A fast-paced Road Rash inspired racing game controlled with real-time hand gestures.
Steer, punch, kick, brake and boost using your webcam โ no traditional controller required.
Road Rash Computer Vision Game is a desktop racing and brawler game inspired by classic Road Rash gameplay, redesigned around Computer Vision.
Instead of relying only on a keyboard or traditional game controller, the game uses your webcam and MediaPipe Hand Landmarker to track hand movement and gestures in real time.
- ๐ Solo Campaign with 5 themed levels
- ๐ค Road Combat with punches and kicks
- ๐ Rivals, Cops and Bosses
- ๐ฆ๏ธ Dynamic Weather Effects
- ๐จ Nitro / Boost System
- โค๏ธ Health and Damage System
- ๐ Score, Combo and Takedown System
- ๐ค Local 2-Player Split-Screen Mode
- โ Real-Time Hand Landmark Visualization
- โจ๏ธ Keyboard Fallback Controls
- ๐ฅ๏ธ Fullscreen Mode
- ๐ Engine and Gameplay Sound Effects
๐ง Full Demonstration video will be added here.
roadrush-optionB-overview.webm
The game uses your webcam to detect hand landmarks and convert gestures into gameplay actions.
| Gesture | Action |
|---|---|
| ๐ค Open Hand | Normal control |
| โ Fist | Punch |
| ๐ค Pinch | Brake |
| ๐ Thumbs Up | Nitro / Boost |
| โ๏ธ Point | Wheelie / Jump |
| โ๏ธ Two Fingers | Kick |
| Steering |
The hand-control system includes:
- Real-time hand tracking
- Hand landmark detection
- Gesture classification
- Steering prediction
- Movement smoothing
- Gesture debouncing
- Hand tilt detection
Two players can play using one webcam.
WEBCAM
โ
โโโโโโโโโโดโโโโโโโโโ
โ โ
RIGHT HAND LEFT HAND
โ โ
โผ โผ
PLAYER 1 PLAYER 2
- ๐ค Player 1 โ Right hand
- ๐ค Player 2 โ Left hand
- ๐๏ธ Split-screen racing
- โ Independent punch controls
โ๏ธ Independent steering- ๐ Race to the finish
- โค๏ธ Last rider standing can also win
The project also includes keyboard controls for testing without a webcam.
A / D โ Steering
F โ Punch
โ / โ โ Steering
L โ Punch
The Solo Campaign contains 5 themed levels with different gameplay environments.
Features include:
- Road traffic
- Rival riders
- Cops
- Boss encounters
- Road hazards
- Pickups
- Weather effects
- Nitro
- Combat
- Score system
- Combo system
Easy
Normal
Hard
Extreme
Play against a friend using one webcam.
Each player receives their own side of the split-screen.
โโโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโ
โ PLAYER 1 โ PLAYER 2 โ
โ โ โ
โ RIGHT HAND โ โ โ LEFT HAND โ
โ โ โ
โ ๐๏ธ โ ๐๏ธ โ
โ โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโ
The game uses MediaPipe Tasks Vision for real-time hand tracking.
WEBCAM
โ
โผ
Video Stream
โ
โผ
MediaPipe Hand Landmarker
โ
โโโโโโโโโดโโโโโโโโโ
โ โ
Hand Landmarks Hand Position
โ โ
โโโโโโโโโฌโโโโโโโโโ
โผ
Gesture Detection
โ
โโโโโโโโโโโโผโโโโโโโโโโโโ
โ โ โ
โผ โผ โผ
Steering Combat Actions
โ โ โ
โ Punch/Kick Nitro/Brake
โ โ
โโโโโโโโโโโโฌโโโโโโโโโโโโโ
โผ
Game Logic
โ
โผ
Canvas Renderer
โ
โผ
Gameplay
| Technology | Purpose |
|---|---|
| โ๏ธ React | UI and application structure |
| ๐ท TypeScript | Type-safe development |
| โก Vite | Development and production build |
| ๐จ Tailwind CSS | UI styling |
| โ MediaPipe Tasks Vision | Hand tracking and gesture recognition |
| ๐ผ๏ธ HTML Canvas | Game rendering |
| ๐ฅ๏ธ Electron | Desktop application |
| ๐ Web Audio API | Sound effects and engine audio |
Road-Rash-Computer-Vision-Game/
โ
โโโ build/
โ โโโ road-rash.ico
โ
โโโ electron/
โ โโโ main.cjs
โ
โโโ public/
โ โโโ favicon-16.png
โ โโโ favicon-32.png
โ โโโ favicon-64.png
โ โโโ icon-192.png
โ โโโ icon-512.png
โ โโโ ...
โ
โโโ src/
โ โโโ App.tsx
โ โโโ Game.tsx
โ โโโ Versus.tsx
โ โโโ levels.ts
โ โโโ render.ts
โ โโโ sound.ts
โ โโโ useHandControl.ts
โ โโโ useDualHandControl.ts
โ โโโ main.tsx
โ โโโ ...
โ
โโโ index.html
โโโ package.json
โโโ package-lock.json
โโโ tsconfig.json
โโโ vite.config.ts
Before running the project, make sure you have:
- Node.js
- npm
- A working webcam
- A modern browser or Chromium environment
- A system capable of running Electron
For the best computer-vision experience, use good lighting and keep your hands clearly visible.
git clone https://github.com/ENiGMA-101/Road-Rash-Computer-Vision-Game.gitEnter the project directory:
cd Road-Rash-Computer-Vision-Gamenpm installnpm run devVite will display the local development URL in the terminal.
Open that URL in your browser.
To run the desktop version during development:
npm run electron:devThis launches the game inside an Electron desktop window.
Build the web application:
npm run buildPreview the production build:
npm run previewTo create the packaged desktop application:
npm run distThe generated release files will be available inside:
release/
When computer-vision mode is enabled, the application requests permission to access your webcam.
For better hand tracking:
- Use good lighting
- Keep your hand inside the camera frame
- Keep fingers clearly separated when using gestures
- Avoid very dark environments
- Keep a reasonable distance from the webcam
Stand side-by-side and make sure both players' hands are visible.
CAMERA
๐ค ๐ค
Player 1 Player 2
โ โ
RIGHT HAND LEFT HAND
| Input | Function |
|---|---|
| Steering | |
| ๐ค Hand Tilt | Additional steering |
| โ Fist | Punch |
| โ๏ธ Two Fingers | Kick |
| ๐ค Pinch | Brake |
| ๐ Thumbs Up | Nitro |
| โ๏ธ Point | Wheelie / Jump |
| Player | Camera Hand | Keyboard |
|---|---|---|
| ๐ง Player 1 | Right Hand | A / D + F |
| ๐ง Player 2 | Left Hand | โ / โ + L |
Controls the main menu and game-mode selection.
Main Menu
โ
โโโ Solo Campaign
โ
โโโ Play With Friends
Responsible for single-player computer vision.
Main responsibilities:
- Webcam access
- MediaPipe initialization
- Hand detection
- Hand landmark extraction
- Gesture classification
- Steering calculation
- Movement smoothing
- Gesture prediction
Responsible for 2-player hand tracking.
It detects up to two hands and maps them according to handedness:
Right Hand โ Player 1
Left Hand โ Player 2
Contains the main Solo Campaign game logic.
Includes:
- Player movement
- Rival riders
- Police
- Bosses
- Cars
- Pickups
- Hazards
- Combat
- Nitro
- Health
- Score
- Combo
- Level progression
- HUD
- Game-over system
Contains the local multiplayer game.
Features:
- Split-screen rendering
- Two-hand tracking
- Two independent players
- Racing
- Combat
- Health
- Score
- Finish detection
- Winner detection
Responsible for drawing game objects onto the HTML Canvas.
Examples:
- ๐๏ธ Bikes
- ๐ Cars
- ๐ Scenery
- ๐ฃ๏ธ Roads
- ๐ฅ Effects
Handles game audio including:
- Engine sound
- Punch effects
- Collision sounds
- Game feedback
- Victory sounds
Contains:
- Level configuration
- Difficulty parameters
- Level themes
- Weather
- Gameplay settings
The project uses MediaPipe's hand landmarks to estimate:
21 Hand Landmarks
โ
โโโ Finger Positions
โโโ Palm Position
โโโ Hand Openness
โโโ Hand Tilt
โโโ Finger Configuration
These values are converted into gameplay commands.
For example:
Hand moves LEFT
โ
Steering = -1
โ
Bike moves LEFT
And:
Closed Fist
โ
Gesture = FIST
โ
Punch
โ
Opponent takes damage
The system identifies several hand configurations.
OPEN HAND โ Normal
FIST โ Punch
PINCH โ Brake
THUMBS UP โ Nitro
POINT โ Wheelie
TWO FINGERS โ Kick
A short gesture history is used to reduce accidental gesture changes caused by individual noisy frames.
The visual style combines:
- Dark futuristic backgrounds
- Neon highlights
- Arcade racing aesthetics
- Canvas-based game rendering
- Responsive HUD
- Fullscreen gameplay
The interface is designed to keep the gameplay area large and easy to see.
This project combines several areas of software engineering:
Computer Vision
+
Game Development
+
Frontend Development
+
Human-Computer Interaction
+
Desktop Application Development
โ
โผ
Road Rash Computer Vision Game
The project demonstrates how a webcam can be used as a natural game controller.
๐ง Active Development
Current implementation includes:
- โ Solo Campaign
- โ 5 themed levels
- โ Multiple difficulty levels
- โ Computer-vision steering
- โ Gesture recognition
- โ Punch
- โ Kick
- โ Brake
- โ Nitro
- โ Wheelie / Jump
- โ Rivals
- โ Cops
- โ Boss encounters
- โ Road traffic
- โ Weather effects
- โ Local 2-player mode
- โ Keyboard fallback
- โ Fullscreen mode
- โ Sound effects
- โ Electron desktop support
Possible future development:
- ๐ Online multiplayer
- ๐๏ธ More bikes
- ๐ค More playable characters
- ๐บ๏ธ More environments
- ๐ More race modes
- ๐ค Improved opponent AI
- โ More advanced gestures
- ๐ฎ Controller support
- ๐ Online leaderboard
- ๐พ Cloud save system
- ๐จ Improved graphics
- โก Better low-end performance
- ๐ฆ Improved installer and release system
Contributions, ideas and improvements are welcome.
Create a feature branch:
git checkout -b feature/your-featureMake your changes:
git add .Commit:
git commit -m "Add your feature"Push:
git push origin feature/your-featureThen open a Pull Request.
GitHub:
If you find this project interesting, consider giving the repository a โญ on GitHub.
Your support helps encourage further development in:
- Computer Vision
- Game Development
- Human-Computer Interaction
- AI-powered applications
- Interactive software
No explicit open-source license is currently specified in this repository.
If you plan to distribute or reuse this project, add an appropriate license such as:
- MIT
- Apache-2.0
- GPL-3.0
Choose the license according to your intended usage and distribution requirements.
๐๏ธ ROAD RASH ร โ COMPUTER VISION ร ๐ฎ GAME DEVELOPMENT
Control the road with your hands.