How bhuvanalakshmi27/nutri-catch-hands works
NutriCatch is a browser-based, hand-gesture-controlled healthy-food catching game. The main path is the home route into the game, where camera tracking or keyboard fallback controls the basket while the game loop handles falling items, collisions, scoring, and difficulty; the interface presents status and results. README capabilities include camera preview, fist-to-freeze control, audio, and locally saved high scores. Tracking and game-loop details are supported by sampled source; other mechanics are represented at the game component boundary where implementation excerpts were incomplete.
Main entry points: NutriCatchGame.tsx Game experience · handTracking.ts Hand tracking · index.tsx Home route · CameraPreview.tsx Camera preview
Components 15
Game entry
- Home route
src/routes/index.tsx
Controls and tracking
- Hand tracking
src/lib/nutricatch/handTracking.ts - Camera preview
src/components/nutricatch/CameraPreview.tsx
Gameplay
- Game experience
src/components/nutricatch/NutriCatchGame.tsx - Food item definitions
src/lib/nutricatch/items.ts - Difficulty modes
src/lib/nutricatch/items.ts - Sprite renderer
src/lib/nutricatch/sprites.ts
Feedback and persistence
- Sound effects
src/lib/nutricatch/audio.ts - Score and status HUD
src/components/nutricatch/NutriCatchGame.tsx - High score storage
src/components/nutricatch/NutriCatchGame.tsx
Other components
- Player
- Camera device
- MediaPipe vision
- Keyboard controls
- Browser localStorage
Connections 16
- Player → Home route: opens
- Home route → Game experience: renders
- Game experience → Hand tracking: enables tracking
- Hand tracking → Camera device: requests video
- Hand tracking → MediaPipe vision: loads model
- Hand tracking → Game experience: provides hand frame
- Player → Keyboard controls: presses keys
- Keyboard controls → Game experience: moves basket
- Game experience → Camera preview: passes video and frame refs
- Game experience → Food item definitions: reads definitions
- Game experience → Difficulty modes: reads settings
- Game experience → Sprite renderer: draws items
- Game experience → Sound effects: plays sounds
- Game experience → Score and status HUD: updates display
- Game experience → High score storage: loads and saves
- High score storage → Browser localStorage: reads and writes