add physicsbody to base 6-7 and removal to func addPhysicsBodyToBase()

This commit is contained in:
127-Z3R0 2020-04-22 14:04:40 +02:00
parent 7b128a7ee8
commit d596442015

View File

@ -51,12 +51,25 @@ class GameScene: SKScene, SKPhysicsContactDelegate {
player.append(basePlayer2)
createVirginBases()
connectBases()
addPhysicsBodyToBase()
bases[5].physicsBody = SKPhysicsBody(circleOfRadius: 50)
}
func addPhysicsBodyToBase() {
bases[5].physicsBody = SKPhysicsBody(circleOfRadius: 20)
bases[5].physicsBody?.categoryBitMask = physicsBodyNumber.base5Number
bases[5].physicsBody?.collisionBitMask = physicsBodyNumber.emptyNumber
bases[5].physicsBody?.contactTestBitMask = physicsBodyNumber.basePlayer2Number
bases[6].physicsBody = SKPhysicsBody(circleOfRadius: 20)
bases[6].physicsBody?.categoryBitMask = physicsBodyNumber.base6Number
bases[6].physicsBody?.collisionBitMask = physicsBodyNumber.emptyNumber
bases[6].physicsBody?.contactTestBitMask = physicsBodyNumber.basePlayer2Number
bases[7].physicsBody = SKPhysicsBody(circleOfRadius: 20)
bases[7].physicsBody?.categoryBitMask = physicsBodyNumber.base7Number
bases[7].physicsBody?.collisionBitMask = physicsBodyNumber.emptyNumber
bases[7].physicsBody?.contactTestBitMask = physicsBodyNumber.basePlayer2Number
}
func createVirginBases() {