Page 1 of 1

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

PostPosted: Tue May 26, 2015 8:37 am
by tunepunk
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.

Re: How do I set animation or animation frame based on angle

PostPosted: Tue May 26, 2015 8:59 am
by LittleStain
would something like: set frame to round(player.angle/45) work?

Re: How do I set animation or animation frame based on angle

PostPosted: Tue May 26, 2015 9:12 am
by tunepunk
LittleStain wrote:would something like: set frame to round(player.angle/45) work?


Ahhh! Makes sense! Thanks!