Concurrent Flappy Bird: Real-Time Physics Engine

The Challenge:

Traditional game architectures often tie physics calculations to the main rendering loop. This creates a critical weakness: whenever complex physics calculations are required, the entire game—including the visuals—lags.

Our Solution (Concurrent Architecture):

I architected a high-performance C++ application using a Producer-Consumer concurrency model to solve this core problem.

The Main Thread (Producer) is dedicated solely to low-latency rendering (SFML) and user input, guaranteeing a stable, locked 60 FPS frame rate.

The ThreadPool (Consumers) consists of multiple worker threads that asynchronously process heavy, CPU-bound tasks, specifically applying physics commands (like FLAP velocity changes) to the shared GameState via a thread-safe SafeQueue.

The Impact:

By decoupling the I/O-bound renderer from the CPU-bound physics engine, I created a robust and scalable architecture. This design eliminates frame rate jitter and demonstrates a best-practice approach to concurrent real-time system design.

Built With

Share this project:

Updates