コード例 #1
0
 public Form1()
 {
     InitializeComponent();
     head     = new queue(375, 180);
     food     = new Food(canvas.Width, canvas.Height);
     graphics = canvas.CreateGraphics(); //crear dibujo
 }
コード例 #2
0
 public void ResetGame()
 {
     bucle.Interval = 100;
     ejeX           = true;
     ejeY           = true;
     xdir           = 0;
     ydir           = 0;
     head           = new queue(375, 180);
     score          = 0;
     points.Text    = "0";
 }
コード例 #3
0
 public void add() //recursiva para meter
 {
     if (next == null)
     {
         next = new queue(this.x, this.y);
     }
     else
     {
         next.add();
     }
 }
コード例 #4
0
        public void GameOver()
        {
            ejeX = true;
            ejeY = true;
            xdir = 0;
            ydir = 0;
            head = new queue(375, 180);
            food = new Food(canvas.Width, canvas.Height);
            MessageBox.Show("perdio, su puntaje fue de " + score);
            score       = 0;
            points.Text = "0";
            var confirmResult = MessageBox.Show("desea jugar de vuelta", "reset", MessageBoxButtons.YesNo);

            if (confirmResult == DialogResult.Yes)
            {
                ResetGame();
            }
            else if (confirmResult == DialogResult.No)
            {
                this.Dispose();
            }
        }
コード例 #5
0
 public queue(int x, int y)
 {
     this.x = x;
     this.y = y;
     next   = null;
 }