Making a destructible tile for a bossfight

So I made a boss fight with a tile that acts as a barrier

Though this makes for a very boring bossfight, so I’m trying to make it so whenever the boss collides with the barrier, it will begin to break, switching between different phases of brokenness before completely being destroyed. My only issue is that the only block that I can find that is similar to what I need is an overlap block, which doesn’t work as the boss isn’t technically overlapping the block.

1 Like

To do this, make it so that if the boss touches the barrier, it replaces the tile. Here’s an example:
image
You see, in this function, every time an enemy hits Mario when he has 0 velocity, Super Mario gets destroyed and replaced by small mario. You can also do this:
image
Which lets you create the barrier as a sprite, therefore, letting it be destroyed, and using the “set sprite position to sprite x y sprite y” thing. This might be complicated though. :sweat_smile:

1 Like

Something like this?

1 Like

Exactly what I needed! My only issue is that this code makes it so there is no waiting time in between phases so it instantly goes from completely fine to fully broken. I have tried to add a timer system but all it does is slow the process (I mean as soon as it gets touched it starts to break, and even when the boss stops touching it it will keep going through the phases and eventually break when nothing was touching it) instead of it stopping at the phase it’s currently at whenever the boss stops touching it and wait for it to be touched again.

1 Like