         })
     }
     
+    func updateScore() {
+        currentScore += 1
+        scoreNode.text = generateScore()
+        
+        DispatchQueue.main.asyncAfter(deadline: .now() + 0.1, execute: {
+            if (self.shouldUpdateScore) {
+                self.updateScore()
+            }
+        })
+    }
+    
     func startGame() {
         srand48(Int(arc4random()))
         

        }
        
        
        let randDelay = drand48() * 0.3
        
        DispatchQueue.main.asyncAfter(deadline: .now() + 0.6 + randDelay, execute: {
            if self.continueSpawnObstacle == true {

        subtitleNode.zPosition = 50

        return subtitleNode
    }
    
    func scoreLabel() -> SKLabelNode {
        scoreNode.text = generateScore()
        scoreNode.fontSize = 13
        scoreNode.horizontalAlignmentMode = .right
        scoreNode.position = CGPoint(x: self.frame.maxX - 4, y:self.frame.midY + 2)
        scoreNode.fontColor = dinoDarkColor
        scoreNode.zPosition = 80
        
        return scoreNode
    }
    
    func generateScore() -> String {
        return String(format: "%07d", currentScore)
    }
    
    func dinoSprite() -> SKSpriteNode {
