コード例 #1
0
ファイル: Explosion.cs プロジェクト: Dahrkael/CoRe
        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
ファイル: Firework.cs プロジェクト: Dahrkael/CoRe
        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
ファイル: Firework.cs プロジェクト: Dahrkael/CoRe
        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
ファイル: Fountain.cs プロジェクト: Dahrkael/CoRe
 protected void ResetParticle(Particle particle)
 {
     particle.Position = position;
     particle.Velocity = velocity();
     particle.Life = random.Next(DefaultParticlesLife);
 }
コード例 #5
0
ファイル: Fountain.cs プロジェクト: Dahrkael/CoRe
 protected override Particle GenerateParticle()
 {
     Particle particle = new Particle(this, image, position, velocity(), random.Next(DefaultParticlesLife));
     particle.Color = color;
     particle.Zoom = 0.5f;
     return particle;
 }