This repository contains a minimal 3D starter built with three.js and Vite. It includes basic player controls, enemy spawning/AI, HUD, and level geometry scaffolding.
scripts/– ES modules for the game loop and engine helpers.core/– Scene/camera/renderer setup and level utilities.player/– Player controller, aiming, and shooting logic.enemy/– Simple enemy actor and spawner.hud/– Lightweight DOM HUD overlay.
config/– Tunable gameplay and scene configuration.scenes/– Level JSON files (e.g.,trainingGround.json).assets/– Placeholder for textures, models, and audio.index.html– Entry point that mounts the renderer and HUD.
- Install dependencies:
npm install
- Run the development server:
Open the printed local URL in your browser. Click to lock the mouse, use WASD to move, and left-click to fire.
npm run dev
- Build for production:
npm run build
- Preview the production build locally:
npm run preview
- The
trainingGroundlevel spawns cone-shaped enemies at timed intervals from predefined points. - Projectiles travel in the direction the camera is facing and remove enemies on contact.
- The HUD shows your score and number of active enemies. Update configuration values in
config/gameConfig.jsto tweak speeds, fire rate, and spawn density.