Frame 1
stop();
march1.stop();
Instance of Symbol 62 MovieClip [acorn2] "ac3" in Frame 1
onClipEvent (load) {
yspeed = 5;
xspeed = 10;
accelleration = 1.5;
}
onClipEvent (enterFrame) {
_x = (_x + xspeed);
_y = (_y + yspeed);
if ((_y >= 362.3) || (_y <= 0)) {
yspeed = yspeed * -1;
}
if ((_x >= 515.1) || (_x <= 0)) {
xspeed = xspeed * -1;
}
}
Instance of Symbol 62 MovieClip [acorn2] "ac2" in Frame 1
onClipEvent (load) {
yspeed = 7;
xspeed = -4;
accelleration = 1.5;
}
onClipEvent (enterFrame) {
_x = (_x + xspeed);
_y = (_y + yspeed);
if ((_y >= 362.3) || (_y <= 0)) {
yspeed = yspeed * -1;
}
if ((_x >= 515.1) || (_x <= 0)) {
xspeed = xspeed * -1;
}
}
Instance of Symbol 62 MovieClip [acorn2] "ac1" in Frame 1
onClipEvent (load) {
yspeed = -10;
xspeed = 6;
accelleration = 1.5;
}
onClipEvent (enterFrame) {
_x = (_x + xspeed);
_y = (_y + yspeed);
if ((_y >= 362.3) || (_y <= 0)) {
yspeed = yspeed * -1;
}
if ((_x >= 515.1) || (_x <= 0)) {
xspeed = xspeed * -1;
}
}
Frame 5
stop();
Frame 6
function startGame() {
floor = 350;
foxSpeed = 13;
bunnySpeed = 5;
jumpPower = 60;
score = 0;
foxPos = {x:0, y:0};
fallSpeed = 0;
falling = false;
fox.swapDepths(999);
bang = new Sound();
bang.attachSound("gunshot");
smash1 = new Sound();
smash1.attachSound("smash");
_root.onEnterFrame = moveFox;
createWorld();
createObjects();
}
function createWorld() {
objects = new Array();
objects.push({type:"box", x:200, y:0});
objects.push({type:"box", x:250, y:0});
objects.push({type:"box", x:500, y:0});
objects.push({type:"box", x:550, y:0});
objects.push({type:"box", x:600, y:0});
objects.push({type:"box", x:650, y:0});
objects.push({type:"box", x:700, y:0});
objects.push({type:"box", x:550, y:50});
objects.push({type:"box", x:600, y:50});
objects.push({type:"box", x:650, y:50});
objects.push({type:"box", x:850, y:0});
objects.push({type:"box", x:1050, y:100});
objects.push({type:"box", x:1100, y:100});
objects.push({type:"box", x:1150, y:100});
objects.push({type:"box", x:1300, y:50});
objects.push({type:"box", x:1350, y:50});
objects.push({type:"box", x:1400, y:100});
objects.push({type:"box", x:1450, y:100});
objects.push({type:"box", x:2000, y:100});
objects.push({type:"box", x:2050, y:100});
objects.push({type:"box", x:2500, y:100});
objects.push({type:"box", x:2650, y:0});
objects.push({type:"box", x:2700, y:0});
objects.push({type:"box", x:2750, y:50});
objects.push({type:"box", x:3000, y:50});
objects.push({type:"box", x:3200, y:100});
objects.push({type:"box", x:4000, y:50});
objects.push({type:"box", x:4200, y:50});
objects.push({type:"box", x:4500, y:0});
objects.push({type:"box", x:4600, y:50});
objects.push({type:"box", x:4600, y:1000});
objects.push({type:"box", x:4200, y:50});
objects.push({type:"box", x:4500, y:100});
objects.push({type:"box", x:4650, y:80});
objects.push({type:"acorn", x:150, y:0});
objects.push({type:"acorn", x:275, y:200});
objects.push({type:"acorn", x:1100, y:250});
objects.push({type:"acorn", x:3050, y:100});
objects.push({type:"acorn", x:3300, y:100});
objects.push({type:"acorn", x:3500, y:50});
objects.push({type:"acorn", x:4000, y:100});
objects.push({type:"acorn", x:4100, y:50});
objects.push({type:"acorn", x:4800, y:60});
objects.push({type:"acorn", x:5000, y:10});
objects.push({type:"bunny", x:1500, y:0});
objects.push({type:"bunny", x:2500, y:0});
objects.push({type:"bunny", x:4300, y:0});
objects.push({type:"bunny", x:400, y:0});
objects.push({type:"bunny", x:3000, y:0});
objects.push({type:"bunny", x:4000, y:0});
objects.push({type:"bunny", x:5000, y:0});
objects.push({type:"bunny", x:5500, y:0});
objects.push({type:"mantrap", x:300, y:0});
objects.push({type:"mantrap", x:3000, y:0});
objects.push({type:"mantrap", x:4000, y:0});
objects.push({type:"mantrap", x:4600, y:0});
objects.push({type:"mantrap", x:1800, y:0});
objects.push({type:"mantrap", x:1200, y:0});
worldEnd = 6000;
}
function createObjects() {
var _local2 = _root;
var _local1 = 0;
while (_local1 < objects.length) {
_local2.attachMovie(objects[_local1].type, "object " + _local1, _local1);
_local1++;
}
}
function moveFox() {
foxBounds = determineBounds(foxPos);
if ((foxBounds.bottom > 0) and (!falling)) {
falling = true;
}
if (falling) {
checkFall();
}
if (Key.isDown(37)) {
if (foxSpeed < foxBounds.left) {
foxPos.x = foxPos.x - foxSpeed;
}
if (foxPos.x < 0) {
foxPos.x = 0;
}
fox._xscale = 25;
moving = true;
} else if (Key.isDown(39)) {
if (foxSpeed < foxBounds.right) {
foxPos.x = foxPos.x + foxSpeed;
}
if (foxPos.x > worldEnd) {
foxPos.x = worldEnd;
}
fox._xscale = -25;
moving = true;
} else {
moving = false;
}
if (Key.isDown(32) and (!falling)) {
fallSpeed = jumpPower;
falling = true;
if (!moving) {
fox.gotoAndPlay("jump");
}
}
if (moving and (!falling)) {
fox.nextFrame();
} else if ((!moving) and (!falling)) {
fox.gotoAndStop(1);
}
fox._y = floor - foxPos.y;
moveBunnies();
collidemantrap();
drawObjects();
getAcorns();
}
function determineBounds(pos) {
var _local3 = {left:1000, right:1000, top:1000, bottom:pos.y};
var i = 0;
while (i < objects.length) {
if (objects[i].type == "box") {
var _local2 = objects[i].x - pos.x;
var _local1 = objects[i].y - pos.y;
if ((_local1 >= 0) and (_local1 <= 50)) {
if (((_local2 + 50) <= 0) and (Math.abs(_local2 + 50) < _local3.left)) {
_local3.left = Math.abs(_local2 + 50);
} else if ((_local2 >= 0) and (_local2 < _local3.right)) {
_local3.right = _local2 - 50;
}
}
if ((_local2 >= -50) and (_local2 <= 50)) {
if (((_local1 + 50) <= 0) and (Math.abs(_local1 + 50) <= _local3.bottom)) {
_local3.bottom = Math.abs(_local1 + 50);
} else if (((_local1 - 50) >= 0) and ((_local1 - 50) < _local3.top)) {
_local3.top = _local1 - 50;
}
}
}
i++;
}
return(_local3);
}
function checkFall() {
fallSpeed = fallSpeed - 10;
if (fallSpeed > (-foxBounds.bottom)) {
foxPos.y = foxPos.y + fallSpeed;
} else {
foxPos.y = foxPos.y - foxBounds.bottom;
fallSpeed = 0;
falling = false;
fox.gotoAndStop(1);
}
if (foxPos.y > foxBounds.top) {
foxPos.y = foxBounds.top;
fallSpeed = 0;
}
}
function drawObjects() {
var _local2 = _root;
var _local1 = 0;
while (_local1 < objects.length) {
_local2["object " + _local1]._x = (x = (275 + objects[_local1].x) - foxPos.x);
_local2["object " + _local1]._y = floor - objects[_local1].y;
_local1++;
}
}
function getAcorns() {
var _local2 = _root;
var _local1 = objects.length - 1;
while (_local1 >= 0) {
if (objects[_local1].type == "acorn") {
if (distance(_local2["object " + _local1], fox) < 30) {
_local2["object " + _local1].play();
objects[_local1].type = "used";
score = score + 100;
if (score >= 900) {
_local2.onEnterFrame = undefined;
gotoAndStop ("win");
}
}
}
_local1--;
}
}
function distance(mc1, mc2) {
d = Math.sqrt(Math.pow(mc1._x - mc2._x, 2) + Math.pow(mc1._y - mc2._y, 2));
return(d);
}
function moveBunnies() {
var _local3 = _root;
var _local1 = objects.length - 1;
while (_local1 >= 0) {
if (objects[_local1].type == "bunny") {
if (Math.abs(objects[_local1].x - foxPos.x) < 275) {
if (foxPos.x < objects[_local1].x) {
var _local2 = -bunnySpeed;
} else if (foxPos.x > objects[_local1].x) {
var _local2 = bunnySpeed;
}
bunnyBounds = determineBounds(objects[_local1]);
if ((_local2 < 0) and (bunnyBounds.left > Math.abs(_local2))) {
objects[_local1].x = objects[_local1].x + _local2;
} else if ((_local2 > 0) and (bunnyBounds.right > Math.abs(_local2))) {
objects[_local1].x = objects[_local1].x + _local2;
}
if (distance(_local3["object " + _local1], fox) < 30) {
drums1.stop();
bang.start();
_local3.onEnterFrame = undefined;
gotoAndStop ("Replay");
}
}
}
_local1--;
}
}
function collidemantrap() {
var _local2 = _root;
var _local1 = objects.length - 1;
while (_local1 >= 0) {
if (objects[_local1].type == "mantrap") {
if (distance(_local2["object " + _local1], fox) < 30) {
drums1.stop();
smash1.start();
_local2.onEnterFrame = undefined;
gotoAndStop ("Replay");
}
}
_local1--;
}
}
startGame();
stop();
march1.stop();
drums1 = new Sound();
drums1.attachSound("drums");
drums1.start();
Instance of Symbol 104 MovieClip in Frame 6
onClipEvent (keyDown) {
if (Key.isDown(37)) {
_x = (++x);
}
if (Key.isDown(39)) {
_x = (--x);
}
}
Frame 8
var i = 0;
while (i < objects.length) {
_root["object " + i].removeMovieClip();
i++;
}
_root.fox.removeMovieClip();
march1 = new Sound();
march1.attachSound("march");
march1.start();
Frame 9
var i = 0;
while (i < objects.length) {
_root["object " + i].removeMovieClip();
i++;
}
_root.fox.removeMovieClip();
final1 = new Sound();
final1.attachSound("final");
final1.start();
Instance of Symbol 143 MovieClip in Frame 9
onClipEvent (load) {
yspeed = -5;
xspeed = -6;
accelleration = 1.5;
}
onClipEvent (enterFrame) {
_x = (_x + xspeed);
_y = (_y + yspeed);
if ((_y >= 315.7) || (_y <= 50)) {
yspeed = yspeed * -1;
}
if ((_x >= 203.4) || (_x <= 0)) {
xspeed = xspeed * -1;
}
}
Instance of Symbol 145 MovieClip in Frame 9
onClipEvent (load) {
yspeed = 4;
xspeed = -3;
accelleration = 1.5;
}
onClipEvent (enterFrame) {
_x = (_x + xspeed);
_y = (_y + yspeed);
if ((_y >= 315.7) || (_y <= 50)) {
yspeed = yspeed * -1;
}
if ((_x >= 355.6) || (_x <= 0)) {
xspeed = xspeed * -1;
}
}
Frame 10
var i = 0;
while (i < objects.length) {
_root["object " + i].removeMovieClip();
i++;
}
_root.fox.removeMovieClip();
Symbol 23 MovieClip [bmc] Frame 1
stop();
myColor = new Color(colorChip1);
myColor.setRGB(rgb);
myColor2 = new Color(colorChip2);
myColor2.setRGB(rgb);
Symbol 23 MovieClip [bmc] Frame 2
myColor = new Color(colorChip1);
myColor.setRGB(rgb);
Symbol 23 MovieClip [bmc] Frame 3
myColor = new Color(colorChip1);
myColor.setRGB(rgb);
Symbol 46 MovieClip [acorn] Frame 1
stop();
Symbol 46 MovieClip [acorn] Frame 8
stop();
Symbol 62 MovieClip [acorn2] Frame 1
stop();
Symbol 62 MovieClip [acorn2] Frame 8
stop();
Symbol 73 Button
on (press) {
gotoAndPlay ("Play");
}
Symbol 74 Button
on (press) {
gotoAndStop ("instructions");
}
Symbol 78 Button
on (press) {
gotoAndStop ("credits");
}
Symbol 92 Button
on (press) {
gotoAndPlay ("play");
}
Symbol 130 MovieClip Frame 1
stop();
Symbol 130 MovieClip Frame 7
gotoAndPlay ("run");
Symbol 130 MovieClip Frame 9
stop();
Symbol 137 Button
on (press) {
gotoAndPlay ("Play");
}
Symbol 138 Button
on (press) {
gotoAndStop ("intro");
}
Symbol 141 Button
on (press) {
gotoAndStop ("Play");
}