Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I link a .sks file to a .swift file in SpriteKit

Tags:

I saw that in XCode 6 there is a built in level editor. I could not find a lot of documentation on how to use it or how it works, but I was able to figure out how to use it to make SKSpriteNodes then link them to a .swift file using childNodeWithName(). When you make a new SpriteKit project, it starts with a GameScene.swift and a GameScene.sks. I was able to use these to make one level visually, then I could code for it in the GameScene.swift, but when I tried to make my own .sks and .swift file for a new level, I could not connect the .sks and the .swift file I had made. I tried following this tutorial exactly:

http://www.techotopia.com/index.php/An_iOS_8_Swift_Sprite_Kit_Level_Editor_Game_Tutorial#Creating_the_Archery_Scene

When I connected the two files no errors came up, and then when I transitioned to the scene it transitioned properly, but nothing that I added visually to the .sks showed up in the simulator. Please help, I've spent hours researching solutions for this. The very few tutorials and forums that I was able to find about the level editor only talked about the GameScene.swift and .sks that start with a new SpriteKit project.


Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!