sprite kit动画期间恢复原状

时间:2016-07-17 19:46:01

标签: ios swift sprite-kit skphysicsbody

我想做简单的弹球游戏,并希望在移动弹球左臂或右侧的动作中改变恢复原状

这是左行动的代码

override func touchesBegan(touches: Set<UITouch>, withEvent event: UIEvent?) {
   /* Called when a touch begins */
    for touch in touches {
        let location = touch.locationInNode(self)
        if location.x < 375 && location.y < 750 {
            flip_left?.runAction(SKAction.sequence([
                SKAction.rotateByAngle(CGFloat(M_PI/3.0), duration: 0.08  ),

                ]))

        }
        else  { flip_left?.physicsBody?.restitution = 0.5 }

0 个答案:

没有答案