home *** CD-ROM | disk | FTP | other *** search
- var layerColors = [10531979,11583901,12966573];
- i = 0;
- while(i < Math.floor(Stage.width / 10) + 2)
- {
- if(i != 0)
- {
- p0.duplicateMovieClip("p" + i,i);
- this["p" + i].cacheAsBitmap = true;
- }
- this["p" + i].xoff = i * 10;
- this["p" + i].tileUpdated = true;
- i++;
- }
- y = 0;
- last_y = 0;
- this.onEnterFrame = function()
- {
- if(!_global.graphicsOptSet[1])
- {
- return undefined;
- }
- _Y = (- _root.scroll_y) / 2;
- i = 0;
- while(i < Math.floor(Stage.width / 10) + 2)
- {
- if(this["p" + i].xoff - _root.scroll_x / 2 < -10)
- {
- this["p" + i].xoff += (Math.floor(Stage.width / 10) + 2) * 10;
- this["p" + i].tileUpdated = true;
- }
- if(this["p" + i].xoff - _root.scroll_x / 2 > (Math.floor(Stage.width / 10) + 1) * 10)
- {
- this["p" + i].xoff -= (Math.floor(Stage.width / 10) + 2) * 10;
- this["p" + i].tileUpdated = true;
- }
- if(this["p" + i].tileUpdated)
- {
- if(_root.scroll_x)
- {
- this["p" + i].tileUpdated = false;
- }
- x = i * 10 - _root.scroll_x / 2 % 10;
- last_y = y;
- y = _root.getGroundHeight(this["p" + i].xoff * 2) / 2;
- nextY = _root.getGroundHeight(this["p" + i].xoff * 2 + 20) / 2 - y;
- n = Math.floor(Math.floor(this["p" + i].xoff * 2 / 10));
- this["p" + i]._y = y;
- bgDraw = this["p" + i];
- bgDraw.clear();
- if(_global.graphicsOptSet[3])
- {
- j = 0;
- while(j <= 2)
- {
- Nj = 2 - j;
- bgDraw.beginFill(layerColors[j]);
- bgDraw.moveTo(0,Math.max(0,_root.SurfaceLayer[n] - j) * (Nj * 25));
- bgDraw.lineTo(11,nextY + Math.max(0,_root.SurfaceLayer[n + 2] - j) * (Nj * 25));
- if(j == 0)
- {
- bgDraw.lineTo(11,500);
- bgDraw.lineTo(0,500);
- }
- else
- {
- bgDraw.lineTo(11,nextY + Math.max(0,_root.SurfaceLayer[n + 2] - j + 1) * ((Nj + 1) * 25));
- bgDraw.lineTo(0,Math.max(0,_root.SurfaceLayer[n] - j + 1) * ((Nj + 1) * 25));
- }
- j++;
- }
- }
- else
- {
- bgDraw.beginFill(layerColors[0]);
- bgDraw.moveTo(0,0);
- bgDraw.lineTo(11,nextY + _root.SurfaceLayer[n + 2]);
- bgDraw.lineTo(11,500);
- bgDraw.lineTo(0,500);
- }
- bgDraw.endFill();
- }
- this["p" + i]._x = this["p" + i].xoff - _root.scroll_x / 2;
- i++;
- }
- };
-