Sorry for a newbie question but can someone help with translating this to Swift?
-(instancetype)init
{
self = [super initWithImageNamed:@"character.png"];
{.
self.name = playerName;
self.zPosition = 10;
}
return self;
}
it's for a child of SKSpriteNode
When I try to call super.init(imageNamed: "character.png")
I get an error saying `Must call a designated Initialiser of the superclass SKSpriteNode.
If I try to just write it like this:
init() {
super.init()
self.name = playerName
self.zPosition = 10
}
I get an error in my GameScene when I call:
var player : Player = Player(childNodeWithName(playerName))
I get an error about converting the type to string.