나는 문자가있다.왜 SpriteKit 게임에서 동작 논리가 다른가요?
for touch in touches {
let location = touch.locationInNode(self)
print(location.x)
print("Pos \(self.magician.position.x)")
if location.x >= self.magician.position.x {
print("R")
self.movingRight = true
} else {
print("L")
self.movingLeft = true
}
}
따라서, 논리입니다 : 다음 location.x 인 경우>, 다음이 의미 내 문자 position.x보다, 내가 오른쪽에 탭과 나의 캐릭터가 이동해야 화면에 탭에 나는이 실행 이 방향으로, 오른쪽으로. 그러나 나는 왜 내가 오른쪽을 탭하면 왼쪽으로 움직이는 지 모르겠다.
SpriteKit에서 논리가 너무 다른 이유를 설명 할 수 있습니까?