Example #1
0
 public override void HandleEvents()
 {
     if (Keyboard.isKeyPressed("Return"))
     {
         SceneFacade.ChangeScene(SceneFacade.gameScene);
     }
 }
Example #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);
            }
        }
Example #3
0
 public override void HandleEvents()
 {
     if (Keyboard.isKeyPressed("P"))
     {
         SceneFacade.ChangeScene(SceneFacade.gameScene);
     }
     else if (Keyboard.isKeyPressed("Q"))
     {
         SceneFacade.ChangeScene(SceneFacade.menuScene);
     }
 }