【发布时间】:2015-10-12 22:10:15
【问题描述】:
我遇到了两个错误。当我使用 = 时,它给了我错误:
二元运算符 '>= &
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))
}
}
}
我需要帮助!
【问题讨论】:
标签: swift sprite-kit int cgfloat binary-operators