Frame 1
function thegame() {
this.onEnterFrame = function () {
water();
clipBounds = ball_mc.getBounds(this);
clipymax = clipBounds.yMax;
clipymin = clipBounds.yMin;
clipxmax = clipBounds.xMax;
clipxmin = clipBounds.xMin;
xpos = _xmouse - arrow_mc._x;
ypos = -1 * (_ymouse - arrow_mc._y);
angle = Math.atan2(xpos, ypos);
angle = (angle / Math.PI) * 180;
arrow_mc._rotation = angle + 180;
y1 = ball_mc._y;
x1 = ball_mc._x;
y2 = this._ymouse;
x2 = this._xmouse;
x_cord = x2 - x1;
y_cord = y2 - y1;
arrowDist = Math.round(Math.sqrt((x_cord * x_cord) + (y_cord * y_cord)));
if (arrowDist < 80) {
arrow_mc.arr_mc._y = arrowDist;
}
xSpeed = speed * Math.sin(ball_mc._rotation * (Math.PI/180));
ySpeed = speed * Math.cos(ball_mc._rotation * (Math.PI/180));
if (clicked) {
ball_mc._y = ball_mc._y - ((ySpeed * dist) * dirx);
ball_mc._x = ball_mc._x + ((xSpeed * dist) * diry);
dist = dist - 0.02;
if (dist <= 0) {
clicked = false;
arrow_mc._visible = true;
click_mc.gotoAndStop(1);
arrow_mc._x = ball_mc._x;
arrow_mc._y = ball_mc._y;
stopx = ball_mc._x;
stopy = ball_mc._y;
}
}
if (ball_mc.hitTest(pit_mc)) {
if (ball_fall_mc._currentframe < 2) {
if (dist < 2) {
ball_fall_mc._x = pit_mc._x;
ball_fall_mc._y = pit_mc._y;
clicked = false;
ball_fall_mc.play();
ball_mc._visible = false;
dirx = 0;
diry = 0;
dist = 0;
numberofhits_array.push(numberofhits);
numberofhits = 0;
}
}
}
};
click_mc.onPress = function () {
click_mc.gotoAndStop(2);
clicked = true;
stopx = ball_mc._x;
stopy = ball_mc._y;
ball_mc._rotation = arrow_mc._rotation;
arrow_mc._visible = false;
y1 = ball_mc._y;
x1 = ball_mc._x;
y2 = this._ymouse;
x2 = this._xmouse;
x_cord = x2 - x1;
y_cord = y2 - y1;
dist = Math.round(Math.sqrt((x_cord * x_cord) + (y_cord * y_cord))) / 20;
dirx = 1;
diry = 1;
if (dist > 7) {
dist = 7;
}
numberofhits++;
};
xSpeed = 0;
ySpeed = 0;
speed = 2;
arrow_mc._x = ball_mc._x;
arrow_mc._y = ball_mc._y;
}
function water() {
if (water_mc.hitTest(ball_mc._x, ball_mc._y, true)) {
dist = 0;
ball_mc._x = stopx;
ball_mc._y = stopy;
}
if (water2_mc.hitTest(ball_mc._x, ball_mc._y, true)) {
dist = 0;
ball_mc._x = stopx;
ball_mc._y = stopy;
}
if (sand_mc.hitTest(ball_mc._x, ball_mc._y, true)) {
dist = dist - 0.4;
}
}
function init() {
numberofhits = 0;
score = 0;
startgame = true;
par_array = [2, 2, 2, 5, 4, 3, 3, 4, 3, 4];
numberofhits_array = [];
total_array = [];
stop();
}
function showscore() {
scorecard_mc.gotoAndStop(2);
ball_fall_mc.gotoAndStop(1);
ball_mc._visible = true;
}
function placeball() {
ball_mc._x = ballspot_mc._x;
ball_mc._y = ballspot_mc._y;
arrow_mc._visible = true;
}
init();
thegame();
Instance of Symbol 45 MovieClip "click_mc" in Frame 1
onClipEvent (load) {
this.useHandCursor = false;
}
Frame 2
placeball();
thegame();
Instance of Symbol 62 MovieClip in Frame 2
onClipEvent (load) {
towards = "up";
}
Instance of Symbol 62 MovieClip in Frame 2
onClipEvent (load) {
towards = "down";
}
Frame 3
placeball();
thegame();
Instance of Symbol 62 MovieClip in Frame 3
onClipEvent (load) {
towards = "up";
}
Instance of Symbol 62 MovieClip in Frame 3
onClipEvent (load) {
towards = "down";
}
Frame 4
placeball();
thegame();
Frame 5
placeball();
thegame();
stop();
Frame 6
placeball();
thegame();
Frame 7
placeball();
thegame();
Frame 8
placeball();
thegame();
Frame 9
placeball();
thegame();
Frame 10
placeball();
thegame();
stop();
Frame 11
stop();
Frame 12
gotoAndStop (1);
Symbol 4 MovieClip Frame 1
moveball();
function moveball() {
if (this.hitTest(_parent.ball_mc)) {
_parent.dirx = _parent.dirx * -1;
if (_parent.dist > 2) {
_parent.dist = _parent.dist - 1;
}
var _local3 = _parent.ySpeed.toString().indexOf(".", 0);
if (Math.round(_parent.ySpeed) == 0) {
if (Number(substring(_parent.ySpeed, Number(_local3 + 2), 1)) <= 1) {
_parent.diry = _parent.diry * -1;
}
}
common();
}
}
function common() {
gotoAndPlay (3);
}
Symbol 4 MovieClip Frame 2
moveball();
this.gotoAndPlay(1);
Symbol 6 MovieClip Frame 1
moveball();
function moveball() {
if (this.hitTest(_parent.ball_mc)) {
_parent.diry = _parent.diry * -1;
if (_parent.dist > 2) {
_parent.dist = _parent.dist - 1;
}
var _local3 = _parent.xSpeed.toString().indexOf(".", 0);
if (Math.round(_parent.xSpeed) == 0) {
if (Number(substring(_parent.xSpeed, Number(_local3 + 2), 1)) <= 1) {
_parent.dirx = _parent.dirx * -1;
trace(((((" xSpeed " + (substring(_parent.xSpeed, Number(_local3 + 2), 1))) + " dist ") + _parent.dist) + " :") + _parent.diry);
}
}
common();
}
}
function common() {
gotoAndPlay (3);
}
Symbol 6 MovieClip Frame 2
moveball();
this.gotoAndPlay(1);
Symbol 10 MovieClip Frame 1
_visible = false;
Symbol 13 MovieClip Frame 1
stop();
Symbol 13 MovieClip Frame 10
stop();
_parent.showscore();
_parent.nextFrame();
Symbol 25 Button
on (release) {
gotoAndStop (1);
_parent.nextlevel = true;
_parent.click_mc.gotoAndStop(1);
}
Symbol 29 Button
on (release) {
_parent.play();
}
Symbol 43 MovieClip Frame 1
grandtotal = 0;
_visible = false;
stop();
Symbol 43 MovieClip Frame 2
var temp = (_parent.numberofhits_array[_parent.numberofhits_array.length - 1] - _parent.par_array[_parent.numberofhits_array.length - 1]);
_parent.total_array.push(temp);
var i = 1;
while (i < _parent._currentframe) {
txtfield_mc.duplicateMovieClip("txtfld" + i, i);
textfileds_mc = eval ("txtfld" + i);
textfileds_mc._x = 148 + (i * (textfileds_mc._width + 3.5));
textfileds_mc.level_txt.text = i;
textfileds_mc.par_txt.text = _parent.par_array[i - 1];
textfileds_mc.hits_txt.text = _parent.numberofhits_array[i - 1];
textfileds_mc.total_txt.text = Number(_parent.numberofhits_array[i - 1]) - Number(_parent.par_array[i - 1]);
grandtotal = grandtotal + Number(_parent.total_array[i - 1]);
totalscore_txt.text = grandtotal;
i++;
}
_visible = true;
if (_parent.numberofhits_array.length >= 10) {
playagain_btn._visible = true;
nxt_btn._visible = false;
} else {
playagain_btn._visible = false;
nxt_btn._visible = true;
}
Symbol 45 MovieClip Frame 1
stop();
Symbol 51 Button
on (release) {
getURL ("http://www.gameshandbook.com");
}
Symbol 54 Button
on (release) {
getURL ("http://www.gameshandbook.com/freegames.php");
}
Symbol 58 Button
on (release) {
_visible = false;
}
Symbol 62 MovieClip Frame 1
moveball();
function moveball() {
if (this.hitTest(_parent.ball_mc)) {
_parent.ball_mc.towards = towards;
_parent.hump_mc.gotoAndPlay(1);
}
}
Symbol 62 MovieClip Frame 2
moveball();
this.gotoAndPlay(1);
Symbol 64 MovieClip Frame 1
moveball();
function moveball() {
if (this.hitTest(_parent.ball_mc)) {
if (_parent.ball_mc.towards == "up") {
if (_parent.dist < 2) {
_parent.dist = 1.5;
_parent.dirx = _parent.dirx * -1;
_parent.diry = 0;
}
} else {
if (_parent.dist < 2) {
_parent.dist = _parent.dist + 2;
} else {
_parent.dist = _parent.dist + 1;
}
_parent.diry = 0;
}
common();
}
}
function common() {
gotoAndPlay (3);
}
Symbol 64 MovieClip Frame 2
moveball();
this.gotoAndPlay(1);
Symbol 64 MovieClip Frame 3
stop();
Symbol 66 MovieClip Frame 1
_visible = false;
Symbol 73 MovieClip Frame 1
moveball();
function moveball() {
if (this.hitTest(_parent.ball_mc)) {
if (_parent.ball_mc.towards == "up") {
if (_parent.dist < 2) {
_parent.dist = 2;
_parent.diry = _parent.diry * -1;
_parent.dirx = 0;
}
} else {
if (_parent.dist < 2) {
_parent.dist = _parent.dist + 2;
} else {
_parent.dist = _parent.dist + 1;
}
_parent.dirx = 0;
}
common();
}
}
function common() {
gotoAndPlay (3);
}
Symbol 73 MovieClip Frame 2
moveball();
this.gotoAndPlay(1);
Symbol 73 MovieClip Frame 3
stop();