gravity (Game Maker)
gravity
( Game Maker 6.1 7 )
gravity - the force of gravity on an object
Description
gravity is a variable that controls the effect of gravity on an object. The higher the gravity the more "pull" it has.
Technically, gravity is an accelerator variable because its value is added to vspeed (usually) every step, and thus causing an objects downward movement to be accelerated.
Normally, you will want to set gravity direction to 270, making gravity pull down on an object. This will only effect the object's vspeed. However, this can be changed if you want an odd gravity effect.
Examples
Example of Use
gravity = 0.5;
Related Pages
- gravity - a page about video game gravity in general.
- vspeed - the vertical speed of an object.
- gravity direction - the direction of gravity.
page revision: 15, last edited: 01 Jul 2014 10:51