Inspiration

The idea for the game came out of nowhere. I thought, “What if I combined elections and classic arcade games?” Totally random, right? But that’s what made it fun. I wanted to create something lighthearted, goofy, and just plain entertaining.

That’s how this game, I like to call it, "Chad & Barry" was born. These two quirky characters double as election candidates with hilariously wide mouths, ready to gobble up as many “edible votes” as they can.

How to play

The gameplay is simple and addicting.

  • To open character's mouth to collect items
    • in desktop Mouse Click or press 'm' key
    • in mobile Tap screen
  • To pause and resume game
    • in desktop press Spacebar
    • in mobile Tap and Hold

The goal? Catch falling objects to rack up points!

But there’s a twist—onions. These sneaky little things will temporarily stop your progress if you accidentally gobble one up.

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. 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.

How I built it

I am not the game developer. 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 decided to give it a go relying solely on Amazon Q Developer.

The game uses several services from AWS.

  • It’s hosted on AWS S3 and served lightning-fast with AWS CloudFront.
  • The game uses the REST API created with AWS API Gateway, which smoothly handles all game requests to fetch and update leaderboard scores.
  • AWS Lambda is used to process scores and rankings effortlessly while scaling automatically with game traffic.
  • Finally the game uses AWS DynamoDB to securely store and retrieve leaderboard scores.

A online AI image generation service is used to design and create Chad & Barry characters. I gave them goofy gobbling animations in After Effects. These animations were converted into sprite sheets using Python, thanks to some code magic from Amazon Q Developer.

Challenges I ran into

There were plenty of roadblocks along the way. Here are some:

Laggy Animations:

When too many objects were falling at once, the game started lagging. Luckily, Amazon Q came to the rescue, suggesting fixes that smoothed out the gameplay.

Dynamic Game Logic:

Making the game progressively harder by switching the falling objects wasn’t as straightforward as I’d hoped. It took several trials and errors (and some frustration) to get it right, and again I could have stuck on it for hours without Amazon Q.

Sprite Sheet Generation:

Without fancy tools, I struggled to create the sprite sheets for Chad & Barry’s animations. I almost gave up, but Amazon Q whipped up some Python code that solved the problem perfectly.

Accomplishments that I am proud of

Turning this crazy idea into a playable, fun game is something I’m really proud of. Watching Chad & Barry gobble up votes like pros (and dodge onions like champs) made the entire journey worth it.

And the fact that I learned and used Phaser.js, despite having zero experience with it before this project, feels like a major win.

What I learned

For me this project was a crash course in game development, problem-solving, and resilience. I learned: The basics of Phaser.js and how to build a game from scratch. How to troubleshoot performance issues and optimize animations. The power of having a tool like Amazon Q Developer—it’s like having an all-knowing co-developer by your side.

What's next for Chad & Barry

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. Customization Options: Players could customize their characters with silly outfits or accessories.

With Amazon Q Developer’s help, the sky’s the limit for "Chad & Barry".

Built With

Share this project:

Updates