Frame 1
_root.gameID = 41;
_root.guest = true;
_quality = "BEST";
Frame 2
_quality = "BEST";
ifFrameLoaded (5) {
gotoAndStop (4);
}
Frame 3
gotoAndPlay (2);
Instance of Symbol 8 MovieClip "scores" in Frame 4
/* no clip actions */
Frame 4
_root.gameID = 41;
_root.rootWidth = 527;
_root.rootHeight = 400;
loadMovie ("./actionscript/scores.swf", "scores");
stop();
Frame 5
Instance of Symbol 60 MovieClip "game" in Frame 5
/* no clip actions */
Symbol 6 Button
on (release) {
nextFrame();
}
Symbol 12 Button
on (release, releaseOutside) {
ball.gravity = true;
playing = true;
ball.speed.z = 14;
ball.speed.x = random(31) - 15;
ball.speed.y = getRandom(ball.position.y, 0);
sounds.gotoAndPlay("whack");
}
Symbol 15 MovieClip Frame 1
Symbol 17 MovieClip Frame 1
Symbol 27 Button
on (release) {
playing = true;
newGame();
}
Symbol 41 MovieClip Frame 1
onEnterFrame = function () {
count++;
if (count >= 54) {
count = 0;
r = random(3);
if (r == 0) {
r = random(4) + 1;
gotoAndPlay("bird" + r);
}
}
};
stop();
Symbol 41 MovieClip Frame 6
stop();
Symbol 41 MovieClip Frame 13
stop();
Symbol 41 MovieClip Frame 20
stop();
Symbol 41 MovieClip Frame 27
stop();
Symbol 48 MovieClip Frame 1
onEnterFrame = function () {
count++;
if (count >= 90) {
count = 0;
r = random(3);
if (r == 0) {
r = random(5) + 1;
gotoAndPlay("sound" + r);
}
}
};
stop();
Symbol 48 MovieClip Frame 6
stop();
Symbol 48 MovieClip Frame 12
stop();
Symbol 48 MovieClip Frame 19
stop();
Symbol 48 MovieClip Frame 25
stop();
Symbol 48 MovieClip Frame 31
stop();
Symbol 52 MovieClip Frame 1
stop();
Symbol 54 Button
on (release) {
if (goal == 100) {
goal = 0;
} else {
goal = 100;
}
}
Symbol 59 MovieClip Frame 1
s = new Sound(this);
goal = 100;
volume = 70;
adjustment = 10;
stop();
onEnterFrame = function () {
if (goal < volume) {
volume = volume - adjustment;
} else if (goal > volume) {
volume = volume + adjustment;
}
if (Math.abs(goal - volume) < adjustment) {
volume - goal;
}
s.setVolume(volume);
frame = int(volume / 10) + 1;
speaker.gotoAndStop(frame);
};
Symbol 59 MovieClip Frame 7
r = random(3) + 1;
gotoAndStop("whack" + r);
Symbol 59 MovieClip Frame 15
stop();
Symbol 59 MovieClip Frame 22
stop();
Symbol 59 MovieClip Frame 30
stop();
Symbol 59 MovieClip Frame 37
stop();
Symbol 59 MovieClip Frame 79
stop();
Symbol 59 MovieClip Frame 85
stop();
Symbol 60 MovieClip Frame 1
function positionRacket() {
racket._x = _xmouse;
racket._y = _ymouse;
catcher._x = _xmouse;
catcher._y = _ymouse;
racket._rotation = ((-racket._y) / 20) - ((-racket._x) / 30);
catcher._rotation = ((-racket._y) / 20) - ((-racket._x) / 30);
}
function placeOnRacket() {
pastz = 30 - ball.position.z;
ratio = pastz / ball.speed.z;
safex = ball.position.x;
safey = ball.position.y;
safez = ball.position.z;
ball.position.z = ball.position.z + (ratio * ball.speed.z);
ball.position.y = ball.position.y + (ratio * ball.speed.y);
ball.position.x = ball.position.x + (ratio * ball.speed.x);
trace(ball.position.z);
}
function getRandom(y, type) {
where = (-y) + 325;
if (type == 0) {
start = 25 + (where * 0.0857142857142857);
spread = 57 - (where * 0.0371428571428571);
r = start + random(spread);
} else {
start = 116 - (where * 0.0857142857142857);
r = start + random(25);
}
return(r);
}
function convert(pos) {
mytrans = new Object();
where = (1 / pos.z) * dim;
mytrans.yscale = where * size;
mytrans.xscale = where * size;
distx = (pos.x - vanx) * (where / (dim / inc));
disty = (-(pos.y - vany)) * (where / (dim / inc));
mytrans.x = vanx + distx;
mytrans.y = vany + disty;
return(mytrans);
}
function redraw(object) {
if (object.shadow != "") {
shad = eval (object.shadow);
shad.position.x = object.position.x + ((object.position.y - floor) * 0.2);
shad.position.y = floor;
shad.position.z = object.position.z + ((object.position.y - floor) * 0.01);
mytrans = convert(shad.position);
shad._x = mytrans.x;
shad._y = mytrans.y;
shad._xscale = mytrans.xscale;
shad._yscale = mytrans.yscale;
}
mytrans = convert(object.position);
object._x = mytrans.x;
object._y = mytrans.y;
object._xscale = mytrans.xscale;
object._yscale = mytrans.yscale;
}
function translate(object) {
if (object.gravity) {
object.speed.y = object.speed.y - gravity;
}
object.position.x = object.position.x + object.speed.x;
object.position.y = object.position.y + object.speed.y;
object.position.z = object.position.z + object.speed.z;
if (object.position.y < floor) {
sounds.gotoAndPlay("bounce");
gravity = 7 + random(3);
object.position.y = floor;
object.speed.x = object.speed.x * object.slide;
object.speed.y = object.speed.y * (-object.bounce);
object.speed.z = object.speed.z * object.slide;
}
if (object.position.z > wall) {
sounds.gotoAndPlay("garage");
object.position.z = wall;
object.speed.z = object.speed.z * (-(object.bounce * 0.5));
object.speed.x = object.speed.x * (object.bounce * 0.5);
}
if (((object.position.z < 30) and (object.speed.z < 0)) and (!passed)) {
placeOnRacket();
if (catcher.hitTest(object._x + _x, object._y + _y, true)) {
sounds.gotoAndPlay("whack");
gravity = 11;
score++;
if (score > best) {
best = score;
}
mult = Math.min((score / 120) + 0.4, 1);
object.speed.x = (object._x - _xmouse) * mult;
type = 0;
if (random(5) == 0) {
type = 1;
}
object.speed.z = 14 + (type * 6);
object.speed.y = getRandom(object.position.y, type);
} else {
ball.position.x = safex;
ball.position.y = safey;
ball.position.z = safez;
passed = true;
}
}
if (object.position.z < 14) {
ball.gravity = false;
sounds.gotoAndPlay("past");
racket._visible = false;
Mouse.show();
object._visible = false;
eval (object.shadow)._visible = false;
object.position.z = 100;
object.speed.z = 0;
object.speed.y = 0;
object.speed.z = 0;
playing = false;
_parent.scores.scripting.test(score);
}
}
function reset() {
resetButton._visible = true;
}
function newGame() {
racket._visible = true;
resetButton._visible = false;
ball.shadow = "shadow";
ball.bounce = 0.8;
ball.slide = 0.9;
ball.gravity = false;
ball.location = new Object();
ball.position = new Object();
ball.speed = new Object();
ball.position.x = 0;
ball.position.y = 0;
ball.position.z = 30;
ball.speed.x = 0;
ball.speed.y = 0;
ball.speed.z = 0;
shadow._visible = true;
Mouse.hide();
tennisball = ball;
floor = -525;
wall = 133;
inc = 20;
vanx = 0;
vany = 0;
dim = 6000;
gravity = 11;
size = 0.4;
ball._visible = true;
translate(tennisball);
redraw(tennisball);
score = 0;
passed = false;
}
onEnterFrame = function () {
if (((_root._xmouse > 530) or ((_root._xmouse < 80) and (_root._ymouse > 330))) or (!playing)) {
Mouse.show();
} else {
Mouse.hide();
}
positionRacket();
translate(tennisball);
redraw(tennisball);
};
playing = true;
best = 0;
newGame();
Instance of Symbol 15 MovieClip "ball" in Symbol 60 MovieClip Frame 1
onClipEvent (load) {
}
Instance of Symbol 17 MovieClip "shadow" in Symbol 60 MovieClip Frame 1
onClipEvent (load) {
location = new Object();
position = new Object();
}