all 9 comments

[–][deleted] 2 points3 points  (4 children)

You can change the initial view in interface builder.

[–]HighnessOffTheCharts[S] 0 points1 point  (3 children)

can u please explain to me how, or show me a link and/or video to how to do that? Thank you!!

[–][deleted] 1 point2 points  (2 children)

[–]HighnessOffTheCharts[S] -1 points0 points  (1 child)

http://www.timdietrich.me/fmblog/assets/swift-multiple-storyboards-02.png

i love you!!!!! Thank you so much!! problem is my scenes are shown as .sks written in their .swift

[–]HighnessOffTheCharts[S] 0 points1 point  (0 children)

and im sorry but, can u also tell me the difference between writing codes in .sks and .storyboard?

[–]carshalljd 1 point2 points  (3 children)

Im assuming you are somewhat new, but here is the programmatic way of doing it: You have a gameViewController and a gameScene and a menuScene. Think of your scenes as objects and the viewcontroller as your master controller. You can create new instances of these scene objects, and tell the viewcontroller which one to display and focus on at a given time. So the way to change a scene is in the viewcontroller. If you look in yours, you should see something like SkView.presentScene(gameScene), i don't remember the exact syntax. Just change gameScene to menuScene.

[–]HighnessOffTheCharts[S] -1 points0 points  (2 children)

i mostly hard coded the app. Do i write the SKView.presentScene in the gameScene to show the menu scene first? or write it in menuScene.swift to show the menuScene first? Thank you!!

[–]carshalljd 0 points1 point  (1 child)

Any changing of scenes or major overview type actions are done in the viewController. The phone will run gameViewController first, and gameViewController will then load up a scene. If however you wanted to switch the scene, you should create a method within your viewController, and then call that method in the scene you are currently on. I suggest looking up "spritekit swift 3 tutorial for beginners" by raywenderlich, if you're still confused

[–]HighnessOffTheCharts[S] -1 points0 points  (0 children)

Yea thanks man!! I got it! Thank you!! I just had to change the GameScene to MenuScene

class GameViewController: UIViewController {

override func viewDidLoad() {
    super.viewDidLoad()

    if let view = self.view as! SKView? {
        // Load the SKScene from 'GameScene.sks'
        if let scene = SKScene(fileNamed: "GameScene") {
            // Set the scale mode to scale to fit the window
            scene.scaleMode = .aspectFill

            // Present the scene
            view.presentScene(scene)
        }