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
38
S
12
G
1
Posts: 526
Reputation: 4,085

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: 339
Reputation: 7,426

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
38
S
12
G
1
Posts: 526
Reputation: 4,085


Return to How do I....?

Who is online

Users browsing this forum: mikehive, Ninjadoodle, plinkie, Yahoo [Bot] and 7 guests