position_destroy

Destroys all instances that collide with a given position.

Syntax:

position_destroy(x, y);


Argument Description
x The x coordinate of where to destroy colliding instances.
y The y coordinate of where to destroy colliding instances.


Returns: N/A


Description

This function simply destroys all instances that are found to be in collision with the specified position. Collisions are based on the mask of the instances, and if any part of the mask over-laps with the target point it then the function will destroy that instance.


Example:

if mouse_check_button_pressed(mb_left)
   {
   position_destroy(mouse_x, mouse_y);
   }

This will destroy all instances that collide with the position of the mouse cursor when the left mouse button is pressed.


Back: Collision Checking
Next: collision_circle
© Copyright YoYo Games Ltd. 2018 All Rights Reserved