Frame 1
quality._visible = false;
soundsControls._visible = false;
music = "start";
stop();
stopAllSounds();
Stage.showMenu = false;
Instance of Symbol 23 MovieClip "quality" in Frame 1
onClipEvent (load) {
if (Key.isToggled(81)) {
toggledQ = true;
}
if (!Key.isToggled(81)) {
toggledQ = false;
}
}
onClipEvent (enterFrame) {
if ((Key.isToggled(81) && (toggledQ == false)) || ((!Key.isToggled(81)) && (toggledQ == true))) {
if (_root._quality == "HIGH") {
_root._quality = "LOW";
} else if (_root._quality == "MEDIUM") {
_root._quality = "HIGH";
} else if (_root._quality == "LOW") {
_root._quality = "MEDIUM";
}
if (toggledQ == false) {
toggledQ = true;
} else if (toggledQ == true) {
toggledQ = false;
}
}
}
Instance of Symbol 25 MovieClip "soundsControls" in Frame 1
onClipEvent (load) {
function soundControl() {
if ((Key.isToggled(77) && (toggledM == false)) || ((!Key.isToggled(77)) && (toggledM == true))) {
if (_root.music == "start") {
_root.music = "stop";
} else if (_root.music == "stop") {
_root.music = "start";
}
if (toggledM == false) {
toggledM = true;
} else if (toggledM == true) {
toggledM = false;
}
}
}
if (Key.isToggled(77)) {
toggledM = true;
}
if (!Key.isToggled(77)) {
toggledM = false;
}
}
onClipEvent (enterFrame) {
soundControl();
}
Frame 2
quality._visible = false;
soundsControls._visible = false;
stop();
Instance of Symbol 46 MovieClip "soundsControls" in Frame 2
onClipEvent (load) {
function soundControl() {
if ((Key.isToggled(77) && (toggledM == false)) || ((!Key.isToggled(77)) && (toggledM == true))) {
if (_root.music == "start") {
stopAllSounds();
_root.soundsControls.gotoAndStop(2);
_root.music = "stop";
} else if (_root.music == "stop") {
stopAllSounds();
_root.soundsControls.gotoAndStop(1);
_root.music = "start";
}
if (toggledM == false) {
toggledM = true;
} else if (toggledM == true) {
toggledM = false;
}
}
}
if (Key.isToggled(77)) {
toggledM = true;
}
if (!Key.isToggled(77)) {
toggledM = false;
}
if (_root.music == "start") {
_root.soundsControls.gotoAndStop(2);
stopAllSounds();
_root.soundsControls.gotoAndStop(1);
} else if (_root.music == "stop") {
_root.soundsControls.gotoAndStop(1);
stopAllSounds();
_root.soundsControls.gotoAndStop(2);
}
}
onClipEvent (enterFrame) {
soundControl();
}
Frame 3
stop();
Frame 4
function carAppear(a, b) {
luck = Math.round(random(300) + 1);
if ((luck % 3) == 0) {
if (i >= 15) {
i = 0;
}
i++;
_root.car1.duplicateMovieClip("car1" + i, 10 + i);
_root["car1" + i]._x = random(100) + a;
_root["car1" + i]._y = random(180) + b;
} else if ((luck % 3) == 1) {
if (j >= 15) {
j = 0;
}
j++;
_root.car2.duplicateMovieClip("car2" + j, 30 + j);
_root["car2" + j]._x = random(100) + a;
_root["car2" + j]._y = random(180) + b;
} else if ((luck % 3) == 2) {
if (k >= 15) {
k = 0;
}
k++;
_root.car3.duplicateMovieClip("car3" + k, 50 + k);
_root["car3" + k]._x = random(100) + a;
_root["car3" + k]._y = random(180) + b;
}
}
stop();
_root.carModel.duplicateMovieClip("car", 3);
_root.car._y = 300;
_root.car._x = 100;
_root.car.upKey = 38;
_root.car.downKey = 40;
_root.car.leftKey = 37;
_root.car.rightKey = 39;
_root._quality = "MEDIUM";
Stage.showMenu = false;
Mouse.hide();
hp = 100;
timeLeft = 2400;
distance = 0;
totalCar = 0;
gameEnd = false;
soundsControls._visible = false;
_root.carModel._visible = true;
_root.car1._visible = false;
_root.car2._visible = false;
_root.car3._visible = false;
_root.end._visible = false;
Instance of Symbol 58 MovieClip "allBG" in Frame 4
onClipEvent (load) {
BGrondStartx = this._x;
}
onClipEvent (enterFrame) {
BGround.duplicateMovieClip("BGround1", 1);
BGround.duplicateMovieClip("BGround2", 2);
_root.distText = ("Distance : " + _root.distance) + "/50";
if (0 < _root.timeLeft) {
_root.timeLeft--;
}
_root.tlText = Math.round(_root.timeLeft / 20);
if (((_root.car.direction == "right") || (_root.car.direction == "upRight")) || (_root.car.direction == "downRight")) {
BGround1._x = BGround._x + (BGround._width - 2);
BGround2._x = BGround._x - (BGround._width - 2);
this._x = this._x - _root.car.speed;
if ((BGrondStartx - BGround._width) >= this._x) {
this._x = BGrondStartx - _root.car.speed;
_root.distance = _root.distance + 1;
}
} else if (_root.car.direction == "left") {
BGround1._x = BGround._x - (BGround._width - 2);
BGround2._x = BGround._x + (BGround._width - 2);
this._x = this._x - _root.car.speed;
if (this._x >= (BGrondStartx + BGround._width)) {
this._x = BGrondStartx - _root.car.speed;
_root.distance = _root.distance - 1;
}
}
}
Instance of Symbol 60 MovieClip "end" in Frame 4
onClipEvent (enterFrame) {
if (((_root.car.direction == "right") || (_root.car.direction == "upRight")) || (_root.car.direction == "downRight")) {
this._x = this._x - _root.car.speed;
} else if (_root.car.direction == "left") {
this._x = this._x - _root.car.speed;
}
if ((_root.distance >= 49) && (this._visible == false)) {
this._visible = true;
this._x = 1500;
this._y = 220;
} else if (_root.distance < 49) {
this._visible = false;
}
}
Instance of Symbol 62 MovieClip "start" in Frame 4
onClipEvent (enterFrame) {
if (((_root.car.direction == "right") || (_root.car.direction == "upRight")) || (_root.car.direction == "downRight")) {
this._x = this._x - _root.car.speed;
} else if (_root.car.direction == "left") {
this._x = this._x - _root.car.speed;
}
}
Instance of Symbol 67 MovieClip "carModel" in Frame 4
onClipEvent (load) {
function soundControl() {
if ((Key.isToggled(77) && (toggledM == false)) || ((!Key.isToggled(77)) && (toggledM == true))) {
if (_root.music == "start") {
stopAllSounds();
_root.soundsControls.gotoAndStop(2);
_root.music = "stop";
} else if (_root.music == "stop") {
stopAllSounds();
_root.soundsControls.gotoAndStop(1);
_root.music = "start";
}
if (toggledM == false) {
toggledM = true;
} else if (toggledM == true) {
toggledM = false;
}
}
}
if (Key.isToggled(77)) {
toggledM = true;
}
if (!Key.isToggled(77)) {
toggledM = false;
}
if (Key.isToggled(81)) {
toggledQ = true;
}
if (!Key.isToggled(81)) {
toggledQ = false;
}
if (_root.music == "start") {
_root.soundsControls.gotoAndStop(2);
stopAllSounds();
_root.soundsControls.gotoAndStop(1);
} else if (_root.music == "stop") {
_root.soundsControls.gotoAndStop(1);
stopAllSounds();
_root.soundsControls.gotoAndStop(2);
}
var direction:String;
var velocity;
a = 0.2;
speed = 0;
maxSpeed = 50;
reSpeed = 15;
direction = "right";
_root.heath = ("Strength : " + _root.hp) + "%";
}
onClipEvent (enterFrame) {
if (this._name != "carModel") {
velocity = Math.round(speed * 5);
if (velocity < 0) {
velocity = velocity * -1;
}
this.swapDepths(this._y);
_root.veloText = ("Speed : " + _root.car.velocity) + " Mph";
if (Key.isDown(rightKey)) {
if (Key.isDown(upKey)) {
direction = "upRight";
((speed < maxSpeed) ? ((speed = speed + a)) : ((speed = maxSpeed)));
this._y = this._y - (speed / 3);
gotoAndPlay(_currentframe +3);
soundControl();
} else if (Key.isDown(downKey)) {
direction = "downRight";
((speed < maxSpeed) ? ((speed = speed + a)) : ((speed = maxSpeed)));
this._y = this._y + (speed / 3);
gotoAndPlay(_currentframe +3);
soundControl();
} else {
direction = "right";
if (speed < 0) {
speed = speed + (7 * a);
} else {
((speed < maxSpeed) ? ((speed = speed + a)) : ((speed = maxSpeed)));
}
gotoAndPlay(_currentframe +3);
soundControl();
}
} else if (Key.isDown(leftKey)) {
direction = "left";
if (0 < speed) {
speed = speed - (7 * a);
brSound.start();
} else {
(((-reSpeed) < speed) ? ((speed = speed - a)) : ((speed = -reSpeed)));
}
gotoAndPlay(_currentframe +3);
soundControl();
} else {
if (1 < speed) {
speed--;
} else if (speed < -1) {
speed++;
} else {
speed = 0;
}
gotoAndStop(_currentframe +3);
soundControl();
}
if (this._y >= 360) {
this._y = 360;
} else if (200 >= this._y) {
this._y = 200;
}
soundControl();
if (speed != 0) {
_root.car.egSound.start(3, 0);
} else {
_root.car.egSound.stop();
}
if ((Key.isToggled(81) && (toggledQ == false)) || ((!Key.isToggled(81)) && (toggledQ == true))) {
if (_root._quality == "HIGH") {
_root._quality = "LOW";
} else if (_root._quality == "MEDIUM") {
_root._quality = "HIGH";
} else if (_root._quality == "LOW") {
_root._quality = "MEDIUM";
}
if (toggledQ == false) {
toggledQ = true;
} else if (toggledQ == true) {
toggledQ = false;
}
}
if (500 < counter) {
counter = 0;
} else {
counter++;
}
if (((_root.totalCar < 5) && (speed >= 25)) && ((counter % (20 - (speed / 5))) < 1)) {
_root.carAppear(600, 190);
_root.totalCar++;
} else if (((_root.totalCar < 5) && (24 >= speed)) && ((counter % (20 - (speed / 5))) < 1)) {
_root.carAppear(-180, 190);
_root.totalCar++;
}
if (((_root.distance == 50) || (0 >= _root.hp)) || (0 >= _root.timeLeft)) {
((0 < speed) ? ((speed = speed - 2)) : ((speed = 0)));
if (speed == 0) {
stopAllSounds();
if (_root.distance == 50) {
_root.gotoAndStop(5);
} else if (0 >= _root.timeLeft) {
_root.gotoAndStop(6);
} else {
_root.gotoAndStop(7);
}
_root.gameEnd = true;
this.removeMovieClip();
}
}
}
}
Instance of Symbol 70 MovieClip "car1" in Frame 4
onClipEvent (load) {
function carCrash() {
ydist = this._y - _root.car._y;
xdist = this._x - _root.car._x;
if (ydist < 0) {
ydist = ydist * -1;
}
if (xdist < 0) {
xdist = xdist * -1;
}
yCrashChk = ydist - 20;
xCrashChk = xdist - 128;
if (((20 >= ydist) && (128 >= xdist)) && (xCrashChk >= yCrashChk)) {
if ((_root.car._x < this._x) && (this.speed < _root.car.speed)) {
_root.hp = _root.hp - Math.round(_root.car.speed - this.speed);
this._x = this._x + ((_root.car.speed - this.speed) * 2);
_root.car.speed = _root.car.speed - ((_root.car.speed - this.speed) + 2);
} else if ((this._x < _root.car._x) && (_root.car.speed < this.speed)) {
_root.hp = _root.hp - Math.round((this.speed - _root.car.speed) / 3);
_root.car.speed = _root.car.speed + (this.speed - _root.car.speed);
this._x = this._x - (this.speed - _root.car.speed);
this.speed = 0;
}
} else if (((20 >= ydist) && (128 >= xdist)) && (xCrashChk < yCrashChk)) {
if (_root.car._y < this._y) {
this._y = this._y + (_root.car.speed / 5);
this.speed = this.speed - (_root.car.speed / 10);
_root.car._y = _root.car._y - (this.speed / 5);
_root.car.speed = _root.car.speed - (_root.car.speed / 10);
_root.hp--;
} else if (this._y < _root.car._y) {
this._y = this._y - (_root.car.speed / 5);
this.speed = this.speed - (_root.car.speed / 10);
_root.car._y = _root.car._y + (this.speed / 5);
_root.car.speed = _root.car.speed - (_root.car.speed / 10);
_root.hp--;
}
}
}
maxSpeed = Math.random(10) + 30;
}
onClipEvent (enterFrame) {
if ((((this._name != "car") && (this._name != "car1")) && (this._name != "car2")) && (this._name != "car3")) {
speed = maxSpeed;
if ((((_root.distance == 50) || (0 >= _root.hp)) || (0 >= _root.timeLeft)) && (_root.gameEnd == true)) {
this.removeMovieClip();
}
if ((this._x >= 750) || (-200 >= this._x)) {
_root.totalCar--;
this.removeMovieClip();
} else if ((600 >= this._x) && (this._x >= -50)) {
this._visible = true;
} else {
this._visible = false;
}
this.swapDepths(this._y);
if (((_root.distance < 50) && (0 < _root.hp)) && (0 < _root.timeLeft)) {
carCrash();
}
if (speed < maxSpeed) {
speed++;
} else {
speed = maxSpeed;
}
this._x = this._x + (speed - _root.car.speed);
_root.heath = ("Strength : " + _root.hp) + "%";
}
if (this._y >= 370) {
this._y = 370;
} else if (190 >= this._y) {
this._y = 190;
}
}
Instance of Symbol 73 MovieClip "car2" in Frame 4
onClipEvent (load) {
function carCrash() {
ydist = this._y - _root.car._y;
xdist = this._x - _root.car._x;
if (ydist < 0) {
ydist = ydist * -1;
}
if (xdist < 0) {
xdist = xdist * -1;
}
yCrashChk = ydist - 20;
xCrashChk = xdist - 128;
if (((20 >= ydist) && (128 >= xdist)) && (xCrashChk >= yCrashChk)) {
if ((_root.car._x < this._x) && (this.speed < _root.car.speed)) {
_root.hp = _root.hp - Math.round(_root.car.speed - this.speed);
this._x = this._x + ((_root.car.speed - this.speed) * 2);
_root.car.speed = _root.car.speed - ((_root.car.speed - this.speed) + 2);
} else if ((this._x < _root.car._x) && (_root.car.speed < this.speed)) {
_root.hp = _root.hp - Math.round((this.speed - _root.car.speed) / 3);
_root.car.speed = _root.car.speed + (this.speed - _root.car.speed);
this._x = this._x - (this.speed - _root.car.speed);
this.speed = 0;
}
} else if (((20 >= ydist) && (128 >= xdist)) && (xCrashChk < yCrashChk)) {
if (_root.car._y < this._y) {
this._y = this._y + (_root.car.speed / 5);
this.speed = this.speed - (_root.car.speed / 10);
_root.car._y = _root.car._y - (this.speed / 5);
_root.car.speed = _root.car.speed - (_root.car.speed / 10);
_root.hp--;
} else if (this._y < _root.car._y) {
this._y = this._y - (_root.car.speed / 5);
this.speed = this.speed - (_root.car.speed / 10);
_root.car._y = _root.car._y + (this.speed / 5);
_root.car.speed = _root.car.speed - (_root.car.speed / 10);
_root.hp--;
}
}
}
maxSpeed = Math.random(10) + 30;
}
onClipEvent (enterFrame) {
if ((((this._name != "car") && (this._name != "car1")) && (this._name != "car2")) && (this._name != "car3")) {
speed = maxSpeed;
if ((((_root.distance == 50) || (0 >= _root.hp)) || (0 >= _root.timeLeft)) && (_root.gameEnd == true)) {
this.removeMovieClip();
}
if ((this._x >= 750) || (-200 >= this._x)) {
_root.totalCar--;
this.removeMovieClip();
} else if ((600 >= this._x) && (this._x >= -50)) {
this._visible = true;
} else {
this._visible = false;
}
this.swapDepths(this._y);
if (((_root.distance < 50) && (0 < _root.hp)) && (0 < _root.timeLeft)) {
carCrash();
}
if (speed < maxSpeed) {
speed++;
} else {
speed = maxSpeed;
}
this._x = this._x + (speed - _root.car.speed);
_root.heath = ("Strength : " + _root.hp) + "%";
}
if (this._y >= 370) {
this._y = 370;
} else if (190 >= this._y) {
this._y = 190;
}
}
Instance of Symbol 76 MovieClip "car3" in Frame 4
onClipEvent (load) {
function carCrash() {
ydist = this._y - _root.car._y;
xdist = this._x - _root.car._x;
if (ydist < 0) {
ydist = ydist * -1;
}
if (xdist < 0) {
xdist = xdist * -1;
}
yCrashChk = ydist - 20;
xCrashChk = xdist - 128;
if (((20 >= ydist) && (128 >= xdist)) && (xCrashChk >= yCrashChk)) {
if ((_root.car._x < this._x) && (this.speed < _root.car.speed)) {
_root.hp = _root.hp - Math.round(_root.car.speed - this.speed);
this._x = this._x + ((_root.car.speed - this.speed) * 2);
_root.car.speed = _root.car.speed - ((_root.car.speed - this.speed) + 2);
} else if ((this._x < _root.car._x) && (_root.car.speed < this.speed)) {
_root.hp = _root.hp - Math.round((this.speed - _root.car.speed) / 3);
_root.car.speed = _root.car.speed + (this.speed - _root.car.speed);
this._x = this._x - (this.speed - _root.car.speed);
this.speed = 0;
}
} else if (((20 >= ydist) && (128 >= xdist)) && (xCrashChk < yCrashChk)) {
if (_root.car._y < this._y) {
this._y = this._y + (_root.car.speed / 5);
this.speed = this.speed - (_root.car.speed / 10);
_root.car._y = _root.car._y - (this.speed / 5);
_root.car.speed = _root.car.speed - (_root.car.speed / 10);
_root.hp--;
} else if (this._y < _root.car._y) {
this._y = this._y - (_root.car.speed / 5);
this.speed = this.speed - (_root.car.speed / 10);
_root.car._y = _root.car._y + (this.speed / 5);
_root.car.speed = _root.car.speed - (_root.car.speed / 10);
_root.hp--;
}
}
}
maxSpeed = Math.random(10) + 30;
}
onClipEvent (enterFrame) {
if ((((this._name != "car") && (this._name != "car1")) && (this._name != "car2")) && (this._name != "car3")) {
speed = maxSpeed;
if ((((_root.distance == 50) || (0 >= _root.hp)) || (0 >= _root.timeLeft)) && (_root.gameEnd == true)) {
this.removeMovieClip();
}
if ((this._x >= 750) || (-200 >= this._x)) {
_root.totalCar--;
this.removeMovieClip();
} else if ((600 >= this._x) && (this._x >= -50)) {
this._visible = true;
} else {
this._visible = false;
}
this.swapDepths(this._y);
if (((_root.distance < 50) && (0 < _root.hp)) && (0 < _root.timeLeft)) {
carCrash();
}
if (speed < maxSpeed) {
speed++;
} else {
speed = maxSpeed;
}
this._x = this._x + (speed - _root.car.speed);
_root.heath = ("Strength : " + _root.hp) + "%";
}
if (this._y >= 370) {
this._y = 370;
} else if (190 >= this._y) {
this._y = 190;
}
}
Frame 5
quality._visible = false;
soundsControls._visible = false;
_root.score = Math.round((((_root.timeLeft / 20) + 1) * ((_root.timeLeft / 20) + 1)) * (_root.hp + 2));
Mouse.show();
Instance of Symbol 23 MovieClip "quality" in Frame 5
onClipEvent (load) {
if (Key.isToggled(81)) {
toggledQ = true;
}
if (!Key.isToggled(81)) {
toggledQ = false;
}
}
onClipEvent (enterFrame) {
if ((Key.isToggled(81) && (toggledQ == false)) || ((!Key.isToggled(81)) && (toggledQ == true))) {
if (_root._quality == "HIGH") {
_root._quality = "LOW";
} else if (_root._quality == "MEDIUM") {
_root._quality = "HIGH";
} else if (_root._quality == "LOW") {
_root._quality = "MEDIUM";
}
if (toggledQ == false) {
toggledQ = true;
} else if (toggledQ == true) {
toggledQ = false;
}
}
}
Instance of Symbol 94 MovieClip "soundsControls" in Frame 5
onClipEvent (load) {
function soundControl() {
if ((Key.isToggled(77) && (toggledM == false)) || ((!Key.isToggled(77)) && (toggledM == true))) {
if (_root.music == "start") {
stopAllSounds();
_root.soundsControls.gotoAndStop(2);
_root.music = "stop";
} else if (_root.music == "stop") {
stopAllSounds();
_root.soundsControls.gotoAndStop(1);
_root.music = "start";
}
if (toggledM == false) {
toggledM = true;
} else if (toggledM == true) {
toggledM = false;
}
}
}
if (Key.isToggled(77)) {
toggledM = true;
}
if (!Key.isToggled(77)) {
toggledM = false;
}
if (_root.music == "start") {
_root.soundsControls.gotoAndStop(4);
stopAllSounds();
_root.soundsControls.gotoAndStop(3);
} else if (_root.music == "stop") {
_root.soundsControls.gotoAndStop(3);
stopAllSounds();
_root.soundsControls.gotoAndStop(4);
}
}
onClipEvent (enterFrame) {
soundControl();
}
Frame 6
stop();
quality._visible = false;
soundsControls._visible = false;
Mouse.show();
Instance of Symbol 94 MovieClip "soundsControls" in Frame 6
onClipEvent (load) {
function soundControl() {
if ((Key.isToggled(77) && (toggledM == false)) || ((!Key.isToggled(77)) && (toggledM == true))) {
if (_root.music == "start") {
stopAllSounds();
_root.soundsControls.gotoAndStop(2);
_root.music = "stop";
} else if (_root.music == "stop") {
stopAllSounds();
_root.soundsControls.gotoAndStop(1);
_root.music = "start";
}
if (toggledM == false) {
toggledM = true;
} else if (toggledM == true) {
toggledM = false;
}
}
}
if (Key.isToggled(77)) {
toggledM = true;
}
if (!Key.isToggled(77)) {
toggledM = false;
}
if (_root.music == "start") {
_root.soundsControls.gotoAndStop(2);
stopAllSounds();
_root.soundsControls.gotoAndStop(1);
} else if (_root.music == "stop") {
_root.soundsControls.gotoAndStop(1);
stopAllSounds();
_root.soundsControls.gotoAndStop(2);
}
}
onClipEvent (enterFrame) {
soundControl();
}
Frame 7
stop();
quality._visible = false;
soundsControls._visible = false;
Mouse.show();
Symbol 12 Button
on (release) {
_root.play();
}
Symbol 13 MovieClip Frame 1
_root.stop();
PercentLoaded = (_root.getBytesLoaded() / _root.getBytesTotal()) * 100;
if (PercentLoaded != 100) {
setProperty(bar, _xscale , PercentLoaded);
} else {
gotoAndStop (3);
}
Symbol 13 MovieClip Frame 2
gotoAndPlay (1);
Symbol 32 Button
on (release) {
stopAllSounds();
gotoAndStop (4);
}
Symbol 34 Button
on (release) {
gotoAndStop (3);
}
Symbol 43 MovieClip Frame 1
Symbol 46 MovieClip Frame 1
stop();
Symbol 46 MovieClip Frame 2
stop();
Symbol 67 MovieClip Frame 1
brSound = new Sound(this);
brSound.attachSound("break");
egSound = new Sound(this);
egSound.attachSound("engine");
stop();
Symbol 84 MovieClip Frame 1
stop();
Symbol 84 MovieClip Frame 2
stop();
Symbol 86 Button
on (release) {
_root.hp = 200;
_root.timeLeft = 2400;
_root.distance = 0;
_root.totalCar = 0;
gotoAndStop (2);
}
Symbol 94 MovieClip Frame 1
stop();
Symbol 94 MovieClip Frame 2
stop();
Symbol 94 MovieClip Frame 3
stop();
Symbol 94 MovieClip Frame 4
stop();