Skip to content

Instantly share code, notes, and snippets.

@PedroFarina
Created June 19, 2019 20:58
Show Gist options
  • Save PedroFarina/42341042558b87364d93ac939ae622d8 to your computer and use it in GitHub Desktop.
Save PedroFarina/42341042558b87364d93ac939ae622d8 to your computer and use it in GitHub Desktop.
Adding a delegate to a Scene
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