示例#1
0
        public void PlanetTravel(double currentPlanetx, double destinationPlanetx, double currentPlanety, double destinationPlanety, Ship ship, PersonalStatus PS, Fuel fuel)
        {
            double distTraveled    = (Math.Sqrt(Math.Pow(currentPlanetx - destinationPlanetx, 2) + Math.Pow(currentPlanety - destinationPlanety, 2)));
            double playerWarpSpeed = (Math.Pow(ship.ShipSpeed, 10 / 3) + Math.Pow(10 - ship.ShipSpeed, -11 / 3));
            double time            = distTraveled / playerWarpSpeed;

            PS.AddTime(time);
            fuel.MyCurrentFuel -= ((int)(distTraveled));
            if (PS.TravelAge() > 40.0)
            {
                GO.Retire(PS, ship);
            }
        }
示例#2
0
 public void EndScreen(PersonalStatus ps, Ship ship)
 {
     Console.Clear();
     Console.WriteLine($"\n\n\n\n\n\n" +
                       $"\n\t\t\t\t~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" +
                       $"\n\t\t\t\t              Game Over" +
                       $"\n\t\t\t\t~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" +
                       $"\n\n\t\t\tYou had {ps.Cash()} Galactic Credits at theR end of your journey" +
                       $"\n\t\t\tYou traveled for {ps.TravelAge()} years total" +
                       $"\n\t\t\tYou had a {ship.ShipName} class ship\n\n\n" +
                       $"\t\t\t              Thank you for playing\n\n\n" +
                       $"\t\t\t\t Copyright 2018 The Space Game Company");
     Console.ReadLine();
     Console.WriteLine("Press 'alt+f4' to exit");
     Console.ReadLine();
     EndScreen(ps, ship);
 }