What Scroller2d Handles in a SpriteKit Game
See where LevelEditor, the Swift API, and your game code fit together before you start integrating.
A useful game development tool should make it clear how far it takes you. Scroller2d brings a visual level editor, a shared data model, and reusable SpriteKit helpers together. Desert Ruins shows those pieces in a playable game and supplies examples of the controls and game rules around them.
If you are deciding whether Scroller2d fits your project, start with one level change and follow it through the editor, saved data, and running scene.
LevelEditor defines the level
LevelEditor is where you place backgrounds, ground sections, characters, obstacles, collectibles, and checkpoints. You can inspect properties, adjust positions and sizes, configure supported animation and sound settings, and reuse common object definitions. Those choices are saved as level and catalog data.
Moving a coin on the canvas changes its saved position. A running app receives that change when the updated resource is included in its next build. The Desert Ruins quickstart walks through copying the saved plist into the Xcode project.
The API reads the data and supplies reusable building blocks
The API gives your Swift code models for the editor’s saved configuration. In Desert Ruins, LevelData.swift now uses LevelAssemblyHelper.Resources to decode the level and its object, character, and obstacle catalogs. The assembly helper resolves per-placement overrides and delegates construction to the SDK’s existing node helpers.
Scene and sprite base classes supply shared functionality. AppSharedSceneBase provides lifecycle and physics-contact delegate hooks and a texture cache. CreateObstacleHelper and CreateCharacterHelper create configured nodes. SKAction.manualAnimate builds texture animation actions with frame timing and repetition settings.
The API now includes LevelAssemblyHelper, CreateGroundHelper, and CameraFollowHelper for the recurring loading, terrain, and camera work. Your scene chooses when to call them and how to configure the results. Desert Ruins includes that integration code so you can trace a configured object through to a node on screen.
Follow the responsibilities in Desert Ruins
| Feature | Editor and API | Desert Ruins game code |
|---|---|---|
| Collectibles | Store collectible definitions, images, and positions in the level model. | Create the pickup sprites and bodies, detect collection, remove the node, and update the total. |
| Obstacles and enemies | Provide catalogs, instance properties, and creation helpers. | Use the assembly helper’s catalog resolution, map asset names, set collision categories, and decide damage and defeat behavior. |
| Character animation | Provide frame configuration, cached textures, and animation actions. | Choose idle, run, jump, or slash based on input and gameplay state. |
| Checkpoints | Describe checkpoint placement, artwork, animation, and sound. | Activate the beacon, remember the respawn point, and reset player motion after a death. |
| Scene lifecycle | Forward startup, update, post-physics, and contact events through scene delegates. | Perform movement, camera updates, combat, and state changes in those hooks. |
| Level assembly | Load level and catalogs, merge instance overrides, and create terrain, obstacle, and character nodes with LevelAssemblyHelper. | Choose asset mappings and factories, attach the result, and add player controls and game-specific content. |
| Terrain | Build tiles, angled and stacked surfaces, gaps, collision runs, ground-height lookup, bounds, and end point with CreateGroundHelper. | Choose collision masks and optional surface inset. Define the behavior of hazards through game-specific contacts. |
| Camera and parallax | Follow a target with look-ahead, optional smoothing, axis selection, and bounds using CameraFollowHelper. | Supply visible world dimensions, call the helper after physics, and wrap repeated background tiles. |
| Level completion | Describe the Level End panel, items, positions, text, and sound. | Choose the finish trigger, calculate results, build the panel, and reset the run on replay. |
These are the responsibilities in the downloadable sample. Your own game can use the data models and select the base classes and helpers that fit its design.
Where the time savings come from
You start with a common representation for level elements and helpers for recurring setup. A second obstacle can reference an existing definition. A layout adjustment can stay in the plist. Animation playback can use the same helper across several objects.
That reduces the amount of infrastructure you need to establish before you can test a design. Your Swift code can focus on choices such as jump behavior, attack timing, enemy rules, and how progress should survive a death. The editor makes the placement and configuration work easier to revisit as those choices evolve.
Estimate your integration work with a small experiment
- Run Desert Ruins with the documented setup and license requirements.
- Move one coin in LevelEditor, save, copy the updated level into the demo, and run again.
- Open
LevelData.swiftto trace the loading and asset naming, then inspectGameScene.swiftfor scene assembly and gameplay. - Choose one object from your own game and try representing it with a catalog definition and level placement.
For an existing game, plan how its scene coordinates, asset names, collision categories, and input logic will connect to the loaded models. For a new game, the sample provides a starting scene to adapt as you establish those conventions.
The API’s data models are available without a key. The scene inheritance and runtime helpers use an API key generated through LevelEditor. The Downloads page explains the free editor limits and paid license options.
Try the complete example
Desert Ruins includes the editable workspace, API, and iOS project. Start with the quickstart, then use the focused articles when you want to examine a particular feature.
Where Scroller2d saves work
The largest savings come when a project adds levels or revises them repeatedly. Share one resource loader, one set of base object definitions, and one camera helper. Move a collectible or tune an obstacle on two placements, then check which fields inherit the change. Compare the amount of game code you had to touch. The examples throughout the site show what still belongs in each game.