标签:style blog io color os sp on div log
//让精灵动起来,并改变方向 void EnemyBase::changeDirection(float dt) { auto curr = currPoint(); if(curr->getPositionX() > this->getPosition().x ) { runAction( Animate::create(AnimationCache::getInstance()->getAnimation("runright"))) ; }else{ runAction( Animate::create(AnimationCache::getInstance()->getAnimation("runleft")) ); } }
//敌人前进的动画 void EnemyBase::runFllowPoint() { auto point = currPoint(); setPosition(point->getPosition()); point = nextPoint(); if( point!= NULL ){ runAction(CCSequence::create(MoveTo::create(getRunSpeed(), point->getPosition()) , CallFuncN::create(CC_CALLBACK_0(EnemyBase::runFllowPoint, this)) , NULL)); } }
标签:style blog io color os sp on div log
原文地址:http://www.cnblogs.com/newlist/p/4126526.html