Пример #1
0
        public void Figure_left()
        {
            try
            {
                //for (int j = 0; j < figure.Check_left().Length - 1; j++)
                //{
                //    //Single_pixel[figure.Check_left()[j], figure.Check_left()[j + 1]].Change_color(Single_pixel[figure.Check_left()[j], figure.Check_left()[j + 1]].Get_color());
                //    //j++;
                //    if (Single_pixel[figure.Check_left()[l], figure.check_sides_left_left()[l + 1]].get_color() != "Black")
                //    {
                //        move_left = false;
                //    }
                //    l++;

                //}
                for (int l = 0; l < figure.Check_left().Length; l++)
                {
                    if (Single_pixel[figure.Check_left()[l], figure.Check_left()[l + 1]].Get_color() != Background_Color)
                    {
                        move_availble = false;
                    }
                    l++;
                }
                if (move_availble == true)
                {
                    for (int i = 0; i < figure.Coordinate().Length; i++)
                    {
                        Single_pixel[figure.Coordinate()[i], figure.Coordinate()[i + 1]].Change_color(Background_Color);
                        i++;
                    }

                    figure.Coordinates_left();

                    for (int i = 0; i < figure.Coordinate().Length; i++)
                    {
                        Single_pixel[figure.Coordinate()[i], figure.Coordinate()[i + 1]].Change_color(tertimino_color);
                        i++;
                    }
                }
                else
                {
                    move_availble = true;
                }
            }
            catch (System.IndexOutOfRangeException)
            {
            }
        }