FPS drop!

My FPS has been dropping even to 1fps( :scream:) Sprites go to even 2000+ and infinitly rise.
@MakeCode help?

4 Likes

You’re probably spawning a new sprite every (on game update) as soon as that moonrock() variable = 1 2 or 3. I would recommend making a variable that keeps track of whether or not the sprite is spawned and only spawning one if it hasn’t already spawned one. You could just make a variable called SpriteIsSpawned = False at the start, then make SpriteIsSpawned = True when you spawn a sprite. Then you could only let sprites spawn if SpriteIsSpawned = False. You could make multiple different variables for different sprites.

1 Like

Could you help me fix it?idk how to fix :sweat_smile:

the moonrock() variable is to keep track if you’ve collrcted the moonrock.