How python-computer-vision-game/gesture-tic-tac-toe-algorithm-project works
Gesture Tic-Tac-Toe is a two-player webcam game: the player points or pinches to select a cell, and the game validates moves, resolves rounds, updates scores, and renders results. Its principal flow runs from camera frames through hand tracking and gesture selection into the game engine. The README also documents mouse input, setup, settings, instructions, camera recovery, and audio. The sampled excerpts establish the main calls; some screen and loop details are only partially shown, so undocumented links are omitted.
Main entry points: game_state.py Game loop and screens · hand_tracker.py Hand tracking · renderer.py Game and menu rendering · gesture_detector.py Gesture detection
Components 20
Input
- Camera capture
src/hand_tracker.py - Hand tracking
src/hand_tracker.py - Gesture detection
src/gesture_detector.py - Pointer selection
src/gesture_detector.py - Mouse input
src/gesture_detector.py - Cell mapping
src/gesture_detector.py
Game logic
- Game loop and screens
src/game_state.py - Game engine
src/game_state.py - Board state
src/board.py - Move and result rules
src/game_rules.py - Turn management
src/turn_manager.py - Match scores
src/score_manager.py
Presentation
- Game and menu rendering
src/renderer.py
Runtime support
- Application entry
main.py - Settings and UI text
src/config.py - Sound and music
src/audio_manager.py
Other components
- Player
- Webcam
- MediaPipe
- Audio assets
assets/sounds
Connections 28
- Player → Application entry: starts
README.md - Application entry → Game loop and screens: runs
main.py - Webcam → Camera capture: provides frames
src/hand_tracker.py - Camera capture → Hand tracking: captures frames
src/hand_tracker.py - Hand tracking → MediaPipe: detects hands
src/hand_tracker.py - Game loop and screens → Camera capture: reads frames
src/game_state.py - Game loop and screens → Hand tracking: processes frames
src/game_state.py - Hand tracking → Gesture detection: supplies landmarks
src/gesture_detector.py - Gesture detection → Pointer selection: produces pointers
src/gesture_detector.py - Player → Mouse input: moves pointer
README.md - Mouse input → Game loop and screens: supplies input
src/game_state.py - Game loop and screens → Pointer selection: updates selection
src/game_state.py - Game loop and screens → Cell mapping: maps cells
src/game_state.py - Pointer selection → Game loop and screens: confirms target
src/game_state.py - Game loop and screens → Game engine: dispatches actions
src/game_state.py - Game engine → Move and result rules: evaluates moves
src/game_state.py - Game engine → Board state: updates board
src/game_state.py - Game engine → Turn management: tracks turns
src/game_state.py - Game engine → Match scores: records results
src/game_state.py - Game loop and screens → Game and menu rendering: draws screens
src/game_state.py - Game and menu rendering → Board state: reads board
src/renderer.py - Game and menu rendering → Gesture detection: uses pointer types
src/renderer.py - Game and menu rendering → Hand tracking: uses hand connections
src/renderer.py - Game loop and screens → Sound and music: plays cues
src/game_state.py - Sound and music → Audio assets: loads sounds
src/audio_manager.py - Game loop and screens → Settings and UI text: reads settings
src/game_state.py - Sound and music → Settings and UI text: reads paths
src/audio_manager.py - Gesture detection → Settings and UI text: reads thresholds
src/gesture_detector.py