Topic was automatically imported from the old Question2Answer platform.
Asked By
AquilaHeliaca
Old Version
Published before Godot 3 was released.
Hi
I’ve just started learn godot and i trying to make side scroll platformer. I set up yellow tile and i want to replace this tile with green one, when player collide with this tile. How i can do that? Or maybe i should use tilemap only for static, non-interactive elements, and make interactive elements with sprites or something?
The ideal is to use tilemaps for static tiles only, if are used to make tilemaps with some advanced editor like Tiled, then you may also be used to parse the tilemap and spawn game elements replacing special tiles (animated, triggers, etc.).
Using the corresponding nodes for interactive objects will make the level design a lot more flexible and easier to update than depending on tiles.
That said, you can do many things with tiles, working like old times using the tilemap as if it were an array, it has some functions to translate coordinates, getting used cells and many other things for tile-dependant designs.
Also parse the tilemap on runtime to replace tiles with other nodes.