Skip to content

RPS Multiplayer is a simple real-time game where two players can play Rock, Paper, Scissors from different devices by sharing the same Game ID.

Notifications You must be signed in to change notification settings

hadishah123/RPS-Royale

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RPS Multiplayer (Rock Paper Scissors)

🎯 Overview

RPS Multiplayer is a simple real-time game where two players can play Rock, Paper, Scissors from different devices by sharing the same Game ID.
It uses Node.js, Express, and Socket.IO for the backend, and HTML + Tailwind CSS for the frontend.

📸 Preview

Gameplay Screenshot

🛠️ Tech Stack

Layer Technologies
Frontend HTML, TailwindCSS, JavaScript, Socket.IO Client
Backend Node.js, Express, Socket.IO
Styling Tailwind CSS (via CDN)
Deployment Render / Railway (WebSocket-friendly)

📁 Folder Structure

rps-multiplayer/
├── package.json
├── server.js
├── README.md
└── public/
    ├── index.html
    ├── style.css
    └── script.js

⬇️ Installation

npm install

🧑‍💻 Run (development)

npm run dev
# or
npm start

Multiplayer Game Setup (Localhost)

🕹️ How to Play Locally

  1. Open http://localhost:3000 in two devices or two browser tabs.
  2. On the first tab/device:
    • Click "Create Game".
    • Note the generated Game ID.
  3. On the second tab/device:
    • Enter the same Game ID.
    • Click "Join Game" to connect.

⚠️ Important Notes

  • Room Storage:
    Rooms are stored in memory. This means data is lost when the server restarts.
    For production, use Redis or a persistent database to handle:

    • Room persistence
    • Scaling across multiple server instances
  • Player Limit:
    Each room is limited to 2 players.


🚀 Deployment Tips

To deploy the app, make sure your hosting platform supports WebSockets.

Supported Hosting Platforms:

✅ Always configure WebSockets properly in production environments for real-time communication.


🤝 Contributing

Pull requests are welcome!
For major changes, please open an issue first to discuss what you’d like to change.


🪪 License

MIT License © 2025 Hadi Shah

About

RPS Multiplayer is a simple real-time game where two players can play Rock, Paper, Scissors from different devices by sharing the same Game ID.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published