- “Maker Faire Rome – The European edition” returns to the Gazometro OstiensePosted 7 hours ago
- Single-chip saturation meterPosted 4 weeks ago
- Raspberry Pi Relay BoardPosted 2 months ago
- PCB CAD, A SELECTION GUIDEPosted 3 months ago
- Automatic dispenser for catsPosted 3 months ago
- Do you have a mask? RASPBERRY Pi SEES ITPosted 3 months ago
- RFID based Attendance system using Arduino and External EEPROMPosted 4 months ago
- ESP32 Neopixel Status Indicator and Sensor PCB Shield with Wi-Fi ManagerPosted 4 months ago
- Remote control power functions usbPosted 4 months ago
- ESP32-CAM with Telegram: Take Photos Control Outputs Sensor Readings and Motion NotificationsPosted 4 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.