cocos2d for android - 점점 빠르게, 점점 느리게 레이어를 이동

static class SpriteEase extends SpriteDemo {
        public void onEnter() {
            super.onEnter();
        
            CGSize s = CCDirector.sharedDirector().winSize();
            CCIntervalAction move = CCMoveBy.action(3, CGPoint.make(s.width-130,0));
            CCIntervalAction move_back = move.reverse();
    
            // 점점 느리게
            CCIntervalAction move_ease_in = CCEaseIn.action(move.copy(), 3.0f);
            CCIntervalAction move_ease_in_back = move_ease_in.reverse();
        
            // 점점 빠르게
            CCIntervalAction move_ease_out = CCEaseOut.action(move.copy(), 3.0f);
            CCIntervalAction move_ease_out_back = move_ease_out.reverse();
        
            CCIntervalAction delay = CCDelayTime.action(0.25f);
        
            CCIntervalAction seq1 = CCSequence.actions(move, delay, move_back, delay.copy());
            CCIntervalAction seq2 = CCSequence.actions(move_ease_in, delay.copy(), move_ease_in_back, delay.copy());
            CCIntervalAction seq3 = CCSequence.actions(move_ease_out, delay.copy(), move_ease_out_back, delay.copy());
        
        
            CCAction a2 = grossini.runAction(CCRepeatForever.action(seq1));
            a2.setTag(1);
        
            CCAction a1 = tamara.runAction(CCRepeatForever.action(seq2));
            a1.setTag(1);
        
            CCAction a = kathia.runAction(CCRepeatForever.action(seq3));
            a.setTag(1);
            
            schedule("testStopAction", 6.25f);
        }
        
        public void testStopAction(float dt) {
            unschedule("testStopAction");
            tamara.stopAction(1);
            kathia.stopAction(1);
            grossini.stopAction(1);
        }
        
        public String title() {
            return "EaseIn - EaseOut - Stop";
        }
    }

이 블로그의 인기 게시물

ASP에서 C# 언어로 만든 DLL 호출

안드로이드 스튜디오를 설치 후 필수로 사용되는 플러그인