Basic Street Fighter clone using HTML5 Canvas with stick figure fighters.
uv run uvicorn server:app --reload --port 3000server.py— Litestar/uvicorn entry point (SSE, Deepgram proxy, static files)index.html— Game page, canvas 800x400src/input.js— Abstract input system (InputManager + adapters, Command Pattern)src/fighter.js— Fighter class: physics, state machine, stick figure renderingsrc/game.js— Game loop, stage, hit detection, HUDsrc/sfx.js— Sound effects (pre-decoded MP3 AudioBuffers)assets/— Sound effect MP3 files
Abstract input via adapters. Game logic only sees Actions enum, never raw keys.
InputManagerholds adapters, merges actionsKeyboardAdaptermaps key codes → actions- Designed for extension: gamepad, voice, etc.
Default to using uv for Python package management.
- Use
uv run <command>to run Python scripts - Use
uv add <package>to add dependencies - Use
uv syncto install dependencies from pyproject.toml - uv automatically manages virtual environments
- Python with Litestar (ASGI framework) + uvicorn
- SSE via
ServerSentEventresponse class - Static files via
create_static_files_router() - WebSocket proxy to Deepgram via
websocketslibrary - Environment variables loaded from
.envvia python-dotenv
Pure HTML/JS served as static files. No bundler needed — browser-native ES modules.
index.htmlloaded at/src/served at/src/assets/served at/assets/