Building Aliens vs. Tetris in 2 Hours With Grok 3

Posted on February 22, 2025 by @1337ice_cream

Seeing all the hype about Grok 3 being good at creating video games was pretty exciting. I coded a few games from scratch when I was younger, and it was extremely difficult as a new programmer to figure out all the mechanics of simple games like Pong and Tetris. The internet was young, and you still had to learn how to code from a book, which didn’t help. In this test, I started by having Grok 3 build Tetris. The base game was generated successfully in one shot. I did not specify which language to use, and it chose JavaScript. The game played fine and used basic colors.

Initial Tetris Grok screenshot

Adding Complexity

Adding some complexity to it sounded fun, so I decided to add a flying spaceship that would shoot at your pieces. This proved to be difficult for Grok because it now had to track the position and health of each square of each piece so it could rotate correctly. After many attempts to fix the problem, I decided part of the issue was that position tracking should have been considered in the original ask. I asked Grok to write me a new prompt that considered all the new things I had asked for. I resubmitted the new prompt to Grok, and it coded a version that wasn’t fully working but was working better. It took one additional prompt to have working damage tracking through piece rotation. At this point, I also had it add a score penalty for each lost brick to encourage quicker gameplay.

Polishing the Game

A common suggestion I see on X is to ask Grok to "make it more beautiful," and the result was really pleasant. It looks like a real game now!

Tetris Grok before enhancement Tetris Grok after enhancement

Lessons Learned

An important realization I made during the creation of this was that when using LLM products to build things "piece by piece" and these pieces need to work together, you will need to re-evaluate if the original piece was even designed to do that in the first place. In this instance, where my Tetris pieces wouldn’t track through rotation, it was easier to ask Grok to start over with the new specifications in mind. Don’t be afraid to start over! Grok is fast!

Final Thoughts

The final game was surprisingly fun to play. Most of the 2 hours were actually spent playing the different versions of the game. I will say that finally getting a block you desperately needed and having it change shape on you can be devastating, but it’s still pretty fun. This game is written in JavaScript, so feel free to steal it, play with it, and make it your own! Check it out here [Desktop Only].