The Collision event will trigger when the caller collides with the given object's instance.

  • Both object's sprites need a collision mask defined.
  • Without physics: the room must not be a Physics World, both objects can be solid or not.
  • With physics: the room must be a Physics World, also both object need separate physics Collision Shapes (when using physics, sprite masks are unused).

Collision functions check a point/rectangle for an existing object.

  • place_empty(x_coord,y_coord) - true if the caller would not collide with any instance
  • place_free(x_coord,y_coord) - true if the caller would not collide with any solid instance
  • collision_point - check a point for a specific object's instance
    • x_coord/y_coord: point to check, object: the object whose instance is searched, precise: true/false, notme: exclude the calling instance? (true/false)
    • returns the <instance-id> or noone.
    • not much use if you don't catch the result inside a variable or statement:
collision_result = collision_point(x_coord,y_coord,object,precise,notme);