How sharpp08/table-hockey works
Table Hockey is a Pygame arcade air-hockey game. The player launches a match from the menu, controls a paddle while the opponent AI responds, and plays through goals and win conditions to the end screen; pause, settings, and score persistence support that flow. The main loop coordinates match updates and drawing. Source excerpts establish the core calls, but gaps leave some event routing and match internals unverified, so those links are omitted.
Main entry points: main.py Game loop · match.py Match lifecycle · config.py Game constants · states.py Screen states
Components 15
Application
- Game loop
TABLE_HOCKEY/main.py - Screen states
TABLE_HOCKEY/states.py
Match simulation
- Match lifecycle
TABLE_HOCKEY/match.py - Puck physics
TABLE_HOCKEY/physics.py - Opponent AI
TABLE_HOCKEY/ai.py - Paddle entity
TABLE_HOCKEY/paddle.py - Puck entity
TABLE_HOCKEY/puck.py - Player score
TABLE_HOCKEY/player.py
Screens and rendering
- Match effects
TABLE_HOCKEY/effects.py - Table renderer
TABLE_HOCKEY/ui.py - Menu widgets
TABLE_HOCKEY/menu_ui.py
Configuration and feedback
- Settings and layout
TABLE_HOCKEY/settings.py - Game constants
TABLE_HOCKEY/config.py - Synth audio
TABLE_HOCKEY/audio.py
Other components
- Player
Connections 26
- Player → Game loop: plays
TABLE_HOCKEY/main.py - Game loop → Screen states: creates manager
TABLE_HOCKEY/main.py - Game loop → Match lifecycle: builds match
TABLE_HOCKEY/main.py - Game loop → Settings and layout: uses settings
TABLE_HOCKEY/main.py - Game loop → Table renderer: draws table
TABLE_HOCKEY/main.py - Game loop → Synth audio: controls audio
TABLE_HOCKEY/main.py - Screen states → Menu widgets: uses widgets
TABLE_HOCKEY/states.py - Screen states → Match lifecycle: resets and resumes
TABLE_HOCKEY/states.py - Screen states → Settings and layout: saves preferences
- Match lifecycle → Opponent AI: requests movement
TABLE_HOCKEY/match.py - Match lifecycle → Puck physics: updates collisions
TABLE_HOCKEY/match.py - Match lifecycle → Paddle entity: updates paddles
TABLE_HOCKEY/match.py - Match lifecycle → Puck entity: simulates puck
TABLE_HOCKEY/match.py - Match lifecycle → Player score: tracks scores
TABLE_HOCKEY/match.py - Match lifecycle → Match effects: triggers effects
TABLE_HOCKEY/match.py - Match lifecycle → Synth audio: plays match sounds
TABLE_HOCKEY/match.py - Game loop → Paddle entity: draws paddles
TABLE_HOCKEY/main.py - Game loop → Puck entity: draws puck
TABLE_HOCKEY/main.py - Game loop → Match effects: draws effects
TABLE_HOCKEY/main.py - Game loop → Game constants: reads constants
TABLE_HOCKEY/main.py - Match lifecycle → Game constants: uses tuning
TABLE_HOCKEY/match.py - Settings and layout → Game constants: validates defaults
TABLE_HOCKEY/settings.py - Opponent AI → Game constants: uses difficulty
TABLE_HOCKEY/ai.py - Puck physics → Game constants: uses physics values
TABLE_HOCKEY/physics.py - Match effects → Game constants: uses colors
TABLE_HOCKEY/effects.py - Table renderer → Game constants: uses palette
TABLE_HOCKEY/ui.py