I'm currently making a game with several levels in Swift. Each level is controlled by its own class that is initialised when the level is to be played. Is it possible to connect all these classes to a single SKScene, and initialise them when wanted?
The scene is called GameScene.sks. Here is some code to illustrate what I mean.
class ChooseLevel:SKScene {
switch level {
case 1:
// switch to class Level01
case 2:
// switch to class Level02
// and so on ...
}
}
So really what I want is that GameScene now ignores ChooseLevel
and for example instead "takes orders" from Level01
. Is this doable?