implementing game loop, making gates stop spawning once one of them dies