I just recently started on a new project to get more into hardware. It's a version of Tetris that runs on an RP2040-based board, with a 32x64 RGB led matrix as display.
The core game logic is implemented as a function that gets called at 60Hz with user input and is responsible for producing the RGB buffer. Around that sits a little harness that takes care of grabbing inputs and sending the visual output to the display.
I've also written a separate version of the hosting harness for WASM & webgl. When working on the game proper it's just a faster turnaround to compile and test things in the browser. It'll also make it easy to get feedback from people since I can just point them to a URL. I already had most of this code lying around from a previous project so it didn't take much time to whip up the web frontend.
All of the code for the game logic and the two harnesses is in C++.
The core game logic is implemented as a function that gets called at 60Hz with user input and is responsible for producing the RGB buffer. Around that sits a little harness that takes care of grabbing inputs and sending the visual output to the display.
I've also written a separate version of the hosting harness for WASM & webgl. When working on the game proper it's just a faster turnaround to compile and test things in the browser. It'll also make it easy to get feedback from people since I can just point them to a URL. I already had most of this code lying around from a previous project so it didn't take much time to whip up the web frontend.
All of the code for the game logic and the two harnesses is in C++.