I wanted to experiment with giving an AI agent more freedom in creating an entire application. I decided to make a small HTML/JS game—I explained the high-level idea of the game and told it to get started.
Over a 2-day period, the AI agent and I chatted back and forth. I didn't write a single line of code, but I did act as the designer and code reviewer. It was a very interesting process. And I won't lie... I enjoyed it! 😄 Some of the excitement came from seeing it come together so rapidly. I even asked the AI Agent to create SVG files for some of the assets used in the game—its SVGs were pretty generic, but they work.
I was using GitHub Copilot, in Agent mode, with GPT-5 Mini. There were a couple of times that the AI got a bit confused, and I would just end the thread and start a new one.
It was definitely a learning experience. Here are some of the prompts:
We are going to create an HTML and Javascript game. Create and generate the necessary files. The game should be a top-down 2d game, in outer space. The user plays as a ship - design a ship, as pixel-art. When the user holds the up arrow, the ship will move forward. When the user holds the left arrow, the ship will rotate left. When the user holds the right arrow, the ship will rotate right. If the ship has forward momentum then continue coasting after the up arrow is released. The ship should remain in the center of the canvas - other objects will move closer or further, based on the movement of the player. In space, there are hostile space stations. Each station is stationary, but shoots at the player. The player can shoot plasma balls, when the user presses the space bar.
Lets add some collision logic - station, shot, plasma, or ship are all known as "SpaceObject". If a SpaceObject collides with any other space object, then remove the Collided objects.
I've undone those changes. Lets try again.
- Add a 'Level'. Globally accessible.
- Level is incremented when the station is destroyed.
- Level is decremented wheen the player is destroyed.
- Display the level in the top right.
Something that was really interesting was that as the process progressed, I found myself using more language that was "in game" specific: for example I started referring to the Ship as "The Ship" instead of "the player object". These are only 3 prompts from a 2-day experiment, but the ongoing process was very cool.
The game is all vanilla JavaScript and HTML. I was able to easily deploy it as an Azure Static Web App.
You can try it out here: Play the Game
Source Code: View on GitHub