diff --git a/GoldWars/GoldWars/Assets.xcassets/RulesBoost.imageset/RulesBoost.png b/GoldWars/GoldWars/Assets.xcassets/RulesBoost.imageset/RulesBoost.png index a226098..9f311d2 100644 Binary files a/GoldWars/GoldWars/Assets.xcassets/RulesBoost.imageset/RulesBoost.png and b/GoldWars/GoldWars/Assets.xcassets/RulesBoost.imageset/RulesBoost.png differ diff --git a/GoldWars/GoldWars/Assets.xcassets/RulesEinheiten.imageset/RulesEinheiten.png b/GoldWars/GoldWars/Assets.xcassets/RulesEinheiten.imageset/RulesEinheiten.png index 786d326..43448b8 100644 Binary files a/GoldWars/GoldWars/Assets.xcassets/RulesEinheiten.imageset/RulesEinheiten.png and b/GoldWars/GoldWars/Assets.xcassets/RulesEinheiten.imageset/RulesEinheiten.png differ diff --git a/GoldWars/GoldWars/Entities/EntityManager.swift b/GoldWars/GoldWars/Entities/EntityManager.swift index 15930a0..2811867 100644 --- a/GoldWars/GoldWars/Entities/EntityManager.swift +++ b/GoldWars/GoldWars/Entities/EntityManager.swift @@ -68,7 +68,7 @@ class EntityManager { } if let rulesEntity = entity as? Rules { - scene.addChild(rulesEntity.node) + scene.addChild(rulesEntity.image) } if let wayEntity = entity as? Way { @@ -374,7 +374,7 @@ class EntityManager { func removeRules(){ entities.forEach({entity in if let rules = entity as? Rules { - rules.node.removeFromParent() + rules.image.removeFromParent() if let button = rules.component(ofType: ButtonComponent.self) { button.buttonNode.removeFromParent() diff --git a/GoldWars/GoldWars/RulesScene.swift b/GoldWars/GoldWars/RulesScene.swift index 9394923..440f16a 100644 --- a/GoldWars/GoldWars/RulesScene.swift +++ b/GoldWars/GoldWars/RulesScene.swift @@ -39,7 +39,6 @@ class RulesScene: SKScene { onButtonPress: { EntityManager.rulesEMInstance.removeRules() EntityManager.rulesEMInstance.add(Rules(rulesScene: self, textureName: "RulesSpiel")) - })) EntityManager.rulesEMInstance.add(Button(name: "Basen", textureName: "yellow_button13", @@ -48,7 +47,6 @@ class RulesScene: SKScene { onButtonPress: { EntityManager.rulesEMInstance.removeRules() EntityManager.rulesEMInstance.add(Rules(rulesScene: self, textureName: "RulesBasen")) - })) EntityManager.rulesEMInstance.add(Button(name: "Einheiten", textureName: "yellow_button13", @@ -57,7 +55,6 @@ class RulesScene: SKScene { onButtonPress: { EntityManager.rulesEMInstance.removeRules() EntityManager.rulesEMInstance.add(Rules(rulesScene: self, textureName: "RulesEinheiten")) - })) EntityManager.rulesEMInstance.add(Button(name: "Spielende", textureName: "yellow_button13", @@ -66,7 +63,6 @@ class RulesScene: SKScene { onButtonPress: { EntityManager.rulesEMInstance.removeRules() EntityManager.rulesEMInstance.add(Rules(rulesScene: self, textureName: "RulesSpielende")) - })) EntityManager.rulesEMInstance.add(Button(name: "Boost", textureName: "yellow_button13", @@ -75,7 +71,6 @@ class RulesScene: SKScene { onButtonPress: { EntityManager.rulesEMInstance.removeRules() EntityManager.rulesEMInstance.add(Rules(rulesScene: self, textureName: "RulesBoost")) - })) EntityManager.rulesEMInstance.add(Button(name: "Erfolge", textureName: "yellow_button13", @@ -84,7 +79,6 @@ class RulesScene: SKScene { onButtonPress: { EntityManager.rulesEMInstance.removeRules() EntityManager.rulesEMInstance.add(Rules(rulesScene: self, textureName: "RulesErfolge")) - })) EntityManager.rulesEMInstance.add(Background(size: self.size)) EntityManager.rulesEMInstance.add(Rules(rulesScene: self, textureName: "RulesSpiel")) @@ -105,13 +99,13 @@ class RulesScene: SKScene { class Rules: GKEntity { - var node: SKSpriteNode + var image: SKSpriteNode init(rulesScene: RulesScene, textureName: String) { let texture = SKTexture(imageNamed: textureName) - node = SKSpriteNode(texture: texture, size: CGSize(width: rulesScene.size.width * 0.8, height: rulesScene.size.height * 0.8)) - node.position = CGPoint(x: rulesScene.size.width * 0.6, y: rulesScene.size.height * 0.6 - 150) - node.zPosition = 4 + image = SKSpriteNode(texture: texture, size: CGSize(width: rulesScene.size.width * 0.8, height: rulesScene.size.height * 0.8)) + image.position = CGPoint(x: rulesScene.size.width * 0.6, y: rulesScene.size.height * 0.6 - 150) + image.zPosition = 4 super.init() }