Turning tedious physical therapy homework into fun, engaging, and trackable web games.
Rehab Games is a webcam-based platform that transforms shoulder rehabilitation exercises into classic arcade games. Track your recovery progress while playing, making physical therapy something you'll actually look forward to.
- 🎥 Webcam-Based Motion Tracking: Uses MediaPipe Pose detection to track your movements in real-time
- 🕹️ Three Classic Games:
- Pong: Vertical shoulder mobility (Flexion/Extension)
- Flappy Bird: Lateral arm raises (Shoulder Abduction)
- Arkanoid: Horizontal arm movement (Abduction/Adduction)
- 📊 Progress Tracking: Leaderboard system to monitor your scores and recovery over time
- 🎯 Difficulty Levels: Easy, Medium, and Hard modes to match your rehabilitation stage
- 📱 Responsive Design: Works on desktop browsers with webcam support
- Python 3.8+
- Webcam
- Modern web browser (Chrome, Firefox, Edge recommended)
-
Clone the repository
git clone https://github.com/YOUR_USERNAME/Rehab-Games-2.git cd Rehab-Games-2/RehabGames -
Create a virtual environment
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install dependencies
pip install -r requirements.txt
-
Run database migrations
python manage.py migrate
-
Start the development server
python manage.py runserver
-
Open your browser Navigate to
http://localhost:8000
- Select a Game: Choose from Pong, Flappy Bird, Arkanoid, or Road Fighter
- Grant Webcam Permission: Allow your browser to access your webcam
- Choose Settings: Select difficulty level and hand preference
- Position Yourself: Stand where your full upper body is visible
- Start Playing: Follow on-screen instructions for each game's controls
- Track Progress: View your scores on the leaderboard
RehabGames/
├── app/ # Main Django application
│ ├── static/ # Static files (CSS, JS, images)
│ │ ├── css/ # Stylesheets
│ │ ├── js/ # Game logic and hand tracking
│ │ └── visionEngine.js # Core motion detection engine
│ ├── templates/ # HTML templates
│ ├── models.py # Database models
│ ├── views.py # View controllers
│ └── urls.py # URL routing
├── RehabGames/ # Django project settings
│ ├── settings.py # Configuration
│ └── urls.py # Root URL config
├── manage.py # Django management script
└── requirements.txt # Python dependencies
- Django 4.2: Web framework
- SQLite: Database for score tracking
- Gunicorn: Production WSGI server
- HTML5 Canvas: Game rendering
- JavaScript: Game logic
- MediaPipe Pose: Real-time pose detection
- TensorFlow.js: Machine learning backend
- Render: Hosting platform
- WhiteNoise: Static file serving
- Exercise: Shoulder Flexion/Extension (up and down)
- Controls: Move your arm up and down to control the paddle
- Goal: Beat the AI to 10 points
- Exercise: Shoulder Abduction (lateral raises)
- Controls: Raise both arms to flap
- Goal: Navigate through as many pipes as possible
- Exercise: Shoulder Abduction/Adduction (side to side)
- Controls: Move your arm left and right to control the paddle
- Goal: Break all the bricks without losing the ball
# Score Model
class Score(models.Model):
game = models.CharField(max_length=50) # Game type
player_name = models.CharField(max_length=100) # Player name
score = models.IntegerField() # Score achieved
difficulty = models.CharField(max_length=20) # Difficulty level
date = models.DateTimeField(auto_now_add=True) # TimestampThis project is licensed under the MIT License - see the LICENSE file for details.
- Joseph Celtruda - GitHub Profile
- Harrison Schmidt - GitHub Profile
- Nicole Stepanenko - GitHub Profile
- Jimi Xia - GitHub Profile
- Project Link: https://github.com/jceltruda/Rehab-Games
- Live Demo: https://rehab-games.onrender.com/
- DevPost: https://devpost.com/software/rehab-games
- Video Demo: https://youtu.be/QHAb9Sb3wYU