pastebin - collaborative debugging

pastebin is a collaborative debugging tool allowing you to share and modify code snippets while chatting on IRC, IM or a message board.

This site is developed to XHTML and CSS2 W3C standards. If you see this paragraph, your browser does not support those standards and you need to upgrade. Visit WaSP for a variety of options.

C# pastebin - collaborative debugging tool View Help


Posted by Shawn on Sat 19 Apr 19:22
report abuse | download | new post

  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. }

Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.

Syntax highlighting:

To highlight particular lines, prefix each line with @@


Remember me so that I can delete my post