@Override
  public void update(long elapsedTime) {
    super.update(elapsedTime);

    if (currentAnimation.getId().contains("sword")
        || currentAnimation.getId().contains("test")
        ||
        //				currentAnimation.getId().contains("crouching") ||
        !firstTime) {

      if (framesDebug == 0) {
        System.out.println(
            currentAnimation.getId()
                + ": "
                + currentAnimation.getCurrentFrame()
                + " -> ("
                + getX()
                + ", "
                + getY()
                + ")");
      }

      if (framesDebug == 4) {
        framesDebug = -1;
      }

      framesDebug++;
      firstTime = false;
    }

    /* Updates the position of the bounding box */
    enableBoundingBox();
  }
Beispiel #2
0
 public void updateReal(long elapsedTime) {
   super.update(elapsedTime);
   if (this.getCurrentAnimation().getId().equals("opening")) {
     if (this.getCurrentAnimation().isOver(false)) {
       this.setCurrentAnimation("opened", FRAME_DURATION);
     }
   } else if (this.getCurrentAnimation().getId().equals("closing")) {
     if (this.getCurrentAnimation().isOver(false)) {
       this.setCurrentAnimation("closed", FRAME_DURATION);
     }
   }
 }