mirror of
https://github.com/talkenson/astroparty.git
synced 2026-04-11 09:29:17 +00:00
No description
- TypeScript 82.3%
- HTML 16.5%
- Dockerfile 1.2%
|
All checks were successful
Build and Deploy Astroparty / build-and-push (push) Successful in 14s
|
||
|---|---|---|
| .agent | ||
| .forgejo/workflows | ||
| maps | ||
| packages | ||
| .dockerignore | ||
| .env.example | ||
| .gitignore | ||
| astroparty-stack.yml | ||
| docker-compose.yml | ||
| Dockerfile | ||
| Dockerfile.map-editor | ||
| package-lock.json | ||
| package.json | ||
| pnpm-workspace.yaml | ||
| README.md | ||
🚀 AstroParty
A multiplayer browser-based space combat game inspired by classic Asteroids. Players control spaceships with simple two-button controls in an intense battle arena.
🎮 Game Features
- 2-16 Players: Support for solo flight or intense multiplayer battles
- Simple Controls: Two buttons - Thrust/Rotate and Fire
- Jackbox-Style: Separate controller devices and shared display screen
- Real-time Multiplayer: WebSocket-based synchronization
🏗️ Architecture
- Server: Fastify + Socket.io + Matter.js physics
- Display Client: Full-screen game field with Canvas rendering
- Controller Client: Mobile-friendly two-button interface
- Shared Package: Common types and game constants
🚀 Quick Start
Prerequisites
- Node.js 18+
- pnpm 8+
Installation
# Install dependencies
pnpm install
# Copy environment variables
cp .env.example .env
Development
# Start all services (server + both clients)
pnpm dev
Development URLs:
- Display: http://localhost:5173
- Controller: http://localhost:5174
Production URLs (after npm start):
- Display: http://localhost:3000/display/
- Controller: http://localhost:3000/controller/
Production
# Build all packages
npm run build
# Start server
npm start
🐳 Docker Deployment
Build Docker Image
# Build the Docker image
docker build -t astroparty:latest .
# Or use docker-compose
docker-compose build
Run with Docker
# Run with docker-compose (recommended)
docker-compose up -d
# Or run directly
docker run -d -p 3000:3000 \
-e ROUND_DURATION=150000 \
--name astroparty \
astroparty:latest
Then open:
- Display: http://localhost:3000/display/
- Controller: http://localhost:3000/controller/
Stop Docker Container
# With docker-compose
docker-compose down
# Or stop container directly
docker stop astroparty
docker rm astroparty
🎯 How to Play
- Open the Display on a large screen (TV, monitor)
- Players open Controller on their phones/devices
- Enter your name and join
- Left Button: Press to thrust forward, release to rotate clockwise
- Right Button: Fire bullets (3 ammo, 2s reload per charge)
- Destroy other ships to score points!
- Ships wrap around screen edges, bullets disappear at edges
📁 Project Structure
astroparty/
├── packages/
│ ├── shared/ # Types and constants
│ ├── server/ # Game server
│ ├── client-display/ # Game field display
│ └── client-controller/ # Player controls
└── package.json
🔧 Configuration
Edit .env to configure:
PORT: Server port (default: 3000)ROUND_DURATION: Round length in milliseconds (default: 150000 = 2:30)
🛠️ Tech Stack
- TypeScript - Type safety
- Fastify - Fast server framework
- Socket.io - Real-time communication
- Matter.js - Physics engine
- Vite - Fast build tool
- Canvas API - Game rendering
📝 License
MIT