Created
June 18, 2014 20:33
-
-
Save xealgo/e16ecb3d9ca80429291e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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