实现Node的动作,主要分为即时动作和延时动作
+(id) action
-(void) startWithTagert: (id)aTarget
-(void) stop
-(void) isDone
-(void) step
-(void) update
-(void) pause
-(void) unPause
-(BOOL) isRunning
CCActionInterval* moveToAction = CCMoveTo::actionWithDuration(2,ccp(size.width - 50, size.height - 50));
//CCActionInterval是延时动作,与之对应的是CCActionInstant即时动作
//CCMoveTo每次执行都到达指定的地点
//actionWithDuration第一个参数是设置动作的时间(秒),第二个是动作最终的坐标位置
CCActionInterval* moveByAction = CCMoveBy::actionWithDuration(2,ccp(80, 80));
//CCMoveBy每次执行,x坐标增加80,y坐标增加80
CCActionInterval* moveBackAction = moveByAction->reverse();//按相反的方式返回,即x坐标减少80,y坐标减少80
//m_player->runAction(moveToAction);
//m_player->runAction(moveByAction);
//m_player->runAction(moveBackAction);
m_player->runAction(CCSequence::actions(moveByAction, moveBackAction, NULL));