private void genMancare() { int maxXpos = pictureBox1.Size.Width / Setari.Latime; int maxYpos = pictureBox1.Size.Height / Setari.Inaltime; Random rnd = new Random(); mar = new Cerc { x = rnd.Next(0, maxXpos), y = rnd.Next(0, maxYpos) }; }
private void eat() { Cerc body = new Cerc { x = Snake[Snake.Count - 1].x, y = Snake[Snake.Count - 1].y }; Snake.Add(body); Setari.Scor += Setari.Puncte; label2.Text = Setari.Scor.ToString(); genMancare(); }
private void start() { label3.Visible = false; new Setari(); Snake.Clear(); Cerc head = new Cerc { x = 10, y = 5 }; Snake.Add(head); label2.Text = Setari.Scor.ToString(); genMancare(); }