Seperate health and life labels

I’ve created a game with a few levels. Each type of enemy in a level, reduces health by 1. I would like for it to restart the current level when health reaches 0. Ok that by itself works. But I would also like for it to subtract one from the lives when health reaches 0, and then when lives reach 0, It restarts the game.

I can get one or the other to work but not both. I do this by toggling the Reset drop-down on the character to either “Reset on level start” or “keep on level restart”. I am using a global block for the lives.

health 0 restarts level and subtracts 1 from lives.
lives 0 restarts game and resets everything.

Edit: I just realized that I had it sort of working on level with a different character that has it’s own behaviors but the label wasn’t updating. Previously I had copied the behaviors between the two different characters. So I’ve been fiddling around with the behaviors on level 1 character so long now to get the label to update that I forgot I had the actual logic working before.
Now I just have to go figure out what’s different between the two. But I will leave this post up in case it helps somebody else, and so that I can read the answers as well and in case I don’t figure it out on my own for some reason.

don’t use globals, instead use the “save number” block in game flow. It’s like a hard drive - saves data between sessions. No other data gets saved between levels. It also stays saved if you close and reopen flowlab.

If you want the player to start at 3 lives again when they close and open the game, have the lives set to 3 when the player hits “play” on the main menu screen.


Play and main menu? I just hit escape from the editing screen and it goes right into the game. No menu’s or play buttons to hit. And if there is one when I eventually share the game, how do I build logic that only triggers when the button is hit? Oh are you saying I should make a play button or main menu button at the beginning of my game? I’m not sure I know how to do that. How would I keep the arrow keys from moving my character until a button was pressed? I might could think on that one and figure it out. Or maybe level 1 is just a menu that leads to level 2 which from the user stand point appears as level 1.

Ah, I figured your game had a main menu lol, definitely make one asap. It doesn’t need to have the control buttons or anything, just a simple title and a “play” button. You can touch it up later. You can make a main menu by making a completely seperate level and having it at the top of the levels list.

MouseClick is also a trigger which functions like finger. “down” means the finger hit the screen, “up” means it left the screen, and “over” and “out” should be self explanatory. You can use MouseClick to make a start button :slight_smile: