Jhonathan Ibanez's Recent Forum Activity

  • heheheh xD!!. Man thank you, that plugin is exactly what I was looking for :)

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Yeah I mean something like...

    function SpawnByName(name,layer,imgpt){

    var obj = name.type; //I know there is not property that would allow me to //do this but I do know there is a runtime.type_by_index property that I //can use and that there is a certain property type.index that would come //in handy too for this

    var ins = this.runtime.createInstance(obj, layer, this.getImagePoint(imgpt, true), this.getImagePoint(imgpt, false));

    /*

    ...

    ...

    ..

    */

    }

  • Hi everyone.

    As you could guess I am trying to implement an Action that I may use to Spawn an instance of a given type by its name. I am not sure if this kind of action would be a bad practice but if not (or even if is I would like to know if there is a way I can create an instance through its name just our of curiosity) I need to know how could I get the type of a given Object in the runtime.js. Thank you before hand.

  • Hi Hillstrom. That will definitely come in handy :). If you want I can try and create a Manual :). For now what I did, as I mentionated earier, was to implement a B?zier Curve.

    This is my function: 107*((1-EnemyShip.Speed)^2)+2*(1-EnemyShip.Speed)*EnemyShip.Speed*520+(EnemyShip.Speed^2*Sprite3.X)

    It is messy so I do not expect you to understand it nor use it, but if you ttake the time to look closer at it, and you look at this link :http://devmag.org.za/2011/04/05/bzier-curves-a-tutorial/, you will understand how you could implement this kind of movement. BTW, I used set X, Y instead of "move to object" or other behaviours actions. Right now my function is cuadratic and so it is not quite a circular movement, I am working on the cubic version of this functions.

  • Hi GeneratorX. Thank you for answering, You solution seems fairly good, however, would I need to "hardcode" those points?. In the other hand (and because I didn?t want to sound rude with GeneratorX), I managed to create the kingdom rush movement using Bezier curves which turned out to be quite easy to implement, if anybody needs it I could create a tutorial, just let me know.

  • Hillstrom: You can ask whatever you want, I do not mind. I can answer you this from a programming perspective. I do not think that having a sprite with animations that make the illusion of various troops would be a bad practice, nor having separate sprites for every single unit is either. It is less memory expensive to use a single sprite for an entire or part of a troop, of course, but what really matters is the kind of game you want to create. If your game would gain no extra benefit from having every single unit with its own sprite then just don�t do it. For example, if your game is going to implement a "power" that kills a single unit, not matter how much HP or whatever it has, then the single sprite troop approach is not an option, in the other hand if your game is not going to implement such specific mechanics, and maybe you are going to spawn a fixed number of troops (like in Lord of the rings battle for middle earth), then that approach would be correct. Hope it helps.

  • Paradox: Thank you. I took a look at pathfind cost and as you say it might help but at least I was not able to make it work, so I am going to try darklinki�s option, thanks again though.

    Darklinki: I would definitely thank you if you could make an example for me (I had a hunch about pathfinding not being the answer to my problem).

  • Thank you very much for you quick reply. Unfortunately it seems like I cannot figure out how I could use the RTS sample to achieve my goal... I can?t make my troops move along a fixed path, is there a way to make my troops march througn an object. Say I have a road image, I create a sprite object and put the my road image for that object, could I make my troops move through that object?

  • Hi guys.

    My problem is, as the name of the topic suggest, that I would like my troops to move along a fixed path like those of kingdom rush.

    I am aware of the pathfinding behaviour, I have tried plenty of things with this behaviour but with no succes until now. Any help would be appreciated.

  • Hi everybody.

    As I expected, it worked!!. It was pretty simple to solve (silly me...), I do not know if all of you guys who might have read this topic are saying "gosh that is so simple, this guy is just so noob", but if you dont, and in the other hand you have the same problem I had, please tell and I ll create some tutorial or something.

    Anyway, I managed to solve the problem of angle facing with senital frames animations (so my game could have some kind of a senital perspective of course), and without losing the predictive aim features of turret behaviour by dividing the logic of turret behaviour from the sprite animation, in other words, I created a dummy object (sprite object) that will be actually implementing the turret behaviour with no sprite at all (so it looks invisible and I know I can make it visible/unvisible with a property) and another object that will have the actual turret sprite. When you do that, the golem wont rotate (while the actual turret will) and it will look like the golem is shooting to the desired direction but with no funny rotating animation.

    I could add more details but I think that it would be better understood with a tutorial, so please, let me know!. Thank you everybody.

  • I think the solution to my problem is actually pretty simple, Ill try something I just come up with a minutes ago this night, and if it works, I ll let all of you guys know. Wish me luck :P.

  • Well I managed to somehow trick that, and that is not the problem.

    Trick: if this could be called a trick..., what I did was to put another object called AbstractTurret (not the best name, I know) but without a sprite on it so it is "invisible", on top of the actual turret sprite (golem), this is rotating and using the turret behaviour, that way I use the predictive aim feature.

    The problem is that I want the actual golem sprite to "face" the enemy (sprite animation that is only played, frame by frame, if the enemy is on range) according to the angle formed between the two of them (golem and enemy).

    Note: I do not know yet if my "trick" I the worst practice ever!, but it works, I looks like the golem is actually shooting, looks nice, and logically filled my needs. If this approach is not criticized may be I ll create a manual (do not know if this is worth it, but could come in handy for some guys as lazy as me :P and who do not want to write some code even if programmers like myself xD)

    Again, I apologize for my english :S :P.

Jhonathan Ibanez's avatar

Jhonathan Ibanez

Member since 4 Jul, 2013

None one is following Jhonathan Ibanez yet!

Connect with Jhonathan Ibanez

Trophy Case

  • 11-Year Club
  • Email Verified

Progress

12/44
How to earn trophies