home *** CD-ROM | disk | FTP | other *** search
- function fuelPadClass()
- {
- }
- fuelPadClass.prototype = new MovieClip();
- fuelPadClass.prototype.onLoad = function()
- {
- this.x = this._x;
- this.y = this._y;
- this.startx = this.x;
- this.starty = this.y;
- this.c = 0;
- this.d = 15;
- };
- fuelPadClass.prototype.onEnterFrame = function()
- {
- if(_root.state == "paused")
- {
- }
- if(_root.state == "playing")
- {
- this.ty = Math.abs(py - (this.y - 15));
- if(this.ty < 15)
- {
- this.tx = Math.abs(px - this.x);
- if(this.tx < 20)
- {
- px = this.x;
- leftThrust = 0;
- rightThrust = 0;
- playerFuel += 0.25;
- thrusting = 0;
- addThrust = 0;
- if(playerYspeed > 0)
- {
- playerYspeed = 0;
- }
- playerState = "refueling";
- if(playerFuel > 100)
- {
- playerFuel = 100;
- }
- if(playerFuel < 100)
- {
- this.c = this.c + 1;
- if(this.c > this.d)
- {
- this.c = 0;
- refuelSnd.start();
- }
- }
- }
- }
- }
- };
- Object.registerClass("fuelPad",fuelPadClass);
-