此函数将检查给定位置是否与给定位置处具有有效碰撞遮罩的任何实例发生碰撞。
position_empty(x, y);
参数 | 类型 | 描述 |
---|---|---|
x | Real | 要检查的x位置。 |
y | Real | 要检查的y位置。 |
var xx, yy;
xx = random(room_width);
yy = random(room_height);
if (position_empty(xx, yy))
{
instance_create_layer(xx, yy, "Bullets", obj_Bomb);
}
这将检查房间中某处的随机位置是否存在碰撞,如果没有碰撞,则将创建obj_Bomb实例。