I am trying to make a button that when pressed starts a game. Where it says let pointOfTouch = touch.location(self)
, I am getting the error message "Cannot call value of non-function type 'CGFloat.'" There is another post regarding this, but I have not found much use from it. Here is my code:
override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) {
for touch: AnyObject in touches {
let pointOfTouch = touch.location(self)
let nodeITapped = atPoint(pointOfTouch)
if nodeITapped.name == "startGame" {
startGame()
}
}
}