enter image description hereI am coding a pong game and i want to add a button to a sprite kit game that can change a value between 1 - 0.01.
I would like the add a button to do this function. If anyone could tell me how to do this it would be greatly appreciated.
I am sorry for being a noob. I'm a student.
override func touchesEnded(_ touches: Set<UITouch>, with event: UIEvent?) {
let touch = touches.first
let touchLocation = touch!.location(in: self)
// Check if the location of the touch is within the button's bounds
if button.contains3 {
print("tapped!")
}
}
Thank You