From 31143265f686a87323f5bd41c608a157f62f6434 Mon Sep 17 00:00:00 2001 From: 72haja Date: Wed, 22 Apr 2020 18:17:07 +0200 Subject: [PATCH] add unitCount and unitType for basePlayer1 and basePlayer2 --- GoldWars/GoldWars/Game/GameScene.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/GoldWars/GoldWars/Game/GameScene.swift b/GoldWars/GoldWars/Game/GameScene.swift index 00b152a..8dcdebf 100644 --- a/GoldWars/GoldWars/Game/GameScene.swift +++ b/GoldWars/GoldWars/Game/GameScene.swift @@ -34,8 +34,8 @@ class GameScene: SKScene, SKPhysicsContactDelegate { let maxX = self.size.width let midY = self.size.height / 2 - let basePlayer1 = Base(color: SKColor.red, position: CGPoint(x: maxX * 0.1, y: midY), name: "Player1" ) - let basePlayer2 = Base(color: SKColor.blue, position: CGPoint(x: maxX * 0.9, y: midY), name: "Player2" ) + let basePlayer1 = Base(color: SKColor.red, position: CGPoint(x: maxX * 0.1, y: midY), name: "Player1", unitCount: 100, unitType: Unit.General) + let basePlayer2 = Base(color: SKColor.blue, position: CGPoint(x: maxX * 0.9, y: midY), name: "Player2", unitCount: 100, unitType: Unit.General) basePlayer2.physicsBody = SKPhysicsBody(circleOfRadius: 50) basePlayer2.physicsBody?.categoryBitMask = physicsBodyNumber.basePlayer2Number basePlayer2.physicsBody?.collisionBitMask = physicsBodyNumber.emptyNumber