I couldn’t find many guides about this, so I decided to make a guide. This is my first guide, so I hope it’s good!
So you want a game where you get a certain amount of lives and when you die you lose one and respawn. Here’s how you do it.
Also, you might want a One-up like from the Super Mario Bros. series. For those who don’t know, a 1-up is an object that gives you an extra life. For example, say you had 2 lives, and you grabbed a 1-up. Now you have 3 lives. I’ll show you how to make one after the multi-life system part of the guide.
Materials for multi-life system
1 lifecycle device
1 counter device
1 end game device/ 1 team switcher device (Decide whether running out of lives ends the game or stops the KO’d player from playing)
Device settings for multi-life system
-
The lifecycle’s event should be set to “player knocked out”
-
The counter’s starting value should be the amount of lives you want. The counter’s scope should be set on “Player,” unless you want everybody to share lives. The counter’s target number should be 0.
-
The team switcher’s switch strategy should be “certain team,” and that team should be spectators.
Steps for multi-life system
Now that that’s done, we can start wiring.
Wire the lifecycle to the counter with the settings (Event occurs–decrement counter)
Wire the counter to the end game or the team switcher (The required settings are the only options)
This should be what the finished product looks like
And you’re done! The game will end once you die a certain amount of times.
Edit: with the help of @Xa67 's (for some reason deleted) post and some guides I searched up about blocks, I figured out how to make your lives show!
Materials for life amount shown
1 overlay device
1 property device
1 lifecycle device
The following are materials that were used in the previous part that you should not duplicate:
The lifecycle
The counter
Settings for life amount shown
The overlay should have both scopes on “player,” unless everyone is sharing lives.
The property should be named. I chose Lifeshow for my property name. It should be a number property with the default value of 3. The scope should be on player unless everyone shares lives.
The new lifecycle should broadcast on a channel, which I named Gamestart.
Previous material setting changes:
The counter should have the “update property” setting on yes. The property it should update is the property you made for this.
The old lifecycle should broadcast on a channel. I named its channel Dead.
Steps for life amount shown
Go to the overlay’s block settings. Make a block that triggers when activated by the new lifecycle’s channel, Gamestart.
Code the blocks like this:
Then make another block for the channel Dead with the exact same code.
Now it should show. This coding currently doesn’t show how to include the 1-up in the life show. I’ll tell you how to do that after the 1-up section of the guide.
Now for the 1-up section.
Disclaimer: the way my 1-up works is for my life system. If you already have one, you could either adjust the 1-up to fit, or you could adjust your life system.
Once again, for those who don’t know, a 1-up is an object that gives you an extra life. For example, say you had 2 lives and you grabbed a 1-up. Now you have 3 lives.
Materials for the 1-up
1 zone device
1 item image device
1 wire repeater device
The counter from the previous guide, do not make a new one.
Device settings for the 1-up
-
The zone should be a circle, and it should be shrunk all the way.
-
The item image should be what you want to represent the 1-up, I chose a gimberry. You don’t have to make it a gimberry, it’s just what I chose. Make sure its scope is global because you can’t change the zone scope and the zone’s scope is global.
-
You don’t need to change the wire repeater settings
Steps for the 1-up
Now it’s time to start wiring. Wire the zone to the item image with the settings (Player enters zone–hide item image)
Now put the zone on top of the item image.
![Screenshot 2024-03-20 2.42.10 PM](https://forum.creative.gimkit.com/uploads/default/original/3X/f/2/f2d58bfbd95dea7585e7b102840d6c056b6d5adf.png)
Wire the zone to the wire repeater with the settings (Player enters zone–repeat wire pulse)
Wire the wire repeater to the zone with the settings (Wire repeater receives a pulse–deactivate zone)
It should look like this:
Finally, wire the zone to the counter with the settings (Player enters zone–increment counter)
And you’re done! This is what the finished 1-up should look like:
And this is what the finished 1-up + multi-life system should look like:
Now to include the 1-up counting up on the overlay. This step is so short, I might as well put all the information here:
Updating the overlay when 1-up is grabbed
The zone should broadcast on a channel when it is entered. I named the channel One-up.
In the overlay, add one more block for that same channel.
And repeat that same code from earlier one last time.
That’s the end!
Please like the guide and tell me if I made a mistake or wasn’t very clear on something. Thank you!