Select Page

Are you dreaming of game development? With AI tools like Amazon Q for Developers, it is easier than ever! The possibilities are limitless, and with AWS services, you can go from idea to production in just a few hours – no coding required. Here’s how I created a memory game in just 5 hours using Amazon Q!

The AWS Game Challenge Hackathon requires participants to build games using AWS, especially Amazon Q, a competitor to GitHub Copilot. It was my first time using Amazon Q and my first time in a hackathon. I was amazed at how quickly I could create something playable with its help, showcasing the power of AI and cloud technology.

Learn how I built my game, and get inspired to start your journey!

h

Table of Contents

$

AWS Services I used to build the Memory Card Game

$

How I come up with the idea for the game

$

How to play (game mechanics)

$

Building Memory Game with Amazon Q for Developers

$

Improving the game with images

$

Using AWS Bedrock for image generation

$

Deploying to Amplify

$

The final result

How much did I spend on AWS services

Get in touch!

AWS services used to create the game

Before going into game details, I will discuss the AWS services I end up using. Besides IAM, which I used before, everything else was my first time.
Also, if you manage to read the whole blog post, you will find how much money it costs me to build the app 😊and host it in the cloud.

  • Amazon Q for Developers – pretty much everything was done with its help; I used it for coding, making UI (CSS) changes, and asking for ideas…
  • AWS Amplify: I used that service for hosting my application on the internet
  • AWS Bedrock offers many AI models, and I used Tital Image Generation to create pictures for my app.
  • IAM for user configuration for Amplify deployment.

The Game idea

Creativity is not my strongest skill, so I took what I already knew: a memory card game that I play with my kids before going to sleep.

How to play (game mechanics)

Playing this memory game is simple and fun!

  1. A set of cards are placed face-down, and each card has a matching pair featuring the same image.
  2. During their turn, a player flips two cards.
  3. If the cards’ pictures are the same, the player earns a point on the scoreboard and gets another turn.
  4. If the cards don’t match, the turn passes to the next player.

Since all players see the cards flipped, memory is key to remembering card positions and winning the game!

How Amazon Q for Developers helped me to build the game

The game seemed easy to implement and fun to play, so I asked Q to create a game for me.

Asking Amazon Q for Developers to build a memory card game

The Q understood what I wanted well, but for some reason, it gave me a code in Python, which I guess will work, but Python is not my preferred language, so I gave a couple of clarifications and got a code for the Angular/HTML/CSS game.

Interestingly, in addition to a code for a game, it gives me instructions on how to create a new Angular project, which is a nice touch.

Clarifying my request for Amazon Q

I did as instructed, and a couple of minutes later, all the code it suggested was part of my MemQ game.

It’s time to run it and see if that even compiles…👻

I did not expect it would work; it was quite a lot of code, and I had not read it before running; I expected I would fix the mistakes once I tried ‘npm run start’, and it failed with some error, but the game worked!!! 🎉 It not only compiled without mistakes but also was playable; all functionality worked.

The first version Amazon Q give me is working but looks bad

The UI looked ugly, but I could play and complete the game for both players. Player 2 won! 😜

Interestingly, even the card’s flip animation worked, which I did not expect.

So now we need to make the game a bit prettier, and I challenged Q with a tricky question; I asked it to style the user’s components like old games in 1980-1990 and see what would happen.

I asked Amazon Q to help with CSS development

All I have to do is copy/paste the styles. I especially like that the Q understands my context; it sees the CSS styles I already use and gives me just the styles I need to replace, with the same component’s names.
The result looks great, and it’s precisely what I wanted!

Working styles without any changes directly from Amazon Q for Developers

Updating the game to use images

The next step is to use the images for the back of the memory card instead of the blue color.

Updating CSS with Amazon Q is easy, just ask what you want

Of course, I still have to copy and paste some code myself, so Amazon Q isn’t ready to replace developers yet.

We all can keep our jobs, at least for now! 😊

The result was excellent; all I had to do was create an image from our family trip to Washington using Adobe Photoshop.

Images for the back of the card with CSS provided by Q

Images generation with AWS Bedrock

Next, I need images for the other side of the memory cards; that is too much to do by myself, so let’s use AI to help. I have never used AWS Bedrock, but it took just a few minutes to figure out how to generate images there.

I used Titan Image Generator V2, which is not as great as other LLMs I used before, but it did a pretty good job anyway. I found that the best result I got was when giving fewer instructions, so after spending an hour playing with Bedrock, I got my nine images ready.

AWS Bedrock edit model access for Titan Image Generation V2
Generating game images using AWS Bedrock
After inserting images, the corners overlapped with the rounded corners of the card, which did not look good, so instead of solving that myself, I just copied styles and asked to fix it, which Q did.
Asking Amazon Q to fix minor CSS issue with image rounded corners

Now, I have a fully functional, nice-looking, and playable game with custom images. The only issue is it is all running on my local.

Let’s fix it next.

Fully developed game with Amazon Q is ready for deployment

Deploying the Memory Card game to AWS Amplify

I want to deploy my game in the cloud and asked Amazon Q about my options.

Asking Amazon Q about deployment options

To tell you the truth, I already know about my options after working as independent contractor with AWS on multiple projects and getting multiple AWS certificates.
Nevertheless, you can’t know it all, and the second option – AWS Amplify, was something I had never heard of and used before.
While option #1 is better for my case, it is more scalable and effective; let’s go with option #2 just to learn a new service.
I tried just to deploy it from GitHub, but it failed; based on the error message, I understand I need to add support for Amplify to the app first.

Q helps with adding support for Amplify

Amplify deployment is the part that took most of my time.

The biggest issue was I had no idea what I was doing, and my experience with Amplify was 0 (zero).

The second issue is that there are two versions, Amplify Gen1 and Amplify Gen 2, and Q struggled with that; it was pretty common when it gave me the command to run, and it did not work, so it acknowledged that version was incorrect and provided me with the correct Gen2 option.

Soving the version issue with Amplify

Anyway, one hour and five deployments later, I got the app successfully deployed to Amplify!

Finally the deployment to Amplify is successful
App deployed to Amplify with ugly url

The final result

All I have to do now is fix the ugly URL with something easier to remember. Thankfully, Amplify supports 3rd party domains, and the final result is available at https://game.yaplex.com/, and the repo is at GitHub https://github.com/yaplex/mem-q

Final result at yaplex.com domain

While the hackathon results will be available at the end of January 2025, the results of my time investment are remarkable. I learned a lot and improved as a developer.

  • Amazon Q is a good competitor to Github Copilot, especially with AWS-related products. For example, I asked GitHub Copilot for help with Amplify, and I found its answers were not as good as those from Amazon Q. However, the usability for Q is very bad; I can’t put Amazon Q in a separate window on a second monitor, and that drives me crazy because the left side of VS code is used for file navigation and Git. I have to switch between Q and other components constantly.
  • Bedrock has a lot of different models that I can spin within minutes. They are serverless, and I charged only when using them, so using large, expensive models is very cheap.
  • Amazon Amplify is a new service for me; the idea behind it is excellent: you can manage the front end, back end, authentication, database, and domains from the same place. I feel like, eventually, that would be a default place to deploy apps. However, the implementation for Amplify is rather bad; you need to change your app to add support for Amplify. Gen 1 and Gen2 versions are incompatible, and Q is confused about which one I use all the time, so deployment was a very painful process.

Total cost to build a game and deploy it to AWS – CAD 1.27

It takes less than a cup of latte to build a fully functional game (I have used a free version of Amazon Q. Otherwise, the subscription would take another $19/month.)
I was not charged for the Amplify; it is free for 12 months, so all the expenses are using AWS Bedrock for image generation.

Total cost of building a Memory Card game with Amazon Q for Developer

Get in touch!

Are you looking for an experienced independent contractor who can use AI (Amazon Q and other LLMs) to build cool stuff? Use the form below to contact me.

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.