Magnetron AI Project

For this project I decided to try my hand with Visual Studio Code Github Copilot extension. Using the Github Copilot in Agent mode I entered a prompt for a passive game, built for web browsers, where particles are constantly falling into a central point accumulating score. Also the mouse will act as a attractor or repellant for the particles, depending on the mouse mode currently active. Note: The exact prompt has been lost to me but this was the gist of it.

Once it completed it built a very simple 2d “game” using canvas and some simple physics to apply force to the particles. The particles are stored in an array that is updated every frame by a gameplay loop.

For my first time creating any sort of html/canvas game I was pretty impressed. So I kept prompting Github Copilot to add more features like a border around the screen area so that the particles could bounce back. As well as a way to invert the attraction mode of the main central point. I was impressed by how it would roughly sift through the existing code and know to create a function, and add it into the gameplay loop. Or create an event-listener to toggle some global which would then be read on animate or physics update. The whole website is main composed of one large file so I’m not sure how Github Copilot would do if this were a more complex website.

I then used Github Copilot in ask mode to assist in creating an azure static page container and upload my website to it. It gave me some pretty simple commands to follow and in less than 10 minutes my website was running on a storage container in azure.

The music was made also using ai with Suno AI. I used something along the lines of lofi chill rain sounds, because I wanted a relaxing kind of soundtrack.

My original inspiration for this game was just to have some sort of “mindless” game on a second monitor that I could occasionally distract myself for when I needed a little break. I love physics related games and so a game where you can bounce balls around with your mouse was a nice and simple idea to get what I wanted.

Link to game: https://jazy5gamessto.z13.web.core.windows.net/

Link to source code: https://github.com/Jazy5552/Magnetron

Leave a Reply