Leaf Pup: Kumo's Adventure
A 3D voxel adventure game where you play as a dog exploring infinite procedurally generated forest levels, collecting leaves and hunting for a legendary golden bone.
A browser-based 3D adventure game built in vanilla JavaScript and Three.js where you control a voxel dog character exploring procedurally generated forest worlds. Collect leaves, avoid obstacles, hunt for the golden bone, and unlock emotes through progressive levels.
- Three.js
- WebGL
- Vanilla JavaScript (ES Modules)
- Tailwind CSS
- Web Audio API
- Canvas API
- GLSL Shaders
Leaf Pup is a real-time 3D voxel game running entirely in the browser with no build tools. You play as Kumo, a cheerful voxel dog, exploring an infinite sequence of procedurally generated 40x40 tile worlds. Each level tasks you with collecting a target number of leaves to unlock a golden bone spawned with a custom shader portal effect—finding it completes the level and advances you deeper into the forest. The game is built on vanilla ES Modules, Three.js (v0.165), and Tailwind CSS, running directly in-browser via CDN with no webpack or compilation step.
The architecture centers on a singleton game state object holding the scene, camera, player, and all entity arrays. A deterministic seeding system (using a custom Random class) ensures procedural biome generation and entity placement is replicable; each world tile is seeded via a hash of the worldSeed and tile coordinates. The game loop drives physics, collision detection, and animation updates at 60 FPS using Three.js's requestAnimationFrame. Player input is mapped from keyboard (WASD, Space, E for emotes) and touch controls on mobile, feeding directly into a stamina-gated movement and barking system.
Entity systems handle birds with flocking AI, squirrels with panic behavior and boundary avoidance, falling leaves with physics, and a treasure bone protected by a shockwave collision field. All character animation is code-driven using Math.sin/cos and lerp curves—no GLTF animations. Procedural textures are generated at runtime via Canvas API to keep the asset footprint minimal. The codebase includes a debug terminal (toggled via ?debug URL param), entity inspector, and collider visualization for development.
- Procedurally infinite world generation with deterministic seeding—explore progressively deeper levels with unique biome layouts and obstacle placement
- Voxel character creation with 10+ idle animations, barking, howling, backflips, and sit/lay emotes—all hand-coded procedural animation
- Real-time physics-based entity behavior: birds with flocking, squirrels with panic/boundary logic, falling leaves with collision, stamina-gated player movement
- Custom Three.js shaders for sky gradient, portal effects, and occlusion-based transparency to hide the player when camera clips behind obstacles
- Mobile-responsive touch controls with pause menu, settings (volume, camera sensitivity, inversion), and fast-paced level progression system