Frame 1
scorelimit = 15;
tellTarget ("timer") {
play();
};
Frame 2
ifFrameLoaded (85) {
gotoAndPlay (5);
}
Frame 4
gotoAndPlay (1);
Frame 5
ifFrameLoaded (105) {
gotoAndPlay (10);
}
Frame 9
gotoAndPlay (5);
Frame 10
ifFrameLoaded (121) {
gotoAndPlay (15);
}
Frame 14
gotoAndPlay (10);
Frame 15
ifFrameLoaded (122) {
gotoAndPlay (20);
}
Frame 19
gotoAndPlay (15);
Frame 20
ifFrameLoaded (123) {
gotoAndPlay (25);
}
Frame 24
gotoAndPlay (20);
Frame 25
ifFrameLoaded (124) {
gotoAndPlay (30);
}
Frame 29
gotoAndPlay (25);
Frame 30
ifFrameLoaded (125) {
gotoAndPlay (35);
}
Frame 34
gotoAndPlay (30);
Frame 35
ifFrameLoaded (126) {
gotoAndPlay (40);
}
Frame 39
gotoAndPlay (35);
Frame 40
ifFrameLoaded (127) {
gotoAndPlay (45);
}
Frame 44
gotoAndPlay (40);
Frame 45
ifFrameLoaded (131) {
gotoAndPlay (50);
}
Frame 49
gotoAndPlay (45);
Frame 50
ifFrameLoaded (136) {
gotoAndPlay (55);
}
Frame 54
gotoAndPlay (50);
Frame 55
ifFrameLoaded (158) {
gotoAndPlay (121);
}
Frame 66
scorelimit = 15;
Frame 120
stop();
Frame 121
stop();
crowd.setVolume(100);
Instance of Symbol 54 MovieClip "ball" in Frame 121
onClipEvent (load) {
_root.directionX = random(2) + 1;
_root.directionY = random(2) + 1;
_root.ballSpeedX = random(3) + 3;
_root.ballSpeedY = random(3) + 1;
}
Instance of Symbol 56 MovieClip "leftPaddle" in Frame 121
onClipEvent (mouseDown) {
startDrag ("_root.leftPaddle", false, 33, 30, 33, 220);
}
onClipEvent (keyDown) {
stopDrag();
}
Frame 122
computerScore = 0;
playerScore = 0;
spong = new Sound();
spong.attachSound("tennis");
crowd = new Sound();
crowd.attachSound("crowdsmall");
Frame 123
if (5 < (computerScore - playerScore)) {
paddleSpeed = 3;
}
if ((5 >= (computerScore - playerScore)) && ((computerScore - playerScore) >= 0)) {
paddleSpeed = 3;
}
if ((5 >= (playerScore - computerScore)) && ((playerScore - computerScore) >= 0)) {
paddleSpeed = 4;
}
if (3 < (playerScore - computerScore)) {
paddleSpeed = 6;
}
ballX2 = _root.ball._x + 5;
ballY2 = _root.ball._y;
rightPaddleTop = _root.rightPaddle._y + 18;
rightPaddleBottom = _root.rightPaddle._y - 18;
rightPaddleX = (_root.rightPaddle._x - 6) - ballSpeedX;
ballX = _root.ball._x - 5;
leftPaddleTop = _root.leftPaddle._y + 25;
leftPaddleBottom = _root.leftPaddle._y - 25;
leftPaddleX = (_root.leftPaddle._x + 6) + ballSpeedX;
ballValue = _root.ball._y;
if (_root.ball._x < 20) {
computerScore = computerScore + 1;
setProperty("_root.ball", _x , "250");
_root.directionX = random(2) + 1;
_root.directionY = random(2) + 1;
_root.ballSpeedX = random(3) + 3;
_root.ballSpeedY = random(3) + 1;
gotoAndPlay (124);
}
if (480 < _root.ball._x) {
playerScore = playerScore + 1;
setProperty("_root.ball", _x , "250");
_root.directionX = random(2) + 1;
_root.directionY = random(2) + 1;
_root.ballSpeedX = random(3) + 3;
_root.ballSpeedY = random(3) + 1;
gotoAndPlay (124);
crowd.start();
}
if (ballY2 < _root.rightPaddle._y) {
setProperty("_root.rightPaddle", _y , _root.rightPaddle._y - paddleSpeed);
}
if (_root.rightPaddle._y < ballY2) {
setProperty("_root.rightPaddle", _y , _root.rightPaddle._y + paddleSpeed);
}
if ((((_root.leftPaddle._x < ballX) && (ballX < leftPaddleX)) && (_root.ball._y < leftPaddleTop)) && (leftPaddleBottom < _root.ball._y)) {
spong.start();
_root.directionX = 2;
if ((_root.leftPaddle._y + 6) >= ballValue) {
_root.ballSpeedY = random(4) + 2;
}
if (ballValue >= (_root.leftPaddle._y + 12)) {
_root.ballSpeedY = random(4) + 2;
}
if (ballSpeedX < 20) {
_root.ballSpeedX = _root.ballSpeedX + 0.5;
}
}
if ((((ballX2 < _root.rightPaddle._x) && (rightPaddleX < ballX2)) && (_root.ball._y < rightPaddleTop)) && (rightPaddleBottom < ballY2)) {
spong.start();
_root.directionX = 1;
if (ballSpeedX < 20) {
_root.ballSpeedX = _root.ballSpeedX + 0.5;
}
}
if (directionX == 2) {
setProperty("_root.ball", _x , _root.ball._x + _root.ballSpeedX);
}
if (directionX == 1) {
setProperty("_root.ball", _x , _root.ball._x - _root.ballSpeedX);
}
if (_root.ball._y < 22) {
_root.directionY = 2;
}
if (228 < _root.ball._y) {
_root.directionY = 1;
}
if (directionY == 2) {
setProperty("_root.ball", _y , _root.ball._y + _root.ballSpeedY);
}
if (directionY == 1) {
setProperty("_root.ball", _y , _root.ball._Y - _root.ballSpeedY);
}
Frame 124
ballX2 = _root.ball._x + 5;
ballY2 = _root.ball._y;
rightPaddleTop = _root.rightPaddle._y + 18;
rightPaddleBottom = _root.rightPaddle._y - 18;
rightPaddleX = (_root.rightPaddle._x - 6) - ballSpeedX;
ballX = _root.ball._x - 5;
leftPaddleTop = _root.leftPaddle._y + 25;
leftPaddleBottom = _root.leftPaddle._y - 25;
leftPaddleX = (_root.leftPaddle._x + 6) + ballSpeedX;
ballValue = _root.ball._y;
if (_root.ball._x < 20) {
computerScore = computerScore + 1;
setProperty("_root.ball", _x , "250");
_root.directionX = random(2) + 1;
_root.directionY = random(2) + 1;
_root.ballSpeedX = random(3) + 3;
_root.ballSpeedY = random(3) + 1;
gotoAndPlay (125);
}
if (480 < _root.ball._x) {
playerScore = playerScore + 1;
setProperty("_root.ball", _x , "250");
_root.directionX = random(2) + 1;
_root.directionY = random(2) + 1;
_root.ballSpeedX = random(3) + 3;
_root.ballSpeedY = random(3) + 1;
gotoAndPlay (125);
crowd.start();
}
if (ballY2 < _root.rightPaddle._y) {
setProperty("_root.rightPaddle", _y , _root.rightPaddle._y - paddleSpeed);
}
if (_root.rightPaddle._y < ballY2) {
setProperty("_root.rightPaddle", _y , _root.rightPaddle._y + paddleSpeed);
}
if ((((_root.leftPaddle._x < ballX) && (ballX < leftPaddleX)) && (_root.ball._y < leftPaddleTop)) && (leftPaddleBottom < _root.ball._y)) {
spong.start();
_root.directionX = 2;
if ((_root.leftPaddle._y + 6) >= ballValue) {
_root.ballSpeedY = random(4) + 2;
}
if (ballValue >= (_root.leftPaddle._y + 12)) {
_root.ballSpeedY = random(4) + 2;
}
if (ballSpeedX < 20) {
_root.ballSpeedX = _root.ballSpeedX + 0.5;
}
}
if ((((ballX2 < _root.rightPaddle._x) && (rightPaddleX < ballX2)) && (_root.ball._y < rightPaddleTop)) && (rightPaddleBottom < ballY2)) {
spong.start();
_root.directionX = 1;
if (ballSpeedX < 20) {
_root.ballSpeedX = _root.ballSpeedX + 0.5;
}
}
if (directionX == 2) {
setProperty("_root.ball", _x , _root.ball._x + _root.ballSpeedX);
}
if (directionX == 1) {
setProperty("_root.ball", _x , _root.ball._x - _root.ballSpeedX);
}
if (_root.ball._y < 22) {
_root.directionY = 2;
}
if (228 < _root.ball._y) {
_root.directionY = 1;
}
if (directionY == 2) {
setProperty("_root.ball", _y , _root.ball._y + _root.ballSpeedY);
}
if (directionY == 1) {
setProperty("_root.ball", _y , _root.ball._Y - _root.ballSpeedY);
}
gotoAndPlay (125);
Frame 125
stop();
if ((playerScore == scorelimit) or (computerScore == scorelimit)) {
gotoAndPlay (126);
} else {
gotoAndPlay (123);
}
Frame 126
if (computerScore < playerScore) {
gotoAndPlay (127);
} else {
gotoAndPlay (158);
}
Frame 127
tellTarget ("winner") {
play();
};
Frame 157
gotoAndPlay (141);
Frame 158
crowd.setVolume(90);
Frame 161
crowd.setVolume(80);
Frame 164
crowd.setVolume(70);
Frame 167
crowd.setVolume(60);
Frame 170
crowd.setVolume(50);
Frame 173
crowd.setVolume(40);
Frame 176
crowd.setVolume(30);
Frame 179
crowd.setVolume(20);
Frame 182
crowd.setVolume(10);
Frame 185
crowd.setVolume(0);
Frame 188
stop();
Symbol 8 MovieClip Frame 39
gotoAndPlay (1);
Symbol 32 Button
on (release) {
gotoAndPlay (121);
}
Symbol 66 Button
on (release) {
gotoAndPlay (122);
}
Symbol 87 Button
on (release) {
gotoAndPlay (121);
}