Merge branch '114-adjust-menu-scene-for-smaller-ipads' into 'development'

Resolve "Adjust menu scene for smaller iPads"

Closes #114

See merge request marcel.schwarz/software-projekt-2!141
This commit is contained in:
Aldin Duraki 2020-06-25 19:03:31 +00:00
commit 6cfd91b659
2 changed files with 61 additions and 59 deletions

View File

@ -9,29 +9,26 @@
import Foundation
import GameplayKit
class SpinningLogoEntity: GKEntity {
class SpinningLogoEntity : GKEntity {
let spinningLogoNode : SpinningLogo3DNode
let goldLetteringNode : SKSpriteNode
let warsLetteringNode : SKSpriteNode
let spinningLogoNode: SpinningLogo3DNode
let goldLetteringNode: SKSpriteNode
let warsLetteringNode: SKSpriteNode
init(sceneSize size: CGSize) {
spinningLogoNode = SpinningLogo3DNode()
let midX = size.width / 2
let midY = size.height / 2
goldLetteringNode = SKSpriteNode(texture: SKTexture(imageNamed: "goldLettering"))
goldLetteringNode.position = CGPoint(x: midX, y: midY);
goldLetteringNode.size = CGSize(width: 675, height: 284)
goldLetteringNode.position = CGPoint(x: midX , y: midY + 280);
goldLetteringNode.size = CGSize(width: 675, height: 284)
goldLetteringNode.position = CGPoint(x: size.width / 2 , y: size.height * 0.83)
goldLetteringNode.size = CGSize(width: size.width / 2.02, height: size.height / 3.6)
warsLetteringNode = SKSpriteNode(texture: SKTexture(imageNamed: "warsLettering"))
warsLetteringNode.position = CGPoint(x: midX, y: midY - 300);
warsLetteringNode.size = CGSize(width: 700, height: 284)
warsLetteringNode.position = CGPoint(x: size.width / 2, y: size.height * 0.17)
warsLetteringNode.size = CGSize(width: size.width / 2.02, height: size.height / 3.6)
spinningLogoNode.viewportSize = CGSize(width: 200, height: 200)
spinningLogoNode = SpinningLogo3DNode()
spinningLogoNode.viewportSize = CGSize(width: size.width / 5.12 * 0.69, height: size.height / 3.84 * 0.69)
spinningLogoNode.zPosition = goldLetteringNode.zPosition - 1
spinningLogoNode.position = CGPoint(x: midX - 65, y: midY + 285);
spinningLogoNode.position = CGPoint(x: size.width * 0.455, y: size.height * 0.83)
super.init()
}

View File

@ -17,7 +17,8 @@ class MenuScene: SKScene {
entityManager.setScene(scene: self)
let midX = self.size.width / 2
let midY = self.size.height / 2
entityManager.add(Button(name: "startGameButton",
entityManager.add(
Button(name: "startGameButton",
textureName: "gold_button_3",
text: "Start Game",
position: CGPoint(x: midX, y: midY + 90),
@ -26,41 +27,45 @@ class MenuScene: SKScene {
self.loadScene(scene: GameScene(size: self.size))
SoundManager.sharedInstance.stopMenuMusic()
} else {
if GameCenterManager.isAuthenticated {
GameCenterManager.sharedInstance.presentMatchmaker()
}else {
} else {
GameCenterManager.sharedInstance.authUser()
}
}
}))
entityManager.add(Button(name: "settingsButton",
}
)
)
entityManager.add(
Button(name: "settingsButton",
textureName: "gold_button_3",
text: "Einstellungen",
position: CGPoint(x: midX, y: midY ),
onButtonPress: {
let scene = SettingsScene(size: self.size)
self.loadScene(scene: scene)
}))
entityManager.add(Button(name: "gameCenterButton",
onButtonPress: { self.loadScene(scene: SettingsScene(size: self.size))}
)
)
entityManager.add(
Button(name: "gameCenterButton",
textureName: "gold_button_3",
text: "GameCenter",
position: CGPoint(x: midX, y: midY - 90),
onButtonPress: {
if GameCenterManager.isAuthenticated {
GameCenterManager.sharedInstance.presentGameCenter()
}else {
} else {
GameCenterManager.sharedInstance.authUser()
}
}))
entityManager.add(Button(name: "regelwerkButton",
}
)
)
entityManager.add(
Button(name: "regelwerkButton",
textureName: "questionmark",
text: "",
position: CGPoint(x: self.size.width - 50, y: self.size.height - 50),
onButtonPress: {
let scene = RulesScene(size: self.size)
self.loadScene(scene: scene)
}))
onButtonPress: { self.loadScene(scene: RulesScene(size: self.size)) }
)
)
entityManager.add(Background(size: self.size))
entityManager.add(SpinningLogoEntity(sceneSize: self.size))