Skip to content

ShenLoong99/Flappy-Bird

Repository files navigation

Contributors Forks Stargazers Issues Unlicense License LinkedIn

Flappy Bird (Unity Mini Project)

flappy-bird


Unity 6 C# Scripting URP Status

Last Commit Repo Size

Explore the docs »

Table of Contents
  1. About The Project
  2. Built With
  3. File Structure
  4. Getting Started
  5. Usage & Testing
  6. Roadmap
  7. Challenges

About The Project

This project is a Flappy Bird–inspired 2D game built with Unity as a mini learning project. The goal was to understand core Unity fundamentals such as player physics, collision detection, obstacle spawning, scoring, and basic game state management using C#.

The project was developed while following and learning from Game Maker’s Toolkit's "The Unity Tutorial For Complete Beginners", with additional experimentation and customization.

Built With

  • Unity (2D)
  • C#
  • Unity Physics (Rigidbody2D, Colliders)
  • Unity UI System

File Structure

flappy-bird/                        # Root Project Directory 
├── .git/                           # Git version control metadata 
├── .vs/                            # Visual Studio configuration files 
├── .vscode/                        # VS Code workspace settings 
├── Assets/                         # Primary Game Content 
│   ├── Audio/                      # Sound effects (flap, score, hit) 
│   ├── Materials/                  # Sprite and object shaders 
│   ├── Prefabs/                    # Reusable templates (Pipe, Bird) 
│   ├── Scenes/                     # Game levels (MainMenu, GameScene) 
│   ├── Scripts/                    # C# Logic 
│   │   ├── BirdScript.cs           # Bird physics and input 
│   │   ├── PipeMove.cs             # Leftward movement logic 
│   │   ├── PipeSpawner.cs          # Dynamic pipe instantiation 
│   │   ├── LogicScript.cs          # Scoring and Game Over system 
│   │   └── PipeMiddleScript.cs     # Score trigger detection 
│   └── Settings/                   # Project-specific internal settings 
├── Library/                        # Unity's local cache (do not track in Git) 
├── Logs/                           # Editor and build log files 
├── Packages/                       # Unity Registry dependencies 
├── ProjectSettings/                # Input, Tag, and Physics configurations 
├── Flappy Bird.sln                 # Visual Studio Solution file 
├── README.md                       # Project documentation 
└── Flappy Bird Tutorial.pdf        # Project documentation/guide 

Getting Started

Prerequisites

  • Unity Hub
  • Unity Editor (recommended LTS version)

Installation & Deployment

  1. Clone the repository.
  2. Open Unity Hub
  3. Click Open Project
  4. Select the cloned project folder
  5. Open the main scene and press ▶ Play

Usage & Testing

Watch the sample gameplay at my linkedIn post here: Flappy Bird Gameplay

  • Press Spacebar to flap
  • Avoid pipes and obstacles
  • Score increases as you pass pipes
  • Game resets on collision

Testing focused on:

  • Collision accuracy
  • Pipe spawning intervals
  • Player physics balance
  • Score consistency

Project Roadmap

  • Add start & game-over screens
  • Add sound effects & background music
  • High score persistence
  • Mobile touch support
  • Difficulty scaling over time

Challenges

Challenge Solution
Unstable player movement & gravity balance Adjusted Rigidbody2D gravity scale and flap force values to achieve responsive yet fair controls.
Inconsistent pipe spawning Implemented timed spawning with randomized Y-axis positions while keeping a fixed X-axis offset to maintain consistent difficulty.
Collision detection triggering unexpectedly Refined collider sizes and positions to better match sprites and prevent false collisions.
Score incrementing multiple times per pipe Added a dedicated scoring trigger and logic to ensure each pipe is counted only once.
Game state reset issues after game over Centralized game state handling to properly reset player position, score, and obstacles on restart.

Acknowledgements

Special thanks to Game Maker's Toolkit for the excellent tutorial

Tutorial: The Unity Tutorial For Complete Beginners

This project was built as a hands-on learning exercise inspired by that video

About

Flappy Bird–inspired 2D game built with Unity, featuring C# scripting, Rigidbody physics, procedural pipe spawning, collision handling, and score tracking.

Topics

Resources

Stars

Watchers

Forks

Contributors

Languages