Triangular Tetris

At the Gathering 4 Gardner weekly meetup a few weeks ago, we were discussing the aperiodic monotile and someone proposed a variation of Tetris where the only shape you get is the hat. I was inspired to start work on something like that — I just haven’t yet been inspired to finish! I only got as far as changing Tetris’s square grid to a triangular — that is, polyiamond — grid.

I present: Triangular Tetris!

The source code (as always, available on my GitHub) is based on Jake Gordon’s javascript-tetris from 2011. Jake wrote a blog post dissecting his code in detail.

I’m not terribly happy with the rotation controls; if you play it right now you’ll see what I mean. I might revisit it and come up with something better, later. Also right now you’ll see that the falling piece can “clip through” stationary pieces in at least two unusual ways, one of which actually involves one triangle being drawn partially behind another. I don’t know whether to call that a bug or a feature.

To turn this into Hat Tetris, one would need to divide each of those triangles into three kites; figure out collision detection; figure out intuitive rotation controls; and (hardest of all, I think) figure out what “completing a row” looks like. I have some ideas; just have to find time to implement them…


For another interpretation of “triangular Tetris,” check out David Bagley’s Tertris, which is also playable online.

Posted 2023-05-19