diff options
| author | LLLL Colonq <llll@colonq> | 2026-07-31 05:00:49 -0400 |
|---|---|---|
| committer | LLLL Colonq <llll@colonq> | 2026-07-31 05:00:49 -0400 |
| commit | ea5332e4a1a035e888709bee278fcafb182f7922 (patch) | |
| tree | 7e1520391e7f04fa3df425fd9ed02008f748cdfd /2026/games_submissions/the0x539/main.js | |
| parent | 3ec03ba57474aa4320cb7901980b55706adbc111 (diff) | |
Update
Diffstat (limited to '2026/games_submissions/the0x539/main.js')
| -rw-r--r-- | 2026/games_submissions/the0x539/main.js | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/2026/games_submissions/the0x539/main.js b/2026/games_submissions/the0x539/main.js index b89465e..14a2b45 100644 --- a/2026/games_submissions/the0x539/main.js +++ b/2026/games_submissions/the0x539/main.js @@ -8,6 +8,7 @@ import { consumeClock, resetInventory, } from './interaction.js'; +import { scenarios } from './difficulty.js'; const followCursor = document.querySelector('follow-cursor'); const tooltip = document.querySelector('item-tooltip'); @@ -83,7 +84,7 @@ function giveItem(item, count) { let timerInterval = null; function timer() { - if (!document.querySelector('item-stack[data-item="clock"]')) { + if (!document.querySelector('item-stack[data-item="clock"]:not(crafting-output item-stack)')) { // time's up! endGame(false); } else { @@ -96,11 +97,12 @@ function startGame(difficulty) { resetInventory(); + const scenario = scenarios.toReversed().find(s => difficulty >= s.level); + desiredCrafts.clear(); - desiredCrafts.add('helmet'); - desiredCrafts.add('chestplate'); - desiredCrafts.add('leggings'); - desiredCrafts.add('boots'); + for (const item of scenario.goal) { + desiredCrafts.add(item); + } todoList.replaceChildren(); for (const item of desiredCrafts) { @@ -112,12 +114,11 @@ function startGame(difficulty) { todoList.append(listItem); } - - giveItem('log', 64); - giveItem('ingot', 64); - giveItem('clock', 12); - giveItem('dust', 16); - giveItem('cobble', 16); + + for (const [item, amount] of Object.entries(scenario.items)) { + giveItem(item, amount); + } + giveItem('clock', scenario.time(difficulty - scenario.level)); document.addEventListener('mousemove', onMouseMove); timerInterval = setInterval(timer, 1000); |
