Methods
-
Blockly.JavaScript['collide_with_arrow_function'](block)
-
Parameters:
Name Type Description blockCode Equivalent:
undefined -
Blockly.JavaScript['collide_with_world_bounds'](block)
-
Parameters:
Name Type Description blockCode Equivalent:
undefined -
Blockly.JavaScript['is_body_touching'](block)
-
Parameters:
Name Type Description blockCode Equivalent:
undefined -
check_collision(direction, collide)
-
Enables/disables objects with physics enabled to collide with the world in the given direction.
Check out the third party documentation for a more in depth explanation.Parameters:
Name Type Description directiondirection to set the property for
collideBoolean sets collision in the direction to true or false
Code Equivalent:
game.physics.arcade.checkCollision.direction = collide; -
check_overlap_procedure_field(object1, object2, functionName)
-
Checks if two objects overlap, and calls the function if they are. No physics is applied.
Check out the third party documentation for a more in depth explanation.Parameters:
Name Type Description object1first object to check
object2second object to check
functionNamefunction to call if the objects are overlapping
Code Equivalent:
game.physics.arcade.overlap(object1, object2, functionName, null, this); -
collide(object1, object2)
-
Checks if two objects are colliding, and separates them if they are.
Check out the third party documentation for a more in depth explanation.Parameters:
Name Type Description object1first object to check
object2second object to check
Code Equivalent:
game.physics.arcade.collide(object1, object2); -
collide_boolean(object1, object2)
-
Checks if two objects are colliding, separates them if they are, and returns true/false.
Check out the third party documentation for a more in depth explanation.Parameters:
Name Type Description object1first object to check
object2second object to check
Code Equivalent:
game.physics.arcade.collide(object1, object2) -
collide_function_field(object1, object2, functionName)
-
Checks if two objects are colliding, separates them if they are, and calls the function.
Check out the third party documentation for a more in depth explanation.Parameters:
Name Type Description object1first object to check
object2second object to check
functionNamefunction to call if the objects are colliding
Code Equivalent:
game.physics.arcade.collide(object1, object2, functionName); -
collide_with_world_bounds(object, collide)
-
Enables/disables collision between an object and the bounds of the world.
Check out the third party documentation for a more in depth explanation.Parameters:
Name Type Description objectobject to set collision for
collideBoolean enables/disables the collision
Code Equivalent:
object.body.collideWorldBounds = collide; -
collision_get_objects_at_location_function(group, x, y, functionName)
-
Returns a list of objects from the group that are at the x/y location, calling the given function on the ones that are there.
Check out the third party documentation for a more in depth explanation.Parameters:
Name Type Description groupgroup to check
xNumber x location to check
yNumber y location to check
functionNamefunction to call
Code Equivalent:
game.physics.arcade.getObjectsAtLocation(x, y, group, functionName); -
get_objects_at_location(group, x, y)
-
Returns a list of objects from the group that are at the x/y location.
Check out the third party documentation for a more in depth explanation.Parameters:
Name Type Description groupgroup to check
xNumber x location to check
yNumber y location to check
Code Equivalent:
game.physics.arcade.getObjectsAtLocation(x, y, group) -
get_objects_under_pointer(pointer, group)
-
Returns a list of objects from the given group that are currently underneath the mouse pointer.
Check out the third party documentation for a more in depth explanation.Parameters:
Name Type Description pointermouse pointer to check
groupgroup to check
Code Equivalent:
game.physics.arcade.getObjectsUnderPointer(pointer, group) -
is_body_touching(object, direction)
-
Returns true if something is touching the object in the specified direction.
Check out the third party documentation for a more in depth explanation.Parameters:
Name Type Description objectobject to check
directiondirection to check
Code Equivalent:
object.body.touching.direction -
overlap_boolean(object1, object2)
-
Returns true/false if two objects are overlapping.
Check out the third party documentation for a more in depth explanation.Parameters:
Name Type Description object1first object to check
object2second object to check
Code Equivalent:
game.physics.arcade.overlap(object1, object2) -
physics_intersects(lhs, rhs)
-
Returns a Boolean if the two objects are intersecting. Checks for intersection of the object's bodies.
Check out the third party documentation for a more in depth explanation.Parameters:
Name Type Description lhsobject to check
rhsobject to check
Code Equivalent:
game.physics.arcade.intersects(lhs, rhs)