• 2D
  • Destructable Tile Blocks

I am relatively new on Godot and working on my first test project. I try this and that. The ones who played New Super Mario Bros of you guys should know that there is a kind of mushroom that makes you big and able to smash through breakable blocks. Making my pixel based character big was easy. But how do I destroy a single tile. Is it possible? Or do I have to use seperate nodes for every block. I mean I don't want to have a Staticbody node named "Wall 545". In GameMaker you could place a single object as much as you want in room. Or is it bad to have thousands of the same node? Thank you in advance.

4 days later

@Blastblood said: I am relatively new on Godot and working on my first test project. I try this and that. The ones who played New Super Mario Bros of you guys should know that there is a kind of mushroom that makes you big and able to smash through breakable blocks. Making my pixel based character big was easy. But how do I destroy a single tile. Is it possible? Or do I have to use seperate nodes for every block. I mean I don't want to have a Staticbody node named "Wall 545". In GameMaker you could place a single object as much as you want in room. Or is it bad to have thousands of the same node? Thank you in advance.

You can't. Use tiles for map and block nodes for destructibles. Block node should have static body, collider, area, script. When player enters area, script destroy block node. Area is from bottom and collider is at top. From top you can walk on blocks and from bottom you can destroy them. Having hundreds or thousand copies of single node is fine. There probably is way how to dynamically remove tile, but this is simpler and individual tiles have limited functionality only to collisions and light occluding, besides ability to begin rendered of course.