hello, i am trying to get a player on the screen to move from left to right but my code does not work. it only moves right when i tap the screen. This is my code
override func touchesBegan(touches: Set<UITouch>, withEvent event: UIEvent?) {
if gameStarted == false{
gameStarted = true
completedLevel = false
let movePlayerright = SKAction.moveByX(700, y:0, duration:3)
let movePlayerleft = SKAction.moveByX(-700, y:0, duration:3)
if gameStarted == true{
Player.runAction(movePlayerright)
Player.runAction(movePlayerleft)
}
}
Thanks.
😁😀😝