GM: vspeed

From GMpedia.org Wiki

Jump to: navigation, search

vspeed

Type: variable
Globalism: Local
Editable: Yes
The correct title of this article is vspeed. It appears incorrectly here because of technical restrictions.

The variable vspeed is a local variable that indicates the vertical component of an object's speed. Together with hspeed, this variable results in the speed of an object.

vspeed holds the vertical speed of the object. A plus number (as in the example above) means the object is moving down, a minus number (vspeed = - 4) means the object is moving up. This is useful if you want an object with one image that you want to face up and down (to save filesize), like an enemy spaceship in a top-down shooter, you can check the vspeed of the object, if it's less that 0, it's moving up, if it's greater than 0, it's moving down.

[edit] See Also

Content from Game Maker Knowledge Base, was used to expand this article. The content was contributed by nickydude.
Personal tools