Flappy Bird Game in C++ ; Friendly to beginner! Using object-oriented programming and the EasyX graphics library.
If you find this project helpful, please give us a ⭐️ Star!
The game involves controlling a bird by clicking the screen to avoid obstacles (columns). The project uses object-oriented programming to structure different functionalities of the game.
-
CBirdAPP
: Main game class, manages game state and core logic.CBackGround m_BackGround
: Background objectCGround m_Ground
: Ground objectCPlayerBird m_PlayerBird
: Player bird objectCColumnBox m_columnBox
: Manages columnsCBeforeGame m_BeforeGame
: Pre-game interfaceCAfterGame m_AfterGame
: Post-game interface
-
CBackGround
: Handles game background.IMAGE m_imgBack
: Background imagevoid InitBackGround()
: Initialize backgroundvoid ShowBackGround()
: Display background
-
CGround
: Handles game ground.IMAGE m_imgGround
: Ground imagevoid InitGround()
: Initialize groundvoid ShowGround()
: Display groundvoid MoveGround(int step)
: Move groundbool ITouchGround(CPlayerBird* player)
: Check if the player bird touches the ground
-
CPlayerBird
: Handles the player-controlled bird.IMAGE m_imgPlayer[8]
: Bird animation framesvoid InitPlayerBird()
: Initialize birdvoid ShowPlayerBird()
: Display birdvoid MovePlayerBird()
: Move bird
-
CColumn
: Handles obstacle columns.IMAGE m_imgColumn
: Column imagevoid InitColumn()
: Initialize columnvoid ShowColumn()
: Display columnvoid MoveColumn(int step)
: Move columnbool ITouchBird(CPlayerBird* player)
: Check if the column touches the player bird
-
CColumnBox
: Manages multiple column objects.list<CColumn*> m_ColLst
: List of column objectsvoid InitColumnBox()
: Initialize columnsvoid ShowAllColumn()
: Display all columnsvoid MoveAllColumn(int step)
: Move all columns
-
CBeforeGame
: Handles pre-game interface.void InitBeforeGame()
: Initialize pre-game interfacevoid ShowBeforeGame()
: Display pre-game interfacevoid StartGame()
: Start the game
-
CAfterGame
: Handles post-game interface.void InitAfterGame()
: Initialize post-game interfacevoid ShowAfterGame()
: Display post-game interfacevoid ReStartGame()
: Restart the game
- Control a bird to fly through obstacles
- Simple yet addictive gameplay
- Score tracking
- Basic collision detection
- Game restart functionality
If you find this project helpful, please give us a ⭐️ Star!
- C++ compiler (e.g., g++)
- EasyX graphics library (for Windows)
- Inspired by Dong Nguyen's original Flappy Bird game
- EasyX graphics library