Hey! I've been trying to make my character's initial value, his health, stay the same after each layout change. Since at each layout change it creates a new sprite of my character, his health keeps getting back to what it was at the beginning and I don't know how to get it to work.
Develop games in your browser. Powerful, performant & highly capable.
You can just put a global variable in an event sheet. Before you change layouts, set the variable to your character's health. When the new layout starts, set the player's health to the variable's value.
But what's the global's initial value and am I suppose to name it something in particular?
global variable HP=100
(It changes during gameplay)
but you don't do anything it's global and it stays the same if you don't put different value on start of layout.
When you leave the game save the HP in local storage if needs be.
The name can be anything that makes sense, and the initial value should be whatever you want the character's health to be at the start of the game.
Man, I need to start using local storage for things...