Browser-based hand-tracking mini-games built with MediaPipe Hands, vanilla JavaScript, and HTML5 canvas.
This project delivers browser games controlled by hand movement using the webcam and MediaPipe Hands. It is designed for local demo use, rapid customization, and browser-based interaction without a build step.
- Clone the repository:
git clone https://github.com/ali-ezz/hand-tracking-games.git cd hand-tracking-games - Start a local server from the project root:
python3 -m http.server 8000
- Open the browser at:
http://localhost:8000 - Allow camera access, enter a player name, choose a game, and play.
- Hand-tracking input powered by MediaPipe Hands via CDN
- Multiple mini-games: fruit slicing, maze navigation, air painting, runner control, and shape tracing
- Persistent local leaderboard per game using
localStorage - Responsive canvas rendering with device pixel ratio scaling
- Minimal dependency footprint for easy local hosting and customization
- Play the Ninja Fruit game by moving your index finger to slice fruits and avoid bombs.
- Use the Maze mode to guide the player through a small maze with your fingertip.
- Create drawings in Paint Air with real-time hand motion and color controls.
- Control vertical movement in Runner mode using hand position.
- Trace shapes and fill coverage to score in Shape Trace.
index.html— entry page, UI, menus, and leaderboard modaljs/game.js— core engine, MediaPipe integration, game modes, scoring, and localStoragejs/ui.js— UI behavior and menu interactionsjs/net.js— network/leaderboard helpers (if used)assets/— optional audio, sprites, and game assetsserver/— backend metadata or leaderboard storage utilitiesLICENSE— repository licenseCONTRIBUTING.md— contribution guidelinesCODE_OF_CONDUCT.md— community standardsSECURITY.md— vulnerability reporting guidance.github/ISSUE_TEMPLATE/— issue intake templates.github/PULL_REQUEST_TEMPLATE.md— PR guidanceCODEOWNERS— maintainers and review owners
If you want to customize or add a new game mode, start by modifying js/game.js and adding new mode logic around the existing hand-tracking result handlers.
Please read CONTRIBUTING.md before opening issues or pull requests.
This project is licensed under the MIT License. See LICENSE for details.