我对SpriteKit和游戏开发有点新鲜 我的问题是如何使用SKAction更好:
SKAction * shelvesAction = [SKAction performSelector:@selector(makeShelves) onTarget:self];
SKAction * delayAction = [SKAction waitForDuration:1];
SKAction * runShelvesForever = [SKAction repeatActionForever:[SKAction sequence:@[delayAction,shelvesAction]]];
[self runAction:runShelvesForever withKey:@"shelvesAction"];
或者只是一个NSTimer
_shevesTimer = [NSTimer scheduledTimerWithTimeInterval:1 target:self selector:@selector(makeShelves) userInfo:nil repeats:YES];
哪一个更快,有什么不同?