private Brick brick = new Brick();
Making a brick array of size 20 now I need to draw these to the board class.
Brick[] numberOfBricks = new Brick[20];
public Board()
{
ball = new Ball(new Point(10, 10));
this.Location = new System.Drawing.Point(0, 0);
this.Size = new System.Drawing.Size(500, 462);
this.Visible = true;
movement.Interval = 1;
movement.Tick += new EventHandler(movement_Tick);
this.KeyDown += new KeyEventHandler(Board_KeyDown);
this.Paint += new PaintEventHandler(Form1_Paint);
delta =2;
}
private void Render()
{
BufferedGraphicsContext currentContext;
BufferedGraphics buffer;
currentContext = BufferedGraphicsManager.Current;
//create the bufer to draw onto
buffer = currentContext.Allocate(this.CreateGraphics(), this.DisplayRectangle);
buffer.Graphics.DrawImage(newImage, corners);
ball.DrawMe(buffer.Graphics);
bumper.Draw(buffer.Graphics);
[COLOR=#ff0000] for (int index = 0; index < numberOfBricks.Length; index++)[/COLOR][COLOR=#ff0000] {[/COLOR]
[COLOR=#ff0000] numberOfBricks[index].Draw(buffer.Graphics);[/COLOR]
[COLOR=#ff0000] } [/COLOR]
//draw the buffer to the visible scfrren
buffer.Render();
//always destroy a buffer after you are done with it!!!
buffer.Dispose();
}