Study Notes for cocos2d to cocos2d-x (2)

Source: Internet
Author: User

Key points:

  • About random functions: srand and Rand are C standard library functions. For each platform, you can obtain a random number in milliseconds.

Vophone: srand (timgetticks ());

IOS: arc4random (); this can be used directly

Others: srand (unsigned) Time (null ));

  • Boolean:

Object-C-> C ++

Yes-> true

No-> false

  • Callback function:

Object-C: selector: @ selector (spritemovefinished)

SCHEDULE: @ selector (gamelogic)

C ++: schedule_selector (_ selector) function _ selector has only one parameter type, which is cctime.

Callfunc_selector (_ selector) function _ selector has a maximum of one parameter type, which is void.

Callfuncn_selector (_ selector) function _ selector has only one parameter type, which is ccnode *

Callfuncnd_selector (_ selector) function _ selector has two parameter types: ccnode * and void *

There is only one parameter type in the menu_selector (_ selector) function _ selector, Which is ccobject *

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.