xcode Player.center显示错误:在“SKSpritenode”类型的对象上找不到属性“center”

时间:2017-07-02 10:53:58

标签: objective-c xcode sprite-kit skspritenode

当我尝试在我的SKSpritenode上设置中心时,它会显示错误。我可以使用位置,但这不是完成我想要的正确方法。关于使用什么的任何想法?或者如何在节点上使用.center?

player.center = CGPointMake(player.center.x, player.center.y - BirdFly); // Shows error that i put in title
BirdFly = BirdFly - 5;

if (BirdFly < -15){
    BirdFly = -15;
}

if (BirdFly > 0){
    player.texture = [SKTexture textureWithImageNamed:@"flappy1"];



}
if (BirdFly < 0){
    player.texture = [SKTexture textureWithImageNamed:@"flappy5"];
}

}

0 个答案:

没有答案