Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        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];
        }
Ejemplo n.º 3
0
        public IntervalLayer()
        {
            m_time0 = m_time1 = m_time2 = m_time3 = m_time4 = 0.0f;

            CCSize s = CCDirector.sharedDirector().getWinSize();

            // sun
            //CCParticleSystem sun = CCParticleSun.node();
            //sun.Texture = CCTextureCache.sharedTextureCache().addImage("Images/fire");
            //sun.position = (new CCPoint(s.width - 32, s.height - 32));

            ////sun.setTotalParticles(130);
            //sun.Life = (0.6f);
            //this.addChild(sun);

            // timers
            m_label0 = CCLabelBMFont.labelWithString("0", "fonts/fnt/bitmapFontTest4");
            m_label1 = CCLabelBMFont.labelWithString("0", "fonts/fnt/bitmapFontTest4");
            m_label2 = CCLabelBMFont.labelWithString("0", "fonts/fnt/bitmapFontTest4");
            m_label3 = CCLabelBMFont.labelWithString("0", "fonts/fnt/bitmapFontTest4");
            m_label4 = CCLabelBMFont.labelWithString("0", "fonts/fnt/bitmapFontTest4");

            base.scheduleUpdate();
            schedule(step1);
            schedule(step2, 0);
            schedule(step3, 1.0f);
            schedule(step4, 2.0f);

            m_label1.position = new CCPoint(s.width * 2 / 6, s.height / 2);
            m_label2.position = new CCPoint(s.width * 3 / 6, s.height / 2);
            m_label3.position = new CCPoint(s.width * 4 / 6, s.height / 2);
            m_label4.position = new CCPoint(s.width * 5 / 6, s.height / 2);

            addChild(m_label0);
            addChild(m_label1);
            addChild(m_label2);
            addChild(m_label3);
            addChild(m_label4);

            // Sprite
            CCSprite sprite = CCSprite.spriteWithFile(s_pPathGrossini);

            sprite.position = new CCPoint(40, 50);

            CCJumpBy jump = CCJumpBy.actionWithDuration(3, new CCPoint(s.width - 80, 0), 50, 4);

            addChild(sprite);
            sprite.runAction(CCRepeatForever.actionWithAction(
                                 (CCActionInterval)(CCSequence.actions(jump, jump.reverse()))
                                 )
                             );
            // pause button
            CCMenuItem item1 = CCMenuItemFont.itemFromString("Pause", this, onPause);
            CCMenu     menu  = CCMenu.menuWithItems(item1);

            menu.position = new CCPoint(s.width / 2, s.height - 50);

            addChild(menu);
        }
Ejemplo n.º 4
0
        public Atlas4()
        {
            m_time = 0;

            // Upper Label
            CCLabelBMFont label = CCLabelBMFont.labelWithString("Bitmap Font Atlas", "fonts/fnt/bitmapFontTest");

            addChild(label);

            CCSize s = CCDirector.sharedDirector().getWinSize();

            label.position    = new CCPoint(s.width / 2, s.height / 2);
            label.anchorPoint = new CCPoint(0.5f, 0.5f);


            CCSprite BChar = (CCSprite)label.getChildByTag(0);
            CCSprite FChar = (CCSprite)label.getChildByTag(7);
            CCSprite AChar = (CCSprite)label.getChildByTag(12);


            CCActionInterval rotate    = CCRotateBy.actionWithDuration(2, 360);
            CCAction         rot_4ever = CCRepeatForever.actionWithAction(rotate);

            CCActionInterval   scale       = CCScaleBy.actionWithDuration(2, 1.5f);
            CCFiniteTimeAction scale_back  = scale.reverse();
            CCFiniteTimeAction scale_seq   = CCSequence.actions(scale, scale_back);
            CCAction           scale_4ever = CCRepeatForever.actionWithAction((CCActionInterval)scale_seq);

            CCActionInterval jump       = CCJumpBy.actionWithDuration(0.5f, new CCPoint(), 60, 1);
            CCAction         jump_4ever = CCRepeatForever.actionWithAction(jump);

            CCActionInterval   fade_out   = CCFadeOut.actionWithDuration(1);
            CCActionInterval   fade_in    = CCFadeIn.actionWithDuration(1);
            CCFiniteTimeAction seq        = CCSequence.actions(fade_out, fade_in);
            CCAction           fade_4ever = CCRepeatForever.actionWithAction((CCActionInterval)seq);

            BChar.runAction(rot_4ever);
            BChar.runAction(scale_4ever);
            FChar.runAction(jump_4ever);
            AChar.runAction(fade_4ever);


            // Bottom Label
            CCLabelBMFont label2 = CCLabelBMFont.labelWithString("00.0", "fonts/fnt/bitmapFontTest");

            addChild(label2, 0, (int)TagSprite.kTagBitmapAtlas2);
            label2.position = new CCPoint(s.width / 2.0f, 80);

            CCSprite lastChar = (CCSprite)label2.getChildByTag(3);

            lastChar.runAction((CCAction)(rot_4ever.copy()));

            //schedule( schedule_selector(Atlas4::step), 0.1f);
            base.schedule(step, 0.1f);
        }
Ejemplo n.º 5
0
        public override void onEnter()
        {
            base.onEnter();

            alignSpritesLeft(1);

            CCActionInterval   jump   = CCJumpBy.actionWithDuration(2, new CCPoint(300, 0), 50, 4);
            CCFiniteTimeAction action = CCSequence.actions(jump, jump.reverse());

            m_grossini.runAction(action);
        }
Ejemplo n.º 6
0
        public override void onEnter()
        {
            base.onEnter();

            alignSpritesLeft(1);

            CCAction action = CCSpawn.actions(
                CCJumpBy.actionWithDuration(2, new CCPoint(300, 0), 50, 4),
                CCRotateBy.actionWithDuration(2, 720));

            m_grossini.runAction(action);
        }
Ejemplo n.º 7
0
        public override void onEnter()
        {
            base.onEnter();

            centerSprites(3);

            CCActionInterval   actionTo     = CCJumpTo.actionWithDuration(2, new CCPoint(300, 300), 50, 4);
            CCActionInterval   actionBy     = CCJumpBy.actionWithDuration(2, new CCPoint(300, 0), 50, 4);
            CCActionInterval   actionUp     = CCJumpBy.actionWithDuration(2, new CCPoint(0, 0), 80, 4);
            CCFiniteTimeAction actionByBack = actionBy.reverse();

            m_tamara.runAction(actionTo);
            m_grossini.runAction(CCSequence.actions(actionBy, actionByBack));
            m_kathia.runAction(CCRepeatForever.actionWithAction(actionUp));
        }
Ejemplo n.º 8
0
        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));
        }
Ejemplo n.º 9
0
        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));
        }
Ejemplo n.º 10
0
 public override CCFiniteTimeAction reverse()
 {
     return(CCJumpBy.actionWithDuration(m_fDuration, CCPointExtension.ccp(-m_delta.x, -m_delta.y), m_height, m_nJumps));
 }