Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🏝️ Island Survival 3D

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.

🎮 Game Features

  • 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

🎯 How to Play

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)

Survival Tips

  • 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

🛠️ Technical Details

Architecture

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

Technologies Used

  • 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

🚀 Getting Started

  1. Clone or download this repository
  2. Open index.html in a modern web browser
  3. Click "Start Game" to begin your survival adventure!

Browser Requirements

  • Modern browser with WebGL support
  • Recommended: Chrome, Firefox, Safari, or Edge

📁 Project Structure

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

🎨 Game Mechanics

Resource Types

  • 🌳 Wood - Collected from trees and fallen branches
  • 🪨 Stone - Gathered from rocks scattered around the island
  • 🍓 Food - Found in bushes and mushrooms

Weather Events

  • 🌧️ Rain - Slows movement, increases hunger drain
  • 💨 Wind - Pushes player around, makes movement challenging

Special Events

  • 📦 Treasure Crates - Contain multiple resource types
  • 🍄 Mushroom Spawns - Extra food sources appear
  • 🌿 Fallen Branches - Additional wood resources

🔧 Development

To modify or extend the game:

  1. Each JavaScript module handles specific functionality
  2. The gameState object contains all shared game data
  3. Three.js objects are managed in scene.js
  4. UI updates are centralized in ui.js
  5. Add new events in events.js

📜 License

This project is open source. Feel free to use, modify, and distribute as needed.

🎯 Survival Challenge

Can you survive the island? Test your resource management skills and see how many days you can last!

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages