     
     var cameraRect: CGRect {
         return CGRect(x: getCameraPosition().x - size.width / 2 + (size.width - playableRect.width) / 2,
-                      y: getCameraPosition().y - size.height / 2 + (size.width - playableRect.height) / 2,
+                      y: getCameraPosition().y - size.height / 2 + (size.height - playableRect.height) / 2,
                       width: playableRect.width, height: playableRect.height)
     }
     

    }
    
    func setCameraPosition(position: CGPoint) {
        cameraNode.position = CGPoint(x: position.x, y: position.y - overlapAmount() / 2)
    }
    
    func backgroundNode() -> SKSpriteNode {

    func spawnEnemy() {
        let enemy = SKSpriteNode(imageNamed: "enemy")
        enemy.name = "enemy"
        enemy.position = CGPoint(x: cameraRect.origin.x + cameraRect.width + enemy.size.width/2,
                                 y: CGFloat.random(
                                    min: CGRectGetMinY(cameraRect) + enemy.size.height/2,
                                    max: CGRectGetMaxY(cameraRect) - enemy.size.height/2))
        enemy.zPosition = 51
        
        addChild(enemy)
        let actionMove = SKAction.moveByX(-cameraRect.width, y: 0, duration: 2.0)
        let actionRemove = SKAction.removeFromParent()
        enemy.runAction(SKAction.sequence([actionMove, actionRemove]))
    }
