|
vspeed |
|
Drag & Drop equivalent:
Reverse hspeed - D&D equivalent:
Example:
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.
You can also use vspeed to reverse an objects vertical motion. For example, putting the following code inside an enemies collision with something:
Revision #3 |