avatarJim the AI Whisperer

Free AI web copilot to create summaries, insights and extended knowledge, download it at here

5959

Abstract

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.

Tactics and Strategies

— The sequence cycles: Red, Orange, Yellow, Green, Blue, Indigo, Violet, Red, Orange, Yellow, Green, Blue, Green…

— 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!

I’ve also released Rainbow Cherry Chomp with an Attribution-NonCommercial-ShareAlike Creative Commons License.

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:

You might enjoy these related articles from Jim the AI Whisperer:

Artificial Intelligence
Coding
Game Development
Creativity
Art
Recommended from ReadMedium