コード例 #1
0
        public static void Smoke(Particle p)
        {
            p.Scale += 0.001f;

            switch (p.State)
            {
                case ParticleState.Attack:
                    p.Alpha = p.AttackValue *0.3f;
                    break;
                case ParticleState.Alive:
                    if(p.Alpha<0.3f) p.Alpha += 0.001f;
                    break;
                case ParticleState.Decay:
                    p.Alpha = 0.3f - (p.DecayValue * 0.3f);
                    break;
            }
        }
コード例 #2
0
 public static void PermaLight(Particle p)
 {
     switch (p.State)
     {
         case ParticleState.Attack:
             p.Alpha = p.AttackValue;
             break;
         case ParticleState.Alive:
             p.Alpha = 1f;
             p.CurrentTime = 0;
             break;
         case ParticleState.Decay:
             p.Alpha = 1f - p.DecayValue;
             break;
     }
 }
コード例 #3
0
 public static void FadeInOut(Particle p)
 {
     switch (p.State)
     {
         case ParticleState.Attack:
             p.Alpha = p.AttackValue;
             break;
         case ParticleState.Alive:
             p.Alpha = 1f;
             break;
         case ParticleState.Decay:
             p.Alpha = 1f - p.DecayValue;
             break;
     }
 }
コード例 #4
0
 public static void FadeLight(Particle p)
 {
     switch (p.State)
     {
         case ParticleState.Attack:
             p.Color = new Color(new Vector3(0.5f+(p.AttackValue*0.5f)));
             break;
         case ParticleState.Alive:
             p.Color = Color.White;
             break;
         case ParticleState.Decay:
             p.Color = new Color(new Vector3(1f - (p.DecayValue * 0.5f)));
             break;
     }
 }
コード例 #5
0
        public void LoadContent(ContentManager content)
        {
            _texParticles = content.Load<Texture2D>("particles");

            for (int i = 0; i < MAX_PARTICLES; i++)
                Particles[i] = new Particle() {State = ParticleState.Done};

            multiplicativeBlend = new BlendState();

            multiplicativeBlend.ColorDestinationBlend = Blend.SourceColor;
            multiplicativeBlend.ColorSourceBlend = Blend.DestinationColor;
            //multiplicativeBlend.AlphaSourceBlend = Blend.One;
            //multiplicativeBlend.AlphaDestinationBlend = Blend.SourceAlpha;
            //multiplicativeBlend.AlphaBlendFunction = BlendFunction.Add;
            //multiplicativeBlend.ColorBlendFunction = BlendFunction.Add;
        }