Menu

Get help using Construct 2

Post » Sun Feb 17, 2013 6:30 am

I have a menu that uses up & down arrows to change the animation frame. My current line of code is:

On Down Arrow >
Set animation frame to "(Sprite.AnimationFrame+1) %Sprite.AnimationFrameCount

This works perfectly, but with my up arrow event (same event as down, only -1), when the animation is at frame 0, how do I make it loop back to the last frame?

I've tried a sub-event of "If Sprite.Animation frame = 0", but then it actually SKIPS 0 and goes straight to the final frame.

Any help would be greatly appreciated.

Thanks,
Steve
B
22
S
3
Posts: 451
Reputation: 2,135

Post » Sun Feb 17, 2013 9:37 am

You were on the right track with the sub event :D

here have a look: https://dl.dropbox.com/u/45711709/menuKey.capx
B
33
S
6
G
7
Posts: 338
Reputation: 7,424

Post » Sun Feb 17, 2013 10:53 am

This is actually quite an eye opener - now I have to go back and check all my coding where I did weird stuff in order to make it work!

Thanks so much for this!
B
22
S
3
Posts: 451
Reputation: 2,135


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 21 guests