public static KeyboardController SetupLevelKeyboard1P(PlayerChar mario, Scene scene) { KeyboardController keyboard = new KeyboardController(); // Add system commands here keyboard.AddSystemCommand((int)Keys.Q, new QuitCommand(scene)); keyboard.AddSystemCommand((int)Keys.Space, new ResetCommand(scene)); keyboard.AddSystemCommand((int)Keys.P, new PauseCommand(scene)); keyboard.AddPlayerCommand((int)Keys.W, new UpCommand(mario)); keyboard.AddPlayerCommand((int)Keys.S, new DownCommand(mario)); keyboard.AddPlayerCommand((int)Keys.A, new LeftCommand(mario)); keyboard.AddPlayerCommand((int)Keys.D, new RightCommand(mario)); keyboard.AddPlayerCommand((int)Keys.U, new MarioSuperCommand(mario)); keyboard.AddPlayerCommand((int)Keys.I, new MarioFireCommand(mario)); keyboard.AddPlayerCommand((int)Keys.O, new MarioDamageCommand(mario)); keyboard.AddPlayerCommand((int)Keys.Y, new MarioResetCommand(mario)); keyboard.AddPlayerCommand((int)Keys.F, new MarioFireBallCommand(mario)); return(keyboard); }
public static KeyboardController SetupLevelKeyboard2P(PlayerChar mario, PlayerChar luigi, Scene scene) { KeyboardController keyboard = new KeyboardController(); // Add system commands here keyboard.AddSystemCommand((int)Keys.Q, new QuitCommand(scene)); keyboard.AddSystemCommand((int)Keys.Space, new ResetCommand(scene)); keyboard.AddSystemCommand((int)Keys.P, new PauseCommand(scene)); // Add player commands here keyboard.AddPlayerCommand((int)Keys.Up, new UpCommand(luigi)); keyboard.AddPlayerCommand((int)Keys.Down, new DownCommand(luigi)); keyboard.AddPlayerCommand((int)Keys.Left, new LeftCommand(luigi)); keyboard.AddPlayerCommand((int)Keys.Right, new RightCommand(luigi)); keyboard.AddPlayerCommand((int)Keys.W, new UpCommand(mario)); keyboard.AddPlayerCommand((int)Keys.S, new DownCommand(mario)); keyboard.AddPlayerCommand((int)Keys.A, new LeftCommand(mario)); keyboard.AddPlayerCommand((int)Keys.D, new RightCommand(mario)); keyboard.AddPlayerCommand((int)Keys.F, new MarioFireBallCommand(mario)); keyboard.AddPlayerCommand((int)Keys.L, new MarioFireBallCommand(luigi)); return(keyboard); }
public static KeyboardController SetupMenuKeyboard(Menu menu, Scene scene) { KeyboardController keyboard = new KeyboardController(); // Add system commands here keyboard.AddSystemCommand((int)Keys.Q, new QuitCommand(scene)); // Add player commands here keyboard.AddSystemCommand((int)Keys.Up, new ScrollUpCommand(menu)); keyboard.AddSystemCommand((int)Keys.Down, new ScrollDownCommand(menu)); keyboard.AddSystemCommand((int)Keys.W, new ScrollUpCommand(menu)); keyboard.AddSystemCommand((int)Keys.S, new ScrollDownCommand(menu)); keyboard.AddSystemCommand((int)Keys.Enter, new SelectCommand(menu)); return(keyboard); }