예제 #1
0
 public void Go(int number)
 {
     Moving.RotateFileSave rotateFile = new Moving.RotateFileSave();
     rotate = rotateFile.Load();
     for (int i = 0; i < number; i++)
     {
         if (rotate.isTop)
         {
             point = new Point(point.X, point.Y - 5);
         }
         else if (rotate.isBack)
         {
             point = new Point(point.X, point.Y + 5);
         }
         else if (rotate.isLeft)
         {
             point = new Point(point.X + 5, point.Y);
         }
         else if (rotate.isRight)
         {
             point = new Point(point.X - 5, point.Y);
         }
         CodeGame.MyForm.SetPlayerPoint(point);
         CodeGame.MyForm.Refresh();
     }
 }
예제 #2
0
 public Load()
 {
     Moving.RotateFileSave rotateSave = new Moving.RotateFileSave();
     rotate = rotateSave.Load();
     Moving.PosSaveFile posSaveFile = new Moving.PosSaveFile();
     move = posSaveFile.Load();
 }
예제 #3
0
 public void Check()
 {
     foreach (char item in CodeGame.MyForm.tbCode.Text)
     {
         if (!isMove)
         {
             tmp += item;
         }
         if (tmp == "move.Go(")
         {
             isMove = true;
             if (item == ';')
             {
                 move.Go(number);
                 tmp    = null;
                 isMove = false;
             }
             if (Char.IsDigit(item))
             {
                 number *= 10;
                 number += Int32.Parse(Convert.ToString(item));
             }
         }
         if (tmp == "rotate.RotateTop(")
         {
             isMove = true;
             if (item == ';')
             {
                 rotate.RotateTop();
                 Moving.RotateFileSave rotateSave = new Moving.RotateFileSave();
                 rotateSave.Save(rotate);
                 tmp    = null;
                 isMove = false;
             }
         }
         if (tmp == "rotate.RotateDown(")
         {
             isMove = true;
             if (item == ';')
             {
                 rotate.RotateDown();
                 Moving.RotateFileSave rotateSave = new Moving.RotateFileSave();
                 rotateSave.Save(rotate);
                 tmp    = null;
                 isMove = false;
             }
         }
         if (tmp == "rotate.RotateLeft(")
         {
             isMove = true;
             if (item == ';')
             {
                 rotate.RotateLeft();
                 Moving.RotateFileSave rotateSave = new Moving.RotateFileSave();
                 rotateSave.Save(rotate);
                 tmp    = null;
                 isMove = false;
             }
         }
         if (tmp == "rotate.RotateRight(")
         {
             isMove = true;
             if (item == ';')
             {
                 rotate.RotateRight();
                 Moving.RotateFileSave rotateSave = new Moving.RotateFileSave();
                 rotateSave.Save(rotate);
                 tmp    = null;
                 isMove = false;
             }
         }
     }
 }