How pjconcepcion/flappy-bird works
Flappy Bird is a small Pygame game: the player uses Space to flap past pipes, scores by passing through gaps, and can restart or quit after a collision. The runtime loop in Main handles input, advances game state, and renders the screen. GameManager owns pipe spawning, movement, collision, and scoring; Player models movement, while Screen and the shape/text classes provide display elements. The README documents controls and mechanics; the graph follows sampled source for internal wiring.
Main entry points: main.py Game Loop · game_manager.py Game Manager · screen.py Screen · player.py Player
Components 9
Runtime
- Game Loop
src/main.py
Gameplay
- Player
src/player.py - Game Manager
src/game_manager.py - Pipe Motion
src/game_manager.py
Display
- Screen
src/screen.py - Shapes
src/shape.py - Text Labels
src/canvas.py
Other components
- Pygame
- Player
Connections 20
- Player → Game Loop: sends controls
- Game Loop → Pygame: polls events
- Game Loop → Player: initializes
- Game Loop → Screen: initializes
- Game Loop → Game Manager: initializes
- Game Loop → Player: dispatches jump
- Game Loop → Game Manager: advances state
- Game Loop → Screen: renders
- Game Manager → Player: updates and checks
- Game Manager → Screen: reads floor
- Game Manager → Screen: registers and removes
- Game Manager → Pipe Motion: creates and moves
- Game Manager → Shapes: creates pipe shapes
- Game Manager → Text Labels: creates and updates labels
- Pipe Motion → Shapes: moves geometry
- Screen → Shapes: creates background and floor
- Screen → Pygame: blits and flips
- Player → Pygame: loads and scales image
- Shapes → Pygame: creates surfaces
- Text Labels → Pygame: renders fonts