This project is a desktop-based clone of the classic Flappy Bird game developed using Java Swing. It simulates real-time gameplay mechanics where the player controls a bird navigating through procedurally generated pipes using keyboard input. The project demonstrates core game development concepts such as rendering, collision detection, game loops, and event handling in Java.
- Realistic bird physics with gravity and jump mechanics
- Procedurally generated pipes with random vertical gaps
- Real-time scoring system
- Game over detection and restart functionality
- Custom background and character assets
- Smooth real-time rendering using Java Swing
- Java
- Java Swing
- Object-Oriented Programming
- Event handling and graphics rendering
- Java JDK 8 or higher
- Any Java IDE (IntelliJ IDEA, Eclipse, NetBeans) or terminal
- Clone or download the repository.
- Ensure all image assets are placed in the
/resources/folder and referenced usinggetResource(). - Compile and run the project:
javac App.java FlappyBird.java
java AppMake sure the resources folder is correctly added to the classpath when using an IDE.
- Spacebar – Jump / Start game / Restart after game over
- Up Arrow – Move bird upward
- Down Arrow – Move bird downward
- The bird is continuously affected by gravity.
- A jump provides upward velocity.
- Pipes are generated every 1.5 seconds and move left across the screen.
- The game ends if the bird collides with a pipe or goes out of bounds.
- Each successfully passed pipe contributes to the score.
- Desktop game development demos
- Object-oriented programming practice
- Real-time simulation projects
- Java graphics and event-handling demonstrations
This project demonstrates the implementation of a complete 2D game using Java Swing. It highlights real-time rendering, physics simulation, procedural obstacle generation, and interactive user input handling.
- Add background music and sound effects
- Implement high score tracking
- Improve animations and visual effects
- Migrate to JavaFX or LibGDX
- Add mobile or touch-based controls