Frame 3
startM.onRelease = function () {
stopAllSounds();
gotoAndPlay (5);
};
stop();
Frame 5
stop();
Frame 6
stop();
goagain.onRelease = function () {
stopAllSounds();
gotoAndPlay ("starta");
};
Frame 7
stop();
goagain.onRelease = function () {
stopAllSounds();
gotoAndPlay ("starta");
};
Symbol 17 MovieClip Frame 1
function preloadFunction() {
bytesLoaded = _parent.getBytesLoaded();
bytesTotal = _parent.getBytesTotal();
percentage = Math.round((bytesLoaded / bytesTotal) * 100);
if (bytesLoaded >= bytesTotal) {
_parent.play();
clearInterval(millisecs);
}
progressBar._xscale = percentage;
}
_parent.stop();
millisecs = setInterval(preloadFunction, 10);
Symbol 23 MovieClip Frame 1887
stop();
Symbol 37 MovieClip Frame 1
var game = {};
game.ball = {};
game.lpaddle = {};
game.rpaddle = {};
game.getkey = key.getCode();
game.lpaddle.clip = left_Paddle;
game.lpaddle.x = 0;
game.ball.radius = 14.5;
game.width = 600;
game.height = 300;
game.lpaddle.y = 80;
game.lpaddle.width = 22.9;
game.lpaddle.height = 108.3;
game.rpaddle.clip = right_Paddle;
game.rpaddle.x = 577.5;
game.rpadde.y = 80;
game.rpaddle.width = 22.9;
game.rpaddle.height = 108.3;
game.rpaddle.ycenter = right_Paddle._y + 54.15;
game.ball.clip = ball1;
game.ball.x = 295.6;
game.ball.y = 145.1;
game.ball.xmov = -5;
game.ball.ymov = -5;
game.ball.radius = 14.5;
game.ball.rtx = (game.ball.x = game.ball.x + game.ball.radius);
game.ball.bty = (game.ball.y = game.ball.y + game.ball.radius);
game.top = 0;
game.bottom = 300;
game.lbound = 0;
game.rbound = 600;
game.lpoints = 0;
game.rpoints = 0;
goodpoints = new Sound();
badpoints = new Sound();
paddlehits = new Sound();
blarg1 = (Number = 0);
blarg2 = (Number = 0);
game.resetpoints = function () {
game.lpoints = a;
game.rpoints = b;
};
game.setTempPosition = function () {
this.ball.tempx = this.ball.x + this.ball.xmov;
this.ball.tempy = this.ball.y + this.ball.ymov;
};
game.AI = function () {
if (game.ball.y >= 150) {
if ((right_Paddle._y < game.ball.tempy) && (right_Paddle._y <= 190)) {
right_Paddle._y = right_Paddle._y + 10;
}
if ((right_Paddle._y > game.ball.tempy) && (right_Paddle._y >= 5)) {
right_Paddle._y = right_Paddle._y - 10;
}
} else if (game.ball.y <= 150) {
if (((right_Paddle._y + game.rpaddle.height) < game.ball.tempy) && (right_Paddle._y <= 190)) {
right_Paddle._y = right_Paddle._y + 10;
}
if (((right_Paddle._y + game.rpaddle.height) > game.ball.tempy) && (right_Paddle._y >= 5)) {
right_Paddle._y = right_Paddle._y - 10;
}
}
};
game.checkForWalls = function () {
if (this.ball.tempy < 0) {
this.ball.tempy = 0;
this.ball.ymov = this.ball.ymov * -1;
} else if ((this.ball.tempy + this.ball.radius) > this.height) {
this.ball.tempy = this.height - this.ball.radius;
this.ball.ymov = this.ball.ymov * -1;
}
};
game.paddleCollisions = function () {
if ((((this.ball.tempx < (this.lpaddle.x + this.lpaddle.width)) && ((this.ball.tempx + (this.ball.radius / 2)) > this.lpaddle.x)) && ((this.ball.tempy + (this.ball.radius / 2)) > this.lpaddle.y)) && (this.ball.tempy < (this.lpaddle.y + this.lpaddle.height))) {
this.ball.tempx = this.lpaddle.x + this.lpaddle.width;
this.ball.xmov = this.ball.xmov * -1;
this.ball.x = 22.9;
game.IncreaseSpeed();
}
if ((((this.ball.tempx < (this.rpaddle.x + this.rpaddle.width)) && ((this.ball.tempx + (this.ball.radius / 2)) > this.rpaddle.x)) && ((this.ball.tempy + (this.ball.radius / 2)) > this.rpaddle.y)) && (this.ball.tempy < (this.rpaddle.y + this.rpaddle.height))) {
this.ball.tempx = this.rpaddle.x - this.ball.radius;
this.ball.xmov = this.ball.xmov * -1;
this.ball.x = 554.6;
game.IncreaseSpeed();
}
};
game.drawBall = function () {
this.ball.x = this.ball.tempx;
this.ball.y = this.ball.tempy;
ball1._x = this.ball.x;
ball1._y = this.ball.y;
};
game.IncreaseSpeed = function () {
this.ball.xmov = this.ball.xmov * 1.1;
this.ball.ymov = this.ball.ymov * 1.1;
};
game.paddleMovement = function () {
game.AI();
if ((this.getkey = "<Down>" && ((lpaddle.y + 108.3) <= 295))) {
left_Paddle._y = left_Paddle._y + 5;
} else if ((this.getkey = "<Up>" && (lpaddle.y >= 5))) {
left_Paddle._y = left_Paddle._y - 5;
}
};
game.checkForPoints = function () {
if (this.ball.x < this.lbound) {
badpoints.attachSound("badpoint");
badpoints.start();
blarg2 = blarg2 + 1;
ball1._x = 295.6;
ball1._y = 145.1;
this.ball.x = 295.6;
this.ball.y = 145.1;
this.ball.xmov = 6;
this.ball.ymov = 6;
} else if (this.ball.x > this.rbound) {
goodpoints.attachSound("goodpoint");
goodpoints.start();
blarg1 = blarg1 + 1;
ball1._x = 295.6;
this.ball.x = 295.6;
this.ball.y = 145.1;
this.ball.xmov = 6;
this.ball.ymov = 6;
}
};
game.pcol2 = function () {
if (ball1.hitTest(left_Paddle)) {
paddlehits.attachSound("paddlehit");
paddlehits.start();
this.ball.xmov = this.ball.xmov * -1;
this.IncreaseSpeed();
}
if (ball1.hitTest(right_Paddle)) {
paddlehits.attachSound("paddlehit");
paddlehits.start();
this.ball.xmov = this.ball.xmov * -1;
this.IncreaseSpeed();
}
};
game.checkforwin = function () {
if (blarg2 >= 10) {
stopAllSounds();
_parent.gotoAndPlay("youlose");
} else if (blarg1 >= 10) {
stopAllSounds();
_parent.gotoAndPlay("youwin");
}
};
this.onEnterFrame = function () {
game.pcol2();
game.setTempPosition();
game.checkForWalls();
game.drawBall();
game.checkForPoints();
game.resetpoints();
game.checkforwin();
game.AI();
};
_root.onEnterFrame = function () {
game.AI();
if (Key.isDown(38) && (left_Paddle._y >= 5)) {
left_Paddle._y = left_Paddle._y - 20;
} else if (Key.isDown(40) && (left_Paddle._y <= 191.7)) {
left_Paddle._y = left_Paddle._y + 20;
} else if (Key.isDown(16) && (left_Paddle._y >= 5)) {
left_Paddle._y = left_Paddle._y - 20;
} else if (Key.isDown(17) && (left_Paddle._y <= 191.7)) {
left_Paddle._y = left_Paddle._y + 20;
}
};
Symbol 41 MovieClip Frame 2
stop();