INTRODUCTION
It all started when I was playing video games with my brother. This typically happens every other afternoon and we always played without even thinking about how we could make our own. Even if we thought about making a game it would always end up in us not knowing how to and having difficulty learning programs. However, one afternoon my dad showed me amazon game challenge and my response was I don't know how to code. Luckily I didn't need to because there was an ai tool that does all the coding and adjustments for you, so your imagination is the limit.
Learning/Setup
Even though I didn't need to learn how to code I still needed how to write code , run the program and run the game. The first step was opening up and downloading everything I needed which was super easy thanks to Ricardo Sueiras who has a guide on how to download everything ( https://dev.to/aws/the-essential-guide-to-installing-amazon-q-developer-cli-on-linux-headless-and-desktop-3bo7?trk=c09e10a1-6feb-4902-897f-846979733114&sc_channel=blog ). In addition, downloading the AI assistant (Q developer CLI) and pairing it with pygames which is completely free made making my game super easy.
Now for me , it was about learning how to start. The first step was typing in this line.
Then was typing in q chat to start getting code and making my game.
Now I had to choose my game. I wanted to make a memory matching game. The game had 12 cards and you had to match pairs. If you failed to match a pair they would flip back over but if you matched a pair they would stay. It would also show how many moves it took. Once you matched all the pairs you would get a end screen. As a beginner, I wanted to created simple game that I can play in short span of time and also helps me improve my memory therefore I selected memory game. I selected the memory game so that I can practice my memory.
I asked Q CLI "make me a pygames memory game with 12 tiles with objective of matching a pair , total 6 pairs. If match fails, tiles flip back over
but if match success then tiles stay.. the game ends once all 6 pairs matched."
Below screenshot shows, AI start working
Below is the Game screenshot after running the code that Q AI gave
The ai assistant did all the hard work of making my game. It coded and gave basic instructions on how the game works and also what the game includes, allowing me to enjoy the fruits of it's labor.
Tweaking
However I realized that the game was too bright for my liking and you only matched numbers which was also boring. I decided I wanted to make the game look better and also match fruits instead. I also wanted a timer added to see how fast I could match them.
Below is prompt to make graphics better
The Graphics were much better now.
Below is the prompt for fruits matching
Now I was matching fruits instead of numbers making the game more unique
Though the game now have fruits, the graphics are not as expected though! :)
Below is the prompt to add a timer
Now I had a timer to measure how long it takes to complete.
Effective prompting
Some effective prompting techniques I have found is to ask the ai to make the code copy and paste able to just directly copy and paste into pygames. Also I found that you can ask the AI to generate ideas for the game if you do not have any.
How the AI handled classic programming challenges
The ai did very well handling challenges like bugs or any issues. As soon as you told ai the problem it would fix the code and provide a description of what was wrong.
Development automation that saved me time
Some development automation that saved me time was that I typed in to forever make sure to always give code in copy and past able format to save time every time I logged in. I also made sure to prioritize correctness over a quick answer for better results to save time from going back and asking the ai to fix code.
Code example of interesting ai generated solution
The code below is an interesting solution because it added the text to the matching game when it did not really need to but was still beneficial to my game.
Conclusion
By this point after downloading, getting the code, and running the game my screen time was running out and I soon had to leave and wrap things up. However, something was different about the way I spent today's screen time. I felt productive and proud of the game I made with my dad(fruit match). I cherished this moment and was also thankful to my dad for showing me this. I hope that more people try using this to make their own game.
Thank you.
Top comments (0)