Flappy Bird quiz
9 questions about the Python behind the game. Use the source as you go.
Explore the source
See how the game uses position and velocity. Look up answers as you go.
Python practice · Fix one frame of flight
The bird’s position is wrong after gravity acts. Fix step() so it returns the new vertical position followed by the new vertical speed.
This exercise uses the bird’s movement calculation. The game also handles drawing and screen boundaries.
Find the game’s movement codePython code
Enter starts a new line with indentation. Tab moves to the next control.
Output
Python practice · Compare two flights
Predict which flight will rise higher. Run the code, then change gravity in the second flight and run it again. Describe what happens to the highest point.
This model shows 30 frames after one flap. It uses the game’s starting position and flap strength.
Find the game’s movement code Find the gravity settingPython code
Enter starts a new line with indentation. Tab moves to the next control.
Output
- First flight
- Second flight
View data table
| Frame | First flight | Second flight |
|---|