Skip to content

feat: bigger, layered, animated pets with state-driven auras#12

Open
dropdevrahul wants to merge 3 commits into
mainfrom
feat/pet-visuals
Open

feat: bigger, layered, animated pets with state-driven auras#12
dropdevrahul wants to merge 3 commits into
mainfrom
feat/pet-visuals

Conversation

@dropdevrahul

Copy link
Copy Markdown
Owner

Summary

A real visual upgrade for all four pets. Before/after comparison below.

  • Bigger canvas: HL 8 → 12, standard width SW = 22. New padAt(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.
  • Per-state auras: a new core/pets/effects.ts provides auraFor(state) — sparkles for happy, drifting Zzz for 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.
  • Ground shadow under every pet via a shared groundShadow() layer — small thing, makes the pet feel anchored.
  • Layered idle for every pet (cat already had it, the others didn't): body / eyes / accent on independent timers, so motion is organic instead of all ticking together.
    • Cat: ear-twitch + flicking tail accent peeking from the right.
    • Hamster: cheek pouches puff in and out (°).
    • Ghost: wavy ectoplasm tail shifts left/right.
    • Robot: antenna LED pulses + chest module heartbeat.
  • Richer silhouettes using box-drawing chars (╱ ╲ ┌ ┐ └ ┘ │ ─ ●) instead of bare ASCII.
  • Snapshot tests lock in canvas geometry: every layer frame is exactly HL × ≥SW, every step has a duration, the frame-0 composite is HL rows.

Before / after (cat happy)

before                              after
  /\_____/\                            ✦           ✧
 /  ^   ^  \                                ·         ·
(  == ω ==  )                           /\_____/\
 \  '-'  /                             (  ^   ^  )
 (__)  (__)                            |  ●   ●  |
                                       |    ω    |
                                       |  \___/  |
                                        \       /
                                         |_____|
                                        (__) (__)

                                       ▁▁▁▁▁▁▁▁▁▁▁▁

Run bun scripts/preview.ts to 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 errors
  • bun scripts/preview.ts — every pet × every state renders at the new geometry
  • staticSprite() via core/render.ts produces correctly-shaped frames for the statusline / inline ASCII card
  • Reviewer: run campy watch and switch through each pet to eyeball the layered motion

Out of scope (good follow-ups)

  • Per-pet multi-color rendering (touches core/render.ts color path)
  • Rounded Unicode speech bubbles (touches core/render.ts bubble path)
  • New pet types

Rahul Tyagi 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant