diff --git a/GoldWars/GoldWars/Map/TwoPlayerDefaultTestMap.swift b/GoldWars/GoldWars/Map/TwoPlayerDefaultTestMap.swift index d7d388c..74a46d3 100644 --- a/GoldWars/GoldWars/Map/TwoPlayerDefaultTestMap.swift +++ b/GoldWars/GoldWars/Map/TwoPlayerDefaultTestMap.swift @@ -30,33 +30,36 @@ class TwoPlayerDefaultTestMap: MapProtocoll { position: CGPoint(x: self.size.width * 0.1, y: self.size.height / 2), team: .team1 ) - entityManager.add(basePlayerOne) - var genericBasePositions = Array() + let column1 = [ + Base(position: CGPoint(x: self.size.width * 0.25, y: self.size.height * 0.25)), + Base(position: CGPoint(x: self.size.width * 0.25, y: self.size.height * 0.5)), + Base(position: CGPoint(x: self.size.width * 0.25, y: self.size.height * 0.75)) + ] - // First column - genericBasePositions.append(CGPoint(x: self.size.width * 0.25, y: self.size.height * 0.25)) - genericBasePositions.append(CGPoint(x: self.size.width * 0.25, y: self.size.height * 0.5)) - genericBasePositions.append(CGPoint(x: self.size.width * 0.25, y: self.size.height * 0.75)) + let column2 = [ + Base(position: CGPoint(x: self.size.width * 0.5, y: self.size.height * 0.333)), + Base(position: CGPoint(x: self.size.width * 0.5, y: self.size.height * 0.666)) + ] - // Second column - genericBasePositions.append(CGPoint(x: self.size.width * 0.5, y: self.size.height * 0.333)) - genericBasePositions.append(CGPoint(x: self.size.width * 0.5, y: self.size.height * 0.666)) - - // Third column - genericBasePositions.append(CGPoint(x: self.size.width * 0.75, y: self.size.height * 0.25)) - genericBasePositions.append(CGPoint(x: self.size.width * 0.75, y: self.size.height * 0.5)) - genericBasePositions.append(CGPoint(x: self.size.width * 0.75, y: self.size.height * 0.75)) - - for pos in genericBasePositions { - entityManager.add(Base(position: pos)) - } + let column3 = [ + Base(position: CGPoint(x: self.size.width * 0.75, y: self.size.height * 0.25)), + Base(position: CGPoint(x: self.size.width * 0.75, y: self.size.height * 0.5)), + Base(position: CGPoint(x: self.size.width * 0.75, y: self.size.height * 0.75)) + ] // Player two (rightest base) let basePlayerTwo = Base( position: CGPoint(x: self.size.width * 0.9, y: self.size.height / 2), team: .team2 ) + + entityManager.add(basePlayerOne) + + column1.forEach({base in entityManager.add(base)}) + column2.forEach({base in entityManager.add(base)}) + column3.forEach({base in entityManager.add(base)}) + entityManager.add(basePlayerTwo) } }