2012. 11. 27. 12:10

void SpriteEaseElasticInOut::onEnter()

{

    EaseSpriteDemo::onEnter();

    

    CCSize s = CCDirector::sharedDirector()->getWinSize();

    

    CCActionInterval* move = CCMoveBy::create(3, CCPointMake(s.width-130, 0));


    CCActionInterval* move_ease_inout1 = CCEaseElasticInOut::create((CCActionInterval*)(move->copy()->autorelease()), 0.3f);

    CCActionInterval* move_ease_inout_back1 = move_ease_inout1->reverse();

    

    CCActionInterval* move_ease_inout2 = CCEaseElasticInOut::create((CCActionInterval*)(move->copy()->autorelease()), 0.45f);

    CCActionInterval* move_ease_inout_back2 = move_ease_inout2->reverse();

    

    CCActionInterval* move_ease_inout3 = CCEaseElasticInOut::create((CCActionInterval*)(move->copy()->autorelease()), 0.6f);

    CCActionInterval* move_ease_inout_back3 = move_ease_inout3->reverse();

    

    CCDelayTime *delay = CCDelayTime::create(0.25f);

        

    CCFiniteTimeAction* seq1 = CCSequence::create(move_ease_inout1, delay, move_ease_inout_back1, CCCA(delay), NULL);

    CCFiniteTimeAction* seq2 = CCSequence::create(move_ease_inout2, CCCA(delay), move_ease_inout_back2, CCCA(delay), NULL);

    CCFiniteTimeAction* seq3 = CCSequence::create(move_ease_inout3, CCCA(delay), move_ease_inout_back3, CCCA(delay), NULL);

    

    m_tamara->runAction( CCRepeatForever::create((CCActionInterval*)seq1));

    m_kathia->runAction( CCRepeatForever::create((CCActionInterval*)seq2));

    m_grossini->runAction( CCRepeatForever::create((CCActionInterval*)seq3)); 

}

Posted by Нуеоп