How to make a Flappy Bird game on an 8×8 LED Matrix with MAX7219 driver

I want to create a simple Flappy Bird–style game using an Arduino, an 8×8 LED matrix, a MAX7219 driver, and a push button. The bird would be a single LED that moves up when I press the push button and falls down due to gravity. Pipes with gaps would scroll from right to left, and if the bird hits a pipe or goes off the screen, the game ends. I need advice on structuring the game loop, choosing the right library for the MAX7219, and detecting collisions on an 8×8 grid. I have an Arduino Uno, the LED matrix with MAX7219, and a push button. Has anyone tried a similar project or can share suggestions or example code?

Basically you can’t do this directly. You need to have the co-ordinates of your bird, which you know because you last placed it there.

Then you need to know the co-ordinates of your pipe walls. This bit is a lot more tricky. You have generated the image of your pipe works so you should be able to calculate where the walls are. In fact there will be a whole lot of possible positions for your pipe walls.

So you make a list of these and then go through the list comparing each possible pipe wall with where your bird is. If there is no match then fine, go onto the next iteration of the game. If there is a match then its game over.

Do you have a choice?

This is a complex chip and has many options. You need to understand the chip even before you can use a library. I would get the data sheet for this chip and give it a good read. Personally I program this chip directly without using any library.

A typical game loop repeats until the game ends. It begins by calculating the new positions of all elements based on speed, direction, and physics such as gravity. It then detects events like player input, collisions, or timers expiring. At this stage, decisions are made that affect the screen, for example triggering an explosion animation when a collision occurs or switching to an end-of-game screen. The loop then paints the updated scene to the display, reflecting these changes. Finally it cycles back to the start, pacing the loop to keep the frame rate consistent.

For this you might benefit from studying state machines. Here is a small introduction to the topic: Yet another Finite State Machine introduction