Returns whether a given position is empty or not.


position_empty(x, y);

Argument Description
x The x position to check.
y The y position to check.

Returns: Boolean


This function will check to see if a given position enters into collision with any instance with a valid collision mask at the given position.


var xx, yy;
xx = random(room_width);
yy = random(room_height);
if position_empty(xx, yy)
   instance_create(xx, yy, obj_Bomb);

This will check a random position somewhere in the room for a collision and if there is none it will create an instance of obj_Bomb.

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