Build a polished, playable browser game: Roots of Yore — Detailed Concept The Hook A…
- User
Build a polished, playable browser game: Roots of Yore — Detailed Concept The Hook A root-growing puzzle game where you guide a seedling's roots through dark soil to reach underground water sources. Each level is a procedurally-woven dirt grid with hidden aquifers, rocks, nutrients, and buried secrets. Core Mechanic — Root Drawing - The player draws root paths through the soil by clicking/holding on a grid - Roots grow in the direction you drag, branching when you want - Limited root energy per level — you can't just dig everywhere - Roots hit obstacles: rocks (block path), caves (open passages), worm tunnels (speed boost) Progression - Early levels: Simple straight-down digging, one water source - Mid levels: Multiple water sources to connect, branching roots, puzzles that require splitting your main root - Late levels: Roots must grow around deep rock formations, navigate through worm tunnels, avoid acidic soil patches that drain energy Soil Layers & Resources Layer Depth What's there Topsoil 0–20% Loose, cheap to dig. Seeds, fallen leaves (bonus nutrients) Clay 20–50% Denser, costs 2× energy. Hidden water veins, small fossils Bedrock 50–80% Very dense, 3× energy. Rare crystals (score boost), underground rivers Deep Earth 80–100% Molten pockets, geothermal vents. Endgame water sources Energy System - You start each level with 100 energy - Each grid cell of soil costs energy to grow through: - Topsoil: 1 energy - Clay: 2 energy - Bedrock: 3 energy - Roots regain energy when touching water or nutrient pockets - Branching costs extra (branching is a strategic trade-off) Visual Style (pixel art, Itch-ready) - Dark soil cross-section view — like looking into an ant farm - Roots glow with a warm green/gold pulse - Water shimmers when you're near it (subtle blue glow through soil) - Rocks are craggy grey-brown, fossils are bone-white - Crystals pulse with a soft purple light Level Structure World 1 — "The Seedling" (5 levels) - Learn to grow straight down - Simple single water target - Intro to energy management World 2 — "The Sapling" (5 levels) - Branching introduced - Two water sources to connect - Rocks appear as obstacles World 3 — "The Crown" (5 levels) - Nutrients, crystals, fossils for bonuses - Multiple branching puzzles - Acidic soil (damages root) World 4 — "The Deep" (5 levels) - Bedrock layer puzzles - Geothermal vents as hazards - Final boss-level: connect 5 water sources with minimal energy Scoring - Base: 100 pts per water source connected - Energy bonus: leftover energy × 10 - Bonus collectibles: fossils (+50), crystals (+100), ancient roots (+200) - Speed bonus: faster completion = multiplier up to 2× - Perfection: connect all sources on a level without dying = extra star Sound & Feel - Soft earthy crunch when roots grow - Musical chime when hitting water - Deep rumble when hitting bedrock - Gentle ambient droning that changes with depth. Make the core loop fun within the first ten seconds, with tight controls for both keyboard and touch, and juicy feedback — screen shake, particle effects, and satisfying animations. Include a start screen, a score system, pause and game-over states with instant restart, and a local high-score table. Style it with a cohesive visual theme and make sure it runs smoothly at 60fps on desktop and mobile.
Assistant
I will explore the existing project files to understand the setup.
I will check
package.jsonto see installed packages and dependencies.I will install
lucide-reactfor rich iconography throughout the game UI andcanvas-confettifor celebratory effects upon winning levels and unlocking worlds.I will read
src/index.cssto verify our styling and Tailwind setup.I will read
index.htmlto see the current page title and metadata.I will now update
index.htmlto give the game an appropriate title ("Roots of Yore — Ant Farm Root Growing Puzzle Game"), import rich fonts (Cinzelfor fantasy/yore feel andInter/Fira Codefor crisp game HUD), and set dark theme styles.I will now create
src/types/game.tsto define the complete type definitions for cells, soil layers, root nodes, level configurations, game states, particles, and achievements.I will now create
src/utils/audio.tsimplementing a Web Audio API procedural sound engine that generates crisp soil digging sounds, water chimes, crystal resonances, and dynamic depth ambience.I will now create
src/data/levels.tswith all 20 levels spanning the 4 themed worlds (The Seedling,The Sapling,The Crown,The Deep) plus an endless procedural level generator.I will now create
src/components/CanvasRenderer.tsxwhich renders the ant-farm cross-section view with responsive high-DPI scaling, organic root splines, pulsing energy flow, animated water shimmer, and interactive drag-drawing controls.I will now create
src/components/Header.tsxto display real-time game HUD metrics including the energy gauge, water progress, score, level title, undo/restart controls, and audio toggles.I will now create
src/components/StartScreen.tsxwhich provides an immersive entrance to the game with career mode access, endless mode generator, tutorial guide, career stats, and sound settings.I will now create
src/components/WorldSelect.tsxto let players navigate through all 4 subterranean worlds and choose any unlocked level with star rating indicators and high scores.I will now create
src/components/LevelCompleteModal.tsxwhich awards stars, shows a full point breakdown, launches celebratory confetti, and allows progression to the next level.I will now create
src/components/GameOverModal.tsxdisplaying specific failure reasons, progress made, instant retry, and helpful gameplay hints.I will now create
src/components/EncyclopediaModal.tsxproviding an illustrated lore book covering every soil layer, collectible, and hazard with precise energy costs and strategic advice.I will now create
src/components/ControlsOverlay.tsxshowing clear diagrams and instructions for touch drawing, mouse drag, branching, undoing steps, and keyboard shortcuts.I will now create
src/components/EndlessModeSetup.tsxallowing players to generate infinite custom underground puzzles with selectable dimensions, difficulty settings, and seed parameters.I will now create
src/App.tsxcontaining the full game state manager, level loader, root growth logic with pathfinding/tunnel jumping, sound effects triggers, particle engine, dynamic depth drone updates, local storage career persistence, and screen routing.I will inspect
src/main.tsxto see howAppis being imported.I will now edit
src/App.tsxto fix theAppdefault export and clean up the unusedwaterGainedvariable declaration.I will search for any reference to
waterGained = trueinsrc/App.tsxand fix it along with adding the default export.I will now remove the redundant
waterGained = true;statement from line 373 and appendexport default App;to the end ofsrc/App.tsx.I will read the last lines of
src/App.tsxto add the default export cleanly.I will read the last lines of
src/App.tsxto addexport default App;.I will now add
export default App;to the end ofsrc/App.tsx.I will now run
build_projectto verify that our entire game builds and bundles cleanly.I have built Roots of Yore — Deep Earth Root Puzzle Game, a full-featured, juicy, and playable browser game created with React, Vite, Tailwind CSS, and HTML5 Canvas.
🌿 What Was Built & Implemented:
-
Ant-Farm Cross-Section Canvas Engine (
src/components/CanvasRenderer.tsx):- Visual Stratigraphy: Renders distinct soil horizons (
Topsoil 0–20%,Clay 20–50%,Bedrock 50–80%,Deep Earth 80–100%) complete with atmospheric sky/grass horizon, underground caves, pulsing water caustics, and organic dirt texturing. - Organic Root Splines & Energy Pulse: Roots grow as organic curved pathways connecting parent nodes to branches, complete with golden-green cores and animated energy ripples flowing from the surface seedling down to all active root tips.
- Ghost Hover & Cost Preview: When hovering or dragging near an active root tip, shows a glowing path preview and exact energy cost badge (
-1,-2,-3,BLOCK, etc.) so you never waste precious energy by accident. - Smooth Drag Drawing: You can click adjacent cells to grow step-by-step, or click and drag across multiple cells to grow continuous root paths smoothly.
- Effortless Branching: Click any existing node along your root line to highlight it as an active branching point, then drag in any direction to split your roots (
+1branching strategic cost).
- Visual Stratigraphy: Renders distinct soil horizons (
-
Web Audio Procedural Sound & Drone Engine (
src/utils/audio.ts):- Zero-Latency Procedural Audio: Generates crisp sound effects dynamically using Web Audio API without requiring bulky external audio files.
- Unique Soil Crunches: Distinct high-pass/band-pass filtered noise bursts for topsoil, heavy dense thuds for clay, and 60Hz/90Hz sub-bass rumbles for bedrock and magma digging.
- Harmonic Chimes & Relics: Shimmering arpeggiated chimes when reaching water aquifers (
C5 -> E5 -> G5 -> C6), crystalline resonance rings for geodes (A5 -> C#6 -> E6), bone crackles for fossils, and sizzling bubbles when touching acid patches. - Dynamic Subterranean Drone: Background ambient drone pad (
Osc1 + Osc2 + BiquadFilter) whose pitch and low-pass cutoff automatically shift deeper into bass frequencies as your deepest root tip descends into lower layers.
-
20 Career Progression Levels across 4 Worlds + Endless Mode (
src/data/levels.ts):- World 1 — "The Seedling" (Levels 1–5): Master straight/diagonal digging, energy budgeting, topsoil vs. clay costs, and your first nutrient pods (
+20 Energy) and fossils (+50 Pts). - World 2 — "The Sapling" (Levels 6–10): Introduce branching to connect two separate water sources (
targetWaterCount: 2), navigate around craggy rocks (rock), and enter swirling orange/cyan Worm Tunnels to instantly slide out the matching tunnel across the map for0energy. - World 3 — "The Crown" (Levels 11–15): Break into the 3× energy Bedrock layer, mine glowing purple crystals (
+100 Pts), dodge bubbling green Acidic Soil (-8 Energy), and traverse open cave air corridors (0 Energy). - World 4 — "The Deep" (Levels 16–20): Plunge into the 4× energy Deep Earth magma layer, dodge scorching Geothermal Vents (
-12 Energy), discover ancient preserved world-tree roots (+200 Pts & +25 Energy), and conquer the 16×24 Final Boss-Level requiring you to connect 5 distinct water aquifers across all 4 layers. - Endless Deep Generator (
src/components/EndlessModeSetup.tsx): An infinite procedural ant-farm level generator allowing customized grid sizes (Medium 13x20,Deep 15x24,Colossal 17x28), difficulty presets (Relaxed,Normal,Hardcore), and custom numeric seeds.
- World 1 — "The Seedling" (Levels 1–5): Master straight/diagonal digging, energy budgeting, topsoil vs. clay costs, and your first nutrient pods (
-
Juicy Feedback, Stats & UI Modals (
src/components/&src/App.tsx):- Real-Time HUD (
Header.tsx): Shows live energy gauge with warning pulse when< 20energy, connected aquifer counter, score counter, audio toggles, and instant action buttons. - Juicy Particles & Screen Shake: High-performance particle bursts when digging cells, water droplet splashes on aquifer connections, and bombastic screen shake when hitting rocks, acid, or vents.
- Celebratory Victory & Confetti (
LevelCompleteModal.tsx): Awards 1, 2, or 3 stars based on leftover energy, breaks down score multipliers (Speed Multiplier up to 2x), and fires celebratory confetti (canvas-confetti). - Instant Restart & Undo System: Press
ZorBackspace(or the HUD button) to retract your last root step (up to any point along the branch) to correct mistakes. PressRto instantly retry a level. - Subterranean Encyclopedia & Lore (
EncyclopediaModal.tsx): An illustrated compendium detailing the exact energy costs, score boosts, and strategic tips for every soil layer, collectible, and hazard. - Local High-Score & Star Table: Persists level scores, star ratings (
60 total stars across career), and career statistics (roots grown, water drank, fossils found) tolocalStorage.
- Real-Time HUD (
Files built:
index.html,src/types/game.ts,src/utils/audio.ts,src/data/levels.ts,src/components/CanvasRenderer.tsx,src/components/Header.tsx,src/components/StartScreen.tsx,src/components/WorldSelect.tsx,src/components/LevelCompleteModal.tsx,src/components/GameOverModal.tsx,src/components/EncyclopediaModal.tsx,src/components/ControlsOverlay.tsx,src/components/EndlessModeSetup.tsx,src/App.tsx-
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.