diff --git a/GoldWars/GoldWars/Base/Base.swift b/GoldWars/GoldWars/Base/Base.swift index c5abd99..83df93f 100644 --- a/GoldWars/GoldWars/Base/Base.swift +++ b/GoldWars/GoldWars/Base/Base.swift @@ -12,12 +12,12 @@ import GameplayKit class Base : SKSpriteNode{ public static let colorSelected = SKColor.yellow var availableBases = [Base]() - var standartColor = SKColor.green + var defaultColor = SKColor.green init(color: UIColor, position: CGPoint, name: String) { super.init(texture: SKTexture(imageNamed: "Base"), color: color, size: CGSize(width: 50.0, height: 50.0)) - standartColor = color + defaultColor = color self.colorBlendFactor = 1 self.name = name self.position = position @@ -55,21 +55,11 @@ class Base : SKSpriteNode{ } override func touchesEnded(_ touches: Set, with event: UIEvent?) { - self.color = standartColor + self.color = defaultColor for base in availableBases { - base.color = base.standartColor + base.color = base.defaultColor base.size = CGSize(width: 50, height: 50) } } } - - -enum PlayerColors { - static let colors = [ - UIColor(red: 231/255, green: 76/255, blue: 60/255, alpha: 1.0), - UIColor(red: 241/255, green: 196/255, blue: 15/255, alpha: 1.0), - UIColor(red: 46/255, green: 204/255, blue: 113/255, alpha: 1.0), - UIColor(red: 52/255, green: 152/255, blue: 219/255, alpha: 1.0), - ] -} diff --git a/GoldWars/GoldWars/Game/GameScene.swift b/GoldWars/GoldWars/Game/GameScene.swift index c6f9651..f3bd0d7 100644 --- a/GoldWars/GoldWars/Game/GameScene.swift +++ b/GoldWars/GoldWars/Game/GameScene.swift @@ -173,23 +173,11 @@ class GameScene: SKScene, SKPhysicsContactDelegate { } - func touchDown(atPoint pos : CGPoint) { - - } - - func touchMoved(toPoint pos : CGPoint) { - - } - - func touchUp(atPoint pos : CGPoint) { - - } - override func touchesBegan(_ touches: Set, with event: UIEvent?) { for touch in touches { - let locationUser = touch.location(in: self) - if atPoint(locationUser) == menu { - menu.removeFromParent() + let locationUser = touch.location(in: self) + if atPoint(locationUser) == menu { + menu.removeFromParent() } } } @@ -213,12 +201,4 @@ class GameScene: SKScene, SKPhysicsContactDelegate { func didBegin(_ contact: SKPhysicsContact) { self.addChild(menu) } - - override func touchesCancelled(_ touches: Set, with event: UIEvent?) { - - } - - override func update(_ currentTime: TimeInterval) { - - } }