diff --git a/GoldWars/GoldWars/Game/GameScene.swift b/GoldWars/GoldWars/Game/GameScene.swift index 31f5b99..71a2ac5 100644 --- a/GoldWars/GoldWars/Game/GameScene.swift +++ b/GoldWars/GoldWars/Game/GameScene.swift @@ -15,7 +15,7 @@ class GameScene: SKScene, SKPhysicsContactDelegate { var graphs = [String : GKGraph]() var bases = [Base]() var player = [Base]() - var menu = SKSpriteNode() + var popUpOnBaseCollision = SKSpriteNode() struct physicsBodyNumber { static let basePlayer1Number: UInt32 = 0b1 @@ -41,9 +41,9 @@ class GameScene: SKScene, SKPhysicsContactDelegate { basePlayer2.physicsBody?.collisionBitMask = physicsBodyNumber.emptyNumber basePlayer2.physicsBody?.contactTestBitMask = physicsBodyNumber.base5Number & physicsBodyNumber.base6Number & physicsBodyNumber.base7Number - menu = SKSpriteNode(color: SKColor.blue , size: CGSize(width: self.size.width * 0.4, height: self.size.height * 0.4)) - menu.position = CGPoint(x: self.size.width * 0.5, y: self.size.height * 0.5) - menu.zPosition = 2 + popUpOnBaseCollision = SKSpriteNode(color: SKColor.blue , size: CGSize(width: self.size.width * 0.4, height: self.size.height * 0.4)) + popUpOnBaseCollision.position = CGPoint(x: self.size.width * 0.5, y: self.size.height * 0.5) + popUpOnBaseCollision.zPosition = 2 self.addChild(basePlayer1) self.addChild(basePlayer2) @@ -175,8 +175,8 @@ class GameScene: SKScene, SKPhysicsContactDelegate { override func touchesBegan(_ touches: Set, with event: UIEvent?) { for touch in touches { let locationUser = touch.location(in: self) - if atPoint(locationUser) == menu { - menu.removeFromParent() + if atPoint(locationUser) == popUpOnBaseCollision { + popUpOnBaseCollision.removeFromParent() } } } @@ -198,6 +198,6 @@ class GameScene: SKScene, SKPhysicsContactDelegate { } func didBegin(_ contact: SKPhysicsContact) { - self.addChild(menu) + self.addChild(popUpOnBaseCollision) } } diff --git a/GoldWars/GoldWars/GameViewController.swift b/GoldWars/GoldWars/GameViewController.swift index 90982d7..2f7d3d6 100644 --- a/GoldWars/GoldWars/GameViewController.swift +++ b/GoldWars/GoldWars/GameViewController.swift @@ -17,7 +17,7 @@ class GameViewController: UIViewController { if let view = self.view as! SKView? { if let scene = SKScene(fileNamed: "MenuScene") { - scene.scaleMode = .aspectFill + //scene.scaleMode = .aspectFill view.presentScene(scene) //TODO: create dev profile or remove on delivery view.showsFPS = true diff --git a/GoldWars/GoldWars/Info.plist b/GoldWars/GoldWars/Info.plist index 870f784..53cfd47 100644 --- a/GoldWars/GoldWars/Info.plist +++ b/GoldWars/GoldWars/Info.plist @@ -38,8 +38,6 @@ UISupportedInterfaceOrientations~ipad - UIInterfaceOrientationPortrait - UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight