Frame 1
copyright = "Copyright (c) 2005 by Yaroslav Yanovsky";
var plLoaded = false;
var plLoadState = (int((this.getBytesLoaded() / this.getBytesTotal()) * 100) + "%");
fscommand ("showmenu", false);
fscommand ("allowscale", false);
fscommand ("wmode", "opaque");
Frame 2
if (this.getBytesLoaded() < this.getBytesTotal()) {
gotoAndPlay ("load");
}
Frame 3
function adjustScore(value) {
_root.score = _root.score + value;
if (_root.score < 0) {
_root.score = 0;
}
}
function togglePause() {
if (paused) {
message.gotoAndPlay("unpaused");
} else {
message.gotoAndPlay("paused");
}
togglePauseSilent();
}
function togglePauseSilent() {
paused = !paused;
}
function getEncodedValue(v, key) {
var _local1 = (v ^ key).toString();
var _local4 = new Array();
_local4.push(key);
var _local2 = new Array();
i = 0;
while (i < _local1.length) {
_local2.push(_local1.charCodeAt(i) ^ key);
i++;
}
_local4.push(_local2.length ^ key);
_local4 = _local4.concat(_local2);
return(_local4.join(","));
}
function getScoreEncoded() {
var _local5 = random(16777215);
var _local4 = random(16777215);
while (_local4 == _local5) {
_local4 = random(16777215);
}
var _local3 = random(16777215);
while ((_local3 == _local5) || (_local3 == _local4)) {
_local3 = random(16777215);
}
var _local2 = random(16777215);
while (((_local2 == _local5) || (_local2 == _local4)) || (_local2 == _local3)) {
_local2 = random(16777215);
}
var _local6 = _root.numberofLevel + (_root.numberofLevels * _root.numberofGame);
return(new Array(getEncodedValue(_root.score, _local5), getEncodedValue(_local6, _local4), getEncodedValue(_root.score, _local3), getEncodedValue(_local6, _local2)));
}
function updateMouse() {
var _local3 = _root._xmouse;
var _local2 = _root._ymouse;
var _local4 = (((_local3 > 0) && (_local3 < 480)) && (_local2 > 0)) && (_local2 < 360);
if (_local4 != mouseInRect) {
if ((mouseInRect = _local4)) {
Mouse.hide();
cursor._visible = true;
} else {
Mouse.show();
cursor._visible = false;
}
}
cursor._x = _local3;
cursor._y = _local2;
}
function updateTitle() {
updateMouse();
}
function hideOffscreenStuff() {
ufo.gotoAndPlay("dead");
ufo2.gotoAndPlay("dead");
terran.gotoAndPlay("dead");
terran3.gotoAndPlay("dead");
mine.gotoAndPlay("dead");
mine2.gotoAndPlay("dead");
caskorange.gotoAndPlay("dead");
caskred.gotoAndPlay("dead");
caskyellow.gotoAndPlay("dead");
caskblue.gotoAndPlay("dead");
caskgreen.gotoAndPlay("dead");
box.gotoAndPlay("dead");
bullet1.gotoAndPlay("dead");
bullet2.gotoAndPlay("dead");
bullet3.gotoAndPlay("dead");
bullet4.gotoAndPlay("dead");
plasma.gotoAndPlay("dead");
aimsrc.gotoAndPlay("dead");
shiphpsrc.gotoAndPlay("dead");
shipxpsrc.gotoAndPlay("dead");
planethpsrc.gotoAndPlay("dead");
weaponsrc.gotoAndPlay("dead");
playersrc.gotoAndPlay("dead");
}
function upgradeNumberToName(num) {
switch (num) {
case 1 :
return("armor");
case 2 :
return("bulletspeed");
case 3 :
return("clipsize");
case 4 :
return("experience");
case 5 :
return("explosion");
case 6 :
return("reload");
case 7 :
return("repair");
case 8 :
return("shipspeed");
case 9 :
return("shotspeed");
}
}
function buildingNumberToName(num) {
switch (Number(num)) {
case 1 :
return("airport");
case 2 :
return("starport");
case 3 :
return("support1");
case 4 :
return("support2");
case 5 :
return("support3");
case 6 :
return("ship");
case 7 :
return("squadron");
case 8 :
return("powerplant");
case 9 :
return("mine");
}
}
function playSound(snd) {
if (_root.soundEnabled) {
_root.sound.gotoAndPlay(snd);
}
}
function playMusic(snd) {
if (_root.musicEnabled) {
stopAllSounds();
_root.sound.gotoAndPlay(snd);
}
}
var rootURL = "http://www.enkord.com/";
if (moreGamesURL == undefined) {
moreGamesURL = rootURL;
}
if (downloadURL == undefined) {
downloadURL = rootURL + "games/jamxm/download/";
}
if (orderURL == undefined) {
orderURL = rootURL + "product.php?action=order&product=jamxm&from=webversion";
}
if (hiscoreURL == undefined) {
hiscoreURL = rootURL + "games/jamxm/web/hiscore.php";
}
if (downloadPromotedURL == undefined) {
downloadPromotedURL = "http://www.enkord.com/games/clashnslash/";
}
var _r;
var paused = false;
var curscreen = "none";
var curweapon = 0;
aimsrc.duplicateMovieClip("cursor", 15000);
var mouseState = false;
var prevMouseState = false;
var gameInit = true;
var score = 0;
var difficulty = 0;
var musicEnabled = true;
var soundEnabled = true;
var NofPause = 5;
var numberofGame = 0;
var placeMin = 3;
var mouseInRect = ((((x > 0) && (x < 480)) && (y > 0)) && (y < 360));
if (mouseInRect) {
Mouse.hide();
}
hideOffscreenStuff();
cursor.gotoAndPlay("arrow");
Frame 4
playMusic("menumusic");
Frame 5
_quality = "high";
updateTitle();
_root.bg.gotoAndStop("space1");
play();
Frame 6
updateTitle();
gotoAndPlay ("titlerepeat");
Frame 7
function raceStarted(bool) {
rpaused._visible = false;
begining.nrace = "race " + numberofLevel;
var _local1 = 1;
while (_local1 <= numberofGame) {
begining.nrace = begining.nrace + "*";
_local1++;
}
begining._visible = bool;
}
function finishRace(Place) {
hero.money = hero.money + prize[Place];
qMoney = hero.money;
_quality = "HIGH";
var i = 0;
while (i <= 3) {
gst = eval ("game_st" + i);
gst.removeMovieClip();
i++;
}
if (Place <= placeMin) {
if (numberofLevel >= numberofLevels) {
completed();
} else {
numberofLevel++;
gotoAndPlay ("upgrade");
}
} else {
gameOver();
}
}
function completed() {
if (placeMin > 1) {
placeMin--;
}
gotoAndPlay ("complete");
}
function gameOver() {
gotoAndPlay ("gameover");
}
shop = new Object();
shop.plazma = [0, 2000, 2000, 5000, 5000, 5000, 5000, 5000];
shop.rocket = [0, 6000, 6000, 6000, 6000, 6000, 6000, 6000];
shop.oil = [0, 3500, 3500, 3500, 3500, 3500, 3500, 3500];
shop.mine = [0, 5000, 5000, 5000, 5000, 5000, 5000, 5000];
shop.armor = [0, 0, 6000, 8000, 10000];
shop.bumper = [0, 7000, 10000, 12000];
shop.motor = [0, 9000, 20000, 32000];
shop.spoiler = [0, 2000, 9000, 6000];
shop.handling = [0, 2000, 6000, 8000];
shop.wheels = [0, 5000, 8000];
armorNumberPlus = 3;
discriptions = new Object();
names = new Object();
names1 = "Plasma Rifle I";
names2 = "Plasma Rifle II";
names3 = "Plasma Rifle III";
names4 = "Plasma Rifle IV";
names5 = "Plasma Rifle V";
names6 = "Plasma Rifle VI";
names7 = "Plasma Rifle VII";
names.plazma = [0, names1, names2, names3, names4, names5, names6, names7];
discription1 = "Shoots plasma charges at very high speed but causes very little damage. Allows to shoot 1 charge";
discription2 = "A little bit improved plasma rifle that allows you to shoot 2 charges";
discription3 = "Same as basic plasma rifle but allows you to shoot 3 charges instead of 1";
discription4 = "Slightly improved version of plasma rifle shoots 4 charges at high speed but causes little damage";
discription5 = "Moderately improved plasma rifle allows eliminating your enemies with 5 hot plasma charges";
discription6 = "This plasma rifle was heavily modified to hold more charges. It allows you to shoot 6 times";
discription7 = "The ultimate plasma rifle allows to spit with plasma everywhere! 7 charges! Take It";
discriptions.plazma = [0, discription1, discription2, discription3, discription4, discription5, discription6, discription7];
names1 = "Light Rocket I";
names2 = "Light Rocket II";
names3 = "Light Rocket III";
names4 = "Light Rocket IV";
names5 = "Light Rocket V";
names6 = "Light Rocket VI";
names7 = "Light Rocket VII";
names.rocket = [0, names1, names2, names3, names4, names5, names6, names7];
discription1 = "Shoots light rockets";
discription2 = "Improved rocket system with two rockets";
discription3 = "Improved rocket system with three rockets instead of one";
discription4 = "Improved rocket system with four rockets";
discription5 = "Significantly improved rocket system with five rockets";
discription6 = "Heavily upgraded rocket system with six rockets";
discription7 = "Light rocket system with maximum upgrades and seven deadly rockets";
discriptions.rocket = [0, discription1, discription2, discription3, discription4, discription5, discription6, discription7];
names1 = "Oil Viper I";
names2 = "Oil Viper II";
names3 = "Oil Viper III";
names4 = "Oil Viper IV";
names5 = "Oil Viper V";
names6 = "Oil Viper VI";
names7 = "Oil Viper VII";
names.oil = [0, names1, names2, names3, names4, names5, names6, names7];
discription1 = "This system spills some oil on the ground behind you so opponents will slip and lose control over their cars";
discription2 = "Slightly improved version that will allow you to spill twice as much oil as the original";
discription3 = "Another upgrade will increase the amount of oil up to three times more than basic device delivers";
discription4 = "Moderately improved version of Oil Viper system has four oil charges";
discription5 = "Oil Viper increases its effectiveness five fold";
discription6 = "This is greatly improved Oil Viper system that will allow to spill up to six times more oil than basic model";
discription7 = "Oil Viper system with maximum upgrades and ability to hold seven oil charges";
discriptions.oil = [0, discription1, discription2, discription3, discription4, discription5, discription6, discription7];
names1 = "Spike Mine I";
names2 = "Spike Mine II";
names3 = "Spike Mine III";
names4 = "Spike Mine IV";
names5 = "Spike Mine V";
names6 = "Spike Mine VI";
names7 = "Spike Mine VII";
names.mine = [0, names1, names2, names3, names4, names5, names6, names7];
discription1 = "A big red mine that will explode deadly if someone accidentally collides with it";
discription2 = "Improved version allows you to plant two mines instead of one";
discription3 = "Even better version that allows you to plant three mines instead of one";
discription4 = "This upgrade for spike mines allows you to plant four mines";
discription5 = "More upgrades, more mines! This time you will have five mines. This is a thing you've been asking for, isn't it?";
discription6 = "Six mines instead of one. Each upgrade gives you one additional mine";
discription7 = "Ultimately upgraded spike mine system allows you to plant|as much as seven mines";
discriptions.mine = [0, discription1, discription2, discription3, discription4, discription5, discription6, discription7];
names1 = "Protector";
names2 = "Defender";
names3 = "TurtleShell";
names4 = "Thorn Barrier";
names.armor = [0, names1, names2, names3, names4];
discription1 = "This is very basic armor that adds minor protection to your car";
discription2 = "Improved version of Protector armor that provides twice as much defence";
discription3 = "High quality armor pack with very good protection capabilities. Use it and see your car survive much longer";
discription4 = "This is the best armor you will ever have. Made from the strongest material this armor basically eats damage";
discriptions.armor = [0, discription1, discription2, discription3, discription4];
names1 = "Vanguard Mark I";
names2 = "Tiger";
names3 = "Wall Crusher";
names.bumper = [0, names1, names2, names3];
discription1 = "Basic bumper. It provides no special protection against collisions";
discription2 = "Improved bumper model. It gives some protection against collisions and gives more impressive look to your car";
discription3 = "Are you qoing to crush some walls? With this bumper you can easily do so. It is made of solid titanium bars";
discriptions.bumper = [0, discription1, discription2, discription3];
names1 = "Buzzer SD";
names2 = "Battle Hammer";
names3 = "SuperCharger";
names.motor = [0, names1, names2, names3];
discription1 = "The very basic engine. It has low acceleration and low top speed";
discription2 = "Improved engine with higher acceleration and top speed parameters";
discription3 = "Wow! This engine will make you car roar like thunder and fly like lightning";
discriptions.motor = [0, discription1, discription2, discription3];
names1 = "Spoiler";
names2 = "Airjaw";
names3 = "Bat Wing";
names.spoiler = [0, names1, names2, names3];
discription1 = "This is first level of Spoiler";
discription2 = "Basic spoiler. It has mainly aesthetic purpose";
discription3 = "This spoiler is freaking cool! Even batman will burst with envy when you install it on your car";
discriptions.spoiler = [0, discription1, discription2, discription3];
names1 = "Safe drive";
names2 = "Hydrorider";
names3 = "Hydro Smoothpack";
names.handling = [0, names1, names2, names3];
discription1 = "Simpliest handling system. Designed for safe and easy driving";
discription2 = "Handling system for semi-racing vehicles";
discription3 = "Advanced handling system for racing cars. An item for professionals";
discriptions.handling = [0, discription1, discription2, discription3];
names1 = "Road Slaves";
names2 = "Power Racers";
names.wheels = [0, names1, names2];
discription1 = "The simpliest tires. Best suited for van, not for racing car";
discription2 = "The best racing solution you will ever find. Take them and watch your car drive very smooth";
discriptions.wheels = [0, discription1, discription2];
prize = [0, 5000, 3000, 2000, 0];
numberofLevels = 9;
level = new Array();
level[1] = new Object();
Line1 = "0,0,0,0,0,0,0,0,0,0,0,0;";
Line2 = "0,0,0,0,0,0,0,0,0,0,0,0;";
Line3 = "0,0,5,3,3,3,3,3,3,7,0,0;";
Line4 = "0,0,1,0,0,0,0,0,0,1,0,0;";
Line5 = "0,0,1,0,0,0,0,0,0,1,0,0;";
Line6 = "0,0,1,0,0,0,0,0,0,1,0,0;";
Line7 = "0,0,1,0,0,0,0,0,0,1,0,0;";
Line8 = "0,0,1,0,0,0,s,s,s,1,0,0;";
Line9 = "0,0,1,0,0,0,s,0,0,1,0,0;";
Line10 = "0,0,6,3,3,3,3,3,3,8,0,0;";
Line11 = "0,0,0,0,0,0,0,0,0,0,0,0;";
Line12 = "0,0,0,0,0,0,0,0,0,0,0,0;";
level[1].Grounds = ((((((((((Line1 + Line2) + Line3) + Line4) + Line5) + Line6) + Line7) + Line8) + Line9) + Line10) + Line11) + Line12;
Line1 = "0,0,0,0,0,0,0,0,0,0,0,0;";
Line2 = "0,0,0,0,0,0,0,0,0,0,0,0;";
Line3 = "0,0,3,3,3,3,3,3,3,2,0,0;";
Line4 = "0,0,1,0,0,0,0,0,0,2,0,0;";
Line5 = "0,0,1,0,0,0,0,0,0,2,0,0;";
Line6 = "0,0,1,0,0,0,0,0,0,2,0,0;";
Line7 = "0,0,1,0,0,0,0,0,0,2,0,0;";
Line8 = "0,0,1,0,0,0,0,0,0,2,0,0;";
Line9 = "0,0,1,0,0,0,0,0,0,2,0,0;";
Line10 = "0,0,1,4,4,4,4,4,4,4,0,0;";
Line11 = "0,0,0,0,0,0,0,0,0,0,0,0";
Line12 = "0,0,0,0,0,0,0,0,0,0,0,0";
level[1].Directions = ((((((((((Line1 + Line2) + Line3) + Line4) + Line5) + Line6) + Line7) + Line8) + Line9) + Line10) + Line11) + Line12;
Line1 = "0,0,0,0,0,0,0,0,0,0,0,0;";
Line2 = "0,0,0,0,0,0,0,0,0,0,0,0;";
Line3 = "0,0,3,S,1,1,1,1,1,1,0,0;";
Line4 = "0,0,1,0,0,0,0,0,0,4,0,0;";
Line5 = "0,0,3,0,0,0,0,0,0,4,0,0;";
Line6 = "0,0,3,0,0,0,0,0,0,4,0,0;";
Line7 = "0,0,3,0,0,0,0,0,0,4,0,0;";
Line8 = "0,0,3,0,0,0,0,0,h,4,0,0;";
Line9 = "0,0,3,0,0,0,0,0,0,4,0,0;";
Line10 = "0,0,2,2,2,2,2,2,2,4,0,0;";
Line11 = "0,0,0,0,0,0,0,0,0,0,0,0;";
Line12 = "0,0,0,0,0,0,0,0,0,0,0,0;";
level[1].Fitches = ((((((((((Line1 + Line2) + Line3) + Line4) + Line5) + Line6) + Line7) + Line8) + Line9) + Line10) + Line11) + Line12;
Line1 = "0,0,0,0,0,0,0,0,0,0,0,0;";
Line2 = "0,0,0,0,0,0,0,0,0,0,0,0;";
Line3 = "0,0,28,1,2,3,4,5,6,7,0,0;";
Line4 = "0,0,27,0,0,0,0,0,0,8,0,0;";
Line5 = "0,0,26,0,0,0,0,0,0,9,0,0;";
Line6 = "0,0,25,0,0,0,0,0,0,10,0,0;";
Line7 = "0,0,24,0,0,0,0,0,0,11,0,0;";
Line8 = "0,0,23,0,0,0,12,12,12,12,0,0;";
Line9 = "0,0,22,0,0,0,12,0,0,13,0,0;";
Line10 = "0,0,21,20,19,18,17,16,15,14,0,0;";
Line11 = "0,0,0,0,0,0,0,0,0,0,0,0;";
Line12 = "0,0,0,0,0,0,0,0,0,0,0,0;";
level[1].GroundsNumbers = ((((((((((Line1 + Line2) + Line3) + Line4) + Line5) + Line6) + Line7) + Line8) + Line9) + Line10) + Line11) + Line12;
level[1].locks = ["rocket", "mine", "motor", "bumper", "spoiler", "handling", "wheels"];
level[1].Cars = new Array();
var i = 0;
while (i <= 3) {
level[1].Cars[i] = new Object();
level[1].Cars[i].weaponNumber = 1;
level[1].Cars[i].weaponDefenseNumber = 1;
level[1].Cars[i].weaponDefenseUpgrade = 1;
level[1].Cars[i].weaponAttackUpgrade = 1;
level[1].Cars[i].bumperNumber = 1;
level[1].Cars[i].spoilerNumber = 1;
level[1].Cars[i].wheelsNumber = 1;
level[1].Cars[i].armorNumber = 1;
level[1].Cars[i].motorNumber = 1;
level[1].Cars[i].handlingNumber = 1;
level[1].Cars[i].money = 0;
level[1].Cars[i].speedFactor = 0.75;
level[1].Cars[i].weaponDefenseLevel = 0;
level[1].Cars[i].weaponAttackLevel = 0;
level[1].Cars[i].cornerFactor = 0;
i++;
}
Max = new Object();
Max = Level[1].Cars[1];
Bob = new Object();
Bob = Level[1].Cars[2];
Jack = new Object();
Jack = Level[1].Cars[3];
level[1].numberofOils0 = 0;
level[1].numberofMoney = 8;
level[1].numberofBMoney = 0;
level[1].numberofKits = 1;
level[1].numberofBKits = 0;
level[1].numberofMines0 = 2;
level[1].maxRoadNumber = 28;
level[1].maxLapsNumber = 2;
level[1].numberofXField = 12;
level[1].numberofYField = 12;
level[2] = new Object();
Line1 = "0,0,0,0,0,0,0,0,0,0,0,0;";
Line2 = "0,0,0,0,0,0,0,0,0,0,0,0;";
Line3 = "0,0,5,3,3,3,3,15,15,7,0,0;";
Line4 = "0,0,1,0,0,0,0,0,0,1,0,0;";
Line5 = "0,0,14,0,0,0,0,0,0,1,0,0;";
Line6 = "0,0,14,0,0,0,0,0,0,1,0,0;";
Line7 = "0,0,1,0,0,0,5,3,3,8,0,0;";
Line8 = "0,0,1,0,0,0,1,0,0,0,0,0;";
Line9 = "0,0,1,0,0,0,1,0,0,0,0,0;";
Line10 = "0,0,6,15,15,3,8,0,0,0,0,0;";
Line11 = "0,0,0,0,0,0,0,0,0,0,0,0;";
Line12 = "0,0,0,0,0,0,0,0,0,0,0,0;";
level[2].Grounds = ((((((((((Line1 + Line2) + Line3) + Line4) + Line5) + Line6) + Line7) + Line8) + Line9) + Line10) + Line11) + Line12;
Line1 = "0,0,0,0,0,0,0,0,0,0,0,0;";
Line2 = "0,0,0,0,0,0,0,0,0,0,0,0;";
Line3 = "0,0,3,3,3,3,3,3,3,2,0,0;";
Line4 = "0,0,1,0,0,0,0,0,0,2,0,0;";
Line5 = "0,0,1,0,0,0,0,0,0,2,0,0;";
Line6 = "0,0,1,0,0,0,0,0,0,2,0,0;";
Line7 = "0,0,1,0,0,0,4,4,4,4,0,0;";
Line8 = "0,0,1,0,0,0,2,0,0,0,0,0;";
Line9 = "0,0,1,0,0,0,2,0,0,0,0,0;";
Line10 = "0,0,1,4,4,4,4,0,0,0,0,0;";
Line11 = "0,0,0,0,0,0,0,0,0,0,0,0;";
Line12 = "0,0,0,0,0,0,0,0,0,0,0,0;";
level[2].Directions = ((((((((((Line1 + Line2) + Line3) + Line4) + Line5) + Line6) + Line7) + Line8) + Line9) + Line10) + Line11) + Line12;
Line1 = "0,0,0,0,0,0,0,0,0,0,0,0;";
Line2 = "0,0,0,0,0,0,0,0,0,0,0,0;";
Line3 = "0,0,3,3,S,3,3,3,3,2,0,0;";
Line4 = "0,0,1,0,0,0,0,0,0,2,0,0;";
Line5 = "0,0,f,0,0,0,0,0,0,f,0,0;";
Line6 = "0,0,1,0,0,0,0,0,0,2,0,0;";
Line7 = "0,0,1,0,0,0,4,4,4,4,0,0;";
Line8 = "0,0,f,0,0,0,2,0,0,0,0,0;";
Line9 = "0,0,1,0,0,0,2,0,0,0,0,0;";
Line10 = "0,0,1,4,e,4,4,0,0,0,0,0;";
Line11 = "0,0,0,0,0,0,0,0,0,0,0,0;";
Line12 = "0,0,0,0,0,0,0,0,0,0,0,0;";
level[2].Fitches = ((((((((((Line1 + Line2) + Line3) + Line4) + Line5) + Line6) + Line7) + Line8) + Line9) + Line10) + Line11) + Line12;
Line1 = "0,0,0,0,0,0,0,0,0,0,0,0;";
Line2 = "0,0,0,0,0,0,0,0,0,0,0,0;";
Line3 = "0,0,27,28,1,2,3,4,5,6,0,0;";
Line4 = "0,0,26,0,0,0,0,0,0,7,0,0;";
Line5 = "0,0,25,0,0,0,0,0,0,8,0,0;";
Line6 = "0,0,24,0,0,0,0,0,0,9,0,0;";
Line7 = "0,0,23,0,0,0,13,12,11,10,0,0;";
Line8 = "0,0,22,0,0,0,14,0,0,0,0,0;";
Line9 = "0,0,21,0,0,0,15,0,0,0,0,0;";
Line10 = "0,0,20,19,18,17,16,0,0,0,0,0;";
Line11 = "0,0,0,0,0,0,0,0,0,0,0,0;";
Line12 = "0,0,0,0,0,0,0,0,0,0,0,0;";
level[2].GroundsNumbers = ((((((((((Line1 + Line2) + Line3) + Line4) + Line5) + Line6) + Line7) + Line8) + Line9) + Line10) + Line11) + Line12;
level[2].locks = ["rocket", "mine", "motor", "bumper", "spoiler", "handling", "wheels"];
level[2].Cars = new Array();
Max = new Object();
Max.weaponNumber = 1;
Max.weaponDefenseNumber = 1;
Max.weaponDefenseUpgrade = 2;
Max.weaponAttackUpgrade = 1;
Max.bumperNumber = 1;
Max.spoilerNumber = 1;
Max.wheelsNumber = 1;
Max.armorNumber = 2;
Max.motorNumber = 1;
Max.handlingNumber = 1;
Max.speedFactor = 0.75;
Max.weaponDefenseLevel = 1;
Max.weaponAttackLevel = 0;
Max.cornerFactor = 0;
Bob = new Object();
Bob.weaponNumber = 1;
Bob.weaponDefenseNumber = 1;
Bob.weaponDefenseUpgrade = 1;
Bob.weaponAttackUpgrade = 2;
Bob.bumperNumber = 1;
Bob.spoilerNumber = 1;
Bob.wheelsNumber = 1;
Bob.armorNumber = 1;
Bob.motorNumber = 2;
Bob.handlingNumber = 1;
Bob.speedFactor = 0.75;
Bob.weaponDefenseLevel = 0;
Bob.weaponAttackLevel = 1;
Bob.cornerFactor = 0;
Jack = new Object();
Jack.weaponNumber = 1;
Jack.weaponDefenseNumber = 1;
Jack.weaponDefenseUpgrade = 1;
Jack.weaponAttackUpgrade = 1;
Jack.bumperNumber = 1;
Jack.spoilerNumber = 1;
Jack.wheelsNumber = 1;
Jack.armorNumber = 1;
Jack.motorNumber = 1;
Jack.handlingNumber = 1;
Jack.speedFactor = 0.8;
Jack.weaponDefenseLevel = 0;
Jack.weaponAttackLevel = 0;
Jack.cornerFactor = 1;
level[2].Cars[1] = Max;
level[2].Cars[2] = Bob;
level[2].Cars[3] = Jack;
level[2].numberofOils0 = 5;
level[2].numberofMoney = 4;
level[2].numberofBMoney = 1;
level[2].numberofKits = 5;
level[2].numberofBKits = 1;
level[2].numberofMines0 = 0;
level[2].maxRoadNumber = 28;
level[2].maxLapsNumber = 3;
level[2].numberofXField = 12;
level[2].numberofYField = 12;
level[3] = new Object();
Line1 = "0,0,0,0,0,0,0,0,0,0,0,0;";
Line2 = "0,0,0,0,0,0,0,0,0,0,0,0;";
Line3 = "0,0,0,0,0,0,5,3,3,7,0,0;";
Line4 = "0,0,0,0,0,0,1,0,0,1,0,0;";
Line5 = "0,0,0,0,0,0,1,0,0,1,0,0;";
Line6 = "0,0,5,3,3,3,13,3,3,8,0,0;";
Line7 = "0,0,1,0,0,0,1,0,0,0,0,0;";
Line8 = "0,0,1,0,0,0,1,0,0,0,0,0;";
Line9 = "0,0,1,0,0,0,1,0,0,0,0,0;";
Line10 = "0,0,6,3,3,3,8,0,0,0,0,0;";
Line11 = "0,0,0,0,0,0,0,0,0,0,0,0;";
Line12 = "0,0,0,0,0,0,0,0,0,0,0,0;";
level[3].Grounds = ((((((((((Line1 + Line2) + Line3) + Line4) + Line5) + Line6) + Line7) + Line8) + Line9) + Line10) + Line11) + Line12;
Line1 = "0,0,0,0,0,0,0,0,0,0,0,0;";
Line2 = "0,0,0,0,0,0,0,0,0,0,0,0;";
Line3 = "0,0,0,0,0,0,2,4,4,4,0,0;";
Line4 = "0,0,0,0,0,0,2,0,0,1,0,0;";
Line5 = "0,0,0,0,0,0,2,0,0,1,0,0;";
Line6 = "0,0,3,3,3,3,3,3,3,1,0,0;";
Line7 = "0,0,1,0,0,0,2,0,0,0,0,0;";
Line8 = "0,0,1,0,0,0,2,0,0,0,0,0;";
Line9 = "0,0,1,0,0,0,2,0,0,0,0,0;";
Line10 = "0,0,1,4,4,4,4,0,0,0,0,0;";
Line11 = "0,0,0,0,0,0,0,0,0,0,0,0;";
Line12 = "0,0,0,0,0,0,0,0,0,0,0,0;";
level[3].Directions = ((((((((((Line1 + Line2) + Line3) + Line4) + Line5) + Line6) + Line7) + Line8) + Line9) + Line10) + Line11) + Line12;
Line1 = "0,0,0,0,0,0,0,0,0,0,0,0;";
Line2 = "0,0,0,0,0,0,0,0,G,0,0,0;";
Line3 = "0,0,0,0,0,0,2,4,4,4,0,0;";
Line4 = "0,0,0,0,0,0,2,0,E,1,0,0;";
Line5 = "0,0,0,G,G,0,f,0,0,1,H,0;";
Line6 = "0,0,1,3,S,3,AB,3,3,1,H,0;";
Line7 = "0,F,1,0,0,0,2,0,0,0,0,0;";
Line8 = "0,F,1,H,0,0,2,0,0,0,0,0;";
Line9 = "0,0,1,H,0,0,2,H,0,0,0,0;";
Line10 = "0,0,1,4,4,4,4,0,0,0,0,0;";
Line11 = "0,0,0,0,0,E,0,0,0,0,0,0;";
Line12 = "0,0,0,0,0,0,0,0,0,0,0,0;";
level[3].Fitches = ((((((((((Line1 + Line2) + Line3) + Line4) + Line5) + Line6) + Line7) + Line8) + Line9) + Line10) + Line11) + Line12;
Line1 = "0,0,0,0,0,0,0,0,0,0,0,0;";
Line2 = "0,0,0,0,0,0,0,0,0,0,0,0;";
Line3 = "0,0,0,0,0,0,12,11,10,9,0,0;";
Line4 = "0,0,0,0,0,0,13,0,0,8,0,0;";
Line5 = "0,0,0,0,0,0,14,0,0,7,0,0;";
Line6 = "0,0,26,27,1,2,3,4,5,6,0,0;";
Line7 = "0,0,25,0,0,0,15,0,0,0,0,0;";
Line8 = "0,0,24,0,0,0,16,0,0,0,0,0;";
Line9 = "0,0,23,0,0,0,17,0,0,0,0,0;";
Line10 = "0,0,22,21,20,19,18,0,0,0,0,0;";
Line11 = "0,0,0,0,0,0,0,0,0,0,0,0;";
Line12 = "0,0,0,0,0,0,0,0,0,0,0,0;";
level[3].GroundsNumbers = ((((((((((Line1 + Line2) + Line3) + Line4) + Line5) + Line6) + Line7) + Line8) + Line9) + Line10) + Line11) + Line12;
level[3].locks = ["rocket", "mine", "motor", "bumper", "handling", "wheels"];
level[3].Cars = new Array();
Max = new Object();
Max.weaponNumber = 1;
Max.weaponDefenseNumber = 1;
Max.weaponDefenseUpgrade = 2;
Max.weaponAttackUpgrade = 1;
Max.bumperNumber = 1;
Max.spoilerNumber = 1;
Max.wheelsNumber = 1;
Max.armorNumber = 2;
Max.motorNumber = 1;
Max.handlingNumber = 1;
Max.speedFactor = 0.75;
Max.weaponDefenseLevel = 1;
Max.weaponAttackLevel = 1;
Max.cornerFactor = 0;
Bob = new Object();
Bob.weaponNumber = 1;
Bob.weaponDefenseNumber = 2;
Bob.weaponDefenseUpgrade = 1;
Bob.weaponAttackUpgrade = 2;
Bob.bumperNumber = 1;
Bob.spoilerNumber = 2;
Bob.wheelsNumber = 1;
Bob.armorNumber = 1;
Bob.motorNumber = 1;
Bob.handlingNumber = 1;
Bob.speedFactor = 0.75;
Bob.weaponDefenseLevel = 1;
Bob.weaponAttackLevel = 1;
Bob.cornerFactor = 0;
Jack = new Object();
Jack.weaponNumber = 1;
Jack.weaponDefenseNumber = 1;
Jack.weaponDefenseUpgrade = 1;
Jack.weaponAttackUpgrade = 1;
Jack.bumperNumber = 1;
Jack.spoilerNumber = 1;
Jack.wheelsNumber = 1;
Jack.armorNumber = 1;
Jack.motorNumber = 1;
Jack.handlingNumber = 1;
Jack.speedFactor = 0.8;
Jack.weaponDefenseLevel = 1;
Jack.weaponAttackLevel = 1;
Jack.cornerFactor = 1;
level[3].Cars[1] = Max;
level[3].Cars[2] = Bob;
level[3].Cars[3] = Jack;
level[3].numberofOils0 = 5;
level[3].numberofMoney = 4;
level[3].numberofBMoney = 1;
level[3].numberofKits = 5;
level[3].numberofBKits = 1;
level[3].numberofMines0 = 0;
level[3].maxRoadNumber = 27;
level[3].maxLapsNumber = 4;
level[3].numberofXField = 12;
level[3].numberofYField = 12;
level[4] = new Object();
Line1 = "0,0,0,0,0,0,0,0,0,0,0,0;";
Line2 = "0,0,0,0,0,0,0,0,0,0,0,0;";
Line3 = "0,0,0,0,0,5,3,3,3,7,0,0;";
Line4 = "0,0,0,0,0,1,0,0,0,1,0,0;";
Line5 = "0,0,5,3,3,8,0,0,0,1,0,0;";
Line6 = "0,0,1,0,0,0,0,0,0,1,0,0;";
Line7 = "0,0,1,0,0,0,0,0,0,1,0,0;";
Line8 = "0,0,6,3,3,7,s,s,s,1,0,0;";
Line9 = "0,0,0,0,0,1,0,0,0,1,0,0;";
Line10 = "0,0,0,0,0,6,3,3,3,8,0,0;";
Line11 = "0,0,0,0,0,0,0,0,0,0,0,0;";
Line12 = "0,0,0,0,0,0,0,0,0,0,0,0;";
level[4].Grounds = ((((((((((Line1 + Line2) + Line3) + Line4) + Line5) + Line6) + Line7) + Line8) + Line9) + Line10) + Line11) + Line12;
Line1 = "0,0,0,0,0,0,0,0,0,0,0,0;";
Line2 = "0,0,0,0,0,0,0,0,0,0,0,0;";
Line3 = "0,0,0,0,0,3,3,3,3,2,0,0;";
Line4 = "0,0,0,0,0,1,0,0,0,2,0,0;";
Line5 = "0,0,3,3,3,1,0,0,0,2,0,0;";
Line6 = "0,0,1,0,0,0,0,0,0,2,0,0;";
Line7 = "0,0,1,0,0,0,0,0,0,2,0,0;";
Line8 = "0,0,1,4,4,4,0,0,0,2,0,0;";
Line9 = "0,0,0,0,0,1,0,0,0,2,0,0;";
Line10 = "0,0,0,0,0,1,4,4,4,4,0,0;";
Line11 = "0,0,0,0,0,0,0,0,0,0,0,0;";
Line12 = "0,0,0,0,0,0,0,0,0,0,0,0;";
level[4].Directions = ((((((((((Line1 + Line2) + Line3) + Line4) + Line5) + Line6) + Line7) + Line8) + Line9) + Line10) + Line11) + Line12;
Line1 = "0,0,0,0,0,0,0,0,0,0,0,0;";
Line2 = "0,0,0,0,0,0,0,0,0,0,0,0;";
Line3 = "0,0,0,0,0,5,e,3,3,7,0,0;";
Line4 = "0,0,0,0,0,1,0,0,0,1,0,0;";
Line5 = "0,0,5,S,3,8,0,0,0,1,0,0;";
Line6 = "0,0,f,0,0,0,0,0,0,C,0,0;";
Line7 = "0,0,1,0,0,0,0,0,0,1,0,0;";
Line8 = "0,0,6,3,i,7,l,0,n,1,0,0;";
Line9 = "0,0,0,0,0,1,0,0,0,1,0,0;";
Line10 = "0,0,0,0,0,6,3,3,3,8,0,0;";
Line11 = "0,0,0,0,0,0,0,0,0,0,0,0;";
Line12 = "0,0,0,0,0,0,0,0,0,0,0,0;";
level[4].Fitches = ((((((((((Line1 + Line2) + Line3) + Line4) + Line5) + Line6) + Line7) + Line8) + Line9) + Line10) + Line11) + Line12;
Line1 = "0,0,0,0,0,0,0,0,0,0,0,0;";
Line2 = "0,0,0,0,0,0,0,0,0,0,0,0;";
Line3 = "0,0,0,0,0,5,6,7,8,9,0,0;";
Line4 = "0,0,0,0,0,4,0,0,0,10,0,0;";
Line5 = "0,0,28,1,2,3,0,0,0,11,0,0;";
Line6 = "0,0,27,0,0,0,0,0,0,12,0,0;";
Line7 = "0,0,26,0,0,0,0,0,0,13,0,0;";
Line8 = "0,0,25,24,23,22,14,14,14,14,0,0;";
Line9 = "0,0,0,0,0,21,0,0,0,15,0,0;";
Line10 = "0,0,0,0,0,20,19,18,17,16,0,0;";
Line11 = "0,0,0,0,0,0,0,0,0,0,0,0;";
Line12 = "0,0,0,0,0,0,0,0,0,0,0,0;";
level[4].GroundsNumbers = ((((((((((Line1 + Line2) + Line3) + Line4) + Line5) + Line6) + Line7) + Line8) + Line9) + Line10) + Line11) + Line12;
level[4].locks = ["mine", "motor", "bumper", "handling", "wheels"];
level[4].Cars = new Array();
Max = new Object();
Max.weaponNumber = 1;
Max.weaponDefenseNumber = 1;
Max.weaponDefenseUpgrade = 3;
Max.weaponAttackUpgrade = 2;
Max.bumperNumber = 1;
Max.spoilerNumber = 1;
Max.wheelsNumber = 1;
Max.armorNumber = 2;
Max.motorNumber = 1;
Max.handlingNumber = 1;
Max.speedFactor = 0.75;
Max.weaponDefenseLevel = 1;
Max.weaponAttackLevel = 1;
Max.cornerFactor = 0;
Bob = new Object();
Bob.weaponNumber = 1;
Bob.weaponDefenseNumber = 2;
Bob.weaponDefenseUpgrade = 1;
Bob.weaponAttackUpgrade = 2;
Bob.bumperNumber = 1;
Bob.spoilerNumber = 2;
Bob.wheelsNumber = 1;
Bob.armorNumber = 1;
Bob.motorNumber = 1;
Bob.handlingNumber = 1;
Bob.speedFactor = 0.75;
Bob.weaponDefenseLevel = 1;
Bob.weaponAttackLevel = 1;
Bob.cornerFactor = 1;
Jack = new Object();
Jack.weaponNumber = 1;
Jack.weaponDefenseNumber = 1;
Jack.weaponDefenseUpgrade = 1;
Jack.weaponAttackUpgrade = 1;
Jack.bumperNumber = 1;
Jack.spoilerNumber = 1;
Jack.wheelsNumber = 1;
Jack.armorNumber = 1;
Jack.motorNumber = 1;
Jack.handlingNumber = 2;
Jack.speedFactor = 0.8;
Jack.weaponDefenseLevel = 1;
Jack.weaponAttackLevel = 1;
Jack.cornerFactor = 1;
level[4].Cars[1] = Max;
level[4].Cars[2] = Bob;
level[4].Cars[3] = Jack;
level[4].numberofOils0 = 0;
level[4].numberofMoney = 4;
level[4].numberofBMoney = 1;
level[4].numberofKits = 5;
level[4].numberofBKits = 1;
level[4].numberofMines0 = 10;
level[4].maxRoadNumber = 28;
level[4].maxLapsNumber = 4;
level[4].numberofXField = 12;
level[4].numberofYField = 12;
level[5] = new Object();
Line1 = "0,0,0,0,0,0,0,0,0,0,0,0;";
Line2 = "0,0,0,0,0,0,0,0,0,0,0,0;";
Line3 = "0,0,5,3,3,11,3,3,3,7,0,0;";
Line4 = "0,0,1,0,0,1,0,0,0,1,0,0;";
Line5 = "0,0,1,0,0,1,s,s,0,1,0,0;";
Line6 = "0,0,1,0,0,1,0,s,0,1,0,0;";
Line7 = "0,0,1,0,0,1,0,s,0,1,0,0;";
Line8 = "0,0,9,3,3,8,0,s,s,1,0,0;";
Line9 = "0,0,1,0,0,0,0,0,0,1,0,0;";
Line10 = "0,0,6,3,3,3,3,3,3,8,0,0;";
Line11 = "0,0,0,0,0,0,0,0,0,0,0,0;";
Line12 = "0,0,0,0,0,0,0,0,0,0,0,0;";
level[5].Grounds = ((((((((((Line1 + Line2) + Line3) + Line4) + Line5) + Line6) + Line7) + Line8) + Line9) + Line10) + Line11) + Line12;
Line1 = "0,0,0,0,0,0,0,0,0,0,0,0;";
Line2 = "0,0,0,0,0,0,0,0,0,0,0,0;";
Line3 = "0,0,5,3,3,3,3,3,3,2,0,0;";
Line4 = "0,0,1,0,0,1,0,0,0,2,0,0;";
Line5 = "0,0,1,0,0,1,s,s,0,2,0,0;";
Line6 = "0,0,1,0,0,1,0,s,0,2,0,0;";
Line7 = "0,0,1,0,0,1,0,s,0,2,0,0;";
Line8 = "0,0,1,3,3,1,0,s,s,2,0,0;";
Line9 = "0,0,1,0,0,0,0,0,0,2,0,0;";
Line10 = "0,0,1,4,4,4,4,4,4,4,0,0;";
Line11 = "0,0,0,0,0,0,0,0,0,0,0,0;";
Line12 = "0,0,0,0,0,0,0,0,0,0,0,0;";
level[5].Directions = ((((((((((Line1 + Line2) + Line3) + Line4) + Line5) + Line6) + Line7) + Line8) + Line9) + Line10) + Line11) + Line12;
Line1 = "0,0,0,0,0,0,0,0,0,0,0,0;";
Line2 = "0,0,0,0,0,0,0,0,0,0,0,0;";
Line3 = "0,0,0,0,0,Ab,0,0,0,0,0,0;";
Line4 = "0,I,J,K,I,J,K,0,0,0,0,0;";
Line5 = "0,0,0,0,0,h,l,O,0,e,0,0;";
Line6 = "0,0,0,0,0,0,0,P,0,0,0,0;";
Line7 = "0,I,J,K,I,J,K,O,0,0,0,0;";
Line8 = "0,0,0,0,0,0,0,0,h,0,0,0;";
Line9 = "0,0,0,0,0,0,0,0,0,0,0,0;";
Line10 = "0,0,d,0,0,g,0,g,S,0,0,0;";
Line11 = "0,0,0,0,0,0,0,0,0,0,0,0;";
Line12 = "0,0,0,0,0,0,0,0,0,0,0,0;";
level[5].Fitches = ((((((((((Line1 + Line2) + Line3) + Line4) + Line5) + Line6) + Line7) + Line8) + Line9) + Line10) + Line11) + Line12;
Line1 = "0,0,0,0,0,0,0,0,0,0,0,0;";
Line2 = "0,0,0,0,0,0,0,0,0,0,0,0;";
Line3 = "0,0,14,15,16,17,18,19,20,21,0,0;";
Line4 = "0,0,13,0,0,9,0,0,0,22,0,0;";
Line5 = "0,0,12,0,0,9,9,9,0,23,0,0;";
Line6 = "0,0,11,0,0,9,0,9,0,24,0,0;";
Line7 = "0,0,10,0,0,9,0,9,0,25,0,0;";
Line8 = "0,0,9,9,9,9,0,9,9,26,0,0;";
Line9 = "0,0,8,0,0,0,0,0,0,27,0,0;";
Line10 = "0,0,7,6,5,4,3,2,1,28,0,0;";
Line11 = "0,0,0,0,0,0,0,0,0,0,0,0;";
Line12 = "0,0,0,0,0,0,0,0,0,0,0,0;";
level[5].GroundsNumbers = ((((((((((Line1 + Line2) + Line3) + Line4) + Line5) + Line6) + Line7) + Line8) + Line9) + Line10) + Line11) + Line12;
level[5].locks = ["mine", "motor", "handling", "wheels"];
level[5].Cars = new Array();
Max = new Object();
Max.weaponNumber = 1;
Max.weaponDefenseNumber = 1;
Max.weaponDefenseUpgrade = 3;
Max.weaponAttackUpgrade = 2;
Max.bumperNumber = 2;
Max.spoilerNumber = 1;
Max.wheelsNumber = 1;
Max.armorNumber = 2;
Max.motorNumber = 1;
Max.handlingNumber = 1;
Max.speedFactor = 0.75;
Max.weaponDefenseLevel = 1;
Max.weaponAttackLevel = 1;
Max.cornerFactor = 0;
Bob = new Object();
Bob.weaponNumber = 1;
Bob.weaponDefenseNumber = 2;
Bob.weaponDefenseUpgrade = 1;
Bob.weaponAttackUpgrade = 2;
Bob.bumperNumber = 1;
Bob.spoilerNumber = 2;
Bob.wheelsNumber = 1;
Bob.armorNumber = 1;
Bob.motorNumber = 1;
Bob.handlingNumber = 1;
Bob.speedFactor = 0.8;
Bob.weaponDefenseLevel = 1;
Bob.weaponAttackLevel = 1;
Bob.cornerFactor = 0;
Jack = new Object();
Jack.weaponNumber = 1;
Jack.weaponDefenseNumber = 1;
Jack.weaponDefenseUpgrade = 1;
Jack.weaponAttackUpgrade = 1;
Jack.bumperNumber = 1;
Jack.spoilerNumber = 1;
Jack.wheelsNumber = 1;
Jack.armorNumber = 1;
Jack.motorNumber = 1;
Jack.handlingNumber = 2;
Jack.speedFactor = 0.8;
Jack.weaponDefenseLevel = 1;
Jack.weaponAttackLevel = 1;
Jack.cornerFactor = 2;
level[5].Cars[1] = Max;
level[5].Cars[2] = Bob;
level[5].Cars[3] = Jack;
level[5].numberofOils0 = 0;
level[5].numberofMoney = 4;
level[5].numberofBMoney = 1;
level[5].numberofKits = 5;
level[5].numberofBKits = 1;
level[5].numberofMines0 = 10;
level[5].maxRoadNumber = 28;
level[5].maxLapsNumber = 4;
level[5].numberofXField = 12;
level[5].numberofYField = 12;
level[6] = new Object();
Line1 = "0,0,0,0,0,0,0,0,0,0,0,0;";
Line2 = "0,0,0,0,0,0,0,0,0,0,0,0;";
Line3 = "0,0,5,3,3,3,3,3,3,7,0,0;";
Line4 = "0,0,21,0,0,0,0,0,0,1,0,0;";
Line5 = "0,0,20,0,5,16,17,18,3,8,0,0;";
Line6 = "0,0,20,0,1,0,0,0,s,0,0,0;";
Line7 = "0,0,20,0,1,s,s,s,s,0,0,0;";
Line8 = "0,0,20,0,1,0,s,0,0,0,0,0;";
Line9 = "0,0,19,0,1,s,s,0,0,0,0,0;";
Line10 = "0,0,6,3,8,0,0,0,0,0,0,0;";
Line11 = "0,0,0,0,0,0,0,0,0,0,0,0;";
Line12 = "0,0,0,0,0,0,0,0,0,0,0,0;";
level[6].Grounds = ((((((((((Line1 + Line2) + Line3) + Line4) + Line5) + Line6) + Line7) + Line8) + Line9) + Line10) + Line11) + Line12;
Line1 = "0,0,0,0,0,0,0,0,0,0,0,0;";
Line2 = "0,0,0,0,0,0,0,0,0,0,0,0;";
Line3 = "0,0,3,3,3,3,3,3,3,2,0,0;";
Line4 = "0,0,1,0,0,0,0,0,0,2,0,0;";
Line5 = "0,0,1,0,2,4,4,4,4,4,0,0;";
Line6 = "0,0,1,0,2,0,0,0,2,0,0,0;";
Line7 = "0,0,1,0,2,4,2,4,2,0,0,0;";
Line8 = "0,0,1,0,2,0,2,0,0,0,0,0;";
Line9 = "0,0,1,0,2,4,4,0,0,0,0,0;";
Line10 = "0,0,1,4,4,0,0,0,0,0,0,0;";
Line11 = "0,0,0,0,0,0,0,0,0,0,0,0;";
Line12 = "0,0,0,0,0,0,0,0,0,0,0,0;";
level[6].Directions = ((((((((((Line1 + Line2) + Line3) + Line4) + Line5) + Line6) + Line7) + Line8) + Line9) + Line10) + Line11) + Line12;
Line1 = "0,0,0,0,0,0,0,0,0,0,0,0;";
Line2 = "0,0,0,0,0,0,0,0,0,0,0,0;";
Line3 = "0,0,0,0,0,S,0,e,0,0,0,0;";
Line4 = "0,0,f,0,0,0,0,0,0,0,0,0;";
Line5 = "0,0,0,0,0,0,0,0,0,0,0,0;";
Line6 = "0,0,0,0,0,0,0,0,i,0,0,0;";
Line7 = "0,0,0,0,0,l,0,0,0,0,0,0;";
Line8 = "0,0,0,0,0,0,e,0,0,0,0,0;";
Line9 = "0,0,f,0,0,l,0,0,0,0,0,0;";
Line10 = "0,0,0,0,0,0,0,0,0,0,0,0;";
Line11 = "0,0,0,0,0,0,0,0,0,0,0,0;";
Line12 = "0,0,0,0,0,0,0,0,0,0,0,0;";
level[6].Fitches = ((((((((((Line1 + Line2) + Line3) + Line4) + Line5) + Line6) + Line7) + Line8) + Line9) + Line10) + Line11) + Line12;
Line1 = "0,0,0,0,0,0,0,0,0,0,0,0;";
Line2 = "0,0,0,0,0,0,0,0,0,0,0,0;";
Line3 = "0,0,26,27,28,1,2,3,4,5,0,0;";
Line4 = "0,0,25,0,0,0,0,0,0,6,0,0;";
Line5 = "0,0,24,0,12,11,10,9,8,7,0,0;";
Line6 = "0,0,23,0,13,0,0,0,8,0,0,0;";
Line7 = "0,0,22,0,14,8,8,8,8,0,0,0;";
Line8 = "0,0,21,0,15,0,8,0,0,0,0,0;";
Line9 = "0,0,20,0,16,8,8,0,0,0,0,0;";
Line10 = "0,0,19,18,17,0,0,0,0,0,0,0;";
Line11 = "0,0,0,0,0,0,0,0,0,0,0,0;";
Line12 = "0,0,0,0,0,0,0,0,0,0,0,0;";
level[6].GroundsNumbers = ((((((((((Line1 + Line2) + Line3) + Line4) + Line5) + Line6) + Line7) + Line8) + Line9) + Line10) + Line11) + Line12;
level[6].locks = ["motor", "handling", "wheels"];
level[6].Cars = new Array();
Max = new Object();
Max.weaponNumber = 1;
Max.weaponDefenseNumber = 1;
Max.weaponDefenseUpgrade = 3;
Max.weaponAttackUpgrade = 2;
Max.bumperNumber = 2;
Max.spoilerNumber = 1;
Max.wheelsNumber = 1;
Max.armorNumber = 2;
Max.motorNumber = 1;
Max.handlingNumber = 1;
Max.speedFactor = 0.75;
Max.weaponDefenseLevel = 1;
Max.weaponAttackLevel = 1;
Max.cornerFactor = 1;
Bob = new Object();
Bob.weaponNumber = 2;
Bob.weaponDefenseNumber = 2;
Bob.weaponDefenseUpgrade = 1;
Bob.weaponAttackUpgrade = 2;
Bob.bumperNumber = 1;
Bob.spoilerNumber = 2;
Bob.wheelsNumber = 1;
Bob.armorNumber = 1;
Bob.motorNumber = 1;
Bob.handlingNumber = 1;
Bob.speedFactor = 0.8;
Bob.weaponDefenseLevel = 1;
Bob.weaponAttackLevel = 2;
Bob.cornerFactor = 1;
Jack = new Object();
Jack.weaponNumber = 1;
Jack.weaponDefenseNumber = 1;
Jack.weaponDefenseUpgrade = 1;
Jack.weaponAttackUpgrade = 1;
Jack.bumperNumber = 1;
Jack.spoilerNumber = 2;
Jack.wheelsNumber = 1;
Jack.armorNumber = 1;
Jack.motorNumber = 1;
Jack.handlingNumber = 2;
Jack.speedFactor = 0.8;
Jack.weaponDefenseLevel = 1;
Jack.weaponAttackLevel = 1;
Jack.cornerFactor = 2;
level[6].Cars[1] = Max;
level[6].Cars[2] = Bob;
level[6].Cars[3] = Jack;
level[6].numberofOils0 = 0;
level[6].numberofMoney = 4;
level[6].numberofBMoney = 1;
level[6].numberofKits = 5;
level[6].numberofBKits = 1;
level[6].numberofMines0 = 10;
level[6].maxRoadNumber = 28;
level[6].maxLapsNumber = 3;
level[6].numberofXField = 12;
level[6].numberofYField = 12;
level[7] = new Object();
Line1 = "0,0,0,0,0,0,0,0,0,0,0,0;";
Line2 = "0,0,0,0,0,0,0,0,0,0,0,0;";
Line3 = "0,0,0,5,3,3,3,3,7,0,0,0;";
Line4 = "0,0,5,8,0,0,0,0,6,7,0,0;";
Line5 = "0,0,1,0,0,0,0,0,0,1,0,0;";
Line6 = "0,0,1,0,0,0,0,0,0,1,0,0;";
Line7 = "0,0,1,0,0,0,0,0,0,1,0,0;";
Line8 = "0,0,1,0,0,0,0,0,0,1,0,0;";
Line9 = "0,0,6,7,0,0,0,0,5,8,0,0;";
Line10 = "0,0,0,6,3,3,3,3,8,0,0,0;";
Line11 = "0,0,0,0,0,0,0,0,0,0,0,0;";
Line12 = "0,0,0,0,0,0,0,0,0,0,0,0;";
level[7].Grounds = ((((((((((Line1 + Line2) + Line3) + Line4) + Line5) + Line6) + Line7) + Line8) + Line9) + Line10) + Line11) + Line12;
Line1 = "0,0,0,0,0,0,0,0,0,0,0,0;";
Line2 = "0,0,0,0,0,0,0,0,0,0,0,0;";
Line3 = "0,0,0,3,3,3,3,3,2,0,0,0;";
Line4 = "0,0,3,1,0,0,0,0,3,2,0,0;";
Line5 = "0,0,1,0,0,0,0,0,0,2,0,0;";
Line6 = "0,0,1,0,0,0,0,0,0,2,0,0;";
Line7 = "0,0,1,0,0,0,0,0,0,2,0,0;";
Line8 = "0,0,1,0,0,0,0,0,0,2,0,0;";
Line9 = "0,0,1,4,0,0,0,0,2,4,0,0;";
Line10 = "0,0,0,1,4,4,4,4,4,0,0,0;";
Line11 = "0,0,0,0,0,0,0,0,0,0,0,0;";
Line12 = "0,0,0,0,0,0,0,0,0,0,0,0;";
level[7].Directions = ((((((((((Line1 + Line2) + Line3) + Line4) + Line5) + Line6) + Line7) + Line8) + Line9) + Line10) + Line11) + Line12;
Line1 = "0,0,0,0,0,0,0,0,0,0,0,0;";
Line2 = "0,0,0,0,0,0,0,0,0,0,0,0;";
Line3 = "0,0,0,a,0,S,0,0,b,0,0,0;";
Line4 = "0,0,a,0,0,0,0,0,0,b,0,0;";
Line5 = "0,0,0,0,0,0,0,0,0,0,0,0;";
Line6 = "0,0,0,0,0,0,0,0,0,0,0,0;";
Line7 = "0,0,0,0,0,0,0,0,0,0,0,0;";
Line8 = "0,0,0,0,0,0,0,0,0,0,0,0;";
Line9 = "0,0,d,0,0,0,0,0,0,c,0,0;";
Line10 = "0,0,0,d,0,0,0,0,c,0,0,0;";
Line11 = "0,0,0,0,0,0,0,0,0,0,0,0;";
Line12 = "0,0,0,0,0,0,0,0,0,0,0,0;";
level[7].Fitches = ((((((((((Line1 + Line2) + Line3) + Line4) + Line5) + Line6) + Line7) + Line8) + Line9) + Line10) + Line11) + Line12;
Line1 = "0,0,0,0,0,0,0,0,0,0,0,0;";
Line2 = "0,0,0,0,0,0,0,0,0,0,0,0;";
Line3 = "0,0,0,27,28,1,2,3,4,0,0,0;";
Line4 = "0,0,25,26,0,0,0,0,5,6,0,0;";
Line5 = "0,0,24,0,0,0,0,0,0,7,0,0;";
Line6 = "0,0,23,0,0,0,0,0,0,8,0,0;";
Line7 = "0,0,22,0,0,0,0,0,0,9,0,0;";
Line8 = "0,0,21,0,0,0,0,0,0,10,0,0;";
Line9 = "0,0,20,19,0,0,0,0,12,11,0,0;";
Line10 = "0,0,0,18,17,16,15,14,13,0,0,0;";
Line11 = "0,0,0,0,0,0,0,0,0,0,0,0;";
Line12 = "0,0,0,0,0,0,0,0,0,0,0,0;";
level[7].GroundsNumbers = ((((((((((Line1 + Line2) + Line3) + Line4) + Line5) + Line6) + Line7) + Line8) + Line9) + Line10) + Line11) + Line12;
level[7].locks = ["motor", "handling"];
level[7].Cars = new Array();
Max = new Object();
Max.weaponNumber = 1;
Max.weaponDefenseNumber = 1;
Max.weaponDefenseUpgrade = 3;
Max.weaponAttackUpgrade = 2;
Max.bumperNumber = 2;
Max.spoilerNumber = 1;
Max.wheelsNumber = 1;
Max.armorNumber = 2;
Max.motorNumber = 1;
Max.handlingNumber = 2;
Max.speedFactor = 0.75;
Max.weaponDefenseLevel = 1;
Max.weaponAttackLevel = 1;
Max.cornerFactor = 1;
Bob = new Object();
Bob.weaponNumber = 2;
Bob.weaponDefenseNumber = 2;
Bob.weaponDefenseUpgrade = 1;
Bob.weaponAttackUpgrade = 2;
Bob.bumperNumber = 1;
Bob.spoilerNumber = 2;
Bob.wheelsNumber = 1;
Bob.armorNumber = 1;
Bob.motorNumber = 1;
Bob.handlingNumber = 2;
Bob.speedFactor = 0.8;
Bob.weaponDefenseLevel = 1;
Bob.weaponAttackLevel = 2;
Bob.cornerFactor = 1;
Jack = new Object();
Jack.weaponNumber = 1;
Jack.weaponDefenseNumber = 1;
Jack.weaponDefenseUpgrade = 1;
Jack.weaponAttackUpgrade = 1;
Jack.bumperNumber = 1;
Jack.spoilerNumber = 2;
Jack.wheelsNumber = 1;
Jack.armorNumber = 2;
Jack.motorNumber = 1;
Jack.handlingNumber = 2;
Jack.speedFactor = 0.8;
Jack.weaponDefenseLevel = 1;
Jack.weaponAttackLevel = 1;
Jack.cornerFactor = 2;
level[7].Cars[1] = Max;
level[7].Cars[2] = Bob;
level[7].Cars[3] = Jack;
level[7].numberofOils0 = 8;
level[7].numberofBOils0 = 2;
level[7].numberofMoney = 4;
level[7].numberofBMoney = 1;
level[7].numberofKits = 5;
level[7].numberofBKits = 1;
level[7].numberofMines0 = 10;
level[7].maxRoadNumber = 28;
level[7].maxLapsNumber = 4;
level[7].numberofXField = 12;
level[7].numberofYField = 12;
level[8] = new Object();
Line1 = "0,0,0,0,0,0,0,0,0,0,0,0;";
Line2 = "0,0,0,0,0,0,0,0,0,0,0,0;";
Line3 = "0,0,5,3,3,3,7,0,0,0,0,0;";
Line4 = "0,0,1,0,0,0,1,0,0,0,0,0;";
Line5 = "0,0,1,0,0,0,1,0,0,0,0,0;";
Line6 = "0,0,1,0,0,0,6,3,3,7,0,0;";
Line7 = "0,0,1,0,0,0,s,0,0,2,0,0;";
Line8 = "0,0,1,0,0,0,s,s,s,2,0,0;";
Line9 = "0,0,1,0,0,0,0,0,0,2,0,0;";
Line10 = "0,0,6,3,3,3,3,3,3,8,0,0;";
Line11 = "0,0,0,0,0,0,0,0,0,0,0,0;";
Line12 = "0,0,0,0,0,0,0,0,0,0,0,0;";
level[8].Grounds = ((((((((((Line1 + Line2) + Line3) + Line4) + Line5) + Line6) + Line7) + Line8) + Line9) + Line10) + Line11) + Line12;
Line1 = "0,0,0,0,0,0,0,0,0,0,0,0;";
Line2 = "0,0,0,0,0,0,0,0,0,0,0,0;";
Line3 = "0,0,3,3,3,3,2,0,0,0,0,0;";
Line4 = "0,0,1,0,0,0,2,0,0,0,0,0;";
Line5 = "0,0,1,0,0,0,2,0,0,0,0,0;";
Line6 = "0,0,1,0,0,0,3,3,3,2,0,0;";
Line7 = "0,0,1,0,0,0,2,0,0,2,0,0;";
Line8 = "0,0,1,0,0,0,3,3,3,2,0,0;";
Line9 = "0,0,1,0,0,0,0,0,0,2,0,0;";
Line10 = "0,0,1,4,4,4,4,4,4,4,0,0;";
Line11 = "0,0,0,0,0,0,0,0,0,0,0,0;";
Line12 = "0,0,0,0,0,0,0,0,0,0,0,0;";
level[8].Directions = ((((((((((Line1 + Line2) + Line3) + Line4) + Line5) + Line6) + Line7) + Line8) + Line9) + Line10) + Line11) + Line12;
Line1 = "0,0,0,0,0,0,0,0,0,0,0,0;";
Line2 = "0,0,0,0,0,0,0,0,0,0,0,0;";
Line3 = "0,0,a,0,0,0,h,0,0,0,0,0;";
Line4 = "0,0,0,0,0,0,0,0,0,0,0,0;";
Line5 = "0,0,C,0,0,0,0,0,0,0,0,0;";
Line6 = "0,0,0,0,0,0,0,0,0,0,0,0;";
Line7 = "0,0,g,0,0,0,g,0,0,0,0,0;";
Line8 = "0,0,0,0,0,0,0,0,h,0,0,0;";
Line9 = "0,0,0,0,0,0,0,0,0,0,0,0;";
Line10 = "0,0,B,0,0,0,S,0,0,0,0,0;";
Line11 = "0,0,0,0,0,0,0,0,0,0,0,0;";
Line12 = "0,0,0,0,0,0,0,0,0,0,0,0;";
level[8].Fitches = ((((((((((Line1 + Line2) + Line3) + Line4) + Line5) + Line6) + Line7) + Line8) + Line9) + Line10) + Line11) + Line12;
Line1 = "0,0,0,0,0,0,0,0,0,0,0,0;";
Line2 = "0,0,0,0,0,0,0,0,0,0,0,0;";
Line3 = "0,0,12,13,14,15,16,0,0,0,0,0;";
Line4 = "0,0,11,0,0,0,17,0,0,0,0,0;";
Line5 = "0,0,10,0,0,0,18,0,0,0,0,0;";
Line6 = "0,0,9,0,0,0,19,20,21,22,0,0;";
Line7 = "0,0,8,0,0,0,19,0,0,23,0,0;";
Line8 = "0,0,7,0,0,0,19,19,19,24,0,0;";
Line9 = "0,0,6,0,0,0,0,0,0,25,0,0;";
Line10 = "0,0,5,4,3,2,1,28,27,26,0,0;";
Line11 = "0,0,0,0,0,0,0,0,0,0,0,0;";
Line12 = "0,0,0,0,0,0,0,0,0,0,0,0;";
level[8].GroundsNumbers = ((((((((((Line1 + Line2) + Line3) + Line4) + Line5) + Line6) + Line7) + Line8) + Line9) + Line10) + Line11) + Line12;
level[8].locks = ["motor"];
level[8].Cars = new Array();
Max = new Object();
Max.weaponNumber = 2;
Max.weaponDefenseNumber = 1;
Max.weaponDefenseUpgrade = 3;
Max.weaponAttackUpgrade = 2;
Max.bumperNumber = 2;
Max.spoilerNumber = 1;
Max.wheelsNumber = 1;
Max.armorNumber = 2;
Max.motorNumber = 1;
Max.handlingNumber = 2;
Max.speedFactor = 0.8;
Max.weaponDefenseLevel = 1;
Max.weaponAttackLevel = 1;
Max.cornerFactor = 1;
Bob = new Object();
Bob.weaponNumber = 2;
Bob.weaponDefenseNumber = 2;
Bob.weaponDefenseUpgrade = 1;
Bob.weaponAttackUpgrade = 2;
Bob.bumperNumber = 2;
Bob.spoilerNumber = 2;
Bob.wheelsNumber = 1;
Bob.armorNumber = 1;
Bob.motorNumber = 1;
Bob.handlingNumber = 2;
Bob.speedFactor = 0.85;
Bob.weaponDefenseLevel = 1;
Bob.weaponAttackLevel = 2;
Bob.cornerFactor = 1;
Jack = new Object();
Jack.weaponNumber = 1;
Jack.weaponDefenseNumber = 1;
Jack.weaponDefenseUpgrade = 1;
Jack.weaponAttackUpgrade = 1;
Jack.bumperNumber = 1;
Jack.spoilerNumber = 2;
Jack.wheelsNumber = 1;
Jack.armorNumber = 2;
Jack.motorNumber = 1;
Jack.handlingNumber = 2;
Jack.speedFactor = 0.9;
Jack.weaponDefenseLevel = 1;
Jack.weaponAttackLevel = 1;
Jack.cornerFactor = 2;
level[8].Cars[1] = Max;
level[8].Cars[2] = Bob;
level[8].Cars[3] = Jack;
level[8].numberofOils0 = 8;
level[8].numberofBOils0 = 0;
level[8].numberofMoney = 4;
level[8].numberofBMoney = 1;
level[8].numberofKits = 5;
level[8].numberofBKits = 1;
level[8].numberofMines0 = 30;
level[8].maxRoadNumber = 28;
level[8].maxLapsNumber = 4;
level[8].numberofXField = 12;
level[8].numberofYField = 12;
level[9] = new Object();
Line1 = "0,0,0,0,0,0,0,0,0,0,0,0;";
Line2 = "0,0,0,0,0,0,0,0,0,0,0,0;";
Line3 = "0,0,5,3,3,3,3,3,3,7,0,0;";
Line4 = "0,0,1,0,0,0,0,s,0,2,0,0;";
Line5 = "0,0,1,0,5,3,3,3,3,8,0,0;";
Line6 = "0,0,1,0,1,0,0,0,0,0,0,0;";
Line7 = "0,0,1,0,1,0,0,0,0,0,0,0;";
Line8 = "0,0,1,0,6,3,3,3,3,7,0,0;";
Line9 = "0,0,1,0,0,0,0,s,0,2,0,0;";
Line10 = "0,0,6,3,3,3,3,3,3,8,0,0;";
Line11 = "0,0,0,0,0,0,0,0,0,0,0,0;";
Line12 = "0,0,0,0,0,0,0,0,0,0,0,0;";
level[9].Grounds = ((((((((((Line1 + Line2) + Line3) + Line4) + Line5) + Line6) + Line7) + Line8) + Line9) + Line10) + Line11) + Line12;
Line1 = "0,0,0,0,0,0,0,0,0,0,0,0;";
Line2 = "0,0,0,0,0,0,0,0,0,0,0,0;";
Line3 = "0,0,3,3,3,3,3,3,3,2,0,0;";
Line4 = "0,0,1,0,0,0,0,2,0,2,0,0;";
Line5 = "0,0,1,0,2,4,4,4,4,4,0,0;";
Line6 = "0,0,1,0,2,0,0,0,0,0,0,0;";
Line7 = "0,0,1,0,2,0,0,0,0,0,0,0;";
Line8 = "0,0,1,0,3,3,3,3,3,2,0,0;";
Line9 = "0,0,1,0,0,0,0,2,0,2,0,0;";
Line10 = "0,0,1,4,4,4,4,4,4,4,0,0;";
Line11 = "0,0,0,0,0,0,0,0,0,0,0,0;";
Line12 = "0,0,0,0,0,0,0,0,0,0,0,0;";
level[9].Directions = ((((((((((Line1 + Line2) + Line3) + Line4) + Line5) + Line6) + Line7) + Line8) + Line9) + Line10) + Line11) + Line12;
Line1 = "0,0,0,0,0,0,0,0,0,0,0,0;";
Line2 = "0,0,0,0,0,0,0,0,0,0,0,0;";
Line3 = "0,0,0,0,0,S,0,0,0,0,0,0;";
Line4 = "0,0,0,0,0,0,0,p,0,0,0,0;";
Line5 = "0,0,0,0,0,0,0,0,0,0,0,0;";
Line6 = "0,0,0,0,h,0,0,0,0,0,0,0;";
Line7 = "0,0,0,0,0,0,0,0,0,0,0,0;";
Line8 = "0,0,A,0,0,0,0,0,0,0,0,0;";
Line9 = "0,0,0,0,0,0,0,p,0,0,0,0;";
Line10 = "0,0,0,h,0,0,0,0,0,D,0,0;";
Line11 = "0,0,0,0,0,0,0,0,0,0,0,0;";
Line12 = "0,0,0,0,0,0,0,0,0,0,0,0;";
level[9].Fitches = ((((((((((Line1 + Line2) + Line3) + Line4) + Line5) + Line6) + Line7) + Line8) + Line9) + Line10) + Line11) + Line12;
Line1 = "0,0,0,0,0,0,0,0,0,0,0,0;";
Line2 = "0,0,0,0,0,0,0,0,0,0,0,0;";
Line3 = "0,0,36,37,38,1,2,3,4,5,0,0;";
Line4 = "0,0,35,0,0,0,0,3,0,6,0,0;";
Line5 = "0,0,34,0,12,11,10,9,8,7,0,0;";
Line6 = "0,0,33,0,13,0,0,0,0,0,0,0;";
Line7 = "0,0,32,0,14,0,0,0,0,0,0,0;";
Line8 = "0,0,31,0,15,16,17,18,19,20,0,0;";
Line9 = "0,0,30,0,0,0,0,18,0,21,0,0;";
Line10 = "0,0,29,28,27,26,25,24,23,22,0,0;";
Line11 = "0,0,0,0,0,0,0,0,0,0,0,0;";
Line12 = "0,0,0,0,0,0,0,0,0,0,0,0;";
level[9].GroundsNumbers = ((((((((((Line1 + Line2) + Line3) + Line4) + Line5) + Line6) + Line7) + Line8) + Line9) + Line10) + Line11) + Line12;
level[9].locks = [];
level[9].Cars = new Array();
Max = new Object();
Max.weaponNumber = 2;
Max.weaponDefenseNumber = 1;
Max.weaponDefenseUpgrade = 3;
Max.weaponAttackUpgrade = 3;
Max.bumperNumber = 3;
Max.spoilerNumber = 1;
Max.wheelsNumber = 1;
Max.armorNumber = 2;
Max.motorNumber = 1;
Max.handlingNumber = 2;
Max.speedFactor = 0.8;
Max.weaponDefenseLevel = 1;
Max.weaponAttackLevel = 1;
Max.cornerFactor = 2;
Bob = new Object();
Bob.weaponNumber = 2;
Bob.weaponDefenseNumber = 2;
Bob.weaponDefenseUpgrade = 1;
Bob.weaponAttackUpgrade = 2;
Bob.bumperNumber = 2;
Bob.spoilerNumber = 2;
Bob.wheelsNumber = 1;
Bob.armorNumber = 1;
Bob.motorNumber = 2;
Bob.handlingNumber = 2;
Bob.speedFactor = 0.85;
Bob.weaponDefenseLevel = 1;
Bob.weaponAttackLevel = 2;
Bob.cornerFactor = 2;
Jack = new Object();
Jack.weaponNumber = 1;
Jack.weaponDefenseNumber = 1;
Jack.weaponDefenseUpgrade = 1;
Jack.weaponAttackUpgrade = 3;
Jack.bumperNumber = 1;
Jack.spoilerNumber = 2;
Jack.wheelsNumber = 1;
Jack.armorNumber = 2;
Jack.motorNumber = 1;
Jack.handlingNumber = 2;
Jack.speedFactor = 0.9;
Jack.weaponDefenseLevel = 1;
Jack.weaponAttackLevel = 3;
Jack.cornerFactor = 2;
level[9].Cars[1] = Max;
level[9].Cars[2] = Bob;
level[9].Cars[3] = Jack;
level[9].numberofOils0 = 8;
level[9].numberofBOils0 = 0;
level[9].numberofMoney = 4;
level[9].numberofBMoney = 1;
level[9].numberofKits = 5;
level[9].numberofBKits = 1;
level[9].numberofMines0 = 10;
level[9].maxRoadNumber = 38;
level[9].maxLapsNumber = 4;
level[9].numberofXField = 12;
level[9].numberofYField = 12;
numberofCars = 4;
numberofLevel = 1;
hero.money = 0;
qMoney = 0;
Cars = new Array();
var i = 1;
while (i <= numberofCars) {
Cars[i] = new Object();
for (name in level[1].Cars[i]) {
Cars[i][name] = level[1].Cars[i][name];
}
i++;
}
renewHero = function () {
trace("!!");
hero = new Object();
for (name in level[1].Cars[0]) {
hero[name] = level[1].Cars[0][name];
}
};
if (hero == undefined) {
renewHero();
} else {
Cars[0] = new Object();
Cars[0] = hero;
}
numofPause = 1;
rpaused._visible = false;
updateGameStatistics = function () {
gst = game_st0;
gst.maxlap = level[numberofLevel].maxLapsNumber;
gst.current._width = (gst.full._width * main.Cars[0].damage) / 100;
gst.curlap = main.CarsVar[0].lapsCompleted + 1;
if (gst.curlap < 1) {
gst.curlap = 1;
}
gst = game_st1;
gst.n = hero.weaponAttackUpgrade - main.CarsVar[0].shootNumbers;
gst = game_st3;
gst.n = hero.weaponDefenseUpgrade - main.CarsVar[0].defenseNumbers;
};
updateOver = function () {
over._x = main._x;
over._y = main._y;
};
Frame 8
_quality = "LOW";
cursor.gotoAndPlay("arrow");
Cars = level[numberofLevel].Cars;
Cars[0] = hero;
Xst = 0;
Yst = 0;
putGameSt = function (i, k) {
var l = (i + k);
attachMovie(("game_st" + i) + k, "game_st" + i, this.getNextHighestDepth());
gst = eval ("game_st" + i);
gst._x = Xst;
gst._y = Yst;
Xst = Xst + gst._width;
};
this.createEmptyMovieClip("over", 1);
over._x = 240;
over._y = 170;
if (!main.begins) {
main.begin();
putGameSt(0, 0);
gst.full._width = gst.full._width * (0.333333333333333 + ((2 * (hero.armorNumber - 1)) / (3 * armorNumberPlus)));
putGameSt(1, hero.weaponNumber);
putGameSt(2, hero.weaponDefenseNumber);
putGameSt(3, 0);
}
Frame 9
updateMouse();
updateOver();
updateGameStatistics();
Frame 10
gotoAndPlay ("game");
Frame 11
plazma.enabled = false;
wheels.enabled = false;
handling.enabled = false;
spoiler.enabled = false;
armor.enabled = false;
bumper.enabled = false;
rocket.enabled = false;
oil.enabled = false;
mine.enabled = false;
motor.enabled = false;
Instance of Symbol 2015 MovieClip "plazma" in Frame 11
on (rollOver) {
_root.cursor.gotoAndPlay("hand");
light._visible = true;
_root.playSound("select");
_root.top.discription = discription;
_root.top.prise = prise;
_root.top.nm = nm;
}
on (rollOut) {
_root.cursor.gotoAndPlay("arrow");
light._visible = false;
_root.top.discription = "";
_root.top.prise = "";
_root.top.nm = "";
}
on (press) {
if (_parent.qMoney >= prise) {
_root.playSound("click");
_parent.changeMoney(prise);
_parent.plazmaplus();
this.play();
} else {
_root.playSound("clipempty");
}
}
on (release) {
_root.top.discription = discription;
_root.top.prise = prise;
_root.top.nm = nm;
}
Instance of Symbol 2033 MovieClip "rocket" in Frame 11
on (rollOver) {
_root.cursor.gotoAndPlay("hand");
light._visible = true;
_root.playSound("select");
_root.top.discription = discription;
_root.top.prise = prise;
_root.top.nm = nm;
}
on (rollOut) {
_root.cursor.gotoAndPlay("arrow");
light._visible = false;
_root.top.discription = "";
_root.top.prise = "";
_root.top.nm = "";
}
on (press) {
if (_parent.qMoney >= prise) {
_root.playSound("click");
_parent.changeMoney(prise);
_parent.rocketplus();
this.play();
} else {
_root.playSound("clipempty");
}
}
on (release) {
_root.top.discription = discription;
_root.top.prise = prise;
_root.top.nm = nm;
}
Instance of Symbol 2048 MovieClip "oil" in Frame 11
on (rollOver) {
_root.cursor.gotoAndPlay("hand");
light._visible = true;
_root.playSound("select");
_root.top.discription = discription;
_root.top.prise = prise;
_root.top.nm = nm;
}
on (rollOut) {
_root.cursor.gotoAndPlay("arrow");
light._visible = false;
_root.top.discription = "";
_root.top.prise = "";
_root.top.nm = "";
}
on (press) {
if (_parent.qMoney >= prise) {
_root.playSound("click");
_parent.changeMoney(prise);
_parent.oilplus();
this.play();
} else {
_root.playSound("clipempty");
}
}
on (release) {
_root.top.discription = discription;
_root.top.prise = prise;
_root.top.nm = nm;
}
Instance of Symbol 2063 MovieClip "mine" in Frame 11
on (rollOver) {
_root.cursor.gotoAndPlay("hand");
light._visible = true;
_root.playSound("select");
_root.top.discription = discription;
_root.top.prise = prise;
_root.top.nm = nm;
}
on (rollOut) {
_root.cursor.gotoAndPlay("arrow");
light._visible = false;
_root.top.discription = "";
_root.top.prise = "";
_root.top.nm = "";
}
on (press) {
if (_parent.qMoney >= prise) {
_root.playSound("click");
_parent.changeMoney(prise);
_parent.mineplus();
this.play();
} else {
_root.playSound("clipempty");
}
}
on (release) {
_root.top.discription = discription;
_root.top.prise = prise;
_root.top.nm = nm;
}
Instance of Symbol 2070 MovieClip "armor" in Frame 11
on (rollOver) {
_root.cursor.gotoAndPlay("hand");
light._visible = true;
_root.playSound("select");
_root.top.discription = discription;
_root.top.prise = prise;
_root.top.nm = nm;
}
on (rollOut) {
_root.cursor.gotoAndPlay("arrow");
light._visible = false;
_root.top.discription = "";
_root.top.prise = "";
_root.top.nm = "";
}
on (press) {
if (_parent.qMoney >= prise) {
_root.playSound("click");
_parent.changeMoney(prise);
_parent.armorplus();
this.play();
} else {
_root.playSound("clipempty");
}
}
on (release) {
_root.top.discription = discription;
_root.top.prise = prise;
_root.top.nm = nm;
}
Instance of Symbol 2075 MovieClip "bumper" in Frame 11
on (rollOver) {
_root.cursor.gotoAndPlay("hand");
light._visible = true;
_root.playSound("select");
_root.top.discription = discription;
_root.top.prise = prise;
_root.top.nm = nm;
}
on (rollOut) {
_root.cursor.gotoAndPlay("arrow");
light._visible = false;
_root.top.discription = "";
_root.top.prise = "";
_root.top.nm = "";
}
on (press) {
if (_parent.qMoney >= prise) {
_root.playSound("click");
_parent.changeMoney(prise);
_parent.bumperplus();
this.play();
} else {
_root.playSound("clipempty");
}
}
on (release) {
_root.top.discription = discription;
_root.top.prise = prise;
_root.top.nm = nm;
}
on (releaseOutside) {
_root.top.discription = "";
_root.top.prise = "";
}
Instance of Symbol 2080 MovieClip "motor" in Frame 11
on (rollOver) {
_root.cursor.gotoAndPlay("hand");
light._visible = true;
_root.playSound("select");
_root.top.discription = discription;
_root.top.prise = prise;
_root.top.nm = nm;
}
on (rollOut) {
_root.cursor.gotoAndPlay("arrow");
light._visible = false;
_root.top.discription = "";
_root.top.prise = "";
_root.top.nm = "";
}
on (press) {
if (_parent.qMoney >= prise) {
_root.playSound("click");
_parent.changeMoney(prise);
_parent.motorplus();
this.play();
} else {
_root.playSound("clipempty");
}
}
on (release) {
_root.top.discription = discription;
_root.top.prise = prise;
_root.top.nm = nm;
}
Instance of Symbol 2085 MovieClip "spoiler" in Frame 11
on (rollOver) {
_root.cursor.gotoAndPlay("hand");
light._visible = true;
_root.playSound("select");
_root.top.discription = discription;
_root.top.prise = prise;
_root.top.nm = nm;
}
on (rollOut) {
_root.cursor.gotoAndPlay("arrow");
light._visible = false;
_root.top.discription = "";
_root.top.prise = "";
_root.top.nm = "";
}
on (press) {
if (_parent.qMoney >= prise) {
_root.playSound("click");
_parent.changeMoney(prise);
_parent.spoilerplus();
this.play();
} else {
_root.playSound("clipempty");
}
}
on (release) {
_root.top.discription = discription;
_root.top.prise = prise;
_root.top.nm = nm;
}
Instance of Symbol 2090 MovieClip "handling" in Frame 11
on (rollOver) {
_root.cursor.gotoAndPlay("hand");
light._visible = true;
_root.playSound("select");
_root.top.discription = discription;
_root.top.prise = prise;
_root.top.nm = nm;
}
on (rollOut) {
_root.cursor.gotoAndPlay("arrow");
light._visible = false;
_root.top.discription = "";
_root.top.prise = "";
_root.top.nm = "";
}
on (press) {
if (_parent.qMoney >= prise) {
_root.playSound("click");
_parent.changeMoney(prise);
_parent.handlingplus();
this.play();
} else {
_root.playSound("clipempty");
}
}
on (release) {
_root.top.discription = discription;
_root.top.prise = prise;
_root.top.nm = nm;
}
Instance of Symbol 2093 MovieClip "wheels" in Frame 11
on (rollOver) {
_root.cursor.gotoAndPlay("hand");
light._visible = true;
_root.playSound("select");
_root.top.discription = discription;
_root.top.prise = prise;
_root.top.nm = nm;
}
on (rollOut) {
_root.cursor.gotoAndPlay("arrow");
light._visible = false;
_root.top.discription = "";
_root.top.prise = "";
_root.top.nm = "";
}
on (press) {
if (_parent.qMoney >= prise) {
_root.playSound("click");
_parent.changeMoney(prise);
_parent.wheelsplus();
this.play();
} else {
_root.playSound("clipempty");
}
}
on (release) {
_root.top.discription = discription;
_root.top.prise = prise;
_root.top.nm = nm;
}
Instance of Symbol 1692 MovieClip "car" in Frame 11
onClipEvent (keyDown) {
if (Key.getCode() == 114) {
_parent.qMoney = 100000 /* 0x0186A0 */;
}
}
Instance of Symbol 2109 MovieClip "exit" in Frame 11
on (rollOver) {
_root.cursor.gotoAndPlay("hand");
gotoAndPlay ("flash");
_root.playSound("select");
}
on (rollOut) {
_root.cursor.gotoAndPlay("arrow");
}
on (press) {
_root.playSound("click");
_parent.finish();
}
Frame 12
function changeMoney(q) {
qMoney = qMoney - q;
}
function plazmaplus() {
if (hero.weaponNumber == 1) {
hero.weaponAttackUpgrade++;
updatePlazma();
} else {
hero.weaponNumber = 1;
hero.weaponAttackUpgrade = 1;
updateRocket();
updatePlazma();
}
}
function rocketplus() {
if (hero.weaponNumber == 2) {
hero.weaponAttackUpgrade++;
updateRocket();
} else {
hero.weaponNumber = 2;
hero.weaponAttackUpgrade = 1;
updateRocket();
updatePlazma();
}
}
function oilplus() {
if (hero.weaponDefenseNumber == 1) {
hero.weaponDefenseUpgrade++;
updateOil();
} else {
hero.weaponDefenseNumber = 1;
hero.weaponDefenseUpgrade = 1;
}
updateOil();
updateMine();
}
function mineplus() {
if (hero.weaponDefenseNumber == 2) {
hero.weaponDefenseUpgrade++;
updateMine();
} else {
hero.weaponDefenseNumber = 2;
hero.weaponDefenseUpgrade = 2;
}
updateOil();
updateMine();
}
function armorplus() {
hero.armorNumber++;
updateArmor();
}
function handlingplus() {
hero.handlingNumber++;
updateHandling();
}
function bumperplus() {
hero.bumperNumber++;
updateBumper();
}
function motorplus() {
hero.motorNumber++;
updateMotor();
}
function spoilerplus() {
hero.spoilerNumber++;
updateSpoiler();
}
function wheelsplus() {
hero.wheelsNumber++;
updateWheels();
}
function finish() {
hero.money = qMoney;
Cars[0] = hero;
cursor.gotoAndPlay("arrow");
gotoAndPlay("levelpause" + numofPause);
if (numofPause == NofPause) {
numofPause = 0;
}
numofPause++;
}
function updateTop() {
money = qMoney;
}
putLocks = function () {
if (level[numberofLevel].locks != undefined) {
var k = 0;
while (k <= (level[numberofLevel].locks.length - 1)) {
var iconMC = eval (level[numberofLevel].locks[k]);
iconMC.locksUp();
iconMC.enabled = false;
k++;
}
}
};
updatePlazma = function () {
if (hero.weaponNumber == 1) {
plazma.gotoAndStop(hero.weaponAttackUpgrade + 1);
plazma.prise = shop.plazma[hero.weaponAttackUpgrade + 1];
plazma.discription = discriptions.plazma[hero.weaponAttackUpgrade + 1];
plazma.nm = names.plazma[hero.weaponAttackUpgrade + 1];
plazma.current._visible = true;
rocket.current._visible = false;
} else {
plazma.prise = shop.plazma[1];
plazma.discription = discriptions.plazma[1];
plazma.nm = names.plazma[1];
plazma.gotoAndStop(1);
}
};
updateRocket = function () {
if (hero.weaponNumber == 2) {
rocket.gotoAndStop(hero.weaponAttackUpgrade + 1);
rocket.prise = shop.rocket[hero.weaponAttackUpgrade + 1];
rocket.discription = discriptions.rocket[hero.weaponAttackUpgrade + 1];
rocket.nm = names.rocket[hero.weaponAttackUpgrade + 1];
plazma.current._visible = false;
rocket.current._visible = true;
} else {
rocket.prise = shop.rocket[1];
rocket.discription = discriptions.rocket[1];
rocket.nm = names.rocket[1];
if (rocket.enabled) {
rocket.gotoAndStop(1);
}
}
};
updateOil = function () {
if (hero.weaponDefenseNumber == 1) {
oil.gotoAndStop(hero.weaponDefenseUpgrade + 1);
oil.prise = shop.oil[hero.weaponDefenseUpgrade + 1];
oil.discription = discriptions.oil[hero.weaponDefenseUpgrade + 1];
oil.nm = names.oil[hero.weaponDefenseUpgrade + 1];
oil.current._visible = true;
mine.current._visible = false;
} else {
oil.prise = shop.oil[1];
oil.discription = discriptions.oil[1];
oil.nm = names.oil[1];
oil.gotoAndStop(1);
}
};
updateMine = function () {
if (hero.weaponDefenseNumber == 2) {
mine.gotoAndStop(hero.weaponDefenseUpgrade + 1);
mine.prise = shop.mine[hero.weaponDefenseUpgrade + 1];
mine.discription = discriptions.mine[hero.weaponDefenseUpgrade + 1];
mine.nm = names.mine[hero.weaponDefenseUpgrade + 1];
oil.current._visible = false;
mine.current._visible = true;
} else {
mine.prise = shop.mine[1];
mine.discription = discriptions.mine[1];
mine.nm = names.mine[1];
if (mine.enabled) {
mine.gotoAndStop(1);
}
}
};
updateArmor = function () {
armor.gotoAndStop(hero.armorNumber + 1);
armor.prise = shop.armor[hero.armorNumber + 1];
armor.discription = discriptions.armor[hero.armorNumber + 1];
armor.nm = names.armor[hero.armorNumber + 1];
};
updateBumper = function () {
bumper.gotoAndStop(hero.bumperNumber + 1);
bumper.prise = shop.bumper[hero.bumperNumber + 1];
bumper.discription = discriptions.bumper[hero.bumperNumber + 1];
bumper.nm = names.bumper[hero.bumperNumber + 1];
};
updateMotor = function () {
motor.gotoAndStop(hero.motorNumber + 1);
motor.prise = shop.motor[hero.motorNumber + 1];
motor.discription = discriptions.motor[hero.motorNumber + 1];
motor.nm = names.motor[hero.motorNumber + 1];
motor.light._visible = false;
};
updateSpoiler = function () {
spoiler.gotoAndStop(hero.spoilerNumber + 1);
spoiler.prise = shop.spoiler[hero.spoilerNumber + 1];
spoiler.discription = discriptions.spoiler[hero.spoilerNumber + 1];
spoiler.nm = names.spoiler[hero.spoilerNumber + 1];
};
updateHandling = function () {
handling.gotoAndStop(hero.handlingNumber + 1);
handling.prise = shop.handling[hero.handlingNumber + 1];
handling.discription = discriptions.handling[hero.handlingNumber + 1];
handling.nm = names.handling[hero.handlingNumber + 1];
};
updateWheels = function () {
wheels.gotoAndStop(hero.wheelsNumber + 1);
wheels.prise = shop.wheels[hero.wheelsNumber + 1];
wheels.discription = discriptions.wheels[hero.wheelsNumber + 1];
wheels.nm = names.wheels[hero.wheelsNumber + 1];
};
plazma.enabled = true;
wheels.enabled = true;
handling.enabled = true;
spoiler.enabled = true;
armor.enabled = true;
bumper.enabled = true;
rocket.enabled = true;
oil.enabled = true;
mine.enabled = true;
motor.enabled = true;
plazma.light._visible = false;
wheels.light._visible = false;
handling.light._visible = false;
spoiler.light._visible = false;
armor.light._visible = false;
bumper.light._visible = false;
rocket.light._visible = false;
oil.light._visible = false;
mine.light._visible = false;
motor.light._visible = false;
plazma.lock._visible = false;
wheels.lock._visible = false;
handling.lock._visible = false;
spoiler.lock._visible = false;
armor.lock._visible = false;
bumper.lock._visible = false;
rocket.lock._visible = false;
oil.lock._visible = false;
mine.lock._visible = false;
motor.lock._visible = false;
updateRocket();
updatePlazma();
updateOil();
updateMine();
updateArmor();
updateHandling();
updateBumper();
updateMotor();
updateSpoiler();
updateWheels();
if (!numberofGame) {
putLocks();
}
top.discription = "";
Frame 13
updateMouse();
car.setImage(0, hero.wheelsNumber, hero.weaponNumber, hero.bumperNumber, hero.spoilerNumber);
updateTop();
car.play();
Frame 14
gotoAndPlay ("shop");
Frame 15
_quality = "high";
updateMouse();
_root.bg.gotoAndStop("space1");
score = qMoney;
play();
Frame 16
nameinput.onSetFocus = function (oldFocus) {
if (this.text == "Your name here") {
this.text = "";
}
};
updateMouse();
gotoAndPlay ("complete");
Frame 17
_quality = "high";
updateMouse();
_root.bg.gotoAndStop("space2");
score = qMoney;
play();
Frame 18
nameinput.onSetFocus = function (oldFocus) {
if (this.text == "Your name here") {
this.text = "";
}
};
updateMouse();
gotoAndPlay ("gameover");
Frame 19
_quality = "high";
updateMouse();
_root.bg.gotoAndStop("space1");
play();
Frame 20
nameinput.onSetFocus = function (oldFocus) {
if (this.text == "Your name here") {
this.text = "";
}
};
updateMouse();
gotoAndPlay ("levelpause0");
Frame 21
_quality = "high";
updateMouse();
_root.bg.gotoAndStop("space1");
play();
Frame 22
gotoAndPlay ("levelpause3");
Frame 23
_quality = "high";
updateMouse();
_root.bg.gotoAndStop("space1");
play();
Frame 24
gotoAndPlay ("levelpause2");
Frame 25
_quality = "high";
updateMouse();
_root.bg.gotoAndStop("space1");
play();
Frame 26
gotoAndPlay ("levelpause4");
Frame 27
_quality = "high";
updateMouse();
_root.bg.gotoAndStop("space1");
play();
Frame 28
gotoAndPlay ("levelpause1");
Frame 29
_quality = "high";
updateMouse();
_root.bg.gotoAndStop("space1");
play();
Frame 30
gotoAndPlay ("levelpause5");
Frame 31
_quality = "high";
updateMouse();
play();
Frame 32
gotoAndPlay ("instr");
Symbol 26 MovieClip Frame 1
var reload = 60;
var reloadupgraded = 30;
var respawn = 120;
stop();
Symbol 26 MovieClip Frame 2
stop();
Symbol 26 MovieClip Frame 3
stop();
Symbol 26 MovieClip Frame 4
play();
Symbol 26 MovieClip Frame 5
gotoAndStop ("arrow");
Symbol 26 MovieClip Frame 6
play();
Symbol 26 MovieClip Frame 7
gotoAndStop ("arrow");
Symbol 26 MovieClip Frame 8
play();
Symbol 26 MovieClip Frame 9
gotoAndStop ("arrow");
Symbol 26 MovieClip Frame 10
play();
Symbol 26 MovieClip Frame 11
gotoAndStop ("arrow");
Symbol 26 MovieClip Frame 12
play();
Symbol 26 MovieClip Frame 13
gotoAndStop ("arrow");
Symbol 26 MovieClip Frame 14
stop();
Symbol 29 Button
on (rollOver) {
button2.gotoAndPlay("flash");
cursor.gotoAndPlay("hand");
_root.playSound("select");
}
on (rollOut) {
cursor.gotoAndPlay("arrow");
}
on (release) {
_root.playSound("click");
getURL (_root.downloadURL, "_blank");
}
Symbol 33 MovieClip Frame 1
stop();
Symbol 33 MovieClip Frame 2
play();
Symbol 34 Button
on (rollOver) {
button.gotoAndPlay("flash");
cursor.gotoAndPlay("hand");
_root.playSound("select");
}
on (rollOut) {
cursor.gotoAndPlay("arrow");
}
on (release) {
cursor.gotoAndPlay("arrow");
_root.playSound("click");
_root.counter = 0;
_root.gotoAndPlay("instr");
}
Symbol 36 MovieClip Frame 1
stop();
Symbol 36 MovieClip Frame 2
play();
Symbol 48 MovieClip Frame 1
stop();
Symbol 48 MovieClip Frame 2
play();
Symbol 49 Button
on (rollOver) {
cursor.gotoAndPlay("hand");
greatgames.gotoAndPlay("zoom");
_root.playSound("select");
}
on (rollOut) {
cursor.gotoAndPlay("arrow");
}
on (release) {
_root.playSound("click");
getURL (_root.moreGamesURL, "_blank");
}
Symbol 52 MovieClip Frame 1
stop();
Symbol 52 MovieClip Frame 2
stop();
Symbol 54 Button
on (rollOver) {
cursor.gotoAndPlay("hand");
}
on (rollOut) {
cursor.gotoAndPlay("arrow");
}
on (release) {
if ((_root.musicEnabled = !_root.musicEnabled)) {
playMusic("menumusic");
signmusic.gotoAndPlay("on");
} else {
stopAllSounds();
signmusic.gotoAndPlay("off");
}
}
Symbol 60 MovieClip Frame 1
stop();
Symbol 60 MovieClip Frame 2
stop();
Symbol 61 Button
on (rollOver) {
cursor.gotoAndPlay("hand");
}
on (rollOut) {
cursor.gotoAndPlay("arrow");
}
on (release) {
if ((_root.soundEnabled = !_root.soundEnabled)) {
signsound.gotoAndPlay("on");
} else {
signsound.gotoAndPlay("off");
}
}
Symbol 69 MovieClip [kit] Frame 1
q = 20;
onEnterFrame = function () {
X = _x;
Y = _y;
delete onEnterFrame;
};
Symbol 102 MovieClip [mine] Frame 1
stop();
q = -20;
onEnterFrame = function () {
X = _x;
Y = _y;
delete onEnterFrame;
};
Symbol 102 MovieClip [mine] Frame 18
stop();
this.removeMovieClip();
Symbol 105 MovieClip [money] Frame 1
q = 500;
onEnterFrame = function () {
X = _x;
Y = _y;
delete onEnterFrame;
};
Symbol 108 MovieClip [nuke] Frame 1
q = -80;
onEnterFrame = function () {
X = _x;
Y = _y;
delete onEnterFrame;
};
Symbol 151 MovieClip [oil] Frame 1
stop();
onEnterFrame = function () {
X = _x;
Y = _y;
delete onEnterFrame;
};
Symbol 154 MovieClip [shield] Frame 1
onEnterFrame = function () {
X = _x;
Y = _y;
delete onEnterFrame;
};
Symbol 157 MovieClip [slowdown] Frame 1
onEnterFrame = function () {
X = _x;
Y = _y;
delete onEnterFrame;
};
Symbol 190 MovieClip Frame 1
stop();
Symbol 190 MovieClip Frame 2
stop();
Symbol 190 MovieClip Frame 3
stop();
Symbol 190 MovieClip Frame 4
stop();
Symbol 190 MovieClip Frame 5
stop();
Symbol 190 MovieClip Frame 6
stop();
Symbol 190 MovieClip Frame 7
stop();
Symbol 190 MovieClip Frame 8
stop();
Symbol 190 MovieClip Frame 9
stop();
Symbol 190 MovieClip Frame 10
stop();
Symbol 190 MovieClip Frame 11
stop();
Symbol 190 MovieClip Frame 12
stop();
Symbol 190 MovieClip Frame 13
stop();
Symbol 190 MovieClip Frame 14
stop();
Symbol 190 MovieClip Frame 15
stop();
Symbol 190 MovieClip Frame 16
stop();
Symbol 191 MovieClip [bullet2] Frame 1
speed = 20;
power0 = -25;
level = 1;
power = power0 * 2;
i = 0;
lifetime = 2000;
R0 = 40;
nofviews = 16;
thisObj = this;
_visible = false;
stop();
Symbol 191 MovieClip [bullet2] Frame 2
if (alpha > 360) {
alpha = alpha - 360;
}
if (alpha < 0) {
alpha = alpha + 360;
}
viewN = Math.round((alpha * nofviews) / 360) + 1;
if (viewN < 0) {
viewN = nofviews + viewN;
}
if (viewN > nofviews) {
viewN = 0;
}
bullet.gotoAndStop(viewN);
if (_parent.Cars.length) {
carsLength = _parent.Cars.length;
} else {
carsLength = 0;
}
_x = (_x + (50 * Math.sin(((alpha * Math.PI) / 180) + (Math.PI/2))));
_y = (_y - (50 * Math.cos(((alpha * Math.PI) / 180) + (Math.PI/2))));
_visible = true;
Symbol 191 MovieClip [bullet2] Frame 3
stop();
X = _x + (speed * Math.sin(((alpha * Math.PI) / 180) + (Math.PI/2)));
Y = _y - (speed * Math.cos(((alpha * Math.PI) / 180) + (Math.PI/2)));
changeflag = false;
_x = X;
_y = Y;
if ((((_x > _parent.leftBorder) && (_x < _parent.rightBorder)) && (_y > _parent.upBorder)) && (_y < _parent.downBorder)) {
play();
} else {
removeMovieClip(thisObj);
}
var k = 0;
while (k <= carsLength) {
if (k != numberofCar) {
enemy = _parent.Cars[k];
R12 = Math.sqrt(((enemy._x - _x) * (enemy._x - _x)) + ((enemy._y - _y) * (enemy._y - _y)));
if (R12 < R0) {
if (((((_x + _parent._x) < _parent.windowRightBorder) && ((_x + _parent._x) > _parent.windowLeftBorder)) && ((_y + _parent._y) > _parent.windowUpBorder)) && ((_y + _parent._y) < _parent.windowDownBorder)) {
_root.playSound("rocketdamage");
}
enemy.changeDamage(power, "Fire");
if (enemy.damage > 0) {
_parent.explosion(_x, _y);
}
removeMovieClip(thisObj);
}
}
k++;
}
Symbol 191 MovieClip [bullet2] Frame 4
i++;
X = _x + (speed * Math.sin(((alpha * Math.PI) / 180) + (Math.PI/2)));
Y = _y - (speed * Math.cos(((alpha * Math.PI) / 180) + (Math.PI/2)));
changeflag = false;
_x = X;
_y = Y;
if ((((_x > _parent.leftBorder) && (_x < _parent.rightBorder)) && (_y > _parent.upBorder)) && (_y < _parent.downBorder)) {
gotoAndPlay (3);
} else {
removeMovieClip(thisObj);
}
var k = 0;
while (k <= carsLength) {
if (k != numberofCar) {
enemy = _parent.Cars[k];
R12 = Math.sqrt(((enemy._x - _x) * (enemy._x - _x)) + ((enemy._y - _y) * (enemy._y - _y)));
if (R12 < R0) {
if (((((_x + _parent._x) < _parent.windowRightBorder) && ((_x + _parent._x) > _parent.windowLeftBorder)) && ((_y + _parent._y) > _parent.windowUpBorder)) && ((_y + _parent._y) < _parent.windowDownBorder)) {
_root.playSound("rocketdamage");
}
enemy.changeDamage(power, "Fire");
if (enemy.damage > 0) {
_parent.explosion(_x, _y);
}
removeMovieClip(thisObj);
}
}
k++;
}
Symbol 194 MovieClip [speedup] Frame 1
onEnterFrame = function () {
X = _x;
Y = _y;
delete onEnterFrame;
};
Symbol 197 MovieClip [spread] Frame 1
onEnterFrame = function () {
X = _x;
Y = _y;
delete onEnterFrame;
};
Symbol 200 MovieClip [thorns] Frame 1
onEnterFrame = function () {
X = _x;
Y = _y;
delete onEnterFrame;
};
Symbol 206 MovieClip [frozen] Frame 1
onEnterFrame = function () {
X = _x;
Y = _y;
delete onEnterFrame;
};
Symbol 209 MovieClip [gboost] Frame 1
onEnterFrame = function () {
X = _x;
Y = _y;
delete onEnterFrame;
};
Symbol 212 MovieClip [bkit] Frame 1
q = 40;
onEnterFrame = function () {
X = _x;
Y = _y;
delete onEnterFrame;
};
Symbol 215 MovieClip [bmoney] Frame 1
q = 1000;
onEnterFrame = function () {
X = _x;
Y = _y;
delete onEnterFrame;
};
Symbol 246 MovieClip [bum] Frame 20
stop();
Symbol 290 MovieClip [box] Frame 1
stop();
q = -0.1;
onEnterFrame = function () {
X = _x;
Y = _y;
delete onEnterFrame;
};
Symbol 290 MovieClip [box] Frame 25
stop();
removeMovieClip(this);
Symbol 293 MovieClip [wheels3] Frame 1
q = -0.1;
onEnterFrame = function () {
X = _x;
Y = _y;
delete onEnterFrame;
};
Symbol 326 MovieClip Frame 1
stop();
Symbol 326 MovieClip Frame 2
stop();
Symbol 326 MovieClip Frame 3
stop();
Symbol 326 MovieClip Frame 4
stop();
Symbol 326 MovieClip Frame 5
stop();
Symbol 326 MovieClip Frame 6
stop();
Symbol 326 MovieClip Frame 7
stop();
Symbol 326 MovieClip Frame 8
stop();
Symbol 326 MovieClip Frame 9
stop();
Symbol 326 MovieClip Frame 10
stop();
Symbol 326 MovieClip Frame 11
stop();
Symbol 326 MovieClip Frame 12
stop();
Symbol 326 MovieClip Frame 13
stop();
Symbol 326 MovieClip Frame 14
stop();
Symbol 326 MovieClip Frame 15
stop();
Symbol 326 MovieClip Frame 16
stop();
Symbol 327 MovieClip [bulletspread] Frame 1
speed = 20;
power0 = -20;
level = 1;
power = power0 * 2;
i = 0;
lifetime = 5;
R0 = 40;
nofviews = 16;
nam = this._name;
nam0 = "bulletspread00";
k = nam.substr(nam0.length, nam.length - nam0.length);
alpha = ((k - 1) * 360) / nofviews;
bullet.gotoAndStop(k);
thisObj = this;
Symbol 327 MovieClip [bulletspread] Frame 2
X = _x + ((5 * speed) * Math.sin(((alpha * Math.PI) / 180) + (Math.PI/2)));
Y = _y - ((5 * speed) * Math.cos(((alpha * Math.PI) / 180) + (Math.PI/2)));
Symbol 327 MovieClip [bulletspread] Frame 3
_x = X;
_y = Y;
if (_parent.Cars.length) {
carsLength = _parent.Cars.length;
} else {
carsLength = 0;
}
Symbol 327 MovieClip [bulletspread] Frame 4
X = _x + (speed * Math.sin(((alpha * Math.PI) / 180) + (Math.PI/2)));
Y = _y - (speed * Math.cos(((alpha * Math.PI) / 180) + (Math.PI/2)));
_x = X;
_y = Y;
Symbol 327 MovieClip [bulletspread] Frame 5
i++;
if (i == 1) {
_visible = true;
}
if ((((_x > _parent.leftBorder) && (_x < _parent.rightBorder)) && (_y > _parent.upBorder)) && (_y < _parent.downBorder)) {
gotoAndPlay (4);
} else {
stop();
removeMovieClip(thisObj);
}
var k = 0;
while (k <= carsLength) {
if (k != numberofCar) {
enemy = _parent.Cars[k];
R12 = Math.sqrt(((enemy._x - _x) * (enemy._x - _x)) + ((enemy._y - _y) * (enemy._y - _y)));
if (R12 < R0) {
if (((((_x + _parent._x) < _parent.windowRightBorder) && ((_x + _parent._x) > _parent.windowLeftBorder)) && ((_y + _parent._y) > _parent.windowUpBorder)) && ((_y + _parent._y) < _parent.windowDownBorder)) {
_root.playSound("rocketdamage");
}
enemy.changeDamage(power, "Fire");
removeMovieClip(thisObj);
}
}
k++;
}
Symbol 1692 MovieClip Frame 1
stop();
Images = [c0, c1, c2, c3, w1, w2, g1, g2, b1, b2, b3, s2, s3];
ilength = Images.length;
setImage = function (nc, nw, ng, nb, ns) {
var i = 0;
while (i <= (ilength - 1)) {
Images[i]._visible = false;
i++;
}
w = eval ("w" + nw);
w._visible = true;
g = eval ("g" + ng);
g._visible = true;
b = eval ("b" + nb);
b._visible = true;
s = eval ("s" + ns);
s._visible = true;
c = eval ("c" + nc);
c._visible = true;
myNg = ng;
myNs = ns;
myNb = nb;
myNw = nw;
myNc = nc;
};
setImage(myNc, myNw, myNg, myNb, myNs);
Symbol 1692 MovieClip Frame 2
stop();
setImage(myNc, myNw, myNg, myNb, myNs);
Symbol 1692 MovieClip Frame 3
stop();
setImage(myNc, myNw, myNg, myNb, myNs);
Symbol 1692 MovieClip Frame 4
stop();
setImage(myNc, myNw, myNg, myNb, myNs);
Symbol 1692 MovieClip Frame 5
stop();
setImage(myNc, myNw, myNg, myNb, myNs);
Symbol 1692 MovieClip Frame 6
stop();
setImage(myNc, myNw, myNg, myNb, myNs);
Symbol 1692 MovieClip Frame 7
stop();
setImage(myNc, myNw, myNg, myNb, myNs);
Symbol 1692 MovieClip Frame 8
stop();
setImage(myNc, myNw, myNg, myNb, myNs);
Symbol 1692 MovieClip Frame 9
stop();
setImage(myNc, myNw, myNg, myNb, myNs);
Symbol 1692 MovieClip Frame 10
stop();
setImage(myNc, myNw, myNg, myNb, myNs);
Symbol 1692 MovieClip Frame 11
stop();
setImage(myNc, myNw, myNg, myNb, myNs);
Symbol 1692 MovieClip Frame 12
stop();
setImage(myNc, myNw, myNg, myNb, myNs);
Symbol 1692 MovieClip Frame 13
stop();
setImage(myNc, myNw, myNg, myNb, myNs);
Symbol 1692 MovieClip Frame 14
stop();
setImage(myNc, myNw, myNg, myNb, myNs);
Symbol 1692 MovieClip Frame 15
stop();
setImage(myNc, myNw, myNg, myNb, myNs);
Symbol 1692 MovieClip Frame 16
stop();
setImage(myNc, myNw, myNg, myNb, myNs);
Symbol 1692 MovieClip Frame 17
stop();
setImage(myNc, myNw, myNg, myNb, myNs);
Symbol 1692 MovieClip Frame 18
stop();
setImage(myNc, myNw, myNg, myNb, myNs);
Symbol 1692 MovieClip Frame 19
stop();
setImage(myNc, myNw, myNg, myNb, myNs);
Symbol 1692 MovieClip Frame 20
stop();
setImage(myNc, myNw, myNg, myNb, myNs);
Symbol 1692 MovieClip Frame 21
stop();
setImage(myNc, myNw, myNg, myNb, myNs);
Symbol 1692 MovieClip Frame 22
stop();
setImage(myNc, myNw, myNg, myNb, myNs);
Symbol 1692 MovieClip Frame 23
stop();
setImage(myNc, myNw, myNg, myNb, myNs);
Symbol 1692 MovieClip Frame 24
stop();
setImage(myNc, myNw, myNg, myNb, myNs);
Symbol 1692 MovieClip Frame 25
stop();
setImage(myNc, myNw, myNg, myNb, myNs);
Symbol 1692 MovieClip Frame 26
stop();
setImage(myNc, myNw, myNg, myNb, myNs);
Symbol 1692 MovieClip Frame 27
stop();
setImage(myNc, myNw, myNg, myNb, myNs);
Symbol 1692 MovieClip Frame 28
stop();
setImage(myNc, myNw, myNg, myNb, myNs);
Symbol 1692 MovieClip Frame 29
stop();
setImage(myNc, myNw, myNg, myNb, myNs);
Symbol 1692 MovieClip Frame 30
stop();
setImage(myNc, myNw, myNg, myNb, myNs);
Symbol 1692 MovieClip Frame 31
stop();
setImage(myNc, myNw, myNg, myNb, myNs);
Symbol 1692 MovieClip Frame 32
stop();
setImage(myNc, myNw, myNg, myNb, myNs);
Symbol 1693 MovieClip [enemy1] Frame 1
function seekforNextGround() {
if (_parent.GroundsNumbers[i][j] && (_parent.GroundsNumbers[i][j] >= nextGround)) {
nextGround = _parent.GroundsNumbers[i][j] + 1;
}
if (nextGround > (_parent.Way.length - 1)) {
nextGround = 1;
}
}
function chooseDirection() {
var _local5;
var _local4;
var _local8;
var _local9;
var _local7 = new Object();
var _local2 = new Array();
var _local3 = 1;
while (_local3 <= 4) {
_local2[_local3] = new Object();
_local3++;
}
_local2[1].dir = "up";
_local2[1].Num = _parent.GroundsNumbers[newi][newj - 1];
if (_parent.Grounds[newi][newj - 1] == "s") {
_local2[1].Num = 0;
}
_local2[2].dir = "down";
_local2[2].Num = _parent.GroundsNumbers[newi][newj + 1];
if (_parent.Grounds[newi][newj + 1] == "s") {
_local2[2].Num = 0;
}
_local2[3].dir = "left";
_local2[3].Num = _parent.GroundsNumbers[newi - 1][newj];
if (_parent.Grounds[newi - 1][newj] == "s") {
_local2[3].Num = 0;
}
_local2[4].dir = "right";
_local2[4].Num = _parent.GroundsNumbers[newi + 1][newj];
if (_parent.Grounds[newi + 1][newj] == "s") {
_local2[4].Num = 0;
}
var _local6 = 1;
while (_local6 <= 4) {
_local5 = _local2[_local6].Num;
_local4 = _local6;
_local3 = _local6;
while (_local3 <= 4) {
if (_local2[_local3].Num > _local5) {
_local4 = _local3;
_local5 = _local2[_local3].Num;
}
_local3++;
}
_local7 = _local2[_local4];
_local2[_local4] = _local2[_local6];
_local2[_local6] = _local7;
_local6++;
}
_local6 = 1;
while (_local6 <= 4) {
if (_local2[_local6].Num == _parent.GroundsNumbers[i][j]) {
_local8 = _local6;
}
_local6++;
}
_local9 = _local8 - 1;
if (_local9 == 2) {
_local9 = 1;
}
kx = 0;
ky = 0;
if ((_local2[_local9].dir == "up") && (_local2[_local8].dir == "left")) {
kx = -1;
ky = -2;
trace("ul");
}
if ((_local2[_local9].dir == "up") && (_local2[_local8].dir == "right")) {
kx = 1;
ky = -2;
trace("ur");
}
if ((_local2[_local9].dir == "down") && (_local2[_local8].dir == "left")) {
kx = -1;
ky = 2;
trace("dl");
}
if ((_local2[_local9].dir == "down") && (_local2[_local8].dir == "right")) {
kx = 1;
ky = 2;
trace("dr");
}
if ((_local2[_local9].dir == "left") && (_local2[_local8].dir == "up")) {
kx = -2;
ky = -1;
trace("lu");
}
if ((_local2[_local9].dir == "left") && (_local2[_local8].dir == "down")) {
kx = -2;
ky = 1;
trace("ld");
}
if ((_local2[_local9].dir == "right") && (_local2[_local8].dir == "up")) {
kx = 2;
ky = -1;
trace("ru");
}
if ((_local2[_local9].dir == "right") && (_local2[_local8].dir == "down")) {
kx = 2;
ky = 1;
trace("rd");
}
_local6 = 1;
while (_local6 <= 4) {
delete _local2[1];
_local2.splice(1, 1);
_local6++;
}
}
function motion(dir) {
switch (dir) {
case "left" :
mydr = speed0 / dr;
afactor = 1;
alpha = alpha - ((speed0 / dr) * signofSpeed);
break;
case "right" :
mydr = speed0 / dr;
alpha = (alpha + ((speed0 / dr) * signofSpeed)) + wPlus;
afactor = -1;
break;
case "up" :
if ((speed0 <= speedmax) && (movable)) {
speed0 = speed0 + a;
}
break;
case "down" :
if (speed0 < (-speedmax)) {
break;
}
speed0 = speed0 - a;
}
}
function backXY() {
_x = X0;
_y = Y0;
speed = 0;
alpha = alpha0;
}
function changeDamage(q, kindOfStr) {
armor = 1;
if (q == undefined) {
q = 0;
}
switch (kindOfStr) {
case "Strike" :
armor = armorStrike;
break;
case "Fire" :
armor = armorFire;
}
if ((!underShield) or (q > 0)) {
damage = damage + (q / armor);
}
if ((damage <= 0) && (movable)) {
die();
}
if (damage > 100) {
damage = 100;
}
if (damage < smokeDamageLevel) {
timeSmoke = 200 + (damage * 10);
if (intervalSmoke) {
clearInterval(intervalSmoke);
}
var _local2 = setInterval(toSmoke, timeSmoke);
intervalSmoke = _local2;
}
if (intervalSmoke && (damage >= smokeDamageLevel)) {
clearInterval(intervalSmoke);
intervalSmoke = 0;
}
}
function explosion() {
bum.gotoAndPlay(1);
}
function die() {
clearInt();
if (((((X + _parent._x) < _parent.windowRightBorder) && ((X + _parent._x) > _parent.windowLeftBorder)) && ((Y + _parent._y) > _parent.windowUpBorder)) && ((Y + _parent._y) < _parent.windowDownBorder)) {
_root.playSound("explosion");
}
_parent.remove(thisObj, "enemy1");
}
function dieFinal() {
clearInt();
onEnterFrame = function () {
removeMovieClip(thisObj);
delete onEnterFrame;
};
}
function shoot() {
if ((_parent.CarsVar[numberofCar].shootNumbers < maxshootNumbers) && (movable)) {
_parent.CarsVar[numberofCar].shootNumbers++;
_parent.shootNumbers++;
_parent.attachMovie(bulletsName, "bullet" + _parent.shootNumbers, _parent.getNextHighestDepth());
mybullet = eval ("_parent.bullet" + _parent.shootNumbers);
mybullet._x = X;
mybullet._y = Y;
onEnterFrame = function () {
mybullet.numberofCar = numberofCar;
mybullet.alpha = alpha;
delete onEnterFrame;
};
}
}
function defense() {
if (_parent.CarsVar[numberofCar].weaponDefenseNumber == 1) {
trysetOil();
} else {
trysetMine();
}
}
function setOil() {
var _local3;
var _local2;
if (_parent.CarsVar[numberofCar].defenseNumbers < maxDefenseNumbers) {
_parent.CarsVar[numberofCar].defenseNumbers++;
_local3 = X - (R01 * Math.sin(((alpha * Math.PI) / 180) + (Math.PI/2)));
_local2 = Y + (R01 * Math.cos(((alpha * Math.PI) / 180) + (Math.PI/2)));
if (movable) {
_parent.setOil(_local3, _local2);
}
}
}
function setMine() {
var _local3;
var _local2;
if (_parent.CarsVar[numberofCar].defenseNumbers < maxDefenseNumbers) {
_parent.CarsVar[numberofCar].defenseNumbers++;
_local3 = X - (R01 * Math.sin(((alpha * Math.PI) / 180) + (Math.PI/2)));
_local2 = Y + (R01 * Math.cos(((alpha * Math.PI) / 180) + (Math.PI/2)));
if (movable) {
_parent.setMine(_local3, _local2);
}
}
}
function newPlace() {
clearInterval(intervalPlace);
intervalPlace = 0;
if (movable) {
placeIt();
}
}
Accelaration = [0, 0.6, 0.8, 1];
Rotation = [0, 4, 3, 2];
Drifting = [0, 0.0365, 0.036, 0.0357, 0.0353];
armorStrikes = [0, 1, 2, 3];
armorFires = [0, 1, 2, 3, 4];
SpeedMax0 = [0, 10, 12, 14, 16];
WAttacks = [0, 0.0002, 0.0004, 0.0006, 0.0008];
WDefenses = [0, 0.0001, 0.0002, 0.0004, 0.0008];
cornerKs = [0, 0.4, 0.6, 0.8, 1];
dSMax = 2;
KSmax = _root.numberofGame;
hitPower = -0.5;
Power0 = -0.2;
ft = 0.2;
mydr = 0;
bum.stop();
cross = false;
thisObj = this;
afactor = 0;
SpeedDDown = 0.03;
SpeedDmin = 1;
kt = 1;
nofviews = 32;
alpha = 0;
alpha0 = 0;
viewN = 1;
R01 = 30;
R0 = R01 * R01;
timeenabled = true;
timetouching = 1;
dalpha = 10;
bulletsName = "bullet1";
da = 1;
dx = 30;
dy = 30;
speedBootsPlus = 10;
OilW = 10;
restartTime = 24;
ilock = 0;
ilockkMax = 60;
timeSpeedUp = 2000;
timeShields = 4000;
timeFroze = 2000;
timeThorns = 12000;
timeHeadler = 50;
timeSmoke = 1000;
smokeDamageLevel = 30;
timeDust = 350;
SpeedDDust = 1;
speedFromWheels = 15;
KfromP = 0.037;
dBadGroundAccel = 0.3;
speedFroze = 1;
PowerThorns = -100;
formateCar = function () {
wheelsNumber = _parent.CarsVar[numberofCar].wheelsNumber;
spoilerNumber = _parent.CarsVar[numberofCar].spoilerNumber;
armorNumber = _parent.CarsVar[numberofCar].armorNumber;
bumperNumber = _parent.CarsVar[numberofCar].bumperNumber;
motorNumber = _parent.CarsVar[numberofCar].motorNumber;
weaponNumber = _parent.CarsVar[numberofCar].weaponNumber;
weaponDefenseNumber = _parent.CarsVar[numberofCar].weaponDefenseNumber;
handlingNumber = _parent.CarsVar[numberofCar].handlingNumber;
maxshootNumbers = _parent.CarsVar[numberofCar].weaponAttackUpgrade;
maxDefenseNumbers = _parent.CarsVar[numberofCar].weaponDefenseUpgrade;
attackLevel = _parent.CarsVar[numberofCar].weaponAttackLevel;
defenseLevel = _parent.CarsVar[numberofCar].weaponDefenseLevel;
cornerFactor = _parent.CarsVar[numberofCar].cornerFactor;
WDefense = WDefenses[defenseLevel];
WAttack = WAttacks[attackLevel];
speedmax0 = (SpeedMax0[motorNumber] * _parent.CarsVar[numberofCar].speedFactor) + (dSMax * KSmax);
K0 = Drifting[(spoilerNumber + wheelsNumber) - 1];
cornerK = cornerKs[cornerFactor];
K = K0;
dr = Rotation[handlingNumber];
a0 = Accelaration[motorNumber];
a = a0;
armorStrike = armorStrikes[bumperNumber];
armorFire = armorFires[armorNumber];
damage = 100;
Power = Power0;
boostEnabled = false;
X = _x;
Y = _y;
signofSpeed = 1;
underShield = false;
motionUp = true;
motionRight = false;
motionLeft = false;
toRestart = false;
wPlus = 0;
speed = 0;
speedX = 0;
speedY = 0;
speed0 = 0;
SpeedDX = 0;
SpeedDY = 0;
speedmax = speedmax0;
a = a0;
K = K0;
followi = i;
followj = j;
maxDefenseNumbers = 3;
OilRot = false;
car.setImage(numberofCar, wheelsNumber, weaponNumber, bumperNumber, spoilerNumber);
bulletsName = "bullet" + _parent.CarsVar[numberofCar].weaponNumber;
switch (_parent.Directions[i][j]) {
case 1 :
alpha = 270;
break;
case 2 :
alpha = 90;
break;
case 3 :
alpha = 0;
break;
case 4 :
alpha = 180;
}
setDirection();
seekforNextGround();
newi = _parent.Way[nextGround][0];
newj = _parent.Way[nextGround][1];
chooseDirection();
};
Start = function () {
gotoAndPlay (2);
bonus = _parent.bonusonCar[numberofCar];
movable = true;
};
restart = function () {
placeIt();
if (_parent.CarsVar[numberofCar].movable) {
formateCar();
Start();
} else {
formateCar();
finish();
}
};
placeIt = function () {
_x = (_parent.leftBorder + (((i + Math.random()) - 0.5) * _parent.Xelement));
_y = (_parent.upBorder + (((j + Math.random()) - 0.5) * _parent.Yelement));
};
finishFroze = function () {
clearInterval(intervalFroze);
intervalFroze = 0;
a = a0;
speedmax = speedmax0;
bonus.gotoAndStop("Empty");
};
frozeIt = function () {
bonus.gotoAndStop("Froze");
speedmax = speedFroze;
speed0 = speedFroze;
SpeedD = 0;
SpeedDX = 0;
SpeedDY = 0;
if (!intervalFroze) {
var _local1 = setInterval(finishFroze, timeFroze);
intervalFroze = _local1;
}
};
setBonus = function (bname) {
bonus.gotoAndStop(bname);
};
clearInt = function () {
if (intervalFroze) {
clearInterval(intervalFroze);
}
if (intervalSpeedUp) {
clearInterval(intervalSpeedUp);
}
if (intervalSlowDown) {
clearInterval(intervalSlowDown);
}
if (intervalShields) {
clearInterval(intervalShields);
}
if (intervalThorns) {
clearInterval(intervalThorns);
}
if (intervalDust) {
clearInterval(intervalDust);
}
if (intervalSmoke) {
clearInterval(intervalSmoke);
}
if (intervalPlace) {
clearInterval(intervalPlace);
}
};
tryShoot = function () {
var _local5;
var _local3;
var _local4;
var _local2 = 0;
while (_local2 <= (_parent.Cars.length - 1)) {
_local4 = _parent.Cars[_local2]._x;
_local3 = _parent.Cars[_local2]._y;
balpha = -Math.atan((_local4 - X) / (_local3 - Y));
if ((_local3 - Y) >= 0) {
balpha = balpha + (Math.PI/2);
} else {
balpha = balpha - (Math.PI/2);
}
if (balpha < 0) {
balpha = balpha + (Math.PI*2);
}
balpha = (balpha * 180) / Math.PI;
if (Math.abs(balpha - alpha) < dalpha) {
_local5 = Math.random() * Math.random();
if (_local5 < WAttack) {
shoot();
}
}
_local2++;
}
};
trysetOil = function () {
var _local5;
var _local3;
var _local4;
var _local2 = 0;
while (_local2 <= (_parent.Cars.length - 1)) {
_local4 = _parent.Cars[_local2]._x;
_local3 = _parent.Cars[_local2]._y;
balpha = -Math.atan((_local4 - _x) / (_local3 - _y));
if ((_local3 - _y) >= 0) {
balpha = balpha + (Math.PI/2);
} else {
balpha = balpha - (Math.PI/2);
}
if (balpha < 0) {
balpha = balpha + (Math.PI*2);
}
balpha = ((balpha * 180) / Math.PI) - 180;
if (Math.abs(balpha - alpha) < dalpha) {
_local5 = Math.random() * Math.random();
if (_local5 < WDefense) {
setOil();
}
}
_local2++;
}
};
trysetMine = function () {
var _local5;
var _local3;
var _local4;
var _local2 = 0;
while (_local2 <= (_parent.Cars.length - 1)) {
_local4 = _parent.Cars[_local2].X;
_local3 = _parent.Cars[_local2].Y;
balpha = -Math.atan((_local4 - X) / (_local3 - Y));
if ((_local3 - Y) >= 0) {
balpha = balpha + (Math.PI/2);
} else {
balpha = balpha - (Math.PI/2);
}
if (balpha < 0) {
balpha = balpha + (Math.PI*2);
}
balpha = ((balpha * 180) / Math.PI) - 180;
if (Math.abs(balpha - alpha) < dalpha) {
_local5 = Math.random() * Math.random();
if (_local5 < WDefense) {
setMine();
}
}
_local2++;
}
};
toSmoke = function () {
if (!_parent.paused) {
_parent.SmokeNumber++;
_parent.attachMovie("smoke", "smoke" + _parent.SmokeNumber, _parent.getNextHighestDepth());
item = eval ("_parent.smoke" + _parent.SmokeNumber);
item._x = X;
item._y = Y;
}
};
setDirection = function () {
if (alpha > 360) {
alpha = alpha - 360;
}
if (alpha < -360) {
alpha = alpha + 360;
}
viewN = Math.round((alpha * nofviews) / 360) + 1;
if (viewN < 0) {
viewN = nofviews + viewN;
}
if (viewN > nofviews) {
viewN = 0;
}
car.gotoAndStop(viewN);
};
finishlap = function () {
_parent.CarsVar[numberofCar].lapsCompleted++;
_parent.CarsVar[numberofCar].shootNumbers = 0;
_parent.CarsVar[numberofCar].defenseNumbers = 0;
if (_parent.CarsVar[numberofCar].lapsCompleted == _parent.maxLapsNumber) {
finish();
_parent.carsFinished++;
}
};
finish = function () {
a = 0;
_parent.CarsVar[numberofCar].movable = false;
movable = false;
};
stop();
Symbol 1693 MovieClip [enemy1] Frame 2
alpha0 = alpha;
if (motionUp) {
motion("up");
}
if (motionDown) {
motion("down");
}
if (motionRight) {
motion("right");
}
if (motionLeft) {
motion("left");
}
if (OilRot) {
motion("right");
}
if (Math.abs(speed0) > ft) {
speed0 = (speed0 * (Math.abs(speed0) - ft)) / Math.abs(speed0);
} else {
speed0 = 0;
}
carIsTouched = false;
if (speed0 > 0) {
signofSpeed = 1;
} else {
signofSpeed = -1;
}
if ((motionRight or motionLeft) or SpeedD) {
SpeedDX = SpeedDX - (((speed0 * afactor) * K) * Math.sin((alpha * Math.PI) / 180));
SpeedDY = SpeedDY + (((speed0 * afactor) * K) * Math.cos((alpha * Math.PI) / 180));
} else {
SpeedD = 0;
SpeedDX = 0;
SpeedDY = 0;
}
speedX = (speed0 * Math.cos((alpha * Math.PI) / 180)) + SpeedDX;
speedY = (speed0 * Math.sin((alpha * Math.PI) / 180)) + SpeedDY;
speed = Math.sqrt((speedX * speedX) + (speedY * speedY));
SpeedD = Math.sqrt((SpeedDX * SpeedDX) + (SpeedDY * SpeedDY));
SpeedD0 = SpeedD;
if (SpeedD > (SpeedDDown * speed0)) {
SpeedD = Math.sqrt((SpeedDX * SpeedDX) + (SpeedDY * SpeedDY)) - ((SpeedDDown * speed0) * signofSpeed);
if (SpeedD0 > 0) {
kt = SpeedD / SpeedD0;
} else {
kt = 0;
}
SpeedDX = SpeedDX * kt;
SpeedDY = SpeedDY * kt;
} else {
SpeedD = 0;
kt = 1;
}
X = _x + speedX;
Y = _y + speedY;
if ((_parent.Grounds[i][j] == 14) or (_parent.Grounds[i][j] == 15)) {
Y = Y + ((Math.random() - 0.5) * speed0);
a = dBadGroundAccel;
} else if (a == dBadGroundAccel) {
a = a0;
}
if ((_parent.Grounds[i][j] == 17) or (_parent.Grounds[i][j] == 20)) {
K = KfromP;
} else if (K == KfromP) {
K = K0;
}
X0 = _x;
Y0 = _y;
if (_parent.testOnMotion(X, Y)) {
_x = X;
_y = Y;
} else {
if (((((X + _parent._x) < _parent.windowRightBorder) && ((X + _parent._x) > _parent.windowLeftBorder)) && ((Y + _parent._y) > _parent.windowUpBorder)) && ((Y + _parent._y) < _parent.windowDownBorder)) {
_root.playSound("collision");
}
changeDamage(hitPower, "Strike");
if (Math.abs(speed0) > (40 * ft)) {
speed0 = (speed0 * (Math.abs(speed0) - (2 * ft))) / Math.abs(speed0);
}
X = _x + speedX;
Y = _y;
if (_parent.testOnMotion(X, Y)) {
_x = X;
_y = Y;
} else {
X = _x;
Y = _y + speedY;
if (_parent.testOnMotion(X, Y)) {
_x = X;
_y = Y;
}
}
}
toDust = function () {
if (!_parent.paused) {
if (((((_x + _parent._x) < _parent.windowRightBorder) && ((_x + _parent._x) > _parent.windowLeftBorder)) && ((Y + _parent._y) > _parent.windowUpBorder)) && ((Y + _parent._y) < _parent.windowDownBorder)) {
_root.playSound("friction");
}
clearInterval(intervalDust);
intervalDust = 0;
_parent.DustNumber++;
_parent.attachMovie("dust", "dust" + _parent.DustNumber, _parent.getNextHighestDepth());
item = eval ("_parent.dust" + _parent.DustNumber);
item._x = X;
item._y = Y;
}
};
if (((SpeedD > SpeedDDust) && (!intervalDust)) && (motionRight or motionLeft)) {
var myIntervalDust = setInterval(toDust, timeDust);
intervalDust = myIntervalDust;
}
if ((intervalDust && (SpeedD < SpeedDDust)) or ((!motionRight) and (!motionLeft))) {
}
if (carIsTouched) {
backXY();
}
i = Math.floor(((X + (_parent.Xelement / 2)) - _parent.leftBorder) / _parent.Xelement);
j = Math.floor(((Y + (_parent.Yelement / 2)) - _parent.upBorder) / _parent.Yelement);
if ((i != followi) or (j != followj)) {
if (_parent.GroundsNumbers[i][j] != _parent.GroundsNumbers[followi][followj]) {
seekforNextGround();
newi = _parent.Way[nextGround][0];
newj = _parent.Way[nextGround][1];
chooseDirection();
} else {
newi = _parent.Way[nextGround][0];
newj = _parent.Way[nextGround][1];
}
followi = i;
followj = j;
}
if ((_parent.GroundsNumbers[i][j] >= (_parent.CarsVar[numberofCar].lastFieldNumber + 1)) && (_parent.GroundsNumbers[i][j] <= (_parent.CarsVar[numberofCar].lastFieldNumber + 2))) {
_parent.CarsVar[numberofCar].lastFieldNumber = _parent.GroundsNumbers[i][j];
if (_parent.maxRoadNumber == _parent.CarsVar[numberofCar].lastFieldNumber) {
_parent.CarsVar[numberofCar].lastFieldNumber = 0;
}
if ((_parent.CarsVar[numberofCar].lastFieldNumber == 2) && (_parent.GroundsNumbers[i][j] == 2)) {
if (_parent.CarsVar[numberofCar].notfirstlap) {
finishlap();
} else {
_parent.CarsVar[numberofCar].notfirstlap = true;
}
}
}
toPoint = function () {
if (nextGround > (_parent.Way.length - 1)) {
nextGround = 1;
}
var _local3;
var _local2;
switch (Math.abs(kx)) {
case 0 :
_local3 = (numberofCar - 2) * 30;
break;
case 1 :
_local3 = ((((kx / Math.abs(kx)) * cornerK) * 1) / 2) * _parent.Xelement;
break;
case 2 :
_local3 = ((kx / Math.abs(kx)) * _parent.Xelement) / 2;
}
purposeX = ((newi - 0.5) * _parent.Xelement) + _local3;
switch (Math.abs(ky)) {
case 0 :
_local2 = (numberofCar - 2) * 30;
break;
case 1 :
_local2 = ((((ky / Math.abs(ky)) * cornerK) * 1) / 2) * _parent.Yelement;
break;
case 2 :
_local2 = ((ky / Math.abs(ky)) * _parent.Yelement) / 2;
}
purposeY = ((newj - 0.5) * _parent.Yelement) + _local2;
alpha1 = -Math.atan((purposeX - _x) / (purposeY - _y));
if ((purposeY - _y) >= 0) {
alpha1 = alpha1 + (Math.PI/2);
} else {
alpha1 = alpha1 - (Math.PI/2);
}
if (alpha1 < 0) {
alpha1 = alpha1 + (Math.PI*2);
}
alpha1 = (alpha1 * 180) / Math.PI;
};
toPoint();
if ((((alpha1 < alpha) && (Math.abs((-alpha) + alpha1) <= 180)) or ((alpha1 > alpha) && (Math.abs((-alpha) + alpha1) > 180))) && (Math.abs((-alpha) + alpha1) > da)) {
motionLeft = true;
motionRight = false;
}
if ((((alpha1 > alpha) && (Math.abs((-alpha) + alpha1) <= 180)) or ((alpha1 < alpha) && (Math.abs((-alpha) + alpha1) > 180))) && (Math.abs((-alpha) + alpha1) > da)) {
motionLeft = false;
motionRight = true;
}
freemotion = true;
if (((Math.abs((-alpha) + alpha1) < da) or (Math.abs(((-alpha) + alpha1) - 360) < da)) && (freemotion)) {
alpha = alpha1;
motionLeft = false;
motionRight = false;
}
tryShoot();
defense();
if (carIsTouched) {
backXY();
}
var k = 0;
while (k <= _parent.Cars.length) {
if (k != numberofCar) {
enemy = _parent.Cars[k];
R12 = ((enemy._x - X) * (enemy._x - X)) + ((enemy._y - Y) * (enemy._y - Y));
if ((R12 < R0) && (speed > enemy.speed)) {
backXY();
if (((((X + _parent._x) < _parent.windowRightBorder) && ((X + _parent._x) > _parent.windowLeftBorder)) && ((Y + _parent._y) > _parent.windowUpBorder)) && ((Y + _parent._y) < _parent.windowDownBorder)) {
_root.playSound("collision");
}
timeenabled = false;
lastTouched = k;
enemy.SpeedDX = enemy.SpeedDX + (speedX / 3);
enemy.SpeedDY = enemy.SpeedDY + (speedY / 3);
enemy.SpeedD = Math.sqrt((enemy.SpeedDX * enemy.SpeedDX) + (enemy.SpeedDY * enemy.SpeedDY));
enemy.backXY();
enemy.carIsTouched = true;
var ePower = enemy.Power;
enemy.changeDamage(Power, "Strike");
speed0 = speed0 / 2;
SpeedDX = SpeedDX / 2;
SpeedDY = SpeedDY / 2;
SpeedD = SpeedD / 2;
changeDamage(ePower, "Strike");
_x = X0;
_y = Y0;
}
}
k++;
}
var k = 0;
while (k <= _parent.Boxes.length) {
item = _parent.Boxes[k];
R12 = ((item.X - X) * (item.X - X)) + ((item.Y - Y) * (item.Y - Y));
if ((R12 <= R0) && (item._currentframe == 1)) {
if (((((X + _parent._x) < _parent.windowRightBorder) && ((X + _parent._x) > _parent.windowLeftBorder)) && ((Y + _parent._y) > _parent.windowUpBorder)) && ((Y + _parent._y) < _parent.windowDownBorder)) {
_root.playSound("wood");
}
item.play();
if (speed0 != 0) {
speed0 = speed0 - (((speedmax / 3) * Math.abs(speed0)) / speed0);
}
SpeedDX = (2 * SpeedDX) / 3;
SpeedDY = (2 * SpeedDY) / 3;
SpeedD = (2 * SpeedD) / 3;
changeDamage(item.q, "Strike");
}
k++;
}
var k = 1;
while (k <= (_parent.Wheels.length - 1)) {
item = _parent.Wheels[k];
R12 = ((item.X - X) * (item.X - X)) + ((item.Y - Y) * (item.Y - Y));
if (R12 <= R0) {
if (((((X + _parent._x) < _parent.windowRightBorder) && ((X + _parent._x) > _parent.windowLeftBorder)) && ((Y + _parent._y) > _parent.windowUpBorder)) && ((Y + _parent._y) < _parent.windowDownBorder)) {
_root.playSound("tires");
}
if ((_parent.Directions[i][j] == 1) or (_parent.Directions[i][j] == 2)) {
if (item.X < X) {
SpeedDX = speed0;
} else {
SpeedDX = -speed0;
}
changeDamage(item.q, "Strike");
}
if ((_parent.Directions[i][j] == 3) or (_parent.Directions[i][j] == 4)) {
if (item.Y < Y) {
SpeedDY = speed0;
} else {
SpeedDY = -speed0;
}
}
SpeedD = Math.sqrt((SpeedDY * SpeedDY) + (SpeedDX * SpeedDX));
}
k++;
}
finishOilW = function () {
motionRight = false;
clearInterval(intervalOil);
intervalOil = 0;
wPlus = 0;
};
var k = 0;
while (k <= _parent.Oils.length) {
item = _parent.Oils[k];
R12 = ((item.X - X) * (item.X - X)) + ((item.Y - Y) * (item.Y - Y));
if ((R12 <= R0) && (item._currentframe == 1)) {
if (((((X + _parent._x) < _parent.windowRightBorder) && ((X + _parent._x) > _parent.windowLeftBorder)) && ((Y + _parent._y) > _parent.windowUpBorder)) && ((Y + _parent._y) < _parent.windowDownBorder)) {
_root.playSound("slip");
}
item.play();
motionRight = true;
wPlus = OilW;
var intervalOil = setInterval(finishOilW, 200);
}
k++;
}
if ((((_parent.Fitches[i][j] == "A") or (_parent.Fitches[i][j] == "B")) or (_parent.Fitches[i][j] == "C")) or (_parent.Fitches[i][j] == "D")) {
switch (_parent.Directions[i][j]) {
case 1 :
if (((X - ((i - 0.5) * _parent.Xelement)) < (_parent.Xelement / 6)) && ((X - ((i - 0.5) * _parent.Xelement)) > ((-_parent.Xelement) / 6))) {
if ((((((X + _parent._x) < _parent.windowRightBorder) && ((X + _parent._x) > _parent.windowLeftBorder)) && ((Y + _parent._y) > _parent.windowUpBorder)) && ((Y + _parent._y) < _parent.windowDownBorder)) && (!boosted)) {
boosted = true;
_root.playSound("boost");
}
SpeedDY = -speedmax;
}
break;
case 2 :
if (((X - ((i - 0.5) * _parent.Xelement)) < (_parent.Xelement / 6)) && ((X - ((i - 0.5) * _parent.Xelement)) > ((-_parent.Xelement) / 6))) {
if ((((((X + _parent._x) < _parent.windowRightBorder) && ((X + _parent._x) > _parent.windowLeftBorder)) && ((Y + _parent._y) > _parent.windowUpBorder)) && ((Y + _parent._y) < _parent.windowDownBorder)) && (!boosted)) {
boosted = true;
_root.playSound("boost");
}
SpeedDY = speedmax;
}
break;
case 3 :
if (((Y - ((j - 0.5) * _parent.Yelement)) < (_parent.Yelement / 6)) && ((Y - ((j - 0.5) * _parent.Yelement)) > ((-_parent.Yelement) / 6))) {
if ((((((X + _parent._x) < _parent.windowRightBorder) && ((X + _parent._x) > _parent.windowLeftBorder)) && ((Y + _parent._y) > _parent.windowUpBorder)) && ((Y + _parent._y) < _parent.windowDownBorder)) && (!boosted)) {
boosted = true;
_root.playSound("boost");
}
SpeedDX = speedmax;
}
break;
case 4 :
if (!(((Y - ((j - 0.5) * _parent.Yelement)) < (_parent.Yelement / 6)) && ((Y - ((j - 0.5) * _parent.Yelement)) > ((-_parent.Yelement) / 6)))) {
break;
}
if ((((((X + _parent._x) < _parent.windowRightBorder) && ((X + _parent._x) > _parent.windowLeftBorder)) && ((Y + _parent._y) > _parent.windowUpBorder)) && ((Y + _parent._y) < _parent.windowDownBorder)) && (!boosted)) {
boosted = true;
_root.playSound("boost");
}
SpeedDX = -speedmax;
}
SpeedD = Math.sqrt((SpeedDY * SpeedDY) + (SpeedDX * SpeedDX));
}
if ((Math.abs(SpeedD) < Math.abs(speedmax / 2)) && (boosted)) {
boosted = false;
}
var k = 0;
while (k <= _parent.Moneys.length) {
item = _parent.Moneys[k];
R12 = ((item.X - X) * (item.X - X)) + ((item.Y - Y) * (item.Y - Y));
if ((R12 <= R0) && (item._currentframe == 1)) {
if (((((X + _parent._x) < _parent.windowRightBorder) && ((X + _parent._x) > _parent.windowLeftBorder)) && ((Y + _parent._y) > _parent.windowUpBorder)) && ((Y + _parent._y) < _parent.windowDownBorder)) {
_root.playSound("bonus");
}
changeMoney(item.q);
removeMovieClip(item);
}
k++;
}
var k = 0;
while (k <= _parent.Kits.length) {
item = _parent.Kits[k];
R12 = ((item.X - X) * (item.X - X)) + ((item.Y - Y) * (item.Y - Y));
if ((R12 <= R0) && (item._currentframe == 1)) {
if (((((X + _parent._x) < _parent.windowRightBorder) && ((X + _parent._x) > _parent.windowLeftBorder)) && ((Y + _parent._y) > _parent.windowUpBorder)) && ((Y + _parent._y) < _parent.windowDownBorder)) {
_root.playSound("bonus");
}
changeDamage(item.q);
removeMovieClip(item);
}
k++;
}
var k = 0;
while (k <= _parent.Mines.length) {
item = _parent.Mines[k];
R12 = ((item.X - X) * (item.X - X)) + ((item.Y - Y) * (item.Y - Y));
if ((R12 <= R0) && (item._currentframe == 1)) {
if (((((X + _parent._x) < _parent.windowRightBorder) && ((X + _parent._x) > _parent.windowLeftBorder)) && ((Y + _parent._y) > _parent.windowUpBorder)) && ((Y + _parent._y) < _parent.windowDownBorder)) {
_root.playSound("explosion");
}
item.play();
changeDamage(item.q, "Fire");
}
k++;
}
var k = 1;
while (k <= (_parent.Spreads.length - 1)) {
item = _parent.Spreads[k];
R12 = ((item.X - X) * (item.X - X)) + ((item.Y - Y) * (item.Y - Y));
if ((R12 <= R0) && (item._currentframe == 1)) {
if (((((X + _parent._x) < _parent.windowRightBorder) && ((X + _parent._x) > _parent.windowLeftBorder)) && ((Y + _parent._y) > _parent.windowUpBorder)) && ((Y + _parent._y) < _parent.windowDownBorder)) {
_root.playSound("bonus");
}
_parent.takeSpread(item.X, item.Y);
item.removeMovieClip();
_parent.Spreads.splice(k, 1);
}
k++;
}
var k = 1;
while (k <= (_parent.Frozens.length - 1)) {
item = _parent.Frozens[k];
R12 = ((item.X - X) * (item.X - X)) + ((item.Y - Y) * (item.Y - Y));
if ((R12 <= R0) && (!isNaN(R12))) {
if (((((X + _parent._x) < _parent.windowRightBorder) && ((X + _parent._x) > _parent.windowLeftBorder)) && ((Y + _parent._y) > _parent.windowUpBorder)) && ((Y + _parent._y) < _parent.windowDownBorder)) {
_root.playSound("bonus");
}
appling = _parent.takeFrozen(numberofCar, item.X, item.Y);
item.removeMovieClip();
_parent.Frozens.splice(k, 1);
if (appling) {
bonus.gotoAndStop("FrozeApply");
} else {
bonus.gotoAndStop("FrozeCancel");
}
}
k++;
}
var k = 1;
while (k <= (_parent.Nukes.length - 1)) {
item = _parent.Nukes[k];
R12 = ((item.X - X) * (item.X - X)) + ((item.Y - Y) * (item.Y - Y));
if ((R12 <= R0) && (!isNaN(R12))) {
if (((((X + _parent._x) < _parent.windowRightBorder) && ((X + _parent._x) > _parent.windowLeftBorder)) && ((Y + _parent.Y) > _parent.windowUpBorder)) && ((Y + _parent._y) < _parent.windowDownBorder)) {
_root.playSound("bonus");
}
if (_parent.takeNuke(numberofCar, item.X, item.Y, item.q)) {
bonus.gotoAndStop("NukeApply");
} else {
bonus.gotoAndStop("NukeCancel");
}
item.removeMovieClip();
_parent.Nukes.splice(k, 1);
}
k++;
}
finishSpeedUp = function () {
clearInterval(intervalSpeedUp);
intervalSpeedUp = 0;
speedmax = speedmax0;
speed0 = speed0 / 2;
a = a0;
bonus.gotoAndStop("Empty");
};
var k = 0;
while (k <= _parent.SpeedUps.length) {
item = _parent.SpeedUps[k];
R12 = ((item.X - X) * (item.X - X)) + ((item.Y - Y) * (item.Y - Y));
if (((R12 <= R0) && (item._currentframe == 1)) && (!intervalSpeedUp)) {
removeMovieClip(item);
speedmax = 2 * speedmax0;
speed0 = 2 * speed0;
bonus.gotoAndStop("SpeedUp");
if (((((X + _parent._x) < _parent.windowRightBorder) && ((X + _parent._x) > _parent.windowLeftBorder)) && ((Y + _parent._y) > _parent.windowUpBorder)) && ((Y + _parent._y) < _parent.windowDownBorder)) {
_root.playSound("bonus");
}
var intervalSpeedUp = setInterval(finishSpeedUp, timeSpeedUp);
}
k++;
}
finishSlowDowns = function () {
clearInterval(intervalSlowDown);
speedmax = speedmax0;
intervalSlowDown = 0;
a = a0;
bonus.gotoAndStop("Empty");
};
var k = 0;
while (k <= _parent.SlowDowns.length) {
item = _parent.SlowDowns[k];
R12 = ((item.X - X) * (item.X - X)) + ((item.Y - Y) * (item.Y - Y));
if (((R12 <= R0) && (item._currentframe == 1)) && (!intervalSlowDown)) {
removeMovieClip(item);
if (((((X + _parent._x) < _parent.windowRightBorder) && ((X + _parent._x) > _parent.windowLeftBorder)) && ((Y + _parent._y) > _parent.windowUpBorder)) && ((Y + _parent._y) < _parent.windowDownBorder)) {
_root.playSound("bonus");
}
speedmax = speedmax0 / 2;
speed0 = speed0 / 2;
bonus.gotoAndStop("SlowDown");
var intervalSlowDown = setInterval(finishSlowDowns, timeSpeedUp);
}
k++;
}
finishShields = function () {
clearInterval(intervalShields);
intervalShields = 0;
underShield = false;
bonus.gotoAndStop("Empty");
};
var k = 1;
while (k <= (_parent.Shields.length - 1)) {
item = _parent.Shields[k];
R12 = ((item.X - X) * (item.X - X)) + ((item.Y - Y) * (item.Y - Y));
if ((R12 <= R0) && (!intervalShields)) {
item.removeMovieClip();
_parent.Shields.splice(k, 1);
underShield = true;
if (((((X + _parent._x) < _parent.windowRightBorder) && ((X + _parent._x) > _parent.windowLeftBorder)) && ((Y + _parent._y) > _parent.windowUpBorder)) && ((Y + _parent._y) < _parent.windowDownBorder)) {
_root.playSound("bonus");
}
bonus.gotoAndStop("Shield");
var intervalShields = setInterval(finishShields, timeShields);
}
k++;
}
finishThorns = function () {
clearInterval(intervalThorns);
intervalThorns = 0;
Power = Power0;
bonus.gotoAndStop("Empty");
};
var k = 1;
while (k <= (_parent.Thorns.length - 1)) {
item = _parent.Thorns[k];
R12 = ((item.X - X) * (item.X - X)) + ((item.Y - Y) * (item.Y - Y));
if ((R12 <= R0) && (!intervalThorns)) {
item.removeMovieClip();
_parent.Thorns.splice(k, 1);
Power = PowerThorns;
if (((((X + _parent._x) < _parent.windowRightBorder) && ((X + _parent._x) > _parent.windowLeftBorder)) && ((Y + _parent._y) > _parent.windowUpBorder)) && ((Y + _parent._y) < _parent.windowDownBorder)) {
_root.playSound("bonus");
}
bonus.gotoAndStop("Thorns");
var intervalThorns = setInterval(finishThorns, timeThorns);
}
k++;
}
if (Math.abs(speed) < (2 * ft)) {
ilock++;
if ((ilock == ilockkMax) && (movable)) {
placeIt();
}
} else {
ilock = 0;
}
i = Math.floor(((_x + (_parent.Xelement / 2)) - _parent.leftBorder) / _parent.Xelement);
j = Math.floor(((_y + (_parent.Yelement / 2)) - _parent.upBorder) / _parent.Yelement);
setDirection();
bonus._x = _x - 21;
bonus._y = _y - 48;
Symbol 1693 MovieClip [enemy1] Frame 3
gotoAndPlay (2);
Symbol 1693 MovieClip [enemy1] Frame 4
stop();
Symbol 1694 MovieClip [hero] Frame 1
function placeIt() {
_x = (_parent.leftBorder + (((i + Math.random()) - 0.5) * _parent.Xelement));
_y = (_parent.upBorder + (((j + Math.random()) - 0.5) * _parent.Yelement));
gotoAndPlay (2);
}
function motion(dir) {
switch (dir) {
case "left" :
mydr = speed / dr;
alpha = (alpha - ((speed0 / dr) * signofSpeed)) - wPlus;
break;
case "right" :
mydr = speed / dr;
alpha = (alpha + ((speed0 / dr) * signofSpeed)) + wPlus;
break;
case "up" :
if (speed0 <= speedmax) {
speed0 = speed0 + a;
}
break;
case "down" :
if (speed0 < (-speedmax)) {
break;
}
speed0 = speed0 - a;
}
}
function motionbyMouse() {
var _local2;
pX = _parent._xmouse;
pY = _parent._ymouse;
_local2 = Math.atan((pY - _y) / (pX - _x));
if ((pX - _x) >= 0) {
} else {
_local2 = _local2 + Math.PI;
}
_local2 = (_local2 * 180) / Math.PI;
if (_local2 < 0) {
_local2 = _local2 + 360;
}
if ((((_local2 - alpha) > 0) && ((_local2 - alpha) < 180)) or (((alpha - _local2) > 0) && ((alpha - _local2) > 180))) {
carvars.motionRight = true;
carvars.motionLeft = false;
carvars.afactor = -1;
}
if ((((_local2 - alpha) > 0) && ((_local2 - alpha) > 180)) or (((alpha - _local2) > 0) && ((alpha - _local2) < 180))) {
carvars.motionLeft = true;
carvars.motionRight = false;
carvars.afactor = 1;
}
if (Math.abs(_local2 - alpha) < mydr) {
alpha = _local2;
carvars.motionLeft = false;
carvars.motionRight = false;
carvars.afactor = 0;
}
carvars.motionUp = true;
}
function backXY() {
_x = X0;
_y = Y0;
alpha = alpha0;
}
function shoot() {
if (carvars.shootNumbers >= maxshootNumbers) {
_root.playSound("clipempty");
}
if ((carvars.shootNumbers < maxshootNumbers) && (started)) {
carvars.shootNumbers++;
_parent.shootNumbers++;
_parent.attachMovie(bulletsName, "bullet" + _parent.shootNumbers, _parent.getNextHighestDepth());
mybullet = eval ("_parent.bullet" + _parent.shootNumbers);
mybullet._x = _x;
mybullet._y = _y;
switch (weaponNumber) {
case 1 :
_root.playSound("plasmashot");
break;
case 2 :
_root.playSound("rocketshot");
}
onEnterFrame = function () {
mybullet.numberofCar = numberofCar;
mybullet.alpha = alpha;
mybullet.play();
delete onEnterFrame;
};
}
}
function defense() {
if (carvars.weaponDefenseNumber == 1) {
setOil();
} else {
setMine();
}
}
function setOil() {
var _local4;
var _local3;
if (carvars.defenseNumbers < maxDefenseNumbers) {
_root.playSound("spill");
carvars.defenseNumbers++;
_local4 = _x - (R01 * Math.sin(((alpha * Math.PI) / 180) + (Math.PI/2)));
_local3 = _y + (R01 * Math.cos(((alpha * Math.PI) / 180) + (Math.PI/2)));
_parent.setOil(_local4, _local3);
} else {
_root.playSound("clipempty");
}
}
function setMine() {
var _local4;
var _local3;
if (carvars.defenseNumbers < maxDefenseNumbers) {
_root.playSound("plant");
carvars.defenseNumbers++;
_local4 = _x - (R01 * Math.sin(((alpha * Math.PI) / 180) + (Math.PI/2)));
_local3 = _y + (R01 * Math.cos(((alpha * Math.PI) / 180) + (Math.PI/2)));
_parent.setMine(_local4, _local3);
} else {
_root.playSound("clipempty");
}
}
function changeMoney(q) {
carvars.money = carvars.money + q;
}
function changeDamage(q, kindOfStr) {
armor = 1;
if (q == undefined) {
q = 0;
}
switch (kindOfStr) {
case "Strike" :
armor = armorStrike;
break;
case "Fire" :
armor = armorFire;
}
if ((!underShield) or (q > 0)) {
damage = damage + (q / armor);
}
if ((damage <= 0) && (started)) {
die();
started = false;
}
if (damage > 100) {
damage = 100;
}
if ((damage < smokeDamageLevel) && ((((150 + (damage * 10)) - timeSmoke) > 10) or (!intervalSmoke))) {
timeSmoke = 150 + (damage * 10);
if (intervalSmoke) {
clearInterval(intervalSmoke);
}
var _local2 = setInterval(toSmoke, timeSmoke);
intervalSmoke = _local2;
}
if (intervalSmoke && (damage >= smokeDamageLevel)) {
clearInterval(intervalSmoke);
intervalSmoke = 0;
}
}
function explosion() {
bum.gotoAndPlay(1);
}
function die() {
clearInt();
_root.playSound("explosion");
carvars.otherway = otherway;
_parent.remove(thisObj, "hero");
stop();
}
function dieFinal() {
clearInt();
onEnterFrame = function () {
removeMovieClip(thisObj);
delete onEnterFrame;
};
}
Accelaration = [0, 0.6, 0.8, 1];
Rotation = [0, 2.6, 2.2, 1.8];
Drifting = [0, 0.073, 0.068, 0.06, 0.05];
armorStrikes = [0, 1, 2, 3];
armorFires = [0, 1, 1.5, 2, 3];
SpeedMax0 = [0, 10, 12, 14, 16];
dSMax = 2;
KSmax = _root.numberofGame;
hitPower = -0.1;
Power0 = -0.2;
ft = 0.2;
OilW = 10;
mydr = 0;
SpeedDDown = 0.05;
SpeedDmin = 1;
lasti = 0;
lastj = 0;
bum.stop();
kt = 1;
nofviews = 32;
alpha = 0;
alpha0 = 0;
viewN = 1;
R01 = 30;
R0 = R01 * R01;
timeenabled = true;
timetouching = 1;
restartTime = 500;
timeSpeedUp = 4000;
timeShields = 4000;
timeFroze = 2000;
timeThorns = 12000;
smokeDamageLevel = 30;
timeDust = 250;
SpeedDDust = 0.9;
speedFromWheels = 15;
speedFroze = 1;
PowerThorns = -100;
dBadGroundAccel = 0.25;
KfromP = 0.11;
formateCar = function () {
carvars = _parent.CarsVar[numberofCar];
wheelsNumber = carvars.wheelsNumber;
spoilerNumber = carvars.spoilerNumber;
armorNumber = carvars.armorNumber;
bumperNumber = carvars.bumperNumber;
motorNumber = carvars.motorNumber;
weaponNumber = carvars.weaponNumber;
weaponDefenseNumber = carvars.weaponDefenseNumber;
handlingNumber = carvars.handlingNumber;
maxshootNumbers = carvars.weaponAttackUpgrade;
maxDefenseNumbers = carvars.weaponDefenseUpgrade;
speedmax0 = SpeedMax0[motorNumber];
speedmax = speedmax0;
K0 = Drifting[(spoilerNumber + wheelsNumber) - 1];
K = K0;
dr = Rotation[handlingNumber];
a0 = Accelaration[motorNumber];
a = a0;
armorStrike = armorStrikes[bumperNumber];
armorFire = armorFires[armorNumber];
damage = 100;
Power = Power0;
boostEnabled = false;
wPlus = 0;
speed = 0;
speedX = 0;
speedY = 0;
speed0 = 0;
SpeedDX = 0;
SpeedDY = 0;
X = _x;
Y = _y;
signofSpeed = 1;
car.setImage(numberofCar, wheelsNumber, weaponNumber, bumperNumber, spoilerNumber);
bulletsName = "bullet" + weaponNumber;
underShield = false;
otherway = carvars.otherway;
switch (_parent.Directions[i][j]) {
case 1 :
alpha = 270;
break;
case 2 :
alpha = 90;
break;
case 3 :
alpha = 0;
break;
case 4 :
alpha = 180;
}
setDirection();
};
Start = function () {
started = true;
bonus = _parent.bonusonCar[numberofCar];
if (_parent.CarsVar[numberofCar].movable) {
gotoAndPlay (2);
} else {
stop();
}
};
restart = function () {
placeIt();
formateCar();
Start();
};
finishFroze = function () {
clearInterval(intervalFroze);
intervalFroze = 0;
a = a0;
speedmax = speedmax0;
bonus.gotoAndStop("Empty");
};
frozeIt = function () {
bonus.gotoAndStop("Froze");
speedmax = speedFroze;
speed0 = 0;
SpeedD = 0;
SpeedDX = 0;
SpeedDY = 0;
if (!intervalFroze) {
var _local1 = setInterval(finishFroze, timeFroze);
intervalFroze = _local1;
}
};
toSmoke = function () {
if (!_parent.paused) {
_parent.SmokeNumber++;
_parent.attachMovie("smoke", "smoke" + _parent.SmokeNumber, _parent.getNextHighestDepth());
item = eval ("_parent.smoke" + _parent.SmokeNumber);
item._x = X;
item._y = Y;
}
};
setDirection = function () {
if (alpha > 360) {
alpha = alpha - 360;
}
if (alpha < 0) {
alpha = alpha + 360;
}
viewN = Math.round((alpha * nofviews) / 360) + 1;
if (viewN < 0) {
viewN = nofviews + viewN;
}
if (viewN > nofviews) {
viewN = 0;
}
car.gotoAndStop(viewN);
};
finishlap = function () {
carvars.lapsCompleted++;
_root.playSound("lap");
if (carvars.lapsCompleted == _parent.maxLapsNumber) {
clearInt();
carvars.movable = false;
gotoAndStop (1);
_parent.finish();
} else {
_parent.bonusPlus();
}
carvars.shootNumbers = 0;
carvars.defenseNumbers = 0;
};
clearInt = function () {
delete onEnterFrame;
if (intervalFroze) {
clearInterval(intervalFroze);
}
if (intervalSpeedUp) {
clearInterval(intervalSpeedUp);
}
if (intervalSlowDown) {
clearInterval(intervalSlowDown);
}
if (intervalShields) {
clearInterval(intervalShields);
}
if (intervalThorns) {
clearInterval(intervalThorns);
}
if (intervalSmoke) {
clearInterval(intervalSmoke);
}
if (intervalDust) {
clearInterval(intervalDust);
}
};
thisObj = this;
stop();
Symbol 1694 MovieClip [hero] Frame 2
alpha0 = alpha;
if (carvars.rulebyMouse) {
motionbyMouse();
}
if (carvars.motionUp) {
motion("up");
}
if (carvars.motionDown) {
motion("down");
}
if (carvars.motionRight) {
motion("right");
}
if (carvars.motionLeft) {
motion("left");
}
carIsTouched = false;
if (Math.abs(speed0) > ft) {
speed0 = (speed0 * (Math.abs(speed0) - ft)) / Math.abs(speed0);
} else {
speed0 = 0;
}
if (speed0 > 0) {
signofSpeed = 1;
} else {
signofSpeed = -1;
}
if ((carvars.motionRight or carvars.motionLeft) or SpeedDX) {
SpeedDX = SpeedDX - (((speed0 * carvars.afactor) * K) * Math.sin((alpha * Math.PI) / 180));
} else {
SpeedDX = 0;
}
if ((carvars.motionRight or carvars.motionLeft) or SpeedDY) {
SpeedDY = SpeedDY + (((speed0 * carvars.afactor) * K) * Math.cos((alpha * Math.PI) / 180));
} else {
SpeedDY = 0;
}
speedX = (speed0 * Math.cos((alpha * Math.PI) / 180)) + SpeedDX;
speedY = (speed0 * Math.sin((alpha * Math.PI) / 180)) + SpeedDY;
speed = Math.sqrt((speedX * speedX) + (speedY * speedY));
SpeedD = Math.sqrt((SpeedDX * SpeedDX) + (SpeedDY * SpeedDY));
SpeedD0 = SpeedD;
if (SpeedD > (SpeedDDown * speed0)) {
SpeedD = Math.sqrt((SpeedDX * SpeedDX) + (SpeedDY * SpeedDY)) - ((SpeedDDown * speed0) * signofSpeed);
if (SpeedD0 > 0) {
kt = SpeedD / SpeedD0;
} else {
kt = 0;
}
SpeedDX = SpeedDX * kt;
SpeedDY = SpeedDY * kt;
} else {
SpeedDX = 0;
SpeedDY = 0;
kt = 1;
}
SpeedD = Math.sqrt((SpeedDY * SpeedDY) + (SpeedDX * SpeedDX));
X0 = _x;
Y0 = _y;
X = _x + speedX;
Y = _y + speedY;
Z = 0;
if ((_parent.Grounds[i][j] == 14) or (_parent.Grounds[i][j] == 15)) {
Z = (((Math.random() - 0.5) * speed0) * 2) / 3;
a = dBadGroundAccel;
} else if (a == dBadGroundAccel) {
a = a0;
}
if ((_parent.Grounds[i][j] == 17) or (_parent.Grounds[i][j] == 20)) {
K = KfromP;
} else if (K == KfromP) {
K = K0;
}
YF = Y + Z;
if (_parent.testOnMotion(X, YF)) {
_x = X;
_y = YF;
} else {
_root.playSound("collision");
changeDamage(hitPower, "Strike");
if (Math.abs(speed0) > (40 * ft)) {
speed0 = (speed0 * (Math.abs(speed0) - (2 * ft))) / Math.abs(speed0);
}
X = _x + speedX;
Y = _y;
if (_parent.testOnMotion(X, Y)) {
_x = X;
_y = Y;
} else {
X = _x;
Y = _y + speedY;
if (_parent.testOnMotion(X, Y)) {
_x = X;
_y = Y;
}
}
}
i = Math.floor(((X + (_parent.Xelement / 2)) - _parent.leftBorder) / _parent.Xelement);
j = Math.floor(((Y + (_parent.Yelement / 2)) - _parent.upBorder) / _parent.Yelement);
var k = 0;
while (k <= _parent.Cars.length) {
if (k != numberofCar) {
enemy = _parent.Cars[k];
R12 = ((enemy._x - X) * (enemy._x - X)) + ((enemy._y - Y) * (enemy._y - Y));
if ((R12 < R0) && (speed >= enemy.speed)) {
backXY();
_root.playSound("collision");
enemy.SpeedDX = enemy.SpeedDX + (speedX / 3);
enemy.SpeedDY = enemy.SpeedDY + (speedY / 3);
enemy.SpeedD = Math.sqrt((enemy.SpeedDX * enemy.SpeedDX) + (enemy.SpeedDY * enemy.SpeedDY));
enemy.backXY();
enemy.carIsTouched = true;
var ePower = enemy.Power;
enemy.changeDamage(Power, "Strike");
speed0 = speed0 / 2;
SpeedDX = SpeedDX / 2;
SpeedDY = SpeedDY / 2;
SpeedD = SpeedD / 2;
changeDamage(ePower, "Strike");
_x = X0;
_y = Y0;
}
}
k++;
}
var k = 0;
while (k <= _parent.Boxes.length) {
item = _parent.Boxes[k];
R12 = ((item.X - X) * (item.X - X)) + ((item.Y - Y) * (item.Y - Y));
if ((R12 <= R0) && (item._currentframe == 1)) {
_root.playSound("wood");
item.play();
if (speed0 != 0) {
speed0 = speed0 - (((speedmax / 3) * Math.abs(speed0)) / speed0);
}
SpeedDX = (2 * SpeedDX) / 3;
SpeedDY = (2 * SpeedDY) / 3;
SpeedD = (2 * SpeedD) / 3;
changeDamage(item.q, "Strike");
}
k++;
}
var k = 1;
while (k <= (_parent.Wheels.length - 1)) {
item = _parent.Wheels[k];
R12 = ((item.X - X) * (item.X - X)) + ((item.Y - Y) * (item.Y - Y));
if (R12 <= R0) {
_root.playSound("tires");
if ((_parent.Directions[i][j] == 1) or (_parent.Directions[i][j] == 2)) {
if (item.X < X) {
SpeedDX = speed0;
} else {
SpeedDX = -speed0;
}
changeDamage(item.q, "Strike");
}
if ((_parent.Directions[i][j] == 3) or (_parent.Directions[i][j] == 4)) {
if (item.Y < Y) {
SpeedDY = speed0;
} else {
SpeedDY = -speed0;
}
}
SpeedD = Math.sqrt((SpeedDY * SpeedDY) + (SpeedDX * SpeedDX));
}
k++;
}
finishOilW = function () {
if (intervalOil) {
carvars.motionRight = false;
}
clearInterval(intervalOil);
intervalOil = 0;
wPlus = 0;
};
var k = 0;
while (k <= _parent.Oils.length) {
item = _parent.Oils[k];
R12 = ((item.X - X) * (item.X - X)) + ((item.Y - Y) * (item.Y - Y));
if ((R12 <= R0) && (item._currentframe == 1)) {
_root.playSound("slip");
item.play();
carvars.motionRight = true;
wPlus = OilW;
var intervalOil = setInterval(finishOilW, 200);
}
k++;
}
if ((((_parent.Fitches[i][j] == "A") or (_parent.Fitches[i][j] == "B")) or (_parent.Fitches[i][j] == "C")) or (_parent.Fitches[i][j] == "D")) {
switch (_parent.Directions[i][j]) {
case 1 :
if (((X - ((i - 0.5) * _parent.Xelement)) < (_parent.Xelement / 6)) && ((X - ((i - 0.5) * _parent.Xelement)) > ((-_parent.Xelement) / 6))) {
if (!boosted) {
boosted = true;
_root.playSound("boost");
}
SpeedDY = -speedmax;
}
break;
case 2 :
if (((X - ((i - 0.5) * _parent.Xelement)) < (_parent.Xelement / 6)) && ((X - ((i - 0.5) * _parent.Xelement)) > ((-_parent.Xelement) / 6))) {
if (!boosted) {
boosted = true;
_root.playSound("boost");
}
SpeedDY = speedmax;
}
break;
case 3 :
if (((Y - ((j - 0.5) * _parent.Yelement)) < (_parent.Yelement / 6)) && ((Y - ((j - 0.5) * _parent.Yelement)) > ((-_parent.Yelement) / 6))) {
if (!boosted) {
boosted = true;
_root.playSound("boost");
}
SpeedDX = speedmax;
}
break;
case 4 :
if (!(((Y - ((j - 0.5) * _parent.Yelement)) < (_parent.Yelement / 6)) && ((Y - ((j - 0.5) * _parent.Yelement)) > ((-_parent.Yelement) / 6)))) {
break;
}
if (!boosted) {
boosted = true;
_root.playSound("boost");
}
SpeedDX = -speedmax;
}
SpeedD = Math.sqrt((SpeedDY * SpeedDY) + (SpeedDX * SpeedDX));
}
if ((Math.abs(SpeedD) < Math.abs(speedmax / 2)) && (boosted)) {
boosted = false;
}
var k = 0;
while (k <= _parent.Moneys.length) {
item = _parent.Moneys[k];
R12 = ((item.X - X) * (item.X - X)) + ((item.Y - Y) * (item.Y - Y));
if ((R12 <= R0) && (item._currentframe == 1)) {
_root.playSound("bonus");
changeMoney(item.q);
bonus.gotoAndStop("takeMoney");
bonus.setQ(item.q);
removeMovieClip(item);
}
k++;
}
var k = 0;
while (k <= _parent.Kits.length) {
item = _parent.Kits[k];
R12 = ((item.X - X) * (item.X - X)) + ((item.Y - Y) * (item.Y - Y));
if ((R12 <= R0) && (item._currentframe == 1)) {
_root.playSound("bonus");
changeDamage(item.q);
removeMovieClip(item);
}
k++;
}
var k = 0;
while (k <= _parent.Mines.length) {
item = _parent.Mines[k];
R12 = ((item.X - X) * (item.X - X)) + ((item.Y - Y) * (item.Y - Y));
if ((R12 <= R0) && (item._currentframe == 1)) {
_root.playSound("explosion");
item.play();
changeDamage(item.q, "Fire");
}
k++;
}
var k = 1;
while (k <= (_parent.Spreads.length - 1)) {
item = _parent.Spreads[k];
R12 = ((item.X - X) * (item.X - X)) + ((item.Y - Y) * (item.Y - Y));
if ((R12 <= R0) && (item._currentframe == 1)) {
_root.playSound("bonus");
_parent.takeSpread(item.X, item.Y);
item.removeMovieClip();
_parent.Spreads.splice(k, 1);
}
k++;
}
var k = 1;
while (k <= (_parent.Frozens.length - 1)) {
item = _parent.Frozens[k];
R12 = ((item.X - X) * (item.X - X)) + ((item.Y - Y) * (item.Y - Y));
if ((R12 <= R0) && (item._currentframe == 1)) {
_root.playSound("bonus");
appling = _parent.takeFrozen(numberofCar, item.X, item.Y);
item.removeMovieClip();
_parent.Frozens.splice(k, 1);
if (appling) {
bonus.gotoAndStop("FrozeApply");
} else {
bonus.gotoAndStop("FrozeCancel");
}
}
k++;
}
var k = 1;
while (k <= (_parent.Nukes.length - 1)) {
item = _parent.Nukes[k];
R12 = ((item.X - X) * (item.X - X)) + ((item.Y - Y) * (item.Y - Y));
if ((R12 <= R0) && (item._currentframe == 1)) {
_root.playSound("bonus");
if (_parent.takeNuke(numberofCar, item.X, item.Y, item.q)) {
bonus.gotoAndStop("NukeApply");
} else {
bonus.gotoAndStop("NukeCancel");
}
item.removeMovieClip();
_parent.Nukes.splice(k, 1);
}
k++;
}
finishSpeedUp = function () {
clearInterval(intervalSpeedUp);
intervalSpeedUp = 0;
speedmax = speedmax0;
speed0 = speed0 / 2;
a = a0;
bonus.gotoAndStop("Empty");
};
var k = 0;
while (k <= _parent.SpeedUps.length) {
item = _parent.SpeedUps[k];
R12 = ((item.X - X) * (item.X - X)) + ((item.Y - Y) * (item.Y - Y));
if (((R12 <= R0) && (item._currentframe == 1)) && (!intervalSpeedUp)) {
removeMovieClip(item);
speedmax = 2 * speedmax0;
speed0 = 2 * speed0;
bonus.gotoAndStop("SpeedUp");
_root.playSound("bonus");
var intervalSpeedUp = setInterval(finishSpeedUp, timeSpeedUp);
}
k++;
}
finishSlowDowns = function () {
clearInterval(intervalSlowDown);
speedmax = speedmax0;
intervalSlowDown = 0;
a = a0;
bonus.gotoAndStop("Empty");
};
var k = 0;
while (k <= _parent.SlowDowns.length) {
item = _parent.SlowDowns[k];
R12 = ((item.X - X) * (item.X - X)) + ((item.Y - Y) * (item.Y - Y));
if (((R12 <= R0) && (item._currentframe == 1)) && (!intervalSlowDown)) {
removeMovieClip(item);
_root.playSound("bonus");
speedmax = speedmax0 / 2;
speed0 = speed0 / 2;
bonus.gotoAndStop("SlowDown");
var intervalSlowDown = setInterval(finishSlowDowns, timeSpeedUp);
}
k++;
}
finishShields = function () {
clearInterval(intervalShields);
intervalShields = 0;
underShield = false;
bonus.gotoAndStop("Empty");
};
var k = 1;
while (k <= (_parent.Shields.length - 1)) {
item = _parent.Shields[k];
R12 = ((item.X - X) * (item.X - X)) + ((item.Y - Y) * (item.Y - Y));
if ((R12 <= R0) && (!intervalShields)) {
item.removeMovieClip();
_parent.Shields.splice(k, 1);
underShield = true;
_root.playSound("bonus");
bonus.gotoAndStop("Shield");
var intervalShields = setInterval(finishShields, timeShields);
}
k++;
}
finishThorns = function () {
clearInterval(intervalThorns);
intervalThorns = 0;
Power = Power0;
bonus.gotoAndStop("Empty");
};
var k = 1;
while (k <= (_parent.Thorns.length - 1)) {
item = _parent.Thorns[k];
R12 = ((item.X - X) * (item.X - X)) + ((item.Y - Y) * (item.Y - Y));
if ((R12 <= R0) && (!intervalThorns)) {
item.removeMovieClip();
_parent.Thorns.splice(k, 1);
Power = PowerThorns;
_root.playSound("bonus");
bonus.gotoAndStop("Thorns");
var intervalThorns = setInterval(finishThorns, timeThorns);
}
k++;
}
setDirection();
toDust = function () {
if (!_parent.paused) {
_root.playSound("friction");
_parent.DustNumber++;
_parent.attachMovie("dust", "dust" + _parent.DustNumber, _parent.getNextHighestDepth());
item = eval ("_parent.dust" + _parent.DustNumber);
item._x = X;
item._y = Y;
}
};
if (((SpeedD > SpeedDDust) && (!intervalDust)) && (carvars.motionRight or carvars.motionLeft)) {
var myIntervalDust = setInterval(toDust, timeDust);
intervalDust = myIntervalDust;
}
if ((intervalDust && (SpeedD < SpeedDDust)) or ((!carvars.motionRight) and (!carvars.motionLeft))) {
clearInterval(intervalDust);
intervalDust = 0;
}
if (carIsTouched) {
backXY();
}
i = Math.floor(((_x + (_parent.Xelement / 2)) - _parent.leftBorder) / _parent.Xelement);
j = Math.floor(((_y + (_parent.Yelement / 2)) - _parent.upBorder) / _parent.Yelement);
nextroud = false;
if ((_parent.GroundsNumbers[i][j] >= (carvars.lastFieldNumber + 1)) && (_parent.GroundsNumbers[i][j] <= (carvars.lastFieldNumber + 2))) {
nextroud = true;
}
if (((_parent.GroundsNumbers[i][j] + _parent.maxRoadNumber) >= (carvars.lastFieldNumber + 1)) && ((_parent.GroundsNumbers[i][j] + _parent.maxRoadNumber) <= (carvars.lastFieldNumber + 2))) {
nextroud = true;
}
if ((((lasti != i) or (lastj != j)) && (_parent.GroundsNumbers[i][j] == _parent.GroundsNumbers[lasti][lastj])) or (_parent.Grounds[i][j] == "s")) {
otherway = true;
carvars.lastFieldNumber = _parent.GroundsNumbers[lasti][lastj];
}
if (otherway && (_parent.GroundsNumbers[i][j] > carvars.lastFieldNumber)) {
nextroud = true;
otherway = false;
}
if (otherway && (_parent.GroundsNumbers[i][j] < carvars.lastFieldNumber)) {
otherway = false;
}
if (nextroud) {
carvars.lastFieldNumber = _parent.GroundsNumbers[i][j];
if (_parent.maxRoadNumber == carvars.lastFieldNumber) {
carvars.lastFieldNumber = 0;
}
if ((carvars.lastFieldNumber == 2) && (_parent.GroundsNumbers[i][j] == 2)) {
if (carvars.notfirstlap) {
finishlap();
} else {
carvars.notfirstlap = true;
}
}
}
lasti = i;
lastj = j;
bonus._x = _x - 21;
bonus._y = _y - 48;
Symbol 1694 MovieClip [hero] Frame 3
gotoAndPlay (2);
Symbol 1694 MovieClip [hero] Frame 4
stop();
Symbol 1755 MovieClip [dust] Frame 32
stop();
removeMovieClip(this);
Symbol 1788 MovieClip [smoke] Frame 18
stop();
removeMovieClip(this);
Symbol 1823 MovieClip [light3] Frame 1
stop();
Symbol 1823 MovieClip [light3] Frame 2
stop();
_root.playSound("greenbeam");
Symbol 1828 MovieClip [light1] Frame 1
stop();
Symbol 1828 MovieClip [light1] Frame 2
stop();
_root.playSound("redbeam");
Symbol 1833 MovieClip [light2] Frame 1
stop();
Symbol 1833 MovieClip [light2] Frame 2
stop();
_root.playSound("redbeam");
Symbol 1847 MovieClip Frame 3
gotoAndPlay (1);
Symbol 1847 MovieClip Frame 9
stop();
_parent.removeMovieClip();
Symbol 1848 MovieClip [bullet1] Frame 1
speed = 30;
power0 = -10;
level = 1;
power = power0 * 2;
i = 0;
R0 = 40;
thisObj = this;
if (_parent.Cars.length) {
carsLength = _parent.Cars.length;
} else {
carsLength = 0;
}
_visible = false;
stop();
Symbol 1848 MovieClip [bullet1] Frame 2
_x = (_x + (50 * Math.sin(((alpha * Math.PI) / 180) + (Math.PI/2))));
_y = (_y - (50 * Math.cos(((alpha * Math.PI) / 180) + (Math.PI/2))));
_visible = true;
Symbol 1848 MovieClip [bullet1] Frame 3
stop();
X = _x + (speed * Math.sin(((alpha * Math.PI) / 180) + (Math.PI/2)));
Y = _y - (speed * Math.cos(((alpha * Math.PI) / 180) + (Math.PI/2)));
changeflag = false;
_x = X;
_y = Y;
i++;
if ((((_x > _parent.leftBorder) && (_x < _parent.rightBorder)) && (_y > _parent.upBorder)) && (_y < _parent.downBorder)) {
play();
} else {
removeMovieClip(thisObj);
}
var k = 0;
while (k <= carsLength) {
if (k != numberofCar) {
enemy = _parent.Cars[k];
R12 = Math.sqrt(((enemy._x - _x) * (enemy._x - _x)) + ((enemy._y - _y) * (enemy._y - _y)));
if (R12 < R0) {
if (((((_x + _parent._x) < _parent.windowRightBorder) && ((_x + _parent._x) > _parent.windowLeftBorder)) && ((_y + _parent._y) > _parent.windowUpBorder)) && ((_y + _parent._y) < _parent.windowDownBorder)) {
_root.playSound("plasmadamage");
}
enemy.changeDamage(power, "Fire");
star.stop();
onEnterFrame = function () {
star.gotoAndPlay("del");
delete onEnterFrame;
};
stop();
}
}
k++;
}
Symbol 1848 MovieClip [bullet1] Frame 4
i++;
X = _x + (speed * Math.sin(((alpha * Math.PI) / 180) + (Math.PI/2)));
Y = _y - (speed * Math.cos(((alpha * Math.PI) / 180) + (Math.PI/2)));
changeflag = false;
_x = X;
_y = Y;
if ((((_x > _parent.leftBorder) && (_x < _parent.rightBorder)) && (_y > _parent.upBorder)) && (_y < _parent.downBorder)) {
gotoAndPlay (3);
} else {
removeMovieClip(thisObj);
}
var k = 0;
while (k <= carsLength) {
if (k != numberofCar) {
enemy = _parent.Cars[k];
R12 = Math.sqrt(((enemy._x - _x) * (enemy._x - _x)) + ((enemy._y - _y) * (enemy._y - _y)));
if (R12 < R0) {
if (((((_x + _parent._x) < _parent.windowRightBorder) && ((_x + _parent._x) > _parent.windowLeftBorder)) && ((_y + _parent._y) > _parent.windowUpBorder)) && ((_y + _parent._y) < _parent.windowDownBorder)) {
_root.playSound("plasmadamage");
}
enemy.changeDamage(power, "Fire");
star.stop();
onEnterFrame = function () {
star.gotoAndPlay("del");
delete onEnterFrame;
};
}
}
k++;
}
Symbol 1874 MovieClip [bonusonCar] Frame 1
stop();
setQ = function (valueQ) {
Q = valueQ;
};
Symbol 1874 MovieClip [bonusonCar] Frame 2
stop();
Symbol 1874 MovieClip [bonusonCar] Frame 3
stop();
Symbol 1874 MovieClip [bonusonCar] Frame 4
stop();
Symbol 1874 MovieClip [bonusonCar] Frame 5
stop();
Symbol 1874 MovieClip [bonusonCar] Frame 6
stop();
timer = _parent.timeHeadler;
i = 0;
onEnterFrame = function () {
i++;
if (i == timer) {
delete onEnterFrame;
gotoAndStop ("Empty");
}
};
Symbol 1874 MovieClip [bonusonCar] Frame 7
stop();
timer = _parent.timeHeadler;
i = 0;
onEnterFrame = function () {
i++;
if (i == timer) {
delete onEnterFrame;
gotoAndStop ("Empty");
}
};
Symbol 1874 MovieClip [bonusonCar] Frame 8
stop();
timer = _parent.timeHeadler;
i = 0;
onEnterFrame = function () {
i++;
if (i == timer) {
delete onEnterFrame;
gotoAndStop ("Empty");
}
};
Symbol 1874 MovieClip [bonusonCar] Frame 9
stop();
timer = _parent.timeHeadler;
i = 0;
onEnterFrame = function () {
i++;
if (i == timer) {
delete onEnterFrame;
gotoAndStop ("Empty");
}
};
Symbol 1874 MovieClip [bonusonCar] Frame 10
stop();
Symbol 1874 MovieClip [bonusonCar] Frame 11
stop();
timer = _parent.timeHeadler;
i = 0;
onEnterFrame = function () {
i++;
q = Q;
if (i == timer) {
delete onEnterFrame;
gotoAndStop ("Empty");
}
};
Symbol 1904 MovieClip Frame 1
stop();
Symbol 1904 MovieClip Frame 3
play();
Symbol 1904 MovieClip Frame 4
stop();
Symbol 1904 MovieClip Frame 5
play();
Symbol 1904 MovieClip Frame 6
stop();
Symbol 1904 MovieClip Frame 7
play();
Symbol 1904 MovieClip Frame 8
stop();
Symbol 1904 MovieClip Frame 9
play();
Symbol 1904 MovieClip Frame 10
stop();
Symbol 1904 MovieClip Frame 11
play();
Symbol 1904 MovieClip Frame 12
stop();
Symbol 1904 MovieClip Frame 13
play();
Symbol 1904 MovieClip Frame 14
stop();
Symbol 1904 MovieClip Frame 15
play();
Symbol 1904 MovieClip Frame 16
stop();
Symbol 1904 MovieClip Frame 17
play();
Symbol 1904 MovieClip Frame 18
stop();
Symbol 1904 MovieClip Frame 19
play();
Symbol 1904 MovieClip Frame 20
stop();
Symbol 1904 MovieClip Frame 21
play();
Symbol 1904 MovieClip Frame 22
stop();
Symbol 1904 MovieClip Frame 23
play();
Symbol 1904 MovieClip Frame 24
stop();
Symbol 1904 MovieClip Frame 25
play();
Symbol 1904 MovieClip Frame 26
stop();
Symbol 1904 MovieClip Frame 27
play();
Symbol 1904 MovieClip Frame 28
stop();
Symbol 1904 MovieClip Frame 29
play();
Symbol 1904 MovieClip Frame 30
stop();
Symbol 1904 MovieClip Frame 31
play();
Symbol 1904 MovieClip Frame 32
stop();
Symbol 1904 MovieClip Frame 33
play();
Symbol 1904 MovieClip Frame 34
stop();
Symbol 1904 MovieClip Frame 35
play();
Symbol 1904 MovieClip Frame 36
stop();
Symbol 1904 MovieClip Frame 37
play();
Symbol 1904 MovieClip Frame 38
stop();
Symbol 1904 MovieClip Frame 39
play();
Symbol 1904 MovieClip Frame 40
stop();
Symbol 1904 MovieClip Frame 41
play();
Symbol 1904 MovieClip Frame 42
stop();
Symbol 1906 MovieClip Frame 1
distanceX = 240;
distanceY = 180;
Symbol 1906 MovieClip Frame 2
del = (_parent.myCar.X + _parent._x) - _parent.windowLeftBorder;
if (del < distanceX) {
_parent._x = (_parent._x + distanceX) - del;
}
del = ((-_parent.myCar.X) - _parent._x) + _parent.windowRightBorder;
if (del < distanceX) {
_parent._x = (_parent._x - distanceX) + del;
}
del = (_parent.myCar.Y + _parent._y) - _parent.windowUpBorder;
if (del < distanceY) {
_parent._y = (_parent._y + distanceY) - del;
}
del = ((-_parent.myCar.Y) - _parent._y) + _parent.windowDownBorder;
if (del < distanceY) {
_parent._y = (_parent._y - distanceY) + del;
}
Symbol 1906 MovieClip Frame 3
gotoAndPlay (2);
Symbol 1907 MovieClip Frame 1
function remove(mc, Source) {
var bum;
var ii;
var jj;
var x;
var y;
var carName;
var timer;
var car;
var carNumber;
var thisObj;
var bonus;
thisObj = this;
carNumber = mc.numberofCar;
ii = mc.i;
jj = mc.j;
x = mc._x;
y = mc._y;
carName = mc._name;
mc.removeMovieClip();
bonusonCar[carNumber].removeMovieClip();
bum = explosion(x, y);
timer = 0;
bum.onEnterFrame = function () {
if (!paused) {
timer++;
}
if (timer == (restartTime - 2)) {
attachMovie(Source, carName, thisObj.getNextHighestDepth());
car = eval (carName);
car._x = x;
car._y = y;
car._visible = false;
Cars[carNumber] = car;
Cars[carNumber].numberofCar = carNumber;
attachMovie("bonusonCar", "bonus" + carNumber, thisObj.getNextHighestDepth());
bonus = eval ("bonus" + carNumber);
bonusonCar[carNumber] = bonus;
}
if (timer == restartTime) {
Cars[carNumber].i = ii;
Cars[carNumber].j = jj;
car._visible = true;
car.restart();
delete onEnterFrame;
removeMovieClip(bum);
}
};
}
windowLeftBorder = 0;
windowRightBorder = 480;
windowUpBorder = 0;
windowDownBorder = 360;
windowWidth = windowRightBorder - windowLeftBorder;
windowHeight = windowDownBorder - windowUpBorder;
Xelement = 180;
Yelement = 180;
thisObj = this;
Grounds = new Array();
maxGroundsPictures = 12;
timeHeadler = 50;
translator = function (S) {
var _local2 = new Array();
_local2[0] = new Array();
var _local3 = 0;
var _local1 = 0;
var _local4 = 0;
st = "";
do {
s0 = S.substr(_local4, 1);
if (s0 == ",") {
_local2[_local1][_local3] = st;
_local1++;
if (!_local2[_local1]) {
_local2[_local1] = new Array();
}
st = "";
}
if (s0 == ";") {
_local2[_local1][_local3] = st;
st = "";
_local1 = 0;
_local3++;
}
if ((s0 != ";") && (s0 != ",")) {
st = st + s0;
}
_local4++;
} while (_local4 < S.length);
_local2[_local1][_local3] = st;
return(_local2);
};
begin = function () {
begins = true;
levelConstruktor = _parent.level[_parent.numberofLevel];
numberofXField = levelConstruktor.numberofXField;
numberofYField = levelConstruktor.numberofYField;
myWidth = Xelement * numberofXField;
myHeight = Yelement * numberofYField;
leftBorder = -100;
_x = leftBorder;
rightBorder = leftBorder + myWidth;
upBorder = -100;
_y = upBorder;
downBorder = upBorder + myHeight;
SmokeNumber = 0;
DustNumber = 0;
Boxes = new Array();
numberofBoxes = 0;
Wheels = new Array();
numberofWheels = 0;
Boosts = new Array();
numberofBoosts = 0;
Arrows = new Array();
numberofArrows = 0;
numberofOils0 = levelConstruktor.numberofOils0;
numberofOils = 0;
Oils = new Array();
numberofMoney = 0;
numberofMoney0 = levelConstruktor.numberofMoney;
numberofBMoney = 0;
numberofBMoney0 = levelConstruktor.numberofBMoney;
Moneys = new Array();
numberofKits = 0;
numberofKits0 = levelConstruktor.numberofKits;
numberofBKits = 0;
numberofBKits0 = levelConstruktor.numberofBKits;
Kits = new Array();
numberofMines0 = levelConstruktor.numberofMines0;
numberofMines = 0;
Mines = new Array();
numberofSpeedUp = 0;
SpeedUps = new Array();
numberofSlowDown = 0;
SlowDowns = new Array();
numberofShields = 0;
Shields = new Array();
numberofSpreads = 0;
Spreads = new Array();
spreadsBulletNumber = 16;
numberofBulletSpread = 0;
numberofFrozens = 0;
Frozens = new Array();
numberofNukes = 0;
Nukes = new Array();
Thorns = new Array();
numberofThorns = 0;
numberofBonuses = 7;
Fitches = levelConstruktor.Fitches;
maxRoadNumber = levelConstruktor.maxRoadNumber;
maxLapsNumber = levelConstruktor.maxLapsNumber;
numberofGrounds = 0;
bordersNumber = 0;
numberOfArcs = 0;
bumNumber = 0;
RAppl = 200;
Grounds = translator(levelConstruktor.Grounds);
GroundsNumbers = translator(levelConstruktor.GroundsNumbers);
Fitches = translator(levelConstruktor.Fitches);
Directions = translator(levelConstruktor.Directions);
Way = new Array();
Way = [[0, 0]];
var _local3 = 0;
while (_local3 <= (numberofXField - 1)) {
var _local2 = 0;
while (_local2 <= (numberofYField - 1)) {
if (!isNaN(Grounds[_local3][_local2])) {
Grounds[_local3][_local2] = Number(Grounds[_local3][_local2]);
}
Directions[_local3][_local2] = Number(Directions[_local3][_local2]);
GroundsNumbers[_local3][_local2] = Number(GroundsNumbers[_local3][_local2]);
_local2++;
}
_local3++;
}
_local3 = 0;
while (_local3 <= (numberofXField - 1)) {
var _local2 = 0;
while (_local2 <= (numberofYField - 1)) {
switch (Grounds[_local3][_local2]) {
case 0 :
setGround1(_local3, _local2, 0);
break;
case "s" :
setGround1(_local3, _local2, "s");
break;
case 1 :
setRoad(_local3, _local2, "vertical", 1);
break;
case 2 :
setRoad(_local3, _local2, "vertical", 1);
break;
case 3 :
setRoad(_local3, _local2, "horizontal", 1);
break;
case 4 :
setRoad(_local3, _local2, "horizontal", 1);
break;
case 5 :
setCorner(_local3, _local2, "leftup");
break;
case 6 :
setCorner(_local3, _local2, "leftdown");
break;
case 7 :
setCorner(_local3, _local2, "rightup");
break;
case 8 :
setCorner(_local3, _local2, "rightdown");
break;
case 9 :
setTRoad(_local3, _local2, "left");
break;
case 10 :
setTRoad(_local3, _local2, "right");
break;
case 11 :
setTRoad(_local3, _local2, "up");
break;
case 12 :
setTRoad(_local3, _local2, "down");
break;
case 13 :
setXRoad(_local3, _local2);
break;
case 14 :
setRoad(_local3, _local2, "vertical", 2);
break;
case 15 :
setRoad(_local3, _local2, "horizontal", 2);
break;
case 16 :
setRoad(_local3, _local2, "horizontal", 3);
break;
case 17 :
setRoad(_local3, _local2, "horizontal", 4);
break;
case 18 :
setRoad(_local3, _local2, "horizontal", 5);
break;
case 19 :
setRoad(_local3, _local2, "vertical", 3);
break;
case 20 :
setRoad(_local3, _local2, "vertical", 4);
break;
case 21 :
setRoad(_local3, _local2, "vertical", 5);
}
if (Fitches[_local3][_local2]) {
switch (Fitches[_local3][_local2]) {
case "a" :
setaBoxes(_local3, _local2);
break;
case "b" :
setbBoxes(_local3, _local2);
break;
case "c" :
setcBoxes(_local3, _local2);
break;
case "d" :
setdBoxes(_local3, _local2);
break;
case "e" :
seteBoxes(_local3, _local2);
break;
case "f" :
setfBoxes(_local3, _local2);
break;
case "g" :
setgBoxes(_local3, _local2);
break;
case "h" :
sethBoxes(_local3, _local2);
break;
case "i" :
setiBoxes(_local3, _local2);
break;
case "j" :
setjBoxes(_local3, _local2);
break;
case "k" :
setkBoxes(_local3, _local2);
break;
case "l" :
setlBoxes(_local3, _local2);
break;
case "m" :
setmBoxes(_local3, _local2);
break;
case "n" :
setnBoxes(_local3, _local2);
break;
case "p" :
setpBoxes(_local3, _local2);
break;
case "E" :
setWheels(_local3, _local2, Fitches[_local3][_local2]);
break;
case "F" :
setWheels(_local3, _local2, Fitches[_local3][_local2]);
break;
case "G" :
setWheels(_local3, _local2, Fitches[_local3][_local2]);
break;
case "H" :
setWheels(_local3, _local2, Fitches[_local3][_local2]);
break;
case "A" :
setBoost(_local3, _local2);
break;
case "B" :
setBoost(_local3, _local2);
break;
case "C" :
setBoost(_local3, _local2);
break;
case "D" :
setBoost(_local3, _local2);
break;
case "S" :
setChecker(_local3, _local2);
break;
case "I" :
setArcLeft(_local3, _local2);
break;
case "J" :
setArcMiddle(_local3, _local2);
break;
case "K" :
setArcRight(_local3, _local2);
break;
case "Aa" :
setArrow(_local3, _local2, Fitches[_local3][_local2]);
break;
case "Ab" :
setArrow(_local3, _local2, Fitches[_local3][_local2]);
break;
case "Ac" :
setArrow(_local3, _local2, Fitches[_local3][_local2]);
break;
case "Ad" :
setArrow(_local3, _local2, Fitches[_local3][_local2]);
break;
case "AA" :
setArrow(_local3, _local2, Fitches[_local3][_local2]);
break;
case "AB" :
setArrow(_local3, _local2, Fitches[_local3][_local2]);
break;
case "AC" :
setArrow(_local3, _local2, Fitches[_local3][_local2]);
break;
case "AD" :
setArrow(_local3, _local2, Fitches[_local3][_local2]);
}
}
if (GroundsNumbers[_local3][_local2]) {
setBorder(_local3, _local2);
makeWay(_local3, _local2);
}
_local2++;
}
_local3++;
}
setBonus();
setCars();
setLights();
};
makeWay = function (i, j) {
var _local1 = GroundsNumbers[i][j];
var _local2 = true;
if (Way[_local1] != undefined) {
_local2 = false;
}
if (GroundsNumbers[i - 1][j] == (_local1 - 1)) {
_local2 = true;
}
if (GroundsNumbers[i + 1][j] == (_local1 - 1)) {
_local2 = true;
}
if (GroundsNumbers[i][j - 1] == (_local1 - 1)) {
_local2 = true;
}
if (GroundsNumbers[i][j + 1] == (_local1 - 1)) {
_local2 = true;
}
if (_local1 == 1) {
_local2 = true;
}
if (_local2) {
Way[_local1] = new Array();
Way[_local1][0] = i;
Way[_local1][1] = j;
}
};
setGround1 = function (i, j, st) {
numberofGrounds++;
var rnd;
if (st) {
fn = "ground1" + st;
} else {
rnd = Math.round(Math.random() * maxGroundsPictures);
fn = "ground1" + rnd;
}
bg.attachMovie(fn, "ground" + numberofGrounds, bg.getNextHighestDepth());
myground = eval ("bg.ground" + numberofGrounds);
myground._x = leftBorder + (i * Xelement);
myground._y = upBorder + (j * Yelement);
};
setBonusPlus = function (N) {
var _local2;
var _local1 = 1;
while (_local1 <= N) {
_local2 = Math.round(Math.random() * (numberofBonuses - 1)) + 1;
switch (_local2) {
case 1 :
setSpeedUps();
break;
case 2 :
setSlowDowns();
break;
case 3 :
setShields();
break;
case 4 :
setSpreads();
break;
case 5 :
setFrozens();
break;
case 6 :
setNukes();
break;
case 7 :
setThorns();
}
_local1++;
}
};
setBonus = function () {
setOils();
setMoney();
setBMoney();
setKit();
setBKit();
setMines();
setBonusPlus(2);
};
bonusPlus = function () {
setMoney();
setKit();
setBonusPlus(1);
};
setRoad = function (i, j, dir, AN) {
numberofGrounds++;
attached = "road" + AN;
bg.attachMovie(attached, "ground" + numberofGrounds, bg.getNextHighestDepth());
myground = eval ("bg.ground" + numberofGrounds);
if (!(dir === "horizontal")) {
} else {
myground._rotation = 90;
}
myground._x = leftBorder + (i * Xelement);
myground._y = upBorder + (j * Yelement);
};
setCorner = function (i, j, dir) {
numberofGrounds++;
bg.attachMovie("corner1", "ground" + numberofGrounds, bg.getNextHighestDepth());
myground = eval ("bg.ground" + numberofGrounds);
switch (dir) {
case "leftup" :
myground._rotation = 0;
break;
case "leftdown" :
myground._rotation = 270;
break;
case "rightup" :
myground._rotation = 90;
break;
case "rightdown" :
myground._rotation = 180;
}
myground._x = leftBorder + (i * Xelement);
myground._y = upBorder + (j * Yelement);
};
setTRoad = function (i, j, dir) {
numberofGrounds++;
bg.attachMovie("troad", "ground" + numberofGrounds, bg.getNextHighestDepth());
myground = eval ("bg.ground" + numberofGrounds);
switch (dir) {
case "left" :
myground._rotation = 270;
break;
case "right" :
myground._rotation = 90;
break;
case "up" :
myground._rotation = 0;
break;
case "down" :
myground._rotation = 180;
}
myground._x = leftBorder + (i * Xelement);
myground._y = upBorder + (j * Yelement);
};
setXRoad = function (i, j, dir) {
numberofGrounds++;
bg.attachMovie("xroad", "ground" + numberofGrounds, bg.getNextHighestDepth());
myground = eval ("bg.ground" + numberofGrounds);
myground._x = leftBorder + (i * Xelement);
myground._y = upBorder + (j * Yelement);
};
setBorder = function (i, j) {
function setLineVertical(dir) {
var k = 1;
while (k <= 6) {
bordersNumber++;
borders.attachMovie("border", "border" + bordersNumber, borders.getNextHighestDepth());
myborder1 = eval ("borders.border" + bordersNumber);
switch (dir) {
case "left" :
myborder1._x = leftBorder + ((i - 0.5) * Xelement);
myborder1._y = (upBorder + ((j - 0.5) * Yelement)) + (((k - 1) * Yelement) / 5);
break;
case "right" :
myborder1._x = leftBorder + ((i + 0.5) * Xelement);
myborder1._y = (upBorder + ((j - 0.5) * Yelement)) + (((k - 1) * Yelement) / 5);
}
k++;
}
}
function setLineHorisontal(dir) {
var k = 1;
while (k <= 6) {
bordersNumber++;
borders.attachMovie("border", "border" + bordersNumber, borders.getNextHighestDepth());
myborder1 = eval ("borders.border" + bordersNumber);
switch (dir) {
case "up" :
myborder1._x = (leftBorder + ((i - 0.5) * Xelement)) + (((k - 1) * Xelement) / 5);
myborder1._y = upBorder + ((j - 0.5) * Yelement);
break;
case "down" :
myborder1._x = (leftBorder + ((i - 0.5) * Xelement)) + (((k - 1) * Xelement) / 5);
myborder1._y = upBorder + ((j + 0.5) * Yelement);
}
k++;
}
}
if (!GroundsNumbers[i - 1][j]) {
setLineVertical("left");
}
if (!GroundsNumbers[i + 1][j]) {
setLineVertical("right");
}
if (!GroundsNumbers[i][j - 1]) {
setLineHorisontal("up");
}
if (!GroundsNumbers[i][j + 1]) {
setLineHorisontal("down");
}
};
setBox = function (x, y) {
numberofBoxes++;
bonuses.attachMovie("box", "box" + numberofBoxes, bonuses.getNextHighestDepth());
mybox = eval ("bonuses.box" + numberofBoxes);
Boxes[numberofBoxes] = mybox;
mybox._x = x;
mybox._y = y;
};
setaBoxes = function (i, j) {
var _local6;
var _local5;
var _local4;
var _local3;
_local6 = leftBorder + (i * Xelement);
_local5 = upBorder + (j * Yelement);
N = 4;
dy = 20;
dx = 20;
var _local2 = 1;
while (_local2 <= N) {
var _local1 = 1;
while (_local1 <= ((N - _local2) + 1)) {
_local3 = (_local5 - (Yelement / 2)) + (dy * _local2);
_local4 = (_local6 - (Xelement / 2)) + (dx * _local1);
setBox(_local4, _local3);
_local1++;
}
_local2++;
}
};
setbBoxes = function (i, j) {
var _local6;
var _local5;
var _local4;
var _local3;
_local6 = leftBorder + (i * Xelement);
_local5 = upBorder + (j * Yelement);
N = 4;
dy = 20;
dx = -20;
var _local2 = 1;
while (_local2 <= N) {
var _local1 = 1;
while (_local1 <= ((N - _local2) + 1)) {
_local3 = (_local5 - (Yelement / 2)) + (dy * _local2);
_local4 = (_local6 + (Xelement / 2)) + (dx * _local1);
setBox(_local4, _local3);
_local1++;
}
_local2++;
}
};
setcBoxes = function (i, j) {
var _local6;
var _local5;
var _local4;
var _local3;
_local6 = leftBorder + (i * Xelement);
_local5 = upBorder + (j * Yelement);
N = 4;
dy = -20;
dx = -20;
var _local2 = 1;
while (_local2 <= N) {
var _local1 = 1;
while (_local1 <= ((N - _local2) + 1)) {
_local3 = (_local5 + (Yelement / 2)) + (dy * _local2);
_local4 = (_local6 + (Xelement / 2)) + (dx * _local1);
setBox(_local4, _local3);
_local1++;
}
_local2++;
}
};
setdBoxes = function (i, j) {
var _local6;
var _local5;
var _local4;
var _local3;
_local6 = leftBorder + (i * Xelement);
_local5 = upBorder + (j * Yelement);
N = 4;
dy = -20;
dx = 20;
var _local2 = 1;
while (_local2 <= N) {
var _local1 = 1;
while (_local1 <= ((N - _local2) + 1)) {
_local3 = (_local5 + (Yelement / 2)) + (dy * _local2);
_local4 = (_local6 - (Xelement / 2)) + (dx * _local1);
setBox(_local4, _local3);
_local1++;
}
_local2++;
}
};
seteBoxes = function (i, j) {
var _local5;
var _local4;
var _local2;
var _local1;
_local5 = leftBorder + ((i - 0.5) * Xelement);
_local4 = upBorder + ((j - 0.5) * Yelement);
N = 4;
dy = (Yelement / 2) - 20;
var _local3 = 1;
while (_local3 <= N) {
_local1 = ((_local4 + (Yelement / 2)) - dy) + ((Math.random() - 0.5) * 20);
_local2 = _local5 + (Xelement * Math.random());
setBox(_local2, _local1);
_local3++;
}
_local3 = 1;
while (_local3 <= N) {
_local1 = ((_local4 + (Yelement / 2)) + dy) + ((Math.random() - 0.5) * 20);
_local2 = _local5 + (Xelement * Math.random());
setBox(_local2, _local1);
_local3++;
}
};
setfBoxes = function (i, j) {
var _local5;
var _local4;
var _local2;
var _local1;
_local5 = leftBorder + ((i - 0.5) * Xelement);
_local4 = upBorder + ((j - 0.5) * Yelement);
N = 4;
dx = (Xelement / 2) - 20;
var _local3 = 1;
while (_local3 <= N) {
_local2 = ((_local5 + (Xelement / 2)) - dx) + ((Math.random() - 0.5) * 20);
_local1 = _local4 + (Yelement * Math.random());
setBox(_local2, _local1);
_local3++;
}
_local3 = 1;
while (_local3 <= N) {
_local2 = ((_local5 + (Xelement / 2)) + dx) + ((Math.random() - 0.5) * 20);
_local1 = _local4 + (Yelement * Math.random());
setBox(_local2, _local1);
_local3++;
}
};
sethBoxes = function (i, j) {
var _local5;
var _local4;
var _local3;
var _local2;
_local5 = leftBorder + ((i - 0.5) * Xelement);
_local4 = upBorder + ((j - 0.5) * Yelement);
N = 7;
dx = (Xelement / 2) - 20;
var _local1 = 1;
while (_local1 <= N) {
_local3 = ((_local5 + (Xelement / 2)) - dx) + ((Math.random() - 0.5) * 20);
_local2 = _local4 + ((Yelement * _local1) / N);
setBox(_local3, _local2);
_local1++;
}
_local1 = 1;
while (_local1 <= N) {
_local3 = ((_local5 + (Xelement / 2)) + dx) + ((Math.random() - 0.5) * 20);
_local2 = _local4 + ((Yelement * _local1) / N);
setBox(_local3, _local2);
_local1++;
}
};
setiBoxes = function (i, j) {
var _local5;
var _local4;
var _local3;
var _local2;
_local5 = leftBorder + ((i - 0.5) * Xelement);
_local4 = upBorder + ((j - 0.5) * Yelement);
N = 7;
dy = (Xelement / 2) - 20;
ddy = (Xelement / 2) - 40;
var _local1 = 1;
while (_local1 <= N) {
_local2 = ((_local4 + (Yelement / 2)) - dy) + ((Math.random() - 0.5) * 20);
_local3 = _local5 + ((Xelement * _local1) / N);
setBox(_local3, _local2);
_local1++;
}
_local1 = 1;
while (_local1 <= N) {
_local2 = ((_local4 + (Yelement / 2)) - ddy) + ((Math.random() - 0.5) * 20);
_local3 = _local5 + ((Xelement * _local1) / N);
setBox(_local3, _local2);
_local1++;
}
};
setjBoxes = function (i, j) {
var _local5;
var _local4;
var _local3;
var _local2;
_local5 = leftBorder + ((i - 0.5) * Xelement);
_local4 = upBorder + ((j - 0.5) * Yelement);
N = 7;
dy = -20;
ddy = 20;
var _local1 = 1;
while (_local1 <= N) {
_local2 = ((_local4 + (Yelement / 2)) + dy) + ((Math.random() - 0.5) * 20);
_local3 = _local5 + ((Xelement * _local1) / N);
setBox(_local3, _local2);
_local1++;
}
_local1 = 1;
while (_local1 <= N) {
_local2 = ((_local4 + (Yelement / 2)) + ddy) + ((Math.random() - 0.5) * 20);
_local3 = _local5 + ((Xelement * _local1) / N);
setBox(_local3, _local2);
_local1++;
}
};
setkBoxes = function (i, j) {
var _local5;
var _local4;
var _local3;
var _local2;
_local5 = leftBorder + ((i - 0.5) * Xelement);
_local4 = upBorder + ((j - 0.5) * Yelement);
N = 7;
dy = (Xelement / 2) - 20;
ddy = (Xelement / 2) - 40;
var _local1 = 1;
while (_local1 <= N) {
_local2 = ((_local4 + (Yelement / 2)) + dy) + ((Math.random() - 0.5) * 20);
_local3 = _local5 + ((Xelement * _local1) / N);
setBox(_local3, _local2);
_local1++;
}
_local1 = 1;
while (_local1 <= N) {
_local2 = ((_local4 + (Yelement / 2)) + ddy) + ((Math.random() - 0.5) * 20);
_local3 = _local5 + ((Xelement * _local1) / N);
setBox(_local3, _local2);
_local1++;
}
};
setlBoxes = function (i, j) {
var _local5;
var _local4;
var _local3;
var _local2;
_local5 = leftBorder + ((i - 0.5) * Xelement);
_local4 = upBorder + ((j - 0.5) * Yelement);
N = 7;
dx = (Xelement / 2) - 20;
ddx = (Xelement / 2) - 40;
var _local1 = 1;
while (_local1 <= N) {
_local3 = ((_local5 + (Xelement / 2)) - dx) + ((Math.random() - 0.5) * 20);
_local2 = _local4 + ((Yelement * _local1) / N);
setBox(_local3, _local2);
_local1++;
}
_local1 = 1;
while (_local1 <= N) {
_local3 = ((_local5 + (Xelement / 2)) - ddx) + ((Math.random() - 0.5) * 20);
_local2 = _local4 + ((Yelement * _local1) / N);
setBox(_local3, _local2);
_local1++;
}
};
setmBoxes = function (i, j) {
var _local5;
var _local4;
var _local3;
var _local2;
_local5 = leftBorder + ((i - 0.5) * Xelement);
_local4 = upBorder + ((j - 0.5) * Yelement);
N = 7;
dx = -20;
ddx = 20;
var _local1 = 1;
while (_local1 <= N) {
_local3 = ((_local5 + (Xelement / 2)) + dx) + ((Math.random() - 0.5) * 20);
_local2 = _local4 + ((Yelement * _local1) / N);
setBox(_local3, _local2);
_local1++;
}
_local1 = 1;
while (_local1 <= N) {
_local3 = ((_local5 + (Xelement / 2)) + ddx) + ((Math.random() - 0.5) * 20);
_local2 = _local4 + ((Yelement * _local1) / N);
setBox(_local3, _local2);
_local1++;
}
};
setnBoxes = function (i, j) {
var _local5;
var _local4;
var _local3;
var _local2;
_local5 = leftBorder + ((i - 0.5) * Xelement);
_local4 = upBorder + ((j - 0.5) * Yelement);
N = 7;
dx = (Xelement / 2) - 20;
ddx = (Xelement / 2) - 40;
var _local1 = 1;
while (_local1 <= N) {
_local3 = ((_local5 + (Xelement / 2)) + dx) + ((Math.random() - 0.5) * 20);
_local2 = _local4 + ((Yelement * _local1) / N);
setBox(_local3, _local2);
_local1++;
}
_local1 = 1;
while (_local1 <= N) {
_local3 = ((_local5 + (Xelement / 2)) + ddx) + ((Math.random() - 0.5) * 20);
_local2 = _local4 + ((Yelement * _local1) / N);
setBox(_local3, _local2);
_local1++;
}
};
setpBoxes = function (i, j) {
var _local6;
var _local5;
var _local4;
var _local3;
_local6 = leftBorder + ((i - 0.5) * Xelement);
_local5 = upBorder + ((j - 0.5) * Yelement);
N = 8;
dy = 20;
dx = 40;
var _local2 = 1;
while (_local2 <= N) {
var _local1 = 1;
while (_local1 <= (N / 2)) {
_local3 = _local5 + (dy * _local2);
_local4 = _local6 + (dx * (_local1 - ((_local2 % 2) / 2)));
setBox(_local4, _local3);
_local1++;
}
_local2++;
}
};
setWheel = function (x, y) {
numberofWheels++;
bonuses.attachMovie("wheels3", "wheels" + numberofWheels, bonuses.getNextHighestDepth());
mywheels = eval ("bonuses.wheels" + numberofWheels);
Wheels[numberofWheels] = mywheels;
mywheels._x = x;
mywheels._y = y;
};
setWheels = function (i, j, dir) {
var _local4;
var _local7;
var _local6;
var _local5;
var _local9;
var _local8;
var _local3;
var _local2;
_local4 = 8;
_local5 = 10;
_local9 = leftBorder + (i * Xelement);
_local8 = upBorder + (j * Yelement);
switch (dir) {
case "E" :
_local3 = 0;
_local2 = -1;
break;
case "F" :
_local3 = 1;
_local2 = 0;
break;
case "G" :
_local3 = 0;
_local2 = 1;
break;
case "H" :
_local3 = -1;
_local2 = 0;
}
var _local1 = 1;
while (_local1 <= _local4) {
_local7 = (((_local9 + ((Xelement / 2) * _local3)) - ((Xelement / 2) * Math.abs(_local2))) + ((_local5 * (Math.random() - 0.5)) * _local3)) + (((Xelement * _local1) / _local4) * (1 - Math.abs(_local3)));
_local6 = (((_local8 + ((Yelement / 2) * _local2)) - ((Yelement / 2) * Math.abs(_local3))) + ((_local5 * (Math.random() - 0.5)) * _local2)) + (((Yelement * _local1) / _local4) * (1 - Math.abs(_local2)));
setWheel(_local7, _local6);
_local1++;
}
};
setBoost = function (i, j) {
numberofBoosts++;
bonuses.attachMovie("gboost", "boost" + numberofBoosts, bonuses.getNextHighestDepth());
myboost = eval ("bonuses.boost" + numberofBoosts);
Boosts[numberofBoosts] = myboost;
switch (Directions[i][j]) {
case 1 :
myboost._rotation = -180;
break;
case 2 :
myboost._rotation = 0;
break;
case 3 :
myboost._rotation = -90;
break;
case 4 :
myboost._rotation = 90;
}
myboost._x = leftBorder + (i * Xelement);
myboost._y = upBorder + (j * Yelement);
};
setArrow = function (i, j, dir) {
setAr = function () {
numberofArrows++;
bonuses.attachMovie("arrow", "arrow" + numberofArrows, bonuses.getNextHighestDepth());
myarrow = eval ("bonuses.arrow" + numberofArrows);
myarrow._x = leftBorder + (i * Xelement);
myarrow._y = upBorder + (j * Yelement);
Arrows[numberofArrows] = myarrow;
};
setAr();
switch (dir) {
case "Ad" :
myarrow._rotation = 90;
return;
case "Ab" :
myarrow._rotation = -90;
return;
case "Aa" :
myarrow._rotation = 180;
return;
case "Ac" :
myarrow._rotation = 0;
return;
case "AD" :
myarrow._rotation = 90;
setAr();
myarrow._rotation = 180;
return;
case "AA" :
myarrow._rotation = -90;
setAr();
myarrow._rotation = 180;
return;
case "AC" :
myarrow._rotation = 90;
setAr();
myarrow._rotation = 0;
return;
case "AB" :
myarrow._rotation = -90;
setAr();
myarrow._rotation = 0;
}
};
setArcLeft = function (i, j) {
numberOfArcs++;
trace("!!!");
_parent.over.attachMovie("arc1", "arc" + numberOfArcs, _parent.over.getNextHighestDepth());
myarc = eval ("_parent.over.arc" + numberOfArcs);
myarc._x = leftBorder + ((i + 0.5) * Xelement);
myarc._y = upBorder + (j * Yelement);
};
setArcRight = function (i, j) {
numberOfArcs++;
_parent.over.attachMovie("arc3", "arc" + numberOfArcs, _parent.over.getNextHighestDepth());
myarc = eval ("_parent.over.arc" + numberOfArcs);
myarc._x = leftBorder + ((i - 0.5) * Xelement);
myarc._y = upBorder + (j * Yelement);
};
setArcMiddle = function (i, j) {
numberOfArcs++;
_parent.over.attachMovie("arc2", "arc" + numberOfArcs, _parent.over.getNextHighestDepth());
myarc = eval ("_parent.over.arc" + numberOfArcs);
myarc._x = leftBorder + (i * Xelement);
myarc._y = upBorder + (j * Yelement);
};
setChecker = function (i, j) {
bonuses.attachMovie("checker", "checker", bonuses.getNextHighestDepth());
mychecker = bonuses.checker;
checkFieldNumber = GroundsNumbers[i][j];
switch (Directions[i][j]) {
case 1 :
mychecker._rotation = 0;
mychecker._x = leftBorder + (i * Xelement);
mychecker._y = upBorder + ((j + 0.5) * Yelement);
return;
case 2 :
mychecker._rotation = 0;
mychecker._x = leftBorder + (i * Xelement);
mychecker._y = upBorder + ((j - 0.5) * Yelement);
return;
case 3 :
mychecker._rotation = 90;
mychecker._x = leftBorder + ((i + 0.5) * Xelement);
mychecker._y = upBorder + (j * Yelement);
return;
case 4 :
mychecker._rotation = 90;
mychecker._x = leftBorder + ((i - 0.5) * Xelement);
mychecker._y = upBorder + (j * Yelement);
}
};
setOils = function () {
var k = 1;
while (k <= numberofOils) {
bonuses.attachMovie("oil", "oil" + k, bonuses.getNextHighestDepth());
myoil = eval ("bonuses.oil" + k);
Oils[k] = myoil;
NofGround = Math.round(Math.random() * (maxRoadNumber - 1)) + 1;
myoil._x = leftBorder + (((Way[NofGround][0] + Math.random()) - 0.5) * Xelement);
myoil._y = upBorder + (((Way[NofGround][1] + Math.random()) - 0.5) * Yelement);
k++;
}
};
setMoney = function () {
numberofMoney++;
bonuses.attachMovie("money", "money" + numberofMoney, bonuses.getNextHighestDepth());
myitem = eval ("bonuses.money" + numberofMoney);
Moneys[numberofMoney] = myitem;
NofGround = Math.round(Math.random() * (maxRoadNumber - 1)) + 1;
myitem._x = leftBorder + (((Way[NofGround][0] + Math.random()) - 0.5) * Xelement);
myitem._y = upBorder + (((Way[NofGround][1] + Math.random()) - 0.5) * Yelement);
};
setMoneys = function () {
var _local1 = 1;
while (_local1 <= numberofMoney0) {
setMoney();
_local1++;
}
};
setBMoney = function () {
numberofMoney++;
bonuses.attachMovie("bmoney", "money" + numberofMoney, bonuses.getNextHighestDepth());
myitem = eval ("bonuses.money" + numberofMoney);
Moneys[numberofMoney] = myitem;
NofGround = Math.round(Math.random() * (maxRoadNumber - 1)) + 1;
myitem._x = leftBorder + (((Way[NofGround][0] + Math.random()) - 0.5) * Xelement);
myitem._y = upBorder + (((Way[NofGround][1] + Math.random()) - 0.5) * Yelement);
};
setBMoneys = function () {
var _local1 = 1;
while (_local1 <= numberofBMoney0) {
setBMoney();
_local1++;
}
};
setKit = function () {
numberofKits++;
bonuses.attachMovie("kit", "kit" + numberofKits, bonuses.getNextHighestDepth());
myitem = eval ("bonuses.kit" + numberofKits);
Kits[numberofKits] = myitem;
NofGround = Math.round(Math.random() * (maxRoadNumber - 1)) + 1;
myitem._x = leftBorder + (((Way[NofGround][0] + Math.random()) - 0.5) * Xelement);
myitem._y = upBorder + (((Way[NofGround][1] + Math.random()) - 0.5) * Yelement);
};
setKits = function () {
var _local1 = 1;
while (_local1 <= numberofKits0) {
setKit();
_local1++;
}
};
setBKit = function () {
numberofKits++;
bonuses.attachMovie("bkit", "kit" + numberofKits, bonuses.getNextHighestDepth());
myitem = eval ("bonuses.kit" + numberofKits);
Kits[numberofKits] = myitem;
NofGround = Math.round(Math.random() * (maxRoadNumber - 1)) + 1;
myitem._x = leftBorder + (((Way[NofGround][0] + Math.random()) - 0.5) * Xelement);
myitem._y = upBorder + (((Way[NofGround][1] + Math.random()) - 0.5) * Yelement);
};
setBKits = function () {
var _local1 = 1;
while (_local1 <= numberofBKits0) {
setBKit();
_local1++;
}
};
setOil = function (x, y) {
numberofOils++;
bonuses.attachMovie("oil", "oil" + numberofOils, bonuses.getNextHighestDepth());
myitem = eval ("bonuses.oil" + numberofOils);
Oils[numberofOils] = myitem;
myitem._x = x;
myitem._y = y;
};
setOils = function () {
var _local1 = 1;
while (_local1 <= numberofOils0) {
NofGround = Math.round(Math.random() * (maxRoadNumber - 1)) + 1;
x = leftBorder + (((Way[NofGround][0] + Math.random()) - 0.5) * Xelement);
y = upBorder + (((Way[NofGround][1] + Math.random()) - 0.5) * Yelement);
setOil(x, y);
_local1++;
}
};
setMine = function (x, y) {
numberofMines++;
bonuses.attachMovie("mine", "mine" + numberofMines, bonuses.getNextHighestDepth());
myitem = eval ("bonuses.mine" + numberofMines);
Mines[numberofMines] = myitem;
myitem._x = x;
myitem._y = y;
};
setMines = function () {
var _local1 = 1;
while (_local1 <= numberofMines0) {
NofGround = Math.round(Math.random() * (maxRoadNumber - 1)) + 1;
x = leftBorder + (((Way[NofGround][0] + Math.random()) - 0.5) * Xelement);
y = upBorder + (((Way[NofGround][1] + Math.random()) - 0.5) * Yelement);
setMine(x, y);
_local1++;
}
};
setSpeedUps = function () {
numberofSpeedUp++;
bonuses.attachMovie("speedup", "speedup" + numberofSpeedUp, bonuses.getNextHighestDepth());
myitem = eval ("bonuses.speedup" + numberofSpeedUp);
SpeedUps[numberofSpeedUp] = myitem;
NofGround = Math.round(Math.random() * (maxRoadNumber - 1)) + 1;
myitem._x = leftBorder + (((Way[NofGround][0] + Math.random()) - 0.5) * Xelement);
myitem._y = upBorder + (((Way[NofGround][1] + Math.random()) - 0.5) * Yelement);
};
setSlowDowns = function () {
numberofSlowDown++;
bonuses.attachMovie("slowdown", "slowdown" + numberofSlowDown, bonuses.getNextHighestDepth());
myitem = eval ("bonuses.slowdown" + numberofSlowDown);
SlowDowns[numberofSlowDown] = myitem;
NofGround = Math.round(Math.random() * (maxRoadNumber - 1)) + 1;
myitem._x = leftBorder + (((Way[NofGround][0] + Math.random()) - 0.5) * Xelement);
myitem._y = upBorder + (((Way[NofGround][1] + Math.random()) - 0.5) * Yelement);
};
setShields = function () {
numberofShields++;
bonuses.attachMovie("shield", "shield" + numberofShields, bonuses.getNextHighestDepth());
myitem = eval ("bonuses.shield" + numberofShields);
Shields[numberofShields] = myitem;
NofGround = Math.round(Math.random() * (maxRoadNumber - 1)) + 1;
myitem._x = leftBorder + (((Way[NofGround][0] + Math.random()) - 0.5) * Xelement);
myitem._y = upBorder + (((Way[NofGround][1] + Math.random()) - 0.5) * Yelement);
};
setFrozens = function () {
numberofFrozens++;
bonuses.attachMovie("frozen", "frozen" + numberofFrozens, bonuses.getNextHighestDepth());
myitem = eval ("bonuses.frozen" + numberofFrozens);
Frozens[numberofFrozens] = myitem;
NofGround = Math.round(Math.random() * (maxRoadNumber - 1)) + 1;
myitem._x = leftBorder + (((Way[NofGround][0] + Math.random()) - 0.5) * Xelement);
myitem._y = upBorder + (((Way[NofGround][1] + Math.random()) - 0.5) * Yelement);
};
takeFrozen = function (carNumber, x, y) {
var _local4 = false;
var _local1 = 0;
while (_local1 <= (Cars.length - 1)) {
R12 = Math.sqrt(((Cars[_local1]._x - x) * (Cars[_local1]._x - x)) + ((Cars[_local1]._y - y) * (Cars[_local1]._y - y)));
if ((R12 <= RAppl) && (_local1 != carNumber)) {
Cars[_local1].frozeIt();
_local4 = true;
}
_local1++;
}
if (_local4) {
return(true);
}
return(false);
};
setNukes = function () {
numberofNukes++;
bonuses.attachMovie("nuke", "nuke" + numberofNukes, bonuses.getNextHighestDepth());
myitem = eval ("bonuses.nuke" + numberofNukes);
Nukes[numberofNukes] = myitem;
NofGround = Math.round(Math.random() * (maxRoadNumber - 1)) + 1;
myitem._x = leftBorder + (((Way[NofGround][0] + Math.random()) - 0.5) * Xelement);
myitem._y = upBorder + (((Way[NofGround][1] + Math.random()) - 0.5) * Yelement);
};
takeNuke = function (carNumber, x, y, q) {
var _local5 = false;
var _local2 = 0;
while (_local2 <= (Cars.length - 1)) {
R12 = Math.sqrt(((Cars[_local2]._x - x) * (Cars[_local2]._x - x)) + ((Cars[_local2]._y - y) * (Cars[_local2]._y - y)));
if ((R12 <= RAppl) && (_local2 != carNumber)) {
Cars[_local2].changeDamage(q, "Fire");
_local5 = true;
Cars[_local2].explosion();
}
_local2++;
}
if (_local5 == true) {
_root.playSound("explosion");
return(true);
}
return(false);
};
setSpreads = function () {
numberofSpreads++;
bonuses.attachMovie("spread", "spread" + numberofSpreads, bonuses.getNextHighestDepth());
myitem = eval ("bonuses.spread" + numberofSpreads);
Spreads[numberofSpreads] = myitem;
NofGround = Math.round(Math.random() * (maxRoadNumber - 1)) + 1;
myitem._x = leftBorder + (((Way[NofGround][0] + Math.random()) - 0.5) * Xelement);
myitem._y = upBorder + (((Way[NofGround][1] + Math.random()) - 0.5) * Yelement);
};
takeSpread = function (x, y, num) {
alpha = 0;
numberofBulletSpread++;
if (numberofBulletSpread == 100) {
numberofBulletSpread = 0;
}
var k = 1;
while (k <= spreadsBulletNumber) {
if (numberofBulletSpread < 10) {
attachMovie("bulletspread", ("bulletspread0" + numberofBulletSpread) + k, this.getNextHighestDepth());
myitem = eval (("bulletspread0" + numberofBulletSpread) + k);
} else {
attachMovie("bulletspread", ("bulletspread" + numberofBulletSpread) + k, this.getNextHighestDepth());
myitem = eval (("bulletspread" + numberofBulletSpread) + k);
}
myitem._x = x;
myitem._y = y;
myitem.gotoAndPlay(1);
k++;
}
};
setThorns = function () {
numberofThorns++;
bonuses.attachMovie("thorns", "thorns" + numberofThorns, bonuses.getNextHighestDepth());
myitem = eval ("bonuses.thorns" + numberofThorns);
Thorns[numberofThorns] = myitem;
NofGround = Math.round(Math.random() * (maxRoadNumber - 1)) + 1;
myitem._x = leftBorder + (((Way[NofGround][0] + Math.random()) - 0.5) * Xelement);
myitem._y = upBorder + (((Way[NofGround][1] + Math.random()) - 0.5) * Yelement);
};
setCars = function () {
shootNumbers = 0;
carsFinished = 0;
attachMovie("hero", "myCar", this.getNextHighestDepth());
ii = Way[checkFieldNumber][0];
jj = Way[checkFieldNumber][1];
switch (Directions[ii][jj]) {
case 1 :
myCar._x = ((ii * Xelement) + leftBorder) - ((3 * Xelement) / 10);
myCar._y = ((jj * Yelement) + upBorder) - (Yelement / 5);
break;
case 2 :
myCar._x = ((ii * Xelement) + leftBorder) - ((3 * Xelement) / 10);
myCar._y = ((jj * Yelement) + upBorder) + (Yelement / 5);
break;
case 3 :
myCar._x = ((ii * Xelement) + leftBorder) + (Xelement / 5);
myCar._y = ((jj * Yelement) + upBorder) - ((3 * Yelement) / 10);
break;
case 4 :
myCar._x = ((ii * Xelement) + leftBorder) - (Xelement / 5);
myCar._y = ((jj * Yelement) + upBorder) - ((3 * Yelement) / 10);
}
Cars = [myCar];
CarsVar = new Array();
enemiesNumber = 3;
var i = 1;
while (i <= enemiesNumber) {
attachMovie("enemy1", "e" + i, this.getNextHighestDepth());
ecar = eval ("e" + i);
Cars[i] = ecar;
if ((Directions[ii][jj] == 3) or (Directions[ii][jj] == 4)) {
Cars[i]._y = myCar._y + (30 * i);
Cars[i]._x = myCar._x;
} else {
Cars[i]._y = myCar._y;
Cars[i]._x = myCar._x + (30 * i);
}
i++;
}
bonusonCar = new Array();
var bonus;
var i = 0;
while (i <= enemiesNumber) {
attachMovie("bonusonCar", "bonus" + i, this.getNextHighestDepth());
bonus = eval ("bonus" + i);
bonusonCar[i] = bonus;
i++;
}
onEnterFrame = function () {
var _local2 = 0;
while (_local2 <= (Cars.length - 1)) {
Cars[_local2].numberofCar = _local2;
Cars[_local2].i = ii;
Cars[_local2].j = jj;
CarsVar[_local2] = _parent.Cars[_local2];
CarsVar[_local2].otherway = false;
CarsVar[_local2].notfirstlap = false;
CarsVar[_local2].lapsCompleted = 0;
CarsVar[_local2].lastFieldNumber = 1;
CarsVar[_local2].shootNumbers = 0;
CarsVar[_local2].defenseNumbers = 0;
Cars[_local2].formateCar();
_local2++;
}
CarsVar[0].motionUp = false;
CarsVar[0].motionDown = false;
CarsVar[0].motionLeft = false;
CarsVar[0].motionRight = false;
CarsVar[0].rulebyMouse = false;
CarsVar[0].afactor = 0;
delete onEnterFrame;
};
};
startCars = function () {
var _local1 = 0;
while (_local1 <= (Cars.length - 1)) {
CarsVar[_local1].movable = true;
Cars[_local1].Start();
_local1++;
}
};
setLights = function () {
playLight = function () {
if (i == N) {
clearInterval(intervalLight);
startCars();
_root.raceStarted(false);
var i = 1;
while (i <= N) {
light = eval ("_root.light" + i);
light.removeMovieClip();
i++;
}
}
light = eval ("_root.light" + i);
light.play();
i++;
light = eval ("_root.light" + i);
light.play();
};
var N = 3;
var timeLight = 1000;
var light;
var X0 = ((windowLeftBorder + (windowWidth / 2)) - 59);
var Y0 = ((windowUpBorder + (windowHeight / 2)) - 10);
var i = 1;
while (i <= N) {
_root.attachMovie("light" + i, "light" + i, _root.getNextHighestDepth());
light = eval ("_root.light" + i);
light._x = X0;
X0 = X0 + light._width;
light._y = Y0 - (light._height / 2);
i++;
}
i = 0;
_root.raceStarted(true);
var intervalLight = setInterval(playLight, timeLight);
};
testOnMotion = function (X, Y) {
changeflag = false;
i = Math.floor(((X + (Xelement / 2)) - leftBorder) / Xelement);
j = Math.floor(((Y + (Yelement / 2)) - upBorder) / Yelement);
if (!GroundsNumbers[i][j]) {
changeflag = true;
}
if (changeflag) {
return(false);
}
return(true);
};
restartTime = 60;
explosion = function (x, y) {
var bum;
bumNumber++;
attachMovie("bum", "bum" + bumNumber, this.getNextHighestDepth());
bum = eval ("bum" + bumNumber);
bum._x = x;
bum._y = y;
bum.play();
return(bum);
};
setPause = function () {
paused = !paused;
if (paused) {
_root.rpaused._visible = true;
var _local2 = 0;
while (_local2 <= (Cars.length - 1)) {
Cars[_local2].stop();
Cars[_local2].mybullet.stop();
_local2++;
}
} else {
_root.rpaused._visible = false;
var _local2 = 0;
while (_local2 <= (Cars.length - 1)) {
Cars[_local2].play();
Cars[_local2].mybullet.play();
_local2++;
}
}
};
finish = function () {
carsFinished++;
begins = false;
var _local2 = 0;
while (_local2 <= (Cars.length - 1)) {
Cars[_local2].dieFinal();
_local2++;
}
_parent.finishRace(carsFinished);
};
Instance of Symbol 1906 MovieClip "cp" in Symbol 1907 MovieClip Frame 1
onClipEvent (mouseDown) {
_parent.CarsVar[0].rulebyMouse = true;
}
onClipEvent (mouseUp) {
_parent.CarsVar[0].rulebyMouse = false;
_parent.CarsVar[0].motionRight = false;
_parent.CarsVar[0].motionLeft = false;
_parent.CarsVar[0].motionUp = false;
}
onClipEvent (keyDown) {
if ((Key.getCode() == 38) && (_parent.CarsVar[0].movable)) {
_parent.CarsVar[0].motionUp = true;
}
if ((Key.getCode() == 37) && (_parent.CarsVar[0].movable)) {
if (!_parent.CarsVar[0].motionLeft) {
_parent.CarsVar[0].afactor = 1;
_parent.CarsVar[0].motionLeft = true;
}
}
if ((Key.getCode() == 40) && (_parent.CarsVar[0].movable)) {
_parent.CarsVar[0].motionDown = true;
}
if ((Key.getCode() == 39) && (_parent.CarsVar[0].movable)) {
if (!_parent.CarsVar[0].motionRight) {
_parent.CarsVar[0].motionRight = true;
_parent.CarsVar[0].afactor = -1;
}
}
if ((Key.getCode() == 87) && (_parent.CarsVar[0].movable)) {
_parent.CarsVar[0].motionUp = true;
}
if ((Key.getCode() == 65) && (_parent.CarsVar[0].movable)) {
if (!_parent.CarsVar[0].motionLeft) {
_parent.CarsVar[0].afactor = 1;
_parent.CarsVar[0].motionLeft = true;
}
}
if ((Key.getCode() == 83) && (_parent.CarsVar[0].movable)) {
_parent.CarsVar[0].motionDown = true;
}
if ((Key.getCode() == 68) && (_parent.CarsVar[0].movable)) {
if (!_parent.CarsVar[0].motionRight) {
_parent.CarsVar[0].motionRight = true;
_parent.CarsVar[0].afactor = -1;
}
}
if (((Key.getCode() == 17) && (_parent.CarsVar[0].movable)) && (!_parent.paused)) {
_parent.myCar.shoot();
}
if (((Key.getCode() == 16) && (_parent.CarsVar[0].movable)) && (!_parent.paused)) {
_parent.myCar.defense();
}
if (Key.getCode() == 32) {
_parent.setPause();
}
if (Key.getCode() == 70) {
_parent.finish();
}
}
onClipEvent (keyUp) {
if (Key.getCode() == 38) {
_parent.CarsVar[0].motionUp = false;
}
if (Key.getCode() == 37) {
_parent.CarsVar[0].motionLeft = false;
_parent.CarsVar[0].afactor = 0;
}
if (Key.getCode() == 40) {
_parent.CarsVar[0].motionDown = false;
}
if (Key.getCode() == 39) {
_parent.CarsVar[0].motionRight = false;
_parent.CarsVar[0].afactor = 0;
}
if (Key.getCode() == 87) {
_parent.CarsVar[0].motionUp = false;
}
if (Key.getCode() == 65) {
_parent.CarsVar[0].motionLeft = false;
_parent.CarsVar[0].afactor = 0;
}
if (Key.getCode() == 83) {
_parent.CarsVar[0].motionDown = false;
}
if (Key.getCode() == 68) {
_parent.CarsVar[0].motionRight = false;
_parent.CarsVar[0].afactor = 0;
}
}
Symbol 1937 MovieClip Frame 14
stop();
Symbol 1938 MovieClip Frame 1
var score = 50;
stop();
Symbol 1938 MovieClip Frame 2
stop();
Symbol 1938 MovieClip Frame 3
stop();
Symbol 1938 MovieClip Frame 4
play();
Symbol 1938 MovieClip Frame 18
gotoAndPlay ("dead");
Symbol 1938 MovieClip Frame 19
play();
Symbol 1938 MovieClip Frame 33
gotoAndPlay ("alive");
Symbol 1938 MovieClip Frame 34
stop();
Symbol 1946 MovieClip Frame 1
stop();
Symbol 1946 MovieClip Frame 2
_root.sound.gotoAndPlay("hitbullet");
play();
Symbol 1946 MovieClip Frame 28
stop();
Symbol 1955 MovieClip Frame 1
var score = 150;
stop();
Symbol 1955 MovieClip Frame 2
stop();
Symbol 1955 MovieClip Frame 3
stop();
Symbol 1955 MovieClip Frame 4
play();
Symbol 1955 MovieClip Frame 17
gotoAndPlay ("dead");
Symbol 1955 MovieClip Frame 18
play();
Symbol 1955 MovieClip Frame 32
gotoAndPlay ("alive");
Symbol 1955 MovieClip Frame 33
stop();
Symbol 1961 MovieClip Frame 1
var score = 100;
stop();
Symbol 1961 MovieClip Frame 2
stop();
Symbol 1961 MovieClip Frame 3
stop();
Symbol 1961 MovieClip Frame 4
play();
Symbol 1961 MovieClip Frame 18
gotoAndPlay ("dead");
Symbol 1961 MovieClip Frame 19
play();
Symbol 1961 MovieClip Frame 33
gotoAndPlay ("alive");
Symbol 1961 MovieClip Frame 34
stop();
Symbol 1972 MovieClip Frame 1
stop();
Symbol 1972 MovieClip Frame 2
_root.sound.gotoAndPlay("shotcannon");
play();
Symbol 1972 MovieClip Frame 4
gotoAndStop ("normal");
Symbol 1972 MovieClip Frame 5
_root.sound.gotoAndPlay("hitbullet");
play();
Symbol 1972 MovieClip Frame 15
gotoAndStop ("normal");
Symbol 1972 MovieClip Frame 16
_root.sound.gotoAndPlay("explosion");
play();
Symbol 1972 MovieClip Frame 30
stop();
Symbol 1972 MovieClip Frame 31
play();
Symbol 1972 MovieClip Frame 50
gotoAndStop ("normal");
Symbol 1973 Button
on (release) {
getURL (_root.downloadPromotedURL);
}
Symbol 1976 MovieClip Frame 1
stop();
Symbol 1976 MovieClip Frame 2
stop();
Symbol 1979 MovieClip Frame 1
play();
Symbol 1979 MovieClip Frame 14
stop();
Symbol 1982 MovieClip Frame 1
play();
Symbol 1982 MovieClip Frame 46
stop();
Symbol 1983 MovieClip Frame 1
function togglePause() {
if (paused) {
message.gotoAndPlay("unpaused");
} else {
message.gotoAndPlay("paused");
}
paused = !paused;
}
function hideOffscreenStuff() {
ufo.gotoAndPlay("dead");
ufo2.gotoAndPlay("dead");
terran.gotoAndPlay("dead");
terran3.gotoAndPlay("dead");
mine.gotoAndPlay("dead");
mine2.gotoAndPlay("dead");
caskorange.gotoAndPlay("dead");
caskred.gotoAndPlay("dead");
caskyellow.gotoAndPlay("dead");
caskblue.gotoAndPlay("dead");
caskgreen.gotoAndPlay("dead");
box.gotoAndPlay("dead");
bullet1.gotoAndPlay("dead");
bullet2.gotoAndPlay("dead");
bullet3.gotoAndPlay("dead");
plasma.gotoAndPlay("dead");
aimsrc.gotoAndPlay("dead");
shiphpsrc.gotoAndPlay("dead");
planethpsrc.gotoAndPlay("dead");
weaponsrc.gotoAndPlay("dead");
playersrc.gotoAndPlay("dead");
}
var rootURL = "http://www.enkord.com/";
if (moreGamesURL == undefined) {
moreGamesURL = rootURL;
}
if (downloadURL == undefined) {
downloadURL = rootURL + "clashnslash/";
}
if (orderURL == undefined) {
orderURL = rootURL + "product.php?action=order&product=clashnslash&from=webversion";
}
if (hiscoreURL == undefined) {
hiscoreURL = rootURL + "clashnslashweb/hiscore.php";
}
var _r;
var paused = false;
aimsrc.duplicateMovieClip("cursor", 15000);
var mouseState = false;
var prevMouseState = false;
var gameInit = true;
var mouseInRect = ((((x > 0) && (x < 480)) && (y > 0)) && (y < 360));
if (mouseInRect) {
Mouse.hide();
}
hideOffscreenStuff();
Symbol 1983 MovieClip Frame 2
play();
Symbol 1983 MovieClip Frame 3
updateTitle();
Symbol 1983 MovieClip Frame 4
function doInitLevel1() {
game.weapon = new WeaponClass(25, 12, bullet1);
}
function doSpawnLevel1(count) {
if (count < 20) {
game.spawnBanner(0.2, ufo, 0);
game.spawnBanner(0.2, ufo, 0);
game.spawnBanner(0.25, mine, 0);
game.spawnBanner(0.3, mine2, 0);
} else if (count < 40) {
var _local1 = 0;
while (_local1 < (((count % 4) == 0) ? 2 : 1)) {
bonus = 0;
roll = random(20);
if (roll < 5) {
bonus = BONUS_SCORE;
} else if (roll == 5) {
bonus = BONUS_EXPLOSION;
} else if (roll == 6) {
bonus = BONUS_SPREAD;
}
game.spawnOffscreen(0.2, ufo, bonus);
_local1++;
}
} else if (count < 60) {
var _local1 = 0;
while (_local1 < (((count % 3) == 0) ? 2 : 1)) {
bonus = 0;
roll = random(20);
if (roll < 5) {
bonus = BONUS_SCORE;
} else if (roll < 7) {
bonus = BONUS_EXPLOSION;
} else if (roll == 7) {
bonus = BONUS_NUKE;
} else if (roll <= 10) {
bonus = BONUS_SPREAD;
}
game.spawnOffscreen(0.2, ufo, bonus);
_local1++;
}
}
}
var level = 1;
score = 0;
Symbol 1983 MovieClip Frame 5
function deg2rad(fVal) {
return((fVal * Math.PI) / 180);
}
function rad2deg(fVal) {
return(fVal * 57.2957795130823);
}
function getLength(x, y) {
return(Math.sqrt((x * x) + (y * y)));
}
function setLength(x, y, len) {
var _local1 = getLength(x, y);
if (_local1 < 1E-5) {
return(undefined);
}
if (len > 1E-5) {
_local1 = _local1 / len;
x = x / _local1;
y = y / _local1;
} else {
x = 0;
y = 0;
}
return([x, y]);
}
function EntityClass(x, y, imc) {
imc.duplicateMovieClip("entity" + entityCounter, entityCounter);
this.mc = eval ("entity" + entityCounter);
entityCounter++;
this.mc._x = x;
this.mc._y = y;
this.velocityX = 0;
this.velocityY = 0;
this.alive = true;
this.status = STATUS_NORMAL;
this.laststatus = 0;
this.bonus = 0;
}
function PlayerClass(imc) {
this.velocityX = 0;
this.velocityY = 0;
if (player) {
this.mc = player;
} else {
imc.duplicateMovieClip("player", guiDepth++);
this.mc = player;
}
this.maxhp = 6;
this.hp = this.maxhp;
this.lastdamage = 0;
this.damagepause = 40;
this.respawnpause = respawnTime * 2;
}
function PlanetClass(imc) {
this.mc = imc;
this.velocityX = 0;
this.velocityY = 0;
this.maxhp = 10;
this.hp = this.maxhp;
}
function WeaponClass(clp, cd, imc) {
this.maxclip = clp;
this.clip = this.maxclip;
this.cooldown = cd;
this.lastshot = 0;
gui.clip.gotoAndPlay(this.clip + 2);
this.reloaded = 0;
this.mc = imc;
this.isShrapnel = false;
i = 1;
while (i <= this.maxclip) {
bulletcover.duplicateMovieClip("bulletcover" + i, 8000 + i);
var obj = eval ("bulletcover" + i);
obj._x = 25 + (i * 12);
obj._y = 12;
i++;
}
}
function GameClass() {
this.objects = new Array();
this.bullets = new Array();
this.bonuses = new Array();
this.player = new PlayerClass(playersrc);
this.player.mc.swapDepths(8000);
this.planet = new PlanetClass(planetsrc);
this.frames = 0;
this.spawnCounter = 0;
}
var entityCounter = 100;
var orbitLength = 80;
var reloadTime = aimsrc.reload;
var respawnTime = aimsrc.respawn;
var guiDepth = 10000;
var levelCompleteMessageDisplayed = false;
var gameOverState = false;
CLEAN_PAUSE = 100;
SPAWN_PAUSE = 100;
weaponsrc.duplicateMovieClip("weapon", guiDepth++);
weapon._x = 14;
weapon._y = 14;
message.currentleveltext = "LEVEL " + level;
message.gotoAndPlay("level");
cursor.gotoAndStop("aim");
BONUS_EXPLOSION = 1;
BONUS_NUKE = 2;
BONUS_SPREAD = 3;
BONUS_SCORE = 4;
BONUS_SLIME = 5;
BONUS_ICE = 6;
STATUS_NORMAL = 0;
STATUS_SLIME = 1;
STATUS_ICE = 2;
STATUS_PERIOD = 200;
var bonusmc = new Array();
bonusmc[BONUS_EXPLOSION] = caskorange;
bonusmc[BONUS_NUKE] = caskred;
bonusmc[BONUS_SPREAD] = caskyellow;
bonusmc[BONUS_SCORE] = box;
bonusmc[BONUS_SLIME] = caskgreen;
bonusmc[BONUS_ICE] = caskblue;
SCORE_PLAYER_HIT_PENALTY = -500;
SCORE_PLAYER_DEATH_PENALTY = -5000;
SCORE_PLANET_HIT_PENALTY = -1000;
SCORE_SHOT_MISS_PENALTY = -50;
SCORE_SLIME_CATCH = 200;
SCORE_ICE_CATCH = 500;
SCORE_EXPLOSION_FACTOR = 8;
SCORE_NUKE_FACTOR = 4;
SCORE_SLIME_DEATH_FACTOR = 5;
SCORE_ICE_DEATH_FACTOR = 10;
shiphpsrc.duplicateMovieClip("shiphp", guiDepth++);
shiphp._x = 60;
shiphp._y = 344;
planethpsrc.duplicateMovieClip("planethp", guiDepth++);
planethp._x = 420;
planethp._y = 344;
mouseListener = new Object();
mouseListener.onMouseDown = function () {
mouseState = true;
};
mouseListener.onMouseUp = function () {
mouseState = false;
};
Mouse.addListener(mouseListener);
EntityClass.prototype.setMovement = function (x, y, vel) {
var _local2 = setLength(x - this.mc._x, y - this.mc._y, vel);
this.velocityX = _local2[0];
this.velocityY = _local2[1];
};
EntityClass.prototype.update = function () {
if (this.status != STATUS_NORMAL) {
if ((this.laststatus + STATUS_PERIOD) < game.frames) {
this.setStatus(STATUS_NORMAL);
}
if (this.status == STATUS_SLIME) {
this.mc._x = this.mc._x + (this.velocityX / 2);
this.mc._y = this.mc._y + (this.velocityY / 2);
}
} else {
this.mc._x = this.mc._x + this.velocityX;
this.mc._y = this.mc._y + this.velocityY;
}
};
EntityClass.prototype.die = function () {
if (this.alive) {
var _local2 = this.mc.score;
if (this.status == STATUS_SLIME) {
_local2 = _local2 * SCORE_SLIME_DEATH_FACTOR;
} else if (this.status == STATUS_SLIME) {
_local2 = _local2 * SCORE_ICE_DEATH_FACTOR;
}
adjustScore(_local2);
this.mc.gotoAndPlay("decay");
} else {
this.mc.gotoAndPlay("dead");
}
this.alive = false;
if (this.bonus != 0) {
var _local3 = new BonusClass(this.mc._x, this.mc._y, this.bonus, bonusmc[this.bonus]);
game.addBonus(_local3);
}
};
EntityClass.prototype.dieSilent = function () {
this.alive = false;
this.mc.gotoAndPlay("dead");
};
EntityClass.prototype.setStatus = function (newstatus) {
if (newstatus == STATUS_NORMAL) {
this.mc.gotoAndPlay("alive");
this.status = newstatus;
this.laststatus = game.frames;
} else if (this.mc._currentframe == 1) {
this.status = newstatus;
if (newstatus == STATUS_SLIME) {
this.mc.gotoAndPlay("slime");
} else {
this.mc.gotoAndPlay("ice");
}
this.laststatus = game.frames;
}
};
PlayerClass.prototype = new EntityClass();
PlayerClass.prototype.update = function () {
if (this.hp <= 0) {
if ((this.lastdamage + this.respawnpause) < game.frames) {
this.hp = this.maxhp;
this.mc.gotoAndPlay("respawn");
shiphp.bar._xscale = 100;
}
return(undefined);
}
var _local6 = cursor._x - this.mc._x;
var _local4 = cursor._y - this.mc._y;
var _local8 = getLength(_local6, _local4);
var _local5;
if (_local8 > 100) {
var _local3 = (_local8 - 100) / 20;
if (_local3 > 2) {
_local3 = 2;
}
_local5 = setLength(_local6, _local4, _local3);
} else {
_local5 = [0, 0];
}
this.velocityX = _local5[0];
this.velocityY = _local5[1];
super.update();
_local6 = this.mc._x - planetsrc._x;
_local4 = this.mc._y - planetsrc._y;
var _local7 = setLength(_local6, _local4, orbitLength);
_local6 = _local7[0] + planetsrc._x;
_local4 = _local7[1] + planetsrc._y;
this.mc._x = _local6;
this.mc._y = _local4;
};
PlayerClass.prototype.damage = function () {
if ((this.hp <= 0) || ((this.lastdamage + this.damagepause) > game.frames)) {
return(undefined);
}
this.mc.gotoAndPlay("damage");
this.lastdamage = game.frames;
this.hp--;
shiphp.bar._xscale = (this.hp / this.maxhp) * 100;
if (this.hp <= 0) {
this.mc.gotoAndPlay("decay");
cursor.gotoAndPlay("respawn");
adjustScore(SCORE_PLAYER_DEATH_PENALTY);
} else {
adjustScore(SCORE_PLAYER_HIT_PENALTY);
}
};
PlanetClass.prototype = new EntityClass();
PlanetClass.prototype.update = function () {
};
PlanetClass.prototype.damage = function () {
if ((this.hp <= 0) || ((this.lastdamage + this.damagepause) > game.frames)) {
return(undefined);
}
this.hp--;
planethp.bar._xscale = (this.hp / this.maxhp) * 100;
if (this.hp <= 0) {
this.mc.gotoAndPlay("decay");
}
adjustScore(SCORE_PLANET_HIT_PENALTY);
};
WeaponClass.prototype.shoot = function () {
if ((this.lastshot + this.cooldown) > game.frames) {
return(false);
}
if (this.clip > 0) {
var bc = eval ("bulletcover" + this.clip);
bc._visible = false;
this.clip--;
if (this.clip <= 0) {
this.reload();
}
this.lastshot = game.frames;
return(true);
}
return(false);
};
WeaponClass.prototype.reload = function () {
this.reloaded = game.frames + (reloadTime * 2);
cursor.gotoAndPlay("reload");
};
WeaponClass.prototype.update = function () {
if ((this.clip <= 0) && (this.reloaded <= game.frames)) {
this.clip = this.maxclip;
i = 1;
while (i <= this.clip) {
var bc = eval ("bulletcover" + i);
bc._visible = true;
i++;
}
}
};
WeaponClass.prototype.remove = function () {
i = 1;
while (i <= this.clip) {
_root["bulletcover" + i].removeMovieClip();
i++;
}
};
GameClass.prototype.init = function () {
eval ("doInitLevel" + level)();
};
GameClass.prototype.addObject = function (obj) {
this.objects.push(obj);
};
GameClass.prototype.addBullet = function (bul) {
this.bullets.push(bul);
};
GameClass.prototype.addBonus = function (bon) {
this.bonuses.push(bon);
};
GameClass.prototype.isGameOver = function () {
return((this.objects.length > 0) && (this.planet.mc._currentframe == this.planet.mc._totalframes));
};
GameClass.prototype.cleanUp = function () {
for (i in this.objects) {
this.objects[i].dieSilent();
}
for (i in this.bonuses) {
this.bonuses[i].dieSilent();
}
for (i in this.bullets) {
this.bullets[i].dieSilent();
}
planethp.removeMovieClip();
shiphp.removeMovieClip();
weapon.removeMovieClip();
this.weapon.remove();
this.clean();
};
GameClass.prototype.gameOver = function () {
this.cleanUp();
cursor.gotoAndPlay("arrow");
gameOverState = true;
this.player.mc.removeMovieClip();
};
GameClass.prototype.levelComplete = function () {
this.cleanUp();
level++;
};
GameClass.prototype.update = function () {
updateMouse();
if (paused) {
return(undefined);
}
this.player.update();
this.weapon.update();
this.planet.update();
for (i in this.objects) {
var obj = this.objects[i];
obj.update();
if (obj.alive) {
if (obj.mc.hit.hitTest(this.player.mc.hit)) {
this.player.damage();
} else if (obj.mc.hit.hitTest(this.planet.mc.hit)) {
this.planet.damage();
obj.die();
}
}
}
for (i in this.bonuses) {
this.bonuses[i].update();
}
for (i in this.bullets) {
var bul = this.bullets[i];
if (bul.alive) {
bul.update();
if (((bul.mc._x + _x) + _parent._x) > 480) {
bul.dieSilent();
adjustScore(SCORE_SHOT_MISS_PENALTY);
} else if ((game.frames % 5) == 0) {
for (j in this.bonuses) {
var bon = this.bonuses[j];
if (bon.alive && (bon.mc.hit.hitTest(bul.mc._x, bul.mc._y, false))) {
bon.die();
bul.die();
break;
}
}
for (j in this.objects) {
var obj = this.objects[j];
if (obj.alive && (obj.mc.hit.hitTest((bul.mc._x + _x) + _parent._x, (bul.mc._y + _y) + _parent._y, false))) {
obj.die();
bul.die();
break;
}
}
}
}
}
if (this.isGameOver()) {
this.gameOver();
}
this.frames++;
if ((this.frames % CLEAN_PAUSE) == 0) {
this.clean();
}
if ((this.frames % SPAWN_PAUSE) == 1) {
eval ("doSpawnLevel" + level)(this.spawnCounter++);
}
};
GameClass.prototype.clean = function () {
var _local4 = new Array();
for (i in this.objects) {
var _local2 = this.objects[i];
if ((_local2.alive || ((_local2.mc._currentframe != _local2.mc._totalframes) && (_local2.mc._currentframe != 1))) && ((((_local2.mc._x > -50) && (_local2.mc._x < 530)) && (_local2.mc._y > -50)) && (_local2.mc._y < 410))) {
_local4.push(_local2);
} else {
_local2.mc.removeMovieClip();
}
}
this.objects = _local4;
var _local6 = new Array();
for (i in this.bonuses) {
var _local3 = this.bonuses[i];
if (_local3.alive || (_local3.mc._currentframe < _local3.mc._totalframes)) {
_local6.push(_local3);
} else {
_local3.mc.removeMovieClip();
}
}
this.bonuses = _local6;
var _local5 = new Array();
for (i in this.bullets) {
var _local3 = this.bullets[i];
if (_local3.alive || (_local3.mc._currentframe < _local3.mc._totalframes)) {
_local5.push(_local3);
} else {
_local3.mc.removeMovieClip();
}
}
this.bullets = _local5;
};
GameClass.prototype.shootAt = function (x, y) {
if ((this.player.hp <= 0) || (!this.weapon.shoot())) {
return(undefined);
}
this.player.mc.gotoAndPlay("shot");
var _local4 = new EntityClass(this.player.mc._x, this.player.mc._y, this.weapon.mc);
_local4.setMovement(x, y, 5);
game.addBullet(_local4);
if (this.weapon.isShrapnel) {
var _local3 = x - this.player.mc._x;
var _local2 = y - this.player.mc._y;
var _local7 = 0.2;
var _local6 = Math.sin(_local7);
var _local5 = Math.cos(_local7);
var _local8 = (_local3 * _local5) + (_local2 * _local6);
_local4 = new EntityClass(this.player.mc._x, this.player.mc._y, this.weapon.mc);
_local4.setMovement(_local8 + this.player.mc._x, (((-_local3) * _local6) + (_local2 * _local5)) + this.player.mc._y, 5);
_local4.mc._xscale = 80;
_local4.mc._yscale = 80;
game.addBullet(_local4);
_local7 = -0.2;
_local6 = Math.sin(_local7);
_local5 = Math.cos(_local7);
_local8 = (_local3 * _local5) + (_local2 * _local6);
_local4 = new EntityClass(this.player.mc._x, this.player.mc._y, this.weapon.mc);
_local4.setMovement(_local8 + this.player.mc._x, (((-_local3) * _local6) + (_local2 * _local5)) + this.player.mc._y, 5);
_local4.mc._xscale = 80;
_local4.mc._yscale = 80;
game.addBullet(_local4);
}
};
GameClass.prototype.spawnBanner = function (vel, mc, bonus, orient) {
var _local4 = 50 + (Math.random() * 200);
var _local3 = -20 + (Math.random() * 80);
var _local2 = new EntityClass(_local4, _local3, mc);
_local2.bonus = bonus;
_local2.setMovement(planetsrc._x, planetsrc._y, vel);
if ((orient != undefined) && (orient)) {
_local2.mc._rotation = rad2deg(Math.atan2(180 - _local2.mc._y, 240 - _local2.mc._x)) + 90;
}
_local2.mc.gotoAndPlay("zoom");
this.addObject(_local2);
};
var game = new GameClass();
game.init();
if (gameInit) {
gameInit = false;
} else {
hideOffscreenStuff();
}
Symbol 1983 MovieClip Frame 6
game.update();
cursor._x = 400;
cursor._y = game.frames % 300;
if (cursor._y > 150) {
cursor._y = 300 - cursor._y;
}
cursor._y = cursor._y - 75;
if ((!Key.isDown(32)) && (prevSpace)) {
togglePause();
}
prevSpace = Key.isDown(32);
game.shootAt(cursor._x, cursor._y);
prevMouseState = mouseState;
var nextlevel = false;
if (gameOverState) {
game.planet.mc.gotoAndPlay("normal");
gotoAndPlay ("gameover");
} else {
if (game.objects.length == 0) {
if (levelCompleteMessageDisplayed) {
if (message._currentframe == 1) {
game.levelComplete();
nextlevel = true;
}
} else {
levelCompleteMessageDisplayed = true;
message.gotoAndPlay("complete");
}
}
if (nextlevel) {
game.player.mc.removeMovieClip();
cursor.gotoAndPlay("arrow");
switch (level) {
case 2 :
gotoAndPlay ("levelpause1");
break;
case 3 :
gotoAndPlay ("levelpause2");
break;
case 4 :
gotoAndPlay ("levelpause3");
break;
case 5 :
gotoAndPlay ("levelpause4");
break;
case 6 :
gotoAndPlay ("levelpause5");
break;
case 7 :
gotoAndPlay ("complete");
}
} else {
play();
}
}
Symbol 1983 MovieClip Frame 7
game.update();
if (game.frames > 700) {
gotoAndPlay ("ending");
} else {
gotoAndPlay ("game");
}
Symbol 1983 MovieClip Frame 8
_quality = "high";
game.gameOver();
play();
Symbol 1983 MovieClip Frame 178
gotoAndPlay ("play");
Symbol 1990 Button
on (rollOver) {
_root.playSound("select");
cursor.gotoAndPlay("hand");
}
on (rollOut) {
cursor.gotoAndPlay("arrow");
}
on (release) {
_root.playSound("click");
getURL (_root.downloadPromotedURL, "_blank");
}
Symbol 2015 MovieClip Frame 1
stop();
Symbol 2015 MovieClip Frame 2
stop();
Symbol 2015 MovieClip Frame 3
stop();
Symbol 2015 MovieClip Frame 4
stop();
Symbol 2015 MovieClip Frame 5
stop();
Symbol 2015 MovieClip Frame 6
stop();
Symbol 2015 MovieClip Frame 7
stop();
Symbol 2015 MovieClip Frame 8
stop();
this.enabled = false;
Symbol 2033 MovieClip Frame 1
stop();
locksUp = function () {
lock._visible = true;
};
Symbol 2033 MovieClip Frame 2
stop();
Symbol 2033 MovieClip Frame 3
stop();
Symbol 2033 MovieClip Frame 4
stop();
Symbol 2033 MovieClip Frame 5
stop();
Symbol 2033 MovieClip Frame 6
stop();
Symbol 2033 MovieClip Frame 7
stop();
Symbol 2033 MovieClip Frame 8
stop();
this.enabled = false;
Symbol 2048 MovieClip Frame 1
stop();
Symbol 2048 MovieClip Frame 2
stop();
Symbol 2048 MovieClip Frame 3
stop();
Symbol 2048 MovieClip Frame 4
stop();
Symbol 2048 MovieClip Frame 5
stop();
Symbol 2048 MovieClip Frame 6
stop();
Symbol 2048 MovieClip Frame 7
stop();
Symbol 2048 MovieClip Frame 8
stop();
this.enabled = false;
Symbol 2063 MovieClip Frame 1
stop();
locksUp = function () {
lock._visible = true;
};
Symbol 2063 MovieClip Frame 2
stop();
Symbol 2063 MovieClip Frame 3
stop();
Symbol 2063 MovieClip Frame 4
stop();
Symbol 2063 MovieClip Frame 5
stop();
Symbol 2063 MovieClip Frame 6
stop();
Symbol 2063 MovieClip Frame 7
stop();
Symbol 2063 MovieClip Frame 8
stop();
this.enabled = false;
Symbol 2070 MovieClip Frame 1
stop();
locksUp = function () {
lock._visible = true;
};
Symbol 2070 MovieClip Frame 2
stop();
Symbol 2070 MovieClip Frame 3
stop();
Symbol 2070 MovieClip Frame 4
stop();
Symbol 2070 MovieClip Frame 5
stop();
this.enabled = false;
Symbol 2075 MovieClip Frame 1
stop();
locksUp = function () {
lock._visible = true;
};
Symbol 2075 MovieClip Frame 2
stop();
Symbol 2075 MovieClip Frame 3
stop();
Symbol 2075 MovieClip Frame 4
stop();
this.enabled = false;
Symbol 2080 MovieClip Frame 1
stop();
locksUp = function () {
lock._visible = true;
};
Symbol 2080 MovieClip Frame 2
stop();
Symbol 2080 MovieClip Frame 3
stop();
Symbol 2080 MovieClip Frame 4
stop();
this.enabled = false;
Symbol 2085 MovieClip Frame 1
stop();
locksUp = function () {
lock._visible = true;
};
Symbol 2085 MovieClip Frame 2
stop();
Symbol 2085 MovieClip Frame 3
stop();
Symbol 2085 MovieClip Frame 4
stop();
this.enabled = false;
Symbol 2090 MovieClip Frame 1
stop();
locksUp = function () {
lock._visible = true;
};
Symbol 2090 MovieClip Frame 2
stop();
Symbol 2090 MovieClip Frame 3
stop();
Symbol 2090 MovieClip Frame 4
stop();
this.enabled = false;
Symbol 2093 MovieClip Frame 1
stop();
locksUp = function () {
lock._visible = true;
};
Symbol 2093 MovieClip Frame 2
stop();
Symbol 2093 MovieClip Frame 3
stop();
this.enabled = false;
Symbol 2103 MovieClip Frame 1
if (discription == "") {
price = "";
} else {
price = "price";
}
Symbol 2109 MovieClip Frame 1
stop();
Symbol 2109 MovieClip Frame 2
play();
Symbol 2122 Button
on (rollOver) {
_root.cursor.gotoAndPlay("hand");
}
on (rollOut) {
_root.cursor.gotoAndPlay("arrow");
}
on (release) {
_root._r = _root.getScoreEncoded();
var name = _root.playername;
var d1;
var d2;
var d3;
var d4;
d1 = _root._r[0].toString();
d2 = _root._r[1].toString();
d3 = _root._r[2].toString();
d4 = _root._r[3].toString();
getURL (_root.hiscoreURL, "_blank", "POST");
}
Symbol 2126 Button
on (rollOver) {
buttongetfull.gotoAndPlay("flash");
cursor.gotoAndPlay("hand");
_root.playSound("select");
}
on (rollOut) {
cursor.gotoAndPlay("arrow");
}
on (release) {
_root.playSound("click");
getURL (_root.orderURL, "_blank");
}
Symbol 2128 MovieClip Frame 1
stop();
Symbol 2128 MovieClip Frame 2
play();
Symbol 2129 Button
on (rollOver) {
buttonstartover.gotoAndPlay("flash");
cursor.gotoAndPlay("hand");
_root.playSound("select");
}
on (rollOut) {
cursor.gotoAndPlay("arrow");
}
on (release) {
_root.numberofGame++;
_root.playSound("click");
_root.gotoAndPlay("play");
}
Symbol 2131 MovieClip Frame 1
stop();
Symbol 2131 MovieClip Frame 2
play();
Symbol 2138 Button
on (rollOver) {
buttonagain.gotoAndPlay("flash");
cursor.gotoAndPlay("hand");
_root.playSound("select");
}
on (rollOut) {
cursor.gotoAndPlay("arrow");
}
on (release) {
_root.playSound("click");
_root.numberofGame = 0;
_root.renewHero();
_root.gotoAndPlay("play");
}
Symbol 2139 MovieClip Frame 1
stop();
Symbol 2139 MovieClip Frame 2
play();
Symbol 2141 Button
on (rollOver) {
button2.gotoAndPlay("flash");
cursor.gotoAndPlay("hand");
_root.playSound("select");
}
on (rollOut) {
cursor.gotoAndPlay("arrow");
}
on (release) {
_root.playSound("click");
getURL (downloadURL, "_blank");
}
Symbol 2143 Button
on (rollOver) {
buttoncontinue.gotoAndPlay("flash");
cursor.gotoAndPlay("hand");
_root.playSound("select");
}
on (rollOut) {
cursor.gotoAndPlay("arrow");
}
on (release) {
_root.playSound("click");
_root.gotoAndPlay("continue");
}
Symbol 2144 MovieClip Frame 1
stop();
Symbol 2144 MovieClip Frame 2
play();
Symbol 2180 Button
on (rollOver) {
buttoncontinue.gotoAndPlay("flash");
cursor.gotoAndPlay("hand");
_root.playSound("select");
}
on (rollOut) {
cursor.gotoAndPlay("arrow");
}
on (release) {
_root.playSound("click");
_root.gotoAndPlay("play");
}