• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

[Solved] Image-Angle affecting direction in Space Rocks tutorial

J

Jeffrey-Smith

Guest
I'm currently going through the space rocks tutorial and am creating the asteroid's behaviour.
The tutorial tells you to change the object's image_angle each step to create a rotating effect, so that it
doesn't affect the asteroid's actual direction value.

When testing this behaviour, the asteroids started to change their direction as well as the image_angle.


I copied the code from the finished project, where this problem doesn't occur, and pasted into my version and i still get the same behavior.
Why is the direction of my asteroid get changed when I'm changing its image_angle?

creation code:
sprite_index = choose(spr_asteroidSmall, spr_asteroidMedium, spr_asteroidLarge);
direction = irandom_range(0, 359);
image_angle = irandom_range(0, 359);
speed = 1;

Step event:
move_wrap(true, true, sprite_width / 2);
image_angle = image_angle + 1;

 
Top