public void Dibujar(Graphics graphics) { if (siguiente != null) { siguiente.Dibujar(graphics); } graphics.FillRectangle(new SolidBrush(Color.Violet), this.x, this.y, this.ancho, this.ancho); }
private void timer1_Tick(object sender, EventArgs e) { graphics.Clear(Color.White); cabeza.Dibujar(graphics); movimiento(); micomida.DibujaRectangulo(graphics); if(cabeza.interseccion(micomida)) { micomida.Cambiar(); cabeza.crecer(); } choquecuerpo(); choqueescenario(); }