I'll build a complete Minecraft-style voxel game. Let me check the entry files, then install the needed packages.
Packages installed. Now I'll create the core game modules — constants, seeded noise, block registry, and the chunk data structure.
Now the texture atlas (procedural pixel-art painted on canvas) and the chunk mesher with per-vertex ambient occlusion.
Now the mesher — the heart of voxel rendering, with face culling, baked directional shading and smooth per-vertex ambient occlusion.
The mesher needs the world module. Creating it now — chunk lifecycle, terrain generation with cross-chunk trees, edits persistence, and DDA raycasting — plus the player physics module.
Minor TS literal-type issue — B.AIR is as const so the variable narrows to 0. Quick fix:
Now the ambient systems: particle bursts for block breaking, procedural WebAudio sound effects, and the day/night sky rig (sun, moon, stars, drifting clouds, graduated sky colors).
Now the engine — the conductor that ties rendering, input, physics, chunk streaming, interaction, and the day cycle together.
The engine is in. Now the presentation layer — title/menu screens, loading sequence, HUD, hotbar, crosshair — plus global styles and the HTML shell.
Now the app shell, global styles with all the game-UI styling, and the HTML entry with fonts.
All files are in place. Let me build to verify everything compiles.
Build passes on the first shot. Before calling it done, I want to apply a few robustness fixes I spotted: pre-generating the spawn area so the player doesn't fall during load, guarding break effects against unbreakable floor blocks, explicit ReactNode typing, and fuller GPU cleanup on world restart.
Now replacing the React.ReactNode usages with the imported type:
Rebuilding to confirm everything is clean:
One more critical fix from my QA pass: the uniform UV rotation is wrong for the -z/+z side faces — the grass-side texture would appear flipped on two sides. I need per-face UV tables matching the corner winding:
Both edits applied (the transient error was just the mid-edit state). Final build:
The build is green. VoxelCraft is complete — a full Minecraft-style voxel sandbox running in the browser.
What was built
Core engine (src/game/)
world.ts — Chunked infinite world (16×16×64) streamed around the player at render distance 5, with distant-chunk unloading. Seeded fBm value-noise terrain produces continents, lakes, beaches and mountain ranges; trees are planted with a deterministic world-coordinate hash + margin scan so canopies crossing chunk borders render identically from either side. Player edits persist per-chunk even after unload/regenerate. Includes an Amanatides–Woo DDA raycaster for block targeting.
mesher.ts — Custom voxel mesher: neighbor face-culling, correct cross-chunk visibility, per-vertex ambient occlusion, baked directional face shading, upright per-face UVs, and a lowered water surface. Emits separate opaque (leaf cutout via alphaTest) and translucent (glass/water) geometries.
textures.ts — A procedural 16×16 pixel-art texture atlas painted on canvas (grass, dirt, stone, sand, bark, rings, cutout leaves, planks, glass, water, cobble, bricks) plus crisp hotbar icons lifted from the same atlas.
player.ts — AABB physics: substepped integration, per-axis collision resolution, gravity, jumping, sprinting, swimming, and a fly mode (F), with void/ceiling safety nets.
sky.ts / audio.ts / particles.ts — A full 7-minute day/night cycle (graduated sky/fog palettes, sun & moon sprites, stars, drifting clouds, dynamic directional + hemisphere light), synthesized WebAudio SFX (break, place, tick, thud, splash, wind bed) and pooled break particles.
Controls & gameplay
- WASD + mouse look (pointer lock), Space jump, Shift sprint (with FOV kick), F fly, 1–9/scroll hotbar selection, left-click mine (hold to repeat), right-click place with player-collision guard, H help, Esc pause.
- 9 placeable blocks: Grass, Dirt, Stone, Cobblestone, Planks, Oak Log, Leaves, Sand, Glass.
Presentation
- Pixel-styled title screen with animated cube + striped loading bar and rotating tips, pause menu with world regeneration, HUD chips (FPS, XYZ, chunks, day/period), animated hotbar with block-name callouts, crosshair, vignette, underwater fog/tint, and walk-bob camera juice.
Files built: src/game/constants.ts, src/game/noise.ts, src/game/blocks.ts, src/game/chunk.ts, src/game/textures.ts, src/game/mesher.ts, src/game/world.ts, src/game/player.ts, src/game/particles.ts, src/game/audio.ts, src/game/sky.ts, src/game/engine.ts, src/GameView.tsx, src/App.tsx, src/index.css, index.html