This repository contains a multiplayer rhythm boxing game. The main client lives in the gameclient/ folder and there's a simple body-tracking Python script that can enable punching input via your webcam.
- Open a terminal and change into the game client directory:
cd gameclient- Install dependencies:
npm install- Start the dev server:
npm run dev- Open the app in your browser. Vite will print the local dev URL (typically
http://localhost:5173).
The project includes a Python body-tracking script (OpenCVBody/bodyTracker.py) that reads from your webcam and sends punching events to the running game client. To enable this feature:
Requirements
- Python 3.12 (recommended)
- OpenCV for Python (
opencv-python) - A working webcam
Install Python dependencies
# Optionally create and activate a virtual environment
python3.12 -m venv .venv
source .venv/bin/activate
# Install dependencies
pip install -r OpenCVBody/requirements.txt || pip install opencv-pythonIf OpenCVBody/requirements.txt does not exist, install opencv-python directly.
Run the body tracker
Start the tracker in the background (so your terminal remains available for the dev server):
python3.12 OpenCVBody/bodyTracker.py &The script will connect to your webcam. Keep it running while you play. It will communicate with the game client (the client should be running via npm run dev) to translate detected punches into in-game actions.
Troubleshooting
- If the script fails to access the webcam, make sure no other app is using it and that your OS permissions allow camera access.
- If
python3.12is not found, install Python 3.12 or adjust the command to the Python executable you have (e.g.,python3,python3.11). - If OpenCV install fails, check compiler/toolchain availability (for some platforms you may need build tools) or use the prebuilt wheel via
pip install opencv-python.
To play multiplayer or the officially hosted version, make sure the Python body tracker is running in the background (if you want punching support), then open:
https://beat-boxing-liard.vercel.app/
The hosted site should connect to the tracker running locally so punching input maps to your in-game character.
- This README assumes the
gameclient/dev server uses Vite and the defaultnpm run devscript defined ingameclient/package.json. - The body tracker script is assumed to be at
OpenCVBody/bodyTracker.pyand to be compatible with OpenCV Python bindings.