delete portrait-mode and more refactoring with master Aldin
This commit is contained in:
parent
6712398f6a
commit
b87eb3dd53
@ -15,7 +15,7 @@ class GameScene: SKScene, SKPhysicsContactDelegate {
|
|||||||
var graphs = [String : GKGraph]()
|
var graphs = [String : GKGraph]()
|
||||||
var bases = [Base]()
|
var bases = [Base]()
|
||||||
var player = [Base]()
|
var player = [Base]()
|
||||||
var menu = SKSpriteNode()
|
var popUpOnBaseCollision = SKSpriteNode()
|
||||||
|
|
||||||
struct physicsBodyNumber {
|
struct physicsBodyNumber {
|
||||||
static let basePlayer1Number: UInt32 = 0b1
|
static let basePlayer1Number: UInt32 = 0b1
|
||||||
@ -41,9 +41,9 @@ class GameScene: SKScene, SKPhysicsContactDelegate {
|
|||||||
basePlayer2.physicsBody?.collisionBitMask = physicsBodyNumber.emptyNumber
|
basePlayer2.physicsBody?.collisionBitMask = physicsBodyNumber.emptyNumber
|
||||||
basePlayer2.physicsBody?.contactTestBitMask = physicsBodyNumber.base5Number & physicsBodyNumber.base6Number & physicsBodyNumber.base7Number
|
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))
|
popUpOnBaseCollision = 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)
|
popUpOnBaseCollision.position = CGPoint(x: self.size.width * 0.5, y: self.size.height * 0.5)
|
||||||
menu.zPosition = 2
|
popUpOnBaseCollision.zPosition = 2
|
||||||
|
|
||||||
self.addChild(basePlayer1)
|
self.addChild(basePlayer1)
|
||||||
self.addChild(basePlayer2)
|
self.addChild(basePlayer2)
|
||||||
@ -175,8 +175,8 @@ class GameScene: SKScene, SKPhysicsContactDelegate {
|
|||||||
override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) {
|
override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) {
|
||||||
for touch in touches {
|
for touch in touches {
|
||||||
let locationUser = touch.location(in: self)
|
let locationUser = touch.location(in: self)
|
||||||
if atPoint(locationUser) == menu {
|
if atPoint(locationUser) == popUpOnBaseCollision {
|
||||||
menu.removeFromParent()
|
popUpOnBaseCollision.removeFromParent()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -198,6 +198,6 @@ class GameScene: SKScene, SKPhysicsContactDelegate {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func didBegin(_ contact: SKPhysicsContact) {
|
func didBegin(_ contact: SKPhysicsContact) {
|
||||||
self.addChild(menu)
|
self.addChild(popUpOnBaseCollision)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -17,7 +17,7 @@ class GameViewController: UIViewController {
|
|||||||
|
|
||||||
if let view = self.view as! SKView? {
|
if let view = self.view as! SKView? {
|
||||||
if let scene = SKScene(fileNamed: "MenuScene") {
|
if let scene = SKScene(fileNamed: "MenuScene") {
|
||||||
scene.scaleMode = .aspectFill
|
//scene.scaleMode = .aspectFill
|
||||||
view.presentScene(scene)
|
view.presentScene(scene)
|
||||||
//TODO: create dev profile or remove on delivery
|
//TODO: create dev profile or remove on delivery
|
||||||
view.showsFPS = true
|
view.showsFPS = true
|
||||||
|
@ -38,8 +38,6 @@
|
|||||||
</array>
|
</array>
|
||||||
<key>UISupportedInterfaceOrientations~ipad</key>
|
<key>UISupportedInterfaceOrientations~ipad</key>
|
||||||
<array>
|
<array>
|
||||||
<string>UIInterfaceOrientationPortrait</string>
|
|
||||||
<string>UIInterfaceOrientationPortraitUpsideDown</string>
|
|
||||||
<string>UIInterfaceOrientationLandscapeLeft</string>
|
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||||
<string>UIInterfaceOrientationLandscapeRight</string>
|
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||||
</array>
|
</array>
|
||||||
|
Loading…
Reference in New Issue
Block a user