- 3DRAG + MOTORFISH: How to prevent step losses in 3D printerPosted 2 weeks ago
- Motorfish: The stepper does not misses a step (the Firmware)Posted 3 weeks ago
- Motorfish: The stepper does not misses a stepPosted 4 weeks ago
- “Maker Faire Rome – The European edition” returns to the Gazometro OstiensePosted 3 months ago
- Single-chip saturation meterPosted 3 months ago
- Raspberry Pi Relay BoardPosted 5 months ago
- PCB CAD, A SELECTION GUIDEPosted 5 months ago
- Automatic dispenser for catsPosted 6 months ago
- Do you have a mask? RASPBERRY Pi SEES ITPosted 6 months ago
- RFID based Attendance system using Arduino and External EEPROMPosted 6 months ago
Recreate Flappy Bird’s flight mechanic
Flappy Bird was released by programmer Dong Nguyen in 2013, and made use of a straightforward game mechanic to create an addictive hit. Tapping the screen provided ‘lift’ to the main character, which is used strategically to navigate through a series of moving pipes. A point is scored for each pipe successfully passed. The idea proved so addictive that Nguyen eventually regretted his creation and removed it from the Google and Apple app stores. In this article, I’ll show you how to recreate this simple yet time-consuming game, using Python and Pygame Zero.
The player’s motion is very similar to that employed in a standard platformer: falling down towards the bottom of the screen under gravity. See the article, Super Mario-style jumping physics in Wireframe #7 for more on creating this type of movement. Pressing a button (in our case, the
SPACEbar) gives the player some upward thrust by setting its velocity to a negative value (i.e. upwards) larger than the value of gravity acting downwards. I’ve adapted and used two different images for the sprite , so that it looks like it’s flapping its wings to generate lift and move upwards.