I'll build a full voxel sandbox game with procedural textures, chunk meshing with ambient occlusion, physics, and three hand-crafted maps (village, castle, desert pyramid). Let me start by exploring the project setup.
Let me check the CSS setup and TypeScript config.
Now let me install Three.js, the only dependency needed for the voxel engine.
Now I'll set up the HTML shell with pixel fonts and the global stylesheet.
Now the block registry — block IDs, per-face texture tiles, material properties, and colors.
Now the procedural texture atlas generator — pixel-art style textures drawn on canvas, plus isometric block icons for the hotbar.
Now the core voxel engine module: the World data structure, chunk meshing with per-vertex ambient occlusion, and a DDA voxel raycaster.
I left a placeholder line in the AO section — let me clean that up right away.
Now the map generators — three detailed worlds with terrain noise and hand-built structures, plus the preview thumbnail renderer.
Now the tiny synthesized sound engine — no audio assets needed, just WebAudio oscillators and noise.
Now the heart of the game — the Engine class: renderer, pointer-lock controls, player physics, block editing, particles, clouds, and chunk management.
Now the React UI: main menu with live-generated map previews, in-game HUD, and pause overlay.
Now App.tsx to orchestrate everything, plus a quick check of main.tsx.
Everything is wired up. Let me build the project to catch any errors.
The build passes. Now let me review and fix a few gameplay-correctness issues I spotted: camera not synced at spawn until first input, a possible unhandled promise rejection on pointer-lock requests, and castle tower doors carved in the wrong spot (diagonal instead of facing the courtyard).
Two more refinements: fix AO refresh across diagonal chunk corners on edits, and tune the light intensities down (Lambert with strong hemi+sun would blow out the textures).
Now let me rebuild to verify everything still compiles cleanly.
The build is green. Let me do a final verification pass over the chunk meshing math — I traced the winding order of all six faces to be certain nothing renders inside-out, and everything checks out. One last thing worth strengthening: the initial camera framing inside the game container when entering (already handled by respawn now syncing the camera).
Here's a summary of what was built:
VoxelCraft — a complete browser Minecraft clone
Core engine (src/game/)
world.ts — 96×48×96 voxel world with chunked meshing (16-column chunks), per-face backface culling, per-vertex ambient occlusion with AO-aware triangulation diagonals, UV-mapped atlas coordinates, lower water surface rendering, and an Amanatides–Woo DDA voxel raycaster for block picking.
textures.ts — a 100% procedural pixel-art texture atlas (22 hand-coded 16×16 tiles: grass, dirt, cobble, planks, bark rings, leaves, glass, bricks, water, gold, cactus…) with NearestFilter crispness, plus isometric 3D block icons for the hotbar drawn via canvas transforms.
engine.ts — Three.js renderer with pointer-lock mouse look, WASD physics with axis-separated AABB collision, gravity/jumping/sprinting, fly mode (F), swimming, hold-to-mine repeat, break/place rules (no bedrock, no placing inside yourself), block-particle bursts, synthesized break/place/step/splash sounds, head bob, drifting clouds, per-map sky/fog/hemisphere lighting themes, and FPS reporting.
maps.ts — three deterministic, structure-rich worlds:
- Greenvale Village — rolling meadows, 5 timber cottages with gabled roofs, windows and chimneys, a central wishing-well plaza with lamp posts, gravel streets, a fenced farm with irrigation channels and crops, trees and bushes.
- Stonehaven Keep — a full castle: crenellated curtain walls, 4 hollow watchtowers with doors and battlements, a gatehouse, plank drawbridge over a 2-deep water moat, and a keep with pillared great hall, long table, tapestries, banners and a gold throne.
- Sunfall Necropolis — dune fields, a 26-step gold-capped pyramid with an explorable corridor into a treasure vault (gold hoard, lamps, hieroglyph walls), a palm-ringed oasis, cacti, and a ruined colonnade with fallen pillars.
Interface
- Menu — dark atmospheric design with Silkscreen pixel typography, ambient glows, and live top-down renders of each actual world as card thumbnails (keyboard
1–3 quick-join).
- HUD — crosshair, 9-slot hotbar with iso icons and scroll/digit selection, block-name flash, FPS counter, fly/mute flags, key hints.
- Pause menu — resume/change-map/mute with a full controls grid; pointer-lock flow handled gracefully (ESC → pause, click → recapture).
Everything — terrain noise, textures, sounds, thumbnails — is generated in code with zero external assets, and the project compiles to a single self-contained HTML file.
Files built: index.html, src/index.css, src/game/blocks.ts, src/game/textures.ts, src/game/world.ts, src/game/maps.ts, src/game/audio.ts, src/game/engine.ts, src/components/Menu.tsx, src/components/HUD.tsx, src/components/PauseMenu.tsx, src/App.tsx