开始学习Cocos2D-x
在cocos2d-x中提供了好几个定时器的方法供调用我们可以在CCNode.h 这个头文件中找到相应的方法,下面整理一下:
(1)使用下面这个方法,那么节点在每一帧都会执行update方法。
/**
* Schedules the "update" method.
*
* It will use the order number 0. This method will be called every frame.
* Scheduled methods with a lower order value will be called before the ones that have a higher order value.
* Only one "update" method could be scheduled per node.
*/
void scheduleUpdate(void);
在注释中说到,该方法的order(优先级数)为0,order(优先级数)越小那么越先调度。每一个节点都只能有一个update调度方法。
注意要重写该update方法。
/*
* Update method will be called automatically every frame if "scheduleUpdate&#