position_destroy


描述

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. Instances destroyed in this way will trigger their Destroy and Clean Up events.


语法:

position_destroy(x, y);

参数 描述
x The x coordinate of where to destroy colliding instances.
y The y coordinate of where to destroy colliding instances.


Returns:

N/A(无返回值)


例如:

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.