public void dibujar(Graphics g) { if (siguiente != null) { siguiente.dibujar(g); } g.FillRectangle(new SolidBrush(Color.Blue), this.x, this.y, this.ancho, this.ancho); }
private void timer1_Tick(object sender, EventArgs e) { g.Clear(Color.Black); cabeza.dibujar(g); movimiento(); comida.dibujar(g); choqueCuerpo(); choquePared(); if (cabeza.colicion(comida)) { comida.reGen(); velocidad -= 5; timer1.Interval = velocidad; cabeza.insertar(); puntos += 10; label1.Text = "Puntaje:" + puntos.ToString(); } }