private void FoodShow() { //Attribute Attribute = new Attribute(); int HorizontalSnakePosition = GameScreen.Size.Width / Attribute.width; int VerticalSnakePosition = GameScreen.Size.Height / Attribute.height; Random FoodObjects = new Random(); FoodItem = new Position_snake(); FoodItem.Horizontal = FoodObjects.Next(0, HorizontalSnakePosition); FoodItem.Vertical = FoodObjects.Next(0, VerticalSnakePosition); //MessageBox.Show("LL"); }
private void StartGame() { label2.Visible = false; speed.Visible = false; new SnakeSettings(); //Attribute.GameOver = true; Snake_game.Clear(); // MessageBox.Show("LL"); Position_snake Face = new Position_snake(); Face.Horizontal = 24; Face.Vertical = 20; Snake_game.Add(Face); FoodShow(); }