@yuye
“EDIT: as advised by dev.loop.2d, I feel I must spend more time and thoroughly go through API and examples… So, as of now, you may ignore my below request”
Hi there. Its been a while since you posted this on forum. But I wanted to share something.
If you can spare the time for making tutorials for us, then here is my kind request.
I started learning basics of game dev. by using Unity engine. I learned and found it easier.
After 2 months of understanding game dev and developing a few games, I wanted to shift to open source community so that I’ve better and root level control of what I am developing. So, I found Cocos2d-x, and found it to be ultra amazing and better than Unity in few aspects for 2D games.
In Unity(both 2D and 3D games), I found it easy to use because there was higher level of abstraction of classes like method Start()(for initializing the game scene), method Update()and FixedUpdate() for regularly updating the game scene and calling different functions.
It has been nearly 3 months but I am struggling a bit in order to have confidence in building my own games. I’ve read the documentation(haven’t gone through API part much). But I am actually able to gain the knowledge of what the different functions do, not the flow control. I’ve read some 2-3 source codes, but I am not able to have a clear idea of it. If you are entertaining any further requests, here is my wish
Can you explain me the cocos2d-x v3.0 scripting architecture by making flow chart of “program flow control in a game” by taking an example of any very very simple game with atleast following components:
1)2 scenes and atleast 1 scene having 2 layers.
2) What are substitutes of Start and Update methods. I am not sure whether init() works is for Start() or works in addition to just Start()
3)Touches.
Note 1: I know how to make use of touch events but don’t understand from where it is getting called again and again. So, in flowchart, you may explain it that what is calling this touch method.
Note 2: I am aware of that who is child of who(Like Scenes,Layers are child of Node,etc) as it is given in documentation.
So, for Unity’s basic 2D game, if I were to explain the control flow, it would be something like: (Without picture): Game is started with a scene(which is explicitly set as main/first scene). The objects in this game scene is initialized through Start(). After it, Update()/FixedUpdate() method is auto called and auto updates the game objects in the current scene by calling different classes and its functions, and by making transitions to other scenes using a particular method. Layers in a particular scenes are actually set through GUI in the ‘layers’ and the objects on the same layer do not collide. We may set z-order of the game objects on the same layer.
I seriously don’t know if my request is worth while. Or else, can you guide me through another way instead of what I requested. I am very much interested in learning and sticking to cocos2d-x.
Thanks for reading so long request. I hope your guidance will take me understand properly.
Thanks again.