Basic knowledge of Cocos2d-x: game flow control, Scene, layer, Genie 1, Scene and flow control Scene (Scene): relatively unchanged content of the element set called Flow Control (flowcontrol ): the game switching process between scenes is called Process Control in the Cocos2d-x, the realization of the scene is CCScene. 2. layer-by-layer subordinate scenarios
Basic knowledge of Cocos2d-x: game flow control, Scene, layer, Genie 1, Scene and flow control Scene (Scene): relatively unchanged content of the element set called flow control (flow control ): the game switching process between scenes is called Process Control in the Cocos2d-x, the realization of the scene is CCScene. 2. The layer belongs to the scenario
Basic knowledge of Cocos2d-x: Game process control, scene, layer, genie
1. scenario and Process Control
Scene: a set of elements whose content is relatively unchanged is called a Scene.
Flow control: process control refers to the process of switching between scenarios.
In Cocos2d-x, the implementation of the scenario is CCScene.
2. Layer
The layer belongs to the game elements under the scenario. A complex scenario involves multiple previous scenes, and a layer displays some visual elements.
The implementation of the layer is CCLayer.
3. Genie
Layers and scenes are containers of other game elements. If you don't want them to add visible game elements, they are transparent. Different from the layer and scenario, the genie belongs to the layer and is a visible image in the scenario.
The essence of implementation in Cocos2d-x is CCSprite
4. nodes and rendering tree
Node: each element in the graph is called a node.
Rendering tree: the relational graph. The Relational Graph essentially specifies the plotting method of the elements. The rendering process is the process of traversing the rendering tree.
5. In the Cocos2d-x, the action is implemented by the CCAction class, the continuous action class CCActionInterval and the instantaneous action class CCActionInstant derived from the CCAction class. All actions take one of the above two classes. You can create multiple frames in the Cocos2d-x to create the Frame Animation Sequence CCAnimation, and create the Frame Animation Sequence of the genie.