Пример #1
0
 /// <summary>
 /// Respawns the specified ship.
 /// </summary>
 /// <param name="ship">The ship.</param>
 private static void Respawn(Ship ship)
 {
     Thread.Sleep(respawnRate * msPerFrame);
     ship.Loc = new Vector2D(random.Next(universeSize + 1) - (universeSize / 2), random.Next(universeSize + 1) - (universeSize / 2));
     while (Math.Abs(ship.Loc.GetX()) < starSize && Math.Abs(ship.Loc.GetX()) < starSize)
     {
         ship.Loc = new Vector2D(random.Next(universeSize + 1) - (universeSize / 2), random.Next(universeSize + 1) - (universeSize / 2));
     }
     ship.Respawn();
 }