cur.point.X && snake.First.Value.point.Y == cur.point.Y) {TheEnd (e);} + +;
} (snake.First.Value.point.X == 640 | snake.First.Value.point.Y == 480 | snake.First.Value.point.Y == 0 | snake . First.Value.point.X == 0) {TheEnd (e);}
(snake.First.Value.point.X == apple.Coordinates.X && snake.First.Value.point.Y == apple.Coordinates.Y)// Collision apple
{(count_apple% 5 == 0) {apple = new Apple (true, snake); m = true;} {apple = new Apple (false, snake); m = false;} _apple + + ; + = (point * bonus);. AddLast (snake.Last.Value); (points> = 1000) {Triumph (e);}
}
}
t_Tick (object sender, EventArgs e)// Move Snake
{. AddFirst (new Dir (snake.First.Value.point.X + dir.point.X, snake.First.Value.point.Y + dir.point.Y));. RemoveLast ();. Refresh ();
}
TheEnd (PaintEventArgs e)
{drawString = "The End"; drawFont = new Font ("Arial", 15); drawBrush = new SolidBrush (Color.Red); drawPoint = new PointF (270, 10); . Graphics.DrawString (drawString, drawFont, drawBrush, drawPoint);. Dispose ();. Points = points;. Add (person);. Graphics.DrawString ("Ваш результат:", drawFont, new SolidBrush (Color. Green), new PointF (200, 30));. Graphics.DrawString (person.Player + ":" + Convert.ToString (person.Points), drawFont, new SolidBrush (Color.Green), new PointF (200 , 50));. Graphics.DrawString ("Рекорди", new Font ("Arial", 15), new SolidBrush (Color.Black), new PointF (250, 70)); temp = table . GetAllPersons (); w = 90; = new Font ("Tahoma", 15); = new SolidBrush (Color.Orange); n = temp.Count; (n> 10) {n = 10;} (int i = 0; i
{. Graphics.DrawString (temp [i]. Player + ":" + Convert.ToString (temp [i]. Points), drawFont, drawBrush, new PointF (200, w) ); + = 20;
}. Close ();
}
Triumph (PaintEventArgs e)
{. Dispose (); drawString = "Перемога"; drawFont = new Font ("Arial", 100); drawBrush = new SolidBrush (Color.Red); drawPoint = new PointF (100 , 10);. Graphics.DrawString (drawString, drawFont, drawBrush, drawPoint); = new Font ("Arial", 15);. Stop ();. Points = points;. Add (person);. Graphics.DrawString ("Ваш результат:", drawFont, new SolidBrush (Color.Green), new PointF (200, 130));. Graphics.DrawString (person.Player + ":" + Convert.ToString (person.Points ), drawFont, new SolidBrush (Color.Green), new PointF (200, 150));. Graphics.DrawString ("Рекорди", new Font ("Arial", 15), new SolidBrush (Color.Black), new PointF (250, 170)); temp = table.GetAllPersons ();. OrderByDescending (y => y.Points); w = 190; = new Font ("Tahoma", 15); = new SolidBrush (Color.Orange); n = temp.Count; (n> 10) {n = 10;} (int i = 0; i
{. Graphics...