speed (Game Maker)


( Game Maker 6.1, 7 )

speed - an object's speed


speed is an object variable that represents and object's speed. It is used in combination with direction, which determines the object's direction.

The speed of an object is measured in pixels per step.

Setting speed to a negative number will result in the instance moving in the opposite direction as direction.

speed can be modified indirectly by changing hspeed, vspeed or both. It is not believed that "teleporting" by changing x or y effects speed.


Example of Use

The code in this example sets the speed to 1 and the direction so that the instance is moving right.

direction = 0;
speed = 1;

Related Pages




Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution 2.5 License.