Пример #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);
        }
Пример #2
0
        public GameScene(CCGameView gameView) : base(gameView)
        {
            layer = new GameLayer();
            this.AddLayer(layer);

            fireworks     = new CCParticleFireworks(CCPoint.Zero);
            explosion     = new CCParticleExplosion(CCPoint.Zero);
            startLocation = CCPoint.Zero;

            fireworks.StartColor = new CCColor4F(CCColor3B.Yellow);
            fireworks.Position   = new CCPoint(App.ScreenWidth / 1.5f, App.ScreenHeight / 1.5f);
            layer.AddChild(fireworks);

            explosion.StartColor = new CCColor4F(CCColor3B.Red);
            explosion.EndColor   = new CCColor4F(CCColor3B.Black);
            explosion.Position   = new CCPoint(App.ScreenWidth / 3f, App.ScreenHeight / 3f);

            layer.AddChild(explosion);

            //Device.StartTimer(TimeSpan.FromMilliseconds(2000), HandleFunc);

            var touchEvent = new CCEventListenerTouchOneByOne();

            touchEvent.OnTouchBegan = (CCTouch arg1, CCEvent arg2) => {
                CCPoint newLocation =
                    new CCPoint(arg1.LocationOnScreen.X * xRatio, App.ScreenHeight - arg1.LocationOnScreen.Y * yRatio);
                startLocation = newLocation;
                return(HandleFunc());
            };
            // AddEventListener(touchEvent);
        }
Пример #3
0
        public override void onEnter()
        {
            base.onEnter();

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

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

            setEmitterPosition();
        }
Пример #4
0
        //draws our particle effects in the view
        public void DrawParticle(CCPoint point)
        {
            var explosion = new CCParticleFireworks(CCPoint.Zero)
            {
                TotalParticles = 10,
                StartColor     = new CCColor4F(CCColor3B.White),
                EndColor       = new CCColor4F(CCColor3B.Black),
                Position       = new CCPoint(point.X, point.Y)
            };

            _layer.AddChild(explosion);
        }
Пример #5
0
        void Jump()
        {
            bird_vel.Y = 400.0f + Math.Abs(bird_vel.X);

            var old_part = GetChildByTag((int)Tags.Particles);

            if (old_part != null)
            {
                RemoveChild(old_part, true);
            }

            var particle = new CCParticleFireworks();

            particle.Position = bird_pos;
            particle.Gravity  = new CCPoint(0, -5000);
            particle.Duration = .3f;
            AddChild(particle, -1, (int)Tags.Particles);
        }
Пример #6
0
        void Jump()
        {
            bird_vel.Y = 400.0f + Math.Abs(bird_vel.X);

            var old_part = GetChild((int)Tags.Particles);

            if (old_part != null)
            {
                Remove(old_part, true);
            }

            var particle = new CCParticleFireworks()
            {
                Position = bird_pos,
                Gravity  = new CGPoint(0, -5000),
                Duration = .3f,
            };

            Add(particle, -1, (int)Tags.Particles);
        }
Пример #7
0
 public static new CCParticleFireworks Create()
 {
     var ret = new CCParticleFireworks();
     ret.InitWithTotalParticles(1500);
     return ret;
 }
Пример #8
0
        void Jump()
        {
            bird_vel.Y = 400.0f + Math.Abs(bird_vel.X);

            var old_part = GetChild((int)Tags.Particles);
            if (old_part!=null)
                Remove(old_part,true);

            var particle = new CCParticleFireworks() {
                Position = bird_pos,
                Gravity = new PointF(0,-5000),
                Duration = .3f,
            };
            Add (particle,-1,(int)Tags.Particles);
        }