Frame 1
b1 = _root.getBytesLoaded();
b2 = _root.getBytesTotal();
tgPrel = 1 + Math.round((b1 * 100) / b2);
prel.gotoAndStop(tgPrel);
if (b1 >= b2) {
gotoAndPlay ("intro");
}
Frame 4
if (Math.round(b1 / 1024) <= 35) {
gotoAndPlay ("loop1");
}
Frame 5
_root.b1 = _root.getBytesLoaded();
_root.b2 = _root.getBytesTotal();
_root.tgPrel = 1 + Math.round((b1 * 100) / b2);
_root.tg = _root.tgPrel - 2;
trace("_root.tg: " + _root.tg);
if (_root.tg <= 9) {
_root.procent = "0" + _root.tg;
} else {
_root.procent = _root.tg;
}
_root.prel.gotoAndStop(_root.tgPrel);
Frame 9
if (Math.round(b1 / 1024) <= 100) {
gotoAndPlay ("loop2");
}
Frame 11
_root.b1 = _root.getBytesLoaded();
_root.b2 = _root.getBytesTotal();
_root.tgPrel = 1 + Math.round((b1 * 100) / b2);
_root.tg = _root.tgPrel - 2;
trace("_root.TG: " + tgPrel);
if (_root.tgPrel <= 9) {
_root.procent = "0" + tg;
trace(_root.procent);
} else {
_root.procent = tg;
}
_root.prel.gotoAndStop(_root.tgPrel);
Frame 14
if (b1 < b2) {
gotoAndPlay ("loop3");
}
Frame 15
_root.procent = "--";
prel.gotoAndStop(100);
Frame 166
_root.locatie = _url;
if (_root.locatie.indexOf("freeonlinegames", 0) != -1) {
_root.play();
} else {
_root.gotoAndPlay("loop1");
}
Frame 174
_root.sunet = true;
_root.pauza = false;
_root.locatie = _url;
if (_root.locatie.indexOf("freeonlinegames", 0) != -1) {
_root.play();
} else {
_root.gotoAndPlay("loop1");
}
Frame 175
function initVehicle() {
particles = [];
particles[0] = {x:0, y:0, r:vehicleVars.wRear, w:{w:0}, c:true, g:grav * 3};
particles[1] = {x:80, y:0, r:vehicleVars.wFront, w:{w:0}, c:true, g:grav * 3};
particles[2] = {x:20, y:-22, c:false, g:grav / 4.5};
particles[3] = {x:60, y:-22, c:false, g:grav / 4.5};
particles[4] = {x:10, y:-42, c:true, g:grav / 6};
particles[5] = {x:70, y:-42, c:true, g:grav / 6};
particles[6] = {x:40, y:-58, c:true, g:grav / 10};
var _local1 = 2;
while (_local1 < particles.length) {
var _local2 = vC.attachMovie("mcParticle", "particle" + _local1, vC.getNextHighestDepth());
_local2._x = particles[_local1].x;
_local2._y = particles[_local1].y;
_local1++;
}
_local1 = 0;
while (_local1 < particles.length) {
p = particles[_local1];
if (p.r == undefined) {
p.r = 0;
p.w = false;
} else if (p.w != undefined) {
p.w.x = p.r;
p.w.y = 0;
p.w.ox = p.w.x;
p.w.oy = p.w.y;
p.w.rL = p.r;
p.w.s = 0;
}
p.x = p.x + initX;
p.y = p.y + initY;
p.ox = p.x;
p.oy = p.y;
_local1++;
}
springs = [];
springs[0] = {p0:particles[4], p1:particles[2], w0:spring1, w1:spring2};
springs[1] = {p0:particles[5], p1:particles[3], w0:spring1, w1:spring2};
springs[2] = {p0:particles[2], p1:particles[3], w0:spring1, w1:spring2};
springs[3] = {v:particles[1], p0:particles[0], p1:particles[4], w0:spring1, w1:spring2, aMin:0, aMax:360};
springs[4] = {p0:particles[1], p1:particles[5], w0:spring1, w1:spring2};
springs[5] = {p0:particles[4], p1:particles[5], w0:spring1, w1:spring2};
springs[6] = {p0:particles[0], p1:particles[5], w0:spring1, w1:spring2};
springs[7] = {p0:particles[1], p1:particles[4], w0:spring1, w1:spring2};
springs[8] = {p0:particles[2], p1:particles[5], w0:spring1, w1:spring2};
springs[9] = {v:particles[0], p0:particles[2], p1:particles[4], w0:spring1, w1:spring2, aMin:0, aMax:360};
springs[10] = {p0:particles[3], p1:particles[4], w0:spring1, w1:spring2};
springs[11] = {p0:particles[3], p1:particles[5], w0:spring1, w1:spring2};
springs[12] = {v:particles[5], p0:particles[0], p1:particles[1], w0:spring1, w1:spring2, aMin:0, aMax:360};
springs[13] = {p0:particles[0], p1:particles[6], w0:spring1, w1:spring2};
springs[14] = {p0:particles[1], p1:particles[6], w0:spring1, w1:spring2};
springs[15] = {p0:particles[2], p1:particles[6], w0:spring1, w1:spring2};
springs[16] = {p0:particles[3], p1:particles[6], w0:spring1, w1:spring2};
_local1 = 0;
while (_local1 < springs.length) {
s = springs[_local1];
s.rL = getDistance(s.p0, s.p1);
if (s.c == undefined) {
s.c = 5;
}
_local1++;
}
if (gCar == true) {
aTerrain = [];
aTerrain[0] = {x0:0, y0:120, x1:500, y1:120};
} else if (oppS != true) {
aTerrain = [];
aTerrain[0] = {x0:-300, y0:380, x1:1000, y1:380};
aTerrain[1] = {x0:1000, y0:380, x1:1050, y1:390};
aTerrain[2] = {x0:1050, y0:390, x1:1380, y1:360};
aTerrain[3] = {x0:1380, y0:360, x1:2000, y1:320};
aTerrain[4] = {x0:2000, y0:320, x1:2200, y1:270};
aTerrain[5] = {x0:2200, y0:270, x1:2300, y1:220};
} else {
aTerrain = [];
aTerrain[0] = {x0:-300, y0:350, x1:50, y1:350};
aTerrain[1] = {x0:50, y0:350, x1:150, y1:310};
aTerrain[2] = {x0:150, y0:310, x1:400, y1:310};
aTerrain[3] = {x0:400, y0:310, x1:500, y1:350};
aTerrain[4] = {x0:500, y0:350, x1:850, y1:350};
}
}
function rollWheel(p, nx, ny) {
if (nx < -1) {
nx = -1;
} else if (nx > 1) {
nx = 1;
}
if (ny < -1) {
ny = -1;
} else if (ny > 1) {
ny = 1;
}
w = p.w;
var _local8 = 1;
var _local6 = 1;
var _local2 = -w.y;
var _local1 = w.x;
var _local7 = Math.sqrt((_local2 * _local2) + (_local1 * _local1));
_local2 = _local2 / _local7;
_local1 = _local1 / _local7;
var _local15 = (_local2 * w.s) * _local6;
var _local13 = (_local1 * w.s) * _local8;
var _local14 = p.x - p.ox;
var _local12 = p.y - p.oy;
var _local11 = _local14 + _local15;
var _local10 = _local12 + _local13;
var _local9 = ((-ny) * _local11) + (nx * _local10);
w.ox = w.x - (_local9 * _local2);
w.oy = w.y - (_local9 * _local1);
w0 = 1 - w.w;
p.x = p.x + (((w0 * w.s) * _local6) * (-ny));
p.y = p.y + (((w0 * w.s) * _local8) * nx);
w.s = w.s * w.w;
}
function aF(p, pressure) {
p.ox = p.ox + ((pressure * f) * (p.x - p.ox));
p.oy = p.oy + ((pressure * f) * (p.y - p.oy));
}
function lean(dir) {
d = getDistance(particles[0], particles[1]) / 2;
a = getAngle(particles[0], particles[1]) + (dir * riderPower);
mX = getMean([particles[0].x, particles[1].x]);
mY = getMean([particles[0].y, particles[1].y]);
particles[0].x = mX - (Math.cos((a * Math.PI) / 180) * d);
particles[0].y = mY - (Math.sin((a * Math.PI) / 180) * d);
particles[1].x = mX + (Math.cos((a * Math.PI) / 180) * d);
particles[1].y = mY + (Math.sin((a * Math.PI) / 180) * d);
}
function Verlet(car) {
var _local1 = 14;
i = 0;
while (i < 2) {
((car == 1) ? ((p = particles[i])) : ((p = oppParticles[i])));
if (p.w != false) {
var p = p.w;
var _local12 = -p.y;
var _local11 = p.x;
var _local9 = Math.sqrt((_local12 * _local12) + (_local11 * _local11));
_local12 = _local12 / _local9;
_local11 = _local11 / _local9;
p.x = p.x + (p.s * _local12);
p.y = p.y + (p.s * _local11);
var _local16 = p.ox;
var _local15 = p.oy;
var _local14 = (p.ox = p.x);
var _local13 = (p.oy = p.y);
var _local7 = _local14 - _local16;
_local7 = Math.max(-_local1, Math.min(_local1, _local7));
var _local6 = _local13 - _local15;
_local6 = Math.max(-_local1, Math.min(_local1, _local6));
p.x = p.x + (drag * _local7);
p.y = p.y + (drag * _local6);
var _local10 = Math.sqrt((p.x * p.x) + (p.y * p.y));
var _local5 = (_local10 - p.rL) / _local10;
p.x = p.x - (p.x * _local5);
p.y = p.y - (p.y * _local5);
}
i++;
}
var _local8;
((car == 1) ? (_local8 = particles) : (_local8 = oppParticles));
i = 0;
while (i < _local8.length) {
var p = _local8[i];
var _local16 = p.ox;
var _local15 = p.oy;
var _local14 = (p.ox = p.x);
var _local13 = (p.oy = p.y);
var _local7 = _local14 - _local16;
_local7 = Math.max(-_local1, Math.min(_local1, _local7));
var _local6 = _local13 - _local15;
_local6 = Math.max(-_local1, Math.min(_local1, _local6));
p.x = p.x + (drag * _local7);
p.y = p.y + ((drag * _local6) + p.g);
i++;
}
((car == 1) ? (_local8 = springs) : (_local8 = oppSprings));
i = 0;
while (i < _local8.length) {
var _local2 = _local8[i];
var _local4 = _local2.p0;
var _local3 = _local2.p1;
var _local12 = _local4.x - _local3.x;
var _local11 = _local4.y - _local3.y;
var _local10 = getDistance(_local4, _local3);
var _local5 = (d1 = (_local10 - _local2.rL) / _local10);
_local5 = _local5 * _local2.w0;
d1 = d1 * _local2.w1;
_local4.x = _local4.x - (_local12 * _local5);
_local4.y = _local4.y - (_local11 * _local5);
_local3.x = _local3.x + (_local12 * d1);
_local3.y = _local3.y + (_local11 * d1);
i++;
}
}
function generateTerrain() {
var _local13 = main._x;
if (aTerrain[0].x1 < ((-_local13) - 600)) {
aTerrain.shift();
}
var _local3 = aTerrain.length - 1;
var _local24 = aTerrain[_local3].x0;
var _local1 = aTerrain[_local3].x1;
var _local23 = aTerrain[_local3].y0;
var _local2 = aTerrain[_local3].y1;
if (_local1 < (((-_local13) + sW) + 340)) {
if (terrainStep <= 0) {
if (flatTerrain == true) {
tMode = "finish";
} else if (tMode == 2) {
tMode = 3;
} else if (tMode == 4) {
tMode = 1;
} else {
var _local10 = Math.random();
if (_local10 < 0.06) {
tMode = 4;
} else if (_local10 < 0.1) {
tMode = 2;
} else if (_local10 < 0.14) {
tMode = 5;
} else {
tMode = 0;
}
}
if (tMode != 0) {
var _local16 = random(6) + 4;
tSteps = _local16;
terrainStep = _local16;
}
}
var _local5 = 1.7 - (Math.random() * 1.4);
var _local6 = 1.7 - (Math.random() * 1.4);
var _local21 = (_local5 + 1) / 2;
var _local18 = (_local6 + 1) / 2;
var _local4 = planet.surface / 100;
if (tMode == "finish") {
var _local15 = _local1;
var _local14 = _local15 + 300;
var _local11 = _local2;
var _local17 = _local11;
aTerrain.push({x0:_local15, y0:_local11, x1:_local14, y1:_local17});
}
if (tMode == 0) {
var _local22 = aTerrain[_local3 - 1].x1 - aTerrain[_local3 - 1].x0;
var _local19 = aTerrain[_local3 - 1].y1 - aTerrain[_local3 - 1].y0;
var _local8 = _local19 / _local22;
var _local15 = _local1;
var _local14 = (_local1 + 20) + random(100);
var _local11 = _local2;
var _local17 = (_local2 + 60) - random(140);
var _local12 = _local14 - _local15;
var _local20 = _local17 - _local11;
var _local7 = _local20 / _local12;
var _local9 = 0.6 * _local4;
if ((_local8 - _local7) > _local9) {
_local7 = _local8 - _local9;
} else if ((_local8 - _local7) < (-_local9)) {
_local7 = _local8 + _local9;
}
aTerrain.push({x0:_local15, y0:_local11, x1:_local14, y1:_local11 + (_local12 * _local7)});
} else if (tMode == 1) {
aTerrain.push({x0:_local1, y0:_local2, x1:(_local1 + 35) + (65 * _local5), y1:_local2 + (terrainStep * ((16 * _local4) * _local6))});
terrainStep--;
} else if (tMode == 2) {
aTerrain.push({x0:_local1, y0:_local2, x1:(_local1 + 35) + (65 * _local5), y1:_local2 - ((tSteps - terrainStep) * ((16 * _local4) * _local6))});
terrainStep--;
} else if (tMode == 3) {
aTerrain.push({x0:_local1, y0:_local2, x1:(_local1 + 30) + (80 * _local5), y1:_local2 - (terrainStep * ((16 * _local4) * _local6))});
terrainStep--;
} else if (tMode == 4) {
aTerrain.push({x0:_local1, y0:_local2, x1:(_local1 + 30) + (80 * _local5), y1:_local2 + ((tSteps - terrainStep) * ((16 * _local4) * _local6))});
terrainStep--;
} else if (tMode == 5) {
aTerrain.push({x0:_local1, y0:_local2, x1:(_local1 + 26) + (40 * _local21), y1:_local2 - ((tSteps - terrainStep) * ((14 * _local4) * _local18))});
terrainStep--;
}
}
}
function collide(car) {
var _local21;
((car == 1) ? (_local21 = particles) : (_local21 = oppParticles));
i = 0;
while (i < _local21.length) {
p = _local21[i];
if (p.c) {
var _local10 = p.x;
var _local20 = p.y;
var _local13 = p.r;
j = 0;
while (j < aTerrain.length) {
var _local6 = aTerrain[j];
var _local5 = _local6.x0;
var _local7 = _local6.y0;
var _local12 = _local6.x1;
var _local16 = _local6.y1;
if ((_local10 <= _local12) && (_local10 >= _local5)) {
var _local4 = _local12 - _local5;
var _local3 = _local16 - _local7;
var _local2 = Math.sqrt((_local4 * _local4) + (_local3 * _local3));
var _local15 = _local4 / _local2;
var _local14 = _local3 / _local2;
var _local9 = -_local14;
var _local8 = _local15;
var _local18 = _local10 - _local5;
var _local17 = _local20 - _local7;
var _local11 = (_local18 * _local15) + (_local17 * _local14);
if (_local11 < 0) {
_local2 = Math.sqrt((_local18 * _local18) + (_local17 * _local17));
var _local1 = _local13 - _local2;
if (0 < _local1) {
_local18 = _local18 / _local2;
_local17 = _local17 / _local2;
px = _local18 * _local1;
py = _local17 * _local1;
p.x = p.x + px;
p.y = p.y + py;
aF(p, 1);
if (p.w != false) {
rollWheel(p, -_local9, -_local8);
}
}
} else if (_local2 < _local11) {
_local18 = _local18 - _local4;
_local17 = _local17 - _local3;
_local2 = Math.sqrt((_local18 * _local18) + (_local17 * _local17));
var _local1 = _local13 - _local2;
if (0 < _local1) {
_local18 = _local18 / _local2;
_local17 = _local17 / _local2;
var px = (_local18 * _local1);
var py = (_local17 * _local1);
p.x = p.x + px;
p.y = p.y + py;
aF(p, 1);
if (p.w != false) {
rollWheel(p, -_local9, -_local8);
}
}
} else {
_local9 = -_local3;
_local8 = _local4;
_local9 = _local9 / _local2;
_local8 = _local8 / _local2;
_local18 = _local10 - _local5;
_local17 = _local20 - _local7;
var _local19 = (_local18 * _local9) + (_local17 * _local8);
var _local1 = _local19 + _local13;
if (_local1 > 0) {
_local1 = _local1 * -1;
var px = (_local9 * _local1);
var py = (_local8 * _local1);
p.x = p.x + px;
p.y = p.y + py;
aF(p, 1);
if (finish != true) {
if ((gCar == false) && (oppS == false)) {
if (car == 1) {
setDamage(p, _local1);
}
}
}
if (p.w != false) {
rollWheel(p, -_local9, -_local8);
}
}
}
}
j++;
}
if (p.x < (aTerrain[0].x0 + p.r)) {
p.x = aTerrain[0].x0 + p.r;
aF(p, 1);
if (p.w != false) {
rollWheel(p, 1, 0);
}
}
}
i++;
}
}
function render() {
if (drawOpp == true) {
var _local11 = oppParticles[0].x;
var _local10 = oppParticles[1].x;
var _local20 = oppParticles[2].x;
var _local19 = oppParticles[3].x;
var _local27 = oppParticles[4].x;
var _local25 = oppParticles[5].x;
var _local22 = oppParticles[0].y;
var _local21 = oppParticles[1].y;
var _local9 = oppParticles[2].y;
var _local8 = oppParticles[3].y;
var _local26 = oppParticles[4].y;
var _local24 = oppParticles[5].y;
vC.oppWheel0._x = _local11;
vC.oppWheel0._y = _local22;
vC.oppWheel1._x = _local10;
vC.oppWheel1._y = _local21;
var _local23 = (Math.atan2(oppParticles[0].w.y, oppParticles[0].w.x) * 180) / Math.PI;
vC.oppWheel0.tire._rotation = _local23;
vC.oppWheel1.tire._rotation = _local23;
oppCarX = getMean([_local11, _local10, _local27, _local25]);
oppChassis._x = oppCarX;
oppChassis._y = getMean([_local9, _local26, _local8, _local24]);
oppChassis._rotation = getAngle({x:_local20, y:_local9}, {x:_local19, y:_local8});
if (keyPressed == true) {
}
}
var _local7 = particles[0].x;
var _local5 = particles[1].x;
var _local3 = particles[2].x;
var _local17 = particles[3].x;
var _local15 = particles[4].x;
var _local13 = particles[5].x;
var _local6 = particles[0].y;
var _local4 = particles[1].y;
var _local18 = particles[2].y;
var _local16 = particles[3].y;
var _local14 = particles[4].y;
var _local12 = particles[5].y;
vC.wheel0._x = _local7;
vC.wheel0._y = _local6;
vC.wheel0.tire._rotation = (Math.atan2(particles[0].w.y, particles[0].w.x) * 180) / Math.PI;
vC.wheel1._x = _local5;
vC.wheel1._y = _local4;
vC.wheel1.tire._rotation = (Math.atan2(particles[1].w.y, particles[1].w.x) * 180) / Math.PI;
chassis._x = getMean([_local3, _local17, _local15, _local13]);
chassis._y = getMean([_local18, _local14, _local16, _local12]);
if (crash != true) {
carX = getMean([_local7, _local5, _local15, _local13]);
carY = getMean([_local6, _local4, _local14, _local12]);
} else {
carX = getMean([_local15, _local13]);
carY = getMean([_local14, _local12]);
}
chassis._rotation = getAngle({x:_local3, y:_local18}, {x:_local17, y:_local16});
xPos = (sW / 3) - carX;
yPos = (sH / 2) - carY;
if (overStart != true) {
if ((-((sW / 3) - carX)) < 400) {
xPos = 0;
} else {
overStart = true;
}
}
xPosDiff = memXPos - xPos;
yPosDiff = memYPos - yPos;
if (Math.abs(xPosDiff) < 0.5) {
xPosDiff = 0;
}
if (Math.abs(yPosDiff) < 0.5) {
yPosDiff = 0;
}
memXPos = xPos;
memYPos = yPos;
if (stopScroll != true) {
main._x = xPos;
main._y = yPos;
}
vC.clear();
if (keyPressed == true) {
if ((crash != true) && (finish != true)) {
vC.lineStyle(6, "0xFFFFFF");
vC.moveTo(_local17, _local16);
vC.lineTo(_local5, _local4);
vC.moveTo(_local3, _local18);
vC.lineTo(_local7, _local6);
}
if (drawOpp == true) {
vC.lineStyle(6, "0xFFFFFF");
vC.moveTo(_local19, _local8);
vC.lineTo(_local10, _local21);
vC.moveTo(_local20, _local9);
vC.lineTo(_local11, _local22);
}
}
surface.clear();
i = 0;
while (i < aTerrain.length) {
l = aTerrain[i];
if (l.x1 >= (-main._x)) {
if (l.x0 < ((-main._x) + sW)) {
surface.beginFill(fillColor);
var _local1 = 6;
surface.lineStyle(_local1 * 2, lineColor);
surface.moveTo(l.x0, l.y0 + _local1);
surface.lineTo(l.x1, l.y1 + _local1);
surface.lineStyle(none);
if (stopScroll == true) {
var _local2 = aTerrain[aTerrain.length - 1].y1 + (sH / 2);
surface.lineTo(l.x1, _local2);
surface.lineTo(l.x0, _local2);
} else {
surface.lineTo(l.x1, carY + (sH / 2));
surface.lineTo(l.x0, carY + (sH / 2));
}
surface.endFill();
}
}
i++;
}
}
function getDistance(ob0, ob1) {
return(Math.sqrt(Math.pow(ob0.x - ob1.x, 2) + Math.pow(ob0.y - ob1.y, 2)));
}
function getMean(values) {
mean = 0;
i = 0;
while (i < values.length) {
mean = mean + values[i];
i++;
}
return(mean / values.length);
}
function getAngle(ob0, ob1) {
return((Math.atan2(ob1.y - ob0.y, ob1.x - ob0.x) * 180) / Math.PI);
}
function randOrd(a, b) {
return(Math.round(Math.random()) - 0.5);
}
initVehicleVars = function () {
damage = 0;
telrun = 0;
};
mainLoop = function () {
if (keyPressed != false) {
if ((crash != true) && (finish != true)) {
move();
}
Verlet(1);
if (drawOpp == true) {
Verlet(2);
}
}
afterBurner();
telrun++;
telLong++;
if (telLong > 4) {
generateTerrain();
telLong = 0;
if (crash != true) {
angleConstrain();
} else {
fadeLoop();
}
}
displayBuildings();
if (telrun > 3) {
if (keyPressed != false) {
calcOppPos();
}
if (finish != true) {
calcPlanetPos();
} else {
fadeLoop();
}
telrun = 0;
}
collide(1);
soundCounters();
if (drawOpp == true) {
collide(2);
}
if (drawOpp == true) {
if (oppFinish != true) {
moveOpp();
}
}
render();
renderBackground();
damageBar();
};
oppSelectLoop = function () {
moveOppSelect();
Verlet(1);
collide(1);
renderOppSelect();
};
garageLoop = function () {
moveGarage();
Verlet(1);
collide(1);
renderOppSelect();
};
startGarageCar = function (mc) {
_global.currentPlanet = 3;
oppS = false;
gCar = true;
scoreGame = false;
main = mc;
initPlanet();
init();
setupStage();
setupVehicle();
initVehicle();
initVehicleVars();
initDriver();
main.onEnterFrame = function () {
garageLoop();
};
clearIntervals();
};
startOppSelect = function () {
oppS = true;
gCar = false;
scoreGame = false;
main = this.createEmptyMovieClip("container", 0);
staticMcs = this.createEmptyMovieClip("staticMcs", 1);
KingGame = false;
if ((_global.currentPlanet == 5) || (_global.game.youTheKing == true)) {
KingGame = true;
}
initPlanet();
init();
if (_global.afterRace != true) {
initOpponents(_global.currentPlanet);
aRandomOpponents = new Array();
trace(aOpponents.length + " LENGTEEEEEEEEE");
aRandomOpponents.randoMix(aOpponents.length);
aRandomOpponents.splice(_global.nrOfOpponents);
randomOpponentIndex = 0;
currentOpponent = aRandomOpponents[randomOpponentIndex];
if (KingGame == true) {
if (oppKing == true) {
currentOpponent = 0;
} else {
currentOpponent = random(aOpponents.length);
}
}
}
attachBg();
setupStage();
setupVehicle();
buildOpp();
initVehicle();
initVehicleVars();
initDriver();
setStarBackground();
main.onEnterFrame = function () {
oppSelectLoop();
};
clearIntervals();
onceSixSecInt = setInterval(onceSixSec, 6000);
longRandom = Math.random();
medRandom = Math.random();
};
carsVisible = function (option) {
if (option == false) {
vC.wheel0._visible = false;
vC.wheel1._visible = false;
chassis._visible = false;
vC.oppWheel0._visible = false;
vC.oppWheel1._visible = false;
oppChassis._visible = false;
} else {
vC.wheel0._visible = true;
vC.wheel1._visible = true;
chassis._visible = true;
vC.oppWheel0._visible = true;
vC.oppWheel1._visible = true;
oppChassis._visible = true;
}
};
start = function () {
stopSound();
playLoop("race");
scoreGame = false;
drawOpp = true;
gCar = false;
oppS = false;
main = this.createEmptyMovieClip("container", 0);
staticMcs = this.createEmptyMovieClip("static", 1);
KingGame = false;
if ((_global.currentPlanet == 5) || (_global.game.youTheKing == true)) {
KingGame = true;
}
initPlanet();
init();
attachHud();
setupVehicle();
buildOpp();
initVehicle();
initVehicleVars();
initDriver();
attachBg();
setStarBackground();
main.onEnterFrame = function () {
mainLoop();
};
clearIntervals();
onceSixSecInt = setInterval(onceSixSec, 6000);
oncePerSecInt = setInterval(oncePerSec, 1000);
tenPerSecInt = setInterval(tenPerSec, 100);
longRandom = Math.random();
medRandom = Math.random();
carsVisible(false);
attachStartMessage();
initAfterburner("measure");
};
startHighscoreGame = function () {
if (_global.scoreGameProgress == 1) {
_global.currentPlanet = 3;
} else if (_global.scoreGameProgress == 2) {
_global.currentPlanet = 2;
} else if (_global.scoreGameProgress == 3) {
_global.currentPlanet = 4;
}
initAllParts();
stopSound();
playLoop("race");
scoreGame = true;
scoreKeyHelpShowed = false;
drawOpp = true;
gCar = false;
oppS = false;
main = this.createEmptyMovieClip("container", 0);
staticMcs = this.createEmptyMovieClip("static", 1);
KingGame = false;
attachHud();
initPlanet();
init();
initOpponents(_global.currentPlanet);
aRandomOpponents = new Array();
aRandomOpponents.randoMix(aOpponents.length);
aRandomOpponents.splice(1);
randomOpponentIndex = 0;
currentOpponent = aRandomOpponents[randomOpponentIndex];
setupVehicle();
buildOpp();
initVehicle();
initVehicleVars();
initDriver();
attachBg();
setStarBackground();
main.onEnterFrame = function () {
mainLoop();
};
clearIntervals();
onceSixSecInt = setInterval(onceSixSec, 6000);
oncePerSecInt = setInterval(oncePerSec, 1000);
tenPerSecInt = setInterval(tenPerSec, 100);
longRandom = Math.random();
medRandom = Math.random();
carsVisible(false);
attachStartMessage();
initAfterburner("measure");
};
angleConstrain = function () {
var _local9 = 3;
var _local2 = springs[_local9];
var _local1 = _local2.v;
var _local5 = _local2.p0;
var _local4 = _local2.p1;
var _local8 = (Math.atan2(_local5.y - _local1.y, _local5.x - _local1.x) * 180) / Math.PI;
var _local6 = (Math.atan2(_local4.y - _local1.y, _local4.x - _local1.x) * 180) / Math.PI;
var _local7 = _local6 - _local8;
var _local3 = false;
if (((_local7 > 28) && (_local7 < 34)) || ((_local7 < -324) && (_local7 > -332))) {
telKO = 0;
} else {
telKO++;
}
if (telKO > 3) {
_local3 = true;
}
_local9 = 12;
_local2 = springs[_local9];
_local1 = _local2.v;
_local5 = _local2.p0;
_local4 = _local2.p1;
_local8 = (Math.atan2(_local5.y - _local1.y, _local5.x - _local1.x) * 180) / Math.PI;
_local6 = (Math.atan2(_local4.y - _local1.y, _local4.x - _local1.x) * 180) / Math.PI;
_local7 = _local6 - _local8;
if (_local7 < -120) {
_local3 = true;
}
if (_local3 == true) {
crashCar();
}
};
crashCar = function () {
particles[2].c = true;
particles[3].c = true;
springs[0] = null;
springs[3] = null;
springs[13] = null;
springs[12] = null;
springs[6] = null;
springs[1] = null;
springs[4] = null;
springs[14] = null;
springs[12] = null;
springs[7] = null;
speelSimpelSFX("crash");
crash = true;
hud.planet.car1.gotoAndStop("crashed");
i = 2;
while (i < 7) {
p = particles[i];
particles[i].g = grav;
f = 0.1;
i++;
}
};
getChassisColor = function (type, colornr) {
if (colornr == "kingmobile") {
return(16776960);
}
var _local1 = [];
_local1[1] = [null, 16711680, 16711680, 3381759, 3355443, 10053375, 16776960, 16724991, 39168, 6684774, 16750848, 39168, 16776960, 16777215, 13421772];
_local1[2] = [null, 16711680, 0, 14090455, 39168, 13421772, 16776960, 16776960, 16750848, 0, 13311, 10053120, 16724889, 10066329, 255, 255];
_local1[3] = [null, 16711680, 16776960, 16711680, 16737792, 16777215, 10053375, 3355443, 34785, 16737792, 52275, 13382502, 13421772, 10027008, 16738047, 13421772];
var _local2 = _local1[type][colornr];
return(_local2);
};
setupVehicle = function () {
vC = main.createEmptyMovieClip("vContainer", 2);
var _local26 = vC.attachMovie("wheel", "wheel0", 3);
var _local21 = vC.attachMovie("wheel", "wheel1", 4);
chassis = vC.attachMovie("mcChassis", "chassis", 5);
initAllParts();
setWFront = 17;
setWRear = 23;
if (KingGame == true) {
var _local18 = 2.4;
var _local22 = 2.4;
var _local34 = 0.01;
}
if ((oppS != true) && (gCar != true)) {
var _local19 = vC.attachMovie("wheel", "oppWheel0", 6);
var _local17 = vC.attachMovie("wheel", "oppWheel1", 7);
oppChassis = vC.attachMovie("mcOppChassis", "oppChassis", 8);
}
_local26._y = (_local21._y = (_local19._y = (_local17._y = (chassis._y = (oppChassis._y = -1000)))));
if (oppS == true) {
chassis.afterburner._visible = false;
var _local8 = aOpponents[currentOpponent];
var _local7 = ((_local8.rep - 50) / 200) + 1;
var _local28 = aOpponents[currentOpponent].key;
var _local23 = aOpponents[currentOpponent].homePlanet;
var _local13 = _global.game.oppChassisColors[_local23][_local28];
if (oppKing == true) {
vehicleVars = {wRear:setWRear, wFront:setWFront, wType:3, chassis:_local8.chassis, chassisNr:3, color:"kingmobile", engineSpeed:_local7, chassisSpeed:_local7, engineLoss:1, chassisLoss:1, gripLoss:1};
} else {
vehicleVars = {wRear:setWRear, wFront:setWFront, wType:_local8.wheels, chassis:_local8.chassis, chassisNr:_local8.chassis, color:_local13, engineSpeed:_local7, chassisSpeed:_local7, engineLoss:1, chassisLoss:1, gripLoss:1};
}
AISpeed = (1.4 * _local7) * _local7;
var _local10 = allParts.chassis[currentParts.chassis].type + 1;
var _local11 = allParts.engines[currentParts.engine].type;
var _local29 = allEngines[_local11].speed;
var _local30 = allChassis[_local10 - 1].speed;
playerSpeed = (1.4 * _local29) * _local30;
} else if (scoreGame == true) {
var _local8 = aOpponents[0];
var _local24 = 45 + ((30 * _global.scoreGameProgress) / 3.5);
var _local7 = ((_local24 - 50) / 150) + 1;
oppTopSpeed = 1.4 * _local7;
var _local28 = aOpponents[currentOpponent].key;
var _local23 = aOpponents[currentOpponent].homePlanet;
var _local13 = _global.game.oppChassisColors[_local23][_local28];
var _local10 = _global.scoreGameProgress - 1;
var _local11 = _global.scoreGameProgress - 1;
currentEngine = _local11 + 1;
var _local29 = allEngines[_local11].speed;
var _local3 = 1;
var _local30 = allChassis[_local10].speed;
var _local12 = _global.scoreGameProgress;
_local28 = 1;
_local23 = 1;
_local13 = _global.game.oppChassisColors[_local23][_local28];
vehicleVars = {wRear:setWRear, wFront:setWFront, wType:_local12, chassis:_local10 + 1, chassisNr:_local10 + 1, color:_local3, engineSpeed:_local29, chassisSpeed:_local30, engineLoss:1, chassisLoss:1, gripLoss:1};
oppVehicleVars = {wRear:setWRear, wFront:setWFront, wType:_local12, chassis:_local10 + 1, chassisNr:_local10 + 1, color:5, engineSpeed:_local29, chassisSpeed:_local30};
_local10 = allParts.chassis[currentParts.chassis].type + 1;
_local11 = allParts.engines[currentParts.engine].type;
_local29 = allEngines[_local11].speed;
_local30 = allChassis[_local10 - 1].speed;
playerSpeed = (1.4 * _local29) * _local30;
} else {
var _local8 = aOpponents[currentOpponent];
if (oppKing == true) {
var _local24 = 100;
} else {
var _local24 = 40 + ((3 * _local8.rep) / 5);
}
var _local7 = ((_local24 - 50) / 150) + 1;
oppTopSpeed = 1.4 * _local7;
var _local28 = aOpponents[currentOpponent].key;
var _local23 = aOpponents[currentOpponent].homePlanet;
var _local13 = _global.game.oppChassisColors[_local23][_local28];
if (oppKing == true) {
oppVehicleVars = {wRear:setWRear, wFront:setWFront, wType:3, chassis:_local8.chassis, chassisNr:3, color:"kingmobile", engineSpeed:_local7, chassisSpeed:_local7};
} else {
oppVehicleVars = {wRear:setWRear, wFront:setWFront, wType:_local8.wheels, chassis:_local8.chassis, chassisNr:_local8.chassis, color:_local13, engineSpeed:_local7, chassisSpeed:_local7};
}
var _local10 = allParts.chassis[currentParts.chassis].type + 1;
var _local11 = allParts.engines[currentParts.engine].type;
currentEngine = _local11 + 1;
if (youKing == true) {
currentEngine = 3;
}
var _local29 = allEngines[_local11].speed;
var _local3 = allParts.chassis[currentParts.chassis].color;
var _local30 = allChassis[_local10 - 1].speed;
var _local12 = allParts.tires[currentParts.tires].type + 1;
var _local27 = allParts.engines[currentParts.engine].wear;
var _local14 = allParts.chassis[currentParts.chassis].wear;
var _local16 = allParts.tires[currentParts.tires].wear;
var _local15 = (100 - (_local27 / 2)) / 100;
var _local20 = (100 - (_local14 / 2)) / 100;
var _local25 = (100 - (_local16 / 2)) / 100;
if (youKing == true) {
vehicleVars = {wRear:setWRear, wFront:setWFront, wType:3, chassisNr:3, color:"kingmobile", engineSpeed:_local18, chassisSpeed:_local22, engineLoss:1, chassisLoss:1, gripLoss:1};
} else {
vehicleVars = {wRear:setWRear, wFront:setWFront, wType:_local12, chassisNr:_local10, color:_local3, engineSpeed:_local29, chassisSpeed:_local30, engineLoss:_local15, chassisLoss:_local20, gripLoss:_local25};
}
trace((((((((((("___ " + _local10) + " ") + _local11) + " ") + _local3) + " i ") + currentParts.chassis) + " ") + allParts.chassis[currentParts.chassis].type) + " ") + allParts.chassis[currentParts.chassis].color);
}
var _local9 = allTires[_local12 - 1].grip * vehicleVars.gripLoss;
if (youKing == true) {
_local9 = 0.001;
}
if (_local9 == undefined) {
_local9 = 0.04;
}
f = _local9;
topSpeed = (1.4 * (vehicleVars.engineSpeed * vehicleVars.engineLoss)) * (vehicleVars.chassisSpeed * vehicleVars.chassisLoss);
if (topSpeed > maxSpeed) {
topSpeed = maxSpeed;
}
riderPower = 0.6;
chassis.chassisType.gotoAndStop(vehicleVars.chassisNr);
chassis.exhaust.gotoAndStop(vehicleVars.chassisNr);
chassis.chassisType.chassisColor.gotoAndStop(vehicleVars.color);
var _local6 = getChassisColor(vehicleVars.chassisNr, vehicleVars.color);
var _local4 = 0;
while (_local4 < 2) {
var _local2 = vC["wheel" + _local4];
var _local3 = _local6;
if (_local3 == undefined) {
_local3 = 65297;
}
C = new Color(_local2.wheelColor);
C.setRGB(_local6);
_local2.tire.gotoAndStop(vehicleVars.wType);
if (_local4 == 0) {
var _local5 = vehicleVars.wRear;
} else {
var _local5 = vehicleVars.wFront;
}
_local2._xscale = (100 * _local5) / 35;
_local2._yscale = _local2._xscale;
_local4++;
}
if (oppVehicleVars != null) {
oppChassis.chassisType.gotoAndStop(oppVehicleVars.chassisNr);
oppChassis.exhaust.gotoAndStop(oppVehicleVars.chassisNr);
oppChassis.chassisType.chassisColor.gotoAndStop(oppVehicleVars.color);
_local6 = getChassisColor(oppVehicleVars.chassisNr, oppVehicleVars.color);
_local4 = 0;
while (_local4 < 2) {
var _local2 = vC["oppWheel" + _local4];
if (_local3 == undefined) {
var _local3 = 65297;
}
C = new Color(_local2.wheelColor);
C.setRGB(_local6);
_local2.tire.gotoAndStop(oppVehicleVars.wType);
if (_local4 == 1) {
var _local5 = oppVehicleVars.wRear;
} else {
var _local5 = oppVehicleVars.wFront;
}
_local2._xscale = (100 * _local5) / 35;
_local2._yscale = _local2._xscale;
_local4++;
}
}
};
buildOpp = function () {
oppParticles = [];
oppParticles[0] = {x:0, y:0, r:oppVehicleVars.wFront, w:{w:0}, c:true, g:grav * 3};
oppParticles[1] = {x:80, y:0, r:oppVehicleVars.wRear, w:{w:0}, c:true, g:grav * 3};
oppParticles[2] = {x:20, y:-22, c:false, g:grav / 4.5};
oppParticles[3] = {x:60, y:-22, c:false, g:grav / 4.5};
oppParticles[4] = {x:10, y:-42, c:true, g:grav / 6};
oppParticles[5] = {x:70, y:-42, c:true, g:grav / 6};
oppParticles[6] = {x:40, y:-58, c:true, g:grav / 10};
i = 0;
while (i < oppParticles.length) {
var _local1 = oppParticles[i];
if (_local1.r == undefined) {
_local1.r = 0;
_local1.w = false;
} else if (_local1.w != undefined) {
_local1.w.x = _local1.r;
_local1.w.y = 0;
_local1.w.ox = _local1.w.x;
_local1.w.oy = _local1.w.y;
_local1.w.rL = _local1.r;
_local1.w.s = 0;
}
_local1.x = _local1.x + initOppX;
_local1.y = _local1.y + initOppY;
_local1.ox = _local1.x;
_local1.oy = _local1.y;
i++;
}
oppSprings = [];
oppSprings[0] = {p0:oppParticles[4], p1:oppParticles[2], w0:spring1, w1:spring2};
oppSprings[1] = {p0:oppParticles[5], p1:oppParticles[3], w0:spring1, w1:spring2};
oppSprings[2] = {p0:oppParticles[2], p1:oppParticles[3], w0:spring1, w1:spring2};
oppSprings[3] = {p0:oppParticles[0], p1:oppParticles[4], w0:spring1, w1:spring2};
oppSprings[4] = {p0:oppParticles[1], p1:oppParticles[5], w0:spring1, w1:spring2};
oppSprings[5] = {p0:oppParticles[4], p1:oppParticles[5], w0:spring1, w1:spring2};
oppSprings[6] = {p0:oppParticles[0], p1:oppParticles[5], w0:spring1, w1:spring2};
oppSprings[7] = {p0:oppParticles[1], p1:oppParticles[4], w0:spring1, w1:spring2};
oppSprings[8] = {p0:oppParticles[2], p1:oppParticles[5], w0:spring1, w1:spring2};
oppSprings[9] = {p0:oppParticles[2], p1:oppParticles[4], w0:spring1, w1:spring2};
oppSprings[10] = {p0:oppParticles[3], p1:oppParticles[4], w0:spring1, w1:spring2};
oppSprings[11] = {p0:oppParticles[3], p1:oppParticles[5], w0:spring1, w1:spring2};
oppSprings[12] = {p0:oppParticles[0], p1:oppParticles[1], w0:spring1, w1:spring2};
oppSprings[13] = {p0:oppParticles[0], p1:oppParticles[6], w0:spring1, w1:spring2};
oppSprings[14] = {p0:oppParticles[1], p1:oppParticles[6], w0:spring1, w1:spring2};
oppSprings[15] = {p0:oppParticles[2], p1:oppParticles[6], w0:spring1, w1:spring2};
oppSprings[16] = {p0:oppParticles[3], p1:oppParticles[6], w0:spring1, w1:spring2};
i = 0;
while (i < oppSprings.length) {
s = oppSprings[i];
s.rL = getDistance(s.p0, s.p1);
if (s.c == undefined) {
s.c = 5;
}
i++;
}
};
move = function () {
var _local1 = 0;
if (down(37)) {
lean(-1);
}
if (down(39)) {
lean(1);
}
if (down(38)) {
_local1 = _local1 + topSpeed;
if (enginePlaying != true) {
sfxEngine("play");
}
} else if (enginePlaying == true) {
sfxEngine("stop");
}
if (down(40)) {
_local1 = _local1 - topSpeed;
}
i = 0;
while (i < 2) {
p = particles[i];
p.w.s = Math.max(-maxSpeed, Math.min(maxSpeed, p.w.s + _local1));
i++;
}
};
brake = function (wheel) {
var _local1 = wheel.w;
var _local2 = wheel;
_local1.ox = _local1.x;
_local1.oy = _local1.y;
_local2.ox = _local2.x;
_local2.oy = _local2.y;
_local1.s = 0;
};
moveOppSelect = function () {
p = particles[0];
var _local3 = 0;
if (oSstap == null) {
var _local6 = checkForTrouble();
if (_local6 != null) {
_global.trouble = _local6;
quitToGarage();
}
if (youKing == true) {
var _local5 = staticMcs.attachMovie("mcWaitForChallenger", "mcWaitForChallenger", staticMcs.getNextHighestDepth());
_local5._x = sW / 2;
_local5._y = 60;
_local5.wait.onRelease = function () {
oSstap = 0;
this._parent.removeMovieClip();
};
oSstap = "wait";
} else if (_global.afterRace == true) {
_global.afterRace = false;
var _local4 = staticMcs.attachMovie("mcClickOk", "mcClickOk", staticMcs.getNextHighestDepth());
_local4.gotoAndStop("showstats");
displayDamage(_local4);
_local4.btnOk.onRelease = function () {
oSstap = 0;
this._parent.removeMovieClip();
};
oSstap = "wait";
} else {
oSstap = 0;
}
}
if (oSstap != "wait") {
if (p.x < 140) {
oSstap = 0;
} else if ((oSstap <= 1) && (p.x < 200)) {
oSstap = 1;
} else if (oSstap <= 2) {
oSstap = 2;
}
}
if (oSstap == 0) {
_local3 = grav / 0.3;
} else if (oSstap == 1) {
_local3 = 0;
} else if (oSstap == 2) {
if (p.x > (220 + (30 * longRandom))) {
_local3 = -topSpeed;
} else {
brake(particles[0]);
if (oSstap2Taken != true) {
oSstap2Taken = true;
attachOpponentPanel();
}
}
} else if (oSstap == 3) {
_local3 = topSpeed;
if (_local3 > 1.6) {
_local3 = 1.6;
}
}
if (p.x > 570) {
oSstap = null;
oSstap2Taken = false;
if (KingGame != true) {
if (randomOpponentIndex < (aRandomOpponents.length - 1)) {
randomOpponentIndex++;
} else {
randomOpponentIndex = 0;
}
currentOpponent = aRandomOpponents[randomOpponentIndex];
trace(_global.game.rep + " REPUTATION ");
}
init();
setupVehicle();
initVehicle();
}
_local3 = _local3 * (1 - (longRandom * 0.4));
i = 0;
while (i < particles.length) {
p = particles[i];
if (p.w != false) {
p.w.s = Math.max(-maxSpeed, Math.min(maxSpeed, p.w.s + _local3));
}
i++;
}
};
moveOpp = function () {
var _local1 = -oppTopSpeed;
i = 0;
while (i < oppParticles.length) {
p = oppParticles[i];
if (p.w != false) {
p.w.s = Math.max(-maxSpeed, Math.min(maxSpeed, p.w.s + _local1));
}
i++;
}
};
afterBurner = function () {
if (down(32)) {
var _local3 = (afterburnerBitsLeft / abTotalBits) * 100;
hud.fuel.mask._xscale = _local3;
if (afterburnerBitsLeft > 0) {
if (afterburnerPlaying != true) {
sfxAfterburner("play");
}
afterburnerBitsLeft = afterburnerBitsLeft - 1;
chassis.afterburner._visible = true;
var _local2 = springs[2];
var _local4 = (Math.atan2(_local2.p1.y - _local2.p0.y, _local2.p1.x - _local2.p0.x) * 180) / Math.PI;
var _local5 = 2 * Math.cos((Math.PI/180) * _local4);
var _local1 = 0;
while (_local1 < 8) {
particles[_local1].x = particles[_local1].x + (_local5 / 10);
_local1++;
}
} else {
afterburnerBitsLeft = 0;
if (afterburnerPlaying == true) {
sfxAfterburner("stop");
}
chassis.afterburner._visible = false;
}
} else {
if (afterburnerPlaying == true) {
sfxAfterburner("stop");
}
chassis.afterburner._visible = false;
}
if (drawOpp == true) {
if (oppGear == 0) {
if ((oppOverStart != true) && (countOS > 4)) {
oppBurner = true;
} else {
oppBurner = false;
}
} else {
if ((oppFinish != true) && (oppOverStart == true)) {
if (longRandom > 0.3) {
oppBurner = true;
}
}
if (oppFinish == true) {
oppBurner = false;
}
}
if (oppBurner == true) {
oppChassis.afterburner._visible = true;
var _local2 = oppSprings[2];
var _local4 = (Math.atan2(_local2.p1.y - _local2.p0.y, _local2.p1.x - _local2.p0.x) * 180) / Math.PI;
var _local5 = 2 * Math.cos((Math.PI/180) * _local4);
var _local1 = 2;
while (_local1 < 6) {
oppParticles[_local1].x = oppParticles[_local1].x - 0.36;
_local1++;
}
} else {
oppChassis.afterburner._visible = false;
}
}
};
renderOppSelect = function () {
vC.wheel0._x = particles[0].x;
vC.wheel0._y = particles[0].y;
vC.wheel0.tire._rotation = (Math.atan2(particles[0].w.y, particles[0].w.x) * 180) / Math.PI;
vC.wheel1._x = particles[1].x;
vC.wheel1._y = particles[1].y;
vC.wheel1.tire._rotation = (Math.atan2(particles[1].w.y, particles[1].w.x) * 180) / Math.PI;
chassis._x = getMean([particles[2].x, particles[3].x, particles[4].x, particles[5].x]);
chassis._y = getMean([particles[2].y, particles[4].y, particles[3].y, particles[5].y]);
carX = getMean([particles[0].x, particles[1].x, particles[4].x, particles[5].x]);
carY = getMean([particles[0].y, particles[1].y, particles[4].y, particles[5].y]);
chassis._rotation = getAngle({x:particles[2].x, y:particles[2].y}, {x:particles[3].x, y:particles[3].y});
vC.clear();
if (crash != true) {
vC.lineStyle(6, "0xFFFFFF");
vC.moveTo(particles[3].x, particles[3].y);
vC.lineTo(particles[1].x, particles[1].y);
vC.moveTo(particles[2].x, particles[2].y);
vC.lineTo(particles[0].x, particles[0].y);
}
if (gCar != true) {
surface.clear();
i = 0;
while (i < aTerrain.length) {
l = aTerrain[i];
surface.beginFill(fillColor);
var _local1 = 6;
surface.lineStyle(_local1 * 2, lineColor);
surface.moveTo(l.x0, l.y0 + _local1);
surface.lineTo(l.x1, l.y1 + _local1);
surface.lineStyle(none);
surface.lineTo(l.x1, sH);
surface.lineTo(l.x0, sH);
surface.endFill();
i++;
}
}
};
berekenAfstand = function (mc1, mc2) {
var _local2 = mc2._x - mc1._x;
var _local1 = mc2._y - mc1._y;
return(Math.round(Math.sqrt((_local2 * _local2) + (_local1 * _local1))));
};
oncePerSec = function () {
fps = ticks - memTicks;
memTicks = ticks;
staticMcs.mcTicks.fps = "fps: " + fps;
medRandom = Math.random();
};
tenPerSec = function () {
if (finish != true) {
renderSurfaceTiles();
}
renderStartFinish();
manageDamage();
if (scoreGame == true) {
var _local1 = getTimer();
var _local2 = Math.round((_local1 - scoreTimer) / 1000);
if ((finish != true) && (keyPressed == true)) {
hud.amount.text = _local2 + " sec";
}
}
};
onceTwoSec = function () {
};
onceSixSec = function () {
longRandom = Math.random();
if (longRandom < 0.4) {
playRandomSound();
}
};
Array.prototype.randoMix = function (rdm) {
if (this.length < 1) {
if ((rdm == null) || (rdm < 0)) {
rdm = 10;
}
c = 0;
while (c < rdm) {
this[c] = c;
c++;
}
}
rdm = this.length;
i = 0;
while (i < rdm) {
rdMix = random(rdm);
this.temp = this[rdMix];
this.push(this.temp);
this.splice(rdMix, 1);
rdm--;
i++;
}
};
moveElas = function (mc, doelx, doely, inertia, k) {
mc.move = true;
var _local3 = doelx;
var _local2 = doely;
_local3 = (-mc._x) + _local3;
_local2 = (-mc._y) + _local2;
mc.xElas = (mc.xElas * inertia) + (_local3 * k);
mc.yElas = (mc.yElas * inertia) + (_local2 * k);
mc._x = mc._x + mc.xElas;
mc._y = mc._y + mc.yElas;
if ((Math.abs(mc.xElas) < 0.1) && (Math.abs(mc.yElas) < 0.1)) {
mc.move = false;
}
};
attachFlits = function () {
staticMcs.attachMovie("mcFlits", "mcFlits", staticMcs.getNextHighestDepth());
};
returnAPos = function (input, arrayData) {
i = 0;
while (i < arrayData.length) {
if (arrayData[i] == input) {
return(i);
}
i++;
}
return(0);
};
getNewChassisColor = function (chassisNr, origcolor) {
if (chassisNr == 1) {
var _local2 = 11;
} else if (chassisNr == 2) {
var _local2 = 15;
} else {
var _local2 = 15;
}
var _local1 = oricolor;
nwc = _local1;
nwc = random(_local2) + 1;
if (nwc == _local1) {
if (nwc < _local2) {
nwc++;
} else {
nwc--;
}
}
return(nwc);
};
calcPlanetPos = function () {
if (_root.pauza == false) {
if ((-xPos) > (planet.omtrek - 2400)) {
flatTerrain = true;
}
if ((-xPos) > (planet.omtrek - 275)) {
stopScroll = true;
}
if ((chassis._x + 50) > planet.omtrek) {
finish = true;
if (raceWon == null) {
raceWon = true;
}
if (scoreGame == true) {
attachScoreMessage();
} else {
attachFinishMessage();
}
hud.planet.car1.gotoAndStop("finished");
}
hud.planet.car1._rotation = (carX / planet.omtrek) * 180;
}
};
manageEarnings = function () {
if (_root.pauza == false) {
if (_global.currentAmount == 2) {
if (raceWon == true) {
var _local6 = aOpponents[currentOpponent].key;
var _local5 = aOpponents[currentOpponent].homePlanet;
var _local3 = aOpponents[currentOpponent];
var _local4 = _global.game.oppChassisColors[_local5][_local6];
_global.game.parts.engines.push({type:_local3.engine - 1, wear:10 + random(80)});
_global.game.parts.chassis.push({type:_local3.chassis - 1, wear:10 + random(80), color:_local4});
_global.game.parts.tires.push({type:_local3.wheels - 1, wear:10 + random(80)});
_global.game.parts.afterburners.push({type:_local3.afterburner - 1, wear:10 + random(80)});
var _local7 = getNewChassisColor(_local3.chassis, _local4);
_global.game.oppChassisColors[_local5][_local6] = _local7;
manageReputation();
} else {
carLost = true;
allParts.chassis.splice(currentParts.chassis, 1);
allParts.engines.splice(currentParts.engine, 1);
allParts.tires.splice(currentParts.tires, 1);
allParts.afterburners.splice(currentParts.afterburner, 1);
currentParts.chassis = 0;
currentParts.engine = 0;
currentParts.afterburner = 0;
currentParts.tires = 0;
}
} else if (_global.currentAmount == 4) {
if (youKing == true) {
_global.game.cash = _global.game.cash + 100000;
}
if (raceWon == true) {
_global.game.youTheKing = true;
main._parent.gotoAndStop(startOppSelect());
} else {
_global.game.king.key = aOpponents[currentOpponent].key;
_global.game.king.planet = aOpponents[currentOpponent].homePlanet;
_global.game.youTheKing = false;
quitToGarage();
}
} else {
if (raceWon == true) {
_global.game.cash = _global.game.cash + int(_global.currentAmount);
} else if (oppCrashed != true) {
_global.game.cash = _global.game.cash - int(_global.currentAmount);
}
if (_global.game.cash < 0) {
_global.game.cash = 0;
}
}
manageReputation();
}
};
manageReputation = function () {
if (_root.pauza == false) {
var _local3 = int(aOpponents[currentOpponent].rep);
if (oppKing == true) {
_local3 = 100;
}
var _local4 = int(_local3 - _global.game.rep);
var _local5 = random(3) + 1;
trace((_local4 + " niet rep ") + _local3);
if (raceWon == true) {
trace((_local4 + " deze rep ") + _local3);
if (_local4 > 0) {
_global.game.rep = _global.game.rep + int((_local3 / 30) * _local5);
} else {
_global.game.rep = _global.game.rep + int(_local3 / 30);
}
} else if (oppCrashed != true) {
if (KingGame != true) {
if (_local4 < 0) {
_global.game.rep = _global.game.rep - int((_local3 / 30) * _local5);
} else {
_global.game.rep = _global.game.rep - int(_local3 / 30);
}
}
}
_global.game.rep = int(_global.game.rep);
if (_global.game.rep > 100) {
_global.game.rep = 100;
} else if (_global.game.rep < 1) {
_global.game.rep = 1;
}
if (_global.game.certificate == false) {
if (_global.game.rep >= 30) {
_global.game.certificate = true;
_global.awardCertificate = true;
}
}
}
};
calcOppPos = function () {
if (_root.pauza == false) {
var _local9 = 4;
if (firstOppCalc == false) {
firstOppCalc = true;
var _local12 = planet.diff * ((1 + _global.game.diffFactor) / 2);
surfaceFactor = planet.surface / 100;
surfaceFluct = surfaceFactor + 0.5;
oppMaxSpeed = (11 * _local12) * oppTopSpeed;
oppMinSpeed = (4 * _local12) * oppTopSpeed;
}
if (flatTerrain != true) {
if (oppParticles[1].x < 0) {
oppOverStart = true;
drawOpp = false;
vC.oppWheel0._visible = false;
vC.oppWheel1._visible = false;
oppChassis._visible = false;
}
}
if (oppFinish != true) {
if (oppGear == 0) {
countOS = countOS + _local9;
if (countOS > 20) {
oppSpeed = oppSpeed + 5.6;
}
if (oppSpeed >= (oppMaxSpeed * 0.7)) {
oppGear = 1;
countOS = 0;
}
} else if (oppGear == 1) {
countOS = countOS - _local9;
if (countOS <= 0) {
oppSpeed = oppSpeed + ((2 + (medRandom * 4)) * surfaceFluct);
countOS = 8 + random(30);
}
if (Math.random() < (0.01 * surfaceFactor)) {
oppSpeed = random(4);
}
if (oppSpeed > oppMaxSpeed) {
oppSpeed = oppMaxSpeed - 1;
} else if (oppSpeed < oppMinSpeed) {
oppSpeed = oppSpeed + 0.1;
}
if (longRandom < 0.004) {
if ((oppXPos < (planet.omtrek * 0.7)) && (oppXPos > (planet.omtrek * 0.2))) {
if ((KingGame != true) && (scoreGame != true)) {
oppCrashed = true;
hud.planet.car2.gotoAndStop("crashed");
}
}
}
}
if (oppCrashed != true) {
oppXPos = oppXPos + (oppSpeed * _local9);
}
}
hud.planet.car2._rotation = -((oppXPos / planet.omtrek) * 180);
if (drawOpp != true) {
if ((oppXPos - 50) > planet.omtrek) {
hud.planet.car2.gotoAndStop("finished");
oppFinish = true;
if (raceWon == null) {
raceWon = false;
}
}
} else if ((oppCarX < planet.omtrek) && (oppOverStart == true)) {
hud.planet.car2.gotoAndStop("finished");
oppFinish = true;
if (raceWon == null) {
raceWon = false;
}
}
var _local8 = aTerrain[aTerrain.length - 1].x1;
var _local6 = aTerrain[aTerrain.length - 1].y1;
var _local11 = false;
if (flatTerrain == true) {
var _local10 = aTerrain[aTerrain.length - 1];
if (_local10.y0 == _local10.y1) {
_local11 = true;
}
}
if (_local11 == true) {
if ((-xPos) > (planet.omtrek - 1500)) {
if (drawOpp != true) {
if ((oppXPos >= (planet.omtrek - 275)) || (oppFinish == true)) {
if ((oppXPos <= _local8) || (oppFinish == true)) {
drawOpp = true;
if (oppFinish == true) {
var _local13 = planet.omtrek - 200;
if (_local13 < _local8) {
nwPos = _local13;
} else {
nwPos = _local8 - 100;
}
} else if (oppXPos > planet.omtrek) {
var nwPos = (planet.omtrek - 100);
} else if (_local8 < (planet.omtrek + 275)) {
var nwPos = _local8;
} else {
var nwPos = (planet.omtrek + 275);
}
var _local7 = 8 + random(8);
oppParticles[0].x = nwPos + 0;
oppParticles[0].y = (0 + _local6) - _local7;
oppParticles[1].x = nwPos + 80;
oppParticles[1].y = (0 + _local6) - _local7;
oppParticles[2].x = nwPos + 20;
oppParticles[2].y = (-22 + _local6) - _local7;
oppParticles[3].x = nwPos + 60;
oppParticles[3].y = (-22 + _local6) - _local7;
oppParticles[4].x = nwPos + 10;
oppParticles[4].y = (-44 + _local6) - _local7;
oppParticles[5].x = nwPos + 70;
oppParticles[5].y = (-44 + _local6) - _local7;
oppParticles[6].x = nwPos + 40;
oppParticles[6].y = (-65 + _local6) - _local7;
if (oppFinish == true) {
var _local5 = 2;
} else {
var _local5 = 10;
}
var _local4 = 1;
while (_local4 < 7) {
var _local3 = oppParticles[_local4];
_local3.ox = _local3.x + _local5;
_local3.oy = _local3.y;
_local4++;
}
oppParticles[0].w.s = -_local5;
oppParticles[1].w.s = -_local5;
vC.oppWheel0._visible = true;
vC.oppWheel1._visible = true;
oppChassis._visible = true;
}
}
}
}
}
}
};
manageDamage = function () {
if (_root.pauza == false) {
if (damage > 100) {
crash = true;
damage = 100;
}
if (crash == true) {
if (carX < planet.omtrek) {
attachCrashMessage();
}
}
}
};
setDamage = function (p, pe) {
if (_root.pauza == false) {
var _local3 = false;
var _local2 = Math.abs(pe);
if (_local2 > 50) {
_local2 = 50;
}
if (_local2 > 0) {
_local2 = Math.pow(_local2, 3) / 1000;
if (p.w != false) {
_local3 = true;
_local2 = _local2 / 5;
if (_local2 > 0.15) {
speelSimpelSFX("hitground", _local2);
}
} else if (_local2 > 0.15) {
speelSimpelSFX("hitroof", _local2);
}
if (_local2 > 0.1) {
damageScale = _local2 * 100;
if (damageScale > 100) {
damageScale = 100;
}
}
if (_local3 == false) {
damage = damage + _local2;
} else {
wheelDamage = wheelDamage + _local2;
}
}
}
};
damageBar = function () {
if (_root.pauza == false) {
if (damageScale > 3) {
damageScale = damageScale - 3;
} else {
damageScale = 0;
}
hud.damage.bar._xscale = damageScale;
}
};
storeDamage = function () {
if (_root.pauza == false) {
var _local2 = currentParts.tires;
if (crash == true) {
allParts.tires[_local2].wear = 100;
} else {
allParts.tires[_local2].wear = allParts.tires[_local2].wear + (wheelDamage / 2);
if (allParts.tires[_local2].wear > 100) {
allParts.tires[_local2].wear = 100;
}
}
if (crash == true) {
var _local5 = random(15) + 10;
} else {
var _local5 = 0;
}
var _local4 = currentParts.chassis;
allParts.chassis[_local4].wear = allParts.chassis[_local4].wear + (((1.2 - (Math.random() * 0.4)) * (damage + (wheelDamage / 6))) + _local5);
if (allParts.chassis[_local4].wear > 100) {
allParts.chassis[_local4].wear = 100;
}
var _local3 = currentParts.engine;
allParts.engines[_local3].wear = allParts.engines[_local3].wear + (((1.2 - (Math.random() * 0.4)) * ((damage / 3) + (wheelDamage / 4))) + (_local5 / 2));
if (allParts.engines[_local3].wear > 100) {
allParts.engines[_local3].wear = 100;
}
}
};
initAfterburner = function (optie) {
if (_root.pauza == false) {
if (optie == "measure") {
var _local7 = currentParts.afterburner;
var _local3 = allParts.afterburners[_local7].wear;
var _local4 = allParts.afterburners[_local7].type;
var _local2 = allAfterburners[_local4].secs;
abTotalBits = _local2 * 33;
var _local6 = ((_local3 / 100) * _local2) * 33;
afterburnerBitsLeft = abTotalBits - _local6;
if (youKing == true) {
abTotalBits = 1650;
afterburnerBitsLeft = 1650;
}
var _local5 = (afterburnerBitsLeft / abTotalBits) * 100;
hud.fuel.mask._xscale = _local5;
} else {
var _local7 = currentParts.afterburner;
allParts.afterburners[_local7].wear = 100 - Math.round((afterburnerBitsLeft / abTotalBits) * 100);
}
}
};
setStarBackground = function () {
if (_root.pauza == false) {
var _local5 = 0;
while (_local5 < 19) {
var _local4 = background.stars.getNextHighestDepth();
var _local3 = background.stars.attachMovie("mcSter", "mcSter" + _local4, _local4);
_local3._x = random(sW);
_local3._y = random(sH);
var _local6;
if (Math.random() > 1) {
frameNr = 3;
} else {
frameNr = random(2) + 1;
}
_local3.gotoAndStop(frameNr);
_local3.distance = 0.9 + (Math.random() * 0.09);
_local3.onEnterFrame = function () {
if (stopScroll != true) {
this._x = this._x + (xPosDiff * this.distance);
this._y = this._y + (yPosDiff * this.distance);
if ((this._x < ((-xPos) - starMargin)) || (this._x > (((-xPos) + sW) + starMargin))) {
this.removeMovieClip();
} else if ((this._y < (-yPos)) || (this._y > ((-yPos) + sH))) {
this.removeMovieClip();
}
}
};
_local5++;
}
}
};
renderBackground = function () {
if (_root.pauza == false) {
var _local3 = 0;
for (var _local5 in background.stars) {
_local3++;
}
if (stopScroll != true) {
background.mcBg._x = -xPos;
background.mcBg._y = -yPos;
if (_local3 < 18) {
if (Math.random() > 0.8) {
var _local6 = background.stars.getNextHighestDepth();
var _local4 = background.stars.attachMovie("mcSter", "mcSter" + _local6, _local6);
_local4._x = ((-xPos) + sW) + random(starMargin);
_local4._y = (-yPos) + random(sH);
var _local7;
if (Math.random() > 1) {
frameNr = 3;
} else {
frameNr = random(2) + 1;
}
_local4.gotoAndStop(frameNr);
_local4.distance = 0.9 + (Math.random() * 0.09);
_local4.onEnterFrame = function () {
if (stopScroll != true) {
this._x = this._x + (xPosDiff * this.distance);
this._y = this._y + (yPosDiff * this.distance);
if ((this._x < ((-xPos) - starMargin)) || (this._x > (((-xPos) + sW) + starMargin))) {
this.removeMovieClip();
} else if ((this._y < (-yPos)) || (this._y > ((-yPos) + sH))) {
this.removeMovieClip();
}
}
};
}
}
} else {
xPosDiff = 0;
}
}
};
renderSurfaceTiles = function () {
if (_root.pauza == false) {
var _local3 = 0;
for (var _local4 in surfaceTiles) {
_local3++;
}
countTiles--;
if (_local3 < 2) {
var _local13 = aTerrain.length - 1;
var _local6 = aTerrain[_local13];
var _local7 = _local6.x0;
var _local14 = _local6.x1;
var _local10 = _local6.y0;
var _local9 = _local6.y1;
if (countTiles <= 0) {
var _local12 = (-yPos) + sH;
if (_local10 && (_local9 < (_local12 - 100))) {
if (_local7 > ((-xPos) + 270)) {
if ((_local14 - _local7) > 50) {
countTiles = 40 + random(20);
var _local8 = surfaceTiles.getNextHighestDepth();
var _local5 = surfaceTiles.attachMovie("mcSurfaceTile", "surfaceTile" + _local8, _local8);
var _local15 = planet.colors.lineColor;
C = new Color(_local5);
C.setRGB(_local15);
}
var _local11 = (_local10 + _local9) / 2;
_local5._x = _local7;
_local5._y = (_local11 + 140) + random(60);
_local5.onEnterFrame = function () {
if ((this._x + this._width) < (-xPos)) {
if (finish != true) {
this.removeMovieClip();
}
}
};
}
}
}
}
}
};
quitToGarage = function () {
if (_root.pauza == false) {
_global.inGame = true;
staticMcs.removeMovieClip();
speelSimpelSFX("garage");
main._parent.gotoAndStop("startmenu");
main.removeMovieClip();
}
};
quitToMainMenu = function () {
if (_root.pauza == false) {
_global.inGame = false;
staticMcs.removeMovieClip();
main._parent.gotoAndStop("startmenu");
main.removeMovieClip();
}
};
renderStartFinish = function () {
if (_root.pauza == false) {
var _local3 = planet.omtrek;
if (scenery.finish == undefined) {
if (((-xPos) > (_local3 - 400)) || ((-xPos) < (_local3 - 400))) {
var _local4 = scenery.attachMovie("mcStartFinish", "finish", 0);
_local4.onEnterFrame = function () {
this._x = planet.omtrek;
this._y = aTerrain[aTerrain.length - 1].y1;
};
}
}
}
};
checkForTrouble = function () {
if (_root.pauza == false) {
var _local3 = currentParts.engine;
var _local7 = allParts.engines[_local3].wear;
var _local6 = currentParts.chassis;
var _local4 = allParts.chassis[_local6].wear;
var _local8 = currentParts.tires;
var _local5 = allParts.tires[_local8].wear;
if (carLost == true) {
return("carlost");
}
if (_global.planetTime >= 20) {
return("time");
}
if (((_local7 >= 100) || (_local4 >= 100)) || (_local5 >= 100)) {
return("damage");
}
if (crash == true) {
return("damage");
}
return(null);
}
};
displayHighscores = function () {
if (_root.pauza == false) {
var _local2 = staticMcs.finishMessage;
_local2.gotoAndStop("highscores");
_local2.ok.gotoAndStop("ok");
_local2.ok.onRelease = function () {
quitToMainMenu();
};
}
};
submitScore = function (passVar) {
var _local3 = staticMcs.finishMessage;
_local3.gotoAndStop("completed");
_local3.btn1.gotoAndStop("menu");
_local3.btn2.gotoAndStop("submit");
_local3.score.text = "Total score: " + _global.totalScore;
_local3.btn1.onRelease = function () {
stopSound();
playLoop("menuloop");
quitToMainMenu();
};
_local3.btn2.onRelease = function () {
stopSound();
playLoop("menuloop");
_root.xdada = 0;
_root.gotoAndPlay("submitScore");
};
};
listenToAnyKey = function (option) {
if (_root.pauza == false) {
var _local3 = staticMcs.finishMessage;
if (Key.isDown(Key.getCode())) {
delete _local3.onEnterFrame;
if (option == "scoregame") {
if (_global.scoreGameProgress > 2) {
submitScore(_local3);
} else {
_global.scoreGameProgress++;
startHighscoreGame();
}
} else if (option == "exit") {
stopSound();
playLoop("menuloop");
quitToMainMenu();
} else if (option == "finish") {
if (cashPaid == false) {
cashPaid = true;
manageEarnings();
}
clearIntervals();
if (youKing != true) {
initAfterburner();
storeDamage();
}
stopSound();
playLoop("menuloop");
var _local4 = checkForTrouble();
if (_local4 != null) {
_global.trouble = _local4;
quitToGarage();
} else {
_global.trouble = null;
if (KingGame != true) {
_global.afterRace = true;
if (randomOpponentIndex < (aRandomOpponents.length - 1)) {
randomOpponentIndex++;
} else {
randomOpponentIndex = 0;
}
currentOpponent = aRandomOpponents[randomOpponentIndex];
main._parent.gotoAndStop(startOppSelect());
} else {
_global.afterRace = false;
main._parent.gotoAndStop(startOppSelect());
}
}
} else if (option == "keyhelp") {
staticMcs.startMessage.removeMovieClip();
scoreKeyHelpShowed = true;
attachStartMessage();
} else {
keyPressed = true;
if (scoreGame == true) {
scoreTimer = getTimer();
}
staticMcs.startMessage.removeMovieClip();
carsVisible(true);
attachFlits();
speelSimpelSFX("startrace");
}
}
}
};
attachScoreMessage = function () {
stopSFXLoops();
if (staticMcs.finishMessage == undefined) {
((raceWon == true) ? (speelSimpelSFX("finish")) : (speelSimpelSFX("lost")));
staticMcs.crashMessage.removeMovieClip();
var _local3 = staticMcs.attachMovie("finishMessage", "finishMessage", staticMcs.getNextHighestDepth());
_local3.pressanykey._visible = false;
if (raceWon == true) {
_local3.gotoAndStop("summary");
var _local8 = 1000 * _global.scoreGameProgress;
var finishTimer = getTimer();
var _local11 = finishTimer - scoreTimer;
var _local5 = Math.round((60000 - _local11) / 10);
if (_local5 < 0) {
_local5 = 0;
}
var _local10 = damage + (wheelDamage / 4);
var _local4 = Math.round((100 - _local10) * 10);
if (_local4 < 0) {
_local4 = 0;
}
var _local6 = (_local5 + _local4) + _local8;
var _local9 = _global.game.diffLevel;
var _local7 = Math.round(_local6 * _local9);
_local3.score.text = _local8;
_local3.damage.text = _local4;
_local3.time.text = _local5;
_local3.total.text = _local6;
_local3.difficulty.text = "* " + _local9;
_local3.addscore.text = _local7;
_global.totalScore = _global.totalScore + _local7;
_local3.totalscore.text = _global.totalScore;
_local3.onEnterFrame = function () {
this.finishTimer++;
if (this.finishTimer > 30) {
this.pressanykey._visible = true;
listenToAnyKey("scoregame", this);
}
moveElas(this, this._x, 100, 0.4, 0.2);
};
} else {
_local3.gotoAndStop("gameover");
_local3.onEnterFrame = function () {
this.finishTimer++;
if (this.finishTimer > 30) {
this.pressanykey._visible = true;
listenToAnyKey("exit", this);
}
moveElas(this, this._x, 100, 0.4, 0.2);
};
}
_local3._x = sW / 2;
_local3._y = -1000;
_local3.xElas = 0;
_local3.yElas = 0;
_local3.finishTimer = 0;
}
};
attachFinishMessage = function () {
stopSFXLoops();
attachFlits();
if (staticMcs.finishMessage == undefined) {
((raceWon == true) ? (speelSimpelSFX("finish")) : (speelSimpelSFX("lost")));
staticMcs.crashMessage.removeMovieClip();
var _local4 = staticMcs.attachMovie("finishMessage", "finishMessage", staticMcs.getNextHighestDepth());
var _local7 = "$ " + _global.currentAmount;
if (_global.currentAmount == 2) {
_local7 = "the car";
}
if (raceWon == true) {
_local4.gotoAndStop("win");
var _local6 = Math.floor(_global.currentAmount / 2000);
var _local5 = "!";
var _local3 = 1;
while (_local3 < _local6) {
_local5 = _local5 + "!";
_local3++;
}
if (KingGame == true) {
if (oppKing == true) {
var _local9 = "You are the new King!";
} else if (youKing == true) {
var _local9 = "You have retained your crown";
}
} else {
var _local9 = (("you win " + _local7) + " ") + _local5;
}
_local4.winmoney.text = _local9;
} else {
_local4.gotoAndStop("lose");
if (KingGame == true) {
if (oppKing == true) {
var _local8 = "You have lost the challenge.";
} else if (youKing == true) {
var _local8 = "You have lost your crown.";
}
} else {
var _local8 = ("you lose " + _local7) + ".";
}
_local4.losemoney.text = _local8;
}
_local4.pressanykey._visible = false;
_local4._x = sW / 2;
_local4._y = -1000;
_local4.xElas = 0;
_local4.yElas = 0;
_local4.finishTimer = 0;
_local4.onEnterFrame = function () {
this.finishTimer++;
if (this.finishTimer > 30) {
this.pressanykey._visible = true;
listenToAnyKey("finish", this);
}
moveElas(this, this._x, 100, 0.4, 0.2);
};
}
};
attachStartMessage = function () {
if (staticMcs.startMessage == undefined) {
if (scoreGame == true) {
var m = staticMcs.attachMovie("startScoreMessage", "startMessage", staticMcs.getNextHighestDepth());
if ((_global.scoreGameProgress == 1) && (scoreKeyHelpShowed != true)) {
m.gotoAndStop("keyhelp");
m._x = sW / 2;
m._y = -1000;
m.xElas = 0;
m.yElas = 0;
m.finishTimer = 0;
m.onEnterFrame = function () {
this.finishTimer++;
moveElas(this, this._x, 140, 0.4, 0.2);
if (this.finishTimer > 10) {
listenToAnyKey("keyhelp", this);
}
};
} else {
m.gotoAndStop("round");
m.round.text = "round " + _global.scoreGameProgress;
m.pressanykey._visible = false;
m._x = sW / 2;
m._y = -1000;
m.xElas = 0;
m.yElas = 0;
m.finishTimer = 0;
m.onEnterFrame = function () {
this.finishTimer++;
moveElas(this, this._x, 140, 0.4, 0.2);
if (this.finishTimer > 30) {
listenToAnyKey(null, this);
m.pressanykey._visible = true;
}
};
}
} else {
var m = staticMcs.attachMovie("startMessage", "startMessage", staticMcs.getNextHighestDepth());
if (_global.game.time > 2) {
m.gotoAndStop(2);
}
m._x = sW / 2;
m._y = -1000;
m.xElas = 0;
m.yElas = 0;
m.finishTimer = 0;
m.onEnterFrame = function () {
this.finishTimer++;
moveElas(this, this._x, 140, 0.4, 0.2);
if (this.finishTimer > 10) {
listenToAnyKey(null, this);
}
};
}
}
};
stopSFXLoops = function () {
sfx_engine.stop();
sfx_afterburner.stop();
};
attachCrashMessage = function () {
stopSFXLoops();
if (staticMcs.finishMessage == undefined) {
if (staticMcs.crashMessage == undefined) {
var _local2 = staticMcs.attachMovie("finishMessage", "crashMessage", staticMcs.getNextHighestDepth());
_local2.gotoAndStop("crash");
_local2.pressanykey._visible = false;
_local2.crashed._visible = false;
_local2._x = sW / 2;
_local2._y = -1000;
_local2.xElas = 0;
_local2.yElas = 0;
_local2.finishTimer = 0;
_local2.onEnterFrame = function () {
this.finishTimer++;
if (this.finishTimer > 40) {
this.crashed._visible = true;
}
if (this.finishTimer > 100) {
this.pressanykey._visible = true;
if (scoreGame == true) {
listenToAnyKey("exit", this);
} else {
listenToAnyKey("finish");
}
}
moveElas(this, this._x, 100, 0.4, 0.2);
};
}
}
};
clickOkAfterRace = function (action) {
var _local2;
switch (action) {
case "carlost" :
_local2 = "You have lost your car.";
break;
case "time" :
_local2 = "It's time to go home";
break;
case "damage" :
_local2 = "Your car has been badly damaged. You will need to do repairs before you can race again.";
}
var _local3 = cC.attachMovie("mcClickOk", "mcClickOk", cC.getNextHighestDepth());
_local3.gotoAndStop("general");
_local3.description.text = _local2;
_local3.btnOk.onRelease = function () {
this._parent.removeMovieClip();
};
};
clearIntervals = function () {
clearInterval(opponentWaitInt);
clearInterval(oncePerSecInt);
clearInterval(onceSixSecInt);
clearInterval(tenPerSecInt);
};
displayDamage = function (mc) {
var _local3 = currentParts.engine;
var _local5 = _global.game.parts.engines[_local3].wear;
mc.engine.red._width = _local5;
mc.engine.description.gotoAndStop("damage");
var _local6 = currentParts.tires;
_local5 = _global.game.parts.tires[_local6].wear;
mc.tires.red._width = _local5;
mc.tires.description.gotoAndStop("wear");
var _local7 = currentParts.afterburner;
_local5 = _global.game.parts.afterburners[_local7].wear;
mc.afterburner.red._width = 100 - _local5;
mc.afterburner.green.gotoAndStop(2);
mc.afterburner.red.gotoAndStop(2);
mc.afterburner.description.gotoAndStop("fuel");
var _local4 = currentParts.chassis;
_local5 = _global.game.parts.chassis[_local4].wear;
mc.chassis.red._width = _local5;
mc.chassis.description.gotoAndStop("damage");
};
getNewChassisColor = function (chassisNr, origcolor) {
trace("chassisNr: " + chassisNr);
if (chassisNr == 1) {
var _local2 = 14;
} else if (chassisNr == 2) {
var _local2 = 15;
} else {
var _local2 = 15;
}
var _local1 = oricolor;
nwc = _local1;
nwc = random(_local2) + 1;
if (nwc == _local1) {
if (nwc < _local2) {
nwc++;
} else {
nwc--;
}
}
return(nwc);
};
init = function () {
ticks = 0;
sW = 550;
sH = 400;
mH = 500;
mW = 2000;
initAllParts();
allParts = _global.game.parts;
currentParts = _global.game.currentParts;
down = Key.isDown;
if (gCar == true) {
initX = 50;
initY = -40;
} else if (oppS == true) {
initX = -200 + random(100);
initY = 250;
} else {
initX = 300;
initY = 230;
initOppX = 150;
initOppY = 230;
}
memXPos = 0;
memYPos = 0;
drag = 0.9999999;
maxSpeed = 2.7;
spring1 = 0.55;
spring2 = 0.55;
starMargin = 100;
terrainStep = 0;
xPosDiff = 0;
yPosDiff = 0;
xPos = 0;
yPos = 0;
surface = main.createEmptyMovieClip("surface", 1);
surfaceTiles = main.createEmptyMovieClip("surfaceTileContainer", 6);
scenery = main.createEmptyMovieClip("sceneryContainer", 7);
crash = false;
finish = false;
oppFinish = false;
oppXPos = 0;
flatTerrain = null;
stopScroll = null;
finish = null;
raceWon = null;
overStart = false;
oppOverStart = false;
telrun = 0;
telLong = 0;
oppSpeed = 0;
oppGear = 0;
countOS = 0;
stopScroll = false;
countTiles = 0;
raceWon = null;
keyPressed = false;
oSstap = null;
oSstap2Taken = null;
Key.removeListener(_global.LuisterToets);
delete _global.LuisterToets;
damageScale = 0;
damage = 0;
wheelDamage = 0;
afterburnerPlaying = null;
enginePlaying = null;
engineStep = 0;
oppBurner = false;
oppCrashed = false;
firstOppCalc = false;
hitGroundCounter = 0;
dispBuilding = null;
currentEngine = 1;
AISpeed = null;
playerSpeed = null;
cashPaid = false;
carLost = false;
if ((KingGame == true) && (_global.game.youTheKing != true)) {
oppKing = true;
} else {
oppKing = false;
}
if ((_global.game.youTheKing == true) && (KingGame == true)) {
youKing = true;
} else {
youKing = false;
}
if (gCar != true) {
_global.planetTime++;
}
fillColor = planet.colors.fillColor;
lineColor = planet.colors.lineColor;
};
attachHud = function () {
hud = staticMcs.attachMovie("mcHud", "mcHud", 0);
hud.damage.bar._xscale = 0;
if (scoreGame == true) {
hud.amount.text = " ";
} else {
var _local2;
if (_global.currentAmount == 2) {
_local2 = "car";
} else if (_global.currentAmount == 4) {
_local2 = "crown";
} else {
_local2 = "$ " + _global.currentAmount;
}
hud.amount.text = _local2;
}
hud.planet.car1.gotoAndStop("rechts");
hud.planet.car2.gotoAndStop("links");
hud.exit.onRelease = function () {
if ((keyPressed == true) && (finish != true)) {
crashCar();
}
};
};
initDriver = function () {
driver = {rep:30, name:"Martijn"};
};
initPlanet = function () {
initPlanets();
var _local3 = _global.currentPlanet;
trace("deze planeet " + _local3);
if (gCar == true) {
grav = 0.4 + (Math.random() / 6);
} else {
var _local2 = [];
_local2[1] = {fillColor:"0xB7C5D9", lineColor:"0xA5B6CF"};
_local2[2] = {fillColor:"0xFFB3B3", lineColor:"0xFFCACA"};
_local2[3] = {fillColor:"0xBDB9D0", lineColor:"0xCECCDD"};
_local2[4] = {fillColor:"0xCECECE", lineColor:"0xDDDDDD"};
_local2[5] = {fillColor:"0xC8EAC6", lineColor:"0xE2F4E1"};
planet = {omtrek:aPlanets[_local3].size, colors:_local2[_local3], diff:aPlanets[_local3].diff, surface:aPlanets[_local3].surface};
grav = aPlanets[_local3].gravity;
}
};
initPlanets = function () {
var _local5 = "Not many dare to race on this planet.";
var _local4 = "This is not for rookies.";
var _local3 = "Reputations are built on this planet.";
var _local2 = "Be carefull on those hills.";
var _local1 = "Become King to set a high score.";
aPlanets = [];
aPlanets[1] = {surface:98, gravity:0.21, size:18000, travel_cost:3000, diff:0.66, description:_local5};
aPlanets[2] = {surface:66, gravity:0.19, size:14000, travel_cost:1500, diff:0.8, description:_local4};
aPlanets[3] = {surface:54, gravity:0.24, size:8000, travel_cost:400, diff:0.91, description:_local3};
aPlanets[4] = {surface:76, gravity:0.28, size:10000, travel_cost:800, diff:0.81, description:_local2};
aPlanets[5] = {surface:82, gravity:0.24, size:30000, travel_cost:100000, diff:0.65, description:_local1};
};
newPlanetData = function () {
aPlanets = [];
aPlanets[1] = 2 + random(6);
aPlanets[2] = 2 + random(6);
aPlanets[3] = 4 + random(4);
aPlanets[4] = 3 + random(5);
aPlanets[5] = 1;
return(aPlanets);
};
planetDescriptions = function (type, amount) {
if (type == "surface") {
if (amount < 30) {
return("flat");
}
if (amount < 60) {
return("bumpy");
}
if (amount < 80) {
return("hills");
}
return("mountanious");
}
if (type == "size") {
if (amount < 9000) {
return("tiny");
}
if (amount < 13000) {
return("small");
}
if (amount < 16000) {
return("medium");
}
return("huge");
}
if (type == "gravity") {
if (amount < 0.2) {
return("very low");
}
if (amount < 0.22) {
return("low");
}
if (amount < 0.26) {
return("medium");
}
return("very high");
}
};
initOpponents = function (planet) {
trace("PLANEET: " + planet);
var _local2 = [];
_local2[0] = {name:"Everett", homePlanet:1, key:0, face:4, faceframe:1, rep:90, chassis:3, wheels:3, engine:3, afterburner:3, temper:2};
_local2[1] = {name:"B1", homePlanet:1, key:1, face:5, faceframe:1, rep:86, chassis:3, wheels:3, engine:3, afterburner:3, temper:0};
_local2[2] = {name:"Wander", homePlanet:1, key:2, face:3, faceframe:1, rep:42, chassis:3, wheels:3, engine:3, afterburner:3, temper:2};
_local2[3] = {name:"Skid Vicious", homePlanet:1, key:3, face:4, faceframe:2, rep:70, chassis:2, wheels:3, engine:3, afterburner:3, temper:2};
_local2[4] = {name:"Wanderley", homePlanet:1, key:4, face:2, faceframe:1, rep:63, chassis:3, wheels:3, engine:3, afterburner:3, temper:0};
_local2[5] = {name:"F1", homePlanet:1, key:5, face:5, faceframe:2, rep:94, chassis:3, wheels:3, engine:3, afterburner:3, temper:0};
_local2[6] = {name:"Dr Lamptey", homePlanet:1, key:6, face:1, faceframe:1, rep:73, chassis:3, wheels:3, engine:3, afterburner:2, temper:0};
_local2[7] = {name:"Wheeler", homePlanet:1, key:7, face:4, faceframe:3, rep:80, chassis:3, wheels:3, engine:3, afterburner:3, temper:0};
var _local5 = [];
_local5[0] = {name:"Gold Peter", homePlanet:2, key:0, face:4, faceframe:4, rep:53, chassis:2, wheels:3, engine:2, afterburner:3, temper:0};
_local5[1] = {name:"Flem", homePlanet:2, key:1, face:3, faceframe:2, rep:72, chassis:3, wheels:2, engine:2, afterburner:3, temper:2};
_local5[2] = {name:"Ignatius", homePlanet:2, key:2, face:2, faceframe:2, rep:88, chassis:3, wheels:3, engine:3, afterburner:2, temper:0};
_local5[3] = {name:"Merrel", homePlanet:2, key:3, face:3, faceframe:3, rep:53, chassis:3, wheels:3, engine:2, afterburner:2, temper:0};
_local5[4] = {name:"Ursuul", homePlanet:2, key:4, face:1, faceframe:2, rep:38, chassis:2, wheels:1, engine:1, afterburner:1, temper:3};
_local5[5] = {name:"Willard", homePlanet:2, key:5, face:2, faceframe:3, rep:78, chassis:3, wheels:3, engine:2, afterburner:3, temper:0};
_local5[6] = {name:"ZX80", homePlanet:2, key:6, face:5, faceframe:1, rep:66, chassis:3, wheels:2, engine:2, afterburner:1, temper:0};
_local5[7] = {name:"Newman", homePlanet:2, key:7, face:1, faceframe:3, rep:46, chassis:2, wheels:3, engine:1, afterburner:2, temper:2};
var _local4 = [];
_local4[0] = {name:"Gertrude", homePlanet:3, key:0, face:1, faceframe:4, rep:40, chassis:2, wheels:2, engine:1, afterburner:1, temper:0};
_local4[1] = {name:"Tel Ngane", homePlanet:3, key:1, face:2, faceframe:4, rep:9, chassis:1, wheels:1, engine:1, afterburner:1, temper:0};
_local4[2] = {name:"Islander", homePlanet:3, key:2, face:3, faceframe:4, rep:19, chassis:1, wheels:1, engine:1, afterburner:2, temper:2};
_local4[3] = {name:"El Unser", homePlanet:3, key:3, face:1, faceframe:5, rep:24, chassis:1, wheels:2, engine:1, afterburner:2, temper:0};
_local4[4] = {name:"Koi", homePlanet:3, key:4, face:2, faceframe:5, rep:13, chassis:1, wheels:2, engine:1, afterburner:1, temper:0};
_local4[5] = {name:"Bernd", homePlanet:3, key:5, face:4, faceframe:5, rep:28, chassis:2, wheels:1, engine:2, afterburner:1, temper:2};
_local4[6] = {name:"Mamadou", homePlanet:3, key:6, face:3, faceframe:5, rep:62, chassis:2, wheels:3, engine:2, afterburner:2, temper:2};
_local4[7] = {name:"Norfolk", homePlanet:3, key:7, face:1, faceframe:6, rep:37, chassis:1, wheels:1, engine:1, afterburner:3, temper:0};
var _local3 = [];
_local3[0] = {name:"Spurgeon", homePlanet:4, key:0, face:2, faceframe:6, rep:50, chassis:2, wheels:3, engine:2, afterburner:2, temper:0};
_local3[1] = {name:"Joonas", homePlanet:4, key:1, face:3, faceframe:6, rep:46, chassis:1, wheels:2, engine:2, afterburner:3, temper:0};
_local3[2] = {name:"No Name Sam", homePlanet:4, key:2, face:3, faceframe:7, rep:38, chassis:2, wheels:1, engine:1, afterburner:2, temper:2};
_local3[3] = {name:"Railway Guy", homePlanet:4, key:3, face:1, faceframe:7, rep:68, chassis:3, wheels:3, engine:3, afterburner:3, temper:0};
_local3[4] = {name:"Ali", homePlanet:4, key:4, face:2, faceframe:7, rep:63, chassis:3, wheels:3, engine:3, afterburner:2, temper:0};
_local3[5] = {name:"Biebs", homePlanet:4, key:5, face:1, faceframe:8, rep:48, chassis:2, wheels:2, engine:2, afterburner:1, temper:3};
_local3[6] = {name:"Otis", homePlanet:4, key:6, face:4, faceframe:6, rep:88, chassis:3, wheels:3, engine:3, afterburner:3, temper:2};
_local3[7] = {name:"Alvin", homePlanet:4, key:7, face:4, faceframe:7, rep:34, chassis:2, wheels:2, engine:1, afterburner:1, temper:0};
aOpponents = [];
if (planet == 1) {
aOpponents = _local2;
aOpponents.push(_local5[random(_local5.length)]);
aOpponents.push(_local4[random(_local4.length)]);
aOpponents.push(_local3[random(_local3.length)]);
} else if (planet == 2) {
aOpponents = _local5;
aOpponents.push(_local2[random(_local2.length)]);
aOpponents.push(_local4[random(_local4.length)]);
aOpponents.push(_local3[random(_local3.length)]);
} else if (planet == 3) {
aOpponents = _local4;
aOpponents.push(_local5[random(_local5.length)]);
aOpponents.push(_local2[random(_local2.length)]);
aOpponents.push(_local3[random(_local3.length)]);
} else if (planet == 4) {
aOpponents = _local3;
aOpponents.push(_local5[random(_local5.length)]);
aOpponents.push(_local4[random(_local4.length)]);
aOpponents.push(_local2[random(_local2.length)]);
} else if (planet == 5) {
if (oppKing == true) {
var _local7 = _global.game.king.key;
switch (_global.game.king.planet) {
case 1 :
aOpponents[0] = _local2[_local7];
break;
case 2 :
aOpponents[0] = _local5[_local7];
break;
case 3 :
aOpponents[0] = _local4[_local7];
break;
case 4 :
aOpponents[0] = _local3[_local7];
}
} else {
aOpponents = _local2;
}
}
if (planet == _global.game.king.planet) {
i = 0;
while (i < aOpponents.length) {
if (aOpponents[i].key == _global.game.king.key) {
aOpponents.splice(i, 1);
}
i++;
}
}
};
sharedOppColors = function () {
var _local1 = [];
_local1[1] = [6, 3, 4, 9, 10, 7, 8, 1, 5];
_local1[2] = [6, 12, 3, 8, 15, 7, 10, 2];
_local1[3] = [12, 3, 7, 13, 10, 8, 5, 11, 4];
_local1[4] = [10, 11, 12, 13, 7, 6, 3, 1, 8];
return(_local1);
};
getSentence = function (option) {
switch (option) {
case "sentence" :
var _local1 = [];
_local1[0] = "I feel lucky today. Let's race.";
_local1[1] = "You look a bit pale, I think I will beat you today";
_local1[2] = "Yeah, lets race, how exiting";
_local1[3] = "Let's go.";
_local1[4] = "I feel a little weak today. You'll probably beat me, but let's go anyway.";
_local1[5] = "I'm on a winning steak. Let's go.";
_local1[6] = "You look like you have a hangover. Dare to challenge me?";
_local1[7] = "You look like you are about to lose you next race";
_local1[8] = "You can't beat me today.";
_local1[9] = "I don't race against creatures as ugly as you. But I'll make an exception.";
_local1[10] = "If you want to build a reputation, try to beat me.";
_local1[11] = "Huh, what?? race? Ok, lets go..";
_local1[12] = "I could use some exercise, let's go for it";
_local1[13] = "Let's go, I want to win some cash before I go home.";
_local1[14] = "So you think you can beat me with that??? Good luck. You'll need it";
_local1[15] = "You don't stand a chance against me.";
_local1[16] = "I hear you have quite a reputation, let's go.";
return(_local1[random(_local1.length)]);
case "decline" :
var _local2 = [];
_local2[0] = "Who are you? Why would I want to race against you?";
_local2[1] = "Only in your dreams chipmunk";
_local2[2] = "So, why would I waste my time racing you, eh?";
_local2[3] = "Not today, come back when you build a reputation";
_local2[4] = "I'm not here for charity pal.";
_local2[5] = "You are not worthy scratching my car over";
_local2[6] = "I don't race babies";
_local2[7] = "I only race intelligent lifeforms";
_local2[8] = "I don't race beginners";
_local2[9] = "I only race against pro's";
return(_local2[random(_local2.length)]);
case "chicken" :
var _local7 = [];
_local7[0] = "I thank thee for the honour, but I'd rather not.";
_local7[1] = "No, not at this point";
_local7[2] = "I feel luck is not with me today";
return(_local7[random(_local7.length)]);
case "temper" :
var _local4 = [];
_local4[0] = "...";
_local4[1] = "grrrwwrrr";
_local4[2] = "I don't like you";
_local4[3] = "Get lost!";
_local4[4] = "You again?";
_local4[5] = "Go home!";
_local4[6] = "Punk!";
return(_local4[random(_local4.length)]);
case "car" :
var _local5 = [];
_local5[0] = "Your car, I want it";
_local5[1] = "It looks like you will be walking home tonight.";
_local5[2] = "Take a look at my car. You want it? Come and get it";
_local5[3] = "I like your car";
_local5[4] = "I feel like taking a gamble today. Let's race for the car.";
_local5[5] = "You look like you are about to lose you car";
return(_local5[random(_local5.length)]);
case "weird" :
var _local3 = [];
_local3[0] = "You can beat me, easily. Really.";
_local3[1] = "Haha, hik, yup, hik.";
_local3[2] = "Once, I will be the King.";
_local3[3] = "I will be the next King.";
_local3[4] = "I defeated the King once. Hihi, Yup hehe. Hik.";
_local3[5] = "If you want to race like a monk you have got to live like a monk.";
_local3[6] = "I will wear the crown someday.";
return(_local3[random(_local3.length)]);
case "king" :
var _local6 = [];
_local6[0] = "What makes you think you can defeat the King?";
_local6[1] = "I know what you want, you can't have it.";
_local6[2] = "Many have failed, why would it be different this time?";
_local6[3] = "You challenging me is an insult. You shall be defeated.";
_local6[4] = "This crown could be yours. To bad you cannot beat me.";
return(_local6[random(_local6.length)]);
case "youking" :
var _local8 = [];
_local8[0] = "You are not worthy of the crown, I will take it from you.";
_local8[1] = "Your crown, your precious crown...";
_local8[2] = "Your car, your crown, and the palace are mine!";
return(_local8[random(_local8.length)]);
}
};
opponentText = function () {
var _local1 = (aSentences = []);
_local1[0] = "I feel lucky today. Let's race.";
_local1[1] = "You look a bit pale, I think I will beat you today";
_local1[2] = "Yeah, lets race, how exiting";
_local1[3] = "Let's go.";
_local1[4] = "I feel a little weak today. You'll probably beat me, but let's go anyway.";
_local1[5] = "I'm on a winning steak. Let's go.";
_local1[6] = "You look like you have a hangover. Dare to challenge me?";
_local1[7] = "You look like you are about to lose you next race";
_local1[8] = "You can't beat me today.";
_local1[9] = "I don't race against creatures as ugly as you. But I'll make an exception.";
_local1[10] = "If you want to build a reputation, try to beat me.";
_local1[11] = "Huh, what?? race? Ok, lets go..";
_local1[12] = "I could use some exercise, let's go for it";
_local1[13] = "Let's go, I want to win some cash before I go home.";
_local1[14] = "So you think you can beat me with that??? Good luck. You'll need it";
_local1[15] = "You don't stand a chance against me.";
_local1[16] = "I hear you have quite a reputation, let's go.";
var _local4 = (aDeclineSentences = []);
_local4[0] = "Who are you? Why would I want to race against you?";
_local4[1] = "Only in your dreams chipmunk";
_local4[2] = "So, why would I waste my time racing you, eh?";
_local4[3] = "Not today, come back when you build a reputation";
_local4[4] = "I'm not here for charity pal.";
_local4[5] = "You are not worthy scratching my car over";
_local4[6] = "I don't race babies";
aC[7] = "I only race intelligent lifeforms";
aC[8] = "I don't race beginners";
aC[9] = "I only race against pro's";
var _local7 = (aChickenSentences = []);
_local7[0] = "I thank thee for the honour, but I'd rather not.";
_local7[1] = "No, not at this point";
_local7[2] = "I feel luck is not with me today";
var _local3 = (aTemperSentences = []);
_local3[0] = "...";
_local3[1] = "grrrwwrrr";
_local3[2] = "I don't like you";
_local3[3] = "Get lost!";
_local3[4] = "You again?";
_local3[5] = "Go home!";
_local3[6] = "Punk!";
var aC = ((aCarSentences = []));
aC[0] = "Your car, I want it";
aC[1] = "It looks like you will be walking home tonight.";
aC[2] = "Take a look at my car. You want it? Come and get it";
aC[3] = "I like your car";
aC[4] = "I feel like taking a gamble today. Let's race for the car.";
aC[5] = "You look like you are about to lose you car";
var _local2 = (aWeirdSentences = []);
_local2[0] = "You can beat me, easily. Really.";
_local2[1] = "Haha, hik, yup, hik.";
_local2[2] = "Once, I will be the King.";
_local2[3] = "I will be the next King.";
_local2[4] = "I defeated the King once. Hihi, Yup hehe. Hik.";
_local2[5] = "If you want to race like a monk you have got to live like a monk.";
_local2[6] = "I will wear the crown someday.";
var _local5 = (aKingSentences = []);
_local5[0] = "What makes you think you can defeat the King?";
_local5[1] = "I know what you want, you can't have it.";
_local5[2] = "Many have failed, why would it be different this time?";
_local5[3] = "You challenging me is an insult. You shall be defeated.";
_local5[4] = "This crown could be yours. To bad you cannot beat me.";
var _local6 = (aOppKingSentences = []);
_local6[0] = "You are not worthy of the crown, I will take it from you.";
_local6[1] = "Your crown, your precious crown...";
_local6[2] = "Your car, your crown, and the palace are mine!";
};
displayBuildings = function () {
var _local3 = 260;
var _local2 = planet.omtrek;
if (dispBuilding == null) {
if ((-xPos) < 1400) {
var _local1 = background.buildings.attachMovie("mcBuildings", "mcBuildings", 1);
_local1.gotoAndStop("start");
_local1._x = _local3;
dispBuilding = "start";
}
if ((-xPos) > (_local2 - 1000)) {
var _local1 = background.buildings.attachMovie("mcBuildings", "mcBuildings", 1);
_local1.gotoAndStop("finish");
_local1._x = _local2;
_local1._y = aTerrain[aTerrain.length - 1].y1;
dispBuilding = "finish";
}
} else if (dispBuilding == "start") {
if ((-xPos) > 1400) {
background.buildings.mcBuildings.removeMovieClip();
dispBuilding = null;
}
}
};
attachBg = function () {
background = main.createEmptyMovieClip("background", 0);
background.createEmptyMovieClip("stars", 1);
background.createEmptyMovieClip("buildings", 2);
var _local1 = background.attachMovie("mcBg", "mcBg", 0);
_local1._width = sW;
};
checkAllPartsPresent = function () {
var _local2 = true;
if (_global.game.parts.engines.length <= 0) {
_local2 = false;
}
if (_global.game.parts.tires.length <= 0) {
_local2 = false;
}
if (_global.game.parts.afterburners.length <= 0) {
_local2 = false;
}
if (_global.game.parts.chassis.length <= 0) {
_local2 = false;
}
return(_local2);
};
checkForDamage = function () {
var _local2 = true;
var _local4 = currentParts.engine;
if (_global.game.parts.engines[_local4].wear >= 100) {
_local2 = false;
}
var _local5 = currentParts.tires;
if (_global.game.parts.tires[_local5].wear >= 100) {
_local2 = false;
}
var _local3 = currentParts.chassis;
if (_global.game.parts.chassis[_local3].wear >= 100) {
_local2 = false;
}
trace(_global.game.parts.chassis[_local3].wear);
return(_local2);
};
initCarStats = function () {
var _local3 = _global.game.parts;
var _local2 = _global.game.currentParts;
var _local4 = _local3.chassis[_local2.chassis].type;
var _local6 = _local3.engines[_local2.engine].type;
var _local9 = _local3.tires[_local2.tires].type;
var _local16 = allChassis[_local4].speed;
var _local15 = allEngines[_local6].speed;
var _local5 = allTires[_local9].grip;
var _local13 = _local3.engines[_local2.engine].wear;
var _local7 = _local3.chassis[_local2.chassis].wear;
var _local10 = _local3.tires[_local2.tires].wear;
var _local8 = (100 - (_local13 / 2)) / 100;
var _local11 = (100 - (_local7 / 2)) / 100;
var _local12 = (100 - (_local10 / 2)) / 100;
var _local17 = (31 * (_local16 * _local11)) * (_local15 * _local8);
cC.mcGarage.stats.speed._width = _local17;
var _local14 = (((0.05 - _local5) / 0.05) * 99) * _local12;
cC.mcGarage.stats.grip._width = _local14;
};
damageRollOvers = function (mc, optionDelete) {
if (optionDelete != true) {
mc.onRollOver = function () {
this.repair._visible = true;
};
mc.onRollOut = function () {
this.repair._visible = false;
};
mc.onReleaseOutside = function () {
this.repair._visible = false;
};
} else {
delete mc.onReleaseOutside;
delete mc.onRollOver;
delete mc.onRollOut;
delete mc.onRelease;
}
};
clickOkRepair = function (wearToZero, damageBar, itemPrice, optionFuel) {
var _local3 = cC.attachMovie("mcClickOk", "mcClickOk", cC.getNextHighestDepth());
_local3.gotoAndStop("repair");
var _local5 = wearToZero.wear;
var repairPrice = Math.round(((itemPrice * _local5) / 100) * 0.4);
if (optionFuel == true) {
var _local4 = "Refuelling ";
} else {
var _local4 = "Repairing ";
}
_local3.description.text = (_local4 + "this item will cost $ ") + repairPrice;
if (_global.game.cash < repairPrice) {
_local3.description2.text = "You do not have enough money to do the repair";
_local3.btnOk._x = sW / 2;
_local3.btnCancel._visible = false;
_local3.btnOk.onRelease = function () {
this._parent.removeMovieClip();
};
} else {
_local3.btnOk.onRelease = function () {
wearToZero.wear = 0;
if (optionFuel == true) {
damageBar._width = 100;
} else {
damageBar._width = 0;
}
_global.game.cash = _global.game.cash - int(repairPrice);
printCash();
initCarStats();
delete damageBar._parent.onRelease;
delete damageBar._parent.onRollOver;
delete damageBar._parent.onReleaseOutside;
delete damageBar._parent.onRollOut;
this._parent.removeMovieClip();
};
_local3.btnCancel.onRelease = function () {
this._parent.removeMovieClip();
};
}
};
clickOkTravel = function (planetNr, nrOfOpps, travelPrice) {
if (((planetNr == 1) || (planetNr == 2)) && (_global.game.certificate != true)) {
var _local3 = cC.attachMovie("mcClickOk", "mcClickOk", cC.getNextHighestDepth());
_local3.gotoAndStop("travel");
_local3.description.text = "You need a certificate to race on this planet.";
_local3.description2.text = "To get a certificate your reputation must be at least 3/10.";
_local3.btnOk._x = sW / 2;
_local3.btnCancel._visible = false;
_local3.btnOk.onRelease = function () {
this._parent.removeMovieClip();
};
_local3.doNotShow._visible = false;
} else if (_global.game.cash < travelPrice) {
var _local3 = cC.attachMovie("mcClickOk", "mcClickOk", cC.getNextHighestDepth());
_local3.gotoAndStop("travel");
_local3.description.text = "Travelling to this planet will cost $ " + travelPrice;
_local3.description2.text = "You do not have enough money to travel.";
_local3.btnOk._x = sW / 2;
_local3.btnCancel._visible = false;
_local3.btnOk.onRelease = function () {
this._parent.removeMovieClip();
};
_local3.doNotShow._visible = false;
} else if (_global.game.misc.noTravelmessage == true) {
_global.currentPlanet = planetNr;
_global.nrOfOpponents = nrOfOpps;
_global.game.cash = _global.game.cash - int(travelPrice);
initControlCenter("start_race");
} else {
var _local3 = cC.attachMovie("mcClickOk", "mcClickOk", cC.getNextHighestDepth());
_local3.gotoAndStop("travel");
_local3.description.text = "Travelling to this planet will cost $ " + travelPrice;
_local3.description2.text = aPlanets[planetNr].description;
_local3.btnOk.onRelease = function () {
_global.currentPlanet = planetNr;
_global.nrOfOpponents = nrOfOpps;
_global.game.cash = _global.game.cash - int(travelPrice);
speelSimpelSFX("warp");
initControlCenter("start_race");
this._parent.removeMovieClip();
};
_local3.btnCancel.onRelease = function () {
this._parent.removeMovieClip();
};
_local3.doNotShow.onRelease = function () {
_global.game.misc.noTravelmessage = true;
this._visible = false;
};
}
};
initGarage = function () {
printCash();
var garage = cC.mcGarage;
initAllParts();
if (checkAllPartsPresent() == true) {
startGarageCar(garage.garageCar);
initCarStats();
} else {
garage.stats._visible = false;
}
if (_global.awardCertificate == true) {
_global.awardCertificate = null;
var _local3 = cC.attachMovie("mcClickOk", "mcClickOk", cC.getNextHighestDepth());
_local3.gotoAndStop("general");
_local3.description.text = "Congratulations! You have been awarded a certificate to race on all planets!";
_local3.btnOk.onRelease = function () {
this._parent.removeMovieClip();
};
}
var game = _global.game;
if (_global.game.parts.engines.length > 0) {
var _local4 = _global.game.currentParts.engine;
var enginetype = _global.game.parts.engines[_local4].type;
var _local6 = _global.game.parts.engines[_local4].wear;
var _local9 = allEngines[enginetype].description;
garage.engine.description.text = _local9;
garage.engine.damage._visible = true;
garage.engine.damage.description.gotoAndStop("damage");
garage.engine.damage.red._width = _local6;
if (_local6 > 0) {
damageRollOvers(garage.engine.damage);
garage.engine.damage.onRelease = function () {
clickOkRepair(_global.game.parts.engines[_global.game.currentParts.engine], garage.engine.damage.red, allEngines[enginetype].price);
};
} else {
damageRollOvers(garage.engine.damage, true);
}
if (game.currentParts.engine > 0) {
garage.engine.left.gotoAndStop(1);
garage.engine.left.onRelease = function () {
game.currentParts.engine--;
initGarage();
speelSimpelSFX("beep");
};
} else {
garage.engine.left.gotoAndStop(3);
}
if (game.currentParts.engine < (game.parts.engines.length - 1)) {
garage.engine.right.gotoAndStop(1);
garage.engine.right.onRelease = function () {
game.currentParts.engine++;
initGarage();
speelSimpelSFX("beep");
};
} else {
garage.engine.right.gotoAndStop(3);
}
} else {
garage.engine.description.text = "none";
garage.engine.damage._visible = false;
garage.engine.left.gotoAndStop(3);
garage.engine.right.gotoAndStop(3);
}
if (_global.game.parts.afterburners.length > 0) {
var _local8 = game.currentParts.afterburner;
var afterburnertype = _global.game.parts.afterburners[_local8].type;
var _local6 = _global.game.parts.afterburners[_local8].wear;
var _local9 = allAfterburners[afterburnertype].description;
garage.afterburner.description.text = _local9;
if (_local6 > 0) {
damageRollOvers(garage.afterburner.damage);
garage.afterburner.damage.repair.gotoAndStop(2);
garage.afterburner.damage.onRelease = function () {
clickOkRepair(_global.game.parts.afterburners[_global.game.currentParts.afterburner], garage.afterburner.damage.red, allAfterburners[afterburnertype].price, true);
};
} else {
damageRollOvers(garage.afterburner.damage, true);
}
garage.afterburner.damage._visible = true;
garage.afterburner.damage.description.gotoAndStop("fuel");
garage.afterburner.damage.green.gotoAndStop(2);
garage.afterburner.damage.red.gotoAndStop(2);
garage.afterburner.damage.red._width = 100 - _local6;
if (game.currentParts.afterburner > 0) {
garage.afterburner.left.gotoAndStop(1);
garage.afterburner.left.onRelease = function () {
game.currentParts.afterburner--;
initGarage();
speelSimpelSFX("beep");
};
} else {
garage.afterburner.left.gotoAndStop(3);
}
if (game.currentParts.afterburner < (game.parts.afterburners.length - 1)) {
garage.afterburner.right.gotoAndStop(1);
garage.afterburner.right.onRelease = function () {
game.currentParts.afterburner++;
initGarage();
speelSimpelSFX("beep");
};
} else {
garage.afterburner.right.gotoAndStop(3);
}
} else {
garage.afterburner.description.text = "none";
garage.afterburner.damage._visible = false;
garage.afterburner.left.gotoAndStop(3);
garage.afterburner.right.gotoAndStop(3);
}
if (_global.game.parts.tires.length > 0) {
var _local7 = game.currentParts.tires;
var tirestype = _global.game.parts.tires[_local7].type;
var _local6 = _global.game.parts.tires[_local7].wear;
var _local9 = allTires[tirestype].description;
garage.tires.damage._visible = true;
garage.tires.damage.description.gotoAndStop("wear");
garage.tires.damage.red._width = _local6;
garage.tires.description.text = _local9;
if (_local6 > 0) {
damageRollOvers(garage.tires.damage);
garage.tires.damage.onRelease = function () {
clickOkRepair(_global.game.parts.tires[_global.game.currentParts.tires], garage.tires.damage.red, allTires[tirestype].price);
};
} else {
damageRollOvers(garage.tires.damage, true);
}
if (game.currentParts.tires > 0) {
garage.tires.left.gotoAndStop(1);
garage.tires.left.onRelease = function () {
game.currentParts.tires--;
initGarage();
speelSimpelSFX("beep");
};
} else {
garage.tires.left.gotoAndStop(3);
}
if (game.currentParts.tires < (game.parts.tires.length - 1)) {
garage.tires.right.gotoAndStop(1);
garage.tires.right.onRelease = function () {
game.currentParts.tires++;
initGarage();
speelSimpelSFX("beep");
};
} else {
garage.tires.right.gotoAndStop(3);
}
} else {
garage.tires.description.text = "none";
garage.tires.damage._visible = false;
garage.tires.left.gotoAndStop(3);
garage.tires.right.gotoAndStop(3);
}
if (_global.game.parts.chassis.length > 0) {
var _local5 = game.currentParts.chassis;
var chassistype = _global.game.parts.chassis[_local5].type;
var _local6 = _global.game.parts.chassis[_local5].wear;
var _local9 = allChassis[chassistype].description;
garage.chassis.damage._visible = true;
garage.chassis.damage.description.gotoAndStop("damage");
garage.chassis.damage.red._width = _local6;
garage.chassis.description.text = _local9;
if (_local6 > 0) {
damageRollOvers(garage.chassis.damage);
garage.chassis.damage.onRelease = function () {
clickOkRepair(_global.game.parts.chassis[_global.game.currentParts.chassis], garage.chassis.damage.red, allChassis[chassistype].price);
};
} else {
damageRollOvers(garage.chassis.damage, true);
}
if (game.currentParts.chassis > 0) {
garage.chassis.left.gotoAndStop(1);
garage.chassis.left.onRelease = function () {
game.currentParts.chassis--;
initGarage();
speelSimpelSFX("beep");
};
} else {
garage.chassis.left.gotoAndStop(3);
}
if (game.currentParts.chassis < (game.parts.chassis.length - 1)) {
garage.chassis.right.gotoAndStop(1);
garage.chassis.right.onRelease = function () {
game.currentParts.chassis++;
initGarage();
speelSimpelSFX("beep");
};
} else {
garage.chassis.right.gotoAndStop(3);
}
} else {
garage.chassis.description.text = "none";
garage.chassis.damage._visible = false;
garage.chassis.left.gotoAndStop(3);
garage.chassis.right.gotoAndStop(3);
}
};
printCash = function () {
cC.repcash.text = (("reputation: " + Math.floor(_global.game.rep / 10)) + "/10 cash: $") + int(_global.game.cash);
};
initAllParts = function () {
var _local1 = (allEngines = []);
_local1[0] = {speed:1.2, description:"40 HP", price:2500};
_local1[1] = {speed:1.4, description:"80 HP", price:10000};
_local1[2] = {speed:1.9, description:"140 HP turbo", price:24000};
var _local2 = (allTires = []);
_local2[0] = {grip:0.028, description:"low grip", price:200};
_local2[1] = {grip:0.02, description:"medium grip", price:600};
_local2[2] = {grip:0.006, description:"high grip", price:1500};
var _local3 = (allChassis = []);
_local3[0] = {speed:1, description:"casual", price:4000};
_local3[1] = {speed:1.2, description:"sports", price:11000};
_local3[2] = {speed:1.5, description:"race", price:28000};
var _local4 = (allAfterburners = []);
_local4[0] = {secs:10, description:"1 liter", description2:" (+- 10 seconds)", price:1000};
_local4[1] = {secs:25, description:"2,5 liter", description2:" (+- 25 seconds)", price:3000};
_local4[2] = {secs:50, description:"5 liter", description2:" (+- 50 seconds)", price:6000};
};
createPartsArray = function () {
var _local3 = [];
_local3[0] = {type:0, wear:0};
var _local4 = [];
_local4[0] = {type:0, wear:0, color:1};
var _local2 = [];
_local2[0] = {type:0, wear:0};
var _local1 = [];
_local1[0] = {type:0, wear:0};
var _local5 = {engines:_local3, chassis:_local4, tires:_local2, afterburners:_local1};
return(_local5);
};
createNewGame = function (inputName) {
if (_global.userData.games == null) {
_global.userData.games = [];
}
var _local3 = _global.userData.games;
var _local12 = createPartsArray();
var _local13 = beginShopItems();
var _local5 = {engine:0, chassis:0, tires:0, afterburner:0};
var _local7 = sharedOppColors();
var _local8 = newPlanetData();
var _local9 = new Object();
var _local11 = {planet:3, key:0};
var _local4 = 1 + ((_global.difficulty - 1) / 5);
var _local6 = 10000 * (((1 - _local4) * 2) + 1);
var _local10 = {time:0, name:inputName, cash:_local6, rep:15, diffLevel:_global.difficulty, diffFactor:_local4, king:_local11, youTheKing:false, certificate:false, parts:_local12, currentParts:_local5, shopItems:_local13, oppChassisColors:_local7, planetOpponents:_local8, misc:_local9};
var _local2 = 0;
while (_local2 < 5) {
if (_local3[_local2] == null) {
break;
}
_local2++;
}
_local3[_local2] = _local10;
_global.currentGame = _local3.length - 1;
startGarage();
};
createScoreGame = function () {
if (_global.userData.highScoreGame == null) {
_global.userData.highScoreGame = [];
}
var _local11 = _global.userData.highScoreGame;
var _local9 = createPartsArray();
var _local10 = beginShopItems();
var _local2 = {engine:0, chassis:0, tires:0, afterburner:0};
var _local4 = sharedOppColors();
var _local5 = newPlanetData();
var _local6 = new Object();
var _local8 = {planet:3, key:0};
_global.difficulty = (cC.difficulty * 2) / 100;
var _local3 = 1 + ((_global.difficulty - 1) / 5);
var _local7 = {time:0, name:"scoregame", cash:0, rep:15, diffLevel:_global.difficulty, diffFactor:_local3, king:_local8, youTheKing:false, parts:_local9, currentParts:_local2, shopItems:_local10, oppChassisColors:_local4, planetOpponents:_local5, misc:_local6};
_local11[0] = _local7;
_global.scoreGameProgress = 1;
_global.currentGame = 5;
_global.game = _global.userData.highScoreGame[0];
_global.totalScore = 0;
startHighscoreGame();
trace(" ---------- " + _global.currentPlanet);
};
startGarage = function () {
_global.game = _global.userData.games[_global.currentGame];
if (_global.game.youTheKing == true) {
trace("YOU THE KING");
_global.currentPlanet = 5;
_global.nrOfOpponents = 1;
speelSimpelSFX("warp");
initControlCenter("start_race");
} else {
speelSimpelSFX("garage");
cC.gotoAndStop("empty");
stuurMc(cC.image, cC.image._x, cC.image._y - 100, 6);
}
};
scrollMainMenu = function (optionInstant) {
cC.gotoAndStop("empty");
if (optionInstant == true) {
cC.image._y = cC.image._y - 100;
} else {
stuurMc(cC.image, cC.image._x, cC.image._y + 100, 6, "mainmenu");
}
};
initControlCenter = function (action) {
if (action == "garage") {
cC.gotoAndStop("garage");
initGarage();
cC.btn1.gotoAndStop("shop");
cC.btn2.gotoAndStop("race");
cC.btn1.onRelease = function () {
initControlCenter("shop");
};
cC.btn2.onRelease = function () {
if ((checkAllPartsPresent() == true) && (checkForDamage() == true)) {
initControlCenter("select_planet");
} else {
var _local2 = cC.attachMovie("mcClickOk", "mcClickOk", cC.getNextHighestDepth());
_local2.gotoAndStop("general");
_local2.description.text = "You car is not complete, or badly damaged.";
_local2.btnOk.onRelease = function () {
this._parent.removeMovieClip();
};
}
};
cC.backtomain.onRelease = function () {
scrollMainMenu();
};
cC.instructions.onRelease = function () {
initControlCenter("instructions");
};
}
if (action == "instructions") {
cC.gotoAndStop("instructions");
cC.btn1.gotoAndStop("ok");
cC.btn1.onRelease = function () {
initControlCenter("garage");
speelSimpelSFX("garage");
};
}
if (action == "shop") {
cC.gotoAndStop("shop");
initShop("new");
cC.btn1.gotoAndStop("garage");
cC.btn2.gotoAndStop("race");
cC.btn1.onRelease = function () {
initControlCenter("garage");
speelSimpelSFX("garage");
};
cC.btn2.onRelease = function () {
if ((checkAllPartsPresent() == true) && (checkForDamage() == true)) {
initControlCenter("select_planet");
} else {
var _local2 = cC.attachMovie("mcClickOk", "mcClickOk", cC.getNextHighestDepth());
_local2.gotoAndStop("general");
_local2.description.text = "You car is not complete, or badly damaged.";
_local2.btnOk.onRelease = function () {
this._parent.removeMovieClip();
};
}
};
cC.backtomain.onRelease = function () {
scrollMainMenu();
};
} else if (action == "load_game") {
cC.gotoAndStop("load_game");
cC.btn1.gotoAndStop("back");
cC.btn1.onRelease = function () {
initControlCenter("mainmenu");
};
var _local7 = 0;
while (_local7 < 4) {
cC["saved" + _local7].gamename = null;
delete cC["saved" + _local7].onRelease;
var _local8 = _global.userData.games[_local7].name;
if (_global.userData.games[_local7].name != undefined) {
cC["saved" + _local7].gamename = _local8;
cC["saved" + _local7].gameNr = _local7;
cC["saved" + _local7].onRelease = function () {
_global.currentGame = this.gameNr;
startGarage();
};
cC["delete_" + _local7].gameNr = _local7;
cC["delete_" + _local7].onRelease = function () {
_global.userData.games.splice(this.gameNr, 1);
initControlCenter("load_game");
};
} else {
cC["delete_" + _local7]._visible = false;
cC["saved" + _local7].gamename = "empty";
}
_local7++;
}
} else if (action == "difficulty") {
cC.gotoAndStop("difficulty");
cC.easy.onRelease = function () {
_global.difficulty = 0;
createNewGame(newGameName);
newGameName = null;
};
cC.medium.onRelease = function () {
_global.difficulty = 1;
createNewGame(newGameName);
newGameName = null;
};
cC.hard.onRelease = function () {
_global.difficulty = 2;
createNewGame(newGameName);
newGameName = null;
};
} else if (action == "highscore_game") {
cC.gotoAndStop("highscore_game");
cC.btn1.gotoAndStop("race");
cC.btn2.gotoAndStop("back");
cC.btn1.onRelease = function () {
root.gotoAndStop("starthighscoregame");
};
cC.btn2.onRelease = function () {
initControlCenter("select_new_game");
};
} else if (action == "select_new_game") {
cC.gotoAndStop("select_new_game");
cC.btn1.gotoAndStop("back");
cC.full.onRelease = function () {
var _local2 = _global.userData.games;
if ((_local2.length < 4) || (_local2.length == undefined)) {
initControlCenter("new_game");
} else {
cC.error.text = "to many games, delete one first";
}
};
cC.highscore.onRelease = function () {
initControlCenter("highscore_game");
};
cC.btn1.onRelease = function () {
initControlCenter("mainmenu");
};
} else if (action == "new_game") {
cC.gotoAndStop("new_game");
cC.btn1.gotoAndStop("back");
cC.btn2.gotoAndStop("proceed");
cC.btn2.onRelease = function () {
if (((cC.name.text != null) && (cC.name.text != "")) && (cC.name.text != " ")) {
newGameName = cC.name.text;
initControlCenter("difficulty");
}
};
cC.btn1.onRelease = function () {
initControlCenter("select_new_game");
};
} else if (action == "mainmenu") {
cC.gotoAndStop("mainmenu");
cC.new_game.onRelease = function () {
initControlCenter("select_new_game");
};
cC.load_game.onRelease = function () {
initControlCenter("load_game");
};
} else if (action == "select_planet") {
initPlanets();
cC.gotoAndStop("select_planet");
if (cC.image.planet5._visible == true) {
var _local6 = cC.image.planet5;
_local6.onRelease = function () {
clickOkTravel(5, 1, 100000);
};
_local6.onRollOver = function () {
var _local3 = cC.attachMovie("mcPlanetText", "mcPlanetText", cC.getNextHighestDepth());
_local3.gotoAndStop("king");
var _local4 = 5;
_local3._y = _root._ymouse - (_local3._height / 2);
_local3._x = _root._xmouse;
_local3.onEnterFrame = function () {
this._y = _root._ymouse - (this._height / 2);
this._x = _root._xmouse;
};
};
_local6.onRollOut = function () {
cC.mcPlanetText.removeMovieClip();
};
_local6.onReleaseOutside = function () {
cC.mcPlanetText.removeMovieClip();
};
}
var _local7 = 1;
while (_local7 < 5) {
var _local6 = cC.image["planet" + _local7];
_local6.onRelease = function () {
var _local3 = int(this._name.split("planet")[1]);
var _local5 = _global.game.planetOpponents[_local3];
var _local4 = aPlanets[_local3].travel_cost;
clickOkTravel(_local3, _local5, _local4);
};
_local6.onRollOver = function () {
var _local4 = cC.attachMovie("mcPlanetText", "mcPlanetText", cC.getNextHighestDepth());
var _local5 = this._name.split("planet")[1];
_local4.size.text = planetDescriptions("size", aPlanets[_local5].size);
_local4.surface.text = planetDescriptions("surface", aPlanets[_local5].surface);
_local4.gravity.text = planetDescriptions("gravity", aPlanets[_local5].gravity);
_local4.travelcost.text = aPlanets[_local5].travel_cost;
_local4.opponents.text = _global.game.planetOpponents[_local5];
if (_local5 == 2) {
_local4._y = _root._ymouse;
_local4._x = _root._xmouse - _local4._width;
_local4.onEnterFrame = function () {
this._y = _root._ymouse;
this._x = _root._xmouse - this._width;
};
} else if (_local5 == 4) {
_local4._y = _root._ymouse - _local4._height;
_local4._x = _root._xmouse - _local4._width;
_local4.onEnterFrame = function () {
this._y = _root._ymouse - this._height;
this._x = _root._xmouse - this._width;
};
} else {
_local4._y = _root._ymouse - _local4._height;
_local4._x = _root._xmouse;
_local4.onEnterFrame = function () {
this._y = _root._ymouse - this._height;
this._x = _root._xmouse;
};
}
};
_local6.onRollOut = function () {
cC.mcPlanetText.removeMovieClip();
};
_local6.onReleaseOutside = function () {
cC.mcPlanetText.removeMovieClip();
};
_local7++;
}
cC.btn1.gotoAndStop("back");
cC.btn1.onRelease = function () {
var _local2 = 1;
while (_local2 < 6) {
var _local1 = cC.image["planet" + _local2];
delete _local1.onRelease;
delete _local1.onRollOver;
delete _local1.onReleaseOutside;
delete _local1.onRollOut;
_local2++;
}
initControlCenter("garage");
speelSimpelSFX("garage");
};
} else if (action == "start_race") {
root.gotoAndStop("startgame");
}
};
startControlCenter = function (mc, optieIngame, optieShopRefill) {
root = mc;
KingGame = false;
cC = mc.attachMovie("mcControlCenter", "mcControlCenter", 0);
if (optieShopRefill == true) {
_global.game.planetOpponents = newPlanetData();
_global.game.shopItems = beginShopItems();
}
if (optieIngame == "garage") {
scrollMainMenu(true);
initControlCenter("garage");
} else if (optieIngame == "highScore") {
initControlCenter("highscore_game");
} else {
initControlCenter("mainmenu");
}
};
stuurMc = function (mc, doelX, doelY, acc, optie) {
delete mc.onEnterFrame;
mc.onEnterFrame = function () {
verschil = Math.abs(mc._x - doelX);
posX = mc._x;
posY = mc._y;
if (doelX > mc._x) {
mc._x = mc._x + (((doelX - posX) / acc) + 0.1);
}
if (doelX < mc._x) {
mc._x = mc._x + ((0.1 + ((doelX - posX) / acc)) - 0.1);
}
if (doelY > mc._y) {
mc._y = mc._y + (((doelY - posY) / acc) + 0.1);
}
if (doelY < mc._y) {
mc._y = mc._y + (((doelY - posY) / acc) - 0.1);
}
if ((Math.round(mc._x) == Math.round(doelX)) && (Math.round(mc._y) == Math.round(doelY))) {
delete mc.onEnterFrame;
if (optie == "mainmenu") {
initControlCenter("mainmenu");
} else {
initControlCenter("garage");
}
}
};
};
setoSstap3 = function () {
oSstap = 3;
clearInterval(opponentWaitInt);
staticMcs.mcOpponentPanel.removeMovieClip();
};
negotiate = function (amount) {
var _local2 = false;
if (amount == 2) {
var _local5 = aOpponents[currentOpponent];
var _local3 = ((_local5.rep * AISpeed) / _global.game.rep) * playerSpeed;
trace(_local3 + " rep ");
if (_local3 > 0.95) {
if (Math.random() < (0.3 * _local3)) {
_local2 = true;
}
}
if (Math.random() > 0.2) {
_local2 = false;
}
} else {
if (afw == null) {
afw = amount * (Math.random() * 0.7);
}
if ((amount > (initialAmount - afw)) && (amount < (initialAmount + afw))) {
_local2 = true;
}
if (Math.random() > 0.7) {
_local2 = false;
}
}
return(_local2);
};
getSentenceNr = function () {
var _local4 = aOpponents[currentOpponent];
var _local2 = aSentences.length - 1;
var _local6 = _local4.rep / _global.game.rep;
if (_local6 < 1) {
var _local3 = 0;
} else {
var _local3 = _local2 / 2;
}
trace(Math.floor(_local2 / 2));
var _local5 = _local3 + random(Math.floor(_local2 / 2));
return(_local5);
};
manageAmount = function (action) {
if (action == "setamount") {
var _local4 = aOpponents[currentOpponent];
var _local6 = (_local4.rep * 140) * ((1 - _global.game.diffFactor) + 1);
var _local8 = aPlanets[_global.currentPlanet].travel_cost * 3;
_local6 = _local6 + _local8;
var _local3 = (_local4.rep * AISpeed) / (_global.game.rep * playerSpeed);
var _local2 = _local3 * _local6;
_local2 = _local2 * (1.4 - Math.random());
if (_local2 >= 10000) {
_local2 = Math.round(_local2 / 1000) * 1000;
} else {
_local2 = Math.round(_local2 / 100) * 100;
}
if (_local2 < 50) {
_local2 = 50;
}
if (_local3 > 0.8) {
if (Math.random() > 0.9) {
_local2 = 2;
}
}
if (_local3 < (0.2 + (Math.random() / 6))) {
_local2 = 3;
}
if (_local3 > (3.5 + Math.random())) {
if (Math.random() > 0.3) {
_local2 = 0;
}
}
if (_local4.temper > (4 + random(4))) {
_local2 = 1;
}
if (KingGame == true) {
_local2 = 4;
}
return(_local2);
}
if (action == "car") {
_global.currentAmount = 2;
} else if (action == "up") {
if (_global.currentAmount == 2) {
_global.currentAmount = initialAmount;
} else {
var _local5 = _global.currentAmount;
if (_local5 >= 10000) {
_global.currentAmount = _global.currentAmount + 1000;
} else if (_local5 >= 1000) {
_global.currentAmount = _global.currentAmount + 100;
} else if (_local5 >= 100) {
_global.currentAmount = _global.currentAmount + 50;
} else {
_global.currentAmount = _global.currentAmount + 10;
}
if (_global.currentAmount < 50) {
_global.currentAmount = 50;
}
}
} else if (_global.currentAmount == 2) {
_global.currentAmount = initialAmount;
} else {
var _local5 = _global.currentAmount;
if (_local5 > 10000) {
_global.currentAmount = _global.currentAmount - 1000;
} else if (_local5 > 1000) {
_global.currentAmount = _global.currentAmount - 100;
} else if (_local5 > 100) {
_global.currentAmount = _global.currentAmount - 50;
} else {
_global.currentAmount = _global.currentAmount - 10;
}
if (_global.currentAmount < 50) {
_global.currentAmount = 50;
}
}
};
initPanelValues = function () {
panel.face.gotoAndStop(aOpponents[currentOpponent].face);
panel.face.faceframes.gotoAndStop(aOpponents[currentOpponent].faceframe);
if ((KingGame == true) && (oppKing == true)) {
panel.face.crown._visible = true;
var _local1 = "The King";
var _local2 = "king";
} else {
panel.face.crown._visible = false;
var _local1 = aOpponents[currentOpponent].name;
var _local2 = Math.ceil(aOpponents[currentOpponent].rep / 10) + "/10";
}
panel.name.text = _local1;
panel.rep.text = _local2;
};
initPanelBtns = function (optieNegotiate) {
panel.btn2._visible = true;
if (optieNegotiate == true) {
panel.btn1.gotoAndStop("negotiate");
panel.btn1.onRelease = function () {
if (negotiate(_global.currentAmount) == true) {
panel.gotoAndStop(2);
initPanelValues();
if (_global.currentAmount == 2) {
panel.sentence.text = aOpponents[currentOpponent].name + " has accepted you offer to race for the cars";
} else {
panel.sentence.text = ((aOpponents[currentOpponent].name + " has accepted your offer of $ ") + _global.currentAmount) + ".";
}
panel.btn.gotoAndStop("race");
panel.btn.onRelease = function () {
clearIntervals();
start();
};
} else {
aOpponents[currentOpponent].temper++;
panel.gotoAndStop(2);
initPanelValues();
if (_global.currentAmount == 2) {
panel.sentence.text = aOpponents[currentOpponent].name + " has declined you offer to race for the cars.";
} else {
panel.sentence.text = ((aOpponents[currentOpponent].name + " has declined your offer of $ ") + _global.currentAmount) + ".";
}
panel.btn.gotoAndStop("ok");
panel.btn.onRelease = function () {
oSstap = 3;
staticMcs.mcOpponentPanel.removeMovieClip();
};
}
};
} else {
panel.btn1.gotoAndStop("accept");
panel.btn2.gotoAndStop("decline");
panel.btn1.onRelease = function () {
if (_global.game.cash >= _global.currentAmount) {
clearIntervals();
start();
} else {
var _local3 = staticMcs.attachMovie("mcClickOk", "mcClickOk", staticMcs.getNextHighestDepth());
_local3.gotoAndStop("general");
_local3.description.text = "You do not have enough money to accept this amount.";
_local3.btnOk.onRelease = function () {
this._parent.removeMovieClip();
oSstap = 3;
staticMcs.mcOpponentPanel.removeMovieClip();
aOpponents[currentOpponent].temper = aOpponents[currentOpponent].temper + 2;
};
}
};
panel.btn2.onRelease = function () {
oSstap = 3;
staticMcs.mcOpponentPanel.removeMovieClip();
aOpponents[currentOpponent].temper = aOpponents[currentOpponent].temper + 2;
};
if (KingGame == true) {
panel.btn2._visible = false;
}
}
};
attachOpponentPanel = function () {
panel = staticMcs.attachMovie("mcOpponentPanel", "mcOpponentPanel", staticMcs.getNextHighestDepth());
initialAmount = manageAmount("setamount");
if (initialAmount == 4) {
initPanelValues();
if (oppKing == true) {
panel.sentence.text = getSentence("king");
} else {
panel.sentence.text = getSentence("youking");
}
_global.currentAmount = initialAmount;
panel.mcAmount.amount.text = "crown";
initPanelBtns();
} else if (initialAmount == 0) {
opponentWaitInt = setInterval(setoSstap3, 2000);
panel.gotoAndStop(3);
initPanelValues();
panel.sentence.text = getSentence("decline");
} else if (initialAmount == 1) {
opponentWaitInt = setInterval(setoSstap3, 2000);
panel.gotoAndStop(3);
initPanelValues();
panel.sentence.text = getSentence("temper");
} else if (initialAmount == 2) {
initPanelValues();
panel.sentence.text = getSentence("car");
_global.currentAmount = initialAmount;
panel.mcAmount.amount.text = "car";
initPanelBtns();
} else if (initialAmount == 3) {
opponentWaitInt = setInterval(setoSstap3, 2000);
panel.gotoAndStop(3);
initPanelValues();
panel.sentence.text = getSentence("chicken");
} else {
if (Math.random() < 0.97) {
panel.sentence.text = getSentence("sentence");
} else {
panel.sentence.text = getSentence("weird");
}
initPanelValues();
afw = null;
_global.currentAmount = initialAmount;
panel.mcAmount.amount.text = _global.currentAmount;
initPanelBtns();
panel.mcAmount.onRollOver = function () {
this.gotoAndStop(2);
};
panel.mcAmount.onRollOut = function () {
this.gotoAndStop(1);
this.amount.text = _global.currentAmount;
};
panel.mcAmount.onReleaseOutside = function () {
this.gotoAndStop(1);
this.amount.text = _global.currentAmount;
};
panel.mcAmount.onRelease = function () {
this.gotoAndStop(2);
delete this.onRollOver;
delete this.onRollOut;
delete this.onReleaseOutside;
manageAmount("car");
initPanelBtns(true);
};
panel.up.onRelease = function () {
manageAmount("up");
panel.mcAmount.gotoAndStop(1);
panel.mcAmount.amount.text = _global.currentAmount;
if (_global.currentAmount != initialAmount) {
initPanelBtns(true);
} else {
initPanelBtns();
}
};
panel.down.onRelease = function () {
manageAmount("down");
panel.mcAmount.gotoAndStop(1);
panel.mcAmount.amount.text = _global.currentAmount;
if (_global.currentAmount != initialAmount) {
initPanelBtns(true);
} else {
initPanelBtns();
}
};
}
};
setupStage = function () {
var _local6 = staticMcs.attachMovie("mcAd", "mcAd", staticMcs.getNextHighestDepth());
_local6._x = sW / 2;
_local6._y = 330;
var _local7 = background.buildings.attachMovie("mcBuildings", "mcBuildings", 0);
var _local5 = "buildings" + _global.currentPlanet;
if (KingGame == true) {
_local5 = "king";
}
_local7.gotoAndStop(_local5);
var _local4 = staticMcs.attachMovie("cashOppSelect", "cashOppSelect", staticMcs.getNextHighestDepth());
_local4._x = 0;
_local4._y = sH;
_local4.cash.text = "$" + int(_global.game.cash);
var _local3 = staticMcs.attachMovie("mcGoHome", "mcGoHome", staticMcs.getNextHighestDepth());
_local3._x = sW;
_local3._y = sH;
_local3.onRelease = function () {
if (KingGame == true) {
_global.inGame = false;
_root.main._parent.gotoAndStop("startmenu");
_root.main.removeMovieClip();
_root.staticMcs.removeMovieClip();
} else {
_root.quitToGarage();
}
};
};
initSliderBtns = function (shop) {
_root.onMouseUp = function () {
mouseDown = false;
};
_root.onMouseDown = function () {
mouseDown = true;
};
trace(shop.up);
shop.up.onRollOver = function () {
scrolling = -2;
this.gotoAndStop(2);
};
shop.up.onRollOut = function () {
this.gotoAndStop(1);
scrolling = 0;
};
shop.up.onReleaseOutside = function () {
this.gotoAndStop(1);
scrolling = 0;
};
shop.down.onRollOver = function () {
this.gotoAndStop(2);
scrolling = 2;
};
shop.down.onRollOut = function () {
this.gotoAndStop(1);
scrolling = 0;
};
shop.down.onReleaseOutside = function () {
this.gotoAndStop(1);
scrolling = 0;
};
};
initShop = function (option) {
printCash();
var _local2 = cC.mcShop;
initSliderBtns(_local2);
var _local3 = 120;
var slidey = 94;
_local2.items.headers.gotoAndStop(option);
displayShopItems(_local2.items, option);
_local2.btnNew.onRelease = function () {
initShop("new");
};
_local2.btnSell.onRelease = function () {
initShop("sell");
};
heightRatio = _local3 / _local2.items._height;
if (heightRatio < 1) {
_local2.slider._height = heightRatio * _local3;
_local2.items.onEnterFrame = function () {
this._y = (-(((cC.mcShop.slider._y - (cC.mcShop.slider._height / 2)) - slidey) / heightRatio)) + slidey;
};
} else {
_local2.slider._visible = false;
}
var toplock = (slidey + (_local2.slider._height / 2));
var bottomlock = ((slidey + _local3) - (_local2.slider._height / 2));
_local2.slider._y = toplock;
_local2.slider.onEnterFrame = function () {
if (mouseDown == true) {
if ((this._y > (toplock - scrolling)) && (this._y < (bottomlock - scrolling))) {
this._y = this._y + scrolling;
}
}
};
_local2.slider.onPress = function () {
this.startDrag(false, this._x, toplock, this._x, bottomlock);
};
_local2.slider.onRelease = function () {
this.stopDrag();
};
_local2.slider.onReleaseOutside = function () {
this.stopDrag();
};
};
beginShopItems = function () {
initAllParts();
var _local4 = [];
var _local1 = 0;
while (_local1 < allEngines.length) {
_local4[_local1] = {stock:random(6 - _local1)};
_local1++;
}
if (_local4[0].stock == 0) {
_local4[0] = {stock:1};
}
var _local2 = [];
_local1 = 0;
while (_local1 < allTires.length) {
_local2[_local1] = {stock:random(8 - _local1)};
_local1++;
}
if (_local2[0].stock == 0) {
_local2[0] = {stock:1};
}
var _local3 = [];
_local1 = 0;
while (_local1 < allChassis.length) {
_local3[_local1] = {stock:random(4 - _local1)};
_local1++;
}
if (_local3[0].stock == 0) {
_local3[0] = {stock:1};
}
var _local5 = [];
_local1 = 0;
while (_local1 < allAfterburners.length) {
_local5[_local1] = {stock:random(6 - _local1)};
_local1++;
}
if (_local5[0].stock == 0) {
_local5[0] = {stock:1};
}
var _local6 = {engines:_local4, chassis:_local3, tires:_local2, afterburners:_local5};
return(_local6);
};
descriptionFunctonality = function (mc, option) {
mc.onRollOver = function () {
this.gotoAndStop(2);
};
mc.onRollOut = function () {
this.gotoAndStop(1);
};
mc.onReleaseOutside = function () {
this.gotoAndStop(1);
};
if (option == "sell") {
mc.onRelease = function () {
sellItem(this._parent.type, this._parent.itemnr, this._parent.wear, this._parent.arrayNr, this._parent.value);
};
} else {
mc.onRelease = function () {
buyItem(this._parent.type, this._parent.itemnr, this._parent.value);
};
}
};
sellItem = function (typenm, itemnr, wear, arrayNr, value) {
initAllParts();
cC.mcShop.picture.gotoAndStop(typenm);
cC.mcShop.picture.itempic.gotoAndStop(itemnr + 1);
cC.mcShop.picture.buy._visible = false;
cC.mcShop.picture.sell._visible = true;
switch (typenm) {
case "engine" :
cC.mcShop.picture.description.text = "$ " + value;
cC.mcShop.picture.sell.onRelease = function () {
_global.game.parts.engines.splice(arrayNr, 1);
_global.game.currentParts.engine = 0;
_global.game.cash = _global.game.cash + int(value);
printCash();
displayShopItems(cC.mcShop.items, "sell");
this._parent.gotoAndStop("logo");
};
break;
case "tires" :
cC.mcShop.picture.description.text = "$ " + value;
cC.mcShop.picture.sell.onRelease = function () {
_global.game.parts.tires.splice(arrayNr, 1);
_global.game.currentParts.tires = 0;
_global.game.cash = _global.game.cash + int(value);
printCash();
displayShopItems(cC.mcShop.items, "sell");
this._parent.gotoAndStop("logo");
};
break;
case "chassis" :
cC.mcShop.picture.description.text = "$ " + value;
cC.mcShop.picture.mcColor._visible = false;
var _local3 = _global.game.parts.chassis[arrayNr].color;
cC.mcShop.picture.itempic.chassisColor.gotoAndStop(_local3);
cC.mcShop.picture.sell.onRelease = function () {
_global.game.parts.chassis.splice(arrayNr, 1);
_global.game.currentParts.chassis = 0;
_global.game.cash = _global.game.cash + int(value);
printCash();
displayShopItems(cC.mcShop.items, "sell");
this._parent.gotoAndStop("logo");
};
break;
case "afterburner" :
cC.mcShop.picture.description.text = "$ " + value;
cC.mcShop.picture.sell.onRelease = function () {
_global.game.parts.afterburners.splice(arrayNr, 1);
_global.game.currentParts.afterburner = 0;
_global.game.cash = _global.game.cash + int(value);
printCash();
displayShopItems(cC.mcShop.items, "sell");
this._parent.gotoAndStop("logo");
};
}
};
notEnoughCash = function () {
var _local2 = cC.attachMovie("mcClickOk", "mcClickOk", cC.getNextHighestDepth());
_local2.gotoAndStop("general");
_local2.description.text = "You do not have enough money to buy this item.";
_local2.btnOk.onRelease = function () {
this._parent.removeMovieClip();
};
};
buyItem = function (typenm, itemnr, value) {
initAllParts();
cC.mcShop.picture.gotoAndStop(typenm);
cC.mcShop.picture.itempic.gotoAndStop(itemnr + 1);
cC.mcShop.picture.buy._visible = true;
cC.mcShop.picture.sell._visible = false;
switch (typenm) {
case "afterburner" :
cC.mcShop.picture.description.text = allAfterburners[itemnr].description;
cC.mcShop.picture.description2.text = allAfterburners[itemnr].description2;
cC.mcShop.picture.buy.onRelease = function () {
if (_global.game.cash >= value) {
_global.game.shopItems.afterburners[itemnr].stock--;
var _local3 = {type:itemnr, wear:0};
_global.game.cash = _global.game.cash - int(value);
printCash();
_global.game.parts.afterburners.push(_local3);
displayShopItems(cC.mcShop.items, "new");
this._parent.gotoAndStop("logo");
} else {
notEnoughCash();
}
};
break;
case "tires" :
cC.mcShop.picture.description.text = allTires[itemnr].description;
cC.mcShop.picture.buy.onRelease = function () {
if (_global.game.cash >= value) {
_global.game.shopItems.tires[itemnr].stock--;
var _local3 = {type:itemnr, wear:0};
_global.game.cash = _global.game.cash - int(value);
printCash();
_global.game.parts.tires.push(_local3);
displayShopItems(cC.mcShop.items, "new");
this._parent.gotoAndStop("logo");
} else {
notEnoughCash();
}
};
break;
case "chassis" :
cC.mcShop.picture.description.text = allChassis[itemnr].description;
cC.mcShop.picture.mcColor._visible = true;
cC.mcShop.picture.mcColor.onRelease = function () {
var _local1 = cC.mcShop.picture.itempic.chassisColor;
if (_local1._currentFrame == _local1.aantFrames) {
_local1.gotoAndStop(1);
} else {
_local1.gotoAndStop(_local1._currentFrame + 1);
}
};
cC.mcShop.picture.buy.onRelease = function () {
if (_global.game.cash >= value) {
_global.game.shopItems.chassis[itemnr].stock--;
var _local3 = {type:itemnr, wear:0, color:cC.mcShop.picture.itempic.chassisColor._currentframe};
_global.game.parts.chassis.push(_local3);
_global.game.cash = _global.game.cash - int(value);
printCash();
displayShopItems(cC.mcShop.items, "new");
this._parent.gotoAndStop("logo");
} else {
notEnoughCash();
}
};
break;
case "engine" :
cC.mcShop.picture.description.text = allEngines[itemnr].description;
cC.mcShop.picture.buy.onRelease = function () {
if (_global.game.cash >= value) {
_global.game.shopItems.engines[itemnr].stock--;
var _local3 = {type:itemnr, wear:0};
_global.game.cash = _global.game.cash - int(value);
printCash();
_global.game.parts.engines.push(_local3);
displayShopItems(cC.mcShop.items, "new");
this._parent.gotoAndStop("logo");
} else {
notEnoughCash();
}
};
}
};
displayShopItems = function (mc, option) {
initAllParts();
for (var _local15 in mc) {
trace(mc[_local15]);
mc[_local15].removeMovieClip();
}
if (option == "new") {
var _local4 = _global.game.shopItems;
memY = 0;
var _local16 = mc.attachMovie("mcShopTitel", "engineTitel", mc.getNextHighestDepth());
_local16.titel.text = "Engines";
_local16._y = 40;
memY = _local16._y;
var _local14 = mc.getNextHighestDepth();
var _local5 = 0;
while (_local5 < _local4.engines.length) {
var _local3 = mc.attachMovie("mcShopItem", ("shopItem" + _local14) + _local5, _local14 + _local5);
_local3.mcDescription.description = allEngines[_local5].description;
var _local11 = _local4.engines[_local5].stock;
_local3.stock.text = _local11;
_local3.price.text = allEngines[_local5].price;
_local3.value = allEngines[_local5].price;
_local3.itemnr = _local5;
_local3.type = "engine";
_local3._y = memY + 30;
memY = _local3._y;
if (_local11 > 0) {
descriptionFunctonality(_local3.mcDescription);
}
_local5++;
}
_local16 = mc.attachMovie("mcShopTitel", "chassisTitel", mc.getNextHighestDepth());
_local16.titel.text = "Chassis";
_local16._y = memY + 40;
memY = _local16._y;
_local14 = mc.getNextHighestDepth();
_local5 = 0;
while (_local5 < _local4.chassis.length) {
var _local3 = mc.attachMovie("mcShopItem", ("shopItem" + _local14) + _local5, _local14 + _local5);
_local3.mcDescription.description = allChassis[_local5].description;
var _local11 = _local4.chassis[_local5].stock;
_local3.stock.text = _local11;
_local3.price.text = allChassis[_local5].price;
_local3.value = allChassis[_local5].price;
_local3.itemnr = _local5;
_local3.type = "chassis";
_local3._y = memY + 30;
memY = _local3._y;
if (_local11 > 0) {
descriptionFunctonality(_local3.mcDescription);
}
_local5++;
}
_local16 = mc.attachMovie("mcShopTitel", "tiresTitel", mc.getNextHighestDepth());
_local16.titel.text = "Tires";
_local16._y = memY + 40;
memY = _local16._y;
_local14 = mc.getNextHighestDepth();
_local5 = 0;
while (_local5 < _local4.tires.length) {
var _local3 = mc.attachMovie("mcShopItem", ("shopItem" + _local14) + _local5, _local14 + _local5);
_local3.mcDescription.description = allTires[_local5].description;
var _local11 = _local4.tires[_local5].stock;
_local3.stock.text = _local11;
_local3.price.text = allTires[_local5].price;
_local3.value = allTires[_local5].price;
_local3.itemnr = _local5;
_local3.type = "tires";
_local3._y = memY + 30;
memY = _local3._y;
if (_local11 > 0) {
descriptionFunctonality(_local3.mcDescription);
}
_local5++;
}
_local16 = mc.attachMovie("mcShopTitel", "afterburnerTitel", mc.getNextHighestDepth());
_local16.titel.text = "Afterburners";
_local16._y = memY + 40;
memY = _local16._y;
_local14 = mc.getNextHighestDepth();
_local5 = 0;
while (_local5 < _local4.afterburners.length) {
var _local3 = mc.attachMovie("mcShopItem", ("shopItem" + _local14) + _local5, _local14 + _local5);
_local3.mcDescription.description = allAfterburners[_local5].description;
var _local11 = _local4.afterburners[_local5].stock;
_local3.stock.text = _local11;
_local3.price.text = allAfterburners[_local5].price;
_local3.value = allAfterburners[_local5].price;
_local3.itemnr = _local5;
_local3.type = "afterburner";
_local3._y = memY + 30;
memY = _local3._y;
if (_local11 > 0) {
descriptionFunctonality(_local3.mcDescription);
}
_local5++;
}
} else if (option == "sell") {
var _local4 = _global.game.parts;
memY = 0;
var _local16 = mc.attachMovie("mcShopTitel", "engineTitel", mc.getNextHighestDepth());
_local16.titel.text = "Engines";
_local16._y = 40;
memY = _local16._y;
var _local14 = mc.getNextHighestDepth();
var _local5 = 0;
while (_local5 < _local4.engines.length) {
var _local3 = mc.attachMovie("mcShopItem", ("shopItem" + _local14) + _local5, _local14 + _local5);
var _local7 = _local4.engines[_local5].type;
_local3.mcDescription.description = allEngines[_local7].description;
var _local9 = Math.round(_local4.engines[_local5].wear);
var _local13 = allEngines[_local7].price;
var _local12 = Math.round(_local13 * (((100 - _local9) / 100) / 2));
_local3.stock.text = _local9 + "%";
_local3.price.text = _local12;
_local3.wear = _local9;
_local3.value = _local12;
_local3.itemnr = _local7;
_local3.arrayNr = _local5;
_local3.type = "engine";
_local3._y = memY + 30;
memY = _local3._y;
descriptionFunctonality(_local3.mcDescription, "sell");
_local5++;
}
_local16 = mc.attachMovie("mcShopTitel", "chassisTitel", mc.getNextHighestDepth());
_local16.titel.text = "Chassis";
_local16._y = memY + 40;
memY = _local16._y;
_local14 = mc.getNextHighestDepth();
_local5 = 0;
while (_local5 < _local4.chassis.length) {
var _local3 = mc.attachMovie("mcShopItem", ("shopItem" + _local14) + _local5, _local14 + _local5);
var _local6 = _local4.chassis[_local5].type;
_local3.mcDescription.description = allChassis[_local6].description;
var _local9 = Math.round(_local4.chassis[_local5].wear);
var _local13 = allChassis[_local6].price;
var _local12 = Math.round(_local13 * (((100 - _local9) / 100) / 2));
_local3.stock.text = _local9 + "%";
_local3.price.text = _local12;
_local3.wear = _local9;
_local3.value = _local12;
_local3.itemnr = _local6;
_local3.arrayNr = _local5;
_local3.type = "chassis";
_local3._y = memY + 30;
memY = _local3._y;
descriptionFunctonality(_local3.mcDescription, "sell");
_local5++;
}
_local16 = mc.attachMovie("mcShopTitel", "tiresTitel", mc.getNextHighestDepth());
_local16.titel.text = "Tires";
_local16._y = memY + 40;
memY = _local16._y;
_local14 = mc.getNextHighestDepth();
_local5 = 0;
while (_local5 < _local4.tires.length) {
var _local3 = mc.attachMovie("mcShopItem", ("shopItem" + _local14) + _local5, _local14 + _local5);
var _local10 = _local4.tires[_local5].type;
_local3.mcDescription.description = allTires[_local10].description;
var _local9 = Math.round(_local4.tires[_local5].wear);
var _local13 = allTires[_local10].price;
var _local12 = Math.round(_local13 * (((100 - _local9) / 100) / 2));
_local3.stock.text = _local9 + "%";
_local3.price.text = _local12;
_local3.wear = _local9;
_local3.value = _local12;
_local3.itemnr = _local10;
_local3.arrayNr = _local5;
_local3.type = "tires";
_local3._y = memY + 30;
memY = _local3._y;
descriptionFunctonality(_local3.mcDescription, "sell");
_local5++;
}
_local16 = mc.attachMovie("mcShopTitel", "afterburnersTitel", mc.getNextHighestDepth());
_local16.titel.text = "Afterburners";
_local16._y = memY + 40;
memY = _local16._y;
_local14 = mc.getNextHighestDepth();
_local5 = 0;
while (_local5 < _local4.afterburners.length) {
var _local3 = mc.attachMovie("mcShopItem", ("shopItem" + _local14) + _local5, _local14 + _local5);
var _local8 = _local4.afterburners[_local5].type;
_local3.mcDescription.description = allAfterburners[_local8].description;
var _local9 = Math.round(_local4.afterburners[_local5].wear);
var _local13 = allAfterburners[_local8].price;
var _local12 = Math.round(_local13 * (((100 - _local9) / 100) / 2));
_local3.stock.text = _local9 + "%";
_local3.price.text = _local12;
_local3.wear = _local9;
_local3.value = _local12;
_local3.itemnr = _local8;
_local3.arrayNr = _local5;
_local3.type = "afterburner";
_local3._y = memY + 30;
memY = _local3._y;
descriptionFunctonality(_local3.mcDescription, "sell");
_local5++;
}
}
};
initSounds = function (mc) {
if (_root.sunet == true) {
_global.sound = mc.createEmptyMovieClip("soundContainer", 2);
_global.sound.createEmptyMovieClip("loop", 0);
_global.sound.createEmptyMovieClip("afterburner_mc", 1);
_global.sound.createEmptyMovieClip("sfx", 2);
_global.sound.createEmptyMovieClip("low", 3);
_global.sound.createEmptyMovieClip("engine_mc", 4);
_global.sound.createEmptyMovieClip("hitground", 5);
sfx_engine = new Sound(_global.sound.engine_mc);
initSFX();
}
};
sfxEngine = function (option) {
if (_root.sunet == true) {
if (option == "play") {
if (engineStep != 1) {
if (keyPressed == true) {
sfx_engine.attachSound("engine_start" + currentEngine);
enginePlaying = true;
var _local3 = 80;
sfx_engine.setVolume(_local3);
sfx_engine.start(0, 0);
sfx_engine.onSoundComplete = function () {
engineStep = 1;
sfxEngine("play");
};
}
} else {
enginePlaying = true;
sfx_engine.attachSound("engine" + currentEngine);
sfx_engine.start(0, 0);
sfx_engine.onSoundComplete = function () {
this.start(0, 0);
};
}
} else {
engineStep = 0;
enginePlaying = false;
sfx_engine.stop();
sfx_engine.attachSound("engine_fade" + currentEngine);
sfx_engine.start(0, 0);
sfx_engine.onSoundComplete = function () {
sfx_engine.stop();
};
}
}
};
sfxAfterburner = function (option) {
if (_root.sunet == true) {
if (option == "play") {
if (keyPressed == true) {
sfx_afterburner = new Sound(_global.sound.afterburner_mc);
sfx_afterburner.attachSound("afterburner");
afterburnerPlaying = true;
var _local4 = 30;
sfx_afterburner.setVolume(_local4);
sfx_afterburner.start(0, 0);
sfx_afterburner.onSoundComplete = function () {
this.start(0, 0);
};
}
} else {
afterburnerPlaying = false;
sfx_afterburner.stop();
}
}
};
initSFX = function () {
if (_root.sunet == true) {
sfx_startrace = new Sound(_global.sound.sfx);
sfx_startrace.attachSound("startrace");
sfx_warp = new Sound(_global.sound.sfx);
sfx_warp.attachSound("warp");
sfx_garage = new Sound(_global.sound.sfx);
sfx_garage.attachSound("garage");
sfx_crash = new Sound(_global.sound.sfx);
sfx_crash.attachSound("crash");
sfx_crash_KO = new Sound(_global.sound.sfx);
sfx_crash_KO.attachSound("crash_KO");
sfx_beep = new Sound(_global.sound.sfx);
sfx_beep.attachSound("beep");
sfx_finish = new Sound(_global.sound.sfx);
sfx_finish.attachSound("finish");
sfx_finish2 = new Sound(_global.sound.sfx);
sfx_finish2.attachSound("finish2");
sfx_finish3 = new Sound(_global.sound.sfx);
sfx_finish3.attachSound("lose");
sfx_hitground = new Sound(_global.sound.hitground);
sfx_hitground.attachSound("hitground");
sfx_hitroof = new Sound(_global.sound.hitground);
sfx_hitroof.attachSound("hitroof");
random_sounds = new Sound(_global.sound.low);
}
};
playRandomSound = function () {
if (_root.sunet == true) {
var _local2 = "random" + (random(3) + 1);
random_sounds.attachSound(_local2);
random_sounds.setVolume(40);
random_sounds.start();
}
};
playLoop = function (loop) {
if (_root.sunet == true) {
music = new Sound(_global.sound.loop);
music.attachSound(loop);
if (_root.sunet == true) {
music.start(0, 0);
}
music.onSoundComplete = function () {
if (_root.sunet == true) {
this.start(0, 0);
}
};
music.setVolume(100);
}
};
fadeLoop = function () {
if (music.getVolume() > 0) {
music.setVolume(music.getVolume() - 1);
}
};
randomSFX = function () {
if (shortRandom > 0.8) {
omgeving_bird.start();
}
};
soundCounters = function () {
hitGroundCounter--;
};
speelSimpelSFX = function (naam, passVar) {
switch (naam) {
case "startrace" :
if (_root.sunet == true) {
sfx_startrace.start();
}
break;
case "beep" :
if (_root.sunet == true) {
sfx_beep.start();
}
break;
case "hitground" :
if (hitGroundCounter <= 0) {
hitGroundCounter = 5;
var _local2 = 200 * passVar;
if (_local2 > 100) {
_local2 = 100;
}
sfx_hitground.setVolume(_local2);
if (_root.sunet == true) {
sfx_hitground.start();
}
}
break;
case "hitroof" :
if (hitGroundCounter <= 0) {
hitGroundCounter = 5;
var _local2 = 100 * (passVar * 4);
if (_local2 > 100) {
_local2 = 100;
}
sfx_hitroof.setVolume(_local2);
if (_root.sunet == true) {
sfx_hitroof.start();
}
}
break;
case "warp" :
if (_root.sunet == true) {
sfx_warp.start();
}
break;
case "crash" :
if (_root.sunet == true) {
sfx_crash.start();
sfx_crash_KO.start();
}
break;
case "finish" :
if (_root.sunet == true) {
sfx_finish.start();
sfx_finish2.start();
}
break;
case "lost" :
sfx_finish3.start();
sfx_finish2.start();
break;
case "garage" :
if (_root.sunet == true) {
sfx_garage.start();
}
break;
case "powerup" :
if (_root.sunet != true) {
break;
}
power_up.start();
power_up.onSoundComplete = function () {
speelSimpelSFX("powerup_voice");
};
}
};
sfxCounters = function () {
mini_aanval.counter--;
sfx_raathit.counter1--;
sfx_raathit.counter2--;
};
manageSoundFx = function (naam, difOptie) {
switch (naam) {
case "schild" :
if (_root.sunet == true) {
schild_commander.start();
}
break;
case "mini_attack" :
if (mini_aanval.counter <= 0) {
mini_aanval.counter = 3;
var _local2 = random(aAanvalVoices.length - 1);
mini_aanval.attachSound(aAanvalVoices[_local2]);
if (_root.sunet == true) {
mini_aanval.start();
}
}
break;
case "sfx_raathit" :
if (aCounters["raat" + difOptie] >= getTimer()) {
break;
}
aCounters["raat" + difOptie] = getTimer() + 2000;
if (_root.sunet != true) {
break;
}
sfx_raathit.start();
sfx_raathit2.start();
}
};
stopSound = function () {
music.stop();
};
trace("frame: 1");
Frame 176
trace("frame: 2");
var userSettings = SharedObject.getLocal("user_data");
_global.userData = userSettings.data;
initSounds(this);
playLoop("menuloop");
Frame 177
stop();
trace("frame: 3");
this.staticMcs.removeMovieClip();
if (_global.inGame == true) {
_global.inGame = false;
_global.userData.games[_global.currentGame].time++;
startControlCenter(this, "garage", true);
if (_global.trouble != null) {
clickOkAfterRace(_global.trouble);
_global.trouble = null;
}
} else if (_global.inHighScoreGame == true) {
_global.inHighScoreGame = false;
startControlCenter(this, "highScore", true);
} else {
startControlCenter(this);
}
Frame 178
stop();
trace("frame: 4");
_global.planetTime = 0;
startOppSelect();
Frame 179
stop();
trace("frame: 5");
_global.planetTime = 0;
_global.inHighScoreGame = true;
createScoreGame();
this.onEnterFrame = function () {
trace("score: " + _global.totalScore);
};
Frame 180
trace("score scene");
_root.main.removeMovieClip();
_root.staticMcs.removeMovieClip();
removeMovieClip(_root.xxc1);
removeMovieClip(_root.xxc2);
removeMovieClip(_root.xxc3);
removeMovieClip(_root.xxc4);
Frame 181
_root.menu.removeMovieClip();
_root.gameid = "PlanetRacer";
_root.best = _global.score;
_global.score = 0;
_root.updated = 0;
_root.done = 0;
done = 0;
i = 1;
while (i <= 100) {
_root["score" + i] = null;
_root["name" + i] = null;
_root["escore" + i] = null;
_root["ename" + i] = null;
i++;
}
Frame 183
cale = "http://www.freeonlinegames.com/scoreboard/score.php?game=" + _root.gameid;
loadVariablesNum (cale, 0, "POST");
Frame 191
if (done != 1) {
gotoAndPlay ("loopLoad");
} else {
gotoAndPlay ("scoreTable");
}
Frame 195
monthnume = new Array();
monthscor = new Array();
i = 1;
while (i <= 100) {
monthnume[i] = _root["name" + i];
monthscor[i] = Number(_root["score" + i].slice(0, _root["score" + i].length - 1));
i++;
}
evernume = new Array();
everscor = new Array();
i = 1;
while (i <= 100) {
evernume[i] = _root["ename" + i];
everscor[i] = Number(_root["escore" + i].slice(0, _root["escore" + i].length - 1));
i++;
}
Frame 196
stop();
if (_root.best > everscor[100]) {
scoreWind.gotoAndStop("submitScoreYes");
} else {
scoreWind.gotoAndStop("submitScoreNo");
}
if (_root.xdada == 1) {
scoreWind.gotoAndStop("topEver");
}
Symbol 13 MovieClip Frame 1
var component = _parent._parent;
component.registerSkinElement(arrow_mc, "arrow");
component.registerSkinElement(face_mc, "face");
component.registerSkinElement(shadow_mc, "shadow");
component.registerSkinElement(darkshadow_mc, "darkshadow");
component.registerSkinElement(highlight_mc, "highlight");
component.registerSkinElement(highlight3D_mc, "highlight3D");
Symbol 22 MovieClip Frame 1
var component = _parent._parent;
component.registerSkinElement(arrow_mc, "arrow");
component.registerSkinElement(face_mc, "face");
component.registerSkinElement(shadow_mc, "shadow");
component.registerSkinElement(darkshadow_mc, "darkshadow");
component.registerSkinElement(highlight_mc, "highlight");
component.registerSkinElement(highlight3D_mc, "highlight3D");
Symbol 31 MovieClip Frame 1
var component = _parent._parent;
component.registerSkinElement(arrow_mc, "foregroundDisabled");
component.registerSkinElement(face_mc, "face");
component.registerSkinElement(shadow_mc, "shadow");
component.registerSkinElement(darkshadow_mc, "darkshadow");
component.registerSkinElement(highlight_mc, "highlight");
component.registerSkinElement(highlight3D_mc, "highlight3D");
Symbol 32 MovieClip [UpArrow] Frame 1
stop();
Symbol 32 MovieClip [UpArrow] Frame 2
stop();
Symbol 32 MovieClip [UpArrow] Frame 3
stop();
Symbol 38 MovieClip Frame 1
var component = _parent._parent;
component.registerSkinElement(shadow_mc, "shadow");
component.registerSkinElement(darkshadow_mc, "darkshadow");
component.registerSkinElement(highlight_mc, "highlight");
component.registerSkinElement(highlight3D_mc, "highlight3D");
Symbol 47 MovieClip Frame 1
var component = _parent._parent;
component.registerSkinElement(face_mc, "face");
component.registerSkinElement(shadow_mc, "shadow");
component.registerSkinElement(darkshadow_mc, "darkshadow");
component.registerSkinElement(highlight_mc, "highlight");
component.registerSkinElement(highlight3D_mc, "highlight3D");
Symbol 52 MovieClip Frame 1
var component = _parent._parent;
component.registerSkinElement(highlight3D_mc, "highlight3D");
component.registerSkinElement(shadow_mc, "shadow");
component.registerSkinElement(darkshadow_mc, "darkshadow");
component.registerSkinElement(highlight_mc, "highlight");
Symbol 53 MovieClip [ScrollThumb] Frame 1
stop();
Symbol 61 MovieClip Frame 1
var component = _parent._parent;
component.registerSkinElement(arrow_mc, "arrow");
component.registerSkinElement(face_mc, "face");
component.registerSkinElement(shadow_mc, "shadow");
component.registerSkinElement(darkshadow_mc, "darkshadow");
component.registerSkinElement(highlight_mc, "highlight");
component.registerSkinElement(highlight3D_mc, "highlight3D");
Symbol 69 MovieClip Frame 1
var component = _parent._parent;
component.registerSkinElement(arrow_mc, "arrow");
component.registerSkinElement(face_mc, "face");
component.registerSkinElement(shadow_mc, "shadow");
component.registerSkinElement(darkshadow_mc, "darkshadow");
component.registerSkinElement(highlight_mc, "highlight");
component.registerSkinElement(highlight3D_mc, "highlight3D");
Symbol 77 MovieClip Frame 1
var component = _parent._parent;
component.registerSkinElement(arrow_mc, "foregroundDisabled");
component.registerSkinElement(face_mc, "face");
component.registerSkinElement(shadow_mc, "shadow");
component.registerSkinElement(darkshadow_mc, "darkshadow");
component.registerSkinElement(highlight_mc, "highlight");
component.registerSkinElement(highlight3D_mc, "highlight3D");
Symbol 78 MovieClip [DownArrow] Frame 1
stop();
Symbol 78 MovieClip [DownArrow] Frame 2
stop();
Symbol 78 MovieClip [DownArrow] Frame 3
stop();
Symbol 80 Button
on (release) {
getURL ("http://www.freeonlinegames.com/?PlanetRacer", "_blank");
}
Symbol 84 MovieClip Frame 1
stop();
Symbol 94 MovieClip Frame 1
stop();
Symbol 104 MovieClip Frame 50
stop();
_parent.play();
Symbol 127 MovieClip Frame 1
stop();
Symbol 127 MovieClip Frame 28
gotoAndPlay ("loop");
Symbol 141 MovieClip Frame 1
stop();
Symbol 155 MovieClip Frame 1
stop();
this.aantFrames = 11;
Symbol 171 MovieClip Frame 1
stop();
this.aantFrames = 15;
Symbol 188 MovieClip Frame 1
stop();
this.aantFrames = 15;
Symbol 189 MovieClip Frame 1
stop();
Symbol 202 MovieClip Frame 1
stop();
Symbol 211 MovieClip Frame 1
stop();
this.onRollOver = function () {
this.gotoAndStop(2);
};
this.onRollOut = function () {
this.gotoAndStop(1);
};
this.onReleaseOutside = function () {
this.gotoAndStop(1);
};
Symbol 214 MovieClip Frame 1
stop();
this.onRollOver = function () {
this.gotoAndStop(2);
};
this.onRollOut = function () {
this.gotoAndStop(1);
};
this.onReleaseOutside = function () {
this.gotoAndStop(1);
};
Symbol 221 MovieClip Frame 1
stop();
this.onRollOver = function () {
this.gotoAndStop(2);
};
this.onRollOut = function () {
this.gotoAndStop(1);
};
this.onReleaseOutside = function () {
this.gotoAndStop(1);
};
Symbol 227 MovieClip Frame 1
stop();
Symbol 230 MovieClip Frame 1
stop();
Symbol 238 MovieClip Frame 1
stop();
Symbol 239 MovieClip Frame 1
stop();
this.repair._visible = false;
Symbol 245 MovieClip [mcClickOk] Frame 1
stop();
this.bg.onRollOver = function () {
this.useHandCursor = false;
};
Instance of Symbol 214 MovieClip "btnOk" in Symbol 245 MovieClip [mcClickOk] Frame 3
on (release) {
_root.scrollMainMenu();
}
Symbol 295 MovieClip Frame 1
stop();
this.iniFrame = this._currentframe;
this.onRollOver = function () {
this.gotoAndStop(this.iniFrame + 1);
};
this.onRollOut = function () {
this.gotoAndStop(this.iniFrame);
};
this.onReleaseOutside = function () {
this.gotoAndStop(this.iniFrame);
};
Symbol 295 MovieClip Frame 3
this.iniFrame = this._currentframe;
Symbol 295 MovieClip Frame 5
this.iniFrame = this._currentframe;
Symbol 295 MovieClip Frame 7
this.iniFrame = this._currentframe;
Symbol 295 MovieClip Frame 9
this.iniFrame = this._currentframe;
Symbol 295 MovieClip Frame 11
this.iniFrame = this._currentframe;
Symbol 295 MovieClip Frame 13
this.iniFrame = this._currentframe;
Symbol 295 MovieClip Frame 15
this.iniFrame = this._currentframe;
Symbol 301 MovieClip [finishMessage] Frame 4
_global.score = this.scor;
trace("globlaScore: " + _global.score);
Symbol 301 MovieClip [finishMessage] Frame 6
Selection.setFocus("input");
Symbol 303 MovieClip Frame 1
var component = _parent;
component.registerSkinElement(track_mc, "scrollTrack");
Symbol 304 MovieClip [FScrollBarSymbol] Frame 1
#initclip 2
FScrollBarClass = function () {
if (this._height == 4) {
return(undefined);
}
this.init();
this.minPos = (this.maxPos = (this.pageSize = (this.largeScroll = 0)));
this.smallScroll = 1;
this.width = (this.horizontal ? (this._width) : (this._height));
this._xscale = (this._yscale = 100);
this.setScrollPosition(0);
this.tabEnabled = false;
if (this._targetInstanceName.length > 0) {
this.setScrollTarget(this._parent[this._targetInstanceName]);
}
this.tabChildren = false;
this.setSize(this.width);
};
FScrollBarClass.prototype = new FUIComponentClass();
FScrollBarClass.prototype.setHorizontal = function (flag) {
if (this.horizontal && (!flag)) {
this._xscale = 100;
this._rotation = 0;
} else if (flag && (!this.horizontal)) {
this._xscale = -100;
this._rotation = -90;
}
this.horizontal = flag;
};
FScrollBarClass.prototype.setScrollProperties = function (pSize, mnPos, mxPos) {
if (!this.enable) {
return(undefined);
}
this.pageSize = pSize;
this.minPos = Math.max(mnPos, 0);
this.maxPos = Math.max(mxPos, 0);
this.scrollPosition = Math.max(this.minPos, this.scrollPosition);
this.scrollPosition = Math.min(this.maxPos, this.scrollPosition);
if ((this.maxPos - this.minPos) <= 0) {
this.scrollThumb_mc.removeMovieClip();
this.upArrow_mc.gotoAndStop(3);
this.downArrow_mc.gotoAndStop(3);
this.downArrow_mc.onPress = (this.downArrow_mc.onRelease = (this.downArrow_mc.onDragOut = null));
this.upArrow_mc.onPress = (this.upArrow_mc.onRelease = (this.upArrow_mc.onDragOut = null));
this.scrollTrack_mc.onPress = (this.scrollTrack_mc.onRelease = null);
this.scrollTrack_mc.onDragOut = (this.scrollTrack_mc.onRollOut = null);
this.scrollTrack_mc.useHandCursor = false;
} else {
var _local2 = this.getScrollPosition();
this.upArrow_mc.gotoAndStop(1);
this.downArrow_mc.gotoAndStop(1);
this.upArrow_mc.onPress = (this.upArrow_mc.onDragOver = this.startUpScroller);
this.upArrow_mc.onRelease = (this.upArrow_mc.onDragOut = this.stopScrolling);
this.downArrow_mc.onPress = (this.downArrow_mc.onDragOver = this.startDownScroller);
this.downArrow_mc.onRelease = (this.downArrow_mc.onDragOut = this.stopScrolling);
this.scrollTrack_mc.onPress = (this.scrollTrack_mc.onDragOver = this.startTrackScroller);
this.scrollTrack_mc.onRelease = this.stopScrolling;
this.scrollTrack_mc.onDragOut = this.stopScrolling;
this.scrollTrack_mc.onRollOut = this.stopScrolling;
this.scrollTrack_mc.useHandCursor = false;
this.attachMovie("ScrollThumb", "scrollThumb_mc", 3);
this.scrollThumb_mc._x = 0;
this.scrollThumb_mc._y = this.upArrow_mc._height;
this.scrollThumb_mc.onPress = this.startDragThumb;
this.scrollThumb_mc.controller = this;
this.scrollThumb_mc.onRelease = (this.scrollThumb_mc.onReleaseOutside = this.stopDragThumb);
this.scrollThumb_mc.useHandCursor = false;
this.thumbHeight = (this.pageSize / ((this.maxPos - this.minPos) + this.pageSize)) * this.trackSize;
this.thumbMid_mc = this.scrollThumb_mc.mc_sliderMid;
this.thumbTop_mc = this.scrollThumb_mc.mc_sliderTop;
this.thumbBot_mc = this.scrollThumb_mc.mc_sliderBot;
this.thumbHeight = Math.max(this.thumbHeight, 6);
this.midHeight = (this.thumbHeight - this.thumbTop_mc._height) - this.thumbBot_mc._height;
this.thumbMid_mc._yScale = (this.midHeight * 100) / this.thumbMid_mc._height;
this.thumbMid_mc._y = this.thumbTop_mc._height;
this.thumbBot_mc._y = this.thumbTop_mc._height + this.midHeight;
this.scrollTop = this.scrollThumb_mc._y;
this.trackHeight = this.trackSize - this.thumbHeight;
this.scrollBot = this.trackHeight + this.scrollTop;
_local2 = Math.min(_local2, this.maxPos);
this.setScrollPosition(Math.max(_local2, this.minPos));
}
};
FScrollBarClass.prototype.getScrollPosition = function () {
return(this.scrollPosition);
};
FScrollBarClass.prototype.setScrollPosition = function (pos) {
this.scrollPosition = pos;
if (this.scrollThumb_mc != undefined) {
pos = Math.min(pos, this.maxPos);
pos = Math.max(pos, this.minPos);
}
this.scrollThumb_mc._y = (((pos - this.minPos) * this.trackHeight) / (this.maxPos - this.minPos)) + this.scrollTop;
this.executeCallBack();
};
FScrollBarClass.prototype.setLargeScroll = function (lScroll) {
this.largeScroll = lScroll;
};
FScrollBarClass.prototype.setSmallScroll = function (sScroll) {
this.smallScroll = sScroll;
};
FScrollBarClass.prototype.setEnabled = function (enabledFlag) {
var _local3 = this.enable;
if (enabledFlag && (!_local3)) {
this.enable = enabledFlag;
if (this.textField != undefined) {
this.setScrollTarget(this.textField);
} else {
this.setScrollProperties(this.pageSize, this.cachedMinPos, this.cachedMaxPos);
this.setScrollPosition(this.cachedPos);
}
this.clickFilter = undefined;
} else if ((!enabledFlag) && (_local3)) {
this.textField.removeListener(this);
this.cachedPos = this.getScrollPosition();
this.cachedMinPos = this.minPos;
this.cachedMaxPos = this.maxPos;
if (this.clickFilter == undefined) {
this.setScrollProperties(this.pageSize, 0, 0);
} else {
this.clickFilter = true;
}
this.enable = enabledFlag;
}
};
FScrollBarClass.prototype.setSize = function (hgt) {
if (this._height == 1) {
return(undefined);
}
this.width = hgt;
this.scrollTrack_mc._yscale = 100;
this.scrollTrack_mc._yscale = (100 * this.width) / this.scrollTrack_mc._height;
if (this.upArrow_mc == undefined) {
this.attachMovie("UpArrow", "upArrow_mc", 1);
this.attachMovie("DownArrow", "downArrow_mc", 2);
this.downArrow_mc.controller = (this.upArrow_mc.controller = this);
this.upArrow_mc.useHandCursor = (this.downArrow_mc.useHandCursor = false);
this.upArrow_mc._x = (this.upArrow_mc._y = 0);
this.downArrow_mc._x = 0;
}
this.scrollTrack_mc.controller = this;
this.downArrow_mc._y = this.width - this.downArrow_mc._height;
this.trackSize = this.width - (2 * this.downArrow_mc._height);
if (this.textField != undefined) {
this.onTextChanged();
} else {
this.setScrollProperties(this.pageSize, this.minPos, this.maxPos);
}
};
FScrollBarClass.prototype.scrollIt = function (inc, mode) {
var _local3 = this.smallScroll;
if (inc != "one") {
_local3 = ((this.largeScroll == 0) ? (this.pageSize) : (this.largeScroll));
}
var _local2 = this.getScrollPosition() + (mode * _local3);
if (_local2 > this.maxPos) {
_local2 = this.maxPos;
} else if (_local2 < this.minPos) {
_local2 = this.minPos;
}
this.setScrollPosition(_local2);
};
FScrollBarClass.prototype.startDragThumb = function () {
this.lastY = this._ymouse;
this.onMouseMove = this.controller.dragThumb;
};
FScrollBarClass.prototype.dragThumb = function () {
this.scrollMove = this._ymouse - this.lastY;
this.scrollMove = this.scrollMove + this._y;
if (this.scrollMove < this.controller.scrollTop) {
this.scrollMove = this.controller.scrollTop;
} else if (this.scrollMove > this.controller.scrollBot) {
this.scrollMove = this.controller.scrollBot;
}
this._y = this.scrollMove;
var _local2 = this.controller;
_local2.scrollPosition = Math.round(((_local2.maxPos - _local2.minPos) * (this._y - _local2.scrollTop)) / _local2.trackHeight) + _local2.minPos;
this.controller.isScrolling = true;
updateAfterEvent();
this.controller.executeCallBack();
};
FScrollBarClass.prototype.stopDragThumb = function () {
this.controller.isScrolling = false;
this.onMouseMove = null;
};
FScrollBarClass.prototype.startTrackScroller = function () {
this.controller.trackScroller();
this.controller.scrolling = setInterval(this.controller, "scrollInterval", 500, "page", -1);
};
FScrollBarClass.prototype.scrollInterval = function (inc, mode) {
clearInterval(this.scrolling);
if (inc == "page") {
this.trackScroller();
} else {
this.scrollIt(inc, mode);
}
this.scrolling = setInterval(this, "scrollInterval", 35, inc, mode);
};
FScrollBarClass.prototype.trackScroller = function () {
if ((this.scrollThumb_mc._y + this.thumbHeight) < this._ymouse) {
this.scrollIt("page", 1);
} else if (this.scrollThumb_mc._y > this._ymouse) {
this.scrollIt("page", -1);
}
};
FScrollBarClass.prototype.stopScrolling = function () {
this.controller.downArrow_mc.gotoAndStop(1);
this.controller.upArrow_mc.gotoAndStop(1);
clearInterval(this.controller.scrolling);
};
FScrollBarClass.prototype.startUpScroller = function () {
this.controller.upArrow_mc.gotoAndStop(2);
this.controller.scrollIt("one", -1);
this.controller.scrolling = setInterval(this.controller, "scrollInterval", 500, "one", -1);
};
FScrollBarClass.prototype.startDownScroller = function () {
this.controller.downArrow_mc.gotoAndStop(2);
this.controller.scrollIt("one", 1);
this.controller.scrolling = setInterval(this.controller, "scrollInterval", 500, "one", 1);
};
FScrollBarClass.prototype.setScrollTarget = function (tF) {
if (tF == undefined) {
this.textField.removeListener(this);
delete this.textField[(this.horizontal ? "hScroller" : "vScroller")];
if ((this.textField.hScroller != undefined) && (this.textField.vScroller != undefined)) {
this.textField.unwatch("text");
this.textField.unwatch("htmltext");
}
}
this.textField = undefined;
if (!(tF instanceof TextField)) {
return(undefined);
}
this.textField = tF;
this.textField[(this.horizontal ? "hScroller" : "vScroller")] = this;
this.onTextChanged();
this.onChanged = function () {
this.onTextChanged();
};
this.onScroller = function () {
if (!this.isScrolling) {
if (!this.horizontal) {
this.setScrollPosition(this.textField.scroll);
} else {
this.setScrollPosition(this.textField.hscroll);
}
}
};
this.textField.addListener(this);
this.textField.watch("text", this.callback);
this.textField.watch("htmlText", this.callback);
};
FScrollBarClass.prototype.callback = function (prop, oldVal, newVal) {
clearInterval(this.hScroller.synchScroll);
clearInterval(this.vScroller.synchScroll);
this.hScroller.synchScroll = setInterval(this.hScroller, "onTextChanged", 50);
this.vScroller.synchScroll = setInterval(this.vScroller, "onTextChanged", 50);
return(newVal);
};
FScrollBarClass.prototype.onTextChanged = function () {
if ((!this.enable) || (this.textField == undefined)) {
return(undefined);
}
clearInterval(this.synchScroll);
if (this.horizontal) {
var _local3 = this.textField.hscroll;
this.setScrollProperties(this.textField._width, 0, this.textField.maxhscroll);
this.setScrollPosition(Math.min(_local3, this.textField.maxhscroll));
} else {
var _local3 = this.textField.scroll;
var _local2 = this.textField.bottomScroll - this.textField.scroll;
this.setScrollProperties(_local2, 1, this.textField.maxscroll);
this.setScrollPosition(Math.min(_local3, this.textField.maxscroll));
}
};
FScrollBarClass.prototype.executeCallBack = function () {
if (this.textField == undefined) {
super.executeCallBack();
} else if (this.horizontal) {
this.textField.hscroll = this.getScrollPosition();
} else {
this.textField.scroll = this.getScrollPosition();
}
};
Object.registerClass("FScrollBarSymbol", FScrollBarClass);
#endinitclip
Symbol 305 MovieClip [FUIComponentSymbol] Frame 1
#initclip 1
function FUIComponentClass() {
this.init();
}
FUIComponentClass.prototype = new MovieClip();
FUIComponentClass.prototype.init = function () {
this.enable = true;
this.focused = false;
this.useHandCursor = false;
this._accImpl = new Object();
this._accImpl.stub = true;
this.styleTable = new Array();
if (_global.globalStyleFormat == undefined) {
_global.globalStyleFormat = new FStyleFormat();
globalStyleFormat.isGlobal = true;
_global._focusControl = new Object();
_global._focusControl.onSetFocus = function (oldFocus, newFocus) {
oldFocus.myOnKillFocus();
newFocus.myOnSetFocus();
};
Selection.addListener(_global._focusControl);
}
if (this._name != undefined) {
this._focusrect = false;
this.tabEnabled = true;
this.focusEnabled = true;
this.tabChildren = false;
this.tabFocused = true;
if (this.hostStyle == undefined) {
globalStyleFormat.addListener(this);
} else {
this.styleTable = this.hostStyle;
}
this.deadPreview._visible = false;
this.deadPreview._width = (this.deadPreview._height = 1);
this.methodTable = new Object();
this.keyListener = new Object();
this.keyListener.controller = this;
this.keyListener.onKeyDown = function () {
this.controller.myOnKeyDown();
};
this.keyListener.onKeyUp = function () {
this.controller.myOnKeyUp();
};
for (var _local3 in this.styleFormat_prm) {
this.setStyleProperty(_local3, this.styleFormat_prm[_local3]);
}
}
};
FUIComponentClass.prototype.setEnabled = function (enabledFlag) {
this.enable = ((arguments.length > 0) ? (enabledFlag) : true);
this.tabEnabled = (this.focusEnabled = enabledFlag);
if ((!this.enable) && (this.focused)) {
Selection.setFocus(undefined);
}
};
FUIComponentClass.prototype.getEnabled = function () {
return(this.enable);
};
FUIComponentClass.prototype.setSize = function (w, h) {
this.width = w;
this.height = h;
this.focusRect.removeMovieClip();
};
FUIComponentClass.prototype.setChangeHandler = function (chng, obj) {
this.handlerObj = ((obj == undefined) ? (this._parent) : (obj));
this.changeHandler = chng;
};
FUIComponentClass.prototype.invalidate = function (methodName) {
this.methodTable[methodName] = true;
this.onEnterFrame = this.cleanUI;
};
FUIComponentClass.prototype.cleanUI = function () {
if (this.methodTable.setSize) {
this.setSize(this.width, this.height);
} else {
this.cleanUINotSize();
}
this.methodTable = new Object();
delete this.onEnterFrame;
};
FUIComponentClass.prototype.cleanUINotSize = function () {
for (var _local2 in this.methodTable) {
this[_local2]();
}
};
FUIComponentClass.prototype.drawRect = function (x, y, w, h) {
var _local4 = this.styleTable.focusRectInner.value;
var _local5 = this.styleTable.focusRectOuter.value;
if (_local4 == undefined) {
_local4 = 16777215 /* 0xFFFFFF */;
}
if (_local5 == undefined) {
_local5 = 0;
}
this.createEmptyMovieClip("focusRect", 1000);
this.focusRect.controller = this;
this.focusRect.lineStyle(1, _local5);
this.focusRect.moveTo(x, y);
this.focusRect.lineTo(x + w, y);
this.focusRect.lineTo(x + w, y + h);
this.focusRect.lineTo(x, y + h);
this.focusRect.lineTo(x, y);
this.focusRect.lineStyle(1, _local4);
this.focusRect.moveTo(x + 1, y + 1);
this.focusRect.lineTo((x + w) - 1, y + 1);
this.focusRect.lineTo((x + w) - 1, (y + h) - 1);
this.focusRect.lineTo(x + 1, (y + h) - 1);
this.focusRect.lineTo(x + 1, y + 1);
};
FUIComponentClass.prototype.pressFocus = function () {
this.tabFocused = false;
this.focusRect.removeMovieClip();
Selection.setFocus(this);
};
FUIComponentClass.prototype.drawFocusRect = function () {
this.drawRect(-2, -2, this.width + 4, this.height + 4);
};
FUIComponentClass.prototype.myOnSetFocus = function () {
this.focused = true;
Key.addListener(this.keyListener);
if (this.tabFocused) {
this.drawFocusRect();
}
};
FUIComponentClass.prototype.myOnKillFocus = function () {
this.tabFocused = true;
this.focused = false;
this.focusRect.removeMovieClip();
Key.removeListener(this.keyListener);
};
FUIComponentClass.prototype.executeCallBack = function () {
this.handlerObj[this.changeHandler](this);
};
FUIComponentClass.prototype.updateStyleProperty = function (styleFormat, propName) {
this.setStyleProperty(propName, styleFormat[propName], styleFormat.isGlobal);
};
FUIComponentClass.prototype.setStyleProperty = function (propName, value, isGlobal) {
if (value == "") {
return(undefined);
}
var _local17 = parseInt(value);
if (!isNaN(_local17)) {
value = _local17;
}
var _local16 = ((arguments.length > 2) ? (isGlobal) : false);
if (this.styleTable[propName] == undefined) {
this.styleTable[propName] = new Object();
this.styleTable[propName].useGlobal = true;
}
if (this.styleTable[propName].useGlobal || (!_local16)) {
this.styleTable[propName].value = value;
if (this.setCustomStyleProperty(propName, value)) {
} else if (propName == "embedFonts") {
this.invalidate("setSize");
} else if (propName.subString(0, 4) == "text") {
if (this.textStyle == undefined) {
this.textStyle = new TextFormat();
}
var _local18 = propName.subString(4, propName.length);
this.textStyle[_local18] = value;
this.invalidate("setSize");
} else {
for (var _local15 in this.styleTable[propName].coloredMCs) {
var _local4 = new Color(this.styleTable[propName].coloredMCs[_local15]);
if (this.styleTable[propName].value == undefined) {
var _local5 = {ra:"100", rb:"0", ga:"100", gb:"0", ba:"100", bb:"0", aa:"100", ab:"0"};
_local4.setTransform(_local5);
} else {
_local4.setRGB(value);
}
}
}
this.styleTable[propName].useGlobal = _local16;
}
};
FUIComponentClass.prototype.registerSkinElement = function (skinMCRef, propName) {
if (this.styleTable[propName] == undefined) {
this.styleTable[propName] = new Object();
this.styleTable[propName].useGlobal = true;
}
if (this.styleTable[propName].coloredMCs == undefined) {
this.styleTable[propName].coloredMCs = new Object();
}
this.styleTable[propName].coloredMCs[skinMCRef] = skinMCRef;
if (this.styleTable[propName].value != undefined) {
var _local4 = new Color(skinMCRef);
_local4.setRGB(this.styleTable[propName].value);
}
};
_global.FStyleFormat = function () {
this.nonStyles = {listeners:true, isGlobal:true, isAStyle:true, addListener:true, removeListener:true, nonStyles:true, applyChanges:true};
this.listeners = new Object();
this.isGlobal = false;
if (arguments.length > 0) {
for (var _local3 in arguments[0]) {
this[_local3] = arguments[0][_local3];
}
}
};
_global.FStyleFormat.prototype = new Object();
FStyleFormat.prototype.addListener = function () {
var _local3 = 0;
while (_local3 < arguments.length) {
var _local4 = arguments[_local3];
this.listeners[arguments[_local3]] = _local4;
for (var _local5 in this) {
if (this.isAStyle(_local5)) {
_local4.updateStyleProperty(this, _local5.toString());
}
}
_local3++;
}
};
FStyleFormat.prototype.removeListener = function (component) {
this.listeners[component] = undefined;
for (var _local4 in this) {
if (this.isAStyle(_local4)) {
if (component.styleTable[_local4].useGlobal == this.isGlobal) {
component.styleTable[_local4].useGlobal = true;
var _local3 = (this.isGlobal ? undefined : (globalStyleFormat[_local4]));
component.setStyleProperty(_local4, _local3, true);
}
}
}
};
FStyleFormat.prototype.applyChanges = function () {
var _local6 = 0;
for (var _local5 in this.listeners) {
var _local3 = this.listeners[_local5];
if (arguments.length > 0) {
var _local4 = 0;
while (_local4 < arguments.length) {
if (this.isAStyle(arguments[_local4])) {
_local3.updateStyleProperty(this, arguments[_local4]);
}
_local4++;
}
} else {
for (var _local4 in this) {
if (this.isAStyle(_local4)) {
_local3.updateStyleProperty(this, _local4.toString());
}
}
}
}
};
FStyleFormat.prototype.isAStyle = function (name) {
return((this.nonStyles[name] ? false : true));
};
#endinitclip
Symbol 307 MovieClip [cashOppSelect] Frame 1
_global.scor = zcor;
trace("scor: " + _global.scor);
Symbol 313 Button
on (release) {
getURL ("http://www.freeonlinegames.com/?PlanetRacer", "_blank");
}
Symbol 331 MovieClip [mcBuildings] Frame 1
stop();
Symbol 335 MovieClip [mcFlits] Frame 1
this.onEnterFrame = function () {
this._alpha = this._alpha - 15;
if (this._alpha <= 0) {
this.removeMovieClip();
}
};
Symbol 338 Button
on (release) {
targetul1 = ("http://www.freeonlinegames.com/downloads/" + _parent.wynume) + ".exe";
getURL (targetul1);
}
Symbol 342 MovieClip [mcGoHome] Frame 1
stop();
Symbol 344 MovieClip [mcHighscores] Frame 1
stop();
this.bg.onRollOver = function () {
this.useHandCursor = false;
};
Symbol 363 MovieClip Frame 1
stop();
this.onRollOver = function () {
this.gotoAndStop(2);
};
this.onRollOut = function () {
this.gotoAndStop(1);
};
this.onReleaseOutside = function () {
this.gotoAndStop(1);
};
Symbol 367 Button
on (release) {
targetul3 = "http://www.freegamesforyourwebsite.com/?" + _parent.wxnume;
getURL (targetul3, "_blank");
}
Symbol 368 Button
on (release) {
targetul2 = "http://www.freeonlinegames.com/?" + _parent.wxnume;
getURL (targetul2, "_blank");
}
Symbol 369 Button
on (release) {
_parent.mainMenuFunction();
}
Symbol 370 Button
on (release) {
targetul1 = ("http://www.freeonlinegames.com/downloads/" + _parent.wxnume) + ".exe";
getURL (targetul1);
}
Symbol 371 Button
on (release, keyPress "p") {
_parent.pauseFunction();
}
Symbol 372 Button
on (release, keyPress "s") {
_parent.soundFunction();
}
Symbol 385 MovieClip Frame 1
stop();
wxculoarea3 = new Color(but1);
wxculoarea4 = new Color(but2);
wxculoarea5 = new Color(but3);
wxculoarea6 = new Color(but4);
wxculoarea7 = new Color(but5);
wxculoarea8 = new Color(but6);
myColorTransform2 = new Object();
myColorTransform2 = {ra:"100", rb:_parent.xrtb5, ga:"100", gb:_parent.xgtb5, ba:"100", bb:_parent.xbtb5, aa:"100", ab:"0"};
wxculoarea3.setTransform(myColorTransform2);
wxculoarea4.setTransform(myColorTransform2);
wxculoarea5.setTransform(myColorTransform2);
wxculoarea6.setTransform(myColorTransform2);
wxculoarea7.setTransform(myColorTransform2);
wxculoarea8.setTransform(myColorTransform2);
_parent.wxbutno = 6;
if (((_parent.wxdownload == false) && (_parent.wxpause == true)) && (_parent.wxsound == true)) {
this.gotoAndStop(2);
_parent.wxbutno = 5;
}
if (((_parent.wxdownload == true) && (_parent.wxpause == false)) && (_parent.wxsound == true)) {
this.gotoAndStop(3);
_parent.wxbutno = 5;
}
if (((_parent.wxdownload == true) && (_parent.wxpause == true)) && (_parent.wxsound == false)) {
this.gotoAndStop(4);
_parent.wxbutno = 5;
}
if (((_parent.wxdownload == false) && (_parent.wxpause == false)) && (_parent.wxsound == true)) {
this.gotoAndStop(5);
_parent.wxbutno = 4;
}
if (((_parent.wxdownload == false) && (_parent.wxpause == true)) && (_parent.wxsound == false)) {
this.gotoAndStop(6);
_parent.wxbutno = 4;
}
if (((_parent.wxdownload == true) && (_parent.wxpause == false)) && (_parent.wxsound == false)) {
this.gotoAndStop(7);
_parent.wxbutno = 4;
}
if (((_parent.wxdownload == false) && (_parent.wxpause == false)) && (_parent.wxsound == false)) {
this.gotoAndStop(8);
_parent.wxbutno = 3;
}
Symbol 385 MovieClip Frame 2
wxculoarea3 = new Color(but1);
wxculoarea4 = new Color(but2);
wxculoarea5 = new Color(but3);
wxculoarea6 = new Color(but4);
wxculoarea7 = new Color(but5);
wxculoarea8 = new Color(but6);
myColorTransform2 = new Object();
myColorTransform2 = {ra:"100", rb:_parent.xrtb5, ga:"100", gb:_parent.xgtb5, ba:"100", bb:_parent.xbtb5, aa:"100", ab:"0"};
wxculoarea3.setTransform(myColorTransform2);
wxculoarea4.setTransform(myColorTransform2);
wxculoarea5.setTransform(myColorTransform2);
wxculoarea6.setTransform(myColorTransform2);
wxculoarea7.setTransform(myColorTransform2);
wxculoarea8.setTransform(myColorTransform2);
Symbol 385 MovieClip Frame 3
wxculoarea3 = new Color(but1);
wxculoarea4 = new Color(but2);
wxculoarea5 = new Color(but3);
wxculoarea6 = new Color(but4);
wxculoarea7 = new Color(but5);
wxculoarea8 = new Color(but6);
myColorTransform2 = new Object();
myColorTransform2 = {ra:"100", rb:_parent.xrtb5, ga:"100", gb:_parent.xgtb5, ba:"100", bb:_parent.xbtb5, aa:"100", ab:"0"};
wxculoarea3.setTransform(myColorTransform2);
wxculoarea4.setTransform(myColorTransform2);
wxculoarea5.setTransform(myColorTransform2);
wxculoarea6.setTransform(myColorTransform2);
wxculoarea7.setTransform(myColorTransform2);
wxculoarea8.setTransform(myColorTransform2);
Symbol 385 MovieClip Frame 4
wxculoarea3 = new Color(but1);
wxculoarea4 = new Color(but2);
wxculoarea5 = new Color(but3);
wxculoarea6 = new Color(but4);
wxculoarea7 = new Color(but5);
wxculoarea8 = new Color(but6);
myColorTransform2 = new Object();
myColorTransform2 = {ra:"100", rb:_parent.xrtb5, ga:"100", gb:_parent.xgtb5, ba:"100", bb:_parent.xbtb5, aa:"100", ab:"0"};
wxculoarea3.setTransform(myColorTransform2);
wxculoarea4.setTransform(myColorTransform2);
wxculoarea5.setTransform(myColorTransform2);
wxculoarea6.setTransform(myColorTransform2);
wxculoarea7.setTransform(myColorTransform2);
wxculoarea8.setTransform(myColorTransform2);
Symbol 385 MovieClip Frame 5
wxculoarea3 = new Color(but1);
wxculoarea4 = new Color(but2);
wxculoarea5 = new Color(but3);
wxculoarea6 = new Color(but4);
wxculoarea7 = new Color(but5);
wxculoarea8 = new Color(but6);
myColorTransform2 = new Object();
myColorTransform2 = {ra:"100", rb:_parent.xrtb5, ga:"100", gb:_parent.xgtb5, ba:"100", bb:_parent.xbtb5, aa:"100", ab:"0"};
wxculoarea3.setTransform(myColorTransform2);
wxculoarea4.setTransform(myColorTransform2);
wxculoarea5.setTransform(myColorTransform2);
wxculoarea6.setTransform(myColorTransform2);
wxculoarea7.setTransform(myColorTransform2);
wxculoarea8.setTransform(myColorTransform2);
Symbol 385 MovieClip Frame 6
wxculoarea3 = new Color(but1);
wxculoarea4 = new Color(but2);
wxculoarea5 = new Color(but3);
wxculoarea6 = new Color(but4);
wxculoarea7 = new Color(but5);
wxculoarea8 = new Color(but6);
myColorTransform2 = new Object();
myColorTransform2 = {ra:"100", rb:_parent.xrtb5, ga:"100", gb:_parent.xgtb5, ba:"100", bb:_parent.xbtb5, aa:"100", ab:"0"};
wxculoarea3.setTransform(myColorTransform2);
wxculoarea4.setTransform(myColorTransform2);
wxculoarea5.setTransform(myColorTransform2);
wxculoarea6.setTransform(myColorTransform2);
wxculoarea7.setTransform(myColorTransform2);
wxculoarea8.setTransform(myColorTransform2);
Symbol 385 MovieClip Frame 7
wxculoarea3 = new Color(but1);
wxculoarea4 = new Color(but2);
wxculoarea5 = new Color(but3);
wxculoarea6 = new Color(but4);
wxculoarea7 = new Color(but5);
wxculoarea8 = new Color(but6);
myColorTransform2 = new Object();
myColorTransform2 = {ra:"100", rb:_parent.xrtb5, ga:"100", gb:_parent.xgtb5, ba:"100", bb:_parent.xbtb5, aa:"100", ab:"0"};
wxculoarea3.setTransform(myColorTransform2);
wxculoarea4.setTransform(myColorTransform2);
wxculoarea5.setTransform(myColorTransform2);
wxculoarea6.setTransform(myColorTransform2);
wxculoarea7.setTransform(myColorTransform2);
wxculoarea8.setTransform(myColorTransform2);
Symbol 385 MovieClip Frame 8
wxculoarea3 = new Color(but1);
wxculoarea4 = new Color(but2);
wxculoarea5 = new Color(but3);
wxculoarea6 = new Color(but4);
wxculoarea7 = new Color(but5);
wxculoarea8 = new Color(but6);
myColorTransform2 = new Object();
myColorTransform2 = {ra:"100", rb:_parent.xrtb5, ga:"100", gb:_parent.xgtb5, ba:"100", bb:_parent.xbtb5, aa:"100", ab:"0"};
wxculoarea3.setTransform(myColorTransform2);
wxculoarea4.setTransform(myColorTransform2);
wxculoarea5.setTransform(myColorTransform2);
wxculoarea6.setTransform(myColorTransform2);
wxculoarea7.setTransform(myColorTransform2);
wxculoarea8.setTransform(myColorTransform2);
Symbol 390 Button
on (press) {
_parent.play();
}
Symbol 393 MovieClip Frame 1
stop();
if (_parent.wxaliniere == "Dreapta-Jos") {
this.gotoAndStop(2);
}
if ((_parent.wxaliniere == "Dreapta-Sus") && (_parent.wxbutno == 6)) {
this.gotoAndStop(3);
}
if ((_parent.wxaliniere == "Dreapta-Sus") && (_parent.wxbutno == 5)) {
this.gotoAndStop(5);
}
if ((_parent.wxaliniere == "Dreapta-Sus") && (_parent.wxbutno == 4)) {
this.gotoAndStop(6);
}
if ((_parent.wxaliniere == "Dreapta-Sus") && (_parent.wxbutno == 3)) {
this.gotoAndStop(7);
}
if ((_parent.wxaliniere == "Stanga-Sus") && (_parent.wxbutno == 6)) {
this.gotoAndStop(4);
}
if ((_parent.wxaliniere == "Stanga-Sus") && (_parent.wxbutno == 5)) {
this.gotoAndStop(8);
}
if ((_parent.wxaliniere == "Stanga-Sus") && (_parent.wxbutno == 4)) {
this.gotoAndStop(9);
}
if ((_parent.wxaliniere == "Stanga-Sus") && (_parent.wxbutno == 3)) {
this.gotoAndStop(10);
}
Symbol 393 MovieClip Frame 2
tg._x = 147;
tg._y = 1.1;
Symbol 393 MovieClip Frame 3
tg._x = 147;
tg._y = -174.9;
Symbol 393 MovieClip Frame 4
tg._x = 1.5;
tg._y = -174.9;
Symbol 393 MovieClip Frame 5
tg._x = 147;
tg._y = -152.4;
Symbol 393 MovieClip Frame 6
tg._x = 147;
tg._y = -128.9;
Symbol 393 MovieClip Frame 7
tg._x = 147;
tg._y = -104.9;
Symbol 393 MovieClip Frame 8
tg._x = 1.5;
tg._y = -151.4;
Symbol 393 MovieClip Frame 9
tg._x = 1.5;
tg._y = -128.4;
Symbol 393 MovieClip Frame 10
tg._x = 1.5;
tg._y = -104.9;
Symbol 411 MovieClip Frame 1
stop();
this.onRollOver = function () {
if (_parent._parent._currentframe <= 10) {
_parent._parent.gotoAndPlay(11);
}
};
if (_parent._parent.wxbutno == 5) {
this.gotoAndStop(2);
}
if (_parent._parent.wxbutno == 4) {
this.gotoAndStop(3);
}
if (_parent._parent.wxbutno == 3) {
this.gotoAndStop(4);
}
Symbol 412 MovieClip Frame 1
stop();
if ((_parent.wxaliniere == "Stanga-Sus") || (_parent.wxaliniere == "Dreapta-Sus")) {
this.gotoAndStop(2);
}
Symbol 413 MovieClip Frame 1
function pauseFunction() {
if (_root.pauza == false) {
_root.pauza = true;
} else {
_root.pauza = false;
}
}
function soundFunction() {
if (_root.sunet == true) {
_root.sunet = false;
} else {
_root.sunet = true;
}
trace("sunet: " + _root.sunet);
}
function mainMenuFunction() {
trace("kinggame: " + _root.KingGame);
if (_root.KingGame == true) {
_global.inGame = false;
_root.main._parent.gotoAndStop("startmenu");
_root.main.removeMovieClip();
_root.staticMcs.removeMovieClip();
} else {
_root.music.stop();
_root.quitToGarage();
}
}
stop();
wxnguides._alpha = 0;
my_color = new Color(my_mc);
my_color.setRGB(wxculoare);
myValue = my_color.getRGB().toString(16);
trace(myValue.length);
if (myValue.length == 5) {
myValue = "0" + myValue;
}
if (myValue.length == 4) {
myValue = "00" + myValue;
}
if (myValue.length == 3) {
myValue = "000" + myValue;
}
if (myValue.length == 2) {
myValue = "0000" + myValue;
}
if (myValue.length == 1) {
myValue = "00000" + myValue;
}
xtbcolor = myValue;
xrtb5 = Number("0x" + xtbcolor.slice(0, 2)) - 1;
xgtb5 = Number("0x" + xtbcolor.slice(2, 4)) - 1;
xbtb5 = Number("0x" + xtbcolor.slice(4, 6)) - 1;
wxculoarea2 = new Color(wxnmenu.tg);
myColorTransform = new Object();
myColorTransform = {ra:"100", rb:xrtb5, ga:"100", gb:xgtb5, ba:"100", bb:xbtb5, aa:"100", ab:"0"};
wxculoarea2.setTransform(myColorTransform);
wxculoarea3 = new Color(wxnfer);
myColorTransform2 = new Object();
myColorTransform2 = {ra:"100", rb:xrtb5, ga:"100", gb:xgtb5, ba:"100", bb:xbtb5, aa:"100", ab:"0"};
wxculoarea3.setTransform(myColorTransform2);
Symbol 413 MovieClip Frame 10
stop();
Instance of Symbol 413 MovieClip in Symbol 414 MovieClip [mcHud] Frame 1
//component parameters
onClipEvent (construct) {
wxnume = "PlanetRacer";
wxaliniere = "Dreapta-Jos";
wxculoare = 13158;
wxdownload = true;
wxpause = false;
wxsound = false;
}
onClipEvent (load) {
this.swapDepths(1000);
}
Symbol 418 MovieClip Frame 1
stop();
this.onRollOver = function () {
this.gotoAndStop(2);
};
this.onRollOut = function () {
this.gotoAndStop(1);
};
this.onReleaseOutside = function () {
this.gotoAndStop(1);
};
Symbol 429 MovieClip Frame 1
stop();
this.onRollOver = function () {
this.gotoAndStop(this._currentframe + 1);
};
this.onRollOut = function () {
this.gotoAndStop(this._currentFrame - 1);
};
this.onReleaseOutside = function () {
this.gotoAndStop(this._currentFrame - 1);
};
Symbol 438 MovieClip Frame 1
stop();
Symbol 448 MovieClip Frame 1
stop();
Symbol 457 MovieClip Frame 1
stop();
Symbol 465 MovieClip Frame 1
stop();
Symbol 469 MovieClip Frame 1
stop();
Symbol 478 MovieClip Frame 1
stop();
Symbol 479 Button
on (release) {
targetul1 = ("http://www.freeonlinegames.com/downloads/" + _parent.wynume) + ".exe";
getURL (targetul1);
}
Symbol 486 MovieClip Frame 1
stop();
if (_parent.wyaliniere == "Centru") {
this.gotoAndStop(2);
}
if (_parent.wyaliniere == "Dreapta") {
this.gotoAndStop(3);
}
Symbol 486 MovieClip Frame 2
wxculoarea2 = new Color(but1);
myColorTransform = new Object();
myColorTransform = {ra:"100", rb:_parent.xrtb5, ga:"100", gb:_parent.xgtb5, ba:"100", bb:_parent.xbtb5, aa:"100", ab:"0"};
wxculoarea2.setTransform(myColorTransform);
Symbol 486 MovieClip Frame 3
wxculoarea2 = new Color(but1);
myColorTransform = new Object();
myColorTransform = {ra:"100", rb:_parent.xrtb5, ga:"100", gb:_parent.xgtb5, ba:"100", bb:_parent.xbtb5, aa:"100", ab:"0"};
wxculoarea2.setTransform(myColorTransform);
Symbol 487 Button
on (release) {
targetul2 = "http://www.freeonlinegames.com/?" + _parent.wynume;
getURL (targetul2, "_blank");
}
Symbol 494 MovieClip Frame 1
stop();
if (_parent.wyaliniere == "Centru") {
this.gotoAndStop(2);
}
if (_parent.wyaliniere == "Dreapta") {
this.gotoAndStop(3);
}
Symbol 494 MovieClip Frame 2
wxculoarea2 = new Color(but2);
myColorTransform = new Object();
myColorTransform = {ra:"100", rb:_parent.xrtb5, ga:"100", gb:_parent.xgtb5, ba:"100", bb:_parent.xbtb5, aa:"100", ab:"0"};
wxculoarea2.setTransform(myColorTransform);
Symbol 494 MovieClip Frame 3
wxculoarea2 = new Color(but2);
myColorTransform = new Object();
myColorTransform = {ra:"100", rb:_parent.xrtb5, ga:"100", gb:_parent.xgtb5, ba:"100", bb:_parent.xbtb5, aa:"100", ab:"0"};
wxculoarea2.setTransform(myColorTransform);
Symbol 495 Button
on (release) {
targetul3 = "http://www.freegamesforyourwebsite.com/?" + _parent.wynume;
getURL (targetul3, "_blank");
}
Symbol 496 MovieClip Frame 1
stop();
if (_parent.wyaliniere == "Centru") {
this.gotoAndStop(2);
}
if (_parent.wyaliniere == "Dreapta") {
this.gotoAndStop(3);
}
Symbol 496 MovieClip Frame 2
wxculoarea2 = new Color(but3);
myColorTransform = new Object();
myColorTransform = {ra:"100", rb:_parent.xrtb5, ga:"100", gb:_parent.xgtb5, ba:"100", bb:_parent.xbtb5, aa:"100", ab:"0"};
wxculoarea2.setTransform(myColorTransform);
Symbol 496 MovieClip Frame 3
wxculoarea2 = new Color(but3);
myColorTransform = new Object();
myColorTransform = {ra:"100", rb:_parent.xrtb5, ga:"100", gb:_parent.xgtb5, ba:"100", bb:_parent.xbtb5, aa:"100", ab:"0"};
wxculoarea2.setTransform(myColorTransform);
Symbol 501 Button
on (release) {
targetul1 = ("http://www.freeonlinegames.com/downloads/" + _parent.wynume) + ".exe";
getURL (targetul1);
}
Symbol 502 MovieClip Frame 1
stop();
Symbol 505 Button
on (release) {
targetul2 = "http://www.freeonlinegames.com/?" + _parent.wynume;
getURL (targetul2, "_blank");
}
Symbol 506 MovieClip Frame 1
stop();
Symbol 507 Button
on (release, keyPress "p") {
_parent.instructionsFunction();
}
Symbol 514 MovieClip Frame 1
stop();
if (_parent.wyaliniere == "Centru") {
this.gotoAndStop(2);
}
if (_parent.wyaliniere == "Dreapta") {
this.gotoAndStop(3);
}
Symbol 514 MovieClip Frame 2
wxculoarea2 = new Color(but4);
myColorTransform = new Object();
myColorTransform = {ra:"100", rb:_parent.xrtb5, ga:"100", gb:_parent.xgtb5, ba:"100", bb:_parent.xbtb5, aa:"100", ab:"0"};
wxculoarea2.setTransform(myColorTransform);
Symbol 514 MovieClip Frame 3
wxculoarea2 = new Color(but4);
myColorTransform = new Object();
myColorTransform = {ra:"100", rb:_parent.xrtb5, ga:"100", gb:_parent.xgtb5, ba:"100", bb:_parent.xbtb5, aa:"100", ab:"0"};
wxculoarea2.setTransform(myColorTransform);
Symbol 515 Button
on (release, keyPress "p") {
_parent.instructionsFunction();
}
Symbol 516 MovieClip Frame 1
stop();
Symbol 517 MovieClip Frame 1
function instructionsFunction() {
}
stop();
if ((wyasezare == "Orizontal") && (wyinstructions == false)) {
this.gotoAndStop(2);
}
if (((wyasezare == "Vertical") && (wyinstructions == true)) && (wypozitie == "Sus")) {
this.gotoAndStop(3);
}
if (((wyasezare == "Vertical") && (wyinstructions == true)) && (wypozitie == "Jos")) {
this.gotoAndStop(4);
}
if (((wyasezare == "Orizontal") && (wyinstructions == true)) && (wypozitie == "Sus")) {
this.gotoAndStop(5);
}
if (((wyasezare == "Orizontal") && (wyinstructions == true)) && (wypozitie == "Jos")) {
this.gotoAndStop(6);
}
my_color = new Color(my_mc);
my_color.setRGB(wyculoare);
myValue = my_color.getRGB().toString(16);
trace(myValue.length);
if (myValue.length == 5) {
myValue = "0" + myValue;
}
if (myValue.length == 4) {
myValue = "00" + myValue;
}
if (myValue.length == 3) {
myValue = "000" + myValue;
}
if (myValue.length == 2) {
myValue = "0000" + myValue;
}
if (myValue.length == 1) {
myValue = "00000" + myValue;
}
xtbcolor = myValue;
xrtb5 = Number("0x" + xtbcolor.slice(0, 2)) - 1;
xgtb5 = Number("0x" + xtbcolor.slice(2, 4)) - 1;
xbtb5 = Number("0x" + xtbcolor.slice(4, 6)) - 1;
wxculoarea2 = new Color(wynbut1.but1);
wxculoarea3 = new Color(wynbut2.but2);
wxculoarea4 = new Color(wynbut3.but3);
wxculoarea5 = new Color(wynbut4.but4);
myColorTransform = new Object();
myColorTransform = {ra:"100", rb:xrtb5, ga:"100", gb:xgtb5, ba:"100", bb:xbtb5, aa:"100", ab:"0"};
wxculoarea2.setTransform(myColorTransform);
wxculoarea3.setTransform(myColorTransform);
wxculoarea4.setTransform(myColorTransform);
wxculoarea5.setTransform(myColorTransform);
Symbol 517 MovieClip Frame 2
stop();
my_color = new Color(my_mc);
my_color.setRGB(wyculoare);
myValue = my_color.getRGB().toString(16);
trace(myValue.length);
if (myValue.length == 5) {
myValue = "0" + myValue;
}
if (myValue.length == 4) {
myValue = "00" + myValue;
}
if (myValue.length == 3) {
myValue = "000" + myValue;
}
if (myValue.length == 2) {
myValue = "0000" + myValue;
}
if (myValue.length == 1) {
myValue = "00000" + myValue;
}
xtbcolor = myValue;
xrtb5 = Number("0x" + xtbcolor.slice(0, 2)) - 1;
xgtb5 = Number("0x" + xtbcolor.slice(2, 4)) - 1;
xbtb5 = Number("0x" + xtbcolor.slice(4, 6)) - 1;
wxculoarea2 = new Color(wynbut1.but1);
wxculoarea3 = new Color(wynbut2.but2);
wxculoarea4 = new Color(wynbut3.but3);
wxculoarea5 = new Color(wynbut4.but4);
myColorTransform = new Object();
myColorTransform = {ra:"100", rb:xrtb5, ga:"100", gb:xgtb5, ba:"100", bb:xbtb5, aa:"100", ab:"0"};
wxculoarea2.setTransform(myColorTransform);
wxculoarea3.setTransform(myColorTransform);
wxculoarea4.setTransform(myColorTransform);
wxculoarea5.setTransform(myColorTransform);
Symbol 517 MovieClip Frame 3
stop();
my_color = new Color(my_mc);
my_color.setRGB(wyculoare);
myValue = my_color.getRGB().toString(16);
trace(myValue.length);
if (myValue.length == 5) {
myValue = "0" + myValue;
}
if (myValue.length == 4) {
myValue = "00" + myValue;
}
if (myValue.length == 3) {
myValue = "000" + myValue;
}
if (myValue.length == 2) {
myValue = "0000" + myValue;
}
if (myValue.length == 1) {
myValue = "00000" + myValue;
}
xtbcolor = myValue;
xrtb5 = Number("0x" + xtbcolor.slice(0, 2)) - 1;
xgtb5 = Number("0x" + xtbcolor.slice(2, 4)) - 1;
xbtb5 = Number("0x" + xtbcolor.slice(4, 6)) - 1;
wxculoarea2 = new Color(wynbut1.but1);
wxculoarea3 = new Color(wynbut2.but2);
wxculoarea4 = new Color(wynbut3.but3);
wxculoarea5 = new Color(wynbut4.but4);
myColorTransform = new Object();
myColorTransform = {ra:"100", rb:xrtb5, ga:"100", gb:xgtb5, ba:"100", bb:xbtb5, aa:"100", ab:"0"};
wxculoarea2.setTransform(myColorTransform);
wxculoarea3.setTransform(myColorTransform);
wxculoarea4.setTransform(myColorTransform);
wxculoarea5.setTransform(myColorTransform);
Symbol 517 MovieClip Frame 4
stop();
my_color = new Color(my_mc);
my_color.setRGB(wyculoare);
myValue = my_color.getRGB().toString(16);
trace(myValue.length);
if (myValue.length == 5) {
myValue = "0" + myValue;
}
if (myValue.length == 4) {
myValue = "00" + myValue;
}
if (myValue.length == 3) {
myValue = "000" + myValue;
}
if (myValue.length == 2) {
myValue = "0000" + myValue;
}
if (myValue.length == 1) {
myValue = "00000" + myValue;
}
xtbcolor = myValue;
xrtb5 = Number("0x" + xtbcolor.slice(0, 2)) - 1;
xgtb5 = Number("0x" + xtbcolor.slice(2, 4)) - 1;
xbtb5 = Number("0x" + xtbcolor.slice(4, 6)) - 1;
wxculoarea2 = new Color(wynbut1.but1);
wxculoarea3 = new Color(wynbut2.but2);
wxculoarea4 = new Color(wynbut3.but3);
wxculoarea5 = new Color(wynbut4.but4);
myColorTransform = new Object();
myColorTransform = {ra:"100", rb:xrtb5, ga:"100", gb:xgtb5, ba:"100", bb:xbtb5, aa:"100", ab:"0"};
wxculoarea2.setTransform(myColorTransform);
wxculoarea3.setTransform(myColorTransform);
wxculoarea4.setTransform(myColorTransform);
wxculoarea5.setTransform(myColorTransform);
Symbol 517 MovieClip Frame 5
stop();
my_color = new Color(my_mc);
my_color.setRGB(wyculoare);
myValue = my_color.getRGB().toString(16);
trace(myValue.length);
if (myValue.length == 5) {
myValue = "0" + myValue;
}
if (myValue.length == 4) {
myValue = "00" + myValue;
}
if (myValue.length == 3) {
myValue = "000" + myValue;
}
if (myValue.length == 2) {
myValue = "0000" + myValue;
}
if (myValue.length == 1) {
myValue = "00000" + myValue;
}
xtbcolor = myValue;
xrtb5 = Number("0x" + xtbcolor.slice(0, 2)) - 1;
xgtb5 = Number("0x" + xtbcolor.slice(2, 4)) - 1;
xbtb5 = Number("0x" + xtbcolor.slice(4, 6)) - 1;
wxculoarea2 = new Color(wynbut1.but1);
wxculoarea3 = new Color(wynbut2.but2);
wxculoarea4 = new Color(wynbut3.but3);
wxculoarea5 = new Color(wynbut4.but4);
myColorTransform = new Object();
myColorTransform = {ra:"100", rb:xrtb5, ga:"100", gb:xgtb5, ba:"100", bb:xbtb5, aa:"100", ab:"0"};
wxculoarea2.setTransform(myColorTransform);
wxculoarea3.setTransform(myColorTransform);
wxculoarea4.setTransform(myColorTransform);
wxculoarea5.setTransform(myColorTransform);
Symbol 517 MovieClip Frame 6
stop();
my_color = new Color(my_mc);
my_color.setRGB(wyculoare);
myValue = my_color.getRGB().toString(16);
trace(myValue.length);
if (myValue.length == 5) {
myValue = "0" + myValue;
}
if (myValue.length == 4) {
myValue = "00" + myValue;
}
if (myValue.length == 3) {
myValue = "000" + myValue;
}
if (myValue.length == 2) {
myValue = "0000" + myValue;
}
if (myValue.length == 1) {
myValue = "00000" + myValue;
}
xtbcolor = myValue;
xrtb5 = Number("0x" + xtbcolor.slice(0, 2)) - 1;
xgtb5 = Number("0x" + xtbcolor.slice(2, 4)) - 1;
xbtb5 = Number("0x" + xtbcolor.slice(4, 6)) - 1;
wxculoarea2 = new Color(wynbut1.but1);
wxculoarea3 = new Color(wynbut2.but2);
wxculoarea4 = new Color(wynbut3.but3);
wxculoarea5 = new Color(wynbut4.but4);
myColorTransform = new Object();
myColorTransform = {ra:"100", rb:xrtb5, ga:"100", gb:xgtb5, ba:"100", bb:xbtb5, aa:"100", ab:"0"};
wxculoarea2.setTransform(myColorTransform);
wxculoarea3.setTransform(myColorTransform);
wxculoarea4.setTransform(myColorTransform);
wxculoarea5.setTransform(myColorTransform);
Symbol 520 Button
on (release) {
_root.xdada = 0;
_root.gotoAndPlay("submitScore");
}
Symbol 530 MovieClip [mcOpponentPanel] Frame 1
stop();
Instance of Symbol 517 MovieClip in Symbol 530 MovieClip [mcOpponentPanel] Frame 1
//component parameters
onClipEvent (construct) {
wynume = "PlanetRacer";
wyculoare = 5987195 /* 0x5B5B7B */;
wyasezare = "Orizontal";
wyaliniere = "Centru";
wypozitie = "Sus";
wyinstructions = false;
}
Symbol 545 MovieClip [mcPlanetText] Frame 1
stop();
Symbol 554 MovieClip [mcSter] Frame 1
stop();
Symbol 559 MovieClip [mcSurfaceTile] Frame 1
this.gotoAndStop(random(4) + 1);
Symbol 568 MovieClip Frame 1
stop();
this.onRollOver = function () {
this.gotoAndStop(2);
};
this.onRollOut = function () {
this.gotoAndStop(1);
};
this.onReleaseOutside = function () {
this.gotoAndStop(1);
};
Symbol 593 Button
on (release) {
getURL ("http://www.freeonlinegames.com/?PlanetRacer", "_blank");
}
Symbol 597 MovieClip Frame 1
stop();
this.onRollOver = function () {
this.gotoAndStop(2);
};
this.onRollOut = function () {
this.gotoAndStop(1);
};
this.onReleaseOutside = function () {
this.gotoAndStop(1);
};
Symbol 600 MovieClip Frame 1
stop();
this.onRollOver = function () {
this.gotoAndStop(2);
};
this.onRollOut = function () {
this.gotoAndStop(1);
};
this.onReleaseOutside = function () {
this.gotoAndStop(1);
};
Symbol 607 MovieClip Frame 1
stop();
this.onRollOver = function () {
this.gotoAndStop(2);
};
this.onRollOut = function () {
this.gotoAndStop(1);
};
this.onReleaseOutside = function () {
this.gotoAndStop(1);
};
Symbol 610 MovieClip Frame 1
stop();
this.onRollOver = function () {
this.gotoAndStop(2);
};
this.onRollOut = function () {
this.gotoAndStop(1);
};
this.onReleaseOutside = function () {
this.gotoAndStop(1);
};
Symbol 613 MovieClip Frame 1
stop();
this.onRollOver = function () {
this.gotoAndStop(2);
};
this.onRollOut = function () {
this.gotoAndStop(1);
};
this.onReleaseOutside = function () {
this.gotoAndStop(1);
};
Symbol 617 MovieClip Frame 1
stop();
this.onRollOver = function () {
this.gotoAndStop(2);
};
this.onRollOut = function () {
this.gotoAndStop(1);
};
this.onReleaseOutside = function () {
this.gotoAndStop(1);
};
Symbol 621 MovieClip Frame 1
stop();
this.onRollOver = function () {
this.gotoAndStop(2);
};
this.onRollOut = function () {
this.gotoAndStop(1);
};
this.onReleaseOutside = function () {
this.gotoAndStop(1);
};
Symbol 625 MovieClip Frame 1
stop();
this.onRollOver = function () {
this.gotoAndStop(2);
};
this.onRollOut = function () {
this.gotoAndStop(1);
};
this.onReleaseOutside = function () {
this.gotoAndStop(1);
};
Symbol 629 MovieClip Frame 1
stop();
this.onRollOver = function () {
this.gotoAndStop(2);
};
this.onRollOut = function () {
this.gotoAndStop(1);
};
this.onReleaseOutside = function () {
this.gotoAndStop(1);
};
Symbol 646 MovieClip Frame 1
stop();
this.onRollOver = function () {
this.gotoAndStop(2);
};
this.onRollOut = function () {
this.gotoAndStop(1);
};
this.onReleaseOutside = function () {
this.gotoAndStop(1);
};
Symbol 646 MovieClip Frame 3
delete this.onRollOver;
delete this.onReleaseOutside;
delete this.onRollOut;
delete this.onRelease;
Symbol 651 MovieClip Frame 1
stop();
this.onRollOver = function () {
this.gotoAndStop(2);
};
this.onRollOut = function () {
this.gotoAndStop(1);
};
this.onReleaseOutside = function () {
this.gotoAndStop(1);
};
Symbol 651 MovieClip Frame 3
delete this.onRollOver;
delete this.onReleaseOutside;
delete this.onRollOut;
delete this.onRelease;
Symbol 656 MovieClip Frame 1
stop();
this.onRollOver = function () {
this.gotoAndStop(2);
};
this.onRollOut = function () {
this.gotoAndStop(1);
};
this.onReleaseOutside = function () {
this.gotoAndStop(1);
};
Symbol 660 MovieClip Frame 1
stop();
this.onRollOver = function () {
this.gotoAndStop(2);
};
this.onRollOut = function () {
this.gotoAndStop(1);
};
this.onReleaseOutside = function () {
this.gotoAndStop(1);
};
Symbol 662 MovieClip Frame 1
stop();
this.next.onRelease = function () {
this._parent.gotoAndStop(2);
};
Symbol 662 MovieClip Frame 2
this.prev.onRelease = function () {
this._parent.gotoAndStop(1);
};
Symbol 674 MovieClip Frame 1
stop();
this.onRollOver = function () {
this.gotoAndStop(2);
};
this.onRollOut = function () {
this.gotoAndStop(1);
};
this.onReleaseOutside = function () {
this.gotoAndStop(1);
};
Symbol 677 MovieClip Frame 1
stop();
this.onRollOver = function () {
this.gotoAndStop(2);
};
this.onRollOut = function () {
this.gotoAndStop(1);
};
this.onReleaseOutside = function () {
this.gotoAndStop(1);
};
Symbol 695 MovieClip Frame 1
stop();
Symbol 702 MovieClip Frame 1
stop();
Symbol 703 MovieClip Frame 1
stop();
Symbol 709 MovieClip Frame 1
stop();
this.onRollOver = function () {
this.gotoAndStop(2);
};
this.onRollOut = function () {
this.gotoAndStop(1);
};
this.onReleaseOutside = function () {
this.gotoAndStop(1);
};
Symbol 712 MovieClip Frame 1
stop();
this.onRollOver = function () {
this.gotoAndStop(2);
};
this.onRollOut = function () {
this.gotoAndStop(1);
};
this.onReleaseOutside = function () {
this.gotoAndStop(1);
};
Symbol 714 MovieClip Frame 1
stop();
Symbol 720 MovieClip Frame 1
stop();
this.onRollOver = function () {
this.gotoAndStop(2);
};
this.onRollOut = function () {
this.gotoAndStop(1);
};
this.onReleaseOutside = function () {
this.gotoAndStop(1);
};
Symbol 723 MovieClip Frame 1
stop();
this.onRollOver = function () {
this.gotoAndStop(2);
};
this.onRollOut = function () {
this.gotoAndStop(1);
};
this.onReleaseOutside = function () {
this.gotoAndStop(1);
};
Symbol 729 MovieClip Frame 1
this._parent._rotation = 180;
this._parent._parent.difficulty = 50;
_global.highScoreDiff = 50;
berekenDifficulty = function (mc) {
var _local5 = mc._parent;
var _local6 = _local5._parent;
w_x = _local5._x + _local6._x;
w_y = _local5._y + _local6._y;
var _local7 = Math.atan2(_root._ymouse - w_y, _root._xmouse - w_x);
var _local4 = (_local7 * 180) / Math.PI;
if ((_local4 < 35) && (_local4 > 0)) {
_local4 = 35;
} else if ((_local4 > -35) && (_local4 <= 0)) {
_local4 = -35;
}
var _local8 = 0.344827586206897;
_local5._rotation = _local4;
var _local3 = _local4;
((_local3 > 0) ? (_local3 = _local3 - 35) : (_local3 = _local3 + 35));
_local3 = _local3 * _local8;
if (_local3 < 0) {
_local3 = _local3 + 100;
}
_local3 = Math.floor(_local3);
if (_local3 == 0) {
((_local4 > 0) ? (_local3 = 1) : (_local3 = 100));
}
_local6.difficulty = Math.floor(_local3);
_global.highScoreDiff = 101 - Math.floor(_local3);
};
this.onPress = function () {
this.onEnterFrame = function () {
berekenDifficulty(this);
};
};
this.onRelease = (this.onReleaseOutside = function () {
delete this.onEnterFrame;
});
Symbol 731 MovieClip [mcControlCenter] Frame 1
stop();
Instance of Symbol 517 MovieClip in Symbol 731 MovieClip [mcControlCenter] Frame 1
//component parameters
onClipEvent (construct) {
wynume = "PlanetRacer";
wyculoare = 5987195 /* 0x5B5B7B */;
wyasezare = "Orizontal";
wyaliniere = "Centru";
wypozitie = "Sus";
wyinstructions = false;
}
Symbol 731 MovieClip [mcControlCenter] Frame 2
Selection.setFocus("name");
Symbol 750 MovieClip [startMessage] Frame 1
stop();
Symbol 757 MovieClip Frame 1
stop();
Symbol 790 MovieClip Frame 1
stop();
Instance of Symbol 304 MovieClip [FScrollBarSymbol] in Symbol 790 MovieClip Frame 7
//component parameters
onClipEvent (construct) {
_targetInstanceName = "";
horizontal = false;
}
Instance of Symbol 305 MovieClip [FUIComponentSymbol] in Symbol 790 MovieClip Frame 8
//component parameters
onClipEvent (construct) {
}
Symbol 795 MovieClip Frame 1
scroll1.setScrollProperties(130, 0, 220);
this.chHand1 = function () {
scoresScroll._y = -(scroll1.getScrollPosition() * 2);
};
scroll1.setChangeHandler("chHand1");
i = 1;
while (i <= 30) {
scoresScroll["n" + i].text = _root.monthnume[i];
scoresScroll["s" + i].text = _root.monthscor[i];
i++;
}
Symbol 802 Button
on (release) {
_root.gotoAndStop("coperta");
}
Symbol 1107 MovieClip Frame 1
scroll1.setScrollProperties(130, 0, 915);
this.chHand1 = function () {
scoresScroll._y = -(scroll1.getScrollPosition() * 2);
};
scroll1.setChangeHandler("chHand1");
q = 1;
while (q <= 100) {
scoresScroll["n" + q].text = _root.evernume[q];
scoresScroll["s" + q].text = _root.everscor[q];
q++;
}
Instance of Symbol 304 MovieClip [FScrollBarSymbol] "scroll1" in Symbol 1107 MovieClip Frame 1
//component parameters
onClipEvent (construct) {
_targetInstanceName = "";
horizontal = false;
}
Symbol 1113 Button
on (release) {
_root.gotoAndStop("coperta");
}
Symbol 1129 Button
on (release) {
i = 1;
while (i <= 100) {
if (_root.best > _root.monthscor[i]) {
k = 100;
while (k >= (i + 1)) {
_root.monthscor[k] = _root.monthscor[k - 1];
_root.monthnume[k] = _root.monthnume[k - 1];
k--;
}
_root.monthscor[i] = _root.best;
_root.monthnume[i] = _root.nickname;
i = 31;
}
i++;
}
i = 1;
while (i <= 100) {
if (_root.best > _root.everscor[i]) {
k = 100;
while (k >= (i + 1)) {
_root.everscor[k] = _root.everscor[k - 1];
_root.evernume[k] = _root.evernume[k - 1];
k--;
}
_root.everscor[i] = _root.best;
_root.evernume[i] = _root.nickname;
i = 31;
}
i++;
}
gotoAndPlay ("submit");
}
Symbol 1135 Button
on (release) {
_root.gotoAndStop("coperta");
}
Symbol 1139 MovieClip Frame 1
stop();
Symbol 1139 MovieClip Frame 9
stop();
Symbol 1139 MovieClip Frame 22
stop();
Symbol 1139 MovieClip Frame 34
var my_date = new Date();
codul = Math.round(my_date.getTime() / 1000) * _root.best;
cale = (((((("http://www.freeonlinegames.com/scoreboard/update.php?game=" + _root.gameid) + "&name=") + _root.nickname) + "&score=") + _root.best) + "&code=") + codul;
loadVariablesNum (cale, 0, "GET");
gotoAndPlay ("loop");
Symbol 1139 MovieClip Frame 45
if (_root.updated != 1) {
gotoAndPlay ("loop");
} else {
_root.best = 0;
_root.score = 0;
_root.xdada = 1;
_root.gotoAndPlay("submitScore");
}