coolsharp의 놀이터

    static class SpriteEaseInOut extends SpriteDemo {
        public void onEnter()
        {
            super.onEnter();
       
            // 윈도우 크기 지정
            CGSize s = CCDirector.sharedDirector().winSize();
            // 5초동안 화면 크기 만큼 이동
            CCIntervalAction move = CCMoveBy.action(5, CGPoint.make(s.width,0));
       
            // 서서히 빨라졌다 다시 서서히 느려지는 액션 값을 2.0f로 셋팅
            CCIntervalAction move_ease_inout1 = CCEaseInOut.action(move.copy(), 2.0f);
            CCIntervalAction move_ease_inout_back1 = move_ease_inout1.reverse();
       
            // 서서히 빨라졌다 다시 서서히 느려지는 액션 값을 3.0f로 셋팅
            CCIntervalAction move_ease_inout2 = CCEaseInOut.action(move.copy(), 3.0f);
            CCIntervalAction move_ease_inout_back2 = move_ease_inout2.reverse();
       
            // 서서히 빨라졌다 다시 서서히 느려지는 액션 값을 4.0f로 셋팅
            CCIntervalAction move_ease_inout3 = CCEaseInOut.action(move.copy(), 4.0f);
            CCIntervalAction move_ease_inout_back3 = move_ease_inout3.reverse();
       
            // 0.25f 딜레이
            CCIntervalAction delay = CCDelayTime.action(0.25f);
       
            // 액션 대입
            CCIntervalAction seq1 = CCSequence.actions(move_ease_inout1, delay, move_ease_inout_back1, delay.copy());
            CCIntervalAction seq2 = CCSequence.actions(move_ease_inout2, delay.copy(), move_ease_inout_back2, delay.copy());
            CCIntervalAction seq3 = CCSequence.actions(move_ease_inout3, delay.copy(), move_ease_inout_back3, delay.copy());
       
            // 액션 시작
            tamara.runAction(CCRepeatForever.action(seq1));
            kathia.runAction(CCRepeatForever.action(seq2));
            grossini.runAction(CCRepeatForever.action(seq3));
        }
       
        public String title() {
            return "EaseInOut and rates";
        }
    }

Posted by coolsharp_backup