diff --git a/GoldWars/GoldWars/Assets.xcassets/exitButton.imageset/Contents.json b/GoldWars/GoldWars/Assets.xcassets/exitButton.imageset/Contents.json new file mode 100644 index 0000000..7b1399e --- /dev/null +++ b/GoldWars/GoldWars/Assets.xcassets/exitButton.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "exitButton.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/GoldWars/GoldWars/Assets.xcassets/exitButton.imageset/exitButton.png b/GoldWars/GoldWars/Assets.xcassets/exitButton.imageset/exitButton.png new file mode 100644 index 0000000..7d180b7 Binary files /dev/null and b/GoldWars/GoldWars/Assets.xcassets/exitButton.imageset/exitButton.png differ diff --git a/GoldWars/GoldWars/Assets.xcassets/finish_button.imageset/finish_button 2.png b/GoldWars/GoldWars/Assets.xcassets/finish_button.imageset/finish_button 2.png index 8beedc1..00c4273 100644 Binary files a/GoldWars/GoldWars/Assets.xcassets/finish_button.imageset/finish_button 2.png and b/GoldWars/GoldWars/Assets.xcassets/finish_button.imageset/finish_button 2.png differ diff --git a/GoldWars/GoldWars/Assets.xcassets/roundInfoTexture.imageset/Contents.json b/GoldWars/GoldWars/Assets.xcassets/roundInfoTexture.imageset/Contents.json new file mode 100644 index 0000000..bdb389d --- /dev/null +++ b/GoldWars/GoldWars/Assets.xcassets/roundInfoTexture.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "roundInfoTexture.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "roundInfoTexture-1.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "roundInfoTexture-2.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/GoldWars/GoldWars/Assets.xcassets/roundInfoTexture.imageset/roundInfoTexture-1.png b/GoldWars/GoldWars/Assets.xcassets/roundInfoTexture.imageset/roundInfoTexture-1.png new file mode 100644 index 0000000..49b79a3 Binary files /dev/null and b/GoldWars/GoldWars/Assets.xcassets/roundInfoTexture.imageset/roundInfoTexture-1.png differ diff --git a/GoldWars/GoldWars/Assets.xcassets/roundInfoTexture.imageset/roundInfoTexture-2.png b/GoldWars/GoldWars/Assets.xcassets/roundInfoTexture.imageset/roundInfoTexture-2.png new file mode 100644 index 0000000..49b79a3 Binary files /dev/null and b/GoldWars/GoldWars/Assets.xcassets/roundInfoTexture.imageset/roundInfoTexture-2.png differ diff --git a/GoldWars/GoldWars/Assets.xcassets/roundInfoTexture.imageset/roundInfoTexture.png b/GoldWars/GoldWars/Assets.xcassets/roundInfoTexture.imageset/roundInfoTexture.png new file mode 100644 index 0000000..49b79a3 Binary files /dev/null and b/GoldWars/GoldWars/Assets.xcassets/roundInfoTexture.imageset/roundInfoTexture.png differ diff --git a/GoldWars/GoldWars/Entities/HUD.swift b/GoldWars/GoldWars/Entities/HUD.swift index b6bbeb0..fc3d53f 100644 --- a/GoldWars/GoldWars/Entities/HUD.swift +++ b/GoldWars/GoldWars/Entities/HUD.swift @@ -52,17 +52,16 @@ class HUD: GKEntity { self.roundTimer = RoundTimer() - leaveGame = ButtonNode(textureName: "yellow_button04", text: "Verlassen" , isEnabled: true, position: CGPoint(x: EntityManager.gameEMInstance.scene.size.width * 0.17, y: EntityManager.gameEMInstance.scene.size.height * 0.04), onButtonPress: { + leaveGame = ButtonNode(textureName: "exitButton", text: "" , isEnabled: true, position: CGPoint(x: EntityManager.gameEMInstance.scene.size.width * 0.05, y: EntityManager.gameEMInstance.scene.size.height * 0.11), onButtonPress: { EntityManager.gameEMInstance.add(Modal(modaltype: .QuitGame, base: nil, anchorPoint: CGPoint(x: EntityManager.gameEMInstance.scene.size.width / 2 , y: EntityManager.gameEMInstance.scene.size.height / 2), gameScene: EntityManager.gameEMInstance.scene, currentDraggedBase: nil, touchLocation: nil, collisionBase: nil)) }) - leaveGame.setScale(0.6) - + leaveGame.size = CGSize(width: 120, height: 120); spySkill = SkillButtonNode( textureName: "spy_button", text: "Spy", isEnabled: true, cooldown: 3, - position: CGPoint(x: EntityManager.gameEMInstance.scene.size.width * 0.80, y: EntityManager.gameEMInstance.scene.size.height * 0.1), + position: CGPoint(x: EntityManager.gameEMInstance.scene.size.width * 0.81, y: EntityManager.gameEMInstance.scene.size.height * 0.1), onButtonPress: { EntityManager.gameEMInstance.getOpponentBases(for: EntityManager.gameEMInstance.getTeam()).forEach({base in base.component(ofType: TeamComponent.self)?.unitcountLabel.text = "\(base.unitCount)"}) GameCenterManager.sharedInstance.addAchievementProgress(identifier: "de.hft.stuttgart.ip2.goldwars.skill.first.time", increasePercentComplete: 100) @@ -75,7 +74,7 @@ class HUD: GKEntity { text: "Def", isEnabled: true, cooldown: 4, - position: CGPoint(x: EntityManager.gameEMInstance.scene.size.width * 0.90, y: EntityManager.gameEMInstance.scene.size.height * 0.1), + position: CGPoint(x: EntityManager.gameEMInstance.scene.size.width * 0.88, y: EntityManager.gameEMInstance.scene.size.height * 0.1), onButtonPress: { DataService.sharedInstance.localRoundData.hasDefenceBoost = true GameCenterManager.sharedInstance.addAchievementProgress(identifier: "de.hft.stuttgart.ip2.goldwars.skill.first.time", increasePercentComplete: 100) @@ -88,7 +87,7 @@ class HUD: GKEntity { text: "Atk", isEnabled: true, cooldown: 4, - position: CGPoint(x: EntityManager.gameEMInstance.scene.size.width * 0.70, y: EntityManager.gameEMInstance.scene.size.height * 0.1), + position: CGPoint(x: EntityManager.gameEMInstance.scene.size.width * 0.74, y: EntityManager.gameEMInstance.scene.size.height * 0.1), onButtonPress: { DataService.sharedInstance.localRoundData.hasAttackBoost = true GameCenterManager.sharedInstance.addAchievementProgress(identifier: "de.hft.stuttgart.ip2.goldwars.skill.first.time", increasePercentComplete: 100) @@ -102,15 +101,16 @@ class HUD: GKEntity { text: "", isEnabled: true, position: CGPoint( - x: EntityManager.gameEMInstance.scene.size.width / 2 , + x: EntityManager.gameEMInstance.scene.size.width * 0.95 , y: EntityManager.gameEMInstance.scene.size.height * 0.1), onButtonPress: { } ) + + finishButton.size = CGSize(width: 100, height: 100) - //finishButton.setScale(0.9) finishButton.zPosition = 2 - backgroundRoundCounter = SKSpriteNode(texture: SKTexture(imageNamed: "roundInfo_texture")) + backgroundRoundCounter = SKSpriteNode(texture: SKTexture(imageNamed: "roundInfoTexture")) currentRoundLabel = SKLabelNode(fontNamed: "Courier-Bold") roundsLabel = SKLabelNode(fontNamed: "Courier-Bold") roundLabel = SKLabelNode(fontNamed: "Courier-Bold") @@ -169,13 +169,13 @@ class HUD: GKEntity { func initRoundInfo(size: CGSize) -> () { backgroundRoundCounter.zPosition = 2 - backgroundRoundCounter.position = CGPoint(x: Double(size.width) * 0.06, y: Double(size.height) * 0.08) - + backgroundRoundCounter.position = CGPoint(x: Double(size.width) * 0.095, y: Double(size.height) * 0.11) + backgroundRoundCounter.size = CGSize(width: 120, height: 120) currentRoundLabel.text = "\(RoundCalculatorService.sharedInstance.currentRound)" currentRoundLabel.fontSize = 50 currentRoundLabel.fontColor = SKColor.black currentRoundLabel.verticalAlignmentMode = .center - currentRoundLabel.position = CGPoint(x: backgroundRoundCounter.position.x, y: backgroundRoundCounter.position.y - 5) + currentRoundLabel.position = CGPoint(x: backgroundRoundCounter.position.x, y: backgroundRoundCounter.position.y - 4) currentRoundLabel.zPosition = backgroundRoundCounter.zPosition + 1 roundsLabel.zPosition = backgroundRoundCounter.zPosition + 1