Share Pastebin
Guest
Public paste!

Shawn

By: a guest | Apr 19th, 2008 | Syntax: C# | Size: 1.21 KB | Hits: 107 | Expires: Never
Copy text to clipboard
  1. using System.Collections.Generic;
  2. using Microsoft.Xna.Framework;
  3. using Microsoft.Xna.Framework.Graphics;
  4.  
  5. namespace SimonXNA
  6. {
  7.     class PlayBoard
  8.     {
  9.         List<Rectangle> ColoredRectangles;
  10.         List<Color> ColorList;
  11.  
  12.         public void Initialize()
  13.         {
  14.             ColoredRectangles = new List<Rectangle>();
  15.             ColorList = new List<Color>();
  16.             ColoredRectangles.Add(new Rectangle(300, 200, 100, 100));
  17.             ColoredRectangles.Add(new Rectangle(401, 200, 100, 100));
  18.             ColoredRectangles.Add(new Rectangle(300, 301, 100, 100));
  19.             ColoredRectangles.Add(new Rectangle(401, 301, 100, 100));
  20.             ColorList.Add(new Color(0, 0, 150));
  21.             ColorList.Add(new Color(0, 150, 0));
  22.             ColorList.Add(new Color(150, 0, 0));
  23.             ColorList.Add(new Color(150, 150, 0));
  24.         }
  25.  
  26.         public void Update()
  27.         {
  28.         }
  29.  
  30.         public void Draw(SpriteBatch sb, Texture2D squares)
  31.         {
  32.             int colorIndex = 0;
  33.             foreach (Rectangle r in ColoredRectangles)
  34.             {
  35.                 sb.Draw(squares, r, ColorList[colorIndex]);
  36.                 colorIndex++;
  37.             }
  38.         }
  39.     }
  40. }