MakubeX's Forum Posts

  • Blacksmith, I've almost got it, but there's some behavior I don't understand. Maybe Ashley can help here.

    Ashley could you answer the following about the capx I linked below:

    1. Why some sprites start moving again out of order of they're suppose to be sorted in the Foreach?

    2. Why do they flip right after spawning (sprite font pinned flips to the bottom)?

    3. Why do some sprites keep creeping up a little bit after they are supposed to have stopped?

    PS. Press W to stop/start the sprites.

    capx Link

  • You're right, if the sprites are all instances of the same object then it's trickier to use distance. You would probably need to identify them using instance variables or something like that.

    I'll play around with your capx and see how I can help out.

  • Could you clarify what the problem is? I'm not sure I understand what you're asking.

  • Instead of using stop sprites I would measure the distance between one sprite and the other in the direction they're moving. If a certain distance is reached then stop moving, else wait a second and keep moving.

  • ... I tried several ways, but none of them worked.

    Could you specify what ways have you tried? It shouldn't be hard using 'on animation finished'.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Came in here for the same reason. Good to know it has been noted.

  • Does the following entity need to have the Platform behavior?

  • Great job! Thanks.

  • rexrainbow

    Funny, I was already looking at that after finding it in an older post.

    Edit: Ok, I see what you pointed out. I have to get an instance of the Physics behavior.

    Thanks for the info, I'll report back with my results.

    Edit 2: Everything worked perfectly. Thanks again!

  • rexrainbow

    I tried calling the Physics behavior action ApplyImpulseAtAgnle from within one of the actions in my plugin but it throws and error when the function ApplyImpulseAtAgnle() tries to call the function getInstImgPointX().

    Error says: 'this.getInstImgPointX is not a function'

    So it looks like problem is 'this' is referencing my plugin. Is there a way around this?

    Thanks!

  • Thanks Rex, I'll try that.

  • I'm looking for a way to apply the same set actions to any Sprite object type.

    More specifically, I have different types of Sprites to which I apply the same Physics actions (from the Physic behavior) to each object except with different angles. Now I know I can create a family but then I wouldn't be able to set different angles (would I?).

    So I thought maybe I could create a function in the Event sheet and set a custom condition that picks the Sprite and then have access to the Actions available to the picked instance without duplicating them in my plugin. This way I can call this function in the Event sheet for each of the Sprite types to apply the actions.

    Is it possible to inherit actions like that?

    Thanks.

  • Just want to clarify for anyone else reading this:

    cr.plugins_.Sprite.Instance is not defined, I think Ashley meant cr.plugins_.Sprite.prototype.Instance

  • Awesome, thanks!

  • Well, I don't really needed as this is for practice, but I was thinking of what if there was a scenario where I loop through the objects and check if the object is a Sprite and if so then apply some actions to it.

    Also if I have a function that takes a UID and I want to check what plugin the instance with that UID belongs to.