tile_delete(index);
Argument | Description |
---|---|
index | The index of the tile to delete. |
Returns: N/A
With this function you can remove a tile from the current room.
This is not permanent and if the player leaves the room and returns
to it again, the tile will be recreated again (if it was placed in
the room editor and the room is not persistent).
if mouse_check_button_pressed(mb_left)
{
var tile;
tile = tile_layer_find(-1000, mouse_x,
mouse_y);
if tile_exists(tile) tile_delete(tile);
}
The above code will check for a press of the left mouse button, and then check the mouse position for a tile. If there is one found, that tile is deleted from the room.