Esempio n. 1
0
 public void Draw(Box1 box1)
 {
     if (IsAlive)
     {
         box1.Draw(Game.Pixel, Bounds, Color.Green);
     }
 }
Esempio n. 2
0
        /// <summary>
        /// draw function for the grid
        /// </summary>
        /// <param name="box1"></param>
        public void Draw(Box1 box1)
        {
            foreach (Box box in boxes)
            {
                box.Draw(box1);
            }

            // Draw vertical gridlines.
            for (int i = 0; i < Size.X; i++)
            {
                box1.Draw(Game1.Pixel, new Rectangle(i * Game1.BoxSize - 1, 0, 1, Size.Y * Game1.BoxSize), Color.DarkGray);
            }

            // Draw horizontal gridlines.
            for (int j = 0; j < Size.Y; j++)
            {
                box1.Draw(Game1.Pixel, new Rectangle(0, j * Game1.BoxSize - 1, Size.X * Game1.BoxSize, 1), Color.DarkGray);
            }
        }