Adding labels and buttons
Next, in the init
function, add the following code:
_gameScene = gameScene myLabel = SKLabelNode(fontNamed:"Chalkduster") myLabel.text = "Score: 0"; myLabel.fontColor = UIColor.whiteColor() myLabel.fontSize = 65; myLabel.setScale(1.0) myLabel.position = CGPointMake(size.width * 0.5, size.height * 0.9) self.addChild(myLabel) gameOverLabel = SKLabelNode(fontNamed:"Chalkduster") gameOverLabel.text = "GAMEOVER"; gameOverLabel.fontSize = 100; gameOverLabel.setScale(1.0) gameOverLabel.position = CGPointMake(size.width * 0.5, size.height * 0.5) gameOverLabel.fontColor = UIColor.whiteColor() self.addChild(gameOverLabel) gameOverLabel.hidden = true playBtn = SKSpriteNode(imageNamed: "playBtn") playBtn.position = CGPoint(x: size.width * 0.15, y: size.height * 0.2) ...