I'm trying to make a game over screen and my lives restarts everytime I die.
Develop games in your browser. Powerful, performant & highly capable.
A global variable will work anywhere in your project.