feat: bigger, layered, animated pets with state-driven auras#12
Open
dropdevrahul wants to merge 3 commits into
Open
feat: bigger, layered, animated pets with state-driven auras#12dropdevrahul wants to merge 3 commits into
dropdevrahul wants to merge 3 commits into
Conversation
added 3 commits
June 13, 2026 23:34
- HL 8 → 12 and a new SW constant for the standard sprite width (22). Adds padAt(rows, topRow) so a layer can paint into a specific row band (aura at the top, eyes mid-body, ground shadow at the bottom) without pushing the body around. - New core/pets/effects.ts with auraFor(state) — per-state particle layers (sparkles for happy, drifting Zzz for sleeping, hearts for excited, droplets for sad, crumbs for eating, drift specks for playing, rare twinkle for idle) — and a groundShadow() layer that every pet shares for a sense of presence. - Cat redesigned at the new canvas: layered body / eyes / tail accent for idle (each on its own timer), per-state bodies with richer expressions, and aura + shadow overlays on every state.
Bring the other three pets up to the new canvas. Each gets: - A bigger, more recognizable silhouette using box-drawing characters: hamster as a chubby pouched blob with proper ears, ghost as a rounded dome with a wavy ectoplasm tail, robot with antenna + LED chest module + struts. - Layered idle: body (slow loop), eyes (independent blink chain), and one pet-specific accent layer on its own timer (hamster cheek puff, ghost tail wisp, robot antenna LED + chest pulse). Before this only cat had layered idle. - Per-state expressions (happy/sad/sleeping/eating/playing/excited) redrawn in the new style. - Aura particle layer + ground shadow on every state, matching the cat pattern from the previous commit.
- tests/sprites.test.ts: for every pet × every state, assert at least one layer exists, every layer frame is HL rows tall and ≥ SW cols wide, the frame-0 composite is HL rows tall, and every step has either a fixed duration or a durationRange. Catches accidental off-by-one regressions before they ship. - scripts/preview.ts: print the first-frame composite of every pet × state to stdout so the redesigned sprites can be eyeballed without spinning up the animation engine or a terminal multiplexer.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A real visual upgrade for all four pets. Before/after comparison below.
HL8 → 12, standard widthSW= 22. NewpadAt(rows, topRow)helper lets each layer paint into a specific row band so the sprite composes cleanly: aura at the top, eyes/body in the middle, ground shadow at the bottom.core/pets/effects.tsprovidesauraFor(state)— sparkles for happy, driftingZzzfor sleeping, hearts for excited, droplets for sad, crumbs for eating, drift specks for playing, a rare twinkle for idle. Every pet × every state gets the matching aura layered above the body.groundShadow()layer — small thing, makes the pet feel anchored.°→◦).╱ ╲ ┌ ┐ └ ┘ │ ─ ●) instead of bare ASCII.HL × ≥SW, every step has a duration, the frame-0 composite isHLrows.Before / after (cat happy)
Run
bun scripts/preview.tsto see all 28 (pet × state) combinations.Test plan
bun test→ 123 pass (38 existing + 85 new sprite snapshot tests, 0 fail)bun run typecheck→ 0 errorsbun scripts/preview.ts— every pet × every state renders at the new geometrystaticSprite()viacore/render.tsproduces correctly-shaped frames for the statusline / inline ASCII cardcampy watchand switch through each pet to eyeball the layered motionOut of scope (good follow-ups)
core/render.tscolor path)core/render.tsbubble path)