示例#1
0
        private static PacmanPanel CreatePacman()
        {
            var pacman = new PacmanPanel();

            pacman.Draw(1, 1);

            return(pacman);
        }
示例#2
0
 private void Form1_Paint(object sender, PaintEventArgs e)
 {
     if (this._gameController == null)
     {
         this._pacman         = this._pacmanFactory();
         this._ghost          = this._ghostFactory();
         this._gameController = this._gameControllerFactory();
         this._visualMaze     = new VisualMaze(_gameController.LogicalMaze);
         this.ClientSize      = new Size(_gameController.LogicalMaze.Field.Length / _gameController.LogicalMaze.Field.GetLength(0) * 50, _gameController.LogicalMaze.Field.GetLength(0) * 50);
         this._gameController.RegisterScoreUpdater(this);
         this._gameController.RegisterPacmanLocationChange(this);
         this._gameController.RegisterGhostLocationChange(this);
     }
 }
示例#3
0
        public ScoreTest()
        {
            ILogicalMaze logicalMaze = new LogicalMaze
            {
                Field = new[, ]
                {
                    { MazeTile.Coin, MazeTile.Coin, MazeTile.Coin },
                    { MazeTile.Coin, MazeTile.Empty, MazeTile.Coin },
                    { MazeTile.Coin, MazeTile.Coin, MazeTile.Coin },
                }
            };

            this._pacmanPanel    = new PacmanPanel();
            this._gameController = new GameController(logicalMaze, _pacmanPanel, new Panel());
        }
示例#4
0
 public PacmanTest()
 {
     this._logicalMaze    = new LogicalMaze();
     this._pacmanPanel    = new PacmanPanel();
     this._gameController = new GameController(_logicalMaze, _pacmanPanel, new Panel());
 }