Пример #1
0
        float width = 6; //宽

        #endregion Fields

        #region Constructors

        /// <summary>
        /// 生成一个爆炸粒子
        /// </summary>
        /// <param name="_t">纹理器</param>
        /// <param name="random">随机器</param>
        /// <param name="color">颜色选择(现已无用,任意填写)</param>
        /// <param name="position">坐标</param>
        public BreakPoint(TextureManager _t, Random random, int color, Vector2D position, float visibleLenth = 10)
        {
            this.random = random;
            int select = random.Next(4);
            Body = new BreakPointBody(_t, color, select);
            Position.X = position.X; Position.Y = position.Y;           //坐标

            float ag = (float)random.NextDouble() * 360;
            Vector2D vct = new Vector2D(0,1);
            vct.rotate(ag);
            Direction.X = vct.X; Direction.Y = vct.Y;                   //生成一个随机方向

            visible_lenth = visibleLenth;
            //生成随机数据
            CreteRandomData();
        }
Пример #2
0
        int TotolTickMax = 30;    //最大总计时周期

        /// <summary>
        /// 生成一个爆炸粒子
        /// </summary>
        /// <param name="_t">纹理器</param>
        /// <param name="random">随机器</param>
        /// <param name="color">颜色选择(现已无用,任意填写)</param>
        /// <param name="position">坐标</param>
        public BreakPoint(TextureManager _t, Random random, int color, Vector2D position, float visibleLenth = 10)
        {
            this.random = random;
            int select = random.Next(4);

            Body       = new BreakPointBody(_t, color, select);
            Position.X = position.X; Position.Y = position.Y;           //坐标

            float    ag  = (float)random.NextDouble() * 360;
            Vector2D vct = new Vector2D(0, 1);

            vct.rotate(ag);
            Direction.X = vct.X; Direction.Y = vct.Y;                   //生成一个随机方向

            visible_lenth = visibleLenth;
            //生成随机数据
            CreteRandomData();
        }