All articles

Run and edit Desert Ruins

Run the iOS sample, move a coin in LevelEditor, and replay the first jump to see your change in SpriteKit.

1. Run the iOS demo

  1. Unzip the download and keep the three folders inside Resources together. The Xcode project finds the bundled API through a relative path.
  2. Open Desert Ruins iOS Demo/DesertRuins.xcodeproj. Select the DesertRuins scheme and an iPhone simulator, then choose Product → Run.
  3. Move right, jump over the crate, and pass the beacon. Press Jump near the edge of the first gap while moving right. Notice where the coin is during the jump.

2. Move the coin in LevelEditor

  1. In LevelEditor, select the extracted Desert Ruins Workspace folder and open Levels/DesertRuins.plist.
  2. Select the coin above the first gap, drag it higher, and press ⌘S.

Watch the coin-editing demo

3. Copy the saved level and replay the jump

To apply just the coin edit, run this in Terminal from the extracted Resources folder.

cp "Desert Ruins Workspace/Levels/DesertRuins.plist" "Desert Ruins iOS Demo/DesertRuins/Levels/DesertRuins.plist"

Run the app again in Xcode and repeat the first jump. The coin should appear at the new height.

Where the demo uses the Scroller2d API

In DesertRuins/LevelData.swift, the demo builds a URL for the bundled Levels/DesertRuins.plist and calls the API to decode it. The throwing resources initializer loads the level and its catalogs.

try LevelAssemblyHelper.Resources(levelURL: levelURL, obstacleURL: obstacleURL, characterURL: characterURL, objectURL: objectURL)

The resources initializer selects the first level by default and exposes the decoded catalogs. The URL variables above point to the bundled level and catalog files. In DesertRuins/GameScene.swift, GameScene subclasses AppSharedSceneBase and sets customDelegate and contactDelegate to receive scene lifecycle and physics contact events. The demo now uses LevelAssemblyHelper for assembly and catalog overrides, CreateGroundHelper for terrain and collision surfaces, and CameraFollowHelper for camera following and limits. Assembly delegates node construction to CreateObstacleHelper and the configured guardian factory. Player controls, pickups, parallax, combat, checkpoint state, and results remain in the demo. Use the updated API bundled with this sample because older binaries do not contain these helpers.

Where Scroller2d saves work

One coin edit is a quick way to see the workflow. Move the coin in LevelEditor, sync the level, and run the same Swift code again. A designer can repeat that loop for placement changes without adding new coordinates to the scene source. The iOS sample still needs a rebuild after syncing the bundled files.