I am not sure if it is the good title but I will try to describe what I am trying to do.
Basically I am doing an endless runner game. What I am looking, is to give choice to player to continue the game once he losts one time and continue to collect coins.
So what I did
- Create a layer called continue
- this layer contain the window with buttons (watch a video to continue or pay 100 coins to continue); this layer initial value is invisible
- create a global variable called continuecheck
The global variable continuecheck = 0
When player dies first time and continuecheck = 0 ===> set continuecheck to 1 and set layer to visible
player has 10 seconds to choose
Once the countdown get to 0, set continuecheck to 0 and layer invisible and go to game over page
According to what describe, logically the global variable continue check has to be 0 for layout to show.
So when the game go to game over page, continuecheck is 0 at that time but when the player go back to the game the continue window does not show anymore when he dies.
I have to close the game and restart for the window to show.
Did anyone has an idea how to fix or a better way to do that?
Sorry I hope I am not to confusing for my description
Thank you for taking the time to read