Ejemplo n.º 1
0
        private void Pawn_U8_Click(object sender, EventArgs e)
        {
            Location1 location = new Location1();
            //폰1이 움직이는 방식
            for (int i = 0; i < 16; i++)
            {
                U[i].Enabled = true;
                button2.PerformClick();
            }
            Pawn_U8.Enabled = false;
            radio20.Location = Pawn_U8.Location;
            radio_x = radio20.Location.X;
            radio_y = radio20.Location.Y;
            button_y = Pawn_U8.Location.Y;
            radio_x += 16;
            radio_y -= 40;
            radio20.Location = new Point(radio_x, radio_y);
            radio20.Visible = true;
            button_x = Pawn_U8.Location.X;
            button_y = Pawn_U8.Location.Y;
            //대각선에 말이 있을 경우 잡기 or 직진
            for (int i = 0; i < 16; i++)
            {
                if (N[i].Location == new Point(button_x - 56, button_y - 56))
                {
                    N[i].Visible = false;
                    for (int j = 10; j < 20; j++)
                    {
                        if (radios[j].Visible == false)
                        {
                            radios[j].Visible = true;
                            radios[j].Location = new Point(N[i].Location.X + 16, N[i].Location.Y + 16);
                        }
                    }
                }
                else if (N[i].Location == new Point(button_x + 56, button_y - 56))
                {
                    N[i].Visible = false;
                    for (int j = 0; j < 10; j++)
                    {
                        if (radios[j].Visible == false)
                        {
                            radios[j].Visible = true;
                            radios[j].Location = new Point(N[i].Location.X + 16, N[i].Location.Y + 16);
                        }
                    }
                }
            }

            //끝에가면 못움직이게
            if (Pawn_U8.Location.Y == 98)
            {
                radio20.Visible = false;
                radio20.Checked = false;
                radio2.Visible = false;
                radio2.Checked = false;
            }
            else
            {
                radio20.Visible = true;
            }
            radio_x = 0;
            radio_y = 0;
            // 처음에 2칸 갈수 있게
            if (button_y == 490)
            {
                radio2.Location = Pawn_U8.Location;
                radio_x = radio2.Location.X;
                radio_y = radio2.Location.Y;
                radio_x += 16;
                radio_y -= 96;
                radio2.Location = new Point(radio_x, radio_y);
                radio2.Visible = true;
                radio_x = 0;
                radio_y = 0;
            }
        }
Ejemplo n.º 2
0
        private void Pawn_U8_Click(object sender, EventArgs e)
        {
            Location1 location = new Location1();

            //폰1이 움직이는 방식
            for (int i = 0; i < 16; i++)
            {
                U[i].Enabled = true;
                button2.PerformClick();
            }
            Pawn_U8.Enabled  = false;
            radio20.Location = Pawn_U8.Location;
            radio_x          = radio20.Location.X;
            radio_y          = radio20.Location.Y;
            button_y         = Pawn_U8.Location.Y;
            radio_x         += 16;
            radio_y         -= 40;
            radio20.Location = new Point(radio_x, radio_y);
            radio20.Visible  = true;
            button_x         = Pawn_U8.Location.X;
            button_y         = Pawn_U8.Location.Y;
            //대각선에 말이 있을 경우 잡기 or 직진
            for (int i = 0; i < 16; i++)
            {
                if (N[i].Location == new Point(button_x - 56, button_y - 56))
                {
                    N[i].Visible = false;
                    for (int j = 10; j < 20; j++)
                    {
                        if (radios[j].Visible == false)
                        {
                            radios[j].Visible  = true;
                            radios[j].Location = new Point(N[i].Location.X + 16, N[i].Location.Y + 16);
                        }
                    }
                }
                else if (N[i].Location == new Point(button_x + 56, button_y - 56))
                {
                    N[i].Visible = false;
                    for (int j = 0; j < 10; j++)
                    {
                        if (radios[j].Visible == false)
                        {
                            radios[j].Visible  = true;
                            radios[j].Location = new Point(N[i].Location.X + 16, N[i].Location.Y + 16);
                        }
                    }
                }
            }

            //끝에가면 못움직이게
            if (Pawn_U8.Location.Y == 98)
            {
                radio20.Visible = false;
                radio20.Checked = false;
                radio2.Visible  = false;
                radio2.Checked  = false;
            }
            else
            {
                radio20.Visible = true;
            }
            radio_x = 0;
            radio_y = 0;
            // 처음에 2칸 갈수 있게
            if (button_y == 490)
            {
                radio2.Location = Pawn_U8.Location;
                radio_x         = radio2.Location.X;
                radio_y         = radio2.Location.Y;
                radio_x        += 16;
                radio_y        -= 96;
                radio2.Location = new Point(radio_x, radio_y);
                radio2.Visible  = true;
                radio_x         = 0;
                radio_y         = 0;
            }
        }