is it possible to have the touchesBegan method in multiple locations or objects in a project?
for example if I have a main class with two buttons:
class GameScene: SKScene, SKPhysicsContactDelegate {
let moveButton = MoveButton()
let fireButton = FireButton()
//add buttons to scene etc...
}
class MoveButton: SKSpriteNode {
override func touchesBegan(touches: NSSet, withEvent event: UIEvent) {
NSLog("moved!")
}
}
class FireButton: SKSpriteNode {
override func touchesBegan(touches: NSSet, withEvent event: UIEvent) {
NSLog("fired!")
}
}
currently I have something similar but the touchesBegan aren't being hit, is this incorrect to do?