A
atmobeat
Guest
Greetings, I'm working on an old top-down game that used objects instead of tiles for floors and walls, and I want my floors and walls to be tiles for the added speed. The game's spells are supposed to be able to change walls and floors into other walls and floors (e.g. my freeze spell changes a regular floor tile into a frozen tile, and my melt spell changes a wall into a lava floor tile, etc.). I know how to get my spells to detect what kind of tile in the tilemap the spell is interacting with.
Correct me if I'm wrong but it seems that if I draw a tile where a tile used to be, the old tile is replaced and goes away (as long as they're on the same layer, right?). So if I draw my frozen tile where my regular floor tile used to be, then the floor tile will go away, right? I assume it works this way because there doesn't seem to be a delete tile function and I think I saw someone mention this in some other random thread. My problem is that when you use the draw_tile function the tile is drawn on the same layer as the instance executing the draw_tile function. That isn't good for my top-down game as I'm using MirthCastle's layer sorting technique, so if my spell_freeze object draws a frozen tile it will be on the wrong layer, and my characters will be drawn under the frozen floor tile. I can't find a function for changing what layer a tile is on. Does one exist?
If not, I've been able to think of a workaround. The idea is to change the layer that the instance using draw_tile is on using layer_add_instance, then draw the tile from the spell object, and then change the spell's layer back to its original layer. Is there a better way to dynamically change tiles into other tiles and keep them on/move them onto the correct layer?
Correct me if I'm wrong but it seems that if I draw a tile where a tile used to be, the old tile is replaced and goes away (as long as they're on the same layer, right?). So if I draw my frozen tile where my regular floor tile used to be, then the floor tile will go away, right? I assume it works this way because there doesn't seem to be a delete tile function and I think I saw someone mention this in some other random thread. My problem is that when you use the draw_tile function the tile is drawn on the same layer as the instance executing the draw_tile function. That isn't good for my top-down game as I'm using MirthCastle's layer sorting technique, so if my spell_freeze object draws a frozen tile it will be on the wrong layer, and my characters will be drawn under the frozen floor tile. I can't find a function for changing what layer a tile is on. Does one exist?
If not, I've been able to think of a workaround. The idea is to change the layer that the instance using draw_tile is on using layer_add_instance, then draw the tile from the spell object, and then change the spell's layer back to its original layer. Is there a better way to dynamically change tiles into other tiles and keep them on/move them onto the correct layer?