A from-scratch, Minecraft-inspired voxel sandbox built with vanilla JS and Three.js. Procedurally generated terrain, first-person movement/physics, and block breaking & placing - all original code with procedurally generated pixel-art textures (no Mojang assets involved).
- On the GitHub page for this project, click the green
<> Codebutton, then click Download ZIP. - Find the downloaded ZIP file (usually in your Downloads folder) and unzip it (double-click it, or right-click and choose "Extract All").
- Open the unzipped folder and double-click
index.html. - It opens in your web browser - click "Click to start" and play!
That's it - no installs, no terminal, nothing else needed. Everything (the 3D engine included) is bundled into this project, so it works completely offline.
If you'd rather serve it over HTTP (e.g. while editing the source files):
npm run devThen open http://localhost:8000 in your browser.
If you change any file in js/, rebuild the bundle that index.html
actually loads:
npm run build(or npm run watch to rebuild automatically while you work.)
- WASD - move
- Mouse - look around (click the screen to lock the pointer)
- Arrow keys - look around (fallback if pointer lock isn't available)
- Space - jump
- Shift - sprint
- Left click - break the targeted block
- Right click - place the selected block
- 1-6 - select a block from the hotbar
index.html/style.css- the page, UI overlay, hotbar, crosshairdist/game.bundle.js- the built game (generated bynpm run build- this is whatindex.htmlactually loads)js/noise.js- seeded Perlin-style noise used for terrain generationjs/textures.js- procedural pixel-art texture atlas (grass, dirt, stone, sand, wood, leaves, water, bedrock)js/world.js- chunked voxel world: terrain/tree generation and mesh building with face cullingjs/player.js- first-person controller with gravity and AABB collisionjs/main.js- scene setup, raycasting for block interaction, hotbar UIjs/vendor/three.module.js- vendored copy of Three.js (bundled in bynpm run build)