ios - Running actions in sequence SpriteKit -
in ios app i'm trying animate distribution of cards of players. however, when try run action sequence, none of cards move. doing wrong?
override func didmovetoview(view: skview) { /* setup scene here */ var actions = [skaction]() let cards = makedeck() c in cards { let card = card(key: c) card.position = cgpointmake(300, 300) addchild(card) actions.append(skaction.moveto(givecardtoplayer(cards.indexof(c)!), duration: 2.0)) } self.runaction(skaction.sequence(actions)) }
change
self.runaction(skaction.sequence(actions))
to
cards.runaction(skaction.sequence(actions))
currently, running sequence of actions on scene rather cards.
without seeing of other code i'd assume correct, if doesn't suggest posting code givecardtoplayer
Comments
Post a Comment