ng that?ā and experiment until they find the order. Red will keep them red; any other color than orange will reset the progression. I like that eating a yellow cherry <i>does</i> change Chomperās color, but is a little bit of misdirection as itās back to default.</p><p id="16fd">Once in Rainbow Disco Mode, the drop pauses (I like to imagine Chomper enters a state where he can travel through space and time), and you can eat every last cherry and clear the level. But be careful not to lose Disco Mode; eating a berry out of sequence will reset Chomper. This also means you have to strategically leave the right berries to finish your meal in Disco.</p><h2 id="2ea8">Level 2 Walkthrough āHungry Eyesā</h2><p id="595a">Level 2 has our first bad guys! These pesky āTombstonesā chase Chomper; they generate when Chomper turns Orange, Green, and Violet. They donāt cause harm yet but they get underfoot. Tombstones do however eat the next cherry you need in your Rainbow sequence if they get there first!</p><p id="146d">More importantly, theyāre coded with behavior: Tombstones will chase Chomper <i>or</i> the next cherry; whichever is closer. This allows players to strategize: you can lure Tombstones away from cherries and circle back.</p><p id="ed80">Tombstoneās eyes will change color to reveal which color cherry they are currently hungry for. This is also a handy visual reminder for the player!</p><p id="378a">The goal ā as always ā is to enter Rainbow Disco Mode and clear remaining cherries. Disco Mode will also freeze Tombstones along with the drop rate.</p><h2 id="1b57">Level 3 Walkthrough āHelp from aboveā</h2><p id="a1f9">Level 3 is where things get real! Tombstones now have a red stroke around them, and their fill color is black, making them more menacing. <b>We have a Game Over condition.</b> Tombstones can attack Chomper, freezing Chomper (but they die in the process). Chomper has 3 lives; there are 3 Tombstones.</p><p id="78ed">The puzzle in this level is how to unfreeze Chomper! They just wonāt budge!</p><p id="712a">Iām hoping this causes a few people to bang their heads on their keyboards.</p><p id="523b">When frozen, Chomper turns white and refuses to move; they will follow the cursor with their head, but thereās no way to reach the needed cherries!</p><p id="d345">I wanted this to be a moment that shakes up gameplay. Because behold: the player can pick up cherries and hand-feed Chomper! i.e. <i>āHelp from aboveā</i>.</p><p id="2ed9">I donāt think anyone will expect this, so itās a nice surprise (and tactical!).</p><p id="3278">It seemed a great way to change mechanics mid-game. Suddenly you can interact with Chomper as a helper character on high, or <i>deus ex machina</i>.</p><p id="31fd">If anyone is stuck too long, you get an extra clue: Chomper will cry out:</p><p id="d0db"><b><i>āFeed me Mama!ā</i></b></p><p id="f01f">Hopefully, that tugs on the heartstrings too!</p><p id="7687">Again, the win condition is Rainbow Disco Mode. It can be quite tactical to get frozen so that you can scoop up cherries by hand and feed Chomper, all the while being safe from Tombstones (they ignore frozen Chomper). Just beware: Chomper can only be frozen <b>three times</b> before they lose all lives.</p><h2 id="0012">Level 4 Walkthrough āSome lines cannot be crossedā</h2><p id="b73d">At Level 4, there is a dynamically produced maze. This maze is constructed from any remaining cherries a step behind in the rainbow sequence. The cherries are connected by ālaser beamsā. So thereās now a strategic reason to āmop upā all cherries of one color before advancing ā often at the cost of making progress if the maze will block off cherries needed at later stages.</p><p id="904d">If Chomper crosses a laser wall, they get zapped and lose rainbow progress!</p><p id="367f">āGame Overā occurs if Chomper is frozen and touching a laser. There are two situations where this can happen:</p><blockquote id="a5d9"><p><b>1) Chomper brushed a laser and was hit by a Tombstone at the same time</b></p></blockquote><blockquote id="7045"><p><b>2) Chomper was already frozen and was shot through by a newly formed laser (because the berry you handed him triggered the laserāyou killed Chomper!).</b></p></blockquote><p id="66d3">Since the laser resets Chomperās Rainbow color progress and Chomper canāt unfreeze without eating a full diet of cherries, itās a āGame Overā.</p><p id="82c2">If you can beat this level, <i>you might get to see a little Easter Egg.</i></p><figure id="0e08"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/1*5l3BZ9xfHC_NDwx8GjH0Pw.png"><figcaption></figcaption></figure><h2 id="a00b">Tactics and Strategies</h2><p id="7752" type="7">ā The sequence cycles: Red, Orange, Yellow, Green, Blue, Indigo, Violet, Red, Orange, Yellow, Green, Blue, Greenā¦</p><p id="8d15" type="7">ā You can eat berries the same colour as Chomper is</p><p id="0a89" type="7">ā in Level 1, you want to make sure that you leave enough berries behind when you enter Disco Rainbow Mode to complete the sequence again. If not (unless youāre very lucky) youāll be left with berries that reset disco mode</p><p id="b6f3" type="7">ā Tombstones only target the next color berry</p><p id="ad0c" type="7">ā Tombstones will chase you. Use this to your advantage!</p><p id="904e" type="7">ā Tombstones die when they freeze you. It can be tactical to take out 1ā2, but beware, you have only 3 lives per level</p><p id="4a2f" type="7">ā Itās easy to work out where walls will generate by keeping track of berries in your periphery vision</p><p id="0bb3" type="7">āSometimes it can be strategic to let cherries amass</p><p id="3101" type="7">ā Tombstones will follow hand-fed berries! I wonder if this can be used to lure them to their deaths (drop a comment if you figure this one out, wink)</p><figure id="e8a1"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/1*vu8BA4nOaCuSo8YY54UwVQ.png"><figcaption>By combining hu
Options
man creativity and the power of GPT-4, we can create our own entertaining games that challenge conventional gameplay and bring joy. Get ready to unleash your imagination and code with GPT-4!</figcaption></figure><h1 id="678d">A last word from your AI-assisted game designer</h1><p id="bfd7">I hope you enjoy this game as much as I enjoyed bringing it together for you. As you can see, even though the coding was written by AI, a lot of creative thought went into it. It was amazing seeing my game mechanics come alive. Follow me to get my next article. Iāll dive into how to prompt GPT-4 to code games for you, how to troubleshoot, and how to squeeze a long code (750 lines) into your chat input without exceeding token limits.</p><p id="0ceb">If youāve enjoyed playing this game and find it interesting, <b>please share my article with your friends!</b></p><p id="c6d3">Iāve also released Rainbow Cherry Chomp with an <a href="https://creativecommons.org/licenses/by-nc-sa/3.0/">Attribution-NonCommercial-ShareAlike Creative Commons License</a>.</p><p id="e9c9"><b>What does this mean?</b> That you can remix, transform or build upon my game code, as long as you attribute it to me and itās for non-commercial purposes (you must distribute your contributions under the same license as the original). <b>Iāll talk more coding <a href="https://readmedium.com/game-changer-using-gpt-4s-coding-capabilities-in-gaming-development-69dc387f96dd">in my next article</a>. Be sure to follow!</b></p><p id="4be7">Donāt forget to share your experiences, insights, and creations with the AI community as we all learn and grow together in this exciting new frontier of AI-assisted game development. Happy coding, and have fun chomping!</p><h2 id="3203">Who is Jim the AI Whisperer?</h2><p id="60b8">As <a href="https://thejasperwhisperer.com"><b>Jim the AI Whisperer</b></a>, I provide training and consulting services to help companies prepare for and properly utilize AI in their operations. Donāt miss out on the huge benefits of AI for your business. Take control of the technology and make informed decisions. <a href="https://thejasperwhisperer.com/contact">Contact me today</a> to learn more.</p><p id="4859">Iām also available for journalism opportunities, podcasts, and interviews.</p><h2 id="0603">Ready to join Medium?</h2><p id="0575">Gain unlimited access to the entire Medium catalog with my referral link, and youāll also be supporting my ongoing writing at no extra cost to you:</p><div id="f446" class="link-block">
<a href="https://medium.com/@JimTheAIWhisperer/membership">
<div>
<div>
<h2>Join Medium with my referral link - Jim the AI Whisperer</h2>
<div><h3>As a Medium member, a portion of your membership fee goes to writers you read, and you get full access to every storyā¦</h3></div>
<div><p>medium.com</p></div>
</div>
<div>
<div style="background-image: url(https://miro.readmedium.com/v2/resize:fit:320/0*fHpReXhL6qL7KtYr)"></div>
</div>
</div>
</a>
</div><h2 id="b8d8">You might enjoy these related articles from Jim the AI Whisperer:</h2><div id="b995" class="link-block">
<a href="https://readmedium.com/game-changer-using-gpt-4s-coding-capabilities-in-gaming-development-69dc387f96dd">
<div>
<div>
<h2>Game Changer: Using GPT-4ās Coding Capabilities in Gaming Development</h2>
<div><h3>From Prompts to Play: Coding a Pacman-like game using GPT-4</h3></div>
<div><p>medium.com</p></div>
</div>
<div>
<div style="background-image: url(https://miro.readmedium.com/v2/resize:fit:320/1*5l3BZ9xfHC_NDwx8GjH0Pw.png)"></div>
</div>
</div>
</a>
</div><div id="c587" class="link-block">
<a href="https://readmedium.com/i-sent-chatgpt-into-an-infinite-loop-bcf23a287d4a">
<div>
<div>
<h2>I sent ChatGPT into an infinite loop with this prompt injection trick</h2>
<div><h3>Simulating a spaceshipās computer in a bottle š</h3></div>
<div><p>medium.com</p></div>
</div>
<div>
<div style="background-image: url(https://miro.readmedium.com/v2/resize:fit:320/1*v1TRPd_CFaeS9tzCX3xrNg.png)"></div>
</div>
</div>
</a>
</div><div id="aeb8" class="link-block">
<a href="https://bootcamp.uxdesign.cc/what-is-gpt-4-and-what-are-some-of-its-new-capabilities-8bf300a8db16">
<div>
<div>
<h2>What is GPT-4, and what are some of its new capabilities?</h2>
<div><h3>Greetings, my fellow wordsmiths and AI enthusiasts! Today, OpenAI announced the release of GPT-4. Letās deep dive intoā¦</h3></div>
<div><p>bootcamp.uxdesign.cc</p></div>
</div>
<div>
<div style="background-image: url(https://miro.readmedium.com/v2/resize:fit:320/1*BScZ1IsPkoz4JjqREfrd4g.png)"></div>
</div>
</div>
</a>
</div><div id="627c" class="link-block">
<a href="https://bootcamp.uxdesign.cc/improve-your-ai-text-to-image-prompts-with-enhanced-nlp-fc804964747f">
<div>
<div>
<h2>Improve your AI text-to-image prompts with enhanced NLP</h2>
<div><h3>AI-Generated Art: How to Narrativize a Prompt for Stunning Art</h3></div>
<div><p>bootcamp.uxdesign.cc</p></div>
</div>
<div>
<div style="background-image: url(https://miro.readmedium.com/v2/resize:fit:320/1*EUewNLTMFjEa41q-jM2NEw.png)"></div>
</div>
</div>
</a>
</div></article></body>
Artificial Intelligence, Coding & Game Design
š¹ļø You can make arcade games with GPT-4. Play the game coded by A.I. š¤
Discover the future of game development with GPT-4! Check out this 4-level arcade game, coded by AI with 750 lines of code!
As an 80s kid, I used to love programming my own games. As I grew older, I lost track of the current coding languages. So I was incredibly excited when Kris Kashtanova reminded me we can use GPT-4ās abilities for writing code!
Canāt wait? Scroll down to play the game!
GPT-4 can generate code blocks in programming languages, like Python, Java, C++, JavaScript, etc. This opens up a world of possibilities for game development enthusiasts who may not be versed in modern programming languages or simply want to tap into AIās potential to create unique games.
In my next blog post, Iāll tell you how I managed to coax 750 lines of code out of GPT-4 with the current token restrictions ā and guide you to make your own games, including prompts. So make sure to follow! Let me tell you, it was a creative conundrum to keep the entirety of the game in the forefront of GPT-4ās attention, and not have it start hallucinating code! I used all my bag of magic tricks and superpowers as a prompt engineer:
But in todayās post, I want to highlight the gameās features, because itās a deceptively simple game loaded with cool elements and hidden surprises.
If you donāt want spoilers, I highly recommend playing it first to discover these secrets through your own gameplay. Play right here! Give it a shot :
Play Rainbow Cherry Chomp:
The new arcade game coded by GPT-4!
Clear the cherries. Sounds easy? Youāll need more than your appetite.
[if the embedded link doesnāt load, or is too small, Rainbow Cherry Chomp is also available to play in all its full-screen glory at openprocessing.org]
Showcasing the hidden features of Rainbow Cherry Chomp:
My game is designed as an arcade PUZZLE, so the following walkthrough will take out some of the enjoyment of puzzling out the solutions! Donāt give up. There are hints provided at the beginning of levels 2, 3, and 4.
Okay, letās look under the hood!
The Inspiration
I wanted to take a simple, nostalgic, and familiar comfort food and shake it up. Much like Double Fine Games does by āhidingā point-and-click puzzle elements inside their gameplay, I wanted players to be stumped at times.
The challenge was that I had one mechanic: Eat cherries. Chomp! Chomp!
Rainbow Chomper is an entirely original character and far more terrifying than a certain āMan OāPacā
Chomperās movement was obviously going to be a big thing, and it was the first element I locked down. It works best with the mouse; the first part of the game I made was just Chomper whooshing around. It was so satisfying!
There are a couple of neat tricks with the movement. If you use a mouse, you can click and hold. Chomper will stay in place but follow your cursor like theyāre turning their head. You can use this to target cherries; release the cursor after holding Chomper in place and they will zoom toward it!
Spoilers
Level 1 Walkthrough āTutorial modeā
In Level 1, the Chomper moves around and eats cherries. There are no bad guys present in this level, making it an introductory stage for the player to understand the basic mechanics of the game. However, in order to stop the constant drop of random berries, Chomper must eat cherries in the correct color order, following the sequence of colors in the rainbow. If Chomper eats the berries in the correct order, they will enter ārainbow disco modeā.
This was the first puzzle; I like that players will be happily eating cherries until they hit their first red one and the color changes. Hopefully, they go āWell thatās interesting, how do I keep doing that?ā and experiment until they find the order. Red will keep them red; any other color than orange will reset the progression. I like that eating a yellow cherry does change Chomperās color, but is a little bit of misdirection as itās back to default.
Once in Rainbow Disco Mode, the drop pauses (I like to imagine Chomper enters a state where he can travel through space and time), and you can eat every last cherry and clear the level. But be careful not to lose Disco Mode; eating a berry out of sequence will reset Chomper. This also means you have to strategically leave the right berries to finish your meal in Disco.
Level 2 Walkthrough āHungry Eyesā
Level 2 has our first bad guys! These pesky āTombstonesā chase Chomper; they generate when Chomper turns Orange, Green, and Violet. They donāt cause harm yet but they get underfoot. Tombstones do however eat the next cherry you need in your Rainbow sequence if they get there first!
More importantly, theyāre coded with behavior: Tombstones will chase Chomper or the next cherry; whichever is closer. This allows players to strategize: you can lure Tombstones away from cherries and circle back.
Tombstoneās eyes will change color to reveal which color cherry they are currently hungry for. This is also a handy visual reminder for the player!
The goal ā as always ā is to enter Rainbow Disco Mode and clear remaining cherries. Disco Mode will also freeze Tombstones along with the drop rate.
Level 3 Walkthrough āHelp from aboveā
Level 3 is where things get real! Tombstones now have a red stroke around them, and their fill color is black, making them more menacing. We have a Game Over condition. Tombstones can attack Chomper, freezing Chomper (but they die in the process). Chomper has 3 lives; there are 3 Tombstones.
The puzzle in this level is how to unfreeze Chomper! They just wonāt budge!
Iām hoping this causes a few people to bang their heads on their keyboards.
When frozen, Chomper turns white and refuses to move; they will follow the cursor with their head, but thereās no way to reach the needed cherries!
I wanted this to be a moment that shakes up gameplay. Because behold: the player can pick up cherries and hand-feed Chomper! i.e. āHelp from aboveā.
I donāt think anyone will expect this, so itās a nice surprise (and tactical!).
It seemed a great way to change mechanics mid-game. Suddenly you can interact with Chomper as a helper character on high, or deus ex machina.
If anyone is stuck too long, you get an extra clue: Chomper will cry out:
āFeed me Mama!ā
Hopefully, that tugs on the heartstrings too!
Again, the win condition is Rainbow Disco Mode. It can be quite tactical to get frozen so that you can scoop up cherries by hand and feed Chomper, all the while being safe from Tombstones (they ignore frozen Chomper). Just beware: Chomper can only be frozen three times before they lose all lives.
Level 4 Walkthrough āSome lines cannot be crossedā
At Level 4, there is a dynamically produced maze. This maze is constructed from any remaining cherries a step behind in the rainbow sequence. The cherries are connected by ālaser beamsā. So thereās now a strategic reason to āmop upā all cherries of one color before advancing ā often at the cost of making progress if the maze will block off cherries needed at later stages.
If Chomper crosses a laser wall, they get zapped and lose rainbow progress!
āGame Overā occurs if Chomper is frozen and touching a laser. There are two situations where this can happen:
1) Chomper brushed a laser and was hit by a Tombstone at the same time
2) Chomper was already frozen and was shot through by a newly formed laser (because the berry you handed him triggered the laserāyou killed Chomper!).
Since the laser resets Chomperās Rainbow color progress and Chomper canāt unfreeze without eating a full diet of cherries, itās a āGame Overā.
If you can beat this level, you might get to see a little Easter Egg.
ā You can eat berries the same colour as Chomper is
ā in Level 1, you want to make sure that you leave enough berries behind when you enter Disco Rainbow Mode to complete the sequence again. If not (unless youāre very lucky) youāll be left with berries that reset disco mode
ā Tombstones only target the next color berry
ā Tombstones will chase you. Use this to your advantage!
ā Tombstones die when they freeze you. It can be tactical to take out 1ā2, but beware, you have only 3 lives per level
ā Itās easy to work out where walls will generate by keeping track of berries in your periphery vision
āSometimes it can be strategic to let cherries amass
ā Tombstones will follow hand-fed berries! I wonder if this can be used to lure them to their deaths (drop a comment if you figure this one out, wink)
By combining human creativity and the power of GPT-4, we can create our own entertaining games that challenge conventional gameplay and bring joy. Get ready to unleash your imagination and code with GPT-4!
A last word from your AI-assisted game designer
I hope you enjoy this game as much as I enjoyed bringing it together for you. As you can see, even though the coding was written by AI, a lot of creative thought went into it. It was amazing seeing my game mechanics come alive. Follow me to get my next article. Iāll dive into how to prompt GPT-4 to code games for you, how to troubleshoot, and how to squeeze a long code (750 lines) into your chat input without exceeding token limits.
If youāve enjoyed playing this game and find it interesting, please share my article with your friends!
What does this mean? That you can remix, transform or build upon my game code, as long as you attribute it to me and itās for non-commercial purposes (you must distribute your contributions under the same license as the original). Iāll talk more coding in my next article. Be sure to follow!
Donāt forget to share your experiences, insights, and creations with the AI community as we all learn and grow together in this exciting new frontier of AI-assisted game development. Happy coding, and have fun chomping!
Who is Jim the AI Whisperer?
As Jim the AI Whisperer, I provide training and consulting services to help companies prepare for and properly utilize AI in their operations. Donāt miss out on the huge benefits of AI for your business. Take control of the technology and make informed decisions. Contact me today to learn more.
Iām also available for journalism opportunities, podcasts, and interviews.
Ready to join Medium?
Gain unlimited access to the entire Medium catalog with my referral link, and youāll also be supporting my ongoing writing at no extra cost to you: