position_empty


描述

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);

参数 描述
x The x position to check.
y The y position to check.


返回:

Boolean(布尔值)


例如:

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.