An engaging Flappy Bird-like game designed specifically for the ESP32-2432S028R "Cheap Yellow Display" (CYD) board. This game features smooth animations, responsive touch controls, and persistent high scores.
Flappy Kiernan is an arcade-style game where players control a character (Kiernan) through a series of pipes by tapping on the touchscreen. The game features:
- Flicker-free animations using hardware-accelerated sprite rendering
- Responsive touchscreen controls
- Persistent high score tracking using SPIFFS
- Dynamic difficulty adjustment
- Smooth countdown and game over transitions
- ESP32-2432S028R "Cheap Yellow Display" (CYD) Board
- USB Cable for programming and power
This project relies on the following libraries:
- LovyanGFX - High-performance graphics library providing flicker-free rendering through hardware acceleration and double buffering
- XPT2046_Touchscreen - Library for interfacing with the XPT2046 touchscreen controller
- Arduino ESP32 Core - Arduino core for the ESP32
- SPIFFS - SPI Flash File System for storing high scores
-
Install the required libraries:
- LovyanGFX: Install through Arduino Library Manager or clone from GitHub
- XPT2046_Touchscreen: Install through Arduino Library Manager or clone from GitHub
- ESP32 Arduino Core: Follow these instructions
-
Connect your ESP32-2432S028R board to your computer
-
Select the appropriate board in Arduino IDE: "ESP32 Dev Module"
-
Compile and upload the sketch to your device
The code is organized into three main sections:
-
Main Definitions, Setup, and Game State
- Display configuration
- Constants definitions
- Game data structures
- Setup and main loop
-
Game Mechanics and Player Sprite
- Player sprite data
- Game mechanics functions
- Touch handling
- High score saving
-
Rendering Functions
- Menu screen rendering
- Countdown animation
- Main game rendering
- Game over screen
- SCLK: GPIO14
- MOSI: GPIO13
- MISO: GPIO12
- DC: GPIO2
- CS: GPIO15
- Backlight: GPIO21
- T_IRQ: GPIO36
- T_DIN: GPIO32
- T_OUT: GPIO39
- T_CLK: GPIO25
- T_CS: GPIO33
- Original concept inspired by Flappy Bird by Dong Nguyen
- Display and touch handling techniques adapted from Random Nerd Tutorials
- Optimization strategies inspired by the ESP32-Cheap-Yellow-Display project by Brian Lough
- Special thanks to the authors of LovyanGFX for providing the double-buffering capabilities that make flicker-free animation possible
This project is licensed under the MIT License - see the LICENSE file for details.
- Add sound effects using the onboard buzzer
- Implement difficulty levels
- Add more visual elements and animations
- Create custom sprites for pipes and background elements
- Display shows nothing: Ensure the backlight pin (GPIO21) is properly controlled. The backlight is active when the pin is pulled LOW.
- Touch not working: Check the touch SPI pins and make sure the touch controller is initialized before the display.
- Game performance issues: Reduce the sprite color depth or size to improve rendering performance.
Contributions to improve Flappy Kiernan are welcome! Please fork the repository and submit a pull request.