Lag Problems... Again

i just noticed that my game is going very slow, and I think it’s because of the amount of sprites in it. Can someone tell me what can I do to improve the FPS?
Thanks!
Game if you need it

4 Likes

To see if it’s the sprite count giving you trouble, turn on stats.

  1. While your game is running, select Menu.
  2. From the pause menu, move to Show Stats. Press A.
  3. Move to Close (the big red X). Press A again.
  4. You’ll see both a FPS and a sprite counter on the screen.
    Stats appearing in the simulator.

I’ve let your game run for a little bit without any obvious sprite overload, but I haven’t played it for very long. Keep us posted and let us know if you’re still having difficulties.

2 Likes

well after I place down a certain amount it starts to lag maybe make a limit?

3 Likes

One idea that comes to mind is when 2 Projectiles overlap Make one deleate then change the damage value of it so i still acts as 2? it would be small but it could work

another is the peashooters checking if there is somthing in there lane im not sure what the code looks like for that but if you made it so the whole lane was checked at once insted of each plant it could also remove some lag it wouldnt fix the spirte count but im not sure what could

1 Like