Frame 1
loading = ("LOAD\n" + Math.floor((100 * getBytesLoaded()) / getBytesTotal())) + "%";
Frame 2
if (getBytesLoaded() < getBytesTotal()) {
gotoAndPlay (1);
}
Frame 3
stop();
ballFlag = 0;
ballYPos = 9;
ballY = 0;
ballX = 1;
score1 = 0;
score2 = 0;
Frame 4
if (Key.isDown(27)) {
getURL ("pong.html");
}
if (Key.isDown(38)) {
if (bat1._y > 0) {
bat1._y--;
}
}
if (Key.isDown(40)) {
if (bat1._y < 15) {
bat1._y++;
}
}
ballYPos = ballYPos + ballY;
ball._y = Math.floor(ballYPos);
if ((ball._y < 0) || (ball._y >= 17)) {
ballY = -ballY;
ball._y = ball._y + ballY;
}
ball._x = ball._x + ballX;
if (Math.random() > 0.4) {
if (Math.abs((bat2._y - ball._y) + 1) > 1) {
if ((ball._y - bat2._y) > 1) {
bat2._y++;
} else {
bat2._y--;
}
}
}
if (ballX > 0) {
if (bat2.hitTest(ball._x, ball._y, 0)) {
blip1.gotoAndPlay(2);
ballX = -1;
ballY = (Math.random() * 1.5) - 0.75;
} else if (ball._x > 17) {
win.gotoAndPlay(2);
score1++;
ballYPos = Math.floor(Math.random() * 17);
ballY = (Math.random() * 1.5) - 0.75;
ball._x = 0;
ballX = 1;
}
} else if (bat1.hitTest(ball._x, ball._y, 0)) {
blip2.gotoAndPlay(2);
ballX = 1;
ballY = (Math.random() * 1.5) - 0.75;
} else if (ball._x < 0) {
fail.gotoAndPlay(2);
score2++;
ballYPos = Math.floor(Math.random() * 17);
ballY = (Math.random() * 1.5) - 0.75;
ball._x = 17;
ballX = -1;
}
if (score1 > 9) {
gotoAndPlay ("win");
}
if (score2 > 9) {
gotoAndPlay ("lose");
}
Frame 5
gotoAndPlay ("loop");
Frame 6
if (Key.isDown(27)) {
getURL ("pong.html");
}
Frame 7
gotoAndPlay ("win");
Frame 8
if (Key.isDown(27)) {
getURL ("pong.html");
}
Frame 9
gotoAndPlay ("lose");
Symbol 7 Button
on (release) {
_parent.gotoAndPlay("loop");
}
Symbol 12 MovieClip Frame 134
stop();
Symbol 14 MovieClip Frame 1
stop();
Symbol 16 MovieClip Frame 1
stop();
Symbol 18 MovieClip Frame 1
stop();
Symbol 20 MovieClip Frame 1
stop();
Symbol 24 Button
on (release) {
getURL ("pong.html");
}