GravityGenerator Class
This generator applies a force to the entity that gives it the specified acceleration.
Constructor
GravityGenerator
(
-
gravityX
-
gravityY
Parameters:
-
gravityX
NumberThe x component of the acceleration vector.
-
gravityY
NumberThe y component of the acceleration vector.
Item Index
Methods
applyForce
(
-
entity
Parameters:
-
entity
EntityThe entity this force should be applied to. It's required that the entity has the Movable component.
getGravityVector
(
-
vector
Retrieves the gravity acceleration vector.
Parameters:
-
vector
Vector2DThe vector to which the gravity vector will be copied.
setGravityVector
(
-
gravityX
-
gravityY
Sets new values for the gravity acceleration vector.
Parameters:
-
gravityX
NumberThe x component of the new acceleration vector.
-
gravityY
NumberThe y component of the new acceleration vector.