easter-egg-quest 1.0.14 → 1.0.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4511,6 +4511,7 @@ class RhythmStage {
4511
4511
  if (isGood) {
4512
4512
  this._goodCycles++;
4513
4513
  } else {
4514
+ this._goodCycles = 0;
4514
4515
  this._showReaction();
4515
4516
  }
4516
4517
  this._lastPhaseCount += 2;
@@ -4670,6 +4671,7 @@ class PageBreather {
4670
4671
  this._startTime = 0;
4671
4672
  this._isUserMoving = false;
4672
4673
  this._inSync = false;
4674
+ this._accuracy = 0;
4673
4675
  this.CYCLE_MS = 6e3;
4674
4676
  this._tick = () => {
4675
4677
  if (!this._active || !this._overlay) return;
@@ -4679,7 +4681,7 @@ class PageBreather {
4679
4681
  const phase = elapsed % this.CYCLE_MS / this.CYCLE_MS;
4680
4682
  const wave = (Math.sin(phase * Math.PI * 2 - Math.PI / 2) + 1) * 0.5;
4681
4683
  const shouldMove = phase < 0.5;
4682
- this._inSync = shouldMove === this._isUserMoving;
4684
+ this._inSync = this._accuracy > 0 && shouldMove === this._isUserMoving;
4683
4685
  const baseOpacity = wave * 0.85;
4684
4686
  const syncBonus = this._inSync ? 0.15 : 0;
4685
4687
  const opacity = this._intensity * (baseOpacity + (1 - wave) * 0.05 + syncBonus);
@@ -4710,6 +4712,7 @@ class PageBreather {
4710
4712
  update(accuracy, isMoving) {
4711
4713
  if (!this._active) return;
4712
4714
  this._isUserMoving = isMoving;
4715
+ this._accuracy = accuracy;
4713
4716
  const raw = Math.max(0, Math.min(1, (accuracy - 0.05) / 0.5));
4714
4717
  this._targetIntensity = 0.5 + raw * 0.5;
4715
4718
  }
@@ -4727,6 +4730,7 @@ class PageBreather {
4727
4730
  this._intensity = 0;
4728
4731
  this._targetIntensity = 0;
4729
4732
  this._inSync = false;
4733
+ this._accuracy = 0;
4730
4734
  }
4731
4735
  destroy() {
4732
4736
  this.stop();
@@ -4828,7 +4832,7 @@ class GameController {
4828
4832
  var _a3, _b3, _c;
4829
4833
  (_a3 = this.eggRenderer) == null ? void 0 : _a3.setBreathIntensity(data.accuracy);
4830
4834
  (_b3 = this.pageBreather) == null ? void 0 : _b3.update(data.accuracy, data.isMoving);
4831
- if (((_c = this.pageBreather) == null ? void 0 : _c.isInSync()) && this.threeRenderer) {
4835
+ if (((_c = this.pageBreather) == null ? void 0 : _c.isInSync()) && data.accuracy > 0 && this.threeRenderer) {
4832
4836
  this.threeRenderer.showProgressParticles(0.6 + data.accuracy * 0.4);
4833
4837
  }
4834
4838
  });