Frame 5
StringTable = function (xmlFile) {
this.table = new Array();
this.loadData(xmlFile);
};
StringTable.prototype.loadData = function (source) {
var _local3 = this;
_local3.xmlFile = new XML();
_local3.xmlFile.load(source);
_local3.xmlFile.ignoreWhite = true;
_local3.xmlFile.notify = _local3;
_local3.xmlFile.onLoad = function () {
var stringID = "";
var _local3 = "";
var _local2 = this.firstChild.childNodes;
var _local1 = 0;
while (_local1 < _local2.length) {
if (!(_local2[_local1].nodeName === "string")) {
} else {
stringID = _local2[_local1].attributes.id;
_local3 = _local2[_local1].firstChild.nodeValue;
this.notify.table[stringID] = _local3;
}
_local1++;
}
this.notify.loaded = true;
if (this.notify.onLoad != null) {
this.notify.onLoad();
}
delete this;
};
};
StringTable.prototype.get = function (stringID) {
return(this.table[stringID]);
};
StringTable.prototype.getBytesLoaded = function () {
return(this.xmlFile.getBytesLoaded());
};
StringTable.prototype.getBytesTotal = function () {
return(this.xmlFile.getBytesTotal());
};
StringTable.prototype.getPercentLoaded = function () {
var _local1 = this;
if (_local1.xmlFile.getBytesTotal() <= 0) {
return(0);
}
var _local2 = Math.round((_local1.xmlFile.getBytesTotal() / _local1.xmlFile.getBytesTotal()) * 100);
return(_local2);
};
StringTable.prototype.dump = function () {
var _local1 = this;
trace("===============================");
trace(" ");
trace("Dumping the String Table:");
trace(" ");
trace("String ID Value");
trace("--------- -----");
for (var _local2 in _local1.table) {
trace((_local2 + " ") + _local1.table[_local2]);
}
trace(" ");
trace("String Table dump done.");
trace("===============================");
trace(" ");
};
fscommand ("trapallkeys", "true");
fscommand ("allowscale", "false");
gStrTable = new StringTable("CRStrings.xml");
stop();
onEnterFrame = function () {
var _local1 = gStrTable.getBytesLoaded() / gStrTable.getBytesTotal();
var _local2 = Math.round(_local1 * 100);
BarInst._xscale = _local2;
if (gStrTable.loaded) {
_root.play();
}
};
Frame 13
function cSFXEngine() {
var _local1 = this;
_local1.samp = new Array();
_local1.restoreVol = new Array();
_local1.loop = new Array();
_local1.name = new Array();
_local1.state = new Array();
_local1.idx = 0;
_local1.ctrl = new Sound();
_local1.proc = SE_IDLE;
_local1.vol = 75;
_local1.ctrl.setVolume(_local1.vol);
_local1.managerMuted = false;
}
function cStageShake() {
this.state = false;
}
SE_IDLE = 0;
SE_FADEDOWN = 1;
cSFXEngine.prototype.Destroy = function () {
var _local1 = this;
delete _local1.samp;
delete _local1.restoreVol;
delete _local1.loop;
delete _local1.name;
delete _local1.state;
delete _local1.ctrl;
};
cSFXEngine.prototype.SetVol = function (idx, vol) {
if (this.managerMuted) {
return(undefined);
}
this.samp[idx].setVolume(vol);
};
cSFXEngine.prototype.SetVolAll = function (vol) {
var _local2 = this;
var _local3 = vol;
var _local1 = 0;
while (_local1 < _local2.samp.length) {
_local2.SetVol(_local1, _local3);
_local1++;
}
};
cSFXEngine.prototype.GetVol = function (idx) {
return(this.samp[idx].getVolume());
};
cSFXEngine.prototype.SetPan = function (idx, pan) {
this.samp[idx].setPan(pan);
};
cSFXEngine.prototype.GetPan = function (idx) {
return(this.samp[idx].getPan());
};
cSFXEngine.prototype.SetMasterVol = function (vol) {
var _local1 = this;
_local1.vol = vol;
_local1.ctrl.setVolume(_local1.vol);
};
cSFXEngine.prototype.MuteMasterVol = function () {
this.proc = SE_FADEDOWN;
};
cSFXEngine.prototype.RestoreMasterVol = function () {
this.ctrl.setVolume(this.vol);
};
cSFXEngine.prototype.StopAll = function () {
var _local2 = this;
var _local1 = 0;
while (_local1 < _local2.state.length) {
_local2.samp[_local1].stop();
_local2.state[_local1] = false;
_local1++;
}
};
cSFXEngine.prototype.MuteAll = function () {
var _local2 = this;
var _local1 = 0;
while (_local1 < _local2.samp.length) {
_local2.Mute(_local1);
_local1++;
}
_local2.managerMuted = true;
};
cSFXEngine.prototype.RestoreAll = function () {
var _local2 = this;
_local2.managerMuted = false;
var _local1 = 0;
while (_local1 < _local2.samp.length) {
_local2.Restore(_local1);
_local1++;
}
};
cSFXEngine.prototype.Add = function (name, clip) {
var _local1 = this;
var _local2 = name;
var _local3 = clip;
if (_local3 == null) {
_local3 = _root.createEmptyMovieClip(_local2, _local1.idx);
}
_local1.samp[_local1.idx] = new Sound(_local3);
_local1.samp[_local1.idx].attachSound(_local2);
_local1.restoreVol[_local1.idx] = 100;
_local1.name[_local1.idx] = _local2;
_local1.state[_local1.idx] = false;
return(_local1.idx++);
};
cSFXEngine.prototype.Play = function (idx, loopnum) {
this.samp[idx].start(0, loopnum);
this.state[idx] = true;
};
cSFXEngine.prototype.Stop = function (idx) {
var _local1 = idx;
var _local2 = this;
_local2.samp[_local1].stop(_local2.name[_local1]);
_local2.state[_local1] = false;
};
cSFXEngine.prototype.Mute = function (idx) {
var _local1 = this;
var _local2 = idx;
if (_local1.managerMuted || (_local1.GetVol(_local2) <= 0)) {
} else {
_local1.restoreVol[_local2] = _local1.GetVol(_local2);
_local1.SetVol(_local2, 0);
}
};
cSFXEngine.prototype.Restore = function (idx) {
var _local1 = this;
var _local2 = idx;
if (_local1.managerMuted || (_local1.GetVol(_local2) > 0)) {
} else {
_local1.SetVol(_local2, _local1.restoreVol[_local2]);
}
};
cSFXEngine.prototype.IsPlaying = function (idx) {
return(this.state[idx]);
};
Sfx.Destroy();
Sfx = new cSFXEngine();
Sfx.SetMasterVol(100);
SFXID_Grind1 = Sfx.Add("MainGrind1.wav", SoundObjDriver1Inst);
SFXID_Grind2 = Sfx.Add("MainGrind4.wav", SoundObjDriver2Inst);
SFXID_Bump = Sfx.Add("Bump.wav", this);
SFXID_Driver = Sfx.Add("Driver2.wav", this);
SFXID_Beep1 = Sfx.Add("Beep01.wav", this);
SFXID_Beep2 = Sfx.Add("Beep02.wav", this);
SFXID_Pip1 = Sfx.Add("Pip1.wav", this);
SFXID_Pip2 = Sfx.Add("Pip2.wav", this);
SFXID_Brush = Sfx.Add("Brush.wav", this);
SFXID_Loop1 = Sfx.Add("loop1.wav", this);
SFXOBJ_Screech = createEmptyMovieClip("sre", 9999);
SFX_Screech = new Sound(SFXOBJ_Screech);
SFX_Screech.attachSound("screech.wav");
SFX_Screech.setVolume(50);
SFXOBJ_Reverse = createEmptyMovieClip("rev", 9998);
SFX_Reverse = new Sound(SFXOBJ_Reverse);
SFX_Reverse.attachSound("reverse.wav");
SFXOBJ_Horn = createEmptyMovieClip("hor", 9997);
SFX_Horn1 = new Sound(SFXOBJ_Horn);
SFX_Horn1.attachSound("horn01.wav");
SFX_Horn2 = new Sound(SFXOBJ_Horn);
SFX_Horn2.attachSound("horn02.wav");
SFX_Horn3 = new Sound(SFXOBJ_Horn);
SFX_Horn3.attachSound("horn03.wav");
SFX_Horn3.setVolume(15);
cStageShake.prototype.Impulse = function () {
var _local1 = this;
_local1.dy = 0;
_local1.f = 1;
_local1.state = true;
};
cStageShake.prototype.Update = function () {
var _local1 = this;
if (!_local1.state) {
_y = 0;
} else {
_local1.dy = -5 + (Math.random() * 10);
_y = (_local1.dy * _local1.f);
_local1.f = _local1.f - 0.2;
if (_local1.f <= 0) {
_local1.state = false;
}
}
};
StageShake = new cStageShake();
onEnterFrame = function () {
StageShake.Update();
};
Frame 63
function cModeSelectionArrows() {
this.SetSelection(SELECT_INSTRUCTIONS);
}
function cKeyHandler() {
this.noKey = true;
Key.addListener(this);
}
function TransitionFlakes() {
var _local1 = 0;
while (_local1 < 24) {
FlakeParticleMakerInst.FlakeBurst(Math.random() * 700, Math.random() * 480);
_local1++;
}
}
stop();
QuitDialogInst._visible = false;
gQuitDialog = QuitDialogInst.duplicateMovieClip("quit", 10000);
gQuitDialog._visible = false;
gNumPlayers = -1;
SELECT_1PLAYER = 0;
SELECT_2PLAYER = 1;
SELECT_INSTRUCTIONS = 2;
cModeSelectionArrows.prototype.SetSelection = function (sel) {
var _local1 = this;
_local1.mSel = sel;
switch (sel) {
case SELECT_1PLAYER :
_local1.ySel = Select1PlayerInst._y;
return;
case SELECT_2PLAYER :
_local1.ySel = Select2PlayerInst._y;
return;
case SELECT_INSTRUCTIONS :
_local1.ySel = SelectInstructionsInst._y;
}
};
cModeSelectionArrows.prototype.SelectNext = function () {
var _local1 = this;
_local1.mSel++;
if (_local1.mSel > SELECT_INSTRUCTIONS) {
_local1.mSel = SELECT_1PLAYER;
}
_local1.SetSelection(_local1.mSel);
};
cModeSelectionArrows.prototype.SelectPrev = function () {
var _local1 = this;
_local1.mSel--;
if (_local1.mSel < SELECT_1PLAYER) {
_local1.mSel = SELECT_INSTRUCTIONS;
}
_local1.SetSelection(_local1.mSel);
};
cModeSelectionArrows.prototype.SelectCurrent = function () {
switch (this.mSel) {
case SELECT_1PLAYER :
gNumPlayers = 1;
LogoInst.gotoAndPlay("Out");
return;
case SELECT_2PLAYER :
gNumPlayers = 2;
LogoInst.gotoAndPlay("Out");
return;
case SELECT_INSTRUCTIONS :
TransitionFlakes();
gotoAndPlay ("Instructions");
}
};
cModeSelectionArrows.prototype.Update = function () {
ArrowLeftInst._y = (ArrowRightInst._y = ArrowRightInst._y + ((this.ySel - ArrowLeftInst._y) * 0.5));
};
cKeyHandler.prototype.Update = function () {
if ((((((!Key.isDown(40)) && (!Key.isDown(38))) && (!Key.isDown(37))) && (!Key.isDown(39))) && (!Key.isDown(32))) && (!Key.isDown(13))) {
this.noKey = true;
}
};
cKeyHandler.prototype.onKeyDown = function () {
var _local1 = this;
if (!_local1.noKey) {
} else if (Key.isDown(40) || (Key.isDown(39))) {
ModeSelectionArrows.SelectNext();
_local1.noKey = false;
} else if (Key.isDown(38) || (Key.isDown(37))) {
ModeSelectionArrows.SelectPrev();
_local1.noKey = false;
} else if (Key.isDown(32) || (Key.isDown(13))) {
ModeSelectionArrows.SelectCurrent();
_local1.noKey = false;
}
};
Select1PlayerInst.onRollOver = function () {
ModeSelectionArrows.SetSelection(SELECT_1PLAYER);
};
Select1PlayerInst.onRelease = function () {
gNumPlayers = 1;
LogoInst.gotoAndPlay("Out");
Sfx.Play(SFXID_Beep1, 1);
};
Select2PlayerInst.onRollOver = function () {
ModeSelectionArrows.SetSelection(SELECT_2PLAYER);
};
Select2PlayerInst.onRelease = function () {
gNumPlayers = 2;
LogoInst.gotoAndPlay("Out");
Sfx.Play(SFXID_Beep1, 1);
};
SelectInstructionsInst.onRollOver = function () {
ModeSelectionArrows.SetSelection(SELECT_INSTRUCTIONS);
};
SelectInstructionsInst.onRelease = function () {
gNumPlayers = 2;
TransitionFlakes();
gotoAndPlay ("Instructions");
Sfx.Play(SFXID_Beep1, 1);
};
onMouseMove = function () {
if (Math.random() > 0.95) {
FlakeParticleMakerInst.FlakeBurst(_xmouse, _ymouse);
}
};
KeyHandler = new cKeyHandler();
StageShake = new cStageShake();
ModeSelectionArrows = new cModeSelectionArrows();
onEnterFrame = function () {
StageShake.Update();
ModeSelectionArrows.Update();
KeyHandler.Update();
};
Frame 85
stop();
MCLogo.enabled = false;
DialogInstructionInst.ButtonCloseInst.onRelease = function () {
TransitionFlakes();
gotoAndPlay ("Mode Select");
Sfx.Play(SFXID_Beep1, 1);
MCLogo.enabled = true;
};
Frame 100
function Pause(state) {
var _local1 = state;
PlayerLeftInst.enabled = !_local1;
PlayerRightInst.enabled = !_local1;
Team1Inst.enabled = !_local1;
Team2Inst.enabled = !_local1;
Team3Inst.enabled = !_local1;
}
function Back() {
gotoAndPlay ("Intro");
}
function SetHeadIcon(PlayerNum, TeamCol) {
switch (PlayerNum) {
case 0 :
switch (TeamCol) {
case SKIN_RED :
HUDInst.Head1_1Inst._visible = true;
HUDInst.Head1_1Inst._x = HUDInst.Marker1_1Inst._x;
HUDInst.Head1_1Inst._y = HUDInst.Marker1_1Inst._y;
HUDInst.Head1_2Inst._visible = true;
HUDInst.Head1_2Inst._x = HUDInst.Marker1_2Inst._x;
HUDInst.Head1_2Inst._y = HUDInst.Marker1_2Inst._y;
gHeadIcon1_1Inst = HUDInst.Head1_1Inst;
gHeadIcon1_2Inst = HUDInst.Head1_2Inst;
HUDInst.TeamBackRed1Inst._visible = true;
HUDInst.TeamBackRed1Inst._x = HUDInst.Team1_1BackInst._x;
HUDInst.TeamBackRed1Inst._y = HUDInst.Team1_1BackInst._y;
HUDInst.TeamBackRed2Inst._visible = true;
HUDInst.TeamBackRed2Inst._x = HUDInst.Team1_2BackInst._x;
HUDInst.TeamBackRed2Inst._y = HUDInst.Team1_2BackInst._y;
break;
case SKIN_BLUE :
HUDInst.Head2_1Inst._visible = true;
HUDInst.Head2_1Inst._x = HUDInst.Marker1_1Inst._x;
HUDInst.Head2_1Inst._y = HUDInst.Marker1_1Inst._y;
HUDInst.Head2_2Inst._visible = true;
HUDInst.Head2_2Inst._x = HUDInst.Marker1_2Inst._x;
HUDInst.Head2_2Inst._y = HUDInst.Marker1_2Inst._y;
gHeadIcon1_1Inst = HUDInst.Head2_1Inst;
gHeadIcon1_2Inst = HUDInst.Head2_2Inst;
HUDInst.TeamBackBlue1Inst._visible = true;
HUDInst.TeamBackBlue1Inst._x = HUDInst.Team1_1BackInst._x;
HUDInst.TeamBackBlue1Inst._y = HUDInst.Team1_1BackInst._y;
HUDInst.TeamBackBlue2Inst._visible = true;
HUDInst.TeamBackBlue2Inst._x = HUDInst.Team1_2BackInst._x;
HUDInst.TeamBackBlue2Inst._y = HUDInst.Team1_2BackInst._y;
break;
case SKIN_YELLOW :
HUDInst.Head3_1Inst._visible = true;
HUDInst.Head3_1Inst._x = HUDInst.Marker1_1Inst._x;
HUDInst.Head3_1Inst._y = HUDInst.Marker1_1Inst._y;
HUDInst.Head3_2Inst._visible = true;
HUDInst.Head3_2Inst._x = HUDInst.Marker1_2Inst._x;
HUDInst.Head3_2Inst._y = HUDInst.Marker1_2Inst._y;
gHeadIcon1_1Inst = HUDInst.Head3_1Inst;
gHeadIcon1_2Inst = HUDInst.Head3_2Inst;
HUDInst.TeamBackYellow1Inst._visible = true;
HUDInst.TeamBackYellow1Inst._x = HUDInst.Team1_1BackInst._x;
HUDInst.TeamBackYellow1Inst._y = HUDInst.Team1_1BackInst._y;
HUDInst.TeamBackYellow2Inst._visible = true;
HUDInst.TeamBackYellow2Inst._x = HUDInst.Team1_2BackInst._x;
HUDInst.TeamBackYellow2Inst._y = HUDInst.Team1_2BackInst._y;
}
return;
case 1 :
switch (TeamCol) {
case SKIN_RED :
HUDInst.TeamBackRed1Inst._visible = true;
HUDInst.TeamBackRed1Inst._x = HUDInst.Team2_1BackInst._x;
HUDInst.TeamBackRed1Inst._y = HUDInst.Team2_1BackInst._y;
HUDInst.TeamBackRed2Inst._visible = true;
HUDInst.TeamBackRed2Inst._x = HUDInst.Team2_2BackInst._x;
HUDInst.TeamBackRed2Inst._y = HUDInst.Team2_2BackInst._y;
HUDInst.Head1_1Inst._visible = true;
HUDInst.Head1_1Inst._x = HUDInst.Marker2_1Inst._x;
HUDInst.Head1_1Inst._y = HUDInst.Marker2_1Inst._y;
HUDInst.Head1_2Inst._visible = true;
HUDInst.Head1_2Inst._x = HUDInst.Marker2_2Inst._x;
HUDInst.Head1_2Inst._y = HUDInst.Marker2_2Inst._y;
gHeadIcon2_1Inst = HUDInst.Head1_1Inst;
gHeadIcon2_2Inst = HUDInst.Head1_2Inst;
return;
case SKIN_BLUE :
HUDInst.Head2_1Inst._visible = true;
HUDInst.Head2_1Inst._x = HUDInst.Marker2_1Inst._x;
HUDInst.Head2_1Inst._y = HUDInst.Marker2_1Inst._y;
HUDInst.Head2_2Inst._visible = true;
HUDInst.Head2_2Inst._x = HUDInst.Marker2_2Inst._x;
HUDInst.Head2_2Inst._y = HUDInst.Marker2_2Inst._y;
gHeadIcon2_1Inst = HUDInst.Head2_1Inst;
gHeadIcon2_2Inst = HUDInst.Head2_2Inst;
HUDInst.TeamBackBlue1Inst._visible = true;
HUDInst.TeamBackBlue1Inst._x = HUDInst.Team2_1BackInst._x;
HUDInst.TeamBackBlue1Inst._y = HUDInst.Team2_1BackInst._y;
HUDInst.TeamBackBlue2Inst._visible = true;
HUDInst.TeamBackBlue2Inst._x = HUDInst.Team2_2BackInst._x;
HUDInst.TeamBackBlue2Inst._y = HUDInst.Team2_2BackInst._y;
return;
case SKIN_YELLOW :
HUDInst.Head3_1Inst._visible = true;
HUDInst.Head3_1Inst._x = HUDInst.Marker2_1Inst._x;
HUDInst.Head3_1Inst._y = HUDInst.Marker2_1Inst._y;
HUDInst.Head3_2Inst._visible = true;
HUDInst.Head3_2Inst._x = HUDInst.Marker2_2Inst._x;
HUDInst.Head3_2Inst._y = HUDInst.Marker2_2Inst._y;
gHeadIcon2_1Inst = HUDInst.Head3_1Inst;
gHeadIcon2_2Inst = HUDInst.Head3_2Inst;
HUDInst.TeamBackYellow1Inst._visible = true;
HUDInst.TeamBackYellow1Inst._x = HUDInst.Team2_1BackInst._x;
HUDInst.TeamBackYellow1Inst._y = HUDInst.Team2_1BackInst._y;
HUDInst.TeamBackYellow2Inst._visible = true;
HUDInst.TeamBackYellow2Inst._x = HUDInst.Team2_2BackInst._x;
HUDInst.TeamBackYellow2Inst._y = HUDInst.Team2_2BackInst._y;
}
}
}
function ShowNextTeam() {
if (gNumPlayers == 1) {
if (gPlayer1Team != -1) {
gTeam1 = gTeam;
gotoAndPlay ("Track Select");
SetHeadIcon(0, gTeam1);
gTeam2 = gTeam1;
while (gTeam2 == gTeam1) {
gTeam2 = random(3);
}
SetHeadIcon(1, gTeam2);
}
} else if ((gPlayer1Team != -1) && (gPlayer2Team != -1)) {
gTeam2 = gTeam;
gotoAndPlay ("Track Select");
SetHeadIcon(1, gTeam2);
} else if (((gPlayer1Team != -1) && (gPlayer2Team == -1)) && (!Player2SelectTeamTextInst._visible)) {
Player1SelectTeamTextInst._visible = false;
Player2SelectTeamTextInst._visible = true;
Player2SelectTeamTextInst.gotoAndPlay(1);
gTeam1 = gTeam;
SetHeadIcon(0, gTeam1);
var _local1 = SKIN_RED;
if (_local1 == gTeam1) {
_local1++;
}
if (_local1 > SKIN_YELLOW) {
_local1 = SKIN_RED;
}
gTeam = _local1;
switch (_local1) {
case SKIN_RED :
gTeamInst = Team1Inst;
break;
case SKIN_BLUE :
gTeamInst = Team2Inst;
break;
case SKIN_YELLOW :
gTeamInst = Team3Inst;
}
}
gTeamInst.gotoAndPlay("In");
}
stop();
SKIN_RED = 0;
SKIN_BLUE = 1;
SKIN_YELLOW = 2;
gTeam = SKIN_RED;
gTeam1 = -1;
gTeam2 = -1;
gTeamInst = Team1Inst;
gPlayer1Team = -1;
gPlayer2Team = -1;
Player1SelectTeamTextInst._visible = true;
Player2SelectTeamTextInst._visible = false;
HUDInst.Head1_1Inst.stop();
HUDInst.Head1_2Inst.stop();
HUDInst.Head2_1Inst.stop();
HUDInst.Head2_2Inst.stop();
HUDInst.Head3_1Inst.stop();
HUDInst.Head3_2Inst.stop();
HUDInst.Head1_1Inst._visible = false;
HUDInst.Head1_2Inst._visible = false;
HUDInst.Head2_1Inst._visible = false;
HUDInst.Head2_2Inst._visible = false;
HUDInst.Head3_1Inst._visible = false;
HUDInst.Head3_2Inst._visible = false;
HUDInst.Marker1_1Inst._visible = false;
HUDInst.Marker1_2Inst._visible = false;
HUDInst.Marker2_1Inst._visible = false;
HUDInst.Marker2_2Inst._visible = false;
HUDInst.TeamBackRed1Inst._visible = false;
HUDInst.TeamBackRed2Inst._visible = false;
HUDInst.TeamBackBlue1Inst._visible = false;
HUDInst.TeamBackBlue2Inst._visible = false;
HUDInst.TeamBackYellow1Inst._visible = false;
HUDInst.TeamBackYellow2Inst._visible = false;
gHeadIcon1_1Inst = null;
gHeadIcon1_2Inst = null;
gHeadIcon2_1Inst = null;
gHeadIcon2_2Inst = null;
gTeamInst.gotoAndPlay("In");
PlayerLeftInst.onRelease = function () {
if (gTeamInst._currentframe != 15) {
} else {
Sfx.Play(SFXID_Beep1, 1);
TransitionFlakes();
gTeamInst.gotoAndPlay("Out");
var _local1 = false;
while (!_local1) {
gTeam--;
if (gTeam < 0) {
gTeam = 2;
}
if (gTeam != gTeam1) {
_local1 = true;
}
}
switch (gTeam) {
case SKIN_RED :
gTeamInst = Team1Inst;
return;
case SKIN_BLUE :
gTeamInst = Team2Inst;
return;
case SKIN_YELLOW :
gTeamInst = Team3Inst;
}
}
};
PlayerRightInst.onRelease = function () {
if (gTeamInst._currentframe != 15) {
} else {
Sfx.Play(SFXID_Beep1, 1);
TransitionFlakes();
gTeamInst.gotoAndPlay("Out");
var _local1 = false;
while (!_local1) {
gTeam++;
if (gTeam > 2) {
gTeam = 0;
}
if (gTeam != gTeam1) {
_local1 = true;
}
}
switch (gTeam) {
case SKIN_RED :
gTeamInst = Team1Inst;
return;
case SKIN_BLUE :
gTeamInst = Team2Inst;
return;
case SKIN_YELLOW :
gTeamInst = Team3Inst;
}
}
};
cKeyHandler.prototype.onKeyDown = function () {
var _local1 = this;
if (!_local1.noKey) {
} else if (Key.isDown(40) || (Key.isDown(39))) {
PlayerRightInst.onRelease();
_local1.noKey = false;
} else if (Key.isDown(38) || (Key.isDown(37))) {
PlayerLeftInst.onRelease();
_local1.noKey = false;
} else if (Key.isDown(32) || (Key.isDown(13))) {
gTeamInst.onRelease();
_local1.noKey = false;
}
};
Team1Inst.onRelease = function () {
if (gPlayer1Team == -1) {
gPlayer1Team = SKIN_RED;
} else {
gPlayer2Team = SKIN_RED;
}
Sfx.Play(SFXID_Beep2, 1);
Team1Inst.gotoAndPlay("Out");
};
Team2Inst.onRelease = function () {
if (gPlayer1Team == -1) {
gPlayer1Team = SKIN_BLUE;
} else {
gPlayer2Team = SKIN_BLUE;
}
Sfx.Play(SFXID_Beep2, 1);
Team2Inst.gotoAndPlay("Out");
};
Team3Inst.onRelease = function () {
if (gPlayer1Team == -1) {
gPlayer1Team = SKIN_YELLOW;
} else {
gPlayer2Team = SKIN_YELLOW;
}
Sfx.Play(SFXID_Beep2, 1);
Team3Inst.gotoAndPlay("Out");
};
onEnterFrame = function () {
KeyHandler.Update();
if (Math.abs(HUDInst._y - 430) > 1) {
HUDInst._y = HUDInst._y + ((430 - HUDInst._y) * 0.2);
} else {
HUDInst._y = 430;
}
};
Frame 110
function Pause(state) {
var _local1 = state;
TrackLeftInst.enabled = !_local1;
TrackRightInst.enabled = !_local1;
TrackIcon01AnimInst.enabled = !_local1;
TrackIcon02AnimInst.enabled = !_local1;
TrackIcon03AnimInst.enabled = !_local1;
TrackIcon04AnimInst.enabled = !_local1;
}
function Back() {
gotoAndPlay ("Intro");
}
function ShowNextTrack() {
gTrackInst._visible = true;
gTrackInst.gotoAndPlay("Play");
if (gSelected) {
gotoAndPlay ("Race");
}
}
stop();
TRACK_ONE = 0;
TRACK_TWO = 1;
TRACK_THREE = 2;
TRACK_FOUR = 3;
gTrack = TRACK_ONE;
gTrackInst = TrackIcon01AnimInst;
gSelected = false;
TrackIcon01AnimInst.gotoAndPlay("In");
TrackIcon02AnimInst._visible = false;
TrackIcon03AnimInst._visible = false;
TrackIcon04AnimInst._visible = false;
TrackLeftInst.onRelease = function () {
if (gTrackInst._currentframe != 7) {
return(undefined);
}
Sfx.Play(SFXID_Beep1, 1);
TransitionFlakes();
gTrackInst.gotoAndPlay("Out");
gTrack--;
if (gTrack < 0) {
gTrack = 3;
}
switch (gTrack) {
case TRACK_ONE :
gTrackInst = TrackIcon01AnimInst;
return;
case TRACK_TWO :
gTrackInst = TrackIcon02AnimInst;
return;
case TRACK_THREE :
gTrackInst = TrackIcon03AnimInst;
return;
case TRACK_FOUR :
gTrackInst = TrackIcon04AnimInst;
}
};
TrackRightInst.onRelease = function () {
if (gTrackInst._currentframe != 7) {
return(undefined);
}
Sfx.Play(SFXID_Beep1, 1);
TransitionFlakes();
gTrackInst.gotoAndPlay("Out");
gTrack++;
if (gTrack > 3) {
gTrack = 0;
}
switch (gTrack) {
case TRACK_ONE :
gTrackInst = TrackIcon01AnimInst;
return;
case TRACK_TWO :
gTrackInst = TrackIcon02AnimInst;
return;
case TRACK_THREE :
gTrackInst = TrackIcon03AnimInst;
return;
case TRACK_FOUR :
gTrackInst = TrackIcon04AnimInst;
}
};
cKeyHandler.prototype.onKeyDown = function () {
var _local1 = this;
if (!_local1.noKey) {
} else if (Key.isDown(40) || (Key.isDown(39))) {
TrackRightInst.onRelease();
_local1.noKey = false;
} else if (Key.isDown(38) || (Key.isDown(37))) {
TrackLeftInst.onRelease();
_local1.noKey = false;
} else if (Key.isDown(32) || (Key.isDown(13))) {
gTrackInst.onRelease();
_local1.noKey = false;
}
};
TrackIcon01AnimInst.onRelease = function () {
gTrackInst.gotoAndPlay("Out");
gSelected = true;
Sfx.Play(SFXID_Beep2, 1);
};
TrackIcon02AnimInst.onRelease = function () {
gTrackInst.gotoAndPlay("Out");
gSelected = true;
Sfx.Play(SFXID_Beep2, 1);
};
TrackIcon03AnimInst.onRelease = function () {
gTrackInst.gotoAndPlay("Out");
gSelected = true;
Sfx.Play(SFXID_Beep2, 1);
};
TrackIcon04AnimInst.onRelease = function () {
gTrackInst.gotoAndPlay("Out");
gSelected = true;
Sfx.Play(SFXID_Beep2, 1);
};
Frame 121
function cParticles(numParticles, layer, sourceMovieClip, maskMovieClip) {
var _local2 = layer;
var _local3 = this;
_local3.particle = new Array();
_local3.numParticles = numParticles;
_local3.free = new Array();
var _local1 = 0;
n = 0;
while (n < numParticles) {
_local3.particle.push(sourceMovieClip.duplicateMovieClip(("p" + _local2) + _local1, _local2 + (_local1++)));
p = _local3.particle[n];
if ((maskMovieClip != undefined) && (maskMovieClip != null)) {
p.setMask(maskMovieClip.duplicateMovieClip(("m" + _local2) + _local1, _local2 + (_local1++)));
}
p._x = 0;
p._y = 0;
p._visible = false;
p.life = 100;
_local3.free.push(n);
n++;
}
_local3.nl = _local1;
}
function Vec2() {
}
function Vec2(x, y) {
this.x = x;
this.y = y;
}
function formatTime(time) {
var _local1 = Math.floor(time / 1000);
var _local3 = Math.floor(_local1 / 60);
_local1 = _local1 - (_local3 * 60);
var _local2 = Math.floor((time - ((_local3 * 60000) + (_local1 * 1000))) / 10);
_local3 = "" + _local3;
_local1 = "" + _local1;
_local2 = "" + _local2;
if (_local1.length < 2) {
_local1 = "0" + _local1;
}
if (_local2.length < 2) {
_local2 = "0" + _local2;
}
return((_local3 + _local1) + _local2);
}
function Pause(state) {
var _local1 = state;
gPause = _local1;
Driver1.FreezeState(_local1);
Driver2.FreezeState(_local1);
if (_local1) {
gPauseTime = getTimer();
} else {
gDogSkin1.play();
gSledSkin1.play();
gDogSkin2.play();
gSledSkin2.play();
Driver1.t = Driver1.t + (getTimer() - gPauseTime);
Driver2.t = Driver2.t + (getTimer() - gPauseTime);
}
}
function Back() {
PlayerPart.CleanUp();
count.removeMovieClip();
EngineSound1Inst.Stop();
EngineSound2Inst.Stop();
Key.removeListener(EngineSound1Inst);
Key.removeListener(EngineSound2Inst);
Driver1.Destroy();
Driver2.Destroy();
gotoAndPlay ("Intro");
gTrackOverlayInst.removeMovieClip();
gHighScoreDialogInst.removeMovieClip();
HUDInst.BackInst.enabled = true;
Sfx.StopAll();
}
function ResetRace() {
PlayerPart.CleanUp();
count.removeMovieClip();
EngineSound1Inst.Stop();
EngineSound2Inst.Stop();
Key.removeListener(EngineSound1Inst);
Key.removeListener(EngineSound2Inst);
Driver1.Destroy();
Driver2.Destroy();
gotoAndPlay ("Reset Race");
gHighScoreDialogInst.removeMovieClip();
HUDInst.BackInst.enabled = true;
Sfx.StopAll();
}
function cDriver(playerNum, driverClip, sledClip, startClip, fullLapClip, halfLapClip, AIList, AIPlayer, keys) {
var _local1 = this;
var _local2 = playerNum;
var _local3 = startClip;
_local1.playerNum = _local2;
_local1.freeze = true;
_local1.clip = driverClip.duplicateMovieClip("drv" + _local2, LAYER_DRIVER + (_local2 * 10));
_local1.clip._x = _local3._x;
_local1.clip._y = _local3._y;
_local1.clip._rotation = _local3._rotation;
_local1.clip.Col1Inst._visible = false;
_local1.clip.Col2Inst._visible = false;
_local1.sledClip = sledClip.duplicateMovieClip("sld" + _local2, (LAYER_DRIVER + (_local2 * 10)) + 1);
_local1.ang = (Math.PI/180) * _local1.clip._rotation;
_local1.seekAng = _local1.ang;
_local1.dir = new Vec2();
_local1.speed = 0;
_local1.accel = 0;
_local1.lastPos = new Vec2();
_local1.work = new Vec2();
_local1.work2 = new Vec2();
_local1.up = new Vec2(1, 0);
_local1.running = false;
_local1.cpu = AIPlayer;
_local1.way = 0;
_local1.wayList = AIList;
_local1.aiMaxSpeed = 4;
_local1.opponent = null;
_local1.lapFullClip = fullLapClip;
_local1.lapHalfClip = halfLapClip;
_local1.nextLapMarker = _local1.lapFullClip;
_local1.lap = -0.5;
_local1.t = -1;
_local1.finished = false;
_local1.finishTime = -1;
_local1.dist = 0;
if (keys == KEYS_PLAYER1) {
_local1.keyUp = 38;
_local1.keyLeft = 37;
_local1.keyRight = 39;
_local1.keyDown = 40;
EngineSound1Inst.SetKeys(_local1.keyUp, _local1.keyDown, _local1.keyLeft, _local1.keyRight, 32);
EngineSound1Inst.SetHornType(0);
} else {
_local1.keyUp = 87;
_local1.keyLeft = 65;
_local1.keyRight = 68;
_local1.keyDown = 83;
if (!_local1.cpu) {
EngineSound2Inst.SetKeys(_local1.keyUp, _local1.keyDown, _local1.keyLeft, _local1.keyRight, 88);
EngineSound2Inst.SetHornType(1);
}
}
_local1.dir.RadianToEulerAngle(_local1.ang);
_local1.sledClip._x = _local1.clip._x - _local1.dir.x;
_local1.sledClip._y = _local1.clip._y - _local1.dir.y;
_local1.PositionSled();
_local1.clip.Dog1Inst.stop();
_local1.clip.Dog2Inst.stop();
_local1.sledClip.stop();
_local1.skidCounter = 0;
}
function HideClipsInList(array) {
var _local2 = array;
var _local1 = 0;
while (_local1 < _local2.length) {
_local2[_local1]._visible = false;
_local1++;
}
}
function GameOver() {
gHighScoreDialogInst.Show(gNumPlayers);
HUDInst.BackInst.enabled = false;
}
stop();
cParticles.prototype.GetNumLayers = function () {
return(this.nl);
};
cParticles.prototype.CleanUp = function () {
var _local1 = this;
n = 0;
while (n < _local1.numParticles) {
_local1.particle[n].removeMovieClip();
n++;
}
delete _local1.particle;
delete _local1.free;
};
cParticles.prototype.Reset = function () {
var _local1 = this;
n = 0;
while (n < _local1.particle.length) {
if (_local1.particle[n]._visible) {
_local1.particle[n]._visible = false;
_local1.free.push(n);
}
n++;
}
};
cParticles.prototype.Add = function (x, y, life, rot, scale, dx, dy) {
var _local1 = life;
var _local2 = this;
if (_global.CullFx) {
} else if (_local2.free.length == 0) {
} else {
n = _local2.free.pop();
p = _local2.particle[n];
p._x = x;
p._y = y;
p._rotation = 0;
p._visible = true;
p._alpha = 100;
p._xscale = 100;
p._yscale = 100;
p.life = _local1;
p.maxLife = _local1;
p.fade = 100 / _local1;
p.rot = rot;
p.dx = dx;
p.dy = dy;
p.scale = scale;
}
};
cParticles.prototype.GetNumActive = function () {
return(this.particle.length);
};
cParticles.prototype.Update = function (dx, dy) {
var _local1 = this;
var _local2 = dy;
var _local3 = dx;
n = 0;
while (n < _local1.particle.length) {
p = _local1.particle[n];
if (p._visible) {
p.life--;
if (p.life <= 0) {
_local1.particle[n]._visible = false;
_local1.free.push(n);
} else {
p._rotation = p._rotation + p.rot;
p._alpha = p._alpha - p.fade;
p._x = p._x + (p.dx + _local3);
p._y = p._y + (p.dy + _local2);
p._xscale = p._xscale * p.scale;
p._yscale = p._yscale * p.scale;
}
}
n++;
}
};
cParticles.prototype.UpdateNoAlpha = function (dx, dy) {
var _local1 = this;
var _local2 = dy;
var _local3 = dx;
n = 0;
while (n < _local1.particle.length) {
p = _local1.particle[n];
if (p._visible) {
p.life--;
if (p.life <= 0) {
_local1.particle[n]._visible = false;
_local1.free.push(n);
} else {
p._rotation = p._rotation + p.rot;
p._x = p._x + (p.dx + _local3);
p._y = p._y + (p.dy + _local2);
p._xscale = p._xscale * p.scale;
p._yscale = p._yscale * p.scale;
}
}
n++;
}
};
LAYER_TRACK = 50;
LAYER_PARTICLES = 60;
LAYER_DRIVER = 100;
LAYER_TRACKOVERLAY = 195;
LAYER_FLAG = 200;
LAYER_WINNER1 = 300;
LAYER_WINNER2 = 400;
LAYER_HIGHSCORE = 500;
LAYER_COUNT = 600;
PlayerPart = new cParticles(32, LAYER_PARTICLES, SmokePartInst);
Track1Inst._visible = false;
Track1Inst.enabled = false;
Track2Inst._visible = false;
Track2Inst.enabled = false;
Track3Inst._visible = false;
Track3Inst.enabled = false;
Track4Inst._visible = false;
Track4Inst.enabled = false;
IntroAnimInst._visible = false;
IntroAnimInst.stop();
duplicateMovieClip (IntroAnimInst, "count", LAYER_COUNT);
Set(undefined, undefined);
switch (gTrack) {
case 0 :
gTrackInst = Track1Inst;
gTrackOverlayInst = attachMovie("Track1Overlay", "overlay", LAYER_TRACKOVERLAY, {_x:Track1Inst.OverlayInst._x, _y:Track1Inst.OverlayInst._y});
break;
case 1 :
gTrackInst = Track2Inst;
gTrackOverlayInst = attachMovie("Track2Overlay", "overlay", LAYER_TRACKOVERLAY, {_x:Track2Inst.OverlayInst._x, _y:Track2Inst.OverlayInst._y});
break;
case 2 :
gTrackInst = Track3Inst;
gTrackOverlayInst = attachMovie("Track3Overlay", "overlay", LAYER_TRACKOVERLAY, {_x:Track3Inst.OverlayInst._x, _y:Track3Inst.OverlayInst._y});
break;
case 3 :
gTrackInst = Track4Inst;
gTrackOverlayInst = attachMovie("Track4Overlay", "overlay", LAYER_TRACKOVERLAY, {_x:Track4Inst.OverlayInst._x, _y:Track4Inst.OverlayInst._y});
}
AI = new Array();
trace("Building AI waypoint list");
n = 1;
qw = ("P" + n) + "Inst";
while (gTrackInst[qw] != undefined) {
trace("Found " + qw);
AI[n - 1] = gTrackInst[qw];
n++;
qw = ("P" + n) + "Inst";
}
gTrackInst._visible = true;
gTrackInst.OverlayInst._visible = false;
gTrackInst.enabled = true;
gTrackOverlayInst._visible = true;
Vec2.prototype.Len = function () {
var _local1 = this;
return(Math.sqrt((_local1.x * _local1.x) + (_local1.y * _local1.y)));
};
Vec2.prototype.Norm = function () {
var _local1 = this;
w = Math.sqrt((_local1.x * _local1.x) + (_local1.y * _local1.y));
if (w == 0) {
return(0);
}
_local1.x = _local1.x / w;
_local1.y = _local1.y / w;
return(w);
};
Vec2.prototype.Scale = function (s) {
this.x = this.x * s;
this.y = this.y * s;
};
Vec2.prototype.RadianToEulerAngle = function (a) {
this.x = Math.sin(a);
this.y = -Math.cos(a);
};
Vec2.prototype.Dot = function (v) {
return((this.x * v.x) + (this.y * v.y));
};
gPauseTime = 0;
gPause = false;
gWinner = -1;
KEYS_PLAYER1 = 0;
KEYS_PLAYER2 = 1;
MODE_SINGLEPLAYER = 0;
MODE_TWOPLAYERS = 1;
SKIN_RED = 0;
SKIN_BLUE = 1;
SKIN_YELLOW = 2;
NUM_LAPS = 5;
gPlayer1WinsAnimInst = Player1WinsAnimInst.duplicateMovieClip("p1w", LAYER_WINNER1);
gPlayer1WinsAnimInst._x = Player1WinsAnimInst._x;
gPlayer1WinsAnimInst._y = Player1WinsAnimInst._y;
Player1WinsAnimInst._visible = false;
gPlayer2WinsAnimInst = Player2WinsAnimInst.duplicateMovieClip("p2w", LAYER_WINNER2);
gPlayer2WinsAnimInst._x = Player2WinsAnimInst._x;
gPlayer2WinsAnimInst._y = Player2WinsAnimInst._y;
Player2WinsAnimInst._visible = false;
HighScoreDialogInst._visible = false;
gHighScoreDialogInst = HighScoreDialogInst.duplicateMovieClip("high", LAYER_HIGHSCORE);
gHighScoreDialogInst._visible = false;
gMode = MODE_TWOPLAYERS;
gDogSkin1 = null;
gSledSkin1 = null;
gDogSkin2 = null;
gSledSkin2 = null;
switch (gTeam1) {
case SKIN_RED :
gDogSkin1 = RedDogTeamInst;
gSledSkin1 = RedSledInst;
break;
case SKIN_BLUE :
gDogSkin1 = BlueDogTeamInst;
gSledSkin1 = BlueSledInst;
break;
case SKIN_YELLOW :
gDogSkin1 = YellowDogTeamInst;
gSledSkin1 = YellowSledInst;
}
switch (gTeam2) {
case SKIN_RED :
gDogSkin2 = RedDogTeamInst;
gSledSkin2 = RedSledInst;
break;
case SKIN_BLUE :
gDogSkin2 = BlueDogTeamInst;
gSledSkin2 = BlueSledInst;
break;
case SKIN_YELLOW :
gDogSkin2 = YellowDogTeamInst;
gSledSkin2 = YellowSledInst;
}
cDriver.prototype.Destroy = function () {
var _local1 = this;
_local1.clip.removeMovieClip();
_local1.sledClip.removeMovieClip();
};
cDriver.prototype.FreezeState = function (state) {
this.freeze = state;
};
cDriver.prototype.SetOpponent = function (driver) {
this.opponent = driver;
};
cDriver.prototype.PositionSled = function () {
var _local1 = this;
_local1.work.x = _local1.clip._x - _local1.sledClip._x;
_local1.work.y = _local1.clip._y - _local1.sledClip._y;
_local1.work.Norm();
var _local2 = Math.acos(_local1.up.Dot(_local1.work));
_local1.work.Scale(12);
_local1.sledClip._x = _local1.clip._x - _local1.work.x;
_local1.sledClip._y = _local1.clip._y - _local1.work.y;
if (_local1.work.y < 0) {
_local1.sledClip._rotation = 360 - (_local2 * 57.2957795130823);
} else {
_local1.sledClip._rotation = _local2 * 57.2957795130823;
}
_local1.colDelay = 0;
};
cDriver.prototype.Update = function () {
var _local1 = this;
if (_local1.freeze || (gPause)) {
} else {
if (_local1.t == -1) {
_local1.t = getTimer();
}
if (_local1.speed > 3) {
if (Math.random() > 0.75) {
var v = new Vec2(0, 0);
if (Math.random() > 0.5) {
_local1.sledClip.Part1MarkInst.localToGlobal(v);
} else {
_local1.sledClip.Part2MarkInst.localToGlobal(v);
}
PlayerPart.Add(v.x, v.y, 15, 1.01, 1.1, -_local1.dir.x, -_local1.dir.y);
}
}
if (!_local1.finished) {
var time = (getTimer() - _local1.t);
_local1.finishTime = time;
var _local2 = Math.floor(time / 1000);
var _local3 = Math.floor(_local2 / 60);
_local2 = _local2 - (_local3 * 60);
var hun = Math.floor((time - ((_local3 * 60000) + (_local2 * 1000))) / 10);
_local3 = "" + _local3;
_local2 = "" + _local2;
hun = "" + hun;
if (_local3.length < 2) {
_local3 = "0" + _local3;
}
if (_local2.length < 2) {
_local2 = "0" + _local2;
}
if (hun.length < 2) {
hun = "0" + hun;
}
if (_local1.playerNum == 0) {
HUDInst.Player1TimeString.text = (((("TIME: " + _local3) + ":") + _local2) + ":") + hun;
} else {
HUDInst.Player2TimeString.text = (((("TIME: " + _local3) + ":") + _local2) + ":") + hun;
}
}
if (_local1.cpu) {
if (_local1.wayList[_local1.way].hitTest(_local1.clip._x, _local1.clip._y, true)) {
_local1.way++;
if (_local1.way >= _local1.wayList.length) {
_local1.way = 0;
}
}
_local1.work.x = _local1.clip._x - _local1.wayList[_local1.way]._x;
_local1.work.y = _local1.clip._y - _local1.wayList[_local1.way]._y;
_local1.work.Norm();
_local1.work2.RadianToEulerAngle(_local1.ang - (Math.PI/2));
_local1.work2.Norm();
var dot = _local1.work.Dot(_local1.work2);
if (dot < -0.1) {
_local1.ang = _local1.ang - 0.08;
} else if (dot > 0.1) {
_local1.ang = _local1.ang + 0.08;
}
_local1.accel = 0.1;
_local1.seekAng = _local1.ang;
} else {
if (Key.isDown(_local1.keyLeft)) {
_local1.seekAng = _local1.seekAng - 0.07;
} else if (Key.isDown(_local1.keyRight)) {
_local1.seekAng = _local1.seekAng + 0.07;
}
if (Key.isDown(_local1.keyUp)) {
_local1.accel = 0.1;
} else if (Key.isDown(_local1.keyDown)) {
_local1.accel = -0.1;
} else {
_local1.accel = 0;
}
}
_local1.ang = _local1.ang + ((_local1.seekAng - _local1.ang) * 0.15);
if (_local1.skidCounter > 0) {
_local1.skidCounter--;
}
if (((Math.abs(_local1.seekAng - _local1.ang) > 0.35) && (_local1.speed >= 4.5)) && (_local1.skidCounter == 0)) {
SFX_Screech.start();
_local1.skidCounter = 66;
}
_local1.work.x = _local1.clip.Col1Inst._x;
_local1.work.y = _local1.clip.Col1Inst._y;
_local1.clip.localToGlobal(_local1.work);
var c1 = (!gTrackInst.TrackGuideInst.hitTest(_local1.work.x, _local1.work.y, true));
if (!c1) {
c1 = _local1.opponent.clip.hitTest(_local1.work.x, _local1.work.y, false);
if (!c1) {
c1 = _local1.opponent.sledClip.hitTest(_local1.work.x, _local1.work.y, false);
}
}
_local1.work.x = _local1.clip.Col2Inst._x;
_local1.work.y = _local1.clip.Col2Inst._y;
_local1.clip.localToGlobal(_local1.work);
var c2 = (!gTrackInst.TrackGuideInst.hitTest(_local1.work.x, _local1.work.y, true));
if (!c2) {
c2 = _local1.opponent.clip.hitTest(_local1.work.x, _local1.work.y, false);
if (!c2) {
c2 = _local1.opponent.sledClip.hitTest(_local1.work.x, _local1.work.y, false);
}
}
if (c1 && (c2)) {
_local1.speed = _local1.speed * 0.75;
_local1.clip._x = _local1.lastPos.x;
_local1.clip._y = _local1.lastPos.y;
if ((_local1.speed > 3) && (_local1.colDelay == 0)) {
Sfx.Play(SFXID_Bump, 1);
_local1.colDelay = 5;
}
} else if (c1) {
_local1.ang = _local1.ang + 0.1;
_local1.speed = _local1.speed * 0.8;
if (_local1.colDelay == 0) {
if (_local1.speed > 3) {
Sfx.Play(SFXID_Bump, 1);
} else {
Sfx.Play(SFXID_Brush, 1);
}
_local1.colDelay = 5;
}
} else if (c2) {
_local1.ang = _local1.ang - 0.1;
_local1.speed = _local1.speed * 0.8;
if (_local1.colDelay == 0) {
if (_local1.speed > 3) {
Sfx.Play(SFXID_Bump, 1);
} else {
Sfx.Play(SFXID_Brush, 1);
}
_local1.colDelay = 5;
}
} else if (_local1.colDelay > 0) {
_local1.colDelay--;
}
_local1.dir.RadianToEulerAngle(_local1.ang);
if (Math.abs(_local1.accel) > 0) {
_local1.speed = _local1.speed + _local1.accel;
} else if (_local1.speed > 0) {
_local1.speed = _local1.speed - 0.2;
} else {
_local1.speed = 0;
}
if (_local1.speed < -0.5) {
_local1.speed = -0.5;
}
if (_local1.cpu) {
if ((_local1.opponent.dist + 400) > _local1.dist) {
_local1.aiMaxSpeed = 5.35;
} else {
_local1.aiMaxSpeed = 4.5;
}
if (_local1.speed > _local1.aiMaxSpeed) {
_local1.speed = _local1.aiMaxSpeed;
}
} else if (_local1.speed > 5) {
_local1.speed = 5;
}
_local1.lastPos.x = _local1.clip._x;
_local1.lastPos.y = _local1.clip._y;
_local1.clip._x = _local1.clip._x + (_local1.dir.x * _local1.speed);
_local1.clip._y = _local1.clip._y + (_local1.dir.y * _local1.speed);
_local1.clip._rotation = _local1.seekAng * 57.2957795130823;
_local1.work.x = Math.abs(_local1.clip._x - _local1.lastPos.x);
_local1.work.y = Math.abs(_local1.clip._y - _local1.lastPos.y);
_local1.dist = _local1.dist + _local1.work.Len();
_local1.work.x = _local1.clip._x - _local1.sledClip._x;
_local1.work.y = _local1.clip._y - _local1.sledClip._y;
_local1.work.Norm();
var a = Math.acos(_local1.up.Dot(_local1.work));
_local1.work.Scale(12);
_local1.sledClip._x = _local1.clip._x - _local1.work.x;
_local1.sledClip._y = _local1.clip._y - _local1.work.y;
if (_local1.work.y < 0) {
_local1.sledClip._rotation = 360 - (a * 57.2957795130823);
} else {
_local1.sledClip._rotation = a * 57.2957795130823;
}
if (_local1.running) {
if (_local1.speed < 0.1) {
_local1.running = false;
_local1.clip.Dog1Inst.stop();
_local1.clip.Dog2Inst.stop();
_local1.sledClip.stop();
}
} else if (_local1.speed > 0.1) {
_local1.running = true;
_local1.clip.Dog1Inst.play();
_local1.clip.Dog2Inst.play();
_local1.sledClip.play();
}
if (_local1.nextLapMarker.hitTest(_local1.clip._x, _local1.clip._y, true)) {
_local1.lap = _local1.lap + 0.5;
if (_local1.nextLapMarker == _local1.lapFullClip) {
if ((_local1.lap > 0.5) && (_local1.lap < NUM_LAPS)) {
Sfx.Play(SFXID_Beep1, 1);
}
_local1.nextLapMarker = _local1.lapHalfClip;
} else {
_local1.nextLapMarker = _local1.lapFullClip;
}
if (_local1.lap <= (NUM_LAPS - 1)) {
if (_local1.playerNum == 0) {
HUDInst.Player1LapString.text = (("LAP " + Math.floor(_local1.lap + 1)) + " OF ") + NUM_LAPS;
} else {
HUDInst.Player2LapString.text = (("LAP " + Math.floor(_local1.lap + 1)) + " OF ") + NUM_LAPS;
}
}
if (_local1.lap == NUM_LAPS) {
if (gWinner == -1) {
gWinner = _local1.playerNum;
if (_local1.playerNum == 0) {
EngineSound1Inst.SetKeys(-1, -1, -1, -1, 32);
gPlayer1WinsAnimInst.gotoAndPlay("Start");
} else {
EngineSound2Inst.SetKeys(-1, -1, -1, -1, 32);
gPlayer2WinsAnimInst.gotoAndPlay("Start");
}
Sfx.Play(SFXID_Beep2, 1);
}
_local1.cpu = true;
_local1.finished = true;
if ((gNumPlayers == 2) && (_local1.opponent.finished)) {
GameOver();
}
if (((gNumPlayers == 1) && (gWinner == 1)) && (_local1.playerNum == 0)) {
GameOver();
}
}
}
}
};
gTrackInst.TrackGuideInst._visible = false;
SledInst._visible = false;
gTrackInst.StartMarker01Inst._visible = false;
gTrackInst.StartMarker02Inst._visible = false;
gTrackInst.LapMarker1Inst._visible = false;
gTrackInst.LapMarker2Inst._visible = false;
RedDogTeamInst._visible = false;
BlueDogTeamInst._visible = false;
YellowDogTeamInst._visible = false;
RedSledInst._visible = false;
BlueSledInst._visible = false;
YellowSledInst._visible = false;
HideClipsInList(AI);
if (gNumPlayers == 2) {
Driver1 = new cDriver(0, gDogSkin1, gSledSkin1, gTrackInst.StartMarker02Inst, gTrackInst.LapMarker1Inst, gTrackInst.LapMarker2Inst, AI, false, KEYS_PLAYER2);
Driver2 = new cDriver(1, gDogSkin2, gSledSkin2, gTrackInst.StartMarker01Inst, gTrackInst.LapMarker1Inst, gTrackInst.LapMarker2Inst, AI, false, KEYS_PLAYER1);
} else {
Driver1 = new cDriver(0, gDogSkin1, gSledSkin1, gTrackInst.StartMarker02Inst, gTrackInst.LapMarker1Inst, gTrackInst.LapMarker2Inst, AI, false, KEYS_PLAYER1);
Driver2 = new cDriver(1, gDogSkin2, gSledSkin2, gTrackInst.StartMarker01Inst, gTrackInst.LapMarker1Inst, gTrackInst.LapMarker2Inst, AI, true, null);
}
Driver1.SetOpponent(Driver2);
Driver2.SetOpponent(Driver1);
EngineSound1Inst.StartEngine();
Key.addListener(EngineSound1Inst);
Key.addListener(EngineSound2Inst);
onEnterFrame = function () {
Driver1.Update();
Driver2.Update();
PlayerPart.Update();
};
Frame 131
gotoAndPlay ("Race");
Symbol 43 MovieClip Frame 1
this._visible = false;
Symbol 49 Button
on (release) {
getURL ("http://www.miniclip.com/", "_blank");
}
Symbol 54 MovieClip Frame 1
pushSWF1 = "http://www.miniclip.com/swfcontent/push/didyouknow.swf";
totalAds = 1;
gotoAndPlay ("ReadCookie");
Symbol 54 MovieClip Frame 9
so = SharedObject.getLocal("MiniclipLoaderAd");
showThisAd = so.data.showThisAd + 1;
if (showThisAd > totalAds) {
showThisAd = 1;
}
so.data.showThisAd = showThisAd;
gotoAndPlay ("prepareAd");
Symbol 54 MovieClip Frame 20
doReadCookie();
showAd = ((this["pushSWF" + showThisAd] + "?cacheBuster=") + getTimer()) + random(999999);
gotoAndPlay ("loadAd");
Symbol 54 MovieClip Frame 31
if (_url.indexOf(http) > 0) {
mcAd.loadMovie(showAd);
}
mcCookie.doWriteCookie(showThisAd);
Symbol 54 MovieClip Frame 33
if ((mcAd.getBytesTotal() != 0) && (mcAd.getBytesLoaded() == mcAd.getBytesTotal())) {
lastAdShown = showThisAd;
doWriteCookie();
gotoAndStop ("showAd");
} else {
gotoAndPlay(_currentframe - 1);
}
Symbol 54 MovieClip Frame 41
stop();
Symbol 64 MovieClip Frame 1
stop();
Symbol 64 MovieClip Frame 100
stop();
Symbol 66 MovieClip Frame 1
stop();
Symbol 66 MovieClip Frame 12
_root.play();
_root.isFinished = true;
_parent.stop();
stop();
Symbol 70 Button
on (release) {
getURL ("http://www.miniclip.com/", "_blank");
}
Symbol 71 MovieClip Frame 2
_parent.mcAnimation.play();
stop();
Symbol 71 MovieClip Frame 13
_parent.gotoAndPlay("preload");
stop();
Symbol 85 MovieClip Frame 1
stop();
Symbol 85 MovieClip Frame 60
Symbol 85 MovieClip Frame 121
_parent.mcBackground.play();
stop();
Symbol 86 MovieClip Frame 1
_root.stop();
play();
Instance of Symbol 43 MovieClip "mcIntro" in Symbol 86 MovieClip Frame 1
onClipEvent (load) {
_visible = false;
}
Symbol 86 MovieClip Frame 2
xPos = _x;
yPos = _y;
mcBackground._x = mcBackground._x - xPos;
mcBackground._y = mcBackground._y - yPos;
mcAnimation._x = mcAnimation._x - xPos;
mcAnimation._y = mcAnimation._y - yPos;
var stageWidth = Stage.width;
var stageHeight = Stage.height;
var centerStageX = (stageWidth / 2);
var centerStageY = (stageHeight / 2);
mcBackground._width = stageWidth;
mcBackground._height = stageHeight;
mcAnimation._x = mcAnimation._x + centerStageX;
mcAnimation._y = mcAnimation._y + (centerStageY - (stageHeight / 10));
stop();
Instance of Symbol 66 MovieClip "mcLoadingAnimated" in Symbol 86 MovieClip Frame 2
onClipEvent (load) {
_visible = false;
}
Symbol 86 MovieClip Frame 3
var loadedPercent = int((_root.getBytesLoaded() / _root.getBytesTotal()) * 100);
if (loadedPercent == 100) {
_root.play();
stop();
} else {
mcLoadingAnimated._visible = true;
}
Symbol 86 MovieClip Frame 5
var loadedPercent = int((_root.getBytesLoaded() / _root.getBytesTotal()) * 100);
if (loadedPercent < 100) {
mcLoadingAnimated.mcLoading.gotoAndStop(loadedPercent);
mcLoadingAnimated.mcLoading.txtPercentLoaded1 = ("The game is loading (" + loadedPercent) + "%)";
mcLoadingAnimated.mcLoading.txtPercentLoaded2 = ("The game is loading (" + loadedPercent) + "%)";
gotoAndPlay(_currentframe - 1);
} else {
mcLoadingAnimated.play();
stop();
}
Symbol 109 Button
on (release) {
getURL ("http://www.miniclip.com", "_blank");
}
Symbol 110 MovieClip Frame 35
stop();
Symbol 110 MovieClip Frame 40
stop();
_parent.gotoAndPlay("Player Select");
Symbol 114 MovieClip Frame 1
TextOnePlayer.text = _root.gStrTable.get("ONE_PLAYER");
Symbol 118 MovieClip Frame 1
TextTwoPlayers.text = _root.gStrTable.get("TWO_PLAYER");
Symbol 123 MovieClip Frame 1
TextInstructions.text = _root.gStrTable.get("INSTRUCTIONS");
Symbol 129 MovieClip Frame 1
TextYes.text = _root.gStrTable.get("YES");
Symbol 133 MovieClip Frame 1
TextNo.text = _root.gStrTable.get("NO");
Symbol 135 MovieClip Frame 1
function Show(state) {
this._visible = state;
_parent.Pause(true);
}
TextAreYouSure.text = _parent.gStrTable.get("ARE_YOU_SURE");
YesButtonInst.onRelease = function () {
_root.Sfx.Play(_root.SFXID_Beep1, 1);
_parent.Pause(false);
_parent.Back();
_visible = false;
};
NoButtonInst.onRelease = function () {
_root.Sfx.Play(_root.SFXID_Beep1, 1);
_parent.Pause(false);
_visible = false;
};
Symbol 138 MovieClip Frame 1
TextInstructions.text = _root.gStrTable.get("INSTRUCTIONS_BODY");
Symbol 140 MovieClip Frame 1
Text.text = _root.gStrTable.get("ONE_PLAYER_GAME");
Symbol 142 MovieClip Frame 1
Text.text = _root.gStrTable.get("TWO_PLAYER_GAME");
Symbol 144 MovieClip Frame 1
Text.text = _root.gStrTable.get("ONE_PLAYER_INST");
Symbol 146 MovieClip Frame 1
Text.text = _root.gStrTable.get("TWO_PLAYER_INST");
Symbol 165 MovieClip Frame 1
Text.text = _root.gStrTable.get("PLAYER_ONE");
Symbol 167 MovieClip Frame 1
Text.text = _root.gStrTable.get("SELECT_TEAM");
Symbol 168 MovieClip Frame 12
stop();
Symbol 170 MovieClip Frame 1
Text.text = _root.gStrTable.get("PLAYER_TWO");
Symbol 171 MovieClip Frame 12
stop();
Symbol 182 MovieClip Frame 1
stop();
Symbol 182 MovieClip Frame 2
_visible = true;
play();
Symbol 182 MovieClip Frame 15
stop();
Symbol 182 MovieClip Frame 35
_visible = false;
_parent.ShowNextTeam();
Symbol 190 MovieClip Frame 1
stop();
Symbol 190 MovieClip Frame 2
_visible = true;
play();
Symbol 190 MovieClip Frame 15
stop();
Symbol 190 MovieClip Frame 35
_visible = false;
_parent.ShowNextTeam();
Symbol 196 MovieClip Frame 1
stop();
Symbol 196 MovieClip Frame 2
_visible = true;
play();
Symbol 196 MovieClip Frame 15
stop();
Symbol 196 MovieClip Frame 35
_visible = false;
_parent.ShowNextTeam();
Symbol 199 Button
on (release) {
getURL ("http://www.miniclip.com", "_blank");
}
Symbol 205 MovieClip Frame 1
Text.text = _root.gStrTable.get("HUD_PLAYER_ONE");
stop();
Symbol 207 MovieClip Frame 1
Text.text = _root.gStrTable.get("HUD_PLAYER_TWO");
stop();
Symbol 210 MovieClip Frame 1
Text.text = _root.gStrTable.get("QUIT");
stop();
Symbol 212 MovieClip Frame 1
BackInst.onRelease = function () {
_root.Sfx.Play(_root.SFXID_Beep1, 1);
_parent.gQuitDialog.Show(true);
};
Symbol 216 MovieClip Frame 7
stop();
Symbol 216 MovieClip Frame 8
play();
Symbol 216 MovieClip Frame 14
stop();
_parent.ShowNextTrack();
Symbol 220 MovieClip Frame 1
Symbol 220 MovieClip Frame 7
stop();
Symbol 220 MovieClip Frame 13
stop();
_visible = false;
_parent.ShowNextTrack();
Symbol 224 MovieClip Frame 7
stop();
Symbol 224 MovieClip Frame 8
play();
Symbol 224 MovieClip Frame 14
stop();
_parent.ShowNextTrack();
Symbol 228 MovieClip Frame 1
Symbol 228 MovieClip Frame 7
stop();
Symbol 228 MovieClip Frame 13
stop();
_visible = false;
_parent.ShowNextTrack();
Symbol 230 MovieClip Frame 1
Text.text = _root.gStrTable.get("SELECT_TRACK");
Symbol 231 MovieClip Frame 10
stop();
Symbol 261 MovieClip Frame 1
_visible = false;
Symbol 283 MovieClip Frame 1
stop();
Symbol 283 MovieClip Frame 2
play();
Symbol 283 MovieClip Frame 50
stop();
if (_parent.gNumPlayers == 1) {
_parent.GameOver();
}
Symbol 286 MovieClip Frame 1
stop();
Symbol 286 MovieClip Frame 2
play();
Symbol 286 MovieClip Frame 50
stop();
Symbol 295 MovieClip Frame 52
_root.Driver1.FreezeState(false);
_root.Driver2.FreezeState(false);
_root.Sfx.Play(_root.SFXID_Loop1, 9999);
Symbol 295 MovieClip Frame 62
stop();
Symbol 298 MovieClip Frame 1
Text.text = _root.gStrTable.get("ENTER_HIGH_SCORE");
Symbol 301 MovieClip Frame 1
Text.text = _root.gStrTable.get("OK");
Symbol 304 MovieClip Frame 1
Text.text = _root.gStrTable.get("RACE_AGAIN");
Symbol 307 MovieClip Frame 1
Text.text = _root.gStrTable.get("MAIN_MENU");
Symbol 314 MovieClip Frame 1
this._visible = false;
Symbol 330 Button
on (release) {
gameURL = ("http://www.miniclip.com/" + gamename) + ".htm";
getURL (gameURL, "_blank");
}
Instance of Symbol 314 MovieClip "mcHighscores" in Symbol 336 MovieClip Frame 1
onClipEvent (load) {
_visible = false;
}
Symbol 336 MovieClip Frame 2
if (_url.indexOf("miniclip.com") == -1) {
gotoAndStop(_currentframe + 1);
} else {
var noCache = (getTimer() + random(100000));
mcTarget.loadMovie("http://www.miniclip.com/swfcontent/highscore.swf?" + noCache);
stop();
}
Symbol 336 MovieClip Frame 3
stop();
Symbol 338 MovieClip Frame 1
function Show(numPlayers) {
gNumPlayers = numPlayers;
_visible = true;
gotoAndPlay ("Player 1");
}
stop();
score = 0;
track = 0;
playerScore = 0;
gNumPlayers = 0;
gPlayer1Name = "";
gPlayer2Name = "";
Symbol 338 MovieClip Frame 10
stop();
YesButtonInst.onRelease = function () {
var _local1 = _root;
_local1.Sfx.Play(_local1.SFXID_Beep1, 1);
playerScore = _local1.formatTime(_local1.Driver1.finishTime);
currentPlayer = 1;
gotoAndPlay("Hiscores" + (_local1.gTrack + 1));
};
NoButtonInst.onRelease = function () {
var _local1 = _root;
_local1.Sfx.Play(_local1.SFXID_Beep1, 1);
if (gNumPlayers == 2) {
gotoAndPlay ("Player 2");
} else {
_visible = false;
_local1.back();
_local1.gotoAndPlay("Intro");
}
};
Symbol 338 MovieClip Frame 20
stop();
YesButtonInst.onRelease = function () {
var _local1 = _root;
_local1.Sfx.Play(_local1.SFXID_Beep1, 1);
playerScore = _local1.formatTime(_local1.Driver2.finishTime);
currentPlayer = 2;
gotoAndPlay("Hiscores" + (_local1.gTrack + 1));
};
NoButtonInst.onRelease = function () {
var _local1 = _root;
_local1.Sfx.Play(_local1.SFXID_Beep1, 1);
_visible = false;
_local1.back();
gotoAndPlay ("Intro");
};
Symbol 338 MovieClip Frame 30
stop();
trace(_root.gHighScoreDialogInst.playerScore);
if ((currentPlayer == 1) && (gNumPlayers == 2)) {
RaceAgainButtonInst._visible = false;
MenuButtonInst._visible = false;
NextButton._visible = true;
} else {
RaceAgainButtonInst._visible = true;
MenuButtonInst._visible = true;
NextButton._visible = false;
}
NextButton.onRelease = function () {
gotoAndPlay ("Player 2");
};
MenuButtonInst.onRelease = function () {
_visible = false;
_root.back();
_root.gotoAndPlay("Intro");
};
RaceAgainButtonInst.onRelease = function () {
_visible = false;
_root.ResetRace();
};
Instance of Symbol 336 MovieClip "table1" in Symbol 338 MovieClip Frame 30
//component parameters
onClipEvent (initialize) {
scoreLocation = "_root.gHighScoreDialogInst.playerScore";
gamename = "caravan1";
saveScore = true;
scoreIsTime = true;
scoreReversed = false;
negativeScoreAllowed = false;
}
Symbol 338 MovieClip Frame 40
stop();
if ((currentPlayer == 1) && (gNumPlayers == 2)) {
RaceAgainButtonInst._visible = false;
MenuButtonInst._visible = false;
NextButton._visible = true;
} else {
RaceAgainButtonInst._visible = true;
MenuButtonInst._visible = true;
NextButton._visible = false;
}
NextButton.onRelease = function () {
gotoAndPlay ("Player 2");
};
MenuButtonInst.onRelease = function () {
_visible = false;
_root.back();
_root.gotoAndPlay("Intro");
};
RaceAgainButtonInst.onRelease = function () {
_visible = false;
_root.ResetRace();
};
Instance of Symbol 336 MovieClip "table2" in Symbol 338 MovieClip Frame 40
//component parameters
onClipEvent (initialize) {
scoreLocation = "_root.gHighScoreDialogInst.playerScore";
gamename = "caravan2";
saveScore = true;
scoreIsTime = true;
scoreReversed = false;
negativeScoreAllowed = false;
}
Symbol 338 MovieClip Frame 50
stop();
if ((currentPlayer == 1) && (gNumPlayers == 2)) {
RaceAgainButtonInst._visible = false;
MenuButtonInst._visible = false;
NextButton._visible = true;
} else {
RaceAgainButtonInst._visible = true;
MenuButtonInst._visible = true;
NextButton._visible = false;
}
NextButton.onRelease = function () {
gotoAndPlay ("Player 2");
};
MenuButtonInst.onRelease = function () {
_visible = false;
_root.back();
_root.gotoAndPlay("Intro");
};
RaceAgainButtonInst.onRelease = function () {
_visible = false;
_root.ResetRace();
};
Instance of Symbol 336 MovieClip "table3" in Symbol 338 MovieClip Frame 50
//component parameters
onClipEvent (initialize) {
scoreLocation = "_root.gHighScoreDialogInst.playerScore";
gamename = "caravan3";
saveScore = true;
scoreIsTime = true;
scoreReversed = false;
negativeScoreAllowed = false;
}
Symbol 338 MovieClip Frame 60
stop();
if ((currentPlayer == 1) && (gNumPlayers == 2)) {
RaceAgainButtonInst._visible = false;
MenuButtonInst._visible = false;
NextButton._visible = true;
} else {
RaceAgainButtonInst._visible = true;
MenuButtonInst._visible = true;
NextButton._visible = false;
}
NextButton.onRelease = function () {
gotoAndPlay ("Player 2");
};
MenuButtonInst.onRelease = function () {
_visible = false;
_root.back();
_root.gotoAndPlay("Intro");
};
RaceAgainButtonInst.onRelease = function () {
_visible = false;
_root.ResetRace();
};
Instance of Symbol 336 MovieClip "Table4" in Symbol 338 MovieClip Frame 60
//component parameters
onClipEvent (initialize) {
scoreLocation = "_root.gHighScoreDialogInst.playerScore";
gamename = "caravan4";
saveScore = true;
scoreIsTime = true;
scoreReversed = false;
negativeScoreAllowed = false;
}
Symbol 342 MovieClip Frame 1
function StartEngine() {
SFXStart.start(0, 1);
}
function Increase() {
SFXIdle.stop();
SFXInc.start(d, 1);
}
function Decrease() {
var d;
SFXIdle.stop();
SFXDec.start(0, 1);
}
function SetKeys(up, down, left, right, space) {
KeyUp = up;
KeyDown = down;
KeyLeft = left;
KeyRight = right;
KeySpace = space;
}
function SetHornType(hornID) {
switch (hornID) {
case 0 :
HornSFX = SFXHorn1;
return;
case 1 :
HornSFX = SFXHorn2;
return;
case 2 :
HornSFX = SFXHorn3;
}
}
function Stop() {
SFXIdle.stop();
SFXStart.stop();
SFXInc.stop();
SFXLoop.stop();
SFXDec.stop();
}
SFXStart = new Sound(this);
SFXStart.attachSound("basestartup.wav");
SFXStart.setVolume(20);
SFXIdle = new Sound(this);
SFXIdle.attachSound("idle.wav");
SFXIdle.setVolume(20);
SFXInc = new Sound(this);
SFXInc.attachSound("increase.wav");
SFXInc.setVolume(20);
SFXLoop = new Sound(this);
SFXLoop.attachSound("loop.wav");
SFXLoop.setVolume(20);
SFXDec = new Sound(this);
SFXDec.attachSound("basedec.wav");
SFXHornClip = createEmptyMovieClip("hrn", 100);
SFXHorn1 = new Sound(SFXHornClip);
SFXHorn1.attachSound("horn01.wav");
SFXHorn2 = new Sound(SFXHornClip);
SFXHorn2.attachSound("horn02.wav");
SFXHorn3 = new Sound(SFXHornClip);
SFXHorn3.attachSound("horn03.wav");
SFXHorn3.setVolume(80);
SFXStart.onSoundComplete = function () {
SFXIdle.start(0, 99999);
};
SFXInc.onSoundComplete = function () {
SFXLoop.start(0, 99999);
};
SFXDec.onSoundComplete = function () {
SFXIdle.start(0, 99999);
};
KeyUp = 0;
KeyDown = 0;
KeyLeft = 0;
KeyRight = 0;
KeySpace = 0;
HornSFX = -1;
lastKey = -1;
onKeyDown = function () {
if ((Key.getCode() == KeyUp) && (lastKey != KeyUp)) {
Increase();
}
if ((Key.getCode() == KeyDown) && (lastKey != KeyDown)) {
_parent.SFX_Reverse.start(0, 999);
}
if ((Key.getCode() == KeySpace) && (lastKey != KeySpace)) {
HornSFX.start(0, 1);
}
lastKey = Key.getCode();
};
onKeyUp = function () {
if (Key.getCode() == KeyUp) {
Decrease();
lastKey = -1;
}
if (Key.getCode() == KeyDown) {
_parent.SFX_Reverse.stop();
lastKey = -1;
}
if (Key.getCode() == KeySpace) {
lastKey = -1;
}
};