home *** CD-ROM | disk | FTP | other *** search
/ 600 Games / 600games.iso / Nave / dtunnel.swf / scripts / DefineSprite_4_terrain / frame_1 / DoAction.as
Encoding:
Text File  |  2006-06-13  |  1.7 KB  |  82 lines

  1. createEmptyMovieClip("left",_root.depth);
  2. with(left)
  3. {
  4.    beginFill(_root.mycolor,100);
  5.    moveTo(0,0);
  6.    lineStyle(3,_root.mycolor,100);
  7.    nextx = _root.nextx;
  8.    nexty = 0;
  9.    lineTo(nextx,nexty);
  10.    _root.coordinates.push(nextx);
  11.    _root.coordinates.push(nexty);
  12.    i = 25;
  13.    while(i > 0)
  14.    {
  15.       addx = random(Math.round(_root.jaggyness / 2)) + _root.jaggyness / 2;
  16.       if(nextx <= addx + 10)
  17.       {
  18.          nextx += addx;
  19.       }
  20.       else if(nextx + addx > _root.stagewidth - _root.tunnelwidth - 10)
  21.       {
  22.          nextx -= addx;
  23.          trace("minus");
  24.       }
  25.       else
  26.       {
  27.          aors = random(2);
  28.          if(aors == 0)
  29.          {
  30.             nextx += addx;
  31.          }
  32.          else
  33.          {
  34.             nextx -= addx;
  35.          }
  36.       }
  37.       nexty -= _root.addy;
  38.       lineTo(nextx,nexty);
  39.       _root.coordinates.push(nextx);
  40.       _root.coordinates.push(nexty);
  41.       i--;
  42.    }
  43.    _root.nextx = nextx;
  44.    lineTo(0,nexty);
  45.    LineTo(0,0);
  46.    endFill();
  47. }
  48. if(_root.depth < 1000)
  49. {
  50.    _root.depth = _root.depth + 1;
  51. }
  52. else
  53. {
  54.    _root.depth = 5;
  55. }
  56. createEmptyMovieClip("right",_root.depth);
  57. with(right)
  58. {
  59.    beginFill(_root.mycolor,100);
  60.    moveTo(_root.stagewidth,0);
  61.    lineStyle(3,_root.mycolor,100);
  62.    i = _root.coordinates.length / 2;
  63.    while(i > 0)
  64.    {
  65.       lineTo(_root.coordinates[0] + _root.tunnelwidth,_root.coordinates[1]);
  66.       rlasty = _root.coordinates[1];
  67.       _root.coordinates.splice(0,2);
  68.       i--;
  69.    }
  70.    lineTo(_root.stagewidth,rlasty);
  71.    lineTo(_root.stagewidth,0);
  72.    endFill();
  73. }
  74. if(_root.depth < 1000)
  75. {
  76.    _root.depth = _root.depth + 1;
  77. }
  78. else
  79. {
  80.    _root.depth = 5;
  81. }
  82.