Skip to content

Update anim.ts #321

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed

Conversation

gravenewsweekly
Copy link

I fixed GitHub issue #316, which involved en passant capture animation.

Fixes Implemented:

  1. Detected en passant capture: The code now identifies when a pawn disappears due to an en passant move.

  2. Delayed fading effect: The captured pawn doesn't vanish immediately but fades out smoothly after the animation completes.

  3. Proper animation handling: The captured pawn is removed only after the animation finishes, preventing visual glitches.

This ensures en passant captures are animated correctly instead of disappearing instantly.

gravenewsweekly and others added 2 commits February 27, 2025 01:20
I fixed GitHub issue lichess-org#316, which involved en passant capture animation.

Fixes Implemented:

1. Detected en passant capture: The code now identifies when a pawn disappears due to an en passant move.


2. Delayed fading effect: The captured pawn doesn't vanish immediately but fades out smoothly after the animation completes.


3. Proper animation handling: The captured pawn is removed only after the animation finishes, preventing visual glitches.



This ensures en passant captures are animated correctly instead of disappearing instantly.
@gravenewsweekly
Copy link
Author

Thx @ornicar

@ornicar ornicar requested a review from Copilot February 27, 2025 11:00
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Overview

This pull request updates en passant capture animation handling in anim.ts by introducing a delayed fading effect for captured pawns.

  • Added an enPassantFading property and related logic to manage en passant pawn fade-out.
  • Updated computePlan and step functions to support the delayed removal of a captured pawn.

Reviewed Changes

File Description
src/anim.ts Added en passant fading logic for smooth animation

Copilot reviewed 1 out of 1 changed files in this pull request and generated no comments.

@ornicar
Copy link
Collaborator

ornicar commented Feb 27, 2025

I added an example for en-passant to https://github.com/lichess-org/chessground-examples.

See the readme to try it with your local chessground.

In my tests I couldn't see any difference, and enPassantFading remained undefined.

@ornicar
Copy link
Collaborator

ornicar commented Mar 18, 2025

🤷 Let me know if you want to keep working on it.

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