コード例 #1
0
ファイル: GS_ColoredBackground.cs プロジェクト: gotleg/MonoFe
 /// <summary>
 /// Handles the events.
 /// </summary>
 public void HandleEvents()
 {
     if (!Events.Poll())
         return;
     // On quitte le programme quand on appuie sur Echap
     KeyboardState keyState = new KeyboardState();
     if (keyState.IsKeyPressed(Key.Escape))
         GameStateManager.Quit();
 }
コード例 #2
0
ファイル: HelloWorld.cs プロジェクト: DarkYuan/sdl-testing
        private void Events_Tick(object sender, TickEventArgs e)
        {
            // Clear Screen, Draw, Output
            Video.Screen.Fill(Color.Black);
            Player.Draw(Video.Screen, Color.Wheat, false, true);
            Video.Screen.Update();

            // Handle Movement
            KeyboardState KeyState = new KeyboardState(true);
            if (KeyState.IsKeyPressed(Key.A)) { Player.XPosition1 -= 2; Player.XPosition2 -= 2; }
            else if (KeyState.IsKeyPressed(Key.D)) { Player.XPosition1 += 2; Player.XPosition2 += 2; }
            if (KeyState.IsKeyPressed(Key.W)) { Player.YPosition1 -= 2; Player.YPosition2 -= 2; }
            else if (KeyState.IsKeyPressed(Key.S)) { Player.YPosition1 += 2; Player.YPosition2 += 2; }
        }
コード例 #3
0
 public SDL_Keyboard_VSUnisystem()
 {
     state = new KeyboardState();
     LoadSettings();
     NesEmu.EMUShutdown += NesEmu_EMUShutdown;
 }
コード例 #4
0
 public SDL_Keyboard_Joyad(int playerIndex)
 {
     this.playerIndex = playerIndex;
     LoadSettings();
     state = new KeyboardState();
 }
コード例 #5
0
ファイル: GS_Dashboard.cs プロジェクト: gotleg/MonoFe
        public void HandleEvents()
        {
            if (!Events.Poll ())
                return;
            // On change de GameState
            KeyboardState keyState = new KeyboardState ();
            if (keyState.IsKeyPressed (Key.Escape)) {
                //GameStateManager.ChangeState(new GS_ColoredBackground());
                GameStateManager.Quit ();
            }
            if (keyState.IsKeyPressed (Key.Space))
                GameStateManager.ChangeState (new GS_ColoredBackground ());

            if (keyState.IsKeyPressed (Key.DownArrow))
                moveDownList ();
            if (keyState.IsKeyPressed (Key.UpArrow))
                moveUpList ();
            if (keyState.IsKeyPressed (Key.LeftArrow)) {
                if (currentEmulator == 0) {
                    currentEmulator = emulators.Length - 1;
                } else {
                    currentEmulator--;
                }
                changeEmulator.Play ();
                switchEmulator ();
            }
            if (keyState.IsKeyPressed (Key.RightArrow)) {
                if (currentEmulator == emulators.Length - 1) {
                    currentEmulator = 0;
                } else {
                    currentEmulator++;
                }
                changeEmulator.Play ();
                switchEmulator ();

            }
        }