Skip to content

kanhadewangan/SyncArena

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

54 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐ŸŽฎ Multiplayer Town

Arena

Real-time multiplayer game with WebRTC video chat Version License Node

๐Ÿš€ Quick Links

Link Status
Live Demo ๐ŸŸข Online
GitHub Repo View Code
Report Issue Bug Reports

โœจ Features

  • ๐ŸŽฎ Real-time Multiplayer - Join rooms, play with others instantly
  • ๐Ÿ’ฌ Live Chat - Text messaging in-game
  • ๐Ÿ“น WebRTC Video Chat - Peer-to-peer video calls
  • ๐ŸŽจ Retro UI - Pixel art themed interface
  • ๐Ÿ“ฑ Responsive - Works on desktop and mobile
  • โšก Fast - <2s load time

๐Ÿ›  Tech Stack

Frontend: Phaser 3 | Socket.IO | WebRTC | Vanilla JS
Backend: Node.js | Express | Socket.IO


๐Ÿ“ฆ Installation

# Clone repo
git clone https://github.com/kanhadewangan/town.git
cd town

# Install
npm install

# Run backend
npm start

# Run frontend (new terminal)
npx http-server -p 3000

Open: http://localhost:3000


๐ŸŽฎ How to Play

  1. Enter room name (or leave blank for random)
  2. Click Create/Join to start
  3. Use arrow keys to move
  4. Click ๐Ÿ’ฌ for chat
  5. Click ๐Ÿ“น for video call
Key Action
โ†‘โ†“โ†โ†’ Move
๐Ÿ’ฌ Chat
๐Ÿ“น Video
Enter Send msg

๐Ÿš€ Deploy

Frontend (Vercel)

git push origin main
# Connect to Vercel โ†’ Auto deploy

Live at: https://syncarena.onrender.com

Backend (Render)

New Web Service โ†’ Connect GitHub
Build: npm install
Start: node backend/index.js
Env: PORT=8080

๐Ÿ”Œ Socket.IO Events

Client โ†’ Server

  • joinRoom - Enter room
  • playerMove - Send position
  • chatMessage - Send message
  • webrtc-offer - Video offer
  • webrtc-answer - Video answer
  • webrtc-ice-candidate - NAT traversal

Server โ†’ Client

  • playerJoined - You joined
  • newPlayer - Player joined
  • playerMoved - Player moved
  • playerLeft - Player left
  • chatMessage - New message
  • announce - Join/leave notify

๐ŸŒ Browser Support

โœ… Chrome 80+
โœ… Firefox 75+
โœ… Safari 14+
โœ… Edge 80+
โœ… Mobile (iOS/Android)


๐Ÿ“Š Stats

  • Code: ~2000 lines
  • Size: 60 KB (frontend)
  • Assets: 500 KB
  • Max Players: 999/room
  • Latency: <100ms typical

๐Ÿ”ง Troubleshooting

Socket Won't Connect

  • Check backend URL in scene.js
  • Verify CORS in backend/index.js

Video Not Working

  • Allow camera/mic permissions
  • Check browser support (Chrome/Firefox/Safari)

Lag Issues

  • Close other apps
  • Check bandwidth
  • Reduce video quality

๐Ÿ“ Structure

town/
โ”œโ”€โ”€ index.html           # Room selection & UI
โ”œโ”€โ”€ styles.css           # Styling & animations
โ”œโ”€โ”€ main.js              # Phaser config
โ”œโ”€โ”€ scene.js             # Game logic (1500 lines)
โ”œโ”€โ”€ backend/index.js     # Server
โ”œโ”€โ”€ public/              # Assets
โ””โ”€โ”€ readme.md            # This file

๐Ÿค Contributing

git checkout -b feature/your-feature
git commit -m "Add feature"
git push origin feature/your-feature
# Create Pull Request

๐Ÿ“„ License

MIT - Free to use


๐Ÿ’ฌ Support


Made with โค๏ธ by Kanha Dewangan

V1.0.0 โ€ข December 2025

About

# ๐ŸŽฎ Multiplayer Town

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •