Ejemplo n.º 1
0
 public void BeforeStart()
 {
     SetWindowSize(150, 40);
     foreach (var item in cars)
     {
         item.MaxSpeed = Car._random.Next
                             (MinForRandomCarSpeed, MaxForRandomCarSpeed);
         prepareCarEvent += new Action(item.Prepare);
         driveCarEvent   += new Action(item.Drive);
     }
     finishEvent += GameOver;
     PrintGame.PrintBoard(cars);
 }
Ejemplo n.º 2
0
 void PlayAgain()
 {
     if (Again())
     {
         foreach (var item in cars)
         {
             item.Position = 1200;
             item.MaxSpeed = Car._random.Next
                                 (MinForRandomCarSpeed, MaxForRandomCarSpeed);
         }
         PrintGame.PrintBoard(cars);
         Play(1);
     }
     else
     {
         throw new Exception("exit");
     }
 }