示例#1
0
 public override void HandleEvents()
 {
     if (Keyboard.isKeyPressed("Return"))
     {
         SceneFacade.ChangeScene(SceneFacade.gameScene);
     }
 }
示例#2
0
        public override void HandleEvents()
        {
            if (objects.First().getPhysics().getSpeed() > 0)
            {
                objects.First().getPhysics().setSpeed(0);
            }

            if (Keyboard.isKeyDown("Up"))
            {
                objects.First().getPhysics().setVSpeed(-10);
            }

            if (Keyboard.isKeyDown("Down"))
            {
                objects.First().getPhysics().setVSpeed(10);
            }

            if (Keyboard.isKeyDown("Right"))
            {
                objects.First().getPhysics().setHSpeed(10);
            }

            if (Keyboard.isKeyDown("Left"))
            {
                objects.First().getPhysics().setHSpeed(-10);
            }

            if (Keyboard.isKeyPressed("P"))
            {
                SceneFacade.ChangeScene(SceneFacade.pauseScene);
            }
        }
示例#3
0
 public override void HandleEvents()
 {
     if (Keyboard.isKeyPressed("P"))
     {
         SceneFacade.ChangeScene(SceneFacade.gameScene);
     }
     else if (Keyboard.isKeyPressed("Q"))
     {
         SceneFacade.ChangeScene(SceneFacade.menuScene);
     }
 }