The Gravyzone

This is where I irregularly post about mostly game dev

Home

Flabby bird clone made with Raylib

Aug. 27, 2026 | Categories: GameDev

The project was to implement this infinite runner style game in my favorite library Raylib using C. CS50Games is written in Love (which uses Lua) and is OOP and C is not OOP.

I did not make the mistake I made in Pong where I was stubbornly trying to 'fake' OOP with convoluted bullcrap, so this came along better. One issue I took with the CS50 way (which I understand is purposeful for demonstrating creating/deletion of objects) was the constant spawning of pipes and despawning of them, when you really just need a data structure that holds n-pipes and loops like the background. Meaning, I just reset the pipes location after it goes of the screen x-pixels.

So I did that instead of constantly allocating/deallocating memory.

This is such a small project and I'm sure in some languages the memory allocation/deallocation this optimization wouldn't matter much if at all but why not just take care of it? Good practice. Lots of games have lots things loaded in memory at all times anyways as it's more efficient.

 

A fun bug I discovered, which was of my own making, was the infamous precision loss going from floats to ints. The pipes would slow down when the would approach the end of the screen. They were supposed to keep moving at a constant rate.

This took emberrasinly long to catch. Cast that int to a (float){}, curly braces just for clarity,  and all was well with the world. Noob mistake I should have caught sooner, but hard lesson learned. Burned into my brain. Forever. God. Damn. For. Ever. I bet my old comp sci teachers are rubbing their hands menacingly thinking 'HAHAHAHAHA I told you to watch out for these errors'.

The final game is fine, this is the third time i've done a flappy bird clone (once in Unity with C# and again in Godot, I wanted to learn the differences in the engines by making a similar game) and I am very over it, never doing another clone of this stupid game again.

Final reflection: it was fun learning some new features in Raylib like using sprites, sounds, more AABB collision BUT with a focus on slight offsets to make the game easier/harder.  And watch your types.

 

 

Say NO to AI. All typos and gammar errors are my own, thank you very much.