Exemple #1
0
 /// <summary>
 /// Allows the user to clearly know, which AI lost by pausing the program with a window.
 /// </summary>
 /// <param name="s">receives the name of the loser AI</param>
 public void EliminateLoser(string s)
 {
     using (Font f = new Font("Helvetica", 20))
     {
         this.g.DrawString("Loser", f, Brushes.Black,
                           this.width / 2 - 2 * f.Size, this.height / 2);
     }
     p.RefreshDisplay();
     // Makes a window pop up
     DrawingPanel.Pause(s + " lost. Press OK to challenge the winner.");
 }
Exemple #2
0
        static void Main(string[] args)
        {
            DrawingPanel panel = new DrawingPanel(800, 500);
            Graphics     g     = panel.GetGraphics();
            int          a     = 0;

            while (a == 0)
            {
                MovingSnake(g, panel, x, y, keyData, fruitX, fruitY);
            }

            DrawingPanel.Pause();
        }