Frame 1
loadMovie ("preloader.swf", "preloader");
_root.gameID = 41;
_quality = "BEST";
Stage.showMenu = false;
Frame 2
_quality = "BEST";
ifFrameLoaded (5) {
gotoAndStop (4);
}
Frame 3
gotoAndPlay (2);
Frame 4
_root.gameID = 41;
_root.rootWidth = 527;
_root.rootHeight = 400;
stop();
Frame 5
Symbol 3 MovieClip Frame 1
if (this.sessionstarted != 1) {
this.arcade = new LoadVars();
this.sessionvars = new LoadVars();
this.arcade.gamename = "garagetennis";
this.arcade.sessdo = "sessionstart";
this.arcade.sendAndLoad("arcade.php", sessionvars, "POST");
if (this.sessionvars.sessiontype != 2) {
_root.is_a_challenge = 0;
} else {
_root.is_a_challenge = 1;
}
this.sessionstarted = 1;
}
if (_root.gameover == 1) {
if ((this.askpermission != 1) && (this.sessionvars.connStatus == 1)) {
this.prequestvars = new LoadVars();
this.pranswer = new LoadVars();
this.prequestvars.gametime = this.sessionvars.gametime;
this.prequestvars.fakekey = this.sessionvars.initbar;
_root.score = int(Number(_root.score));
if (_root.score != 0) {
this.prequestvars.score = _root.score;
} else {
this.prequestvars.score = -1;
}
this.prequestvars.id = this.sessionvars.lastid;
this.prequestvars.sessdo = "permrequest";
this.prequestvars.note = (this.prequestvars.id * this.prequestvars.score) * this.prequestvars.fakekey;
this.prequestvars.sendAndLoad("./arcade.php", this.pranswer, "POST");
this.askpermission = 1;
}
if ((this.pranswer.validate == 1) && (this.finalsent != 1)) {
this.burnscore = new LoadVars();
this.burnscore.microone = this.pranswer.microone;
this.burnscore.gametime = this.prequestvars.gametime;
this.burnscore.id = this.prequestvars.id;
if (_root.score == 0) {
this.burnscore.noscore = 1;
}
this.burnscore.sessdo = "burn";
this.burnscore.send("./arcade.php", "_self", "POST");
this.finalsent = 1;
}
}
Symbol 6 Button
on (release) {
nextFrame();
}
Symbol 11 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 13 MovieClip Frame 1
Symbol 16 MovieClip Frame 1
Symbol 24 Button
on (release) {
gname = "garagetennis";
_root.score = score;
_root.gameover = 1;
}
Symbol 36 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 36 MovieClip Frame 6
stop();
Symbol 36 MovieClip Frame 13
stop();
Symbol 36 MovieClip Frame 20
stop();
Symbol 36 MovieClip Frame 27
stop();
Symbol 42 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 42 MovieClip Frame 6
stop();
Symbol 42 MovieClip Frame 12
stop();
Symbol 42 MovieClip Frame 19
stop();
Symbol 42 MovieClip Frame 25
stop();
Symbol 42 MovieClip Frame 31
stop();
Symbol 49 MovieClip Frame 1
stop();
Symbol 53 Button
on (release) {
if (goal == 100) {
goal = 0;
} else {
goal = 100;
}
}
Symbol 35 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 35 MovieClip Frame 7
r = random(3) + 1;
gotoAndStop("whack" + r);
Symbol 35 MovieClip Frame 15
stop();
Symbol 35 MovieClip Frame 22
stop();
Symbol 35 MovieClip Frame 30
stop();
Symbol 35 MovieClip Frame 37
stop();
Symbol 35 MovieClip Frame 79
stop();
Symbol 35 MovieClip Frame 85
stop();
Symbol 8 MovieClip Frame 1
function positionRacket() {
racket._x = _xmouse;
racket._y = _ymouse;
catcher._x = _xmouse;
catcher._y = _ymouse;
racket._rotation = ((racket._y * -1) / 20) - ((racket._x * -1) / 30);
catcher._rotation = ((racket._y * -1) / 20) - ((racket._x * -1) / 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 * -1) + 325;
if (type != 0) {
start = 116 - (where * 0.085714);
r = start + random(25);
} else {
start = 25 + (where * 0.085714);
spread = 57 - (where * 0.037143);
r = start + random(spread);
}
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) * -1) * (where / (dim / inc));
mytrans.x = vanx + distx;
mytrans.y = vany + disty;
return(mytrans);
}
function redraw(object) {
if (object.shadow != "") {
shad = 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 * -1);
object.speed.z = object.speed.z * object.slide;
}
if (wall < object.position.z) {
sounds.gotoandplay("garage");
object.position.z = wall;
object.speed.z = (object.speed.z * (object.bounce * -1)) * 0.5;
object.speed.x = object.speed.x * (object.bounce * 0.5);
}
if (((object.position.z < 30) && (object.speed.z < 0)) && (!passed)) {
placeOnRacket();
if (!catcher.hitTest(object._x + _x, object._y + _y, true)) {
ball.position.x = safex;
ball.position.y = safey;
ball.position.z = safez;
passed = true;
} else {
sounds.gotoandplay("whack");
gravity = 11;
score++;
if (best < score) {
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);
}
}
if (object.position.z < 14) {
ball.gravity = false;
sounds.gotoandplay("past");
racket._visible = false;
Mouse.show();
resetButton._visible = true;
object._visible = false;
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 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 (!((((530 < _root._xmouse) || (_root._xmouse < 80)) && (330 < _root._ymouse)) || (!playing))) {
Mouse.hide();
} else {
Mouse.show();
}
positionRacket();
translate(tennisball);
redraw(tennisball);
};
playing = true;
best = 0;
newGame();
Instance of Symbol 13 MovieClip "ball" in Symbol 8 MovieClip Frame 1
onClipEvent (load) {
}
Instance of Symbol 16 MovieClip "shadow" in Symbol 8 MovieClip Frame 1
onClipEvent (load) {
location = new Object();
position = new Object();
}
Symbol 59 Button
on (release) {
nextFrame();
}