Skip to content

Instantly share code, notes, and snippets.

@xealgo
Created June 18, 2014 20:33
Show Gist options
  • Save xealgo/e16ecb3d9ca80429291e to your computer and use it in GitHub Desktop.
Save xealgo/e16ecb3d9ca80429291e to your computer and use it in GitHub Desktop.
var stagePos = smClient.felt.script.position;
var pos = {
top : stagePos('top',-200),
left: 0
}
var index = 0;
var cards = _.clone(smClient.game.cards);
for(var card, f = 0; f < action.finalHand.length; f++) {
card = _.find(cards, function(v) {
if(v.options.value == action.finalHand[f]) {
return true;
}
++index;
});
if(card) {
// remove it from the list so that the next iteration will
// have one less object to iterate over.
delete cards[card.id];
}
pos.left = stagePos('left', -200 + (82 * f));
smClient.game.cards[card.id].moveTo(pos, {movement:'arc'});
}
smClient.cs.step(1000 * smClient.options.speed);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment