How do I define clickable frames for an animation?

Get help using Construct 2

Post » Thu Dec 18, 2014 5:17 pm

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.
B
4
S
1
Posts: 3
Reputation: 258

Post » Thu Dec 18, 2014 6:12 pm

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.
Moderator
B
113
S
41
G
20
Posts: 1,586
Reputation: 19,126

Post » Thu Dec 18, 2014 6:53 pm

Something like this, @pabloclark?

animation-click-example.capx
You do not have the required permissions to view the files attached to this post.
Bruno

I like to eat, but I'm no cook. Why liking to play games would make you a game designer?
B
20
S
6
G
3
Posts: 637
Reputation: 3,776

Post » Thu Dec 18, 2014 7:06 pm

just use 8 and 12 :D
in animation first frame is 0....8=anim.frame 9
B
67
S
24
G
7
Posts: 1,518
Reputation: 11,072

Post » Fri Dec 19, 2014 10:00 pm

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.
B
4
S
1
Posts: 3
Reputation: 258


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 11 guests