Apologies if this has been answered. If so, could someone link me to it, thanks?
Is it possible to carry the value of the Health Extension across Scenes?
I have it working fine on a per Scene level but cannot get it to carry across.
I have it displaying Hearts at the top of the screen similar to the Geometry Monster demo.
I’ve had a go at trying to do it similar to the Score but either I’m doing it wrong or I’m missing something.
Am I even pointing in the right direction?
I’ve had a go at using the names from the Health Extension but I’m getting lost.
I’m still new at this, so any help or pointers is greatly appreciated.
Below are my Scene 1,2 & 3 Events and my Enemy Management screens.
Just get rid of the scene score and health variables. Use the global variables and stop copying the values between scene and global variables, is not necessary.
Global variable g_var_player_hp = xxx
Or Storage to a Scene Variable
Suppouse this is level 1
This gs_player_hp is a Scene variable that is not defined in any Scene just make sure that you write to the Storage when you update the player hp, like here
In this event an enemy attack the player so take damage update the value of gs_player_hp and store in game_data
So when player collidion EndLevel
in the new Level 2
Read the Storage and assign the value to gs_player_hp
cool, thanks for that, I’ll have a bash tomorrow.