Continuing in our exploration of gamified higher math, Leo and I programmed up a version of space invaders in HopScotch that depends on matrix multiplication. I took only a few hours to create a pretty interesting game. Below are some screenshots from the game. It’s a bit hard to explain the game play; I recommend playing it yourself here!
The matrix (Vmn) is constantly being multiplied by the current target (Txy) to create the new values (Nxy):
You click on the V(mn) entries to roll them through -1, 0, 1, and then when you have an Nxy result you like, click “Fire” to load the new (Nxy) to the target (Txy). Since the matrix multiplication is being continuously, as soon as you load the Nxy into the Txy, the new Nxy are re-computed. It’s easy to create matrices that move the target around in more-or-less any way you like.
Meanwhile, the invader is getting closer and closer. If you hit the invader before it hits earth, you win.