home *** CD-ROM | disk | FTP | other *** search
/ 600 Games / 600games.iso / Nave / rocket_rush.swf / scripts / __Packages / Ground.as < prev    next >
Encoding:
Text File  |  2007-03-20  |  1.6 KB  |  50 lines

  1. class Ground extends MovieClip
  2. {
  3.    var angle;
  4.    var y;
  5.    var clips = [];
  6.    static var speed = 2;
  7.    function Ground(p_ground, p_mc, p_y)
  8.    {
  9.       super();
  10.       p_mc.createEmptyMovieClip("ground_clip",-10);
  11.       var _loc4_ = 0;
  12.       while(_loc4_ < 5)
  13.       {
  14.          this.clips[_loc4_] = p_mc.ground_clip.attachMovie(p_ground,"ground" + _loc4_,p_mc.ground_clip.getNextHighestDepth());
  15.          this.clips[_loc4_].angle = _loc4_ * 20;
  16.          this.clips[_loc4_]._x = 275;
  17.          this.clips[_loc4_].y = p_y;
  18.          this.clips[_loc4_].cloud._x = Math.random() * 200 - 100;
  19.          this.clips[_loc4_].onEnterFrame = function()
  20.          {
  21.             if(!_global.game_paused)
  22.             {
  23.                var _loc3_ = this._y + this._parent._y + this._parent._parent._y + this._parent._parent._parent._y;
  24.                if(_loc3_ > 400)
  25.                {
  26.                   this._visible = false;
  27.                }
  28.                else
  29.                {
  30.                   this._visible = true;
  31.                }
  32.                this.angle += Ground.speed;
  33.                if(this.angle > 90)
  34.                {
  35.                   this.angle -= 100;
  36.                }
  37.                this._y = this.y - 100 * Math.cos(3.141592653589793 * this.angle / 180);
  38.                this._xscale = 100 + (this._y - (this.y - 80));
  39.                this.swapDepths(10 * this.angle + 50);
  40.                if(this.angle < 60)
  41.                {
  42.                   this._alpha = (this.angle + 10) * 1.43;
  43.                }
  44.             }
  45.          };
  46.          _loc4_ = _loc4_ + 1;
  47.       }
  48.    }
  49. }
  50.