Hi,
I've been stuck on this for over a week any help would be soooo welcome!
I have a 'menu page' which shows the levels, only level 1 is unlocked at the start.
When the player wins level 1, I set 'lvl2 unlocked and make the lvl2 button visible' this is perfect as the player can now select level 2.
But because on level 1 I have added "reset global variables" (I have to do this as that level takes turns between the player and computer) it resets the global and if the player plays level 1 again (even if they have completed it) the global gets reset and if they die or use the 'menu page button' the lvl2 button is invisible again.
I've tried sooo many different ways from saving to local variables, really what I need is a way to do this on the menu page:
If lvl2 button visible then permanently change global to 1 from 0, then when the player goes back to lvl and all global are reset, the global that I want is reset to 1, which keeps the lvl2 button visible.
I thought 'set global' would have set it permanently?
Is this possible or is there another way that I'm missing?
Thank you.
If you use "reset global variables" it does exactly that and will reset all of them to their default values. What you can do instead if you rely on these global variables for switching between player and computer turn, is to make a "Sprite controller". Basically this is just a normal sprite that you add to your project, make it something like 16x16 pixel so it doesn't use any resources and you could name it something like "Level controller" so you know what it is.
The only purpose of this sprite is to hold variables. So you simply add whatever you need to it that is related to switching and keeping track of levels. You then turn it into a global object in the "Properties" menu and that way you will have access to it through out all your layouts.
"Reset global variables" doesn't reset these variables.