How to restore health in one scene

All my levels change in one scene. After destroying the boss, all timers are reset and the game speed changes. As the next level comes I want to update the player’s health. I change my health by 3 points, but if in the next level if I get damaged, my health is completely gone the first time. but it also needs to go according to 1 point

I’m not entirely sure what you mean but here’s usually how I deal with health stuff:
I have at least two object variables for health. One variable is for full health (HealthFull) and another variable for current health (HealthCurrent).

If the player object were to take damage, the ‘HealthCurrent’ is reduced.
If the player object were to get a heal or restore, ‘HealthCurrent’ is increased, but there is a check event to make sure that it doesn’t increase more than the ‘HealthFull’ variable.
If there is a level up involving health, the ‘HealthFull’ variable gets increased. It may or may not restore the ‘HealthCurrent’ as well. If it does, then the same check is done to make sure it doesn’t go in excess of HealthFull.

So there it is. Hope it helps.

Thank you. I didn’t want to use variables but wanted to use an extension. But apparently I’ll have to use variables

Oh, alright. Well, I’m not sure if there’s an extension for that. But if you find one, sure.
So yeah, good luck on your project!

I only increased health, but did not change the number of stars. Without variables it works like this. And about the extension, I confused it with the behavior

So if I understand this correctly, the max health is set at 3.
If the health of HPTarelka is less than 3,
Set it to the max value. So your player gets full health.
Is that correct?

Yes. You got it right

Alright. Is it working as intended? Or is it supposed to do something else?

Everything seems to be working as intended. After completing the level and destroying the boss, the player’s health is restored. And the player passes the new level with full health. Designed for the duration of the game and not just the passage. The longer the player is in the game, the more profitable it is when displaying advertising.

1 Like

Ahh. Okay. Great, great! For a while I thought it still wasn’t working. lol.
So anyway, it looks like you’ve got this already then. Nice.

1 Like