Package javaPlay

Examples of javaPlay.Keyboard.keyDown()


    }
  }

  private void acoesTeclado(){
    Keyboard k = GameEngine.getInstance().getKeyboard();
    if(k.keyDown(Keyboard.RIGHT_KEY)){
      jogador.aumentaVelocidadeHorizontal();
    }
    if(k.keyDown(Keyboard.LEFT_KEY)){
      jogador.diminuiVelocidadeHorizontal();
    }
View Full Code Here


      this.y += this.velocidade;
    }
    if(k.keyDown(Keyboard.UP_KEY)){
      this.y -= this.velocidade;
    }
    if(k.keyDown(Keyboard.LEFT_KEY)){
      this.x -= this.velocidade;
    }
    if(k.keyDown(Keyboard.RIGHT_KEY)){
      this.x += this.velocidade;
    }
View Full Code Here

  private void acoesTeclado(){
    Keyboard k = GameEngine.getInstance().getKeyboard();
    if(k.keyDown(Keyboard.RIGHT_KEY)){
      jogador.aumentaVelocidadeHorizontal();
    }
    if(k.keyDown(Keyboard.LEFT_KEY)){
      jogador.diminuiVelocidadeHorizontal();
    }
    if(k.keyDown(KeyEvent.VK_P)){
      this.pause = !this.pause;
    }
View Full Code Here

      this.y -= this.velocidade;
    }
    if(k.keyDown(Keyboard.LEFT_KEY)){
      this.x -= this.velocidade;
    }
    if(k.keyDown(Keyboard.RIGHT_KEY)){
      this.x += this.velocidade;
    }
  }

  public void draw(Graphics g) {  
View Full Code Here

      jogador.aumentaVelocidadeHorizontal();
    }
    if(k.keyDown(Keyboard.LEFT_KEY)){
      jogador.diminuiVelocidadeHorizontal();
    }
    if(k.keyDown(KeyEvent.VK_P)){
      this.pause = !this.pause;
    }
  }
 
  private void verificaRaioTocaJogador(){
View Full Code Here

    //pega o objeto respons�vel pelo teclado
    Keyboard k = GameEngine.getInstance().getKeyboard();

    //Verifica se uma tecla direcional est� pressionado
    //Em caso positivo, altera a posi��o do jogador
    if(k.keyDown(Keyboard.DOWN_KEY)){
      this.y += this.velocidade;
    }
    if(k.keyDown(Keyboard.UP_KEY)){
      this.y -= this.velocidade;
    }
View Full Code Here

    //Verifica se uma tecla direcional est� pressionado
    //Em caso positivo, altera a posi��o do jogador
    if(k.keyDown(Keyboard.DOWN_KEY)){
      this.y += this.velocidade;
    }
    if(k.keyDown(Keyboard.UP_KEY)){
      this.y -= this.velocidade;
    }
    if(k.keyDown(Keyboard.LEFT_KEY)){
      this.x -= this.velocidade;
    }
View Full Code Here

      this.y += this.velocidade;
    }
    if(k.keyDown(Keyboard.UP_KEY)){
      this.y -= this.velocidade;
    }
    if(k.keyDown(Keyboard.LEFT_KEY)){
      this.x -= this.velocidade;
    }
    if(k.keyDown(Keyboard.RIGHT_KEY)){
      this.x += this.velocidade;
    }
View Full Code Here

      this.y -= this.velocidade;
    }
    if(k.keyDown(Keyboard.LEFT_KEY)){
      this.x -= this.velocidade;
    }
    if(k.keyDown(Keyboard.RIGHT_KEY)){
      this.x += this.velocidade;
    }
  }

  public void draw(Graphics g) {  
View Full Code Here

    //pega o objeto respons�vel pelo teclado
    Keyboard k = GameEngine.getInstance().getKeyboard();

    //Verifica se uma tecla direcional est� pressionado
    //Em caso positivo, altera a posi��o do jogador
    if(k.keyDown(Keyboard.DOWN_KEY)){
      this.y += this.velocidade;
    }
    if(k.keyDown(Keyboard.UP_KEY)){
      this.y -= this.velocidade;
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.