我正在制作一个Objective-C游戏,玩家分配如下:
self.player = [[Player alloc] initWithImageNamed:@"playerWalkAnimation1"];
self.player.position = CGPointMake(100, 50);
self.player.zPosition = 15;
self.player.physicsBody = [SKPhysicsBody bodyWithRectangleOfSize:self.player.frame.size];
self.player.physicsBody.affectedByGravity = NO;
self.player.physicsBody.allowsRotation = NO;
self.player.physicsBody.categoryBitMask = ballCategory;
self.player.physicsBody.collisionBitMask = obs1Category;
self.player.physicsBody.contactTestBitMask = obs1Category;
self.player.physicsBody.usesPreciseCollisionDetection = YES;
[self.map addChild:self.player];
如何向此玩家图像添加步行动画?它是一个PNG,当我玩游戏时,图像只是向前移动一个图像而不是所有构成整个动画的图像。是否有runAction或SKAction将读取从1到完成和repeatForever的所有图像?
任何建议表示赞赏。 谢谢。