A browser-based retro 2D game where players interact with AI-powered historical figures. Core gameplay is built in Phaser and seamlessly embedded into a React application for UI and progression.
Key Contributions
NPC State Machine System · Gameplay AI · System Design
Architected a modular finite state machine (FSM) to control NPC behavior scalably and maintainably.
Enforced consistency across states via a strict IState contract (onEnter, onUpdate, onExit).
Centralized state transitions in a reusable StateMachine controller for isolated, single-responsibility states.
Utilized explicit state and event enums to ensure transitions were predictable and designer-friendly.
Implemented event-driven transitions (e.g. interaction, timeouts, collisions) rather than hard-coded condition chains.
Integrated movement, animation, and timing logic directly at the state level while keeping the core engine agnostic.
Engineered an NPC factory that spawns characters entirely via JSON configuration.
Externalized NPC configurations (identity, metadata, sprites, quotes) to allow code-free character additions.
Implemented random placement logic with custom collision resolution against other NPCs, player, and world.
Built fallback mechanisms to gracefully handle missing data or missing sprite assets.
[
{
"name": "Pythagoras",
"dates": "570–495 BCE",
"about": "Pythagoras was an ancient Greek philosopher and mathematician best known for the Pythagorean theorem.",
"image": "assets/Pythagoras/front_breathe1.png",
"keyIdeas": ["Everything is number"],
"quote": "Number rules the universe."
}
]
Player - NPC Interaction System · UX · Interaction Design
Developed rich interaction states including hover highlights, focus targeting, and click activations.
Designed contextual UI overlays such as dynamic name banners and contextual metadata panels.
Enabled seamless conversation initialization directly from exploring the world map.
Allowed players to eavesdrop and join ongoing asynchronous NPC-to-NPC conversations.
AI-Powered NPC Chat Backend · Systems Design · Scalability
Built a stateless backend chat service using FastAPI to handle conversation routing.
Integrated Google Gemini as the core LLM to power historically accurate conversations.
Engineered multi-character prompt pipelines to support group dialogues while preserving individual NPC personalities.
Designed the API to be horizontally scalable, allowing it to support multiple active game sessions.
Modular Animation System · Reusability · SOLID Design
Built a unified animation abstraction layer shared universally by characters and NPCs.
Standardized playback and transitions through an extensible base animation interface.
Supported both flat sprites and layered animation strategies to handle complex visual effects.
Decoupled animation logic from gameplay and state logic.
End-to-End Project Integration · Solo Development · Full Stack
Developed the entire game client and backend solo, taking full ownership across the complete stack.
Bridged Phaser gameplay cleanly with React UI, passing state seamlessly using React context and event listeners.
Rapidly prototyped content using free assets before substituting customized sprite sheets for core characters.