         
         for enemy in 1...3 {
             for stage in 0...3 {
-                textureMatrix[enemy-1][stage] = atlas.textureNamed("spacesprite\(enemy)-\(stage)")
+                textureMatrix[enemy-1][stage] = textureAtlas.textureNamed("spacesprite\(enemy)-\(stage)")
             }
         }
         

        enemy.yScale = 0.6
        self.addChild(enemy)
        
        enemyList.append(enemy)
        
        // Spawn more enemies
        enemy.run((SKAction.sequence([moveEnemy, waitRandom,SKAction.removeFromParent()])), completion: {

    // MARK: Internal SKNode and texture references
    fileprivate var spinnyNode : SKShapeNode?
    fileprivate var badGuys : SKEmitterNode?
    let textureAtlas = SKTextureAtlas(named: "Enemy Sprite Atlas")
    var textureMatrix = [[SKTexture?]](repeating: [SKTexture?](repeating: nil, count: 4), count: 3)
    var enemyArray = [SKSpriteNode?](repeating: nil, count: 0)
    
    // MARK: Configuration variables.
    let spinnyStuff = UserDefaults.standard.value(forKey: "spinnyStuff") ?? false
