Symbol 16 Button
on (release) {
gotoAndStop ("StartGame");
}
Symbol 23 Button
on (release) {
gotoAndStop ("HighScores");
}
Symbol 26 MovieClip Frame 1
var gf = (new flash.filters.GlowFilter(16776960, 100, 11, 11, 1.11, 3));
onEnterFrame = function () {
F = int(++F);
gf.strength = (1 - (((((s = ((((s = (F / 177) % 1)) < 0.5) ? (s * 2) : (2 - (s * 2))))) * s) * s) * s)) * 1.11;
gf.blurX = (((((s = (F / 211) % 1)) < 0.5) ? (s * 2) : (2 - (s * 2))) * 6) + 8;
gf.blurY = (((((s = (F / 233) % 1)) < 0.5) ? (s * 2) : (2 - (s * 2))) * 6) + 8;
gf.blurY = (((((s = (F / 233) % 1)) < 0.5) ? (s * 2) : (2 - (s * 2))) * 6) + 8;
txt.filters = [gf];
};
onEnterFrame();
Symbol 29 Button
on (release) {
gotoAndStop ("Start");
}
Symbol 32 Button
on (release) {
gotoAndStop ("Start");
i = 0;
while (i < 15) {
this["sf" + i].removeMovieClip();
i++;
}
}
Symbol 37 MovieClip Frame 1
function Load() {
wleft = _parent.world.left;
wright = _parent.world.right;
wtop = _parent.world.top;
wbottom = _parent.world.bottom;
wdepth = _parent.world.depth;
wl = wleft;
wr = wright;
wt = wtop;
wb = wbottom;
wx = ((wright - wleft) / 2) + wleft;
wy = ((wbottom - wtop) / 2) + wtop;
speed = _parent.world.speed;
myPos = new Object();
myPos.x = wl;
myPos.y = wt;
myPos.z = 0;
VisPos = new Object();
VisPos.x = myPos.x;
VisPos.y = myPos.y;
mySpeed = new Object();
mySpeed.x = speed;
mySpeed.y = speed;
mySpeed.z = speed;
m = 100;
f = 0.8;
if (!swidth) {
swidth = _width;
}
if (!sheight) {
sheight = _height;
}
_x = myPos.x;
_y = myPos.y;
varA = 31.066017;
_width = (swidth * ((90 - ((Math.atan(myPos.z / varA) * 180) / Math.PI)) / 90));
_height = (sheight * ((90 - ((Math.atan(myPos.z / varA) * 180) / Math.PI)) / 90));
growshrink = 0;
}
function Ef() {
myPos.z = _parent.ballPosZ;
if (myPos.z < 0) {
myPos.z = 0;
}
VisPos.x = wx - ((wx - myPos.x) * ((90 - ((Math.atan(myPos.z / varA) * 180) / Math.PI)) / 90));
VisPos.y = wy - ((wy - myPos.y) * ((90 - ((Math.atan(myPos.z / varA) * 180) / Math.PI)) / 90));
_x = VisPos.x;
_y = VisPos.y;
_alpha = ((myPos.z - 100) / -1);
_width = (swidth * ((90 - ((Math.atan(myPos.z / varA) * 180) / Math.PI)) / 90));
_height = (sheight * ((90 - ((Math.atan(myPos.z / varA) * 180) / Math.PI)) / 90));
}
Symbol 44 MovieClip Frame 1
function Load() {
skillFactor = _parent.world.skillFactor;
wleft = _parent.world.left;
wright = _parent.world.right;
wtop = _parent.world.top;
wbottom = _parent.world.bottom;
wdepth = _parent.world.depth;
wl = wleft;
wr = wright;
wt = wtop;
wb = wbottom;
wx = ((wright - wleft) / 2) + wleft;
wy = ((wbottom - wtop) / 2) + wtop;
myPos = new Object();
myPos.x = wx;
myPos.y = wy;
myPos.z = 75;
oldPos = new Object();
oldPos.x = myPos.x;
oldPos.y = myPos.y;
VisPos = new Object();
VisPos.x = myPos.x;
VisPos.y = myPos.y;
mySpeed = new Object();
mySpeed.x = 0;
mySpeed.y = 0;
osx = 0;
osy = 0;
m = 100;
f = 0.8;
if (!swidth) {
swidth = _width;
}
if (!sheight) {
sheight = _height;
}
varA = 31.066017;
VisPos.x = wx - ((wx - myPos.x) * ((90 - ((Math.atan(myPos.z / varA) * 180) / Math.PI)) / 90));
VisPos.y = wy - ((wy - myPos.y) * ((90 - ((Math.atan(myPos.z / varA) * 180) / Math.PI)) / 90));
_x = VisPos.x;
_y = VisPos.y;
_width = (swidth * ((90 - ((Math.atan(myPos.z / varA) * 180) / Math.PI)) / 90));
_height = (sheight * ((90 - ((Math.atan(myPos.z / varA) * 180) / Math.PI)) / 90));
xsMax = 0;
ysMax = 0;
}
function Ef() {
var _local2;
bPosX = _parent.ballPosX;
bPosY = _parent.ballPosY;
bDirZ = _parent.ballDirZ;
if (0 < bDirZ) {
myTarX = bPosX;
myTarY = bPosY;
_local2 = LOG(1 / skillFactor);
myPos.x = myPos.x - ((myPos.x - myTarX) * _local2);
myPos.y = myPos.y - ((myPos.y - myTarY) * _local2);
xsMax = 240 * LOG(1 / skillFactor);
ysMax = 160 * LOG(1 / skillFactor);
} else {
myTarX = wx;
myTarY = wy;
_local2 = LOG(0.0666666666666667);
myPos.x = myPos.x - ((myPos.x - myTarX) * _local2);
myPos.y = myPos.y - ((myPos.y - myTarY) * _local2);
xsMax = 240 * LOG(0.0666666666666667);
ysMax = 160 * LOG(0.0666666666666667);
}
if ((myPos.y - (sheight / 2)) < wtop) {
myPos.y = wtop + (sheight / 2);
} else if (wbottom < (myPos.y + (sheight / 2))) {
myPos.y = wbottom - (sheight / 2);
}
if ((myPos.x - (swidth / 2)) < wleft) {
myPos.x = wleft + (swidth / 2);
} else if (wright < (myPos.x + (swidth / 2))) {
myPos.x = wright - (swidth / 2);
}
VisPos.x = wx - ((wx - myPos.x) * ((90 - ((Math.atan(myPos.z / varA) * 180) / Math.PI)) / 90));
VisPos.y = wy - ((wy - myPos.y) * ((90 - ((Math.atan(myPos.z / varA) * 180) / Math.PI)) / 90));
_x = VisPos.x;
_y = VisPos.y;
_width = (swidth * ((90 - ((Math.atan(myPos.z / varA) * 180) / Math.PI)) / 90));
_height = (sheight * ((90 - ((Math.atan(myPos.z / varA) * 180) / Math.PI)) / 90));
osx = mySpeed.x;
osy = mySpeed.y;
mySpeed.x = myPos.x - oldPos.x;
mySpeed.y = myPos.y - oldPos.y;
oldPos.x = myPos.x;
oldPos.y = myPos.y;
_parent.world.enemyPosX = myPos.x;
_parent.world.enemyPosY = myPos.y;
_parent.world.enemySpeedX = mySpeed.x;
_parent.world.enemySpeedY = mySpeed.y;
if (_p == 1) {
_p = 2;
} else if (_p == 2) {
nextFrame();
}
}
stop();
Symbol 44 MovieClip Frame 38
gotoAndStop (1);
_p = 0;
Symbol 44 MovieClip Frame 75
gotoAndStop (1);
_p = 0;
Symbol 44 MovieClip Frame 112
gotoAndStop (1);
_p = 0;
Symbol 44 MovieClip Frame 149
gotoAndStop (1);
_p = 0;
Symbol 44 MovieClip Frame 186
gotoAndStop (1);
_p = 0;
Symbol 47 MovieClip Frame 1
function Load() {
this.onMouseDown = function () {
Hit();
};
gotoAndStop (1);
ballStop = 0;
wleft = _parent.world.left;
wright = _parent.world.right;
wtop = _parent.world.top;
wbottom = _parent.world.bottom;
wdepth = _parent.world.depth - _parent.world.speed;
wl = wleft;
wr = wright;
wt = wtop;
wb = wbottom;
wx = ((wright - wleft) / 2) + wleft;
wy = ((wbottom - wtop) / 2) + wtop;
speed = _parent.world.speed;
curveAmount = _parent.world.curveAmount * S_MUL;
curveDecay = 1.004;
myPos = new Object();
myPos.x = wx;
myPos.y = wy;
myPos.z = 0;
myCurve = new Object();
myCurve.x = 0;
myCurve.y = 0;
VisPos = new Object();
VisPos.x = myPos.x;
VisPos.y = myPos.y;
mySpeed = new Object();
mySpeed.x = 0;
mySpeed.y = 0;
mySpeed.z = 0;
m = 100;
f = 0.8;
if (!swidth) {
swidth = _width;
}
_x = myPos.x;
_y = myPos.y;
varA = 31.066017;
_width = (swidth * ((90 - ((Math.atan(myPos.z / varA) * 180) / Math.PI)) / 90));
_height = (swidth * ((90 - ((Math.atan(myPos.z / varA) * 180) / Math.PI)) / 90));
growshrink = 0;
bstring = [null, "Curve Bonus!", "Super Curve Bonus!", null, "Accuracy Bonus!", "Accuracy + Curve Bonus!", "Accuracy + Super Curve Bonus!", null];
}
function Ef() {
if (ballStop != 1) {
got_acc = 0;
got_cur = 0;
pSpeedX = _parent.world.paddleSpeedX;
pSpeedY = _parent.world.paddleSpeedY;
pPosX = _parent.world.paddlePosX;
pPosY = _parent.world.paddlePosY;
eSpeedX = _parent.world.enemySpeedX;
eSpeedY = _parent.world.enemySpeedY;
ePosX = _parent.world.enemyPosX;
ePosY = _parent.world.enemyPosY;
mySpeed.x = mySpeed.x + myCurve.x;
mySpeed.y = mySpeed.y + myCurve.y;
myPos.z = myPos.z + (mySpeed.z / S_MUL);
myPos.x = myPos.x + (mySpeed.x / S_MUL);
myPos.y = myPos.y - (mySpeed.y / S_MUL);
if (myCurve.x != 0) {
myCurve.x = myCurve.x / EXP(curveDecay);
}
if (myCurve.y != 0) {
myCurve.y = myCurve.y / EXP(curveDecay);
}
radius = swidth / 2;
if ((myPos.y - radius) < wtop) {
myPos.y = wtop + radius;
myCurve.y = myCurve.y / (((curveDecay - 1) * 50) + 1);
mySpeed.y = -mySpeed.y;
_parent.wallBounce2.start(0, 1);
} else if ((myPos.y + radius) > wbottom) {
myPos.y = wbottom - radius;
myCurve.y = myCurve.y / (((curveDecay - 1) * 50) + 1);
mySpeed.y = -mySpeed.y;
_parent.wallBounce2.start(0, 1);
}
if ((myPos.x - radius) < wleft) {
myPos.x = wleft + radius;
myCurve.x = myCurve.x / (((curveDecay - 1) * 50) + 1);
mySpeed.x = -mySpeed.x;
_parent.wallBounce1.start(0, 1);
} else if ((myPos.x + radius) > wright) {
myPos.x = wright - radius;
myCurve.x = myCurve.x / (((curveDecay - 1) * 50) + 1);
mySpeed.x = -mySpeed.x;
_parent.wallBounce1.start(0, 1);
}
if (myPos.z > wdepth) {
if (hitTest(_parent.enemyPaddle)) {
if ((Math.abs(myPos.x - ePosX) < 14) && (Math.abs(myPos.y - ePosY) < 10)) {
GTAP(_parent.enemyPaddle, "C");
} else if (myPos.x < ePosX) {
if (myPos.y < ePosY) {
GTAP(_parent.enemyPaddle, "UL");
} else {
GTAP(_parent.enemyPaddle, "BL");
}
} else if (myPos.y < ePosY) {
GTAP(_parent.enemyPaddle, "UR");
} else {
GTAP(_parent.enemyPaddle, "BR");
}
myPos.z = wdepth;
myCurve.x = (FIX(GS(_parent.enemyPaddle.osx, eSpeedX), _parent.enemyPaddle.xsMax, 1) * S_MUL) / curveAmount;
myCurve.y = ((-FIX(GS(_parent.enemyPaddle.osy, eSpeedY), _parent.enemyPaddle.ysMax, 1)) * S_MUL) / curveAmount;
SA("ex", myCurve.x);
SA("ey", myCurve.y);
mySpeed.z = -mySpeed.z;
_parent.ePaddleBounce.start(0, 1);
} else {
mySpeed.x = 0;
mySpeed.y = 0;
mySpeed.z = 0;
myCurve.x = 0;
myCurve.y = 0;
_parent.FUN = _parent.Ball_Is_Red_Play_1;
_parent.TIME = 1;
_parent.world.enemyLives = _parent.world.enemyLives - 1;
tellTarget (_parent.enemyLives) {
gotoAndPlay("L" + _parent.world.enemyLives);
};
_parent.missSound.start(0, 1);
ballStop = 1;
}
} else if ((myPos.z < 0) && (mySpeed.z < 0)) {
if (hitTest(_parent.userPaddle)) {
if ((Math.abs(myPos.x - pPosX) < 14) && (Math.abs(myPos.y - pPosY) < 10)) {
GTAP(_parent.userPaddle, "C");
got_acc = 1;
_parent.world.score = _parent.world.score + _parent.world.accuracyBonus;
_parent.world.accuracyBonus = _parent.world.accuracyBonus - _parent.world.accuracyDegrade;
if (_parent.world.accuracyBonus < 0) {
_parent.world.accuracyBonus = 0;
}
} else if (myPos.x < pPosX) {
if (myPos.y < pPosY) {
GTAP(_parent.userPaddle, "UL");
} else {
GTAP(_parent.userPaddle, "BL");
}
} else if (myPos.y < pPosY) {
GTAP(_parent.userPaddle, "UR");
} else {
GTAP(_parent.userPaddle, "BR");
}
myPos.z = 0;
myCurve.x = ((-FIX(GS(_parent.userPaddle.osx, pSpeedX), 165 / S_MUL, 1)) * S_MUL) / curveAmount;
myCurve.y = (FIX(GS(_parent.userPaddle.osy, pSpeedY), 115 / S_MUL, 1) * S_MUL) / curveAmount;
SA("ux", myCurve.x * 4);
SA("uy", myCurve.y * 4);
mySpeed.z = -mySpeed.z;
_parent.world.score = _parent.world.score + _parent.world.hitScore;
_parent.world.hitScore = _parent.world.hitScore - _parent.world.hitDegrade;
if (_parent.world.hitScore < 0) {
_parent.world.hitScore = 0;
}
if ((Math.abs(myCurve.x) > 0.1) && (Math.abs(myCurve.y) > 0.1)) {
got_cur = 2;
_parent.world.score = _parent.world.score + _parent.world.superCurveBonus;
_parent.world.superCurveBonus = _parent.world.superCurveBonus - _parent.world.superCurveDegrade;
if (_parent.world.superCurveBonus < 0) {
_parent.world.superCurveBonus = 0;
}
} else if (Math.max(Math.abs(myCurve.x), Math.abs(myCurve.y)) > 0.05) {
got_cur = 1;
_parent.world.score = _parent.world.score + _parent.world.curveBonus;
_parent.world.curveBonus = _parent.world.curveBonus - _parent.world.curveDegrade;
if (_parent.world.curveBonus < 0) {
_parent.world.curveBonus = 0;
}
}
_parent.score = _parent.world.score;
_parent.pPaddleBounce.start(0, 1);
} else {
mySpeed.x = 0;
mySpeed.y = 0;
mySpeed.z = 0;
myCurve.x = 0;
myCurve.y = 0;
_parent.FUN = _parent.Ball_Is_Red_Play_1;
_parent.TIME = 1;
_parent.world.playerLives = _parent.world.playerLives - 1;
tellTarget (_parent.playerLives) {
gotoAndPlay("L" + _parent.world.playerLives);
};
_parent.world.hitScore = 100;
_parent.world.curveBonus = 50;
_parent.world.superCurveBonus = 150;
_parent.world.accuracyBonus = 100;
ballStop = 1;
_parent.missSound.start(0, 1);
}
}
VisPos.x = wx - ((wx - myPos.x) * ((90 - ((Math.atan(myPos.z / varA) * 180) / Math.PI)) / 90));
VisPos.y = wy - ((wy - myPos.y) * ((90 - ((Math.atan(myPos.z / varA) * 180) / Math.PI)) / 90));
_x = VisPos.x;
_y = VisPos.y;
_width = (swidth * ((90 - ((Math.atan(myPos.z / varA) * 180) / Math.PI)) / 90));
_height = (swidth * ((90 - ((Math.atan(myPos.z / varA) * 180) / Math.PI)) / 90));
_parent.ballPosX = myPos.x;
_parent.ballPosY = myPos.y;
_parent.ballPosZ = myPos.z;
_parent.ballDirX = mySpeed.x;
_parent.ballDirY = mySpeed.y;
_parent.ballDirZ = mySpeed.z;
if ((mySpeed.z != 0) && (0 < _parent.world.bonusDisplay)) {
_parent.world.bonus = _parent.world.bonus - 1;
}
if (_parent.world.bonus < 0) {
_parent.world.bonus = 10 * S_MUL;
_parent.world.bonusDisplay = _parent.world.bonusDisplay - 25;
_parent.bonusScore = _parent.world.bonusDisplay;
}
if (got_acc + got_cur) {
_parent.bonus.bonus = bstring[(got_acc << 2) | got_cur];
_parent.bonus.gotoAndStop("bonus");
_parent.bonus._p = 1;
}
}
one_frame_passed = 1;
}
function Hit() {
if (((mySpeed.z == 0) && (myPos.z == 0)) && (one_frame_passed == 1)) {
got_acc = 0;
got_cur = 0;
if (hitTest(_parent.userPaddle)) {
if ((Math.abs(myPos.x - pPosX) < 14) && (Math.abs(myPos.y - pPosY) < 10)) {
GTAP(_parent.userPaddle, "C");
got_acc = 1;
_parent.world.score = _parent.world.score + _parent.world.accuracyBonus;
_parent.world.accuracyBonus = _parent.world.accuracyBonus - _parent.world.accuracyDegrade;
if (_parent.world.accuracyBonus < 0) {
_parent.world.accuracyBonus = 0;
}
} else if (myPos.x < pPosX) {
if (myPos.y < pPosY) {
GTAP(_parent.userPaddle, "UL");
} else {
GTAP(_parent.userPaddle, "BL");
}
} else if (myPos.y < pPosY) {
GTAP(_parent.userPaddle, "UR");
} else {
GTAP(_parent.userPaddle, "BR");
}
mySpeed.z = speed;
myCurve.x = ((-FIX(GS(_parent.userPaddle.osx, pSpeedX), 165 / S_MUL, 1.15)) * S_MUL) / curveAmount;
myCurve.y = (FIX(GS(_parent.userPaddle.osy, pSpeedY), 115 / S_MUL, 1.15) * S_MUL) / curveAmount;
SA("ux", myCurve.x * 4);
SA("uy", myCurve.y * 4);
if (Math.abs(myCurve.x) < 0.01) {
myCurve.x = ((pPosX < wx) ? 0.01 : -0.01) * S_MIL;
}
if (Math.abs(myCurve.y) < 0.01) {
myCurve.y = ((wy < pPosY) ? 0.01 : -0.01) * S_MIL;
}
if ((Math.abs(myCurve.x) > 0.1) && (Math.abs(myCurve.y) > 0.1)) {
got_cur = 2;
_parent.world.score = _parent.world.score + _parent.world.superCurveBonus;
_parent.world.superCurveBonus = _parent.world.superCurveBonus - _parent.world.superCurveDegrade;
if (_parent.world.superCurveBonus < 0) {
_parent.world.superCurveBonus = 0;
}
} else if (Math.max(Math.abs(myCurve.x), Math.abs(myCurve.y)) > 0.05) {
got_cur = 1;
_parent.world.score = _parent.world.score + _parent.world.curveBonus;
_parent.world.curveBonus = _parent.world.curveBonus - _parent.world.curveDegrade;
if (_parent.world.curveBonus < 0) {
_parent.world.curveBonus = 0;
}
}
_parent.score = _parent.world.score;
_parent.pPaddleBounce.start(0, 1);
}
if (got_acc + got_cur) {
_parent.bonus.bonus = bstring[(got_acc << 2) | got_cur];
_parent.bonus.gotoAndStop("bonus");
_parent.bonus._p = 1;
}
}
}
stop();
Symbol 49 MovieClip Frame 1
function Load() {
lagFactor = _parent.world.lagFactor;
wleft = _parent.world.left;
wright = _parent.world.right;
wtop = _parent.world.top;
wbottom = _parent.world.bottom;
wdepth = _parent.world.depth;
wl = wleft;
wr = wright;
wt = wtop;
wb = wbottom;
wx = ((wright - wleft) / 2) + wleft;
wy = ((wbottom - wtop) / 2) + wtop;
myPos = new Object();
myPos.x = wx;
myPos.y = wy;
_parent._xmouse = wx;
_parent._ymouse = wy;
myPos.z = 0;
oldPos = new Object();
oldPos.x = myPos.x;
oldPos.y = myPos.y;
mySpeed = new Object();
mySpeed.x = 0;
mySpeed.y = 0;
osx = 0;
osy = 0;
m = 100;
f = 0.8;
if (!swidth) {
swidth = _width;
}
if (!sheight) {
sheight = _height;
}
_x = myPos.x;
_y = myPos.y;
}
function Ef() {
myTarX = _parent._xmouse;
myTarY = _parent._ymouse;
var _local2 = LOG(0.666666666666667);
myPos.x = myPos.x - ((myPos.x - myTarX) * _local2);
myPos.y = myPos.y - ((myPos.y - myTarY) * _local2);
if ((myPos.y - (sheight / 2)) < wtop) {
myPos.y = wtop + (sheight / 2);
} else if (wbottom < (myPos.y + (sheight / 2))) {
myPos.y = wbottom - (sheight / 2);
}
if ((myPos.x - (swidth / 2)) < wleft) {
myPos.x = wleft + (swidth / 2);
} else if (wright < (myPos.x + (swidth / 2))) {
myPos.x = wright - (swidth / 2);
}
_x = myPos.x;
_y = myPos.y;
osx = mySpeed.x;
osy = mySpeed.y;
mySpeed.x = myPos.x - oldPos.x;
mySpeed.y = myPos.y - oldPos.y;
oldPos.x = myPos.x;
oldPos.y = myPos.y;
_parent.world.paddlePosX = myPos.x;
_parent.world.paddlePosY = myPos.y;
_parent.world.paddleSpeedX = mySpeed.x;
_parent.world.paddleSpeedY = mySpeed.y;
if (_p == 1) {
_p = 2;
} else if (_p == 2) {
nextFrame();
}
}
stop();
Symbol 49 MovieClip Frame 38
gotoAndStop (1);
_p = 0;
Symbol 49 MovieClip Frame 75
gotoAndStop (1);
_p = 0;
Symbol 49 MovieClip Frame 112
gotoAndStop (1);
_p = 0;
Symbol 49 MovieClip Frame 149
gotoAndStop (1);
_p = 0;
Symbol 49 MovieClip Frame 186
gotoAndStop (1);
_p = 0;
Symbol 55 MovieClip Frame 1
function Ef() {
if (_p == 1) {
_p = 2;
} else if (_p == 2) {
nextFrame();
}
}
stop();
Symbol 55 MovieClip Frame 130
_p = 0;
gotoAndStop (1);
Symbol 58 MovieClip Frame 5
stop();
Symbol 58 MovieClip Frame 10
stop();
Symbol 58 MovieClip Frame 15
stop();
Symbol 58 MovieClip Frame 20
stop();
Symbol 58 MovieClip Frame 25
stop();
Symbol 58 MovieClip Frame 30
stop();
Symbol 60 MovieClip Frame 5
stop();
Symbol 60 MovieClip Frame 10
stop();
Symbol 60 MovieClip Frame 15
stop();
Symbol 60 MovieClip Frame 20
stop();
Symbol 60 MovieClip Frame 25
stop();
Symbol 60 MovieClip Frame 30
stop();
Symbol 67 MovieClip Frame 1
stop();
Symbol 67 MovieClip Frame 11
mySO = SharedObject.getLocal("CB120");
scores = mySO.data.score;
if (!scores) {
gotoAndStop ("HS_Empty");
} else {
i = 0;
while (i < scores.length) {
sf = attachMovie("scoreField", "sf" + i, this.getNextHighestDepth());
sf._x = 102;
sf._y = 84 + (6.5 * i);
sf.l.text = scores[i][0];
sf.s.text = scores[i][1];
sf.d.text = scores[i][2];
i++;
}
}
Symbol 67 MovieClip Frame 16
function GAVG(arr) {
var _local3 = 0;
var _local1 = arr.length - 1;
while (_local1 >= 0) {
_local3 = _local3 + arr[_local1];
_local1--;
}
return(_local3 / arr.length);
}
function GMED(arr) {
if (arr.length) {
return(arr[int(arr.length / 2)]);
}
}
function onEnterFrame() {
var _local2 = getTimer();
var _local3 = _local2 - (FRAME * 100);
if (MS < _local3) {
MS = _local3;
}
while (MS < _local2) {
MS = MS + FRAME;
Game_Loop();
}
var _local1 = 1;
while (_local1 <= 10) {
if (Key.isDown(48 + _local1)) {
world.level = _local1;
world.playerLives = 5;
world.enemyLives = 3;
SetLevel();
Level_Intro();
break;
}
_local1++;
}
}
function Game_Loop() {
if (TIME > 0) {
TIME--;
if (TIME <= 0) {
FUN();
}
}
run = function (mc) {
if (mc._visible) {
mc.Ef();
}
};
run(ball);
run(frame);
run(enemyPaddle);
run(userPaddle);
run(bonus);
}
function SetLevel() {
level = "Level " + world.level;
levelNumber = world.level;
}
function Init_Game() {
world = new Object();
world.left = 25;
world.right = 325;
world.top = 25;
world.bottom = 225;
world.depth = 75;
world.speed = 2;
world.bounce = 1;
world.skillFactor = 17;
world.curveAmount = 50;
world.curveDecay = 0.01;
world.score = 0;
score = 0;
world.enemyLives = 3;
world.playerLives = 5;
world.level = 1;
level = "Level 1";
levelNumber = world.level;
world.bonus = 10;
world.bonusDisplay = 3000;
world.hitScore = 100;
world.curveBonus = 50;
world.superCurveBonus = 150;
world.accuracyBonus = 100;
world.hitDegrade = 10;
world.curveDegrade = 5;
world.superCurveDegrade = 15;
world.accuracyDegrade = 10;
bonusWord = "bonus:";
levelSkillFactor = new Array(17, 14, 11, 9, 7, 5, 3.5, 2.75, 2, 1);
levelSpeed = new Array(2, 2.33, 2.66, 3, 3.33, 3.66, 4, 4.33, 4.66, 6);
levelCurve = new Array(25, 22.5, 20, 17.5, 15, 12.5, 10, 10, 10, 10);
if (!sounds) {
sounds = 1;
wallBounce1 = new Sound();
wallBounce1.attachSound("wallBounce1");
wallBounce2 = new Sound();
wallBounce2.attachSound("wallBounce2");
pPaddleBounce = new Sound();
pPaddleBounce.attachSound("pPaddleBounce");
ePaddleBounce = new Sound();
ePaddleBounce.attachSound("ePaddleBounce");
missSound = new Sound();
missSound.attachSound("missSound");
globalSound = new Sound();
globalSound.attachSound(_root);
globalSound.setVolume(80);
}
FUN = Level_Intro;
TIME = 1 * S_MUL;
}
function Level_Intro() {
SetLevel();
PRINT_AVGS();
gotoAndStop ("Level");
userPaddle.Load();
frame.Load();
TIME = 45 * S_MUL;
FUN = Init_Round;
}
function Init_Round() {
gotoAndStop ("LevelStart");
enemyLives.gotoAndPlay("L" + world.enemyLives);
playerLives.gotoAndPlay("L" + world.playerLives);
world.speed = levelSpeed[world.level - 1];
world.skillFactor = levelSkillFactor[world.level - 1];
world.curveAmount = levelCurve[world.level - 1];
world.hitScore = 100;
world.curveBonus = 50;
world.superCurveBonus = 150;
world.accuracyBonus = 100;
world.bonusDisplay = 3000;
bonusScore = world.bonusDisplay;
world.bonus = 10;
enemyPaddle.Load();
FUN = Serve_1;
TIME = 1 * S_MUL;
}
function Serve_1() {
gotoAndStop ("Serve1");
ball.Load();
FUN = Serve_2;
TIME = 1 * S_MUL;
}
function Serve_2() {
gotoAndStop ("Serve2");
}
function Ball_Is_Red_Play_1() {
ball.gotoAndStop(2);
FUN = Ball_Red_Finish;
TIME = 18 * S_MUL;
}
function Ball_Red_Finish() {
if (world.enemyLives < 1) {
world.level = world.level + 1;
SetLevel();
world.enemyLives = 3;
world.score = world.score + world.bonusDisplay;
score = world.score;
gotoAndStop ("Level");
TIME = 45 * S_MUL;
FUN = Init_Round;
} else if (world.playerLives < 1) {
PRINT_AVGS();
bonusScore = "";
bonusWord = "";
gotoAndStop ("GameOver");
} else {
gotoAndStop ("Serve1");
FUN = Serve_1;
TIME = 1 * S_MUL;
}
}
var RECT = (new flash.geom.Rectangle(1, 0, 1, 0));
userPaddle._visible = 0;
enemyPaddle._visible = 0;
ball._visible = 0;
frame._visible = 0;
_global.S_MUL = 4;
_global.S_MIL = 1 / S_MUL;
_global.LOG = function (x) {
return(1 - Math.pow(1 - x, S_MIL));
};
_global.EXP = function (x) {
return(Math.pow(x, S_MIL));
};
_global.RPOW = function (b, e) {
if (b < 0) {
return(-Math.pow(-b, e));
}
return(Math.pow(b, e));
};
_global.FIX = function (a, b, c) {
a = Math.max(-1, Math.min(1, a / b));
return(RPOW(a, c) * b);
};
_global.GTAP = function (mc, f) {
mc.gotoAndStop(f);
mc._p = 1;
};
_global.GS = function (a, b) {
if ((a < 0) && (b < 0)) {
return((a + b) / 2);
}
if ((a > 0) && (b > 0)) {
return((a + b) / 2);
}
return(b / 2);
};
FUN = Init_Game;
TIME = 8 * S_MUL;
FRAME = 33.3333333333333 / S_MUL;
MS = 0;
_global.SA = function (who, v) {
AVG[world.level - 1][who].push(Math.abs(v));
};
if (!_global.AVG) {
_global.AVG = [];
i = 0;
while (i < 10) {
AVG[i] = {ux:[], uy:[], ex:[], ey:[]};
i++;
}
}
_global.PRINT_AVGS = function () {
return(undefined);
while (i < 10) {
var _local1 = AVG[i];
if (_local1.ux.length) {
trace("L " + (i + 1));
trace(((" UX : " + GAVG(_local1.ux)) + " / ") + GMED(_local1.ux));
trace(((" UY : " + GAVG(_local1.uy)) + " / ") + GMED(_local1.uy));
trace(((" EX : " + GAVG(_local1.ex)) + " / ") + GMED(_local1.ex));
trace(((" EY : " + GAVG(_local1.ey)) + " / ") + GMED(_local1.ey));
}
i++;
}
};
Symbol 67 MovieClip Frame 21
userPaddle._visible = 1;
enemyPaddle._visible = 0;
ball._visible = 0;
frame._visible = 0;
Symbol 67 MovieClip Frame 26
userPaddle._visible = 1;
enemyPaddle._visible = 0;
ball._visible = 0;
frame._visible = 0;
Symbol 67 MovieClip Frame 31
userPaddle._visible = 1;
enemyPaddle._visible = 1;
ball._visible = 0;
frame._visible = 0;
Symbol 67 MovieClip Frame 36
userPaddle._visible = 1;
enemyPaddle._visible = 1;
ball._visible = 1;
frame._visible = 1;
Symbol 67 MovieClip Frame 41
function pad0(s, n) {
s = "" + s;
while (s.length < n) {
s = "0" + s;
}
return(s);
}
userPaddle._visible = 1;
enemyPaddle._visible = 1;
ball._visible = 0;
frame._visible = 0;
d = new Date();
new_score = [levelNumber, score, (((pad0(d.getFullYear(), 4) + "-") + pad0(d.getMonth() + 1, 2)) + "-") + pad0(d.getDate())];
mySO = SharedObject.getLocal("CB120");
scores = mySO.data.score;
if (!scores) {
scores = [];
}
i = 0;
while (i < scores.length) {
if (scores[i][1] < new_score[1]) {
scores.splice(i, 0, null);
break;
}
i++;
}
scores[i] = new_score;
scores.splice(15, 999);
mySO.data.score = scores;
mySO.flush();