Could anyone theoretically explain how the game loop works in Cocos2D and Objective-C?
If you need me to be more specific about what I'm asking, please read on.
I've got a rudimentary understanding of C, pointers, arrays, conditionals, loops, strings, variables, methods, structs etc... procedural thinking makes sense to me.
Cocos2D tutorials tend to introduce Director, Scenes, Layers, Nodes and Actions, then just dive into writing classes and away they go.
I'm missing something: I'm yet to grasp how the Cocos2D game loop operates - I don't know how Cocos2D decides it's time to go render the screen again then wait again for input/events again each frame.
And if there's a lot going on in the classes, how does this game loop interrupt them to say, "sorry guys, gotta render another frame, hold up a bit". Or similar.
What, when, how and where is Cocos2D instigating each "tick" of the game engine to render etc, and how does a game start itself into this game loop environment - and therefore how does one decide to structure classes and messaging activity within this frame work for any given game design?
If you're looking for an example to explain this, please use the original Asteroids game.