I'll build "BlockMiner" — a polished 2D Minecraft-style mining arcade game (dig down, grab ores, outrun the rising lava) with canvas rendering, juicy feedback, and full keyboard + touch controls. Let me look at the project first.
Now the core game data definitions:
Now the procedural world generator:
Now the pixel-art texture generator:
Now the WebAudio SFX module:
isolatedModules is on — I'll switch the const enum to a regular enum to be safe with esbuild:
Now the main game engine — physics, mining, rising lava, particles, camera shake, rendering, and the fixed-step loop:
Now the React shell — screens, HUD, touch controls, and the local high-score table:
Rebuild to confirm everything is clean:
Build succeeds. BlockMiner is complete — a polished, Minecraft-themed arcade mining game.
What I built
Core loop (fun in <10s): You spawn on grass with coal seeded right below the surface, so you're breaking blocks and scoring within seconds. After a 7-second on-screen countdown, a wall of lava starts descending from the sky — dig deep, loot ores, and outrun it. Deeper = richer (coal → iron → gold → diamond → emerald), and chaining ores within 4 seconds builds a combo multiplier up to x5.
Engine (src/game/engine.ts) — pure canvas, no game libs, 60fps:
- Tight platformer physics: acceleration/friction, coyote time, jump buffering, variable jump height, per-axis AABB tile collision
- Auto-mining: push into a block to mine it, hold S/⛏ to dig down, with 4-stage crack overlays and a pulsing target highlight
- Juice everywhere: screen shake (breaks, ore pops, damage, death), colored block-debris particles, floating score popups, squash & stretch on jump/land, ambient ore sparkles, ember rain from the lava front, heat-glow screen edge, damage flash, hurt knockback with i-frame blinking
- Depth-based lighting: sky fades to darkness, radial vignette follows the player
- Animated pixel-art Steve with walk cycle, swinging pickaxe, and eyes that flip with facing
Procedural world (world.ts) — seeded value-noise caves, depth-scaled ore veins, lava pockets (cost a heart), bedrock walls; rows generate lazily so depth is infinite.
Textures (textures.ts) — all block sprites are pre-rendered 16×16 pixel-art canvases generated at boot (zero assets).
Sound (sfx.ts) — dependency-free WebAudio synth: dig ticks, break crunches, rising collect arpeggios that stack with your combo, hurt/death stings, lava sirens.
Shell (App.tsx):
- Start screen with animated title over a live scenic world render, controls guide, and high scores
- HUD: hearts, big score + combo badge, depth meter, live "LAVA Xm ↑" proximity warning, pause button
- Pause (Esc/P or button) and game-over screens with instant restart (R/Enter/Space or tap)
- Local high-score table (top 8 with depth + date in localStorage), "NEW BEST RUN!" callout
- Touch controls: ◀ ▶ move buttons plus ⛏ dig and ▲ jump, multi-touch capable, auto-shown on coarse-pointer devices, safe-area aware
Performance stays smooth via a single rAF loop, only-visible tile rendering, pooled particles, capped devicePixelRatio (2), and HUD state throttled to 10Hz so React never fights the canvas.
Files built: index.html, src/index.css, src/game/defs.ts, src/game/world.ts, src/game/textures.ts, src/game/sfx.ts, src/game/engine.ts, src/App.tsx