Designing levels with the SpriteKit scene editor
The Scene editor is a valuable addition to SpriteKit. Previously, developers would be forced to hard-code positional values or rely on third-party tools or custom solutions for level design. Now, we can lay out our levels directly within Xcode by dragging and dropping sprites. We can create nodes, attach physics bodies and constraints, create physics fields, and edit properties directly from the interface.
Here is a simple example scene you might build by simply clicking and dragging:
In this example, I simply dragged and positioned sprites in the scene. If you are making an unsophisticated game, you can start in the scene editor rather than creating custom classes. By editing physics bodies in the editor, you can even create entire physics-based games in the editor, adding only a few lines of code for the controls.
Complex games require custom logic and texture animation for every object, so we will implement a system in our penguin game that...