Gravity can be simulated by setting the y acceleration
of a FlxObject
. You can even use maxVelocity
to set a ‘terminal velocity’.
// object will accelerate downwards by 400 pixels per second
object.acceleration.y = 400;
// object will not accelerate beyond 200 pixels per second
object.maxVelocity.y = 200;