Iterating through animation

0 favourites
  • 8 posts
From the Asset Store
4 Block Soldiers with different animations, 400x400
  • Is it possible for C2 to implement some sort of animation iterator?

  • Do you need to iterate through different animations, or do you need to iterate through different frames to achieve a single animation?

    If the latter, the sprite object already has that functionality with a number of options available -- take a look in the animation editor -- and perhaps the accompanying manual entry. If the former, could you be more specific about what you're actually trying to achieve?

  • Iterate through different animations of course.

  • Alright, why do you want to iterate through different animations, and do you just need to repeat through them in order or do you need some variation in the order?

    Is there a reason you can't combine the frames from each individual animation into a single larger animation?

    If that's not suitable you could probably implement some logic using the "On any finished" condition and the "Set animation" action of the sprite plugin. Off the top of my head I might try implementing a queue of animation names using the array plug-in; pop the next animation name from the front of the queue and push the previous one on to the back of the array each time the condition is triggered.

    Does that help at all? <img src="smileys/smiley1.gif" border="0" align="middle">

  • I'm trying to find out how many animations does a sprite have. Based on the count, it will exhibit different behavior.

  • You could add an instance variable with the count of animations. You would have to manually update it... but then you have to manually add the animations anyway, so it's only a small amount of work.

  • The thing is I would like to dynamically check within a family of objects based on the number of animations they have, the behaviours would be different. And I am not working alone for my project which is why when people start adding more stuff into the family, some behaviours might break. That is why I would like some sort of animation iterator.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • And it would be best if I could get the animation names as well from the iterator.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)