WELCOME TO THE LAB:

I’m currently exploring with AI. The follow experiments were built with the help of AI

Below is my first experiment, making a maze game with ChatGPT (GPT-4).

——-

MAZE (desktop only)

Goal: Find the green goal in the maze within 88 seconds

How to Play (desktop only) - Hover your mouse over the maze to move through the maze

Tip: Use the position guide at the top to show you how close you are to the target. It gets darker the closer you get and lighter as you get farther away.

THE PROCESS:

I wanted to create a maze game with a player represented as a circle and a goal represented as a square. The player would have to navigate through the maze to reach the goal, and the game would keep track of the player's distance to the goal. I also wanted the game to have a timer and work on both desktop and mobile devices. I reached out to ChatGPT to help me develop this game.

First, setting up ChatGPT to work how you want it to is the key to a successfully focused experience. I provided a guide for ChatGPT to follow. ChatGPT provided me with the basic structure of the game, including the maze and player classes, as well as the core functions to make the game run. After testing the initial code, I encountered a few errors, which ChatGPT helped me resolve. Next, we added the distance to the goal counter at the bottom of the screen and updated it to gradually change color from blue to red depending on how close the player was to the goal.

After that, we added a 90-second timer to the game. If the timer reached zero before the player reached the goal, the maze would collapse, and a "game over" message would be displayed, followed by a 5-second countdown. Once the countdown was finished, the game would reset with a new maze and goal position.

We also made sure the game was compatible with mobile devices by adding touch input functionality, allowing players to drag their finger to move the player circle. After testing the game on a Squarespace website, we encountered some issues with the touch controls not working when the game was embedded as an iframe. ChatGPT provided a solution to fix this issue. BUT unfortunately, probably because of the nature of this embed, there is an issue with it working on Squarespace.

Lastly, we added a feature to zoom out and show the entire maze when the player won the game. The zoom-out functionality only triggered once when the player reached the goal. After making these adjustments, the game was complete and ready to be embedded on the website.