Skip to content

sdsdsdasa/flappy-bird-2d-unity

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Flappy Bird — Unity 2D

A feature-rich Flappy Bird clone built in Unity 2D, supporting solo and local co-op (duo) play with multiple difficulty modes, a leaderboard, and custom sound effects.


Demo

pic1 pic2 pic3 pic4 pic5

Features

  • Solo Mode — classic single-player Flappy Bird gameplay
  • Duo Mode — local two-player co-op on the same keyboard; the player who survives longer wins
  • Four Difficulty Levels — Easy, Hard, Extreme, and ExtremeExtreme, each tuning gravity, bird flap strength, pipe speed, and spawn rate
  • Persistent High Scores — per-difficulty high scores saved locally via Unity PlayerPrefs
  • "New Best" Notification — visual + audio feedback when the player beats their personal best
  • Scrolling Background — parallax background scrolling for visual depth
  • Custom Cursor — custom in-game cursor sprite
  • Full Sound Design — background music, flap sounds, death sounds, and win fanfare

Scenes

Scene Purpose
StartScene Main menu
PlayerModeScene Choose Solo or Duo mode
DifficultiesScene Choose difficulty (Easy / Hard / Extreme / ExtremeExtreme)
SoloScene Single-player gameplay
DuoScene Two-player local co-op gameplay

Controls

Solo Mode

Key Action
W Flap up
A Push left
D Push right
Space Restart after game over

Duo Mode

Player 1 uses the same keys as Solo Mode. Player 2 controls are configured separately in-scene.


Project Structure

Assets/
  Font/          — Custom fonts (ThaleahFat)
  Image/         — Sprites, backgrounds, UI, prefabs (pipes, weapons, cursor)
  Scenes/        — All Unity scenes
  Script/        — All C# game scripts
  Sound/         — In-game sound effects (WAV)
Packages/        — Unity package manifest
ProjectSettings/ — Unity project configuration
music/           — Source audio files (MP3)
png/             — Source image assets

Key Scripts

Script Responsibility
BirdScript.cs Player 1 bird physics, input, collision, death
BirdScript2.cs Player 2 bird (Duo mode)
LogicScript.cs Score tracking, game-over logic, win/draw detection
ScenesManager.cs Scene transitions, mode/difficulty state management
PipeSpawnScript.cs Procedural pipe spawning
PipeMoveScript.cs Pipe movement and speed
PipeMiddleScript.cs Score trigger (middle gap detection)
HighScoreScript.cs Per-difficulty high score persistence
BackgroundScrollerScript.cs Parallax background scrolling
BackgroundMusicScript.cs Background music management

Getting Started

Requirements

Running the Project

  1. Clone the repository:
    git clone https://github.com/<your-username>/flappy-bird.git
  2. Open Unity Hub and click Add project from disk, selecting the cloned folder.
  3. Open the project in Unity 2021.3.21f1.
  4. In the Project window, open Assets/Scenes/StartScene.unity.
  5. Press Play to run the game in the editor.

Building

  1. Go to File > Build Settings.
  2. Add all scenes from Assets/Scenes/ in the listed order (StartScene first).
  3. Select your target platform (PC, Mac, WebGL, etc.) and click Build.

Difficulty Settings

Difficulty Gravity Flap Strength Pipe Speed Spawn Rate
Easy 5 20 7 3 s
Hard 5 21 13 1.7 s
Extreme 7 28 19 1.3 s
ExtremeExtreme 5 28 19 1.3 s

Credits

  • Game Engine: Unity 2021.3 LTS
  • Font: ThaleahFat
  • UI Assets: 2D Casual UI pack
  • Background Art: Pixel Skies 1920×1080 (Full HD)
  • Sound Effects: DM Casual Game Sounds pack

License

This project is for personal use. Third-party assets (fonts, UI packs, sound packs, background art) are subject to their respective licenses.

About

a Unity 2D Flappy Bird-style game featuring solo and duo modes, difficulty settings, scoring, power-ups, and custom audio/visual assets.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages