Beispiel #1
0
        /// <summary>
        /// Sets the projectile to the appropriate color based on the firing stage of the psi emitter
        /// </summary>
        /// <param name="elapsedTime">Time passed since last frame</param>
        private void ApplyProjectileColor(EnemyPsiBall projectile)
        {
            switch (numArms)
            {
            case 1:
                projectileColor = Color.DarkViolet;
                break;

            case 2:
                projectileColor.R = (byte)(projectileColor.R - 6 % 255);
                projectileColor.G = projectileColor.B = 0;
                projectile.SetColor(projectileColor);
                break;

            case 3:
                projectileColor.R = (byte)((projectileColor.R + 6));
                projectileColor.G = (byte)((projectileColor.R + 120));
                projectileColor.B = (byte)((projectileColor.R + 200));
                projectile.SetColor(projectileColor);
                break;

            case 4:
                //start random color
                projectileColor.R = (byte)(rand.Next(255));
                projectileColor.G = (byte)(rand.Next(255));
                projectileColor.B = (byte)(rand.Next(255));
                projectile.SetColor(projectileColor);
                break;

            case 5:
                //strobe
                projectile.SetRandom(true);
                break;

            default:
                break;
            }
        }
 /// <summary>
 /// Sets the projectile to the appropriate color based on the firing stage of the psi emitter
 /// </summary>
 /// <param name="elapsedTime">Time passed since last frame</param>
 private void ApplyProjectileColor(EnemyPsiBall projectile)
 {
     switch (numArms)
     {
         case 1:
             projectileColor = Color.DarkViolet;
             break;
         case 2:
             projectileColor.R = (byte)(projectileColor.R - 3 % 255);
             projectileColor.G = projectileColor.B = 0;
             projectile.SetColor(projectileColor);
             break;
         case 3:
             projectileColor.R = (byte)((projectileColor.R + 2));
             projectileColor.G = (byte)((projectileColor.R + 120));
             projectileColor.B = (byte)((projectileColor.R + 200));
             projectile.SetColor(projectileColor);
             break;
         case 4:
             //start random color
             projectileColor.R = (byte)(rand.Next(255));
             projectileColor.G = (byte)(rand.Next(255));
             projectileColor.B = (byte)(rand.Next(255));
             projectile.SetColor(projectileColor);
             break;
         case 5:
             //strobe
             projectile.SetRandom(true);
             break;
         default:
             break;
     }
 }