Skip to content

Instantly share code, notes, and snippets.

@veeneck
Last active August 29, 2015 14:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save veeneck/11144279 to your computer and use it in GitHub Desktop.
Save veeneck/11144279 to your computer and use it in GitHub Desktop.
Update zPosition
- (void)update:(NSTimeInterval)currentTime
{
[characterLayer enumerateChildNodesWithName:@"soldier" usingBlock: ^(SKNode *node, BOOL *stop) {
[(Soldier*)node updatePosition];
}];
}
// And then in the Soldier class
- (void)updatePosition {
self.zPosition = 10000 - self.position.y;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment