Skip to content

Claude/game animations clean as0 lc#10

Open
timkindberg wants to merge 8 commits into
masterfrom
claude/game-animations-clean-as0LC
Open

Claude/game animations clean as0 lc#10
timkindberg wants to merge 8 commits into
masterfrom
claude/game-animations-clean-as0LC

Conversation

@timkindberg

Copy link
Copy Markdown
Owner

No description provided.

Implemented Tier 1 priority animations that help players track card movements and game actions:

Card Movement Animations:
- Card flip animation when drawing from deck
- Card slide animations from deck/field to hand
- Card hover lift for better interactivity

Combat Animations:
- Castle damage shake and red flash when taking damage
- Raid impact explosion effect on castles
- Fortification battle clash animation
- Castle destruction animation sequence

Phase Transitions:
- Dynamic phase banners for Draw, Action, and special phases
- Visual indicators for round changes
- Raid success and assassin attack notifications

Special Effects:
- Royal entrance flourish when bringing royals to power
- Alliance activation beam effect
- Point counter animations for persuasion/threat
- Number pop effects for stat changes

These animations provide clear visual feedback for all major game actions,
making it easier to track what's happening during gameplay.
- Cards now animate from drawn slot to their destinations
- Persuade: animates to alliance persuasion track
- Threaten: animates to opponent's persuasion track
- Fortify: animates to fortification slot with rotation
- Battle: animates to opponent's fortification then fades
- Bring to Power: animates to royal stack with celebration
- Assassinate: animates to target royal
- Field: animates to selected field pile

All animations use a flying card clone that transitions smoothly from source to destination, making it much easier to track where cards are going during gameplay.
Replace clone-based card movement animations with View Transitions API for smoother, more performant animations.

Changes:
- Added CSS for view transitions (::view-transition-old/new)
- Replaced animateCardMovement with animateWithViewTransition
- All card movements now use view-transition-name to mark source/destination
- Browser automatically morphs cards between positions
- Cleaner code: no DOM cloning, no manual position calculations
- Better performance: GPU-accelerated transitions

Card animations now use document.startViewTransition() to:
- Persuade: card → persuasion track
- Threaten: card → opponent persuasion track
- Fortify: card → fortification slot
- Battle: card → opponent fortification
- Bring to Power: card → royal stack
- Assassinate: card → target royal
- Field: card → field pile

The browser handles all the animation tweening automatically, creating smooth morphs between old and new card positions.
@vercel

vercel Bot commented Jan 12, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
royal-family Ready Ready Preview, Comment Jan 12, 2026 2:45pm

- Fix field draw animation to use View Transitions properly (was animating from far left)
- Add UI reference to AIPlayer for animation support
- Add AI wrapper methods: aiDrawFromDeck, aiDrawFromField, aiExecuteAction
- Modify AI to use UI wrappers when available for animated moves
- All AI actions now animate same as player actions

Now when the AI plays, cards smoothly animate showing where they're going, making it much easier to follow AI strategy.
- Remove buggy View Transition from field draws (was animating from far left)
- Use simple CSS animations for player/AI field draws instead
- Add delay() helper method for AI timing
- Fix battle animation to show card flying to fortification
- Fix assassin animation to show card flying to target royal
- Add CSS for card-moving-dest view transition name
- Prevents auto-draw bug caused by async click handlers

Cards now properly animate from their source locations and battle/assassin actions show clear visual feedback of where attacks are going.
Replace View Transitions API with reliable card cloning for all animations:
- Clone card at source position before action executes
- Execute action and render to update game state
- Animate clone to destination with CSS transitions
- Remove clone after animation completes

This fixes:
- Field piles becoming empty during animations
- Cards teleporting from far left during draw
- Persuasion not animating to correct zone
- Assassin and bring-to-power animations not working

Updated methods:
- animateCardToRoyalStack() - bring royal to power
- animateAssassinToTarget() - assassin attack animation

All animations now use consistent, bug-free cloning pattern.
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.

2 participants