Flappy Bird clone ! [Using my own C++ Game Engine]
- itzvnodm
- Dec 19, 2014
- 3 min read
Flappy Bird!
Controls:
Easiest controls ever, one button “Space Bar”, and the hardest game ever.
UI Element:
Player score and Restart Screen as shown below,

Debug Lines: [Press ‘O’ to toggle]
Debug line in my game shows the bird speed and direction with the length of the line indicating the magnitude.
The bird only moves up and down, the background movement is fake and is done by UV Scrolling. Although the pillars move towards the bird. The pillars after going out of the camera spawn back in front of the bird. Below is a gameplay video of my game:
Why?
I chose this game not just because I hated the original one, but because it was something that I could code really fast while showing all of the features my game engine supports that I created over the past semesters, especially this one. I have learned a lot of new things this semester and have used almost all of what I learned, including, but not limited to,
Maya Exporter: I have used all of my models exported from the MayaExporter plugin.
Build Pipeline: All the assets are built using the build pipeline that I developed over this semester. And I should say adding a new type of asset was really convenient and easy.
Mesh: Includes all the vertices and indices details of a model. Meshes and materials are in a cache, and they are shared with every actor sharing the same ones. While creating one of those, the graphics system always checks if it had already created one and either creates one or returns one from the cache.
Material: every object has Material on it which specifies the vertex and fragment shader along with texture.
Sprites and Atlas: UI elements can easily be drawn with the Sprites and Atlas support. Original aspect ratio of the texture is maintained by taking in only the desired width from the user and the desired height calculation is done based on texture's original height and width.
Shaders: Implemented several vertex shaders and fragment shaders with Sprite support, scroll support, specular and diffuse lighting support, Bump/Normal map support.
Normal Maps: The ground has a crude bump map on it that you will notice when the direction of light changes.
Diffuse and Specular Lighting: The pillars in game use the specular lighting.
UV Scrolling: The background plane and ground textures use UV scrolling, where the bird is jumping up and down and the pillars are moving towards the player.
I have also extensively used the concepts learned in previous semesters, including,
Messaging System: I have used messaging system across several controllers across the game to respond and reset on restart.
Sharedpointers
Hashed strings
Named Bitsets
World system and Actors
Collision System
Controllers
Singletons
Extra:
Scene / Level file and Level Loader: I have added a .level lua file that can hold all the level specific information like, Camera settings like Eye, lookat, position, etc., Lighting Information like diffuse color or light direction, and all the actor information including position, acceleration, velocity, mesh, material and collision details.
Actor Snapshot support: Actors can store their own data/Snapshot on a function call and can later restore them, this helped me restart a level in the game, rather than reloading everything from a level file.
Added sound play support
Camera Shake
Night and Day effect
Calculating the Collision bounds using mesh data: Mesh builder not only stores all the vertices and indices data, it also parse through them to find the 3D bounding box of any mesh.
Antialiasing support: in UserSettings.ini
Missing texture support: If a texture is not found while loading any object, a default missing texture is applied that is really apparent and the game continues as normal.
Constant Handling: I have made an effort to create a more robust handling of constants that does settings of floats or float-arrays or matrix based on its internal types. After setting this up, I did not have to worry about calling the specific setting of the constants as long as their type was set. I also tried removing the hard-coding of the Per-view and Per-Frame data constants by having user input the constant names in Material files along with their respective shader table.
Lua Helper Lib: Added Lua Helper lib that has the generic implementation of Lua load handling and some template functions to handle parsing of different number data types.
Commentaires