Esempio n. 1
0
        /// <summary>
        /// 生成粒子,提供坐标,以及产生概率
        /// </summary>
        /// <param name="position">产生的粒子的坐标</param>
        /// <param name="chance">产生的粒子的概率</param>
        public void AddParticle(Vector2D position, float chance = 0.3f)
        {
            double result = random.NextDouble();

            if (result < chance)
            {
                if (Usevisible_lenth)
                {
                    particle p = new BreakPoint(texturemanager, random, color, position, visible_lenth);
                    particles_toAdd.Add(p);
                }
                else
                {
                    particle p = new BreakPoint(texturemanager, random, color, position);
                    particles_toAdd.Add(p);
                }
            }
        }
Esempio n. 2
0
 /// <summary>
 /// 生成粒子,提供坐标,以及产生概率
 /// </summary>
 /// <param name="position">产生的粒子的坐标</param>
 /// <param name="chance">产生的粒子的概率</param>
 public void AddParticle(Vector2D position,float chance = 0.3f)
 {
     double result = random.NextDouble();
     if (result < chance)
     {
         if (Usevisible_lenth)
         {
             particle p = new BreakPoint(texturemanager, random, color, position, visible_lenth);
             particles_toAdd.Add(p);
         }
         else
         {
             particle p = new BreakPoint(texturemanager, random, color, position);
             particles_toAdd.Add(p);
         }
     }
 }