Frame 2
stop();
var ship_filter = (new flash.filters.GlowFilter(65280, 0.8, 4, 4, 2, 3, false, false));
var smoke_filter = (new flash.filters.GlowFilter(16711680, 0.8, 4, 4, 2, 3, false, false));
var tunnel_filter = (new flash.filters.GlowFilter(16776960, 0.8, 4, 4, 2, 3, false, false));
var fuel_filter = (new flash.filters.GlowFilter(65535, 0.8, 4, 4, 2, 3, false, false));
var rock_filter = (new flash.filters.GlowFilter(16777215, 0.8, 4, 4, 2, 3, false, false));
var score_filter = (new flash.filters.GlowFilter(16711935, 0.8, 2, 4, 2, 3, false, false));
gravity = 0.1;
thrust = 0.25;
yspeed = 0;
xspeed = 5;
distance = 0;
smoke_interval = 10000;
frames_passed = 0;
tunnel_height = 150;
fuel_freq = 10;
gasoline = 500;
rock_freq = 50;
engines = false;
_root.attachMovie("ship", "ship", _root.getNextHighestDepth(), {_x:150, _y:200});
_root.createEmptyMovieClip("beam", _root.getNextHighestDepth());
_root.createEmptyMovieClip("fuel_movie", _root.getNextHighestDepth());
_root.createEmptyMovieClip("deadly_movie", _root.getNextHighestDepth());
_root.attachMovie("score", "score", _root.getNextHighestDepth());
_root.attachMovie("beam_spot", "beam_spot", _root.getNextHighestDepth());
beam.filters = new Array(smoke_filter);
beam_spot.filters = new Array(smoke_filter);
ship.filters = new Array(ship_filter);
score.filters = new Array(score_filter);
ship.onEnterFrame = function () {
score.sc.text = ((("Distance: " + distance) + " - ") + "Fuel: ") + gasoline;
if ((gasoline > 0) and engines) {
yspeed = yspeed - thrust;
smoke_interval = smoke_interval - 0.25;
gasoline = gasoline - 1;
}
if ((Math.random() * 1000) < fuel_freq) {
fuel = fuel_movie.attachMovie("fuel", "fuel" + fuel_movie.getNextHighestDepth(), fuel_movie.getNextHighestDepth(), {_x:510, _y:(Math.random() * 400) + 50});
fuel.filters = new Array(fuel_filter);
fuel.onEnterFrame = function () {
this._x = this._x - (xspeed * 1.2);
if (this.hitTest(beam_spot)) {
this._alpha = this._alpha - 5;
if (this._alpha < 0) {
this.removeMovieClip();
}
}
dist_x = (ship._x + (28 * Math.cos(angle))) - this._x;
dist_y = (ship._y + (28 * Math.sin(angle))) - this._y;
dist = Math.sqrt((dist_x * dist_x) + (dist_y * dist_y));
if (dist < 10) {
gasoline = gasoline + 100;
this.removeMovieClip();
}
if (this._x < -10) {
this.removeMovieClip();
}
};
}
if ((Math.random() * 1000) < rock_freq) {
rock = deadly_movie.attachMovie("rock", "rock" + deadly_movie.getNextHighestDepth(), deadly_movie.getNextHighestDepth(), {_x:510, _y:(Math.random() * 400) + 50, _rotation:Math.random() * 360});
rock.filters = new Array(rock_filter);
rock.onEnterFrame = function () {
this._x = this._x - xspeed;
if (this.hitTest(beam_spot)) {
this._alpha = this._alpha - 3;
if (this._alpha < 0) {
this.removeMovieClip();
}
}
if (this._x < -10) {
this.removeMovieClip();
}
};
}
yspeed = yspeed + gravity;
this._y = this._y + yspeed;
angle = Math.atan2(yspeed, xspeed);
this._rotation = (angle * 180) / Math.PI;
beam.clear();
beam.lineStyle(1, 16776960, 10 + (40 * Math.random()));
beam.moveTo(this._x + (30 * Math.cos(angle)), this._y + (30 * Math.sin(angle)));
x = 1;
while (x <= 250) {
to_x = this._x + ((30 + x) * Math.cos(angle));
to_y = this._y + ((30 + x) * Math.sin(angle));
if (deadly_movie.hitTest(to_x, to_y, true) or fuel_movie.hitTest(to_x, to_y, true)) {
break;
}
x++;
}
beam.lineTo(to_x, to_y);
beam_spot._x = to_x;
beam_spot._y = to_y;
frames_passed++;
distance = distance + xspeed;
if (frames_passed >= smoke_interval) {
sm = _root.attachMovie("smoke", "smoke" + _root.getNextHighestDepth(), _root.getNextHighestDepth(), {_x:this._x - 2, _y:this._y});
sm.filters = new Array(smoke_filter);
sm.onEnterFrame = function () {
this._x = this._x - xspeed;
this._width = this._width + 0.2;
this._height = this._height + 0.2;
this._alpha = this._alpha - 2;
if (this._alpha <= 0) {
this.removeMovieClip();
}
};
frames_passed = 0;
}
if (((((this._y > 400) or (this._y < 0)) or deadly_movie.hitTest(this._x + (28 * Math.cos(angle)), this._y + (28 * Math.sin(angle)), true)) or deadly_movie.hitTest(this._x + (8 * Math.cos(angle + (Math.PI/2))), this._y + (8 * Math.sin(angle + (Math.PI/2))), true)) or deadly_movie.hitTest(this._x + (8 * Math.cos(angle - (Math.PI/2))), this._y + (8 * Math.sin(angle - (Math.PI/2))), true)) {
yspeed = 0;
this._y = 200;
gasoline = 500;
distance = 0;
deadly_movie.removeMovieClip();
fuel_movie.removeMovieClip();
_root.createEmptyMovieClip("fuel_movie", _root.getNextHighestDepth());
_root.createEmptyMovieClip("deadly_movie", _root.getNextHighestDepth());
}
};
_root.onMouseDown = function () {
engines = true;
smoke_interval = 10;
};
_root.onMouseUp = function () {
engines = false;
smoke_interval = 100000 /* 0x0186A0 */;
};
Symbol 63 Button
on (release) {
getURL ("http://www.newgrounds.com", "_blank");
}
Symbol 72 Button
on (release) {
_root.play();
}
Symbol 74 MovieClip Frame 1
_root.stop();
PercentLoaded = (_root.getBytesLoaded() / _root.getBytesTotal()) * 100;
if (PercentLoaded != 100) {
bar._xscale = PercentLoaded;
} else {
gotoAndStop ("loaded");
}
Symbol 74 MovieClip Frame 2
gotoAndPlay (1);