Shawn
By: a guest | Apr 19th, 2008 | Syntax:
C# | Size: 1.21 KB | Hits: 107 | Expires: Never
using System.Collections.Generic;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
namespace SimonXNA
{
class PlayBoard
{
List<Rectangle> ColoredRectangles;
List<Color> ColorList;
public void Initialize()
{
ColoredRectangles
= new List
<Rectangle
>();
ColorList
= new List
<Color
>();
ColoredRectangles.
Add(new Rectangle
(300, 200, 100, 100
));
ColoredRectangles.
Add(new Rectangle
(401, 200, 100, 100
));
ColoredRectangles.
Add(new Rectangle
(300, 301, 100, 100
));
ColoredRectangles.
Add(new Rectangle
(401, 301, 100, 100
));
ColorList.
Add(new Color
(0, 0, 150
));
ColorList.
Add(new Color
(0, 150, 0
));
ColorList.
Add(new Color
(150, 0, 0
));
ColorList.
Add(new Color
(150, 150, 0
));
}
public void Update()
{
}
public void Draw(SpriteBatch sb, Texture2D squares)
{
int colorIndex = 0;
foreach (Rectangle r in ColoredRectangles)
{
sb.Draw(squares, r, ColorList[colorIndex]);
colorIndex++;
}
}
}
}