home *** CD-ROM | disk | FTP | other *** search
- class Ground extends MovieClip
- {
- var angle;
- var y;
- var clips = [];
- static var speed = 2;
- function Ground(p_ground, p_mc, p_y)
- {
- super();
- p_mc.createEmptyMovieClip("ground_clip",-10);
- var _loc4_ = 0;
- while(_loc4_ < 5)
- {
- this.clips[_loc4_] = p_mc.ground_clip.attachMovie(p_ground,"ground" + _loc4_,p_mc.ground_clip.getNextHighestDepth());
- this.clips[_loc4_].angle = _loc4_ * 20;
- this.clips[_loc4_]._x = 275;
- this.clips[_loc4_].y = p_y;
- this.clips[_loc4_].cloud._x = Math.random() * 200 - 100;
- this.clips[_loc4_].onEnterFrame = function()
- {
- if(!_global.game_paused)
- {
- var _loc3_ = this._y + this._parent._y + this._parent._parent._y + this._parent._parent._parent._y;
- if(_loc3_ > 400)
- {
- this._visible = false;
- }
- else
- {
- this._visible = true;
- }
- this.angle += Ground.speed;
- if(this.angle > 90)
- {
- this.angle -= 100;
- }
- this._y = this.y - 100 * Math.cos(3.141592653589793 * this.angle / 180);
- this._xscale = 100 + (this._y - (this.y - 80));
- this.swapDepths(10 * this.angle + 50);
- if(this.angle < 60)
- {
- this._alpha = (this.angle + 10) * 1.43;
- }
- }
- };
- _loc4_ = _loc4_ + 1;
- }
- }
- }
-