Frame 1
function setGameState(nextState) {
switch (gameState) {
case GS_CREDITS :
removeCredits();
break;
case GS_ENABLE_SOUNDS :
removeEnableSounds();
break;
case GS_LOGO1 :
removeLogo1();
break;
case GS_LOGO2 :
removeLogo2();
break;
case GS_MENU :
removeMenu();
break;
case GS_RETURN_SHELL :
removeHelp();
break;
case GS_HELP :
removeHelp();
break;
case GS_HIGH_SCORES :
removeHighScores();
break;
case GS_ANIMACION_START :
removeAnimacionStart();
break;
case GS_SELECT_LEVEL :
removeSelectLevel();
break;
case GS_GAME :
removeGame();
break;
case GS_GAME_OVER :
removeGameOver();
}
switch (nextState) {
case GS_CREDITS :
showCredits();
break;
case GS_ENABLE_SOUNDS :
showEnableSounds();
break;
case GS_LOGO1 :
showLogo1();
break;
case GS_LOGO2 :
showLogo2();
break;
case GS_MENU :
showMenu();
break;
case GS_RETURN_SHELL :
showReturnShell();
break;
case GS_HELP :
helpPrevScreen = gameState;
showHelp();
break;
case GS_HIGH_SCORES :
showHighScores();
break;
case GS_ANIMACION_START :
showAnimacionStart();
break;
case GS_SELECT_LEVEL :
showSelectLevel();
break;
case GS_GAME :
showGame();
break;
case GS_GAME_OVER :
showGameOver();
}
gameState = nextState;
}
function showCredits() {
var _local3 = attachMovie("Credits", "Credits", CREDITS_DEPTH);
_local3.back.p = _local3;
_local3.back.gs = this;
Button(_local3.back).onPress = function () {
_root.clipGame.playSound(_root.clipGame.SOUND_BOTON);
this.gs.setGameState(this.gs.GS_MENU);
};
Button(_local3.back).onRollOver = function () {
_root.clipGame.playSound(_root.clipGame.SOUND_BOTON_MOUSE_OVER);
};
playSoundFondoTransitionalScreens();
}
function removeCredits() {
Credits.removeMovieClip();
stopSoundFondoTransitionalScreens();
}
function showMenu() {
var _local1;
_local1 = "ScreenMenu";
attachMovie(_local1, "menu", MENU_DEPTH);
menu._x = 0;
menu._y = 0;
updateSoundButton(menu.botonera.sound);
crearClipSoundOnOff(GS_MENU);
playSoundFondoMenu();
}
function removeMenu() {
menu.removeMovieClip();
soundOnOff.removeMovieClip();
stopSoundFondoMenu();
}
function showAnimacionStart() {
attachMovie("animacion_start", "animacion_start", ANIMACION_START_DEPTH);
animacion_start._x = 0;
animacion_start._y = 0;
}
function removeAnimacionStart() {
animacion_start.removeMovieClip();
}
function showHelp() {
var _local1 = "Tutorial";
attachMovie(_local1, "help", TUTORIAL_DEPTH);
help._x = 0;
help._y = 0;
}
function removeHelp() {
help.removeMovieClip();
stopSoundFondoTransitionalScreens();
}
function showReturnShell() {
var _local1 = "LLoadingDialogShell";
attachMovie(_local1, "returnShell", RETURN_SHELL_DEPTH);
returnShell._x = 0;
returnShell._y = 0;
}
function removeReturnShell() {
returnShell.removeMovieClip();
}
function showHighScores() {
_root.scoreStr1 = formatScore(_root.scoreNum1);
_root.scoreStr2 = formatScore(_root.scoreNum2);
_root.scoreStr3 = formatScore(_root.scoreNum3);
_root.scoreStr4 = formatScore(_root.scoreNum4);
_root.scoreStr5 = formatScore(_root.scoreNum5);
var _local2 = (((_root.scoreNum1 + _root.scoreNum2) + _root.scoreNum3) + _root.scoreNum4) + _root.scoreNum5;
if (_local2 > 999999) {
_local2 = 999999 /* 0x0F423F */;
}
_root.scoreStrTotal = formatScore(_local2);
var _local3 = "screen_highscores";
attachMovie(_local3, "highscores", HIGH_SCORES_DEPTH);
highscores._x = 0;
highscores._y = 0;
playSoundFondoTransitionalScreens();
}
function removeHighScores() {
highscores.removeMovieClip();
stopSoundFondoTransitionalScreens();
}
function showGame() {
_global.startLevel = apiClasses.CMath.getRandom(0, 2);
_root.scoreNum = 0;
_root.scoreStr = _root.scoreNum + "00000";
playSoundTruckLoop();
scaleIndex = 0;
scales = new Array();
scales = [100, 75, 50];
scaling = false;
currentScale = 100;
velIncScaled = new Array();
minXVelScaled = new Array();
maxXVelScaled = new Array();
yVelScaled = new Array();
minXScaled = new Array();
maxXScaled = new Array();
heightToZoomScaled = new Array();
velIncScaled = [0.6, 0.7, 0.8];
minXVelScaled = [2.5, 2.5, 2.5];
maxXVelScaled = [5.5, 6.5, 8.5];
yVelScaled = [-16, -20, -26];
minXScaled = [370, 385, 480];
maxXScaled = [530, 630, 900];
heightToZoomScaled = [300, 500];
stopSoundFondoMenu();
_root.scoreStr = _root.scoreNum + "00000";
vidas = 8;
energy = 100;
attachMovie("hud1", "hud1", HUD_DEPTH);
_global.DEER_COUNT_CLIP = this.hud1.deerCount;
hud1._x = 0;
hud1._y = 0;
initLevel(currentLevel);
hudLogic();
}
function removeGame() {
stopSoundFondoGame();
stopSoundLoopLowEnergy();
hud1.removeMovieClip();
player.destroy();
catapult.destroy();
deleteMudBall();
var _local1 = 0;
while (_local1 < numNubes) {
var _local2 = nube[_local1];
_local2.destroy();
_local1++;
}
tallIndicator.destroy();
background.destroy();
obstacle.destroy();
deerManager.destroy();
deerManager = null;
ready.removeMovieClip();
warning.removeMovieClip();
youWin.removeMovieClip();
_local1 = 0;
while (_local1 < MAX_SCORES) {
score[_local1].clip.removeMovieClip();
_local1++;
}
}
function gameLogic() {
if (gameStarted) {
processNubes();
catapult.update();
catapult.render();
mudBall.update();
mudBall.render();
obstacle.update();
if (obstacle.isDead()) {
obstacle.destroy();
} else {
obstacle.render();
}
deerManager.update();
deerManager.render();
_global.heightStr = Math.round(deerManager.getHeight());
_global.deerStr = deerManager.getNumDeers();
tallIndicator.setNewTarget(deerManager.getTopYClipDeerStack());
tallIndicator.update();
tallIndicator.render();
processFloatingScores();
hudLogic();
}
player.update();
player.render();
if (pauseKeyPressed || (cuentaAutoPause > MAX_CUENTA_AUTOPAUSE)) {
if (!gamePaused) {
showGamePausedWindow(0);
}
}
}
function initLevel(level) {
energy = 100;
_root.cuentaFootballs = 0;
cuentaWarning = 0;
cuentaAutoPause = 0;
hayQuePasarAGameOver = false;
levelOver = false;
gameOver = false;
freezeCamera = false;
choirPlayerMeetsBigBossPlayed = false;
arrancar = false;
background = new gameClasses.DeerStacker2.CBackground();
var _local8 = _global.startLevel;
background.init(BACKGROUND_X, BACKGROUND_Y, _local8, BACKGROUND_DEPTH, _root.clipGame);
backgroundMusic = _local8;
player = new gameClasses.DeerStacker2.CPlayer();
player.init(PLAYER_START_X, PLAYER_START_Y, PLAYER_DEPTH, _root.clipGame);
catapult = new gameClasses.DeerStacker2.CCatapult();
catapult.init(CATAPULT_START_X, CATAPULT_START_Y, CATAPULT_DEPTH, _root.clipGame);
deerManager = new gameClasses.DeerStacker2.CDeerManager(_root.clipGame, player, DEER_DEPTH);
_global.deerManager = deerManager;
numNubes = 0;
nube = new Array(MAX_NUBES);
var _local3 = 0;
while (_local3 < MAX_NUBES) {
var _local4 = new gameClasses.DeerStacker2.CCloud();
nube[_local3] = _local4;
var _local7 = apiClasses.CMath.getRandom(0, SCREEN_WIDTH);
var _local6 = apiClasses.CMath.getRandom(-200, (SCREEN_HEIGHT / 2) - 100);
_local8 = apiClasses.CMath.getRandom(0, gameClasses.DeerStacker2.CCloud.getMaxType());
var _local5 = CLOUDS_DEPTH + _local3;
_local4.init(_local7, _local6, _local8, _local3, _local5, _root.clipGame);
numNubes++;
_local3++;
}
tallIndicator = new gameClasses.DeerStacker2.CTallIndicator();
tallIndicator.init(TALL_INDICATOR_START_X, TALL_INDICATOR_START_Y, TALL_INDICATOR_DEPTH, _root.clipGame);
_global.heightStr = 0;
score = new Array(MAX_SCORES);
_local3 = 0;
while (_local3 < MAX_SCORES) {
score[_local3] = new Object();
score[_local3].vivo = false;
score[_local3].x = 0;
score[_local3].y = 0;
score[_local3].xSpeed = 0;
score[_local3].ySpeed = 0;
score[_local3].indice = _local3;
score[_local3].clip = attachMovie("ScoreClip", "score" + _local3, SCORES_FLOTANTES_DEPTH + _local3);
score[_local3].clip.cacheAsBitmap = true;
score[_local3].clip._visible = false;
score[_local3].score = 0;
score[_local3].counter = 0;
_local3++;
}
showReady();
}
function onEnterFrameFunction() {
programCounter++;
if (programCounter >= 120) {
programCounter = 0;
}
if ((gameState == GS_LOGO1) || (gameState == GS_LOGO2)) {
if (((((((((((Key.isDown(39) || (Key.isDown(37))) || (Key.isDown(38))) || (Key.isDown(40))) || (Key.isDown(KEY_X))) || (Key.isDown(KEY_C))) || (Key.isDown(17))) || (Key.isDown(KEY_Z))) || (Key.isDown(32))) || (Key.isDown(13))) || (Key.isDown(27))) || (Key.isDown(KEY_P))) {
setGameState(GS_MENU);
}
}
oldPauseKeyPressed = nowPauseKeyPressed;
if ((Key.isDown(13) || (Key.isDown(KEY_P))) || (Key.isDown(27))) {
nowPauseKeyPressed = true;
} else {
nowPauseKeyPressed = false;
}
if (nowPauseKeyPressed != oldPauseKeyPressed) {
pauseKeyPressed = nowPauseKeyPressed;
if (!pauseKeyPressed) {
yaSeSoltoLaTeclaPausa = true;
}
} else {
pauseKeyPressed = false;
}
if ((!gameOver) && (hayQuePasarAGameOver)) {
var _local3 = sendScore();
attachMovie("GameOver", "gameover", CUADRO_GAME_OVER_DEPTH);
gameover._x = 0;
gameover._y = 0;
gameOver = true;
cuentaGameOver = 0;
stopAllAnimations();
stopSoundTruckLoop();
}
if ((gameState == GS_GAME) && (!gamePaused)) {
readyLogic();
_root.scoreStr = formatScore(_root.scoreNum);
if (levelOver) {
cuentaLevelOver++;
if (cuentaLevelOver > MAX_CUENTA_LEVEL_OVER) {
levelover.removeMovieClip();
levelUp();
return(undefined);
}
} else if (gameOver) {
stopSoundFondoGame();
stopSoundLoopLowEnergy();
cuentaGameOver++;
if (cuentaGameOver > MAX_CUENTA_GAME_OVER) {
gameover.removeMovieClip();
setGameState(GS_GAME_OVER);
return(undefined);
}
}
if (!gameOver) {
if (!scaling) {
processInput();
gameLogic();
height = deerManager.getHeight();
var _local2 = scaleIndex;
if (height > heightToZoomScaled[1]) {
scaleIndex = 2;
} else if (height > heightToZoomScaled[0]) {
scaleIndex = 1;
} else {
scaleIndex = 0;
}
if (_local2 != scaleIndex) {
scaling = true;
if (scaleIndex < _local2) {
scaling = false;
scaleIndex = _local2;
}
if (scaling) {
playSound(SOUND_VOICE_THERE_WHOLE_LOTTA);
}
}
} else {
scale(scales[scaleIndex]);
}
}
}
oldxmouse = _xmouse;
oldymouse = _ymouse;
if (gamePaused && ((yaSeSoltoLaTeclaPausa && (pauseKeyPressed)) || ((cuentaAutoPause > MAX_CUENTA_AUTOPAUSE) && (pauseKeyPressed)))) {
removeGamePausedWindow();
}
}
function sendScore() {
var _local14 = ((_global.isGuest == undefined) ? true : (_global.isGuest));
if (!_local14) {
var _local15 = Number(_root.scoreNum);
var _local13 = player.getX();
var _local12 = player.getY();
var _local11 = deerManager.getStack();
var _local7 = new String();
var _local5 = ",";
var _local4 = 0;
while (_local4 < _local11.length) {
var _local3 = _local11[_local4];
var _local9 = Math.floor(_local3.getX() - _local13);
var _local8 = Math.floor(_local3.getY() - _local12);
var _local10 = _local3.getType();
var _local6 = Math.floor(_local3.getRotation());
_local7 = _local7 + ((((((_local9 + _local5) + _local8) + _local5) + _local10) + _local5) + _local6);
_local7 = _local7 + _local5;
_local4++;
}
_local7 = _local7 + String(currentScale);
_local7 = apiClasses.LZW.compress(_local7);
_global.sendScore(3, _local15, _local7);
return(false);
}
return(true);
}
function processInput() {
if (pressedMouseFire) {
tiempoPressedMouseFire++;
}
if (tiempoPressedMouseFire >= TIEMPO_PRESSED_HAND_OFF) {
handOffPressed = true;
} else {
handOffPressed = false;
}
oldLeftPressed = leftPressed;
oldRightPressed = rightPressed;
oldUpPressed = upPressed;
oldDownPressed = downPressed;
oldFirePressed = firePressed;
oldFire2Pressed = fire2Pressed;
oldMouseLeftPressed = mouseLeftPressed;
oldMouseRightPressed = mouseRightPressed;
oldMouseUpPressed = mouseUpPressed;
oldMouseDownPressed = mouseDownPressed;
oldMouseFirePressed = mouseFirePressed;
rightPressed = Key.isDown(39);
leftPressed = Key.isDown(37);
upPressed = Key.isDown(38);
downPressed = Key.isDown(40);
firePressed = (Key.isDown(KEY_X) || (Key.isDown(KEY_C))) || (Key.isDown(17));
fire2Pressed = Key.isDown(KEY_Z) || (Key.isDown(32));
if (((((rightPressed || (leftPressed)) || (upPressed)) || (downPressed)) || (firePressed)) || (fire2Pressed)) {
cuentaAutoPause = 0;
} else {
cuentaAutoPause++;
}
var _local2 = false;
_local2 = true;
if (!_local2) {
var _local1 = 30;
mouseRightPressed = xmouse > (char.x + _local1);
mouseLeftPressed = xmouse < (char.x - _local1);
mouseUpPressed = ymouse < (char.y - _local1);
mouseDownPressed = ymouse > (char.y + _local1);
if (mouseRightPressed) {
rightPressed = true;
}
if (mouseLeftPressed) {
leftPressed = true;
}
if (mouseUpPressed) {
upPressed = true;
}
if (mouseDownPressed) {
downPressed = true;
}
} else {
mouseRightPressed = false;
mouseLeftPressed = false;
mouseUpPressed = false;
mouseDownPressed = false;
}
if (upPressed && (downPressed)) {
upPressed = false;
downPressed = false;
}
if (leftPressed && (rightPressed)) {
leftPressed = false;
rightPressed = false;
}
leftRepeated = leftPressed && (oldLeftPressed == leftPressed);
rightRepeated = rightPressed && (oldRightPressed == rightPressed);
upRepeated = upPressed && (oldUpPressed == upPressed);
downRepeated = downPressed && (oldDownPressed == downPressed);
fireRepeated = firePressed && (oldFirePressed == firePressed);
fire2Repeated = fire2Pressed && (oldFire2Pressed == fire2Pressed);
disparar = (firePressed == false) && (oldFirePressed == true);
if (!arrancar) {
if ((((((Key.isDown(39) || (Key.isDown(37))) || (Key.isDown(38))) || (Key.isDown(40))) || (Key.isDown(17))) || (Key.isDown(16))) || (Key.isDown(32))) {
arrancar = true;
}
}
}
function onMouseUpFunction() {
}
function onMouseDownFunction() {
tiempoPressedMouseFire = 0;
pressedMouseFire = true;
}
function getRandom(minimum, maximum) {
return(Math.floor((Math.random() * ((maximum - minimum) + 1)) + minimum));
}
function crearSoundManager() {
var _local1 = 1;
createEmptyMovieClip("soundManager", SOUND_MANAGER_DEPTH);
soundManager.createEmptyMovieClip("soundSoundOn", _local1++);
soundManager.soundSoundOn.miSonido = new Sound(soundManager.soundSoundOn);
soundManager.soundSoundOn.miSonido.attachSound("SoundOn.wav");
soundManager.soundSoundOn.miSonido.setVolume(100);
soundManager.createEmptyMovieClip("soundSoundOff", _local1++);
soundManager.soundSoundOff.miSonido = new Sound(soundManager.soundSoundOff);
soundManager.soundSoundOff.miSonido.attachSound("SoundOff.wav");
soundManager.soundSoundOff.miSonido.setVolume(100);
soundManager.createEmptyMovieClip("soundLogoMTV", _local1++);
soundManager.soundLogoMTV.miSonido = new Sound(soundManager.soundLogoMTV);
soundManager.soundLogoMTV.miSonido.attachSound("LogoMTV.wav");
soundManager.soundLogoMTV.miSonido.setVolume(100);
soundManager.createEmptyMovieClip("soundLogoJoju", _local1++);
soundManager.soundLogoJoju.miSonido = new Sound(soundManager.soundLogoJoju);
soundManager.soundLogoJoju.miSonido.attachSound("LogoJoju.wav");
soundManager.soundLogoJoju.miSonido.setVolume(100);
soundManager.createEmptyMovieClip("soundGameOver", _local1++);
soundManager.soundGameOver.miSonido = new Sound(soundManager.soundGameOver);
soundManager.soundGameOver.miSonido.attachSound("GameOver.wav");
soundManager.soundGameOver.miSonido.setVolume(100);
soundManager.createEmptyMovieClip("soundReady", _local1++);
soundManager.soundReady.miSonido = new Sound(soundManager.soundReady);
soundManager.soundReady.miSonido.attachSound("Ready.wav");
soundManager.soundReady.miSonido.setVolume(100);
soundManager.createEmptyMovieClip("sonido_boton", _local1++);
soundManager.sonido_boton.miSonido = new Sound(soundManager.sonido_boton);
soundManager.sonido_boton.miSonido.attachSound("Click.wav");
soundManager.sonido_boton.miSonido.setVolume(100);
soundManager.createEmptyMovieClip("soundButtonMouseOver", _local1++);
soundManager.soundButtonMouseOver.miSonido = new Sound(soundManager.soundButtonMouseOver);
soundManager.soundButtonMouseOver.miSonido.attachSound("MouseOver.wav");
soundManager.soundButtonMouseOver.miSonido.setVolume(100);
soundManager.createEmptyMovieClip("sonido_fondo_menu", _local1++);
soundManager.sonido_fondo_menu.miSonido = new Sound(soundManager.sonido_fondo_menu);
soundManager.sonido_fondo_menu.miSonido.attachSound("MainMenuMusic.wav");
soundManager.sonido_fondo_menu.miSonido.setVolume(50);
soundManager.sonido_fondo_menu.onSoundComplete = soundFondoComplete;
soundManager.createEmptyMovieClip("sonido_fondo_transitional_screens", _local1++);
soundManager.sonido_fondo_transitional_screens.miSonido = new Sound(soundManager.sonido_fondo_transitional_screens);
soundManager.sonido_fondo_transitional_screens.miSonido.attachSound("TransitionalScreensMusic.wav");
soundManager.sonido_fondo_transitional_screens.miSonido.setVolume(50);
soundManager.sonido_fondo_transitional_screens.onSoundComplete = soundFondoComplete;
soundManager.createEmptyMovieClip("sonido_fondo", _local1++);
soundManager.sonido_fondo.miSonido1 = new Sound(soundManager.sonido_fondo);
soundManager.sonido_fondo.miSonido1.attachSound("MusicaLevel1.wav");
soundManager.sonido_fondo.miSonido1.setVolume(100);
soundManager.sonido_fondo.miSonido2 = new Sound(soundManager.sonido_fondo);
soundManager.sonido_fondo.miSonido2.attachSound("MusicaLevel2.wav");
soundManager.sonido_fondo.miSonido2.setVolume(100);
soundManager.sonido_fondo.miSonido3 = new Sound(soundManager.sonido_fondo);
soundManager.sonido_fondo.miSonido3.attachSound("MusicaLevel3.wav");
soundManager.sonido_fondo.miSonido3.setVolume(100);
soundManager.createEmptyMovieClip("soundCatapult", _local1++);
soundManager.soundCatapult.miSonido = new Sound(soundManager.soundCatapult);
soundManager.soundCatapult.miSonido.attachSound("Catapult.wav");
soundManager.soundCatapult.miSonido.setVolume(100);
soundManager.createEmptyMovieClip("soundFallDeer", _local1++);
soundManager.soundFallDeer.miSonido = new Sound(soundManager.soundFallDeer);
soundManager.soundFallDeer.miSonido.attachSound("Fall_Deer.wav");
soundManager.soundFallDeer.miSonido.setVolume(100);
soundManager.createEmptyMovieClip("soundFallMudball", _local1++);
soundManager.soundFallMudball.miSonido = new Sound(soundManager.soundFallMudball);
soundManager.soundFallMudball.miSonido.attachSound("Fall_Mudball.wav");
soundManager.soundFallMudball.miSonido.setVolume(100);
soundManager.createEmptyMovieClip("soundMudballBuffalo", _local1++);
soundManager.soundMudballBuffalo.miSonido = new Sound(soundManager.soundMudballBuffalo);
soundManager.soundMudballBuffalo.miSonido.attachSound("Mudball_Buffalo.wav");
soundManager.soundMudballBuffalo.miSonido.setVolume(100);
soundManager.createEmptyMovieClip("soundMudballCloneTonic", _local1++);
soundManager.soundMudballCloneTonic.miSonido = new Sound(soundManager.soundMudballCloneTonic);
soundManager.soundMudballCloneTonic.miSonido.attachSound("Mudball_CloneTonic.wav");
soundManager.soundMudballCloneTonic.miSonido.setVolume(100);
soundManager.createEmptyMovieClip("soundMudballElephant", _local1++);
soundManager.soundMudballElephant.miSonido = new Sound(soundManager.soundMudballElephant);
soundManager.soundMudballElephant.miSonido.attachSound("Mudball_Elephant.wav");
soundManager.soundMudballElephant.miSonido.setVolume(100);
soundManager.createEmptyMovieClip("soundMudballFridge", _local1++);
soundManager.soundMudballFridge.miSonido = new Sound(soundManager.soundMudballFridge);
soundManager.soundMudballFridge.miSonido.attachSound("Mudball_Fridge.wav");
soundManager.soundMudballFridge.miSonido.setVolume(100);
soundManager.createEmptyMovieClip("soundMudballOldCar", _local1++);
soundManager.soundMudballOldCar.miSonido = new Sound(soundManager.soundMudballOldCar);
soundManager.soundMudballOldCar.miSonido.attachSound("Mudball_OldCar.wav");
soundManager.soundMudballOldCar.miSonido.setVolume(100);
soundManager.createEmptyMovieClip("soundMudballOldTractor", _local1++);
soundManager.soundMudballOldTractor.miSonido = new Sound(soundManager.soundMudballOldTractor);
soundManager.soundMudballOldTractor.miSonido.attachSound("Mudball_OldTractor.wav");
soundManager.soundMudballOldTractor.miSonido.setVolume(100);
soundManager.createEmptyMovieClip("soundMudballSheep", _local1++);
soundManager.soundMudballSheep.miSonido = new Sound(soundManager.soundMudballSheep);
soundManager.soundMudballSheep.miSonido.attachSound("Mudball_Sheep.wav");
soundManager.soundMudballSheep.miSonido.setVolume(100);
soundManager.createEmptyMovieClip("soundMudballToiletFlush", _local1++);
soundManager.soundMudballToiletFlush.miSonido = new Sound(soundManager.soundMudballToiletFlush);
soundManager.soundMudballToiletFlush.miSonido.attachSound("Mudball_ToiletFlush.wav");
soundManager.soundMudballToiletFlush.miSonido.setVolume(100);
soundManager.createEmptyMovieClip("soundTruckAccelerates", _local1++);
soundManager.soundTruckAccelerates.miSonido = new Sound(soundManager.soundTruckAccelerates);
soundManager.soundTruckAccelerates.miSonido.attachSound("TruckAccelerates2.wav");
soundManager.soundTruckAccelerates.miSonido.setVolume(70);
soundManager.createEmptyMovieClip("soundDeerHitDeer", _local1++);
soundManager.soundDeerHitDeer.miSonido = new Sound(soundManager.soundDeerHitDeer);
soundManager.soundDeerHitDeer.miSonido.attachSound("DeerHitDeer.wav");
soundManager.soundDeerHitDeer.miSonido.setVolume(100);
soundManager.createEmptyMovieClip("soundDeerHitGround", _local1++);
soundManager.soundDeerHitGround.miSonido = new Sound(soundManager.soundDeerHitGround);
soundManager.soundDeerHitGround.miSonido.attachSound("DeerHitGround.wav");
soundManager.soundDeerHitGround.miSonido.setVolume(100);
soundManager.createEmptyMovieClip("soundDeerHitTruck", _local1++);
soundManager.soundDeerHitTruck.miSonido = new Sound(soundManager.soundDeerHitTruck);
soundManager.soundDeerHitTruck.miSonido.attachSound("DeerHitTruck.wav");
soundManager.soundDeerHitTruck.miSonido.setVolume(100);
soundManager.createEmptyMovieClip("soundBuffaloHitDeer", _local1++);
soundManager.soundBuffaloHitDeer.miSonido = new Sound(soundManager.soundBuffaloHitDeer);
soundManager.soundBuffaloHitDeer.miSonido.attachSound("BuffaloHitDeer.wav");
soundManager.soundBuffaloHitDeer.miSonido.setVolume(200);
soundManager.createEmptyMovieClip("soundBuffaloHitGround", _local1++);
soundManager.soundDeerHitGround.miSonido = new Sound(soundManager.soundDeerHitGround);
soundManager.soundDeerHitGround.miSonido.attachSound("BuffaloHitGround.wav");
soundManager.soundDeerHitGround.miSonido.setVolume(200);
soundManager.createEmptyMovieClip("soundBuffaloHitTruck", _local1++);
soundManager.soundBuffaloHitTruck.miSonido = new Sound(soundManager.soundBuffaloHitTruck);
soundManager.soundBuffaloHitTruck.miSonido.attachSound("BuffaloHitTruck.wav");
soundManager.soundBuffaloHitTruck.miSonido.setVolume(200);
soundManager.createEmptyMovieClip("soundElephantHitDeer", _local1++);
soundManager.soundElephantHitDeer.miSonido = new Sound(soundManager.soundElephantHitDeer);
soundManager.soundElephantHitDeer.miSonido.attachSound("ElephantHitDeer.wav");
soundManager.soundElephantHitDeer.miSonido.setVolume(200);
soundManager.createEmptyMovieClip("soundElephantHitGround", _local1++);
soundManager.soundElephantHitGround.miSonido = new Sound(soundManager.soundElephantHitGround);
soundManager.soundElephantHitGround.miSonido.attachSound("ElephantpHitGround.wav");
soundManager.soundElephantHitGround.miSonido.setVolume(200);
soundManager.createEmptyMovieClip("soundElephantHitTruck", _local1++);
soundManager.soundElephantHitTruck.miSonido = new Sound(soundManager.soundElephantHitTruck);
soundManager.soundElephantHitTruck.miSonido.attachSound("ElephantHitTruck.wav");
soundManager.soundElephantHitTruck.miSonido.setVolume(200);
soundManager.createEmptyMovieClip("soundSheepHitDeer", _local1++);
soundManager.soundSheepHitDeer.miSonido = new Sound(soundManager.soundSheepHitDeer);
soundManager.soundSheepHitDeer.miSonido.attachSound("SheepHitDeer.wav");
soundManager.soundSheepHitDeer.miSonido.setVolume(200);
soundManager.createEmptyMovieClip("soundSheepHitGround", _local1++);
soundManager.soundSheepHitGround.miSonido = new Sound(soundManager.soundSheepHitGround);
soundManager.soundSheepHitGround.miSonido.attachSound("SheepHitGround.wav");
soundManager.soundSheepHitGround.miSonido.setVolume(200);
soundManager.createEmptyMovieClip("soundSheepHitTruck", _local1++);
soundManager.soundSheepHitTruck.miSonido = new Sound(soundManager.soundSheepHitTruck);
soundManager.soundSheepHitTruck.miSonido.attachSound("SheepHitTruck.wav");
soundManager.soundSheepHitTruck.miSonido.setVolume(200);
soundManager.createEmptyMovieClip("soundTruckEscape", _local1++);
soundManager.soundTruckEscape.miSonido = new Sound(soundManager.soundTruckEscape);
soundManager.soundTruckEscape.miSonido.attachSound("Truck_escape.wav");
soundManager.soundTruckEscape.miSonido.setVolume(30);
soundManager.createEmptyMovieClip("soundTruckLoop", _local1++);
soundManager.soundTruckLoop.miSonido = new Sound(soundManager.soundTruckLoop);
soundManager.soundTruckLoop.miSonido.attachSound("Truck_Loop.wav");
soundManager.soundTruckLoop.miSonido.setVolume(40);
soundManager.createEmptyMovieClip("soundClick", _local1++);
soundManager.soundClick.miSonido = new Sound(soundManager.soundClick);
soundManager.soundClick.miSonido.attachSound("click.wav");
soundManager.soundClick.miSonido.setVolume(100);
soundManager.createEmptyMovieClip("soundMouseOver", _local1++);
soundManager.soundMouseOver.miSonido = new Sound(soundManager.soundMouseOver);
soundManager.soundMouseOver.miSonido.attachSound("mouseOver.wav");
soundManager.soundMouseOver.miSonido.setVolume(100);
soundManager.createEmptyMovieClip("soundWin", _local1++);
soundManager.soundWin.miSonido = new Sound(soundManager.soundWin);
soundManager.soundWin.miSonido.attachSound("soundWin.wav");
soundManager.soundWin.miSonido.setVolume(100);
soundManager.createEmptyMovieClip("soundLose", _local1++);
soundManager.soundLose.miSonido = new Sound(soundManager.soundLose);
soundManager.soundLose.miSonido.attachSound("soundLose.wav");
soundManager.soundLose.miSonido.setVolume(100);
soundManager.createEmptyMovieClip("soundResult", _local1++);
soundManager.soundResult.miSonido = new Sound(soundManager.soundResult);
soundManager.soundResult.miSonido.attachSound("soundResult.wav");
soundManager.soundResult.miSonido.setVolume(100);
soundManager.createEmptyMovieClip("soundVoiceMissedThatOne", _local1++);
soundManager.soundVoiceMissedThatOne.miSonido = new Sound(soundManager.soundVoiceMissedThatOne);
soundManager.soundVoiceMissedThatOne.miSonido.attachSound("VoiceMissedThatOne.wav");
soundManager.soundVoiceMissedThatOne.miSonido.setVolume(100);
soundManager.createEmptyMovieClip("soundVoiceThereWholeLotta", _local1++);
soundManager.soundVoiceThereWholeLotta.miSonido = new Sound(soundManager.soundVoiceThereWholeLotta);
soundManager.soundVoiceThereWholeLotta.miSonido.attachSound("VoiceThereWholeLotta.wav");
soundManager.soundVoiceThereWholeLotta.miSonido.setVolume(100);
soundManager.createEmptyMovieClip("soundCrow", _local1++);
soundManager.soundCrow.miSonido = new Sound(soundManager.soundCrow);
soundManager.soundCrow.miSonido.attachSound("Crow.wav");
soundManager.soundCrow.miSonido.setVolume(200);
soundManager.createEmptyMovieClip("soundScore", _local1++);
soundManager.soundScore.miSonido = new Sound(soundManager.soundScore);
soundManager.soundScore.miSonido.attachSound("Score.wav");
soundManager.soundScore.miSonido.setVolume(100);
soundManager.createEmptyMovieClip("soundDeerAppears", _local1++);
soundManager.soundDeerAppears.miSonido = new Sound(soundManager.soundDeerAppears);
soundManager.soundDeerAppears.miSonido.attachSound("DeerAppears.wav");
soundManager.soundDeerAppears.miSonido.setVolume(100);
soundManager.createEmptyMovieClip("soundMudballAppears", _local1++);
soundManager.soundMudballAppears.miSonido = new Sound(soundManager.soundMudballAppears);
soundManager.soundMudballAppears.miSonido.attachSound("MudballAppears.wav");
soundManager.soundMudballAppears.miSonido.setVolume(100);
soundManager.createEmptyMovieClip("soundEngineHittingFloor", _local1++);
soundManager.soundEngineHittingFloor.miSonido = new Sound(soundManager.soundEngineHittingFloor);
soundManager.soundEngineHittingFloor.miSonido.attachSound("EngineHittingFloor.wav");
soundManager.soundEngineHittingFloor.miSonido.setVolume(200);
soundManager.createEmptyMovieClip("soundFridgeHittingFloor", _local1++);
soundManager.soundFridgeHittingFloor.miSonido = new Sound(soundManager.soundFridgeHittingFloor);
soundManager.soundFridgeHittingFloor.miSonido.attachSound("FridgeHittingFloor.wav");
soundManager.soundFridgeHittingFloor.miSonido.setVolume(200);
soundManager.createEmptyMovieClip("soundToiletHittingFloor", _local1++);
soundManager.soundToiletHittingFloor.miSonido = new Sound(soundManager.soundToiletHittingFloor);
soundManager.soundToiletHittingFloor.miSonido.attachSound("ToiletHittingFloor.wav");
soundManager.soundToiletHittingFloor.miSonido.setVolume(200);
soundManager.createEmptyMovieClip("soundTractorTireHittingFloor", _local1++);
soundManager.soundTractorTireHittingFloor.miSonido = new Sound(soundManager.soundTractorTireHittingFloor);
soundManager.soundTractorTireHittingFloor.miSonido.attachSound("TractorTireHittingFloor.wav");
soundManager.soundTractorTireHittingFloor.miSonido.setVolume(200);
soundManager.createEmptyMovieClip("soundCloneTonic", _local1++);
soundManager.soundCloneTonic.miSonido = new Sound(soundManager.soundCloneTonic);
soundManager.soundCloneTonic.miSonido.attachSound("CloneTonic.wav");
soundManager.soundCloneTonic.miSonido.setVolume(200);
soundManager.createEmptyMovieClip("soundDeerDie1", _local1++);
soundManager.soundDeerDie1.miSonido = new Sound(soundManager.soundDeerDie1);
soundManager.soundDeerDie1.miSonido.attachSound("d_anotheronebitesthedust.wav");
soundManager.soundDeerDie1.miSonido.setVolume(120);
soundManager.createEmptyMovieClip("soundDeerDie2", _local1++);
soundManager.soundDeerDie2.miSonido = new Sound(soundManager.soundDeerDie2);
soundManager.soundDeerDie2.miSonido.attachSound("d_havebeendrinking.wav");
soundManager.soundDeerDie2.miSonido.setVolume(120);
soundManager.createEmptyMovieClip("soundDeerDie3", _local1++);
soundManager.soundDeerDie3.miSonido = new Sound(soundManager.soundDeerDie3);
soundManager.soundDeerDie3.miSonido.attachSound("d_thatgottahurt.wav");
soundManager.soundDeerDie3.miSonido.setVolume(120);
soundManager.createEmptyMovieClip("soundDeerDie4", _local1++);
soundManager.soundDeerDie4.miSonido = new Sound(soundManager.soundDeerDie4);
soundManager.soundDeerDie4.miSonido.attachSound("d_yousureknow.wav");
soundManager.soundDeerDie4.miSonido.setVolume(120);
soundManager.createEmptyMovieClip("soundDeer1", _local1++);
soundManager.soundDeer1.miSonido = new Sound(soundManager.soundDeer1);
soundManager.soundDeer1.miSonido.attachSound("Deer01.wav");
soundManager.soundDeer1.miSonido.setVolume(200);
soundManager.createEmptyMovieClip("soundDeer2", _local1++);
soundManager.soundDeer2.miSonido = new Sound(soundManager.soundDeer2);
soundManager.soundDeer2.miSonido.attachSound("Deer02.wav");
soundManager.soundDeer2.miSonido.setVolume(200);
soundManager.createEmptyMovieClip("soundDeer3", _local1++);
soundManager.soundDeer3.miSonido = new Sound(soundManager.soundDeer3);
soundManager.soundDeer3.miSonido.attachSound("Deer03.wav");
soundManager.soundDeer3.miSonido.setVolume(200);
soundManager.createEmptyMovieClip("soundDeer4", _local1++);
soundManager.soundDeer4.miSonido = new Sound(soundManager.soundDeer4);
soundManager.soundDeer4.miSonido.attachSound("Deer04.wav");
soundManager.soundDeer4.miSonido.setVolume(200);
soundManager.createEmptyMovieClip("soundDeer5", _local1++);
soundManager.soundDeer5.miSonido = new Sound(soundManager.soundDeer5);
soundManager.soundDeer5.miSonido.attachSound("Deer05.wav");
soundManager.soundDeer5.miSonido.setVolume(200);
soundManager.createEmptyMovieClip("soundDeer6", _local1++);
soundManager.soundDeer6.miSonido = new Sound(soundManager.soundDeer6);
soundManager.soundDeer6.miSonido.attachSound("Deer06.wav");
soundManager.soundDeer6.miSonido.setVolume(200);
}
function playSound(s) {
if (soundOn) {
switch (s) {
case SOUND_CATAPULT :
soundManager.soundCatapult.miSonido.start();
break;
case SOUND_FALL_DEER :
soundManager.soundFallDeer.miSonido.start();
break;
case SOUND_FALL_MUDBALL :
soundManager.soundFallMudball.miSonido.start();
break;
case SOUND_MUDBALL_BUFFALO :
soundManager.soundMudballBuffalo.miSonido.start();
break;
case SOUND_MUDBALL_CLONE_TONIC :
soundManager.soundMudballCloneTonic.miSonido.start();
break;
case SOUND_MUDBALL_ELEPHANT :
soundManager.soundMudballElephant.miSonido.start();
break;
case SOUND_MUDBALL_FRIDGE :
soundManager.soundMudballFridge.miSonido.start();
break;
case SOUND_MUDBALL_OLD_CAR :
soundManager.soundMudballOldCar.miSonido.start();
break;
case SOUND_MUDBALL_OLD_TRACTOR :
soundManager.soundMudballOldTractor.miSonido.start();
break;
case SOUND_MUDBALL_SHEEP :
soundManager.soundMudballSheep.miSonido.start();
break;
case SOUND_MUDBALL_TOILET_FLUSH :
soundManager.soundMudballToiletFlush.miSonido.start();
break;
case SOUND_TRUCK_ACCELERATES :
soundManager.soundTruckAccelerates.miSonido.start();
break;
case SOUND_TRUCK_ESCAPE :
soundManager.soundTruckEscape.miSonido.start();
break;
case SOUND_DEER_HIT_DEER :
soundManager.soundDeerHitDeer.miSonido.start();
break;
case SOUND_DEER_HIT_GROUND :
trace("SOUND deer");
soundManager.soundDeerHitGround.miSonido.start();
break;
case SOUND_DEER_HIT_TRUCK :
soundManager.soundDeerHitTruck.miSonido.start();
break;
case SOUND_BUFFALO_HIT_DEER :
soundManager.soundBuffaloHitDeer.miSonido.start();
break;
case SOUND_BUFFALO_HIT_GROUND :
soundManager.soundBuffaloHitGround.miSonido.start();
break;
case SOUND_BUFFALO_HIT_TRUCK :
soundManager.soundBuffaloHitTruck.miSonido.start();
break;
case SOUND_ELEPHANT_HIT_DEER :
soundManager.soundElephantHitDeer.miSonido.start();
break;
case SOUND_ELEPHANT_HIT_GROUND :
trace("SOUND elephant");
soundManager.soundElephantHitGround.miSonido.start();
break;
case SOUND_ELEPHANT_HIT_TRUCK :
soundManager.soundElephantHitTruck.miSonido.start();
break;
case SOUND_SHEEP_HIT_DEER :
soundManager.soundSheepHitDeer.miSonido.start();
break;
case SOUND_SHEEP_HIT_GROUND :
trace("SOUND sheep");
soundManager.soundSheepHitGround.miSonido.start();
break;
case SOUND_SHEEP_HIT_TRUCK :
soundManager.soundSheepHitTruck.miSonido.start();
break;
case SOUND_SOUND_ON :
soundManager.soundSoundOn.miSonido.start();
break;
case SOUND_SOUND_OFF :
soundManager.soundSoundOff.miSonido.start();
break;
case SOUND_LOGO_MTV :
soundManager.soundLogoMTV.miSonido.start();
break;
case SOUND_LOGO_JOJU :
soundManager.soundLogoJoju.miSonido.start();
break;
case SOUND_GAME_OVER :
soundManager.soundGameOver.miSonido.start();
break;
case SOUND_START :
soundManager.soundStart.miSonido.start();
break;
case SOUND_BOTON :
soundManager.sonido_boton.miSonido.start();
break;
case SOUND_READY :
soundManager.soundReady.miSonido.start();
break;
case SOUND_BOTON_MOUSE_OVER :
soundManager.soundButtonMouseOver.miSonido.start();
break;
case SOUND_CLAPPING :
soundManager.soundClapping.miSonido.start();
break;
case SOUND_HOP :
soundManager.hop.miSonido.start();
break;
case SOUND_SHAKING_FLOOR :
soundManager.soundShakingFloor.miSonido.start();
break;
case SOUND_DOOR_SHUT :
soundManager.soundDoorShut.miSonido.start();
break;
case SOUND_CLICK :
soundManager.soundClick.miSonido.start();
break;
case SOUND_MOUSE_OVER :
soundManager.soundMouseOver.miSonido.start();
break;
case SOUND_BOO :
soundManager.soundBoo.miSonido.start();
break;
case SOUND_AUDIENCE_COMBO :
soundManager.soundAudienceCombo.miSonido.start();
break;
case SOUND_START :
soundManager.soundStart.miSonido.start();
break;
case SOUND_WIN :
soundManager.soundWin.miSonido.start();
break;
case SOUND_LOSE :
soundManager.soundLose.miSonido.start();
break;
case SOUND_RESULT :
soundManager.soundResult.miSonido.start();
break;
case SOUND_VOICE_MISSED_THAT_ONE :
var _local1 = apiClasses.CMath.getRandom(0, 4);
switch (_local1) {
case 0 :
soundManager.soundVoiceMissedThatOne.miSonido.start();
break;
case 1 :
soundManager.soundDeerDie1.miSonido.start();
break;
case 2 :
soundManager.soundDeerDie2.miSonido.start();
break;
case 3 :
soundManager.soundDeerDie3.miSonido.start();
break;
case 4 :
soundManager.soundDeerDie4.miSonido.start();
}
break;
case SOUND_VOICE_THERE_WHOLE_LOTTA :
soundManager.soundVoiceThereWholeLotta.miSonido.start();
break;
case SOUND_CROW :
trace("SOUND CROW");
soundManager.soundCrow.miSonido.start();
break;
case SOUND_SCORING_POINTS :
soundManager.soundScore.miSonido.start();
break;
case SOUND_DEER_APPEARS :
trace("sound deer appears");
soundManager.soundDeerAppears.miSonido.start();
break;
case SOUND_MUDBALL_APPEARS :
_local1 = apiClasses.CMath.getRandom(0, 6);
switch (_local1) {
case 0 :
soundManager.soundDeerAppears.miSonido.start();
break;
case 1 :
soundManager.soundDeer1.miSonido.start();
break;
case 2 :
soundManager.soundDeer2.miSonido.start();
break;
case 3 :
soundManager.soundDeer3.miSonido.start();
break;
case 4 :
soundManager.soundDeer4.miSonido.start();
break;
case 5 :
soundManager.soundDeer5.miSonido.start();
break;
case 6 :
soundManager.soundDeer6.miSonido.start();
}
trace("sound deer appears");
break;
case SOUND_ENGINE_HITTING_FLOOR :
trace("SOUND: engine");
soundManager.soundEngineHittingFloor.miSonido.start();
break;
case SOUND_FRIDGE_HITTING_FLOOR :
trace("SOUND: fridge");
soundManager.soundFridgeHittingFloor.miSonido.start();
break;
case SOUND_TOILET_HITTING_FLOOR :
trace("SOUND: toilet");
soundManager.soundToiletHittingFloor.miSonido.start();
break;
case SOUND_TRACTOR_TIRE_HITTING_FLOOR :
trace("SOUND: tractor tire");
soundManager.soundTractorTireHittingFloor.miSonido.start();
break;
case SOUND_CLONE_TONIC :
soundManager.soundCloneTonic.miSonido.start();
}
}
}
function playingSoundCar() {
return(soundManager.soundTruckEscape.miSonido.position >= soundManager.soundTruckEscape.miSonido.duration);
}
function stopSound(s) {
switch (s) {
case SOUND_TRUCK_ESCAPE :
soundManager.soundTruckEscape.miSonido.stop();
break;
case SOUND_WIN :
soundManager.soundWin.miSonido.stop();
break;
case SOUND_LOSE :
soundManager.soundLose.miSonido.stop();
}
}
function stopEverySound() {
soundManager.soundSoundOn.miSonido.stop();
soundManager.soundSoundOff.miSonido.stop();
soundManager.soundLogoMTV.miSonido.stop();
soundManager.soundLogoJoju.miSonido.stop();
soundManager.soundGameOver.miSonido.stop();
soundManager.soundStart.miSonido.stop();
soundManager.sonido_boton.miSonido.stop();
soundManager.soundButtonMouseOver.miSonido.stop();
soundManager.soundClapping.miSonido.stop();
soundManager.hop.miSonido.stop();
soundManager.soundShakingFloor.miSonido.stop();
soundManager.soundDoorShut.miSonido.stop();
soundManager.soundClick.miSonido.stop();
soundManager.soundMouseOver.miSonido.stop();
soundManager.soundBoo.miSonido.stop();
soundManager.soundAudienceCombo.miSonido.stop();
soundManager.soundStart.miSonido.stop();
soundManager.soundWin.miSonido.stop();
soundManager.soundLose.miSonido.stop();
soundManager.soundResult.miSonido.stop();
}
function playSoundTruckLoop() {
if (soundOn) {
soundManager.soundTruckLoop.miSonido.start(0, 999999);
}
}
function stopSoundTruckLoop() {
soundManager.soundTruckLoop.miSonido.stop();
}
function playSoundFondoGame() {
if (soundOn) {
if (!tocando_fondo) {
if (backgroundMusic == 0) {
soundManager.sonido_fondo.miSonido1.start(0, 999999);
} else if (backgroundMusic == 1) {
soundManager.sonido_fondo.miSonido2.start(0, 999999);
} else if (backgroundMusic == 2) {
soundManager.sonido_fondo.miSonido3.start(0, 999999);
}
tocando_fondo = true;
}
}
}
function stopSoundFondoGame() {
if (backgroundMusic == 0) {
soundManager.sonido_fondo.miSonido1.stop();
} else if (backgroundMusic == 1) {
soundManager.sonido_fondo.miSonido2.stop();
} else if (backgroundMusic == 2) {
soundManager.sonido_fondo.miSonido3.stop();
}
tocando_fondo = false;
}
function playSoundFondoMenu() {
if (soundOn) {
if (!tocando_fondo_menu) {
soundManager.sonido_fondo_menu.miSonido.start(0, 999999);
tocando_fondo_menu = true;
}
}
}
function stopSoundFondoMenu() {
soundManager.sonido_fondo_menu.miSonido.stop();
tocando_fondo_menu = false;
}
function playSoundFondoTransitionalScreens() {
if (soundOn) {
if (!tocando_fondo_transitional_screens) {
soundManager.sonido_fondo_transitional_screens.miSonido.start(0, 999999);
tocando_fondo_transitional_screens = true;
}
}
}
function stopSoundFondoTransitionalScreens() {
soundManager.sonido_fondo_transitional_screens.miSonido.stop();
tocando_fondo_transitional_screens = false;
}
function toogleSound() {
if (soundOn) {
soundOff();
} else {
soundON();
}
}
function updateSoundButton(b) {
if (soundOn) {
b.gotoAndStop(1);
} else {
b.gotoAndStop(2);
}
}
function soundOff(valor) {
_global.soundEnabled = false;
if (gameState != GS_ENABLE_SOUNDS) {
stopAllSounds();
}
if (gameState != GS_ENABLE_SOUNDS) {
playSound(SOUND_SOUND_OFF);
}
soundOn = false;
soundOnOff.gotoAndStop("off");
tocando_fondo_menu = false;
}
function soundON() {
_global.soundEnabled = true;
soundOn = true;
playSound(SOUND_SOUND_ON);
soundOnOff.gotoAndPlay("on");
switch (gameState) {
case GS_GAME :
if (!gamePaused) {
playSoundFondoGame();
}
break;
case GS_MENU :
playSoundFondoMenu();
break;
case GS_HELP :
playSoundFondoTransitionalScreens();
}
}
function showEnableSounds() {
attachMovie("EnableSounds", "EnableSounds", ENABLE_SOUNDS_DEPTH);
EnableSounds._x = 0;
EnableSounds._y = 0;
}
function removeEnableSounds() {
EnableSounds.removeMovieClip();
}
function crearClipSoundOnOff(modo) {
attachMovie("soundOnOff", "soundOnOff", SOUND_ON_OFF_DEPTH);
soundOnOff._alpha = 100;
if (modo == GS_MENU) {
soundOnOff._x = SCREEN_WIDTH - soundOnOff._width;
soundOnOff._y = 30;
} else if (modo == GS_GAME_PAUSED) {
soundOnOff._x = ((((SCREEN_WIDTH / 2) - (soundOnOff._width / 2)) + 132) - 50) + 7;
soundOnOff._y = (((SCREEN_HEIGHT / 2) + 162) - 65) + 57;
}
soundOnOff.onPress = toogleSound;
if (soundOn) {
soundOnOff.gotoAndPlay("on");
} else {
soundOnOff.gotoAndStop("off");
}
}
function showLogo1() {
}
function removeLogo1() {
logo1.removeMovieClip();
}
function showLogo2() {
var _local1 = "screen_cc";
attachMovie(_local1, "logo2", LOGO2_DEPTH);
logo2._x = 0;
logo2._y = 0;
playSound(SOUND_LOGO_MTV);
}
function removeLogo2() {
logo2.removeMovieClip();
}
function showGameOver() {
playSound(SOUND_GAME_OVER);
var _local1 = "ScreenGameOver";
attachMovie(_local1, "gameover", GAME_OVER_DEPTH);
gameover._x = 0;
gameover._y = 0;
}
function removeGameOver() {
gameover.removeMovieClip();
}
function showGamePausedWindow(deDondeViene) {
attachMovie("gamePaused", "game_paused", GAME_PAUSED_DEPTH);
updateSoundButton(this.game_paused.botonera.sound);
game_paused._x = 0;
game_paused._y = 0;
stopAllSounds();
playSound(SOUND_BOTON_MOUSE_OVER);
crearClipSoundOnOff(GS_GAME_PAUSED);
gamePaused = true;
if (deDondeViene == 100) {
pauseKeyPressed = false;
nowPauseKeyPressed = false;
yaSeSoltoLaTeclaPausa = true;
} else {
yaSeSoltoLaTeclaPausa = false;
}
stopAllAnimations();
}
function removeGamePausedWindow(saleDelJuego) {
_root.clipGame.game_paused.gotoAndPlay("POut");
soundOnOff.removeMovieClip();
gamePaused = false;
cuentaAutoPause = 0;
tocando_fondo = false;
continueAllAnimations();
if (!saleDelJuego) {
playSoundFondoGame();
}
}
function removeClipGamePausedWindow() {
game_paused.removeMovieClip();
}
function mostrarHelpEnPausa() {
helpEnPausa = true;
game_paused._visible = false;
soundOnOff._visible = false;
attachMovie("Tutorial", "help", TUTORIAL_DEPTH);
help._x = 0;
help._y = 0;
playSoundFondoTransitionalScreens();
}
function removeHelpEnPausa() {
helpEnPausa = false;
help.removeMovieClip();
stopSoundFondoTransitionalScreens();
game_paused._visible = true;
soundOnOff._visible = true;
}
function mostrarConfirmationQuit() {
game_paused._visible = false;
soundOnOff._visible = false;
attachMovie("screenConfirmationQuit", "quit", QUIT_DEPTH);
quit._x = 0;
quit._y = 0;
}
function confirmationQuitNo() {
quit.removeMovieClip();
game_paused._visible = true;
soundOnOff._visible = true;
}
function confirmationQuitYes() {
quit.removeMovieClip();
removeGamePausedWindow(true);
setGameState(GS_MENU);
}
function gameOverBack() {
removeGameOver();
setGameState(GS_MENU);
}
function mostrarConfirmationQuitShell() {
game_paused._visible = false;
soundOnOff._visible = false;
attachMovie("moregames_confirm", "quitShell", QUIT_DEPTH);
quitShell._x = 0;
quitShell._y = 0;
}
function confirmationQuitShellNo() {
quitShell.removeMovieClip();
game_paused._visible = true;
soundOnOff._visible = true;
}
function confirmationQuitShellYes() {
quitShell.removeMovieClip();
removeGamePausedWindow(true);
getURL ("http://www.comedycentral.com/sitewide/game_player/gameplayer_popup.jhtml?game=76347&ad=false", "_self");
setGameState(GS_RETURN_SHELL);
}
function showSelectLevel() {
attachMovie("screen_select_level", "select_level", SELECT_LEVEL_DEPTH);
select_level._x = 0;
select_level._y = 0;
controlDeNivelesLocked();
playSoundFondoTransitionalScreens();
}
function removeSelectLevel() {
select_level.removeMovieClip();
stopSoundFondoTransitionalScreens();
}
function grabarUltimoNivelAlcanzado(nivel) {
if (nivel > ultimoNivelAlcanzado) {
sharedObject.data.ultimoNivelAlcanzado = nivel;
sharedObject.flush();
ultimoNivelAlcanzado = nivel;
}
}
function controlHighScore() {
switch (currentLevel) {
case 1 :
if (_root.scoreNum > _root.scoreNum1) {
sharedObject.data.scoreNum1 = _root.scoreNum;
sharedObject.flush();
_root.scoreNum1 = _root.scoreNum;
}
break;
case 2 :
if (_root.scoreNum > _root.scoreNum2) {
sharedObject.data.scoreNum2 = _root.scoreNum;
sharedObject.flush();
_root.scoreNum2 = _root.scoreNum;
}
break;
case 3 :
if (_root.scoreNum > _root.scoreNum3) {
sharedObject.data.scoreNum2 = _root.scoreNum;
sharedObject.flush();
_root.scoreNum3 = _root.scoreNum;
}
break;
case 4 :
if (_root.scoreNum > _root.scoreNum4) {
sharedObject.data.scoreNum4 = _root.scoreNum;
sharedObject.flush();
_root.scoreNum4 = _root.scoreNum;
}
break;
case 5 :
if (_root.scoreNum <= _root.scoreNum5) {
break;
}
sharedObject.data.scoreNum5 = _root.scoreNum;
sharedObject.flush();
_root.scoreNum5 = _root.scoreNum;
}
}
function controlDeNivelesLocked() {
if (ultimoNivelAlcanzado >= 1) {
select_level.level2.gotoAndStop("unlocked");
if (ultimoNivelAlcanzado >= 2) {
select_level.level3.gotoAndStop("unlocked");
if (ultimoNivelAlcanzado >= 3) {
select_level.level4.gotoAndStop("unlocked");
if (ultimoNivelAlcanzado >= 4) {
select_level.level5.gotoAndStop("unlocked");
} else {
select_level.level5.gotoAndStop("locked");
}
} else {
select_level.level4.gotoAndStop("locked");
select_level.level5.gotoAndStop("locked");
}
} else {
select_level.level3.gotoAndStop("locked");
select_level.level4.gotoAndStop("locked");
select_level.level5.gotoAndStop("locked");
}
} else {
select_level.level2.gotoAndStop("locked");
select_level.level3.gotoAndStop("locked");
select_level.level4.gotoAndStop("locked");
select_level.level5.gotoAndStop("locked");
}
if (sharedObject.data.scoreNum1 >= 15000) {
select_level.level2.gotoAndStop("unlocked");
}
}
function formatScore(score) {
if (score < 10) {
return("00000" + score);
}
if (score < 100) {
return("0000" + score);
}
if (score < 1000) {
return("000" + score);
}
if (score < 10000) {
return("00" + score);
}
if (score < 100000) {
return("0" + score);
}
return("" + score);
}
function getBaseDir(thisMc) {
if (thisMc == undefined) {
thisMc = _root;
}
var _local2 = thisMc._url;
var _local3 = _local2.lastIndexOf("/");
if (_local3 != -1) {
var _local5 = _local2.substring(0, _local3 + 1);
return(_local5);
}
return("");
}
function processNubes() {
var _local2 = 0;
while (_local2 < numNubes) {
var _local1 = nube[_local2];
if (_local1.getIsAlive()) {
_local1.update();
_local1.render();
}
_local2++;
}
}
function launchMudBall() {
var _local5 = random(8) - random(8);
var _local4 = apiClasses.CMath.getFloatRandom(minXVelScaled[scaleIndex], maxXVelScaled[scaleIndex]);
var _local3 = yVelScaled[scaleIndex] + apiClasses.CMath.getFloatRandom(0, 1);
var _local2;
mudBall = new gameClasses.DeerStacker2.CMudBall();
mudBall.init(MUD_BALL_START_X, MUD_BALL_START_Y, MUD_BALL_DEPTH, _root.clipGame, _local5, _local4, _local3, currentScale);
var _local6 = apiClasses.CMath.getRandom(1, 24);
if (_local6 <= 1) {
_local2 = gameClasses.DeerStacker2.CDeer.ELEPHANT;
deerManager.addDeer(MUD_BALL_START_X, MUD_BALL_START_Y, _local2, _local5, _local4, _local3, currentScale);
} else if (_local6 <= 7) {
_local2 = gameClasses.DeerStacker2.CDeer.SHEEP;
deerManager.addDeer(MUD_BALL_START_X, MUD_BALL_START_Y, _local2, _local5, _local4, _local3, currentScale);
} else if (_local6 <= 13) {
_local2 = gameClasses.DeerStacker2.CDeer.BUFFALO;
deerManager.addDeer(MUD_BALL_START_X, MUD_BALL_START_Y, _local2, _local5, _local4, _local3, currentScale);
} else if (_local6 <= 24) {
_local2 = gameClasses.DeerStacker2.CObstacle.getRandomType();
while ((!deerManager.canAddDeers()) && (_local2 == gameClasses.DeerStacker2.CObstacle.TONIC)) {
_local2 = gameClasses.DeerStacker2.CObstacle.getRandomType();
}
obstacle = new gameClasses.DeerStacker2.CObstacle(deerManager);
obstacle.init(MUD_BALL_START_X, MUD_BALL_START_Y, _local2, OBSTACLE_DEPTH, _root.clipGame, _local5, _local4, _local3);
}
player.animationLookDeer();
}
function launchDeer() {
var _local3 = random(8) - random(8);
var _local2 = apiClasses.CMath.getFloatRandom(minXVelScaled[scaleIndex], maxXVelScaled[scaleIndex]);
var _local1 = yVelScaled[scaleIndex] + apiClasses.CMath.getFloatRandom(0, 1);
deerManager.addDeer(MUD_BALL_START_X, MUD_BALL_START_Y, gameClasses.DeerStacker2.CDeer.DEER, _local3, _local2, _local1, currentScale);
player.animationLookDeer();
}
function deleteMudBall() {
mudBall.destroy();
mudBall = null;
}
function scale(s) {
var _local1;
if (s < currentScale) {
_local1 = currentScale - 5;
} else {
_local1 = currentScale + 5;
}
if (_local1 == s) {
_local1 = s;
scaling = false;
}
currentScale = _local1;
background.applyScale(currentScale);
player.applyScale(currentScale);
catapult.applyScale(currentScale);
mudBall.applyScale(currentScale);
deerManager.applyScale(currentScale);
}
function hudLogic() {
}
function loseALife() {
vidas--;
if (vidas < 0) {
vidas = 0;
hayQuePasarAGameOver = true;
} else {
hud1.vidasClip.gotoAndPlay(9 - vidas);
}
if (hayQuePasarAGameOver) {
stopSoundFondoGame();
}
}
function showReady() {
cuentaReady = 0;
attachMovie("ReadySign", "ready", CUADRO_READY_DEPTH);
ready.cacheAsBitmap = true;
ready._x = 0;
ready._y = -60;
playSound(SOUND_READY);
gameStarted = false;
}
function readyLogic() {
cuentaReady++;
if (cuentaReady == MAX_CUENTA_READY) {
removeReady();
}
}
function removeReady() {
ready.removeMovieClip();
playSoundFondoGame();
gameStarted = true;
}
function stopAllAnimations() {
catapult.stopAnimation();
player.stopAnimation();
deerManager.stopAnimation();
tallIndicator.stopAnimation();
mudBall.stopAnimation();
}
function continueAllAnimations() {
catapult.continueAnimation();
player.continueAnimation();
deerManager.continueAnimation();
tallIndicator.continueAnimation();
mudBall.continueAnimation();
}
function processFloatingScores() {
var _local1 = 0;
while (_local1 < MAX_SCORES) {
if (score[_local1].vivo) {
floatingScoreLogic(score[_local1]);
}
_local1++;
}
}
function floatingScoreLogic(s) {
s.counter++;
if (s.counter > FPS_FLOATING_SCORE_VERTICAL) {
s.clip._xscale = s.clip._xscale - 4;
s.clip._yscale = s.clip._yscale - 4;
}
if (s.counter <= FPS_FLOATING_SCORE_VERTICAL) {
s.y = s.y - 2;
s.clip._y = s.y;
} else if (s.counter <= (FPS_FLOATING_SCORE_VERTICAL + FPS_FLOATING_SCORE_DIAGONAL)) {
s.x = s.x + s.xSpeed;
s.y = s.y + s.ySpeed;
s.clip._x = s.x;
s.clip._y = s.y;
} else {
trace("caso 4");
s.vivo = false;
s.clip._visible = false;
addScore(s.score);
playSound(SOUND_SCORING_POINTS);
trace("---" + SOUND_SCORING_POINTS);
}
}
function getPrimerFloatingScoreLibre() {
var _local2 = -1;
var _local1 = 0;
while (_local1 < MAX_SCORES) {
if (!score[_local1].vivo) {
_local2 = _local1;
break;
}
_local1++;
}
return(_local2);
}
function initFloatingScore(s, x, y, sc, isAScore) {
s.vivo = true;
s.x = x;
s.y = y;
s.xSpeed = (SCORE_X - x) / FPS_FLOATING_SCORE_DIAGONAL;
s.ySpeed = (SCORE_Y - (y - FPS_FLOATING_SCORE_VERTICAL)) / FPS_FLOATING_SCORE_DIAGONAL;
if (isAScore) {
s.score = sc;
} else {
s.score = 0;
}
s.counter = 0;
s.clip._visible = true;
if (isAScore) {
s.clip._xscale = 100;
s.clip._yscale = 100;
if (sc > 10000) {
s.clip.gotoAndStop(1);
} else if (sc > 1000) {
s.clip.gotoAndStop(5);
} else if (sc > 100) {
s.clip.gotoAndStop(6);
} else {
s.clip.gotoAndStop(7);
}
s.clip.scoreStr.text = sc;
} else {
s.clip._xscale = 60;
s.clip._yscale = 60;
var _local3 = sc;
if (_local3 == 2) {
s.clip.gotoAndStop(2);
} else if (_local3 == 3) {
s.clip.gotoAndStop(3);
} else if (_local3 == 5) {
s.clip.gotoAndStop(4);
}
}
s.clip._x = s.x;
s.clip._y = s.y;
}
function dispararFloatingScore(x, y, sc, multiplier) {
var _local1 = getPrimerFloatingScoreLibre();
if (_local1 != -1) {
initFloatingScore(score[_local1], x, y, sc, true);
}
if (multiplier != 1) {
var _local2 = getPrimerFloatingScoreLibre();
if (_local2 != -1) {
initFloatingScore(score[_local2], x + 50, y - 40, multiplier, false);
}
}
}
function addScore(s) {
_root.scoreNum = _root.scoreNum + s;
controlHighScore();
}
function mostrarCredits() {
setGameState(GS_CREDITS);
}
function playGame() {
setGameState(GS_HELP);
}
function soundNo() {
_global.soundEnabled = false;
soundOn = false;
setGameState(GS_LOGO2);
}
function soundYes() {
_global.soundEnabled = true;
soundOn = true;
setGameState(GS_LOGO2);
}
function playMoreGames() {
getURL ("http://www.comedycentral.com/games/action_arcade/redneck_games_2.jhtml", "_parent");
}
_global.soundEnabled = false;
_global.isGuest = true;
_global.launchingDeer = true;
_global.heightStr = 0;
_global.deerStr = 0;
tocando_fondo = false;
backgroundMusic = 0;
FPS = 30;
programCounter = 0;
SCREEN_WIDTH = 660;
SCREEN_HEIGHT = 528;
SCREEN_X_MIDDLE = SCREEN_WIDTH / 2;
SCREEN_Y_MIDDLE = SCREEN_HEIGHT / 2;
var MAX_NUBES = 20;
var numNubes = 0;
var player;
var PLAYER_START_X = 410;
var PLAYER_START_Y = 520;
var TALL_INDICATOR_START_X = 630;
var TALL_INDICATOR_START_Y = (PLAYER_START_Y - 40);
var catapult;
var CATAPULT_START_X = SCREEN_X_MIDDLE;
var CATAPULT_START_Y = SCREEN_HEIGHT;
var mudBall;
var MUD_BALL_START_X = 200;
var MUD_BALL_START_Y = 320;
var obstacle;
var deerManager;
var tallIndicator;
var background;
var BACKGROUND_X = SCREEN_X_MIDDLE;
var BACKGROUND_Y = SCREEN_HEIGHT;
var scaleIndex;
var scales;
var scaling;
var currentScale = 100;
var height;
var numDeer;
SCORE_X = 130;
SCORE_Y = 60;
FPS_FLOATING_SCORE_VERTICAL = FPS;
FPS_FLOATING_SCORE_DIAGONAL = FPS / 3;
MAX_SCORES = 20;
_root.gDebugMode = false;
_root.version = "Version: Alpha 0.0.1";
_root.clipGame = this;
fscommand ("allowscale", false);
fscommand ("showmenu", false);
ENGLISH = 0;
SPANISH = 1;
language = ENGLISH;
ENABLE_SOUNDS_DEPTH = 1000;
MENU_DEPTH = 1100;
CREDITS_DEPTH = 1105;
LOGO1_DEPTH = 1200;
LOGO2_DEPTH = 1300;
GAME_OVER_DEPTH = 1400;
ANIMACION_START_DEPTH = 1500;
GAME_DEPTH = 1600;
SOUND_MANAGER_DEPTH = 1700;
CUADRO_YOUWIN_DEPTH = 2100;
CUADRO_WARNING_DEPTH = 2200;
RETURN_SHELL_DEPTH = 2450;
SELECT_LEVEL_DEPTH = 2600;
HIGH_SCORES_DEPTH = 2700;
SOUND_ON_OFF_DEPTH = 2900;
CLOUDS_DEPTH = 7000;
BACKGROUND_DEPTH = 8000;
CATAPULT_DEPTH = 9000;
DEER_DEPTH = 12000;
OBSTACLE_DEPTH = 21000;
MUD_BALL_DEPTH = 22000;
PLAYER_DEPTH = 23000;
HUD_DEPTH = 27000;
TALL_INDICATOR_DEPTH = 28000;
SCORES_FLOTANTES_DEPTH = 28500;
CUADRO_GAME_OVER_DEPTH = 29000;
CUADRO_READY_DEPTH = 30000;
GAME_PAUSED_DEPTH = 50000;
TUTORIAL_DEPTH = 51000;
QUIT_DEPTH = 52000;
gamePaused = false;
KEY_Z = 90;
KEY_X = 88;
KEY_C = 67;
KEY_V = 86;
KEY_P = 80;
cuentaReady = 0;
cuentaWin = 0;
cuentaWarning = 0;
MAX_CUENTA_READY = FPS * 2;
gameStarted = false;
cuentaAutoPause = 0;
MAX_CUENTA_AUTOPAUSE = FPS * 15;
arrancar = false;
_root.scoreNum1 = 0;
_root.scoreNum2 = 0;
_root.scoreNum3 = 0;
_root.scoreNum4 = 0;
_root.scoreNum5 = 0;
_root.scoreStr1 = _root.scoreNum1 + "00000";
_root.scoreStr2 = _root.scoreNum2 + "00000";
_root.scoreStr3 = _root.scoreNum3 + "00000";
_root.scoreStr4 = _root.scoreNum4 + "00000";
_root.scoreStr5 = _root.scoreNum5 + "00000";
_root.scoreNum = 0;
_root.scoreStr = _root.scoreNum + "00000";
vidas = 8;
energy = 100;
currentLevel = 1;
_root.cuentaFootballs = 0;
RIGHT = 0;
LEFT = 1;
DOWN = 2;
UP = 3;
GS_INIT = 0;
GS_ENABLE_SOUNDS = 1;
GS_LOGO1 = 2;
GS_LOGO2 = 3;
GS_MENU = 4;
GS_HELP = 5;
GS_CREDITS = 6;
GS_SELECT_LEVEL = 7;
GS_NEWSLETTER = 8;
GS_GAME = 9;
GS_GAME_OVER = 10;
GS_GAME_PAUSED = 11;
GS_ANIMACION_START = 12;
GS_HIGH_SCORES = 13;
GS_RETURN_SHELL = 14;
gameState = GS_INIT;
soundOn = _global.soundEnabled;
crearSoundManager();
_global.startLevel = apiClasses.CMath.getRandom(0, 2);
setGameState(GS_ENABLE_SOUNDS);
hayQuePasarALevelOver = false;
levelOver = false;
cuentaLevelOver = 0;
MAX_CUENTA_LEVEL_OVER = FPS * 7;
gameOver = false;
cuentaGameOver = 0;
MAX_CUENTA_GAME_OVER = 1 * FPS;
hayQuePasarAGameOver = false;
this.onEnterFrame = onEnterFrameFunction;
nowPauseKeyPressed = false;
oldPauseKeyPressed = false;
pauseKeyPressed = false;
yaSeSoltoLaTeclaPausa = false;
tiempoPressedMouseFire = 0;
tiempoPressedTecladoFire = 0;
pressedMouseFire = false;
xMouseOld = _xmouse;
yMouseOld = _ymouse;
leftPressed = false;
rightPressed = false;
upPressed = false;
downPressed = false;
firePressed = false;
fire2Pressed = false;
oldLeftPressed = false;
oldRightPressed = false;
oldUpPressed = false;
oldDownPressed = false;
oldFirePressed = false;
oldFire2Pressed = false;
leftRepeated = false;
rightRepeated = false;
upRepeated = false;
downRepeated = false;
fireRepeated = false;
fire2Repeated = false;
mouseLeftPressed = false;
mouseRightPressed = false;
mouseUpPressed = false;
mouseDownPressed = false;
mouseFirePressed = false;
oldMouseLeftPressed = false;
oldMouseRightPressed = false;
oldMouseUpPressed = false;
oldMouseDownPressed = false;
oldMouseFirePressed = false;
mouseLeftRepeated = false;
mouseRightRepeated = false;
mouseUpRepeated = false;
mouseDownRepeated = false;
PIXELS_MINIMUM_MOVEMENT = 1;
oldxmouse = 0;
oldymouse = 0;
this.onMouseUp = onMouseUpFunction;
SOUND_SOUND_ON = 28;
SOUND_SOUND_OFF = 29;
SOUND_LOGO_MTV = 30;
SOUND_LOGO_JOJU = 31;
SOUND_GAME_OVER = 32;
SOUND_START = 33;
SOUND_BOTON = 34;
SOUND_BOTON_MOUSE_OVER = 35;
SOUND_CATAPULT = 99;
SOUND_FALL_DEER = 100;
SOUND_FALL_MUDBALL = 101;
SOUND_MUDBALL_BUFFALO = 102;
SOUND_MUDBALL_CLONE_TONIC = 103;
SOUND_MUDBALL_ELEPHANT = 105;
SOUND_MUDBALL_FRIDGE = 106;
SOUND_MUDBALL_OLD_CAR = 107;
SOUND_MUDBALL_OLD_TRACTOR = 108;
SOUND_MUDBALL_SHEEP = 109;
SOUND_MUDBALL_TOILET_FLUSH = 110;
SOUND_TRUCK_ACCELERATES = 111;
SOUND_TRUCK_ESCAPE = 112;
SOUND_DEER_HIT_DEER = 115;
SOUND_DEER_HIT_GROUND = 116;
SOUND_DEER_HIT_TRUCK = 117;
SOUND_BUFFALO_HIT_DEER = 118;
SOUND_BUFFALO_HIT_GROUND = 119;
SOUND_BUFFALO_HIT_TRUCK = 120;
SOUND_ELEPHANT_HIT_DEER = 121;
SOUND_ELEPHANT_HIT_GROUND = 122;
SOUND_ELEPHANT_HIT_TRUCK = 123;
SOUND_SHEEP_HIT_DEER = 124;
SOUND_SHEEP_HIT_GROUND = 125;
SOUND_SHEEP_HIT_TRUCK = 126;
SOUND_VOICE_MISSED_THAT_ONE = 127;
SOUND_VOICE_THERE_WHOLE_LOTTA = 128;
SOUND_START = 44;
SOUND_WIN = 45;
SOUND_LOSE = 46;
SOUND_RESULT = 47;
SOUND_READY = 300;
SOUND_CROW = 301;
SOUND_SCORING_POINTS = 302;
SOUND_DEER_APPEARS = 303;
SOUND_MUDBALL_APPEARS = 304;
SOUND_ENGINE_HITTING_FLOOR = 305;
SOUND_FRIDGE_HITTING_FLOOR = 306;
SOUND_TOILET_HITTING_FLOOR = 307;
SOUND_TRACTOR_TIRE_HITTING_FLOOR = 308;
SOUND_CLONE_TONIC = 309;
helpEnPausa = false;
ultimoNivelAlcanzado = 0;
sharedObject = SharedObject.getLocal("sthprkwwr");
if (sharedObject.data.ultimoNivelAlcanzado == undefined) {
sharedObject.data.ultimoNivelAlcanzado = 0;
sharedObject.flush();
} else {
ultimoNivelAlcanzado = sharedObject.data.ultimoNivelAlcanzado;
}
if (sharedObject.data.scoreNum1 == undefined) {
sharedObject.data.scoreNum1 = 0;
sharedObject.flush();
} else {
_root.scoreNum1 = sharedObject.data.scoreNum1;
}
if (sharedObject.data.scoreNum2 == undefined) {
sharedObject.data.scoreNum2 = 0;
sharedObject.flush();
} else {
_root.scoreNum2 = sharedObject.data.scoreNum2;
}
if (sharedObject.data.scoreNum3 == undefined) {
sharedObject.data.scoreNum3 = 0;
sharedObject.flush();
} else {
_root.scoreNum3 = sharedObject.data.scoreNum3;
}
if (sharedObject.data.scoreNum4 == undefined) {
sharedObject.data.scoreNum4 = 0;
sharedObject.flush();
} else {
_root.scoreNum4 = sharedObject.data.scoreNum4;
}
if (sharedObject.data.scoreNum5 == undefined) {
sharedObject.data.scoreNum5 = 0;
sharedObject.flush();
} else {
_root.scoreNum5 = sharedObject.data.scoreNum5;
}
URLSWF = getBaseDir(this);
Symbol 72 Button
on (release) {
getURL ("http://www.jojugames.com", "_blank");
}
Symbol 89 MovieClip [screen_cc] Frame 116
_root.clipGame.setGameState(_root.clipGame.GS_MENU);
Symbol 140 Button
on (press) {
_root.clipGame.playSound(_root.clipGame.SOUND_BOTON);
_root.clipGame.soundNo();
}
on (rollOver) {
_root.clipGame.playSound(_root.clipGame.SOUND_BOTON_MOUSE_OVER);
}
Symbol 145 Button
on (press) {
_root.clipGame.playSound(_root.clipGame.SOUND_BOTON);
_root.clipGame.soundYes();
}
on (rollOver) {
_root.clipGame.playSound(_root.clipGame.SOUND_BOTON_MOUSE_OVER);
}
Symbol 148 MovieClip [EnableSounds] Frame 7
stop();
Symbol 150 Button
on (press) {
_root.clipGame.playSound(_root.clipGame.SOUND_BOTON);
_root.clipGame.confirmationQuitNo();
}
on (rollOver) {
_root.clipGame.playSound(_root.clipGame.SOUND_BOTON_MOUSE_OVER);
}
Symbol 151 Button
on (press) {
_root.clipGame.playSound(_root.clipGame.SOUND_BOTON);
_root.clipGame.confirmationQuitYes();
}
on (rollOver) {
_root.clipGame.playSound(_root.clipGame.SOUND_BOTON_MOUSE_OVER);
}
Symbol 152 MovieClip [ScreenConfirmationQuit] Frame 7
stop();
Symbol 185 MovieClip [Deer] Frame 1
stop();
Symbol 185 MovieClip [Deer] Frame 12
gotoAndPlay (2);
Symbol 185 MovieClip [Deer] Frame 16
stop();
Symbol 185 MovieClip [Deer] Frame 17
stop();
Symbol 185 MovieClip [Deer] Frame 18
stop();
Symbol 185 MovieClip [Deer] Frame 19
play();
Symbol 185 MovieClip [Deer] Frame 38
gotoAndStop (1);
Symbol 214 MovieClip [Driver] Frame 25
stop();
Symbol 214 MovieClip [Driver] Frame 38
stop();
Symbol 214 MovieClip [Driver] Frame 54
stop();
Symbol 297 MovieClip Frame 1
gotoAndPlay ("deeranim");
Symbol 297 MovieClip Frame 2
clearInterval(id);
Symbol 297 MovieClip Frame 135
function irAlDeer3Anim() {
gotoAndPlay ("deer3anim");
clearInterval(id);
}
stop();
var id = setInterval(this, "irAlDeer3Anim", 2000);
Symbol 297 MovieClip Frame 136
clearInterval(id);
Symbol 297 MovieClip Frame 251
function irAlDeerAnim() {
gotoAndPlay ("deeranim");
clearInterval(id);
}
stop();
var id = setInterval(this, "irAlDeerAnim", 4000);
Symbol 297 MovieClip Frame 252
clearInterval(id);
Symbol 297 MovieClip Frame 367
function irAlDeer2Anim() {
gotoAndPlay ("deer2anim");
clearInterval(id);
}
stop();
var id = setInterval(this, "irAlDeer2Anim", 4000);
Symbol 302 Button
on (release) {
_root.clipGame.playSound(_root.clipGame.SOUND_BOTON);
gotoAndPlay (2);
tutanim.gotoAndPlay("deer2anim");
}
on (rollOver) {
_root.clipGame.playSound(_root.clipGame.SOUND_BOTON_MOUSE_OVER);
}
Symbol 307 Button
on (release) {
_root.clipGame.playSound(_root.clipGame.SOUND_BOTON);
if (_root.clipGame.helpEnPausa) {
_root.clipGame.removeHelpEnPausa();
} else {
_root.clipGame.setGameState(_root.clipGame.GS_GAME);
}
}
on (rollOver) {
_root.clipGame.playSound(_root.clipGame.SOUND_BOTON_MOUSE_OVER);
}
Symbol 311 Button
on (release) {
_root.clipGame.playSound(_root.clipGame.SOUND_BOTON);
gotoAndPlay (3);
tutanim.gotoAndPlay("deer3anim");
}
on (rollOver) {
_root.clipGame.playSound(_root.clipGame.SOUND_BOTON_MOUSE_OVER);
}
Symbol 316 Button
on (release) {
_root.clipGame.playSound(_root.clipGame.SOUND_BOTON);
gotoAndPlay (1);
tutanim.gotoAndPlay("deeranim");
}
on (rollOver) {
_root.clipGame.playSound(_root.clipGame.SOUND_BOTON_MOUSE_OVER);
}
Symbol 323 Button
on (release) {
_root.clipGame.playSound(_root.clipGame.SOUND_BOTON);
if (_root.clipGame.helpEnPausa) {
_root.clipGame.removeHelpEnPausa();
} else {
_root.clipGame.setGameState(_root.clipGame.GS_GAME);
}
}
on (rollOver) {
_root.clipGame.playSound(_root.clipGame.SOUND_BOTON_MOUSE_OVER);
}
Symbol 324 Button
on (release) {
_root.clipGame.playSound(_root.clipGame.SOUND_BOTON);
gotoAndPlay (2);
tutanim.gotoAndPlay("deer2anim");
}
on (rollOver) {
_root.clipGame.playSound(_root.clipGame.SOUND_BOTON_MOUSE_OVER);
}
Symbol 326 MovieClip [Tutorial] Frame 1
stop();
Symbol 326 MovieClip [Tutorial] Frame 2
stop();
Symbol 326 MovieClip [Tutorial] Frame 3
stop();
Symbol 369 MovieClip Frame 1
_global.launchingDeer = false;
_root.clipGame.playSound(_root.clipGame.SOUND_MUDBALL_APPEARS);
Symbol 369 MovieClip Frame 60
if (_global.launchingDeer) {
_root.clipGame.launchDeer();
} else {
_root.clipGame.launchMudBall();
}
_root.clipGame.playSound(_root.clipGame.SOUND_CATAPULT);
Symbol 369 MovieClip Frame 65
gotoAndPlay (98);
Symbol 369 MovieClip Frame 135
var r = apiClasses.CMath.getRandom(1, 100);
var type;
if (r <= 75) {
gotoAndPlay (136);
} else {
gotoAndPlay (1);
}
Symbol 369 MovieClip Frame 136
_global.launchingDeer = true;
_root.clipGame.playSound(_root.clipGame.SOUND_DEER_APPEARS);
Symbol 369 MovieClip Frame 194
gotoAndPlay (60);
Symbol 374 MovieClip [MudTrail] Frame 14
gotoAndPlay (1);
Symbol 408 MovieClip [Elephant] Frame 1
stop();
Symbol 408 MovieClip [Elephant] Frame 12
gotoAndPlay (2);
Symbol 408 MovieClip [Elephant] Frame 16
stop();
Symbol 408 MovieClip [Elephant] Frame 17
stop();
Symbol 408 MovieClip [Elephant] Frame 18
stop();
Symbol 427 MovieClip [Sheep] Frame 1
stop();
Symbol 427 MovieClip [Sheep] Frame 12
gotoAndPlay (2);
Symbol 427 MovieClip [Sheep] Frame 16
stop();
Symbol 427 MovieClip [Sheep] Frame 17
stop();
Symbol 427 MovieClip [Sheep] Frame 18
stop();
Symbol 446 MovieClip [Buffalo] Frame 1
stop();
Symbol 446 MovieClip [Buffalo] Frame 12
gotoAndPlay (2);
Symbol 446 MovieClip [Buffalo] Frame 16
stop();
Symbol 446 MovieClip [Buffalo] Frame 17
stop();
Symbol 446 MovieClip [Buffalo] Frame 18
stop();
Symbol 452 MovieClip Frame 10
stop();
Symbol 453 MovieClip Frame 1
stop();
Symbol 453 MovieClip Frame 2
stop();
Symbol 453 MovieClip Frame 3
stop();
Symbol 453 MovieClip Frame 4
stop();
Symbol 453 MovieClip Frame 5
stop();
Symbol 453 MovieClip Frame 6
stop();
Symbol 453 MovieClip Frame 7
stop();
Symbol 453 MovieClip Frame 8
stop();
Symbol 453 MovieClip Frame 9
stop();
Symbol 457 Button
on (press) {
_root.clipGame.playSound(_root.clipGame.SOUND_BOTON);
_root.clipGame.showGamePausedWindow(0);
}
on (rollOver) {
_root.clipGame.playSound(_root.clipGame.SOUND_BOTON_MOUSE_OVER);
}
Symbol 482 MovieClip [ReadySign] Frame 13
stop();
Symbol 491 Button
on (press) {
_root.clipGame.playSound(_root.clipGame.SOUND_BOTON);
_root.clipGame.gameOverBack();
}
on (rollOver) {
_root.clipGame.playSound(_root.clipGame.SOUND_BOTON_MOUSE_OVER);
}
Symbol 496 Button
on (press) {
_root.clipGame.playSound(_root.clipGame.SOUND_BOTON);
_root.clipGame.setGameState(_root.clipGame.GS_GAME);
}
on (rollOver) {
_root.clipGame.playSound(_root.clipGame.SOUND_BOTON_MOUSE_OVER);
}
Symbol 504 Button
on (release) {
_root.clipGame.playSound(_root.clipGame.SOUND_BOTON);
_root.clipGame.playMoreGames();
}
on (rollOver) {
_root.clipGame.playSound(_root.clipGame.SOUND_BOTON_MOUSE_OVER);
}
Symbol 505 MovieClip [ScreenGameOver] Frame 13
stop();
Symbol 512 Button
on (press) {
_root.clipGame.playSound(_root.clipGame.SOUND_BOTON);
_root.clipGame.mostrarHelpEnPausa();
}
on (rollOver) {
_root.clipGame.playSound(_root.clipGame.SOUND_BOTON_MOUSE_OVER);
}
Symbol 515 MovieClip Frame 1
stop();
Symbol 515 MovieClip Frame 2
stop();
Symbol 516 Button
on (press) {
_root.clipGame.playSound(_root.clipGame.SOUND_BOTON);
_root.clipGame.playGame();
}
on (rollOver) {
_root.clipGame.playSound(_root.clipGame.SOUND_BOTON_MOUSE_OVER);
}
Symbol 521 Button
on (press) {
_root.clipGame.playSound(_root.clipGame.SOUND_BOTON);
_root.clipGame.mostrarCredits();
}
on (rollOver) {
_root.clipGame.playSound(_root.clipGame.SOUND_BOTON_MOUSE_OVER);
}
Symbol 526 Button
on (release) {
_root.clipGame.playSound(_root.clipGame.SOUND_BOTON);
_root.clipGame.playMoreGames();
}
on (rollOver) {
_root.clipGame.playSound(_root.clipGame.SOUND_BOTON_MOUSE_OVER);
}
Instance of Symbol 515 MovieClip "sound" in Symbol 527 MovieClip Frame 1
on (press) {
_root.clipGame.playSound(_root.clipGame.SOUND_BOTON);
_root.clipGame.toogleSound();
_root.clipGame.updateSoundButton(this);
}
on (rollOver) {
_root.clipGame.playSound(_root.clipGame.SOUND_BOTON_MOUSE_OVER);
}
Symbol 530 MovieClip [ScreenMenu] Frame 20
stop();
Symbol 537 Button
on (press) {
_root.clipGame.playSound(_root.clipGame.SOUND_BOTON);
_root.clipGame.removeGamePausedWindow(false);
}
on (rollOver) {
_root.clipGame.playSound(_root.clipGame.SOUND_BOTON_MOUSE_OVER);
}
Symbol 542 Button
on (press) {
_root.clipGame.playSound(_root.clipGame.SOUND_BOTON);
_root.clipGame.mostrarConfirmationQuit();
}
on (rollOver) {
_root.clipGame.playSound(_root.clipGame.SOUND_BOTON_MOUSE_OVER);
}
Instance of Symbol 515 MovieClip "sound" in Symbol 543 MovieClip Frame 1
on (press) {
_root.clipGame.playSound(_root.clipGame.SOUND_BOTON);
_root.clipGame.toogleSound();
_root.clipGame.updateSoundButton(this);
}
on (rollOver) {
_root.clipGame.playSound(_root.clipGame.SOUND_BOTON_MOUSE_OVER);
}
Symbol 544 MovieClip [GamePaused] Frame 20
stop();
Symbol 544 MovieClip [GamePaused] Frame 29
stop();
_root.clipGame.removeClipGamePausedWindow();
Symbol 546 MovieClip [__Packages.apiClasses.CMath] Frame 0
class apiClasses.CMath
{
function CMath () {
}
static function getRandom(min, max) {
return(Math.floor((Math.random() * ((max - min) + 1)) + min));
}
static function getFloatRandom(min, max) {
return(min + (Math.random() * (max - min)));
}
static function toStandardAngle(angle) {
angle = angle % 360;
if (angle < 0) {
angle = angle + 360;
}
return(angle);
}
static function radToDeg(angleInRadians) {
return(angleInRadians * 57.2957795130823);
}
static function degToRad(angleInDegrees) {
return(angleInDegrees * (Math.PI/180));
}
static function dist(x1, y1, x2, y2) {
return(Math.sqrt(((x2 - x1) * (x2 - x1)) + ((y2 - y1) * (y2 - y1))));
}
static function sign(n) {
if (n == 0) {
return(0);
}
if (n < 0) {
return(-1);
}
return(1);
}
static function angle(x, y) {
return(radToDeg(Math.atan2(y, x)));
}
}
Symbol 547 MovieClip [__Packages.apiClasses.CSprite2D] Frame 0
class apiClasses.CSprite2D
{
var x, y, isAlive, width, height, index, depth, xVel, yVel, gravity, scale, rotation, rotVel, age, path, clip;
function CSprite2D () {
x = 0;
y = 0;
isAlive = false;
width = 0;
height = 0;
index = -1;
depth = 0;
xVel = 0;
yVel = 0;
gravity = 0;
scale = 100;
rotation = 0;
rotVel = 0;
age = getTimer();
}
function init(x, y, index, depth, path) {
this.x = x;
this.y = y;
this.index = index;
this.depth = depth;
this.path = path;
isAlive = true;
age = getTimer();
}
function getIsAlive() {
return(isAlive);
}
function setX(x) {
this.x = x;
}
function getX() {
return(x);
}
function getY() {
return(y);
}
function getYClip() {
return(clip._y);
}
function setXY(x, y) {
this.x = x;
this.y = y;
}
function setRotation(num) {
rotation = num;
}
function getRotation() {
return(rotation);
}
function setRotVel(num) {
rotVel = num;
}
function update() {
yVel = yVel + gravity;
x = x + xVel;
y = y + yVel;
rotation = rotation + rotVel;
}
function render() {
clip._rotation = rotation;
clip._xscale = scale;
clip._yscale = scale;
if (scale == 100) {
clip._x = x;
clip._y = y;
} else {
clip._x = gameClasses.DeerStacker2.CConstants.SCREEN_X_MIDDLE + ((x - gameClasses.DeerStacker2.CConstants.SCREEN_X_MIDDLE) * (scale / 100));
clip._y = gameClasses.DeerStacker2.CConstants.SCREEN_HEIGHT + ((y - gameClasses.DeerStacker2.CConstants.SCREEN_HEIGHT) * (scale / 100));
}
}
function destroy() {
if (clip != null) {
clip.removeMovieClip();
clip = null;
}
}
function getClip() {
return(clip);
}
function setY(aY) {
y = aY;
}
function setXVel(num) {
xVel = num;
}
function getXVel() {
return(xVel);
}
function setYVel(num) {
yVel = num;
}
function getYVel() {
return(yVel);
}
function getDist(obj) {
return(apiClasses.CMath.dist(x, y, obj.getX(), obj.getY()));
}
function invertXVel() {
xVel = xVel * -1;
}
function invertYVel() {
yVel = yVel * -1;
}
function stopAnimation() {
clip.gotoAndStop(clip._currentframe);
}
function continueAnimation() {
clip.gotoAndPlay(clip._currentframe);
}
}
Symbol 548 MovieClip [__Packages.gameClasses.DeerStacker2.CConstants] Frame 0
class gameClasses.DeerStacker2.CConstants
{
function CConstants () {
}
static var SCREEN_WIDTH = 660;
static var SCREEN_HEIGHT = 528;
static var SCREEN_X_MIDDLE = SCREEN_WIDTH / 2;
static var SCREEN_Y_MIDDLE = SCREEN_HEIGHT / 2;
static var SOUND_MANAGER_DEPTH = 1700;
}
Symbol 549 MovieClip [__Packages.gameClasses.DeerStacker2.CBackground] Frame 0
class gameClasses.DeerStacker2.CBackground extends apiClasses.CSprite2D
{
var type, clip, path, depth, width, height, render, scale;
function CBackground () {
super();
type = 0;
}
function init(x, y, type, depth, path) {
super.init(x, y, -1, depth, path);
this.type = type;
createMovieClip();
}
static function getMaxType() {
return(BACKGROUND_3);
}
function createMovieClip() {
var _local3;
if (type == BACKGROUND_1) {
_local3 = "Background1";
} else if (type == BACKGROUND_2) {
_local3 = "Background2";
} else if (type == BACKGROUND_3) {
_local3 = "Background3";
}
clip = path.attachMovie(_local3, "Background", depth);
clip.cacheAsBitmap = true;
clip.gotoAndStop(1);
width = clip._width;
height = clip._height;
var _local4 = new MovieClipLoader();
_local4.loadClip(_global.ad_ds2, clip.AD.Contenedor);
render();
}
function update() {
super.update();
}
function applyScale(aScale) {
scale = aScale;
render();
}
static var BACKGROUND_1 = 0;
static var BACKGROUND_2 = 1;
static var BACKGROUND_3 = 2;
}
Symbol 550 MovieClip [__Packages.apiClasses.LZW] Frame 0
class apiClasses.LZW
{
static var _processList;
function LZW () {
trace("This is an static Class and should not be instantiated.");
}
static function compress(p_str) {
var _local1 = createCompressProcess(p_str);
iterateCompressProcess(_processList[_local1], 0);
var _local2 = getSlowCompressString(_local1);
dispose(_local1);
return(_local2);
}
static function slowCompress(p_str) {
return(createCompressProcess(p_str));
}
static function createCompressProcess(p_str) {
var _local2 = {};
_local2.method = "compress";
_local2.ns = "";
_local2.isFinished = false;
_local2.s = p_str.split("");
_local2.t = new Array();
var _local1 = 0;
while (_local1 < 256) {
_local2.t[String.fromCharCode(_local1)] = _local1;
_local1++;
}
_local2.tl = 256;
_local2.l = _local2.s.length;
_local2.is = "";
_local2.ic = undefined;
_local2.i = 0;
if (_processList == undefined) {
startEngine();
}
_processList.push(_local2);
return(_processList.length - 1);
}
static function iterateCompressProcess(p, p_iterations) {
if (isNaN(p_iterations)) {
p_iterations = 1000;
}
if (p_iterations == 0) {
p_iterations = p.l + 1;
}
var _local2 = 0;
while (_local2 < p_iterations) {
if (p.i > p.l) {
break;
}
p.ic = p.s[p.i];
if (!p.t[p.is + p.ic]) {
p.ns = p.ns + String.fromCharCode(p.t[p.is]);
p.t[p.is + p.ic] = p.tl++;
p.is = p.ic;
} else {
p.is = p.is + p.ic;
}
p.i++;
_local2++;
}
if (p.i > p.l) {
endCompressProcess(p);
}
}
static function endCompressProcess(p) {
p.isFinished = true;
p.s = undefined;
}
static function getSlowCompressFactor(p_id) {
var _local1 = _processList[p_id];
if (!_local1) {
return(null);
}
return(_local1.i / (_local1.l + 1));
}
static function getSlowCompressString(p_id) {
var _local1 = _processList[p_id];
if ((!_local1) || (!_local1.isFinished)) {
return(null);
}
return(_local1.ns);
}
static function decompress(p_str) {
var _local1 = createDecompressProcess(p_str);
iterateDecompressProcess(_processList[_local1], 0);
var _local2 = getSlowDecompressString(_local1);
dispose(_local1);
return(_local2);
}
static function slowDecompress(p_str) {
return(createDecompressProcess(p_str));
}
static function createDecompressProcess(p_str) {
var _local2 = {};
_local2.method = "decompress";
_local2.ns = "";
_local2.isFinished = false;
_local2.s = p_str.split("");
_local2.t = new Array();
var _local1 = 0;
while (_local1 < 256) {
_local2.t[_local1] = String.fromCharCode(_local1);
_local1++;
}
_local2.tl = 256;
_local2.l = _local2.s.length;
_local2.nc = undefined;
_local2.is = "";
_local2.b = "";
_local2.c = "";
_local2.i = 0;
if (_processList == undefined) {
startEngine();
}
_processList.push(_local2);
return(_processList.length - 1);
}
static function iterateDecompressProcess(p, p_iterations) {
if (isNaN(p_iterations)) {
p_iterations = 1000;
}
if (p_iterations == 0) {
p_iterations = p.l;
}
var _local2 = 0;
while (_local2 < p_iterations) {
if (p.i >= p.l) {
break;
}
p.nc = p.s[p.i].charCodeAt(0);
p.is = p.t[p.nc];
if (p.b == "") {
p.b = p.is;
p.ns = p.ns + p.is;
} else if (p.nc < 256) {
p.ns = p.ns + p.is;
p.t[p.tl++] = p.b + p.is;
p.b = p.is;
} else {
if (!p.t[p.nc]) {
p.c = p.b + p.b.substr(0, 1);
} else {
p.c = p.t[p.nc];
}
p.ns = p.ns + p.c;
p.t[p.tl++] = p.b + p.c.substr(0, 1);
p.b = p.c;
}
p.i++;
_local2++;
}
if (p.i >= p.l) {
endDecompressProcess(p);
}
}
static function endDecompressProcess(p) {
p.isFinished = true;
p.s = undefined;
}
static function getSlowDecompressFactor(p_id) {
var _local1 = _processList[p_id];
if (!_local1) {
return(null);
}
return(_local1.i / _local1.l);
}
static function getSlowDecompressString(p_id) {
var _local1 = _processList[p_id];
if ((!_local1) || (!_local1.isFinished)) {
return(null);
}
return(_local1.ns);
}
static function startEngine() {
_processList = new Array();
_root.createEmptyMovieClip("__LZW_compression__", 1762138);
_root.__LZW_compression__.onEnterFrame = function () {
apiClasses.LZW.tick();
};
}
static function stopEngine() {
_processList = undefined;
_root.__LZW_compression__.onEnterFrame = undefined;
_root.__LZW_compression__.removeMovieClip();
}
static function dispose(p_id) {
for (var _local2 in _processList[p_id]) {
_processList[p_id][_local2] = undefined;
}
_processList[p_id] = null;
}
static function tick() {
var _local2 = false;
var _local1 = 0;
while (_local1 < _processList.length) {
if (_processList[_local1] != undefined) {
_local2 = true;
if (!_processList[_local1].isFinished) {
if (_processList[_local1].method == "compress") {
iterateCompressProcess(_processList[_local1]);
} else if (_processList[_local1].method == "decompress") {
iterateDecompressProcess(_processList[_local1]);
}
}
}
_local1++;
}
if (!_local2) {
stopEngine();
}
}
}
Symbol 551 MovieClip [__Packages.gameClasses.DeerStacker2.CPlayer] Frame 0
class gameClasses.DeerStacker2.CPlayer extends apiClasses.CSprite2D
{
var clip, path, depth, width, height, clipWheel1, clipWheel2, clipDriver, minX, x, xVel, velInc, maxX, scale;
function CPlayer () {
super();
}
function init(x, y, depth, path) {
super.init(x, y, -1, depth, path);
createMovieClip();
setParameters();
}
function createMovieClip() {
clip = path.attachMovie("Truck", "Truck", depth);
clip.cacheAsBitmap = true;
clip.gotoAndStop(1);
width = clip._width;
height = clip._height;
clipWheel1 = clip.wheel1;
clipWheel2 = clip.wheel2;
clipDriver = clip.driver;
clipDriver.gotoAndStop(1);
render();
}
function update() {
var _local4 = false;
if (Key.isDown(37) && (x > minX)) {
_local4 = true;
xVel = xVel - velInc;
} else if (Key.isDown(39) && (x < maxX)) {
_local4 = true;
xVel = xVel + velInc;
}
if (x > (maxX + 30)) {
x = maxX + 30;
}
var _local5 = apiClasses.CMath.sign(xVel);
rv = _local5 * Math.pow(xVel, 2);
xVel = xVel * FRICTION;
super.update();
if ((!_root.clipGame.playingSoundCar()) && (_local4)) {
_root.clipGame.playSound(_root.clipGame.SOUND_TRUCK_ESCAPE);
} else if (!_local4) {
_root.clipGame.stopSound(_root.clipGame.SOUND_TRUCK_ESCAPE);
}
}
function render() {
super.render();
clipWheel1._rotation = clipWheel1._rotation + rv;
clipWheel2._rotation = clipWheel2._rotation + rv;
}
function animationLookDeer() {
clipDriver.gotoAndPlay("lookDeer");
}
function animationYes() {
clipDriver.gotoAndPlay("yes");
}
function animationGiveMeMore() {
clipDriver.gotoAndPlay("giveMeMore");
}
function applyScale(aScale) {
scale = aScale;
render();
setParameters();
}
function setParameters() {
velInc = _root.clipGame.velIncScaled[_root.clipGame.scaleIndex];
trace(velInc);
minX = _root.clipGame.minXScaled[_root.clipGame.scaleIndex];
maxX = _root.clipGame.maxXScaled[_root.clipGame.scaleIndex];
}
function stopAnimation() {
super.stopAnimation();
clipWheel1.gotoAndStop(clipWheel1._currentframe);
clipWheel2.gotoAndStop(clipWheel2._currentframe);
clipDriver.gotoAndStop(clipDriver._currentframe);
clip.grupoHumo.Humo1.gotoAndStop(clip.grupoHumo.Humo1._currentframe);
clip.grupoHumo.Humo2.gotoAndStop(clip.grupoHumo.Humo2._currentframe);
clip.grupoHumo.Humo3.gotoAndStop(clip.grupoHumo.Humo3._currentframe);
clip.grupoHumo.Humo4.gotoAndStop(clip.grupoHumo.Humo4._currentframe);
}
function continueAnimation() {
super.continueAnimation();
clipWheel1.gotoAndPlay(clipWheel1._currentframe);
clipWheel2.gotoAndPlay(clipWheel2._currentframe);
clipDriver.gotoAndPlay(clipDriver._currentframe);
clip.grupoHumo.Humo1.gotoAndPlay(clip.grupoHumo.Humo1._currentframe);
clip.grupoHumo.Humo2.gotoAndPlay(clip.grupoHumo.Humo2._currentframe);
clip.grupoHumo.Humo3.gotoAndPlay(clip.grupoHumo.Humo3._currentframe);
clip.grupoHumo.Humo4.gotoAndPlay(clip.grupoHumo.Humo4._currentframe);
}
var WHEEL_WIDTH = 44;
var WHEEL_HEIGHT = 41;
var WHEEL1_OFFSET_X = 12 + (gameClasses.DeerStacker2.CPlayer.prototype.WHEEL_WIDTH / 2);
var WHEEL1_OFFSET_Y = 35 + (gameClasses.DeerStacker2.CPlayer.prototype.WHEEL_HEIGHT / 2);
var WHEEL2_OFFSET_X = 127 + (gameClasses.DeerStacker2.CPlayer.prototype.WHEEL_WIDTH / 2);
var WHEEL2_OFFSET_Y = 35 + (gameClasses.DeerStacker2.CPlayer.prototype.WHEEL_HEIGHT / 2);
var DRIVER_OFFSET_X = 57;
var DRIVER_OFFSET_Y = -13;
var rv = 0;
var FRICTION = 0.9;
}
Symbol 552 MovieClip [__Packages.gameClasses.DeerStacker2.CCloud] Frame 0
class gameClasses.DeerStacker2.CCloud extends apiClasses.CSprite2D
{
var type, clip, path, depth, width, height, render, x, xVel, y, scale;
function CCloud () {
super();
type = 0;
}
function init(x, y, type, index, depth, path) {
super.init(x, y, index, depth, path);
this.type = type;
createMovieClip();
setRandomVel();
}
static function getMaxType() {
return(CLOUD_BIG);
}
function createMovieClip() {
var _local2;
if (type == CLOUD_SMALL) {
_local2 = "CloudSmall";
} else if (type == CLOUD_MEDIUM_1) {
_local2 = "CloudMedium1";
} else if (type == CLOUD_MEDIUM_2) {
_local2 = "CloudMedium2";
} else if (type == CLOUD_BIG) {
_local2 = "CloudBig";
}
clip = path.attachMovie(_local2, "Cloud" + depth, depth);
clip.cacheAsBitmap = true;
clip.gotoAndStop(1);
width = clip._width;
height = clip._height;
render();
}
function update() {
super.update();
if (x > (gameClasses.DeerStacker2.CConstants.SCREEN_WIDTH + 100)) {
convertItselfIntoAnotherCloud();
}
}
function setRandomVel() {
xVel = (Math.random() * 0.5) + 0.5;
}
function convertItselfIntoAnotherCloud() {
x = -200;
clip.removeMovieClip();
y = apiClasses.CMath.getRandom(0, gameClasses.DeerStacker2.CConstants.SCREEN_HEIGHT / 2);
type = apiClasses.CMath.getRandom(0, getMaxType());
setRandomVel();
createMovieClip();
}
function applyScale(aScale) {
scale = aScale;
render();
}
static var CLOUD_SMALL = 0;
static var CLOUD_MEDIUM_1 = 1;
static var CLOUD_MEDIUM_2 = 2;
static var CLOUD_BIG = 3;
}
Symbol 553 MovieClip [__Packages.gameClasses.DeerStacker2.CCatapult] Frame 0
class gameClasses.DeerStacker2.CCatapult extends apiClasses.CSprite2D
{
var clip, path, depth, width, height, scale;
function CCatapult () {
super();
}
function init(x, y, depth, path) {
super.init(x, y, -1, depth, path);
createMovieClip();
}
function createMovieClip() {
clip = path.attachMovie("Catapult2", "Catapult2", depth);
clip.catapult.gotoAndPlay(136);
width = clip._width;
height = clip._height;
render();
}
function render() {
super.render();
}
function destroy() {
super.destroy();
}
function applyScale(aScale) {
scale = aScale;
render();
}
function stopAnimation() {
super.stopAnimation();
clip.catapult.gotoAndStop(clip.catapult._currentframe);
}
function continueAnimation() {
super.continueAnimation();
clip.catapult.play();
}
var CATAPULT_OFFSET_X = 410;
var CATAPULT_OFFSET_Y = 175;
}
Symbol 554 MovieClip [__Packages.gameClasses.DeerStacker2.CObstacle] Frame 0
class gameClasses.DeerStacker2.CObstacle extends apiClasses.CSprite2D
{
var gravity, onCar, xShift, hasCollidedWithStack, bounced, scale, type, rotation, rotVel, xVel, yVel, state, clip, path, depth, width, height, render, y, invertYVel, invertXVel, baseAngle, rDeer;
function CObstacle () {
super();
gravity = 0.45;
onCar = false;
xShift = 0;
hasCollidedWithStack = false;
bounced = false;
scale = _root.clipGame.currentScale;
}
function init(x, y, type, depth, path, rotVel, xVel, yVel) {
super.init(x, y, type, depth, path);
this.type = type;
createMovieClip();
rotation = 0;
this.rotVel = rotVel;
this.xVel = xVel;
this.yVel = yVel;
scale = _root.clipGame.currentScale;
state = STATE_FREEFALL;
}
function getType() {
return(type);
}
static function getRandomType() {
return(apiClasses.CMath.getRandom(ENGINE, TRACTOR_TIRE));
}
function createMovieClip() {
var _local2;
if (type == ENGINE) {
_local2 = "Engine";
} else if (type == FRIDGE) {
_local2 = "Fridge";
} else if (type == TOILET) {
_local2 = "Toilet";
} else if (type == TONIC) {
_local2 = "Tonic";
} else if (type == TRACTOR_TIRE) {
_local2 = "TractorTire";
}
clip = path.attachMovie(_local2, "Obstacle" + depth, depth);
clip.cacheAsBitmap = true;
clip.gotoAndStop(1);
width = clip._width;
height = clip._height;
render();
}
function update() {
if (state == STATE_ANIMATION_DEAD) {
cuentaAnimationDead++;
if ((cuentaAnimationDead % 4) <= 1) {
clip._visible = false;
} else {
clip._visible = true;
}
if (cuentaAnimationDead >= MAX_CUENTA_ANIMATION_DEAD) {
state = STATE_DEAD;
}
return(undefined);
}
super.update();
var _local4;
if ((!hasCollidedWithStack) && ((!bounced) || (type == TRACTOR_TIRE))) {
_local4 = _global.deerManager.checkColisionWithStack(this);
} else {
_local4 = false;
}
if (_local4 && (!hasCollidedWithStack)) {
trace("COLISION OBSTACLE - STACK");
trace((y + " ----- ") + _global.deerManager.getTopYDeerStack());
if (y < _global.deerManager.getTopYDeerStack()) {
yVel = yVel * 0.3;
invertYVel();
} else {
xVel = xVel * 1.5;
invertXVel();
}
hasCollidedWithStack = true;
}
if (state == STATE_FREEFALL) {
var _local5 = 500;
if (y > _local5) {
y = _local5;
if (type == TRACTOR_TIRE) {
yVel = yVel * 0.9;
} else {
yVel = yVel * 0.2;
}
invertYVel();
if (bounced) {
startAnimacionDead();
} else {
playSoundHitGround();
bounced = true;
}
}
}
}
function setBounced(b) {
bounced = b;
}
function setOnCar(b) {
onCar = b;
}
function isOnCar() {
return(onCar);
}
function setXShift(xs) {
xShift = xs;
}
function getXShift() {
return(xShift);
}
function getBaseAngle() {
return(baseAngle);
}
function isDead() {
return(state == STATE_DEAD);
}
function setState(nextState) {
if (state != nextState) {
state = nextState;
if (state == STATE_ON_GROUND) {
baseAngle = rotation;
yVel = 0;
xVel = 0;
rotVel = 0;
gravity = 0;
}
}
}
function getState() {
return(state);
}
function setRDeer(deer) {
rDeer = deer;
}
function getRDeer() {
return(rDeer);
}
function applyScale(aScale) {
scale = aScale;
render();
}
function startAnimacionDead() {
state = STATE_ANIMATION_DEAD;
cuentaAnimationDead = 0;
}
function playSoundHitGround() {
if (type == ENGINE) {
_root.clipGame.playSound(_root.clipGame.SOUND_ENGINE_HITTING_FLOOR);
} else if (type == FRIDGE) {
_root.clipGame.playSound(_root.clipGame.SOUND_FRIDGE_HITTING_FLOOR);
} else if (type == TOILET) {
_root.clipGame.playSound(_root.clipGame.SOUND_TOILET_HITTING_FLOOR);
} else if (type == TRACTOR_TIRE) {
_root.clipGame.playSound(_root.clipGame.SOUND_TRACTOR_TIRE_HITTING_FLOOR);
}
}
static var ENGINE = 0;
static var FRIDGE = 1;
static var TOILET = 2;
static var TONIC = 3;
static var TRACTOR_TIRE = 4;
static var STATE_FREEFALL = 0;
static var STATE_DEAD = 2;
static var STATE_ON_GROUND = 3;
static var STATE_ANIMATION_DEAD = 4;
var cuentaAnimationDead = 0;
var MAX_CUENTA_ANIMATION_DEAD = 20;
}
Symbol 555 MovieClip [__Packages.gameClasses.DeerStacker2.CDeer] Frame 0
class gameClasses.DeerStacker2.CDeer extends apiClasses.CSprite2D
{
var gravity, onCar, xShift, bounced, inStack, scale, type, rotation, rotVel, xVel, yVel, state, prevX, prevY, mCreatedByTonic, clip, path, depth, width, height, render, x, y, maxX, baseAngle, rDeer, minX, getClip;
function CDeer () {
super();
gravity = 0.45;
onCar = false;
xShift = 0;
bounced = false;
inStack = false;
scale = _root.clipGame.currentScale;
}
function init(x, y, type, depth, path, rotVel, xVel, yVel, createdByTonic) {
super.init(x, y, type, depth, path);
this.type = type;
createMovieClip();
rotation = 0;
this.rotVel = rotVel;
this.xVel = xVel;
this.yVel = yVel;
state = STATE_FREEFALL;
prevX = x;
prevY = y;
mCreatedByTonic = createdByTonic;
}
static function getMaxType() {
return(ELEPHANT);
}
function createMovieClip() {
var _local2;
if (type == DEER) {
_local2 = "Deer";
} else if (type == SHEEP) {
_local2 = "Sheep";
} else if (type == BUFFALO) {
_local2 = "Buffalo";
} else if (type == ELEPHANT) {
_local2 = "Elephant";
}
clip = path.attachMovie(_local2, "Deer" + depth, depth);
clip.cacheAsBitmap = true;
clip.gotoAndPlay("fly");
width = clip._width;
height = clip._height;
render();
}
function update() {
if (state == STATE_ANIMATION_DEAD) {
cuentaAnimationDead++;
if ((cuentaAnimationDead % 4) <= 1) {
clip._visible = false;
} else {
clip._visible = true;
}
if (cuentaAnimationDead >= MAX_CUENTA_ANIMATION_DEAD) {
state = STATE_DEAD;
}
return(undefined);
}
prevX = x;
prevY = y;
super.update();
if ((yVel > 0) && (!soundFallPlayed)) {
playSoundFall();
soundFallPlayed = true;
}
if ((state == STATE_FREEFALL) || (state == STATE_FREEFALL2)) {
var _local3 = 500;
if (y > _local3) {
y = _local3;
gravity = 0;
xVel = 0;
yVel = 0;
rotVel = 0;
startAnimacionDead();
playSoundHitGround();
}
}
if (x > (maxX + 30)) {
x = maxX + 30;
}
}
function setBounced(b) {
bounced = b;
}
function setOnCar(b) {
onCar = b;
}
function isOnCar() {
return(onCar);
}
function setXShift(xs) {
xShift = xs;
}
function getXShift() {
if (!mCreatedByTonic) {
return(xShift);
}
return(xShift + 60);
}
function getBaseAngle() {
return(baseAngle);
}
function isDead() {
return(state == STATE_DEAD);
}
function setState(nextState) {
if (state != nextState) {
state = nextState;
if (state == STATE_ON_GROUND) {
baseAngle = rotation;
yVel = 0;
xVel = 0;
rotVel = 0;
gravity = 0;
} else if ((state == STATE_FREEFALL2) || (state == STATE_FREEFALL)) {
gravity = 0.45;
}
}
}
function getState() {
return(state);
}
function setRDeer(deer) {
rDeer = deer;
}
function getRDeer() {
return(rDeer);
}
function getType() {
return(type);
}
function applyScale(aScale) {
scale = aScale;
minX = _root.clipGame.minXScaled[_root.clipGame.scaleIndex];
maxX = _root.clipGame.maxXScaled[_root.clipGame.scaleIndex];
render();
}
function playSoundFall() {
if (type == DEER) {
_root.clipGame.playSound(_root.clipGame.SOUND_FALL_DEER);
} else {
_root.clipGame.playSound(_root.clipGame.SOUND_FALL_MUDBALL);
}
}
function playSoundHitGround() {
if (type == DEER) {
_root.clipGame.playSound(_root.clipGame.SOUND_DEER_HIT_GROUND);
} else if (type == SHEEP) {
_root.clipGame.playSound(_root.clipGame.SOUND_SHEEP_HIT_GROUND);
} else if (type == BUFFALO) {
_root.clipGame.playSound(_root.clipGame.SOUND_BUFFALO_HIT_GROUND);
} else if (type == ELEPHANT) {
_root.clipGame.playSound(_root.clipGame.SOUND_ELEPHANT_HIT_GROUND);
}
}
function playSoundHitTruck() {
if (type == DEER) {
_root.clipGame.playSound(_root.clipGame.SOUND_DEER_HIT_TRUCK);
} else if (type == SHEEP) {
_root.clipGame.playSound(_root.clipGame.SOUND_SHEEP_HIT_TRUCK);
} else if (type == BUFFALO) {
_root.clipGame.playSound(_root.clipGame.SOUND_BUFFALO_HIT_TRUCK);
} else if (type == ELEPHANT) {
_root.clipGame.playSound(_root.clipGame.SOUND_ELEPHANT_HIT_TRUCK);
}
}
function playSoundHitDeer() {
if (type == DEER) {
_root.clipGame.playSound(_root.clipGame.SOUND_DEER_HIT_DEER);
} else if (type == SHEEP) {
_root.clipGame.playSound(_root.clipGame.SOUND_SHEEP_HIT_DEER);
} else if (type == BUFFALO) {
_root.clipGame.playSound(_root.clipGame.SOUND_BUFFALO_HIT_DEER);
} else if (type == ELEPHANT) {
_root.clipGame.playSound(_root.clipGame.SOUND_ELEPHANT_HIT_DEER);
}
}
function hitCarEvent() {
playSoundHitTruck();
clip.gotoAndPlay("die");
}
function hitDeerEvent() {
getClip().gotoAndPlay("die");
}
function flyEvent() {
getClip().gotoAndPlay("fly");
}
function startAnimacionDead() {
var _local2 = apiClasses.CMath.toStandardAngle(clip._rotation);
if ((_local2 <= 90) || (_local2 >= 270)) {
clip.gotoAndStop("floor1");
} else {
clip.gotoAndStop("floor2");
}
rotation = 0;
clip._rotation = 0;
state = STATE_ANIMATION_DEAD;
cuentaAnimationDead = 0;
}
function continueAnimation() {
if ((state == STATE_ANIMATION_DEAD) || (state == STATE_ON_GROUND)) {
clip.gotoAndStop(clip._currentframe);
} else {
clip.gotoAndPlay(clip._currentframe);
}
}
function setInStack() {
inStack = true;
if (y < 370) {
x = ((x + prevX) / 2) + 2;
y = ((y + prevY) / 2) + 2;
}
}
function wasInStack() {
return(inStack);
}
function puedeSerAgarradoPorTruck() {
return((state != STATE_ANIMATION_DEAD) && (state != STATE_DEAD));
}
var soundFallPlayed = false;
static var DEER = 0;
static var SHEEP = 1;
static var BUFFALO = 2;
static var ELEPHANT = 3;
static var STATE_FREEFALL = 0;
static var STATE_DEAD = 2;
static var STATE_ON_GROUND = 3;
static var STATE_FREEFALL2 = 4;
static var STATE_ANIMATION_DEAD = 5;
var cuentaAnimationDead = 0;
var MAX_CUENTA_ANIMATION_DEAD = 20;
}
Symbol 556 MovieClip [__Packages.gameClasses.DeerStacker2.CMudBall] Frame 0
class gameClasses.DeerStacker2.CMudBall extends apiClasses.CSprite2D
{
var gravity, scaleImageMud, cual, rotation, rotVel, xVel, yVel, scale, clip, path, depth, mudTrail, width, height, age, x, y;
function CMudBall (aCual) {
super();
gravity = 0.45;
scaleImageMud = 100;
cual = aCual;
}
function init(x, y, depth, path, rotVel, xVel, yVel, aScale) {
super.init(x, y, -1, depth, path);
createMovieClip();
rotation = 0;
this.rotVel = rotVel;
this.xVel = xVel;
this.yVel = yVel;
scale = aScale;
scaleImageMud = 100;
}
function createMovieClip() {
clip = path.attachMovie("MudBall", "MudBall", depth);
clip.gotoAndStop(1);
mudTrail = path.attachMovie("MudTrail", "MudTrail", depth + 1);
mudTrail._rotation = -45;
mudTrail.gotoAndPlay(1);
width = clip._width;
height = clip._height;
render();
}
function update() {
if (getTimer() > (age + FADE_START)) {
scaleImageMud = _root.clipGame.currentScale - (_root.clipGame.currentScale * ((getTimer() - (age + FADE_START)) / FADE_DURATION));
if (scaleImageMud < 0) {
scaleImageMud = 0;
}
}
super.update();
if (getTimer() >= ((age + FADE_START) + FADE_DURATION)) {
_root.clipGame.deleteMudBall(cual);
}
}
function applyScale(aScale) {
scale = aScale;
render();
}
function render() {
super.render();
if (scaleImageMud != 100) {
clip._xscale = (clip._yscale = scaleImageMud);
} else {
clip._xscale = (clip._yscale = scale);
}
mudTrail._x = gameClasses.DeerStacker2.CConstants.SCREEN_X_MIDDLE + ((x - gameClasses.DeerStacker2.CConstants.SCREEN_X_MIDDLE) * (scale / 100));
mudTrail._y = gameClasses.DeerStacker2.CConstants.SCREEN_HEIGHT + ((y - gameClasses.DeerStacker2.CConstants.SCREEN_HEIGHT) * (scale / 100));
if (scaleImageMud == 100) {
mudTrail._xscale = (mudTrail._yscale = scale);
} else {
mudTrail._xscale = (mudTrail._yscale = scaleImageMud);
}
mudTrail._rotation = apiClasses.CMath.angle(xVel, yVel);
}
function stopAnimation() {
super.stopAnimation();
mudTrail.gotoAndStop(mudTrail._currentframe);
}
function continueAnimation() {
super.continueAnimation();
mudTrail.gotoAndPlay(mudTrail._currentframe);
}
function destroy() {
super.destroy();
mudTrail.removeMovieClip();
mudTrail = null;
}
var FADE_START = 1000;
var FADE_DURATION = 1000;
}
Symbol 557 MovieClip [__Packages.gameClasses.DeerStacker2.CTallIndicator] Frame 0
class gameClasses.DeerStacker2.CTallIndicator extends apiClasses.CSprite2D
{
var targetY, clip, path, depth, width, height, render, y;
function CTallIndicator () {
super();
}
function init(x, y, depth, path) {
super.init(x, y, -1, depth, path);
targetY = y;
createMovieClip();
}
function createMovieClip() {
clip = path.attachMovie("TallIndicator", "TallIndicator", depth);
clip.gotoAndPlay(1);
width = clip._width;
height = clip._height;
render();
}
function update() {
if (moving) {
super.update();
if (Math.floor(y) < Math.floor(targetY)) {
y++;
} else if (Math.floor(y) > Math.floor(targetY)) {
y--;
} else {
moving = false;
_root.clipGame.playSound(_root.clipGame.SOUND_CROW);
}
}
}
function setNewTarget(aTargetY) {
if (targetY != aTargetY) {
targetY = aTargetY;
moving = true;
}
}
var moving = false;
}
Symbol 558 MovieClip [__Packages.gameClasses.DeerStacker2.CDeerManager] Frame 0
class gameClasses.DeerStacker2.CDeerManager
{
var path, player, startDepth, height, initialFatSounds, deerHitHood, deers, fallingDeers, groundDeers, topYDeerStack, topYClipDeerStack;
function CDeerManager (path, player, startDepth) {
this.path = path;
this.player = player;
this.startDepth = startDepth;
init();
height = 0;
initialFatSounds = 0;
deerHitHood = 0;
}
function init() {
deers = new Array();
fallingDeers = new Array();
groundDeers = new Array();
}
function addDeer(x, y, type, rotVel, xVel, yVel) {
var _local2 = new gameClasses.DeerStacker2.CDeer();
_local2.init(x, y, type, startDepth, path, rotVel, xVel, yVel);
startDepth++;
_local2.flyEvent();
deers.push(_local2);
fallingDeers.push(_local2);
}
function addDeerTonic(xx2, yy2, type, rotation) {
var _local2 = new gameClasses.DeerStacker2.CDeer();
_local2.init(xx2, yy2, gameClasses.DeerStacker2.CDeer.DEER, startDepth, path, 0, 0, 0, true);
startDepth++;
deers.push(_local2);
_local2.setRotation(rotation);
_local2.setState(gameClasses.DeerStacker2.CDeer.STATE_ON_GROUND);
_local2.setOnCar(true);
_local2.setInStack();
groundDeers.push(_local2);
_local2.getClip().gotoAndPlay("bubbles");
}
function update() {
moveDeers();
}
function moveDeers() {
var _local23 = player.getXVel();
var _local24 = 4.5;
var _local19 = Math.abs(_local23 / _local24);
var _local20 = 216000000 /* 0xCDFE600 */;
var _local21 = 100;
var _local8 = _local23 / Math.abs(_local23);
var _local22 = 30;
topYDeerStack = player.getY();
topYClipDeerStack = _root.clipGame.TALL_INDICATOR_START_Y;
var _local11 = 0;
while (_local11 <= deers.length) {
var _local5 = gameClasses.DeerStacker2.CDeer(deers[_local11]);
_local5.update();
if (_local5.isOnCar()) {
_local5.setX(player.getX() + _local5.getXShift());
if (_local5.getY() < topYDeerStack) {
topYDeerStack = _local5.getY();
topYClipDeerStack = _local5.getYClip();
}
var _local16 = Math.pow(Math.abs(_local5.getY() - player.getY()), 3) / _local20;
var _local17 = (_local21 * _local19) * _local16;
_local5.setX(_local5.getX() - (_local8 * _local17));
_local5.setRotVel(0);
var _local12 = _local5.getRotation();
var _local15 = _local5.getBaseAngle() - (((_local8 * _local22) * _local16) * _local19);
if (Math.abs(_local12 - _local15) > 0.5) {
_local5.setRotation(_local15);
}
} else if (_local5.isDead()) {
_local5.destroy();
deers.splice(_local11, 1);
}
_local11++;
}
var _local18 = 15;
_local11 = 0;
while (_local11 <= (fallingDeers.length - 1)) {
var _local3 = gameClasses.DeerStacker2.CDeer(fallingDeers[_local11]);
if (_local3.getState() != gameClasses.DeerStacker2.CDeer.STATE_FREEFALL2) {
_local3.continueAnimation();
}
if (_local3.isDead()) {
fallingDeers.splice(_local11, 1);
if (_local3.getType() == gameClasses.DeerStacker2.CDeer.DEER) {
if (!_local3.wasInStack()) {
if (_root.clipGame.vidas > 0) {
_root.clipGame.playSound(_root.clipGame.SOUND_VOICE_MISSED_THAT_ONE);
}
_root.clipGame.loseALife();
}
}
_local3.destroy();
}
if (_local3.getClip().hitArea_mc.hitTest(player.getClip().hitArea_mc) && (_local3.puedeSerAgarradoPorTruck())) {
if ((_local3.getState() != gameClasses.DeerStacker2.CDeer.STATE_FREEFALL2) && (canAddDeers())) {
if (_local3.getY() > (player.getY() - 50)) {
trace("**** CIERVO CORREGIDO CON EL AUTO Y***");
_local3.setY(player.getY() - 50);
}
if (_local3.getX() > (player.getX() + 80)) {
trace("**** CIERVO CORREGIDO CON EL AUTO X+ CAJUELA ***");
_local3.setX(player.getX() + 80);
}
if (_local3.getX() < (player.getX() + 30)) {
trace("**** CIERVO CORREGIDO CON EL AUTO X+ CAJUELA ***");
_local3.setX(player.getX() + 30);
}
_local3.hitCarEvent();
_local3.setState(gameClasses.DeerStacker2.CDeer.STATE_ON_GROUND);
fallingDeers.splice(_local11, 1);
groundDeers.push(_local3);
_local3.setOnCar(true);
_local3.setXShift(_local3.getX() - player.getX());
if (deerHitHood == 0) {
deerHitHood = 1;
}
if (!_local3.wasInStack()) {
_local3.setInStack();
addScore(_local3.getY(), _local3);
if (_local5.getY() < topYDeerStack) {
topYDeerStack = _local5.getY();
topYClipDeerStack = _local5.getYClip();
}
}
}
}
if (_local3.getState() == gameClasses.DeerStacker2.CDeer.STATE_FREEFALL) {
var _local10 = 0;
while (_local10 <= (groundDeers.length - 1)) {
var _local7 = gameClasses.DeerStacker2.CDeer(groundDeers[_local10]);
var _local14 = getDis(_local3, _local7);
if ((_local14 < (2 * _local18)) && (_local3.getRDeer() != _local7)) {
var _local4 = _local3;
var _local6 = _local7;
var _local9 = _local4.getX() - _local6.getX();
if (((Math.abs(_local9) < 8) && (_local4.getYVel() > 0)) && (canAddDeers())) {
if (_local6.isOnCar() && (_local6.getState() == gameClasses.DeerStacker2.CDeer.STATE_ON_GROUND)) {
_local3.playSoundHitDeer();
_local4.setState(gameClasses.DeerStacker2.CDeer.STATE_ON_GROUND);
fallingDeers.splice(_local11, 1);
groundDeers.push(_local4);
_local4.getClip().gotoAndPlay("die");
_local4.setOnCar(true);
var _local13 = _local6.getX() - _local4.getX();
_local4.setX((player.getX() + _local6.getXShift()) - _local13);
_local4.setXShift(_local4.getX() - player.getX());
var _local12 = _local6.getClip()._rotation;
if ((Math.abs(_local12) < 25) || (Math.abs(180 - Math.abs(_local12)) < 25)) {
_local6.hitDeerEvent();
}
if (!_local4.wasInStack()) {
addScore(_local4.getY(), _local4);
_local4.setInStack();
}
break;
}
} else {
_local3.setBounced(true);
_local3.setRDeer(_local7);
_local8 = _local9 / Math.abs(_local9);
_local4.setRotVel((_local8 * 4) + (random(6) * _local8));
_local4.setYVel(_local4.getYVel() * 0.75);
_local4.setXVel(((1 * _local8) + (random(2) * _local8)) + player.getXVel());
break;
}
}
_local10++;
}
}
_local11++;
}
height = Math.floor(Math.abs(player.getY() - topYDeerStack));
}
function render() {
var _local2 = 0;
while (_local2 < deers.length) {
var _local3 = deers[_local2];
_local3.render();
_local2++;
}
}
function getDis(dr1, dr2) {
return(Math.sqrt(((dr1.getX() - dr2.getX()) * (dr1.getX() - dr2.getX())) + ((dr1.getY() - dr2.getY()) * (dr1.getY() - dr2.getY()))));
}
function getHeight() {
return(height);
}
function getTopYDeerStack() {
return(topYDeerStack);
}
function getTopYClipDeerStack() {
return(topYClipDeerStack);
}
function applyScale(aScale) {
var _local3 = deers.length - 1;
while (_local3 >= 0) {
var _local4 = gameClasses.DeerStacker2.CDeer(deers[_local3]);
_local4.applyScale(aScale);
_local3--;
}
var _local2 = groundDeers.length - 1;
while (_local2 >= 0) {
var _local4 = gameClasses.DeerStacker2.CDeer(groundDeers[_local2]);
_local4.applyScale(aScale);
_local2--;
}
_local3 = fallingDeers.length - 1;
while (_local3 >= 0) {
var _local4 = gameClasses.DeerStacker2.CDeer(fallingDeers[_local3]);
_local4.applyScale(aScale);
_local3--;
}
}
function tonic(deer) {
var _local6 = Math.floor(deer.getX());
var _local4 = Math.floor(deer.getY());
_root.clipGame.playSound(_root.clipGame.SOUND_CLONE_TONIC);
trace("TONIC ..........................");
trace("X del DEER: " + deer.getX());
trace("X del CLIP del DEER: " + deer.getClip()._x);
var _local3 = 0;
while (_local3 < 5) {
_local4 = _local4 - 20;
trace((("se va acrear el deer tonic con: lastX " + _local6) + " lastY ") + _local4);
var _local5 = apiClasses.CMath.getRandom(0, 360);
addDeerTonic(_local6, _local4, deer.getType(), _local5);
_local3++;
}
trace("... termino tonic.......");
}
function breakStack(y) {
var _local3 = deers.length;
while (_local3 >= 0) {
var _local2 = gameClasses.DeerStacker2.CDeer(deers[_local3]);
if ((_local2.isOnCar() && (_local2.getY() <= (y + 30))) && (_local2.getY() >= (y - 60))) {
_local2.setOnCar(false);
_local2.setState(gameClasses.DeerStacker2.CDeer.STATE_FREEFALL2);
_local2.setRotVel(random(8) - random(8));
fallingDeers.push(_local2);
groundDeers.splice(_local3, 1);
_local2.setXVel(apiClasses.CMath.getFloatRandom(-3, 3));
} else if (_local2.isOnCar() && (_local2.getY() <= (y - 60))) {
_local2.setOnCar(false);
_local2.setState(gameClasses.DeerStacker2.CDeer.STATE_FREEFALL);
_local2.setRotVel(random(4) - random(4));
fallingDeers.push(_local2);
groundDeers.splice(_local3, 1);
_local2.setXVel(apiClasses.CMath.getFloatRandom(-2, 2));
}
_local3--;
}
}
function checkColisionWithStack(obstacle) {
var _local6 = 15;
var _local3 = groundDeers.length - 1;
while (_local3 >= 0) {
var _local2 = gameClasses.DeerStacker2.CDeer(groundDeers[_local3]);
var _local5 = _local2.getDist(obstacle);
if (_local5 < (2 * _local6)) {
if (_local2.isOnCar() && (_local2.getState() == gameClasses.DeerStacker2.CDeer.STATE_ON_GROUND)) {
if (obstacle.getType() == gameClasses.DeerStacker2.CObstacle.TONIC) {
tonic(_local2);
} else {
breakStack(obstacle.getY());
}
return(true);
}
}
_local3--;
}
return(false);
}
function getNumDeers() {
return(groundDeers.length);
}
function destroy() {
var _local2 = 0;
while (_local2 <= deers.length) {
var _local3 = gameClasses.DeerStacker2.CDeer(deers[_local2]);
_local3.destroy();
_local3 = null;
_local2++;
}
deers = null;
_local2 = 0;
while (_local2 <= groundDeers.length) {
var _local3 = gameClasses.DeerStacker2.CDeer(groundDeers[_local2]);
_local3.destroy();
_local3 = null;
_local2++;
}
groundDeers = null;
_local2 = 0;
while (_local2 <= fallingDeers.length) {
var _local3 = gameClasses.DeerStacker2.CDeer(fallingDeers[_local2]);
_local3.destroy();
_local3 = null;
_local2++;
}
fallingDeers = null;
}
function stopAnimation() {
var _local2 = 0;
while (_local2 <= deers.length) {
var _local3 = gameClasses.DeerStacker2.CDeer(deers[_local2]);
_local3.stopAnimation();
_local2++;
}
_local2 = 0;
while (_local2 <= groundDeers.length) {
var _local3 = gameClasses.DeerStacker2.CDeer(groundDeers[_local2]);
_local3.stopAnimation();
_local2++;
}
_local2 = 0;
while (_local2 <= fallingDeers.length) {
var _local3 = gameClasses.DeerStacker2.CDeer(fallingDeers[_local2]);
_local3.stopAnimation();
_local2++;
}
}
function continueAnimation() {
var _local2 = 0;
while (_local2 <= deers.length) {
var _local3 = gameClasses.DeerStacker2.CDeer(deers[_local2]);
_local3.continueAnimation();
_local2++;
}
_local2 = 0;
while (_local2 <= groundDeers.length) {
var _local3 = gameClasses.DeerStacker2.CDeer(groundDeers[_local2]);
_local3.continueAnimation();
_local2++;
}
_local2 = 0;
while (_local2 <= fallingDeers.length) {
var _local3 = gameClasses.DeerStacker2.CDeer(fallingDeers[_local2]);
_local3.continueAnimation();
_local2++;
}
}
function addScore(aY, aDeer, createdByTonic) {
var _local3;
var _local4 = aDeer.getType();
if (_local4 == gameClasses.DeerStacker2.CDeer.DEER) {
_local3 = 1;
} else if (_local4 == gameClasses.DeerStacker2.CDeer.SHEEP) {
_local3 = 2;
} else if (_local4 == gameClasses.DeerStacker2.CDeer.BUFFALO) {
_local3 = 3;
} else if (_local4 == gameClasses.DeerStacker2.CDeer.ELEPHANT) {
_local3 = 5;
}
var _local5;
if (aY < topYDeerStack) {
_local5 = aY;
} else {
_local5 = topYDeerStack;
}
var _local8 = Math.floor(Math.abs(player.getY() - aY));
var _local10 = Math.floor(Math.abs(player.getY() - _local5));
var _local6 = 50 + (_local8 * _local3);
_root.clipGame.dispararFloatingScore(aDeer.getClip()._x, aDeer.getClip()._y, _local6, _local3);
}
function canAddDeers() {
return(groundDeers.length < MAX_DEERS);
}
function getStack() {
return(groundDeers);
}
static var MAX_DEERS = 200;
}