When you guess a location on the Tubebusters map you are awarded points based on how close you are to the real location of the specified ghost station. Once you have guessed the location of all ten different ghost stations you will be told your overall score.
Creating Tubebusters
Tubebusters is actually the first interactive map project that I have created almost entirely using generative AI. To create the game I gave Magicoder Playground an initial prompt to
"Create an interactive map in Javascript using the Leaflet.js mapping library which asks users to place a map marker on the Eiffel Tower and then measures how far their guess is from the real location of the Eiffel Tower."
Magicoder then provided me with all the code needed to create an interactive Leaflet map which actually worked. From this very basic geo-guessing question (requiring a user to simply point on a map to the Eiffel Tower) I was quickly able to create a more substantial game. Using the initial code provided by Magicoder Playground I then asked Bard to create an array of ten different locations and to use this array to ask the user to randomly locate each of these locations by placing a marker on the map.
To complete the map I then asked Bard to calculate the total of the distances measured for each of the ten guesses. It is this total which is used to provide the total score at the end of each game.
It actually feels kind of magical to be able to create a basic working geo-guessing game with just a few AI prompts. Of course at the moment generative AI's are far from perfect. On nearly every other project I've worked on recently I have always eventually hit a brick wall when asking an AI for coding help. However thanks to the help of AI I was able to create Tubebusters in a just a few hours work.
If you are interested in creating your own geo-guessing game then you can clone Tubebusters (or just grab the project code) on its Glitch page.
No comments:
Post a Comment