Cocos2dx Game Development Study Notes 2-starting from helloworld

Source: Internet
Author: User

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.



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.