How tanyaflos76/pygame-project works
Typario is a Pygame typing game. The player chooses a language and difficulty, types words as they appear, and reaches a score-and-record game-over screen with retry/menu options. Game owns the event loop and screen dispatch; each screen signals transitions back through Game. Gameplay delegates word selection, input matching, score, and health to Spawner, which loads language word lists. Game-over records scores in SQLite. The README is empty; screen base-class details and some screen implementations are unsampled, so the graph focuses on evidenced wiring.
Main entry points: game.py Game loop · game_over.py Game-over screen · menu.py Language menu · difficulty.py Difficulty selection
Components 15
Game runtime
- Application entry
typario/main.py - Game loop
typario/game.py - Button component
typario/components/button.py - Image loader
typario/utils/image.py
Game screens
- Language menu
typario/screens/menu.py - Difficulty selection
typario/screens/difficulty.py - Typing screen
typario/screens/game.py - Game-over screen
typario/screens/game_over.py
Typing gameplay
- Word and score logic
typario/lib/spawner.py - Language word lists
typario/data/languages
Configuration and records
- Game settings
typario/core/config.py - Record operations
typario/utils/records.py - Records database
typario/data/records.db - Settings file
config/config.json
Other components
- Player
Connections 27
- Player → Application entry: starts
- Application entry → Game loop: creates and runs
- Game loop → Game settings: loads settings
- Game settings → Settings file: reads
- Game loop → Record operations: initializes database
- Game loop → Language menu: dispatches screen
- Game loop → Difficulty selection: dispatches screen
- Game loop → Typing screen: dispatches screen
- Game loop → Game-over screen: dispatches screen
- Player → Language menu: chooses language
- Language menu → Button component: uses
- Language menu → Image loader: loads background
- Language menu → Game loop: requests difficulty
- Player → Difficulty selection: chooses difficulty
- Difficulty selection → Button component: uses
- Difficulty selection → Image loader: loads background
- Difficulty selection → Game loop: requests game
- Player → Typing screen: types characters
- Typing screen → Word and score logic: creates and updates
- Typing screen → Word and score logic: forwards input
- Word and score logic → Language word lists: reads words
- Typing screen → Game loop: requests game over
- Game-over screen → Record operations: adds score and finds record
- Record operations → Records database: reads and writes
- Game-over screen → Button component: uses
- Game-over screen → Image loader: loads background
- Game-over screen → Game loop: requests retry or menu