public override void OnEnter() { base.OnEnter(); CCSize windowSize = Layer.VisibleBoundsWorldspace.Size; Emitter = new CCParticleFireworks(MidWindowPoint); Background.AddChild(Emitter, 10); Emitter.Texture = CCTextureCache.SharedTextureCache.AddImage(TestResource.s_stars1); SetEmitterPosition(); }
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(bird_pos); //particle.Position = bird_pos; particle.Gravity = new CCPoint(0, -5000); particle.Duration = .3f; AddChild(particle, -1, (int)Tags.Particles); }