r/ClaudeCode • u/georgealtran • 2h ago
Built with Claude Built a pixel-art RPG mod for Claude Code: tool calls become monsters, to-do lists become bosses, and the HUD tracks cache, rate limit and context. Here's what I learned about mods
What I built: a free, open-source mod that adds a small pixel-art band above the message box. Lua, a tiny moon mage, fights a monster every time Claude uses a tool (reads, edits, shell commands, web, MCP, subagents each have their own monster). A to-do list summons a boss whose health is split into one block per task; the last task is a critical hit. A failed tool call makes the monster hit back, and when Claude fixes the error, an elite appears carrying the error as a trophy. The HUD is real session data: prompt-cache warmth, plan limit, context usage, XP. 9 biomes, 10 bosses, 8 languages, desktop app and VS Code.
How I used Claude Code: I did the game design and the art direction; Claude Code wrote the hooks module (TypeScript), the Python scripts that turn my AI-generated sprites into one clean pixel grid, 79 tests, and the translations. I worked in short sessions, each ending with a handoff file so the next session could pick up where we stopped.
What I learned:
- The band has a size budget. It's drawn as SVG, and in the desktop app the whole band tree has a ceiling around 260k characters: past it, the app silently keeps the previous frame. Bosses with big sprites "didn't show up" until we measured the tree in a test, split the scene into layers and stopped embedding a font in every tooltip.
- Hover needs native boxes. Inside an image-mode SVG nothing is hoverable, so the tooltips are app-native areas laid over the scene, positioned in text cells.
- Animate in SVG, redraw rarely. Walking, parallax and the countdowns are SMIL/CSS animations; the hooks only redraw when the state changes. One bug taught me why: a countdown started hidden and appeared at t=0, so every redraw during a fight made the number blink for a frame.
- Hot reload keeps state, not timers. A tool call cut short by a reload left a fight "running" forever and froze the scene; now stale fights are cleaned up.
- Pixel art only at integer scales. Every sprite, the scenery and the trailer use 1x/2x/3x/4x with nearest-neighbor, never in between.
- Test time with a fake clock. Fights, boss falls and stage transitions are tested by advancing a mock clock instead of waiting.
Install: /plugin install cronicas-de-lua --marketplace geoaltran/cronicas-de-lua-claude-code Repo (code MIT, art CC BY-NC): github.com/geoaltran/cronicas-de-lua-claude-code
Happy to go deeper on any of these. What other part of a Claude Code session would you turn into a game mechanic?
•
u/AutoModerator 2h ago
Hey! Thanks for posting to r/ClaudeCode
While participating in this thread, please follow our community rules. Keep discussions constructive. Attack the idea, not the person.
For help, project discussions, tips, and general chat, join the ClaudeCode Discord.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
3
u/TheBanq 2h ago
Wow this is the 1287128th version of this, congrats
3
u/HatWithoutBand 1h ago
So, am I the only one who see in this those typical YT videos, where creator has to put 2 other videos into corners (one of them Subway Surfers) to keep attention of ADHD kids?