A dynamic 3D survival game built with Three.js where you must survive on a procedurally generated island while managing resources and facing environmental challenges.
- 3D Island Environment: Explore a beautiful 3D island with trees, rocks, and bushes
- Survival Mechanics: Monitor hunger and energy levels to stay alive
- Resource Collection: Gather wood, stone, and food to survive
- Dynamic Weather: Experience rain and wind that affect gameplay
- Day/Night Cycle: Watch the environment change throughout the day
- Random Events: Discover treasure crates, mushroom spawns, and fallen branches
- Immersive Controls: WASD movement with mouse look controls
- WASD / Arrow Keys - Move around the island
- Mouse - Look around (first-person view)
- Click / E - Gather resources
- F - Eat food to restore hunger
- R - Rest to restore energy (skips time)
- Shift - Run (drains energy faster)
- Keep your hunger and energy above 0 or you'll die
- Eat food regularly to maintain hunger
- Rest when energy is low (but not when it's above 80%)
- Running drains energy faster but helps during emergencies
- Weather events like rain slow your movement
- Look for treasure crates and mushrooms for bonus resources
The game uses a modular JavaScript architecture:
- gameState.js - Central state management
- scene.js - Three.js scene setup and world creation
- player.js - Movement controls and player actions
- resources.js - Resource spawning and collection
- weather.js - Weather system and effects
- events.js - Random event generation
- ui.js - User interface updates
- main.js - Game loop and initialization
- Three.js r128 - 3D graphics and rendering
- HTML5 - Game structure and UI elements
- CSS3 - Styling, animations, and visual effects
- Vanilla JavaScript - Game logic and interactions
- Clone or download this repository
- Open
index.htmlin a modern web browser - Click "Start Game" to begin your survival adventure!
- Modern browser with WebGL support
- Recommended: Chrome, Firefox, Safari, or Edge
Island Survival/
├── index.html # Main HTML file
├── css/
│ └── styles.css # All game styling
├── js/
│ ├── main.js # Game initialization and loop
│ ├── gameState.js # State management
│ ├── scene.js # Three.js setup
│ ├── player.js # Player controls
│ ├── resources.js # Resource system
│ ├── weather.js # Weather effects
│ ├── events.js # Random events
│ └── ui.js # UI management
└── README.md # This file
- 🌳 Wood - Collected from trees and fallen branches
- 🪨 Stone - Gathered from rocks scattered around the island
- 🍓 Food - Found in bushes and mushrooms
- 🌧️ Rain - Slows movement, increases hunger drain
- 💨 Wind - Pushes player around, makes movement challenging
- 📦 Treasure Crates - Contain multiple resource types
- 🍄 Mushroom Spawns - Extra food sources appear
- 🌿 Fallen Branches - Additional wood resources
To modify or extend the game:
- Each JavaScript module handles specific functionality
- The
gameStateobject contains all shared game data - Three.js objects are managed in
scene.js - UI updates are centralized in
ui.js - Add new events in
events.js
This project is open source. Feel free to use, modify, and distribute as needed.
Can you survive the island? Test your resource management skills and see how many days you can last!