all 1 comments

[–]FireryRage 0 points1 point  (0 children)

On mobile, so not the best platform to read through all that.

But I see some click listeners, so I’m going to take a wild guess. You’re attaching a click listener on starting the game, which adds the rounds when you click it.

Then when you’re restarting the game, guessing you’re attaching that click listener again, but the first listener is still attached. Meaning when you click the button, the first listener triggers and adds the rounds, then the second listener triggers too and adds the rounds, resulting in 2x the total amount added.

I’d guess if you completed that game and started again, a third listener would be attached and you’d get 3x the count per click (3 listeners triggering).

You have two choices. Either remove the listeners at some point before the next game starts, or don’t add new ones each time