I have a component:
class Test: GKComponent {
override init() {
super.init()
print("init ran")
}
required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
print("coder init ran")
}
}
I also have a subclass:
class Testing: SKSpriteNode {
required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
}
}
So in my scene editor, I have a sprite. In the editor I subclass it to Testing.
Also in the scene editor I add the component Test.
When I run the project, it runs fine, and it prints both print statements in the Component subclass.
Why does it use both init functions and how do I get it to use only 1?
How would I add something in this component like an action or something... Say I want the sprite to rotate for example? How would I do this?
Thank you for any help...