The O.G. Virtual learning! Buy one, get 2 more Lifetime Memberships! - Click Here!

Moving to the next level


This topic contains 4 replies, has 2 voices, and was last updated by  Universe 3 years, 1 month ago.

  • April 15, 2018 at 8:27 pm #183030


    I am reading the RPG kit documentation and trying to make a transition to another level.
    I read that PortalTo property can get the player to another level, but at the same time it says that you cannot change the scene. How to understand that we can change level but not scene? The manual also recommends to have separate scene for each level (Grlassland, Dungeon etc). Sharing some light how to manage levels accounting for experience or items collected and using portals would be helpful. Thanks!

  • April 16, 2018 at 2:44 pm #183073

    For others reading this, here’s the docs on it…

    So the PortalTo dictionary has both a Level option and Scene option. You just don’t need to set both because one will get ignored. You have to choose whether you are going to advance to another level scene or jump out of the game entirely and open up a non-level scene (for example, go back to the home menu). So think of it like this…

    Level – another level scene
    Scene – some non-level scene

    Things to keep in mind, anytime you’re changing the scene in SpriteKit you’re going to open another scene one way or another. Could even be opening the same scene again (which is common in any SpriteKit game because thats what happens when a player dies, you usually just restart the same level again).

    The Demo version is really the “Holy Bible” of how this thing all works. The docs elaborate on things, but I think it helps most to just unfold properties in the demo and see firsthand how its put together. And its all searchable too. So in the .plist you could search for PortalTo and see how the portal thats in there goes to the Dungeon level.

    And you’ll notice there’s both a Dungeon.sks file and dictionary in the plist called Dungeon. Thats a key connection right there. The plist contains the data, the sks file contains the visual components. So you’ll always have both (and the .swift files, which you probably don’t ever need to edit, is what combines the two to make the game playable).

    And I’m sure you’ve already noticed if you want to make a scene file just for a particular, you would create an sks file named DungeonPad.sks, DungeonTV.sks, DungeonPhone.sks or DungeonPhoneX.sks . The kit knows to look for that base name with those suffixes.

    • April 16, 2018 at 8:21 pm #183085

      Thanks Justin – yes looking into actual setups and trying things makes thing move into the desirable direction. Just was confusing in wording in the documentation, but maybe it is just me.

  • May 13, 2018 at 11:18 am #183820

    Hi Justin

    I am wondering what else too look for when a portal to does not work. I made a new item linked with class etc and filled out plist as per document guidance, but no luck to move player to the next level this time. Thanks!

  • May 13, 2018 at 8:40 pm #183828

    Sorry, found my mistake in plist hierarchy. Great to see things connecting and kit working. Lets see what pops up next 🙂

You must be logged in to reply to this topic.

Know what an affiliate program is? You make money just by sharing links to our site! Win. Win.

Earn when you refer any buyer here! 30 day tracking. Commissions are 33%-50% and recur on subscription products!

Uh oh, missing your affiliate ID. Create one real quick