Dynamics

Dynamics

Methods


acceleration_from_rotation(rotation, speed)


Calculates, the acceleration based on rotation, and returns a point that contains the acceleration x value and the acceleration y value.

Check out the third party documentation for a more in depth explanation.

Parameters:
Name Type Description
rotation Number

the angle in radians

speed Number

the speed the object will move

Code Equivalent:
game.physics.arcade.accelerationFromRotation(rotation, speed)

get_physics_boolean_field(field)


Returns the chosen Boolean field value of the game's physics.

Check out the third party documentation for a more in depth explanation.

Parameters:
Name Type Description
field

the field to get the value of

Code Equivalent:
game.physics.arcade.field.copyFrom(value);

get_physics_point_field(field)


Returns the chosen point field value of the game's physics.

Check out the third party documentation for a more in depth explanation.

Parameters:
Name Type Description
field

the field to get the value of

Code Equivalent:
game.physics.arcade.field

move_to_object(object, destinationObject, speed, maximumTime)


Moves the first object to the second object at the given speed. Speed will be adjusted to reach the destination object within the given maximum time. If the destination object moves, the target location will not change.

Check out the third party documentation for a more in depth explanation.

Parameters:
Name Type Description
object

object to move

destinationObject

object to move to

speed Number

speed for the object to move at

maximumTime Number

maximum amount of time to take to move

Code Equivalent:
game.physics.arcade.moveToObject(object, destinationObject, speed, maximumTime);

physics_accelerate_to_location(object, x, y, speed, x_max, y_max)


Accelerates the object to the given location at the given speed, with the maximum given velocity. The object will start at the given speed, and accelerate up to the maximum velocity towards the location.

Check out the third party documentation for a more in depth explanation.

Parameters:
Name Type Description
object

object to move

x Number

x position of the location to move to

y Number

y position of the location to move to

speed Number

the speed the object will move at

x_max Number

the maximum velocity in the x direction the object can reach

y_max Number

the maximum velocity in the y direction the object can reach

Code Equivalent:
game.physics.arcade.accelerateToXY(object, x, y, speed, x_max, y_max);

physics_accelerate_to_object(object, target, speed, x_max, y_max)


Accelerates the object to the given object's location at the given speed, with the maximum given velocity. The object will start at the given speed, and accelerate up to the maximum velocity towards the location.

Check out the third party documentation for a more in depth explanation.

Parameters:
Name Type Description
object

object to move

target

the target object to move to

speed Number

the speed the object will move at

x_max Number

the maximum velocity in the x direction the object can reach

y_max Number

the maximum velocity in the y direction the object can reach

Code Equivalent:
game.physics.arcade.accelerateToObject(object, target, speed, x_max, y_max);

physics_accelerate_to_pointer(object, pointer, speed, x_max, y_max)


Accelerates the object to the mouse pointer at the given speed, with the maximum given velocity. The object will start at the given speed, and accelerate up to the maximum velocity towards the location.

Check out the third party documentation for a more in depth explanation.

Parameters:
Name Type Description
object

object to move

pointer

the mouse pointer to move to

speed Number

the speed the object will move at

x_max Number

the maximum velocity in the x direction the object can reach

y_max Number

the maximum velocity in the y direction the object can reach

Code Equivalent:
game.physics.arcade.accelerateToPointer(object, pointer, speed, x_max, y_max);

physics_move_to_location(object, x, y, speed, time)


Move the object to the given location at the given speed, taking no longer than the maximum given time. Speed will be adjusted so the object reaches the location within the given time.

Check out the third party documentation for a more in depth explanation.

Parameters:
Name Type Description
object

object to move

x Number

x position of the location to move to

y Number

y position of the location to move to

speed Number

the speed the object will move at

time Number

maximum time for the object to reach the location

Code Equivalent:
game.physics.arcade.moveToXY(object, x, y, speed, time);

physics_move_to_pointer(object, pointer, speed, time)


Move the object to the mouse pointer at the given speed, taking no longer than the maximum given time. Speed will be adjusted so the object reaches the location within the given time.

Check out the third party documentation for a more in depth explanation.

Parameters:
Name Type Description
object

object to move

pointer

the mouse pointer to move to

speed Number

the speed the object will move at

time Number

maximum time for the object to reach the location

Code Equivalent:
game.physics.arcade.moveToPointer(object, speed, pointer, time);

set_physics_boolean_field(field, value)


Assign the chosen Boolean field for the game's physics.

Check out the third party documentation for a more in depth explanation.

Parameters:
Name Type Description
field

the field to set

value Boolean

value to set the field to

Code Equivalent:
game.physics.arcade.field = value;

set_physics_point_field(field, value)


Assigns the chosen point field for the game's physics.

Check out the third party documentation for a more in depth explanation.

Parameters:
Name Type Description
field

the field to set

value

value to set the field to

Code Equivalent:
game.physics.arcade.field.copyFrom(value);