A 3D space shooter game where players pilot an X-wing fighter on a mission to destroy the Death Star.
You can play the game online at: https://trilogy-group-1.github.io/spacewars/
Space Wars is a browser-based 3D game built with Three.js that recreates the iconic trench run scene from Star Wars. Players navigate through the Death Star's surface, avoid obstacles and enemy fire, and ultimately attempt to hit the thermal exhaust port to destroy the Death Star.
- 3D environment with the Death Star surface and trench
- Controllable X-wing fighter with realistic flight physics
- Enemy TIE fighters and turret defenses
- Collision detection and damage system
- Power-ups and special abilities
- Sound effects and background music
- Score tracking and high score system
- Set up the project structure and dependencies
- Create a basic 3D scene with Three.js
- Implement camera controls and basic rendering
- Create or import an X-wing 3D model
- Implement player controls (keyboard/mouse)
- Add basic flight physics and boundaries
- Create the Death Star surface environment
- Design the trench run path
- Add obstacles and collision detection
- Add weapons system for the X-wing
- Implement enemy TIE fighters with basic AI
- Add turret defenses along the trench
- Create game states (start, play, game over)
- Implement scoring system
- Add win/lose conditions
- Add sound effects and music
- Implement visual effects (explosions, laser blasts)
- Optimize performance
- Add menu and instructions
- HTML5, CSS3, JavaScript
- Three.js for 3D rendering
- WebGL for graphics acceleration
- Howler.js for sound management (optional)
- Node.js (v14 or higher)
- npm
-
Clone the repository:
git clone https://github.com/yourusername/spacewars.git cd spacewars
-
Install dependencies:
npm install
-
Start the development server:
npm start
-
Open your browser and navigate to
http://localhost:5173
To build the project for production:
npm run build
The built files will be in the dist
directory.
This project is set up to automatically deploy to GitHub Pages when you push to the main branch.
To set up GitHub Pages deployment:
- Go to your GitHub repository settings
- Navigate to "Pages"
- Under "Build and deployment", select "GitHub Actions" as the source
- The workflow will automatically build and deploy your site
- W/S: Pitch up/down
- A/D: Roll left/right
- Q/E: Yaw left/right
- Shift: Boost speed
- Space: Fire weapons
This project is licensed under the MIT License - see the LICENSE file for details.
- Inspired by Star Wars and the iconic Death Star trench run scene
- Thanks to the Three.js community for their excellent documentation and examples