Example #1
0
        public DefaultKeyboardController(Game1 myGame)
        {
            game = myGame;

            int playerNumber = 0;

            idleCommand       = new MarioIdleCommand(playerNumber);
            NonPressedCommand = new NonPressedKeyMarioCommand(playerNumber);

            controllerMappings = new Dictionary <Keys, ICommand>
            {
                { Keys.Q, new ExitGameCommand() },
                { Keys.W, new MarioUpCommand(playerNumber) },
                { Keys.A, new MarioLeftCommand(playerNumber) },
                { Keys.Left, new MarioLeftCommand(playerNumber) },
                { Keys.Right, new MarioRightCommand(playerNumber) },
                { Keys.Up, new MarioUpCommand(playerNumber) },
                { Keys.Down, new MarioDownCommand(playerNumber) },
                { Keys.S, new MarioDownCommand(playerNumber) },
                { Keys.D, new MarioRightCommand(playerNumber) },
                { Keys.R, new ResetAllCommand() },
                { Keys.I, new SwitchToFireMarioCommand(playerNumber) },
                { Keys.Y, new SwitchToSmallMarioCommand(playerNumber) },
                { Keys.O, new KillMarioCommand(playerNumber) },
                { Keys.U, new SwitchToBigMarioCommand(playerNumber) },
                { Keys.X, new MarioRunningCommand(playerNumber) },
                { Keys.N, new NightmareModeCommand(playerNumber) },
                { Keys.J, new JumpOnlyModeCommand(playerNumber) },
                { Keys.L, new LevelEditorCommand() },
                { Keys.H, new ReplayCommander() }
            };
        }
        public EditingKeyboardController(Game1 myGame, CameraController camera)
        {
            game    = myGame;
            textBox = EditLevelDisplay.saveTextBox;

            int playerNumber = 0;

            idleCommand       = new MarioIdleCommand(playerNumber);
            NonPressedCommand = new NonPressedKeyMarioCommand(playerNumber);

            ResetTimer();

            controllerMappings = new Dictionary <Keys, ICommand>
            {
                { Keys.W, new CameraUpCommand(camera) },
                { Keys.A, new CameraLeftCommand(camera) },
                { Keys.Left, new CameraLeftCommand(camera) },
                { Keys.Right, new CameraRightCommand(camera) },
                { Keys.Up, new CameraUpCommand(camera) },
                { Keys.Down, new CameraDownCommand(camera) },
                { Keys.S, new CameraDownCommand(camera) },
                { Keys.D, new CameraRightCommand(camera) },
                { Keys.B, new LevelEditorCommand() }
            };
        }
Example #3
0
        public GamerReplayer(Game1 game)
        {
            this.srReadFile    = new StreamReader(strReadFilePath);
            this.game          = game;
            idleCommand        = new MarioIdleCommand(playerNumber);
            NonPressedCommand  = new NonPressedKeyMarioCommand(playerNumber);
            LogCommandMappings = new Dictionary <String, ICommand>
            {
                { "Q", new ExitGameCommand() },
                { "W", new MarioUpCommand(playerNumber) },
                { "A", new MarioLeftCommand(playerNumber) },

                { "D", new MarioRightCommand(playerNumber) },

                { "X", new MarioRunningCommand(playerNumber) },
            };
        }