AWS Logo
Menu
Building a Brain Training Game Using  Amazon Q Developer

Building a Brain Training Game Using Amazon Q Developer

I would like to share my experience building a brain training game using Amazon Q Developer to speed up the development process.

Published Dec 21, 2024

The Purpose

When creating a game, I always think about how users can play the game with a good purpose behind. I didn't want to create a violent game. My game should be beneficial and improve humans' lives. That is why I created my game called Pawzzle. It is a brain training game that provides a fun and engaging way to support cognitive health, particularly for individuals with Alzheimer's disease and other memory-related conditions. By incorporating exercises designed to challenge memory, attention, and problem-solving skills, the game aims to slow the progression of cognitive decline, improve mental acuity, and enhance the quality of life for those affected. In addition, Pawzzle can be used as a tool for caregivers and healthcare providers to monitor cognitive changes and promote mental stimulation in a positive, interactive environment. Ultimately, the game is designed to make brain training accessible, enjoyable, and beneficial for people facing memory challenges.

Game Concept

Users can challenge themselves by choosing different time frames to finish the game (from 10 seconds to 100 seconds). They will have to flip cards and remembers when each image is, then they will need to flip and match two similar images during the set time frames.

Development Process with Amazon Q Developer

I first sketched out different functions I needed for the games such as flip functions, reset function, audio functions, etc. For each functions I needed, I typed questions to ask Amazon Q about how I should built the javascript codes. Through Amazon Q suggestion, I figured out the logics and the functions I needed for starting games, restarting games, arranging cards, etc.
The game includes features like:
  • Customizable time limit
  • Sound effects and background music
  • Flip counter
  • Card shuffling
  • Victory/game over screens
Amazon Q also suggestions new functions for me to add to my codes such as:
  1. createFallingEffect(type):
    • Creates multiple falling elements of a specified type (e.g., 'star').
    • Randomizes their starting position, animation duration, and delay.
    • Appends these elements to a container and removes them after the animation ends.
  2. startAnimation():
    • Calls createFallingEffect to start animations for falling leaves and stars.
  3. createFloatingElement(type, imagePath):
    • Creates a floating element with a specified type and image.
    • Sets its initial position and applies a transition for floating down the screen.
    • Appends the element to the document body and removes it after the animation ends.
  4. setInterval():
    • Periodically calls createFloatingElement to generate floating leaves and stars every second.
Through out the development process, I also used Amazon Q developer to debug codes, optimize the codes, and get suggestion to fix the errors. Thanks to Amazon Q developer, the whole development process was sped up a lot when comparing the time I used to use to develop by myself.

Deployment with Amazon S3 and AWS Amplify Hosting

I used Amazon S3 for storing the codes and assets. Amazon S3 is connected with AWS Amplify Hosting so the deployment was super fast. I was surprised at how fast the deployment process was using AWS Amplify Hosting.

To conclude

I was grateful to learn about Amazon Q Developer and the functions this generative AI-powered assistant offers. The tool helped me tremendously in term of coding, getting suggestions, debugging and fixing errors. I learnt a lot using the explanation functions of Amazon Q. I want to continue using this tool for my future development.

 

Comments