private static GhostPanel CreateGhostPanel() { var ghost = new GhostPanel(); ghost.Draw(4, 4); return(ghost); }
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); } }