public override void onEnter() { base.onEnter(); CCActionInterval move = CCMoveBy.actionWithDuration(3, new CCPoint(350, 0)); CCActionInterval move_back = (CCActionInterval)move.reverse(); CCActionInterval move_ease_in = CCEaseIn.actionWithAction(move.copy() as CCActionInterval, 3); CCActionInterval move_ease_in_back = move_ease_in.reverse() as CCActionInterval; CCActionInterval move_ease_out = CCEaseOut.actionWithAction(move.copy() as CCActionInterval, 3); CCActionInterval move_ease_out_back = move_ease_out.reverse() as CCActionInterval; CCFiniteTimeAction seq1 = CCSequence.actions(move, move_back); CCFiniteTimeAction seq2 = CCSequence.actions(move_ease_in, move_ease_in_back); CCFiniteTimeAction seq3 = CCSequence.actions(move_ease_out, move_ease_out_back); CCAction a2 = m_grossini.runAction(CCRepeatForever.actionWithAction(seq1 as CCActionInterval)); a2.tag = 1; CCAction a1 = m_tamara.runAction(CCRepeatForever.actionWithAction(seq2 as CCActionInterval)); a1.tag = 1; CCAction a = m_kathia.runAction(CCRepeatForever.actionWithAction(seq3 as CCActionInterval)); a.tag = 1; schedule(new SEL_SCHEDULE(testStopAction), 6.0f); }
public override void onEnter() { base.onEnter(); CCActionInterval move = CCMoveBy.actionWithDuration(3, new CCPoint(350, 0)); CCActionInterval move_ease_inout1 = CCEaseInOut.actionWithAction(move.copy() as CCActionInterval, 2.0f); CCActionInterval move_ease_inout_back1 = move_ease_inout1.reverse() as CCActionInterval; CCActionInterval move_ease_inout2 = CCEaseInOut.actionWithAction(move.copy() as CCActionInterval, 3.0f); CCActionInterval move_ease_inout_back2 = move_ease_inout2.reverse() as CCActionInterval; CCActionInterval move_ease_inout3 = CCEaseInOut.actionWithAction(move.copy() as CCActionInterval, 4.0f); CCActionInterval move_ease_inout_back3 = move_ease_inout3.reverse() as CCActionInterval; CCFiniteTimeAction seq1 = CCSequence.actions(move_ease_inout1, move_ease_inout_back1); CCFiniteTimeAction seq2 = CCSequence.actions(move_ease_inout2, move_ease_inout_back2); CCFiniteTimeAction seq3 = CCSequence.actions(move_ease_inout3, move_ease_inout_back3); m_tamara.runAction(CCRepeatForever.actionWithAction(seq1 as CCActionInterval)); m_kathia.runAction(CCRepeatForever.actionWithAction(seq2 as CCActionInterval)); m_grossini.runAction(CCRepeatForever.actionWithAction(seq3 as CCActionInterval)); }
public MenuLayer3() { CCMenuItemFont.FontName = "Arial"; CCMenuItemFont.FontSize = 28; CCLabelBMFont label = CCLabelBMFont.labelWithString("Enable AtlasItem", "fonts/fnt/bitmapFontTest3"); CCMenuItemLabel item1 = CCMenuItemLabel.itemWithLabel(label, this, this.menuCallback2); CCMenuItemFont item2 = CCMenuItemFont.itemFromString("--- Go Back ---", this, this.menuCallback); m_item2 = item2; m_item1 = item1; CCSprite spriteNormal = CCSprite.spriteWithFile(s_MenuItem, new CCRect(0, 23 * 2, 115, 23)); CCSprite spriteSelected = CCSprite.spriteWithFile(s_MenuItem, new CCRect(0, 23 * 1, 115, 23)); CCSprite spriteDisabled = CCSprite.spriteWithFile(s_MenuItem, new CCRect(0, 23 * 0, 115, 23)); CCMenuItemSprite item3 = CCMenuItemSprite.itemFromNormalSprite(spriteNormal, spriteSelected, spriteDisabled, this, this.menuCallback3); m_disabledItem = item3; m_disabledItem.Enabled = false; m_item3 = item3; CCMenu menu = CCMenu.menuWithItems(item1, item2, item3); menu.position = new CCPoint(0, 0); addChild(menu); CCSize s = CCDirector.sharedDirector().getWinSize(); m_item1.position = new CCPoint(s.width / 2 - 150, s.height / 2); m_item2.position = new CCPoint(s.width / 2 - 200, s.height / 2); m_item3.position = new CCPoint(s.width / 2, s.height / 2 - 100); CCJumpBy jump = CCJumpBy.actionWithDuration(3, new CCPoint(400, 0), 50, 4); CCActionInterval spin1 = CCRotateBy.actionWithDuration(3, 360); CCActionInterval spin2 = (CCActionInterval)(spin1.copy()); CCActionInterval spin3 = (CCActionInterval)(spin1.copy()); m_item1.runAction(CCRepeatForever.actionWithAction(spin1)); m_item2.runAction(CCRepeatForever.actionWithAction( (CCActionInterval)(CCSequence.actions(jump, jump.reverse())) ) ); m_item2.runAction(CCRepeatForever.actionWithAction(spin2)); // Augments the jump m_item3.runAction(CCRepeatForever.actionWithAction(spin3)); }
public override void onEnter() { base.onEnter(); centerSprites(2); CCActionInterval act1 = CCRotateTo.actionWithDuration(1, 90); CCActionInterval act2 = CCRotateTo.actionWithDuration(1, 0); CCActionInterval seq = (CCActionInterval)(CCSequence.actions(act1, act2)); CCAction rep1 = CCRepeatForever.actionWithAction(seq); CCActionInterval rep2 = CCRepeat.actionWithAction((CCFiniteTimeAction)(seq.copy()), 10); m_tamara.runAction(rep1); m_kathia.runAction(rep2); }
public override void onEnter() { base.onEnter(); alignSpritesLeft(2); CCActionInterval a1 = CCMoveBy.actionWithDuration(1, new CCPoint(150, 0)); CCActionInterval action1 = CCRepeat.actionWithAction( CCSequence.actions(CCPlace.actionWithPosition(new CCPoint(60, 60)), a1), 3); CCAction action2 = CCRepeatForever.actionWithAction( (CCActionInterval)(CCSequence.actions((CCActionInterval)(a1.copy()), a1.reverse())) ); m_kathia.runAction(action1); m_tamara.runAction(action2); }
public override void onEnter() { base.onEnter(); CCSize s = CCDirector.sharedDirector().getWinSize(); CCSprite sp1 = CCSprite.spriteWithFile(TestResource.s_pPathSister1); CCSprite sp2 = CCSprite.spriteWithFile(TestResource.s_pPathSister2); CCSprite sp3 = CCSprite.spriteWithFile(TestResource.s_pPathSister1); CCSprite sp4 = CCSprite.spriteWithFile(TestResource.s_pPathSister2); sp1.position = (new CCPoint(100, s.height / 2)); sp2.position = (new CCPoint(380, s.height / 2)); addChild(sp1); addChild(sp2); sp3.scale = (0.25f); sp4.scale = (0.25f); sp1.addChild(sp3); sp2.addChild(sp4); CCActionInterval a1 = CCRotateBy.actionWithDuration(2, 360); CCActionInterval a2 = CCScaleBy.actionWithDuration(2, 2); CCAction action1 = CCRepeatForever.actionWithAction( (CCActionInterval)(CCSequence.actions(a1, a2, a2.reverse())) ); CCAction action2 = CCRepeatForever.actionWithAction( (CCActionInterval)(CCSequence.actions( (CCActionInterval)(a1.copy()), (CCActionInterval)(a2.copy()), a2.reverse())) ); sp2.anchorPoint = (new CCPoint(0, 0)); sp1.runAction(action1); sp2.runAction(action2); }
public StressTest2() { CCSize s = CCDirector.sharedDirector().getWinSize(); CCLayer sublayer = CCLayer.node(); CCSprite sp1 = CCSprite.spriteWithFile(TestResource.s_pPathSister1); sp1.position = (new CCPoint(80, s.height / 2)); CCActionInterval move = CCMoveBy.actionWithDuration(3, new CCPoint(350, 0)); CCActionInterval move_ease_inout3 = CCEaseInOut.actionWithAction((CCActionInterval)(move.copy()), 2.0f); CCActionInterval move_ease_inout_back3 = (CCActionInterval)move_ease_inout3.reverse(); CCFiniteTimeAction seq3 = CCSequence.actions(move_ease_inout3, move_ease_inout_back3); sp1.runAction(CCRepeatForever.actionWithAction((CCActionInterval)seq3)); sublayer.addChild(sp1, 1); CCParticleFire fire = CCParticleFire.node(); fire.Texture = (CCTextureCache.sharedTextureCache().addImage("Images/fire")); fire.position = (new CCPoint(80, s.height / 2 - 50)); CCActionInterval copy_seq3 = (CCActionInterval)(seq3.copy()); fire.runAction(CCRepeatForever.actionWithAction(copy_seq3)); sublayer.addChild(fire, 2); schedule((shouldNotLeak), 6.0f); addChild(sublayer, 0, CocosNodeTestStaticLibrary.kTagSprite1); }
public override void onEnter() { base.onEnter(); CCActionInterval move = CCMoveBy.actionWithDuration(3, new CCPoint(350, 0)); CCActionInterval move_back = move.reverse() as CCActionInterval; CCActionInterval move_ease = CCEaseBackInOut.actionWithAction((CCActionInterval)(move.copy())); CCActionInterval move_ease_back = move_ease.reverse() as CCActionInterval; CCFiniteTimeAction seq1 = CCSequence.actions(move, move_back); CCFiniteTimeAction seq2 = CCSequence.actions(move_ease, move_ease_back); this.positionForTwo(); m_grossini.runAction(CCRepeatForever.actionWithAction((CCActionInterval)seq1)); m_tamara.runAction(CCRepeatForever.actionWithAction((CCActionInterval)seq2)); }
public override void onEnter() { base.onEnter(); CCActionInterval move = CCMoveBy.actionWithDuration(3, new CCPoint(350, 0)); CCActionInterval move_back = move.reverse() as CCActionInterval; CCActionInterval move_ease_in = CCEaseBounceIn.actionWithAction((CCActionInterval)(move.copy())); CCActionInterval move_ease_in_back = move_ease_in.reverse() as CCActionInterval; CCActionInterval move_ease_out = CCEaseBounceOut.actionWithAction((CCActionInterval)(move.copy())); CCActionInterval move_ease_out_back = move_ease_out.reverse() as CCActionInterval; CCFiniteTimeAction seq1 = CCSequence.actions(move, move_back); CCFiniteTimeAction seq2 = CCSequence.actions(move_ease_in, move_ease_in_back); CCFiniteTimeAction seq3 = CCSequence.actions(move_ease_out, move_ease_out_back); m_grossini.runAction(CCRepeatForever.actionWithAction((CCActionInterval)seq1)); m_tamara.runAction(CCRepeatForever.actionWithAction((CCActionInterval)seq2)); m_kathia.runAction(CCRepeatForever.actionWithAction((CCActionInterval)seq3)); }
public override void onEnter() { base.onEnter(); float x, y; CCSize size = CCDirector.sharedDirector().getWinSize(); x = size.width; y = size.height; CCSprite sprite = CCSprite.spriteWithFile(s_pPathGrossini); CCSprite spriteSister1 = CCSprite.spriteWithFile(s_pPathSister1); CCSprite spriteSister2 = CCSprite.spriteWithFile(s_pPathSister2); sprite.scale = (1.5f); spriteSister1.scale = (1.5f); spriteSister2.scale = (1.5f); sprite.position = (new CCPoint(x / 2, y / 2)); spriteSister1.position = (new CCPoint(40, y / 2)); spriteSister2.position = (new CCPoint(x - 40, y / 2)); CCAction rot = CCRotateBy.actionWithDuration(16, -3600); addChild(sprite); addChild(spriteSister1); addChild(spriteSister2); sprite.runAction(rot); 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(); spriteSister1.runAction(CCRepeat.actionWithAction(CCSequence.actions(jump2, jump1), 5)); spriteSister2.runAction(CCRepeat.actionWithAction(CCSequence.actions((CCFiniteTimeAction)(jump1.copy()), (CCFiniteTimeAction)(jump2.copy())), 5)); spriteSister1.runAction(CCRepeat.actionWithAction(CCSequence.actions(rot1, rot2), 5)); spriteSister2.runAction(CCRepeat.actionWithAction(CCSequence.actions((CCFiniteTimeAction)(rot2.copy()), (CCFiniteTimeAction)(rot1.copy())), 5)); }