swift 2:雪碧倾斜效果

时间:2016-03-02 17:35:09

标签: swift sprite-kit

在点击屏幕时寻找一种向右倾斜精灵的方法(如飞鸟)就像旋转的开始一样,返回到原来的位置。我将使用它作为比sprite通常更快的效果。

我将添加到目前为止的代码:

var player = SKSpriteNode()

override func didMoveToView(view: SKView) {

    let playerTexture = SKTexture(imageNamed: "player")
    player = SKSpriteNode(texture: playerTexture)
    player.position = CGPoint(x: 200, y: 80)
    player.physicsBody = SKPhysicsBody(texture: playerTexture, size: playerTexture.size())
    player.physicsBody!.affectedByGravity = true
    self.addChild(player)
 }

   override func touchesBegan(touches: Set<UITouch>, withEvent event: UIEvent?) {


 }

0 个答案:

没有答案