I'm working on a card game project, and one of the issues I'm facing right now is animations. I just can't figure out how to animate the card properly so that both users see it animate at the same time, and for the right position. And by that I mean, when your opponent draws a card, you see an animation of a card from the opponent's deck into his hand while for the opponent, the animation is from his deck into his hand.
I've tried using jQuery animations, and I could only do one part of the animation - couldn't represent the opponent's animations.
I've also tried some of Atmosphere's packages, but they didn't work the way I wanted.
The cards collection from which I'm trying to animate has a place field for the card (hand, deck, drop..etc). And each element in the HTML depends on the place field to get the cards from, so for example:
Template.playerHand.cards = () ->
Cards.find {userId: Meteor.userId(), place: "hand"}
and the HTML is:
<ul class="holder">
{{#each cards}}
<li><img src="{{card.image}}" /></li>
{{/each}}
</ul>
would it be possible to animate the card depending on the previous place? like if a card was in the deck, then it moved to hand, a specific animation will run. Same for from hand to deck. Thanks.