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

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution 2.5 License.