Pfusch von Aldin.D

This commit is contained in:
Niko Jochim 2020-06-14 19:47:22 +02:00
parent 3082297415
commit 48e6247b69
2 changed files with 4 additions and 1 deletions

View File

@ -30,7 +30,9 @@ class RoundTimer: Timer {
} }
func stopTimer() { func stopTimer() {
guard timer != nil else { return }
timer?.invalidate() timer?.invalidate()
timer = nil
} }
func resumeTimer() { func resumeTimer() {

View File

@ -243,6 +243,8 @@ class GameScene: SKScene{
} }
@objc func pauseGame() -> Void { @objc func pauseGame() -> Void {
entityManager.removeModal()
entityManager.getHUD()?.roundTimer.stopTimer()
entityManager.add(Modal(modaltype: .PauseGame, entityManager.add(Modal(modaltype: .PauseGame,
base: nil, base: nil,
anchorPoint: CGPoint(x: self.size.width / 2 , y: self.size.height / 2), anchorPoint: CGPoint(x: self.size.width / 2 , y: self.size.height / 2),
@ -251,7 +253,6 @@ class GameScene: SKScene{
touchLocation: nil, touchLocation: nil,
collisionBase: nil collisionBase: nil
)) ))
entityManager.getHUD()?.roundTimer.stopTimer()
} }
@objc func resumeGame() -> Void { @objc func resumeGame() -> Void {
entityManager.removeModal() entityManager.removeModal()