Ejemplo n.º 1
0
 public Form1()
 {
     InitializeComponent();
     cabeza = new Cola(10, 10);
     comida = new Comida();
     g      = cambas.CreateGraphics();
 }
 public Form1()
 {
     InitializeComponent();
     this.tamano = 10;
     cabeza      = new Cola(10, 10, 10);
     comida      = new Comida(this.tamano);
     pantalla    = new Pantalla();
     g           = canvas.CreateGraphics();
 }
Ejemplo n.º 3
0
 public void meter()
 {
     if (siguiente == null)
     {
         siguiente = new Cola(this._x, this._y);
     }
     else
     {
         siguiente.meter();
     }
 }
Ejemplo n.º 4
0
 public void meter()
 {
     if (this.siguiente == null)
     {
         this.siguiente = new Cola(this.tamano, this.x, this.y);
     }
     else
     {
         this.siguiente.meter();
     }
 }
Ejemplo n.º 5
0
 public void mantenery(Cola snake)
 {
     if (snake.verY() < 0)
     {
         snake.y = this.height - tamano;
     }
     else if (snake.verY() > this.height - tamano)
     {
         snake.y = 0;
     }
 }
Ejemplo n.º 6
0
 public void mantenerx(Cola snake)
 {
     if (snake.verX() < 0)
     {
         snake.x = this.width - tamano;
     }
     else if (snake.verX() > this.width - tamano)
     {
         snake.x = 0;
     }
 }
Ejemplo n.º 7
0
 public void Finjuego()
 {
     puntaje        = 0;
     lblpuntos.Text = "0";
     ejex           = true;
     ejey           = true;
     xdir           = 0;
     ydir           = 0;
     cabeza         = new Cola(10, 10);
     comida         = new Comida();
     MessageBox.Show("Perdedor!!!");
 }
Ejemplo n.º 8
0
 public Cola(int x, int y)
 {
     this._x   = x;
     this._y   = y;
     siguiente = null;
 }
Ejemplo n.º 9
0
 public Cola(int tamano, int x, int y) : base(tamano, x, y)
 {
     this.siguiente = null;
 }