Ejemplo n.º 1
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);
            }
        }
Ejemplo n.º 2
0
 public override void HandleEvents()
 {
     if (Keyboard.isKeyPressed("Return"))
     {
         SceneFacade.ChangeScene(SceneFacade.gameScene);
     }
 }
Ejemplo n.º 3
0
        public void Initialize()
        {
            SceneFacade.InitializeScenes();

            renderThread = new Thread(new ThreadStart(Render));
            renderThread.Start();
        }
Ejemplo n.º 4
0
 public override void HandleEvents()
 {
     if (Keyboard.isKeyPressed("P"))
     {
         SceneFacade.ChangeScene(SceneFacade.gameScene);
     }
     else if (Keyboard.isKeyPressed("Q"))
     {
         SceneFacade.ChangeScene(SceneFacade.menuScene);
     }
 }