A Three.js first-person game MVP with environment and NPCs.
Watch the project demo : https://drive.google.com/drive/folders/1wMcjeZUnxxQjFv-XirCTFLBwgLxFhf4J?usp=drive_link
- First-person perspective with WASD movement and mouse look
- Small environment with hut, trees, bushes, and rocks
- 2 NPCs that spawn near the player
- Modular NPC system ready for future expansion (personality, attributes, behaviors)
- Install dependencies:
npm install- Run development server:
npm run dev- Open your browser to the URL shown (typically http://localhost:5173)
- WASD - Move around
- Mouse - Look around
- Click - Lock pointer for mouse control
src/main.js- Main game entry pointsrc/FirstPersonController.js- First-person camera and movement controlssrc/Environment.js- Environment generation (hut, trees, bushes, rocks)src/NPC.js- NPC class with structure for future expansion
The NPC system is designed with future features in mind:
- Personality traits
- Character attributes
- Behavior system
- State management
- Interaction system