Frame 1
function fLoading(percent) {
loader.gotoAndStop(percent);
}
function fLoadEnded() {
gotoAndStop ("Init");
}
stop();
_focusrect = false;
Stage.showMenu = false;
var preload = new Preloader(_root.getBytesTotal());
Instance of Symbol 44 MovieClip "loader" in Frame 1
onClipEvent (load) {
this.onEnterFrame = function () {
_parent.preload.fLoadAction(_root.getBytesLoaded());
};
}
Instance of Symbol 48 MovieClip in Frame 8
onClipEvent (load) {
this = new jt3_Ctrl(this);
}
Instance of Symbol 81 MovieClip in Frame 8
onClipEvent (load) {
trace("load sound file...");
_global.S = this;
_global.S._visible = false;
Items = new Object();
G_TabSonFade = new Array();
Mute = false;
Controlled = new Array("sndBtn", "sndMusicPackaging", "sndMusicInGame", "sndFxTruckMoving", "sndFxTruckShield", "sndFxTruckLaserGun", "sndFxTruckHurt", "sndFxSafetyCone", "sndFxImpactWood", "sndFxSewerClose", "sndFxSewerOpen", "sndFxPowerUp", "sndFxLaserBeam", "sndFxHeadFlame", "sndFxTractorBeam", "sndFxArmGunLoad", "sndFxArmGunFire", "sndFxTractorGrab", "sndFxTentacleGrab", "sndFxTentacleRetract", "sndFxTentacleComeBack", "sndFxTentacleAttack", "sndFxTentaclePunch", "sndFxDestructoExplosion", "sndFxHandExplosion", "sndFxArmGunExplosion", "sndFxHurtSurlyExplosion", "sndFxTruckExplosion", "sndFxSurlyFinalExplosion", "sndFxReadyGo", "sndFxLevelClear");
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();
}
Instance of Symbol 87 MovieClip in Frame 8
onClipEvent (keyDown) {
_global.C.KeyDown();
}
onClipEvent (keyUp) {
_global.C.KeyUp();
}
Instance of Symbol 91 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("jt_hour3");
}
function getScoreString() {
var _local5 = "Oops! The high score list isn't available right now!";
var _local8 = 28;
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.txt_highScore.text = getScoreString();
}
function cbFunc(thisBool) {
if (thisBool) {
listScores();
} else {
if (G_TestHighScore == true) {
trace("CBfunc y\u00E9 false...");
}
_parent.txt_highScore.text = "Oops! The high score list isn\u2019t available right now!";
}
}
function cbFunc2(thisBool) {
if (thisBool) {
listScores();
} else {
_parent.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);
}
}
Frame 9
stop();
trace("PlaySound music");
_focusrect = false;
gotoAndStop ("TitlePage");
Instance of Symbol 116 MovieClip "FenceYellowBarrier" in Frame 9
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 123 MovieClip "FenceSafetyCone" in Frame 9
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 134 MovieClip "FenceOpenSewer" in Frame 9
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 138 MovieClip "FenceCloseSewer" in Frame 9
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 164 MovieClip "PowerUpShield" in Frame 9
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 178 MovieClip "PowerUpExtraLife" in Frame 9
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 197 MovieClip "PowerUpBattery" in Frame 9
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 210 MovieClip "PowerUpRepair" in Frame 9
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 291 MovieClip "Friend" in Frame 9
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 398 MovieClip "Truck0" in Frame 9
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 470 MovieClip "Truck1" in Frame 9
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 541 MovieClip "Truck2" in Frame 9
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 602 MovieClip "Tentacle_FrontTop" in Frame 9
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 603 MovieClip "Tentacle_FrontBottom" in Frame 9
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 679 MovieClip "Tentacle_BackTop" in Frame 9
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 680 MovieClip "Tentacle_BackBottom" in Frame 9
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 794 MovieClip "GunBullet" in Frame 9
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 801 MovieClip "DestructoShipBottom" in Frame 9
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 801 MovieClip "DestructoShipTop" in Frame 9
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 44 MovieClip "loader" in Frame 9
/* no clip actions */
Instance of Symbol 851 MovieClip "Hud" in Frame 9
onClipEvent (load) {
this._visible = false;
}
Frame 18
stop();
_global.CS.Hud.Score.text = 0;
_global.S.UndoMute();
_global.S.PlaySound("sndMusicPackaging", 100, 9999);
Frame 26
stop();
Frame 34
stop();
Frame 42
stop();
Frame 50
stop();
Frame 58
stop();
_global.S.UndoMute();
_global.S.StopSound("sndFxTruckMoving");
_global.S.StopSound("sndMusicInGame");
_global.S.PlaySound("sndMusicPackaging", 100, 9999);
var nScore = _global.C.oScoreMng.GetCurrentScore();
trace("Your score is : " + nScore);
_global.CS.YouWin.Pts.text = nScore;
_global.HS.initHiScores();
if (gProxyObj.getIsLoggedIn()) {
btn_submit_score._visible = true;
} else {
btn_submit_score._visible = false;
}
if (_global.HS.G_ShowHighScore == false) {
btn_submit_score._visible = false;
btn_view_score._visible = false;
}
Frame 66
stop();
_global.S.UndoMute();
_global.S.StopSound("sndFxTruckMoving");
_global.S.StopSound("sndMusicInGame");
_global.S.PlaySound("sndMusicPackaging", 100, 9999);
var nScore = _global.C.oScoreMng.GetCurrentScore();
trace("Your score is : " + nScore);
_global.CS.Loose.Pts.text = nScore;
_global.HS.initHiScores();
if (gProxyObj.getIsLoggedIn()) {
btn_submit_score._visible = true;
} else {
btn_submit_score._visible = false;
}
if (_global.HS.G_ShowHighScore == false) {
btn_submit_score._visible = false;
btn_view_score._visible = false;
}
Frame 74
stop();
var nScore = _global.C.oScoreMng.GetCurrentScore();
_global.CS.YourScore.text = nScore;
if (gProxyObj.getIsLoggedIn()) {
btn_submit_score._visible = true;
} else {
btn_submit_score._visible = false;
}
if (_global.C.G_SubmitScore == true) {
_global.HS.submitScore(nScore);
btn_submit_score._visible = false;
} else {
_global.HS.getScores();
}
Instance of Symbol 1025 MovieClip "ControlScroll" in Frame 74
onClipEvent (load) {
scrollUp = false;
scrollDown = false;
}
onClipEvent (enterFrame) {
if (scrollUp == true) {
_parent.txt_highScore.scroll--;
} else if (scrollDown == true) {
_parent.txt_highScore.scroll++;
}
}
Frame 82
stop();
_global.S.StopSound("sndFxTruckMoving");
_global.CS.Hud._visible = false;
_global.CS.TransitionAnim.onEnterFrame = function () {
if (this._currentframe == 35) {
_global.S.StopSound("sndMusicInGame");
_global.CS.gotoAndStop("TransitEnd");
}
};
Frame 83
stop();
_global.S.PlaySound("sndMusicPackaging", 100, 9999);
_global.CS.Transit.LevelNumberFront.text = _global.C.nGameLevelCur + 1;
_global.CS.Transit.LevelNumberBack.text = _global.C.nGameLevelCur + 1;
var nScore = _global.C.oScoreMng.GetCurrentScore();
trace("Your score is : " + nScore);
var nTotalToSaved = _global.C.oScoreMng.GetTotalToSaved();
_global.CS.Transit.ScoreBoard.TotalToSaved.text = nTotalToSaved;
_global.CS.Transit.ScoreBoard.Pts.text = 0;
var nInitialScore = _global.C.oScoreMng.GetInitialScore();
_global.CS.Transit.ScoreBoard.InitialScore.text = nInitialScore;
var nbFriendsRescuedExtra = _global.C.oScoreMng.GetNbOfFriendsRescuedExtra();
_global.CS.Transit.ScoreBoard.ExtraFriends.text = nbFriendsRescuedExtra;
var nbFriendsRecuedByTruck = _global.C.oScoreMng.GetNbOfFriendsRescuedByTruck();
_global.CS.Transit.ScoreBoard.RescuedFriends.text = nbFriendsRecuedByTruck;
var nbPowerUpsCollected = _global.C.oScoreMng.GetNbOfPowerUpsCollected();
_global.CS.Transit.ScoreBoard.PowerUps.text = nbPowerUpsCollected;
var nNbOfHitsOnSurlyHead = _global.C.oScoreMng.GetNbOfHitsOnSurlyHead();
_global.CS.Transit.ScoreBoard.SurlyHits.text = nNbOfHitsOnSurlyHead;
var nCummulatedScore = _global.C.oScoreMng.GetCummulatedScore();
_global.CS.Transit.ScoreBoard.TotalScore.text = nCummulatedScore;
_global.CS.Transit.Pts.text = nCummulatedScore;
_global.CS.Hud.Score.text = nCummulatedScore;
Instance of Symbol 1061 MovieClip "Transit" in Frame 83
/* no clip actions */
Frame 92
stop();
_global.S.StopSound("sndMusicPackaging");
_global.S.PlaySound("sndMusicInGame", 70, 9999);
Symbol 1153 MovieClip [__Packages.Preloader] Frame 0
class Preloader
{
function Preloader (mcTotalBytes) {
vTotalBytes = mcTotalBytes;
}
function fLoadAction(mcBytesLoaded) {
vLoadedBytes = mcBytesLoaded;
if (vLoadedBytes == vTotalBytes) {
_root.fLoadEnded();
} else {
vPercentage = Math.round(100 * (vLoadedBytes / vTotalBytes));
_root.fLoading(vPercentage);
}
}
var vTotalBytes = 0;
var vLoadedBytes = 0;
var vPercentage = 0;
}
Symbol 1154 MovieClip [__Packages.jt3_Ctrl] Frame 0
class jt3_Ctrl extends MovieClip
{
var mcRef, aMovingObjects, aStreetObjects, oFriendOnStreet, oFenceOnStreet, oPowerUpOnStreet, bLastFriendSaveFromTentacle, bLevelCompleted, nGameLevelCur, nbPlayerPts, nbPlayerPtsPrev, oScoreMng, nStateBattleLevel5, nNbOfHitsOnSurlyHead, nNbOfHitsOnSurlyHandLeft, nNbOfHitsOnSurlyHandRight, nNbOfHitsOnSurlyArmGunLeft, nNbOfHitsOnSurlyArmGunRight, nTracktorBeamXSpeedReducer, nTracktorBeamYSpeedReducer, bGameInit, bMuteSoundOn, bTentacleGrabAFriend, bTruckRecuedFriend, strGamePlayLabelCur, strGamePlayLabelPrev, oSurlyTheVillain, oSurlyHeadFlame, oTentacleFrontTop, oTentacleFrontBottom, nGameStateIDCur, nWaitGameStateTimeOut, oTentacleBackTop, oSurlyRightGrabBeam, oTentacleBackBottom, oSurlyLeftGrabBeam, oAi, oPlayerBullet, oPlayer, oStreetGenerator, oSurlyLeftArmGun, oSurlyRightArmGun, oSurlyLeftTractorBeam, oSurlyRightTractorBeam, nGameStateIDSaved, bGamePaused;
function jt3_Ctrl (l_mcRef) {
super();
mcRef = l_mcRef;
mcRef._visible = false;
_global.C = this;
_global.CS = mcRef._parent;
aMovingObjects = new Array();
aStreetObjects = new Array();
oFriendOnStreet = null;
oFenceOnStreet = null;
oPowerUpOnStreet = null;
bLastFriendSaveFromTentacle = new Boolean(false);
bLevelCompleted = new Boolean(false);
nGameLevelCur = 0;
nbPlayerPts = 0;
nbPlayerPtsPrev = -1;
oScoreMng = new jt3_ScoreManager();
nStateBattleLevel5 = 0;
nNbOfHitsOnSurlyHead = 0;
nNbOfHitsOnSurlyHandLeft = 0;
nNbOfHitsOnSurlyHandRight = 0;
nNbOfHitsOnSurlyArmGunLeft = 0;
nNbOfHitsOnSurlyArmGunRight = 0;
nTracktorBeamXSpeedReducer = 0;
nTracktorBeamYSpeedReducer = 0;
bGameInit = new Boolean(false);
bMuteSoundOn = new Boolean(false);
CreateObjects();
bTentacleGrabAFriend = new Boolean(false);
bTruckRecuedFriend = new Boolean(false);
strGamePlayLabelCur = new String();
strGamePlayLabelPrev = new String();
bMuteSoundOn = new Boolean(false);
}
function CheckHitTruckLaserGun() {
var _local6;
var _local5;
var _local3 = new Boolean(false);
var _local4;
_local3 = _global.C.oPlayerBullet.IsObjectMoving();
if (_local3 == true) {
_local6 = _global.C.oPlayerBullet.GetObjectMcRef();
_local5 = _global.C.oSurlyHeadFlame.GetObjectMcRef();
if (_local5.Obj.HitRegion.hitTest(_local6)) {
_global.C.oPlayerBullet.StopBullet();
_global.C.oSurlyHeadFlame.SetAnimState("Hurt");
_global.S.PlaySound("sndFxHurtSurlyExplosion", 100, 1);
if (bTentacleGrabAFriend == true) {
nNbOfHitsOnSurlyHead++;
}
_global.C.oScoreMng.AddPoints(PTS_HIT_ON_SURLY_HEAD);
if (nNbOfHitsOnSurlyHead >= HEAD_FLAMES_MAX_HITS1) {
_local4 = _global.C.oFriendOnStreet.GetObjectMcRef();
if (bTentacleGrabAFriend == true) {
if (_local4._y < STAGE_Y_MIDDLE_POS) {
_global.C.oTentacleBackTop.SetAnimState("Release");
} else {
_global.C.oTentacleBackBottom.SetAnimState("Release");
}
nNbOfHitsOnSurlyHead = 0;
_global.C.oFriendOnStreet.SetAnimState("Release");
_global.C.oScoreMng.AddPoints(PTS_FRIEND_RESCUED_BY_TRUCK);
_global.C.SetCurrentHudFriendState("Saved");
bLastFriendSaveFromTentacle = true;
} else {
nNbOfHitsOnSurlyHead = 0;
}
}
}
}
}
function CheckHitHeadLevel5() {
var _local5;
var _local4;
var _local3 = new Boolean(false);
_local3 = _global.C.oPlayerBullet.IsObjectMoving();
if (_local3 == true) {
_local5 = _global.C.oPlayerBullet.GetObjectMcRef();
_local4 = _global.C.oSurlyHeadFlame.GetObjectMcRef();
if (nNbOfHitsOnSurlyHead >= 0) {
if (_local4.Obj.HitRegion.hitTest(_local5)) {
_global.C.oPlayerBullet.StopBullet();
_global.C.oSurlyHeadFlame.SetAnimState("Hurt");
_global.S.PlaySound("sndFxHurtSurlyExplosion", 100, 1);
if (nStateBattleLevel5 < 3) {
_global.C.oScoreMng.AddPoints(PTS_HIT_ON_SURLY_HEAD);
} else {
nNbOfHitsOnSurlyHead++;
_global.C.oScoreMng.AddPoints(PTS_HIT_ON_SURLY_HEAD);
if ((nNbOfHitsOnSurlyHead >= HEAD_FLAMES_MAX_HITS2) && (nStateBattleLevel5 < 4)) {
nStateBattleLevel5 = 4;
nNbOfHitsOnSurlyHead = -1;
}
}
}
}
}
}
function CheckHitHandLevel5() {
var _local4;
var _local5;
var _local6;
var _local3 = new Boolean(false);
_local3 = _global.C.oPlayerBullet.IsObjectMoving();
if (_local3 == true) {
_local4 = _global.C.oPlayerBullet.GetObjectMcRef();
_local5 = _global.C.oSurlyLeftTractorBeam.GetObjectMcRef();
_local6 = _global.C.oSurlyRightTractorBeam.GetObjectMcRef();
if (nNbOfHitsOnSurlyHandLeft >= 0) {
if (_local5.Obj.HitRegion.hitTest(_local4)) {
_global.C.oPlayerBullet.StopBullet();
nNbOfHitsOnSurlyHandLeft++;
_global.C.oScoreMng.AddPoints(PTS_HIT_ON_SURLY_HEAD);
if (nNbOfHitsOnSurlyHandLeft >= HEAD_HAND_MAX_HITS) {
_global.C.oSurlyLeftTractorBeam.SetAnimState("Die");
_global.S.PlaySound("sndFxHandExplosion", 100, 1);
nNbOfHitsOnSurlyHandLeft = -1;
} else {
_global.C.oSurlyLeftTractorBeam.SetAnimState("Hurt");
_global.S.PlaySound("sndFxHurtSurlyExplosion", 100, 1);
}
}
}
if (nNbOfHitsOnSurlyHandRight >= 0) {
if (_local6.Obj.HitRegion.hitTest(_local4)) {
_global.C.oPlayerBullet.StopBullet();
nNbOfHitsOnSurlyHandRight++;
_global.C.oScoreMng.AddPoints(PTS_HIT_ON_SURLY_HEAD);
if (nNbOfHitsOnSurlyHandRight >= HEAD_HAND_MAX_HITS) {
_global.C.oSurlyRightTractorBeam.SetAnimState("Die");
_global.S.PlaySound("sndFxHandExplosion", 100, 1);
nNbOfHitsOnSurlyHandRight = -1;
} else {
_global.C.oSurlyRightTractorBeam.SetAnimState("Hurt");
_global.S.PlaySound("sndFxHurtSurlyExplosion", 100, 1);
}
}
}
if ((nNbOfHitsOnSurlyHandLeft < 0) && (nNbOfHitsOnSurlyHandRight < 0)) {
nStateBattleLevel5 = 2;
}
}
}
function CheckHitArmGunLevel5() {
var _local4;
var _local5;
var _local6;
var _local3 = new Boolean(false);
_local3 = _global.C.oPlayerBullet.IsObjectMoving();
if (_local3 == true) {
_local4 = _global.C.oPlayerBullet.GetObjectMcRef();
_local5 = _global.C.oSurlyLeftArmGun.GetObjectMcRef();
_local6 = _global.C.oSurlyRightArmGun.GetObjectMcRef();
if (nNbOfHitsOnSurlyArmGunLeft >= 0) {
if (_local5.Obj.HitRegion.hitTest(_local4)) {
_global.C.oPlayerBullet.StopBullet();
nNbOfHitsOnSurlyArmGunLeft++;
_global.C.oScoreMng.AddPoints(PTS_HIT_ON_SURLY_HEAD);
if (nNbOfHitsOnSurlyArmGunLeft >= HEAD_ARMGUN_MAX_HITS) {
_global.C.oSurlyLeftArmGun.SetAnimState("Die");
_global.S.PlaySound("sndFxArmGunExplosion", 100, 1);
nNbOfHitsOnSurlyArmGunLeft = -1;
} else {
_global.C.oSurlyLeftArmGun.SetAnimState("Hurt");
_global.S.PlaySound("sndFxHurtSurlyExplosion", 100, 1);
}
}
}
if (nNbOfHitsOnSurlyArmGunRight >= 0) {
if (_local6.Obj.HitRegion.hitTest(_local4)) {
_global.C.oPlayerBullet.StopBullet();
nNbOfHitsOnSurlyArmGunRight++;
_global.C.oScoreMng.AddPoints(PTS_HIT_ON_SURLY_HEAD);
if (nNbOfHitsOnSurlyArmGunRight >= HEAD_ARMGUN_MAX_HITS) {
_global.C.oSurlyRightArmGun.SetAnimState("Die");
_global.S.PlaySound("sndFxArmGunExplosion", 100, 1);
nNbOfHitsOnSurlyArmGunRight = -1;
} else {
_global.C.oSurlyRightArmGun.SetAnimState("Hurt");
_global.S.PlaySound("sndFxHurtSurlyExplosion", 100, 1);
}
}
}
if ((nNbOfHitsOnSurlyArmGunLeft < 0) && (nNbOfHitsOnSurlyArmGunRight < 0)) {
nStateBattleLevel5 = 3;
nNbOfHitsOnSurlyHead = 0;
}
}
}
function CheckHitLaserGunWithAllPartsOfSurly() {
var _local4;
var _local6;
var _local3 = new Boolean(false);
var _local5;
_local3 = _global.C.oPlayerBullet.IsObjectMoving();
if (_local3 == true) {
_local4 = _global.C.oPlayerBullet.GetObjectMcRef();
switch (_global.C.nStateBattleLevel5) {
case 1 :
_global.C.CheckHitHeadLevel5();
_global.C.CheckHitHandLevel5();
break;
case 2 :
_global.C.CheckHitHeadLevel5();
_global.C.CheckHitArmGunLevel5();
break;
case 3 :
_global.C.CheckHitHeadLevel5();
break;
case 4 :
DoSurlyExplosion();
}
}
}
function ClearStreetObjects() {
bTentacleGrabAFriend = false;
bTruckRecuedFriend = false;
var _local2;
if (oFriendOnStreet != null) {
_local2 = oFriendOnStreet.GetObjectMcRef();
_local2._visible = false;
delete oFriendOnStreet;
oFriendOnStreet = null;
}
if (oFenceOnStreet != null) {
_local2 = oFenceOnStreet.GetObjectMcRef();
_local2._visible = false;
delete oFenceOnStreet;
oFenceOnStreet = null;
}
if (oPowerUpOnStreet != null) {
_local2 = oPowerUpOnStreet.GetObjectMcRef();
_local2._visible = false;
delete oPowerUpOnStreet;
oPowerUpOnStreet = null;
}
if (nGameLevelCur == LAST_LEVEL_NUMBER) {
nNbOfHitsOnSurlyHead = 0;
nNbOfHitsOnSurlyHandLeft = 0;
nNbOfHitsOnSurlyHandRight = 0;
nNbOfHitsOnSurlyArmGunLeft = 0;
nNbOfHitsOnSurlyArmGunRight = 0;
}
}
function DoSurlyExplosion() {
oSurlyTheVillain.SetAnimState("Die");
_global.C.oPlayer.ResetCtrlAndSpaceKeyDown();
oSurlyHeadFlame.SetAnimState("Die");
oTentacleFrontTop.SetAnimState("Die");
oTentacleFrontBottom.SetAnimState("Die");
_global.S.PlaySound("sndFxSurlyFinalExplosion", 100, 1);
nGameStateIDCur = GAME_STATE_YOUWIN_ID;
nWaitGameStateTimeOut = 120;
}
function InitHudDisplay() {
var _local3;
_global.CS.Hud._visible = true;
_global.CS.Hud.HelpBtn.gotoAndStop(1);
_global.CS.Hud.MuteBtn.gotoAndStop(1);
_global.CS.Hud.QuitBtn.gotoAndStop(1);
_global.CS.Hud.NbLifes.text = nbPlayerLifesCur;
_local3 = 1;
while (_local3 <= 10) {
_global.CS.Hud["Friend" + _local3].Obj.gotoAndStop("Extra");
_local3++;
}
if (nGameLevelCur == 1) {
_global.CS.Hud.Score.text = nbPlayerPts;
oScoreMng.SetTotalToSaved(6);
_local3 = 1;
while (_local3 <= 6) {
_global.CS.Hud["Friend" + _local3].Obj.gotoAndStop("ToSave");
_local3++;
}
}
if (nGameLevelCur == 2) {
oScoreMng.SetTotalToSaved(7);
_local3 = 1;
while (_local3 <= 7) {
_global.CS.Hud["Friend" + _local3.toString()].Obj.gotoAndStop("ToSave");
_local3++;
}
}
if (nGameLevelCur == 3) {
oScoreMng.SetTotalToSaved(8);
_local3 = 1;
while (_local3 <= 8) {
_global.CS.Hud["Friend" + _local3.toString()].Obj.gotoAndStop("ToSave");
_local3++;
}
}
if (nGameLevelCur == 4) {
oScoreMng.SetTotalToSaved(9);
_local3 = 1;
while (_local3 <= 9) {
_global.CS.Hud["Friend" + _local3.toString()].Obj.gotoAndStop("ToSave");
_local3++;
}
}
if (nGameLevelCur == 5) {
oScoreMng.SetTotalToSaved(0);
}
}
function TentacleGrabFriend(l_nScreenPos) {
var _local5;
var _local3;
nNbOfHitsOnSurlyHead = 0;
oFriendOnStreet.SetAnimState("Grab");
_local3 = oFriendOnStreet.GetFriendBitmapIndex();
if (l_nScreenPos == 0) {
oTentacleBackTop.SetAnimState("Grab");
_global.S.PlaySound("sndFxTentacleGrab", 100, 1);
oTentacleBackTop.SetFriendBitmapIndex(_local3);
oSurlyRightGrabBeam.SetAnimState("GrabInit");
_global.S.PlaySound("sndFxTractorGrab", 100, 1);
} else {
oTentacleBackBottom.SetAnimState("Grab");
_global.S.PlaySound("sndFxTentacleGrab", 100, 1);
oTentacleBackBottom.SetFriendBitmapIndex(_local3);
oSurlyLeftGrabBeam.SetAnimState("GrabInit");
_global.S.PlaySound("sndFxTractorGrab", 100, 1);
}
}
function UpdateHudDisplay() {
nbPlayerPts = oScoreMng.GetCurrentScore();
if (nbPlayerPts != nbPlayerPtsPrev) {
_global.CS.Hud.Score.text = nbPlayerPts;
nbPlayerPtsPrev = nbPlayerPts;
}
}
function AddPlayerExtraLife() {
nbPlayerLifesCur++;
if (nbPlayerLifesCur > 9) {
nbPlayerLifesCur = 9;
}
_global.CS.Hud.NbLifes.text = nbPlayerLifesCur;
}
function DeleteAllMovingObjects() {
var _local3;
var _local7 = new Boolean();
var _local2;
var _local8;
var _local4 = new String();
for (_local3 in _global.C.aMovingObjects) {
if (_global.C.aMovingObjects[_local3] != undefined) {
_local7 = _global.C.aMovingObjects[_local3].GetActiveFlag();
if (_local7 == true) {
_local2 = _global.C.aMovingObjects[_local3];
_local8 = _local2.GetObjectMcRef();
_local4 = _local2.GetType();
_local4 = "Missile";
if (_local4) {
var _local6;
trace("Missile desactivated !!!");
_local6 = jt3_SurlyMissile(_local2);
_local6.SetAnimState("Die");
}
_local4 = "DestructoShip";
if (_local4) {
var _local5;
trace("DestructoShip desactivated !!!");
_local5 = jt3_SurlyDestructoShip(_local2);
_local5.SetAnimState("Die");
}
}
}
}
}
function RemoveOneLifeToPlayer() {
nbPlayerLifesCur--;
if (fromInstruct) {
fromInstruct = false;
nbPlayerLifesCur++;
}
if (nbPlayerLifesCur <= 0) {
nGameStateIDCur = GAME_STATE_GAMEOVER_ID;
_global.C.oPlayer.HideTruck();
_global.C.oPlayer.ResetCtrlAndSpaceKeyDown();
_global.C.oAi.Stop();
_global.C.ClearStreetObjects();
_global.CS.LooseLifeTransition.gotoAndStop("Play");
_global.S.PlaySound("sndFxTruckExplosion", 100, 1);
nWaitGameStateTimeOut = 120;
} else {
nGameStateIDCur = GAME_STATE_LOOSE_ONE_LIFE_ID;
_global.C.oPlayer.HideTruck();
_global.C.oPlayer.ResetCtrlAndSpaceKeyDown();
_global.C.oAi.Stop();
_global.C.ClearStreetObjects();
if (nGameLevelCur < LAST_LEVEL_NUMBER) {
_global.C.oTentacleBackTop.Init();
_global.C.oTentacleBackBottom.Init();
}
if (nGameLevelCur == LAST_LEVEL_NUMBER) {
_global.C.oTentacleFrontTop.RetractAndStop();
_global.C.oTentacleFrontBottom.RetractAndStop();
ResetSurlyParts();
}
_global.CS.LooseLifeTransition.gotoAndStop("Play");
_global.S.PlaySound("sndFxTruckExplosion", 100, 1);
nWaitGameStateTimeOut = 120;
}
}
function DestructoShipHurtSurly() {
_global.C.oSurlyHeadFlame.SetAnimState("Hurt");
_global.S.PlaySound("sndFxDestructoExplosion", 100, 1);
_global.C.oScoreMng.AddPoints(PTS_HIT_ON_SURLY_HEAD);
}
function CreateAI() {
oAi = new jt3_Ai();
}
function CreateBackTentacles() {
oTentacleBackTop = new jt3_BackTentacle(_global.CS.Tentacle_BackTop);
oTentacleBackBottom = new jt3_BackTentacle(_global.CS.Tentacle_BackBottom);
}
function CreateFrontTentacles() {
oTentacleFrontTop = new jt3_FrontTentacle(_global.CS.Tentacle_FrontTop, _global.CS.DestructoShipTop);
oTentacleFrontBottom = new jt3_FrontTentacle(_global.CS.Tentacle_FrontBottom, _global.CS.DestructoShipBottom);
}
function CreatePlayerBullet() {
oPlayerBullet = new jt3_PlayerBullet(_global.CS.GunBullet);
}
function CreateJimmyAndTimmyPlayer() {
oPlayer = new jt3_Player(_global.CS.Truck0);
}
function CreateStreetGenerator() {
oStreetGenerator = new jt3_StreetObjectGenerator();
}
function CreateSurlyTheVillain() {
oSurlyTheVillain = new jt3_SurlyTheVillain(_global.CS.Surly.Body, _global.CS.Surly.LeftShoulder);
oSurlyHeadFlame = new jt3_SurlyHeadFlame(_global.CS.Surly.HeadFlame);
oSurlyLeftArmGun = new jt3_SurlyArmGun(_global.CS.Surly.LeftArmGun, _global.CS.Surly.LeftArmMissile);
oSurlyRightArmGun = new jt3_SurlyArmGun(_global.CS.Surly.RightArmGun, _global.CS.Surly.RightArmMissile);
oSurlyLeftTractorBeam = new jt3_SurlyTractorBeam(_global.CS.Surly.LeftHandTractorBeam);
oSurlyRightTractorBeam = new jt3_SurlyTractorBeam(_global.CS.Surly.RightHandTractorBeam);
oSurlyLeftGrabBeam = new jt3_SurlyGrabBeam(_global.CS.Surly.LeftGrabBeam);
oSurlyRightGrabBeam = new jt3_SurlyGrabBeam(_global.CS.Surly.RightGrabBeam);
CreateBackTentacles();
CreateFrontTentacles();
}
function EndLevel() {
if (nGameLevelCur < LAST_LEVEL_NUMBER) {
mcRef.onEnterFrame = null;
_global.CS.LevelClear.gotoAndStop("Idle");
_global.C.oPlayer.HideTruck();
_global.C.ClearStreetObjects();
_global.CS.gotoAndStop("TransitStart");
}
}
function DoPlayLevel1To4() {
if (_global.C.nGameStateIDCur == _global.C.GAME_STATE_PLAY_LEVEL1TO4_ID) {
_global.C.oStreetGenerator.EnterFrame();
}
_global.C.StreetObjectsEnterFrame();
_global.C.oTentacleBackTop.EnterFrame();
_global.C.oTentacleBackBottom.EnterFrame();
_global.C.oPlayer.EnterFrame();
_global.C.oPlayerBullet.EnterFrame();
_global.C.UpdateMovingObjects();
if (_global.C.nGameStateIDCur == _global.C.GAME_STATE_PLAY_LEVEL1TO4_ID) {
_global.C.CheckHitTruckLaserGun();
_global.C.oAi.EnterFrame();
_global.C.oSurlyTheVillain.EnterFrame();
}
_global.C.oSurlyHeadFlame.EnterFrame();
_global.C.oSurlyLeftArmGun.EnterFrame();
_global.C.oSurlyRightArmGun.EnterFrame();
_global.C.oSurlyLeftTractorBeam.EnterFrame();
_global.C.oSurlyRightTractorBeam.EnterFrame();
_global.C.oSurlyLeftGrabBeam.EnterFrame();
_global.C.oSurlyRightGrabBeam.EnterFrame();
_global.C.UpdateHudDisplay();
}
function DoPlayLevel5() {
if (_global.C.nGameStateIDCur == _global.C.GAME_STATE_PLAY_LEVEL5_ID) {
_global.C.oStreetGenerator.EnterFrame();
}
_global.C.StreetObjectsEnterFrame();
_global.C.oTentacleFrontTop.EnterFrame();
_global.C.oTentacleFrontBottom.EnterFrame();
_global.C.oPlayer.EnterFrame();
_global.C.oPlayerBullet.EnterFrame();
_global.C.UpdateMovingObjects();
if (_global.C.nGameStateIDCur == _global.C.GAME_STATE_PLAY_LEVEL5_ID) {
_global.C.CheckHitLaserGunWithAllPartsOfSurly();
_global.C.oAi.EnterFrame();
}
_global.C.oSurlyTheVillain.EnterFrame();
_global.C.oSurlyHeadFlame.EnterFrame();
_global.C.oSurlyLeftArmGun.EnterFrame();
_global.C.oSurlyRightArmGun.EnterFrame();
_global.C.oSurlyLeftTractorBeam.EnterFrame();
_global.C.oSurlyRightTractorBeam.EnterFrame();
_global.C.UpdateHudDisplay();
}
function DoPlayerEndLevel() {
_global.C.nWaitGameStateTimeOut--;
if (_global.C.nGameLevelCur < _global.C.LAST_LEVEL_NUMBER) {
_global.C.DoPlayLevel1To4();
} else {
_global.C.DoPlayLevel5();
}
if (_global.C.nWaitGameStateTimeOut < 0) {
_global.C.EndLevel();
}
}
function DoPlayerLooseOneLife() {
_global.C.nWaitGameStateTimeOut--;
if (_global.C.nGameLevelCur < _global.C.LAST_LEVEL_NUMBER) {
_global.C.DoPlayLevel1To4();
} else {
_global.C.DoPlayLevel5();
}
if (_global.C.nWaitGameStateTimeOut < 0) {
_global.CS.gotoAndStop("GamePlay1");
_global.CS.Hud.NbLifes.text = nbPlayerLifesCur;
_global.CS.LooseLifeTransition.gotoAndStop("Idle");
oAi.Init(nGameLevelCur);
if (nGameLevelCur == LAST_LEVEL_NUMBER) {
_global.C.oTentacleFrontTop.Init();
_global.C.oTentacleFrontBottom.Init();
}
InitHudDisplay();
oScoreMng.ClearScore();
oStreetGenerator.Init(nGameLevelCur);
nGameStateIDCur = GAME_STATE_READY_GO_ID;
_global.CS.ReadyGo.gotoAndStop("Play");
_global.S.PlaySound("sndFxReadyGo", 100, 1);
_global.C.nWaitGameStateTimeOut = 70;
oPlayer.Init(nGameLevelCur);
}
}
function DoGameOver() {
_global.C.nWaitGameStateTimeOut--;
if (_global.C.nGameLevelCur < _global.C.LAST_LEVEL_NUMBER) {
_global.C.DoPlayLevel1To4();
} else {
_global.C.DoPlayLevel5();
}
if (_global.C.nWaitGameStateTimeOut < 0) {
_global.CS.LooseLifeTransition.gotoAndStop("Idle");
mcRef.onEnterFrame = null;
_global.CS.Hud._visible = false;
_global.CS.gotoAndStop("LoosePage");
}
}
function DoReadyGo() {
_global.C.nWaitGameStateTimeOut--;
if (_global.C.nWaitGameStateTimeOut < 0) {
if (_global.C.nGameLevelCur < _global.C.LAST_LEVEL_NUMBER) {
nGameStateIDCur = GAME_STATE_PLAY_LEVEL1TO4_ID;
nGameStateIDSaved = nGameStateIDCur;
} else {
nGameStateIDCur = GAME_STATE_PLAY_LEVEL5_ID;
nGameStateIDSaved = nGameStateIDCur;
}
_global.CS.ReadyGo.gotoAndStop("Idle");
}
}
function DoYouWin() {
_global.C.nWaitGameStateTimeOut--;
_global.C.DoPlayLevel5();
if (_global.C.nWaitGameStateTimeOut < 0) {
mcRef.onEnterFrame = null;
_global.CS.Hud._visible = false;
_global.CS.gotoAndStop("WinPage");
}
}
function EnterFrame() {
switch (_global.C.nGameStateIDCur) {
case _global.C.GAME_STATE_READY_GO_ID :
_global.C.DoReadyGo();
break;
case _global.C.GAME_STATE_PLAY_LEVEL1TO4_ID :
_global.C.DoPlayLevel1To4();
break;
case _global.C.GAME_STATE_PLAY_LEVEL5_ID :
_global.C.DoPlayLevel5();
break;
case _global.C.GAME_STATE_LOOSE_ONE_LIFE_ID :
_global.C.DoPlayerLooseOneLife();
break;
case _global.C.GAME_STATE_END_LEVEL_ID :
_global.C.DoPlayerEndLevel();
break;
case _global.C.GAME_STATE_PLAY_PAUSED_ID :
_global.C.DoGameIsPaused();
break;
case _global.C.GAME_STATE_GAMEOVER_ID :
_global.C.DoGameOver();
break;
case _global.C.GAME_STATE_YOUWIN_ID :
_global.C.DoYouWin();
}
}
function GetCurrentGameLevel() {
return(nGameLevelCur);
}
function GotoFrameLabel(l_strFrameLabelNew) {
strGamePlayLabelPrev = strGamePlayLabelCur;
strGamePlayLabelCur = l_strFrameLabelNew;
_global.CS.gotoAndStop(strGamePlayLabelCur);
}
function HelpGame() {
mcRef.onEnterFrame = null;
oPlayer.TurnShieldOff(false);
_global.S.StopSound("sndFxTruckMoving");
bGamePaused = true;
_global.CS.Hud._visible = false;
SaveCurrentGameLabel();
GotoFrameLabel("InstPage1");
}
function CreateObjects() {
if (bGameInit == false) {
CreateAI();
CreateJimmyAndTimmyPlayer();
CreatePlayerBullet();
CreateStreetGenerator();
CreateSurlyTheVillain();
bGameInit = true;
}
}
function KeyDown() {
var _local3 = "nokey";
switch (Key.getCode()) {
case 39 :
_local3 = "right";
break;
case 37 :
_local3 = "left";
break;
case 38 :
_local3 = "up";
break;
case 40 :
_local3 = "down";
break;
case 32 :
_local3 = "space";
break;
case 17 :
_local3 = "ctrl";
}
if ((_local3 != "nokey") && (bGamePaused == false)) {
if ((nGameStateIDCur == 0) || (nGameStateIDCur == 1)) {
_global.C.oPlayer.HandleKeyDown(_local3);
}
}
}
function KeyUp() {
var _local3 = "nokey";
switch (Key.getCode()) {
case 39 :
_local3 = "right";
break;
case 37 :
_local3 = "left";
break;
case 38 :
_local3 = "up";
break;
case 40 :
_local3 = "down";
break;
case 32 :
_local3 = "space";
break;
case 17 :
_local3 = "ctrl";
break;
case KEY_V_PRESS :
_local3 = "v";
}
if (_local3 != "nokey") {
if ((nGameStateIDCur == 0) || (nGameStateIDCur == 1)) {
_global.C.oPlayer.HandleKeyUp(_local3);
}
}
}
function MuteGame() {
if (bMuteSoundOn == false) {
_global.S.DoMute();
bMuteSoundOn = true;
} else {
_global.S.UndoMute();
bMuteSoundOn = false;
}
}
function QuitGame() {
bGamePaused = false;
bMuteSoundOn = false;
oPlayer.HideTruck();
mcRef.onEnterFrame = null;
_global.C.ClearStreetObjects();
_global.CS.Hud._visible = false;
GotoFrameLabel("LoosePage");
}
function QuitPopup() {
bGamePaused = true;
_global.S.StopSound("sndFxTruckMoving");
_global.C.oSurlyHeadFlame.SetAnimState("Idle");
_global.C.oSurlyLeftArmGun.SetAnimState("Idle");
_global.C.oSurlyRightArmGun.SetAnimState("Idle");
_global.C.oSurlyLeftTractorBeam.SetAnimState("Idle");
_global.C.oSurlyRightTractorBeam.SetAnimState("Idle");
_global.C.oSurlyLeftGrabBeam.SetAnimState("Idle");
_global.C.oSurlyRightGrabBeam.SetAnimState("Idle");
_global.CS.QuitPopup._visible = true;
mcRef.onEnterFrame = null;
}
function SetCurrentHudFriendState(l_strFriendStateNew) {
var _local3;
_local3 = oStreetGenerator.GetCurrentFriendIndex();
_global.CS.Hud["Friend" + _local3].Obj.gotoAndStop(l_strFriendStateNew);
if (_local3 == MAX_FRIENDS) {
var _local4 = oScoreMng.HasPlayerSavedTheRequiredFriends();
_global.C.oPlayer.TurnShieldOn(false);
_global.C.oPlayer.ResetCtrlAndSpaceKeyDown();
_global.C.oAi.Stop();
if (_local4 == true) {
nGameStateIDCur = GAME_STATE_END_LEVEL_ID;
nWaitGameStateTimeOut = 120;
_global.CS.LevelClear.gotoAndStop("Play");
_global.S.PlaySound("sndFxLevelClear", 100, 1);
} else {
RemoveOneLifeToPlayer();
}
}
}
function InitGame() {
oFriendOnStreet = null;
oFenceOnStreet = null;
oPowerUpOnStreet = null;
bLastFriendSaveFromTentacle = new Boolean(false);
bLevelCompleted = new Boolean(false);
nGameLevelCur = 0;
nbPlayerPts = 0;
nbPlayerPtsPrev = -1;
nStateBattleLevel5 = 0;
nNbOfHitsOnSurlyHead = 0;
nNbOfHitsOnSurlyHandLeft = 0;
nNbOfHitsOnSurlyHandRight = 0;
nNbOfHitsOnSurlyArmGunLeft = 0;
nNbOfHitsOnSurlyArmGunRight = 0;
nTracktorBeamXSpeedReducer = 0;
nTracktorBeamYSpeedReducer = 0;
}
function ResumeGame() {
if (bGamePaused == true) {
bGamePaused = false;
_global.CS.Hud._visible = true;
_global.CS.QuitPopup._visible = false;
_global.CS.Level5Popup._visible = false;
mcRef.onEnterFrame = EnterFrame;
if (nGameStateIDCur == GAME_STATE_READY_GO_ID) {
SelectBackground2();
} else if (nGameStateIDCur != GAME_STATE_END_LEVEL_ID) {
SelectBackground();
} else {
SelectBackground3();
}
_global.S.PlaySound("sndFxTruckMoving", 100, 9999);
oPlayer.ResumeShield();
if (oPlayer.nbTruckDamage == 100) {
fromInstruct = true;
RemoveOneLifeToPlayer();
}
} else {
StartGame();
}
}
function SaveCurrentGameLabel() {
var _local2;
strGamePlayLabelPrev = strGamePlayLabelCur;
}
function SetLevelNumber(l_nLevelNumberNew) {
nGameLevelCur = l_nLevelNumberNew;
}
function StartGame() {
InitGame();
nGameLevelCur = 0;
bGamePaused = false;
oScoreMng.Init();
StartNewLevel();
}
function InitLevel() {
if (nGameLevelCur < LAST_LEVEL_NUMBER) {
oTentacleBackTop.Init();
oTentacleBackBottom.Init();
}
if (nGameLevelCur == LAST_LEVEL_NUMBER) {
oTentacleFrontTop.Init();
oTentacleFrontBottom.Init();
oTentacleBackTop.SetVisibleFlagTo(false);
oTentacleBackBottom.SetVisibleFlagTo(false);
}
oSurlyTheVillain.Init();
oSurlyHeadFlame.Init();
oSurlyLeftArmGun.Init();
oSurlyRightArmGun.Init();
oSurlyLeftTractorBeam.Init();
oSurlyRightTractorBeam.Init();
oSurlyLeftGrabBeam.Init();
oSurlyRightGrabBeam.Init();
}
function ResetSurlyParts() {
oSurlyTheVillain.Init();
oSurlyHeadFlame.Init();
oSurlyLeftArmGun.Init();
oSurlyRightArmGun.Init();
oSurlyLeftTractorBeam.Init();
oSurlyRightTractorBeam.Init();
oSurlyLeftGrabBeam.Init();
oSurlyRightGrabBeam.Init();
nNbOfHitsOnSurlyHead = 0;
nNbOfHitsOnSurlyHandLeft = 0;
nNbOfHitsOnSurlyHandRight = 0;
nNbOfHitsOnSurlyArmGunLeft = 0;
nNbOfHitsOnSurlyArmGunRight = 0;
nStateBattleLevel5 = 1;
}
function SelectBackground() {
_global.CS.ReadyGo.gotoAndStop("Idle");
_global.CS.ClearLevel.gotoAndStop("Idle");
if (nGameLevelCur < LAST_LEVEL_NUMBER) {
nGameStateIDCur = GAME_STATE_PLAY_LEVEL1TO4_ID;
nGameStateIDSaved = nGameStateIDCur;
nStateBattleLevel5 = 1;
GotoFrameLabel("GamePlay1");
_global.CS.QuitPopup._visible = false;
_global.CS.Level5Popup._visible = false;
_global.CS.LooseLifeTransition.gotoAndStop("Idle");
_global.CS.ReadyGo.gotoAndStop("Idle");
_global.CS.LevelClear.gotoAndStop("Idle");
_global.CS.FrontScrollingPane2._visible = false;
_global.CS.GameBackground2._visible = false;
_global.CS.BackScrollingPane2._visible = false;
_global.CS.FrontScrollingPane1._visible = true;
_global.CS.GameBackground1._visible = true;
_global.CS.BackScrollingPane1._visible = true;
} else {
nGameStateIDCur = GAME_STATE_PLAY_LEVEL5_ID;
nGameStateIDSaved = nGameStateIDCur;
nStateBattleLevel5 = 1;
GotoFrameLabel("GamePlay1");
_global.CS.QuitPopup._visible = false;
_global.CS.Level5Popup._visible = false;
_global.CS.LooseLifeTransition.gotoAndStop("Idle");
_global.CS.ReadyGo.gotoAndStop("Idle");
_global.CS.LevelClear.gotoAndStop("Idle");
_global.CS.FrontScrollingPane1._visible = false;
_global.CS.GameBackground1._visible = false;
_global.CS.BackScrollingPane1._visible = false;
_global.CS.FrontScrollingPane2._visible = true;
_global.CS.GameBackground2._visible = true;
_global.CS.BackScrollingPane2._visible = true;
}
}
function SelectBackground2() {
if (nGameLevelCur < LAST_LEVEL_NUMBER) {
nGameStateIDCur = GAME_STATE_READY_GO_ID;
nStateBattleLevel5 = 1;
GotoFrameLabel("GamePlay1");
_global.CS.QuitPopup._visible = false;
_global.CS.Level5Popup._visible = false;
_global.CS.LooseLifeTransition.gotoAndStop("Idle");
_global.CS.LevelClear.gotoAndStop("Idle");
_global.CS.ReadyGo.gotoAndStop("Play");
_global.S.PlaySound("sndFxReadyGo", 100, 1);
_global.CS.FrontScrollingPane2._visible = false;
_global.CS.GameBackground2._visible = false;
_global.CS.BackScrollingPane2._visible = false;
_global.CS.FrontScrollingPane1._visible = true;
_global.CS.GameBackground1._visible = true;
_global.CS.BackScrollingPane1._visible = true;
oPlayer.Init(nGameLevelCur);
} else {
nGameStateIDCur = GAME_STATE_READY_GO_ID;
nStateBattleLevel5 = 1;
GotoFrameLabel("GamePlay1");
_global.CS.QuitPopup._visible = false;
_global.CS.Level5Popup._visible = false;
_global.CS.LooseLifeTransition.gotoAndStop("Idle");
_global.CS.LevelClear.gotoAndStop("Idle");
_global.CS.ReadyGo.gotoAndStop("Play");
_global.S.PlaySound("sndFxReadyGo", 100, 1);
_global.CS.FrontScrollingPane1._visible = false;
_global.CS.GameBackground1._visible = false;
_global.CS.BackScrollingPane1._visible = false;
_global.CS.FrontScrollingPane2._visible = true;
_global.CS.GameBackground2._visible = true;
_global.CS.BackScrollingPane2._visible = true;
oPlayer.Init(nGameLevelCur);
}
_global.C.nWaitGameStateTimeOut = 50;
}
function SelectBackground3() {
if (nGameLevelCur < LAST_LEVEL_NUMBER) {
GotoFrameLabel("GamePlay1");
_global.CS.QuitPopup._visible = false;
_global.CS.Level5Popup._visible = false;
_global.CS.LooseLifeTransition.gotoAndStop("Idle");
_global.CS.ReadyGo.gotoAndStop("Idle");
_global.CS.LevelClear.gotoAndStop("Idle");
_global.CS.FrontScrollingPane2._visible = false;
_global.CS.GameBackground2._visible = false;
_global.CS.BackScrollingPane2._visible = false;
_global.CS.FrontScrollingPane1._visible = true;
_global.CS.GameBackground1._visible = true;
_global.CS.BackScrollingPane1._visible = true;
} else {
GotoFrameLabel("GamePlay1");
_global.CS.QuitPopup._visible = false;
_global.CS.Level5Popup._visible = false;
_global.CS.LooseLifeTransition.gotoAndStop("Idle");
_global.CS.ReadyGo.gotoAndStop("Idle");
_global.CS.LevelClear.gotoAndStop("Idle");
_global.CS.FrontScrollingPane1._visible = false;
_global.CS.GameBackground1._visible = false;
_global.CS.BackScrollingPane1._visible = false;
_global.CS.FrontScrollingPane2._visible = true;
_global.CS.GameBackground2._visible = true;
_global.CS.BackScrollingPane2._visible = true;
}
}
function StartNewLevel() {
nGameLevelCur++;
bTentacleGrabAFriend = false;
bTruckRecuedFriend = false;
oScoreMng.ResetScore();
oAi.Init(nGameLevelCur);
oStreetGenerator.Init(nGameLevelCur);
if (nbPlayerLifesCur < MAX_PLAYER_LIFES) {
nbPlayerLifesCur = MAX_PLAYER_LIFES;
}
InitLevel();
InitHudDisplay();
mcRef.onEnterFrame = EnterFrame;
bLevelCompleted = false;
nGameStateIDCur = GAME_STATE_READY_GO_ID;
SelectBackground2();
}
function ShowLevel5Popup() {
_global.CS.Hud._visible = true;
_global.CS.Hud.HelpBtn.gotoAndStop(2);
_global.CS.Hud.MuteBtn.gotoAndStop(2);
_global.CS.Hud.QuitBtn.gotoAndStop(2);
_global.C.GotoFrameLabel("GamePlay1");
_global.CS.QuitPopup._visible = false;
_global.CS.Level5Popup._visible = true;
_global.CS.LooseLifeTransition.gotoAndStop("Idle");
_global.CS.LevelClear.gotoAndStop("Idle");
_global.CS.ReadyGo.gotoAndStop("Idle");
}
function StartLevel5() {
nGameStateIDCur = GAME_STATE_READY_GO_ID;
nStateBattleLevel5 = 1;
_global.CS.Level5Popup._visible = false;
_global.CS.ReadyGo.gotoAndStop("Play");
_global.S.PlaySound("sndFxReadyGo", 100, 1);
_global.C.nWaitGameStateTimeOut = 50;
oPlayer.Init(nGameLevelCur);
}
function StreetObjectsEnterFrame() {
var _local3 = new Boolean(false);
var _local6 = new Boolean(false);
var _local5 = new Boolean(false);
var _local4;
if (_global.C.oFriendOnStreet != null) {
_global.C.oFriendOnStreet.EnterFrame();
if ((_global.C.bTentacleGrabAFriend == false) && (_global.C.bTruckRecuedFriend == false)) {
_local3 = _global.C.oFriendOnStreet.IsObjectMoving();
if (_local3) {
_local4 = _global.C.oFriendOnStreet.GetObjectMcRef();
if (_local4._x >= TENTACLE_X_LIMIT_FOR_GRABBING) {
bTentacleGrabAFriend = true;
oStreetGenerator.StopGeneratingFriends();
if (_local4._y > STAGE_Y_MIDDLE_POS) {
_global.C.TentacleGrabFriend(1);
} else {
_global.C.TentacleGrabFriend(0);
}
}
} else {
delete _global.C.oFriendOnStreet;
_global.C.oFriendOnStreet = null;
_global.C.bTentacleGrabAFriend = false;
}
} else {
_local5 = _global.C.oFriendOnStreet.GetActiveFlag();
if (_local5 == false) {
delete _global.C.oFriendOnStreet;
_global.C.oFriendOnStreet = null;
_global.C.bTentacleGrabAFriend = false;
_global.C.bTruckRecuedFriend = false;
_global.C.oStreetGenerator.StartGeneratingFriends();
bLastFriendSaveFromTentacle = false;
}
}
}
if (_global.C.oFenceOnStreet != null) {
_local3 = _global.C.oFenceOnStreet.IsObjectMoving();
if (_local3) {
_global.C.oFenceOnStreet.EnterFrame();
} else {
delete _global.C.oFenceOnStreet;
_global.C.oFenceOnStreet = null;
}
}
if (_global.C.oPowerUpOnStreet != null) {
_local3 = _global.C.oPowerUpOnStreet.IsObjectMoving();
if (_local3) {
_global.C.oPowerUpOnStreet.EnterFrame();
} else {
delete _global.C.oPowerUpOnStreet;
_global.C.oPowerUpOnStreet = null;
}
}
}
function SurlyHasGrabFriend() {
var _local4 = new Boolean();
var _local3;
_local3 = _global.C.oFriendOnStreet.GetObjectMcRef();
if ((bTentacleGrabAFriend == true) && (bLastFriendSaveFromTentacle == false)) {
if (_local3._y < STAGE_Y_MIDDLE_POS) {
_global.C.oTentacleBackTop.SetAnimState("Release");
} else {
_global.C.oTentacleBackBottom.SetAnimState("Release");
}
nNbOfHitsOnSurlyHead = 0;
_global.C.oFriendOnStreet.SetAnimState("Die");
SetCurrentHudFriendState("NotSaved");
}
}
function UpdateMovingObjects() {
var _local3;
var _local4 = new Boolean();
var _local6 = new Boolean();
var _local8;
var _local5;
var _local7;
_local5 = aMovingObjects.length;
_local3 = 0;
while (_local5 > 0) {
if (aMovingObjects[_local3] != undefined) {
_local4 = _global.C.aMovingObjects[_local3].GetActiveFlag();
_local6 = _global.C.aMovingObjects[_local3].IsObjectMoving();
if (_local4 || (_local6)) {
aMovingObjects[_local3].EnterFrame();
_local3++;
} else {
_local7 = aMovingObjects[_local3].GetType();
delete eval (aMovingObjects.splice(_local3, 1));
}
} else {
_local3++;
}
_local5--;
}
}
var STARTING_LEVEL_NUMBER = 1;
var LAST_LEVEL_NUMBER = 5;
var MAX_PLAYER_LIFES = 3;
var MAX_FRIENDS = 10;
var HEAD_FLAMES_MAX_HITS1 = 3;
var HEAD_FLAMES_MAX_HITS2 = 15;
var HEAD_HAND_MAX_HITS = 6;
var HEAD_ARMGUN_MAX_HITS = 10;
var PTS_FRIEND_RELEASE_FROM_TENTACLE = 200;
var PTS_EXTRA_FRIEND_RESCUE = 500;
var PTS_FRIEND_RESCUE_BY_TRUCK = 250;
var PTS_POWER_UP_COLLECT_BY_TRUCK = 100;
var PTS_HIT_SURLY_HEAD = 50;
var STREET_OBJ_FRIEND_ID = 0;
var STREET_OBJ_FENCE_ID = 1;
var STREET_OBJ_POWERUP_ID = 2;
var TENTACLE_X_LIMIT_FOR_GRABBING = 250;
var STAGE_Y_MIDDLE_POS = Stage.height / 2;
var GAME_STATE_PLAY_LEVEL1TO4_ID = 0;
var GAME_STATE_PLAY_LEVEL5_ID = 1;
var GAME_STATE_LOOSE_ONE_LIFE_ID = 2;
var GAME_STATE_END_LEVEL_ID = 3;
var GAME_STATE_PLAY_PAUSED_ID = 4;
var GAME_STATE_GAMEOVER_ID = 5;
var GAME_STATE_YOUWIN_ID = 6;
var GAME_STATE_READY_GO_ID = 7;
var PTS_FRIEND_RESCUED_BY_TRUCK = 250;
var PTS_HIT_ON_SURLY_HEAD = 50;
var KEY_V_PRESS = 86;
var nbPlayerLifesCur = 3;
var fromInstruct = false;
}
Symbol 1155 MovieClip [__Packages.jt3_ScoreManager] Frame 0
class jt3_ScoreManager
{
var aHighScoresList, nTotalToSaved, nbFriendsRecuedByTruck, nbPowerUpsCollected, nNbOfHitsOnSurlyHead, nScoreCur, nbFriendsRescuedExtra, nScoreInitial, nScoreHighest;
function jt3_ScoreManager () {
aHighScoresList = new Array();
nTotalToSaved = 0;
}
function AddPoints(l_PtsID) {
switch (l_PtsID) {
case PTS_FRIEND_RESCUED_BY_TRUCK :
nbFriendsRecuedByTruck++;
break;
case PTS_POWER_UP_COLLECTED_BY_TRUCK :
nbPowerUpsCollected++;
break;
case PTS_HIT_ON_SURLY_HEAD :
trace("Points on Surly head : " + nNbOfHitsOnSurlyHead);
nNbOfHitsOnSurlyHead++;
}
}
function GetCurrentScore() {
var _local2;
_local2 = nScoreCur;
_local2 = _local2 + (nbFriendsRecuedByTruck * PTS_FRIEND_RESCUED_BY_TRUCK);
_local2 = _local2 + (nbPowerUpsCollected * PTS_POWER_UP_COLLECTED_BY_TRUCK);
_local2 = _local2 + (nNbOfHitsOnSurlyHead * PTS_HIT_ON_SURLY_HEAD);
return(_local2);
}
function GetCummulatedScore() {
var _local2;
_local2 = GetCurrentScore();
if (nbFriendsRecuedByTruck > 0) {
_local2 = _local2 + (nTotalToSaved * PTS_FRIEND_REQUIRED);
}
nbFriendsRescuedExtra = nbFriendsRecuedByTruck - nTotalToSaved;
trace("Extra friend saved : " + nbFriendsRescuedExtra);
if (nbFriendsRescuedExtra > 0) {
_local2 = _local2 + (nbFriendsRescuedExtra * PTS_EXTRA_FRIEND_RESCUED);
} else {
nbFriendsRescuedExtra = 0;
}
return(_local2);
}
function GetInitialScore() {
return(nScoreCur);
}
function GetTotalToSaved() {
trace("Total to saved " + nTotalToSaved);
return(nTotalToSaved);
}
function GetNbOfFriendsRescuedExtra() {
nbFriendsRescuedExtra = nbFriendsRecuedByTruck - nTotalToSaved;
return(nbFriendsRescuedExtra);
}
function GetNbOfFriendsRescuedByTruck() {
return(nbFriendsRecuedByTruck);
}
function GetNbOfPowerUpsCollected() {
return(nbPowerUpsCollected);
}
function GetNbOfHitsOnSurlyHead() {
return(nNbOfHitsOnSurlyHead);
}
function Init() {
nScoreInitial = 0;
nScoreCur = 0;
nScoreHighest = 0;
nbFriendsRescuedExtra = 0;
nbFriendsRecuedByTruck = 0;
nbPowerUpsCollected = 0;
nNbOfHitsOnSurlyHead = 0;
}
function HasPlayerSavedTheRequiredFriends() {
var _local2 = new Boolean(false);
trace("...............Friends recued : " + nbFriendsRecuedByTruck);
if (nbFriendsRecuedByTruck >= nTotalToSaved) {
_local2 = true;
}
return(_local2);
}
function ClearScore() {
nbFriendsRescuedExtra = 0;
var _local2;
_local2 = nbPowerUpsCollected;
nbPowerUpsCollected = 0;
var _local3;
_local3 = nbFriendsRecuedByTruck;
nbFriendsRecuedByTruck = 0;
oldScore = ((nNbOfHitsOnSurlyHead * 50) + (_local3 * 250)) + (_local2 * 100);
nNbOfHitsOnSurlyHead = 0;
nScoreCur = GetCummulatedScore() + oldScore;
}
function ResetScore() {
nScoreCur = GetCummulatedScore();
nbFriendsRescuedExtra = 0;
nbFriendsRecuedByTruck = 0;
nbPowerUpsCollected = 0;
nNbOfHitsOnSurlyHead = 0;
}
function SetTotalToSaved(l_nTotalToSaved) {
nTotalToSaved = l_nTotalToSaved;
}
var HIGH_SCORES_LIST_MAX_PLAYERS = 20;
var PTS_FRIEND_REQUIRED = 200;
var PTS_EXTRA_FRIEND_RESCUED = 500;
var PTS_FRIEND_RESCUED_BY_TRUCK = 250;
var PTS_POWER_UP_COLLECTED_BY_TRUCK = 100;
var PTS_HIT_ON_SURLY_HEAD = 50;
var oldScore = 0;
}
Symbol 1156 MovieClip [__Packages.jt3_Ai] Frame 0
class jt3_Ai
{
var nLevelCur, nTimeoutAttack, bLevelStarted, aArmTimeoutCur;
function jt3_Ai () {
nLevelCur = 0;
nTimeoutAttack = 0;
bLevelStarted = new Boolean(false);
CreateTimeoutArrayForSurlyArms();
}
function CreateTimeoutArrayForSurlyArms() {
var _local2;
aArmTimeoutCur = new Array(MAX_ARMS);
_local2 = 0;
while (_local2 < MAX_ARMS) {
aArmTimeoutCur[_local2] = new Number(0);
_local2++;
}
}
function ResetArmsTimeoutValue() {
var _local2;
for (_local2 in aArmTimeoutCur) {
aArmTimeoutCur[_local2] = aTableArmProperties[nLevelCur - 1][_local2].nTimeOut;
}
nTimeoutAttack = TIMEOUT_ATTACK_COUNTER;
}
function UpdateTimeoutForEachArm() {
var _local4;
var _local5;
var _local3;
_local3 = 0;
while (_local3 < MAX_ARMS) {
aArmTimeoutCur[_local3]--;
if (aArmTimeoutCur[_local3] <= 0) {
aArmTimeoutCur[_local3] = aTableArmProperties[nLevelCur - 1][_local3].nTimeOut;
_local4 = aTableArmProperties[nLevelCur - 1][_local3].nProbOfAttack;
_local5 = Math.round(Math.random() * 100);
if (_local5 < _local4) {
_global.C.oSurlyTheVillain.AttackPlayerWithArm(_local3);
}
}
_local3++;
}
}
function EnterFrame() {
if ((nLevelCur > 0) && (nTimeoutAttack == 0)) {
UpdateTimeoutForEachArm();
} else if (nTimeoutAttack > 0) {
nTimeoutAttack--;
}
}
function Init(l_nLevelNew) {
var _local3;
nLevelCur = l_nLevelNew;
ResetArmsTimeoutValue();
}
function ResetAttackTimeout() {
nTimeoutAttack = TIMEOUT_ATTACK_COUNTER;
}
function Stop() {
trace(".............AI STOP AI STOP AI STOP............");
nLevelCur = -1;
}
var ARM_HEAD_FLAME_ID = 0;
var ARM_MISSILE_ID = 1;
var ARM_LASER_BEAM_ID = 2;
var ARM_TRACKTOR_BEAM_ID = 3;
var ARM_DESTRUCTO_SHIP_ID = 4;
var MAX_ARMS = 5;
var MAX_LEVELS = 5;
var TIMEOUT_ATTACK_COUNTER = 40;
var aTableArmProperties = new Array([{nTimeOut:100, nProbOfAttack:50}, {nTimeOut:110, nProbOfAttack:50}, {nTimeOut:120, nProbOfAttack:50}, {nTimeOut:150, nProbOfAttack:50}, {nTimeOut:999, nProbOfAttack:0}], [{nTimeOut:90, nProbOfAttack:55}, {nTimeOut:100, nProbOfAttack:55}, {nTimeOut:110, nProbOfAttack:55}, {nTimeOut:140, nProbOfAttack:55}, {nTimeOut:999, nProbOfAttack:0}], [{nTimeOut:80, nProbOfAttack:60}, {nTimeOut:90, nProbOfAttack:60}, {nTimeOut:100, nProbOfAttack:60}, {nTimeOut:130, nProbOfAttack:60}, {nTimeOut:999, nProbOfAttack:0}], [{nTimeOut:70, nProbOfAttack:70}, {nTimeOut:80, nProbOfAttack:70}, {nTimeOut:90, nProbOfAttack:70}, {nTimeOut:120, nProbOfAttack:70}, {nTimeOut:999, nProbOfAttack:0}], [{nTimeOut:60, nProbOfAttack:70}, {nTimeOut:70, nProbOfAttack:70}, {nTimeOut:80, nProbOfAttack:70}, {nTimeOut:110, nProbOfAttack:80}, {nTimeOut:100, nProbOfAttack:40}]);
}
Symbol 1157 MovieClip [__Packages.jt3_StreetObjectGenerator] Frame 0
class jt3_StreetObjectGenerator
{
var nLevelCur, nNbrOfFramesPast, bLevelStarted, bObjectAppear, bLastObjectWasAFriend, bCanCreateFriend, nFriendIndexCur, aFriendRandomPos, nFriendIndexBitmapCur, aFriendRandomBitmapIndex, nLastPowerUpID, aObjectTimeoutCur;
function jt3_StreetObjectGenerator () {
nLevelCur = 0;
nNbrOfFramesPast = 0;
bLevelStarted = new Boolean(false);
bObjectAppear = new Boolean(false);
bLastObjectWasAFriend = new Boolean(false);
bCanCreateFriend = new Boolean(true);
CreateTimeoutArrayForStreetObjects();
CreateRandomArrayForFriend();
CreateRandomArrayForFriendBitmapIndex();
}
function AddObjectToStreet(l_nStreetObjectID) {
switch (l_nStreetObjectID) {
case STREET_OBJ_FRIEND_ID :
if (bCanCreateFriend == true) {
CreateFriendObject();
}
break;
case STREET_OBJ_FENCE_ID :
CreateFenceObject();
break;
case STREET_OBJ_POWERUP_ID :
CreatePowerUpObject();
break;
case STREET_OBJ_EXTRALIFE_ID :
trace("Add extra life to player.........");
CreateExtraLifeObject();
}
}
function CreateExtraLifeObject() {
var _local5 = new Object();
var _local6;
var _local4;
var _local3 = new Boolean();
if (_global.C.oPowerUpOnStreet != null) {
_local4 = _global.C.oPowerUpOnStreet.GetObjectMcRef();
_local3 = _local4._visible;
if (_local3 == false) {
delete _global.C.oPowerUpOnStreet;
_global.C.oPowerUpOnStreet = null;
}
} else {
_local3 = false;
}
if (_local3 == false) {
trace("Create Extra-life object");
_local5.x = -70;
_local5.y = POWERUP_OBJECTS_Y_MIN + Math.round(Math.random() * POWERUP_Y_RANDOM_RANGE);
_local4 = _global.CS.PowerUpExtraLife;
_global.C.oPowerUpOnStreet = new jt3_StreetPowerUp(_local4, POWER_UP_EXTRALIFE_ID);
_global.C.oPowerUpOnStreet.Init(_local5);
}
}
function CreateFenceObject() {
var _local5 = new Object();
var _local4;
var _local3;
var _local6 = new Boolean();
if (_global.C.oFenceOnStreet != null) {
_local3 = _global.C.oFenceOnStreet.GetObjectMcRef();
_local6 = _local3._visible;
} else {
_local6 = false;
}
if (_local6 == false) {
trace("Create Fence object");
trace("LevelCur :" + nLevelCur);
if (nLevelCur < LAST_LEVEL_NUMBER) {
_local4 = Math.round((Math.random() * 3) + 1);
} else {
_local4 = Math.round((Math.random() * 1) + 1);
}
_local5.x = -70;
_local5.y = FENCE_OBJECTS_Y_MIN + Math.round(Math.random() * FENCE_Y_RANDOM_RANGE);
switch (_local4) {
case FENCE_CLOSE_SEWER_ID :
_local3 = _global.CS.FenceCloseSewer;
break;
case FENCE_OPEN_SEWER_ID :
_local3 = _global.CS.FenceOpenSewer;
break;
case FENCE_SAFETY_CONE_ID :
_local3 = _global.CS.FenceSafetyCone;
break;
case FENCE_YELLOW_BARRIER_ID :
_local3 = _global.CS.FenceYellowBarrier;
break;
default :
trace("FENCE ID ERROR - ID undefined !!!");
trace("in function CreateFenceObject()");
}
_global.C.oFenceOnStreet = new jt3_StreetFence(_local3, _local4);
_global.C.oFenceOnStreet.Init(_local5);
}
}
function CreateFriendObject() {
var _local3 = new Object();
var _local4 = new Boolean();
var _local5;
if (_global.C.oFriendOnStreet != null) {
_local5 = _global.C.oFriendOnStreet.GetObjectMcRef();
_local4 = _local5._visible;
} else {
_local4 = false;
}
if ((nFriendIndexCur < MAX_FRIENDS) && (_local4 == false)) {
_local3.x = -70;
if (aFriendRandomPos[nFriendIndexCur] < 50) {
_local3.y = FRIEND_Y_TOP_POS;
trace("Top friend");
} else {
trace("Bottom friend");
_local3.y = FRIEND_Y_BOTTOM_POS;
}
trace("Create Friend object");
_global.C.oFriendOnStreet = new jt3_StreetFriend(_global.CS.Friend);
nFriendIndexBitmapCur = nFriendIndexCur % 6;
trace("Friend index created.... " + nFriendIndexBitmapCur);
_global.C.oFriendOnStreet.Init(_local3, aFriendRandomBitmapIndex[nFriendIndexBitmapCur]);
nFriendIndexCur++;
if (nFriendIndexBitmapCur > MAX_FRIEND_BITMAPS) {
CreateRandomArrayForFriendBitmapIndex();
}
trace("Friend index : " + nFriendIndexCur);
}
}
function CreatePowerUpObject() {
var _local5 = new Object();
var _local3;
var _local4;
var _local6 = new Boolean();
if (_global.C.oPowerUpOnStreet != null) {
_local4 = _global.C.oPowerUpOnStreet.GetObjectMcRef();
_local6 = _local4._visible;
} else {
_local6 = false;
}
if (_local6 == false) {
trace("Create Power-up object");
_local3 = Math.round(Math.random() * 100);
_local3 = _local3 % 3;
_local3 = _local3 + 1;
trace("Random power up ID : " + _local3);
if (_local3 == nLastPowerUpID) {
_local3++;
_local3 = _local3 % 3;
_local3 = _local3 + 1;
}
_local5.x = -70;
_local5.y = POWERUP_OBJECTS_Y_MIN + Math.round(Math.random() * POWERUP_Y_RANDOM_RANGE);
switch (_local3) {
case POWER_UP_BATTERY_ID :
_local4 = _global.CS.PowerUpBattery;
break;
case POWER_UP_REPAIR_ID :
_local4 = _global.CS.PowerUpRepair;
break;
case POWER_UP_SHIELD_ID :
_local4 = _global.CS.PowerUpShield;
break;
default :
trace("POWER_UP ID ERROR - ID undefined !!!");
trace("in function CreatePowerUpObject()");
}
_global.C.oPowerUpOnStreet = new jt3_StreetPowerUp(_local4, _local3);
_global.C.oPowerUpOnStreet.Init(_local5);
nLastPowerUpID = _local3;
}
}
function CreateRandomArrayForFriendBitmapIndex() {
var _local5 = new Boolean(false);
var _local2;
var _local6 = 0;
var _local3 = 6;
var _local4 = new Array(MAX_FRIEND_BITMAPS);
_local2 = 0;
while (_local2 < MAX_FRIEND_BITMAPS) {
_local4[_local2] = aValidFriendIndex[_local2];
_local2++;
}
if ((aFriendRandomBitmapIndex != undefined) && (aFriendRandomBitmapIndex.length == MAX_FRIEND_BITMAPS)) {
delete aFriendRandomBitmapIndex;
}
aFriendRandomBitmapIndex = new Array();
while (_local3 > 0) {
_local3--;
_local2 = Math.round(Math.random() * _local3);
aFriendRandomBitmapIndex.push(_local4[_local2]);
_local4.splice(_local2, 1);
}
}
function CreateRandomArrayForFriend() {
var _local4 = new Boolean(false);
var _local2;
var _local3 = 0;
aFriendRandomPos = new Array(MAX_FRIENDS);
while (_local4 == false) {
_local2 = 0;
while (_local2 < MAX_FRIENDS) {
aFriendRandomPos[_local2] = Math.round(Math.random() * 100);
_local2++;
}
_local2 = 0;
while (_local2 < MAX_FRIENDS) {
if (aFriendRandomPos[_local2] > 50) {
_local3++;
}
_local2++;
}
if (_local3 == 5) {
_local4 = true;
} else {
_local3 = 0;
}
}
}
function CreateTimeoutArrayForStreetObjects() {
var _local2;
aObjectTimeoutCur = new Array(MAX_OBJECTS);
_local2 = 0;
while (_local2 < MAX_OBJECTS) {
aObjectTimeoutCur[_local2] = new Number(0);
_local2++;
}
}
function ResetObjectTimeoutValue() {
var _local2;
for (_local2 in aObjectTimeoutCur) {
aObjectTimeoutCur[_local2] = aTableSreetObjectProperties[nLevelCur - 1][_local2].nTimeOut;
}
}
function UpdateTimeoutForEachObject() {
var _local4;
var _local3;
var _local2;
_local2 = 0;
while (_local2 < MAX_OBJECTS) {
aObjectTimeoutCur[_local2]--;
if (aObjectTimeoutCur[_local2] <= 0) {
aObjectTimeoutCur[_local2] = aTableSreetObjectProperties[nLevelCur - 1][_local2].nTimeOut;
_local4 = aTableSreetObjectProperties[nLevelCur - 1][_local2].nProbToAppear;
_local3 = Math.round(Math.random() * 100);
if (bObjectAppear == false) {
if (_local3 < _local4) {
if (_local2 == STREET_OBJ_FRIEND_ID) {
AddObjectToStreet(_local2);
bLastObjectWasAFriend = true;
} else {
AddObjectToStreet(_local2);
bLastObjectWasAFriend = false;
}
bObjectAppear = true;
nNbrOfFramesPast = 0;
}
} else if (nNbrOfFramesPast >= FRAMES_TO_SKIP_BETWEEN_OBJECT) {
bObjectAppear = false;
nNbrOfFramesPast = 0;
trace("Frames counter reset");
}
}
_local2++;
}
}
function EnterFrame() {
if (nLevelCur > 0) {
UpdateTimeoutForEachObject();
nNbrOfFramesPast++;
}
}
function Init(l_nLevelNew) {
nLevelCur = l_nLevelNew;
ResetObjectTimeoutValue();
nNbrOfFramesPast = 0;
bObjectAppear = false;
bLastObjectWasAFriend = false;
bCanCreateFriend = true;
nFriendIndexCur = 0;
nFriendIndexBitmapCur = 0;
nLastPowerUpID = -1;
}
function GetCurrentFriendIndex() {
return(nFriendIndexCur);
}
function StartGeneratingFriends() {
bCanCreateFriend = true;
}
function StopGeneratingFriends() {
bCanCreateFriend = false;
}
var STREET_OBJ_FRIEND_ID = 0;
var STREET_OBJ_FENCE_ID = 1;
var STREET_OBJ_POWERUP_ID = 2;
var STREET_OBJ_EXTRALIFE_ID = 3;
var MAX_OBJECTS = 4;
var LAST_LEVEL_NUMBER = 5;
var MAX_FRIENDS = 10;
var MAX_FRIEND_BITMAPS = 6;
var FRAMES_TO_SKIP_BETWEEN_OBJECT = 20;
var FRIEND_Y_TOP_POS = 90;
var FRIEND_Y_BOTTOM_POS = Stage.height - 80;
var FENCE_OBJECTS_Y_MIN = 80;
var POWERUP_OBJECTS_Y_MIN = 64;
var FENCE_Y_RANDOM_RANGE = Stage.height - 164;
var POWERUP_Y_RANDOM_RANGE = Stage.height - 136;
var aValidFriendIndex = new Array(1, 2, 3, 4, 5, 6);
var FENCE_SAFETY_CONE_ID = 1;
var FENCE_YELLOW_BARRIER_ID = 2;
var FENCE_CLOSE_SEWER_ID = 3;
var FENCE_OPEN_SEWER_ID = 4;
var POWER_UP_REPAIR_ID = 1;
var POWER_UP_BATTERY_ID = 2;
var POWER_UP_SHIELD_ID = 3;
var POWER_UP_EXTRALIFE_ID = 4;
var aTableSreetObjectProperties = new Array([{nTimeOut:70, nProbToAppear:99}, {nTimeOut:90, nProbToAppear:60}, {nTimeOut:120, nProbToAppear:50}, {nTimeOut:1000, nProbToAppear:50}], [{nTimeOut:90, nProbToAppear:90}, {nTimeOut:80, nProbToAppear:70}, {nTimeOut:110, nProbToAppear:60}, {nTimeOut:900, nProbToAppear:50}], [{nTimeOut:100, nProbToAppear:80}, {nTimeOut:70, nProbToAppear:80}, {nTimeOut:100, nProbToAppear:70}, {nTimeOut:800, nProbToAppear:50}], [{nTimeOut:110, nProbToAppear:75}, {nTimeOut:60, nProbToAppear:90}, {nTimeOut:90, nProbToAppear:80}, {nTimeOut:700, nProbToAppear:50}], [{nTimeOut:999, nProbToAppear:0}, {nTimeOut:60, nProbToAppear:80}, {nTimeOut:70, nProbToAppear:99}, {nTimeOut:600, nProbToAppear:99}]);
}
Symbol 1158 MovieClip [__Packages.jt3_MovingObject] Frame 0
class jt3_MovingObject
{
var mcRef, strName, strType, bObjectIsMoving, bIsActive, ptPositionCur;
function jt3_MovingObject (l_mcRef) {
mcRef = l_mcRef;
strName = l_mcRef._name;
strType = "Dummy";
bObjectIsMoving = new Boolean(false);
bIsActive = new Boolean(false);
ptPositionCur = new Object();
}
function MoveObject() {
}
function EnterFrame() {
}
function GetActiveFlag() {
return(bIsActive);
}
function GetObjectPosition() {
ptPositionCur.x = mcRef._x;
ptPositionCur.y = mcRef._y;
return(ptPositionCur);
}
function GetObjectMcRef() {
return(mcRef);
}
function GetType() {
return(strType);
}
function IsObjectMoving() {
return(bObjectIsMoving);
}
function SetActiveFlag(l_bActiveFlagNew) {
bIsActive = l_bActiveFlagNew;
}
function SetVisibleFlagTo(l_bIsVisible) {
mcRef._visible = l_bIsVisible;
}
}
Symbol 1159 MovieClip [__Packages.jt3_StreetPowerUp] Frame 0
class jt3_StreetPowerUp extends jt3_MovingObject
{
var mcRef, strName, strType, nPowerUpID, bObjectIsMoving, xSpeedCur, ySpeedCur, strAnimStateCur, xPositionMax;
function jt3_StreetPowerUp (l_mcRef, l_nPowerUpID) {
super();
mcRef = l_mcRef;
strName = l_mcRef._name;
mcRef.Obj.HitRegion._visible = false;
strType = "POWERUP";
nPowerUpID = l_nPowerUpID;
}
function Idle() {
if (bObjectIsMoving == true) {
MoveObject();
}
}
function Pop() {
if (mcRef.Obj.Etat._currentframe >= FR_POP) {
mcRef._visible = false;
bObjectIsMoving = false;
} else {
MoveObject();
}
}
function MoveObject() {
var _local2;
var _local5;
var _local4;
var _local3;
_local4 = xSpeedCur;
_local3 = ySpeedCur;
_local2 = mcRef._x + _local4;
_local5 = mcRef._y + _local3;
if (_local2 > X_POSITION_MAX) {
mcRef._visible = false;
bObjectIsMoving = false;
} else {
mcRef._x = _local2;
}
mcRef._y = _local5;
}
function EnterFrame() {
this[strAnimStateCur]();
}
function GetID() {
return(nPowerUpID);
}
function Init(l_ptObjStartPos) {
mcRef._x = l_ptObjStartPos.x;
mcRef._y = l_ptObjStartPos.y;
if (nPowerUpID == POWER_UP_EXTRALIFE_ID) {
mcRef._xscale = MOVIE_CLIP_SCALING_FACTOR + 50;
mcRef._yscale = MOVIE_CLIP_SCALING_FACTOR + 50;
} else {
mcRef._xscale = MOVIE_CLIP_SCALING_FACTOR;
mcRef._yscale = MOVIE_CLIP_SCALING_FACTOR;
}
SetAnimState("Idle");
mcRef._visible = true;
xSpeedCur = STARTING_X_SPEED;
ySpeedCur = 0;
xPositionMax = Stage.width;
bObjectIsMoving = true;
}
function SetAnimState(l_strAnimStateNew) {
if (((l_strAnimStateNew != null) && (l_strAnimStateNew != "")) && (l_strAnimStateNew != undefined)) {
strAnimStateCur = l_strAnimStateNew;
mcRef.Obj.gotoAndStop(strAnimStateCur);
}
}
var X_ACCELERATING_FACTOR = 2;
var Y_ACCELERATING_FACTOR = 0.5;
var STARTING_X_SPEED = 4;
var OBJECT_SPEED_MAX = 14;
var MOVIE_CLIP_SCALING_FACTOR = 60;
var FR_POP = 30;
var X_POSITION_MAX = Stage.width - 100;
var Y_POSITION_MAX = Stage.height;
var POWER_UP_BATTERY_ID = 1;
var POWER_UP_REPAIR_ID = 2;
var POWER_UP_SHIELD_ID = 3;
var POWER_UP_EXTRALIFE_ID = 4;
}
Symbol 1160 MovieClip [__Packages.jt3_StreetFence] Frame 0
class jt3_StreetFence extends jt3_MovingObject
{
var mcRef, strName, strType, nFenceID, bObjectIsMoving, xSpeedCur, ySpeedCur, strAnimStateCur, xPositionMax;
function jt3_StreetFence (l_mcRef, l_nFenceID) {
super();
mcRef = l_mcRef;
strName = l_mcRef._name;
mcRef.Obj.HitRegion._visible = false;
strType = "Fence";
nFenceID = l_nFenceID;
}
function Idle() {
if (bObjectIsMoving == true) {
MoveObject();
}
}
function Pop() {
if (mcRef.Obj.Etat._currentframe >= FR_POP) {
mcRef.Obj.Etat.stop();
MoveObject();
} else {
MoveObject();
}
}
function MoveObject() {
var _local2;
var _local5;
var _local4;
var _local3;
_local4 = xSpeedCur;
_local3 = ySpeedCur;
_local2 = mcRef._x + _local4;
_local5 = mcRef._y + _local3;
if (_local2 > X_POSITION_MAX) {
mcRef._visible = false;
bObjectIsMoving = false;
} else {
mcRef._x = _local2;
}
mcRef._y = _local5;
}
function EnterFrame() {
this[strAnimStateCur]();
}
function GetID() {
return(nFenceID);
}
function Init(l_ptObjStartPos) {
mcRef._x = l_ptObjStartPos.x;
mcRef._y = l_ptObjStartPos.y;
mcRef._xscale = MOVIE_CLIP_SCALING_FACTOR;
mcRef._yscale = MOVIE_CLIP_SCALING_FACTOR;
SetAnimState("Idle");
mcRef._visible = true;
xSpeedCur = STARTING_X_SPEED;
ySpeedCur = 0;
xPositionMax = Stage.width;
bObjectIsMoving = true;
}
function SetAnimState(l_strAnimStateNew) {
if (((l_strAnimStateNew != null) && (l_strAnimStateNew != "")) && (l_strAnimStateNew != undefined)) {
strAnimStateCur = l_strAnimStateNew;
mcRef.Obj.gotoAndStop(strAnimStateCur);
if (strAnimStateCur == "Pop") {
switch (nFenceID) {
case FENCE_SAFETY_CONE_ID :
_global.S.PlaySound("sndFxSafetyCone", 100, 1);
break;
case FENCE_YELLOW_BARRIER_ID :
_global.S.PlaySound("sndFxImpactWood", 100, 1);
break;
case FENCE_CLOSE_SEWER_ID :
_global.S.PlaySound("sndFxSewerClose", 100, 1);
break;
case FENCE_OPEN_SEWER_ID :
_global.S.PlaySound("sndFxSewerOpen", 100, 1);
}
}
}
}
var X_ACCELERATING_FACTOR = 2;
var Y_ACCELERATING_FACTOR = 0.5;
var STARTING_X_SPEED = 8;
var OBJECT_SPEED_MAX = 14;
var MOVIE_CLIP_SCALING_FACTOR = 60;
var FR_POP = 20;
var X_POSITION_MAX = Stage.width - 100;
var Y_POSITION_MAX = Stage.height;
var FENCE_SAFETY_CONE_ID = 1;
var FENCE_YELLOW_BARRIER_ID = 2;
var FENCE_CLOSE_SEWER_ID = 3;
var FENCE_OPEN_SEWER_ID = 4;
}
Symbol 1161 MovieClip [__Packages.jt3_StreetFriend] Frame 0
class jt3_StreetFriend extends jt3_MovingObject
{
var mcRef, strName, strType, SetActiveFlag, bObjectIsMoving, xSpeedCur, ySpeedCur, strAnimStateCur, nFriendBitmapIndex;
function jt3_StreetFriend (l_mcRef) {
super();
mcRef = l_mcRef;
strName = l_mcRef._name;
strType = "Friend";
}
function Die() {
SetActiveFlag(false);
}
function Idle() {
if (bObjectIsMoving == true) {
MoveObject();
}
}
function Release() {
if (bObjectIsMoving == false) {
mcRef._x = 280;
trace("In Released");
xSpeedCur = STARTING_X_SPEED;
mcRef._visible = true;
bObjectIsMoving = true;
} else {
MoveObject();
if (bObjectIsMoving == false) {
SetAnimState("Die");
}
}
}
function Grab() {
if (mcRef.Obj.Etat._currentframe >= FR_GRAB) {
mcRef._visible = false;
bObjectIsMoving = false;
} else {
MoveObject();
}
}
function Pop() {
if (mcRef.Obj.Etat._currentframe >= FR_POP) {
mcRef._visible = false;
SetActiveFlag(false);
SetAnimState("Die");
bObjectIsMoving = false;
} else {
MoveObject();
}
}
function MoveObject() {
var _local2;
var _local5;
var _local4;
var _local3;
_local4 = xSpeedCur;
_local3 = ySpeedCur;
_local2 = mcRef._x + _local4;
_local5 = mcRef._y + _local3;
if (_local2 > X_POSITION_MAX) {
mcRef._visible = false;
bObjectIsMoving = false;
} else {
mcRef._x = _local2;
}
mcRef._y = _local5;
}
function EnterFrame() {
this[strAnimStateCur]();
}
function GetFriendBitmapIndex() {
return(nFriendBitmapIndex);
}
function Init(l_ptObjStartPos, l_FriendBitmapIndexNew) {
mcRef._x = l_ptObjStartPos.x;
mcRef._y = l_ptObjStartPos.y;
nFriendBitmapIndex = l_FriendBitmapIndexNew;
mcRef.Obj.Etat.Friends.gotoAndStop(nFriendBitmapIndex);
mcRef._xscale = MOVIE_CLIP_SCALING_FACTOR;
mcRef._yscale = MOVIE_CLIP_SCALING_FACTOR;
SetAnimState("Idle");
mcRef._visible = true;
xSpeedCur = STARTING_X_SPEED;
ySpeedCur = 0;
bObjectIsMoving = true;
SetActiveFlag(true);
}
function SetAnimState(l_strAnimStateNew) {
if (((l_strAnimStateNew != null) && (l_strAnimStateNew != "")) && (l_strAnimStateNew != undefined)) {
strAnimStateCur = l_strAnimStateNew;
mcRef.Obj.gotoAndStop(strAnimStateCur);
mcRef.Obj.HitRegion._visible = false;
switch (strAnimStateCur) {
case "Release" :
mcRef.Obj.Etat.Friends.gotoAndStop(nFriendBitmapIndex);
break;
case "Grab" :
case "Pop" :
case "Idle" :
mcRef.Obj.Etat.Friends.gotoAndStop(nFriendBitmapIndex);
}
}
}
var X_ACCELERATING_FACTOR = 2;
var Y_ACCELERATING_FACTOR = 0.5;
var STARTING_X_SPEED = 4;
var OBJECT_SPEED_MAX = 14;
var MOVIE_CLIP_SCALING_FACTOR = 60;
var FR_POP = 30;
var FR_GRAB = 15;
var X_POSITION_MAX = Stage.width - 100;
var Y_POSITION_MAX = Stage.height;
}
Symbol 1162 MovieClip [__Packages.jt3_Player] Frame 0
class jt3_Player
{
var mcRef, strAnimStateCur, bArrowKeyUpIsDown, bArrowKeyDownIsDown, bArrowKeyLeftIsDown, bArrowKeyRightIsDown, bControlKeyIsDown, bSpaceBarKeyUpIsDown, bIsTurning, bGoLeft, bGoRight, bShieldOn, bHideTruck, bMissileHitPlayer, bFenceHitPlayer, bPowerUpHitPlayer, bFriendHitPlayer, bDestructoShipHitPlayer, strLastKeyPress, bLaserGunFired, ptPositionCur, nNbrOfKeysUp, nShieldTimeout, nPowerBarRestoreTimeout, nTruckColorIndex, nbTruckDamage, nbTruckPower, nResetHitMissileCounter, nResetHitDestructoCounter, ySpeedCur, xSpeedCur, xAccelCur, yPositionMax, nbTruckDamagePrev, nbTruckPowerPrev, nFreezeTruckCounter, yAccelCur, strDirectionCur, nTruckDamageStatus, nShieldStatus;
function jt3_Player (l_mcRef) {
mcRef = l_mcRef;
strAnimStateCur = new String("Moving");
bArrowKeyUpIsDown = new Boolean(false);
bArrowKeyDownIsDown = new Boolean(false);
bArrowKeyLeftIsDown = new Boolean(false);
bArrowKeyRightIsDown = new Boolean(false);
bControlKeyIsDown = new Boolean(false);
bSpaceBarKeyUpIsDown = new Boolean(false);
bIsTurning = new Boolean(false);
bGoLeft = new Boolean(false);
bGoRight = new Boolean(false);
bShieldOn = new Boolean(false);
bHideTruck = new Boolean(false);
bMissileHitPlayer = new Boolean(false);
bFenceHitPlayer = new Boolean(false);
bPowerUpHitPlayer = new Boolean(false);
bFriendHitPlayer = new Boolean(false);
bMissileHitPlayer = new Boolean(false);
bDestructoShipHitPlayer = new Boolean(false);
strLastKeyPress = new String("nokey");
bLaserGunFired = new Boolean(false);
ptPositionCur = new Object();
nNbrOfKeysUp = 0;
nShieldTimeout = 0;
nPowerBarRestoreTimeout = 0;
nTruckColorIndex = 0;
}
function Hide() {
if (mcRef.Obj.Etat._currentframe >= FR_HIDE) {
mcRef._visible = false;
bHideTruck = false;
}
}
function Bump() {
if (mcRef.Obj.Etat._currentframe >= FR_BUMP) {
if (bHideTruck == false) {
SetAnimState("Moving");
trace("Goto moving hidetruck=false");
} else {
trace("Goto moving hidetruck=true");
SetAnimState("Hide");
}
}
}
function Hurt() {
if (mcRef.Obj.Etat._currentframe >= FR_HURT) {
if (bHideTruck == false) {
SetAnimState("Moving");
} else {
SetAnimState("Hide");
}
}
}
function Moving() {
}
function PowerUp() {
if (mcRef.Obj.Etat._currentframe >= FR_POWERUP) {
if (bHideTruck == false) {
SetAnimState("Moving");
} else {
SetAnimState("Hide");
}
}
}
function TurnLeft() {
}
function TurnRight() {
}
function AddDamagePointsToTruck(l_nDamagePts) {
if (bShieldOn == false) {
nbTruckDamage = nbTruckDamage + l_nDamagePts;
if (nbTruckDamage > 100) {
nbTruckDamage = 100;
_global.C.RemoveOneLifeToPlayer();
}
}
}
function ChangeTruckColor() {
var _local4;
var _local3 = new Object();
_local4 = strAnimStateCur;
strAnimStateCur = "";
_local3.x = mcRef._x;
_local3.y = mcRef._y;
mcRef._visible = false;
mcRef = _global.CS["Truck" + nTruckColorIndex];
SetAnimState(_local4);
if (bShieldOn == true) {
TurnShieldOn(true);
}
mcRef._x = _local3.x;
mcRef._y = _local3.y;
mcRef._visible = true;
}
function CheckHitFrontTentacle() {
var _local3;
var _local4;
_local3 = _global.C.oTentacleFrontTop.GetObjectMcRef();
_local4 = _global.C.oTentacleFrontBottom.GetObjectMcRef();
if (mcRef.Obj.HitRegion.hitTest(_local3) || (mcRef.Obj.HitRegion.hitTest(_local4))) {
SetAnimState("Hurt");
_global.C.oAi.ResetAttackTimeout();
AddDamagePointsToTruck(TRUCK_DAMAGE_UP_STEP / 5);
}
}
function CheckHitFence() {
var _local3;
if (_global.C.oFenceOnStreet != null) {
_local3 = _global.C.oFenceOnStreet.GetObjectMcRef();
if (mcRef.Obj.HitRegion.hitTest(_local3.Obj.HitRegion) && (bFenceHitPlayer == false)) {
trace("Player truck hit fence !!!");
_global.C.oFenceOnStreet.SetAnimState("Pop");
if (bShieldOn == false) {
SetAnimState("Bump");
bFenceHitPlayer = true;
AddDamagePointsToTruck(TRUCK_DAMAGE_UP_STEP / 2);
}
}
} else {
bFenceHitPlayer = false;
}
}
function CheckHitFriend() {
var _local3;
if (_global.C.oFriendOnStreet != null) {
_local3 = _global.C.oFriendOnStreet.GetObjectMcRef();
if (mcRef.Obj.HitRegion.hitTest(_local3.Obj.HitRegion) && (bFriendHitPlayer == false)) {
trace("Player truck hit friend !!!");
SetAnimState("PowerUp");
bFriendHitPlayer = true;
_global.C.bTruckRecuedFriend = true;
_global.C.oFriendOnStreet.SetAnimState("Pop");
_global.S.PlaySound("sndFxPowerUp", 100, 1);
_global.C.oScoreMng.AddPoints(PTS_FRIEND_RESCUED_BY_TRUCK);
_global.C.SetCurrentHudFriendState("Saved");
}
} else {
bFriendHitPlayer = false;
}
}
function CheckHitPowerUp() {
var _local3;
if (_global.C.oPowerUpOnStreet != null) {
_local3 = _global.C.oPowerUpOnStreet.GetObjectMcRef();
if (mcRef.Obj.HitRegion.hitTest(_local3.Obj.HitRegion) && (bPowerUpHitPlayer == false)) {
var _local4;
SetAnimState("PowerUp");
trace("Player truck hit power-up !!!");
_global.C.oPowerUpOnStreet.SetAnimState("Pop");
_global.S.PlaySound("sndFxPowerUp", 100, 1);
_local4 = _global.C.oPowerUpOnStreet.GetID();
switch (_local4) {
case POWER_UP_SHIELD_ID :
nShieldTimeout = FR_SHIELDED_TIMEOUT;
TurnShieldOn(true);
break;
case POWER_UP_BATTERY_ID :
nbTruckPower = nbTruckPower + TRUCK_BATTERY_POWER_UP_STEP;
break;
case POWER_UP_REPAIR_ID :
nbTruckDamage = nbTruckDamage - TRUCK_REPAIR_POWER_DOWN_STEP;
if (nbTruckDamage < 1) {
nbTruckDamage = 1;
}
break;
case POWER_UP_EXTRALIFE_ID :
_global.C.AddPlayerExtraLife();
}
_global.C.oScoreMng.AddPoints(PTS_POWER_UP_COLLECTED_BY_TRUCK);
bPowerUpHitPlayer = true;
}
} else {
bPowerUpHitPlayer = false;
}
}
function CheckHitMissile() {
var _local6;
var _local9 = new Boolean();
var _local3;
var _local5;
var _local7;
var _local11;
var _local4 = new String();
var _local10 = new String();
var _local12 = new Boolean(false);
_local12 = _global.C.oPlayerBullet.IsObjectMoving();
for (_local6 in _global.C.aMovingObjects) {
if (_global.C.aMovingObjects[_local6] != undefined) {
_local9 = _global.C.aMovingObjects[_local6].GetActiveFlag();
if (_local9 == true) {
_local3 = _global.C.aMovingObjects[_local6];
_local7 = _local3.GetObjectMcRef();
_local4 = _local3.GetType();
if (_local12 == true) {
_local11 = _global.C.oPlayerBullet.GetObjectMcRef();
if (_local11.hitTest(_local7)) {
trace("Bullet hit missile !!!");
_global.C.oPlayerBullet.StopBullet();
_global.S.PlaySound("sndFxHandExplosion", 100, 1);
_local5 = jt3_SurlyMissile(_local3);
_local5.SetAnimState("Explode");
}
}
if (mcRef.Obj.HitRegion.hitTest(_local7)) {
trace(" Type of moving object = " + _local4);
if ((_local4 == "Missile") && (bMissileHitPlayer == false)) {
trace("Missile hit player truck !!!");
bMissileHitPlayer = true;
_local5 = jt3_SurlyMissile(_local3);
_local10 = _local5.GetCurrentAnimState();
if (_local10 == "Moving") {
_local5.SetAnimState("Explode");
_global.S.PlaySound("sndFxTruckHurt", 100, 1);
_global.C.oAi.ResetAttackTimeout();
if (bShieldOn == false) {
SetAnimState("Hurt");
AddDamagePointsToTruck(TRUCK_DAMAGE_UP_STEP);
bMissileHitPlayer = true;
nResetHitMissileCounter = 20;
}
}
}
_local4 = "DestructoShip";
if (_local4 && (bDestructoShipHitPlayer == false)) {
var _local8;
trace("DestructoShip hit player truck !!!");
bMissileHitPlayer = true;
_local8 = jt3_SurlyDestructoShip(_local3);
_local8.SetAnimState("Explode");
_global.S.PlaySound("sndFxTruckHurt", 100, 1);
_global.C.oAi.ResetAttackTimeout();
if (bShieldOn == false) {
SetAnimState("Hurt");
AddDamagePointsToTruck(TRUCK_DAMAGE_UP_STEP);
bDestructoShipHitPlayer = true;
nResetHitDestructoCounter = 20;
}
}
} else if (_local4 == "Missile") {
nResetHitMissileCounter--;
if (nResetHitMissileCounter < 0) {
bMissileHitPlayer = false;
}
} else {
nResetHitDestructoCounter--;
if (nResetHitDestructoCounter < 0) {
bDestructoShipHitPlayer = false;
}
}
}
}
}
}
function CheckRoadChange(l_dir) {
var _local2 = new Object();
var _local3 = new Number();
var _local1 = false;
return(_local1);
}
function MovePlayer() {
var _local5;
var _local4;
var _local3;
var _local6;
_local6 = ySpeedCur + (_global.C.nTracktorBeamYSpeedReducer * 1.5);
if (xSpeedCur == 0) {
_local3 = _global.C.nTracktorBeamXSpeedReducer;
} else if (xSpeedCur > 0) {
_local3 = xSpeedCur + ((xAccelCur + (_global.C.nTracktorBeamXSpeedReducer * 4)) / 1.5);
if (_local3 > TRUCK_SPEED_MAX) {
_local3 = TRUCK_SPEED_MAX / 1.5;
}
} else if (xSpeedCur < 0) {
_local3 = xSpeedCur - (xAccelCur - (_global.C.nTracktorBeamXSpeedReducer * 4));
if (_local3 < (-TRUCK_SPEED_MAX)) {
_local3 = -TRUCK_SPEED_MAX;
}
}
_local5 = mcRef._x + _local3;
_local4 = mcRef._y + _local6;
if (_local5 > POS_XMAX) {
mcRef._x = POS_XMAX;
} else if (_local5 < POS_XMIN) {
mcRef._x = POS_XMIN;
} else {
mcRef._x = _local5;
}
if (_local4 > yPositionMax) {
if (strAnimStateCur != "Moving") {
SetAnimState("Moving");
}
mcRef._y = yPositionMax;
} else if (_local4 < POS_YMIN) {
if (strAnimStateCur != "Moving") {
SetAnimState("Moving");
}
mcRef._y = POS_YMIN;
} else {
mcRef._y = _local4;
}
}
function TurnShieldOff(l_bFadeOut) {
if (l_bFadeOut == true) {
mcRef.Obj.Shield.gotoAndPlay("Shield2");
} else {
mcRef.Obj.Shield.gotoAndStop("Shield0");
}
bShieldOn = false;
_global.S.StopSound("sndFxTruckShield");
}
function TurnShieldOn(l_bShowShield) {
bShieldOn = true;
if (l_bShowShield == true) {
mcRef.Obj.Shield.gotoAndStop("Shield1");
_global.S.PlaySound("sndFxTruckShield", 100, 1);
}
}
function UpdateHudDisplay() {
if (nbTruckDamage != nbTruckDamagePrev) {
_global.CS.Hud.DamageBar.gotoAndStop(nbTruckDamage);
nbTruckDamagePrev = nbTruckDamage;
}
if (nbTruckPower != nbTruckPowerPrev) {
if (nbTruckPower > 100) {
_global.CS.Hud.PowerBar.gotoAndStop(100);
} else {
_global.CS.Hud.PowerBar.gotoAndStop(nbTruckPower);
}
nbTruckPowerPrev = nbTruckPower;
}
}
function EnterFrame() {
if ((mcRef._visible == true) && (bHideTruck == false)) {
HandleSpaceAndCtrlDown();
nPowerBarRestoreTimeout--;
if (nPowerBarRestoreTimeout < 0) {
if (_global.C.nGameLevelCur < LAST_LEVEL_NUMBER) {
nbTruckPower = nbTruckPower + TRUCK_POWERBAR_UP_STEP;
} else {
nbTruckPower = nbTruckPower + (TRUCK_POWERBAR_UP_STEP * 2);
}
if (nbTruckPower > 100) {
nbTruckPower = 100;
}
nPowerBarRestoreTimeout = 50;
}
if (nShieldTimeout > 0) {
nShieldTimeout--;
if ((nShieldTimeout == 0) && (bShieldOn == true)) {
TurnShieldOff();
}
} else if (nbTruckPower < 2) {
TurnShieldOff();
} else if (bShieldOn == true) {
TurnShieldOn(true);
}
if (nFreezeTruckCounter < 0) {
MovePlayer();
} else {
nFreezeTruckCounter--;
if (nFreezeTruckCounter < 0) {
if ((strLastKeyPress == "up") && (nNbrOfKeysUp > 0)) {
SetAnimState("TurnRight");
}
if ((strLastKeyPress == "down") && (nNbrOfKeysUp > 0)) {
SetAnimState("TurnLeft");
}
}
}
this[strAnimStateCur]();
if (_global.C.nGameLevelCur < LAST_LEVEL_NUMBER) {
CheckHitMissile();
CheckHitFriend();
CheckHitFence();
CheckHitPowerUp();
} else {
CheckHitMissile();
if (bShieldOn == false) {
CheckHitFrontTentacle();
}
CheckHitFence();
CheckHitPowerUp();
}
UpdateTruckDamage();
} else {
this[strAnimStateCur]();
}
UpdateHudDisplay();
}
function FireLaserGun() {
if (bLaserGunFired == false) {
nbTruckPower = nbTruckPower - TRUCK_LASER_POWER_DOWN_STEP;
if (nbTruckPower < 2) {
nbTruckPower = 1;
} else {
_global.C.oPlayerBullet.Init(_global.C.oPlayer.GetObjectPosition(), strAnimStateCur);
mcRef.Obj.Laser.Type1.gotoAndPlay("Fire");
_global.S.PlaySound("sndFxTruckLaserGun", 100, 1);
bLaserGunFired = true;
}
}
}
function GetCurrentAnimState() {
return(strAnimStateCur);
}
function GetStageCoord() {
var _local2 = new Object();
_local2.x = mcRef._x;
_local2.y = mcRef._y;
mcRef._parent.localToGlobal(_local2);
return(_local2);
}
function HandleKeyDown(l_strKeyPress) {
strLastKeyPress = l_strKeyPress;
switch (l_strKeyPress) {
case "up" :
if (bArrowKeyUpIsDown == false) {
ySpeedCur = -4;
bArrowKeyUpIsDown = true;
SetAnimState("TurnRight");
nNbrOfKeysUp++;
bIsTurning = true;
}
break;
case "down" :
if (bArrowKeyDownIsDown == false) {
ySpeedCur = 4;
bArrowKeyDownIsDown = true;
SetAnimState("TurnLeft");
nNbrOfKeysUp++;
bIsTurning = true;
}
break;
case "left" :
if (bArrowKeyLeftIsDown == false) {
bGoLeft = true;
xSpeedCur = -3;
bArrowKeyLeftIsDown = true;
SetAnimState("Moving");
nNbrOfKeysUp++;
}
if (xAccelCur == 0) {
xAccelCur = X_ACCELERATING_FACTOR;
} else {
xAccelCur = xAccelCur + X_ACCELERATING_FACTOR;
}
break;
case "right" :
if (bArrowKeyRightIsDown == false) {
bGoRight = true;
xSpeedCur = 2;
bArrowKeyRightIsDown = true;
SetAnimState("Moving");
nNbrOfKeysUp++;
}
if (xAccelCur == 0) {
xAccelCur = X_ACCELERATING_FACTOR;
} else {
xAccelCur = xAccelCur + X_ACCELERATING_FACTOR;
}
break;
case "space" :
if (bSpaceBarKeyUpIsDown == false) {
bSpaceBarKeyUpIsDown = true;
nNbrOfKeysUp++;
}
break;
case "ctrl" :
if (bControlKeyIsDown != false) {
break;
}
bControlKeyIsDown = true;
nNbrOfKeysUp++;
}
}
function HandleSpaceAndCtrlDown() {
if (bControlKeyIsDown == true) {
if (nShieldTimeout == 0) {
nbTruckPower = nbTruckPower - TRUCK_SHIELD_POWER_DOWN_STEP;
if (nbTruckPower < 2) {
nbTruckPower = 1;
TurnShieldOff(false);
} else if (nbTruckPower > 2) {
TurnShieldOn(true);
}
}
}
if (bSpaceBarKeyUpIsDown == true) {
if (_global.C.oPlayerBullet.IsObjectMoving() == false) {
FireLaserGun();
}
}
}
function HandleKeyUp(l_strKeyPress) {
switch (l_strKeyPress) {
case "up" :
bArrowKeyUpIsDown = false;
if (bArrowKeyDownIsDown == false) {
ySpeedCur = 0;
}
nNbrOfKeysUp--;
bIsTurning = false;
break;
case "down" :
bArrowKeyDownIsDown = false;
if (bArrowKeyUpIsDown == false) {
ySpeedCur = 0;
}
nNbrOfKeysUp--;
bIsTurning = false;
break;
case "left" :
bGoLeft = false;
bArrowKeyLeftIsDown = false;
nNbrOfKeysUp--;
break;
case "right" :
bGoRight = false;
bArrowKeyRightIsDown = false;
nNbrOfKeysUp--;
break;
case "space" :
bSpaceBarKeyUpIsDown = false;
bLaserGunFired = false;
nNbrOfKeysUp--;
break;
case "ctrl" :
bControlKeyIsDown = false;
if (nShieldTimeout == 0) {
if (nbTruckPower > 1) {
TurnShieldOff(true);
} else {
TurnShieldOff(false);
}
}
nNbrOfKeysUp--;
break;
case "v" :
trace("Press v key ... ");
nTruckColorIndex++;
nTruckColorIndex = nTruckColorIndex % 3;
ChangeTruckColor();
}
if (nNbrOfKeysUp <= 0) {
SetAnimState("Moving");
nNbrOfKeysUp = 0;
xSpeedCur = 0;
ySpeedCur = 0;
xAccelCur = 0;
yAccelCur = 0;
} else if ((nNbrOfKeysUp == 1) && (bControlKeyIsDown == true)) {
SetAnimState("Moving");
xSpeedCur = 0;
ySpeedCur = 0;
xAccelCur = 0;
yAccelCur = 0;
}
}
function GetObjectMcRef() {
return(mcRef);
}
function GetObjectPosition() {
ptPositionCur.x = mcRef._x;
ptPositionCur.y = mcRef._y;
return(ptPositionCur);
}
function Init(l_nLevelNumber) {
mcRef._x = GAME_STARTING_X_POS;
mcRef._y = GAME_STARTING_Y_POS;
trace("Level in player init" + l_nLevelNumber);
if (l_nLevelNumber < LAST_LEVEL_NUMBER) {
yPositionMax = POS_YMAX - 32;
trace("Y pos max" + yPositionMax);
} else {
yPositionMax = POS_YMAX - 25;
trace("Y pos max2" + POS_YMAX);
}
mcRef._visible = true;
_global.S.PlaySound("sndFxTruckMoving", 100, 9999);
bArrowKeyUpIsDown = false;
bArrowKeyDownIsDown = false;
bArrowKeyLeftIsDown = false;
bArrowKeyRightIsDown = false;
bControlKeyIsDown = false;
bSpaceBarKeyUpIsDown = false;
bIsTurning = false;
bGoRight = false;
bGoLeft = false;
trace("In Player INIT nShieldTimeout : " + nShieldTimeout);
bShieldOn = false;
nShieldTimeout = 0;
nPowerBarRestoreTimeout = 0;
bHideTruck = false;
xSpeedCur = 0;
ySpeedCur = 0;
xAccelCur = 0;
yAccelCur = 0;
nNbrOfKeysUp = 0;
strDirectionCur = null;
nFreezeTruckCounter = -1;
nResetHitMissileCounter = -1;
nResetHitDestructoCounter = -1;
nbTruckDamage = 1;
nbTruckDamagePrev = nbTruckDamage;
nbTruckPower = 100;
nbTruckPowerPrev = nbTruckPower;
nTruckDamageStatus = 0;
mcRef.gotoAndStop("Damage" + nTruckDamageStatus);
mcRef.Obj.Laser.Type1.gotoAndStop("Stop");
_global.CS.Hud.DamageBar.gotoAndStop(nbTruckDamage);
_global.CS.Hud.PowerBar.gotoAndStop(nbTruckPower);
strAnimStateCur = "";
SetAnimState("Moving");
nShieldStatus = 0;
mcRef.Obj.Shield.gotoAndStop("Shield" + nShieldStatus);
}
function MissileHitPlayer() {
var _local2 = new Boolean();
_local2 = bMissileHitPlayer;
bMissileHitPlayer = false;
return(_local2);
}
function RestartWithNewLife() {
}
function SetAnimState(l_strAnimStateNew) {
if (((l_strAnimStateNew != null) && (l_strAnimStateNew != "")) && (l_strAnimStateNew != undefined)) {
if (strAnimStateCur != "Hide") {
if ((bShieldOn == true) && (l_strAnimStateNew == "Hurt")) {
} else {
if (nFreezeTruckCounter < 0) {
if (((l_strAnimStateNew == "Hurt") || (l_strAnimStateNew == "Bump")) || (l_strAnimStateNew == "PowerUp")) {
trace("Reset FreezeCounter !!!!");
nFreezeTruckCounter = 15;
}
strAnimStateCur = l_strAnimStateNew;
mcRef.Obj.gotoAndStop(strAnimStateCur);
} else if (((l_strAnimStateNew == "Hurt") || (l_strAnimStateNew == "Bump")) || (l_strAnimStateNew == "PowerUp")) {
trace("Reset FreezeCounter !!!!");
nFreezeTruckCounter = 15;
strAnimStateCur = l_strAnimStateNew;
mcRef.Obj.gotoAndStop(strAnimStateCur);
} else if (l_strAnimStateNew == "Hide") {
strAnimStateCur = l_strAnimStateNew;
mcRef.Obj.gotoAndStop(strAnimStateCur);
}
if (bShieldOn == false) {
TurnShieldOff();
}
}
}
mcRef.Obj.HitRegion._visible = false;
_global.C.oSurlyTheVillain.SetMovieClipForPlayerHitTest(mcRef.Obj.HitRegion);
}
}
function HideTruck() {
bHideTruck = true;
SetAnimState("Hide");
}
function ShowTruck() {
bHideTruck = false;
mcRef._visible = true;
SetAnimState("Moving");
}
function ResetCtrlAndSpaceKeyDown() {
bControlKeyIsDown = false;
bSpaceBarKeyUpIsDown = false;
}
function ResetLaserGun() {
bLaserGunFired = false;
}
function ResumeShield() {
if (nShieldTimeout > 0) {
TurnShieldOn(true);
}
}
function SetVisibleFlagTo(l_bIsVisible) {
mcRef._visible = l_bIsVisible;
}
function UpdateTruckDamage() {
var _local2 = nTruckDamageStatus;
if (nbTruckDamage < 30) {
nTruckDamageStatus = 0;
} else if (nbTruckDamage < 70) {
nTruckDamageStatus = 1;
} else {
nTruckDamageStatus = 2;
}
if (_local2 != nTruckDamageStatus) {
mcRef.gotoAndStop("Damage" + nTruckDamageStatus);
mcRef.Obj.gotoAndStop(strAnimStateCur);
mcRef.Obj.HitRegion._visible = false;
mcRef.Obj.Laser.Type1.gotoAndStop("Stop");
nShieldStatus = 0;
mcRef.Obj.Shield.gotoAndStop("Shield" + nShieldStatus);
}
}
var LAST_LEVEL_NUMBER = 5;
var LEFT_SCREEN_BOUND = 100;
var RIGHT_SCREEN_BOUND = 250;
var TOP_SCREEN_BOUND = 30;
var BOTTOM_SCREEN_BOUND = 50;
var POS_XMIN = jt3_Player.prototype.LEFT_SCREEN_BOUND;
var POS_YMIN = jt3_Player.prototype.TOP_SCREEN_BOUND;
var POS_XMAX = Stage.width - jt3_Player.prototype.RIGHT_SCREEN_BOUND;
var POS_YMAX = Stage.height - jt3_Player.prototype.BOTTOM_SCREEN_BOUND;
var GAME_STARTING_X_POS = 230;
var GAME_STARTING_Y_POS = 130;
var X_ACCELERATING_FACTOR = 1;
var Y_ACCELERATING_FACTOR = 0.5;
var XSPEED_SLOWING_FACTOR = 40;
var YSPEED_SLOWING_FACTOR = 100;
var WATER_FRICTION_FACTOR = 0.1;
var TRUCK_SPEED_MAX = 14;
var TRUCK_LASER_POWER_DOWN_STEP = 5;
var TRUCK_POWERBAR_UP_STEP = 4;
var TRUCK_SHIELD_POWER_DOWN_STEP = 1;
var TRUCK_BATTERY_POWER_UP_STEP = 40;
var TRUCK_REPAIR_POWER_DOWN_STEP = 30;
var TRUCK_DAMAGE_UP_STEP = 10;
var PTS_FRIEND_RELEASE_FROM_TENTACLE = 100;
var PTS_FRIEND_RESCUED_BY_TRUCK = 250;
var PTS_POWER_UP_COLLECTED_BY_TRUCK = 100;
var PTS_HIT_ON_SURLY_HEAD = 50;
var FR_HIDE = 25;
var FR_BUMP = 25;
var FR_HURT = 30;
var FR_POWERUP = 30;
var FR_ENDJUMP = 30;
var FR_FREEZETRUCK = 2;
var FR_SHIELDED_TIMEOUT = 180;
var POWER_UP_REPAIR_ID = 1;
var POWER_UP_BATTERY_ID = 2;
var POWER_UP_SHIELD_ID = 3;
var POWER_UP_EXTRALIFE_ID = 4;
}
Symbol 1163 MovieClip [__Packages.jt3_SurlyMissile] Frame 0
class jt3_SurlyMissile extends jt3_MovingObject
{
var mcRef, strName, strType, strAnimStateCur, ptTmp, bObjectIsMoving, SetActiveFlag, xAccelCur, xSpeedCur, xPositionMax, ySpeedCur, nWaitForXFrames, yPositionMax;
function jt3_SurlyMissile (l_mcRef) {
super();
mcRef = l_mcRef;
strName = l_mcRef._name;
strType = "Missile";
mcRef._visible = false;
strAnimStateCur = new String();
ptTmp = new Object();
}
function Die() {
mcRef._visible = false;
bObjectIsMoving = false;
SetActiveFlag(false);
}
function Explode() {
if (mcRef.Obj.Etat._currentframe >= FR_EXPLODE) {
SetAnimState("Die");
} else {
xAccelCur = 0;
xSpeedCur = STARTING_X_SPEED;
MoveObject();
}
}
function Moving() {
MoveObject();
ptTmp.x = mcRef._x;
ptTmp.y = mcRef._y;
mcRef._parent.localToGlobal(ptTmp);
if (ptTmp.x < xPositionMax) {
xSpeedCur = xSpeedCur / XY_SLOWING_SPEED_FACTOR;
ySpeedCur = ySpeedCur / XY_SLOWING_SPEED_FACTOR;
SetActiveFlag(false);
SetAnimState("Die");
}
if ((ptTmp.y < 0) || (ptTmp.y > Stage.height)) {
xSpeedCur = xSpeedCur / XY_SLOWING_SPEED_FACTOR;
ySpeedCur = ySpeedCur / XY_SLOWING_SPEED_FACTOR;
SetActiveFlag(false);
SetAnimState("Explode");
}
}
function ComputeXYSpeedWithAngle() {
var _local7 = new Object();
var _local9 = new Object();
var _local12;
var _local8;
var _local11 = 57.2957795130823;
var _local10;
var _local6;
var _local5;
var _local4;
var _local3;
_local7 = _global.C.oPlayer.GetObjectPosition();
_local9 = GetStageCoord();
_local6 = _local9.x - _local7.x;
_local5 = (_local9.y - _local7.y) - 30;
_local8 = Math.atan2(_local5, _local6);
_local12 = _local8 * _local11;
mcRef._rotation = mcRef._rotation + _local12;
_local10 = Math.sqrt((_local6 * _local6) + (_local5 * _local5));
_local4 = Math.cos(_local8) * _local10;
_local3 = Math.sin(_local8) * _local10;
if (_local4 > _local3) {
_local3 = _local3 / _local4;
_local4 = _local4 / _local4;
} else {
_local4 = _local4 / _local3;
_local3 = _local3 / _local3;
}
xSpeedCur = (-1 * _local4) * XY_SPEED_FACTOR;
ySpeedCur = (-1 * _local3) * XY_SPEED_FACTOR;
}
function GetStageCoord() {
var _local2 = new Object();
_local2.x = mcRef._x;
_local2.y = mcRef._y;
mcRef._parent.localToGlobal(_local2);
return(_local2);
}
function MoveObject() {
mcRef._x = mcRef._x + xSpeedCur;
mcRef._y = mcRef._y + ySpeedCur;
}
function EnterFrame() {
this[strAnimStateCur]();
}
function GetCurrentAnimState() {
return(strAnimStateCur);
}
function Init() {
nWaitForXFrames = 0;
SetAnimState("Moving");
mcRef._visible = true;
xAccelCur = X_ACCELERATING_FACTOR;
ComputeXYSpeedWithAngle();
xPositionMax = -50;
yPositionMax = Stage.height;
bObjectIsMoving = true;
}
function SetAnimState(l_strAnimStateNew) {
if (((l_strAnimStateNew != null) && (l_strAnimStateNew != "")) && (l_strAnimStateNew != undefined)) {
strAnimStateCur = l_strAnimStateNew;
mcRef.Obj.gotoAndStop(strAnimStateCur);
}
}
var BULLET_X_RANGE = 100;
var STARTING_X_POS = -60;
var STARTING_Y_POS_LEFTARM = 230;
var STARTING_Y_POS_RIGHTARM = 44;
var X_ACCELERATING_FACTOR = 2;
var XY_SPEED_FACTOR = 10;
var XY_SLOWING_SPEED_FACTOR = 3;
var STARTING_X_SPEED = -2;
var BULLET_SPEED_MAX = 14;
var FR_EXPLODE = 30;
}
Symbol 1164 MovieClip [__Packages.jt3_SurlyDestructoShip] Frame 0
class jt3_SurlyDestructoShip extends jt3_MovingObject
{
var mcRef, strName, strType, SetActiveFlag, bDestructoShipHitSurly, bObjectIsMoving, xAccelCur, xSpeedCur, ySpeedCur, xPositionMax, strAnimStateCur;
function jt3_SurlyDestructoShip (l_mcRef) {
super();
mcRef = l_mcRef;
strName = l_mcRef._name;
strType = "DestructoShip";
SetActiveFlag(true);
bDestructoShipHitSurly = new Boolean(false);
}
function Die() {
SetActiveFlag(false);
}
function Explode() {
if (mcRef.Obj.Etat._currentframe >= FR_EXPLODE) {
mcRef._visible = false;
bObjectIsMoving = false;
SetAnimState("Die");
bDestructoShipHitSurly = false;
} else {
xAccelCur = 0;
xSpeedCur = STARTING_X_SPEED;
MoveObject();
}
}
function Moving() {
if (bObjectIsMoving == true) {
MoveObject();
xAccelCur++;
}
}
function MoveObject() {
var _local4;
var _local6;
var _local3;
var _local5;
_local5 = ySpeedCur;
_local3 = xSpeedCur + xAccelCur;
if (_local3 > BULLET_SPEED_MAX) {
_local3 = BULLET_SPEED_MAX;
}
_local4 = mcRef._x + _local3;
_local6 = mcRef._y + _local5;
if (_local4 > xPositionMax) {
SetAnimState("Explode");
if (bDestructoShipHitSurly == false) {
_global.C.DestructoShipHurtSurly();
bDestructoShipHitSurly = true;
}
} else {
mcRef._x = _local4;
}
mcRef._y = _local6;
}
function EnterFrame() {
this[strAnimStateCur]();
}
function Init() {
mcRef._xscale = MOVIE_CLIP_SCALING_FACTOR;
mcRef._yscale = MOVIE_CLIP_SCALING_FACTOR;
SetAnimState("Moving");
mcRef._visible = true;
xSpeedCur = STARTING_X_SPEED;
ySpeedCur = 0;
xAccelCur = X_ACCELERATING_FACTOR;
xPositionMax = mcRef._x + BULLET_X_RANGE;
bObjectIsMoving = true;
}
function SetAnimState(l_strAnimStateNew) {
if (((l_strAnimStateNew != null) && (l_strAnimStateNew != "")) && (l_strAnimStateNew != undefined)) {
strAnimStateCur = l_strAnimStateNew;
mcRef.Obj.gotoAndStop(strAnimStateCur);
}
}
function StopBullet() {
mcRef._visible = false;
bObjectIsMoving = false;
}
var STARTING_OFFSET_X_POS = 20;
var STARTING_OFFSET_Y_POS = Stage.height / 2;
var BULLET_X_RANGE = 430;
var X_ACCELERATING_FACTOR = 1;
var STARTING_X_SPEED = 2;
var BULLET_SPEED_MAX = 10;
var MOVIE_CLIP_SCALING_FACTOR = 80;
var FR_EXPLODE = 25;
var FR_DIE = 30;
}
Symbol 1165 MovieClip [__Packages.jt3_PlayerBullet] Frame 0
class jt3_PlayerBullet extends jt3_MovingObject
{
var mcRef, strName, strType, ySpeedCur, xAccelCur, xSpeedCur, xPositionMax, bObjectIsMoving;
function jt3_PlayerBullet (l_mcRef) {
super();
mcRef = l_mcRef;
strName = l_mcRef._name;
strType = "Bullet";
}
function MoveObject() {
var _local3;
var _local5;
var _local2;
var _local4;
_local4 = ySpeedCur;
_local2 = xSpeedCur + xAccelCur;
if (_local2 > BULLET_SPEED_MAX) {
_local2 = BULLET_SPEED_MAX;
}
_local3 = mcRef._x + _local2;
_local5 = mcRef._y + _local4;
if (_local3 > xPositionMax) {
StopBullet();
} else {
mcRef._x = _local3;
}
mcRef._y = _local5;
}
function EnterFrame() {
if (bObjectIsMoving == true) {
MoveObject();
xAccelCur++;
}
}
function Init(l_ptPlayerPosition, l_strTruckState) {
switch (l_strTruckState) {
case "Moving" :
mcRef._x = l_ptPlayerPosition.x + TRUCK_MOVING_OFFSET_X_POS;
mcRef._y = l_ptPlayerPosition.y + TRUCK_MOVING_OFFSET_Y_POS;
break;
case "TurnLeft" :
mcRef._x = l_ptPlayerPosition.x + TRUCK_TURNLEFT_OFFSET_X_POS;
mcRef._y = l_ptPlayerPosition.y + TRUCK_TURNLEFT_OFFSET_Y_POS;
break;
case "TurnRight" :
mcRef._x = l_ptPlayerPosition.x + TRUCK_TURNRIGHT_OFFSET_X_POS;
mcRef._y = l_ptPlayerPosition.y + TRUCK_TURNRIGHT_OFFSET_Y_POS;
}
mcRef._xscale = MOVIE_CLIP_SCALING_FACTOR;
mcRef._yscale = MOVIE_CLIP_SCALING_FACTOR;
mcRef._visible = true;
xSpeedCur = STARTING_X_SPEED;
ySpeedCur = 0;
xAccelCur = X_ACCELERATING_FACTOR;
xPositionMax = mcRef._x + BULLET_X_RANGE;
bObjectIsMoving = true;
}
function StopBullet() {
mcRef._visible = false;
bObjectIsMoving = false;
_global.C.oPlayer.ResetLaserGun();
}
var TRUCK_MOVING_OFFSET_X_POS = 20;
var TRUCK_TURNLEFT_OFFSET_X_POS = 20;
var TRUCK_TURNRIGHT_OFFSET_X_POS = 20;
var TRUCK_MOVING_OFFSET_Y_POS = 10;
var TRUCK_TURNLEFT_OFFSET_Y_POS = 0;
var TRUCK_TURNRIGHT_OFFSET_Y_POS = 13;
var BULLET_X_RANGE = 320;
var X_ACCELERATING_FACTOR = 2;
var STARTING_X_SPEED = 2;
var BULLET_SPEED_MAX = 14;
var MOVIE_CLIP_SCALING_FACTOR = 60;
}
Symbol 1166 MovieClip [__Packages.jt3_BackTentacle] Frame 0
class jt3_BackTentacle
{
var mcRef, strAnimStateCur, ptPositionCur, nGrabHitsCount, nNoGrabHitsCount, nFriendBitmapIndex;
function jt3_BackTentacle (l_mcRef) {
mcRef = l_mcRef;
strAnimStateCur = new String();
ptPositionCur = new Object();
}
function Die() {
if (mcRef.Obj.Etat._currentframe >= FR_DIE) {
mcRef._visible = false;
}
}
function GoBack() {
if (mcRef.Obj.Etat._currentframe >= FR_GOBACK) {
SetAnimState("Idle");
}
}
function Grab() {
if (mcRef.Obj.Etat._currentframe >= FR_GRAB) {
SetAnimState("GrabHold");
trace("Grab terminated, goto Grabhold state");
}
}
function GrabHold() {
}
function GrabHurt() {
if (mcRef.Obj.Etat._currentframe >= FR_GRABHURT) {
SetAnimState("GrabHold");
nGrabHitsCount++;
if (nGrabHitsCount >= TENTACLE_GRABHOLD_HITS_MAX) {
nGrabHitsCount = 0;
SetAnimState("Release");
}
}
}
function Hurt() {
if (mcRef.Obj.Etat._currentframe >= FR_HURT) {
SetAnimState("Idle");
nNoGrabHitsCount++;
if (nNoGrabHitsCount >= TENTACLE_NOGRAB_HITS_MAX) {
nNoGrabHitsCount = 0;
SetAnimState("Retract");
}
}
}
function Idle() {
}
function Retract() {
if (mcRef.Obj.Etat._currentframe >= FR_RETRACT) {
SetAnimState("Retracted");
}
}
function Retracted() {
if (mcRef.Obj.Etat._currentframe >= FR_RETRACTED) {
SetAnimState("GoBack");
}
}
function Release() {
if (mcRef.Obj.Etat._currentframe >= FR_RELEASE) {
SetAnimState("Idle");
}
}
function EnterFrame() {
this[strAnimStateCur]();
}
function GetObjectMcRef() {
return(mcRef);
}
function GetStageCoord() {
var _local2 = new Object();
_local2.x = mcRef._x;
_local2.y = mcRef._y;
mcRef._parent.localToGlobal(_local2);
return(_local2);
}
function GetObjectPosition() {
ptPositionCur.x = mcRef._x;
ptPositionCur.y = mcRef._y;
return(ptPositionCur);
}
function Init() {
mcRef._visible = true;
nNoGrabHitsCount = 0;
nGrabHitsCount = 0;
SetAnimState("Idle");
}
function SetAnimState(l_strAnimStateNew) {
if (((l_strAnimStateNew != null) && (l_strAnimStateNew != "")) && (l_strAnimStateNew != undefined)) {
strAnimStateCur = l_strAnimStateNew;
mcRef.Obj.gotoAndStop(strAnimStateCur);
if (strAnimStateCur == "GrabHold") {
mcRef.Obj.Friends.gotoAndStop(nFriendBitmapIndex);
}
}
}
function SetFriendBitmapIndex(l_nBitmapIndex) {
nFriendBitmapIndex = l_nBitmapIndex;
}
function SetVisibleFlagTo(l_bIsVisible) {
mcRef._visible = l_bIsVisible;
}
var TENTACLE_NOGRAB_HITS_MAX = 3;
var TENTACLE_GRABHOLD_HITS_MAX = 3;
var FR_DIE = 30;
var FR_GOBACK = 20;
var FR_GRAB = 40;
var FR_GRABHURT = 20;
var FR_HURT = 25;
var FR_RELEASE = 20;
var FR_RETRACT = 10;
var FR_RETRACTED = 90;
}
Symbol 1167 MovieClip [__Packages.jt3_FrontTentacle] Frame 0
class jt3_FrontTentacle
{
var mcRef, strAnimStateCur, ptPositionCur, mcRefDestructoShip, bDestructoShipLoaded, oDestructoShip, nTimeOut;
function jt3_FrontTentacle (l_mcRef, l_mcRefDestructoShip) {
mcRef = l_mcRef;
strAnimStateCur = new String();
ptPositionCur = new Object();
mcRefDestructoShip = l_mcRefDestructoShip;
bDestructoShipLoaded = new Boolean(false);
oDestructoShip = null;
}
function Stop() {
}
function Attack() {
if (mcRef.Obj.Etat._currentframe == FR_ATTACK_MID) {
oDestructoShip.Init();
bDestructoShipLoaded = false;
}
if (mcRef.Obj.Etat._currentframe >= FR_ATTACK_END) {
GenerateNewTimeOut();
SetAnimState("Idle");
}
}
function Die() {
if (mcRef.Obj.Etat._currentframe >= FR_DIE) {
mcRef._visible = false;
}
}
function Idle() {
nTimeOut--;
if (nTimeOut <= 0) {
SetAnimState("Retract");
_global.S.PlaySound("sndFxTentacleRetract", 100, 1);
}
}
function Punch() {
if (mcRef.Obj.Etat._currentframe >= FR_PUNCH) {
SetAnimState("Idle");
}
}
function Retract() {
if (mcRef.Obj.Etat._currentframe >= FR_RETRACT) {
GenerateNewTimeOut();
SetAnimState("Retracted");
}
}
function Retracted() {
nTimeOut--;
if (nTimeOut <= 0) {
var _local3 = _global.C.oPlayer.GetObjectMcRef();
var _local4;
var _local5;
_local4 = mcRef._x - _local3._x;
trace("Player x: " + _local3._x);
trace("Minimum x dist :" + MINIMUM_X_DISTANCE_FOR_PUNCH);
if ((bDestructoShipLoaded == true) && (_local3._x > MINIMUM_X_DISTANCE_FOR_PUNCH)) {
SetAnimState("Attack");
_global.S.PlaySound("sndFxTentacleAttack", 100, 1);
trace(".............Attack player");
} else {
SetAnimState("Punch");
_global.S.PlaySound("sndFxTentaclePunch", 100, 1);
trace(".............Make a punch");
}
}
}
function GenerateNewTimeOut() {
nTimeOut = Math.round(Math.random() * 100) + 20;
trace("New timeout value = " + nTimeOut);
}
function EnterFrame() {
this[strAnimStateCur]();
if (oDestructoShip != null) {
oDestructoShip.EnterFrame();
}
}
function FireDestructoShip(l_nYPos) {
var _local2 = new Boolean(false);
if (oDestructoShip != null) {
_local2 = oDestructoShip.IsObjectMoving();
}
if ((bDestructoShipLoaded == false) && (_local2 == false)) {
mcRefDestructoShip._x = STARTING_OFFSET_X_POS;
mcRefDestructoShip._y = STARTING_OFFSET_Y_POS;
if (l_nYPos == 0) {
mcRefDestructoShip._y = mcRefDestructoShip._y - 60;
} else {
mcRefDestructoShip._y = mcRefDestructoShip._y + 80;
}
oDestructoShip = new jt3_SurlyDestructoShip(mcRefDestructoShip);
oDestructoShip.SetActiveFlag(true);
bDestructoShipLoaded = true;
} else {
return(null);
}
return(oDestructoShip);
}
function GetObjectMcRef() {
return(mcRef);
}
function GetStageCoord() {
var _local2 = new Object();
_local2.x = mcRef._x;
_local2.y = mcRef._y;
mcRef._parent.localToGlobal(_local2);
return(_local2);
}
function GetObjectPosition() {
ptPositionCur.x = mcRef._x;
ptPositionCur.y = mcRef._y;
return(ptPositionCur);
}
function Init() {
mcRef._visible = true;
GenerateNewTimeOut();
SetAnimState("Idle");
oDestructoShip = null;
}
function SetAnimState(l_strAnimStateNew) {
if (((l_strAnimStateNew != null) && (l_strAnimStateNew != "")) && (l_strAnimStateNew != undefined)) {
strAnimStateCur = l_strAnimStateNew;
mcRef.Obj.gotoAndStop(strAnimStateCur);
if (strAnimStateCur == "GrabHold") {
}
}
}
function RetractAndStop() {
SetAnimState("Stop");
}
function SetVisibleFlagTo(l_bIsVisible) {
mcRef._visible = l_bIsVisible;
}
var TENTACLE_NOGRAB_HITS_MAX = 3;
var TENTACLE_GRABHOLD_HITS_MAX = 3;
var STAGE_Y_MIDDLE_POS = Stage.height / 2;
var MINIMUM_X_DISTANCE_FOR_PUNCH = 100;
var STARTING_OFFSET_X_POS = 20;
var STARTING_OFFSET_Y_POS = Stage.height / 2;
var FR_ATTACK_MID = 10;
var FR_ATTACK_END = 30;
var FR_DIE = 30;
var FR_PUNCH = 25;
var FR_RETRACT = 15;
}
Symbol 1168 MovieClip [__Packages.jt3_SurlyTheVillain] Frame 0
class jt3_SurlyTheVillain
{
var mcRef, mcRefLeftShoulder, strAnimStateCur, ptPositionCur, bHeadFlameHitPlayer, bLaserBeamHitPlayer, mcPlayerHitTestRegion, nTimeoutTractorBeam, nTimeoutLaserBeam;
function jt3_SurlyTheVillain (l_mcRef, l_mcLeftShoulder) {
mcRef = l_mcRef;
mcRefLeftShoulder = l_mcLeftShoulder;
strAnimStateCur = new String();
ptPositionCur = new Object();
bHeadFlameHitPlayer = new Boolean(false);
bLaserBeamHitPlayer = new Boolean(false);
}
function Die() {
if (mcRef.Obj.Etat._currentframe >= FR_DIE) {
mcRef._visible = false;
mcRefLeftShoulder._visible = false;
}
}
function Idle() {
}
function AttackWithDestructoShip() {
var _local4 = new Object();
var _local3;
trace("Destructo Ship Attack !!!");
_local4 = _global.C.oPlayer.GetObjectPosition();
if (_local4.y < (Y_STAGE_CENTER - 20)) {
_local3 = _global.C.oTentacleFrontTop.FireDestructoShip(0);
trace("destructo ship obj: " + _local3);
if (_local3 != null) {
_global.C.aMovingObjects.push(_local3);
}
} else {
_local3 = _global.C.oTentacleFrontBottom.FireDestructoShip(1);
if (_local3 != null) {
_global.C.aMovingObjects.push(_local3);
}
}
}
function AttackWithHeadFlame() {
trace("Head Flame Attack !!!");
_global.C.oSurlyHeadFlame.SetAnimState("Flame");
_global.S.PlaySound("sndFxHeadFlame", 100, 1);
}
function AttackWithMissile() {
var _local5 = new Object();
var _local3;
var _local4 = new String();
if (_global.C.nStateBattleLevel5 < 3) {
trace("Missile Attack !!!");
_local5 = _global.C.oPlayer.GetObjectPosition();
if (_local5.x < SURLY_MAX_X_FIRING_DISTANCE) {
if (_local5.y < (Y_STAGE_CENTER - 20)) {
_local4 = _global.C.oSurlyRightArmGun.GetAnimState();
if (_local4 != "Die") {
_local3 = _global.C.oSurlyRightArmGun.FireMissile();
if (_local3 != null) {
_global.C.aMovingObjects.push(_local3);
}
}
} else {
_local4 = _global.C.oSurlyLeftArmGun.GetAnimState();
if (_local4 != "Die") {
_local3 = _global.C.oSurlyLeftArmGun.FireMissile();
if (_local3 != null) {
_global.C.aMovingObjects.push(_local3);
}
}
}
} else {
AttackWithHeadFlame();
}
}
}
function AttackWithLaserBeam() {
trace("Laser beam Attack !!!");
_global.C.oSurlyHeadFlame.SetAnimState("Laser");
_global.S.PlaySound("sndFxLaserBeam", 100, 1);
}
function ActivateTracktorBeam() {
var _local4 = new Object();
var _local3 = new String();
if (_global.C.nStateBattleLevel5 < 2) {
trace("Value nStateBattleLevel5 :" + _global.C.nStateBattleLevel5);
_local4 = _global.C.oPlayer.GetObjectPosition();
trace("Tracktor Beam Activate for 3 seconds");
if (_local4.y < (Y_STAGE_CENTER - 20)) {
_local3 = _global.C.oSurlyLeftTractorBeam.GetAnimState();
if (_local3 != "Die") {
trace("Left tractor beam....");
_global.C.nTracktorBeamXSpeedReducerToSet = TRACTOR_BEAM_X_SPEED_REDUCER;
_global.C.nTracktorBeamYSpeedReducerToSet = TRACTOR_BEAM_Y_SPEED_REDUCER;
_global.C.oSurlyLeftTractorBeam.SetAnimState("Anticipation");
_global.S.PlaySound("sndFxTractorBeam", 100, 1);
}
} else {
_local3 = _global.C.oSurlyRightTractorBeam.GetAnimState();
if (_local3 != "Die") {
trace("right tractor beam....");
_global.C.nTracktorBeamXSpeedReducerToSet = TRACTOR_BEAM_X_SPEED_REDUCER;
_global.C.nTracktorBeamYSpeedReducerToSet = -TRACTOR_BEAM_Y_SPEED_REDUCER;
_global.C.oSurlyRightTractorBeam.SetAnimState("Anticipation");
_global.S.PlaySound("sndFxTractorBeam", 100, 1);
}
}
}
}
function AttackPlayerWithArm(l_nArmID) {
switch (l_nArmID) {
case ARM_HEAD_FLAME_ID :
AttackWithHeadFlame();
break;
case ARM_MISSILE_ID :
trace("attack with missile...");
AttackWithMissile();
break;
case ARM_LASER_BEAM_ID :
AttackWithLaserBeam();
break;
case ARM_TRACKTOR_BEAM_ID :
ActivateTracktorBeam();
break;
case ARM_DESTRUCTO_SHIP_ID :
AttackWithDestructoShip();
break;
default :
trace("Arm ID ERROR - ID undefined !!!");
trace("in function AttackPlayerWithArm()");
}
}
function CheckHit() {
var _local3 = new String();
_local3 = _global.C.oSurlyHeadFlame.GetCurrentAnimState();
if (_local3 == "Flame") {
if (_global.C.oSurlyHeadFlame.FlameHitTest(mcPlayerHitTestRegion)) {
bHeadFlameHitPlayer = true;
_global.C.oPlayer.AddDamagePointsToTruck(TRUCK_DAMAGE_UP_FLAME);
}
}
if ((_local3 == "Laser") && (bLaserBeamHitPlayer == false)) {
if (_global.C.oSurlyHeadFlame.LaserHitTest(mcPlayerHitTestRegion)) {
bLaserBeamHitPlayer = true;
_global.C.oPlayer.AddDamagePointsToTruck(TRUCK_DAMAGE_UP_LASER);
_global.C.oPlayer.SetAnimState("Hurt");
_global.C.oAi.ResetAttackTimeout();
_global.S.PlaySound("sndFxTruckHurt", 100, 1);
nTimeoutTractorBeam = 30;
trace("Laser hit player");
}
} else if (nTimeoutTractorBeam <= 0) {
bLaserBeamHitPlayer = false;
} else {
nTimeoutTractorBeam--;
}
}
function EnterFrame() {
this[strAnimStateCur]();
CheckHit();
}
function HeadFlameHitPlayer() {
var _local2 = new Boolean();
_local2 = bHeadFlameHitPlayer;
bHeadFlameHitPlayer = false;
return(_local2);
}
function Init() {
mcRef._visible = true;
mcRefLeftShoulder._visible = true;
nTimeoutTractorBeam = 0;
nTimeoutLaserBeam = 0;
SetAnimState("Idle");
}
function LaserBeamHitPlayer() {
var _local2 = new Boolean();
_local2 = bLaserBeamHitPlayer;
bLaserBeamHitPlayer = false;
return(_local2);
}
function SetAnimState(l_strAnimStateNew) {
if (((l_strAnimStateNew != null) && (l_strAnimStateNew != "")) && (l_strAnimStateNew != undefined)) {
strAnimStateCur = l_strAnimStateNew;
mcRef.Obj.gotoAndStop(strAnimStateCur);
mcRefLeftShoulder.Obj.gotoAndStop(strAnimStateCur);
}
}
function SetMovieClipForPlayerHitTest(l_mcHitTestRegion) {
mcPlayerHitTestRegion = l_mcHitTestRegion;
}
function SetVisibleFlagTo(l_bIsVisible) {
mcRef._visible = l_bIsVisible;
}
var ARM_HEAD_FLAME_ID = 0;
var ARM_MISSILE_ID = 1;
var ARM_LASER_BEAM_ID = 2;
var ARM_TRACKTOR_BEAM_ID = 3;
var ARM_DESTRUCTO_SHIP_ID = 4;
var BULLET_X_RANGE = 200;
var SURLY_MAX_X_FIRING_DISTANCE = Stage.width - 290;
var STARTING_X_POS = 420;
var STARTING_Y_POS_LEFTARM = 230;
var STARTING_Y_POS_RIGHTARM = 44;
var Y_STAGE_CENTER = Stage.height / 2;
var FR_DIE = 30;
var TIMEOUT_TRACTORBEAM = 150;
var TRACTOR_BEAM_X_SPEED_REDUCER = 2;
var TRACTOR_BEAM_Y_SPEED_REDUCER = 2;
var TRUCK_DAMAGE_UP_FLAME = 1;
var TRUCK_DAMAGE_UP_LASER = 10;
}
Symbol 1169 MovieClip [__Packages.jt3_SurlyHeadFlame] Frame 0
class jt3_SurlyHeadFlame
{
var mcRef, strAnimStateCur, bHeadFired, ptPositionCur;
function jt3_SurlyHeadFlame (l_mcRef) {
mcRef = l_mcRef;
strAnimStateCur = new String();
bHeadFired = new Boolean(false);
ptPositionCur = new Object();
}
function Die() {
if (mcRef.Obj.Etat._currentframe >= FR_DIE) {
mcRef._visible = false;
}
}
function Hurt() {
if (mcRef.Obj.Etat._currentframe >= FR_HURT) {
SetAnimState("Idle");
}
}
function Idle() {
}
function Flame() {
if (mcRef.Obj.Etat._currentframe >= FR_FLAME) {
SetAnimState("Idle");
}
}
function Laser() {
if (mcRef.Obj.Etat._currentframe >= FR_LASER) {
SetAnimState("Idle");
}
}
function EnterFrame() {
this[strAnimStateCur]();
}
function FlameHitTest(l_mcToTest) {
var _local2 = new Boolean();
_local2 = mcRef.Obj.Flame.hitTest(l_mcToTest);
return(_local2);
}
function GetCurrentAnimState() {
return(strAnimStateCur);
}
function GetObjectMcRef() {
return(mcRef);
}
function Init() {
mcRef._visible = true;
SetAnimState("Idle");
bHeadFired = false;
}
function LaserHitTest(l_mcToTest) {
var _local2 = new Boolean();
_local2 = mcRef.Obj.Laser.hitTest(l_mcToTest);
return(_local2);
}
function SetAnimState(l_strAnimStateNew) {
if (((l_strAnimStateNew != null) && (l_strAnimStateNew != "")) && (l_strAnimStateNew != undefined)) {
strAnimStateCur = l_strAnimStateNew;
mcRef.Obj.gotoAndStop(strAnimStateCur);
mcRef.Obj.HitRegion._visible = false;
}
}
function SetVisibleFlagTo(l_bIsVisible) {
mcRef._visible = l_bIsVisible;
}
var BULLET_X_RANGE = 200;
var STARTING_X_POS = 398.4;
var STARTING_Y_POS = 117.5;
var FR_DIE = 30;
var FR_FLAME = 40;
var FR_HURT = 15;
var FR_LASER = 50;
}
Symbol 1170 MovieClip [__Packages.jt3_SurlyArmGun] Frame 0
class jt3_SurlyArmGun
{
var mcRef, strName, ptmcRefMissileOrg, mcRefMissile, oMissile, strAnimStateCur, bMissileInArmGun, ptPositionCur, ptTmp;
function jt3_SurlyArmGun (l_mcRef, l_mcRefMissile) {
mcRef = l_mcRef;
strName = l_mcRef._name;
ptmcRefMissileOrg = new Object();
mcRefMissile = l_mcRefMissile;
ptmcRefMissileOrg.x = mcRefMissile._x;
ptmcRefMissileOrg.y = mcRefMissile._y;
oMissile = null;
strAnimStateCur = new String();
bMissileInArmGun = new Boolean(false);
ptPositionCur = new Object();
ptTmp = new Object();
}
function Anticipation() {
if (mcRef.Obj.Etat._currentframe >= FR_ANTICIPATION) {
SetAnimState("Fire");
_global.S.PlaySound("sndFxArmGunFire", 100, 1);
}
}
function Die() {
if (mcRef.Obj.Etat._currentframe >= FR_DIE) {
mcRef._visible = false;
}
}
function Fire() {
if ((mcRef.Obj.Etat._currentframe >= FR_FIRE_MISSILE) && (bMissileInArmGun == true)) {
trace("Arm fired missile");
oMissile.Init();
bMissileInArmGun = false;
}
if (mcRef.Obj.Etat._currentframe >= FR_FIRE) {
SetAnimState("Idle");
}
}
function Hurt() {
if (mcRef.Obj.Etat._currentframe >= FR_HURT) {
SetAnimState("Idle");
}
}
function Idle() {
}
function CreateNewMissile() {
trace("A new missile is created");
mcRefMissile._x = ptmcRefMissileOrg.x;
mcRefMissile._y = ptmcRefMissileOrg.y;
mcRefMissile._rotation = 0;
oMissile = new jt3_SurlyMissile(mcRefMissile);
oMissile.SetActiveFlag(true);
}
function EnterFrame() {
if (mcRef._visible == true) {
this[strAnimStateCur]();
}
}
function FireMissile() {
var _local3 = new Boolean(false);
if (oMissile != null) {
_local3 = oMissile.IsObjectMoving();
}
if ((bMissileInArmGun == false) && (_local3 == false)) {
trace("Missile created...");
CreateNewMissile();
bMissileInArmGun = true;
SetAnimState("Anticipation");
_global.S.PlaySound("sndFxArmGunLoad", 100, 1);
} else {
return(null);
}
return(oMissile);
}
function GetObjectMcRef() {
return(mcRef);
}
function GetStageCoord() {
var _local2 = new Object();
_local2.x = mcRef._x;
_local2.y = mcRef._y;
mcRef._parent.localToGlobal(_local2);
return(_local2);
}
function Init() {
mcRef._visible = true;
mcRefMissile._visible = false;
SetAnimState("Idle");
bMissileInArmGun = false;
}
function GetAnimState() {
return(strAnimStateCur);
}
function SetAnimState(l_strAnimStateNew) {
if (((l_strAnimStateNew != null) && (l_strAnimStateNew != "")) && (l_strAnimStateNew != undefined)) {
strAnimStateCur = l_strAnimStateNew;
mcRef.Obj.gotoAndStop(strAnimStateCur);
mcRef.Obj.HitRegion._visible = false;
}
}
function SetVisibleFlagTo(l_bIsVisible) {
mcRef._visible = l_bIsVisible;
}
var BULLET_X_RANGE = 200;
var STARTING_X_POS = 398.4;
var STARTING_Y_POS = 117.5;
var FR_ANTICIPATION = 20;
var FR_DIE = 30;
var FR_FIRE = 30;
var FR_HURT = 15;
var FR_FIRE_MISSILE = 10;
}
Symbol 1171 MovieClip [__Packages.jt3_SurlyTractorBeam] Frame 0
class jt3_SurlyTractorBeam
{
var mcRef, strAnimStateCur, bHeadFired, ptPositionCur;
function jt3_SurlyTractorBeam (l_mcRef) {
mcRef = l_mcRef;
mcRef.Obj.HitRegion._visible = false;
strAnimStateCur = new String();
bHeadFired = new Boolean(false);
ptPositionCur = new Object();
}
function Anticipation() {
if (mcRef.Obj.Etat._currentframe >= FR_ANTICIPATION) {
SetAnimState("TractorBeam");
_global.C.nTracktorBeamXSpeedReducer = _global.C.nTracktorBeamXSpeedReducerToSet;
_global.C.nTracktorBeamYSpeedReducer = _global.C.nTracktorBeamYSpeedReducerToSet;
}
}
function Die() {
if (mcRef.Obj.Etat._currentframe >= FR_DIE) {
_global.C.nTracktorBeamXSpeedReducer = 0;
_global.C.nTracktorBeamYSpeedReducer = 0;
mcRef._visible = false;
}
}
function Hurt() {
if (mcRef.Obj.Etat._currentframe >= FR_HURT) {
_global.C.nTracktorBeamXSpeedReducer = 0;
_global.C.nTracktorBeamYSpeedReducer = 0;
SetAnimState("Idle");
}
}
function Idle() {
}
function TractorBeam() {
if (mcRef.Obj.Etat._currentframe >= FR_TRACTORBEAM) {
_global.C.nTracktorBeamXSpeedReducer = 0;
_global.C.nTracktorBeamYSpeedReducer = 0;
SetAnimState("Idle");
}
}
function EnterFrame() {
if (mcRef._visible == true) {
this[strAnimStateCur]();
}
}
function GetObjectMcRef() {
return(mcRef);
}
function Init() {
mcRef._visible = true;
SetAnimState("Idle");
bHeadFired = false;
}
function SetAnimState(l_strAnimStateNew) {
if (((l_strAnimStateNew != null) && (l_strAnimStateNew != "")) && (l_strAnimStateNew != undefined)) {
strAnimStateCur = l_strAnimStateNew;
mcRef.Obj.gotoAndStop(strAnimStateCur);
mcRef.Obj.HitRegion._visible = false;
}
}
function GetAnimState() {
return(strAnimStateCur);
}
function SetVisibleFlagTo(l_bIsVisible) {
mcRef._visible = l_bIsVisible;
}
var FR_ANTICIPATION = 25;
var FR_DIE = 25;
var FR_HURT = 15;
var FR_TRACTORBEAM = 60;
var STAGE_Y_MIDDLE_POS = Stage.height / 2;
var TRACTOR_BEAM_X_SPEED_REDUCER = 2;
var TRACTOR_BEAM_Y_SPEED_REDUCER = 2;
}
Symbol 1172 MovieClip [__Packages.jt3_SurlyGrabBeam] Frame 0
class jt3_SurlyGrabBeam
{
var mcRef, strAnimStateCur, ptPositionCur, nGrabInitCounter;
function jt3_SurlyGrabBeam (l_mcRef) {
mcRef = l_mcRef;
strAnimStateCur = new String();
ptPositionCur = new Object();
}
function Die() {
if (mcRef.Obj.Etat._currentframe >= FR_DIE) {
SetAnimState("Idle");
}
}
function Grab() {
if (mcRef.Obj.Etat._currentframe >= FR_GRAB) {
SetAnimState("Die");
_global.C.SurlyHasGrabFriend();
}
}
function GrabInit() {
nGrabInitCounter++;
if (nGrabInitCounter > FR_GRABINIT) {
SetAnimState("Grab");
}
}
function Idle() {
}
function EnterFrame() {
this[strAnimStateCur]();
}
function Init() {
mcRef._visible = true;
SetAnimState("Idle");
nGrabInitCounter = 0;
}
function SetAnimState(l_strAnimStateNew) {
if (((l_strAnimStateNew != null) && (l_strAnimStateNew != "")) && (l_strAnimStateNew != undefined)) {
if (strAnimStateCur == "GrabInit") {
nGrabInitCounter = 0;
}
strAnimStateCur = l_strAnimStateNew;
mcRef.Obj.gotoAndStop(strAnimStateCur);
}
}
function SetVisibleFlagTo(l_bIsVisible) {
mcRef._visible = l_bIsVisible;
}
var FR_DIE = 15;
var FR_GRAB = 80;
var FR_GRABINIT = 30;
}
Symbol 48 MovieClip Frame 1
stop();
Symbol 81 MovieClip Frame 1
stop();
Symbol 84 Button
on (keyPress "<Left>") {
return(undefined);
}
on (keyPress "<Right>") {
return(undefined);
}
on (keyPress "<Up>") {
return(undefined);
}
on (keyPress "<Down>") {
return(undefined);
}
Symbol 115 MovieClip Frame 1
stop();
Symbol 122 MovieClip Frame 1
stop();
Symbol 133 MovieClip Frame 1
stop();
Symbol 137 MovieClip Frame 1
stop();
Symbol 163 MovieClip Frame 1
stop();
Symbol 177 MovieClip Frame 1
stop();
Symbol 196 MovieClip Frame 1
stop();
Symbol 209 MovieClip Frame 1
stop();
Symbol 262 MovieClip Frame 1
stop();
Symbol 288 MovieClip Frame 1
stop();
Symbol 290 MovieClip Frame 1
stop();
Symbol 290 MovieClip Frame 6
stop();
Symbol 290 MovieClip Frame 12
stop();
Symbol 290 MovieClip Frame 19
stop();
Symbol 290 MovieClip Frame 25
stop();
Symbol 298 MovieClip Frame 1
stop();
Symbol 298 MovieClip Frame 16
stop();
Symbol 299 MovieClip Frame 1
stop();
Symbol 300 MovieClip Frame 10
stop();
Symbol 301 MovieClip Frame 1
stop();
Symbol 301 MovieClip Frame 10
stop();
Symbol 301 MovieClip Frame 30
gotoAndStop ("Shield0");
Symbol 355 MovieClip Frame 1
stop();
Symbol 355 MovieClip Frame 7
stop();
Symbol 355 MovieClip Frame 15
stop();
Symbol 355 MovieClip Frame 24
stop();
Symbol 355 MovieClip Frame 29
stop();
Symbol 355 MovieClip Frame 37
stop();
Symbol 355 MovieClip Frame 43
stop();
Symbol 370 MovieClip Frame 22
stop();
Symbol 373 MovieClip Frame 1
stop();
Symbol 373 MovieClip Frame 7
stop();
Symbol 373 MovieClip Frame 15
stop();
Symbol 373 MovieClip Frame 24
stop();
Symbol 373 MovieClip Frame 29
stop();
Symbol 373 MovieClip Frame 37
stop();
Symbol 373 MovieClip Frame 43
stop();
Symbol 393 MovieClip Frame 22
stop();
Symbol 397 MovieClip Frame 1
stop();
Symbol 397 MovieClip Frame 7
stop();
Symbol 397 MovieClip Frame 15
stop();
Symbol 397 MovieClip Frame 24
stop();
Symbol 397 MovieClip Frame 29
stop();
Symbol 397 MovieClip Frame 37
stop();
Symbol 397 MovieClip Frame 43
stop();
Symbol 398 MovieClip Frame 1
stop();
Symbol 398 MovieClip Frame 10
stop();
Symbol 398 MovieClip Frame 20
stop();
Symbol 428 MovieClip Frame 1
stop();
Symbol 428 MovieClip Frame 7
stop();
Symbol 428 MovieClip Frame 15
stop();
Symbol 428 MovieClip Frame 24
stop();
Symbol 428 MovieClip Frame 29
stop();
Symbol 428 MovieClip Frame 37
stop();
Symbol 428 MovieClip Frame 43
stop();
Symbol 442 MovieClip Frame 22
stop();
Symbol 445 MovieClip Frame 1
stop();
Symbol 445 MovieClip Frame 7
stop();
Symbol 445 MovieClip Frame 15
stop();
Symbol 445 MovieClip Frame 24
stop();
Symbol 445 MovieClip Frame 29
stop();
Symbol 445 MovieClip Frame 37
stop();
Symbol 445 MovieClip Frame 43
stop();
Symbol 465 MovieClip Frame 22
stop();
Symbol 469 MovieClip Frame 1
stop();
Symbol 469 MovieClip Frame 7
stop();
Symbol 469 MovieClip Frame 15
stop();
Symbol 469 MovieClip Frame 24
stop();
Symbol 469 MovieClip Frame 29
stop();
Symbol 469 MovieClip Frame 37
stop();
Symbol 469 MovieClip Frame 43
stop();
Symbol 470 MovieClip Frame 1
stop();
Symbol 470 MovieClip Frame 10
stop();
Symbol 470 MovieClip Frame 20
stop();
Symbol 494 MovieClip Frame 1
stop();
Symbol 494 MovieClip Frame 7
stop();
Symbol 494 MovieClip Frame 15
stop();
Symbol 494 MovieClip Frame 24
stop();
Symbol 494 MovieClip Frame 29
stop();
Symbol 494 MovieClip Frame 37
stop();
Symbol 494 MovieClip Frame 43
stop();
Symbol 512 MovieClip Frame 22
stop();
Symbol 516 MovieClip Frame 1
stop();
Symbol 516 MovieClip Frame 7
stop();
Symbol 516 MovieClip Frame 15
stop();
Symbol 516 MovieClip Frame 24
stop();
Symbol 516 MovieClip Frame 29
stop();
Symbol 516 MovieClip Frame 37
stop();
Symbol 516 MovieClip Frame 43
stop();
Symbol 536 MovieClip Frame 22
stop();
Symbol 540 MovieClip Frame 1
stop();
Symbol 540 MovieClip Frame 7
stop();
Symbol 540 MovieClip Frame 15
stop();
Symbol 540 MovieClip Frame 24
stop();
Symbol 540 MovieClip Frame 29
stop();
Symbol 540 MovieClip Frame 37
stop();
Symbol 540 MovieClip Frame 43
stop();
Symbol 541 MovieClip Frame 1
stop();
Symbol 541 MovieClip Frame 10
stop();
Symbol 541 MovieClip Frame 20
stop();
Symbol 601 MovieClip Frame 1
stop();
Symbol 654 MovieClip Frame 1
stop();
Symbol 666 MovieClip Frame 1
stop();
Symbol 666 MovieClip Frame 7
stop();
Symbol 666 MovieClip Frame 13
stop();
Symbol 666 MovieClip Frame 19
stop();
Symbol 666 MovieClip Frame 25
stop();
Symbol 666 MovieClip Frame 32
stop();
Symbol 682 MovieClip Frame 1
this._visible = false;
Symbol 696 MovieClip Frame 1
stop();
Symbol 711 MovieClip Frame 1
stop();
Symbol 711 MovieClip Frame 6
stop();
Symbol 711 MovieClip Frame 11
stop();
Symbol 711 MovieClip Frame 20
stop();
Symbol 711 MovieClip Frame 30
stop();
Symbol 713 MovieClip Frame 1
stop();
Symbol 713 MovieClip Frame 6
stop();
Symbol 713 MovieClip Frame 11
stop();
Symbol 713 MovieClip Frame 20
stop();
Symbol 713 MovieClip Frame 30
stop();
Symbol 727 MovieClip Frame 1
stop();
Symbol 759 MovieClip Frame 1
stop();
Symbol 765 MovieClip Frame 1
stop();
Symbol 778 MovieClip Frame 1
stop();
Symbol 791 MovieClip Frame 1
stop();
Instance of Symbol 697 MovieClip "RightGrabBeam" in Symbol 793 MovieClip Frame 1
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 712 MovieClip "RightHandTractorBeam" in Symbol 793 MovieClip Frame 1
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 697 MovieClip "LeftGrabBeam" in Symbol 793 MovieClip Frame 1
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 714 MovieClip "LeftHandTractorBeam" in Symbol 793 MovieClip Frame 1
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 728 MovieClip "Body" in Symbol 793 MovieClip Frame 1
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 760 MovieClip "HeadFlame" in Symbol 793 MovieClip Frame 1
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 766 MovieClip "LeftShoulder" in Symbol 793 MovieClip Frame 1
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 779 MovieClip "RightArmMissile" in Symbol 793 MovieClip Frame 1
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 792 MovieClip "RightArmGun" in Symbol 793 MovieClip Frame 1
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 779 MovieClip "LeftArmMissile" in Symbol 793 MovieClip Frame 1
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 792 MovieClip "LeftArmGun" in Symbol 793 MovieClip Frame 1
onClipEvent (load) {
this._visible = false;
}
Symbol 800 MovieClip Frame 1
stop();
Symbol 811 Button
on (release) {
_global.C.MuteGame();
}
Symbol 813 MovieClip Frame 1
stop();
Symbol 819 Button
on (release) {
_parent.EmptyBtn._visible = true;
_global.C.QuitPopup();
}
Symbol 821 MovieClip Frame 1
stop();
Symbol 825 Button
on (release) {
_global.C.HelpGame();
}
Symbol 827 MovieClip Frame 1
stop();
Symbol 838 MovieClip Frame 1
stop();
Symbol 840 MovieClip Frame 1
stop();
Symbol 843 MovieClip Frame 1
stop();
Symbol 851 MovieClip Frame 1
EmptyBtn._visible = false;
EmptyBtn.useHandCursor = false;
Symbol 866 Button
on (release) {
_global.S.PlaySound("sndBtn", 100, 1);
trace("Play game");
_global.C.StartGame();
}
Symbol 873 Button
on (release) {
_global.S.PlaySound("sndBtn", 100, 1);
gotoAndStop ("InstPage1");
}
Symbol 884 Button
on (release) {
_global.S.PlaySound("sndBtn", 100, 1);
gotoAndStop ("InstPage2");
}
Symbol 907 Button
on (release) {
_global.S.PlaySound("sndBtn", 100, 1);
gotoAndStop ("InstPage3");
}
Symbol 908 Button
on (release) {
_global.S.PlaySound("sndBtn", 100, 1);
gotoAndStop ("InstPage1");
}
Instance of Symbol 697 MovieClip "RightGrabBeam" in Symbol 935 MovieClip Frame 1
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 712 MovieClip "RightHandTractorBeam" in Symbol 935 MovieClip Frame 1
onClipEvent (load) {
this.Obj.HitRegion._visible = false;
}
Instance of Symbol 697 MovieClip "LeftGrabBeam" in Symbol 935 MovieClip Frame 1
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 714 MovieClip "LeftHandTractorBeam" in Symbol 935 MovieClip Frame 1
onClipEvent (load) {
this.Obj.HitRegion._visible = false;
}
Instance of Symbol 760 MovieClip "HeadFlame" in Symbol 935 MovieClip Frame 1
onClipEvent (load) {
this.Obj.HitRegion._visible = false;
}
Instance of Symbol 766 MovieClip "LeftShoulder" in Symbol 935 MovieClip Frame 1
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 779 MovieClip "RightArmMissile" in Symbol 935 MovieClip Frame 1
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 792 MovieClip "RightArmGun" in Symbol 935 MovieClip Frame 1
onClipEvent (load) {
this.Obj.HitRegion._visible = false;
}
Instance of Symbol 779 MovieClip "LeftArmMissile" in Symbol 935 MovieClip Frame 1
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 792 MovieClip "LeftArmGun" in Symbol 935 MovieClip Frame 1
onClipEvent (load) {
this.Obj.HitRegion._visible = false;
}
Symbol 936 Button
on (release) {
_global.S.PlaySound("sndBtn", 100, 1);
gotoAndStop ("InstPage4");
}
Symbol 956 Button
on (release) {
_global.S.PlaySound("sndBtn", 100, 1);
_global.C.ResumeGame();
}
Symbol 983 Button
on (release) {
gotoAndStop ("TitlePage");
}
Symbol 989 Button
on (release) {
_global.C.G_SubmitScore = false;
_global.CS.gotoAndStop("HighScore");
}
Symbol 995 Button
on (release) {
_global.C.G_SubmitScore = true;
_global.CS.gotoAndStop("HighScore");
}
Symbol 1013 Button
on (release) {
_global.S.PlaySound("sndMusicPackaging", 100, 9999);
gotoAndStop ("TitlePage");
}
Symbol 1026 Button
on (release) {
gotoAndStop ("TitlePage");
}
Symbol 1027 Button
on (release) {
var nScore = _global.C.oScoreMng.GetCurrentScore();
_global.HS.submitScore(nScore);
btn_submit_score._visible = false;
}
Symbol 1028 Button
on (press) {
ControlScroll.scrollDown = true;
}
on (release, releaseOutside) {
ControlScroll.scrollDown = false;
}
Symbol 1029 Button
on (press) {
ControlScroll.scrollUp = true;
}
on (release, releaseOutside) {
ControlScroll.scrollUp = false;
}
Symbol 1056 MovieClip Frame 1
var nScore = _global.C.oScoreMng.GetCurrentScore();
var nTotalToSaved = _global.C.oScoreMng.GetTotalToSaved();
_global.CS.TransitionAnim.ScoreBoard.TotalToSaved.text = nTotalToSaved;
_global.CS.TransitionAnim.ScoreBoard.Pts.text = 0;
var nInitialScore = _global.C.oScoreMng.GetInitialScore();
_global.CS.TransitionAnim.ScoreBoard.InitialScore.text = nInitialScore;
var nbFriendsRescuedExtra = _global.C.oScoreMng.GetNbOfFriendsRescuedExtra();
_global.CS.TransitionAnim.ScoreBoard.ExtraFriends.text = nbFriendsRescuedExtra;
var nbFriendsRecuedByTruck = _global.C.oScoreMng.GetNbOfFriendsRescuedByTruck();
_global.CS.TransitionAnim.ScoreBoard.RescuedFriends.text = nbFriendsRecuedByTruck;
var nbPowerUpsCollected = _global.C.oScoreMng.GetNbOfPowerUpsCollected();
_global.CS.TransitionAnim.ScoreBoard.PowerUps.text = nbPowerUpsCollected;
var nNbOfHitsOnSurlyHead = _global.C.oScoreMng.GetNbOfHitsOnSurlyHead();
_global.CS.TransitionAnim.ScoreBoard.SurlyHits.text = nNbOfHitsOnSurlyHead;
var nCummulatedScore = _global.C.oScoreMng.GetCummulatedScore();
_global.CS.TransitionAnim.ScoreBoard.TotalScore.text = nCummulatedScore;
Symbol 1056 MovieClip Frame 23
var nScore = _global.C.oScoreMng.GetCurrentScore();
var nTotalToSaved = _global.C.oScoreMng.GetTotalToSaved();
_global.CS.TransitionAnim.ScoreBoard.TotalToSaved.text = nTotalToSaved;
_global.CS.TransitionAnim.ScoreBoard.Pts.text = 0;
var nInitialScore = _global.C.oScoreMng.GetInitialScore();
_global.CS.TransitionAnim.ScoreBoard.InitialScore.text = nInitialScore;
var nbFriendsRescuedExtra = _global.C.oScoreMng.GetNbOfFriendsRescuedExtra();
_global.CS.TransitionAnim.ScoreBoard.ExtraFriends.text = nbFriendsRescuedExtra;
var nbFriendsRecuedByTruck = _global.C.oScoreMng.GetNbOfFriendsRescuedByTruck();
_global.CS.TransitionAnim.ScoreBoard.RescuedFriends.text = nbFriendsRecuedByTruck;
var nbPowerUpsCollected = _global.C.oScoreMng.GetNbOfPowerUpsCollected();
_global.CS.TransitionAnim.ScoreBoard.PowerUps.text = nbPowerUpsCollected;
var nNbOfHitsOnSurlyHead = _global.C.oScoreMng.GetNbOfHitsOnSurlyHead();
_global.CS.TransitionAnim.ScoreBoard.SurlyHits.text = nNbOfHitsOnSurlyHead;
var nCummulatedScore = _global.C.oScoreMng.GetCummulatedScore();
_global.CS.TransitionAnim.ScoreBoard.TotalScore.text = nCummulatedScore;
Symbol 1068 Button
on (release) {
if (_global.C.nGameLevelCur == 4) {
_global.C.ShowLevel5Popup();
} else {
_global.C.StartNewLevel();
}
}
Symbol 1118 MovieClip Frame 60
stop();
Symbol 1119 MovieClip Frame 1
stop();
Symbol 1123 MovieClip Frame 60
stop();
Symbol 1125 MovieClip Frame 35
stop();
Symbol 1126 MovieClip Frame 1
stop();
Symbol 1131 MovieClip Frame 1
stop();
Symbol 1132 Button
on (release) {
_global.S.PlaySound("sndBtn", 100, 1);
if (this.Instruction._currentframe == 1) {
this.Instruction.gotoAndStop(2);
} else {
this.Instruction.gotoAndStop(1);
_global.C.StartNewLevel();
}
}
Symbol 1145 Button
on (release) {
_parent.Hud.EmptyBtn._visible = false;
_global.C.QuitGame();
}
Symbol 1151 Button
on (release) {
_parent.Hud.EmptyBtn._visible = false;
_global.C.ResumeGame();
}