Frame 1
_global.sq = function (num) {
return(num * num);
};
_global.sign = function (num) {
return(((num < 0) ? -1 : 1));
};
_global.isOdd = function (num) {
return((((num % 2) == 1) ? true : false));
};
_global.isEven = function (num) {
return((((num % 2) == 0) ? true : false));
};
_global.randInt = function (num) {
return(Math.floor(Math.random() * num));
};
_global.randNat = function (num) {
return(Math.ceil(Math.random() * num));
};
_global.randBool = function (num) {
return((((Math.random() * num) < 1) ? true : false));
};
_global.randSign = function (num) {
return((((Math.random() * num) > 1) ? 1 : -1));
};
_global.randBoth = function (num) {
return(((Math.random() * num) * 2) - num);
};
_global.randStop = function (mc) {
mc.gotoAndStop(randNat(mc._totalframes));
};
_global.randPlay = function (mc, num) {
if (randBool(num)) {
mc.play();
} else {
mc.prevFrame();
mc.play();
}
};
_global.Pi2 = (Math.PI/2);
_global.DTR = (Math.PI/180);
_global.RTD = 57.2957795130823;
_global.UPT = new Point(1, 0);
Instance of Symbol 11 MovieClip in Frame 1
onClipEvent (load) {
_root.stop();
progBar._xscale = 0;
head._x = -80;
bottom._x = -80;
txtLoaded = false;
this.loadVariables("prezURL.txt");
_global.goPrez = function () {
getURL (prezURL, prezWindow);
};
}
onClipEvent (data) {
_root.prezWindow = prezWindow;
_root.prezDown = prezDown;
_root.prezURL = prezURL;
txtLoaded = true;
}
onClipEvent (enterFrame) {
if (progBar._xscale > 100) {
progBar._xscale = (_root.getBytesLoaded() / _root.getBytesTotal()) * 100;
head._x = progBar._width - 80;
bottom._x = -80;
} else {
_alpha = (_alpha - 5);
if (_alpha < 5) {
_root.play();
}
}
}
Frame 2
stop();
Instance of Symbol 324 MovieClip "hockey" in Frame 2
onClipEvent (load) {
stop();
}
Frame 3
stop();
hockey.play();
Symbol 335 MovieClip [__Packages.Point] Frame 0
class Point
{
var X, Y;
function Point (myX, myY) {
if (myY == undefined) {
myX = 0;
myY = 0;
}
X = myX;
Y = myY;
}
function showPt(msg) {
if (msg == undefined) {
msg = "";
} else {
msg = msg + " : ";
}
trace(((msg + X) + " , ") + Y);
}
function square() {
return((X * X) + (Y * Y));
}
function norm() {
return(Math.sqrt(square()));
}
function ptToRad() {
return(Math.atan2(Y, X));
}
function ptToRad2(thePt) {
num = Math.atan2(thePt.Y, thePt.X) - Math.atan2(Y, X);
return(num);
}
function plus(pt1, pt2) {
X = pt1.X + pt2.X;
Y = pt1.Y + pt2.Y;
}
function minus(pt1, pt2) {
X = pt1.X - pt2.X;
Y = pt1.Y - pt2.Y;
}
function addPt(pt) {
X = X + pt.X;
Y = Y + pt.Y;
}
function lessPt(pt) {
X = X - pt.X;
Y = Y - pt.Y;
}
function scale(mag) {
X = X * mag;
Y = Y * mag;
}
function unit() {
nrm = norm();
if (nrm > 0) {
scale(1 / nrm);
}
}
function sin() {
if ((X != 0) || (Y != 0)) {
num = Y / norm();
} else {
num = 0;
}
return(num);
}
function cos() {
if ((X != 0) || (Y != 0)) {
num = X / norm();
} else {
num = 0;
}
return(num);
}
function tan() {
switch (true) {
case X != 0 :
num = Y / X;
break;
case Y > 0 :
trace((X + " , ") + Y);
num = Infinity;
break;
case Y < 0 :
trace((X + " , ") + Y);
num = -Infinity;
break;
default :
num = 0;
}
return(num);
}
function innerPro(thePt) {
inP = (X * thePt.X) + (Y * thePt.Y);
return(inP);
}
function innerProSig(thePt) {
inP = innerPro(thePt);
switch (true) {
case inP > 0 :
inP = 1;
break;
case inP < 0 :
inP = -1;
}
return(inP);
}
function innerProPosi(thePt) {
if (innerPro(thePt) < 0) {
boo = false;
} else {
boo = true;
}
return(boo);
}
function rote(rad) {
rad = rad + ptToRad();
nrm = norm();
X = Math.cos(rad) * nrm;
Y = Math.sin(rad) * nrm;
}
function roteRight() {
X = -Y;
Y = X;
}
function roteLeft() {
X = Y;
Y = -X;
}
function rote2(rad) {
rad = rad + ptToRad();
X = Math.cos(rad);
Y = Math.sin(rad);
}
function flipH() {
X = -X;
}
function flipV() {
Y = -Y;
}
function flipBoth() {
X = -X;
Y = -Y;
}
function flipPt(thePt) {
myNrom = norm();
theRad = (Math.atan2(thePt.Y, thePt.X) * 2) - Math.atan2(Y, X);
X = Math.cos(theRad) * myNrom;
Y = Math.sin(theRad) * myNrom;
}
function flipRad(rad) {
rote(-rad);
flipV();
rote(rad);
}
function copyPt(myPt) {
X = myPt.X;
Y = myPt.Y;
}
function mcToPt(mc) {
X = mc._x;
Y = mc._y;
}
function ptToMc(mc) {
mc._x = X;
mc._y = Y;
}
function numToPt(num1, num2) {
X = num1;
Y = num2;
}
function arToPt(ar) {
X = ar[0];
Y = ar[1];
}
function ptToAr() {
return([X, Y]);
}
}
Instance of Symbol 15 MovieClip "d" in Symbol 16 MovieClip Frame 1
onClipEvent (load) {
_rotation = (Math.random() * 360);
}
Symbol 20 Button
on (release) {
play();
b.play();
}
Symbol 24 MovieClip Frame 1
stop();
b.gotoAndStop(1);
Symbol 24 MovieClip Frame 20
b.stop();
Symbol 24 MovieClip Frame 58
rndPosi = randBoth(40);
_y = (300 + rndPosi);
_x = (60 - (rndPosi * 0.4));
_yscale = (100 + (rndPosi / 8));
_xscale = (100 + (rndPosi / 8));
b.c.d._rotation = Math.random() * 360;
Symbol 24 MovieClip Frame 61
b.gotoAndPlay("bk");
Symbol 28 MovieClip Frame 1
stop();
Symbol 29 Button
on (release) {
artPlayTime(12);
}
Symbol 30 Button
on (release) {
artPlayTime(6);
}
Symbol 31 Button
on (release) {
artPlayTime(3);
}
Symbol 32 Button
on (release) {
artPlayTime(9);
}
Symbol 33 Button
on (release) {
artPlayTime(1);
}
Symbol 34 Button
on (release) {
artPlayTime(7);
}
Symbol 35 Button
on (release) {
artPlayTime(2);
}
Symbol 36 Button
on (release) {
artPlayTime(8);
}
Symbol 37 Button
on (release) {
artPlayTime(4);
}
Symbol 38 Button
on (release) {
artPlayTime(10);
}
Symbol 39 Button
on (release) {
artPlayTime(5);
}
Symbol 40 Button
on (release) {
artPlayTime(11);
}
Symbol 45 MovieClip Frame 1
myDate = new Date();
min._rotation = myDate.getMinutes() * 6;
hour._rotation = (myDate.getHours() * 30) + Math.round(myDate.getMinutes() / 2);
Symbol 64 MovieClip Frame 1
stop();
Symbol 88 MovieClip Frame 2
randPlay(this, 20);
Symbol 100 MovieClip Frame 1
if (dontMove) {
stop();
}
Symbol 100 MovieClip Frame 4
if (dontMove) {
stop();
} else {
randPlay(this, 30);
}
Symbol 100 MovieClip Frame 8
if (dontMove) {
gotoAndPlay ("down");
}
Symbol 100 MovieClip Frame 12
if (dontMove) {
gotoAndPlay ("down");
}
Symbol 100 MovieClip Frame 16
if (dontMove) {
gotoAndPlay ("down");
}
Symbol 124 MovieClip Frame 1
stop();
Symbol 128 MovieClip Frame 1
stop();
Symbol 128 MovieClip Frame 40
stop();
Symbol 128 MovieClip Frame 61
h.play();
Symbol 128 MovieClip Frame 99
stop();
_parent.play();
Symbol 146 MovieClip Frame 23
_parent.tama.play();
Symbol 146 MovieClip Frame 70
_parent.play();
Symbol 194 Button
on (release) {
_parent.newBall();
if (_parent.balls < 13) {
_parent.tama.hnd.gotoAndPlay(5);
}
}
Symbol 197 Button
on (release) {
_parent.again();
}
Symbol 199 Button
on (release) {
getURL (_root.prezURL, _root.prezWindow);
}
Symbol 202 MovieClip Frame 1
if (_root.prezDown) {
gotoAndStop (2);
} else {
gotoAndStop (1);
}
Symbol 213 MovieClip Frame 1
stop();
Symbol 213 MovieClip Frame 6
if (_parent.balls == 13) {
_parent.hy.wds.gotoAndStop(2);
}
Instance of Symbol 192 MovieClip in Symbol 213 MovieClip Frame 6
onClipEvent (load) {
gotoAndStop(_parent._parent.nextBallNum);
}
Symbol 213 MovieClip Frame 13
stop();
Symbol 213 MovieClip Frame 23
stop();
Symbol 213 MovieClip Frame 28
stop();
Symbol 213 MovieClip Frame 33
stop();
Symbol 213 MovieClip Frame 38
stop();
Symbol 224 MovieClip Frame 1
stop();
Symbol 229 MovieClip Frame 1
stop();
Symbol 229 MovieClip Frame 13
_parent.nextBall();
Symbol 245 MovieClip Frame 1
gotoAndStop(randInt(8) + 2);
Symbol 255 MovieClip Frame 1
gotoAndStop(randInt(6) + 4);
Symbol 276 MovieClip Frame 1
gotoAndStop(randInt(14) + 7);
Symbol 277 MovieClip Frame 1
stop();
Symbol 280 MovieClip Frame 1
stop();
Symbol 285 MovieClip Frame 1
gotoAndPlay(_root.randNat(50));
Symbol 294 MovieClip Frame 85
gotoAndStop (30);
_parent._parent._parent.deed = 0;
Symbol 303 MovieClip Frame 25
stop();
_parent.gotoAndStop(1);
_parent._parent.doTalk = false;
Symbol 304 MovieClip Frame 1
stop();
Symbol 310 MovieClip Frame 1
stop();
Symbol 316 MovieClip Frame 1
stop();
Symbol 316 MovieClip Frame 4
Symbol 316 MovieClip Frame 5
Symbol 316 MovieClip Frame 6
_parent.doShift();
Symbol 316 MovieClip Frame 7
_parent.doShift();
Symbol 316 MovieClip Frame 8
_parent.doShift();
Symbol 316 MovieClip Frame 9
_parent.doShift();
Symbol 316 MovieClip Frame 10
gotoAndStop (1);
Symbol 322 MovieClip Frame 1
stop();
Symbol 322 MovieClip Frame 4
stop();
Instance of Symbol 320 MovieClip "h" in Symbol 323 MovieClip Frame 1
onClipEvent (load) {
gotoAndStop (30);
}
Symbol 324 MovieClip Frame 1
mouseDelay = 0.4;
areaBouns = 0.96;
maxSpeed = 27;
minSpeed = 5;
minSpeedSq = sq(minSpeed);
weakness = areaBouns;
ballR = ball._width / 2;
padR = myPd._width / 2;
padNBall = ballR + padR;
padNBallSq = sq(padNBall);
padNBallRev = 1 / padNBall;
area = new Point(100, 160);
areaB = new Point(area.X - ballR, area.Y - ballR);
areaP = new Point(area.X - padR, area.Y - padR);
areaBW = areaB.X * 2;
areaBH = areaB.Y * 2;
goalX = 40;
inGoal = goalX - ballR;
areaSnd = new Sound();
hitSnd = new Sound();
goalSnd = new Sound();
areaSnd.attachSound("aSnd");
hitSnd.attachSound("hSnd");
goalSnd.attachSound("gSnd");
function initGame() {
talkType = ttStart;
talking = true;
nextBallNum = 1;
balls = 13;
goalGet = 0;
goalLoose = 0;
goal.got.gotoAndStop(1);
goal.loose.gotoAndStop(1);
exMouAr = new Array(0, 0);
initHyPad(hy.hyPd);
}
function initBall() {
ball.protected = 0;
ball.now = new Point(0, 0);
ball.old = new Point(0, 0);
ball.spd = new Point((Math.random() - 0.5) * 12, (Math.random() * 6) + 6);
ball.state = 1;
ball.swapDepths(10);
ball._alpha = 100;
ball._visible = true;
exPtToMc(ball.now, ball);
}
function initPad(pad) {
pad.old = new Point();
pad.old.copyPt(pad.now);
pad.spd = new Point(0, 0);
pad.toBall = new Point(0, 0);
pad.toBall.minus(pad.now, ball.now);
}
function initMyPad(pad) {
pad.now = new Point(0, 145);
initPad(pad);
exPtToMc(pad.now, pad);
pad.swapDepths(11);
}
function initHyPad(pad) {
arHyPd = new Array();
arHyPd = reXY(pad._x + hy._x, pad._y + hy._y);
pad.now = new Point(arHyPd[0], arHyPd[1]);
initPad(pad);
}
function exPt(pt) {
return(exXY(pt.X, pt.Y));
}
function exXY(X, Y) {
var _local1 = Math.pow(sclBase, Y * aHRv);
return([(X * _local1) * allScl, (_local1 - 1) * ySclUp, _local1]);
}
function exPtToMc(pt, mc) {
var _local1 = Math.pow(sclBase, pt.Y * aHRv);
mc._x = (pt.X * _local1) * allScl;
mc._y = (_local1 - 1) * ySclUp;
mc._xscale = (mc._yscale = _local1 * 100);
}
function reXY(X, Y) {
var _local1 = (Y * ySclDw) + 1;
return([(X / _local1) * allSclRv, (Math.log(_local1) * sclBaseRv) * aH, _local1]);
}
sclBase = 1.25;
allScl = 1.2;
yScl = 2.24;
sclBaseRv = 1 / Math.log(sclBase);
allSclRv = 1 / allScl;
aH = area.Y;
aHRv = 1 / aH;
ySclUp = (aH * allScl) * yScl;
ySclDw = 1 / ySclUp;
Instance of Symbol 78 MovieClip "ball" in Symbol 324 MovieClip Frame 1
onClipEvent (enterFrame) {
if (state > 0) {
_parent.ballMove();
if (protected < 1) {
if (this.now.Y > (-_parent.ballR)) {
_parent.checkHit(_parent.myPd);
} else {
_parent.checkHit(_parent.hy.hyPd);
}
} else {
protected--;
}
_parent.ballMoveAf();
} else if (state < 0) {
_parent.ballDead();
}
}
Instance of Symbol 79 MovieClip "myPd" in Symbol 324 MovieClip Frame 1
onClipEvent (enterFrame) {
_parent.padMoveMy(this);
}
Symbol 324 MovieClip Frame 2
function ballMove() {
ball.old.copyPt(ball.now);
ball.now.plus(ball.now, ball.spd);
oprCome();
ballInner();
}
function ballInner() {
if (ball.now.X > areaB.X) {
ballFlipX(1);
} else if (ball.now.X < (-areaB.X)) {
ballFlipX(-1);
}
if (ball.now.Y > areaB.Y) {
if (Math.abs(ball.now.X) > goalX) {
ballFlipY(1);
oprShift();
} else if (ball.state > -1) {
getGoal(false);
}
} else if (ball.now.Y < (-areaB.Y)) {
if (Math.abs(ball.now.X) > goalX) {
ballFlipY(-1);
} else if (ball.state > -1) {
getGoal(true);
}
}
}
function ballFlipX(FLP) {
var _local3 = (ball.spd.X - ball.now.X) + (FLP * areaB.X);
var _local1 = _local3 / ball.spd.X;
ball.old.X = FLP * areaB.X;
ball.old.Y = ball.old.Y + (ball.spd.Y * _local1);
ball.now.X = ((FLP * areaB.X) * 2) - ball.now.X;
ball.spd.X = ball.spd.X * -1;
ballFlipAf();
}
function ballFlipY(FLP) {
var _local3 = (ball.spd.Y - ball.now.Y) + (FLP * areaB.Y);
var _local1 = _local3 / ball.spd.Y;
ball.old.Y = FLP * areaB.Y;
ball.old.X = ball.old.X + (ball.spd.X * _local1);
ball.now.Y = ((FLP * areaB.Y) * 2) - ball.now.Y;
ball.spd.Y = ball.spd.Y * -1;
ballFlipAf();
}
function ballFlipAf() {
if (ball.spd.square() > minSpeedSq) {
ball.spd.scale(areaBouns);
} else {
ball.spd.unit();
ball.spd.scale(minSpeed);
}
areaSnd.start();
}
function ballMoveAf() {
switch (true) {
case ball.state < 0 :
ball.swapDepths(0);
break;
case ball.now.Y < hy.hyPd.now.Y :
ball.swapDepths(8);
break;
case ball.now.Y > myPd.now.Y :
ball.swapDepths(12);
break;
default :
ball.swapDepths(10);
}
exPtToMc(ball.now, ball);
}
function getGoal(boo) {
ball.state = -1;
goalSnd.start();
if (boo) {
talkType = ttSad;
hy.wds.gotoAndStop(talkType);
goalGet++;
goal.got.gotoAndStop(goalGet + 1);
wJudge.gotoAndStop(2);
} else {
talkType = ttGlad;
hy.wds.gotoAndStop(talkType);
goalLoose++;
goal.loose.gotoAndStop(goalLoose + 1);
wJudge.gotoAndStop(3);
}
tama.hnd.gotoAndPlay(2);
if (balls > 0) {
talking = true;
hy.wds.gotoAndStop(talkType);
} else {
talking = false;
hy.wds.gotoAndStop(1);
}
}
function ballDead() {
if ((ball._alpha > 0) && (Math.abs(ball.now.Y) < (area.Y + padR))) {
ball._alpha = ball._alpha - 50;
ball.spd.Y = ball.spd.Y * 0.7;
ball.now.plus(ball.now, ball.spd);
switch (true) {
case ball.now.X > inGoal :
ball.now.X = inGoal;
ball.spd.X = -4;
areaSnd.start();
break;
case ball.now.X < (-inGoal) :
ball.now.X = -inGoal;
ball.spd.X = 4;
areaSnd.start();
}
ballMoveAf();
} else {
ballDeadAf();
}
}
function ballDeadAf() {
ball.state = 0;
ball._visible = false;
nextBallNum++;
if (nextBallNum < 14) {
BTNs.gotoAndPlay("n");
} else {
switch (true) {
case goalGet > 9 :
BTNs.gotoAndStop("perf");
wJudge.gotoAndStop(4);
break;
case goalGet > 6 :
BTNs.gotoAndStop("good");
wJudge.gotoAndStop(4);
break;
case goalGet > 3 :
BTNs.gotoAndStop("bad");
wJudge.gotoAndStop(5);
break;
default :
BTNs.gotoAndStop("worst");
wJudge.gotoAndStop(5);
}
tama.hnd.gotoAndPlay(2);
}
deed = ddSetReturn;
}
function startGame() {
ball.state = 0;
BTNs.gotoAndPlay("n");
}
function again() {
initGame();
startGame();
}
function newBall() {
talkType = ttNon;
talking = false;
hy.wds.gotoAndStop(1);
wJudge.gotoAndStop(1);
deed = ddSetToStart;
BTNs.gotoAndStop(1);
ballDummy.play();
}
function nextBall() {
initBall();
balls--;
}
function endGame() {
initBall();
}
ttNon = 1;
ttStart = 2;
ttGlad = 3;
ttSad = 4;
ttEndGlad = 5;
ttEndSad = 6;
function checkHit(pad) {
pad.spd.minus(pad.now, pad.old);
pad.toBall.minus(ball.now, pad.now);
padToBallSq = pad.toBall.square();
if (padToBallSq < (padNBallSq + 20)) {
checkHitEx(pad);
}
}
function ptsRad(pt1, pt2) {
return(pt2.ptToRad() - pt1.ptToRad());
}
function checkHitEx(pad) {
spdRlt.minus(ball.spd, pad.spd);
spdRltRad = spdRlt.ptToRad();
ballPoNow.minus(ball.now, pad.old);
ballPoOld.minus(ballPoNow, spdRlt);
ballPoOld.rote(-spdRltRad);
ballPoNow.rote(-spdRltRad);
interPXW = padNBallSq - sq(ballPoNow.Y);
if (interPXW > 0) {
interPX = -Math.sqrt(interPXW);
if (interPX < ballPoNow.X) {
doHit(pad);
}
}
}
function doHit(pad) {
interP.X = interPX;
interP.Y = ballPoNow.Y;
overMag = (ballPoNow.X - interP.X) / (ballPoNow.X - ballPoOld.X);
interP.rote(spdRltRad);
interPRad = interP.ptToRad();
interPUni.copyPt(interP);
interPUni.scale(padNBallRev);
if (Math.abs(interPUni.Y) < 0.2) {
interPUni.numToPt(sign(interPUni.X) * 0.98, sign(interPUni.Y) * 0.2);
}
ball.old.copyPt(interP);
ball.old.addPt(pad.old);
if (!ball.spd.innerProPosi(pad.spd)) {
ball.spd.flipBoth();
ball.spd.flipRad(interPRad);
}
padSpdRad = pad.spd.ptToRad2(interPUni);
bothSpdNrm = ((pad.spd.norm() * Math.cos(padSpdRad)) + ball.spd.norm()) * weakness;
ballSpdScl = Math.max(Math.min(maxSpeed, bothSpdNrm), minSpeed);
interPUni.scale(ballSpdScl);
ball.spd.copyPt(interPUni);
overSpd.copyPt(ball.spd);
overSpd.scale(overMag);
ball.now.plus(ball.old, overSpd);
ballInner();
hitSnd.start();
ball.protected = 2;
if (ball.old.Y > -40) {
oprShift();
}
}
ballPoOld = new Point();
ballPoNow = new Point();
spdRlt = new Point();
interP = new Point();
interPUni = new Point();
overSpd = new Point();
Symbol 324 MovieClip Frame 3
function padMoveMy(pad) {
pad.old.copyPt(pad.now);
exMouAr = reXY(_xmouse, _ymouse);
pad.now.X = pad.now.X + ((exMouAr[0] - pad.old.X) * mouseDelay);
pad.now.Y = pad.now.Y + ((exMouAr[1] - pad.old.Y) * mouseDelay);
padInner(pad, 1);
}
function padInner(pad, sig) {
if ((pad.now.Y * sig) > areaP.Y) {
pad.now.Y = areaP.Y * sig;
} else if ((pad.now.Y * sig) < padR) {
pad.now.Y = padR * sig;
}
if (pad.now.X > areaP.X) {
pad.now.X = areaP.X;
} else if (pad.now.X < (-areaP.X)) {
pad.now.X = -areaP.X;
}
exPtToMc(pad.now, pad);
}
function padMoveHy(pad) {
pad.old.copyPt(pad.now);
arHyPd = reXY(pad._x + hy._x, pad._y + hy._y);
pad.now.X = arHyPd[0];
pad.now.Y = arHyPd[1];
}
function act() {
switch (deed) {
case ddNon :
headMove();
return;
case ddShift :
shiftNAtack();
headMove();
return;
case ddAtack :
shiftNAtack();
headMove();
return;
case ddSetReturn :
setHeadReturn();
return;
case ddReturn :
headReturn();
return;
case ddSetToStart :
setHeadToStart();
return;
case ddToStart :
headToStart();
return;
case ddWaitStart :
headWaitStart();
}
}
function shiftNAtack() {
if (lastF > nextF) {
hy.gotoAndPlay(nextF);
nextF = nextF + actSpd;
padMoveHy(hy.hyPd);
} else {
actAf();
initAct();
hy.h.hr.hair.gotoAndPlay(2);
}
}
function headMove() {
var _local2;
var _local1;
_local2 = headDiv - Math.floor((ball.now.Y + areaB.Y) / areaBHDiv);
_local2 = Math.min(headFMax, Math.max(1, _local2));
_local1 = Math.atan2(ball._y - hy._y, (ball._x - hy._x) - hy.h._x) - Pi2;
_local1 = _local1 * (RTD / 3);
_local1 = Math.min(headRMax, Math.max(-headRMax, _local1));
tama.h._rotation = (_local1 / 3) - 5;
_local1 = _local1 * (_local2 / headFMax);
hy.h.hr.gotoAndStop(_local2);
hy.h.hr._rotation = _local1;
tama.h.gotoAndStop(_local2);
}
function setHeadReturn() {
hyHdRetRCount = 5;
hyHdRetR = hy.h.hr._rotation / hyHdRetRCount;
if (hy.h.hr._currentframe > hyHdRetRCount) {
hyHdRetF = Math.ceil(hy.h.hr._currentframe / hyHdRetRCount);
} else {
hyHdRetF = 1;
}
tmHdRetRCount = 8;
tmHdRetR = (tama.h._rotation - 5) / tmHdRetRCount;
if (tama.h._currentframe != 30) {
tmHdRetF = Math.floor((30 - tama.h._currentframe) / tmHdRetRCount);
if (tmHdRetF == 0) {
tmHdRetF = 1;
}
} else {
tmHdRetF = 0;
}
deed = ddReturn;
}
function headReturn() {
if (lastF > nextF) {
hy.gotoAndPlay(nextF);
nextF = nextF + actSpd;
padMoveHy(hy.hyPd);
} else {
actAf();
}
var _local2 = hy.h.hr._currentframe - hyHdRetF;
if (_local2 > 1) {
hy.h.hr.gotoAndStop(_local2);
} else {
hy.h.hr.gotoAndStop(1);
hy.gotoAndStop(1);
}
var _local1 = tama.h._currentframe + tmHdRetF;
if (tmHdRetF > 0) {
if (_local1 > 30) {
_local1 = 30;
}
} else if (_local1 < 30) {
_local1 = 30;
}
tama.h.gotoAndStop(_local1);
if (hyHdRetRCount > 0) {
hy.h.hr._rotation = hy.h.hr._rotation - hyHdRetR;
hyHdRetRCount--;
}
if (tmHdRetRCount > 0) {
tama.h._rotation = tama.h._rotation - tmHdRetR;
tmHdRetRCount--;
}
}
function actAf() {
hy.gotoAndStop(1);
padMoveHy(hy.hyPd);
}
function initAct() {
deed = 0;
actSpd = 0;
nextF = 0;
baseF = 0;
lastF = 0;
frames = 0;
}
function setAtack(dir, vActSpd) {
actSpd = vActSpd + 3;
frames = 30;
baseF = this["bfAtack" + Math.abs(dir)];
if (dir < 0) {
baseF = baseF + frames;
}
deed = ddAtack;
setRest();
}
function setRest() {
lastF = (baseF + frames) + 1;
nextF = baseF;
}
function doShift() {
hy._x = hy._x + shift;
}
function setShift(aim) {
aim = aim + randBoth(10);
aim = Math.max(Math.min(aim, 30), -30);
var _local1 = aim - hy._x;
var _local3 = Math.abs(_local1);
var _local4 = sign(_local1);
if ((_local3 < 5) || (Math.random() < 0.2)) {
deed = ddNon;
} else {
_local1 = Math.min(_local3, 60) * _local4;
shift = _local1 / 4;
setShiftRest();
}
}
function setShiftHalf() {
if (Math.abs(hy._x) > 10) {
shift = (-hy._x) / 8;
setShiftRest();
}
}
function setShiftRest() {
actSpd = 1;
frames = 6;
baseF = bfShift;
deed = ddShift;
setRest();
}
function setHeadToStart() {
headToStartR = Math.atan2(-hy._y, (-hy._x) - hy.h._x) - Pi2;
headToStartR = headToStartR * (((RTD * 30) / headFMax) / 2.5);
hyHdRetRCount = 5;
headToStartR = headToStartR / hyHdRetRCount;
hy.h.hr.gotoAndPlay("start");
deed = ddToStart;
}
function headToStart() {
if (hyHdRetRCount > 0) {
hy.h.hr._rotation = hy.h.hr._rotation + headToStartR;
hyHdRetRCount--;
if ((tama.h._rotation - tmHdStartSrep) > tmHdStart) {
tama.h._rotation = tama.h._rotation - tmHdStartSrep;
} else {
tama.h._rotation = tmHdStart;
}
}
}
function headWaitStart() {
tama.h.gotoAndStop(30);
tama.h._rotation = 5;
hy.h.hr.stop();
}
initAct();
bfShift = 4;
bfAtack0 = 10;
bfAtack1 = 40;
bfAtack2 = 100;
bfAtack3 = 160;
ddNon = 0;
ddShift = 1;
ddAtack = 2;
ddSetReturn = 3;
ddReturn = 4;
ddRest = 5;
ddSetToStart = 6;
ddToStart = 7;
ddWaitStart = 8;
headDiv = 60;
headFMax = headDiv + 1;
areaBHDiv = areaBH / headDiv;
headRMax = 30;
tmHdStart = -3.2;
tmHdStartSrep = 1.6;
function oprCome() {
if ((((ball.spd.Y < 0) && (ball.now.Y < 0)) && (ball.now.Y < attackY)) && (deed == ddNon)) {
setAtack(choiceAttack(), randInt(3));
attackY = ((-Math.random()) * attackYBaseR) - attackYBase;
}
}
function choiceAttack() {
var _local2 = ball.now.X - hy.hyPd.now.X;
var _local1;
switch (true) {
case _local2 < -50.5 :
_local1 = -3;
break;
case _local2 < -36.5 :
_local1 = -2;
break;
case _local2 < -13.5 :
_local1 = -1;
break;
case _local2 < 13.5 :
_local1 = 0;
break;
case _local2 < 36.5 :
_local1 = 1;
break;
case _local2 < 50.5 :
_local1 = 2;
break;
default :
_local1 = 3;
}
return(_local1);
}
function oprShift() {
var _local7 = ball.now.Y + areaB.Y;
var _local8 = ((-_local7) / ball.spd.Y) * ball.spd.X;
var _local2 = _local8 + ball.now.X;
var _local6 = sign(_local2);
var _local3 = Math.abs(_local2) + areaB.X;
var _local1 = Math.floor(_local3 / areaBW);
if (_local1 < 3) {
var _local5 = _local3 % areaBW;
var _local4 = (areaB.X - _local5) * _local6;
if (isEven(_local1)) {
_local4 = _local4 * -1;
}
setShift(_local4);
} else {
setShiftHalf();
}
}
oprType = 0;
oprData = 0;
non = 0;
come = 1;
refX = 2;
refY = 3;
attack = 5;
attackYBase = 40;
attackYBaseR = 20;
attackY = ((-Math.random()) * attackYBaseR) - attackYBase;
attackH = areaB.Y - attackY;
Symbol 324 MovieClip Frame 4
initMyPad(myPd);
stop();
Symbol 324 MovieClip Frame 15
tama.play();
deed = ddWaitStart;
Symbol 324 MovieClip Frame 16
stop();
Instance of Symbol 213 MovieClip "BTNs" in Symbol 324 MovieClip Frame 16
onClipEvent (load) {
this.swapDepths(30);
}
Instance of Symbol 224 MovieClip "wJudge" in Symbol 324 MovieClip Frame 16
onClipEvent (load) {
this.swapDepths(29);
}
Symbol 324 MovieClip Frame 17
stop();
initGame();
startGame();
Instance of Symbol 225 MovieClip "woodUp" in Symbol 324 MovieClip Frame 17
onClipEvent (load) {
this.swapDepths(1);
}
Instance of Symbol 316 MovieClip "hy" in Symbol 324 MovieClip Frame 17
onClipEvent (load) {
this.swapDepths(9);
doTalk = false;
stop();
}
onClipEvent (enterFrame) {
_parent.act();
}
Instance of Symbol 323 MovieClip "tama" in Symbol 324 MovieClip Frame 17
onClipEvent (load) {
h.gotoAndStop(30);
h._rotation = 5;
}
Symbol 327 Button
on (release) {
play();
_root.hockey.tama.dontMove = true;
}
Symbol 331 Button
on (release) {
play();
}
Symbol 334 MovieClip Frame 6
stop();
Symbol 334 MovieClip Frame 15
stop();
Symbol 334 MovieClip Frame 16
_parent.nextFrame();
_root.hockey.play();