Frame 1
function timeIncrease(amount) {
time = time + amount;
updateTimer();
}
function updateTimer() {
timer = math.floor(time);
}
function itemSpawner(target, ostrich) {
var _local1 = this;
var _local2 = _root;
var _local3 = "clock" + iI;
_local2.attachMovie("clockItem", _local3, 340 + iI);
iI++;
if (iI > 15) {
iI = 0;
}
addScrollObj(_local3);
_local2[_local3]._x = _local2[target]._x;
_local2[_local3]._y = _local2[target]._y;
_local2[_local3].name = _local3;
_local2[_local3].rate = 5;
_local2[_local3].xrate = random(11) - 5;
_local2[_local3].ostrich = ostrich;
_local2[_local3].onEnterFrame = function () {
var _local1 = this;
_local1._y = _local1._y - _local1.rate;
_local1._x = _local1._x + _local1.xrate;
_local1.rate = _local1.rate - 0.40875;
if (_local1._y > 360) {
_local1.onEnterFrame = function () {
var _local1 = this;
if (_local1.hitTest(archer.body)) {
removeScrollObj(_local1.name);
Player[_local1.type] = Player[_local1.type] + _local1.amount;
timeIncrease(3);
_local1.removeMovieClip();
}
if ((_local1._x < -540) || (_local1._x > 1080)) {
removeScrollObj(_local1.name);
_local1.removeMovieClip();
}
};
}
};
if (random(12) == 0) {
if (random(2) == 0) {
_local3 = "speed" + iI;
_local2.attachMovie("speedItem", _local3, 340 + iI);
iI++;
if (iI > 15) {
iI = 0;
}
addScrollObj(_local3);
_local2[_local3]._x = _local2[target]._x;
_local2[_local3]._y = _local2[target]._y;
_local2[_local3].name = _local3;
_local2[_local3].rate = 5;
_local2[_local3].xrate = random(11) - 5;
_local2[_local3].ostrich = ostrich;
_local2[_local3].onEnterFrame = function () {
var _local1 = this;
_local1._y = _local1._y - _local1.rate;
_local1._x = _local1._x + _local1.xrate;
_local1.rate = _local1.rate - 0.40875;
if (_local1._y > 360) {
_local1.onEnterFrame = function () {
var _local1 = this;
if (_local1.hitTest(archer.body)) {
removeScrollObj(_local1.name);
Player[_local1.type] = Player[_local1.type] + _local1.amount;
speedBoost = speedBoost + 280;
_local1.removeMovieClip();
}
if ((_local1._x < -540) || (_local1._x > 1080)) {
removeScrollObj(_local1.name);
_local1.removeMovieClip();
}
};
}
};
} else {
_local3 = "clock" + iI;
_local2.attachMovie("powerItem", _local3, 340 + iI);
iI++;
if (iI > 15) {
iI = 0;
}
addScrollObj(_local3);
_local2[_local3]._x = _local2[target]._x;
_local2[_local3]._y = _local2[target]._y;
_local2[_local3].name = _local3;
_local2[_local3].rate = 5;
_local2[_local3].xrate = random(11) - 5;
_local2[_local3].ostrich = ostrich;
_local2[_local3].onEnterFrame = function () {
var _local1 = this;
_local1._y = _local1._y - _local1.rate;
_local1._x = _local1._x + _local1.xrate;
_local1.rate = _local1.rate - 0.40875;
if (_local1._y > 360) {
_local1.onEnterFrame = function () {
var _local1 = this;
if (_local1.hitTest(archer.body)) {
removeScrollObj(_local1.name);
Player[_local1.type] = Player[_local1.type] + _local1.amount;
powerBoost = powerBoost + 280;
_local1.removeMovieClip();
}
if ((_local1._x < -540) || (_local1._x > 1080)) {
removeScrollObj(_local1.name);
_local1.removeMovieClip();
}
};
}
};
}
}
}
function footStepLeft() {
meow = new Sound();
meow.attachSound(currentStage + "FootStepLeft");
meow.onSoundComplete = function () {
delete this;
};
meow.start();
}
function footStepRight() {
meow = new Sound();
meow.attachSound(currentStage + "FootStepRight");
meow.onSoundComplete = function () {
delete this;
};
meow.start();
}
function initEngine(stage) {
AnimalSpawner = setInterval(animalSpawnerFunction, 500);
Key.addListener(keyListener);
map = _root[stage + "Map"];
walkDirection = "right";
angle = 0;
walkCycle = 9;
currentChunk = 1;
shotMagnitude = 0;
pauseEngine = false;
aC = 1;
aI = 1;
iI = 0;
arrowsArray = new Array();
animalsArray = new Array();
charging = false;
reloading = false;
engineLoaded = true;
setupMap(stage);
updateMap();
updatePlayerInfo();
updateDisplays();
_root.onEnterFrame = huntEngineEnterFrame;
time = 120;
speedBoost = 0;
powerBoost = 0;
walkRate = 5;
pullbackRate = 3;
angleRate = 2;
totalTime = 0;
}
function destroyEngine() {
clearInterval(AnimalSpawner);
Key.removeListener(keyListener);
delete map;
delete walkDirection;
delete angle;
delete walkCycle;
delete currentChunk;
delete shotMagnitude;
delete pauseEngine;
delete aI;
delete iI;
delete charging;
delete reloading;
delete _root.onEnterFrame;
delete arrowsArray;
delete aC;
}
function setupMap(stage) {
var _local1 = stage;
background.gotoAndStop(_local1);
backgroundFar.gotoAndStop(_local1);
backgroundBehind.gotoAndStop(_local1);
backgroundFront.gotoAndStop(_local1);
}
function calcFPS() {
var _local1 = getTimer();
recentNumFrames++;
if (recentNumFrames == recentSetting) {
var _local2 = (_local1 - recentStartTime) / 1000;
recentFPSoutput = Math.round(recentNumFrames / _local2);
recentStartTime = _local1;
recentNumFrames = 0;
}
}
function setArcherFrame(frameToSet) {
archer.body.gotoAndStop(frameToSet);
archer.shadow.gotoAndStop(frameToSet);
}
function setBowFrame(frameToSet) {
archer.body.bow.gotoAndStop(frameToSet);
archer.shadow.bow.gotoAndStop(frameToSet);
}
function setBowAngle(angleToSet) {
var _local1 = angleToSet;
archer.body.head._rotation = 90 + (_local1 / 2);
archer.body.head.gotoAndStop(walkDirection);
archer.shadow.head._rotation = 90 + (_local1 / 2);
archer.shadow.head.gotoAndStop(walkDirection);
archer.body.head._x = headInfo.xArray[archer.body._currentframe];
archer.body.head._y = headInfo.yArray[archer.body._currentframe];
archer.shadow.head._x = headInfo.xArray[archer.body._currentframe];
archer.shadow.head._y = headInfo.yArray[archer.body._currentframe];
archer.body.bow._rotation = _local1;
archer.shadow.bow._rotation = _local1;
if (walkDirection == "right") {
if (!reloading) {
archer.body.bow.gotoAndStop("rightArrow");
archer.shadow.bow.gotoAndStop("rightArrow");
}
} else if (!reloading) {
archer.body.bow.gotoAndStop("leftArrow");
archer.shadow.bow.gotoAndStop("leftArrow");
}
archer.body.bow._x = BowInfo.xArray[archer.body._currentframe];
archer.body.bow._y = BowInfo.yArray[archer.body._currentframe];
archer.shadow.bow._x = BowInfo.xArray[archer.body._currentframe];
archer.shadow.bow._y = BowInfo.yArray[archer.body._currentframe];
if (Player.arrowsLeft == 0) {
archer.body.bow.gotoAndStop(walkDirection + "NoArrow");
archer.shadow.bow.gotoAndStop(walkDirection + "NoArrow");
}
}
function updateBow() {
if (walkDirection == "right") {
setBowAngle(180 - angle);
} else {
setBowAngle(180 + angle);
}
}
function updateMap() {
background.chunkLeft.gotoAndStop(map[currentChunk - 1]);
background.chunkCenter.gotoAndStop(map[currentChunk]);
background.chunkRight.gotoAndStop(map[currentChunk + 1]);
questChunkChecker();
}
function moveBackground(amountToMove) {
background._x = background._x + amountToMove;
}
function moveForeground(amountToMove) {
backgroundFront._x = backgroundFront._x + amountToMove;
if (backgroundFront._x < -540) {
backgroundFront._x = backgroundFront._x + 540;
} else if (backgroundFront._x > 540) {
backgroundFront._x = backgroundFront._x + -540;
}
}
function moveBackdrop(amountToMove) {
}
function moveFarground(amountToMove) {
backgroundFar._x = backgroundFar._x + amountToMove;
if (backgroundFar._x < -540) {
backgroundFar._x = backgroundFar._x + 540;
} else if (backgroundFar._x > 540) {
backgroundFar._x = backgroundFar._x + -540;
}
}
function reloadAnim() {
angle = angle * 0.7;
setBowAngle(angle);
archer.body.bow.gotoAndStop(walkDirection + "NoArrow");
archer.shadow.bow.gotoAndStop(walkDirection + "NoArrow");
if ((archer.body.bow._rotation < 3) && (archer.body.bow._rotation > -3)) {
clearInterval(reloadInterval);
archer.body.bow.gotoAndPlay(walkDirection + "reload");
archer.shadow.bow.gotoAndPlay(walkDirection + "reload");
angle = 0;
setBowAngle(angle);
}
}
function updatePower() {
PBC.powerBar.gotoAndStop(shotMagnitude);
archer.body.bow.gotoAndStop(walkDirection + shotMagnitude);
archer.shadow.bow.gotoAndStop(walkDirection + shotMagnitude);
if (shotMagnitude == 0) {
PBC.powerBar.gotoAndStop(1);
}
if (shotMagnitude == 25) {
archer.body.bow.gotoAndStop(walkDirection + 24);
archer.shadow.bow.gotoAndStop(walkDirection + 24);
}
}
function addArrow(name) {
arrowsArray.push(name);
}
function removeArrow(name) {
var _local1 = name;
i = 0;
while (i < arrowsArray.length) {
if (arrowsArray[i] == _local1) {
arrowsArray.splice(i, 1);
return;
}
i++;
}
}
function addAnimal(name) {
animalsArray.push(name);
}
function removeAnimal(name) {
var _local1 = name;
i = 0;
while (i < animalsArray.length) {
if (animalsArray[i] == _local1) {
animalsArray.splice(i, 1);
return;
}
i++;
}
}
function removeScrollObj(name) {
var _local1 = name;
i = 0;
while (i < scrollObjects.length) {
if (scrollObjects[i] == _local1) {
scrollObjects.splice(i, 1);
return;
}
i++;
}
}
function addScrollObj(name) {
scrollObjects.push(name);
}
function fire() {
var _local1 = _root;
var _local2 = this;
reloading = true;
reloadInterval = setInterval(reloadAnim, 41);
archer.body.bow.gotoAndStop(walkDirection + "NoArrow");
archer.shadow.bow.gotoAndStop(walkDirection + "NoArrow");
archer.body.bow.reloadStep = 0;
var arrowName = ("arrow" + aI);
addScrollObj(arrowName);
addArrow(arrowName);
_local1.attachMovie("arrow", arrowName, 10 + aI);
_local1[arrowName]._x = archer._x + (archer.body.bow._x * 0.54);
if (walkDirection == "right") {
_local1[arrowName]._x = _local1[arrowName]._x + 20;
}
_local1[arrowName]._y = archer._y + (archer.body.bow._y * 0.57);
_local1[arrowName].name = arrowName;
if (powerBoost > 0) {
_local1[arrowName].Vx = (Math.cos(angle * (Math.PI/180)) * shotMagnitude) * 2;
} else {
_local1[arrowName].Vx = Math.cos(angle * (Math.PI/180)) * shotMagnitude;
}
if (walkDirection == "right") {
_local1[arrowName].Vx = _local1[arrowName].Vx * -1;
}
if (powerBoost > 0) {
_local1[arrowName].Vy = (Math.sin(angle * (Math.PI/180)) * shotMagnitude) * 2;
} else {
_local1[arrowName].Vy = Math.sin(angle * (Math.PI/180)) * shotMagnitude;
}
aI++;
if (aI > 10) {
aI = 0;
}
_local1[arrowName].onEnterFrame = function () {
var _local1 = _root;
var _local2 = this;
_local2._x = _local2._x - Number(_local2.Vx);
_local2._y = _local2._y - Number(_local2.Vy);
_local2.Vy = _local2.Vy - 0.40875;
_local2.angle = Math.atan2(_local2.Vy, _local2.Vx) * 57.2957795130823;
_local2._rotation = _local2.angle;
i = 0;
while (i < animalsArray.length) {
if (_local1[animalsArray[i]].body.hitTest(_local2._x, _local2._y, true)) {
var _local3 = Math.round(Math.abs(Math.sqrt(Math.pow(_local2.Vy, 2) + Math.pow(_local2.Vx, 2))));
trace(("took out " + _local3) + " damage");
_local1.attachMovie("damageDisplayer", "damageDisplay" + _local3, 600 + _local3);
_local1["damageDisplay" + _local3].damage = _local3;
_local1["damageDisplay" + _local3].rate = 2;
_local1["damageDisplay" + _local3]._x = _local2._x;
if (_local1["damageDisplay" + _local3]._x < 0) {
_local1["damageDisplay" + _local3]._x = -20;
} else if (_local1["damageDisplay" + _local3]._x > 520) {
_local1["damageDisplay" + _local3]._x = 480;
}
_local1["damageDisplay" + _local3]._y = _local2._y;
_local1["damageDisplay" + _local3].onEnterFrame = function () {
var _local1 = this;
_local1._y = _local1._y - _local1.rate;
_local1.rate = _local1.rate * 1.1;
if (_local1._y < -40) {
_local1.removeMovieClip();
}
};
_local1[animalsArray[i]].pissed = true;
_local1[animalsArray[i]].health = _local1[animalsArray[i]].health - _local3;
if (_local1[animalsArray[i]].health < 1) {
_local1[animalsArray[i]].die();
}
_local1[animalsArray[i]].makeNoise();
_local1[animalsArray[i]].HPBC._visible = true;
if (_local1[animalsArray[i]].health < 1) {
_local1[animalsArray[i]].HPBC.HPbar.gotoAndStop(1);
} else {
_local1[animalsArray[i]].HPBC.HPbar.gotoAndStop(Math.round((_local1[animalsArray[i]].health / _local1[animalsArray[i]].maxHealth) * 25));
}
removeScrollObj(_local2.name);
removeArrow(_local2.name);
_local2.removeMovieClip();
}
i++;
}
if (((_local2._y > 360) || (_local2._x < -540)) || (_local2._x > 1080)) {
removeScrollObj(_local2.name);
removeArrow(_local2.name);
_local2.removeMovieClip();
}
};
}
function spawnAnimal(spawnDir, spawnLevel) {
var _local2 = _root;
var _local1 = "animal" + aC;
addAnimal(_local1);
animalType = ((spawnLevel == "low") ? (lowAnimals[random(lowAnimals.length)]) : (highAnimals[random(highAnimals.length)]));
_local2.attachMovie(animalType, _local1, 100 + aC, _local2[animalType + "Obj"]);
aC++;
if (aC > 15) {
aC = 1;
}
_local2[_local1].HPBC._visible = false;
_local2[_local1].name = _local1;
_local2[_local1].initialize(spawnDir);
_local2[_local1].health = _local2[_local1].maxHealth;
_local2[_local1].makeNoise();
trace("spawned a " + animalType);
}
function animalSpawnerFunction() {
if ((!pauseEngine) && (animalsArray.length < 1)) {
if (Key.isDown(39)) {
((random(2) == 0) ? (spawnAnimal("right", "low")) : (spawnAnimal("right", "high")));
} else if (Key.isDown(37)) {
((random(2) == 0) ? (spawnAnimal("left", "low")) : (spawnAnimal("left", "high")));
} else if (random(2) == 0) {
((random(2) == 0) ? (spawnAnimal("left", "low")) : (spawnAnimal("left", "high")));
} else {
((random(2) == 0) ? (spawnAnimal("right", "low")) : (spawnAnimal("right", "high")));
}
}
}
function huntEngineEnterFrame() {
var _local1 = _root;
if (speedBoost > 0) {
speedBoost--;
speedBoostIcon._visible = true;
} else {
speedBoostIcon._visible = false;
}
if (powerBoost > 0) {
powerBoost--;
powerBoostIcon._visible = true;
} else {
powerBoostIcon._visible = false;
}
if (showFPS) {
calcFPS();
}
if (!pauseEngine) {
time = time - 0.0416666666666667;
totalTime++;
if (time < 0) {
time = 0;
pauseEngine = true;
contain.gotoAndPlay(2);
destroyEngine();
trace("game ova");
}
updateTimer();
if (Key.isDown(32) && (!reloading)) {
if (powerBoost > 0) {
if (shotMagnitude < 25) {
shotMagnitude = shotMagnitude + 2;
} else {
shotMagnitude = 25;
}
} else if (shotMagnitude < 25) {
shotMagnitude++;
}
}
if (Key.isDown(38) && (!reloading)) {
if (angle < 70) {
if (speedBoost > 0) {
angle = angle + 4;
} else {
angle = angle + 2;
}
}
}
if (Key.isDown(40) && (!reloading)) {
if (angle > -45) {
if (speedBoost > 0) {
angle = angle - 4;
} else {
angle = angle - 2;
}
}
}
if (Key.isDown(37)) {
if (walkCycle == 1) {
walkCycle = 8;
}
walkDirection = "left";
if (speedBoost > 0) {
moveBackground(7);
moveForeground(14);
moveBackdrop(2);
moveFarground(3);
} else {
moveBackground(5);
moveForeground(10);
moveBackdrop(1);
moveFarground(2);
}
walkCycle++;
i = 0;
while (i < scrollObjects.length) {
if (speedBoost > 0) {
_local1[scrollObjects[i]]._x = _local1[scrollObjects[i]]._x + 7;
} else {
_local1[scrollObjects[i]]._x = _local1[scrollObjects[i]]._x + 5;
}
i++;
}
if (background._x > 0) {
background.chunkLeft._visible = true;
background.chunkRight._visible = false;
}
if (background._x > 540) {
if (currentChunk == 0) {
moveBackground(-540);
currentChunk = map.length;
updateMap();
} else {
moveBackground(-540);
currentChunk--;
updateMap();
}
}
if (reloading) {
archer.body.bow.gotoAndPlay(65 + archer.body.bow.reloadStep);
archer.shadow.bow.gotoAndPlay(65 + archer.body.bow.reloadStep);
}
} else if (Key.isDown(39)) {
if (walkCycle == 1) {
walkCycle = 8;
}
walkDirection = "right";
if (speedBoost > 0) {
moveBackground(-7);
moveForeground(-14);
moveBackdrop(-2);
moveFarground(-3);
} else {
moveBackground(-5);
moveForeground(-10);
moveBackdrop(-1);
moveFarground(-2);
}
i = 0;
while (i < scrollObjects.length) {
if (speedBoost > 0) {
_local1[scrollObjects[i]]._x = _local1[scrollObjects[i]]._x + -7;
} else {
_local1[scrollObjects[i]]._x = _local1[scrollObjects[i]]._x + -5;
}
i++;
}
if (background._x < 0) {
background.chunkLeft._visible = false;
background.chunkRight._visible = true;
}
walkCycle++;
if (background._x < -540) {
if (currentChunk == map.length) {
moveBackground(540);
currentChunk == 0;
updateMap();
} else {
moveBackground(540);
currentChunk++;
updateMap();
}
}
if (reloading) {
archer.body.bow.gotoAndPlay(27 + archer.body.bow.reloadStep);
archer.shadow.bow.gotoAndPlay(27 + archer.body.bow.reloadStep);
}
} else {
walkCycle = 1;
}
if (walkCycle > 13) {
walkCycle = 2;
}
setArcherFrame(walkDirection + walkCycle);
updateBow();
if ((!reloading) && (Key.isDown(32))) {
updatePower();
}
}
}
keyListener = new Object();
keyListener.onKeyDown = function () {
if (!pauseEngine) {
if ((Key.getCode() == 32) && (!reloading)) {
charging = true;
}
}
};
keyListener.onKeyUp = function () {
if (!pauseEngine) {
if ((Key.getCode() == 32) && (!reloading)) {
fire();
shotMagnitude = 0;
charging = false;
updatePower();
}
}
};
buttonsEnabled = true;
showFPS = true;
engineLoaded = false;
lowAnimals = new Array("rabbit", "ostrich");
highAnimals = new Array("eagle");
headInfo = new Object();
headInfo.xArray = new Array(0, -42.1, -30.9, -39.7, -41.6, -40.2, -39.2, -38.2, -38.2, -37.2, -37.7, -39.2, -41.4, -41.4, -39.7, -35.3, -38.2, -36.7, -36.2, -36.2, -35.8, -38.2, -35.8, -39.2, -37.7, -36.2, -36.2);
headInfo.yArray = new Array(0, -145.9, -145.9, -146.9, -150.8, -151.3, -155.3, -155.3, -151.8, -147.9, -150.4, -153.8, -159.7, -155.7, -151.8, -146.9, -150.4, -151.8, -155.3, -155.3, -151.3, -147.4, -150.8, -153.8, -159.7, -155.3, -151.3);
BowInfo = new Object();
BowInfo.xArray = new Array(0, -41.4, -33.6, -40, -41.5, -41, -39, -38.1, -37, -37.8, -37.5, -39, -39.5, -39, -37, -35.6, -38.5, -36.4, -37.6, -36.7, -36.8, -38, -36.4, -39.6, -39.1, -38.9, -38.5);
BowInfo.yArray = new Array(0, -136.7, -137.6, -135.6, -138.6, -140.1, -143.3, -144.3, -139.9, -136.1, -138.9, -141.9, -147.8, -143.4, -139.8, -135.6, -138.6, -140.1, -143.3, -144.3, -139.9, -136.1, -138.9, -141.9, -147.8, -143.4, -139.8);
scrollObjects = new Array();
plainsMap = new Array(1, 4, 3, 3, 2, 3, 1, 2, 5, 2);
forestMap = new Array(1, 3, 1, 2, 2, 1, 2, 1, 4, 2);
dummySound = new Sound();
homeMusic = new Sound();
homeMusic.attachSound("homeMusicLoop");
forestMusic = new Sound();
forestMusic.attachSound("forestMusic");
plainsMusic = new Sound();
plainsMusic.attachSound("plainsMusic");
showForeground = true;
ostrichObj = new Object();
ostrichObj.initialize = function (dir) {
var _local1 = this;
addScrollObj(_local1.name);
_local1._y = 360;
if (dir == "right") {
_local1.walkDir = "left";
_local1._x = 620;
} else {
_local1.walkDir = "right";
_local1._x = -80;
}
_local1.walkCycle = 2;
_local1.isMoving = true;
_local1.pissed = false;
_local1.maxHealth = 20;
_local1.makeNoise = function () {
var _local1 = new Sound();
_local1.attachSound("ostrichSound");
_local1.onSoundComplete = function () {
delete this;
};
_local1.start();
};
_local1.die = function () {
var _local1 = this;
_local1.dead = true;
_local1.HPBC._visible = false;
_local1.body.gotoAndStop(_local1.walkDir + "Die");
_local1.shadow.gotoAndStop(_local1.walkDir + "Die");
removeAnimal(_local1.name);
};
_local1.onEnterFrame = function () {
var _local1 = this;
if ((!_local1.dead) && (!pauseEngine)) {
_local1.walkCycle++;
if (!_local1.pissed) {
if (_local1.walkCycle > 14) {
_local1.walkCycle = 2;
if (random(7) == 0) {
if (_local1.isMoving) {
_local1.isMoving = false;
} else {
_local1.isMoving = true;
if (random(2) == 0) {
_local1.walkDir = "left";
} else {
_local1.walkDir = "right";
}
}
}
}
if (_local1.isMoving) {
_local1.body.gotoAndStop(_local1.walkDir + _local1.walkCycle);
_local1.shadow.gotoAndStop(_local1.walkDir + _local1.walkCycle);
if (_local1.walkDir == "left") {
_local1._x = _local1._x - 3;
} else {
_local1._x = _local1._x + 3;
}
if ((_local1._x > 180) && (_local1._x < 340)) {
_local1.pissed = true;
}
} else {
_local1.body.gotoAndStop(_local1.walkDir + "1");
_local1.shadow.gotoAndStop(_local1.walkDir + "1");
}
} else {
if (_local1.walkCycle > 14) {
_local1.walkCycle = 2;
}
if (_local1._x > 280) {
_local1.walkDir = "right";
_local1._x = _local1._x + 8.5;
} else {
_local1.walkDir = "left";
_local1._x = _local1._x - 8.5;
}
_local1.body.gotoAndStop(_local1.walkDir + _local1.walkCycle);
_local1.shadow.gotoAndStop(_local1.walkDir + _local1.walkCycle);
}
}
if ((_local1._x < -540) || (_local1._x > 1080)) {
removeAnimal(_local1.name);
removeScrollObj(_local1.name);
_local1.removeMovieClip();
}
};
};
rabbitObj = new Object();
rabbitObj.initialize = function (dir) {
var _local1 = this;
addScrollObj(_local1.name);
_local1._y = 360;
if (dir == "right") {
_local1.walkDir = "left";
_local1._x = 620;
} else {
_local1.walkDir = "right";
_local1._x = -80;
}
_local1.dead = false;
_local1.cycler = 0;
_local1.maxHealth = 15;
_local1.makeNoise = function () {
var _local1 = new Sound();
if (!this.dead) {
_local1.attachSound("rabbitNormal");
} else {
_local1.attachSound("rabbitDeath");
}
_local1.onSoundComplete = function () {
delete this;
};
_local1.start();
};
_local1.die = function () {
var _local1 = this;
_local1.dead = true;
_local1.makeNoise();
_local1.HPBC._visible = false;
_local1.body.gotoAndStop(_local1.walkDir + "Die");
_local1.shadow.gotoAndStop(_local1.walkDir + "Die");
removeAnimal(_local1.name);
};
_local1.onEnterFrame = function () {
var _local1 = this;
if ((!_local1.dead) && (!pauseEngine)) {
_local1.cycler++;
if (_local1.cycler >= 72) {
_local1.cycler = 0;
switch (random(4)) {
case 0 :
_local1.body.gotoAndPlay("leftJump");
_local1.shadow.gotoAndPlay("leftJump");
_local1.walkDir = "left";
break;
case 1 :
_local1.body.gotoAndPlay("rightJump");
_local1.shadow.gotoAndPlay("rightJump");
_local1.walkDir = "right";
break;
case 2 :
_local1.body.gotoAndStop("left");
_local1.shadow.gotoAndStop("left");
_local1.walkDir = "left";
break;
case 3 :
_local1.body.gotoAndStop("right");
_local1.shadow.gotoAndStop("right");
_local1.walkDir = "right";
break;
default :
trace("what?");
}
}
}
if ((_local1._x < -200) || (_local1._x > 740)) {
removeAnimal(_local1.name);
removeScrollObj(_local1.name);
_local1.removeMovieClip();
}
};
};
eagleObj = new Object();
eagleObj.initialize = function (dir) {
var _local1 = this;
trace("init Eagle");
addScrollObj(_local1.name);
_local1._y = 70 + random(30);
if (dir == "right") {
_local1.walkDir = "left";
_local1._x = 640;
_local1.body.gotoAndPlay("left");
_local1.vX = -8;
} else {
_local1.walkDir = "right";
_local1._x = -100;
_local1.body.gotoAndPlay("right");
_local1.vX = 8;
}
_local1.dead = false;
_local1.Vy = 0;
_local1.maxHealth = 10;
_local1.makeNoise = function () {
JimmySound = new Sound();
JimmySound.attachSound("eagleSound");
JimmySound.onSoundComplete = function () {
delete this;
};
JimmySound.start();
};
_local1.die = function () {
var _local1 = this;
_local1.dead = true;
_local1.makeNoise();
_local1.HPBC._visible = false;
_local1.body.gotoAndStop(_local1.walkDir + "Die");
removeAnimal(_local1.name);
};
_local1.onEnterFrame = function () {
var _local1 = this;
_local1._x = _local1._x + _local1.vX;
if (_local1.dead) {
_local1._y = _local1._y + _local1.Vy;
_local1.Vy = _local1.Vy + 0.40875;
if (_local1._y > 360) {
_local1._y = 360;
_local1.deathCycle = 0;
_local1.onEnterFrame = function () {
var _local1 = this;
_local1.deathCycle++;
if (_local1.deathCycle == 30) {
itemSpawner(_local1.name, false);
removeScrollObj(_local1.name);
_local1.removeMovieClip();
}
};
}
}
if ((_local1._x < -200) || (_local1._x > 740)) {
removeAnimal(_local1.name);
removeScrollObj(_local1.name);
_local1.removeMovieClip();
}
};
};
stop();
Instance of Symbol 110 MovieClip in Frame 1
onClipEvent (enterFrame) {
if (_root.getBytesLoaded() == _root.getBytesTotal()) {
_root.gotoAndPlay("intro");
_root.introCounter = 0;
} else {
this.loadBar.gotoAndStop(Math.round((_root.getBytesLoaded() / _root.getBytesTotal()) * 25));
}
}
Frame 8
introCounter++;
Instance of Symbol 115 MovieClip "fader" in Frame 8
onClipEvent (load) {
this.swapDepths(1020);
}
Frame 9
if (introCounter >= 80) {
fader.gotoAndPlay(2);
fader.frameToGoTo = "mainMenu";
fader.soundToFade = "dummySound";
fader.soundToStart = "dummySound";
stop();
} else {
gotoAndPlay ("intro");
}
Frame 15
newGameBTN.enabled = true;
continueBTN.enabled = true;
Frame 22
initEngine(currentStage);
contain.swapDepths(1008);
PBC.swapDepths(1005);
if (showForeground) {
backgroundFront.swapDepths(1004);
backgroundFront.gotoAndStop("show");
} else {
backgroundFront.gotoAndStop("hide");
}
if (showFPS) {
var startTime = getTimer();
var recentSetting = 10;
var recentNumFrames = 0;
var recentStartTime = startTime;
}
Symbol 28 MovieClip Frame 7
stop();
Symbol 36 MovieClip Frame 1
_parent._parent.HPBC._visible = false;
Symbol 36 MovieClip Frame 38
_root.itemSpawner(_parent._parent.name, false);
_root.removeScrollObj(_parent._parent.name);
_parent._parent.removeMovieClip();
Symbol 37 MovieClip Frame 1
stop();
Symbol 37 MovieClip Frame 12
_parent._x = _parent._x + 3;
Symbol 37 MovieClip Frame 13
_parent._x = _parent._x + 3;
Symbol 37 MovieClip Frame 14
_parent._x = _parent._x + 3;
Symbol 37 MovieClip Frame 15
_parent._x = _parent._x + 3;
Symbol 37 MovieClip Frame 16
_parent._x = _parent._x + 3;
Symbol 37 MovieClip Frame 17
_parent._x = _parent._x + 3;
Symbol 37 MovieClip Frame 18
_parent._x = _parent._x + 3;
if (random(5) == 0) {
gotoAndPlay (12);
}
Symbol 37 MovieClip Frame 19
gotoAndStop ("right");
Symbol 37 MovieClip Frame 30
_parent._x = _parent._x - 3;
Symbol 37 MovieClip Frame 31
_parent._x = _parent._x - 3;
Symbol 37 MovieClip Frame 32
_parent._x = _parent._x - 3;
Symbol 37 MovieClip Frame 33
_parent._x = _parent._x - 3;
Symbol 37 MovieClip Frame 34
_parent._x = _parent._x - 3;
Symbol 37 MovieClip Frame 35
_parent._x = _parent._x - 3;
if (random(5) == 0) {
gotoAndPlay (30);
}
Symbol 37 MovieClip Frame 36
gotoAndStop ("left");
Symbol 42 MovieClip Frame 1
stop();
Symbol 42 MovieClip Frame 25
stop();
Symbol 49 MovieClip Frame 30
stop();
Symbol 53 MovieClip Frame 10
stop();
Symbol 69 MovieClip Frame 11
gotoAndPlay ("right");
Symbol 69 MovieClip Frame 19
gotoAndPlay ("left");
Symbol 92 MovieClip Frame 1
_parent._parent.HPBC._visible = false;
Symbol 92 MovieClip Frame 51
_root.itemSpawner(_parent._parent.name, true);
_root.removeScrollObj(_parent._parent.name);
_parent._parent.removeMovieClip();
Symbol 93 MovieClip Frame 1
stop();
Symbol 115 MovieClip Frame 1
stop();
Symbol 115 MovieClip Frame 2
_root[soundToFade].setVolume(90);
_root.pauseEngine = true;
_root.enableButtons();
Symbol 115 MovieClip Frame 3
_root[soundToFade].setVolume(80);
Symbol 115 MovieClip Frame 4
_root[soundToFade].setVolume(70);
Symbol 115 MovieClip Frame 5
_root[soundToFade].setVolume(60);
Symbol 115 MovieClip Frame 6
_root[soundToFade].setVolume(50);
Symbol 115 MovieClip Frame 7
_root[soundToFade].setVolume(40);
Symbol 115 MovieClip Frame 8
_root[soundToFade].setVolume(30);
Symbol 115 MovieClip Frame 9
_root[soundToFade].setVolume(20);
Symbol 115 MovieClip Frame 10
_root[soundToFade].setVolume(10);
Symbol 115 MovieClip Frame 15
_root[soundToFade].stop();
if (_root.engineLoaded) {
_root.foreground.swapDepths(-1);
_root.HPBC.swapDepths(-2);
trace("engine is loaded, deleting shit");
_root.engineLoaded = false;
i = 0;
while (i < _root.scrollObjects.length) {
_root[_root.scrollObjects[i]].removeMovieClip();
i++;
}
}
Symbol 115 MovieClip Frame 16
_root[soundToStart].start(0, 9999);
_root[soundToStart].setVolume(0);
this.swapDepths(1020);
_root.contain.gotoAndStop(1);
_root.gotoAndStop(frameToGoTo);
Symbol 115 MovieClip Frame 22
_root[soundToStart].setVolume(10);
Symbol 115 MovieClip Frame 23
_root[soundToStart].setVolume(20);
Symbol 115 MovieClip Frame 24
_root[soundToStart].setVolume(30);
Symbol 115 MovieClip Frame 25
_root[soundToStart].setVolume(40);
Symbol 115 MovieClip Frame 26
_root[soundToStart].setVolume(50);
Symbol 115 MovieClip Frame 27
_root[soundToStart].setVolume(60);
Symbol 115 MovieClip Frame 28
_root[soundToStart].setVolume(70);
Symbol 115 MovieClip Frame 29
_root[soundToStart].setVolume(80);
Symbol 115 MovieClip Frame 30
_root[soundToStart].setVolume(90);
Symbol 115 MovieClip Frame 31
_root[soundToStart].setVolume(100);
_root.disableButtons();
gotoAndStop (1);
_root.pauseEngine = false;
Symbol 119 Button
on (press) {
getURL ("http://www.wonpwn.com");
}
Symbol 124 Button
on (press) {
getURL ("http://www.wonpwn.com");
}
Symbol 128 Button
on (release) {
newGameBTN.enabled = false;
fader.gotoAndPlay(2);
fader.frameToGoTo = "hunt";
fader.soundToFade = "dummySound";
fader.soundToStart = "forestMusic";
currentStage = "forest";
}
Symbol 147 MovieClip Frame 1
stop();
Symbol 150 MovieClip Frame 1
stop();
Symbol 185 MovieClip Frame 1
stop();
Symbol 185 MovieClip Frame 28
reloadStep = 1;
Symbol 185 MovieClip Frame 29
reloadStep = 2;
Symbol 185 MovieClip Frame 30
reloadStep = 3;
Symbol 185 MovieClip Frame 31
reloadStep = 4;
Symbol 185 MovieClip Frame 32
reloadStep = 5;
Symbol 185 MovieClip Frame 33
reloadStep = 6;
Symbol 185 MovieClip Frame 34
reloadStep = 7;
Symbol 185 MovieClip Frame 35
reloadStep = 8;
Symbol 185 MovieClip Frame 36
reloadStep = 9;
Symbol 185 MovieClip Frame 37
reloadStep = 10;
Symbol 185 MovieClip Frame 38
gotoAndStop(_root.walkDirection + "Arrow");
_root.reloading = false;
Symbol 185 MovieClip Frame 39
stop();
Symbol 185 MovieClip Frame 66
reloadStep = 1;
Symbol 185 MovieClip Frame 67
reloadStep = 2;
Symbol 185 MovieClip Frame 68
reloadStep = 3;
Symbol 185 MovieClip Frame 69
reloadStep = 4;
Symbol 185 MovieClip Frame 70
reloadStep = 5;
Symbol 185 MovieClip Frame 71
reloadStep = 6;
Symbol 185 MovieClip Frame 72
reloadStep = 7;
Symbol 185 MovieClip Frame 73
reloadStep = 8;
Symbol 185 MovieClip Frame 74
reloadStep = 9;
Symbol 185 MovieClip Frame 75
reloadStep = 10;
Symbol 185 MovieClip Frame 76
gotoAndStop(_root.walkDirection + "Arrow");
_root.reloading = false;
Symbol 188 MovieClip Frame 1
stop();
Symbol 218 MovieClip Frame 1
stop();
Symbol 218 MovieClip Frame 3
_root.footStepRight();
Symbol 218 MovieClip Frame 8
_root.footStepLeft();
Symbol 218 MovieClip Frame 20
_root.footStepLeft();
Symbol 218 MovieClip Frame 26
_root.footStepRight();
Symbol 229 MovieClip Frame 1
stop();
Symbol 232 MovieClip Frame 1
stop();
Symbol 238 Button
on (release) {
_root.fader.gotoAndPlay(2);
_root.fader.frameToGoTo = "hunt";
_root.fader.soundToFade = "dummySound";
_root.fader.soundToStart = "forestMusic";
_root.currentStage = "forest";
_root.pauseEngine = false;
_root.destroyEngine();
_root.initEngine();
}
Symbol 241 MovieClip Frame 1
stop();
Symbol 241 MovieClip Frame 20
stop();
scorey = Math.round(_root.totalTime / 24) + " seconds";