home *** CD-ROM | disk | FTP | other *** search
/ 600 Games / 600games.iso / Puzzle / badapple.swf / scripts / DefineSprite_43 / frame_1 / DoAction.as
Encoding:
Text File  |  2007-03-28  |  986 b   |  44 lines

  1. stopclick = false;
  2. currentx = 0;
  3. currenty = 0;
  4. numx = 8;
  5. numy = 6;
  6. numbad = 10;
  7. tempcount = new Array(numx * numy);
  8. numleft = numx * numy - numbad;
  9. tempx = 0;
  10. tempy = 0;
  11. distx = getProperty("/baseapple", _width) - getProperty("/baseapple", _width) / 10 + 22;
  12. disty = getProperty("/baseapple", _height) - getProperty("/baseapple", _height) / 10 + 25;
  13. startx = 315 - numx / 2 * distx;
  14. starty = 225 - numy / 2 * disty + 30;
  15. countx = 1;
  16. county = 1;
  17. countbad = 0;
  18. countI = 0;
  19. while(numx >= countx)
  20. {
  21.    while(numy >= county)
  22.    {
  23.       set("bad" add countx add county,0);
  24.       tempCount[countI] = 0;
  25.       county += 1;
  26.       countI++;
  27.    }
  28.    county = 1;
  29.    countx += 1;
  30. }
  31. while(countbad < numbad)
  32. {
  33.    tempx = random(numx) + 1;
  34.    tempy = random(numy) + 1;
  35.    while("bad" add tempx add tempy == 1)
  36.    {
  37.       tempx = random(numx) + 1;
  38.       tempy = random(numy) + 1;
  39.    }
  40.    set("bad" add tempx add tempy,1);
  41.    countbad += 1;
  42. }
  43. gotoAndPlay(11);
  44.