GML How to destroy tiles?

Capptianm

Member
In my game, I have an item that creates a platformer under a player. I've decided to create an object that creates and destroys tiles. I have the creation of tiles done with this piece of code in the create event:

Code:
var i = layer_get_id("collision")
tilemap = layer_tilemap_get_id(i)
tile = tilemap_get_at_pixel(tilemap, 1, 1)

tilemap_set_at_pixel(tilemap, tile, x, y)
tilemap_set_at_pixel(tilemap, tile, x + 32, y)
tilemap_set_at_pixel(tilemap, tile, x - 32, y)
I want to destroy the tiles in the destroy event, but I'm not sure how to destroy the tiles, how would I do that?
 

Slyddar

Member
You just set the tile you want to destroy to a value of 0, using any method, e.g. tilemap_set() or tilemap_set_at_pixel()
 
Top