Frame 1
stop();
Frame 2
Loading = _root.getBytesLoaded();
Total = _root.getBytesTotal();
if (Loading == Total) {
gotoAndPlay (3);
} else {
_root.loaded = math.floor((Loading / Total) * 100) add "%";
gotoAndPlay (2);
}
Frame 3
this.createEmptyMovieClip("s1", 1);
my_Music = new Sound(s1);
my_Music.attachSound("appolo");
my_Music.start(0, 100);
my_Music.setVolume(100);
stop();
Frame 4
this.createEmptyMovieClip("s2", 2);
my_Gas = new Sound(s2);
my_Gas.attachSound("gas");
this.createEmptyMovieClip("s3", 3);
my_Kayma = new Sound(s3);
my_Kayma.attachSound("kayma");
this.createEmptyMovieClip("s4", 4);
my_Bip = new Sound(s4);
my_Bip.attachSound("bipp");
this.createEmptyMovieClip("s5", 5);
my_Check = new Sound(s5);
my_Check.attachSound("checkpoint");
this.createEmptyMovieClip("s6", 6);
my_Speedup = new Sound(s6);
my_Speedup.attachSound("speedup");
my_Speepup.setVolume(100);
my_Check.setVolume(100);
my_Kayma.start(0, 2000);
my_Gas.start(0, 9999);
my_Gas.setVolume(0);
my_Bip.setVolume(100);
my_Kayma.setVolume(0);
my_Music.setVolume(40);
_root.zoomin._visible = false;
_root.zoomin._alpha = 0;
stop();
mbenneyTimer = function () {
this.reset();
};
mT = mbenneyTimer.prototype;
mT.reset = function () {
var _local2 = this;
_local2.oldTime = 0;
_local2.pause = true;
_local2.totalTime = 0;
};
mT.stop = function () {
var _local2 = this;
if (!_local2.pause) {
_local2.pause = true;
_local2.totalTime = _local2.totalTime + (getTimer() - _local2.oldTime);
}
};
mT.start = function () {
var _local2 = this;
if (_local2.pause) {
_local2.pause = false;
_local2.oldTime = getTimer();
}
};
mT.getMili = function () {
var _local2 = this;
var _local3 = _local2.totalTime;
if (!_local2.pause) {
_local3 = _local3 + (getTimer() - _local2.oldTime);
}
return(_local3);
};
mT.getSecs = function () {
var _local2 = this;
var _local3 = _local2.totalTime / 1000;
if (!_local2.pause) {
_local3 = _local3 + ((getTimer() - _local2.oldTime) / 1000);
}
return(Math.round(_local3));
};
mT.getMins = function () {
var _local2 = this;
var _local3 = _local2.totalTime / 1000;
if (!_local2.pause) {
_local3 = _local3 + (((getTimer() - _local2.oldTime) / 1000) / 60);
}
return(Math.round(_local3));
};
mT.getCount = function (secs) {
var _local2 = this;
var _local3 = _local2.totalTime;
if (!_local2.pause) {
_local3 = _local3 + ((getTimer() - _local2.oldTime) / 1000);
}
var _local4 = secs - _local3;
return(Math.round(_local4));
};
Instance of Symbol 68 MovieClip "car" in Frame 4
onClipEvent (load) {
track_x = -294;
track_y = -2207;
this._x = 350;
this._y = 250;
angle = 1.560932;
_rotation = ((angle * 180) / 3.141593);
_root.track._x = track_x;
_root.track._y = track_y;
_root.lap1 = "00:00";
_root.lap2 = "00:00";
_root.lap3 = "00:00";
_root.timer = "";
}
Frame 5
stop();
Instance of Symbol 68 MovieClip "car" in Frame 5
onClipEvent (load) {
function getPos(clip) {
var _local1 = {x:0, y:0};
clip.localToGlobal(_local1);
return(_local1);
}
function two(x) {
return(((x > 9) ? "" : "0") + x);
}
function three(x) {
var _local1 = x;
return((((_local1 > 99) ? "" : "0") + ((_local1 > 9) ? "" : "0")) + _local1);
}
function displaytime(ms) {
var _local3 = Math.floor(ms / 1000);
ms = ms % 1000;
var _local1 = three(ms);
var _local2 = Math.floor(_local3 / 60);
_local3 = _local3 % 60;
_local1 = (two(_local3) + ":") + _local1;
var _local5 = Math.floor(_local2 / 60);
_local2 = _local2 % 60;
_local1 = (two(_local2) + ":") + _local1;
return(_local1);
}
function skid(Handbrakey) {
var _local4 = this;
var _local5 = _root.track.attachMovie("skidmark", "skidleft" + skids, skids);
var _local3 = 0;
while (_local3 < _local4.displaywheels) {
wheelsPos[_local3] = getPos(_local4["w" + _local3]);
if (Handbrakey) {
_local5.lineStyle(4, 0, 70);
_local5.moveto(_local4.wheelsPos[_local3].x - track_x, _local4.wheelsPos[_local3].y - track_y);
_local5.lineTo(_local4.lastpos[_local3].x, _local4.lastpos[_local3].y);
} else {
_local5.lineStyle(3, 0, 50);
_local5.moveto(_local4.wheelsPos[_local3].x - track_x, _local4.wheelsPos[_local3].y - track_y);
_local5.lineTo(_local4.lastpos[_local3].x, _local4.lastpos[_local3].y);
}
lastpos[_local3].x = _local4.wheelsPos[_local3].x - track_x;
lastpos[_local3].y = _local4.wheelsPos[_local3].y - track_y;
skids++;
_local3++;
}
return(true);
}
function setLastpos() {
var _local3 = this;
var _local2 = 0;
while (_local2 < _local3.displaywheels) {
_local3.wheelsPos[_local2] = getPos(_local3["w" + _local2]);
lastpos[_local2].x = _local3.wheelsPos[_local2].x - track_x;
lastpos[_local2].y = _local3.wheelsPos[_local2].y - track_y;
_local2++;
}
}
function adjust(v, threshold, maximum) {
vx = 0;
if (v <= threshold) {
vx = (v / threshold) * 1;
} else {
vx = 1;
}
return(vx);
}
accel = 0.3;
steer = 0.08;
steer_normal = 0.08;
steer_handbrake = 0.099;
steer_threshold = 4;
MINspd = -5;
MAXspd = 22;
MAXskiddisplay = 2;
MAXturnSpd = 15;
MaxTurnSkid = 20;
deccel = 0.92;
handbrake = 0.93;
handbrake_traction = 20;
drift = 0.98;
speed = 0;
boyut = 1;
surface = 2;
traction = 5;
traction_max = 2;
vector = [0, 0];
bounceBack = 0.6;
laptimes = new Array();
laps = 3;
var i = 1;
while (i <= laps) {
laptimes[i] = 0;
i++;
}
checkpoints = new Array();
checks = 4;
var i = 0;
while (i <= checks) {
checkpoints[i] = false;
i++;
}
lap = 0;
collide = false;
track_x = -294;
track_y = -2207;
this._x = 350;
this._y = 250;
angle = 1.560932;
_rotation = ((angle * 180) / 3.141593);
myTimer = new _root.mbenneyTimer();
displaywheels = 2;
wheelsPos = new Array();
lastPos = new Array();
var i = 0;
while (i < displaywheels) {
wheelsPos[i] = getPos(this["w" + i]);
lastPos[i] = wheelspos[i];
i++;
}
skidding = false;
turnskidding = false;
skids = 1;
myTimer.start();
}
onClipEvent (enterFrame) {
_xscale = (100 / boyut);
_yscale = (100 / boyut);
_rotation = ((angle * 180) / 3.141593);
_root.track._x = track_x;
_root.track._y = track_y;
UD = Key.isDown(38) - Key.isDown(40);
LR = Key.isDown(39) - Key.isDown(37);
HAND = Key.isDown(32);
if (LR) {
angle = angle + ((LR * steer) * adjust(Math.Abs(speed), steer_threshold, MAXSpd));
if (speed > maxturnskid) {
if (!turnskidding) {
setLastpos();
}
turnskidding = skid(HAND);
_root.my_Kayma.setVolume(30);
} else {
turnskidding = false;
_root.my_Kayma.setVolume(0);
}
} else {
turnskidding = false;
_root.my_Kayma.setVolume(0);
}
if (!UD) {
speed = speed * drift;
} else if (UD & (!HAND)) {
speed = Math.min(Math.max(speed + (UD * accel), MINspd), MAXspd);
}
if (Math.abs(speed) < (accel / 2)) {
speed = 0;
}
if (HAND) {
_root.my_Kayma.setVolume(50);
speed = speed * handbrake;
if (speed > MAXskiddisplay) {
steer = steer_handbrake;
if (!skidding) {
setLastpos();
}
skidding = skid(HAND);
}
traction = handbrake_traction / surface;
} else {
skidding = false;
traction = Math.max(traction_max, Math.abs((speed - MAXturnSpd) / surface));
steer = steer_normal;
}
if (speed < 0) {
traction = 1;
}
if (!_root.track.track.hittest(_x, _y, true)) {
speed = speed * 0.95;
traction = traction * 1.1;
}
var frontpos = new Array();
var i = 0;
while (i < this.displaywheels) {
this.frontpos[i] = getPos(this["f" + i]);
i++;
}
if (_root.track.crunchers.hittest(frontpos[0].x, frontpos[0].y, true) & (!collide)) {
speed = (-speed) * bounceback;
vector[0] = -vector[0];
vector[1] = -vector[1];
collide = true;
} else if (_root.track.crunchers.hittest(frontpos[1].x, frontpos[1].y, true) & (!collide)) {
speed = (-speed) * bounceback;
vector[0] = -vector[0];
vector[1] = -vector[1];
collide = true;
} else {
collide = false;
}
track_x = track_x + ((vector[0] = vector[0] + (((Math.cos(angle) * speed) - vector[0]) / traction)));
track_y = track_y + ((vector[1] = vector[1] + (((Math.sin(angle) * speed) - vector[1]) / traction)));
_root.timer = displaytime(myTimer.getMili());
_root.my_Gas.setVolume(int(speed * 2));
_root.speedHand._rotation = Math.max(-11, Math.Abs(speed * 8.5));
if (_root.track.bonusben10.hittest(_x, _y, true)) {
boyut = 2;
MAXspd = 28;
_root.zoomin.zaraba._visible = true;
_root.track.bonusben10._visible = false;
_root.my_Speedup.start();
}
if (_root.track.bonusben11.hittest(_x, _y, true)) {
boyut = 2;
MAXspd = 28;
_root.zoomin.zaraba._visible = true;
_root.track.bonusben11._visible = false;
_root.my_Speedup.start();
}
if (_root.track.check1.hittest(_x, _y, true)) {
checkpoints[1] = true;
boyut = 1;
MAXspd = 22;
_root.zoomin.zaraba._visible = false;
_root.track.bonusben10._visible = true;
_root.track.bonusben11._visible = true;
}
if (_root.track.check2.hittest(_x, _y, true)) {
checkpoints[2] = true;
boyut = 1;
MAXspd = 22;
_root.zoomin.zaraba._visible = false;
_root.track.bonusben10._visible = true;
_root.track.bonusben11._visible = true;
}
if (_root.track.check3.hittest(_x, _y, true)) {
checkpoints[3] = true;
boyut = 1;
MAXspd = 22;
_root.zoomin.zaraba._visible = false;
_root.track.bonusben10._visible = true;
_root.track.bonusben11._visible = true;
}
if (_root.track.check4.hittest(_x, _y, true)) {
checkpoints[4] = true;
boyut = 1;
MAXspd = 22;
_root.zoomin.zaraba._visible = false;
_root.track.bonusben10._visible = true;
_root.track.bonusben11._visible = true;
}
if (_root.track.check0.hittest(_x, _y, true)) {
if (((checkpoints[1] & checkpoints[2]) & checkpoints[3]) & checkpoints[4]) {
lap++;
_root.my_Check.start();
if (lap == 1) {
laptimes[1] = myTimer.getMili();
_root.lap1 = displaytime(laptimes[1]);
} else if (lap == 2) {
laptimes[2] = myTimer.getMili() - laptimes[1];
_root.lap2 = displaytime(laptimes[2]);
} else if (lap == 3) {
laptimes[3] = (myTimer.getMili() - laptimes[2]) - laptimes[1];
_root.lap3 = displaytime(laptimes[3]);
}
var i = 0;
while (i <= checks) {
checkpoints[i] = false;
i++;
}
if (lap >= laps) {
mytimer.stop();
_root.racetimer = myTimer.getMili();
_root.bestlaptime = Math.Min(laptimes[1], Math.Min(laptimes[2], laptimes[3]));
_root.gotoandstop(6);
}
}
}
}
Frame 6
function two(x) {
return(((x > 9) ? "" : "0") + x);
}
function three(x) {
var _local1 = x;
return((((_local1 > 99) ? "" : "0") + ((_local1 > 9) ? "" : "0")) + _local1);
}
function displaytime(ms) {
var _local3 = Math.floor(ms / 1000);
ms = ms % 1000;
var _local1 = three(ms);
var _local2 = Math.floor(_local3 / 60);
_local3 = _local3 % 60;
_local1 = (two(_local3) + ":") + _local1;
var _local5 = Math.floor(_local2 / 60);
_local2 = _local2 % 60;
_local1 = (two(_local2) + ":") + _local1;
return(_local1);
}
_root.totalrace = displaytime(_root.racetimer);
pnconnector.storeScore(_root.racetimer);
_root.bestlap = displaytime(_root.bestlaptime);
stop();
Instance of Symbol 95 MovieClip [pnFlashGames] "pnconnector" in Frame 6
//component parameters
onClipEvent (initialize) {
debugMode = false;
}
//component parameters
onClipEvent (initialize) {
debugMode = true;
}
Symbol 7 MovieClip [skidmark] Frame 71
this.removemovieclip();
Symbol 16 MovieClip Frame 142
_parent.play();
stop();
Symbol 24 Button
on (release) {
getURL ("http://www.flashgamehole.com/en/flash-games/Ben%2010.html", "_blank");
}
Symbol 28 Button
on (release) {
gotoAndPlay (4);
}
Symbol 31 Button
on (release) {
getURL ("http://www.flashgamehole.com/en/flash-games/Ben%2010.html", "_blank");
}
Symbol 43 MovieClip Frame 1
this.track._visible = false;
this.crunchers._visible = false;
this.bonusben10._visible = true;
this.check0._visible = false;
this.check1._visible = false;
this.check2._visible = false;
this.check3._visible = false;
this.check4._visible = false;
stop();
Symbol 49 Button
on (release) {
getURL ("http://www.flashgamehole.com/en/flash-games/Ben%2010.html", "_blank");
}
Symbol 58 Button
on (release) {
getURL ("http://www.flashgamehole.com", "_blank");
}
Symbol 68 MovieClip Frame 1
fscommand ("allowscale", "false");
Symbol 83 MovieClip Frame 25
_root.my_Bip.start(0, 1);
_root.my_Bip.setVolume(100);
Symbol 83 MovieClip Frame 51
_root.my_Bip.start(0, 1);
_root.my_Bip.setVolume(100);
Symbol 83 MovieClip Frame 76
_root.my_Bip.start(0, 1);
_root.my_Bip.setVolume(100);
Symbol 83 MovieClip Frame 102
_root.my_Bip.start(0, 1);
_root.my_Bip.setVolume(100);
_root.gotoandplay(5);
this.movieclipremove();
Symbol 87 MovieClip Frame 1
this.zaraba._visible = false;
stop();
Symbol 94 Button
on (press) {
_root.myMusic.stop();
_root.myGas.stop();
_root.myKayma.stop();
}
on (release) {
gotoAndStop (4);
}