How jack-schultz/pastries-vs-pests works
This is a Tkinter lane-defense game: the player chooses a level, places or moves defensive goods on garden tiles using cards, earns flour, and fights successive pest waves until victory or defeat. The runtime is organized around a window/state stack, a gameplay state that handles input, and a World that coordinates the board and level progression. Entity combat is supported by shared living, damage, armour, and projectile layers. Several domain modules are represented from the source index; their internal call details were not sampled, so those relationships are kept sparse.
Main entry points: world.py World Coordinator · game_state.py Gameplay State · window.py Game Window · living.py Living Entities
Components 25
Game Runtime
- Game Entry
main.py - Game Window
app/window.py - State Stack
app/states/statestack.py - Main Menu
app/states/mainmenu_state.py - Level Selection
app/states/levelselect_state.py - Gameplay State
app/states/game_state.py - Pause State
app/states/pause_state.py - Game Over
app/states/gameover_state.py
Board And Progression
- World Coordinator
app/world.py - Level Definitions
levels/level_collector.py - Wave Manager
levels/wave_manager.py - Garden Board
entities/garden.py - Board Tiles
entities/tile.py - Cards And Tools
entities/card.py - Card Inventory
entities/cardholder.py
Combat Entities
- Defensive Goods
entities/living/goods/base_good.py - Pests
entities/living/pests/base_pest.py - Pest Variants
entities/living/pests/pest_type.py - Projectiles
entities/projectiles/projectile.py
Combat Mechanics
- Living Entities
entities/living/living.py - Armour
armour/base_armour.py - Damage Model
entities/damage.py - Canvas Entities
entities/entity.py - Canvas Geometry
app/rectangle.py
Other components
- Player
Connections 30
- Player → Game Window: uses
app/window.py - Game Entry → Game Window: starts
main.py - Game Window → State Stack: creates
app/window.py - Game Window → Main Menu: starts at
app/window.py - Main Menu → Level Selection: opens
app/states/mainmenu_state.py - Level Selection → Level Definitions: loads levels
app/states/levelselect_state.py - Level Selection → Gameplay State: starts level
app/states/levelselect_state.py - Gameplay State → World Coordinator: creates and ticks
app/states/game_state.py - Gameplay State → Pause State: pushes on escape
app/states/game_state.py - Gameplay State → Game Over: pushes on defeat
app/states/game_state.py - Gameplay State → Cards And Tools: handles card input
app/states/game_state.py - Gameplay State → Board Tiles: handles tile input
app/states/game_state.py - World Coordinator → Level Definitions: loads level data
app/world.py - World Coordinator → Wave Manager: manages waves
app/world.py - World Coordinator → Garden Board: updates board
app/world.py - World Coordinator → Card Inventory: owns inventory
app/world.py - World Coordinator → Pests: moves and tracks
app/world.py - World Coordinator → Projectiles: updates hits
app/world.py - Garden Board → Board Tiles: comprises
entities/garden.py - Board Tiles → Defensive Goods: holds
entities/tile.py - Card Inventory → Cards And Tools: maintains
entities/cardholder.py - Card Inventory → Defensive Goods: creates choices
entities/cardholder.py - Wave Manager → Pest Variants: selects pests
levels/wave_manager.py - Pests → Living Entities: extends
entities/living/pests/base_pest.py - Defensive Goods → Living Entities: extends
entities/living/goods/base_good.py - Living Entities → Armour: absorbs damage
entities/living/living.py - Pests → Defensive Goods: attacks
entities/living/pests/base_pest.py - Projectiles → Damage Model: produces hit damage
entities/projectiles/projectile.py - Living Entities → Damage Model: takes damage
entities/living/living.py - Canvas Entities → Canvas Geometry: owns geometry
entities/entity.py