Need to reverse animation

Discussion and feedback on Construct 2

Post » Wed Aug 22, 2012 9:27 pm

I have a player that leans to the left or right based on the arrow keys. There are 9 frames with 4 being the default position when no arrow is down. I would like to animate from left to right or right to left seamlessly without having to use multiple animations.But there is no way to animate in reverse that I've seen.

I've noticed that there is a ping pong behavior for animations, but that's not completely what I'm looking for. Would be nice if I could animation from frame 0-5, 0-9, 5-0 based on need. I think the ability to have frame labels would be nice as well so you don't have to rely on numbers always.

Is there a way to do this currently?

Thanks for considering!
B
14
S
5
G
2
Posts: 20
Reputation: 2,378

Post » Wed Aug 22, 2012 10:40 pm

You could set the animation speed to 0 and animate manually via events.

when the player holds left
+every 0.2 seconds ---> set current frame to: max(currentFrame-1,0)

when the player holds right
+every 0.2 seconds ---> set current frame to: min(currentFrame+1,9)

when the player not holding left or right, add 1 if the current frame is <4 and subtract if the current frame is >4

assuming your animation is somewhat like this: _\|/_

you may need to tweak the "every 0.2 seconds" to speed up or slow down your animation.Fimbul2012-08-22 23:29:27
B
35
S
8
G
8
Posts: 532
Reputation: 6,868

Post » Wed Aug 22, 2012 10:44 pm

Yeah was missing this feature a few weeks back.
Your other option is to duplicate the animation, and reverse the order.
Might put in a request to @Ashley
If its not in his to do list already.
Image Image
B
161
S
48
G
90
Posts: 7,347
Reputation: 66,749


Return to Construct 2 General

Who is online

Users browsing this forum: Mirlas, wrighthill and 19 guests