Dogwithswords
Member
Right now I am in the middle of converting all legacy codes from the 8.1 build of my game to GMS:2. Thus far I've succeeded in a few tile-based scripts. But one thing that still eludes me is how specific tiles can be deleted for the sake of preserving memory.
Before, my code looked like this:
One thing I am confused about is what the correct syntax is to accomplish just this. So far I see layer_tile_destroy but the issue is I do not know what it means when it needs a tile_element_id or if this would even work.
My tile generator creates the background tiles procedurally, scrolls downward, and deletes as soon as it goes offscreen along the y-axis. I'm trying to do the same thing with GMS:2 but I'm at a roadblock.
I am hoping someone more experienced can point me in the right direction. Any pertinent response would be greatly appreciated as always! ^_^
Before, my code looked like this:
Code:
tile_layer_delete_at(1000, tileUnitWidth * i, room_height * (1.5) + tileUnitHeight);
My tile generator creates the background tiles procedurally, scrolls downward, and deletes as soon as it goes offscreen along the y-axis. I'm trying to do the same thing with GMS:2 but I'm at a roadblock.
I am hoping someone more experienced can point me in the right direction. Any pertinent response would be greatly appreciated as always! ^_^