From c6d1adce9b72c682f858bd7e26f6c58380803292 Mon Sep 17 00:00:00 2001 From: Jakob Haag Date: Sat, 2 May 2020 14:03:41 +0200 Subject: [PATCH] init 100 units to the team-bases on init --- GoldWars/GoldWars/Entities/Base.swift | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/GoldWars/GoldWars/Entities/Base.swift b/GoldWars/GoldWars/Entities/Base.swift index 1358b97..75415f5 100644 --- a/GoldWars/GoldWars/Entities/Base.swift +++ b/GoldWars/GoldWars/Entities/Base.swift @@ -14,13 +14,12 @@ class Base : GKEntity{ init(textureName:String, team: Team?,position: CGPoint ) { self.unitCount = 0 - super.init() + super.init() addComponent(DefaultBaseComponent(texture: SKTexture(imageNamed: textureName), position: position)) if(team != nil){ addComponent(TeamComponent(team: team!, position: position)) - - } - + self.unitCount = 100 + } } required init?(coder: NSCoder) {