home *** CD-ROM | disk | FTP | other *** search
/ 600 Games / 600games.iso / Classicos / AllienAttack.swf / scripts / frame_8 / DoAction.as
Encoding:
Text File  |  2006-06-13  |  1.2 KB  |  57 lines

  1. call("vaisseau");
  2. if(Number(aa) == 0)
  3. {
  4.    found = 0;
  5.    aa = 1;
  6.    col = random(11);
  7.    tentatives = 0;
  8.    while(Number(found) < 1 and Number(tentatives) < 12)
  9.    {
  10.       tentatives = Number(tentatives) + 1;
  11.       row = 4;
  12.       while(Number(found) == 0)
  13.       {
  14.          if(eval("f" add (row * 11 + col)) == 1)
  15.          {
  16.             found = 1;
  17.             ax = eval("x" add (row * 11 + col));
  18.             ay = eval("y" add (row * 11 + col));
  19.             setProperty("/alienfire", _X, ax);
  20.          }
  21.          else
  22.          {
  23.             row -= 1;
  24.             if(Number(row) == Number(-1))
  25.             {
  26.                found = -1;
  27.             }
  28.          }
  29.       }
  30.       if(Number(found) < 1)
  31.       {
  32.          found = 0;
  33.          col = Number(col) + 1;
  34.          if(Number(col) == 11)
  35.          {
  36.             col = 0;
  37.          }
  38.       }
  39.    }
  40. }
  41. else
  42. {
  43.    ay = Number(ay) + 3;
  44.    setProperty("/alienfire", _Y, ay);
  45.    if(336 < Number(ay))
  46.    {
  47.       setProperty("/alienfire", _Y, 400);
  48.       aa = 0;
  49.    }
  50.    if(325 < Number(ay) and Number(ay) < 331 and Number((ax - dx) * (ax - dx)) < 101)
  51.    {
  52.       gameover = 1;
  53.    }
  54.    tx = ax;
  55.    ty = ay;
  56. }
  57.