diff --git a/GoldWars/GoldWars/Scenes/GameScene.swift b/GoldWars/GoldWars/Scenes/GameScene.swift index bb47730..dae1566 100644 --- a/GoldWars/GoldWars/Scenes/GameScene.swift +++ b/GoldWars/GoldWars/Scenes/GameScene.swift @@ -8,6 +8,7 @@ import SpriteKit import GameplayKit +import GameKit class GameScene: SKScene{ @@ -46,12 +47,14 @@ class GameScene: SKScene{ if !(entityManager.getTeamByBase(base: currentDraggedBase!) == entityManager.getTeamByBase(base: base)){ entityManager.add(Modal(modaltype: .BaseAttack, base: currentDraggedBase!, - anchorPoint: CGPoint(x: self.size.width / 2 , y: self.size.height / 2), entityManager: entityManager, gameScene: self)) + anchorPoint: CGPoint(x: self.size.width / 2 , y: self.size.height / 2), + entityManager: entityManager, gameScene: self)) entityManager.update((currentDraggedBase?.attackBase(base: base, units: 100))!) }else { entityManager.add(Modal(modaltype: .BaseAttack, base: currentDraggedBase!, - anchorPoint: CGPoint(x: self.size.width / 2 , y: self.size.height / 2), entityManager: entityManager, gameScene: self)) + anchorPoint: CGPoint(x: self.size.width / 2 , y: self.size.height / 2), + entityManager: entityManager, gameScene: self)) } } @@ -71,7 +74,8 @@ class GameScene: SKScene{ } entityManager.add(Modal(modaltype: .BaseDetails, base: entity as! Base, - anchorPoint: CGPoint(x: self.size.width / 2 , y: self.size.height / 2), entityManager: entityManager, gameScene: self)) + anchorPoint: CGPoint(x: self.size.width / 2 , y: self.size.height / 2), + entityManager: entityManager, gameScene: self)) } } } @@ -96,7 +100,7 @@ class GameScene: SKScene{ body.text = "Schicke \( ((e.component(ofType: SliderComponent.self)?.sliderNode.getValue ?? 0) * CGFloat((e as! Modal).unitCount)).rounded(.up)) Einheiten " } } - let bases = entityManager.getBasesByTeam(for: .team1) + let bases = entityManager.getBasesByPlayer(for: GKLocalPlayer.local) for base in bases { if atPoint(touchLocation) == base.component(ofType: DefaultBaseComponent.self)?.spriteNode{