我想做简单的弹球游戏,并希望在移动弹球左臂或右侧的动作中改变恢复原状
这是左行动的代码
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 }