Level Settings

In the Role Playing Games Kit

The Settings dictionary allows you to set some level-specific settings.

  • CameraFollowsPlayer – A Boolean value, YES means the the camera will follow the player, NO would disable the camera following the player. By default this is a YES value.
  • CameraOffset – To offset where the camera is in relation to the player (so it isn’t dead center) enter a string value in { x, y } format. For example, if you entered {0, 100} the camera would still be centered horizontally on the player (zero change), but would be shifted 100 points vertically.  Most likely, you don’t want to adjust this, but you do have that option.
  • ContinuePoint – A Boolean value, YES will save this level and whatever the entry point was as the most recent continue point. The code will also note that this level and entry point have been visited before. This is important if you have a menu screen with buttons that allow the player to jump to a level ONLY if they’ve previously visited it before.
  • DisableAttack – A Boolean value, YES will disable attacking on the level. Perhaps you don’t want players attacking in the safe enemy-free village.
  • LightFollowsPlayer – this is the name of an SKLightNode in the scene that you want to follow the player. For example, in the Dungeon level in the Kit, we set this value to PlayerLight, and you’ll see in the screenshot below where the PlayerLight initially is in the scene. But at runtime, the light stays attached to the player.

Notice the PlayerLight has a Lighting Mask value of 1.  Any object you want to be affected by this light, should also have a Lighting Mask value of 1.  Notice TheCastle has a Lighting Mask of 1 too…


In App Purchase Properties

You can require users purchase access to levels with the following properties…

  • RequiresProduct – a String value for the name of the In-App Product ID (as setup in iTunes Connect) that the user must have already bought to keep playing the level.
  • StoreMenu – a String value for the name of a menu to transition to if the user has not already bought access. Obviously in this menu you should include buttons that allow the user to purchase access to this (or all) levels. The level will automatically transition in 2 seconds.
  • LeavingLevelTitle – a String value for the title of the pop-up alert that displays to tell the user they don’t have access.
  • LeavingLevelMessage – a String value for the main message of the pop-up alert that displays to tell the user they don’t have access.