Beispiel #1
0
 public void Move(Towards dir)//移动方块,返回值
 {
     curBrick.MoveTestMod();
     if (dir == Towards.LETF)
     {
         curBrick.MoveTestLeft();
     }
     if (dir == Towards.RIGHT)
     {
         curBrick.MoveTestRight();
     }
     if (dir == Towards.UP)//呵呵
     {
         curBrick.MoveTestUp();
     }
     if (dir == Towards.DOWN)
     {
         curBrick.MoveTestDown();
     }
     if (!Intersect())
     {
         curBrick.ChangePos();//改变位置
     }
     else
     {
         curBrick.InitialtPos();
     }
 }
Beispiel #2
0
        public void movHorz(object sender, EventArgs e)
        {
            curBrick.MoveTestMod();
            if (rotate > 0)
            {
                curBrick.RotateTestMod();
                curBrick.ChangeMod();
                rotate--;
                curBrick.shape2++;
            }
            if (move != 0)
            {
                if (move < 0)
                {
                    curBrick.MoveTestLeft();
                    move++;
                }
                else
                {
                    curBrick.MoveTestRight();
                    move--;
                }
            }



            if (!Intersect())
            {
                curBrick.ChangePos();//改变位置
            }
            else
            {
                curBrick.InitialtPos();
            }


            //if (!Intersect())
            //{
            //    curBrick.ChangePos();//改变位置
            //}
            //else
            //{
            //    curBrick.InitialtPos();
            //}
        }