In my didEndContact:
method I increment a "currentScore".
For some reason, didEndContact:
is not being called, and hence the "currentScore" is not being incremented. Any ideas why or what I should be looking for to debug this?
func didEndContact(contact: SKPhysicsContact) {
guard goal!.barEnabled else { return }
score += 1
}
Here is related code, let me know if I can add any other helpful details too:
var barEnabled:Bool {
set {
bar?.physicsBody?.collisionBitMask = newValue ? CollisionMask.Puck : CollisionMask.None
bar?.physicsBody?.categoryBitMask = newValue ? CollisionMask.Goal : CollisionMask.None
}
get {
return bar?.physicsBody?.collisionBitMask == CollisionMask.Puck
}
}