Tetris in WebGL

I'm currently experiencing bit of burnout from developing my indie game in Unreal Engine. Rather than just continuing my marathon and risk total burnout, I decided to go back to my roots and look at some of my past projects.

One of the games I've made back in my undergrad was a Tetris game implemented in OpenGL. Since I've been doing a lot of web development on the side, I figured I should try to rebuild that project in WebGL.

The conversion was surprisingly straightforward:

  • The game state logic, previously written in C++, was rewritten to TypeScript
  • The GUI and event handlers, previously handled by Qt, were converted into Vue.js
  • The shaders were reused as-is because WebGL is essentially just a wrapper around OpenGL

I was pleasantly surprised that the only change needed was updating the Vertex Buffer Objects (VBO) API calls from OpenGL 1.4 to OpenGL 3.0 ES.

Overall, this was a fun experience and made me remember why I decided to pursue my indie game development journey in the first place. However, managing the direct GPU calls was a pain in the ass and I don't mind not ever having to deal with it again in modern game engines.