I'll build a Minecraft clone with Three.js + react-three-fiber. It'll have voxel terrain, multiple block types, wandering mobs, and full mobile touch controls (joystick + action buttons).
Let me start by exploring the project and installing dependencies.
Let me update the HTML and CSS first, then create the game files.
Now let me create the block definitions and texture generator:
Now let me create the game store with world generation:
Now let me create the World component that renders all blocks using an optimized custom geometry:
Now let me create the Player component with first-person controls, physics, and block interaction:
Now let me create the Mobs component:
Now let me create the mobile controls UI:
Now let me create the main App component:
Now let me build the project to check for any errors:
The build succeeded. Let me do a final verification and add a small title overlay for polish:
Build successful! Here's what I built:
🎮 VoxelCraft — Mobile Minecraft Clone
Voxel World Engine
- 48×48 procedurally generated terrain using simplex noise
- Height-mapped with grass hills, sand beaches, snow peaks, and ocean
- Trees scattered on grass, ores (iron/gold/diamond) embedded at various depths
- Optimized rendering: only visible block faces are drawn (merged BufferGeometry per face type)
16 Block Types with procedurally generated pixel-art textures:
Grass, Dirt, Stone, Cobblestone, Sand, Wood Log, Planks, Leaves, Brick, Glass, Iron Ore, Gold Ore, Diamond Ore, Snow, Water, Bedrock
6 Mob Types with custom box-based geometry and AI:
- 🐖 Pig (pink) — passive, wanders
- 🐄 Cow (brown/white) — passive, wanders
- 🐑 Sheep (white) — passive, wanders
- 🐔 Chicken (white/red) — passive, wanders
- 🧟 Zombie (green, arms forward) — hostile, chases player within 18 blocks
- 💥 Creeper (green with face) — hostile, chases player
Mobile-Friendly Controls (auto-detected):
- Left side: virtual joystick for movement
- Right side: drag anywhere to look around
- Bottom-right: Break (red) and Place (green) action buttons + big JUMP button
- Bottom-center: 14-slot hotbar — tap to select blocks
Desktop Controls:
- Click canvas to capture mouse (pointer lock)
- WASD/Arrows to move, Space to jump
- Mouse to look, Left-click break, Right-click place
- Keys 1–0 to select blocks
Physics & Features:
- AABB collision detection with axis-by-axis resolution
- Gravity + jumping with ground detection
- DDA voxel raycasting for precise block targeting (6-block reach)
- Atmospheric fog, hemisphere + directional lighting
- Respawn if you fall into the void
Files built: index.html, src/index.css, src/blocks.ts, src/store.ts, src/World.tsx, src/Player.tsx, src/Mobs.tsx, src/MobileControls.tsx, src/App.tsx