public Form1() { InitializeComponent(); head = new SnakeTail(20, 20);//instancio cabeza g = Canvas.CreateGraphics(); piedra = new Piedra(); food = new Food(); morir = new System.Media.SoundPlayer(@"C:\Users\faliw\OneDrive\Escritorio\Snake c#\Snake\1234.wav"); comer = new System.Media.SoundPlayer(@"C:\Users\faliw\OneDrive\Escritorio\Snake c#\Snake\EAT1.wav"); rnd = new Random(100); }
public void eat() { if (next == null) { next = new SnakeTail(this.x, this.y); } else { next.eat(); } }
public void End() { score = 0; Puntos.Text = "0"; direcx = 0; direcy = 0; ejex = true; ejey = true; food = new Food(); head = new SnakeTail(20, 20); MessageBox.Show("GAME OVER"); }