Snake.cs:
Code:
public void Draw()
{
foreach (Point organ in organs)
{
graphics.FillRectangle(bodyBrush, new Rectangle(organ, Globals.defaultSize));
}
graphics.FillRectangle(headBrush, new Rectangle(organs[0], Globals.defaultSize));
}
FormGame.cs:
Code:
private void FormGame_Paint(object sender, PaintEventArgs e)
{
if (onGame)
{
snake.Draw();
food.Draw();
lvl.Draw();
}
}
FormGame.Designer.cs:
Code:
this.Paint += new System.Windows.Forms.PaintEventHandler(this.FormGame_Paint);
Actually, the level is the problem maker.
Level.cs:
Code:
public void Draw()
{
foreach (Brick b in bricks)
graphics.FillRectangle(solidBrush,
new Rectangle(b.GetPosition(), Globals.defaultSize));
}