示例#1
0
        public Fragment(Vector2 newPosition, GraphicsDevice graphicsDevice, Random random)
        {
            angle    = random.Next(205, 405);
            speed    = random.Next(1, 8);
            position = newPosition;

            //Creating the rectangle and using color.
            color = Movable.get_random_color(random);
            Color[] colorArray = new Color[width * height];
            for (int i = 0; i < colorArray.Length; i++)
            {
                colorArray[i] = color;
            }
            rect = new Texture2D(graphicsDevice, width, height);
            rect.SetData <Color>(colorArray);
        }