How do I define clickable frames for an animation?

0 favourites
  • 5 posts
From the Asset Store
three fully animated characters ideal for your RPG side scroller projects
  • I have an enemy, animation consists of 15 frames, but i need it to be clickable only between frames 9 and 13.

    Any idea how can I achieve this?

    I tried breaking it into 3 different sprites, but has proven to be much more complicated, and getting them to load one after the other seems like much more trouble. Here, the idea was to have the initial animation run, when finished start animation 2 (which is the clickable one), and when that is finished, start animation 3. If the object is clicked during animation 2, then spawns another object.

  • I'd suggest using the "Is between values" condition from the system object in your click event. Set "Value" to your enemies current animation frame -- accessed(generically) by Sprite.AnimationFrame -- "Lower bound" to 9, and "Upper bound" to 13. You can also check which animation is playing in the same event if necessary.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Something like this, pabloclark?

    [attachment=0:12hxk5nl][/attachment:12hxk5nl]

  • just use 8 and 12

    in animation first frame is 0....8=anim.frame 9

  • Guys! I did it!

    I hadn´t seen this post, but it was pretty much what korbaach said, assigning boolean to false, first, conditioning selected frames to true, else false, easy as pie.

    Before that, I tried breaking the animation into 3 different sprites, it worked but it was not as clean.

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