方法:在3d动作后,删除该精灵,创建一个新的精灵 .h-------------------- void newSprite(float dt); .cpp----------------CCActionInterval *shaky=CCShaky3D::create(2, CCSizeMake(4,4),4, 0); pSprite->runAction(CCSequence::create(shaky,shaky->reverse(),NULL)); this->addChild(pSprite, 0, 100); this->schedule(schedule_selector(HelloWorld::newSprite),2); void HelloWorld::newSprite(float dt){ this->removeChildByTag(100); CCSprite *newSprite = CCSprite::create("HelloWorld.png"); this->addChild(newSprite,0); newSprite->setPosition(ccp(visibleSize.width/2 , visibleSize.height/2 )); this->unschedule(schedule_selector(HelloWorld::newSprite)); } |