Is it possible to make a live system? So what I’m trying to do is when Mario dies, he loses a life, but how to I make a life system when the level restarts?
A link to the game would help, but it seems like you would want to make a Global variable to count lives, and everytime the player dies and restarts subtract one from the life counter
when the counter equals zero, restart the entire game
You can do this in the 1-Up object to increase lives when you collect it
But since you have 3 marios I don’t really know where to go from here other than repeating the exact same code in multiple objects
Okay but what object’s behaviours were you in? @nhgcr_for_the_3rd_time
The 1-Up object
So when I die, the life counter doesn’t go down, may I ask what the code is for losing 1 life? @nhgcr_for_the_3rd_time
In either the the Mario objects or a separate object (I would probably do the latter) and when the player does their death animation, send a message that will remove 1 life from the counter
First add this to the end of the death animation
Okay I did that what next?
Whenever the game restarts he still has his three lives for some reason @nhgcr_for_the_3rd_time
That’s probably because of the once behaviour, gimme a sec
After the filter to check whether the lives are above 0, If it fails send a message to the 1-Up object
then replace the Once in the 1-Up code with a Mailbox to receive the message
May I ask how long is the timer? @nhgcr_for_the_3rd_time
It’s all the default settings
Also I would recommend making a separate object to put the lives code into instead of putting it into the music block
Okay so I did that, but for some reason the label starts at zero and not three @nhgcr_for_the_3rd_time
Where did all your death code go?
(In the mario object)
Its in a bundle, called death for mario ig. @nhgcr_for_the_3rd_time