0

I've created a game using Sprite Kit. The game runs just like the iOS game Pop The Lock. I've already got a lot of code within my touches began. Because of this, whenever I try and add a Button to the scene and tell it to do something, all it does is start the game as I've told it to do that my touches began and it doesn't run what I tell it to. How do I add a image as a button that once I tap, it runs only that and not the other things in the touches began? I understand this is very broad but I'd like to see how people add buttons to the scene without affecting anything else. Cheers!

danieldevtech
  • 49
  • 1
  • 3
  • You might find this past helpful: http://stackoverflow.com/questions/19082202/setting-up-buttons-in-skscene/19199748#19199748 – tonethar May 02 '16 at 14:12
  • don't add your button within the touch begin add it in did move to view and create a separate function for it. then you can use that to do whatever you want. adding it to touches begin while you added other functions to the touch confuses the compiler. i can provide some sample code of declaring the button and adding its function the view if you need it. let me know. – Adrian P May 06 '16 at 12:40

0 Answers0