Frame 1
Stage.showMenu = false;
_focusrect = false;
stop();
Instance of Symbol 113 MovieClip [veh] "vehicule" in Frame 7
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 127 MovieClip [snafu] in Frame 7
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 182 MovieClip "Hud" in Frame 7
onClipEvent (load) {
this._visible = false;
this.swapDepths(30000);
}
Instance of Symbol 184 MovieClip in Frame 7
onClipEvent (load) {
this = new tr_Ctrl(this);
}
onClipEvent (keyDown) {
_global.C.keyPressed();
}
onClipEvent (keyUp) {
_global.C.keyReleased();
}
Instance of Symbol 205 MovieClip "CtrlSounds" in Frame 7
onClipEvent (load) {
_global.S = this;
Items = new Object();
G_TabSonFade = new Array();
Mute = false;
Controlled = new Array("sndMusic", "sndBump", "sndSelectVeh", "sndEgg", "sndPackage", "sndBoost", "sndOil", "sndSnafu", "sndBtn", "sndShield", "sndPts", "sndWrench", "sndBip", "sndTransit", "sndDie", "sndAutoSelect", "sndAvionSelect", "sndMotoSelect");
for (i in Controlled) {
this.createEmptyMovieClip(Controlled[i], i + 1);
this[Controlled[i]] = new Sound(Controlled[i]);
this[Controlled[i]].attachSound(Controlled[i]);
Items[Controlled[i]] = new Object();
Items[Controlled[i]].Nom = Controlled[i];
Items[Controlled[i]].Volume = 0;
}
PlaySound = function (l_Name, l_Vol, l_NbLoop, l_restart) {
if ((l_restart == undefined) || (l_restart == false)) {
if (!eval (l_Name).isPlaying) {
SetVolume(l_Name, l_Vol);
eval (l_Name).start(0, l_NbLoop);
eval (l_Name).isPlaying = true;
this[l_Name].onSoundComplete = function () {
this.isPlaying = false;
};
}
} else {
SetVolume(l_Name, l_Vol);
eval (l_Name).start(0, l_NbLoop);
eval (l_Name).isPlaying = true;
this[l_Name].onSoundComplete = function () {
this.isPlaying = false;
};
}
};
StopSound = function (l_Name) {
SetVolume(l_Name, 0);
eval (l_Name).isPlaying = false;
eval (l_Name).stop();
};
SetVolume = function (l_Name, l_Vol) {
Items[l_Name].Volume = l_Vol;
if (Mute) {
eval (l_Name).setVolume(0);
} else {
eval (l_Name).setVolume(l_Vol);
}
};
isPlaying = function (l_Name) {
return(eval (l_Name).isPlaying);
};
DoFade = function (l_Name, l_Vol, l_DirFade, l_SpdFade, l_Index) {
var _local1 = Items[l_Name].Volume;
if (l_DirFade == "In") {
if ((_local1 + l_SpdFade) < l_Vol) {
SetVolume(l_Name, _local1 + l_SpdFade);
} else {
SetVolume(l_Name, l_Vol);
G_TabSonFade.splice(l_Index, 1);
}
} else if ((_local1 - l_SpdFade) > l_Vol) {
SetVolume(l_Name, _local1 - l_SpdFade);
} else {
SetVolume(l_Name, l_Vol);
G_TabSonFade.splice(l_Index, 1);
if (l_Vol == 0) {
StopSound(l_Name);
}
}
};
Fade = function () {
for (i in G_TabSonFade) {
DoFade(G_TabSonFade[i][0], G_TabSonFade[i][1], G_TabSonFade[i][2], G_TabSonFade[i][3], i);
}
};
DoMute = function () {
Mute = true;
for (i in Items) {
eval (Items[i].Nom).setVolume(0);
}
};
UndoMute = function () {
Mute = false;
for (i in Items) {
SetVolume(Items[i].Nom, Items[i].Volume);
}
};
}
onClipEvent (enterFrame) {
_global.S.Fade();
}
Frame 8
_global.S.PlaySound("sndMusic", 0, 9999);
_global.S.G_TabSonFade.push(["sndMusic", 15, "In", 1]);
_focusrect = false;
Instance of Symbol 214 MovieClip "RoadHit" in Frame 8
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 218 MovieClip "ControlHS" in Frame 8
onClipEvent (load) {
function getScores() {
if (G_TestHighScore == true) {
trace("getScores");
}
if (gProxyObj == undefined) {
if (G_TestHighScore == true) {
trace("dans getscore, listescore");
}
listScores();
} else {
if (G_TestHighScore == true) {
trace("dans getscore, getScores");
}
gProxyObj.getScores(cbFunc2);
}
}
function submitScore(theScore) {
if (G_TestHighScore == true) {
trace("Envoie le score = " + theScore);
}
gProxyObj.submitScore(theScore, cbFunc);
}
function initHiScores() {
if (G_TestHighScore == true) {
trace("Tu init le highscore!");
}
gProxyObj.setGame_Id("xs_disaster");
}
function getScoreString() {
var _local5 = "Oops! The high score list isn't available right now!";
var _local8 = 26;
if (gProxyObj != undefined) {
var _local7 = gProxyObj.getScoreCount();
if (_local7 > 0) {
var _local1;
var _local6;
var _local3;
var _local4;
_local5 = "";
_local1 = 0;
while (_local1 < _local7) {
_local6 = gProxyObj.getScoreItem(_local1);
_local3 = _local6[0];
_local4 = fStyleNumber(_local6[1]);
spaceNb = ((_local8 - _local3.length) - _local4.length) - 4;
spaceTXT = "";
var _local2 = 0;
while (_local2 < spaceNb) {
spaceTXT = spaceTXT + " ";
_local2++;
}
if (_local1 < 9) {
_local5 = _local5 + ((((((_local1 + 1) + " ") + _local3) + spaceTXT) + _local4) + newline);
} else if (_local1 < 99) {
_local5 = _local5 + ((((((_local1 + 1) + " ") + _local3) + spaceTXT) + _local4) + newline);
} else {
_local5 = _local5 + ((((((_local1 + 1) + " ") + _local3) + spaceTXT) + _local4) + newline);
}
_local1++;
}
} else {
_local5 = "Whoops, the high scores seem to have escaped!";
}
}
if (G_TestHighScore == true) {
trace("Tu retournes \u00E7a = " + _local5);
}
return(_local5);
}
function listScores() {
if (G_TestHighScore == true) {
trace("Liste les scores..");
}
_parent.mcMain.txt_highScore.text = getScoreString();
}
function cbFunc(thisBool) {
if (thisBool) {
listScores();
} else {
if (G_TestHighScore == true) {
trace("CBfunc y\u00E9 false...");
}
_parent.mcMain.txt_highScore.text = "Oops! The high score list isn\u2019t available right now!";
}
}
function cbFunc2(thisBool) {
if (thisBool) {
listScores();
} else {
_parent.mcMain.txt_highScore.text = "Oops! The high score list isn\u2019t available right now!";
}
}
function fStyleNumber(_nNumber, _nMinimumChar) {
_sNumber = String(_nNumber);
_sNewString = "";
_nlength = _sNumber.length;
_nlength = _nlength / 3;
if (_nlength <= 1) {
_sNewNumber = _sNumber;
if (_sNewNumber.length < _nMinimumChar) {
_sNewNumber = "0" + _sNewNumber;
}
return(_sNewNumber);
}
_nLoop = _nlength;
while (_nLoop > 1) {
_sNewString = (" " + _sNumber.substr(-3)) + _sNewString;
_sNumber = _sNumber.substr(0, -3);
_nLoop--;
}
_sNewNumber = _sNumber + _sNewString;
if (_sNewNumber.length < _nMinimumChar) {
_sNewNumber = "0" + _sNewNumber;
}
return(_sNewNumber);
}
_global.HS = this;
var G_ShowHighScore = true;
var G_TestHighScore = false;
if (G_TestHighScore == true) {
gProxyObj.setServer("www.nick-q.mtvi.com");
gProxyObj.setScreenName("SimonQuiTest");
gProxyObj.setIsLoggedIn(true);
}
}
Instance of Symbol 318 MovieClip "Map" in Frame 9
onClipEvent (load) {
trace(_global.C);
_global.C.CreerMap(this);
}
Instance of Symbol 321 MovieClip "Decoupe" in Frame 9
onClipEvent (load) {
this.swapDepths(20000);
}
Frame 13
stop();
Frame 14
Hud._visible = false;
_global.C.nbPts = 0;
Hud.Pts.text = 0;
stop();
Instance of Symbol 339 MovieClip in Frame 14
/* no clip actions */
Frame 20
stop();
Frame 29
stop();
Frame 34
stop();
Frame 39
Hud._visible = false;
stop();
Instance of Symbol 482 MovieClip "Transit" in Frame 39
onClipEvent (load) {
this.swapDepths(30001);
}
Frame 47
Hud._visible = false;
stop();
Frame 52
Hud._visible = false;
stop();
Frame 58
stop();
Frame 67
Hud._visible = true;
stop();
Instance of Symbol 620 MovieClip "ScorePopUp" in Frame 67
onClipEvent (load) {
this.swapDepths(20005);
}
Instance of Symbol 636 MovieClip "HelpInGame" in Frame 67
onClipEvent (load) {
this.swapDepths(8000000);
}
Symbol 23 MovieClip Frame 1
stop();
Instance of Symbol 19 MovieClip in Symbol 24 MovieClip Frame 1
onClipEvent (load) {
iTotal = _parent._parent.getBytesTotal();
iCurrent = 0;
done = true;
}
onClipEvent (enterFrame) {
iCurrent = 100 * (_parent._parent.getBytesLoaded() / iTotal);
_parent.Bar.gotoAndStop(Math.round(iCurrent));
_parent.Pour_txt.text = Math.round(iCurrent) + " %";
_parent.Shadow_txt.text = Math.round(iCurrent) + " %";
if (Math.round(iCurrent) == 100) {
_parent._parent.gotoAndPlay("Init");
}
}
Symbol 637 MovieClip [__Packages.tr_Ctrl] Frame 0
class tr_Ctrl
{
var mcRef, lvlNo, nbPackages, nbPts, nbPtsX, nbPtsXCollect, nbLife, xCar, snafuArr, timer, gamePause, map, rightarrow, leftarrow, uparrow, downarrow;
function tr_Ctrl (l_mcRef) {
mcRef = l_mcRef;
mcRef._visible = false;
_global.C = this;
_global.CS = mcRef._parent;
lvlNo = 0;
nbPackages = 0;
nbPts = 0;
nbPtsX = 0;
nbPtsXCollect = 0;
_global.CS.Hud.Pts.text = nbPts;
nbLife = 101;
_global.CS.Hud.LifeBar.gotoAndStop(nbLife);
xCar = null;
snafuArr = new Array();
timer = new tr_CountDown();
gamePause = false;
CreateVeh();
mcRef.onEnterFrame = EnterFrame;
}
function CreateVeh() {
xCar = new tr_xCar(_global.CS.attachMovie("veh", "veh", DEPTH_VEH));
}
function CreerMap(l_mcRef) {
map = new tr_Map(l_mcRef);
}
function SetLvlNo(l_lvlNo) {
lvlNo = l_lvlNo;
}
function AddAPackage() {
nbPackages++;
_global.CS.Hud.NbPack.text = 0;
_global.CS.Hud.NbPackTotal.text = nbPackages;
}
function AddAPtsX() {
nbPtsX++;
}
function RemoveAPackage() {
if (nbPackages > 0) {
nbPackages--;
_global.CS.Hud.NbPack.text = _global.CS.Hud.NbPackTotal.text - nbPackages;
if (nbPackages == 0) {
timer.StopTimer();
xCar.PauseMe();
var _local3 = 0;
while (_local3 < snafuArr.length) {
snafuArr[_local3].PauseMe();
_local3++;
}
_global.CS.ScorePopUp.gotoAndStop("Appear");
}
}
}
function GetSnafuDepth() {
return(DEPTH_SNAFU_CAR);
}
function GetHit(l_collider) {
switch (l_collider) {
case "snafu" :
switch (xCar.GetSelectedVeh()) {
case 1 :
RemoveLife(LIFE_SNAFU_1);
break;
case 2 :
RemoveLife(LIFE_SNAFU_2);
break;
case 3 :
RemoveLife(LIFE_SNAFU_3);
}
break;
case "Oil" :
switch (xCar.GetSelectedVeh()) {
case 1 :
RemoveLife(LIFE_OIL_1);
break;
case 2 :
RemoveLife(LIFE_OIL_2);
}
}
}
function RemoveLife(l_amount) {
nbLife = nbLife - l_amount;
if (nbLife < 1) {
nbLife = 1;
}
if (nbLife == 1) {
xCar.Dying();
_global.S.PlaySound("sndDie", 100, 1);
}
_global.CS.Hud.LifeBar.gotoAndStop(nbLife);
}
function Heal() {
nbLife = 101;
_global.CS.Hud.LifeBar.gotoAndStop(nbLife);
}
function GameOver() {
if (lvlNo > 10) {
timer.StopTimer();
xCar.PauseMe();
_global.CS.ScorePopUp.gotoAndStop("Appear");
} else {
lvlNo = 0;
xCar.PauseMe();
timer.StopTimer();
_global.CS.Map.Lvl.gotoAndStop(1);
_global.CS.gotoAndStop("Loose");
}
}
function AddPts(l_ptsType) {
switch (l_ptsType) {
case "PtsX" :
nbPts = nbPts + PTS_X;
nbPtsXCollect++;
break;
case "Package" :
nbPts = nbPts + PTS_PACKAGE;
break;
case "Wrench" :
nbPts = nbPts + PTS_WRENCH;
break;
case "Shield" :
nbPts = nbPts + PTS_WRENCH;
break;
case "Snafu" :
nbPts = nbPts + PTS_SNAFU;
}
_global.CS.Hud.Pts.text = nbPts;
}
function GetScore() {
return(nbPts);
}
function GetLvlNo() {
return(lvlNo);
}
function NextLvl() {
if (lvlNo == 0) {
_global.CS.gotoAndStop("Game");
}
_global.CS.Hud.Clock.gotoAndStop("Idle");
Heal();
map.ResetLvl();
map.PlaceMap();
nbPackages = 0;
nbPtsX = 0;
nbPtsXCollect = 0;
xCar.ResetCar();
var _local3 = 0;
while (_local3 < snafuArr.length) {
snafuArr[_local3].DeleteMc();
delete snafuArr[_local3];
_local3++;
}
snafuArr = new Array();
if (lvlNo > 10) {
_global.CS.Map.Lvl.gotoAndStop("LevelBonus");
timer.StartCd(900);
} else {
lvlNo++;
_global.CS.Map.Lvl.gotoAndStop("Level" + lvlNo);
switch (lvlNo) {
case 1 :
map.CreateSnafus(4);
timer.StartCd(2800);
break;
case 2 :
map.CreateSnafus(6);
timer.StartCd(4800);
break;
case 3 :
map.CreateSnafus(8);
timer.StartCd(7800);
break;
case 4 :
map.CreateSnafus(12);
timer.StartCd(9800);
break;
case 5 :
map.CreateSnafus(16);
timer.StartCd(12000);
}
}
}
function KeyMappingVerify() {
if (rightarrow) {
xCar.HandleKey("right");
} else if (leftarrow) {
xCar.HandleKey("left");
} else if (uparrow) {
xCar.HandleKey("up");
} else if (downarrow) {
xCar.HandleKey("down");
}
}
function keyPressed() {
trace("key is down");
if (Key.getCode() == 39) {
rightarrow = true;
} else {
rightarrow = false;
}
if (Key.getCode() == 37) {
leftarrow = true;
} else {
leftarrow = false;
}
if (Key.getCode() == 38) {
uparrow = true;
} else {
uparrow = false;
}
if (Key.getCode() == 40) {
downarrow = true;
} else {
downarrow = false;
}
}
function keyReleased() {
if (Key.getCode() == 39) {
rightarrow = false;
}
if (Key.getCode() == 37) {
leftarrow = false;
}
if (Key.getCode() == 38) {
uparrow = false;
}
if (Key.getCode() == 40) {
downarrow = false;
}
}
function EnterFrame() {
if (!_global.C.gamePause) {
_global.C.KeyMappingVerify();
_global.C.map.EnterFrame();
_global.C.xCar.EnterFrame();
_global.C.timer.EnterFrame();
}
}
var DEPTH_VEH = 1000;
var DEPTH_SNAFU_CAR = 2000;
var LIFE_SNAFU_1 = 10;
var LIFE_SNAFU_2 = 25;
var LIFE_SNAFU_3 = 20;
var LIFE_OIL_1 = 2;
var LIFE_OIL_2 = 5;
var PTS_X = 250;
var PTS_SNAFU = 500;
var PTS_WRENCH = 50;
var PTS_PACKAGE = 150;
var PTS_SHIELD = 50;
}
Symbol 638 MovieClip [__Packages.tr_Map] Frame 0
class tr_Map
{
var mcRef, hit1, decoupe, hitArray;
function tr_Map (l_mcRef) {
mcRef = l_mcRef;
hit1 = _global.CS.RoadHit;
decoupe = _global.CS.Decoupe;
ScanMap();
PlaceMap();
_global.CS.gotoAndStop("TC");
}
function CreateSnafus(l_nbSnafu) {
var _local4;
var _local3 = 0;
while (_local3 < l_nbSnafu) {
_local4 = mcRef.SnafusContainer.attachMovie("snafu", "snafu" + _global.C.snafuArr.length, _global.C.GetSnafuDepth() + _global.C.snafuArr.length);
_global.C.snafuArr.push(new tr_snafuCar(_local4, _global.C.snafuArr.length));
_local3++;
}
}
function CreatePackage(l_mcRef) {
var _local4 = new tr_Package(l_mcRef);
_global.C.AddAPackage();
var _local3 = new Object();
_local3.x = Math.floor(l_mcRef._x / SCAN_WIDTH);
_local3.y = Math.floor(l_mcRef._y / SCAN_WIDTH);
if (hitArray[_local3.y][_local3.x][0] == 1) {
hitArray[_local3.y][_local3.x][0] = 2;
}
hitArray[_local3.y][_local3.x][1].push(_local4);
}
function CreateWrench(l_mcRef) {
var _local4 = new tr_Wrench(l_mcRef);
var _local2 = new Object();
_local2.x = Math.floor(l_mcRef._x / SCAN_WIDTH);
_local2.y = Math.floor(l_mcRef._y / SCAN_WIDTH);
if (hitArray[_local2.y][_local2.x][0] == 1) {
hitArray[_local2.y][_local2.x][0] = 2;
}
hitArray[_local2.y][_local2.x][1].push(_local4);
}
function CreateSpeedWay(l_mcRef, l_dir) {
var _local3 = new tr_SpeedWay(l_mcRef, l_dir);
var _local2 = new Object();
_local2.x = Math.floor(l_mcRef._x / SCAN_WIDTH);
_local2.y = Math.floor(l_mcRef._y / SCAN_WIDTH);
if (hitArray[_local2.y][_local2.x][0] == 1) {
hitArray[_local2.y][_local2.x][0] = 2;
}
hitArray[_local2.y][_local2.x][1].push(_local3);
}
function CreatePtsX(l_mcRef) {
var _local5 = new tr_PtsX(l_mcRef);
_global.C.AddAPtsX();
var _local3 = new Object();
_local3.x = Math.floor(l_mcRef._x / SCAN_WIDTH);
_local3.y = Math.floor(l_mcRef._y / SCAN_WIDTH);
if (hitArray[_local3.y][_local3.x][0] == 1) {
hitArray[_local3.y][_local3.x][0] = 2;
}
hitArray[_local3.y][_local3.x][1].push(_local5);
}
function CreateShield(l_mcRef) {
var _local4 = new tr_Shield(l_mcRef);
var _local2 = new Object();
_local2.x = Math.floor(l_mcRef._x / SCAN_WIDTH);
_local2.y = Math.floor(l_mcRef._y / SCAN_WIDTH);
if (hitArray[_local2.y][_local2.x][0] == 1) {
hitArray[_local2.y][_local2.x][0] = 2;
}
hitArray[_local2.y][_local2.x][1].push(_local4);
}
function CreateOil(l_mcRef) {
var _local4 = new tr_Oil(l_mcRef);
var _local2 = new Object();
_local2.x = Math.floor(l_mcRef._x / SCAN_WIDTH);
_local2.y = Math.floor(l_mcRef._y / SCAN_WIDTH);
if (hitArray[_local2.y][_local2.x][0] == 1) {
hitArray[_local2.y][_local2.x][0] = 2;
}
hitArray[_local2.y][_local2.x][1].push(_local4);
}
function CreateBarrier(l_mcRef) {
var _local3 = new tr_Barrier(l_mcRef);
var _local2 = new Object();
_local2.x = Math.floor(l_mcRef._x / SCAN_WIDTH);
_local2.y = Math.floor(l_mcRef._y / SCAN_WIDTH);
if (hitArray[_local2.y][_local2.x][0] >= 1) {
hitArray[_local2.y][_local2.x][0] = 3;
}
hitArray[_local2.y][_local2.x][1].push(_local3);
}
function GetObjCell(l_coord, l_dir) {
var _local6 = 0;
var _local2 = (l_coord.y - mcRef._y) / SCAN_HEIGHT;
var _local3 = (l_coord.x - mcRef._x) / SCAN_WIDTH;
if ((l_dir == "right") || (l_dir == "down")) {
_local2 = Math.ceil(_local2);
_local3 = Math.ceil(_local3);
} else if ((l_dir == "left") || (l_dir == "up")) {
_local2 = Math.floor(_local2);
_local3 = Math.floor(_local3);
}
return(hitArray[_local2][_local3][1]);
}
function EnterFrame() {
var _local2 = 0;
while (_local2 < _global.C.snafuArr.length) {
_global.C.snafuArr[_local2].EnterFrame();
_local2++;
}
}
function PlaceMap() {
var _local2 = new Object();
_local2.x = hit1.StartPos._x;
_local2.y = hit1.StartPos._y;
mcRef.localToGlobal(_local2);
mcRef._x = mcRef._x - (_local2.x - XCAR_STD_X_POS);
mcRef._y = mcRef._y - (_local2.y - XCAR_STD_Y_POS);
decoupe._x = mcRef._x;
decoupe._y = mcRef._y;
}
function ScanMap() {
var _local6 = CreateScannerHead();
var _local8 = mcRef._width / SCAN_WIDTH;
var _local10 = mcRef._height / SCAN_HEIGHT;
var _local4 = new Object();
var _local7;
var _local9;
hitArray = new Array();
var _local5 = 0;
while (_local5 < _local10) {
hitArray[_local5] = new Array();
var _local3 = 0;
while (_local3 < _local8) {
hitArray[_local5][_local3] = new Array();
_local6._x = _local3 * SCAN_WIDTH;
_local6._y = _local5 * SCAN_HEIGHT;
_local7 = true;
_local9 = true;
var _local2 = 1;
while (_local2 <= 4) {
_local4.x = _local6["pt" + _local2]._x;
_local4.y = _local6["pt" + _local2]._y;
_local6.localToGlobal(_local4);
if (!hit1.hitTest(_local4.x, _local4.y, true)) {
_local7 = false;
_local2 = 5;
}
_local2++;
}
if (_local7) {
hitArray[_local5][_local3][0] = 1;
} else {
hitArray[_local5][_local3][0] = 0;
}
hitArray[_local5][_local3][1] = new Array();
_local3++;
}
_local5++;
}
_local6.removeMovieClip();
}
function ResetLvl() {
var _local5 = mcRef._width / SCAN_WIDTH;
var _local6 = mcRef._height / SCAN_HEIGHT;
var _local3 = 0;
while (_local3 < _local6) {
var _local2 = 0;
while (_local2 < _local5) {
var _local4 = 0;
while (_local4 < hitArray[_local3][_local2][1].length) {
delete hitArray[_local3][_local2][1][_local4];
_local4++;
}
hitArray[_local3][_local2][1] = new Array();
if (hitArray[_local3][_local2][0] > 1) {
hitArray[_local3][_local2][0] = 1;
}
_local2++;
}
_local3++;
}
}
function CreateScannerHead() {
var _local4 = _global.CS.createEmptyMovieClip("scannerHead", 1);
var _local3 = _global.CS.scannerHead.createEmptyMovieClip("pt1", 1);
_local3._x = HEAD_TOLERANCE;
_local3._y = HEAD_TOLERANCE;
_local3 = _global.CS.scannerHead.createEmptyMovieClip("pt2", 2);
_local3._x = SCAN_WIDTH - HEAD_TOLERANCE;
_local3._y = HEAD_TOLERANCE;
_local3 = _global.CS.scannerHead.createEmptyMovieClip("pt3", 3);
_local3._x = HEAD_TOLERANCE;
_local3._y = SCAN_HEIGHT - HEAD_TOLERANCE;
_local3 = _global.CS.scannerHead.createEmptyMovieClip("pt4", 4);
_local3._x = SCAN_WIDTH - HEAD_TOLERANCE;
_local3._y = SCAN_HEIGHT - HEAD_TOLERANCE;
return(_local4);
}
function GetGap(l_coord, l_wishDir, l_curDir, l_speed) {
var _local3 = (l_coord.y - mcRef._y) / SCAN_HEIGHT;
var _local4 = (l_coord.x - mcRef._x) / SCAN_WIDTH;
var _local2 = new Number();
var _local6 = null;
switch (l_curDir) {
case "left" :
_local4 = Math.floor(_local4);
break;
case "right" :
_local4 = Math.ceil(_local4);
break;
case "up" :
_local3 = Math.floor(_local3);
break;
case "down" :
_local3 = Math.ceil(_local3);
}
switch (l_wishDir) {
case "down" :
_local3 = Math.ceil(_local3);
break;
case "up" :
_local3 = Math.floor(_local3);
break;
case "left" :
_local4 = Math.floor(_local4);
break;
case "right" :
_local4 = Math.ceil(_local4);
}
if (hitArray[_local3][_local4][0] >= 1) {
switch (l_curDir) {
case "left" :
_local2 = _local4 * SCAN_WIDTH;
if (((l_coord.x - mcRef._x) - l_speed) <= _local2) {
_local6 = (l_coord.x - mcRef._x) - _local2;
}
break;
case "right" :
_local2 = _local4 * SCAN_WIDTH;
if (((l_coord.x - mcRef._x) + l_speed) >= _local2) {
_local6 = _local2 - (l_coord.x - mcRef._x);
}
break;
case "down" :
_local2 = _local3 * SCAN_HEIGHT;
if (((l_coord.y - mcRef._y) + l_speed) >= _local2) {
_local6 = _local2 - (l_coord.y - mcRef._y);
}
break;
case "up" :
_local2 = _local3 * SCAN_HEIGHT;
if (((l_coord.y - mcRef._y) - l_speed) > _local2) {
break;
}
_local6 = (l_coord.y - mcRef._y) - _local2;
}
}
return(_local6);
}
function GetNextCellType(l_coord, l_dir) {
var _local5 = 0;
var _local2 = (l_coord.y - mcRef._y) / SCAN_HEIGHT;
var _local3 = (l_coord.x - mcRef._x) / SCAN_WIDTH;
if ((l_dir == "right") || (l_dir == "down")) {
_local2 = Math.ceil(_local2);
_local3 = Math.ceil(_local3);
} else if ((l_dir == "left") || (l_dir == "up")) {
_local2 = Math.floor(_local2);
_local3 = Math.floor(_local3);
}
_local5 = hitArray[_local2][_local3][0];
return(_local5);
}
function Move(l_speed, l_dir) {
var _local3 = 0;
switch (l_dir) {
case "right" :
if ((SCREEN_WIDTH - mcRef._width) > (mcRef._x - l_speed)) {
_local3 = Math.ceil((SCREEN_WIDTH - mcRef._width) - (mcRef._x - l_speed));
}
mcRef._x = mcRef._x - (l_speed - _local3);
break;
case "left" :
if ((mcRef._x + l_speed) > 0) {
_local3 = Math.ceil((mcRef._x + l_speed) - 0);
}
mcRef._x = mcRef._x + (l_speed - _local3);
break;
case "up" :
if ((mcRef._y + l_speed) > 0) {
_local3 = Math.ceil((mcRef._y + l_speed) - 0);
}
mcRef._y = mcRef._y + (l_speed - _local3);
break;
case "down" :
if ((SCREEN_HEIGHT - 1800) > (mcRef._y - l_speed)) {
_local3 = Math.ceil((SCREEN_HEIGHT - 1800) - (mcRef._y - l_speed));
}
mcRef._y = mcRef._y - (l_speed - _local3);
}
decoupe._x = mcRef._x;
decoupe._y = mcRef._y;
return(_local3);
}
var XCAR_STD_X_POS = 230;
var XCAR_STD_Y_POS = 130;
var SCREEN_WIDTH = 500;
var SCREEN_HEIGHT = 300;
var SCAN_WIDTH = 40;
var SCAN_HEIGHT = 40;
var HEAD_TOLERANCE = 4;
}
Symbol 639 MovieClip [__Packages.tr_snafuCar] Frame 0
class tr_snafuCar
{
var mcRef, indx, curSpeed, dir, dirTime, wishedDir, curAnim, isPaused;
function tr_snafuCar (l_mcRef, l_indx) {
var _local4 = _global.C.GetLvlNo();
if ((_local4 == 1) && (l_indx > 6)) {
l_indx = random(6);
} else if ((_local4 == 2) && (l_indx > 11)) {
l_indx = random(11);
} else if ((_local4 == 3) && (l_indx > 15)) {
l_indx = random(15);
}
mcRef = l_mcRef;
indx = l_indx;
mcRef._x = _global.CS.RoadHit["SnafuPos" + l_indx]._x;
mcRef._y = _global.CS.RoadHit["SnafuPos" + l_indx]._y;
curSpeed = 0;
dir = "right";
dirTime = 0;
wishedDir = null;
curAnim = "Moving";
isPaused = false;
}
function EnterFrame() {
if (!isPaused) {
if ((curAnim != "Die") && (curAnim != "Wait")) {
Drive();
Move();
}
this[curAnim]();
}
}
function PauseMe() {
isPaused = true;
mcRef.Obj.stop();
mcRef.Obj.Etat.stop();
}
function DeleteMc() {
mcRef.removeMovieClip();
}
function Die() {
if (mcRef.Obj.Etat._currentframe >= FR_DIE) {
SetAnim("Wait");
mcRef._x = _global.CS.RoadHit["SnafuPos" + indx]._x;
mcRef._y = _global.CS.RoadHit["SnafuPos" + indx]._y;
}
}
function Wait() {
if (mcRef.Obj.Etat._currentframe >= FR_WAIT) {
var _local3 = GetStageCoord();
var _local4 = _global.C.xCar.GetStageCoord();
if ((Math.abs(_local3.x - _local4.x) > SCREEN_WIDTH) && (Math.abs(_local3.y - _local4.y) > SCREEN_HEIGHT)) {
SetAnim("Moving");
}
}
}
function SetAnim(l_anim) {
if (((l_anim != null) && (l_anim != "")) && (l_anim != undefined)) {
curAnim = l_anim;
mcRef.Obj.gotoAndStop(curAnim);
}
}
function Return() {
if (mcRef.Obj.Etat._currentframe >= FR_RETURN) {
if (curSpeed > 0) {
SetAnim("Moving");
} else {
SetAnim("Idle");
}
}
}
function Dying() {
SetAnim("Die");
_global.C.AddPts("Snafu");
_global.S.PlaySound("sndSnafu", 40, 1);
}
function Drive() {
if ((curAnim != "Slip") && (curAnim != "Rebound")) {
var _local4 = _global.C.xCar.GetStageCoord();
var _local3 = GetStageCoord();
var _local6 = Math.abs(_local4.x - _local3.x);
var _local5 = Math.abs(_local4.y - _local3.y);
if (dirTime < DIR_TIMEOUT) {
if ((_local6 < SCAN_WIDTH) || (_local5 < SCAN_HEIGHT)) {
if ((_local6 < SCAN_WIDTH) && (_local5 < SEE_DIST)) {
if (_local4.y > _local3.y) {
wishedDir = "down";
} else {
wishedDir = "up";
}
} else if ((_local5 < SCAN_HEIGHT) && (_local6 < SEE_DIST)) {
if (_local4.x > _local3.x) {
wishedDir = "right";
} else {
wishedDir = "left";
}
}
if (wishedDir != dir) {
if (CheckRoadChange(wishedDir)) {
dir = wishedDir;
mcRef.gotoAndStop(dir);
SetAnim("Return");
}
}
} else {
RandomDir();
}
} else {
RandomAnyDir();
}
}
}
function RandomDir() {
switch (Math.floor(Math.random() * 4) + 1) {
case 1 :
wishedDir = "left";
break;
case 2 :
wishedDir = "right";
break;
case 3 :
wishedDir = "up";
break;
case 4 :
wishedDir = "down";
}
if (((((wishedDir == "right") && (dir == "left")) || ((wishedDir == "left") && (dir == "right"))) || ((wishedDir == "up") && (dir == "down"))) || ((wishedDir == "down") && (dir == "up"))) {
wishedDir = dir;
}
if (CheckRoadChange(wishedDir)) {
dir = wishedDir;
mcRef.gotoAndStop(dir);
SetAnim("Return");
dirTime = 0;
}
}
function RandomAnyDir() {
switch (Math.floor(Math.random() * 4) + 1) {
case 1 :
wishedDir = "left";
break;
case 2 :
wishedDir = "right";
break;
case 3 :
wishedDir = "up";
break;
case 4 :
wishedDir = "down";
}
if (CheckRoadChange(wishedDir)) {
dir = wishedDir;
mcRef.gotoAndStop(dir);
SetAnim("Return");
dirTime = 0;
}
}
function Move() {
if (((dir != null) && (CheckRoad(dir))) && (CheckOtherCar(dir))) {
switch (dir) {
case "right" :
mcRef._x = mcRef._x + curSpeed;
break;
case "left" :
mcRef._x = mcRef._x - curSpeed;
break;
case "up" :
mcRef._y = mcRef._y - curSpeed;
break;
case "down" :
mcRef._y = mcRef._y + curSpeed;
}
if (curSpeed < MAX_SPEED) {
curSpeed = curSpeed + ACCEL_SPEED;
}
} else {
dirTime++;
curSpeed = 0;
if (curAnim != "Rebound") {
SetAnim("Idle");
}
}
}
function CheckPlayerHit(l_xCar) {
var _local2 = false;
if ((curAnim != "Die") && (curAnim != "Wait")) {
_local2 = mcRef.hitTest(l_xCar);
}
return(_local2);
}
function CheckRoadChange(l_dir) {
var _local3 = new Object();
var _local6 = new Number();
var _local4 = false;
if (((((l_dir == "right") && (dir == "left")) || ((l_dir == "left") && (dir == "right"))) || ((l_dir == "up") && (dir == "down"))) || ((l_dir == "down") && (dir == "up"))) {
_local4 = true;
} else {
_local3.x = mcRef._x;
_local3.y = mcRef._y;
switch (l_dir) {
case "right" :
_local3.x = _local3.x + curSpeed;
break;
case "left" :
_local3.x = _local3.x - curSpeed;
break;
case "up" :
_local3.y = _local3.y - curSpeed;
break;
case "down" :
_local3.y = _local3.y + curSpeed;
}
mcRef._parent.localToGlobal(_local3);
_local6 = _global.C.map.GetGap(_local3, l_dir, dir, curSpeed);
if (_local6 > 0) {
curSpeed = _local6;
Move();
_local4 = true;
} else if (_local6 == 0) {
_local4 = true;
}
}
if (_local4) {
_local4 = CheckOtherCar(l_dir);
}
return(_local4);
}
function CheckOtherCar(l_dir) {
var _local8 = true;
var _local7 = GetStageCoord();
var _local6;
var _local4;
var _local3;
var _local5 = 0;
while (_local5 < _global.C.snafuArr.length) {
if (_local5 != indx) {
_local6 = _global.C.snafuArr[_local5].GetStageCoord();
switch (l_dir) {
case "right" :
_local4 = _local6.x - _local7.x;
if ((_local4 < SCAN_WIDTH) && (_local4 > 0)) {
_local3 = Math.abs(_local6.y - _local7.y);
if (_local3 < SCAN_HEIGHT) {
_local8 = false;
_local5 = _global.C.snafuArr.length;
}
}
break;
case "left" :
_local4 = _local7.x - _local6.x;
if ((_local4 < SCAN_WIDTH) && (_local4 > 0)) {
_local3 = Math.abs(_local6.y - _local7.y);
if (_local3 < SCAN_HEIGHT) {
_local8 = false;
_local5 = _global.C.snafuArr.length;
}
}
break;
case "up" :
_local3 = _local7.y - _local6.y;
if ((_local3 < SCAN_HEIGHT) && (_local3 > 0)) {
_local4 = Math.abs(_local7.x - _local6.x);
if (_local4 < SCAN_WIDTH) {
_local8 = false;
_local5 = _global.C.snafuArr.length;
}
}
break;
case "down" :
_local3 = _local6.y - _local7.y;
if (!((_local3 < SCAN_HEIGHT) && (_local3 > 0))) {
break;
}
_local4 = Math.abs(_local7.x - _local6.x);
if (_local4 >= SCAN_WIDTH) {
break;
}
_local8 = false;
_local5 = _global.C.snafuArr.length;
}
}
_local5++;
}
return(_local8);
}
function CheckRoad(l_dir) {
var _local7 = new Number();
var _local5 = new Object();
var _local6 = false;
_local5.x = mcRef._x;
_local5.y = mcRef._y;
switch (l_dir) {
case "right" :
_local5.x = _local5.x + curSpeed;
break;
case "left" :
_local5.x = _local5.x - curSpeed;
break;
case "up" :
_local5.y = _local5.y - curSpeed;
break;
case "down" :
_local5.y = _local5.y + curSpeed;
}
mcRef._parent.localToGlobal(_local5);
_local7 = _global.C.map.GetNextCellType(_local5, l_dir);
if (_local7 == 1) {
_local6 = true;
} else if (_local7 == 2) {
var _local4 = _global.C.map.GetObjCell(_local5, l_dir);
_local6 = true;
var _local3 = 0;
while (_local3 < _local4.length) {
if (_local4[_local3].GetType() == "Oil") {
SetAnim("Slip");
}
_local3++;
}
_local6 = true;
} else if (_local7 == 3) {
_local6 = false;
}
if ((!_local6) && (curAnim == "Slip")) {
SetAnim("Rebound");
}
return(_local6);
}
function Rebound() {
if (mcRef.Obj.Etat._currentframe >= FR_REBOUND) {
if (curSpeed > 0) {
curAnim = "Moving";
} else {
curAnim = "Idle";
}
mcRef.Obj.gotoAndStop(curAnim);
}
}
function Slip() {
if (mcRef.Obj.Etat._currentframe >= FR_SLIP) {
if (curSpeed > 0) {
curAnim = "Moving";
} else {
curAnim = "Idle";
}
mcRef.Obj.gotoAndStop(curAnim);
}
}
function GetStageCoord() {
var _local2 = new Object();
_local2.x = mcRef._x;
_local2.y = mcRef._y;
mcRef._parent.localToGlobal(_local2);
return(_local2);
}
var SCREEN_WIDTH = 600;
var SCREEN_HEIGHT = 300;
var SCAN_WIDTH = 40;
var SCAN_HEIGHT = 40;
var SEE_DIST = 600;
var MAX_SPEED = 6;
var ACCEL_SPEED = 1;
var DIR_TIMEOUT = 6;
var FR_DIE = 23;
var FR_WAIT = 90;
var FR_RETURN = 5;
var FR_SLIP = 40;
var FR_REBOUND = 16;
}
Symbol 640 MovieClip [__Packages.tr_Package] Frame 0
class tr_Package
{
var mcRef, objType, etat;
function tr_Package (l_mcRef) {
mcRef = l_mcRef;
objType = TYPE;
etat = "Idle";
}
function GetType() {
return(objType);
}
function CheckReaction(l_mcRef, l_speed) {
var _local3 = false;
if (l_speed <= MAX_SPEED) {
if (mcRef.hitTest(l_mcRef)) {
_global.C.RemoveAPackage();
_global.C.AddPts("Package");
_global.S.PlaySound("sndPackage", 45, 1, true);
mcRef.Obj.gotoAndStop("Disappear");
_local3 = true;
}
} else {
_global.C.RemoveAPackage();
_global.C.AddPts("Package");
_global.S.PlaySound("sndPackage", 45, 1, true);
mcRef.Obj.gotoAndStop("Disappear");
_local3 = true;
}
return(_local3);
}
function GetStageCoord() {
var _local2 = new Object();
_local2.x = mcRef._x;
_local2.y = mcRef._y;
mcRef._parent.localToGlobal(_local2);
return(_local2);
}
var TYPE = "Package";
var MAX_SPEED = 9;
}
Symbol 641 MovieClip [__Packages.tr_Wrench] Frame 0
class tr_Wrench
{
var mcRef, objType, etat;
function tr_Wrench (l_mcRef) {
mcRef = l_mcRef;
objType = TYPE;
etat = "Idle";
}
function GetType() {
return(objType);
}
function CheckReaction(l_mcRef, l_speed) {
var _local3 = false;
if (l_speed <= MAX_SPEED) {
if (mcRef.hitTest(l_mcRef)) {
_global.C.Heal();
_global.C.AddPts("Wrench");
_global.S.PlaySound("sndWrench", 250, 1);
mcRef.Obj.gotoAndStop("Disappear");
_local3 = true;
}
} else {
_global.C.Heal();
_global.C.AddPts("Wrench");
_global.S.PlaySound("sndWrench", 250, 1);
mcRef.Obj.gotoAndStop("Disappear");
_local3 = true;
}
return(_local3);
}
function GetStageCoord() {
var _local2 = new Object();
_local2.x = mcRef._x;
_local2.y = mcRef._y;
mcRef._parent.localToGlobal(_local2);
return(_local2);
}
var TYPE = "Wrench";
var MAX_SPEED = 9;
}
Symbol 642 MovieClip [__Packages.tr_SpeedWay] Frame 0
class tr_SpeedWay
{
var mcRef, dir, objType, etat;
function tr_SpeedWay (l_mcRef, l_dir) {
mcRef = l_mcRef;
dir = l_dir;
objType = TYPE;
etat = "Idle";
}
function GetDir() {
return(dir);
}
function GetType() {
return(objType);
}
function CheckReaction() {
mcRef.Obj.gotoAndStop("Disappear");
_global.S.PlaySound("sndBoost", 100, 1);
}
function GetStageCoord() {
var _local2 = new Object();
_local2.x = mcRef._x;
_local2.y = mcRef._y;
mcRef._parent.localToGlobal(_local2);
return(_local2);
}
var TYPE = "SpeedWay";
}
Symbol 643 MovieClip [__Packages.tr_PtsX] Frame 0
class tr_PtsX
{
var mcRef, objType, etat;
function tr_PtsX (l_mcRef) {
mcRef = l_mcRef;
objType = TYPE;
etat = "Idle";
}
function GetType() {
return(objType);
}
function CheckReaction() {
_global.C.AddPts("PtsX");
_global.S.PlaySound("sndPts", 100, 1);
mcRef.Obj.gotoAndStop("Disappear");
}
function GetStageCoord() {
var _local2 = new Object();
_local2.x = mcRef._x;
_local2.y = mcRef._y;
mcRef._parent.localToGlobal(_local2);
return(_local2);
}
var TYPE = "PtsX";
}
Symbol 644 MovieClip [__Packages.tr_Shield] Frame 0
class tr_Shield
{
var mcRef, objType, etat;
function tr_Shield (l_mcRef) {
mcRef = l_mcRef;
objType = TYPE;
etat = "Idle";
}
function GetType() {
return(objType);
}
function CheckReaction(l_mcRef, l_speed) {
var _local3 = false;
if (l_speed <= MAX_SPEED) {
if (mcRef.hitTest(l_mcRef)) {
_global.C.AddPts("Shield");
_global.S.PlaySound("sndShield", 80, 1);
mcRef.Obj.gotoAndStop("Disappear");
_local3 = true;
}
} else {
_global.C.AddPts("Shield");
_global.S.PlaySound("sndShield", 80, 1);
mcRef.Obj.gotoAndStop("Disappear");
_local3 = true;
}
return(_local3);
}
function GetStageCoord() {
var _local2 = new Object();
_local2.x = mcRef._x;
_local2.y = mcRef._y;
mcRef._parent.localToGlobal(_local2);
return(_local2);
}
var TYPE = "Shield";
var MAX_SPEED = 9;
}
Symbol 645 MovieClip [__Packages.tr_Oil] Frame 0
class tr_Oil
{
var mcRef, objType, etat;
function tr_Oil (l_mcRef) {
mcRef = l_mcRef;
objType = TYPE;
etat = "Idle";
}
function GetType() {
return(objType);
}
function CheckReaction() {
var _local2 = false;
_global.S.PlaySound("sndOil", 100, 1);
}
function GetStageCoord() {
var _local2 = new Object();
_local2.x = mcRef._x;
_local2.y = mcRef._y;
mcRef._parent.localToGlobal(_local2);
return(_local2);
}
var TYPE = "Oil";
}
Symbol 646 MovieClip [__Packages.tr_Barrier] Frame 0
class tr_Barrier
{
var mcRef, objType;
function tr_Barrier (l_mcRef) {
mcRef = l_mcRef;
objType = TYPE;
}
function GetType() {
return(objType);
}
function CheckReaction(l_mcRef) {
var _local2 = false;
if (l_mcRef.hitTest(mcRef)) {
_local2 = true;
}
return(_local2);
}
var TYPE = "Barrier";
}
Symbol 647 MovieClip [__Packages.tr_xCar] Frame 0
class tr_xCar
{
var mcRef, vehSelected, curSpeed, dir, curAnim, godMode, shielded, isPaused, maxSpeed;
function tr_xCar (l_mcRef) {
mcRef = l_mcRef;
mcRef._x = -1000;
mcRef._y = -1000;
vehSelected = 1;
}
function ResetCar() {
mcRef._x = STD_X_POS;
mcRef._y = STD_Y_POS;
curSpeed = 0;
dir = null;
mcRef.Veh.gotoAndStop("left");
mcRef.Veh.Shield.gotoAndStop("NV");
curAnim = "Idle";
godMode = GODMODE_TIMEOUT;
shielded = FR_SHIELDED_TIMEOUT;
isPaused = false;
switch (vehSelected) {
case 1 :
maxSpeed = MAX_SPEED_1;
break;
case 2 :
maxSpeed = MAX_SPEED_2;
break;
case 3 :
maxSpeed = MAX_SPEED_3;
}
}
function PauseMe() {
isPaused = true;
mcRef.Veh.Obj.stop();
mcRef.Veh.Obj.Etat.stop();
mcRef._x = -1000;
mcRef._y = -1000;
}
function EnterFrame() {
if (!isPaused) {
if (godMode >= GODMODE_TIMEOUT) {
CheckSnafuCollision();
} else {
godMode++;
}
if (shielded < FR_SHIELDED_TIMEOUT) {
shielded++;
if (shielded == FR_SHIELDED) {
mcRef.Veh.Shield.gotoAndStop("TimeOut");
} else if (shielded == (FR_SHIELDED_TIMEOUT - 1)) {
mcRef.Veh.Shield.gotoAndStop("NV");
}
}
Move();
this[curAnim]();
}
}
function SetAnim(l_anim) {
if (((l_anim != null) && (l_anim != "")) && (l_anim != undefined)) {
if (curAnim != "Die") {
curAnim = l_anim;
mcRef.Veh.Obj.gotoAndStop(curAnim);
}
}
}
function ChangeVeh(l_vehNo) {
vehSelected = l_vehNo;
mcRef.gotoAndStop("Veh" + vehSelected);
}
function GetSelectedVeh() {
return(vehSelected);
}
function Dying() {
curAnim = "Die";
mcRef.Veh.Obj.gotoAndStop(curAnim);
}
function Die() {
if (mcRef.Veh.Obj.Etat._currentframe >= FR_DIE) {
_global.C.GameOver();
}
}
function Return() {
if (mcRef.Veh.Obj.Etat._currentframe >= FR_RETURN) {
if (curSpeed > 0) {
SetAnim("Moving");
} else {
SetAnim("Idle");
}
}
}
function Bump() {
if (mcRef.Veh.Obj.Etat._currentframe >= FR_BUMP) {
if (curSpeed > 0) {
curAnim = "Moving";
} else {
curAnim = "Idle";
}
mcRef.Veh.Obj.gotoAndStop(curAnim);
}
}
function Rebound() {
if (mcRef.Veh.Obj.Etat._currentframe >= FR_REBOUND) {
if (curSpeed > 0) {
curAnim = "Moving";
} else {
curAnim = "Idle";
}
mcRef.Veh.Obj.gotoAndStop(curAnim);
}
}
function Slip() {
if (mcRef.Veh.Obj.Etat._currentframe >= FR_SLIP) {
if (curSpeed > 0) {
curAnim = "Moving";
} else {
curAnim = "Idle";
}
mcRef.Veh.Obj.gotoAndStop(curAnim);
}
}
function HandleKey(l_key) {
if (curAnim != "Slip") {
if (l_key != dir) {
if (dir != null) {
if (CheckRoadChange(l_key)) {
dir = l_key;
mcRef.Veh.gotoAndStop(dir);
SetAnim("Return");
}
} else {
dir = l_key;
mcRef.Veh.gotoAndStop(dir);
SetAnim("Return");
}
}
}
}
function CheckSnafuCollision() {
var _local5 = GetStageCoord();
var _local4;
var _local3 = 0;
while (_local3 < _global.C.snafuArr.length) {
_local4 = _global.C.snafuArr[_local3].GetStageCoord();
if ((Math.abs(_local5.x - _local4.x) < SCAN_WIDTH) && (Math.abs(_local5.y - _local4.y) < SCAN_HEIGHT)) {
if (curSpeed > maxSpeed) {
_global.C.snafuArr[_local3].Dying();
} else if (shielded < FR_SHIELDED_TIMEOUT) {
if (_global.C.snafuArr[_local3].CheckPlayerHit(mcRef.Veh)) {
_global.C.snafuArr[_local3].Dying();
}
} else if (_global.C.snafuArr[_local3].CheckPlayerHit(mcRef)) {
_global.S.PlaySound("sndBump", 90, 1);
SetAnim("Bump");
_global.C.GetHit("snafu");
godMode = 0;
_local3 = _global.C.snafuArr.length;
}
}
_local3++;
}
}
function CheckRoad(l_dir) {
var _local9 = new Number();
var _local6 = new Object();
var _local8 = false;
_local6.x = mcRef._x;
_local6.y = mcRef._y;
switch (l_dir) {
case "right" :
_local6.x = _local6.x + curSpeed;
break;
case "left" :
_local6.x = _local6.x - curSpeed;
break;
case "up" :
_local6.y = _local6.y - curSpeed;
break;
case "down" :
_local6.y = _local6.y + curSpeed;
}
mcRef._parent.localToGlobal(_local6);
_local9 = _global.C.map.GetNextCellType(_local6, l_dir);
if (_local9 == 1) {
_local8 = true;
} else if (_local9 == 2) {
var _local4 = _global.C.map.GetObjCell(_local6, l_dir);
_local8 = true;
var _local3 = 0;
while (_local3 < _local4.length) {
var _local5 = GetStageCoord();
_local5.x = _local5.x + (SCAN_WIDTH / 2);
_local5.y = _local5.y + (SCAN_HEIGHT / 2);
switch (_local4[_local3].GetType()) {
case "Wrench" :
if (_local4[_local3].CheckReaction(mcRef, curSpeed)) {
delete _local4[_local3];
_local4.splice(_local3, 1);
}
break;
case "Package" :
if (_local4[_local3].CheckReaction(mcRef, curSpeed)) {
delete _local4[_local3];
_local4.splice(_local3, 1);
}
break;
case "PtsX" :
_local4[_local3].CheckReaction();
delete _local4[_local3];
_local4.splice(_local3, 1);
break;
case "Oil" :
if (vehSelected != 2) {
_local4[_local3].CheckReaction();
SetAnim("Slip");
}
break;
case "Shield" :
if (_local4[_local3].CheckReaction(mcRef, curSpeed)) {
delete _local4[_local3];
_local4.splice(_local3, 1);
shielded = 0;
mcRef.Veh.Shield.gotoAndStop("Idle");
}
break;
case "SpeedWay" :
if (!((curAnim != "Boost") && (_local4[_local3].GetDir() == l_dir))) {
break;
}
_local4[_local3].CheckReaction();
curSpeed = maxSpeed * 5;
if (curAnim == "Die") {
break;
}
curAnim = "Boost";
mcRef.Veh.Obj.gotoAndStop(curAnim);
}
_local3++;
}
}
if (((!_local8) && (curAnim == "Slip")) || ((!_local8) && (curSpeed > maxSpeed))) {
SetAnim("Rebound");
if (_global.S.isPlaying("sndOil")) {
_global.S.StopSound("sndOil");
}
_global.S.PlaySound("sndBump", 90, 1);
}
return(_local8);
}
function CheckRoadChange(l_dir) {
var _local3 = new Object();
var _local4 = new Number();
var _local6 = false;
if (((((l_dir == "right") && (dir == "left")) || ((l_dir == "left") && (dir == "right"))) || ((l_dir == "up") && (dir == "down"))) || ((l_dir == "down") && (dir == "up"))) {
_local6 = true;
} else {
_local3.x = mcRef._x;
_local3.y = mcRef._y;
switch (l_dir) {
case "right" :
_local3.x = _local3.x + curSpeed;
break;
case "left" :
_local3.x = _local3.x - curSpeed;
break;
case "up" :
_local3.y = _local3.y - curSpeed;
break;
case "down" :
_local3.y = _local3.y + curSpeed;
}
mcRef._parent.localToGlobal(_local3);
_local4 = _global.C.map.GetGap(_local3, l_dir, dir, curSpeed);
if (_local4 > 0) {
curSpeed = _local4;
Move();
_local6 = true;
} else if (_local4 == 0) {
_local6 = true;
}
}
return(_local6);
}
function GetStageCoord() {
var _local2 = new Object();
_local2.x = mcRef._x;
_local2.y = mcRef._y;
mcRef._parent.localToGlobal(_local2);
return(_local2);
}
function Move() {
if ((dir != null) && (CheckRoad(dir))) {
var _local3 = new Number();
var _local4 = GetStageCoord();
switch (dir) {
case "right" :
if (_local4.x < STD_X_POS) {
_local3 = STD_X_POS - mcRef._x;
if (_local3 > curSpeed) {
mcRef._x = mcRef._x + curSpeed;
} else {
mcRef._x = mcRef._x + _local3;
_global.C.map.Move(curSpeed - _local3, dir);
}
} else {
_local3 = _global.C.map.Move(curSpeed, dir);
if (_local3 > 0) {
mcRef._x = mcRef._x + _local3;
}
}
break;
case "left" :
if (_local4.x > STD_X_POS) {
_local3 = mcRef._x - STD_X_POS;
if (_local3 > curSpeed) {
mcRef._x = mcRef._x - curSpeed;
} else {
mcRef._x = mcRef._x - _local3;
_global.C.map.Move(curSpeed - _local3, dir);
}
} else {
_local3 = _global.C.map.Move(curSpeed, dir);
if (_local3 > 0) {
mcRef._x = mcRef._x - _local3;
}
}
break;
case "up" :
if (_local4.y > STD_Y_POS) {
_local3 = mcRef._y - STD_Y_POS;
if (_local3 > curSpeed) {
mcRef._y = mcRef._y - curSpeed;
} else {
mcRef._y = mcRef._y - _local3;
_global.C.map.Move(curSpeed - _local3, dir);
}
} else {
_local3 = _global.C.map.Move(curSpeed, dir);
if (_local3 > 0) {
mcRef._y = mcRef._y - _local3;
}
}
break;
case "down" :
if (_local4.y < STD_Y_POS) {
_local3 = STD_Y_POS - mcRef._y;
if (_local3 > curSpeed) {
mcRef._y = mcRef._y + curSpeed;
} else {
mcRef._y = mcRef._y + _local3;
_global.C.map.Move(curSpeed - _local3, dir);
}
} else {
_local3 = _global.C.map.Move(curSpeed, dir);
if (_local3 <= 0) {
break;
}
mcRef._y = mcRef._y + _local3;
}
}
if (curAnim == "Die") {
curSpeed = curSpeed - FRICTION_SPEED;
if (curSpeed <= 0) {
curSpeed = 0;
}
} else if (curSpeed < maxSpeed) {
curSpeed = curSpeed + ACCEL_SPEED;
} else if (curSpeed > maxSpeed) {
curSpeed = curSpeed - FRICTION_SPEED;
if (curSpeed <= maxSpeed) {
SetAnim("Moving");
curSpeed = maxSpeed;
}
}
} else {
if ((curAnim != "Rebound") && (curAnim != "Bump")) {
SetAnim("Idle");
}
curSpeed = 0;
}
}
var SCAN_WIDTH = 40;
var SCAN_HEIGHT = 40;
var STD_X_POS = 230;
var STD_Y_POS = 130;
var MAX_SPEED_1 = 7;
var MAX_SPEED_2 = 8;
var MAX_SPEED_3 = 9;
var ACCEL_SPEED = 1;
var FRICTION_SPEED = 1;
var FRICTION_SPEED_SLOW = 0.2;
var FR_BUMP = 46;
var FR_REBOUND = 17;
var FR_RETURN = 5;
var FR_SHIELDED = 120;
var FR_SHIELDED_TIMEOUT = 184;
var GODMODE_TIMEOUT = 60;
var FR_SLIP = 40;
var FR_DIE = 23;
}
Symbol 648 MovieClip [__Packages.tr_CountDown] Frame 0
class tr_CountDown
{
var etat, elapsedTime, totalT;
function tr_CountDown () {
etat = "Idle";
}
function StartCd(l_totalTime) {
elapsedTime = l_totalTime;
totalT = l_totalTime;
etat = "Count";
_global.CS.Hud.Clock.BigOne.play();
}
function Count() {
elapsedTime--;
var _local3 = ((totalT - elapsedTime) / totalT) * FR_SMALL_ONE;
_global.CS.Hud.Clock.SmallOne.gotoAndStop(_local3);
if (elapsedTime <= 0) {
etat = "Idle";
_global.C.GameOver();
} else if (elapsedTime == 300) {
_global.CS.Hud.Clock.gotoAndStop("HurryUp");
}
}
function GetNbFR() {
return(elapsedTime);
}
function EnterFrame() {
this[etat]();
}
function StopTimer() {
etat = "Idle";
_global.CS.Hud.Clock.BigOne.stop();
_global.CS.Hud.Clock.gotoAndStop("Idle");
}
var FRAMERATE = 28;
var FR_SMALL_ONE = 1800;
}
Symbol 38 MovieClip Frame 1
play();
Symbol 38 MovieClip Frame 50
stop();
Symbol 46 MovieClip Frame 5
stop();
Symbol 62 MovieClip Frame 23
stop();
Symbol 64 MovieClip Frame 1
play();
Symbol 64 MovieClip Frame 17
stop();
Symbol 65 MovieClip Frame 1
stop();
Symbol 71 MovieClip Frame 1
stop();
Symbol 72 MovieClip Frame 1
stop();
Symbol 80 MovieClip Frame 50
stop();
Symbol 86 MovieClip Frame 5
stop();
Symbol 87 MovieClip Frame 23
stop();
Symbol 88 MovieClip Frame 17
stop();
Symbol 89 MovieClip Frame 1
stop();
Symbol 90 MovieClip Frame 1
stop();
Symbol 103 MovieClip Frame 50
stop();
Symbol 108 MovieClip Frame 5
stop();
Symbol 109 MovieClip Frame 23
stop();
Symbol 110 MovieClip Frame 17
stop();
Symbol 111 MovieClip Frame 1
stop();
Symbol 112 MovieClip Frame 1
stop();
Symbol 113 MovieClip [veh] Frame 1
stop();
Symbol 117 MovieClip Frame 16
stop();
Symbol 123 MovieClip Frame 5
stop();
Symbol 124 MovieClip Frame 23
stop();
Symbol 126 MovieClip Frame 1
stop();
Symbol 127 MovieClip [snafu] Frame 1
stop();
Symbol 141 MovieClip Frame 1
stop();
Symbol 159 MovieClip Frame 1
stop();
Symbol 165 Button
on (release) {
_global.C.gamePause = !_global.C.gamePause;
_global.CS.HelpInGame.swapDepths(8000000 + random(100000));
_global.CS.HelpInGame.gotoAndStop("HTP1");
}
Symbol 179 MovieClip Frame 1
stop();
Symbol 180 MovieClip Frame 1
_global.S.PlaySound("sndBip", 80, 1);
Symbol 181 MovieClip Frame 1
stop();
Instance of Symbol 159 MovieClip in Symbol 182 MovieClip Frame 1
on (release, releaseOutside) {
if (this._currentframe == 1) {
_global.S.DoMute();
this.nextFrame();
} else {
_global.S.UndoMute();
this.prevFrame();
}
}
Symbol 205 MovieClip Frame 1
stop();
Symbol 220 Button
on (keyPress "<Left>") {
return(undefined);
}
on (keyPress "<Right>") {
return(undefined);
}
on (keyPress "<Up>") {
return(undefined);
}
on (keyPress "<Down>") {
return(undefined);
}
on (keyPress "<Space>") {
return(undefined);
}
Symbol 252 MovieClip Frame 11
stop();
Symbol 253 MovieClip Frame 1
stop();
Instance of Symbol 253 MovieClip "Obj" in Symbol 254 MovieClip Frame 1
onClipEvent (load) {
_global.C.map.CreatePackage(_parent);
}
Symbol 263 MovieClip Frame 10
stop();
Symbol 264 MovieClip Frame 1
stop();
Instance of Symbol 264 MovieClip "Obj" in Symbol 265 MovieClip Frame 1
onClipEvent (load) {
_global.C.map.CreateWrench(_parent);
}
Symbol 272 MovieClip Frame 11
stop();
Symbol 273 MovieClip Frame 1
stop();
Instance of Symbol 273 MovieClip "Obj" in Symbol 274 MovieClip Frame 1
onClipEvent (load) {
_global.C.map.CreatePtsX(_parent);
}
Symbol 280 MovieClip Frame 1
stop();
Symbol 283 MovieClip Frame 11
_parent.gotoAndStop("Idle");
Symbol 284 MovieClip Frame 1
stop();
Instance of Symbol 284 MovieClip "Obj" in Symbol 285 MovieClip Frame 1
onClipEvent (load) {
_global.C.map.CreateSpeedWay(_parent, "left");
}
Instance of Symbol 284 MovieClip "Obj" in Symbol 286 MovieClip Frame 1
onClipEvent (load) {
_global.C.map.CreateSpeedWay(_parent, "right");
}
Symbol 296 MovieClip Frame 11
stop();
Symbol 297 MovieClip Frame 1
stop();
Instance of Symbol 297 MovieClip "Obj" in Symbol 298 MovieClip Frame 1
onClipEvent (load) {
_global.C.map.CreateShield(_parent);
}
Symbol 302 MovieClip Frame 16
stop();
Symbol 303 MovieClip Frame 1
stop();
Instance of Symbol 303 MovieClip "Obj" in Symbol 304 MovieClip Frame 1
onClipEvent (load) {
_global.C.map.CreateOil(_parent);
}
Instance of Symbol 311 MovieClip in Symbol 312 MovieClip Frame 1
onClipEvent (load) {
_global.C.map.CreateBarrier(_parent);
}
Instance of Symbol 284 MovieClip "Obj" in Symbol 313 MovieClip Frame 1
onClipEvent (load) {
_global.C.map.CreateSpeedWay(_parent, "down");
}
Instance of Symbol 284 MovieClip "Obj" in Symbol 314 MovieClip Frame 1
onClipEvent (load) {
_global.C.map.CreateSpeedWay(_parent, "up");
}
Symbol 315 MovieClip Frame 1
stop();
Symbol 317 MovieClip Frame 2
stop();
Instance of Symbol 320 MovieClip in Symbol 321 MovieClip Frame 1
onClipEvent (load) {
this.swapDepths(20001);
}
Instance of Symbol 320 MovieClip in Symbol 321 MovieClip Frame 1
onClipEvent (load) {
this.swapDepths(20000);
}
Symbol 331 Button
on (release, releaseOutside) {
_global.S.PlaySound("sndBtn", 50, 1);
_parent.gotoAndStop("HTP1");
}
Symbol 338 Button
on (release, releaseOutside) {
trace("Report on Play button pressed");
flash.external.ExternalInterface.call("trackKidsGamePlay", "xs_recipe");
_global.S.PlaySound("sndBtn", 50, 1);
_global.C.SetLvlNo(0);
_parent.gotoAndStop("SelectVeh");
}
Symbol 351 Button
on (release, releaseOutside) {
trace("Report on Play button pressed");
flash.external.ExternalInterface.call("trackKidsGamePlay", "xs_recipe");
_global.S.PlaySound("sndBtn", 50, 1);
_parent.gotoAndStop("SelectVeh");
}
Symbol 355 Button
on (release, releaseOutside) {
_global.S.PlaySound("sndBtn", 50, 1);
_parent.gotoAndStop("HTP4");
}
Symbol 371 Button
on (release, releaseOutside) {
_global.S.PlaySound("sndBtn", 50, 1);
_parent.gotoAndStop("HTP1");
}
Symbol 372 Button
on (release, releaseOutside) {
trace("Report on Help Play button pressed");
flash.external.ExternalInterface.call("trackKidsGamePlay", "xs_recipe");
_global.S.PlaySound("sndBtn", 50, 1);
_parent.gotoAndStop("SelectVeh");
}
Symbol 373 Button
on (release, releaseOutside) {
_global.S.PlaySound("sndBtn", 50, 1);
_parent.gotoAndStop("HTP2");
}
Symbol 401 Button
on (release, releaseOutside) {
trace("Report on Help Play button pressed");
flash.external.ExternalInterface.call("trackKidsGamePlay", "xs_recipe");
_global.S.PlaySound("sndBtn", 50, 1);
_parent.gotoAndStop("SelectVeh");
}
Symbol 402 Button
on (release, releaseOutside) {
_global.S.PlaySound("sndBtn", 50, 1);
_parent.gotoAndStop("HTP3");
}
Symbol 403 Button
on (release, releaseOutside) {
_global.S.PlaySound("sndBtn", 50, 1);
_parent.gotoAndStop("HTP4");
}
Symbol 440 Button
on (release, releaseOutside) {
_global.S.PlaySound("sndBtn", 50, 1);
_parent.gotoAndStop("HTP2");
}
Symbol 451 MovieClip Frame 1
stop();
Symbol 454 MovieClip Frame 1
stop();
Symbol 457 MovieClip Frame 1
stop();
Symbol 465 Button
on (release, releaseOutside) {
_global.C.xCar.ChangeVeh(_parent.VehSelected);
_global.CS.Transit.gotoAndPlay(2);
_global.S.PlaySound("sndBtn", 50, 1);
this.gotoAndStop(1);
}
Symbol 466 MovieClip Frame 1
stop();
Symbol 467 MovieClip Frame 1
var VehSelected = null;
Instance of Symbol 451 MovieClip "Veh1" in Symbol 467 MovieClip Frame 1
on (release, releaseOutside) {
gotoAndStop (2);
_parent.VehSelected = 1;
_parent.Smoke1.gotoAndStop(2);
_parent.Smoke2.gotoAndStop(1);
_parent.Smoke3.gotoAndStop(1);
_parent.Veh2.gotoAndStop(1);
_parent.Veh3.gotoAndStop(1);
_parent.SelectBtn.gotoAndStop(2);
_global.S.PlaySound("sndAutoSelect", 50, 1, true);
}
Instance of Symbol 454 MovieClip "Veh2" in Symbol 467 MovieClip Frame 1
on (release, releaseOutside) {
gotoAndStop (2);
_parent.VehSelected = 2;
_parent.Smoke1.gotoAndStop(1);
_parent.Smoke2.gotoAndStop(2);
_parent.Smoke3.gotoAndStop(1);
_parent.Veh1.gotoAndStop(1);
_parent.Veh3.gotoAndStop(1);
_parent.SelectBtn.gotoAndStop(2);
_global.S.PlaySound("sndAvionSelect", 50, 1, true);
}
Instance of Symbol 457 MovieClip "Veh3" in Symbol 467 MovieClip Frame 1
on (release, releaseOutside) {
gotoAndStop (2);
_parent.VehSelected = 3;
_parent.Smoke1.gotoAndStop(1);
_parent.Smoke2.gotoAndStop(1);
_parent.Smoke3.gotoAndStop(2);
_parent.Veh1.gotoAndStop(1);
_parent.Veh2.gotoAndStop(1);
_parent.SelectBtn.gotoAndStop(2);
_global.S.PlaySound("sndMotoSelect", 50, 1, true);
}
Symbol 479 MovieClip Frame 1
if (_global.C.GetLvlNo() < 4) {
Level_txt.text = "Level " + (_global.C.GetLvlNo() + 1);
} else if (_global.C.GetLvlNo() == 4) {
Level_txt.text = "Last Level!";
} else {
Level_txt.text = "";
}
Symbol 482 MovieClip Frame 1
stop();
Symbol 482 MovieClip Frame 2
BtnCurseur.useHandCursor = false;
play();
_global.S.PlaySound("sndTransit", 80, 1);
Symbol 482 MovieClip Frame 19
_global.S.PlaySound("sndSelectVeh", 80, 1);
Symbol 482 MovieClip Frame 41
_global.S.PlaySound("sndTransit", 80, 1);
Symbol 482 MovieClip Frame 54
if ((_global.C.GetLvlNo() < 5) || (_global.C.GetLvlNo() > 10)) {
_global.C.NextLvl();
} else {
_global.CS.Map.Lvl.gotoAndStop(1);
_global.CS.gotoAndStop("Win");
}
Symbol 482 MovieClip Frame 59
stop();
Symbol 555 Button
on (release) {
_global.CS.gotoAndStop("HighScore");
}
Symbol 561 Button
on (release, releaseOutside) {
_global.CS.gotoAndStop("TC");
}
Symbol 562 MovieClip Frame 1
_global.HS.initHiScores();
if (_global.HS.G_ShowHighScore == false) {
btn_submit_score._visible = false;
btn_view_score._visible = false;
}
Symbol 569 Button
on (release, releaseOutside) {
_global.CS.gotoAndPlay("TC");
}
Symbol 570 MovieClip Frame 1
_global.HS.initHiScores();
if (_global.HS.G_ShowHighScore == false) {
btn_submit_score._visible = false;
btn_view_score._visible = false;
}
Symbol 585 Button
on (press) {
ControlScroll.scrollUp = true;
}
on (release, releaseOutside) {
ControlScroll.scrollUp = false;
}
Symbol 586 Button
on (press) {
ControlScroll.scrollDown = true;
}
on (release, releaseOutside) {
ControlScroll.scrollDown = false;
}
Symbol 592 Button
on (release) {
_global.HS.submitScore(_global.C.GetScore());
btn_submit_score._visible = false;
}
Symbol 593 Button
on (release, releaseOutside) {
_global.CS.gotoAndPlay("TC");
}
Symbol 599 MovieClip Frame 1
if (gProxyObj.getIsLoggedIn()) {
btn_submit_score._visible = true;
} else {
btn_submit_score._visible = false;
}
_global.HS.getScores();
txtScore.text = _global.C.GetScore();
Instance of Symbol 597 MovieClip "ControlScroll" in Symbol 599 MovieClip Frame 1
onClipEvent (load) {
scrollUp = false;
scrollDown = false;
}
onClipEvent (enterFrame) {
if (scrollUp == true) {
_parent.txt_highScore.scroll--;
} else if (scrollDown == true) {
_parent.txt_highScore.scroll++;
}
}
Symbol 608 Button
on (release, releaseOutside) {
if (_global.C.GetLvlNo() > 10) {
_global.C.SetLvlNo(_global.C.GetLvlNo() - 10);
}
trace(_global.C.GetLvlNo());
_parent.play();
this.enabled = false;
}
Symbol 609 MovieClip Frame 1
Score_txt.text = _global.C.GetScore();
Shadow_txt.text = Score_txt.text;
Symbol 617 Button
on (release, releaseOutside) {
if (_global.C.GetLvlNo() < 10) {
trace("KLJ");
_global.C.SetLvlNo(_global.C.GetLvlNo() + 10);
trace("KLH " + _global.C.GetLvlNo());
}
_parent.play();
}
Symbol 619 MovieClip Frame 1
play();
Symbol 619 MovieClip Frame 21
stop();
Instance of Symbol 611 MovieClip in Symbol 619 MovieClip Frame 21
onClipEvent (load) {
if (_global.C.nbPtsXCollect == (_global.C.nbPtsX - 1)) {
if (_global.C.GetLvlNo() < 10) {
_parent.Egg._visible = true;
_global.S.PlaySound("sndEgg", 50, 1);
}
} else {
_parent.Egg._visible = false;
}
}
Symbol 619 MovieClip Frame 22
play();
Symbol 619 MovieClip Frame 28
_global.CS.Transit.gotoAndPlay(2);
_parent.gotoAndStop("Idle");
Symbol 620 MovieClip Frame 1
stop();
Symbol 625 Button
on (release, releaseOutside) {
_global.S.PlaySound("sndBtn", 50, 1);
_global.C.gamePause = false;
_parent.gotoAndStop("NV");
}
Symbol 626 Button
on (release, releaseOutside) {
_global.S.PlaySound("sndBtn", 50, 1);
_parent.nextFrame();
}
Symbol 628 Button
on (release, releaseOutside) {
_global.S.PlaySound("sndBtn", 50, 1);
_parent.prevFrame();
}
Symbol 632 Button
on (release, releaseOutside) {
_global.S.PlaySound("sndBtn", 50, 1);
_parent.prevFrame();
}
Symbol 633 Button
on (release, releaseOutside) {
_global.S.PlaySound("sndBtn", 50, 1);
_parent.nextFrame();
}
Symbol 636 MovieClip Frame 2
stop();
Symbol 636 MovieClip Frame 3
btnBack.useHandCursor = false;