Lashtw commited on
Commit
c8e4a96
·
verified ·
1 Parent(s): 1393af2

Upload 2 files

Browse files
Files changed (2) hide show
  1. sequence.html +3 -2
  2. skyscraper.html +10 -5
sequence.html CHANGED
@@ -2954,7 +2954,7 @@
2954
  player.vx = 0; player.vy = 0; input.axisX = 0; player.autoWalk = false; player.visible = true;
2955
  cameraX = 0; cameraY = 0; isStairsVanished = false; isMagicStairsBuilt = false; score = 0;
2956
  player.gravityHintTimer = 0; screenShake = 0; ritualGlow = 0;
2957
- player.coyoteTimer = 0; player.scaleX = 1; player.scaleY = 1;
2958
  hasShownGravityDialog = false;
2959
  hiddenStage.isWinning = false;
2960
  hiddenStage.hasStarted = false;
@@ -2979,6 +2979,7 @@
2979
  if (hasCompletedBefore) {
2980
  // Skip tutorial, go straight to quiz
2981
  hasPassedTutorial = true;
 
2982
  const startY = height * 0.7;
2983
  platforms = [];
2984
  particles = [];
@@ -2991,7 +2992,7 @@
2991
  platforms.push({ x: i * 100, y: startY, w: 100, h: 40, type: 'safe', visited: true, decoration: deco, seed: Math.random() });
2992
  }
2993
 
2994
- player.x = 200; player.y = startY - 54; player.isGrounded = true; player.prevY = player.y;
2995
  worldRightEdge = 1000; nextStoneNum = 1;
2996
  generatedTargetCount = 0;
2997
 
 
2954
  player.vx = 0; player.vy = 0; input.axisX = 0; player.autoWalk = false; player.visible = true;
2955
  cameraX = 0; cameraY = 0; isStairsVanished = false; isMagicStairsBuilt = false; score = 0;
2956
  player.gravityHintTimer = 0; screenShake = 0; ritualGlow = 0;
2957
+ player.coyoteTimer = 0; player.scaleX = 1; player.scaleY = 1; player.jumpCount = 0;
2958
  hasShownGravityDialog = false;
2959
  hiddenStage.isWinning = false;
2960
  hiddenStage.hasStarted = false;
 
2979
  if (hasCompletedBefore) {
2980
  // Skip tutorial, go straight to quiz
2981
  hasPassedTutorial = true;
2982
+ if (controlType === 'mobile') document.getElementById('mobile-controls').classList.remove('hidden');
2983
  const startY = height * 0.7;
2984
  platforms = [];
2985
  particles = [];
 
2992
  platforms.push({ x: i * 100, y: startY, w: 100, h: 40, type: 'safe', visited: true, decoration: deco, seed: Math.random() });
2993
  }
2994
 
2995
+ player.x = 200; player.y = startY - 54; player.isGrounded = true; player.prevY = player.y; player.jumpCount = 0;
2996
  worldRightEdge = 1000; nextStoneNum = 1;
2997
  generatedTargetCount = 0;
2998
 
skyscraper.html CHANGED
@@ -652,7 +652,7 @@
652
  targetDist: 60, isParallel: true, markerTs: [], dragging: false,
653
  showHbeam: false, hbeamAnim: 0, frame: 0, stars: [], bL: {}, bR: {},
654
  fixMode: false, lineB: null, line2: null, nx: 0, ny: 0,
655
- timerStart: 0, timerDur: 60000, timerActive: false
656
  };
657
  this._genStars(); this._resize();
658
  window.addEventListener('resize', () => this._resize());
@@ -711,6 +711,7 @@
711
  }
712
 
713
  _genLevel() {
 
714
  this.s.fixMode = false; this._resize();
715
  let lv;
716
  if (this.s.phase === 'challenge') {
@@ -783,6 +784,7 @@
783
  }
784
 
785
  _enterFixMode() {
 
786
  this.s.fixMode = true; this.s.type = 'draw';
787
  const l1 = this.s.line1, l2 = this.s.line2, d = this.s.targetDist;
788
  const ldx = l1.p2.x - l1.p1.x, ldy = l1.p2.y - l1.p1.y;
@@ -842,7 +844,7 @@
842
  }
843
 
844
  checkAnswer() {
845
- if (!this.s.playing) return;
846
  if (this.s.timerActive && this._checkTimer()) return;
847
  const l2 = this._getL2(); if (!l2) return;
848
  const d = this.s.targetDist, l1 = this.s.line1;
@@ -859,6 +861,7 @@
859
  });
860
  if (this.s.phase === 'tutorial') {
861
  if (allMatch) {
 
862
  this._showPhaseModal('✅', '教學完成!', '垂直距離處處相等 = 平行!\n確認距離一致就代表兩條線平行', '確認,繼續 →', null);
863
  this.dom.tbtn.onclick = () => { this.dom.tm.classList.add('hidden'); this.s.lvIdx++; this._genLevel() }
864
  }
@@ -866,25 +869,27 @@
866
  return;
867
  }
868
  if (this.s.fixMode) {
869
- if (allMatch) { this._onCorrect(80) }
870
  else this._showToast(`還不是完全平行!${mismatchInfo}`, false);
871
  return;
872
  }
873
- if (allMatch) this._onCorrect(100);
874
  else this._showToast(`還不是完全平行!${mismatchInfo}`, false);
875
  }
876
 
877
  judgeAnswer(says) {
878
- if (!this.s.playing) return;
879
  if (this.s.timerActive && this._checkTimer()) return;
880
  if (this.s.phase === 'tutorial') {
881
  if (says === this.s.isParallel) {
 
882
  this._showPhaseModal('✅', '教學完成!', '觀察垂直距離是否處處相等,\n相等就代表平行!', '確認,繼續 →', null);
883
  this.dom.tbtn.onclick = () => { this.dom.tm.classList.add('hidden'); this.s.lvIdx++; this._genLevel() }
884
  } else this._showToast(this.s.isParallel ? '看看各點垂直距離是否相同?' : '注意各點距離不同喔!', false);
885
  return;
886
  }
887
  if (says === this.s.isParallel) {
 
888
  if (this.s.isParallel) { this._onCorrect(100) }
889
  else { this._showToast('正確!不平行。現在請調整讓它平行!', true); setTimeout(() => this._enterFixMode(), 1200) }
890
  } else {
 
652
  targetDist: 60, isParallel: true, markerTs: [], dragging: false,
653
  showHbeam: false, hbeamAnim: 0, frame: 0, stars: [], bL: {}, bR: {},
654
  fixMode: false, lineB: null, line2: null, nx: 0, ny: 0,
655
+ timerStart: 0, timerDur: 60000, timerActive: false, locked: false
656
  };
657
  this._genStars(); this._resize();
658
  window.addEventListener('resize', () => this._resize());
 
711
  }
712
 
713
  _genLevel() {
714
+ this.s.locked = false;
715
  this.s.fixMode = false; this._resize();
716
  let lv;
717
  if (this.s.phase === 'challenge') {
 
784
  }
785
 
786
  _enterFixMode() {
787
+ this.s.locked = false;
788
  this.s.fixMode = true; this.s.type = 'draw';
789
  const l1 = this.s.line1, l2 = this.s.line2, d = this.s.targetDist;
790
  const ldx = l1.p2.x - l1.p1.x, ldy = l1.p2.y - l1.p1.y;
 
844
  }
845
 
846
  checkAnswer() {
847
+ if (!this.s.playing || this.s.locked) return;
848
  if (this.s.timerActive && this._checkTimer()) return;
849
  const l2 = this._getL2(); if (!l2) return;
850
  const d = this.s.targetDist, l1 = this.s.line1;
 
861
  });
862
  if (this.s.phase === 'tutorial') {
863
  if (allMatch) {
864
+ this.s.locked = true;
865
  this._showPhaseModal('✅', '教學完成!', '垂直距離處處相等 = 平行!\n確認距離一致就代表兩條線平行', '確認,繼續 →', null);
866
  this.dom.tbtn.onclick = () => { this.dom.tm.classList.add('hidden'); this.s.lvIdx++; this._genLevel() }
867
  }
 
869
  return;
870
  }
871
  if (this.s.fixMode) {
872
+ if (allMatch) { this.s.locked = true; this._onCorrect(80) }
873
  else this._showToast(`還不是完全平行!${mismatchInfo}`, false);
874
  return;
875
  }
876
+ if (allMatch) { this.s.locked = true; this._onCorrect(100); }
877
  else this._showToast(`還不是完全平行!${mismatchInfo}`, false);
878
  }
879
 
880
  judgeAnswer(says) {
881
+ if (!this.s.playing || this.s.locked) return;
882
  if (this.s.timerActive && this._checkTimer()) return;
883
  if (this.s.phase === 'tutorial') {
884
  if (says === this.s.isParallel) {
885
+ this.s.locked = true;
886
  this._showPhaseModal('✅', '教學完成!', '觀察垂直距離是否處處相等,\n相等就代表平行!', '確認,繼續 →', null);
887
  this.dom.tbtn.onclick = () => { this.dom.tm.classList.add('hidden'); this.s.lvIdx++; this._genLevel() }
888
  } else this._showToast(this.s.isParallel ? '看看各點垂直距離是否相同?' : '注意各點距離不同喔!', false);
889
  return;
890
  }
891
  if (says === this.s.isParallel) {
892
+ this.s.locked = true;
893
  if (this.s.isParallel) { this._onCorrect(100) }
894
  else { this._showToast('正確!不平行。現在請調整讓它平行!', true); setTimeout(() => this._enterFixMode(), 1200) }
895
  } else {