How mx0c/super-mario-python works
This repository is a pygame Super Mario game. Its user-facing loop is to launch the game, navigate menus, play a level as Mario using movement and jump controls, interact with terrain and enemies, and see score, coin, audio, and game-over feedback. Level construction, player/entity behavior, collision, rendering assets, and interface/audio are distinct runtime concerns. The graph uses sampled source for concrete links; unsampled menu and main-loop wiring is shown only as unverified where appropriate.
Main entry points: Mario.py Mario player · main.py Game entry · Level.py Level runtime · entities Goomba and Koopa
Components 21
Game runtime
- Tile collision
classes/Collider.py - Entity collision
classes/EntityCollider.py - Walking trait
traits/leftrightwalk.py - Player input
classes/Input.py - Camera
classes/Camera.py - Game entry
main.py
World and entities
- Mario player
entities/Mario.py - Level runtime
classes/Level.py - Level layouts
levels - Goomba and Koopa
entities - Items and blocks
entities - Entity base
entities/EntityBase.py
Rendering assets
- Sprite collection
classes/Sprites.py - Spritesheet loader
classes/Spritesheet.py - Animation
classes/Animation.py
Interface and feedback
- Menus
classes/Menu.py - Pause screen
classes/Pause.py - Score dashboard
classes/Dashboard.py - Sound effects
classes/Sound.py
Other components
- Player
- Game display
Connections 23
- Player → Game entry: launches
- Game entry → Mario player: starts game
main.py - Game entry → Level runtime: loads level
main.py - Game entry → Menus: shows menus
main.py - Game entry → Score dashboard: updates HUD
main.py - Game entry → Sound effects: starts audio
main.py - Level runtime → Level layouts: reads layout
classes/Level.py - Level runtime → Sprite collection: creates collection
classes/Level.py - Level runtime → Goomba and Koopa: creates enemies
classes/Level.py - Level runtime → Items and blocks: creates entities
classes/Level.py - Mario player → Player input: checks input
entities/Mario.py - Mario player → Camera: moves camera
entities/Mario.py - Mario player → Tile collision: checks tiles
entities/Mario.py - Mario player → Entity collision: checks entities
entities/Mario.py - Mario player → Pause screen: creates pause
entities/Mario.py - Mario player → Score dashboard: updates score
entities/Mario.py - Mario player → Sound effects: plays effects
entities/Mario.py - Goomba and Koopa → Entity base: inherits
entities/Goomba.py - Goomba and Koopa → Walking trait: uses walking
entities/Goomba.py - Goomba and Koopa → Tile collision: checks tiles
entities/Mario.py - Sprite collection → Spritesheet loader: extracts images
classes/Sprites.py - Sprite collection → Animation: builds animations
classes/Sprites.py - Level runtime → Game display: draws level
classes/Level.py