Hundreds of features to explore
Games made in Construct
Your questions answered
Trusted by schools and universities worldwide
Free education resources to use in the classroom
Students do not need accounts with us
What we believe
We are in this together
World class complete documentation
Official and community submitted guides
Learn and share with other game developers
Upload and play games from the Construct community
Game development stories & opinions
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.
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.
Develop games in your browser. Powerful, performant & highly capable.
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...