Trouble with experience points system - need help

Hey, I started making a game, and it’s going pretty good so far.

However, there’s this issue I can’t seem to find a reason for. I’m not sure whether It’s my mistake or a bug. I figured I should check with some smarter people before reporting it as a bug. I’ll post a link below and a description of the problem. Just tell me if you can find the issue, and how to solve it. Or if you think its a bug instead.

http://flowlab.io/game/play/1179033

In the mouse controlled object there is a problem with the leveling up. When players get close to the crystals they get points. Once you get a certain number of points you level up. But for some reason, after a while, the object stops accumulating points. This means you cannot level up anymore. I need to fix this issue or the game won’t work.

PS. you can see your points in the game in small blue font. It can take a while for the points to stop being gained.

Interestingly the issue has ceased. I have no idea why RIP. Just changed a few things that had nothing to do with the XP. Guess it was a bug then.