Frame 1
var hat = 1;
var hand = 1;
var feet = 1;
_lockroot = true;
var myMenu = new ContextMenu();
myMenu.customItems.push(Copyright);
myMenu.hideBuiltInItems();
_root.menu = myMenu;
bgSound = new Sound(this);
bgSound.attachSound("sound1");
bgSound.start(0, 99);
bgSound.setVolume(100);
stop();
var score = 0;
var currentlevel = 1;
var bounces = 0;
Frame 2
stop();
Frame 3
stop();
_root.collisions.text = "Score: " + _root.score;
_root.go = true;
if (_root.score <= 0) {
_root.score = 0;
}
Frame 4
onEnterFrame = function () {
_root.collisions.text = "Score: " + _root.score;
ball.hat.gotoAndStop(hat);
ball.feet.gotoAndStop(feet);
ball.hand.gotoAndStop(hand);
};
stop();
ball.bounces = 0;
_root.collisions.text = "Score: " + _root.score;
Instance of Symbol 50 MovieClip "ball" in Frame 4
onClipEvent (load) {
radius = 5;
friction = 0.9;
precision = 360;
wait = 0;
bounces = 0;
gravity = 0.2;
yspeed = 0;
xspeed = 0;
jumping = 0;
}
onClipEvent (load) {
gravity = 0.2;
yspeed = 0;
xspeed = 1;
jumping = 0;
}
onClipEvent (enterFrame) {
if (_root.go == true) {
this._rotation = this._rotation + (xspeed / 2);
if (_root.terrain.exit.hitTest(this)) {
_x = 50;
_y = 50;
xspeed = 0;
yspeed = 0;
_root.go = false;
_root.terrain.clear();
_root.collisions.text = "Score: " + _root.score;
_root.terrain.lineStyle(10, FFFFFF, 100);
if ((_root._currentframe - 3) == _root.currentlevel) {
_root.currentlevel = _root.currentlevel + 1;
_root.score = _root.score + (500 * ((_root._currentframe - 3) / 5));
}
_root.gotoAndStop(3);
} else {
collisions = 0;
sum_x = 0;
sum_y = 0;
yspeed = yspeed + gravity;
x = 1;
while (x < precision) {
spot_x = _x + (radius * Math.sin((x * 360) / precision));
spot_y = _y - (radius * Math.cos((x * 360) / precision));
if (_root.terrain.hitTest(spot_x, spot_y, true)) {
collisions++;
sum_x = sum_x + spot_x;
sum_y = sum_y + spot_y;
}
x++;
}
if (collisions > 0) {
_root.collisions.text = "Score: " + _root.score;
ball_dir = Math.atan(yspeed / (xspeed * -1)) / (Math.PI/180);
if ((xspeed * -1) < 0) {
ball_dir = ball_dir + 180;
}
if (((xspeed * -1) >= 0) && (yspeed < 0)) {
ball_dir = ball_dir + 360;
}
spot_x = sum_x / collisions;
spot_y = sum_y / collisions;
x_cat = spot_x - _x;
y_cat = spot_y - _y;
ball_coll = Math.atan(y_cat / x_cat) / (Math.PI/180);
if (x_cat < 0) {
ball_coll = ball_coll + 180;
}
if ((x_cat >= 0) && (y_cat < 0)) {
ball_coll = ball_coll + 360;
}
ground_rotation = ball_coll - 90;
if (ground_rotation < 0) {
ground_rotation = ground_rotation + 180;
}
bounce_angle = (180 - ball_dir) - (2 * ground_rotation);
if (bounce_angle < 0) {
bounce_angle = bounce_angle + 360;
}
speed = Math.sqrt((yspeed * yspeed) + (xspeed * xspeed));
xspeed = (speed * Math.cos((bounce_angle * Math.PI) / 180)) * friction;
yspeed = ((speed * Math.sin((bounce_angle * Math.PI) / 180)) * -1) * friction;
_x = old_x;
_y = old_y;
} else {
old_x = _x;
old_y = _y;
}
_y = (_y + (yspeed * 2));
_x = (_x + (xspeed * 2));
}
if (Key.isDown(39)) {
if (xspeed < 3) {
xspeed = xspeed + 0.3;
}
}
if (Key.isDown(37)) {
if (xspeed > -3) {
xspeed = xspeed - 0.3;
}
}
if (_root.bonus.hitTest(this)) {
_root.bonus._y = 1000;
_root.score = _root.score + (500 * ((_root._currentframe - 3) / 5));
_root.collisions.text = "Score: " + _root.score;
}
}
}
Frame 5
stop();
_root.collisions.text = "Score: " + _root.score;
Frame 6
stop();
_root.collisions.text = "Score: " + _root.score;
Frame 7
stop();
_root.collisions.text = "Score: " + _root.score;
Frame 8
stop();
_root.collisions.text = "Score: " + _root.score;
Frame 9
stop();
_root.collisions.text = "Score: " + _root.score;
Frame 10
stop();
_root.collisions.text = "Score: " + _root.score;
Frame 11
stop();
_root.collisions.text = "Score: " + _root.score;
Frame 12
stop();
_root.collisions.text = "Score: " + _root.score;
Frame 13
stop();
_root.collisions.text = "Score: " + _root.score;
Frame 14
stop();
onEnterFrame = function () {
_root.collisions.text = "Score: " + _root.score;
ball.hat.gotoAndStop(hat);
ball.feet.gotoAndStop(feet);
ball.hand.gotoAndStop(hand);
};
Frame 15
onEnterFrame = function () {
_root.collisions.text = "Score: " + _root.score;
ball.hat.gotoAndStop(hat);
ball.feet.gotoAndStop(feet);
ball.hand.gotoAndStop(hand);
};
stop();
_root.collisions.text = "Score: " + _root.score;
Instance of Symbol 50 MovieClip "ball" in Frame 15
onClipEvent (load) {
radius = 5;
friction = 0.9;
precision = 360;
wait = 0;
bounces = 0;
gravity = 0.2;
yspeed = 0;
xspeed = 0;
jumping = 0;
}
onClipEvent (load) {
gravity = 0.2;
yspeed = 0;
xspeed = 1;
jumping = 0;
}
onClipEvent (enterFrame) {
if (_root.go == true) {
this._rotation = this._rotation + (xspeed / 2);
if (_root.terrain.exit.hitTest(this)) {
_x = 50;
_y = 50;
xspeed = 0;
yspeed = 0;
_root.go = false;
_root.terrain.clear();
_root.collisions.text = "Score: " + _root.score;
_root.terrain.lineStyle(10, FFFFFF, 100);
if ((_root._currentframe - 4) == _root.currentlevel) {
_root.currentlevel = _root.currentlevel + 1;
_root.score = _root.score + (500 * ((_root._currentframe - 3) / 5));
}
_root.gotoAndStop(3);
} else {
collisions = 0;
sum_x = 0;
sum_y = 0;
yspeed = yspeed + gravity;
x = 1;
while (x < precision) {
spot_x = _x + (radius * Math.sin((x * 360) / precision));
spot_y = _y - (radius * Math.cos((x * 360) / precision));
if (_root.terrain.hitTest(spot_x, spot_y, true)) {
collisions++;
sum_x = sum_x + spot_x;
sum_y = sum_y + spot_y;
}
x++;
}
if (collisions > 0) {
_root.collisions.text = "Score: " + _root.score;
ball_dir = Math.atan(yspeed / (xspeed * -1)) / (Math.PI/180);
if ((xspeed * -1) < 0) {
ball_dir = ball_dir + 180;
}
if (((xspeed * -1) >= 0) && (yspeed < 0)) {
ball_dir = ball_dir + 360;
}
spot_x = sum_x / collisions;
spot_y = sum_y / collisions;
x_cat = spot_x - _x;
y_cat = spot_y - _y;
ball_coll = Math.atan(y_cat / x_cat) / (Math.PI/180);
if (x_cat < 0) {
ball_coll = ball_coll + 180;
}
if ((x_cat >= 0) && (y_cat < 0)) {
ball_coll = ball_coll + 360;
}
ground_rotation = ball_coll - 90;
if (ground_rotation < 0) {
ground_rotation = ground_rotation + 180;
}
bounce_angle = (180 - ball_dir) - (2 * ground_rotation);
if (bounce_angle < 0) {
bounce_angle = bounce_angle + 360;
}
speed = Math.sqrt((yspeed * yspeed) + (xspeed * xspeed));
xspeed = (speed * Math.cos((bounce_angle * Math.PI) / 180)) * friction;
yspeed = ((speed * Math.sin((bounce_angle * Math.PI) / 180)) * -1) * friction;
_x = old_x;
_y = old_y;
} else {
old_x = _x;
old_y = _y;
}
_y = (_y + (yspeed * 2));
_x = (_x + (xspeed * 2));
}
if (Key.isDown(39)) {
if (xspeed < 3) {
xspeed = xspeed + 0.3;
}
}
if (Key.isDown(37)) {
if (xspeed > -3) {
xspeed = xspeed - 0.3;
}
}
if (_root.bonus.hitTest(this)) {
_root.bonus._y = 1000;
_root.score = _root.score + (500 * ((_root._currentframe - 3) / 5));
_root.collisions.text = "Score: " + _root.score;
}
}
}
Frame 16
stop();
_root.collisions.text = "Score: " + _root.score;
Frame 17
stop();
_root.collisions.text = "Score: " + _root.score;
Frame 18
stop();
_root.collisions.text = "Score: " + _root.score;
Frame 19
stop();
_root.collisions.text = "Score: " + _root.score;
Frame 20
stop();
_root.collisions.text = "Score: " + _root.score;
Frame 21
stop();
_root.collisions.text = "Score: " + _root.score;
Frame 22
stop();
_root.collisions.text = "Score: " + _root.score;
Frame 23
stop();
_root.collisions.text = "Score: " + _root.score;
Frame 24
stop();
_root.collisions.text = "Score: " + _root.score;
Symbol 24 MovieClip Frame 1
function timerHandler() {
if (!loadingComplete) {
var _local4 = _root.getBytesLoaded() / _root.getBytesTotal();
bar._xscale = 100 * _local4;
if (_local4 == 1) {
loadingComplete = true;
if (AUTO_PLAY) {
startMovie();
} else {
gotoAndStop ("loaded");
}
return(undefined);
}
}
dt = getTimer() - time;
time = time + dt;
frameAccum = frameAccum + dt;
var _local3 = 0;
while ((frameAccum >= FRAME_TIME) && (_local3 < MAX_FRAME_SKIP)) {
advanceFrame(tankLogo, true, true);
advanceFrame(loadingText, false, true);
advanceFrame(barGfx, false, true);
if (loadingComplete) {
advanceFrame(this, false, false);
}
(frameAccum = frameAccum - FRAME_TIME);
_local3++;
}
updateAfterEvent();
}
function advanceFrame(clip, recurse, loop) {
if (!clip) {
return(undefined);
}
clip.stop();
if (clip._currentframe == clip._totalframes) {
if (loop) {
clip.gotoAndStop(1);
}
} else {
clip.nextFrame();
}
if (recurse) {
for (childName in clip) {
if (typeof(clip[childName]) == "movieclip") {
advanceFrame(clip[childName], recurse, loop);
}
}
}
}
function startMovie() {
clearInterval(intervalId);
_root.play();
}
_root.stop();
stop();
var FRAME_TIME = 33.3333333333333;
var AUTO_PLAY = false;
var MAX_FRAME_SKIP = 5;
var loadingComplete;
var intervalId;
var time;
var frameAccum;
loadingComplete = false;
intervalId = setInterval(this, "timerHandler", FRAME_TIME / 2);
frameAccum = 0;
time = getTimer();
timerHandler();
Symbol 24 MovieClip Frame 126
_root.nextFrame();
Symbol 29 Button
on (release) {
if (bgSound.getVolume() != 0) {
bgSound.setVolume(0);
} else {
bgSound.setVolume(100);
}
}
Symbol 32 Button
on (release) {
_root.nextFrame();
}
Symbol 34 Button
on (release) {
_root.mm.nextFrame();
}
Symbol 36 Button
on (release) {
getURL ("http://www.areaglegames.com", _blank);
}
Symbol 41 MovieClip Frame 1
stop();
Symbol 45 MovieClip Frame 1
stop();
Symbol 49 MovieClip Frame 1
stop();
Symbol 50 MovieClip Frame 1
stop();
Symbol 52 Button
on (release) {
_root.gotoAndStop(14);
}
Symbol 55 MovieClip Frame 1
stop();
Symbol 60 Button
on (release) {
if (_root.currentlevel >= 13) {
_root.gotoAndStop(17);
}
}
Symbol 61 Button
on (release) {
if (_root.currentlevel >= 14) {
_root.gotoAndStop(18);
}
}
Symbol 62 Button
on (release) {
if (_root.currentlevel >= 12) {
_root.gotoAndStop(16);
}
}
Symbol 63 Button
on (release) {
if (_root.currentlevel >= 11) {
_root.gotoAndStop(15);
}
}
Symbol 64 Button
on (release) {
if (_root.currentlevel >= 15) {
_root.gotoAndStop(19);
}
}
Symbol 65 Button
on (release) {
if (_root.currentlevel >= 18) {
_root.gotoAndStop(22);
}
}
Symbol 66 Button
on (release) {
if (_root.currentlevel >= 19) {
_root.gotoAndStop(23);
}
}
Symbol 67 Button
on (release) {
if (_root.currentlevel >= 17) {
_root.gotoAndStop(21);
}
}
Symbol 68 Button
on (release) {
if (_root.currentlevel >= 16) {
_root.gotoAndStop(20);
}
}
Symbol 69 Button
on (release) {
if (_root.currentlevel >= 20) {
_root.gotoAndStop(24);
}
}
Symbol 70 Button
on (release) {
if (_root.currentlevel >= 3) {
_root.gotoAndStop(6);
}
}
Symbol 71 Button
on (release) {
if (_root.currentlevel >= 4) {
_root.gotoAndStop(7);
}
}
Symbol 72 Button
on (release) {
if (_root.currentlevel >= 2) {
_root.gotoAndStop(5);
}
}
Symbol 73 Button
on (release) {
_root.gotoAndStop(4);
}
Symbol 74 Button
on (release) {
if (_root.currentlevel >= 5) {
_root.gotoAndStop(8);
}
}
Symbol 75 Button
on (release) {
if (_root.currentlevel >= 8) {
_root.gotoAndStop(11);
}
}
Symbol 76 Button
on (release) {
if (_root.currentlevel >= 9) {
_root.gotoAndStop(12);
}
}
Symbol 77 Button
on (release) {
if (_root.currentlevel >= 7) {
_root.gotoAndStop(10);
}
}
Symbol 78 Button
on (release) {
if (_root.currentlevel >= 6) {
_root.gotoAndStop(9);
}
}
Symbol 79 Button
on (release) {
if (_root.currentlevel >= 10) {
_root.gotoAndStop(13);
}
}
Symbol 84 MovieClip Frame 1
stop();
Instance of Symbol 84 MovieClip in Symbol 103 MovieClip Frame 1
onClipEvent (enterFrame) {
if (_root.currentlevel >= 1) {
this.nextFrame();
}
}
Instance of Symbol 84 MovieClip in Symbol 103 MovieClip Frame 1
onClipEvent (enterFrame) {
if (_root.currentlevel >= 2) {
this.nextFrame();
}
}
Instance of Symbol 84 MovieClip in Symbol 103 MovieClip Frame 1
onClipEvent (enterFrame) {
if (_root.currentlevel >= 3) {
this.nextFrame();
}
}
Instance of Symbol 84 MovieClip in Symbol 103 MovieClip Frame 1
onClipEvent (enterFrame) {
if (_root.currentlevel >= 4) {
this.nextFrame();
}
}
Instance of Symbol 84 MovieClip in Symbol 103 MovieClip Frame 1
onClipEvent (enterFrame) {
if (_root.currentlevel >= 5) {
this.nextFrame();
}
}
Instance of Symbol 84 MovieClip in Symbol 103 MovieClip Frame 1
onClipEvent (enterFrame) {
if (_root.currentlevel >= 6) {
this.nextFrame();
}
}
Instance of Symbol 84 MovieClip in Symbol 103 MovieClip Frame 1
onClipEvent (enterFrame) {
if (_root.currentlevel >= 7) {
this.nextFrame();
}
}
Instance of Symbol 84 MovieClip in Symbol 103 MovieClip Frame 1
onClipEvent (enterFrame) {
if (_root.currentlevel >= 8) {
this.nextFrame();
}
}
Instance of Symbol 84 MovieClip in Symbol 103 MovieClip Frame 1
onClipEvent (enterFrame) {
if (_root.currentlevel >= 9) {
this.nextFrame();
}
}
Instance of Symbol 84 MovieClip in Symbol 103 MovieClip Frame 1
onClipEvent (enterFrame) {
if (_root.currentlevel >= 10) {
this.nextFrame();
}
}
Instance of Symbol 84 MovieClip in Symbol 103 MovieClip Frame 1
onClipEvent (enterFrame) {
if (_root.currentlevel >= 11) {
this.nextFrame();
}
}
Instance of Symbol 84 MovieClip in Symbol 103 MovieClip Frame 1
onClipEvent (enterFrame) {
if (_root.currentlevel >= 12) {
this.nextFrame();
}
}
Instance of Symbol 84 MovieClip in Symbol 103 MovieClip Frame 1
onClipEvent (enterFrame) {
if (_root.currentlevel >= 13) {
this.nextFrame();
}
}
Instance of Symbol 84 MovieClip in Symbol 103 MovieClip Frame 1
onClipEvent (enterFrame) {
if (_root.currentlevel >= 14) {
this.nextFrame();
}
}
Instance of Symbol 84 MovieClip in Symbol 103 MovieClip Frame 1
onClipEvent (enterFrame) {
if (_root.currentlevel >= 15) {
this.nextFrame();
}
}
Instance of Symbol 84 MovieClip in Symbol 103 MovieClip Frame 1
onClipEvent (enterFrame) {
if (_root.currentlevel >= 16) {
this.nextFrame();
}
}
Instance of Symbol 84 MovieClip in Symbol 103 MovieClip Frame 1
onClipEvent (enterFrame) {
if (_root.currentlevel >= 17) {
this.nextFrame();
}
}
Instance of Symbol 84 MovieClip in Symbol 103 MovieClip Frame 1
onClipEvent (enterFrame) {
if (_root.currentlevel >= 18) {
this.nextFrame();
}
}
Instance of Symbol 84 MovieClip in Symbol 103 MovieClip Frame 1
onClipEvent (enterFrame) {
if (_root.currentlevel >= 19) {
this.nextFrame();
}
}
Instance of Symbol 84 MovieClip in Symbol 103 MovieClip Frame 1
onClipEvent (enterFrame) {
if (_root.currentlevel >= 20) {
this.nextFrame();
}
}
Symbol 105 Button
on (release) {
_root.gotoAndStop(2);
}
Symbol 108 Button
on (release) {
_root.gotoAndStop(_root.currentlevel + 3);
}
Symbol 109 MovieClip Frame 1
stop();
Symbol 112 MovieClip Frame 1
stop();
Symbol 114 Button
on (release) {
_root.ball._x = 50;
_root.ball._y = 50;
_root.ball.xspeed = 0;
_root.ball.yspeed = 0;
}
Instance of Symbol 117 MovieClip in Symbol 120 MovieClip Frame 1
onClipEvent (enterFrame) {
this._rotation = this._rotation + 3;
}
Symbol 122 Button
on (release) {
_root.gotoAndStop(3);
_root.terrain.clear();
}
Symbol 123 MovieClip Frame 1
stop();
Symbol 125 MovieClip Frame 1
stop();
Symbol 127 MovieClip Frame 1
stop();
Symbol 129 MovieClip Frame 1
stop();
Symbol 131 MovieClip Frame 1
stop();
Symbol 133 MovieClip Frame 1
stop();
Symbol 135 MovieClip Frame 1
stop();
Symbol 137 MovieClip Frame 1
stop();
Symbol 139 MovieClip Frame 1
stop();
Symbol 143 Button
on (release) {
_root.gotoAndStop(3);
}
Symbol 147 Button
on (release) {
if (_root.score >= 1000) {
_root.score = _root.score - 1000;
_root.hat = 2;
}
}
Symbol 152 Button
on (release) {
if (_root.score >= 10000) {
_root.score = _root.score - 10000;
_root.feet = 2;
}
}
Symbol 156 Button
on (release) {
if (_root.score >= 5000) {
_root.score = _root.score - 5000;
_root.hand = 2;
}
}
Symbol 160 Button
on (release) {
if (_root.score >= 20000) {
_root.score = _root.score - 20000;
_root.hat = 3;
}
}
Symbol 163 Button
on (release) {
if (_root.score >= 25000) {
_root.score = _root.score - 25000;
_root.feet = 3;
}
}
Symbol 167 Button
on (release) {
if (_root.score >= 30000) {
_root.score = _root.score - 30000;
_root.hat = 4;
}
}
Symbol 171 Button
on (release) {
if (_root.score >= 30000) {
_root.score = _root.score - 30000;
_root.feet = 4;
}
}
Symbol 175 Button
on (release) {
if (_root.score >= 30000) {
_root.score = _root.score - 30000;
_root.hand = 4;
}
}
Symbol 180 Button
on (release) {
if (_root.score >= 15000) {
_root.score = _root.score - 15000;
_root.hand = 3;
}
}
Symbol 181 MovieClip Frame 1
stop();
Symbol 184 MovieClip Frame 1
stop();
Symbol 186 MovieClip Frame 1
stop();
Symbol 188 MovieClip Frame 1
stop();
Symbol 190 MovieClip Frame 1
stop();
Symbol 192 MovieClip Frame 1
stop();
Symbol 194 MovieClip Frame 1
stop();
Symbol 196 MovieClip Frame 1
stop();
Symbol 198 MovieClip Frame 1
stop();
Symbol 200 MovieClip Frame 1
stop();