home *** CD-ROM | disk | FTP | other *** search
/ 600 Games / 600games.iso / Nave / SpaceEscape.swf / scripts / DefineSprite_375 / frame_1 / DoAction.as
Encoding:
Text File  |  2005-08-08  |  1.9 KB  |  59 lines

  1. pBestTime = _root.fTimeString(_root.pTimes[pLevelNum]);
  2. pLevelNumDisplay = pLevelNum + 1;
  3. if(_root.game.world._width > _root.game.world._height)
  4. {
  5.    divide = _root.game.world._width;
  6. }
  7. else
  8. {
  9.    divide = _root.game.world._height;
  10. }
  11. divide = 21000;
  12. this.createEmptyMovieClip("shape",0);
  13. this.shape.beginFill("0x405482",100);
  14. i = 0;
  15. while(i < _root.mapsArray[pLevelNum][4].length)
  16. {
  17.    if(_root.mapsArray[pLevelNum][4][i][0] == "moveTo")
  18.    {
  19.       this.shape.moveTo(_root.mapsArray[pLevelNum][4][i][1] / divide * 350,_root.mapsArray[pLevelNum][4][i][2] / divide * 350);
  20.    }
  21.    else
  22.    {
  23.       this.shape.lineTo(_root.mapsArray[pLevelNum][4][i][1] / divide * 350,_root.mapsArray[pLevelNum][4][i][2] / divide * 350);
  24.    }
  25.    i++;
  26. }
  27. this.shape.endFill();
  28. halfWidth = 50 / divide;
  29. halfHeight = 50 / divide;
  30. startLocX = 0;
  31. startLocY = 0;
  32. this.shape.beginFill("0xFF0000",100);
  33. this.shape.moveTo(startLocX - halfWidth,startLocY - halfHeight);
  34. this.shape.lineTo(startLocX + halfWidth,startLocY - halfHeight);
  35. this.shape.lineTo(startLocX + halfWidth,startLocY + halfHeight);
  36. this.shape.lineTo(startLocX - halfWidth,startLocY + halfHeight);
  37. this.shape.lineTo(startLocX - halfWidth,startLocY - halfHeight);
  38. this.shape.endFill();
  39. endLocX = _root.mapsArray[pLevelNum][3][0] / divide * 350;
  40. endLocY = _root.mapsArray[pLevelNum][3][1] / divide * 350;
  41. this.shape.beginFill("0x00FF00",100);
  42. this.shape.moveTo(endLocX - halfWidth,endLocY - halfHeight);
  43. this.shape.lineTo(endLocX + halfWidth,endLocY - halfHeight);
  44. this.shape.lineTo(endLocX + halfWidth,endLocY + halfHeight);
  45. this.shape.lineTo(endLocX - halfWidth,endLocY + halfHeight);
  46. this.shape.lineTo(endLocX - halfWidth,endLocY - halfHeight);
  47. this.shape.endFill();
  48. this.shape._x = 50 - this.shape._width / 2;
  49. this.shape._y = 50 - this.shape._height / 2;
  50. if(_root.pTimes[pLevelNum] == 0)
  51. {
  52.    stop();
  53. }
  54. else
  55. {
  56.    gotoAndStop(2);
  57.    txTime.text = pBestTime;
  58. }
  59.