public void update(int delta, Character owner, Character other) { if (attackPhase == 0 && progress > beginRunTime) { owner.move(new Vector2f(runSpeed * delta * (facingRight ? 1 : -1), 0f)); if (Math.abs(other.getX() - owner.getX()) < whackDistance) { whackBeginTime = progress; attackPhase++; } } else if (attackPhase == 1 && progress > whackBeginTime + whackHurtTime) { attackPhase++; } else if (attackPhase == 2 && (hasHit || progress > whackBeginTime + whackHurtTime + whackDuration)) { attackPhase++; } else if (attackPhase == 3 && progress > whackBeginTime + whackHurtTime + whackDuration + whackRecoverTime) { finishAttack(owner); } super.update(delta, owner, other); }