A real-time multiplayer Rock Paper Scissors game built with Java socket programming. Features a modern Swing-based UI, room-based matchmaking, and extended game modes with Lizard & Spock.
| Layer | Technology |
|---|---|
| Language | Java 17+ |
| Networking | TCP Sockets (java.net.Socket) |
| UI Framework | Java Swing |
| Build System | Bash Shell Scripts |
| Architecture | Multi-threaded Client-Server |
- 🪨 Classic Mode — Rock, Paper, Scissors
- 🦎 Extended Mode — Adds Lizard & Spock (host-configurable)
- ❄️ Cooldown Rule — Prevents consecutive identical picks (host-configurable)
- ⏱️ Timed Rounds — Ready, round, and turn timers
- 🚪 Room System — Create/join game rooms
- 💬 Live Chat — In-game messaging between players
- 📋 Dynamic User List — Sorted by points, real-time status updates
- ✅ Ready Status — Players must ready up to start
- 💀 Elimination — Players who don't pick are eliminated
- 😴 Away Mode — Temporarily step away without leaving
- 👁️ Spectator Mode — Watch games without participating
- Java JDK 17 or higher
- Bash-compatible terminal (Git Bash on Windows)
./build.sh Project./run.sh Project server [port]- Default port:
3000
./run.sh Project uiAdd -d flag to enable VS Code debugging:
./run.sh Project server 3000 -d
./run.sh Project ui -dProject/
├── Client/ # Client-side logic & UI
│ ├── Client.java # Socket connection & payload handling
│ ├── ClientUI.java # Main UI frame (CardLayout)
│ ├── Interfaces/ # Event callback interfaces
│ └── Views/ # Swing UI components
├── Server/ # Server-side logic
│ ├── Server.java # Entry point, accepts connections
│ ├── ServerThread.java # Per-client connection handler
│ ├── Room.java # Base room management
│ └── GameRoom.java # RPS game logic & battle resolution
├── Common/ # Shared models & utilities
│ ├── Payload.java # Base communication object
│ ├── *Payload.java # Specialized payload types
│ ├── User.java # Player state model
│ └── Phase.java # Game phase enum
└── Exceptions/ # Custom exception types
[Client UI] → Payload → [Socket] → [ServerThread] → [GameRoom]
↓
[Client UI] ← Payload ← [Socket] ← [Broadcast to Room]
MIT License
Author: Rayyan Khan