vspeed


Description

vspeed is one of the "built in" properties that all instances have and defines the vertical movement speed (along the y-axis) of the instance in pixels per step. So, a vspeed of 3 means 3 pixels of movement to the bottom (+y) every step, and a vspeed of -3 would mean 3 pixels of movement to the top (-y) every step.


Syntax:

vspeed;


Returns:

Real (single precision floating point value)


Example:

if keyboard_check(vk_up) vspeed = -5;
if keyboard_check(vk_down) vspeed = 5;

The above code will change the vertical speed depending on which keys are pressed.