private static PacmanPanel CreatePacman() { var pacman = new PacmanPanel(); pacman.Draw(1, 1); return(pacman); }
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); } }
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()); }
public PacmanTest() { this._logicalMaze = new LogicalMaze(); this._pacmanPanel = new PacmanPanel(); this._gameController = new GameController(_logicalMaze, _pacmanPanel, new Panel()); }