home *** CD-ROM | disk | FTP | other *** search
- if(_root.paused)
- {
- return undefined;
- }
- gravity = _root.car.gravity;
- _X = parent._x + parent._width / 2 - 15;
- if(_root.car.jet)
- {
- onfloor = true;
- yvel = 0;
- yknown = undefined;
- _Y = _root.car._y;
- return undefined;
- }
- if(_root.gravityType == "normal")
- {
- _Y = _Y + yvel;
- }
- if(_root.gravityType == "reverse")
- {
- _Y = _Y - yvel;
- }
- if(!_root.bg.hitTest(_X,_Y + 1,true))
- {
- yvel += gravity;
- }
- if(_root.gravityType == "normal")
- {
- while(_root.bg.hitTest(_X,_Y + 1,true))
- {
- this._y -= 1;
- onfloor = true;
- yvel = 0;
- yknown = undefined;
- }
- }
- if(_root.gravityType == "reverse")
- {
- while(_root.bg.hitTest(_X,_Y - 5,true))
- {
- this._y += 1;
- onfloor = true;
- yvel = 0;
- yknown = undefined;
- }
- }
- if(_root.gravityType == "normal")
- {
- if(!_root.bg.hitTest(_X,_Y + 5,true))
- {
- onfloor = false;
- }
- }
- if(_root.gravityType == "reverse")
- {
- if(!_root.bg.hitTest(_X,_Y - 10,true))
- {
- onfloor = false;
- }
- }
- if(_root.gravityType == "normal")
- {
- if(_root.bg.hitTest(_X,_Y + 5,true))
- {
- hitBg = true;
- }
- else
- {
- hitBg = false;
- }
- }
- if(distance > 80)
- {
- if(_root.carp2.onfloor)
- {
- if(yknown == undefined)
- {
- yknown = 1;
- }
- if(!_root.bg.hitTest(_X,_Y + 1,true))
- {
- _Y = _root.car._y;
- }
- }
- }
- if(_root.gravityType == "normal")
- {
- if(distance > 200)
- {
- if(!_root.bg.hitTest(_X,_Y + 1,true))
- {
- _Y = _root.car._y;
- }
- }
- }
- if(_root.gravityType == "reverse")
- {
- if(distance < -200)
- {
- if(!_root.bg.hitTest(_X,_Y - 10,true))
- {
- _Y = _root.car._y;
- }
- }
- }
- distance = _Y - _root.car._y;
- if(_root.gravityType == "normal")
- {
- if(_Y < _root.car._y)
- {
- _Y = _root.car._y;
- }
- }
- if(_root.gravityType == "reverse")
- {
- if(_Y > _root.car._y)
- {
- _Y = _root.car._y;
- }
- }
-