コード例 #1
0
ファイル: Player.java プロジェクト: johanfredin/Gravitation
 /**
  * When player dies this should be called. Stops the players sound, resets position of the player
  * and creates an explosion particle effect.
  *
  * @param spawnPoint The Spawnpoint to which the player will be transfered to
  */
 public void die(Vector2 spawnPoint) {
   crashed = true;
   explosion.setPosition(getPosition().x, getPosition().y);
   shootSound.stop();
   exhaustSound.stop();
   explosion.start();
   explosionSound.play();
   setPosition(spawnPoint.x, spawnPoint.y + 1);
 }
コード例 #2
0
ファイル: Player.java プロジェクト: johanfredin/Gravitation
  private void handleTouchPadInput() {
    if (movementTouchPad.isTouched()) {
      body.applyAngularImpulse(
          MathUtils.radDeg
              * -MAX_TURN_DEG
              * (movementTouchPad.getKnobPercentX() + movementTouchPad.getKnobPercentY()),
          true);
    }

    if (gasTouchPad.isTouched()) {
      gasPressed = true;
      exhaust.start();
    }
    if (!gasTouchPad.isTouched()) {
      gasPressed = false;
      movement.set(0, 0);
      exhaust.allowCompletion();
    }
  }