void RespawnAsteroidsIfNeeded() { if (NumAsteriods() == 0) { int count = 0; do { while (true) { int x = r.Next(640); int y = r.Next(480); if (player.GetDistance(x, y) > 50) { Asteroid ast = new LargeAsteroid(x, y); objects.Add(ast); count++; break; } } } while (count < 5); } }