I am getting the following error on the line basicTop.run(SK...
Thread 1: Fatal error: Unexpectedly found nil while unwrapping an Optional value
I do not know why I am getting this. I get this error message when I click on the simulator screen.
class GameScene: SKScene {
var brickSwitch: SKSpriteNode!
var basicTop: SKSpriteNode!
var basicBottom: SKSpriteNode!
var basicLeft: SKSpriteNode!
var basicRight: SKSpriteNode!
override func didMove(to view: SKView) {
layoutScene()
}
func turnBasicTop() {
basicTop.run(SKAction.rotate(byAngle: .pi/2, duration: 0.25))
}
override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) {
turnBasicTop()
}