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.
position_empty(x, y);
Argument | Type | Description |
---|---|---|
x | Real | The x position to check. |
y | Real | The y position to check. |
var xx, yy;
xx = random(room_width);
yy = random(room_height);
if (position_empty(xx, yy))
{
instance_create_layer(xx, yy, "Bullets", 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.