So I'm currently rotating a sprite based on a bool clockwise / counter clockwise function.
This is my coding for the moving of the ship based on this...
func movesprite(direction direction: rotationDirection) {
// Moves sprite left or right dependent on rotation //
let movespriteLeft = SKAction.moveByX(-100, y: 0, duration: 1)
let movespriteRight = SKAction.moveByX(100, y: 0, duration: 1)
if sprite == (direction == .clockwise) {
sprite.runAction(moveshipLeft)
}
else if sprite == (direction == .counterClockwise) {
sprite.runAction(moveshipRight)
}
}
Anyway this doesn't seem to work, at all. My ship does rotate clockwise or counterclockwise fine and compiler accepts this but it has no bearing on the movement on screen.
What's going wrong?