Returns the current [X / Y] speed for the actor.
[ACTOR].getXVelocity()
[ACTOR].getYVelocity()
Sets the [X / Y] speed for the actor.
[ACTOR].setXVelocity([NUMBER]);
[ACTOR].setYVelocity([NUMBER]);
Sets the actor's velocity, given a direction and a magnitude (speed) rather than X/Y components like above.
[ACTOR].setVelocity([NUMBER], [NUMBER]);
Pushes (or shoves) an actor, given an X/Y direction and force. Shoving is more "forceful" than pushing - experiment and see which works better for you.
[ACTOR].push([NUMBER], [NUMBER], [NUMBER]);
[ACTOR].applyImpulse([NUMBER], [NUMBER], [NUMBER]);
Pushes (or shoves) an actor, given an angle and force. Shoving is more "forceful" than pushing - experiment and see which works better for you.
[ACTOR].pushInDirection([NUMBER], [NUMBER]);
[ACTOR].applyImpulseInDirection([NUMBER], [NUMBER]);
Twists (applies torque) to an actor, given a force.
[ACTOR].applyTorque(Utils.RAD * [NUMBER]);
Returns the turning speed (angular velocity) of the actor (in degrees).
Utils.DEG * ([ACTOR].getAngularVelocity())
Sets the turning speed (angular velocity) of the actor (in degrees). Positive turns clockwise. Negative turns counter-clockwise.
[ACTOR].setAngularVelocity(Utils.RAD * [NUMBER]);
Enables or disables gravity for this actor.
[ACTOR].setIgnoreGravity(false); //enable gravity
[ACTOR].setIgnoreGravity(true); //disable gravity
Enables or disableds rotation for this actor.
[ACTOR].enableRotation();
[ACTOR].disableRotation();
Sets the actor's friction and bounciness settings. Provide a value between [0.0 - 1.0] inclusive.
Read our Physics guide for an explanation of what these fields mean.
[ACTOR].setFriction([NUMBER]);
[ACTOR].setBounciness([NUMBER]);
[ACTOR].setMass([NUMBER]);
[ACTOR].setAngularMass([NUMBER]);
[ACTOR].setLinearDamping([NUMBER]);
[ACTOR].setAngularDamping([NUMBER]);
Gets the actor's friction and bounciness settings. Read our Physics guide for an explanation of what these fields mean.
[ACTOR].getFriction()
[ACTOR].getBounciness()
[ACTOR].getMass()
[ACTOR].getAngularMass()
[ACTOR].getLinearDamping()
[ACTOR].getAngularDamping()