Saving Score and Progress Bar

Hi,

I have a game where the user picks a character to play as, then traverses the levels for that character. There are two indicators I keep in each level: health and time left. However, I want to save a character’s score and time remaining between levels without using the “keep between levels” option on the sprite.

A screenshot of the time progress bar behavior, which is currently set to “keep between levels,” is attached here.

I’m having trouble making a health indicator and time progress bar that:

  1. Resets if the level or game restarts
  2. Saves if you move to next level

I appreciate any input! Thanks.

1 Like

To make the keep between levels you could use globals. Connect the health and score numbers each to a seperate global and connect them into the input of “Set”. Then make it so that with a once it is connect to two globals for both Health and Score and connect it to the Input of “Get”.

Btw if you need help with other games it’s suggested you send a link to your game so people have an easier time looking at it.

2 Likes

For the health when 0 or time bar you could make the output to the number connect to a filter which should be set to “Less Than Or Equal To 0” then through the pass output connect it to a game restart behavior or the level behavior and set it to reset current level.

1 Like

Thank you! I’ll give that a go.

And I can’t send a link to the game until it’s published, but I can provide screenshots!

1 Like

Example on the example games page:

That is a great reference! Unfortunately, it doesn’t include saved values for each character.

This is what I have, but it’s not resetting the player’s “energy points” back to 10 on a game restart. The actual saved value is whatever the score was before the level restart.

Everything coming into “energy points” is a number as a result of a collision.

This seems to be close to what I want, but it freezes once you reach 0 or less points. What could be causing that?

Did you know that saves save values throughout levels and restarts?