Inspiration

Growing up as a passionate fan of classic car games like Need for Speed: Most Wanted, Burnout, and many others, I drew inspiration from their thrilling gameplay and nostalgic appeal. These iconic games played a significant role in shaping my interest in car racing games and served as a foundation for my project. As an electric vehicle (EV) owner—embracing both the challenges of charging logistics and the excitement of cutting-edge innovation—I was inspired to create a game that not only showcases the unique and advanced features of EVs but also delivers an engaging and entertaining experience. This project combines my love for classic racing games with a modern twist, showcasing the potential of EVs in an engaging and entertaining way.

What it does

This game is your chance to dive into an exciting EV-themed racing adventure! The goal is simple: score as many points as possible while racing against the clock and following some fun, challenging rules. Here’s what you need to know:

Earn Points (and Keep Them): Your score keeps going up as long as you avoid crashes, stay on the road, and follow the rules—especially when the cops show up. Break the rules, and you’ll lose points, so stay sharp!

Collect Batteries: Scattered across the road are batteries that keep your EV powered. Miss too many, and your battery meter will drain, ending your game early. Grab them to keep your ride going strong!

Dodge Obstacles: Blue cars are out to make your life harder. Avoid them at all costs! If you crash into one, the screen flashes red, and you’ll lose 5 points.

Stay on the Road: No shortcuts here—stay on the asphalt! If you veer onto the grass, the screen turns yellow, and you’ll lose 2 points for leaving the track.

Watch Out for Cops: Every so often, cops will appear in your rearview mirror. When they do, keep your speed under 90 km/h and show some movement to let them know you're alert. If your speed goes over 90 km/h, the game window will flash like a siren, warning you to slow down. For every second you exceed the speed limit, you’ll lose 3 points, so keep it cool and stay in control!

The game is all about mastering quick reflexes, collecting points, and managing your EV’s battery while staying out of trouble. 𝗧𝗿𝘆 𝗶𝘁 𝗼𝘂𝘁 (𝗰𝘂𝗿𝗿𝗲𝗻𝘁𝗹𝘆 𝗼𝗽𝘁𝗶𝗺𝗶𝘇𝗲𝗱 𝗳𝗼𝗿 𝗹𝗮𝗽𝘁𝗼𝗽 𝘂𝘀𝗲 𝗼𝗻𝗹𝘆!)

Controls: ↑/W: Accelerate ↓/S: Deaccelerate ←/A: Turn Left →/D: Turn Right

How we built it

Tech Stack: HTML, CSS and JavaScript

AWS Resources: Amazon Q Developer (For implementing and developing the game) AWS S3 + bucket policy (To store game assets, images, sounds(for future enhancement)) AWS Amplify (helped quickly develop, test, and deploy full-stack applications) AWS Bedrock (to generate sprite files for the game) AWS CDK (IaC- automating the provision of AWS infrastructure)

Day-to-Day Implementation Plan (Took approx. 15 days on an off to build this, also accounts for bug fixing): Day 01 - Day 02 - Car Implementation After thoroughly reviewing the entire codebase, I began implementing the necessary updates, with Amazon Q Developer proving to be a game-changer! Sprite Files: Leveraging AWS Amazon Bedrock, I generated sprite files consisting of simple PNG images that formed the game's visual components. I replaced the JavaScript DOM-based car drawing by identifying and removing the redundant functions in the code. As highlighted earlier, Amazon Q was instrumental in developing user car movement functionality and integrating the sprite files into the game. For example, I used a prompt like:

Day 03 - Day 06 - Obstacle Implementation I then focused on developing the obstacle component of the game, which involved spawning cars that the player must dodge. This task required careful planning and significant effort to manage obstacles effectively while refining prompts for Amazon Q Developer.

Day 06 - Day 08 - Score Board

The scoreboard was designed to track user scores in alignment with the game's EV-inspired theme. To make gameplay more engaging, I added battery degradation as a factor influencing the score, along with a time limit feature to increase the challenge.

How Amazon Q Helped: Using prompts like:

@workspace Create a scoreboard on the right to track the score and include a 2-minute countdown timer that operates separately. @workspace Add functionality to the scoreboard to display battery degradation over time. When the battery reaches 0%, disable the W, A, S, D, or arrow keys to stop the user car. Amazon Q assisted in implementing these features seamlessly, enhancing the strategic and immersive elements of the game.

Day 08 - Day 09 - Battery Collection

Battery Collection: To enhance gameplay, I used a sprite file generated by AWS BedRock for the battery. Players can collect these batteries during the game to recharge their battery level on the scoreboard, helping them continue for the full two-minute duration.

How Amazon Q Helped: With a prompt like: @workspace Use the battery_powerup.png sprite file. Spawn it similarly to the obstacles, and when collected, it should increase the battery percentage displayed on the scoreboard.

Amazon Q efficiently assisted in implementing the battery collection feature, seamlessly integrating it with the game's mechanics.

Day 09 - Day 10 - Collision and Out of Bound

I implemented systems for: Car Obstacle Collision: Deducting 5 points when the user’s car collides with an obstacle. Battery Collision: Increasing battery levels when the user collects a battery object. Out-of-Bounds Detection: Penalizing 3 points when the user car moves off-road. How Amazon Q Helped: Using prompts like: @workspace Detect collisions between user and obstacle cars, reducing the score by 5 points for each collision. @workspace Implement battery collision to spawn batteries within the road area and reward users with battery points on collection. @workspace Penalize 3 points when the user car overlaps the road border (grass area). Amazon Q streamlined these features, making the game mechanics more dynamic and engaging.

Day 11- Day 13- Cop Detection Inspired by GTA and Need for Speed: Most Wanted, I created a unique feature where a cop car appears in the rearview mirror, moving left and right as a randomized obstacle. If the user exceeds the speed limit, the screen flashes red and blue, and 3 points are deducted from their score.

How Amazon Q Helped: Using prompts like:

@workspace Animate cop01.png within the rearview mirror, moving left to right and vice versa. @workspace Randomize the cop's appearance instead of having it always visible. @workspace Add red and blue flashing effects to mimic a siren when the cop appears. @workspace Trigger the flashing effect only if the user's speed exceeds 90km/h (34 frame rate). Amazon Q efficiently handled these steps, making the cop detection a standout and engaging feature of the game.

Day 14 - Day 15 - Game Over The game concludes in two ways:

If the user fails to collect batteries and the battery runs out, the game ends with a dark background displaying the score and the message "Game Over: Battery ran out." If the 2-minute timer runs out, the game ends with a dark background showing the updated score and the message "Game Complete." How Amazon Q Helped: Using a prompt like: @workspace Implement two game end conditions: a dark background with messages and scores for when the battery reaches 0 or when the timer hits 00:00.

Amazon Q simplified the creation of these features, ensuring smooth and clear end-game transitions.

Day 15- Onwards- Testing Resolving bugs and defects was among the most challenging and time-intensive aspects of the development process. Building a game required rigorous end-to-end testing to ensure functionality aligned with expectations, often turning into a lengthy and demanding task. At times, this process felt demotivating and jeopardized the timely submission of my hackathon project.

How Amazon Q Developer Helped

Amazon Q Developer proved invaluable in overcoming these challenges. Many issues arose from unclear prompts, which led to unintended interpretations and subsequent bugs. To address this, I adjusted my approach by reverse-engineering certain steps and prompting Amazon Q to ask clarifying questions.

Amazon Q excelled in this role, posing insightful queries such as:

"What was observed?" "Provide code segments affecting the application." "Describe the current and expected behaviors of the application." By answering these questions, I effectively communicated the issues, enabling Amazon Q to assist in resolving functionality problems and ensuring the success of my project.

Time Saved Using Amazon Q Developer: Amazon Q Developer significantly sped up my game development process, and without it, it would have taken considerably more time. Here's an estimation of the additional effort required if I hadn't used Amazon Q:

Breakdown of the Process with Amazon Q:* Car Movement: 2 Days Obstacle Component: 3 Days Scoreboard: 2 Days Battery Collection: 1 Day Collision and Out of Bound Detection: 1 Day Cop Detection/Randomization: 2 Days Game Over: 1 Day Bugs and Defects: 4 Days Web App Development: Optimized support from Q (you handled it) Deployment: Less assistance from Q (but still helpful) Total Time Taken with Amazon Q: 15 Days

Estimation of Time Without Amazon Q Developer: Without Amazon Q Developer, I would have likely spent more time on each step, especially in debugging, optimizing, and building functionalities. Here's an adjusted estimate assuming the tasks might take 1.5x to 2x longer due to the absence of AI-assisted help

Productivity Increase: With Amazon Q: 15 Days Without Amazon Q: ~32 Days

Using Amazon Q Developer improved my productivity by approximately 53%. This means I completed the game in just over half the time it would have taken without its assistance, allowing me to focus on other aspects, like refining the game or adding additional AWS services.

Challenges we ran into

Dealing with bugs and defects was one of the most challenging aspects of development, as continuous testing was required to ensure the game met expectations. This process often became lengthy and demotivating, threatening timely submission. The issues arose from vague prompts, which Amazon Q Developer misinterpreted, causing functionality problems. By reverse-engineering steps and prompting Amazon Q to ask clarifying questions, I was able to effectively address these issues. Amazon Q's insightful questions helped pinpoint the problems and allowed me to fix the code, ensuring the project stayed on track.

Accomplishments that we're proud of

Some of the accomplishments that I am proud of: Leveraged Amazon Q to develop a game that seemed impossible initially, speeding up development and enhancing code logic. Reverse prompting with Amazon Q helped refine the project through smart questioning, leading to efficient solutions. Utilized Infrastructure as Code (IaC), writing CDK scripts for AWS Amplify and S3, enabling quicker configuration and reducing deployment errors. Gained hands-on experience with AWS Amplify, learning how to build internal tools for quicker deployment and early testing in future projects. Strategized the next stepsto enhance the game, including adding new features and ensuring easy maintenance. Focused on long-term sustainability, planning for future enhancements and ensuring the project remains manageable.

What we learned

I have learned quite a few aspects from building this project, both personally and professionally. Here are some of the things I learned:

Learned how to better leverage Amazon Q Developer to speed up game development and enhance coding processes. Discovered the hard work behind game development, gaining deeper insight into the complexity and effort required. Revised mathematical concepts that were long forgotten, enhancing problem-solving and development skills. Gained hands-on experience with AWS Amplify, learning how to build internal tools for quicker deployment and early testing in future projects. Learned about other AWS technologies like Step Functions, which could be used to automate workflows and improve future solutions.

What's next for Tez- The Fast Paced Racer Game

The future of Tez - The Fast Paced Racer Game is focused on continuous improvement and leveraging new technologies and best practices to ensure its long-term sustainability and scalability. Moving forward, I plan to maintain the project as a learning opportunity, exploring advanced techniques and tools that will help elevate its development.

One of the immediate goals is to enhance the project's structure and code quality. While the current codebase doesn’t fully adhere to the best software engineering practices, I aim to gradually implement improvements, such as restructuring folders and enhancing code readability, with the help of Amazon Q. Additionally, I intend to adopt DevOps best practices, including Infrastructure as Code (IaC), CI/CD pipelines, observability, and automation, to streamline deployment, eliminate manual processes, and ensure that the game remains maintainable and stable over time.

A significant enhancement I plan to incorporate involves integrating AWS Step Functions to automate and manage app updates more effectively. For instance, I envision a solution where changes in an S3 bucket trigger updates to the AWS Amplify app, allowing the game’s build and deployment processes to run seamlessly. This will involve Lambda functions to operate Step Functions and access the necessary S3 buckets.

On the architectural front, I plan to redesign the game’s backend to transform it into a Three-Tier Web Game. This will enable users to sign up, sign in, track high scores, save their progress, and compete globally through a leaderboard. To implement these features, I will use AWS services such as RDS, DynamoDB, and AWS Lambda, with a focus on building a scalable and secure system. Additionally, I aim to implement AWS SNS to set up a notification system, allowing players to report bugs or issues, which will help improve the game over time.

Security is also a top priority for the game’s continued success. I plan to utilize AWS security tools to safeguard the app, ensuring it is accessible via a NAT gateway through a public subnet, while keeping the database secure in a private subnet.

Lastly, I’m excited to explore Kubernetes and EKS to evaluate how the game can be deployed and managed in an EKS cluster. This exploration will focus on how well Kubernetes can manage traffic, maintenance, and application load as the game scales and attracts more users.

The possibilities for the future direction of Tez are endless, with numerous avenues for growth and improvement. Whether it’s diving deeper into machine learning, implementing more immersive user experiences, or optimizing performance for even larger user bases, the options are abundant. However, choosing the right path and focusing on the most impactful improvements will be key to ensuring the game’s continued success.

In summary, the next steps for Tez involve continuous enhancements to the game's architecture, integration of AWS services to improve scalability and security, and a deep dive into new technologies that will support its long-term growth and development. The road ahead is full of potential, and finding the best direction will be a crucial part of Tez’s future.

Share this project:

Updates