hermitONL v0.3: Bitcoin AI Quest Game - Transformed a 3D Hytopia into 2D Phaser3 with AmazonQ

hermitONL v0.3: Bitcoin AI Quest Game - Transformed a 3D Hytopia into 2D Phaser3 with AmazonQ This is a submission for the Amazon Q Developer "Quack The Code" Challenge, addressing multiple prompts: That's Entertainment!, Exploring the Possibilities, and Crushing the Command Line. Embark on Bitcoin Quest, a retro-inspired, top-down multiplayer, educational game where learning about Bitcoin is an exciting adventure! Built with Phaser 3, Apache Cordova, and powered by Google's Gemini AI for dynamic quiz generation and NPC interactions, this game challenges your knowledge of Bitcoin concepts through interactive gameplay, engaging NPC interactions, and timed quizzes. Previously, we had built a 3D version with Hytopia SDK, now we leveraged AmazonQ to transform to 2D version, based on Phaser 3 game engine, while adding more features. What I Built I developed "Bitcoin Quest," a 2D top-down educational game using Phaser 3 and Apache Cordova, designed to make learning about Bitcoin an exciting and interactive adventure. This project directly answers Prompt 2: That's Entertainment! by gamifying the often-complex subject of Bitcoin into an engaging, retro-pixel world. Players explore, interact with "Knowledge NPCs" for bite-sized lessons (as detailed in the "Core Gameplay Loop" of AmazonQContext.md), and test their knowledge through unique, movement-based quizzes where they physically move their avatar to answer zones. Success earns them "Sats" (in-game virtual currency), reinforcing the core design philosophy of "learning through play" and making intricate topics like "Proof-of-Work" or "Private/Public Keys" (from the educational goals in AmazonQContext.md) accessible and enjoyable. The game further enhances engagement with AI-powered features, a key aspect of its entertainment and educational value: Dynamic Bitcoin Quizzes: Leveraging Google's Gemini AI via a backend API (/api/quiz detailed in quiz_app_design.md), the game offers fresh quiz content with a sophisticated caching strategy to ensure variety and quick load times. Interactive AI Demon Chat: Players can spend their earned Sats to interact with an AI Demon NPC (www/img/characters/demon.png). This feature, powered by Gemini AI through the /api/ask-demon endpoint (see quiz_app_design.md and README.md), allows players to ask questions about Bitcoin, the Lightning Network, and Lightning Service Providers (LSPs), creating a dynamic learning dialogue. This endeavor was also a significant technical undertaking, aligning with Prompt 3: Exploring the Possibilities. It involved migrating and completely re-imagining my earlier 3D prototype (built with the Hytopia SDK) for a 2D environment using Phaser 3. This transformation wasn't merely a code port; it was a fundamental re-architecture that pushed the boundaries of how I could leverage AI assistance. For instance, using Amazon Q Developer's /transform command, guided by a specific phaser-gamedev profile defined in the meticulously crafted AmazonQContext.md, was pivotal in converting Hytopia's scene initialization and player control logic into Phaser 3's class structures and event system. This showcases innovative ways to build with Amazon Q Developer, demonstrating its capability beyond simple code generation by understanding project-specific nuances laid out in the context file. The integration of real-time multiplayer using Socket.IO (detailed in quiz_app_design.md and README.md) further stretched the project's technical scope, with Amazon Q assisting in planning and implementing client-server communication logic. Finally, the project lays a strong foundation for Prompt 1: Crushing the Command Line. While the primary focus was game development, the iterative nature of hybrid app development (especially with Cordova for potential Android/iOS builds as per AmazonQContext.md) highlighted numerous opportunities for CLI automation. My approach included conceptualizing and meticulously documenting in AmazonQContext.md how the Amazon Q Developer CLI, with its advanced context features (like "File System Awareness" to read package.json, config.xml, or even quiz_app_design.md as per the enhanced context hooks) and agentic capabilities, could revolutionize this workflow. For example, planning scripts to automate version bumps in config.xml and package.json, managing Cordova plugin configurations, or even generating build reports by having Q analyze log files. Demo Play the game live: https://mmo.hermit.onl/ (Backup: https://game-client-7p87.onrender.com/) (No specific login is required to play the core game. The game features multiplayer presence, AI-generated Bitcoin quizzes, and an AI Demon for chat.) Video (Desktop version): https://www.youtube.com/watch?v=Y_dUU5iyook | Mobile Code Repository Explore the project on GitHub: https://github.com/hermitonl/mmo hermitonl / mmo

May 11, 2025 - 15:37
 0
hermitONL v0.3: Bitcoin AI Quest Game - Transformed a 3D Hytopia into 2D Phaser3 with AmazonQ

hermitONL v0.3: Bitcoin AI Quest Game - Transformed a 3D Hytopia into 2D Phaser3 with AmazonQ

This is a submission for the Amazon Q Developer "Quack The Code" Challenge, addressing multiple prompts: That's Entertainment!, Exploring the Possibilities, and Crushing the Command Line.

Embark on Bitcoin Quest, a retro-inspired, top-down multiplayer, educational game where learning about Bitcoin is an exciting adventure! Built with Phaser 3, Apache Cordova, and powered by Google's Gemini AI for dynamic quiz generation and NPC interactions, this game challenges your knowledge of Bitcoin concepts through interactive gameplay, engaging NPC interactions, and timed quizzes. Previously, we had built a 3D version with Hytopia SDK, now we leveraged AmazonQ to transform to 2D version, based on Phaser 3 game engine, while adding more features.

What I Built

I developed "Bitcoin Quest," a 2D top-down educational game using Phaser 3 and Apache Cordova, designed to make learning about Bitcoin an exciting and interactive adventure. This project directly answers Prompt 2: That's Entertainment! by gamifying the often-complex subject of Bitcoin into an engaging, retro-pixel world. Players explore, interact with "Knowledge NPCs" for bite-sized lessons (as detailed in the "Core Gameplay Loop" of AmazonQContext.md), and test their knowledge through unique, movement-based quizzes where they physically move their avatar to answer zones. Success earns them "Sats" (in-game virtual currency), reinforcing the core design philosophy of "learning through play" and making intricate topics like "Proof-of-Work" or "Private/Public Keys" (from the educational goals in AmazonQContext.md) accessible and enjoyable.

AmazonQ with VS Code

The game further enhances engagement with AI-powered features, a key aspect of its entertainment and educational value:

  • Dynamic Bitcoin Quizzes: Leveraging Google's Gemini AI via a backend API (/api/quiz detailed in quiz_app_design.md), the game offers fresh quiz content with a sophisticated caching strategy to ensure variety and quick load times.
  • Interactive AI Demon Chat: Players can spend their earned Sats to interact with an AI Demon NPC (www/img/characters/demon.png). This feature, powered by Gemini AI through the /api/ask-demon endpoint (see quiz_app_design.md and README.md), allows players to ask questions about Bitcoin, the Lightning Network, and Lightning Service Providers (LSPs), creating a dynamic learning dialogue.

hermitONL v0.3 Phaser3

This endeavor was also a significant technical undertaking, aligning with Prompt 3: Exploring the Possibilities. It involved migrating and completely re-imagining my earlier 3D prototype (built with the Hytopia SDK) for a 2D environment using Phaser 3. This transformation wasn't merely a code port; it was a fundamental re-architecture that pushed the boundaries of how I could leverage AI assistance. For instance, using Amazon Q Developer's /transform command, guided by a specific phaser-gamedev profile defined in the meticulously crafted AmazonQContext.md, was pivotal in converting Hytopia's scene initialization and player control logic into Phaser 3's class structures and event system. This showcases innovative ways to build with Amazon Q Developer, demonstrating its capability beyond simple code generation by understanding project-specific nuances laid out in the context file. The integration of real-time multiplayer using Socket.IO (detailed in quiz_app_design.md and README.md) further stretched the project's technical scope, with Amazon Q assisting in planning and implementing client-server communication logic.

Finally, the project lays a strong foundation for Prompt 1: Crushing the Command Line. While the primary focus was game development, the iterative nature of hybrid app development (especially with Cordova for potential Android/iOS builds as per AmazonQContext.md) highlighted numerous opportunities for CLI automation. My approach included conceptualizing and meticulously documenting in AmazonQContext.md how the Amazon Q Developer CLI, with its advanced context features (like "File System Awareness" to read package.json, config.xml, or even quiz_app_design.md as per the enhanced context hooks) and agentic capabilities, could revolutionize this workflow. For example, planning scripts to automate version bumps in config.xml and package.json, managing Cordova plugin configurations, or even generating build reports by having Q analyze log files.

Demo

Play the game live: https://mmo.hermit.onl/
(Backup: https://game-client-7p87.onrender.com/)

(No specific login is required to play the core game. The game features multiplayer presence, AI-generated Bitcoin quizzes, and an AI Demon for chat.)

Video (Desktop version): https://www.youtube.com/watch?v=Y_dUU5iyook | Mobile

Code Repository

Explore the project on GitHub: https://github.com/hermitonl/mmo

Bitcoin Quest: A Top-Down Quiz Adventure! (Phaser 3 + Cordova + Gemini AI)

Embark on Bitcoin Quest, a retro-inspired, top-down educational game where learning about Bitcoin is an exciting adventure! Built with Phaser 3, Apache Cordova, and powered by Google's Gemini AI for dynamic quiz generation and NPC interactions, this game challenges your knowledge of Bitcoin concepts through interactive gameplay, engaging NPC interactions, and timed quizzes. Dive into a pixel-art world and earn Satoshis as you master the fundamentals of Bitcoin.

This project was developed for the Amazon Q Developer "Quack The Code" Challenge, aiming to showcase innovation in entertainment, explore new development possibilities, and leverage AI for a smarter workflow.

Play Online Now!

Ready to test your Bitcoin knowledge? Play the latest version here:

hermitONL v0.3 Bitcoin Phaser 3 Game

Key Features

A crucial artifact within this repository is AmazonQContext.md. This document is not just a supplementary note; it's a testament to a strategic approach to AI collaboration. It details the comprehensive context provided to Amazon Q Developer, designed to elevate its assistance from generic to deeply project-aware. This file itself, now enhanced to reflect all current features including the AI Demon Chat, multiplayer, and detailed quiz caching (as per quiz_app_design.md), is a key part of my submission. It demonstrates a sophisticated Utilization of Amazon Q Developer by engineering its understanding of the project's goals, gameplay, technical stack, and even desired MCP configurations (like the get_demon_chat_response tool conceptualized in AmazonQContext.md).

(The previous Hytopia SDK version for comparison: https://github.com/hermitonl/btc-quiz)

How I Used Amazon Q Developer

My engagement with Amazon Q Developer was a strategic partnership, not just a series of ad-hoc queries. The AmazonQContext.md file served as the bedrock, supercharging all interactions—from direct questions and requests for explanations to the use of powerful agentic commands—and maximizing Q's utility across all project facets. This directly addresses the judging criteria by showcasing a sophisticated Utilization of Amazon Q Developer for this complex Use Case, significantly boosting the project's Educational Value and overall Writing Quality of this submission.

AmazonQ with VS Code

1. Engineering AI Understanding with AmazonQContext.md (Prompts 1, 2, 3)

The creation and continuous refinement of AmazonQContext.md is a deliberate strategy. It transforms Q into a specialized co-developer by providing deep project immersion:

  • Contextualized Queries for Precision: Beyond agentic commands, even simple questions become more powerful. For example, asking Q (within the phaser-gamedev profile): "In profile phaser-gamedev, how do I best manage Socket.IO event listeners in GameScene.js for player movement (playerMoved, newPlayer, playerDisconnected) and AI Demon chat responses, ensuring UI updates correctly as per the flows in quiz_app_design.md?" (adapted from AmazonQContext.md). Q can provide a highly relevant answer, perhaps suggesting specific event management patterns or Phaser group configurations, because it understands the game's mechanics, multiplayer architecture, and UI update requirements documented across the context files.
  • Strategic AI Integration Blueprint:
    • Context Profiles for Specialization: Profiles like phaser-gamedev, cordova-mobile, bitcoin-education, and project-management-mmo (detailed in AmazonQContext.md) ensure Q operates with specialized knowledge. This means Q's advice on Phaser code for the AI Demon chat UI, Cordova build issues, or the accuracy of Bitcoin concepts for the AI Demon's responses is always aligned with project specifics.
    • Conceptualizing Advanced Context Hooks & MCP: AmazonQContext.md outlines how CLI context hooks (e.g., Q reading quiz_app_design.md for API endpoint details) and a conceptual MCP server (BitcoinQuizGameHelper with tools like get_demon_chat_response) further enhance Q's project awareness, pushing "Exploring the Possibilities" (Prompt 3).

2. Leveraging Agentic Commands and Contextualized Interactions for Development & Transformation (Prompts 2 & 3)

The migration and new feature development (like the AI Demon Chat and multiplayer) benefited immensely from both specific agentic commands and context-aware conversational interactions:

  • Codebase Migration with /transform and Follow-up Queries:
    • The /transform command was ideal for bulk conversion: "Using profile phaser-gamedev... /transform the Hytopia player movement logic... into a Phaser 3 component compatible with Arcade Physics as outlined in AmazonQContext.md's technical stack section."
    • Follow-up (conversational): "Q, the transformed player movement feels a bit jerky. Based on Phaser's Arcade Physics best practices (and our phaser-gamedev profile), what are common causes and how can I implement smoother interpolation, considering the real-time updates for multiplayer described in quiz_app_design.md?"
  • New Feature Implementation (e.g., AI Demon Chat) with /dev and Iterative Refinement:
    • Initiating with /dev: "Using profile phaser-gamedev and project-management-mmo, /dev a plan to implement the AI Demon Chat UI in www/js/index.js, including input fields, response display, and Sat deduction feedback, as specified in quiz_app_design.md."
    • Iterative Development (conversational): "Okay, Q, for the AI Demon chat UI, how can I dynamically create Phaser Text objects for the conversation history, ensuring the text style matches the retro look defined in AmazonQContext.md's 'Art Style' section and handles potential text overflow gracefully?"
  • Code Quality and Best Practices with /review and Targeted Questions:
    • Formal review with /review: "Using profile phaser-gamedev, /review the Socket.IO event handling in www/js/index.js for potential race conditions or performance bottlenecks when many players are connected, referencing the multiplayer architecture in quiz_app_design.md."
    • Specific concerns (conversational): "Q, I'm concerned about the Gemini API call latency for the /api/ask-demon endpoint. Are there any Node.js patterns or Express middleware I should consider for optimizing this, given the details in api/index.js and quiz_app_design.md?"
  • Robustness and Reliability with /test and Clarifications:
    • Generating test suites with /test: "In profile phaser-gamedev, /test the Sat deduction logic for the AI Demon chat in api/index.js, ensuring it correctly handles insufficient funds based on the conceptual Sat management in quiz_app_design.md."
    • Understanding test output (conversational): "Q, a generated test for the AI Demon's response parsing failed. Can you explain what this specific assertion is checking and why it might be failing based on the expected Gemini response structure for chat?"

3. Intelligent CLI Automation: Blending Agentic Power with Scripting (Prompt 1)

The Q Developer CLI becomes exceptionally powerful when its agentic capabilities are combined with traditional scripting, all informed by the rich context in AmazonQContext.md:

  • Complex Automated Workflows:
    • A developer might still write a shell script for a multi-step build and deployment process. However, within that script, they could invoke Amazon Q CLI for specific intelligent steps. For example, a script might call: amazonq --profile cordova-mobile generate-release-notes --from-git-log --template "Release notes based on recent commits for Bitcoin Quest" (an intelligent command Q might suggest or support via context hooks understanding Git history).
    • Or, using /dev to plan a complex CLI task: "In CLI, using project-management-mmo profile, /dev a detailed plan for a script that versions (in config.xml and package.json), builds the Cordova Android app, and deploys it to a test server using environment variables for credentials. The script should also notify the team on Slack." Q provides the plan, and the developer translates this into a robust shell script, possibly embedding smaller, specific amazonq CLI calls where Q's intelligence is most needed (e.g., for dynamic configuration checks based on quiz_app_design.md or validating Cordova plugin compatibility).
  • Contextual /help and /clear: These remain vital. /help used within a profile (e.g., /help in cordova-mobile profile when working on build issues for Android 13) provides focused guidance. /clear ensures a clean slate when shifting contexts significantly.

By demonstrating a flexible interaction model—using powerful agentic commands for complex, defined tasks and leveraging context-supercharged conversational queries for iterative development, feature implementation (like the AI Demon and multiplayer), and clarification—this submission showcases a truly sophisticated and practical Utilization of Amazon Q Developer. This balanced approach makes the complex Use Case (an educational, AI-enhanced, multiplayer-ready game) more manageable, significantly enhances its Educational Value through dynamic AI interactions, and robustly "Explores the Possibilities" of AI-assisted software engineering.

In summary, Amazon Q Developer, supercharged by the strategic use of AmazonQContext.md, was not just a tool but an integral development partner. Its advanced context features enabled the creation of a rich entertainment experience (Prompt 2) by facilitating a complex technical transformation and new feature development (Prompt 3) with greater precision, and illuminated a clear path towards highly intelligent command-line automation (Prompt 1). This project demonstrates Amazon Q's power to adapt and provide nuanced, deeply contextualized support across diverse development challenges, making it an indispensable asset for modern developers aiming to build innovative and engaging applications.