Hi,I am practising subclassing. I have a superclass GameScene and subclass Scene02. I created a scoring that is called in touches began. But when the app transitions to Scene02, the score returns to zero rather than inheriting the score update that is updated in the superclass GameScene init(). How can I make the score in Scene02 class to continue the last score (int 5) from the superclass?Thanks in advanceimport SpriteKitimport GameplayKitclass GameScene: SKScene { var score = 0 let scoreLabel = SKLabelNode(fontNamed: Arial) required init?(coder aDecoder: NSCoder) { super.init(coder: aDecoder) } override init(size: CGSize) { super.init(size: size) scoreLabel.fontSize = 35 scoreLabel.text = Score: Score scoreLabel.fontColor = SKColor.black scoreLabel.position = CGPoint(x: scene!.size.width/2.0, y: scene!.size.height/2.0) scoreLabel.zPosition = 5 self.addChild(scoreLabel) updateScore() } override func didMove(to view: SKView) { self.anchorPoint = .zero self.backgroundColor = SKColor.green } func updat
4
0
1.7k