Cocos2d-x uses the concept of a
Director, just like in a movie! The
controls the flow of operations and tells the necessary recipient what to do.
Think of yourself as the Executive Producer and you tell the
to do! One common
Director task is to control
Scene replacements and
Director is a shared singleton (effectively, there's only one
instance of the class at a time) object that you can call from anywhere in your
Here is an example of a typical game flow. The
Director takes care of
transitioning through this as your game criteria decides:
You are the director of your game. You decide what happens, when and how. Take charge!