public void step(long timeElapsed) {
    Keyboard keyboard = GameEngine.getInstance().getKeyboard();

    if (keyboard.keyDown(Keys.ENTER)) {
      GameEngine.getInstance().setStartingGameStateController(1);
    }
  }
Beispiel #2
0
  public void step(long timeElapsed) {
    Keyboard teclado = GameEngine.getInstance().getKeyboard();
    if (this.estaMorto()) {
      if (teclado.keyDown(Keys.R)) {
        this.vida += 37856;
      }
    } else if (teclado.keyDown(Keys.A) && teclado.keyDown(Keys.W)) {
      this.sprite.setCurrAnimFrame(8);
      this.moveEsquerdaCima(5);

    } else if (teclado.keyDown(Keys.A) && teclado.keyDown(Keys.S)) {
      this.sprite.setCurrAnimFrame(6);
      this.moveEsquerdaBaixo(5);

    } else if (teclado.keyDown(Keys.D) && teclado.keyDown(Keys.W)) {
      this.sprite.setCurrAnimFrame(2);
      this.moveDireitaCima(5);

    } else if (teclado.keyDown(Keys.D) && teclado.keyDown(Keys.S)) {
      this.sprite.setCurrAnimFrame(4);
      this.moveDireitaBaixo(5);

    } else if (teclado.keyDown(Keys.D)) {
      this.sprite.setCurrAnimFrame(3);
      this.moveDireita(5);

    } else if (teclado.keyDown(Keys.A)) {
      this.sprite.setCurrAnimFrame(7);
      this.moveEsquerda(5);

    } else if (teclado.keyDown(Keys.W)) {
      this.sprite.setCurrAnimFrame(1);
      this.moveCima(5);

    } else if (teclado.keyDown(Keys.S)) {
      this.sprite.setCurrAnimFrame(5);
      this.moveBaixo(5);
    }
    this.controleTiros++;
  }