Rocket Raiders is a fast-paced multiplayer space shooter game where players engage in thrilling cosmic battles using high-speed rockets and powerful weapons. The game takes you to the depths of space, where skillful maneuvering and strategic attacks are the keys to survival.
- Multiplayer Battles: Engage in real-time cosmic battles against players from around the world.
- Dynamic Gameplay: Navigate your rocket through an ever-changing field of asteroids and enemies.
- Power-Ups: Collect power-ups to enhance your rocket's abilities and survive longer.
- High Scores: Compete with friends and players worldwide for the highest score.
- Responsive Design: Enjoy the game on both desktop and mobile devices.
- Immersive Soundtrack: Experience the thrill of space with an engaging soundtrack and sound effects.
- MERN Stack (MongoDB, Express.js, React.js, Node.js)
- Redis
- EJS (Embedded JavaScript)
- Vanilla JavaScript
- HTML5 Canvas
- CSS3
- Webpack (Module bundler)
-
Clone the repository:
git clone https://github.com/GoldenThrust/rocket-raiders.git
-
Navigate to the project directory:
cd rocket-raiders
-
Install the dependencies:
npm install
-
Configure the environment variables by creating a
.env
file in the root directory based on the.env-example
file:cp .env-example .env
Update the
.env
file with your configuration:DEV=true PORT=3001 REDIS_URL=127.0.0.1:6379 MONGODB_URI='mongodb://127.0.0.1:27017/rocket-raiders' COOKIE_SECRET=your_cookie_secret JWT_SECRET=your_jwt_secret VITE_HOST_URL=https://localhost:3001 HOST_URL=https://localhost:3001 EMAIL_HOST=smtp.mailtrap.io EMAIL_PORT=587 EMAIL_USER=your_email_user EMAIL_PASS=your_email_pass
-
Set up email service for user authentication. This configuration is required to send verification emails, password reset emails, etc. You can use services like MailDev, Mailtrap or SendGrid. Make sure to replace the placeholder values in .env with your email service credentials.
-
Run the following commands to build and serve the application:
npm run pack npm run build npm run server
-
Open your browser and go to
http://localhost:3001
to play the game.
Note: Always use npm run start-server when not running in production or https server.
- To create a Rocket and Map, you need to set up an admin account. Run the following command, which will prompt you to enter your email address. After entering your email, a link will be sent to activate your account:
node createAdmin.js
-
Once the admin account is created, navigate to http://localhost:3001/auth/admin/login. Enter your activated email address, and an authentication link will be sent to your email. Click on the link to authenticate.
-
After authentication, click on the login button. You will be redirected to the homepage, where you can add rockets and image assets.
Below are the available npm scripts for the project:
- build: Compiles the production build of the client using
cross-env
andreact-router
.npm run build
- dev: Starts the development server with
react-router
.npm run dev
- start: Serves the built client files using
serve
.npm run start
- typecheck: Runs type checking using
react-router typegen
andtsc
.npm run typecheck
- server: Runs the server by executing
index.js
andworker.js
.npm run server
- start-server: Starts the server with
nodemon
for automatic restarts.npm run start-server
- pack: Bundles the application using
webpack
.npm run pack
- test: Placeholder for running tests.
npm test
-
Controls:
- Keyboard: Use the arrow keys to move the rocket.
- Shooting: Press Enter or Shift to shoot, or click/hold the screen (on mobile) to shoot.
- Mobile: Hold the screen to shoot and move the rocket using device motion (tilt the phone).
-
Objective:
The goal of Rocket Raiders is to accumulate the most kills by destroying enemy rockets and obstacles. Engage in fast-paced, multiplayer cosmic battles and be the last rocket standing with the highest kill count. -
Tips:
- Keep an eye on the Minimap of the screen for incoming enemies.
- Use power-ups strategically to boost your chances of survival.
- Always keep moving to avoid being an easy target.
Feel free to contribute to Rocket Raiders. Here are the steps to set up the development environment:
- Fork the repository.
- Create a new branch for your feature or bugfix:
git checkout -b feature-name
- Commit your changes:
git commit -m "Add feature or fix description"
- Push your branch:
git push origin feature-name
- Create a pull request.
Contributions are welcome! Please read the CONTRIBUTING.md file for more information on how to get involved.
Rocket Raiders is licensed under the MIT License. See the LICENSE file for more information.