Table of Contents
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.
- Unity (2D)
- C#
- Unity Physics (Rigidbody2D, Colliders)
- Unity UI System
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
- Unity Hub
- Unity Editor (recommended LTS version)
- Clone the repository.
- Open Unity Hub
- Click Open Project
- Select the cloned project folder
- Open the main scene and press ▶ Play
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
- Add start & game-over screens
- Add sound effects & background music
- High score persistence
- Mobile touch support
- Difficulty scaling over time
| 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. |
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
