I’m currently trying to implement a scoring system to my game which also saves the player’s highest score. Everything is roughly working fine, but there is one bizarre issue that keeps popping up.
To put things simply, I have three different “coins”. One coin gives you 1 point, another gives you 2, and another gives you 3.
Strangely though, whenever you click on the first coin to pick it up, no matter what amount it’s supposed to give you, the score will remain at zero. But then, when you click another coin, it will give you the score you WOULD have gotten from the previous coin you clicked. This process continues indefinitely, with your score always being added in a delay.
Example: You click on the coin worth 2 points and the score remains zero. You then click on the coin worth 1 point and it will give you 2 points. You can then click on the coin worth 3 points and it will add only 1 point. You can do this in any order and there is always that sort of delay.
I can’t figure out where I’m going wrong with this, so any advice over the matter would be much appreciated.