How do I set animation or animation frame based on angle?

Get help using Construct 2

Post » Tue May 26, 2015 8:37 am

I have a sprite animation of 8 frames. Is there any neat easy way to set the frame number depending on an angle? and what would the best way be to do that?

I guess i could do it manually by adding 8 events. 1 for each of the angle spans, that I want to use, but is there any smarter, or more neat way to do it?

Player.Angle 0-45 > Set animation frame 1.
Player.Angle 45-90 > Set animation frame 2. and so on.

It doesn't look very good in my event sheet.
Follow my progress on Twitter
or in this thread Archer Devlog
B
38
S
15
G
17
Posts: 949
Reputation: 12,320

Post » Tue May 26, 2015 8:59 am

would something like: set frame to round(player.angle/45) work?
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Tue May 26, 2015 9:12 am

LittleStain wrote:would something like: set frame to round(player.angle/45) work?


Ahhh! Makes sense! Thanks!
Follow my progress on Twitter
or in this thread Archer Devlog
B
38
S
15
G
17
Posts: 949
Reputation: 12,320


Return to How do I....?

Who is online

Users browsing this forum: AndreasR and 10 guests