Frame 1
stop();
_quality = "MEDIUM";
var lastByteChuck = 0;
var currentByteChunk = 0;
var msPassed = new Date();
currentMS = msPassed.getMilliseconds();
var oldMS = msPassed.getMilliseconds();
loadFunction = function () {
loaded = _root.getBytesLoaded();
total = _root.getBytesTotal();
pLoaded = Math.ceil((loaded / total) * 100);
pLoadedTxt.text = pLoaded + "%";
loadBar.gotoAndStop(pLoaded);
bytesLoadedChunk = loaded / getTimer();
timeLeft = Math.ceil(((100 / pLoaded) - 1) * (getTimer() / 1000));
timeLeftTxt.text = timeLeft + " seconds";
if (loaded == total) {
loadFinished();
}
trace((bytesLoadedChunk + ":") + (10 * pLoaded));
};
loadFinished = function () {
clearInterval(lf);
gotoAndPlay (2);
};
var lf = setInterval(this, "loadFunction", 24);
Frame 7
stopAllSounds();
getURL ("javascript:urchinTracker('/derecho/loadfinished');");
Frame 944
var b1 = new Sound(bolt1);
b1.setVolume(10);
var b2 = new Sound(bolt2);
b2.setVolume(10);
Frame 977
stop();
Frame 986
if (instructions == true) {
gotoAndPlay ("begin");
}
Frame 1004
stop();
instructions = true;
Frame 1021
stop();
Frame 1077
methane.gotoAndStop(2);
rocket.gotoAndStop(2);
cow.gotoAndStop(2);
Frame 1101
stop();
getURL ("javascript:urchinTracker('/derecho/gamestarted');");
Symbol 3 MovieClip Frame 1
_visible = false;
Symbol 7 MovieClip [tree3] Frame 1
stop();
Symbol 10 MovieClip [tree2] Frame 1
stop();
Symbol 14 MovieClip [tree1] Frame 1
stop();
Symbol 28 MovieClip Frame 1
_alpha = 0;
Symbol 42 MovieClip [cow3] Frame 1
stop();
Symbol 42 MovieClip [cow3] Frame 2
stop();
_xscale = 100;
Symbol 42 MovieClip [cow3] Frame 23
gotoAndStop (1);
Symbol 42 MovieClip [cow3] Frame 55
gotoAndStop (1);
Symbol 54 MovieClip [cow2] Frame 1
stop();
Symbol 54 MovieClip [cow2] Frame 2
stop();
_xscale = 100;
Symbol 54 MovieClip [cow2] Frame 23
gotoAndStop (1);
Symbol 54 MovieClip [cow2] Frame 55
gotoAndStop (1);
Symbol 99 MovieClip [smoke] Frame 23
stop();
Symbol 132 MovieClip Frame 15
stop();
Symbol 133 MovieClip [cowSuperMissile] Frame 1
stop();
Symbol 137 MovieClip Frame 16
stop();
Symbol 138 MovieClip [tn] Frame 1
stop();
Symbol 140 MovieClip [sl] Frame 1
stop();
Symbol 147 MovieClip Frame 16
stop();
Symbol 148 MovieClip [bhp] Frame 1
stop();
Symbol 150 MovieClip [hp] Frame 1
stop();
Symbol 155 MovieClip [rock] Frame 1
stop();
Symbol 158 MovieClip [tractorSmoke] Frame 23
this.removeMovieClip();
Symbol 193 MovieClip Frame 1
stop();
Symbol 200 MovieClip [tractor] Frame 1
stop();
Symbol 200 MovieClip [tractor] Frame 2
stop();
Symbol 200 MovieClip [tractor] Frame 9
gotoAndStop (1);
Symbol 200 MovieClip [tractor] Frame 24
gotoAndStop (1);
Symbol 202 MovieClip [cowMissile] Frame 1
stop();
Symbol 211 MovieClip [cow1] Frame 1
stop();
Symbol 211 MovieClip [cow1] Frame 2
stop();
_xscale = 100;
Symbol 211 MovieClip [cow1] Frame 23
gotoAndStop (1);
Symbol 211 MovieClip [cow1] Frame 55
gotoAndStop (1);
Symbol 221 MovieClip Frame 26
stop();
Symbol 223 MovieClip Frame 1
_visible = false;
Symbol 226 MovieClip [methane] Frame 1
stop();
Symbol 229 MovieClip Frame 1
stop();
Symbol 255 MovieClip Frame 20
stop();
Symbol 257 Button
on (release) {
gotoAndPlay (944);
}
Symbol 287 MovieClip Frame 23
gotoAndPlay (1);
Symbol 287 MovieClip Frame 55
gotoAndStop (1);
Symbol 292 MovieClip Frame 1
stop();
Symbol 292 MovieClip Frame 21
gotoAndPlay (2);
Symbol 304 MovieClip Frame 1
var song1 = new Sound(this);
song1.attachSound("arriba1");
song1.stop();
var song2 = new Sound(this);
song2.attachSound("arriba2");
song1.onSoundComplete = function () {
song1.start();
};
song2.onSoundComplete = function () {
song1.start();
};
song1.start();
Symbol 307 Button
on (release) {
_parent.gotoAndPlay("start");
}
Symbol 309 Button
on (release) {
getURL ("http://www.hannadbs.com/", "_blank");
}
Symbol 310 Button
on (release) {
getURL ("http://www.hannadbs.com/derecho/readhighscores.cfm", "_blank");
}
Symbol 311 Button
on (release) {
getURL ("http://www.hannadbs.com/derecho/", "_blank");
}
Symbol 373 MovieClip Frame 1
stop();
Symbol 386 Button
on (release) {
play();
}
Symbol 399 MovieClip Frame 1
stop();
if (fp != true) {
fp = true;
var mySound = new Sound(this);
mySound.setVolume(100);
}
Symbol 399 MovieClip Frame 2
mySound.setVolume(0);
stop();
Symbol 407 MovieClip Frame 1
_visible = false;
stop();
Symbol 407 MovieClip Frame 2
stop();
Symbol 407 MovieClip Frame 3
stop();
Symbol 407 MovieClip Frame 4
stop();
Symbol 407 MovieClip Frame 5
stop();
Symbol 407 MovieClip Frame 6
stop();
Symbol 407 MovieClip Frame 7
stop();
Symbol 421 MovieClip Frame 1
par = _parent._parent;
onEnterFrame = function () {
_rotation = (_rotation + 8);
j = 0;
while (j < par.cowArray.length) {
var _local2 = {x:0, y:0};
par.cowArray[j].localToGlobal(_local2);
if (((this.hitTest(_local2.x, _local2.y, true) == true) && (par.cowArray[j].emotion != 10)) && (par.cowArray[j].cowType != 4)) {
par.splodeCow(par.cowArray[j], 50, false);
}
j++;
}
};
Symbol 430 MovieClip Frame 1
stop();
Symbol 430 MovieClip Frame 2
stop();
Symbol 430 MovieClip Frame 3
stop();
Symbol 430 MovieClip Frame 4
stop();
Symbol 430 MovieClip Frame 5
stop();
Symbol 430 MovieClip Frame 6
stop();
Symbol 433 MovieClip Frame 1
_visible = false;
Symbol 434 MovieClip Frame 1
mrCloud.yspeed = 0;
mrCloud.xspeed = 0;
var lightningPoint = new Object();
var minHeight = 0;
var xchange = 2;
var boltCounter = 0;
var boltDepth = 100;
var cowDepth = 0;
var groundLevel = 100;
var rootLevel = this;
var smokeCounter = 0;
var treeDepth = 200;
var weaponsCounter = 0;
var weaponsDepth = -200;
var rockDepth = -500;
var life = 100;
var wave = 1;
var gamePaused = false;
var powerUpCounter = 0;
var powerUpDepth = 300;
var gameSpeed = 24;
var cowTypes = 3;
var superMode = false;
var smt = 100;
var goreAmount = 0;
var maxCombo = 0;
var kills = 0;
var shots = 0;
var tsmokeDepth = 1000;
var tsmokeCounter = 0;
var cowCombo = 0;
var comboInterval;
var tornadoTime = 0;
var tornadoMode = false;
var hyperMode = false;
var hyperTime = 0;
var missileCounter = 0;
var missileDepth = -100;
var currentStage = 1;
var rocks = new Array();
var gorePieces = new Array();
var missileArray = new Array();
var weaponsArray = new Array();
var powerUpArray = new Array();
var treeArray = new Array();
var cowArray = new Array();
var levelInfo = new Array();
var erb = new Object();
erb.rockCount = -1;
erb.treeCount = -1;
erb.treeType = -1;
levelInfo.push(erb);
erb = new Object();
erb.rockCount = 1;
erb.treeCount = 10;
erb.treeType = 1;
levelInfo.push(erb);
erb = new Object();
erb.rockCount = 4;
erb.treeCount = 3;
erb.treeType = 2;
levelInfo.push(erb);
erb = new Object();
erb.rockCount = 3;
erb.treeCount = 12;
erb.treeType = 2;
levelInfo.push(erb);
erb = new Object();
erb.rockCount = 2;
erb.treeCount = 10;
erb.treeType = 1;
levelInfo.push(erb);
erb = new Object();
erb.rockCount = 2;
erb.treeCount = 6;
erb.treeType = 1;
levelInfo.push(erb);
erb = new Object();
erb.rockCount = 0;
erb.treeCount = 8;
erb.treeType = 3;
levelInfo.push(erb);
erb = new Object();
erb.rockCount = 2;
erb.treeCount = 12;
erb.treeType = 1;
levelInfo.push(erb);
var hover = 0;
var score = 0;
mrCloud.swapDepths(500);
stageBG3.swapDepths(1500);
lightningRod._visible = false;
degToRad = function (angle) {
radians = 0.0174532925 * angle;
return(radians);
};
convert360 = function (angle) {
if (angle < 0) {
angle = Math.abs(angle) + 180;
}
return(angle);
};
clearAllIntervals = function () {
clearInterval(rootLevel.rod);
clearInterval(rootLevel.moveCloud);
clearInterval(rootLevel.scrollBackground);
clearInterval(rootLevel.runCows);
clearInterval(rootLevel.tornadoInterval);
};
distanceToCloud = function (mc) {
if ((Math.abs(mc._x - mrCloud._x) < 100) && (Math.abs(mc._y - mrCloud._y) < 100)) {
return(true);
}
return(false);
};
checkWeaponHit = function (mc) {
trace("Cheacking WeapHit");
var _local1 = {x:0, y:0};
mc.localToGlobal(_local1);
if (mrCloud.hitTest(_local1.x, _local1.y, true)) {
return(true);
}
return(false);
};
pauseGame = function () {
gamePaused = true;
clearInterval(rootLevel.rod);
clearInterval(rootLevel.moveCloud);
clearInterval(rootLevel.scrollBackground);
clearInterval(rootLevel.runCows);
};
resumeGame = function () {
gamePaused = false;
rod = setInterval(this, "moveRod", gameSpeed);
moveCloud = setInterval(this, "cloudMovement", gameSpeed);
scrollBackground = setInterval(this, "bgActions", gameSpeed);
runCows = setInterval(this, "moveCows", gameSpeed);
};
resetAllDogs = function () {
i = 0;
while (i < gorePieces.length) {
clearInterval(gorePieces[i].movement);
i++;
}
i = 0;
while (i < rocks.length) {
rocks[i].gotoAndStop(2);
clearInterval(rocks[i].moveRock);
rocks[i].removeMovieClip();
i++;
}
i = 0;
while (i < cowArray.length) {
cowArray[i].gotoAndStop(2);
cowArray[i].removeMovieClip();
i++;
}
i = 0;
while (i < treeArray.length) {
clearInterval(treeArray[i].rotateTree);
treeArray[i].removeMovieClip();
i++;
}
i = 0;
while (i < weaponsArray.length) {
clearInterval(weaponsArray[i].flyObject);
weaponsArray[i].gotoAndStop(2);
weaponsArray[i].removeMovieClip();
i++;
}
i = 0;
while (i < powerUpArray.length) {
powerUpArray[i].gotoAndStop(2);
clearInterval(powerUpArray[i].flyObject);
powerUpArray[i].removeMovieClip();
i++;
}
i = 0;
while (i < missileArray.length) {
missileArray[i].gotoAndStop(2);
clearInterval(missileArray[i].flyObject);
missileArray[i].removeMovieClip();
i++;
}
rocks = new Array();
gorePieces = new Array();
missileArray = new Array();
weaponsArray = new Array();
powerUpArray = new Array();
treeArray = new Array();
cowArray = new Array();
};
nextWave = function (level) {
currentStage = level;
_parent.waveCounter.wave = wave;
_parent.waveCounter.gotoAndPlay(1);
stageBG.gotoAndStop(level);
ground.gotoAndStop(level);
mrCloud._x = -400;
mrCloud._y = -400;
shots = 0;
kills = 0;
maxCombo = 0;
clearAllIntervals();
resetAllDogs();
resetModes();
startGame();
};
startGame = function () {
resetAllDogs();
i = 0;
while (i < levelInfo[currentStage].rockCount) {
attachMovie("rock", "rock" + i, i + rockDepth);
rocks[i] = rootLevel["rock" + i];
rocks[i]._x = -1000 + (Math.random() * 2000);
rocks[i]._y = -2000;
var _local2 = 25 + (Math.random() * 85);
rocks[i].yspeed = 0;
rocks[i].xspeed = 0;
rocks[i].rotationSpeed = 0;
treeArray[i]._xscale = _local2;
treeArray[i]._yscale = _local2;
rocks[i].radius = _local2 / 2;
rocks[i].rootLevel = rootLevel;
i++;
}
i = 0;
while (i < levelInfo[currentStage].treeCount) {
attachMovie("tree" + levelInfo[currentStage].treeType, "tree" + i, i + treeDepth);
treeArray[i] = rootLevel["tree" + i];
trace(treeArray[i]);
treeArray[i]._x = -1000 + (Math.random() * 2000);
treeArray[i]._y = -2000;
treeArray[i].rotationSpeed = 0;
treeArray[i]._xscale = 50 + (Math.random() * 25);
treeArray[i]._yscale = 50 + (Math.random() * 25);
treeArray[i].rootLevel = rootLevel;
i++;
}
if ((wave % 5) != 0) {
i = 0;
while (i < (wave * 2)) {
if (Math.random() < 0.8) {
if (Math.random() > (1.5 - (wave / 8))) {
newCowType = 3;
} else if (Math.random() > (1.125 - (wave / 5))) {
newCowType = 2;
} else {
newCowType = 1;
}
} else {
newCowType = 1;
}
attachMovie("cow" + newCowType, "cow" + i, i + cowDepth);
cowArray[i] = rootLevel["cow" + i];
cowArray[i]._x = -1000 + (Math.random() * 2000);
cowArray[i]._y = groundLevel;
cowArray[i].cowType = newCowType;
cowArray[i].rootLevel = rootLevel;
cowArray[i].xspeed = -2;
cowArray[i].yspeed = -5;
cowArray[i].life = 100;
cowArray[i].emotion = 1;
cowArray[i].scare = false;
cowArray[i].newposx = cowArray[i]._x;
cowArray[i].newposy = cowArray[i]._y;
cowArray[i].maxCowSpeed = (Math.random() * 5) + 5;
i++;
}
} else {
attachMovie("tractor", "tractor", cowDepth);
cowArray[0] = rootLevel.tractor;
cowArray[0]._x = -1000 + (Math.random() * 2000);
cowArray[0]._y = groundLevel;
cowArray[0].cowType = 4;
cowArray[0].rootLevel = rootLevel;
cowArray[0].xspeed = wave;
cowArray[0].life = 100 * wave;
cowArray[0].yspeed = 0;
cowArray[0].emotion = 9;
cowArray[0].scare = false;
cowArray[0].newposx = cowArray[i]._x;
cowArray[0].newposy = cowArray[i]._y;
cowArray[0].maxCowSpeed = (Math.random() * 5) + 5;
trace(cowArray[0] + "sefes");
}
settleTreesAndRocks();
rod = setInterval(this, "moveRod", gameSpeed);
moveCloud = setInterval(this, "cloudMovement", gameSpeed);
scrollBackground = setInterval(this, "bgActions", gameSpeed);
runCows = setInterval(this, "moveCows", gameSpeed);
};
moveRod = function () {
if (lightningRod._visible == true) {
lightningRod._x = mrCloud._x;
lightningRod._y = mrCloud._y;
var _local2 = mrCloud._x - _xmouse;
var _local1 = mrCloud._y - _ymouse;
var _local3 = Math.sqrt((_local2 * _local2) + (_local1 * _local1));
lightningRod.rod._width = _local3 + 20;
lightningRod._rotation = (Math.atan2(_local1, _local2) * 57.2) + 180;
}
};
settleTreesAndRocks = function () {
trace("setling trees and rocks");
i = 0;
while (i < rocks.length) {
var _local1 = {x:0, y:rocks[i].radius};
rocks[i].localToGlobal(_local1);
while (ground.hitTest(_local1.x, _local1.y, true) == false) {
_local1 = {x:0, y:rocks[i].radius};
rocks[i].localToGlobal(_local1);
rocks[i]._y = rocks[i]._y + 1;
}
i++;
}
i = 0;
while (i < treeArray.length) {
clearInterval(treeArray[i].rotateTree);
var _local1 = {x:0, y:0};
treeArray[i].localToGlobal(_local1);
while (ground.hitTest(_local1.x, _local1.y, true) == false) {
_local1 = {x:0, y:0};
treeArray[i].localToGlobal(_local1);
treeArray[i]._y = treeArray[i]._y + 1;
}
i++;
}
};
startLightning = function () {
lightningRod._x = mrCloud._x;
lightningRod._y = mrCloud._y;
var _local2 = mrCloud._x - _xmouse;
var _local1 = mrCloud._y - _ymouse;
var _local3 = Math.sqrt((_local2 * _local2) + (_local1 * _local1));
lightningRod.rod._width = _local3 + 20;
lightningRod._rotation = (Math.atan2(_local1, _local2) * 57.2) + 180;
lightningRod._visible = true;
trace("lstarted");
mrCloud.outerGlow.gotoAndPlay(2);
};
endLightning = function () {
shots++;
lightningPoint.startx = mrCloud._x;
lightningPoint.starty = mrCloud._y;
lightningPoint.endx = _xmouse;
lightningPoint.endy = _ymouse;
i = 0;
while (i < 10) {
var _local4 = lightningPoint.startx + (((lightningPoint.endx - lightningPoint.startx) / 10) * i);
var _local3 = lightningPoint.starty + (((lightningPoint.endy - lightningPoint.starty) / 10) * i);
rootLevel.createEmptyMovieClip("mc" + i, 2500 + i);
rootLevel["mc" + i]._x = _local4;
rootLevel["mc" + i]._y = _local3;
var _local2 = {x:0, y:0};
rootLevel["mc" + i].localToGlobal(_local2);
if (ground.hitTest(_local2.x, _local2.y, true)) {
lightningPoint.endx = _local4;
lightningPoint.endy = _local3;
break;
}
i++;
}
mrCloud.outerGlow.gotoAndPlay("boom");
lightningRod._visible = false;
var _local9 = false;
attachMovie("bolt", "bolt" + boltCounter, boltCounter + boltDepth);
if (ground.hitTest(_root._xmouse, _root._ymouse + 20, true) == true) {
trace("sef");
attachMovie("smoke", "smoke" + smokeCounter, smokeCounter + 800);
_local9 = true;
}
rootLevel["smoke" + smokeCounter]._x = lightningPoint.endx;
rootLevel["smoke" + smokeCounter]._y = lightningPoint.endy;
rootLevel["bolt" + boltCounter]._x = lightningPoint.startx;
rootLevel["bolt" + boltCounter]._y = lightningPoint.starty;
var _local7 = lightningPoint.startx - lightningPoint.endx;
var _local8 = lightningPoint.starty - lightningPoint.endy;
var _local10 = Math.sqrt((_local7 * _local7) + (_local8 * _local8));
rootLevel["bolt" + boltCounter]._height = _local10 + 20;
rootLevel["bolt" + boltCounter]._rotation = (Math.atan2(lightningPoint.starty - lightningPoint.endy, lightningPoint.startx - lightningPoint.endx) * 57.2) + 90;
if (rootLevel["bolt" + boltCounter] != undefined) {
rootLevel.checkHits = setInterval(rootLevel, "checkAllObjects", 60, rootLevel["bolt" + boltCounter], lightningPoint.endx, lightningPoint.endy, _local7, rootLevel["bolt" + boltCounter], _local9);
}
boltCounter++;
if (boltCounter > 20) {
boltCounter = 0;
}
};
delete mouseListener;
var mouseListener = new Object();
mouseListener.onMouseDown = function () {
if (superMode) {
endLightning();
}
};
Mouse.addListener(mouseListener);
checkAllObjects = function (movie, xh, yh, xangleAmount, bolt, smoke) {
clearInterval(rootLevel.checkHits);
trace("checking shit!");
i = 0;
while (i < cowArray.length) {
var _local2 = {x:0, y:0};
cowArray[i].localToGlobal(_local2);
if ((bolt.hit.hitTest(_local2.x, _local2.y) && (cowArray[i].emotion != 10)) && (cowArray[i].hitByBolt != bolt)) {
cowArray[i].hitByBolt = bolt;
cowArray[i].life = cowArray[i].life - 100;
if (cowArray[i].life <= 0) {
splodeCow(cowArray[i], xangleAmount, smoke);
} else {
kills++;
cowArray[i].gotoAndPlay("hit");
}
trace("hitcow: " + i);
}
if ((((((Math.abs(xh - cowArray[i]._x) < 300) && (Math.abs(yh - cowArray[i]._y) < 300)) && (cowArray[i].scare == false)) && (cowArray[i].emotion != 10)) && (cowArray[i].emotion != 1)) && (cowArray[i].emotion != 9)) {
cowArray[i].scare = true;
cowArray[i].emotion = 1;
}
i++;
}
i = 0;
while (i < treeArray.length) {
j = 0;
while (j < 5) {
var _local2 = {x:0, y:j * -50};
treeArray[i].localToGlobal(_local2);
if (bolt.hit.hitTest(_local2.x, _local2.y, true) && (treeArray[i].burned != true)) {
splodeTree(treeArray[i], xangleAmount);
trace("hitTree: " + i);
break;
}
j++;
}
i++;
}
i = 0;
while (i < rocks.length) {
j = 0;
while (j < 10) {
var _local2 = {x:Math.cos(j) * rocks[i].radius, y:Math.sin(j) * rocks[i].radius};
rocks[i].localToGlobal(_local2);
if (bolt.hit.hitTest(_local2.x, _local2.y, true)) {
splodeRock(rocks[i], xangleAmount);
trace("hitROCK!: " + i);
break;
}
j++;
}
i++;
}
i = 0;
while (i < weaponsArray.length) {
var _local2 = {x:0, y:0};
weaponsArray[i].localToGlobal(_local2);
if (bolt.hit.hitTest(_local2.x, _local2.y, true)) {
score = score + 10;
splodeWeapon(weaponsArray[i]);
trace("weapon: " + i);
}
i++;
}
i = 0;
while (i < missileArray.length) {
var _local2 = {x:0, y:0};
missileArray[i].localToGlobal(_local2);
if (bolt.hit.hitTest(_local2.x, _local2.y, true)) {
score = score + 10;
splodeWeapon(missileArray[i]);
trace("Destroyed Missile: " + i);
}
i++;
}
trace("didHitTest");
};
delayEnd = function () {
clearInterval(weInterval);
clearInterval(rootLevel.tornadoInterval);
clearAllIntervals();
resetAllDogs();
rocks = new Array();
cowArray = new Array();
treeArray = new Array();
weaponsArray = new Array();
var _local2 = Math.ceil((kills / shots) * 100);
_parent.dropBox.dropBox(wave, kills, _local2, maxCombo);
shots = 0;
kills = 0;
maxCombo = 0;
};
moveCows = function () {
var _local1 = true;
i = 0;
while (i < cowArray.length) {
aiCowMove(cowArray[i]);
if (cowArray[i].emotion != 10) {
_local1 = false;
}
i++;
}
if (_local1 == true) {
clearInterval(runCows);
weInterval = setInterval(rootLevel, "delayEnd", 2000);
}
};
var maxCowSpeed = 5;
var cowAccel = 0.9;
aiCowMove = function (cow) {
trace("moving Cow");
trace(cow.emotion);
switch (cow.emotion) {
case 0 :
if ((Math.random() > 0.995) && (cow.cowType == 1)) {
launchMethane(cow);
}
if ((Math.random() > 0.985) && (cow.cowType == 2)) {
launchMethane(cow);
}
if ((Math.random() > 0.985) && (cow.cowType == 3)) {
launchMethane(cow);
}
if (((Math.random() > 0.998) && (Math.random() > (2.5 - (wave / 8)))) && (cow.cowType == 3)) {
launchMissile(cow);
}
cow.body.stop();
var _local2 = {x:0, y:10};
cow.localToGlobal(_local2);
while (ground.hitTest(_local2.x, _local2.y, true) == true) {
_local2 = {x:0, y:10};
cow.localToGlobal(_local2);
cow._y = cow._y - 1;
cow.yspeed = 0;
}
break;
case 1 :
if (Math.abs(cow.xspeed) > 1) {
var _local7 = cow.body._currentframe + Math.abs(Math.ceil(cow.xspeed / 2));
cow.body.gotoAndStop(_local7 % 30);
} else {
cow.body.gotoAndStop(0);
}
if (cow.scare) {
if ((Math.random() > (1 - (wave / 8))) && (cow.cowType == 2)) {
launchMissile(cow);
} else if (cow.cowType == 3) {
launchMissile(cow);
}
if (Math.random() > 0.5) {
cow.xspeed = (Math.random() * 10) + 5;
} else {
cow.xspeed = ((-Math.random()) * 10) - 5;
}
cow.scare = false;
cow.yspeed = -20;
}
_local2 = {x:0, y:10};
cow.localToGlobal(_local2);
cow.yspeed = cow.yspeed + 1;
cow._y = cow._y + cow.yspeed;
cow.groundHit = false;
while (ground.hitTest(_local2.x, _local2.y, true) == true) {
_local2 = {x:0, y:10};
cow.localToGlobal(_local2);
cow._y = cow._y - 1;
cow.groundHit = true;
cow.yspeed = 0;
if (Math.abs(cow.xspeed) < 1) {
cow.emotion = 0;
}
}
if ((Math.random() > 0.99) && (cow.groundHit)) {
cow.yspeed = -20;
}
if (cow.xspeed > 0) {
cow._xscale = 100;
} else {
cow._xscale = -100;
}
if (Math.abs(cow._x - mrCloud._x) < 400) {
if (cow._x > mrCloud._x) {
cow.xspeed = cow.xspeed + cowAccel;
} else {
cow.xspeed = cow.xspeed - cowAccel;
}
if (Math.abs(cow.xspeed) > cow.maxCowSpeed) {
cow.xspeed = cow.xspeed * 0.95;
}
} else {
cow.xspeed = cow.xspeed * 0.95;
}
if ((cow._x < leftSide._x) || (cow._x > rightSide._x)) {
cow.xspeed = cow.xspeed * -3;
}
cow.oldposy = cow.newposy;
cow.oldposx = cow.newposx;
cow.newposx = cow._x;
cow.newposy = cow._y;
if (cow.xspeed >= 0) {
cow._rotation = ((-Math.atan2(cow.oldposy - cow.newposy, cow.newposx - cow.oldposx)) * 20) * Math.abs(cow.xspeed * 0.2);
cow.tail._rotation = Math.atan2(cow.oldposy - cow.newposy, cow.oldposx - cow.newposx) * 57.2;
} else {
cow._rotation = (Math.atan2(cow.oldposy - cow.newposy, cow.oldposx - cow.newposx) * 20) * Math.abs(cow.xspeed * 0.2);
cow.tail._rotation = (-Math.atan2(cow.newposy - cow.oldposy, cow.newposx - cow.oldposx)) * 57.2;
}
cow._x = cow._x + cow.xspeed;
break;
case 9 :
if (Math.random() > ((cow.life / (wave * 100)) + 0.3)) {
attachMovie("tractorSmoke", "tractorSmoke" + tsmokeCounter, tsmokeDepth + tsmokeCounter);
cow.flasher.gotoAndPlay(2);
rootLevel["tractorSmoke" + tsmokeCounter]._x = cow._x + (Math.random() * 20);
rootLevel["tractorSmoke" + tsmokeCounter]._y = cow._y + (Math.random() * 20);
var _local6 = (Math.random() * 50) + 50;
rootLevel["tractorSmoke" + tsmokeCounter]._xscale = _local6;
rootLevel["tractorSmoke" + tsmokeCounter]._yscale = _local6;
}
tsmokeCounter++;
if (tsmokeCounter > 50) {
tsmokeCounter = 0;
}
if (Math.random() > (1 - ((wave / 5) / 150))) {
launchMissile(cow);
}
if (Math.random() > 0.965) {
launchMethane(cow);
}
trace("tractor");
if (cow.xspeed > 0) {
cow._xscale = 100;
} else {
cow._xscale = -100;
}
cow.backTire.tire._rotation = cow._x;
cow.frontTire.tire._rotation = cow._x;
_local2 = {x:0, y:20};
cow.backTire.localToGlobal(_local2);
cow.yspeed = cow.yspeed + 1;
cow.groundHit = false;
while (ground.hitTest(_local2.x, _local2.y, true) == true) {
_local2 = {x:0, y:20};
cow.backTire.localToGlobal(_local2);
cow._y = cow._y - 1;
cow.groundHit = true;
cow.yspeed = 0;
}
var _local3 = {x:0, y:20};
cow.frontTire.localToGlobal(_local3);
if (cow.xspeed > 0) {
cow._rotation++;
while (ground.hitTest(_local3.x, _local3.y, true) == true) {
_local3 = {x:0, y:20};
cow.frontTire.localToGlobal(_local3);
cow._rotation--;
}
} else {
cow._rotation--;
while (ground.hitTest(_local3.x, _local3.y, true) == true) {
_local3 = {x:0, y:20};
cow.frontTire.localToGlobal(_local3);
cow._rotation++;
}
}
cow._y = cow._y + cow.yspeed;
if ((cow._x < leftSide._x) || (cow._x > rightSide._x)) {
cow.xspeed = cow.xspeed * -3;
}
if (Math.abs(cow.xspeed) > wave) {
cow.xspeed = cow.xspeed * 0.9;
}
cow._x = cow._x + cow.xspeed;
break;
case 10 :
cow.gotoAndStop(2);
cow._rotation = 0;
}
};
destroyCurrentWeap = function () {
clearInterval(weaponsArray[weaponsCounter].flyObject);
removeMovieClip(weaponsArray[weaponsCounter]);
};
destroyMissile = function () {
clearInterval(missileArray[missileCounter].flyObject);
removeMovieClip(missileArray[missileCounter]);
};
destroyPowerUp = function () {
clearInterval(powerUpArray[powerUpCounter].flyObject);
removeMovieClip(powerUpArray[powerUpCounter]);
};
splodeWeapon = function (weapon) {
weapon.gotoAndStop(2);
clearInterval(weapon.flyObject);
};
launchMissile = function (cow) {
destroyMissile();
cow.gotoAndPlay("fartMissile");
if (cow.cowType == 2) {
attachMovie("cowMissile", "cowMissile" + missileCounter, missileCounter + missileDepth);
} else {
attachMovie("cowSuperMissile", "cowMissile" + missileCounter, missileCounter + missileDepth);
}
missileArray[missileCounter] = rootLevel["cowMissile" + missileCounter];
missileArray[missileCounter]._x = cow._x;
missileArray[missileCounter]._y = cow._y;
if (cow.cowType < 3) {
missileArray[missileCounter].speedAdjustment = cow.cowType;
} else {
missileArray[missileCounter].speedAdjustment = 3 + ((wave / 5) / 4);
}
missileArray[missileCounter].xspeed = 0;
missileArray[missileCounter].yspeed = 0;
missileArray[missileCounter].exploded = false;
missileArray[missileCounter]._rotation = cow._rotation;
if (missileArray[missileCounter] != undefined) {
missileArray[missileCounter].flyObject = setInterval(rootLevel, "moveMissile", gameSpeed, missileArray[missileCounter]);
}
missileCounter++;
if (missileCounter > 25) {
missileCounter = 0;
}
};
moveMissile = function (missile) {
trace("moving missile");
var _local3 = Math.atan2(mrCloud._y - missile._y, mrCloud._x - missile._x) * 57.2;
var _local2 = missile._rotation - _local3;
if ((_local2 > 0) && (Math.abs(_local2) < 180)) {
missile._rotation = missile._rotation - 5;
} else if (Math.abs(_local2) < 180) {
missile._rotation = missile._rotation + 5;
}
if ((_local2 > 0) && (Math.abs(_local2) > 180)) {
missile._rotation = missile._rotation + 5;
} else if (Math.abs(_local2) > 180) {
missile._rotation = missile._rotation - 5;
}
missile.yspeed = Math.sin(degToRad(missile._rotation)) * (4 + (missile.speedAdjustment * 3));
missile.xspeed = Math.cos(degToRad(missile._rotation)) * (4 + (missile.speedAdjustment * 3));
missile._x = missile._x + missile.xspeed;
missile._y = missile._y + missile.yspeed;
if (Math.abs(missile.xspeed) > 3) {
missile.xspeed = missile.xspeed * 0.8;
}
if (Math.abs(missile.yspeed) > 3) {
missile.yspeed = missile.yspeed * 0.8;
}
if (distanceToCloud(missile)) {
if (checkWeaponHit(missile)) {
if (speedAdjustment == 2) {
life = life - 10;
} else {
life = life - 20;
}
missile.gotoAndStop(2);
clearInterval(missile.flyObject);
}
}
};
launchMethane = function (cow) {
destroyCurrentWeap();
cow.gotoAndPlay("fartMethane");
attachMovie("methane", "methane" + weaponsCounter, weaponsCounter + weaponsDepth);
weaponsArray[weaponsCounter] = rootLevel["methane" + weaponsCounter];
weaponsArray[weaponsCounter]._x = cow._x;
weaponsArray[weaponsCounter]._y = cow._y;
var _local2 = (Math.random() * 80) + 40;
weaponsArray[weaponsCounter].rotMan = Math.random() * 3;
if (Math.random() > 0.5) {
weaponsArray[weaponsCounter].neg = -1;
} else {
weaponsArray[weaponsCounter].neg = 1;
}
weaponsArray[weaponsCounter].xspeed = 0;
weaponsArray[weaponsCounter]._xscale = _local2;
weaponsArray[weaponsCounter]._yscale = _local2;
weaponsArray[weaponsCounter].yspeed = -3;
weaponsArray[weaponsCounter].exploded = false;
weaponsArray[weaponsCounter]._rotation = cow._rotation;
if (weaponsArray[weaponsCounter] != undefined) {
weaponsArray[weaponsCounter].flyObject = setInterval(rootLevel, "moveMethane", gameSpeed, weaponsArray[weaponsCounter]);
}
weaponsCounter++;
if (weaponsCounter > 60) {
weaponsCounter = 0;
}
};
moveMethane = function (methane) {
trace("moving Methane");
methane._rotation = methane._rotation + (methane.rotMan * methane.neg);
if (methane._y < -1500) {
methane.gotoAndStop(2);
clearInterval(methane.flyObject);
methane.removeMovieClip();
}
if ((mrCloud._x < methane._x) && (methane.xspeed < 5)) {
methane.xspeed++;
} else if ((mrCloud._x > methane._x) && (methane.xspeed > -5)) {
methane.xspeed--;
}
methane._x = methane._x - methane.xspeed;
methane._y = methane._y + methane.yspeed;
if (distanceToCloud(methane)) {
if (checkWeaponHit(methane)) {
life = life - 5;
methane.gotoAndStop(2);
clearInterval(methane.flyObject);
}
}
};
splodeRock = function (rock, xangleAmount) {
clearInterval(rock.moveRock);
rock.yspeed = -10 - (Math.random() * 20);
if (xangleAmount > 0) {
rock.xspeed = ((-xangleAmount) * 0.05) - (Math.random() * 10);
} else {
rock.xspeed = ((-xangleAmount) * 0.05) + (Math.random() * 10);
}
trace("sploded rock");
trace(xangleAmount);
trace((rock.xspeed + ":") + rock.yspeed);
if (rock != undefined) {
rock.moveRock = setInterval(rootLevel, "crashRock", gameSpeed, rock, xangleAmount);
}
};
crashRock = function (rock, xangleAmount) {
trace("moving Rock");
rock._x = rock._x + rock.xspeed;
rock._y = rock._y + rock.yspeed;
rock.rockr._rotation = rock.rockr._rotation + rock.xspeed;
rock.yspeed = rock.yspeed + 1;
if ((rock._x < leftSide._x) || (rock._x > rightSide._x)) {
rock.xspeed = rock.xspeed * -1;
}
j = 0;
while (j < cowArray.length) {
var _local1 = {x:0, y:0};
cowArray[j].localToGlobal(_local1);
if (((rock.hitTest(_local1.x, _local1.y, true) == true) && (cowArray[j].emotion != 10)) && (cowArray[j].cowType != 4)) {
splodeCow(cowArray[j], (-rock.xspeed) * 20, false);
} else if (((rock.hitTest(_local1.x, _local1.y, true) == true) && (cowArray[j].emotion != 10)) && (cowArray[j].cowType == 4)) {
rock.xspeed = rock.xspeed * -1;
}
j++;
}
var _local3 = {x:0, y:rock.radius};
rock.localToGlobal(_local3);
if (ground.hitTest(_local3.x, _local3.y, true) == true) {
rock.yspeed = (-Math.abs(rock.yspeed)) * 0.5;
rock.xspeed = rock.xspeed * 0.9;
if (Math.abs(rock.xspeed) < 1) {
clearInterval(rock.moveRock);
}
}
trace("doing the rock actions");
raiseRock(rock);
};
raiseRock = function (rock) {
var _local2 = {x:0, y:rock.radius};
rock.localToGlobal(_local2);
trace("raisin the rock");
do {
trace("doin da loopy");
_local2 = {x:0, y:rock.radius};
rock.localToGlobal(_local2);
rock._y = rock._y - 1;
} while (ground.hitTest(_local2.x, _local2.y, true) == true);
};
splodeTree = function (tree, xangleAmount) {
tree.burned = true;
tree.gotoAndStop(2);
if (tree != undefined) {
tree.rotateTree = setInterval(rootLevel, "crashTree", gameSpeed, tree, xangleAmount);
}
};
crashTree = function (tree, xangleAmount) {
trace("crashing Tree");
if (xangleAmount < 0) {
tree.rotationSpeed++;
} else {
tree.rotationSpeed--;
}
var _local1 = {x:0, y:0};
tree.treeTop.localToGlobal(_local1);
if (ground.hitTest(_local1.x, _local1.y, true) == true) {
clearInterval(tree.rotateTree);
}
i = 0;
while (i < cowArray.length) {
_local1 = {x:0, y:0};
cowArray[i].localToGlobal(_local1);
if (((tree.hit.hitTest(_local1.x, _local1.y, true) == true) && (cowArray[i].emotion != 10)) && (cowArray[i].cowType != 4)) {
splodeCow(cowArray[i], rotationSpeed * 150, false);
}
i++;
}
tree._rotation = tree._rotation + tree.rotationSpeed;
};
splodeCow = function (cow, xangleAmount, smoke) {
kills++;
cow.emotion = 10;
cow.gotoAndStop(2);
if (!smoke) {
cow.mark._visible = false;
}
clearInterval(rootLevel.comboInterval);
cowCombo++;
comboInterval = setInterval(rootLevel, "finishCombo", 500);
if (cow.cowType != 4) {
addGorePiece(cow.leg1, xangleAmount, cow);
addGorePiece(cow.head, xangleAmount, cow);
addGorePiece(cow.leg2, xangleAmount, cow);
addGorePiece(cow.leg3, xangleAmount, cow);
addGorePiece(cow.leg4, xangleAmount, cow);
addGorePiece(cow.bs1, xangleAmount, cow);
addGorePiece(cow.bs2, xangleAmount, cow);
addGorePiece(cow.bs3, xangleAmount, cow);
addGorePiece(cow.bs4, xangleAmount, cow);
if (Math.random() > 0.7) {
launchPowerUp(cow);
}
j = 0;
while (j < (10 + (Math.random() * 20))) {
cow.attachMovie("blood", "blood" + j, j);
cow["blood" + j]._x = Math.random() * 10;
cow["blood" + j]._y = Math.random() * 10;
cow["blood" + j]._xscale = 20 + (Math.random() * 100);
cow["blood" + j]._yscale = 20 + (Math.random() * 100);
addGorePiece(cow["blood" + j], xangleAmount, cow);
j++;
}
} else {
addGorePiece(cow.stack1, xangleAmount, cow);
addGorePiece(cow.stack2, xangleAmount, cow);
addGorePiece(cow.gun, xangleAmount, cow);
addGorePiece(cow.window1, xangleAmount, cow);
addGorePiece(cow.window2, xangleAmount, cow);
addGorePiece(cow.ladder, xangleAmount, cow);
addGorePiece(cow.frontTire, xangleAmount, cow);
addGorePiece(cow.backTire, xangleAmount, cow);
addGorePiece(cow.fender1, xangleAmount, cow);
addGorePiece(cow.fender2, xangleAmount, cow);
addGorePiece(cow.insides, xangleAmount, cow);
addGorePiece(cow.wheel, xangleAmount, cow);
}
};
addGorePiece = function (mc, xangleAmount) {
trace("adding gore");
trace(mc + " :MC");
if ((mc != undefined) && (mc._name.length > 2)) {
gorePieces[goreAmount] = mc;
if (goreAmount == 200) {
clearInterval(gorePieces[0].movement);
} else {
clearInterval(gorePieces[goreAmount + 1].movement);
}
gorePieces[goreAmount + 1].removeMovieClip();
gorePieces[goreAmount + 1].unloadMovie();
goreAmount++;
if (goreAmount > 200) {
goreAmount = 0;
}
mc.yspeed = -10 - (Math.random() * 20);
if (xangleAmount > 0) {
mc.xspeed = ((-xangleAmount) * 0.05) - (Math.random() * 10);
} else {
mc.xspeed = ((-xangleAmount) * 0.05) + (Math.random() * 10);
}
mc.movement = setInterval(rootLevel, "gore", gameSpeed, mc);
}
};
gore = function (mc) {
trace(mc + " :MC");
if (!tornadoMode) {
mc.yspeed = mc.yspeed + 1;
mc.xspeed = mc.xspeed * 0.99;
} else {
var _local3 = {x:0, y:0};
mrCloud.localToGlobal(_local3);
var _local2 = {x:0, y:0};
mc.localToGlobal(_local2);
if (_local2.x < _local3.x) {
mc.xspeed = mc.xspeed + 5;
} else if (_local2.x > _local3.x) {
mc.xspeed = mc.xspeed - 5;
}
if (_local2.y < _local3.y) {
mc.yspeed = mc.yspeed + 1;
} else if (_local2.y > _local3.y) {
mc.yspeed = mc.yspeed - 0.2;
}
}
mc._rotation = mc._rotation - mc.xspeed;
mc._y = mc._y + mc.yspeed;
mc._x = mc._x + mc.xspeed;
if (mc == undefined) {
trace("undefinedmc");
clearInterval(mc.movement);
}
if (mc._y > 1000) {
trace("killed on y");
clearInterval(mc.movement);
}
var _local4 = {x:0, y:0};
mc.localToGlobal(_local4);
if (ground.hitTest(_local4.x, _local4.y, true) == true) {
trace("cleared interval");
clearInterval(mc.movement);
}
};
launchPowerUp = function (cow) {
destroyPowerUp();
if (Math.random() > 0.85) {
attachMovie("tn", "hp" + powerUpCounter, powerUpCounter + powerUpDepth);
powerUpArray[powerUpCounter] = rootLevel["hp" + powerUpCounter];
powerUpArray[powerUpCounter].puType = 4;
} else if (Math.random() > 0.3) {
attachMovie("hp", "hp" + powerUpCounter, powerUpCounter + powerUpDepth);
powerUpArray[powerUpCounter] = rootLevel["hp" + powerUpCounter];
powerUpArray[powerUpCounter].puType = 1;
} else {
attachMovie("bhp", "hp" + powerUpCounter, powerUpCounter + powerUpDepth);
powerUpArray[powerUpCounter] = rootLevel["hp" + powerUpCounter];
powerUpArray[powerUpCounter].puType = 3;
}
powerUpArray[powerUpCounter].xspeed = (Math.random() * 5) - 2.5;
powerUpArray[powerUpCounter].yspeed = -5 - (Math.random() * 2);
powerUpArray[powerUpCounter]._x = cow._x;
powerUpArray[powerUpCounter]._y = cow._y;
powerUpArray[powerUpCounter].flyObject = setInterval(rootLevel, "movePowerUp", gameSpeed, powerUpArray[powerUpCounter]);
powerUpCounter++;
if (powerUpCounter > 8) {
powerUpCounter = 0;
}
};
movePowerUp = function (powerUp) {
trace("moving Powerup");
powerUp._x = powerUp._x - powerUp.xspeed;
powerUp._y = powerUp._y + powerUp.yspeed;
if (powerUp._y < -2200) {
powerUp.gotoAndStop(2);
clearInterval(powerUp.flyObject);
powerUp.removeMovieClip();
}
if (distanceToCloud(powerUp)) {
if (checkWeaponHit(powerUp)) {
if (powerUp.puType == 1) {
if (life < 100) {
life = life + 5;
}
} else if (powerUp.puType == 2) {
resetModes();
clearInterval(smcd);
_parent.locoMode.gotoAndPlay(2);
smt = 350;
superMode = true;
mrCloud.gotoAndStop("angryCloud");
smcd = setInterval(rootLevel, "superModeDecline", 24);
} else if (powerUp.puType == 3) {
if (life < 100) {
life = life + 10;
}
} else if (powerUp.puType == 4) {
resetModes();
tornado();
}
powerUp.gotoAndStop(2);
clearInterval(powerUp.flyObject);
powerUp.removeMovieClip();
}
}
};
finishCombo = function () {
clearInterval(comboInterval);
score = score + ((cowCombo * cowCombo) * 250);
if (cowCombo > 1) {
if (cowCombo > maxCombo) {
maxCombo = cowCombo;
}
_parent.comboCounter.combo = cowCombo;
_parent.comboCounter.gotoAndPlay(2);
}
_parent.score = score;
cowCombo = 0;
};
superModeDecline = function () {
trace("declinin supermode");
smt--;
if (smt <= 0) {
resetModes();
}
};
tornado = function () {
_parent.tornadoMode.gotoAndPlay(2);
tornadoMode = true;
tornadoTime = 200;
mrCloud.gotoAndStop("tornado");
tornadoInterval = setInterval(rootLevel, "bustTornado", 24);
};
hyperLoco = function () {
_parent.hyperMode.gotoAndPlay(2);
hyperMode = true;
tornadoTime = 500;
mrCloud.gotoAndStop("tornado");
tornadoInterval = setInterval(rootLevel, "bustTornado", 24);
};
bustTornado = function () {
var _local1 = {x:0, y:0};
mrCloud.tornado.tip.localToGlobal(_local1);
tornadoTime--;
if (tornadoTime < 0) {
resetModes();
}
while (ground.hitTest(_local1.x, _local1.y, true)) {
_local1 = {x:0, y:0};
mrCloud.tornado.tip.localToGlobal(_local1);
mrCloud.tornado._yscale = mrCloud.tornado._yscale - 2;
mrCloud.tornado._xscale = mrCloud.tornado._xscale - 2;
}
while ((ground.hitTest(_local1.x, _local1.y, true) == false) && (mrCloud.tornado._yscale < 200)) {
_local1 = {x:0, y:0};
mrCloud.tornado.tip.localToGlobal(_local1);
mrCloud.tornado._yscale = mrCloud.tornado._yscale + 2;
mrCloud.tornado._xscale = mrCloud.tornado._xscale + 2;
}
checkAllObjects(mrCloud.tornado.hit, 0, 0, 0, mrCloud.tornado, false);
};
resetModes = function () {
superMode = false;
tornadoMode = false;
mrCloud.gotoAndStop("happyCloud");
mrCloud.lightningButton.onPress = startLightning;
mrCloud.lightningButton.onRelease = endLightning;
mrCloud.lightningButton.onReleaseOutside = endLightning;
clearInterval(smcd);
clearInterval(tornadoInterval);
};
mrCloud.lightningButton.onPress = startLightning;
mrCloud.lightningButton.onRelease = endLightning;
mrCloud.lightningButton.onReleaseOutside = endLightning;
cloudMovement = function () {
if (Key.isDown(37) || (Key.isDown(65))) {
mrCloud.xspeed = mrCloud.xspeed + xchange;
} else if (Key.isDown(39) || (Key.isDown(68))) {
mrCloud.xspeed = mrCloud.xspeed - xchange;
}
if (Key.isDown(38) || (Key.isDown(87))) {
mrCloud.yspeed = mrCloud.yspeed + xchange;
} else if (Key.isDown(40) || (Key.isDown(83))) {
var _local2 = {x:0, y:0};
mc.localToGlobal(_local2);
if ((ground.hitTest(_local2.x, _local2.y, true) == true) && (mc.yspeed > 0)) {
clearInterval(mc.movement);
}
mrCloud.yspeed = mrCloud.yspeed - xchange;
}
mrCloud._x = mrCloud._x - mrCloud.xspeed;
mrCloud._y = mrCloud._y - (mrCloud.yspeed - Math.sin(hover));
var _local2 = {x:0, y:0};
mrCloud.localToGlobal(_local2);
while (ground.hitTest(_local2.x, _local2.y, true) == true) {
_local2 = {x:0, y:0};
mrCloud.localToGlobal(_local2);
mrCloud._y = mrCloud._y - 1;
mrCloud.yspeed = 0;
}
hover = hover + 0.1;
if (hover > 10) {
hover = 0;
}
mrCloud.xspeed = mrCloud.xspeed * 0.9;
mrCloud.yspeed = mrCloud.yspeed * 0.9;
if (mrCloud.xspeed < 0) {
mrCloud._xscale = 50 + (life * 0.5);
} else {
mrCloud._xscale = -50 - (life * 0.5);
}
mrCloud._yscale = 50 + (life * 0.5);
if ((mrCloud._x < leftSide._x) || (mrCloud._x > rightSide._x)) {
mrCloud.xspeed = mrCloud.xspeed * -3;
}
if (life <= 0) {
clearAllIntervals();
resetAllDogs();
rocks = new Array();
cowArray = new Array();
treeArray = new Array();
weaponsArray = new Array();
_parent.dropBox.gameOver(wave, score);
}
_parent.lifeBar._xscale = life;
};
initStageBG2 = stageBG2._x;
initStageBG2 = stageBG2._y;
initStageBG3 = stageBG3._x;
initStageBG3 = stageBG3._y;
var sh = 500;
var sw = 780;
initsw = 780;
initsh = 500;
newcx = (Stage.width - initsw) / 2;
bgActions = function () {
stageBG2._y = initStageBG2 + (mrCloud._y / 10);
stageBG2._x = initStageBG2 + (mrCloud._x / 10);
stageBG3._y = initStageBG3 - (mrCloud._y / 5);
stageBG3._x = initStageBG3 - (mrCloud._x / 5);
this._x = this._x - ((_x - ((-mrCloud._x) + (sw / 2))) / 10);
if (mrCloud._y < minHeight) {
this._y = this._y - ((_y - (((-mrCloud._y) - 100) + (sh / 2))) / 10);
}
};
startGame();
Symbol 440 Button
on (release) {
removeBox();
}
Symbol 458 MovieClip Frame 1
stop();
Symbol 467 Button
on (release) {
removeBoxGameOver();
}
Symbol 472 MovieClip Frame 20
stop();
Symbol 473 Button
on (release) {
gotoAndStop (5);
}
Symbol 476 Button
on (release, keyPress "<Enter>") {
submittedScore = true;
trace(nameText.text);
var my_lv = new LoadVars();
if ((nameText.text != undefined) && (nameText.text != "")) {
my_lv.name = nameText.text;
} else {
my_lv.name = "NO NOMBRE";
}
if ((nameText.text != undefined) && (commentText.text != "")) {
my_lv.comment = commentText.text;
} else {
my_lv.comment = "NO COMMENT";
}
my_lv.score = score;
my_lv.wave = wave;
my_lv.send("http://www.hannadbs.com/derecho/insertHighScore.cfm", "_blank", "POST");
removeBoxGameOver();
}
Symbol 481 MovieClip Frame 1
inity = -250;
_y = inity;
_x = (Stage.width / 2);
_visible = false;
var newLevel = -1;
var score;
var wave;
var submittedScore = false;
var accuracyP;
var maxComboP;
gotoAndStop (3);
clearAllIntervals = function () {
clearInterval(animate);
};
dropBox = function (waveNumber, kills, accuracy, maxCombo) {
gotoAndStop (2);
accuracyP = accuracy;
maxComboP = maxCombo;
newLevel = Math.ceil((Math.random() * 6.9999) + 0.0001);
levelPreview.gotoAndStop(newLevel);
if (((waveNumber + 1) % 5) != 0) {
_parent.game.score = _parent.game.score + (accuracyP * 10);
_parent.game.score = _parent.game.score + (maxComboP * 100);
levelBonus.text = (accuracyP * 10) + (maxComboP * 100);
_parent.score = _parent.game.score;
levelPreview.tractor._visible = false;
} else {
_parent.game.score = _parent.game.score + (waveNumber * 1000);
levelBonus.text = waveNumber * 1000;
_parent.score = _parent.game.score;
levelPreview.tractor._visible = true;
}
stageText.text = "wave: " + (waveNumber + 1);
_visible = true;
clearAllIntervals();
waveText.text = ("WAVE " + waveNumber) + " COMPLETE!";
killsText.text = kills;
accuracyText.text = accuracy + "%";
maxComboText.text = maxCombo;
animate = setInterval(this, "animateIn", 24);
};
gameOver = function (waveNumber, scoreNumber) {
submittedScore = false;
gotoAndStop (4);
endText.text = "he was methowned on wave " + waveNumber;
scoreText.text = scoreNumber;
_visible = true;
clearAllIntervals();
waveText.text = ("WAVE " + waveNumber) + " COMPLETE!";
killsText.text = kills;
accuracyText.text = accuracy;
maxComboText.text = maxCombo;
wave = waveNumber;
score = scoreNumber;
animate = setInterval(this, "animateIn", 24);
};
removeBox = function () {
clearAllIntervals();
_parent.game.wave++;
_parent.game.nextWave(newLevel);
animate = setInterval(this, "animateOut", 24);
};
removeBoxGameOver = function () {
clearAllIntervals();
_parent.gotoAndStop("menu");
};
animateIn = function () {
_parent.game._alpha = _parent.game._alpha - 10;
_y = (_y - ((_y - (Stage.height / 2)) / 10));
if (Math.abs(_y - (Stage.height / 2)) < 1) {
_parent.game._alpha = 0;
clearAllIntervals();
}
};
animateOut = function () {
_parent.game._alpha = _parent.game._alpha + 10;
_y = (_y - ((_y - (Stage.height + 250)) / 10));
if (Math.abs(_y - (Stage.height + 250)) < 1) {
_parent.game._alpha = 100;
gotoAndStop (3);
_visible = false;
clearAllIntervals();
_y = inity;
}
};
Symbol 481 MovieClip Frame 4
if (submittedScore) {
submit._visible = false;
}
Symbol 493 MovieClip Frame 1
stop();
_x = (Stage.width / 2);
Symbol 493 MovieClip Frame 2
combo = combo + "x";
Symbol 496 MovieClip Frame 1
if (firstP != true) {
firstP = true;
wave = 1;
}
_x = (Stage.width / 2);
waveText = "wave " + wave;
Symbol 496 MovieClip Frame 31
stop();
Symbol 501 MovieClip Frame 1
stop();
_x = (Stage.width / 2);
Symbol 510 MovieClip Frame 1
stop();
_x = (Stage.width / 2);