Esempio n. 1
0
        private void runPacman()
        {
            while (State != GameState.GAMEOVER)
            {
                try
                {
                    this.Point = pacman.Point;
                    board.ClearPacMan(pacman.Point);
                    pacman = pacmanMove(pacman.Point, pacmanDirection);
                    board.DrawPacMan(pacman.Point, Color.Yellow, pacman.Direction);

                    PacmanRunner.Wait(_delay);
                }
                catch (Exception ex) { MessageBox.Show(ex.Message); }
            }
        }
Esempio n. 2
0
 private void runPacman()
 {
     while (State != GameState.GAMEOVER)
     {
         try
         {
             this.Point = pacman.Point;
             board.ClearPacMan(pacman.Point);
             //Point sp = scalePoint(pacman.Point);
             //List<Point> commonPoints = roadList.Where(u => u == sp).ToList();
             //if(commonPoints.Count != 0) Debug.WriteLine("Passed:  " + sp.ToString());
             //else Debug.WriteLine("Rejected:  " + sp.ToString());
             pacman = pacmanMove(pacman.Point, pacman.Direction);
             board.DrawPacMan(pacman.Point, Color.Yellow, pacman.Direction);
             PacmanRunner.Wait(_delay);
         }
         catch (Exception ex) { MessageBox.Show(ex.Message); }
     }
 }