From f363d30f152d2005f43b71381288a05ec570ff37 Mon Sep 17 00:00:00 2001 From: Niko Jochim <82joni1bif@hft-stuttgart.de> Date: Sun, 14 Jun 2020 20:19:04 +0200 Subject: [PATCH] rest RoundCalculatorService --- GoldWars/GoldWars/Entities/Way.swift | 2 +- GoldWars/GoldWars/GameCenterManager.swift | 1 - GoldWars/GoldWars/GameViewController.swift | 1 - GoldWars/GoldWars/Scenes/GameScene.swift | 6 +++--- 4 files changed, 4 insertions(+), 6 deletions(-) diff --git a/GoldWars/GoldWars/Entities/Way.swift b/GoldWars/GoldWars/Entities/Way.swift index 9ecc667..ccb22c9 100644 --- a/GoldWars/GoldWars/Entities/Way.swift +++ b/GoldWars/GoldWars/Entities/Way.swift @@ -39,7 +39,7 @@ class Way: GKEntity { self.localWayComponent.strokeColor = UIColor(red: 0.852, green: 0.649, blue: 0.123, alpha: 1) self.localWayComponent.lineWidth = 10 self.localWayComponent.zPosition = 0 - + self.localWayComponent.name = "way" super.init() } diff --git a/GoldWars/GoldWars/GameCenterManager.swift b/GoldWars/GoldWars/GameCenterManager.swift index f6dcd69..a4ce191 100644 --- a/GoldWars/GoldWars/GameCenterManager.swift +++ b/GoldWars/GoldWars/GameCenterManager.swift @@ -59,7 +59,6 @@ final class GameCenterManager: NSObject, GKMatchmakerViewControllerDelegate, GKG } func reset(){ - isMatchStarted = false isServer = false localPlayerRandomNumber = RandomNumber() diff --git a/GoldWars/GoldWars/GameViewController.swift b/GoldWars/GoldWars/GameViewController.swift index 8061d97..3ab5d6e 100644 --- a/GoldWars/GoldWars/GameViewController.swift +++ b/GoldWars/GoldWars/GameViewController.swift @@ -11,7 +11,6 @@ import SpriteKit import GameplayKit class GameViewController: UIViewController { - public static let sharedInstance = GameViewController(); var currentScene: SKView? override func viewDidLoad() { diff --git a/GoldWars/GoldWars/Scenes/GameScene.swift b/GoldWars/GoldWars/Scenes/GameScene.swift index f6fe24a..393e59b 100644 --- a/GoldWars/GoldWars/Scenes/GameScene.swift +++ b/GoldWars/GoldWars/Scenes/GameScene.swift @@ -26,8 +26,6 @@ class GameScene: SKScene{ entityManager.add(Background(size: self.size)) if CommandLine.arguments.contains("--no-matchmaking") { _ = MapFactory(scene: self, entityManager: entityManager).load() - // let node = ButtonNode(textureName: "yellow_button05", text: "Menu", isEnabled: true, position: CGPoint(x: self.size.width / 2, y: self.size.height / 2 - 200), onButtonPress: {self.view?.presentScene(MenuScene(size: self.size)) }) - // self.addChild(node) } return } @@ -183,8 +181,10 @@ class GameScene: SKScene{ } func buttonPressed() { - GameCenterManager.sharedInstance.reset(); + GameCenterManager.sharedInstance.reset() self.gameEndEffects = false + entityManager.getTimer()?.stopTimer() + RoundCalculatorService.sharedInstance.currentRound = 1 self.view?.presentScene(MenuScene(size: self.size)) entityManager.entities.removeAll() self.removeFromParent()