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 | |
| parent | 3ec03ba57474aa4320cb7901980b55706adbc111 (diff) | |
Update
Diffstat (limited to '2026/games_submissions/the0x539')
| -rw-r--r-- | 2026/games_submissions/the0x539/data.js | 6 | ||||
| -rw-r--r-- | 2026/games_submissions/the0x539/difficulty.js | 100 | ||||
| -rw-r--r-- | 2026/games_submissions/the0x539/interaction.js | 4 | ||||
| -rw-r--r-- | 2026/games_submissions/the0x539/items/gold.png | bin | 0 -> 399 bytes | |||
| -rw-r--r-- | 2026/games_submissions/the0x539/main.js | 23 |
5 files changed, 120 insertions, 13 deletions
diff --git a/2026/games_submissions/the0x539/data.js b/2026/games_submissions/the0x539/data.js index dba5d6d..977c557 100644 --- a/2026/games_submissions/the0x539/data.js +++ b/2026/games_submissions/the0x539/data.js @@ -7,6 +7,7 @@ const ingredients = { c: 'cobble', C: 'chest', S: 'string', + g: 'gold', } function recipe(...shape) { @@ -77,6 +78,11 @@ export const recipes = { 's S', ' sS', ), + clock: recipe( + ' g ', + 'gdg', + ' g ', + ), }; export const amounts = { diff --git a/2026/games_submissions/the0x539/difficulty.js b/2026/games_submissions/the0x539/difficulty.js new file mode 100644 index 0000000..87a86b9 --- /dev/null +++ b/2026/games_submissions/the0x539/difficulty.js @@ -0,0 +1,100 @@ +export const scenarios = [ + { + level: 0, + items: { + log: 2, + }, + goal: ['chest'], + time: _ => 10, + }, + { + level: 5, + items: { + plank: 7, + cobble: 6, + dust: 8, + ingot: 4, + }, + goal: ['piston'], + time: d => 15 - d, + }, + { + level: 10, + items: { + log: 2, + cobble: 4, + dust: 2, + ingot: 1, + }, + goal: ['piston'], + time: d => 15 - d, + }, + { + level: 13, + items: { + log: 8, + }, + goal: ['pickaxe'], + time: d => 15 - d, + }, + { + level: 18, + items: { + ingot: 8, + plank: 8, + }, + goal: ['hopper'], + time: d => 20 - d, + }, + { + level: 21, + items: { + ingot: 12, + log: 3, + }, + goal: ['hopper'], + time: d => 20 - d, + }, + { + level: 25, + items: { + ingot: 24, + }, + goal: ['helmet', 'chestplate', 'leggings', 'boots'], + time: d => 18 - d, + }, + { + level: 30, + items: { + ingot: 28, + log: 1, + string: 3, + }, + goal: ['helmet', 'chestplate', 'leggings', 'boots', 'bow'], + time: d => 30 - d, + }, + { + level: 35, + items: { + ingot: 24, + log: 1, + string: 3, + gold: 64, + dust: 17, + }, + goal: ['helmet', 'chestplate', 'leggings', 'boots', 'bow'], + time: _ => 15, + }, + { + level: 40, + items: { + ingot: 24, + log: 1, + string: 3, + gold: 63, + dust: 15, + }, + goal: ['helmet', 'chestplate', 'leggings', 'boots', 'bow'], + time: _ => 15, + }, +]; diff --git a/2026/games_submissions/the0x539/interaction.js b/2026/games_submissions/the0x539/interaction.js index 9c3cd37..d45d5c9 100644 --- a/2026/games_submissions/the0x539/interaction.js +++ b/2026/games_submissions/the0x539/interaction.js @@ -347,7 +347,7 @@ export function consumeClock() { if (state === 'split-evenly' && splitTargets.size > 1) { // oh dear. this is a complicated situation // first, let's try to search for uninvolved clocks - const uninvolved = document.querySelector('inventory-cell > item-stack[data-item="clock"]:not([data-original-count])'); + const uninvolved = document.querySelector('inventory-cell > item-stack[data-item="clock"]:not([data-original-count]):not(crafting-output item-stack)'); if (!!uninvolved) { const count = getCount(uninvolved); if (count === 1) { @@ -368,7 +368,7 @@ export function consumeClock() { return; } - const stack = document.querySelector('item-stack[data-item="clock"][data-count]'); + const stack = document.querySelector('item-stack[data-item="clock"][data-count]:not(crafting-output item-stack)') const count = getCount(stack); if (count === 1) { if (stack.parentElement === grabbedStack) { diff --git a/2026/games_submissions/the0x539/items/gold.png b/2026/games_submissions/the0x539/items/gold.png Binary files differnew file mode 100644 index 0000000..99b1a46 --- /dev/null +++ b/2026/games_submissions/the0x539/items/gold.png 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); |
