0

I have the mechanics of one type of game (a particular puzzle) set-up in one Scene file (mygamescene.swift). I want to stylise the same game differently in two different ways (using different node textures, etc) and show these differently in the game, and have them be accessible from the main screen.

I'm unclear on how to set-up MyGameViewController to present the game scenes differently, using the same game mechanics. Usually it's something like:

  if let scene = GameScene(fileNamed: "mygamescene.swift") {
        // view is set-up here, and presented at the end   
  }

What is the best thing to do here? Do I set-up two different game scenes completely, and then subclass game mechanics in a separate file (and have both game scenes use this)? How do I present each scene differently depending on what is chosen in the menu?

  • first of all `GameScene(fileNamed: "mygamescene.swift")` is invalid. fileNamed only applies to SKS files. 2nd, do you plan on making multiple SKS files? – Knight0fDragon Sep 13 '16 at 14:50

1 Answers1

0

You can create mygamesceneController for resue purpose.

On main controller you can take containerView and add segue for container -to mygamesceneController (as emeded view).

This way you can use mygamesceneController as many places as you want.

Hope this will help you

Kuntal Gajjar
  • 792
  • 6
  • 12