Created
June 19, 2019 20:58
-
-
Save PedroFarina/42341042558b87364d93ac939ae622d8 to your computer and use it in GitHub Desktop.
Adding a delegate to a Scene
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class GameScene: SKScene, SKPhysicsContactDelegate{ | |
override func sceneDidLoad() { | |
self.physicsWorld.contactDelegate = self | |
} | |
func didBegin(_ contact: SKPhysicsContact) { | |
//Começou o contato | |
} | |
func didEnd(_ contact: SKPhysicsContact) { | |
//Acabou o contato | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment