Exemplo n.º 1
0
 public Form1()
 {
     InitializeComponent();
     this.cabeza       = new ColaSnake(10, 10);
     this.nuevaComida  = new ComidaSnake();
     this.nuevoGrafico = this.canvas.CreateGraphics();//propiedad instanciada para dibujar
 }
Exemplo n.º 2
0
 private void FinDelJuego()//Reimicio los valores en 0 para un nuevo juego
 {
     this.lvlPuntos.Text = "0";
     this.ejeX           = true;
     this.ejeY           = true;
     this.direccionX     = 0;
     this.direccionY     = 0;
     this.cabeza         = new ColaSnake(10, 10);
     this.nuevaComida    = new ComidaSnake();
     MessageBox.Show("Puntaje conseguido: " + this.puntajeJuego.ToString(), "PERDISTE!!!", MessageBoxButtons.OK, MessageBoxIcon.Error);
     if (this.puntajeJuego > this.puntajeMaximo)
     {
         this.puntajeMaximo         = this.puntajeJuego;
         this.lvlPuntajeMaximo.Text = this.puntajeMaximo.ToString();
     }
     this.puntajeJuego = 0;
 }