Beispiel #1
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;
        }
Beispiel #2
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;
        }