예제 #1
0
        public void Dibujar(Graphics g)
        {
            if (siguiente != null)
            {
                siguiente.Dibujar(g);
            }

            g.FillRectangle(new SolidBrush(Color.Red), this.x, this.y, this.ancho, this.ancho);
        }
예제 #2
0
 private void Bucle_Tick(object sender, EventArgs e)
 {
     g.Clear(Color.White);
     cabeza.Dibujar(g);
     comida.Dibujar(g);
     this.Movimiento();
     this.ChoqueCuerpo();
     this.ChoquePared();
     if (cabeza.Interseccion(comida))
     {
         comida.Colocar();
         cabeza.Meter();
         puntos++;
         this.lblPuntos.Text = puntos.ToString();
     }
 }