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 rotationNumber the angle in radians
speedNumber 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 fieldthe 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 fieldthe 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 objectobject to move
destinationObjectobject to move to
speedNumber speed for the object to move at
maximumTimeNumber 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 objectobject to move
xNumber x position of the location to move to
yNumber y position of the location to move to
speedNumber the speed the object will move at
x_maxNumber the maximum velocity in the x direction the object can reach
y_maxNumber 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 objectobject to move
targetthe target object to move to
speedNumber the speed the object will move at
x_maxNumber the maximum velocity in the x direction the object can reach
y_maxNumber 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 objectobject to move
pointerthe mouse pointer to move to
speedNumber the speed the object will move at
x_maxNumber the maximum velocity in the x direction the object can reach
y_maxNumber 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 objectobject to move
xNumber x position of the location to move to
yNumber y position of the location to move to
speedNumber the speed the object will move at
timeNumber 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 objectobject to move
pointerthe mouse pointer to move to
speedNumber the speed the object will move at
timeNumber 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 fieldthe field to set
valueBoolean 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 fieldthe field to set
valuevalue to set the field to
Code Equivalent:
game.physics.arcade.field.copyFrom(value);