AWS Logo
Menu
Chad & Barry: the candidates! A game with Amazon Q Developer

Chad & Barry: the candidates! A game with Amazon Q Developer

A simple catch-and-collect game with a twist. Amazon Q Developer is pushed to its limit to write a clean and efficient code for the AWS game building challenge

Published Jan 7, 2025

About the game

As part of the AWS Game Challenge, I decided to create something simple yet fun—a game I cheekily named Chad & Barry. 
Why that name? Honestly, I’m not quite sure, but I guess I was inspired by those iconic Hollywood duos like Bonnie & Clyde or Turner & Hooch. It just felt catchy. 
Chad and Barry are the stars of the game—two quirky characters who double as election candidates, with mouths wide open and ready to gobble up as many “edible votes” as they can.
The inspiration for the game came from the idea of combining two seemingly unrelated themes—election and classic catch-and-collect arcade games—into something lighthearted, fun, and interactive. 
Game playing is simple as just clicking mouse or pressing 'm' key in desktop and tapping screen in mobile to open the character’s mouth to catch falling objects, but with a twist—players would need to avoid Onions that temporarily disable their progress.
As a visual layer of excitement, I included an interactive U.S. states map that lights up state by state as players collect points, mimicking the strategy of winning states in an election.
chad and barry winning states
Chad and Barry game, winning states
Balancing fun and challenge, I designed the unselected character to autoplay, creating a robot rival that keeps the stakes high.
Like in the real U.S. election the first to reach 270 points wins, bringing a playful nod to the real electoral process while keeping the game light, fast-paced and fun.
Chad & Barry Game
CLICK HERE**** to play “CHAD & BARRY
For the game's codebase, visit its GitHub page: https://github.com/rlama/aws-hackathon

AWS services used in the game

  • AWS S3 is the superstar behind this game’s hosting. I’ve always been a big fan of S3 static hosting, it’s like having a reliable friend who’s always there when you need them.
  • AWS CloudFront is used to serve content globally with blazing-fast load times. Think of it as a turbocharged delivery guy who gets the files wherever they need to go, super-fast.
  • AWS API Gateway is the messenger of my game. The game uses the REST API created with it, which smoothly handles all game requests to fetch and update leaderboard scores—no servers, just seamless communication.
  • AWS Lambda is the brain behind the game, processing scores and rankings effortlessly while scaling automatically with game traffic.
  • AWS DynamoDB is the backbone of my game’s data, securely storing and retrieving leaderboard scores with lightning speed and zero hassle.

The Development Journey

I’m a developer at a media company, not a game developer, though I had dabbled in creating a couple of games while learning.
For this project, I wasn’t sure which library to use, but after some research, I landed on Phaser.js a JavaScript canvas-based game library. With no prior knowledge of it, I challenged myself to build this game using Phaser from the ground up, relying solely on Amazon Q developer to guide me through the development journey and all the Phaser related codes.
And let me tell you, I’ve never been so excited using Amazon Q as a developer assistant! I used it as an extension in Visual Studio Code, and honestly, it felt like I was just supervising while it did all the heavy lifting.
Fun fact: 95% of the Phaser code in this game was suggested and generated by Amazon Q—talk about a dream teammate
My first prompt to Amazon Q was “write me a basic game files and folder structure with Phaser and vite as build tool” and it instantly wrote me the flowchart and the codes.
Chad and Barry amazon Q first prompt
Chad and Barry amazon Q first prompt
From that point on, I bombarded Amazon Q with every game-building question I could think of—mostly about Phaser. To my amazement, it kept coming back with spot-on answers and code snippets, like the ultimate game dev sidekick.

Times Amazon Q Developer Totally Blew My Mind

Amazon Q’s ability to not just spit out code but actually read my files and suggest better solutions was pure magic.
I lost count of how many times I handed it my messy code and watched it play the role of a coding wizard, fixing things I didn’t even know were broken!
Chad and Barry checking file to update
Chad and Barry checking file to update

Handling of a complex logic

At times I hit multiple walls with complex game logic - things like scaling difficulty over time, smoothing out choppy animations, perfecting collision handling, or managing memory without everything breaking. I didn’t even have to explain myself to Amazon Q—it just got me.
I’d point it to my file, throw in a quick simple question most of the time grammatically incorrect), and voilà! It would not only understand what I needed but also suggest and execute the code updates like it was reading my mind. Pure wizardry !
Chad and Barry complex issue solution
Chad and Barry complex issue solution

Let Amazon Q create animation sprite sheet for me

For Chat and Barry’s animations, I went with sprite sheet animation—because why not?
Their figures were created using an online AI image generator service. I gave them a basic eating motion (aka mouth-open magic) using After Effects and exported the animation as png sequence.
Chad and Barry animations from images to spritesheet
Chad and Barry animations from images to spritesheet
Since I don’t own any fancy sprite sheet generation software (and wasn’t about to buy one just for this game), I turned to my trusty sidekick, Amazon Q Developer.
It whipped up some Python code for the sprite sheet generation using the png sequence, and guess what? It worked like a charm—spot on, no tweaks needed !
Chad and Barry Python to create sprite sheet
Chad and Barry Python to create sprite sheet

Refactor and Optimize: Game Development Made Easy

Last but not least, I absolutely loved using the "Refactor" and "Optimize" options that Amazon Q provides in the Visual Studio Code context menu—they made cleaning up and improving my code effortless. Thanks to these features, I could spend more time enhancing gameplay and less time debugging!
Chad and Barry Amazon Q Developer Refactor and Optimize
Amazon Q Developer Refactor and Optimize

Conclusion

Building this game was more than a project; it was pure fun, from the crazy concept to watching Chad and Barry’s mouths gobble “edible votes” like pros.
Of course, I couldn’t have pulled it off in just days without my MVP, Amazon Q Developer. From generating Phaser code to fixing animations, it was the behind-the-scenes genius that kept everything running smoothly. It felt like having a co-developer who never slept and always had the perfect solution.
This is just the beginning! I’m already brainstorming ways to make the game even more fun:
  • New Power-Ups: Maybe some items that give Chad & Barry special abilities or bonuses.
  • Levels and Progression: Introducing new levels with unique challenges and themes.
  • Multiplayer Mode: Letting players compete against each other in real-time.
With Amazon Q Developer’s help, the sky’s the limit for "Chad & Barry".
 

Comments