Exemple #1
0
 private void runGame()
 {
     while (State != GameState.GAMEOVER)
     {
         try
         {
             CheckReset();
             eatBonus(Pacman.core());
             ghostSetTargets();
             eatDots(Pacman.core());
             addLives();
             BonusClear();
             BonusPaint(bonusStateCounter);
             DotPaint();
             checkForWin();
             checkForLose();
             eatGhost();
             eatFruit();
             if (score >= highScore)
             {
                 highScore = score;
             }
             parentForm.Write(score.ToString(), Level.ToString(), highScore.ToString(),
                              Pacman.Point.ToString(), PacmanDelay.ToString(), GhostDelay.ToString());
             Runner.Wait(10);
         }
         catch (Exception ex) { MessageBox.Show(ex.ToString()); }
     }
 }
Exemple #2
0
 private void runGame()
 {
     while (State != GameState.GAMEOVER)
     {
         try
         {
             eatDots(Pacman.core());
             eatBonus(Pacman.core());
             dotPaint();
             bonusPaint();
             checkForEnd();
             string data = Pacman.Point.ToString() + "@" + score + "%" + PacmanDelay;
             parentForm.Write(data);
             Runner.Wait(10);
         }
         catch (Exception ex) { MessageBox.Show(ex.ToString()); }
     }
 }