Hearts and Life

After hearts run out, how do you trigger the game to show an alert to restart? Thanks for the help!

Well… you can have a sprite showing 3 hearts. Every time the player hits an enemy you can use (collision-in number 1- + number 0-filter greater than 2- pass: alert- restart level, fail: go to animation (erase a heart every frame)
Try that.

Thanks but there are no enemies. After the player presses the button on the alert before it is destroyed, they lose a heart.
I have a mailbox, attached to the number -1, attached to filters that when passes is sent to the hearts, and fails is sent to the next filter until it equals 0, attached to a pause and alert that is suppose to restart the game when pressed. I’m not sure where my flaw is. Any further help would be great.

Can you post a link?

Make a sprite with 3 hearts like Luminous700 said. Then make an animation, first frame with 1 heart and second frame with 2 hearts.

[Any trigger here (for example mailbox)] --> [(In) Number (-1)] --> [(+) Number (3)] --> [filter (less than 1)]

Two lines from filter output (pass and fail)

(pass)] --> die

(fail)] --> [(go to) animation]

It doesn’t matter if there are no enemies. You just want a health system. And this is it

Nowadays you can use a single animation with each frame showing the amount of hearts. Have the first frame show all the health, while the last one has none. Make everything in between its desired health. Be sure to count the frames at the end.

Once done, create a filter that is set to greater than the amount of frames you had.

Connect that same number that you had before to the go-to and the filter. Then connect the “pass” part of the filter to any consequence the player gets for losing, such as restarting the level, or game.

Thanks for the help. Here is the link that Luminous700 asked for: http://www.flowlab.io/game/play/663769

@jngthree Lol I hope you noticed that Luminous and me said exactly the same

Yeah, that’s why I made a general thanks to everyone in the thread :smile: but Luminous700 asked for the link, that’s why I addressed Luminous700 directly. I appreciate the suggestions Latif3!

I asked for the link so we could take a closer look at it, but seems like it’s all good. :slight_smile:

@latif3 Yeah, we are saying the same things 8)

Oh, last time I looked I thought it read “use multiple animations with filters” and that’s why I gave the other approach


could someone possibly leave a URL explaining how to make a healthbar