public override void onEnter() { base.onEnter(); // rotate and jump CCActionInterval jump1 = CCJumpBy.actionWithDuration(4, new CCPoint(-400, 0), 100, 4); CCActionInterval jump2 = jump1.reverse() as CCActionInterval; CCActionInterval rot1 = CCRotateBy.actionWithDuration(4, 360 * 2); CCActionInterval rot2 = rot1.reverse() as CCActionInterval; CCFiniteTimeAction seq3_1 = CCSequence.actions(jump2, jump1); CCFiniteTimeAction seq3_2 = CCSequence.actions(rot1, rot2); CCFiniteTimeAction spawn = CCSpawn.actions(seq3_1, seq3_2); CCFiniteTimeAction action = CCRepeatForever.actionWithAction((CCActionInterval)spawn); CCRepeatForever action2 = (CCRepeatForever)(action.copy()); CCRepeatForever action3 = (CCRepeatForever)(action.copy()); m_grossini.runAction(CCSpeed.actionWithAction((CCActionInterval)action, 0.5f)); m_tamara.runAction(CCSpeed.actionWithAction((CCActionInterval)action2, 1.5f)); m_kathia.runAction(CCSpeed.actionWithAction((CCActionInterval)action3, 1.0f)); CCParticleSystem emitter = CCParticleFireworks.node(); emitter.Texture = CCTextureCache.sharedTextureCache().addImage("Images/fire"); addChild(emitter); }
public override void onEnter() { base.onEnter(); // rotate and jump CCActionInterval jump1 = CCJumpBy.actionWithDuration(4, new CCPoint(-400, 0), 100, 4); CCActionInterval jump2 = (CCActionInterval)jump1.reverse(); CCActionInterval rot1 = CCRotateBy.actionWithDuration(4, 360 * 2); CCActionInterval rot2 = (CCActionInterval)rot1.reverse(); CCFiniteTimeAction seq3_1 = CCSequence.actions(jump2, jump1); CCFiniteTimeAction seq3_2 = CCSequence.actions(rot1, rot2); CCFiniteTimeAction spawn = CCSpawn.actions(seq3_1, seq3_2); CCSpeed action = CCSpeed.actionWithAction(CCRepeatForever.actionWithAction((CCActionInterval)spawn), 1.0f); action.tag = EaseTest.kTagAction1; CCAction action2 = (CCAction)(action.copy()); CCAction action3 = (CCAction)(action.copy()); action2.tag = EaseTest.kTagAction1; action3.tag = EaseTest.kTagAction1; m_grossini.runAction(action2); //m_grossini.runAction(CCRepeat.actionWithAction(CCSequence.actions(jump2, jump1), 5)); m_tamara.runAction(action3); m_kathia.runAction(action); this.schedule(new SEL_SCHEDULE(altertime), 1.0f);//:@selector(altertime:) interval:1.0f]; }
public override void OnEnter() { base.OnEnter(); var s = CCDirector.SharedDirector.WinSize; // rotate and jump var jump1 = new CCJumpBy(4, new CCPoint(-s.Width + 80, 0), 100, 4); var jump2 = jump1.Reverse(); var rot1 = new CCRotateBy(4, 360 * 2); var rot2 = rot1.Reverse(); var seq3_1 = CCSequence.FromActions(jump2, jump1); var seq3_2 = CCSequence.FromActions(rot1, rot2); var spawn = CCSpawn.FromActions(seq3_1, seq3_2); var action = new CCSpeed(new CCRepeatForever(spawn), 1.0f); action.Tag = EaseTest.kTagAction1; var action2 = (CCAction)(action.Copy()); var action3 = (CCAction)(action.Copy()); action2.Tag = EaseTest.kTagAction1; action3.Tag = EaseTest.kTagAction1; m_grossini.RunAction(action2); m_tamara.RunAction(action3); m_kathia.RunAction(action); Schedule(altertime, 1.0f); }
public void altertime(float dt) { CCSpeed action1 = (CCSpeed)(m_grossini.getActionByTag(EaseTest.kTagAction1)); CCSpeed action2 = (CCSpeed)(m_tamara.getActionByTag(EaseTest.kTagAction1)); CCSpeed action3 = (CCSpeed)(m_kathia.getActionByTag(EaseTest.kTagAction1)); Random rand = new Random(); action1.speed = rand.Next(1000000) / 1000000.0f * 2; action2.speed = rand.Next(1000000) / 1000000.0f * 2; action3.speed = rand.Next(1000000) / 1000000.0f * 2; }
public override void OnEnter() { base.OnEnter(); var s = Layer.VisibleBoundsWorldspace.Size; // rotate and jump var jump1 = new CCJumpBy(4, new CCPoint(-s.Width + 80, 0), 100, 4); var jump2 = jump1.Reverse(); var rot1 = new CCRotateBy(4, 360 * 2); var rot2 = rot1.Reverse(); var seq3_1 = new CCSequence(jump2, jump1); var seq3_2 = new CCSequence(rot1, rot2); var spawn = new CCSpawn(seq3_1, seq3_2); speedAction1 = new CCSpeed(new CCRepeatForever(spawn), 1.0f); speedAction2 = new CCSpeed(new CCRepeatForever(spawn), 2.0f); speedAction3 = new CCSpeed(new CCRepeatForever(spawn), 0.5f); m_grossini.RunAction(speedAction1); m_tamara.RunAction(speedAction2); m_kathia.RunAction(speedAction3); }