by Killagram » Sat Nov 29, 2008 8:49 pm
Draw Actor>
- Code: Select all
angle=direction(x, y, player.x, player.y);
animpos=round(angle/(360/nframes));
8 frames = 360/8 = 45 so
- Code: Select all
animpos=round(angle/45);
It won't work with that image though; the order of the frames is wrong.
Animation must start with facing right (0 animpos, 0 degrees) and then rotate counterclockwise.
Here is a fixed version. Have fun!
- Attachments
-
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it."
-Brian W. Kernighan