Ejemplo n.º 1
0
        public override void onEnter()
        {
            base.onEnter();

            m_background.parent.removeChild(m_background, true);
            m_background = null;

            CCParallaxNode p = CCParallaxNode.node();

            addChild(p, 5);

            CCSprite p1 = CCSprite.spriteWithFile(TestResource.s_back3);
            CCSprite p2 = CCSprite.spriteWithFile(TestResource.s_back3);

            p.addChild(p1, 1, new CCPoint(0.5f, 1), new CCPoint(0, 0));
            p.addChild(p2, 2, new CCPoint(1.5f, 1), new CCPoint(0, 0));

            m_emitter = CCParticleFlower.node();

            m_emitter.Texture = CCTextureCache.sharedTextureCache().addImage(TestResource.s_fire);

            p1.addChild(m_emitter, 10);
            m_emitter.position = new CCPoint(250, 200);

            CCParticleSun par = CCParticleSun.node();

            p2.addChild(par, 10);
            par.Texture = CCTextureCache.sharedTextureCache().addImage(TestResource.s_fire);

            CCActionInterval   move      = CCMoveBy.actionWithDuration(4, new CCPoint(300, 0));
            CCFiniteTimeAction move_back = move.reverse();
            CCFiniteTimeAction seq       = CCSequence.actions(move, move_back);

            p.runAction(CCRepeatForever.actionWithAction((CCActionInterval)seq));
        }
Ejemplo n.º 2
0
        public override void onEnter()
        {
            base.onEnter();

            m_emitter = CCParticleSun.node();
            m_background.addChild(m_emitter, 10);

            m_emitter.Texture = CCTextureCache.sharedTextureCache().addImage(TestResource.s_fire);

            setEmitterPosition();
        }
Ejemplo n.º 3
0
        void shouldNotCrash(float dt)
        {
            unschedule((shouldNotCrash));

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

            // if the node has timers, it crashes
            CCNode explosion = CCParticleSun.node();

            ((CCParticleSun)explosion).Texture = (CCTextureCache.sharedTextureCache().addImage("Images/fire"));

            // if it doesn't, it works Ok.
            //	CocosNode *explosion = [Sprite spriteWithFile:@"grossinis_sister2.png");

            explosion.position = new CCPoint(s.width / 2, s.height / 2);

            runAction(CCSequence.actions(
                          CCRotateBy.actionWithDuration(2, 360),
                          CCCallFuncN.actionWithTarget(this, (removeMe))
                          ));

            addChild(explosion);
        }