this is my first question here and apologize for bad English.
I was recently making a game application using Xcode 6.4 which worked perfectly in IOS devices. However, when I upload Xcode 7 Beta 4 to develop my app for IOS 9 there was a problem.
I was using this code in Xcode 6, which was restricting my hero to flip between -1.0 and 1.0 in X-axes, my hero could not flipping to -2.0:
func flip() {
isUpsideDown = !isUpsideDown
var scale: CGFloat!
if isUpsideDown {
scale = -1.0
} else {
scale = 1.0
}
let translate = SKAction.moveByX(0, y: scale*(size.height + kMLGroundHeight), duration: 0.1)
let flip = SKAction.scaleYTo(scale, duration: 0.1)
runAction(translate)
runAction(flip)
}But now in Xcode 7 this cod seems to not work. Firstly it seems alright but then hero starts to flip to -2.0, -3.0 and this goes on until the hero goes out of frame.
Also this is my game scene cod which worked perfectly on Xcode 6:
override func touchesBegan(touches: Set<UITouch>, withEvent event: UIEvent?) {
if isGameOver {
restart()
} else if !isStarted {
start()
} else {
hero.flip()
}
}I am new to this things and would be appreciated if you answer my question.