swift - GameScene misses initializers -


i error "class 'gamescene' has no initializers" when try add level selection game.

i present scene in gameviewcontroller.swift this:

    override func viewdidload() {     super.viewdidload()      if let scene = gamescene.level(1) {         // configure view.         let skview = self.view as! skview         skview.showsfps = true         skview.showsnodecount = true         skview.showsphysics = true          /* sprite kit applies additional optimizations improve rendering performance */         skview.ignoressiblingorder = true          /* set scale mode scale fit window */         scene.scalemode = .aspectfill          skview.presentscene(scene)     } } 

and in gamescene.swift wanted handle level selection (got ray wenderlich ios game development books)

    class func level(levelnum: int) -> gamescene? {     let scene = gamescene(filenamed: "level\(levelnum)")!     scene.currentlevel = levelnum     scene.scalemode = .aspectfill     return scene } 

but error mentioned , dont know how fix issue :-? there other ways make level selection? have each level 1 sks file, find handy, since enables me lay out levels visually.

any recommendations and/or help? in advance


Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -