Add animations #2

Closed
opened 2026-10-27 16:24:20 +00:00 by Syndria98 · 2 comments
Owner

Add card animations when playing the game. Add animations for adding mana, when creatures apply damage, when damage is applied to a player, etc.

Add card animations when playing the game. Add animations for adding mana, when creatures apply damage, when damage is applied to a player, etc.
Syndria98 added the ai-ready label 2026-10-27 16:24:20 +00:00
Agent added the working label 2026-10-27 16:24:22 +00:00
Collaborator

Implemented game animations driven by state diffs, so they play consistently for every client without changing the backend protocol.

What was added

  • Cards entering the battlefield animate in with a lift/scale effect.
  • Creatures attacking get a lunge/pulse animation.
  • Creature damage shakes the card and shows a floating damage number.
  • Player life loss/gain flashes the player panel and life total with floating damage/heal text.
  • Mana additions show animated mana bursts with the gained amount.
  • Reduced-motion support disables motion for users with prefers-reduced-motion.

Files

  • frontend/app/pages/games/[id].vue — animation triggers, template bindings, styles
  • frontend/app/utils/gameAnimations.ts — snapshot diffing logic
  • frontend/test/gameAnimations.test.ts — coverage for entering cards, attacks, damage, life changes, and mana gains

Verification

  • npx tsx --test test/*.test.ts — 15 tests passed
  • Vue SFC script/template/styles compiled successfully with @vue/compiler-sfc.
  • The repository’s npm test script requires Node 24; this environment has Node 20, so I ran the same test files through tsx.
Implemented game animations driven by state diffs, so they play consistently for every client without changing the backend protocol. ### What was added - **Cards entering the battlefield** animate in with a lift/scale effect. - **Creatures attacking** get a lunge/pulse animation. - **Creature damage** shakes the card and shows a floating damage number. - **Player life loss/gain** flashes the player panel and life total with floating damage/heal text. - **Mana additions** show animated mana bursts with the gained amount. - **Reduced-motion support** disables motion for users with `prefers-reduced-motion`. ### Files - `frontend/app/pages/games/[id].vue` — animation triggers, template bindings, styles - `frontend/app/utils/gameAnimations.ts` — snapshot diffing logic - `frontend/test/gameAnimations.test.ts` — coverage for entering cards, attacks, damage, life changes, and mana gains ### Verification - `npx tsx --test test/*.test.ts` — **15 tests passed** - Vue SFC script/template/styles compiled successfully with `@vue/compiler-sfc`. - The repository’s `npm test` script requires Node 24; this environment has Node 20, so I ran the same test files through `tsx`.
Collaborator

Implementation is ready for review: #3

Implementation is ready for review: https://git.aranroig.com/Syndria98/commander/pulls/3
Agent added help wanted and removed working labels 2026-10-27 16:28:35 +00:00
Agent referenced this issue from a commit 2026-10-27 16:28:35 +00:00
Sign in to join this conversation.
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Syndria98/commander#2