Пример #1
0
        protected override Particle GenerateParticle()
        {
            float rndX = (float)random.NextDouble() * random.Next(-5, 5);
            float rndY = (float)random.NextDouble() * random.Next(-5, 5);

            Particle particle = new Particle(this, image, position, new Vector2(rndX, -rndY), random.Next(DefaultParticlesLife));
            particle.Color = color;
            particle.Zoom = 0.3f;
            return particle;
        }
Пример #2
0
        private void CreateRocket()
        {
            float rndX = (float)random.NextDouble() * random.Next(-5, 5);
            float rndY = 8;//(float)(Random.NextDouble() + 2.0f) * 4;

            Particle particle = new Particle(this, image, position, new Vector2(rndX, -rndY), 0);
            particle.Color = color;
            particle.Zoom = 0.2f;
            particles.Add(particle);
        }
Пример #3
0
        protected override Particle GenerateParticle()
        {
            float rndX = (float)random.NextDouble() * random.Next(-5, 5);
            float rndY = (float)random.NextDouble() * random.Next(-5, 5);

            //Vector2 circle = new Vector2((float)Math.Cos(Math.PI * 2 * iParticles.Count / DefaultParticlesNumber),
            //           ((float)Math.Sin(Math.PI * 2 * iParticles.Count / DefaultParticlesNumber)/2)-0.75f);

            Particle particle = new Particle(this, image, position, new Vector2(rndX, -rndY), random.Next(DefaultParticlesLife));
            particle.Color = color;
            particle.Zoom = 0.4f;
            return particle;
        }
Пример #4
0
 protected void ResetParticle(Particle particle)
 {
     particle.Position = position;
     particle.Velocity = velocity();
     particle.Life = random.Next(DefaultParticlesLife);
 }
Пример #5
0
 protected override Particle GenerateParticle()
 {
     Particle particle = new Particle(this, image, position, velocity(), random.Next(DefaultParticlesLife));
     particle.Color = color;
     particle.Zoom = 0.5f;
     return particle;
 }