Clean up diep.io sandbox?
Solution 1:
This will never happen.
Every time you attack a shape, a new one spawn instantly. This does two things. It will reduce the need for a randomized loop that spawns the shape, and it maintains the original amount of shapes on the field at all times.
Solution 2:
Finally I found a way to clear the sandbox:
Become necromancer
Destroy every pentagon and triangle until they become squares
Collect every square with necromancer.
There will be no objects left, only the necromancer drones.. When collecting a square with necromancer it does not respawn.