Page 1 of 1

animation: cards moving mutliple times

Posted: 30 June 2021, 17:42
by __wiz__
Hi!

During a player's action, a card may move multiple times (first to a played area, causing other cards to move, then to a discard).
The backend goes through this step by step, sending move notifications to the frontend for each card moved.
The js frontend then calls appropriate addToStockWithId or removeFromStockById for each card move notification.

What I noticed is that when card is moved multiple times, for example from hand to table to discard, only the effective move is animated, that is, I see the card moving from hand to discard. I'd like to see all the steps, to make it clearer for non-active players what happens.

Am I doing something wrong?
How did you solve this in your implementations?

Thanks!
Thomas

Re: animation: cards moving mutliple times

Posted: 30 June 2021, 18:02
by vurtan
Hi Thomas,

I'm relatively new on the developer side of BGA, but I came across the Synchronous notifications in the documentation.
This looks like it could solve your issue. Here is the link and just search for "Synchronous notifications"
https://boardgamearena.com/doc/Game_int ... amename.js

Maybe an alternative way would be the simplePause also mentioned on the same page.

Helmut

Re: animation: cards moving mutliple times

Posted: 30 June 2021, 18:15
by Victoria_La
Yes you have to make notification syncronious and make it waif for duration of animation until next one is processed