Roro is a logic problem in your code.
The problem is in your global variable "size", I did not understand what you intend to do with it, but when you create an object and sends subtract 25 from the "size". Below you created a condition of size < 900 and equal to 900 then the game loops because of it.
I have disabled the part that subtracts in line 5 and your game and functioned normally. And so the line 6 was also disabled too.