Forgive me, I might have asked this before, but it hit me in a different manner, and am still learning Swift
In my main scene I can easily initialize a node and then manipulate it as I like:
let myGSlot = SKSpriteNode(color : .green, size: CGSize(width: 100.0, height: 100.0))
However when I try to subclass it:
class GuessSlot : SKSpriteNode{
init(color: SKColor, size: CGSize) {
super.init()
}
required init?(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
No matter what I do, the editor gives me many errors. The main one being:
Must call a designated initializer of the superclass 'SKSpriteNode' Whether I put it in init() or super.init()
I know I'm new to Swift, but this is killing me!
********* latest update and the only way I can get it to compiles but still crashes with the error:
Thread 1: EXC_BAD_ACCESS (code=2, address=0x7ffeec64aff0)
In the debugger I can see that zero values are coming in for the parameters
convenience init(color: SKColor, size: CGSize) {
self.init(color: color, size: size)
}
I do feel less stupid when I see all the threads out there with confusion over this info