类型的价值' SKSpriteNode'没有会员' setscale'

时间:2015-10-13 05:53:48

标签: swift skspritenode

我正在关注这个YouTube系列,你会在出现错误时学习游戏编程,所以我修正了这个错误但导致了另一个错误。而且我很确定我和YouTuber完全一样。

所以,如果您知道解决方案,请帮助我。 (:

import SpriteKit

class GameScene: SKScene {


    var bird = SKSpriteNode()
    override func didMoveToView(view: SKView) {
        self.physicsWorld.gravity = CGVectorMake(0.0, -5.0);

        var BirdTexture = SKTexture(imageNamed: "Flappy_Bird")
        BirdTexture.filteringMode = SKTextureFilteringMode.Nearest

        bird = SKSpriteNode(texture: BirdTexture)
        bird.setscale(0.5)
        bird.position = CGPoint(x: self.frame.size.width * 0.35, y: self.frame.size.height * 0.6)
    }

    override func touchesBegan(touches: Set<UITouch>, withEvent event: UIEvent?) {
        /* Called when a touch begins */
        for touch: AnyObject in touches {
        }
    }

    override func update(currentTime: CFTimeInterval) {
         /* Called before each frame is rendered */
    }
}

1 个答案:

答案 0 :(得分:2)

实际上它只是一个错字:该方法称为setScale()