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";
}
}
댓글
댓글 쓰기