29
« on: May 19, 2017, 01:56:08 pm »
I've done my own version of a destructable tile.
What I did what make a breakable block actor. Pretty straight forward stuff. But when this block is placed underneath level tiles, it hides until it is hit, then it removes the tiles above it and shows itself.
A caveat is the physics. Tiles can be set to have a hitbox, but if the tile changes, the physics stay the same, creating invisible walls. I solved the wonky physics by making all tiles non solid, then on a separate 'physics tile' layer, I place these orange debug tiles I made that have physics shapes. That way, as I so choose, anything can be solid or not, and I can layer up my graphics, and destroyable terrain, without too much worry.
If you know anything about the Super Metroid editor and hacking, Nintendo used a similar 'behind the scenes' system to control tile destruction and passability. Of course, Stencyl is a far more sophisticated engine with far more capabilities. This is just one solution.