How I made MARIO in Construct V3 Pt.9 (Player Death)

It’s been a while since enemies could attack but it never really did anything to Mario but with our death code he will actually be affected by these collisions/attacks. So lets get started.

First off we need to add some events as always otherwise we have nothing to trigger our actions.

Now This is a massive piece of code but there is no reason to be worried it is quite simple at it’s base. Our events will be system health < or = to 0 and system trigger once. So once those 2 events happen we will subtract 1 from Mario’s lives stop all audio ques then play the SNES Mario world life lost sound. After which we play the death animation. And Just as with our enemies we will set it so that Mario will fall through the floor and then die. So once we set his collisions disabled we will set his platform vector to -600 and his 2 to 200 and also we will make it so that it will ignore our commands and then finally it will subtract 250 from our score.

Now we need to add a command that will apply to Mario when he has 0 or more than 0 lives so we will add a system lives greater than 0 and then the actions. Wait 3.5 seconds set coins to 0 restart layout and add 1 to health.

And then an else meaning if Mario has lives that are not greater than 0 wait 3.5 seconds set health to 1 and go to the game over layout.

with all this code compiled it should look like this.

This is when mario isnt on his last life.
And this is what it looks like when he is

So now that he can die we need to add one more deadly thing that is a part of our map. Which will be our lava pit.

To do this we will simply add this code.

Which will make it so that the moment he makes contact with the lava he instantly dies.

Thats going to be it for this blog post thank you for reading Check out my Yt channel @Drago Gaming link: https://www.youtube.com/channel/UCrlNUqQVBxLIbdltHQBdcYg?view_as=subscriber