Flappy Bird (Clone) is a faithful Java recreation of the classic, where players tap to keep their bird airborne, navigating it through a series of challenging pipes. One wrong move means a crash, so timing is key! Rack up high scores to earn medals and push yourself to beat your personal best in this addictive, retro-style game.
Objective: Guide your bird through pipes by keeping it airborne. Each successful pipe passage earns a point, with medals awarded at score milestones.
SPACE/Left Mouse Button- JumpC- Toggle Day/NightB- Change Bird Color
- Java SDK 22: Core programming language and development kit
- Swing/AWT: Used for GUI components and graphics rendering
- Custom Game Engine: Built from scratch with game state management
- Thread-based Game Loop: Maintains consistent 60 FPS gameplay
- BufferedImage: Handles sprite loading and image manipulation
Maintains smooth 60 FPS gameplay with precise timing and frame management.
How it works: A dedicated thread continuously updates game state and renders frames at consistent intervals.
@Override
public void run() {
double timePerFrame = 1000000000.0 / 60;
long lastFrame = System.nanoTime();
long now;
while(true) {
now = System.nanoTime();
if(now - lastFrame >= timePerFrame) {
update();
repaint();
lastFrame = now;
}
}
}Double-buffered rendering system prevents screen tearing and ensures fluid animation.
How it works: Draws game elements to an off-screen buffer before displaying them on screen.
@Override
protected void paintComponent(Graphics g) {
if(scene == null) {
scene = createImage(GAME_WIDTH, GAME_HEIGHT);
pen = scene.getGraphics();
}
pen.clearRect(0, 0, GAME_WIDTH, GAME_HEIGHT);
if(getCurrentState() != null) getCurrentState().draw(pen);
g.drawImage(scene, 0, 0, this);
}Accurate hitbox-based collision system for interactions between bird and obstacles.
How it works: Uses rectangle-based hitboxes with precise overlap detection.
public boolean overlaps(Hitbox hb) {
return (x <= hb.x + hb.width) &&
(x + width >= hb.x) &&
(y <= hb.y + hb.height) &&
(y + height >= hb.y);
}Smooth gravity-based movement with responsive jump mechanics.
How it works: Implements physics calculations for bird movement with configurable parameters.
public void move() {
if(dead)return;
vy += GRAVITY;
y += vy;
y = Math.max(y, 0);
// ...death logic...
}Randomized bird colors with smooth animation system.
How it works: Randomly selects between yellow, red, or blue bird sprites with fluid wing animations every round!
private String getBirdColor() {
switch (ThreadLocalRandom.current().nextInt(3) + 1) {
default -> { return "yellow"; }
case 2 -> { return "red"; }
case 3 -> { return "blue"; }
}
}Tiered achievement system that rewards player skill. Awarded on scores of 10+, 20+, 30+, and 40+ points, respectively.
How it works: Awards increasingly valuable medals based on score thresholds, with visual feedback.
public enum Medal {
BRONZE, SILVER, GOLD, PLATINUM;
private final int minimumScore;
Medal() {
minimumScore = (ordinal() + 1) * 10;
}
public static Medal getMedal(int score) {
Medal medal = null;
for(Medal m : values()) {
if(score >= m.getMinimumScore())
medal = m;
}
return medal;
} 



