2 つのエラーが発生します。<= と >= を使用すると、エラーが発生します。
二項演算子 '>= & <=' は、タイプ CGFloat および Int のオペランドには適用できません
override func touchesMoved(touches: Set<NSObject>, withEvent event: UIEvent) {
var speedOfTouch = 30
for touch: AnyObject in touches {
let location = touch.locationInNode(self)
if location.x < CGRectGetMidX(self.frame) {
square.position.x <= speedOfTouch
square.physicsBody?.applyImpulse(CGVector(dx: -40, dy: 0))
}
else {
square.position.x >= speedOfTouch
square.physicsBody?.applyImpulse(CGVector(dx: 40, dy: 0))
}
}
}
私は助けが必要です!