Login | Register

Animation and rotation

November 8, 2006, 13:30 by Calle
[loading]
-->
If you for an example have a car in overview, and that car already has an animation, how would you do to make even another animation to make it rotate? Make 36 sprites? No, but in earlier version you had to. The commonly used method to make things rotate was to have a rotating sprite, using 36 sub-images and defining the sub-image like this:

image_single = direction/10;

But using that method you cannot have yet another animation unless you want to go advanced and also have really many sub-images. With the new image_angle you can;

<b>The solution:</b>
image_angle = direction;

I made the solution bold, because I think the solution is what most of you are looking for and you don't care for all my meaningless text.

<b>Note:</b>
Maybe you will have to put a - or a + after direction. It depends on what angle your sprite is drawn in. Like +90 or -45 ...

Comments

Loading comments... [loading]
.
Users logged in:

game maker articles, game maker examples, game maker tutorials, gmtutorials, game maker questions and answers, game maker crash course, how to create games