Keeping score during the game
We have a simple system that increases Score of Player as it touches Good Orbs and takes Lives from Player as it crashes into Bad Orbs. When the Score reaches a set number, we win. When Player Lives decreases to zero, we lose.
When we lose, we have the option to retry the Scene. To do this, the system needs to remember what the Score and Player Lives were when first entering the Scene so they can be reset back to these values.
The following two screenshots show the code for initializing the score: