You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Depends on #1 (crafting) for shaped recipes, #2 (ores) for tier materials, and #3 (smelting) to turn ores into usable ingots. Build last of the four interlocking survival systems.
Context
src/game/Items.ts:7-8 explicitly defers tools: the comment notes "Item ids are strings so the registry can grow to tools/materials later" — but ItemDef.icon (line 27) currently only supports "block" | "food". There are no pickaxe/axe/shovel/sword/hoe items and no tool-tier mining logic.
Scope
src/game/Items.ts — extend ItemDef to support tools:
category: "tool" | "weapon" | "armour" added to the icon/union
Mining speed + durability — wire into the mining code path (in Game.ts around the right-click/mining handler ~Game.ts:723, and PlayerState.ts). Each block mined decrements durability; speed scales by tier vs. block hardness.
Weapons — sword damage + knockback + i-frames in the combat path (combat itself is Phase 3, but the item/damage plumbing lands here).
Armour — helmet/chestplate/leggings/boots slots in inventory; damage-soak hook in PlayerState.ts damage handling.
src/ui/InventoryUI.ts + ui.css — durability bar overlay on hotbar/inventory slots; armour slot panel.
Acceptance criteria
Craft a wooden pickaxe; mining stone is visibly faster than hand-mining and consumes durability.
Depends on #1 (crafting) for shaped recipes, #2 (ores) for tier materials, and #3 (smelting) to turn ores into usable ingots. Build last of the four interlocking survival systems.
Context
src/game/Items.ts:7-8explicitly defers tools: the comment notes "Item ids are strings so the registry can grow to tools/materials later" — butItemDef.icon(line 27) currently only supports"block" | "food". There are no pickaxe/axe/shovel/sword/hoe items and no tool-tier mining logic.Scope
src/game/Items.ts— extendItemDefto support tools:category: "tool" | "weapon" | "armour"added to the icon/uniontier: "wood" | "stone" | "copper" | "iron" | "gold" | "diamond"toolType: "pickaxe" | "axe" | "shovel" | "sword" | "hoe"durability: number,miningSpeed: number,damage: numberTextures.ts; atlas has spare tiles).src/game/Recipes.ts(from Voxel lighting + day/night cycle (sun, moon, two-channel shading) #1) — shaped recipes for each tool across all tiers (pickaxe = 3 head + 2 sticks, etc.).Game.tsaround the right-click/mining handler ~Game.ts:723, andPlayerState.ts). Each block mined decrements durability; speed scales by tier vs. block hardness.PlayerState.tsdamage handling.src/ui/InventoryUI.ts+ui.css— durability bar overlay on hotbar/inventory slots; armour slot panel.Acceptance criteria
Roadmap reference
Phase 2 — "Tools, weapons & armour".