ios - Deleting a button after clicking -
i'm trying remove/delete start button scene, when click on it, button becomes invisible still can click , restarts scene... solutions anyone?
this code:
override func touchesbegan(_ touches: set<uitouch>, event: uievent?) { touch in touches{ let location = touch.location(in: self) if startbutton.contains(location){ restartscene() } if died == true { if restartbutton.contains(location){ restartscene() } } } startinggame() } func restartscene() { self.removeallchildren() self.removeallactions() died = false gamestarted = false score = 0 createscene() } func createscene() { self.physicsworld.contactdelegate = self createground() createbird1() createbackground() displayscorelabel() } i found had line:
let location = touch.location(in: self) i don't want location skspritenode, solutions? i'm still pretty new swift appreciated!!
Comments
Post a Comment