Example #1
0
		public MazeController(MazeGame game, MazeView view)
		{
			_game = game;
			_view = view;
			_monsterTimer.Tick += new System.EventHandler(this.monsterTimer_Tick);
			_monsterTimer.Interval = 200;
			//_monsterTimer.Start();
		}
Example #2
0
		private void MainForm_Load(object sender, System.EventArgs e)
		{
			//control initialization to enable proper resizing
			lnkQuitOffset = panel1.Width - lnkQuit.Left;
			lnkNewGameOffset = panel1.Width - lnkNewGame.Left;
			cmbDifficultyOffset = panel1.Width - cmbDifficulty.Left;
			MazeViewOffset = new Size(Width - pnlMazeView.Width, Height - pnlMazeView.Height);

			//MVC initialization
			game = new MazeGame();
			view = new MazeView(game,this);
			controller = new MazeController(game,view);
			controller.Difficulty = difficulty.Easy;
			//controller.CreateMaze();
			this.cmbDifficulty.SelectedIndex = (int)controller.Difficulty;
		}