top of page

Using Grok 3 to make Games using an AI coder - Tetris Variant, Snakes

Writer: Greg HungGreg Hung

Updated: Mar 11

I read a post on X.com where they used the new Grok 3 AI LLM to create the code to create some decent arcade classic games. Using a couple of magic prompts and the knowledge of AI coding using bolt.new I was able to make a tetris variant game in a couple of hours. When using the Grok 3 Prompt you want to inititially use Deep research mode. After the first prompt is done turn on think mode and get the code that you would plug int the ai coding platform. For Example:


Deepsearch: Write a p5js implementation of Grand Theft Auto. It must be extremely polished, and I want you to build all the sprites and assets yourself. I don't want to import any assets


Think: now create a code block with the entire correct code please



The key here is that you need to pair Grok 3 with another application like bolt.new or a p5.js editor (recommended by Grok). The p5.js editor is easy enough to just copy and paste the code, but you have more power to make iterations, and add music and sounds using an ai coder like bolt.new


If you want to learn AI coding check out my Udemy Online course. The power of Grok allows me to generate the code and assets to create a mobile friendly game and put a twist on my Tetris game called Petris.




Tetris Variant Ai game made with Grok 3
Tetris Variant Ai game made with Grok 3


 I added these features to the game to give it a more polished feel.


  • Custom music to the game that you can turn off

  • Sound effects when rotating the blocks

  • Added some new shapes to the game with decent graphics

  • A header customization with a logo

  • A point system when you manage to create a line


While this game is fairly simple it shows the power of what is to come. I'm sure in the future someone may create an AI gaming studio one day. Try out my game.


If you want to learn how to create AI games using Grok I will be making a bootcamp mini course. So leave your contact information if you want to find out when it's available.




Here is another example of how I created a snake variant game using Grok 3 and bolt.new Ai coder.





I also made a simple space invaders game called G Invaders that needs a bit of work but I think is also cute.




using grok 3 & ai to make games

Pieter Levels created an amazing flight simulator game that I used as inspiration to create a hybrid between asteroid and flight simulator asking bolt.new to replicate his game as the first prompt. The future is looking interesting with this combination of technologies.







 
 
 

Comments


bottom of page