I have it set up so that at the beginning of the first Scene, the global variable for Coins is set to zero:
Then, the following is called into each scene via an external event:
The idea is that each time 100 coins are collected, a life is added (global variable “Lives”) and then the coin count is reset to zero.
This works exactly as intended…about 50% of the time. The other 50% of the time the coins just keep counting higher and higher, well over 100. Sometimes an entire game will go by and it performs as expected each time. Sometimes the first 100 coins will result in an extra life, but then after that it just keeps collecting coins. Sometimes it just keeps collecting coin and never adds a life at all.
Any ideas/insight as to what is causing this to work perfectly only half the time?