0

I am creating a 2D SpriteKit game in Swift which will have many levels. I want to use multiple .sks files to design each of those levels, but I can't figure out how to link multiple .sks files to one .swift "gamePlay" file. I would also use a .sks file to create the "main menu," which would be a separate .swift "mainMenu" file.

I have looked at the stack overflow post on connecting .sks files to .swift files, but the post only addresses working through the appDelegate and appears to only allow one connection to one .sks file.

I am new to Swift and any help would be much appreciated.

Community
  • 1
  • 1
Michael Berk
  • 705
  • 7
  • 23
  • sks interface itself is very limited, but if you are going to use sks files then you would create scenes, each of which is "connected" to an sks. Then you would use your SKView to manipulate them. It kind of sounds like you are looking to do this with least possible amount of code, which I'm afraid to say won't be the case no matter where you look. – MaxKargin Aug 16 '15 at 03:48
  • Ok thanks for the advice. – Michael Berk Aug 17 '15 at 01:17

1 Answers1

0

To connect .sks files to .swift files, you simply give them the same name. What I was missing was that I needed to create a "Cocoa Touch Class" instead of a new "Swift File." If the class and the .sks file have the same name, they are automatically connected.

Michael Berk
  • 705
  • 7
  • 23