A Sprite Kit project consists of things usual to any iOS project. It has the AppDelegate
, Storyboard
, and ViewController
classes. It has the usual structure of any iOS application. However, there are differences in ViewController.view
, which has the SKView
class in Storyboard
.
You will handle everything that is related to Sprite Kit in SKView
. This class will render your gameplay elements such as sprites, nodes, backgrounds, and everything else. You can't draw Sprite Kit elements on other views.
It's important to understand that Sprite Kit introduces its own coordinate system. In UIkit, the origin (0,0) is located at the top-left corner, whereas Sprite Kit locates the origin at the bottom-left corner. The reason why this is important to understand is because of the fact that all elements will be positioned relative to the new coordinate system. This system originates from OpenGL, which Sprite Kit uses in implementation.