Пример #1
0
        public BBPlayerController(Game game)
        {
            _mode       = InputMode.Controller;
            twitchInput = (TwitchInputHandler)game.Services.GetService <IInputDataStream>();
            input       = (InputHandler)game.Services.GetService <IInputHandler>();

            RowsNeedChanged = false;
            if (input == null)
            {
                throw new Exception("PlayerController relies on InputHandler as a service, and so you must ensure you have added it as a service first");
            }

            ChangingRows = new List <RowCompassLocation>();

            keyRowBindings = new Dictionary <Keys, RowCompassLocation>
            {
                { Keys.Up, RowCompassLocation.North },
                { Keys.Down, RowCompassLocation.South },
                { Keys.Left, RowCompassLocation.West },
                { Keys.Right, RowCompassLocation.East },
            };
        }
Пример #2
0
        public Game1()
        {
            graphics = new GraphicsDeviceManager(this);
            graphics.PreferredBackBufferWidth  = 1280;
            graphics.PreferredBackBufferHeight = 720;
            //Window.IsBorderless = true;
            Content.RootDirectory = "Content";

            twitch  = new TwitchInputHandler(this);
            input   = new InputHandler(this);
            console = new GameConsole(this);
            this.Components.Add(twitch);
            this.Components.Add(input);
            this.Components.Add(console);

            rm = new RowManager(this);
            this.Components.Add(rm);

            sm = new ScoreManager(this);
            this.Components.Add(sm);

            //TwitchInputHandler twitch = new TwitchInputHandler(this);
        }