How franciscoj-p/snake-mds works
Snake is a small Pygame game: the player starts a session and supplies direction keys through the main loop; the game advances the snake, checks collisions, updates food and score, and the presentation draws the menu or board. The runtime is split among input/loop orchestration, game rules, snake movement, world and score logic, and rendering/configuration. The README documents restart and game-over controls, but the provided screen excerpt shows only the menu, so that behavior is not expanded into an inferred flow.
Main entry points: main.py Game loop · game.py Game state · config.py Game settings · world.py Board and food
Components 9
Runtime
- Game loop
snake/main.py - Game settings
snake/config.py
Game domain
- Game state
snake/game.py - Snake movement
snake/snake_logic.py - Board and food
snake/world.py - Score
snake/world.py
Presentation
- Menu screen
snake/screens.py - Board renderer
snake/ui.py
Other components
- Player
Connections 13
- Player → Game loop: starts and controls
README.md - Game loop → Game state: creates, updates
snake/main.py - Game loop → Menu screen: draws menu
snake/main.py - Game loop → Board renderer: draws game
snake/main.py - Game loop → Game settings: configures display
snake/main.py - Game loop → Snake movement: uses directions
snake/main.py - Game state → Snake movement: moves and checks
snake/game.py - Game state → Board and food: checks and spawns
snake/game.py - Game state → Score: updates score
snake/game.py - Game state → Game settings: reads settings
snake/game.py - Board renderer → Game settings: reads layout
snake/ui.py - Menu screen → Game settings: reads layout
snake/screens.py - Board and food → Game settings: reads board limits
snake/world.py