Skip to content

Commit 789daed

Browse files
committed
Update
1 parent 189593c commit 789daed

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

game.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -558,13 +558,16 @@
558558
let mathProblems = null;
559559
async function loadMathProblems() {
560560
if (mathProblems) return mathProblems;
561+
showLoading();
561562
try {
562563
const res = await fetch('math.txt', { cache: 'no-cache' });
563564
mathProblems = parseMathText(await res.text());
564565
return mathProblems;
565566
} catch (e) {
566567
showMessage(`Failed to load math problems: ${e.message}`, 'error', 3000);
567568
return [];
569+
} finally {
570+
hideLoading();
568571
}
569572
}
570573
function parseMathText(text) {
@@ -1249,8 +1252,8 @@
12491252
mathSession.accumulatedAttack += 20;
12501253
const btn = document.querySelector(`#math-choice-${choice.toLowerCase()}`);
12511254
btn.classList.add('correct');
1252-
setTimeout(() => btn.classList.remove('correct'), 500);
12531255
setTimeout(() => {
1256+
btn.classList.remove('correct')
12541257
mathSession.index += 1;
12551258
nextMathProblem();
12561259
}, 500);

index.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ <h2>Tactics</h2>
4848
<button id="btn-shop" class="btn shop"><i class="fa-solid fa-shop"></i> Shop</button>
4949
</div>
5050

51-
<p class="hint">Version: 1.8 (beta) - The Math Update!</p>
51+
<p class="hint">Version: 1.8 - The Math Update!</p>
5252
<a class="hint" href="https://github.com/willyblah/thegame" target="_blank">GitHub</a> <span class="hint">|</span>
5353
<a class="hint" href="https://github.com/willyblah/thegame/blob/main/README.md" target="_blank">About</a>
5454
</div>
@@ -209,6 +209,7 @@ <h2>Trickster Prize</h2>
209209
</div>
210210
<div class="controls"><button id="btn-prize-back" class="btn">Back</button></div>
211211
</div>
212+
212213
<div id="math-screen" class="screen hidden">
213214
<div class="math-topbar">
214215
<div class="left">

0 commit comments

Comments
 (0)