1. Create a project
The installation and creation methods are described in the README. md file in the cocos2dx directory.
1, download the cocos2dx-3.0 source code on the official website, http://www.cocos2d-x.org/
2. Install python2.7
3. run setup. py to install
4. Run cocos new helloworld-p helloworld-l cpp to generate a new project.
2. What is included in the new project
-Classes
AppDelegate. cpp ----- Where the game actually starts to run
AppDelegate. h
HelloWorldScene. cpp ------ scenario class
HelloWorldScene. h
-Win32
Main. cpp --------- main entry of the program. There is nothing in it, just call Application: getInstance ()-> run ()
Main. h
-Cocos2d ------------- engine source code
-Resources ------------- Resources
3. Procedures
As shown above, the program starts to run from main and then calls Application: getInstance ()-> run ().
In the Application: run () function, call applicationDidFinishLaunching () and enter the main loop.
In the AppDelegate: applicationDidFinishLaunching () function, create a window, set opengl and ctor, and then throw HelloWorld of the first scenario to director,
The entire game begins with the HelloWorld scenario.