Example #1
0
 // stops the hitboxes from "flashing" from the previous location on state reset.
 public void resetHitboxes(Actor actor) {
   for (Hitbox h : hitBoxes) {
     h.hit.confirmed = false;
     h.spent = false;
     h.update();
   }
 }
Example #2
0
  public void update(Actor actor, int delta) {

    checkConditions(actor);

    for (Hitbox h : hitBoxes) {
      h.update();
      if (h.hit.confirmed) actor.hitConfirmed = true;
    }

    for (Touchbox t : touchBoxes) {
      t.update();
    }

    statusUpdate(actor);

    // Update frame
    lastUpdate += delta * Manager.timeScale * Manager.WORLD.conversionConstant;
    if (lastUpdate >= 17) {
      currentFrame++;
      lastUpdate = 0;
    }
    // Reset frame
    if (currentFrame >= frames.length) {
      actor.setState(this.transition);
    }
  }