June 17, 2026 · Projects

C++ Tetris Clone

Last year I began working on a metronome android application for carnatic talas. I couldn't find anything reliable on the Playstore that was free with all the features I needed for my practice, so I decided to make my own app. After I got a working prototype on my Pixel 7, I used it for several months before deciding to release it on the Playstore.

Taking a prototype app and making it release ready has not been fun. After fixing all the annoying UI issues and almost tearing out my hair in the process, I began testing on Firebase labs across multiple android phone models and versions. That's when I ran into an issue I sort of knew I might run into but hoped to the software gods that I wouldn't. Non flagship android models showed a drift of about 10 milliseconds on average, which meant that the beats were not exactly accurate. They were mostly accurate, but +- 10ms is still too much for a metronome app. Underlying hardware differences along with SoundPool - the android audio library I used were not efficient enough, and it didn't matter how much I optimised my kotlin code.

What does any of this have to do with Tetris?

To fix this issue, I realised I have to rewrite my metronome engine in C++ using Oboe, a low latency audio library that is used to build high performance applications for android. I haven't coded in C++ in a very long time and decided to build something small first to get back to the language.

I challenged myself to build a small close ended project without using AI to do so. Tetris fit the criteria. I looked at YouTube tutorials and Raylib documentation (a graphical library for videogame development with C++) and it took me a few days to get a working game. I wrote my own makefile and coded with Vim without an IDE like a peasant just for fun.

Here are some screenshots from my game -

Game over
Game Start

I uploaded my project on GitHub, you can find it here - https://github.com/snowyhiker/Cpp-tetris-clone

I'm rather pleased with my detour results. Now back to fixing my metronome with Oboe! I hope to do this without AI too, lets see how it goes.

  • LinkedIn
  • Tumblr
  • Reddit
  • Google+
  • Pinterest
  • Pocket