Direction

Explanation
This built in variable stores which direction an object is facing. It works like a good compass, it uses degrees, with 0 being to the right, 180 to the left, 360 is the same direction as 0. As you can see, higher number, farther counter-clockwise. This can be used in many ways, for example trying to figure out which way to shoot the bullet.

Example
//bullet create event direction = player.direction; speed = 1; This is for changing the sprite to the right direction. Note that for this to work your sprite that you're using must be facing to the right (0 degrees). Also note that image_angle is a registered only variable. This code would be put in the Step Event: if keyboard_check(vk_right) then {  direction -= 4; } if keyboard_check(vk_left) {  direction += 4; } image_angle = direction; Direction will change by itself, you don't have to set a value. //up press event vspeed -= 1; hspeed = 0; If you now go to the draw event, and draw the direction variable onto the screen, it will change if you press up. Here is a direction diagram. As you see, every 90 degrees is a right angle