How cauecrb/jogosimplesfb works
Flappy is a small browser game: the player holds a key to make the bird rise, releases it to fall, and steers through pipe gaps to score points. The game controller creates the game entities and runs their animation and collision loop. The sampled JavaScript supports the runtime flow; HTML and CSS contents were not sampled, so their wiring and styling relationships are omitted.
Main entry points: flappy.js Game controller · flappy.html Game area
Components 8
Game runtime
- Game controller
js/flappy.js - Bird movement
js/flappy.js - Pipe pairs
js/flappy.js - Pipe animation
js/flappy.js - Collision check
js/flappy.js - Score display
js/flappy.js - Game area
flappy.html
Player input
- Player
Connections 14
- Game controller → Game area: queries and renders
- Game controller → Bird movement: creates
- Game controller → Pipe animation: creates
- Game controller → Score display: creates
- Game controller → Pipe pairs: appends
- Game controller → Bird movement: animates
- Game controller → Pipe animation: animates
- Game controller → Collision check: checks
- Game controller → Score display: appends
- Player → Bird movement: key input
- Pipe animation → Pipe pairs: moves and recycles
- Pipe animation → Score display: reports point
- Collision check → Bird movement: checks overlap
- Collision check → Pipe pairs: checks overlap