static void Main(string[] arg) { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); // default GameModel _gameModel = new GameModel(); IController _controller = new PackmanController(_gameModel); ViewForm _viewForm = new ViewForm(_controller, _gameModel); if (arg.Length == 5) { try { _gameModel = new GameModel(int.Parse(arg[0]), int.Parse(arg[1]), int.Parse(arg[2]), int.Parse(arg[3]), int.Parse(arg[4])); _controller = new PackmanController(_gameModel); _viewForm = new ViewForm(_controller, _gameModel, int.Parse(arg[0]), int.Parse(arg[1])); } catch { // doing something } } Application.Run(_viewForm); }
static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); GameView gameView = new GameView(); Model model = new Model(); PackmanController controller = new PackmanController(gameView, model); gameView.ShowDialog(); }
public FormMain(PackmanController controller, ListEntities entities, int mapWidth, int mapHeight) { InitializeComponent(); Controller = controller; Entities = entities; MapWidth = mapWidth; MapHeight = mapHeight; controller.NewGame(); map = new Bitmap(MapWidth, MapHeight); graphics = Graphics.FromImage(map); Draw(); }
static void Main() { int mapWidth = 800; int mapHeight = 500; MovableObject.speed = 3; int maxAppleCount = 5; int maxTankCount = 5; ListEntities entities = new ListEntities(); GameModel gameModel = new GameModel(mapWidth, mapHeight, entities, maxAppleCount, maxTankCount); PackmanController controller = new PackmanController(gameModel); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new FormMain(controller, entities, mapWidth, mapHeight)); }
public void SetController(PackmanController givenController) { controller = givenController; }