public Form1() { InitializeComponent(); head = new queue(375, 180); food = new Food(canvas.Width, canvas.Height); graphics = canvas.CreateGraphics(); //crear dibujo }
public void ResetGame() { bucle.Interval = 100; ejeX = true; ejeY = true; xdir = 0; ydir = 0; head = new queue(375, 180); score = 0; points.Text = "0"; }
public void add() //recursiva para meter { if (next == null) { next = new queue(this.x, this.y); } else { next.add(); } }
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(); } }
public queue(int x, int y) { this.x = x; this.y = y; next = null; }