How would one create score dependent on total time in game? I would like the score to count by 1000+ each second the game is running for. Later I am going to add some coins which will give my total score +1000 also.
How would one create this functionality? This is all I have right now:
let scoreDisplay = UILabel()
scoreDisplay.text = "Score: \(self.score)"
scoreDisplay.textColor = UIColor.red
scoreDisplay.frame = CGRect(x: mainWidth / 2 - 200, y: mainHeight - 400, width: 247, height: 100)
self.view.addSubview(scoreDisplay)
let delay = SKAction.wait(forDuration: 0.25)
let incrementScore = SKAction.run ({
self.score = self.score + 1
self.scoreDisplay.text = "\(self.score)"
})
I'm pretty new to Swift, so sorry for my basic question!