0
私は単純なゲームを持っており、移行しようとしています。私はスイフト2の使用を開始する前にすべてが働いた。私は仕事をするためにtouchesBeganを得ることができない。私は、オーバーライドと他のものの束を削除しようとしました。ボールはタッチが止まると止まると考えられます。エラーが発生した場所をコメントしました。ありがとうございます。SpriteKit Swift2- UITouch上書きエラー:touchesBegan
override func touchesBegan(touches: Set<UITouch>, withEvent event: UIEvent?) {
let touch = touches.first! as UITouch
let touchedLocation = touch.locationInNode(self)
// change the speedXFirst of the ball if it starts
if start {
// start move
let moveRight = touchedLocation.x > CGRectGetMidX(self.frame)
let speedX = moveRight ? ballSpeedX : -ballSpeedX
ball.speedXFirst = speedX
}
// start game if it stops
else {
startGame()
}
}
override func touchesBegan(touches: Set<UITouch>, withEvent event: UIEvent?) {
//ERROR: Invalide redeclaration of touchesBegan(::with event)..
if start {
// stop move
ball.speedXFirst = 0
}
}
!!!:ちょうど これを削除 –