GM: hspeed
From GMpedia.org Wiki
|
hspeed | |
| Type: | variable |
| Globalism: | Local |
| Editable: | Yes |
- The correct title of this article is hspeed. It appears incorrectly here because of technical restrictions.
The variable hspeed is a local variable that indicates the horizontal component of an object's speed. Together with vspeed, this variable results in the speed of an object.
hspeed holds the horizontal speed of the object. A plus number (as in the example above) means the object is moving right, a minus number (hspeed = - 4) means the object is moving left. This is useful if you want an object with one image that you want to turn left and right (to save filesize), like an enemy on a platform game that moves left & right, you can check the hspeed of the object, if it's less that 0, it's moving left, if it's greater than 0, it's moving right.
[edit] See Also
Content from Game Maker Knowledge Base, was used to expand this article. The content was contributed by nickydude.

