Ejemplo n.º 1
0
        public Controller(Level level, GameView view)
        {
            View = view;
            Level = level;

            _helpTimerStart = DateTime.Now;

            Restart();
        }
Ejemplo n.º 2
0
        public MouseInputHandler(Controller controller, GameView view)
        {
            Controller = controller;
            View = view;

            InputManager.Events.MouseDown += Events_MouseDown;
            InputManager.Events.MouseMoved += Events_MouseMoved;
            InputManager.Events.MouseUp += Events_MouseUp;
            InputManager.Events.KeyPressed += Events_KeyPressed;
        }
Ejemplo n.º 3
0
        protected override void Initialize()
        {
            base.Initialize();

            var mersenneTwister = new MersenneTwister();

            var loader = new LevelLoader();
            var firstLevel = new Level(loader.Load("Content/first"), mersenneTwister);
            var view = new GameView(new Point(Graphics.PreferredBackBufferWidth, Graphics.PreferredBackBufferHeight), new Point(64, 64), firstLevel);

            _controller = new Controller(firstLevel, view);
            var input = new MouseInputHandler(_controller, view);
            input.Swap += _controller.SwapAnimals;
        }