What is a scene?
A scene is basically a collection of different elements such as sprites, sounds, and so on, in a logical way. Suppose we want to make a menu, we'll have to put some buttons, background, and sounds in a manner that is positioned according to our needs.
A Scene
object is a collection of nodes, but a scene itself acts as a node. Imagine a tree of nodes having scene objects as its root. As all nodes in the scene are positioned in defined coordinates, their linkage can be shown as:
Node (Content) → Descendant Node
This linkage of a node with its descendant(s) is very useful. Say, if you rotate a node on the top of the tree, all the nodes will be subsequently rotated.
In technical terms, Scene
is an SKScene
object, which holds an SKNode
object (such as SKSpriteNode
objects for sprites) inside a view (SKView
object), so that we can render and use them. Scene is itself an SKNode
object, which acts as a root node and attaches in an SKView
object. Other objects required for that scene...