Frame 1
total_bytes = _root.getBytesTotal();
loaded_bytes = _root.getBytesLoaded();
remaining_bytes = total_bytes - loaded_bytes;
percent_done = int((loaded_bytes / total_bytes) * 100);
_root.showperc = percent_done + "%";
bar.gotoAndStop(percent_done);
_root.emailme2 = "0";
_root.emailme = "0";
_root.playername = "";
_root.nat = "";
if (remaining_bytes <= 0) {
gotoAndStop (4);
}
Frame 3
gotoAndPlay (1);
_root.qual = 1;
Frame 4
play();
var navigate = 0;
Frame 32
stop();
Frame 47
if (_root.navigate == 1) {
gotoAndPlay ("how");
}
if (_root.navigate == 2) {
gotoAndPlay ("feedback");
}
if (_root.navigate == 3) {
gotoAndPlay ("scores");
}
if (_root.navigate == 4) {
gotoAndPlay ("credits");
}
if (_root.navigate == 5) {
gotoAndPlay ("prize");
}
if (_root.navigate == 6) {
gotoAndPlay ("begin");
}
Frame 48
stop();
Frame 63
stop();
Frame 73
_root.done = "false";
_root.pp = 0;
_root.scorecount = 0;
_root.lasty = 238;
loadVariablesNum ("get_data.php", 0, "POST");
play();
Frame 74
play();
Frame 75
play();
Frame 76
play();
Frame 77
play();
Frame 78
if (_root.pp > 40) {
gotoAndStop (80);
} else if (_root.done != "true") {
gotoAndPlay (74);
_root.pp++;
} else {
gotoAndStop (79);
}
Frame 79
stop();
Frame 80
stop();
Frame 83
stop();
Frame 93
stop();
Frame 103
stop();
_root.natbox._visible = 0;
_root.namebox._visible = 0;
Frame 110
gotoAndStop ("level1");
Frame 113
play();
Frame 121
stop();
Frame 131
gotoAndStop ("level1");
Frame 136
function moveBalls() {
var _local4 = 1;
while (_local4 <= game.numBalls) {
var _local3 = game["ball" + _local4];
if (_local4 == 2) {
if (Key.isDown(_root.lhHead) || (Key.isDown(_root.rhHead))) {
_root.game.ball2.ypos = -10;
_root.game.ball3.ypos = -10;
game.ball2.ypos = _root.jay._y - 40;
game.ball3.ypos = _root.jay._y - 40;
_root.keyhead = true;
_root.keyknee = false;
_root.keykick = false;
if (faceeast) {
if (_root.jay._x < _root.ball1._x) {
_root.ball2._x = _root.jay._x - 20;
_root.ball3._x = _root.jay._x;
} else {
_root.ball2._x = _root.jay._x - 20;
_root.ball3._x = _root.jay._x;
}
} else if (_root.jay._x < _root.ball1._x) {
_root.ball2._x = _root.jay._x - 5;
_root.ball3._x = _root.jay._x + 20;
} else {
_root.ball2._x = _root.jay._x;
_root.ball3._x = _root.jay._x + 20;
}
if (_root.ball1._y != floor) {
decay = 1.28;
}
}
if (Key.isDown(_root.lhKnee) || (Key.isDown(_root.rhKnee))) {
_root.game.ball2.ypos = -10;
_root.game.ball3.ypos = -10;
if ((this.jay.knee._currentframe >= 5) && (this.jay.knee._currentframe <= 10)) {
game.ball2.ypos = _root.jay._y + 8;
game.ball3.ypos = _root.jay._y + 17;
_root.keyhead = false;
_root.keyknee = true;
_root.keykick = false;
if (faceeast) {
if (_root.jay._x < _root.ball1._x) {
_root.ball2._x = _root.jay._x + 4;
_root.ball3._x = _root.jay._x + 14;
} else {
_root.ball2._x = _root.jay._x - 4;
_root.ball3._x = _root.jay._x + 14;
}
} else {
game.ball2.ypos = _root.jay._y + 8;
game.ball3.ypos = _root.jay._y + 18;
if (_root.jay._x < _root.ball1._x) {
_root.ball2._x = _root.jay._x + 10;
_root.ball3._x = _root.jay._x - 15;
} else {
_root.ball2._x = _root.jay._x + 10;
_root.ball3._x = _root.jay._x - 15;
}
}
}
if (_root.ball1._y != floor) {
decay = 1.28;
}
}
if (Key.isDown(lhKick) || (Key.isDown(rhKick))) {
if ((this.jay.kick._currentframe >= 5) && (this.jay.kick._currentframe <= 12)) {
_root.keyhead = false;
_root.keyknee = false;
_root.keykick = true;
_root.game.ball2.ypos = _root.jay._y + 22;
_root.game.ball3.ypos = _root.jay._y + 24;
if (faceeast) {
if (_root.jay._x < _root.ball1._x) {
_root.ball2._x = _root.jay._x + 3;
_root.ball3._x = _root.jay._x + 23;
} else {
_root.ball2._x = _root.jay._x - 4;
_root.ball3._x = _root.jay._x + 14;
}
} else if (_root.jay._x < _root.ball1._x) {
_root.ball2._x = _root.jay._x;
_root.ball3._x = _root.jay._x - 20;
} else {
_root.ball2._x = _root.jay._x + 4;
_root.ball3._x = _root.jay._x - 16;
}
}
if (_root.ball1._y != floor) {
decay = 1.58;
}
}
if (Key.isDown(37) || (Key.isDown(90))) {
_root.ball2._x = _root.ball2._x - 5;
_root.ball3._x = _root.ball3._x - 5;
}
if (Key.isDown(39) || (Key.isDown(88))) {
_root.game.ball1._x = _root.game.ball1._x - _root.midscroll;
_root.ball2._x = _root.ball2._x + 5;
_root.ball3._x = _root.ball3._x + 5;
}
if ((Key.isDown(38) || (Key.isDown(_root.rhjump))) && (ballcount == 0)) {
if (_root.ball1._y == floor) {
_root.ball2._y = _root.ball2._y - 2;
_root.ball3._y = _root.ball3._y - 2;
decay = decay + 0.035;
}
if (decay <= 1.06) {
decay = decay + 0.13;
}
_root.ball2._y = _root.ball2._y - 12;
_root.ball3._y = _root.ball3._y - 12;
ballcount = 10;
}
if (_root.ball2._y < (floor - 20)) {
_root.ball2._y = _root.ball2._y + 1;
_root.ball3._y = _root.ball3._y + 1;
}
_local3.tempx = _root.ball2._x;
_local3.xpos = _local3.tempx;
game.ball3.tempx = _root.ball3._x;
game.ball3.xpos = game.ball3.tempx;
}
if (_local4 == 1) {
if (_root.ballscroll == 1) {
game.ball1.xpos = game.ball1.xpos - _root.midscroll;
trace(ballscroll);
}
oldbally = newbally;
newbally = _local3.clip._y;
if (_local3.ypos >= floor) {
_local3.tempy = floor;
_local3.ypos = floor;
_local3.ymov = _local3.ymov * (-0.48 * decay);
if (_root.floorit > 0) {
_root.floorit = _root.floorit - 1;
floorsound = new Sound();
floorsound.attachSound("floor");
floorsound.start(0, 1);
_root.floorsound.volume(_root.floorit);
trace(_root.floorit);
}
if (ballOutOfPlay == false) {
ballOutOfPlay = true;
numOfBalls = numOfBalls - 1;
floorsound = new Sound();
floorsound.attachSound("w");
floorsound.start(0, 1);
_root.floorit = 15;
floorsound = new Sound();
floorsound.attachSound("floor");
floorsound.start(0, 1);
_root.floorsound.volume(_root.floorit);
if (numOfBalls == 0) {
gotoAndStop ("endgamefail");
}
currentBounces = 0;
scoreLevel = 0;
if (score >= bestScore) {
bestScore = score;
}
game.ball1.tempx = game.ball1.xpos;
game.ball1.tempy = game.ball1.ypos;
game.ball1.ypos = game.ball1.tempy;
_root.scoreballs.gotoAndStop(11 - numOfBalls);
}
}
_local3.xmov = _local3.xmov * friction;
_local3.tempx = _local3.tempx * friction;
_local3.tempx = _local3.xpos + _local3.xmov;
_local3.tempy = _local3.ypos + _local3.ymov;
}
_local4++;
}
game.ball2.tempx = game.ball2.xpos;
game.ball3.tempy = game.ball3.ypos;
game.ball2.xpos = game.ball2.tempx;
game.ball3.ypos = game.ball3.tempy;
_root.ball2._y = game.ball2.ypos;
_root.ball3._y = game.ball3.ypos;
}
function reducedecay() {
if (decay >= 2.2) {
decay = 2;
}
if (decay >= 0) {
decay = decay - 0.00399;
}
if ((decay <= 0.96) and (_root.ball1._y >= (floor - 40))) {
decay = 0;
}
}
function ballToBallDetection(b1, b2) {
bounce = false;
var _local12 = b1.xmov;
var _local10 = b1.ymov;
var _local11 = b2.xmov;
var _local9 = b2.ymov;
var _local6 = b1.xpos;
var _local5 = b1.ypos;
var _local8 = b2.xpos;
var _local7 = b2.ypos;
var _local17 = b1.radius + b2.radius;
var _local24 = (((-2 * _local12) * _local11) + (_local12 * _local12)) + (_local11 * _local11);
var _local23 = ((((-2 * _local6) * _local11) - ((2 * _local8) * _local12)) + ((2 * _local6) * _local12)) + ((2 * _local8) * _local11);
var _local22 = (((-2 * _local6) * _local8) + (_local6 * _local6)) + (_local8 * _local8);
var _local21 = (((-2 * _local10) * _local9) + (_local10 * _local10)) + (_local9 * _local9);
var _local20 = ((((-2 * _local5) * _local9) - ((2 * _local7) * _local10)) + ((2 * _local5) * _local10)) + ((2 * _local7) * _local9);
var _local30 = (((-2 * _local5) * _local7) + (_local5 * _local5)) + (_local7 * _local7);
var _local16 = _local24 + _local21;
var _local13 = _local23 + _local20;
var _local28 = (_local22 + _local30) - (_local17 * _local17);
var _local18 = Math.sqrt((_local13 * _local13) - ((4 * _local16) * _local28));
var _local15 = ((-_local13) + _local18) / (2 * _local16);
var _local14 = ((-_local13) - _local18) / (2 * _local16);
if ((_local15 > 0) && (_local15 <= 1)) {
var _local31 = _local15;
var _local26 = true;
if ((b2.number >= 4) && (b2.number <= 11)) {
floorsound = new Sound();
floorsound.attachSound("floor");
floorsound.start(0, 1);
}
if (b2.number > 11) {
var _local32 = true;
_local26 = false;
if (b2.radius == 10) {
_root.score = _root.score + 10;
coinsound = new Sound();
coinsound.attachSound("coin");
coinsound.start(0, 1);
b2.clip._x = -30;
b2.clip._y = -30;
b2.clip.xpos = 0;
b2.clip.ypos = 0;
b2.clip.ymov = 0;
b2.clip.xmov = 0;
b2.clip.tempx = 0;
b2.clip.tempy = 0;
var _local29 = b2.number;
var _local4 = "ball" + _local29;
game[_local4].xpos = game[_local4].clip._x;
game[_local4].ypos = game[_local4].clip._y;
game[_local4].radius = game[_local4].clip._width / 2;
game[_local4].xmov = 0;
game[_local4].ymov = 0;
game[_local4].rotation = game[_local4].clip._rotation;
bounce = false;
ballscollided = false;
_root.totalcollectables = _root.totalcollectables + 1;
}
}
}
if ((_local14 > 0) && (_local14 <= 1)) {
if ((_local31 == null) || (_local14 < _local15)) {
var _local31 = _local14;
var _local26 = true;
if ((b2.number >= 4) && (b2.number <= 11)) {
floorsound = new Sound();
floorsound.attachSound("floor");
floorsound.start(0, 1);
objectbounces = true;
}
if (b2.number > 11) {
var _local32 = true;
_local26 = false;
if (b2.radius == 10) {
_root.score = _root.score + 10;
coinsound = new Sound();
coinsound.attachSound("coin");
coinsound.start(0, 1);
b2.clip._x = -30;
b2.clip._y = -30;
b2.clip.xpos = 0;
b2.clip.ypos = 0;
b2.clip.ymov = 0;
b2.clip.xmov = 0;
b2.clip.tempx = 0;
b2.clip.tempy = 0;
var _local29 = b2.number;
var _local4 = "ball" + _local29;
game[_local4].xpos = game[_local4].clip._x;
game[_local4].ypos = game[_local4].clip._y;
game[_local4].radius = game[_local4].clip._width / 2;
game[_local4].xmov = 0;
game[_local4].ymov = 0;
game[_local4].rotation = game[_local4].clip._rotation;
bounce = false;
ballscollided = false;
_root.totalcollectables = _root.totalcollectables + 1;
}
}
}
}
if (_local26) {
if (b2.radius == 3) {
bounce = eval("TRUE");
if (_root.ball1._y < 380) {
ballOutOfPlay = false;
}
bounce = true;
b1.xmov = b1.xmov + 2.888;
}
if (b2.radius == 2.5) {
bounce = eval("TRUE");
if (_root.ball1._y < 380) {
ballOutOfPlay = false;
}
bounce = true;
b1.xmov = b1.xmov + 2.88;
}
b1.xmov = b1.xmov * friction;
var _local27 = _local8 - _local6;
var _local25 = _local7 - _local5;
var _local19 = Math.atan2(_local25, _local27);
_local19 = (_local19 * Math.PI) / 180;
b1.tempx = _local6;
b1.tempy = _local5;
b1.ymov = b1.ymov * (-1 * decay);
if (faceeast) {
b1.xmov = b1.xmov * b1.xmov;
} else {
b1.xmov = b1.xmov * (-b1.xmov);
}
}
if (b1.xmov >= 2) {
b1.xmov = 2;
}
if (b1.xmov <= -2) {
b1.xmov = -2;
}
if ((b1.xpos - b1.tempx) == 0) {
_root.game.ball1._x = _root.game.ball1._x + 0.1;
b1.tempx = b1.tempx + 0.1;
b1.xpos = b1.xpos + 0.1;
}
if (bounce == true) {
bounce == false;
if (_root.keyhead) {
headsound = new Sound();
headsound.attachSound("head");
headsound.start(0, 1);
}
if (_root.keyknee) {
kneesound = new Sound();
kneesound.attachSound("knee");
kneesound.start(0, 1);
}
if (_root.keykick) {
kicksound = new Sound();
kicksound.attachSound("kick");
kicksound.start(0, 1);
}
if ((_root.objectbounces = true)) {
floorsound = new Sound();
floorsound.attachSound("floor");
floorsound.start(0, 1);
}
currentBounces = currentBounces + 1;
score = score + scoring[scoreLevel];
if (currentBounces >= bestKeepyUps) {
bestKeepyUps = currentBounces;
}
if (currentBounces == bounces[scoreLevel]) {
scoreLevel = scoreLevel + 1;
}
}
}
function fallball() {
if (_root.superkicker != 1) {
game.ball1.ymov = game.ball1.ymov + gravity;
if (game.ball1.ymov > 12) {
game.ball1.ymov = 12;
}
} else {
game.ball1.ymov = game.ball1.ymov * 0.91;
game.ball1.tempx = game.ball1.clip._x;
if (game.ball1.ymov > 12) {
game.ball1.ymov = 12;
}
}
}
function renderBalls() {
var _local2 = game.ball1;
if (_root.exitlevel == true) {
_local2.tempx = 2000;
}
if (i == 2) {
_local2.tempx = _root.ball2._x;
trace(_local2.xpos);
}
_local2.xpos = _local2.tempx;
_local2.ypos = _local2.tempy;
_local2.clip._x = _local2.xpos;
_local2.clip._y = _local2.ypos;
if (ballscroll == 0) {
_local2.clip.ball_design._rotation = _local2.xpos * 5;
} else {
_local2.clip.ball_design._rotation = _local2.xpos + (Math.floor(midscroll) * 5);
}
if (_root.exitlevel == false) {
ball_shadow._x = game.ball1.clip._x;
ball_shadow._y = floor + 12;
jay_Shadow._x = _root.jay._x - 55;
jay_Shadow._y = floor - 10;
jay_Shadow._alpha = jay._y * 0.1289;
}
}
function checkfoot() {
if (foot_mc._y <= (390 + (foot_mc._width / 2))) {
foot_mc._y = foot_mc._y + 1;
}
xfoot = foot_mc._x;
var _local5 = foot_mc._x;
var _local2 = foot_mc._y;
var _local4 = ball_mc._x;
var _local1 = ball_mc._y;
var _local6 = ball_mc._width / 2;
var _local3 = foot_mc._width / 2;
var _local7 = Math.sqrt(((_local4 - _local5) * (_local4 - _local5)) + ((_local1 - _local2) * (_local1 - _local2)));
if (_local7 <= (_local6 + _local3)) {
if (decay <= 1.06) {
decay = decay + 0.13;
ball_mc._y = (_local2 - abradius) - _local3;
foot_mc._y = (_local1 + abradius) + _local3;
ymov = ymov * (-1 * decay);
}
}
}
function checkmovey() {
if (oldbally >= newbally) {
onthewaydown = 0;
} else {
onthewaydown = 1;
}
}
function checkedges() {
if (_root.ball1._x >= 800) {
_root.ball1._x = 800;
game.ball1.xmov = game.ball1.xmov * -1;
}
if (_root.ball1._x <= ((_root.ball1._width / 2) - random(10))) {
_root.ball1._x = (_root.ball1._width / 2) - random(10);
game.ball1.xmov = game.ball1.xmov * -1;
}
}
function checkscroll() {
if (_root.superkicker == 0) {
if (game.ball1.xpos >= 189) {
scrollokay = true;
} else {
scrollokay = false;
}
if ((scrollokay == true) && (background001._x > -130)) {
if (Key.isDown(39) || (Key.isDown(rhmoveright))) {
background001._x = background001._x - _root.backscroll;
collision006._x = collision006._x - _root.backscroll;
collision007._x = collision007._x - _root.backscroll;
_root.ballscroll = 1;
_root.hole1._x = _root.hole1._x - _root.backscroll;
_root.hole2._x = _root.hole2._x - _root.backscroll;
_root.hole3._x = _root.hole3._x - _root.backscroll;
_root.hole4._x = _root.hole4._x - _root.backscroll;
_root.hole5._x = _root.hole5._x - _root.backscroll;
_root.hole6._x = _root.hole6._x - _root.backscroll;
_root.hole7._x = _root.hole7._x - _root.backscroll;
_root.hole8._x = _root.hole8._x - _root.backscroll;
_root.hole9._x = _root.hole9._x - _root.backscroll;
_root.hole10._x = _root.hole10._x - _root.backscroll;
collision008._x = collision008._x - _root.backscroll;
midground001._x = midground001._x - _root.midscroll;
midground002._x = midground002._x - _root.midscroll;
midground003._x = midground003._x - _root.midscroll;
midground004._x = midground004._x - _root.midscroll;
collision003._x = collision003._x - _root.midscroll;
collision004._x = collision004._x - _root.midscroll;
collision005._x = collision005._x - _root.midscroll;
foreground001._x = foreground001._x - _root.forescroll;
foreground002._x = foreground002._x - _root.forescroll;
ball4._x = ball4._x - _root.midscroll;
ball5._x = ball5._x - _root.midscroll;
ball6._x = ball6._x - _root.midscroll;
ball7._x = ball7._x - _root.midscroll;
ball8._x = ball8._x - _root.midscroll;
ball9._x = ball9._x - _root.midscroll;
ball10._x = ball10._x - _root.midscroll;
ball11._x = ball11._x - _root.midscroll;
ball12._x = ball12._x - _root.midscroll;
ball13._x = ball13._x - _root.midscroll;
ball14._x = ball14._x - _root.midscroll;
ball15._x = ball15._x - _root.midscroll;
ball16._x = ball16._x - _root.midscroll;
ball17._x = ball17._x - _root.midscroll;
ball18._x = ball18._x - _root.midscroll;
ball19._x = ball19._x - _root.midscroll;
ball20._x = ball20._x - _root.midscroll;
ball21._x = ball21._x - _root.midscroll;
ball22._x = ball22._x - _root.midscroll;
ball23._x = ball23._x - _root.midscroll;
ball24._x = ball24._x - _root.midscroll;
ball25._x = ball25._x - _root.midscroll;
ball26._x = ball26._x - _root.midscroll;
ball27._x = ball27._x - _root.midscroll;
ball28._x = ball28._x - _root.midscroll;
ball29._x = ball29._x - _root.midscroll;
ball30._x = ball30._x - _root.midscroll;
_root.game.ball4.xpos = ball4._x;
_root.game.ball5.xpos = ball5._x;
_root.game.ball6.xpos = ball6._x;
_root.game.ball7.xpos = ball7._x;
_root.game.ball8.xpos = ball8._x;
_root.game.ball9.xpos = ball9._x;
_root.game.ball10.xpos = ball10._x;
_root.game.ball11.xpos = ball11._x;
_root.game.ball12.xpos = ball12_x;
_root.game.ball13.xpos = ball13._x;
_root.game.ball14.xpos = ball14._x;
_root.game.ball15.xpos = ball15._x;
_root.game.ball16.xpos = ball16._x;
_root.game.ball17.xpos = ball17._x;
_root.game.ball18.xpos = ball18._x;
_root.game.ball19.xpos = ball19._x;
_root.game.ball20.xpos = ball20._x;
_root.game.ball21.xpos = ball21._x;
_root.game.ball22.xpos = ball22._x;
_root.game.ball23.xpos = ball23._x;
_root.game.ball24.xpos = ball24._x;
_root.game.ball25.xpos = ball25._x;
_root.game.ball26.xpos = ball26._x;
_root.game.ball27.xpos = ball27._x;
_root.game.ball28.xpos = ball28._x;
_root.game.ball29.xpos = ball29._x;
_root.game.ball30.xpos = ball30._x;
}
}
}
}
function collisionscheck() {
if (_root.collision006.hitTest(_root.ball1._x, _root.ball1._y, true)) {
if (_root.ring._currentframe == 1) {
_root.specialsuperkick = true;
_root.ring.gotoAndPlay(2);
}
} else {
_root.specialsuperkick = false;
_root.ring.gotoAndStop(1);
}
if ((_root.collision003.hitTest(jay._x, jay._y, true) || (_root.collision004.hitTest(jay._x, jay._y, true))) || (_root.collision005.hitTest(jay._x, jay._y, true))) {
_root.jay.yspeed = 0;
_root.jay.xspeed = 0;
_root.jay._x = oldjayx;
_root.jay._y = oldjayy;
if (_root.collision003.hitTest(jay._x, jay._y, true) && (oldjayy < 355)) {
_root.jay._y = 382 - (_root.jay._height / 2);
}
_root.jay.floor = _root.jay._y;
} else {
_root.jay.floor = _root.floor - 38;
}
if (_root.collision008.hitTest(jay._x, jay._y, true) && (_root.collision008.hitTest(ball1._x, ball2._y, true))) {
_root.exitlevel = true;
_root.jay_Shadow._x = 2000;
_root.jay_Shadow._alpha = 0;
_root.ball1._alpha = 0;
_root.ball_shadow._alpha = 0;
_root.jay.gotoAndStop(6);
_root.jay.jay_exit.gotoAndPlay(1);
hornsound = new Sound();
hornsound.attachSound("horn");
hornsound.start(0, 1);
}
}
function chipup() {
if ((Key.isDown(40) || (Key.isDown(_root.rhchip))) && (ballOutOfPlay)) {
if (_root.game.ball1.tempy > 350) {
_root.game.ball1.ymov = _root.game.ball1.ymov - 3;
_root.game.ball1.tempy = _root.game.ball1.tempy + game.ball1.ymov;
decay = 7.01;
}
}
}
function nowzoomball() {
if (_root.zoomcounter >= 1) {
_root.zoomcounter = _root.zoomcounter - 1;
_root.ballspeed = _root.ballspeed + 0.015;
_root.superball._xscale = _root.superball._xscale - _root.ballspeed;
_root.superball._yscale = _root.superball._yscale - _root.ballspeed;
if (_root.superball._y >= 237) {
_root.superball._y = _root.superball._y - _root.amounttomoveup;
} else {
_root.superball._y = _root.superball._y + _root.amounttomoveup;
}
} else {
if (_root.collision007.hitTest(superball._x, superball._y, true)) {
_root.showme = false;
_root.score = _root.score + 100;
if (numOfBalls <= 9) {
numOfBalls = numOfBalls + 1;
newballsound = new Sound();
newballsound.attachSound("newball");
newballsound.start(0, 1);
_root.scoreballs.gotoAndStop(11 - numOfBalls);
}
} else {
_root.showme = false;
}
if ((_root.showme = true)) {
holeindex++;
if (holeindex >= 11) {
holeindex = 1;
}
var _local2 = "hole" + holeindex;
hole[_local2].xpos = _root.superball._x;
hole[_local2].ypos = _root.superball._y;
hole[_local2].rotation = _root.superball.rotation;
_root[_local2]._x = hole[_local2].xpos;
_root[_local2]._y = hole[_local2].ypos;
_root[_local2]._rotation = hole[_local2].rotation;
}
holesound = new Sound();
holesound.attachSound("hole");
holesound.start(0, 1);
_root.superball._x = -100;
_root.superball._xscale = 21;
_root.superball._yscale = 21;
_root.superball._alpha = 0;
_root.ball1._alpha = 100;
_root.zoomball = 0;
_root.superkickcounter = 0;
_root.superkicker = 0;
}
}
stopAllSounds();
stop();
jay.gravity = 1.85;
jay.yspeed = 0;
jay.jump = true;
jay.jumpHeight = 20;
jay.floor = 430 - (_root.jay._height / 2);
var gravity = 0.95;
var decay = 1.5;
var friction = 0.995111;
var floor = 400;
var rot = 0;
var ballcount = 0;
var onthewaydown = 0;
var oldbally = 0;
var newbally = 0;
var edgelean = 0;
var score = 0;
var scoreLevel = 0;
var currentBounces = 0;
var bestScore = 0;
var numOfBalls = 11;
var bounce = false;
var bestKeepyUps = 0;
var gamePause = eval("True");
var scrollokay = false;
var scrollspeed = 0;
var playerxpos = 0;
var playerypos = 0;
var ballOutOfPlay = false;
var oldjayx = _root.jay._x;
var oldjayy = _root.jay._y;
var backscroll = 2;
var midscroll = 3;
var forescroll = 4;
var ballscroll = 0;
var lhHead = 82;
var lhKnee = 70;
var lhKick = 86;
var rhHead = 79;
var rhKnee = 75;
var rhKick = 77;
var rhchip = 78;
var rhmoveleft = 90;
var rhmoveright = 88;
var rhjump = 67;
var faceeast = true;
var superkicker = 0;
var newframe = 0;
var superkickcounter = 0;
var oldballx = 0;
var zoomball = 0;
var zoomcounter = 0;
var amounttomoveup = 0;
var ballspeed = 0;
var holdthisxposition = 0;
var totalcollectables = 0;
var lookangle = 0;
var ballcounter = 0;
var keydownLeft = false;
var keydownRight = false;
var keyhead = false;
var keyknee = false;
var keykick = false;
var floorit = 0;
var objectbounces = false;
var jayx = 0;
var specialsuperkick = false;
var showme = true;
var exitlevel = false;
var continuescreen = "endoflevel1";
ball_shadow._y = floor - 10;
_root.jay_Shadow._alpha = 100;
var scoring = new Array();
scoring[0] = 1;
scoring[1] = 2;
scoring[2] = 5;
scoring[3] = 10;
scoring[4] = 20;
scoring[5] = 40;
scoring[6] = 40;
scoring[7] = 40;
scoring[8] = 40;
var bounces = new Array();
bounces[0] = 10;
bounces[1] = 20;
bounces[2] = 30;
bounces[3] = 40;
bounces[4] = 50;
bounces[5] = 60;
bounces[6] = 70;
bounces[7] = 80;
bounces[8] = 90000 /* 0x015F90 */;
_root.ball2._alpha = 0;
_root.ball3._alpha = 0;
_root.ball_shadow._alpha = 100;
var game = {};
game.numBalls = 30;
var i = 1;
while (i <= game.numBalls) {
var name = ("ball" + i);
game[name] = {};
game[name].clip = _root[name];
game[name].xpos = game[name].clip._x;
game[name].ypos = game[name].clip._y;
game[name].radius = game[name].clip._width / 2;
game[name].xmov = 0;
game[name].ymov = 0;
game[name].rotation = game[name].clip._rotation;
game[name].number = i;
i++;
}
game.ball1.xmov = 1.2;
game.ball1.mass = 20;
game.ball1.ymov = 2;
game.ball2.xpos = _root.ball2._x;
game.ball2.ypos = _root.ball2._y;
game.ball3.xpos = _root.ball3._x;
game.ball3.ypos = _root.ball3._y;
_root.scoreballs.gotoAndStop(1);
var hole = {};
hole.numHoles = 10;
var holeindex = 0;
var i = 1;
while (i <= hole.numHoles) {
var name = ("hole" + i);
hole[name] = {};
hole[name].clip = _root[name];
hole[name].xpos = game[name].clip._x;
hole[name].ypos = game[name].clip._y;
hole[name].rotation = game[name].clip._rotation;
i++;
}
streetsound = new Sound();
streetsound.attachSound("office");
streetsound.start(0, 99);
_root.onEnterFrame = function () {
if (_root.exitlevel == true) {
_root.jay._y = floor - 38;
renderBalls();
}
if (_root.exitlevel == false) {
_root.jayx = _root.jay._x;
_root.ballx = _root.ball1._x;
_root.bgdx = _root.background001._x;
if (superkicker != 0) {
_root.game.ball1._x = Math.floor(_root.holdthisxposition);
_root.game.ball1.xpos = Math.floor(_root.holdthisxposition);
_root.game.ball1.tempx = Math.floor(_root.holdthisxposition);
if (superkicker < 2) {
_root.superball._x = _root.game.ball1.tempx;
_root.superball._y = _root.game.ball1.tempy;
}
}
if (_root.numOfBalls <= 9) {
if (_root.totalcollectables >= 5) {
_root.numOfBalls = _root.numOfBalls + 1;
newballsound = new Sound();
newballsound.attachSound("newball");
newballsound.start(0, 1);
_root.scoreballs.gotoAndStop(11 - numOfBalls);
_root.totalcollectables = _root.totalcollectables - 5;
}
}
_root.ring._x = _root.ball1._x;
_root.ring._y = _root.ball1._y;
if (_root.zoomball == 2) {
nowzoomball();
}
chipup();
ballscroll = 0;
checkscroll();
if (game.ball1.ymov > 12) {
game.ball1.ymov = 12;
}
if (ballOutOfPlay == true) {
currentBounces = 0;
scoreLevel = 0;
}
oldjayx = _root.jay._x;
oldjayy = _root.jay._y;
game.ball2.ypos = -10;
game.ball3.ypos = -10;
if (ballcount != 0) {
ballcount = ballcount - 1;
}
reducedecay();
checkedges();
moveBalls();
fallball();
checkmovey();
if (onthewaydown == 1) {
ballToBallDetection(game.ball1, game.ball2);
ballToBallDetection(game.ball1, game.ball3);
ballToBallDetection(game.ball1, game.ball4);
ballToBallDetection(game.ball1, game.ball5);
ballToBallDetection(game.ball1, game.ball6);
ballToBallDetection(game.ball1, game.ball7);
ballToBallDetection(game.ball1, game.ball8);
ballToBallDetection(game.ball1, game.ball9);
ballToBallDetection(game.ball1, game.ball10);
ballToBallDetection(game.ball1, game.ball11);
}
ballToBallDetection(game.ball1, game.ball12);
ballToBallDetection(game.ball1, game.ball13);
ballToBallDetection(game.ball1, game.ball14);
ballToBallDetection(game.ball1, game.ball15);
ballToBallDetection(game.ball1, game.ball16);
ballToBallDetection(game.ball1, game.ball17);
ballToBallDetection(game.ball1, game.ball18);
ballToBallDetection(game.ball1, game.ball19);
ballToBallDetection(game.ball1, game.ball20);
ballToBallDetection(game.ball1, game.ball21);
ballToBallDetection(game.ball1, game.ball22);
ballToBallDetection(game.ball1, game.ball23);
ballToBallDetection(game.ball1, game.ball24);
ballToBallDetection(game.ball1, game.ball25);
ballToBallDetection(game.ball1, game.ball26);
ballToBallDetection(game.ball1, game.ball27);
ballToBallDetection(game.ball1, game.ball28);
ballToBallDetection(game.ball1, game.ball29);
ballToBallDetection(game.ball1, game.ball30);
collisionscheck();
renderBalls();
ball_shadow._x = game.ball1.xpos;
ball_shadow._alpha = game.ball1.ypos * 0.092;
ball_shadow._xscale = game.ball1.ypos / 3;
if ((Key.isDown(32) && (_root.superkickcounter == 0)) && (_root.superkicker == 0)) {
_root.holdthisxposition = _root.game.ball1.xpos;
_root.superkickcounter = _root.superkickcounter + 1;
_root.superkicker = 1;
_root.jay.gotoAndStop(5);
_root.jay.superkick.gotoAndPlay(1);
bionicsound = new Sound();
bionicsound.attachSound("bionic");
bionicsound.start(0, 1);
_root.superball._x = _root.ball1._x;
_root.superball._y = _root.ball1._y;
_root.superball._xscale = _root.ball1._xscale;
_root.superball._yscale = _root.ball1._yscale;
_root.superball._rotation = _root.ball1._rotation;
_root.superball._alpha = 100;
_root.ball1._alpha = 0;
}
if ((Key.isDown(32) && (_root.superkickcounter >= 20)) && (_root.superkicker == 1)) {
_root.superkicker = 2;
_root.newframe = _root.jay.superkick._currentframe;
_root.newframe = Math.floor((_root.newframe / 4) + 2) + 209;
if ((_root.newframe >= 223) && (_root.newframe <= 240)) {
trace(Math.abs(_root.jay._y - _root.ball1._y));
if ((((_root.ball1._x > _root.jay._x) && (Math.abs(_root.jay._x - _root.ball1._x) < 50)) && (Math.abs(_root.jay._y - _root.ball1._y) < 50)) && (faceeast)) {
trace("Hit!");
zoomball = 1;
}
if ((((_root.ball1._x < _root.jay._x) && (Math.abs(_root.jay._x - _root.ball1._x) < 50)) && (Math.abs(_root.jay._y - _root.ball1._y) < 50)) && (faceeast != true)) {
trace("Hit!");
zoomball = 1;
}
if (_root.zoomball == 1) {
_root.superball._rotation = _root.ball1._rotation;
_root.superball._x = _root.ball1._x;
_root.superball._y = _root.ball1._y;
_root.superball._xscale = _root.ball1._xscale;
_root.superball._yscale = _root.ball1._yscale;
_root.zoomball = 2;
_root.zoomcounter = 10;
_root.ballspeed = 1.5;
_root.amounttomoveup = Math.abs(_root.superball._y - 237) / 10;
trace(_root.amounttomoveup);
kicksound = new Sound();
kicksound.attachSound("kick");
kicksound.start(0, 1);
}
}
_root.jay.superkick.gotoAndPlay(_root.newframe);
}
if ((_root.superkickcounter >= 1) && (_root.superkickcounter <= 100)) {
_root.superkickcounter = _root.superkickcounter + 1;
} else {
_root.superkickcounter = 0;
_root.superkicker = 0;
_root.superball._x = _root.ball1._x;
_root.superball._y = _root.ball1._y;
_root.ball1._rotation = _root.superball._rotation;
_root.ball1._alpha = 100;
}
}
};
Instance of Symbol 939 MovieClip "jay" in Frame 136
onClipEvent (enterFrame) {
if (_root.exitlevel == false) {
if (_root.superkicker == 0) {
if (Key.isDown(38) || (Key.isDown(_root.rhjump))) {
if (_root.jay.jump == true) {
_root.jay.yspeed = _root.jay.yspeed - _root.jay.jumpHeight;
_root.jay.jump = false;
_root.jay._y = _root.jay._y + _root.jay.yspeed;
}
}
if (_root.jay._y >= _root.jay.floor) {
_root.jay.jump = true;
_root.jay.yspeed = 0;
_root.jay._y = Math.floor(_root.jay.floor);
} else {
_root.jay.yspeed = _root.jay.yspeed + _root.jay.gravity;
_root.jay._y = _root.jay._y + _root.jay.yspeed;
}
if (Key.isDown(37) || (Key.isDown(_root.rhmoveleft))) {
_root.keydownLeft = true;
_root.faceeast = false;
_root.jay._xscale = -100;
if (this._x >= 20) {
this._x = this._x - 6;
}
}
if (Key.isDown(39) || (Key.isDown(_root.rhmoveright))) {
_root.keydownRight = true;
_root.faceeast = true;
_root.jay._xscale = 100;
if (this._x <= 640) {
this._x = this._x + 6;
}
}
}
}
}
onClipEvent (keyDown) {
if (_root.exitlevel == false) {
if (_root.superkicker == 0) {
if ((Key.getCode() == 37) || (Key.getCode() == _root.rhmoveleft)) {
_root.keydownLeft = true;
_root.jay.gotoAndStop(1);
_root.jay.jay_Run.play();
}
if ((Key.getCode() == 39) || (Key.getCode() == _root.rhmoveright)) {
_root.keydownRight = true;
_root.jay.gotoAndStop(1);
_root.jay.jay_Run.play();
}
if (Key.isDown(_root.lhKnee) || (Key.isDown(_root.rhKnee))) {
_root.jay.gotoAndStop(2);
_root.jay.knee.play();
}
if (Key.isDown(_root.lhKick) || (Key.isDown(_root.rhKick))) {
_root.jay.gotoAndStop(3);
_root.jay.kick.play();
}
if (Key.isDown(82) || (Key.isDown(79))) {
_root.jay.gotoAndStop(4);
_root.jay.heads.play();
}
}
}
}
onClipEvent (keyUp) {
if (_root.exitlevel == false) {
if (_root.superkicker == 0) {
if ((Key.getCode() == 37) || (Key.getCode() == _root.rhmoveleft)) {
_root.keydownLeft = false;
_root.jay.jay_Run.stop();
}
if ((Key.getCode() == 39) || (Key.getCode() == _root.rhmoveright)) {
_root.keydownRight = false;
_root.jay.jay_Run.stop();
}
if ((Key.getCode() == _root.lhKnee) || (Key.getCode() == _root.rhKnee)) {
if (_root.keydownLeft || (_root.keydownRight)) {
trace("Sliding!");
_root.jay.gotoAndStop(1);
_root.jay.jay_Run.gotoAndPlay();
}
}
}
}
}
Instance of Symbol 947 MovieClip "ring" in Frame 136
/* no clip actions */
Frame 137
function moveBalls() {
var _local4 = 1;
while (_local4 <= game.numBalls) {
var _local3 = game["ball" + _local4];
if (_local4 == 2) {
if (Key.isDown(_root.lhHead) || (Key.isDown(_root.rhHead))) {
_root.game.ball2.ypos = -10;
_root.game.ball3.ypos = -10;
game.ball2.ypos = _root.jay._y - 40;
game.ball3.ypos = _root.jay._y - 40;
_root.keyhead = true;
_root.keyknee = false;
_root.keykick = false;
if (faceeast) {
if (_root.jay._x < _root.ball1._x) {
_root.ball2._x = _root.jay._x - 20;
_root.ball3._x = _root.jay._x;
} else {
_root.ball2._x = _root.jay._x - 20;
_root.ball3._x = _root.jay._x;
}
} else if (_root.jay._x < _root.ball1._x) {
_root.ball2._x = _root.jay._x - 5;
_root.ball3._x = _root.jay._x + 20;
} else {
_root.ball2._x = _root.jay._x;
_root.ball3._x = _root.jay._x + 20;
}
if (_root.ball1._y != floor) {
decay = 1.28;
}
}
if (Key.isDown(_root.lhKnee) || (Key.isDown(_root.rhKnee))) {
_root.game.ball2.ypos = -10;
_root.game.ball3.ypos = -10;
if ((this.jay.knee._currentframe >= 5) && (this.jay.knee._currentframe <= 10)) {
game.ball2.ypos = _root.jay._y + 8;
game.ball3.ypos = _root.jay._y + 17;
_root.keyhead = false;
_root.keyknee = true;
_root.keykick = false;
if (faceeast) {
if (_root.jay._x < _root.ball1._x) {
_root.ball2._x = _root.jay._x + 4;
_root.ball3._x = _root.jay._x + 14;
} else {
_root.ball2._x = _root.jay._x - 4;
_root.ball3._x = _root.jay._x + 14;
}
} else {
game.ball2.ypos = _root.jay._y + 8;
game.ball3.ypos = _root.jay._y + 18;
if (_root.jay._x < _root.ball1._x) {
_root.ball2._x = _root.jay._x + 10;
_root.ball3._x = _root.jay._x - 15;
} else {
_root.ball2._x = _root.jay._x + 10;
_root.ball3._x = _root.jay._x - 15;
}
}
}
if (_root.ball1._y != floor) {
decay = 1.28;
}
}
if (Key.isDown(lhKick) || (Key.isDown(rhKick))) {
if ((this.jay.kick._currentframe >= 5) && (this.jay.kick._currentframe <= 12)) {
_root.keyhead = false;
_root.keyknee = false;
_root.keykick = true;
_root.game.ball2.ypos = _root.jay._y + 22;
_root.game.ball3.ypos = _root.jay._y + 24;
if (faceeast) {
if (_root.jay._x < _root.ball1._x) {
_root.ball2._x = _root.jay._x + 3;
_root.ball3._x = _root.jay._x + 23;
} else {
_root.ball2._x = _root.jay._x - 4;
_root.ball3._x = _root.jay._x + 14;
}
} else if (_root.jay._x < _root.ball1._x) {
_root.ball2._x = _root.jay._x;
_root.ball3._x = _root.jay._x - 20;
} else {
_root.ball2._x = _root.jay._x + 4;
_root.ball3._x = _root.jay._x - 16;
}
}
if (_root.ball1._y != floor) {
decay = 1.58;
}
}
if (Key.isDown(37) || (Key.isDown(90))) {
_root.ball2._x = _root.ball2._x - 5;
_root.ball3._x = _root.ball3._x - 5;
}
if (Key.isDown(39) || (Key.isDown(88))) {
_root.game.ball1._x = _root.game.ball1._x - _root.midscroll;
_root.ball2._x = _root.ball2._x + 5;
_root.ball3._x = _root.ball3._x + 5;
}
if ((Key.isDown(38) || (Key.isDown(_root.rhjump))) && (ballcount == 0)) {
if (_root.ball1._y == floor) {
_root.ball2._y = _root.ball2._y - 2;
_root.ball3._y = _root.ball3._y - 2;
decay = decay + 0.035;
}
if (decay <= 1.06) {
decay = decay + 0.13;
}
_root.ball2._y = _root.ball2._y - 12;
_root.ball3._y = _root.ball3._y - 12;
ballcount = 10;
}
if (_root.ball2._y < (floor - 20)) {
_root.ball2._y = _root.ball2._y + 1;
_root.ball3._y = _root.ball3._y + 1;
}
_local3.tempx = _root.ball2._x;
_local3.xpos = _local3.tempx;
game.ball3.tempx = _root.ball3._x;
game.ball3.xpos = game.ball3.tempx;
}
if (_local4 == 1) {
if (_root.ballscroll == 1) {
game.ball1.xpos = game.ball1.xpos - _root.midscroll;
trace(ballscroll);
}
oldbally = newbally;
newbally = _local3.clip._y;
if (_local3.ypos >= floor) {
_local3.tempy = floor;
_local3.ypos = floor;
_local3.ymov = _local3.ymov * (-0.48 * decay);
if (_root.floorit > 0) {
_root.floorit = _root.floorit - 1;
floorsound = new Sound();
floorsound.attachSound("floor");
floorsound.start(0, 1);
_root.floorsound.volume(_root.floorit);
trace(_root.floorit);
}
if (ballOutOfPlay == false) {
ballOutOfPlay = true;
numOfBalls = numOfBalls - 1;
floorsound = new Sound();
floorsound.attachSound("w");
floorsound.start(0, 1);
_root.floorit = 15;
floorsound = new Sound();
floorsound.attachSound("floor");
floorsound.start(0, 1);
_root.floorsound.volume(_root.floorit);
if (numOfBalls == 0) {
gotoAndStop ("endgamefail");
}
currentBounces = 0;
scoreLevel = 0;
if (score >= bestScore) {
bestScore = score;
}
game.ball1.tempx = game.ball1.xpos;
game.ball1.tempy = game.ball1.ypos;
game.ball1.ypos = game.ball1.tempy;
_root.scoreballs.gotoAndStop(11 - numOfBalls);
}
}
_local3.xmov = _local3.xmov * friction;
_local3.tempx = _local3.tempx * friction;
_local3.tempx = _local3.xpos + _local3.xmov;
_local3.tempy = _local3.ypos + _local3.ymov;
}
_local4++;
}
game.ball2.tempx = game.ball2.xpos;
game.ball3.tempy = game.ball3.ypos;
game.ball2.xpos = game.ball2.tempx;
game.ball3.ypos = game.ball3.tempy;
_root.ball2._y = game.ball2.ypos;
_root.ball3._y = game.ball3.ypos;
}
function reducedecay() {
if (decay >= 2.2) {
decay = 2;
}
if (decay >= 0) {
decay = decay - 0.00399;
}
if ((decay <= 0.96) and (_root.ball1._y >= (floor - 40))) {
decay = 0;
}
}
function ballToBallDetection(b1, b2) {
bounce = false;
var _local12 = b1.xmov;
var _local10 = b1.ymov;
var _local11 = b2.xmov;
var _local9 = b2.ymov;
var _local6 = b1.xpos;
var _local5 = b1.ypos;
var _local8 = b2.xpos;
var _local7 = b2.ypos;
var _local17 = b1.radius + b2.radius;
var _local24 = (((-2 * _local12) * _local11) + (_local12 * _local12)) + (_local11 * _local11);
var _local23 = ((((-2 * _local6) * _local11) - ((2 * _local8) * _local12)) + ((2 * _local6) * _local12)) + ((2 * _local8) * _local11);
var _local22 = (((-2 * _local6) * _local8) + (_local6 * _local6)) + (_local8 * _local8);
var _local21 = (((-2 * _local10) * _local9) + (_local10 * _local10)) + (_local9 * _local9);
var _local20 = ((((-2 * _local5) * _local9) - ((2 * _local7) * _local10)) + ((2 * _local5) * _local10)) + ((2 * _local7) * _local9);
var _local30 = (((-2 * _local5) * _local7) + (_local5 * _local5)) + (_local7 * _local7);
var _local16 = _local24 + _local21;
var _local13 = _local23 + _local20;
var _local28 = (_local22 + _local30) - (_local17 * _local17);
var _local18 = Math.sqrt((_local13 * _local13) - ((4 * _local16) * _local28));
var _local15 = ((-_local13) + _local18) / (2 * _local16);
var _local14 = ((-_local13) - _local18) / (2 * _local16);
if ((_local15 > 0) && (_local15 <= 1)) {
var _local31 = _local15;
var _local26 = true;
if ((b2.number >= 4) && (b2.number <= 11)) {
floorsound = new Sound();
floorsound.attachSound("floor");
floorsound.start(0, 1);
}
if (b2.number > 11) {
var _local32 = true;
_local26 = false;
if (b2.radius == 10) {
_root.score = _root.score + 10;
coinsound = new Sound();
coinsound.attachSound("coin");
coinsound.start(0, 1);
b2.clip._x = -30;
b2.clip._y = -30;
b2.clip.xpos = 0;
b2.clip.ypos = 0;
b2.clip.ymov = 0;
b2.clip.xmov = 0;
b2.clip.tempx = 0;
b2.clip.tempy = 0;
var _local29 = b2.number;
var _local4 = "ball" + _local29;
game[_local4].xpos = game[_local4].clip._x;
game[_local4].ypos = game[_local4].clip._y;
game[_local4].radius = game[_local4].clip._width / 2;
game[_local4].xmov = 0;
game[_local4].ymov = 0;
game[_local4].rotation = game[_local4].clip._rotation;
bounce = false;
ballscollided = false;
_root.totalcollectables = _root.totalcollectables + 1;
}
}
}
if ((_local14 > 0) && (_local14 <= 1)) {
if ((_local31 == null) || (_local14 < _local15)) {
var _local31 = _local14;
var _local26 = true;
if ((b2.number >= 4) && (b2.number <= 11)) {
floorsound = new Sound();
floorsound.attachSound("floor");
floorsound.start(0, 1);
objectbounces = true;
}
if (b2.number > 11) {
var _local32 = true;
_local26 = false;
if (b2.radius == 10) {
_root.score = _root.score + 10;
coinsound = new Sound();
coinsound.attachSound("coin");
coinsound.start(0, 1);
b2.clip._x = -30;
b2.clip._y = -30;
b2.clip.xpos = 0;
b2.clip.ypos = 0;
b2.clip.ymov = 0;
b2.clip.xmov = 0;
b2.clip.tempx = 0;
b2.clip.tempy = 0;
var _local29 = b2.number;
var _local4 = "ball" + _local29;
game[_local4].xpos = game[_local4].clip._x;
game[_local4].ypos = game[_local4].clip._y;
game[_local4].radius = game[_local4].clip._width / 2;
game[_local4].xmov = 0;
game[_local4].ymov = 0;
game[_local4].rotation = game[_local4].clip._rotation;
bounce = false;
ballscollided = false;
_root.totalcollectables = _root.totalcollectables + 1;
}
}
}
}
if (_local26) {
if (b2.radius == 3) {
bounce = eval("TRUE");
if (_root.ball1._y < 380) {
ballOutOfPlay = false;
}
bounce = true;
b1.xmov = b1.xmov + 2.888;
}
if (b2.radius == 2.5) {
bounce = eval("TRUE");
if (_root.ball1._y < 380) {
ballOutOfPlay = false;
}
bounce = true;
b1.xmov = b1.xmov + 2.88;
}
b1.xmov = b1.xmov * friction;
var _local27 = _local8 - _local6;
var _local25 = _local7 - _local5;
var _local19 = Math.atan2(_local25, _local27);
_local19 = (_local19 * Math.PI) / 180;
b1.tempx = _local6;
b1.tempy = _local5;
b1.ymov = b1.ymov * (-1 * decay);
if (faceeast) {
b1.xmov = b1.xmov * b1.xmov;
} else {
b1.xmov = b1.xmov * (-b1.xmov);
}
}
if (b1.xmov >= 2) {
b1.xmov = 2;
}
if (b1.xmov <= -2) {
b1.xmov = -2;
}
if ((b1.xpos - b1.tempx) == 0) {
_root.game.ball1._x = _root.game.ball1._x + 0.1;
b1.tempx = b1.tempx + 0.1;
b1.xpos = b1.xpos + 0.1;
}
if (bounce == true) {
bounce == false;
if (_root.keyhead) {
headsound = new Sound();
headsound.attachSound("head");
headsound.start(0, 1);
}
if (_root.keyknee) {
kneesound = new Sound();
kneesound.attachSound("knee");
kneesound.start(0, 1);
}
if (_root.keykick) {
kicksound = new Sound();
kicksound.attachSound("kick");
kicksound.start(0, 1);
}
if ((_root.objectbounces = true)) {
floorsound = new Sound();
floorsound.attachSound("floor");
floorsound.start(0, 1);
}
currentBounces = currentBounces + 1;
score = score + scoring[scoreLevel];
if (currentBounces >= bestKeepyUps) {
bestKeepyUps = currentBounces;
}
if (currentBounces == bounces[scoreLevel]) {
scoreLevel = scoreLevel + 1;
}
}
}
function fallball() {
if (_root.superkicker != 1) {
game.ball1.ymov = game.ball1.ymov + gravity;
if (game.ball1.ymov > 12) {
game.ball1.ymov = 12;
}
} else {
game.ball1.ymov = game.ball1.ymov * 0.91;
game.ball1.tempx = game.ball1.clip._x;
if (game.ball1.ymov > 12) {
game.ball1.ymov = 12;
}
}
}
function renderBalls() {
var _local2 = game.ball1;
if (_root.exitlevel == true) {
_local2.tempx = 2000;
}
if (i == 2) {
_local2.tempx = _root.ball2._x;
trace(_local2.xpos);
}
_local2.xpos = _local2.tempx;
_local2.ypos = _local2.tempy;
_local2.clip._x = _local2.xpos;
_local2.clip._y = _local2.ypos;
if (ballscroll == 0) {
_local2.clip.ball_design._rotation = _local2.xpos * 5;
} else {
_local2.clip.ball_design._rotation = _local2.xpos + (Math.floor(midscroll) * 5);
}
if (_root.exitlevel == false) {
ball_shadow._x = game.ball1.clip._x;
ball_shadow._y = floor + 12;
jay_Shadow._x = _root.jay._x - 55;
jay_Shadow._y = floor - 10;
jay_Shadow._alpha = jay._y * 0.1289;
}
}
function checkfoot() {
if (foot_mc._y <= (390 + (foot_mc._width / 2))) {
foot_mc._y = foot_mc._y + 1;
}
xfoot = foot_mc._x;
var _local5 = foot_mc._x;
var _local2 = foot_mc._y;
var _local4 = ball_mc._x;
var _local1 = ball_mc._y;
var _local6 = ball_mc._width / 2;
var _local3 = foot_mc._width / 2;
var _local7 = Math.sqrt(((_local4 - _local5) * (_local4 - _local5)) + ((_local1 - _local2) * (_local1 - _local2)));
if (_local7 <= (_local6 + _local3)) {
if (decay <= 1.06) {
decay = decay + 0.13;
ball_mc._y = (_local2 - abradius) - _local3;
foot_mc._y = (_local1 + abradius) + _local3;
ymov = ymov * (-1 * decay);
}
}
}
function checkmovey() {
if (oldbally >= newbally) {
onthewaydown = 0;
} else {
onthewaydown = 1;
}
}
function checkedges() {
if (_root.ball1._x >= 800) {
_root.ball1._x = 800;
game.ball1.xmov = game.ball1.xmov * -1;
}
if (_root.ball1._x <= ((_root.ball1._width / 2) - random(10))) {
_root.ball1._x = (_root.ball1._width / 2) - random(10);
game.ball1.xmov = game.ball1.xmov * -1;
}
}
function checkscroll() {
if (_root.superkicker == 0) {
if (game.ball1.xpos >= 189) {
scrollokay = true;
} else {
scrollokay = false;
}
if ((scrollokay == true) && (background001._x > -130)) {
if (Key.isDown(39) || (Key.isDown(rhmoveright))) {
background001._x = background001._x - _root.backscroll;
collision006._x = collision006._x - _root.backscroll;
collision007._x = collision007._x - _root.backscroll;
collision006a._x = collision006a._x - _root.backscroll;
collision007a._x = collision007a._x - _root.backscroll;
_root.ballscroll = 1;
_root.hole1._x = _root.hole1._x - _root.backscroll;
_root.hole2._x = _root.hole2._x - _root.backscroll;
_root.hole3._x = _root.hole3._x - _root.backscroll;
_root.hole4._x = _root.hole4._x - _root.backscroll;
_root.hole5._x = _root.hole5._x - _root.backscroll;
_root.hole6._x = _root.hole6._x - _root.backscroll;
_root.hole7._x = _root.hole7._x - _root.backscroll;
_root.hole8._x = _root.hole8._x - _root.backscroll;
_root.hole9._x = _root.hole9._x - _root.backscroll;
_root.hole10._x = _root.hole10._x - _root.backscroll;
collision008._x = collision008._x - _root.backscroll;
midground000._x = midground000._x - _root.midscroll;
midground001._x = midground001._x - _root.midscroll;
midground002._x = midground002._x - _root.midscroll;
midground003._x = midground003._x - _root.midscroll;
midground004._x = midground004._x - _root.midscroll;
midground010._x = midground010._x - _root.midscroll;
collision003._x = collision003._x - _root.midscroll;
collision004._x = collision004._x - _root.midscroll;
collision005._x = collision005._x - _root.midscroll;
foreground001._x = foreground001._x - _root.forescroll;
foreground002._x = foreground002._x - _root.forescroll;
foreground003._x = foreground003._x - _root.forescroll;
foreground004._x = foreground004._x - _root.forescroll;
ball4._x = ball4._x - _root.midscroll;
ball5._x = ball5._x - _root.midscroll;
ball6._x = ball6._x - _root.midscroll;
ball7._x = ball7._x - _root.midscroll;
ball8._x = ball8._x - _root.midscroll;
ball9._x = ball9._x - _root.midscroll;
ball10._x = ball10._x - _root.midscroll;
ball11._x = ball11._x - _root.midscroll;
ball12._x = ball12._x - _root.midscroll;
ball13._x = ball13._x - _root.midscroll;
ball14._x = ball14._x - _root.midscroll;
ball15._x = ball15._x - _root.midscroll;
ball16._x = ball16._x - _root.midscroll;
ball17._x = ball17._x - _root.midscroll;
ball18._x = ball18._x - _root.midscroll;
ball19._x = ball19._x - _root.midscroll;
ball20._x = ball20._x - _root.midscroll;
ball21._x = ball21._x - _root.midscroll;
ball22._x = ball22._x - _root.midscroll;
ball23._x = ball23._x - _root.midscroll;
ball24._x = ball24._x - _root.midscroll;
ball25._x = ball25._x - _root.midscroll;
ball26._x = ball26._x - _root.midscroll;
ball27._x = ball27._x - _root.midscroll;
ball28._x = ball28._x - _root.midscroll;
ball29._x = ball29._x - _root.midscroll;
ball30._x = ball30._x - _root.midscroll;
_root.game.ball4.xpos = ball4._x;
_root.game.ball5.xpos = ball5._x;
_root.game.ball6.xpos = ball6._x;
_root.game.ball7.xpos = ball7._x;
_root.game.ball8.xpos = ball8._x;
_root.game.ball9.xpos = ball9._x;
_root.game.ball10.xpos = ball10._x;
_root.game.ball11.xpos = ball11._x;
_root.game.ball12.xpos = ball12_x;
_root.game.ball13.xpos = ball13._x;
_root.game.ball14.xpos = ball14._x;
_root.game.ball15.xpos = ball15._x;
_root.game.ball16.xpos = ball16._x;
_root.game.ball17.xpos = ball17._x;
_root.game.ball18.xpos = ball18._x;
_root.game.ball19.xpos = ball19._x;
_root.game.ball20.xpos = ball20._x;
_root.game.ball21.xpos = ball21._x;
_root.game.ball22.xpos = ball22._x;
_root.game.ball23.xpos = ball23._x;
_root.game.ball24.xpos = ball24._x;
_root.game.ball25.xpos = ball25._x;
_root.game.ball26.xpos = ball26._x;
_root.game.ball27.xpos = ball27._x;
_root.game.ball28.xpos = ball28._x;
_root.game.ball29.xpos = ball29._x;
_root.game.ball30.xpos = ball30._x;
}
}
}
}
function collisionscheck() {
if (_root.collision006.hitTest(_root.ball1._x, _root.ball1._y, true) || (_root.collision006a.hitTest(_root.ball1._x, _root.ball1._y, true))) {
if (_root.ring._currentframe == 1) {
_root.specialsuperkick = true;
_root.ring.gotoAndPlay(2);
}
} else {
_root.specialsuperkick = false;
_root.ring.gotoAndStop(1);
}
if ((_root.collision003.hitTest(jay._x, jay._y, true) || (_root.collision004.hitTest(jay._x, jay._y, true))) || (_root.collision005.hitTest(jay._x, jay._y, true))) {
_root.jay.yspeed = 0;
_root.jay.xspeed = 0;
_root.jay._x = oldjayx;
_root.jay._y = oldjayy;
if (_root.collision003.hitTest(jay._x, jay._y, true) && (oldjayy < 355)) {
_root.jay._y = 335 - (_root.jay._height / 2);
}
_root.jay.floor = _root.jay._y;
} else {
_root.jay.floor = _root.floor - 38;
}
if (_root.collision008.hitTest(jay._x, jay._y, true) && (_root.collision008.hitTest(ball1._x, ball2._y, true))) {
_root.exitlevel = true;
_root.ball1._alpha = 0;
_root.ball_shadow._alpha = 0;
_root.jay_Shadow._x = 2000;
_root.jay.gotoAndStop(6);
_root.jay.jay_exit.gotoAndPlay(1);
hornsound = new Sound();
hornsound.attachSound("horn");
hornsound.start(0, 1);
}
}
function chipup() {
if ((Key.isDown(40) || (Key.isDown(_root.rhchip))) && (ballOutOfPlay)) {
if (_root.game.ball1.tempy > 350) {
_root.game.ball1.ymov = _root.game.ball1.ymov - 3;
_root.game.ball1.tempy = _root.game.ball1.tempy + game.ball1.ymov;
decay = 7.01;
}
}
}
function nowzoomball() {
if (_root.zoomcounter >= 1) {
_root.zoomcounter = _root.zoomcounter - 1;
_root.ballspeed = _root.ballspeed + 0.015;
_root.superball._xscale = _root.superball._xscale - _root.ballspeed;
_root.superball._yscale = _root.superball._yscale - _root.ballspeed;
if (_root.superball._y >= 293) {
_root.superball._y = _root.superball._y - _root.amounttomoveup;
} else {
_root.superball._y = _root.superball._y + _root.amounttomoveup;
}
} else {
if (_root.collision007.hitTest(superball._x, superball._y, true) || (_root.collision007a.hitTest(superball._x, superball._y, true))) {
smashsound = new Sound();
smashsound.attachSound("glasssmash");
smashsound.start(0, 1);
_root.score = _root.score + 100;
if (numOfBalls <= 9) {
numOfBalls = numOfBalls + 1;
newballsound = new Sound();
newballsound.attachSound("newball");
newballsound.start(0, 1);
_root.scoreballs.gotoAndStop(11 - numOfBalls);
}
}
holesound = new Sound();
holesound.attachSound("hole");
holesound.start(0, 1);
_root.superball._x = -100;
_root.superball._xscale = 21;
_root.superball._yscale = 21;
_root.superball._alpha = 0;
_root.ball1._alpha = 100;
_root.zoomball = 0;
_root.superkickcounter = 0;
_root.superkicker = 0;
}
}
stopAllSounds();
stop();
jay.gravity = 1.85;
jay.yspeed = 0;
jay.jump = true;
jay.jumpHeight = 20;
jay.floor = 430 - (_root.jay._height / 2);
var gravity = 0.95;
var decay = 1.5;
var friction = 0.995111;
var floor = 400;
var rot = 0;
var ballcount = 0;
var onthewaydown = 0;
var oldbally = 0;
var newbally = 0;
var edgelean = 0;
var bounce = false;
var gamePause = eval("True");
var scrollokay = false;
var scrollspeed = 0;
var playerxpos = 0;
var playerypos = 0;
var ballOutOfPlay = false;
var oldjayx = _root.jay._x;
var oldjayy = _root.jay._y;
var backscroll = 2;
var midscroll = 3;
var forescroll = 4;
var ballscroll = 0;
var lhHead = 82;
var lhKnee = 70;
var lhKick = 86;
var rhHead = 79;
var rhKnee = 75;
var rhKick = 77;
var rhchip = 78;
var rhmoveleft = 90;
var rhmoveright = 88;
var rhjump = 67;
var faceeast = true;
var superkicker = 0;
var newframe = 0;
var superkickcounter = 0;
var oldballx = 0;
var zoomball = 0;
var zoomcounter = 0;
var amounttomoveup = 0;
var ballspeed = 0;
var holdthisxposition = 0;
var totalcollectables = 0;
var lookangle = 0;
var ballcounter = 0;
var keydownLeft = false;
var keydownRight = false;
var keyhead = false;
var keyknee = false;
var keykick = false;
var floorit = 0;
var objectbounces = false;
var jayx = 0;
var specialsuperkick = false;
var exitlevel = false;
var continuescreen = "endoflevel2";
numOfBalls = numOfBalls + 1;
ball_shadow._y = floor - 10;
_root.jay_Shadow._alpha = 100;
var scoring = new Array();
scoring[0] = 1;
scoring[1] = 2;
scoring[2] = 5;
scoring[3] = 10;
scoring[4] = 20;
scoring[5] = 40;
scoring[6] = 40;
scoring[7] = 40;
scoring[8] = 40;
var bounces = new Array();
bounces[0] = 10;
bounces[1] = 20;
bounces[2] = 30;
bounces[3] = 40;
bounces[4] = 50;
bounces[5] = 60;
bounces[6] = 70;
bounces[7] = 80;
bounces[8] = 90000 /* 0x015F90 */;
_root.ball1._alpha = 100;
_root.ball2._alpha = 0;
_root.ball3._alpha = 0;
_root.jay_Shadow._alpha = 100;
_root.ball_shadow._alpha = 100;
game.ball1._alpha = 100;
var game = {};
game.numBalls = 30;
var i = 1;
while (i <= game.numBalls) {
var name = ("ball" + i);
game[name] = {};
game[name].clip = _root[name];
game[name].xpos = game[name].clip._x;
game[name].ypos = game[name].clip._y;
game[name].radius = game[name].clip._width / 2;
game[name].xmov = 0;
game[name].ymov = 0;
game[name].rotation = game[name].clip._rotation;
game[name].number = i;
i++;
}
game.ball1.xmov = 1.2;
game.ball1.mass = 20;
game.ball1.ymov = 2;
game.ball2.xpos = _root.ball2._x;
game.ball2.ypos = _root.ball2._y;
game.ball3.xpos = _root.ball3._x;
game.ball3.ypos = _root.ball3._y;
_root.scoreballs.gotoAndStop(1);
var hole = {};
hole.numHoles = 10;
var holeindex = 0;
var i = 1;
while (i <= hole.numHoles) {
var name = ("hole" + i);
hole[name] = {};
hole[name].clip = _root[name];
hole[name].xpos = game[name].clip._x;
hole[name].ypos = game[name].clip._y;
hole[name].rotation = game[name].clip._rotation;
i++;
}
streetsound = new Sound();
streetsound.attachSound("street");
streetsound.start(0, 99);
_root.scoreballs.gotoAndStop(11 - numOfBalls);
_root.onEnterFrame = function () {
if (_root.exitlevel == true) {
_root.jay._y = floor - 38;
renderBalls();
}
if (_root.exitlevel == false) {
_root.jayx = _root.jay._x;
_root.ballx = _root.ball1._x;
_root.bgdx = _root.background001._x;
if (superkicker != 0) {
_root.game.ball1._x = Math.floor(_root.holdthisxposition);
_root.game.ball1.xpos = Math.floor(_root.holdthisxposition);
_root.game.ball1.tempx = Math.floor(_root.holdthisxposition);
if (superkicker < 2) {
_root.superball._x = _root.game.ball1.tempx;
_root.superball._y = _root.game.ball1.tempy;
}
}
if (_root.numOfBalls <= 9) {
if (_root.totalcollectables >= 5) {
_root.numOfBalls = _root.numOfBalls + 1;
newballsound = new Sound();
newballsound.attachSound("newball");
newballsound.start(0, 1);
_root.scoreballs.gotoAndStop(11 - numOfBalls);
_root.totalcollectables = _root.totalcollectables - 5;
}
}
_root.ring._x = _root.ball1._x;
_root.ring._y = _root.ball1._y;
if (_root.zoomball == 2) {
nowzoomball();
}
chipup();
ballscroll = 0;
checkscroll();
if (game.ball1.ymov > 12) {
game.ball1.ymov = 12;
}
if (ballOutOfPlay == true) {
currentBounces = 0;
scoreLevel = 0;
}
oldjayx = _root.jay._x;
oldjayy = _root.jay._y;
game.ball2.ypos = -10;
game.ball3.ypos = -10;
if (ballcount != 0) {
ballcount = ballcount - 1;
}
reducedecay();
checkedges();
moveBalls();
fallball();
checkmovey();
if (onthewaydown == 1) {
ballToBallDetection(game.ball1, game.ball2);
ballToBallDetection(game.ball1, game.ball3);
ballToBallDetection(game.ball1, game.ball4);
ballToBallDetection(game.ball1, game.ball5);
ballToBallDetection(game.ball1, game.ball6);
ballToBallDetection(game.ball1, game.ball7);
ballToBallDetection(game.ball1, game.ball8);
ballToBallDetection(game.ball1, game.ball9);
ballToBallDetection(game.ball1, game.ball10);
ballToBallDetection(game.ball1, game.ball11);
}
ballToBallDetection(game.ball1, game.ball12);
ballToBallDetection(game.ball1, game.ball13);
ballToBallDetection(game.ball1, game.ball14);
ballToBallDetection(game.ball1, game.ball15);
ballToBallDetection(game.ball1, game.ball16);
ballToBallDetection(game.ball1, game.ball17);
ballToBallDetection(game.ball1, game.ball18);
ballToBallDetection(game.ball1, game.ball19);
ballToBallDetection(game.ball1, game.ball20);
ballToBallDetection(game.ball1, game.ball21);
ballToBallDetection(game.ball1, game.ball22);
ballToBallDetection(game.ball1, game.ball23);
ballToBallDetection(game.ball1, game.ball24);
ballToBallDetection(game.ball1, game.ball25);
ballToBallDetection(game.ball1, game.ball26);
ballToBallDetection(game.ball1, game.ball27);
ballToBallDetection(game.ball1, game.ball28);
ballToBallDetection(game.ball1, game.ball29);
ballToBallDetection(game.ball1, game.ball30);
collisionscheck();
renderBalls();
ball_shadow._x = game.ball1.xpos;
ball_shadow._alpha = game.ball1.ypos * 0.092;
ball_shadow._xscale = game.ball1.ypos / 3;
if ((Key.isDown(32) && (_root.superkickcounter == 0)) && (_root.superkicker == 0)) {
_root.holdthisxposition = _root.game.ball1.xpos;
_root.superkickcounter = _root.superkickcounter + 1;
_root.superkicker = 1;
_root.jay.gotoAndStop(5);
_root.jay.superkick.gotoAndPlay(1);
bionicsound = new Sound();
bionicsound.attachSound("bionic");
bionicsound.start(0, 1);
_root.superball._x = _root.ball1._x;
_root.superball._y = _root.ball1._y;
_root.superball._xscale = _root.ball1._xscale;
_root.superball._yscale = _root.ball1._yscale;
_root.superball._rotation = _root.ball1._rotation;
_root.superball._alpha = 100;
_root.ball1._alpha = 0;
}
if ((Key.isDown(32) && (_root.superkickcounter >= 20)) && (_root.superkicker == 1)) {
_root.superkicker = 2;
_root.newframe = _root.jay.superkick._currentframe;
_root.newframe = Math.floor((_root.newframe / 4) + 2) + 209;
if ((_root.newframe >= 223) && (_root.newframe <= 240)) {
trace(Math.abs(_root.jay._y - _root.ball1._y));
if ((((_root.ball1._x > _root.jay._x) && (Math.abs(_root.jay._x - _root.ball1._x) < 50)) && (Math.abs(_root.jay._y - _root.ball1._y) < 50)) && (faceeast)) {
trace("Hit!");
zoomball = 1;
}
if ((((_root.ball1._x < _root.jay._x) && (Math.abs(_root.jay._x - _root.ball1._x) < 50)) && (Math.abs(_root.jay._y - _root.ball1._y) < 50)) && (faceeast != true)) {
trace("Hit!");
zoomball = 1;
}
if (_root.zoomball == 1) {
_root.superball._rotation = _root.ball1._rotation;
_root.superball._x = _root.ball1._x;
_root.superball._y = _root.ball1._y;
_root.superball._xscale = _root.ball1._xscale;
_root.superball._yscale = _root.ball1._yscale;
_root.zoomball = 2;
_root.zoomcounter = 10;
_root.ballspeed = 1.5;
_root.amounttomoveup = Math.abs(_root.superball._y - 237) / 10;
trace(_root.amounttomoveup);
kicksound = new Sound();
kicksound.attachSound("kick");
kicksound.start(0, 1);
}
}
_root.jay.superkick.gotoAndPlay(_root.newframe);
}
if ((_root.superkickcounter >= 1) && (_root.superkickcounter <= 100)) {
_root.superkickcounter = _root.superkickcounter + 1;
} else {
_root.superkickcounter = 0;
_root.superkicker = 0;
_root.superball._x = _root.ball1._x;
_root.superball._y = _root.ball1._y;
_root.ball1._rotation = _root.superball._rotation;
_root.ball1._alpha = 100;
}
}
};
Frame 138
function moveBalls() {
var _local4 = 1;
while (_local4 <= game.numBalls) {
var _local3 = game["ball" + _local4];
if (_local4 == 2) {
if (Key.isDown(_root.lhHead) || (Key.isDown(_root.rhHead))) {
_root.game.ball2.ypos = -10;
_root.game.ball3.ypos = -10;
game.ball2.ypos = _root.jay._y - 40;
game.ball3.ypos = _root.jay._y - 40;
_root.keyhead = true;
_root.keyknee = false;
_root.keykick = false;
if (faceeast) {
if (_root.jay._x < _root.ball1._x) {
_root.ball2._x = _root.jay._x - 20;
_root.ball3._x = _root.jay._x;
} else {
_root.ball2._x = _root.jay._x - 20;
_root.ball3._x = _root.jay._x;
}
} else if (_root.jay._x < _root.ball1._x) {
_root.ball2._x = _root.jay._x - 5;
_root.ball3._x = _root.jay._x + 20;
} else {
_root.ball2._x = _root.jay._x;
_root.ball3._x = _root.jay._x + 20;
}
if (_root.ball1._y != floor) {
decay = 1.28;
}
}
if (Key.isDown(_root.lhKnee) || (Key.isDown(_root.rhKnee))) {
_root.game.ball2.ypos = -10;
_root.game.ball3.ypos = -10;
if ((this.jay.knee._currentframe >= 5) && (this.jay.knee._currentframe <= 10)) {
game.ball2.ypos = _root.jay._y + 8;
game.ball3.ypos = _root.jay._y + 17;
_root.keyhead = false;
_root.keyknee = true;
_root.keykick = false;
if (faceeast) {
if (_root.jay._x < _root.ball1._x) {
_root.ball2._x = _root.jay._x + 4;
_root.ball3._x = _root.jay._x + 14;
} else {
_root.ball2._x = _root.jay._x - 4;
_root.ball3._x = _root.jay._x + 14;
}
} else {
game.ball2.ypos = _root.jay._y + 8;
game.ball3.ypos = _root.jay._y + 18;
if (_root.jay._x < _root.ball1._x) {
_root.ball2._x = _root.jay._x + 10;
_root.ball3._x = _root.jay._x - 15;
} else {
_root.ball2._x = _root.jay._x + 10;
_root.ball3._x = _root.jay._x - 15;
}
}
}
if (_root.ball1._y != floor) {
decay = 1.28;
}
}
if (Key.isDown(lhKick) || (Key.isDown(rhKick))) {
if ((this.jay.kick._currentframe >= 5) && (this.jay.kick._currentframe <= 12)) {
_root.keyhead = false;
_root.keyknee = false;
_root.keykick = true;
_root.game.ball2.ypos = _root.jay._y + 22;
_root.game.ball3.ypos = _root.jay._y + 24;
if (faceeast) {
if (_root.jay._x < _root.ball1._x) {
_root.ball2._x = _root.jay._x + 3;
_root.ball3._x = _root.jay._x + 23;
} else {
_root.ball2._x = _root.jay._x - 4;
_root.ball3._x = _root.jay._x + 14;
}
} else if (_root.jay._x < _root.ball1._x) {
_root.ball2._x = _root.jay._x;
_root.ball3._x = _root.jay._x - 20;
} else {
_root.ball2._x = _root.jay._x + 4;
_root.ball3._x = _root.jay._x - 16;
}
}
if (_root.ball1._y != floor) {
decay = 1.58;
}
}
if (Key.isDown(37) || (Key.isDown(90))) {
_root.ball2._x = _root.ball2._x - 5;
_root.ball3._x = _root.ball3._x - 5;
}
if (Key.isDown(39) || (Key.isDown(88))) {
_root.game.ball1._x = _root.game.ball1._x - _root.midscroll;
_root.ball2._x = _root.ball2._x + 5;
_root.ball3._x = _root.ball3._x + 5;
}
if ((Key.isDown(38) || (Key.isDown(_root.rhjump))) && (ballcount == 0)) {
if (_root.ball1._y == floor) {
_root.ball2._y = _root.ball2._y - 2;
_root.ball3._y = _root.ball3._y - 2;
decay = decay + 0.035;
}
if (decay <= 1.06) {
decay = decay + 0.13;
}
_root.ball2._y = _root.ball2._y - 12;
_root.ball3._y = _root.ball3._y - 12;
ballcount = 10;
}
if (_root.ball2._y < (floor - 20)) {
_root.ball2._y = _root.ball2._y + 1;
_root.ball3._y = _root.ball3._y + 1;
}
_local3.tempx = _root.ball2._x;
_local3.xpos = _local3.tempx;
game.ball3.tempx = _root.ball3._x;
game.ball3.xpos = game.ball3.tempx;
}
if (_local4 == 1) {
if (_root.ballscroll == 1) {
game.ball1.xpos = game.ball1.xpos - _root.midscroll;
trace(ballscroll);
}
oldbally = newbally;
newbally = _local3.clip._y;
if (_local3.ypos >= floor) {
_local3.tempy = floor;
_local3.ypos = floor;
_local3.ymov = _local3.ymov * (-0.48 * decay);
if (_root.floorit > 0) {
_root.floorit = _root.floorit - 1;
floorsound = new Sound();
floorsound.attachSound("floor");
floorsound.start(0, 1);
_root.floorsound.volume(_root.floorit);
trace(_root.floorit);
}
if (ballOutOfPlay == false) {
ballOutOfPlay = true;
numOfBalls = numOfBalls - 1;
floorsound = new Sound();
floorsound.attachSound("w");
floorsound.start(0, 1);
_root.floorit = 15;
floorsound = new Sound();
floorsound.attachSound("floor");
floorsound.start(0, 1);
_root.floorsound.volume(_root.floorit);
if (numOfBalls == 0) {
gotoAndStop ("endgamefail");
}
currentBounces = 0;
scoreLevel = 0;
if (score >= bestScore) {
bestScore = score;
}
game.ball1.tempx = game.ball1.xpos;
game.ball1.tempy = game.ball1.ypos;
game.ball1.ypos = game.ball1.tempy;
_root.scoreballs.gotoAndStop(11 - numOfBalls);
}
}
_local3.xmov = _local3.xmov * friction;
_local3.tempx = _local3.tempx * friction;
_local3.tempx = _local3.xpos + _local3.xmov;
_local3.tempy = _local3.ypos + _local3.ymov;
}
_local4++;
}
game.ball2.tempx = game.ball2.xpos;
game.ball3.tempy = game.ball3.ypos;
game.ball2.xpos = game.ball2.tempx;
game.ball3.ypos = game.ball3.tempy;
_root.ball2._y = game.ball2.ypos;
_root.ball3._y = game.ball3.ypos;
}
function reducedecay() {
if (decay >= 2.2) {
decay = 2;
}
if (decay >= 0) {
decay = decay - 0.00399;
}
if ((decay <= 0.96) and (_root.ball1._y >= (floor - 40))) {
decay = 0;
}
}
function ballToBallDetection(b1, b2) {
bounce = false;
var _local12 = b1.xmov;
var _local10 = b1.ymov;
var _local11 = b2.xmov;
var _local9 = b2.ymov;
var _local6 = b1.xpos;
var _local5 = b1.ypos;
var _local8 = b2.xpos;
var _local7 = b2.ypos;
var _local17 = b1.radius + b2.radius;
var _local24 = (((-2 * _local12) * _local11) + (_local12 * _local12)) + (_local11 * _local11);
var _local23 = ((((-2 * _local6) * _local11) - ((2 * _local8) * _local12)) + ((2 * _local6) * _local12)) + ((2 * _local8) * _local11);
var _local22 = (((-2 * _local6) * _local8) + (_local6 * _local6)) + (_local8 * _local8);
var _local21 = (((-2 * _local10) * _local9) + (_local10 * _local10)) + (_local9 * _local9);
var _local20 = ((((-2 * _local5) * _local9) - ((2 * _local7) * _local10)) + ((2 * _local5) * _local10)) + ((2 * _local7) * _local9);
var _local30 = (((-2 * _local5) * _local7) + (_local5 * _local5)) + (_local7 * _local7);
var _local16 = _local24 + _local21;
var _local13 = _local23 + _local20;
var _local28 = (_local22 + _local30) - (_local17 * _local17);
var _local18 = Math.sqrt((_local13 * _local13) - ((4 * _local16) * _local28));
var _local15 = ((-_local13) + _local18) / (2 * _local16);
var _local14 = ((-_local13) - _local18) / (2 * _local16);
if ((_local15 > 0) && (_local15 <= 1)) {
var _local31 = _local15;
var _local26 = true;
if ((b2.number >= 4) && (b2.number <= 11)) {
floorsound = new Sound();
floorsound.attachSound("floor");
floorsound.start(0, 1);
}
if (b2.number > 11) {
var _local32 = true;
_local26 = false;
if (b2.radius == 10) {
_root.score = _root.score + 10;
coinsound = new Sound();
coinsound.attachSound("coin");
coinsound.start(0, 1);
b2.clip._x = -30;
b2.clip._y = -30;
b2.clip.xpos = 0;
b2.clip.ypos = 0;
b2.clip.ymov = 0;
b2.clip.xmov = 0;
b2.clip.tempx = 0;
b2.clip.tempy = 0;
var _local29 = b2.number;
var _local4 = "ball" + _local29;
game[_local4].xpos = game[_local4].clip._x;
game[_local4].ypos = game[_local4].clip._y;
game[_local4].radius = game[_local4].clip._width / 2;
game[_local4].xmov = 0;
game[_local4].ymov = 0;
game[_local4].rotation = game[_local4].clip._rotation;
bounce = false;
ballscollided = false;
_root.totalcollectables = _root.totalcollectables + 1;
}
}
}
if ((_local14 > 0) && (_local14 <= 1)) {
if ((_local31 == null) || (_local14 < _local15)) {
var _local31 = _local14;
var _local26 = true;
if ((b2.number >= 4) && (b2.number <= 11)) {
floorsound = new Sound();
floorsound.attachSound("floor");
floorsound.start(0, 1);
objectbounces = true;
}
if (b2.number > 11) {
var _local32 = true;
_local26 = false;
if (b2.radius == 10) {
_root.score = _root.score + 10;
coinsound = new Sound();
coinsound.attachSound("coin");
coinsound.start(0, 1);
b2.clip._x = -30;
b2.clip._y = -30;
b2.clip.xpos = 0;
b2.clip.ypos = 0;
b2.clip.ymov = 0;
b2.clip.xmov = 0;
b2.clip.tempx = 0;
b2.clip.tempy = 0;
var _local29 = b2.number;
var _local4 = "ball" + _local29;
game[_local4].xpos = game[_local4].clip._x;
game[_local4].ypos = game[_local4].clip._y;
game[_local4].radius = game[_local4].clip._width / 2;
game[_local4].xmov = 0;
game[_local4].ymov = 0;
game[_local4].rotation = game[_local4].clip._rotation;
bounce = false;
ballscollided = false;
_root.totalcollectables = _root.totalcollectables + 1;
}
}
}
}
if (_local26) {
if (b2.radius == 3) {
bounce = eval("TRUE");
if (_root.ball1._y < 380) {
ballOutOfPlay = false;
}
bounce = true;
b1.xmov = b1.xmov + 2.888;
}
if (b2.radius == 2.5) {
bounce = eval("TRUE");
if (_root.ball1._y < 380) {
ballOutOfPlay = false;
}
bounce = true;
b1.xmov = b1.xmov + 2.88;
}
b1.xmov = b1.xmov * friction;
var _local27 = _local8 - _local6;
var _local25 = _local7 - _local5;
var _local19 = Math.atan2(_local25, _local27);
_local19 = (_local19 * Math.PI) / 180;
b1.tempx = _local6;
b1.tempy = _local5;
b1.ymov = b1.ymov * (-1 * decay);
if (faceeast) {
b1.xmov = b1.xmov * b1.xmov;
} else {
b1.xmov = b1.xmov * (-b1.xmov);
}
}
if (b1.xmov >= 2) {
b1.xmov = 2;
}
if (b1.xmov <= -2) {
b1.xmov = -2;
}
if ((b1.xpos - b1.tempx) == 0) {
_root.game.ball1._x = _root.game.ball1._x + 0.1;
b1.tempx = b1.tempx + 0.1;
b1.xpos = b1.xpos + 0.1;
}
if (bounce == true) {
bounce == false;
if (_root.keyhead) {
headsound = new Sound();
headsound.attachSound("head");
headsound.start(0, 1);
}
if (_root.keyknee) {
kneesound = new Sound();
kneesound.attachSound("knee");
kneesound.start(0, 1);
}
if (_root.keykick) {
kicksound = new Sound();
kicksound.attachSound("kick");
kicksound.start(0, 1);
}
if ((_root.objectbounces = true)) {
floorsound = new Sound();
floorsound.attachSound("floor");
floorsound.start(0, 1);
}
currentBounces = currentBounces + 1;
score = score + scoring[scoreLevel];
if (currentBounces >= bestKeepyUps) {
bestKeepyUps = currentBounces;
}
if (currentBounces == bounces[scoreLevel]) {
scoreLevel = scoreLevel + 1;
}
}
}
function fallball() {
if (_root.superkicker != 1) {
game.ball1.ymov = game.ball1.ymov + gravity;
if (game.ball1.ymov > 12) {
game.ball1.ymov = 12;
}
} else {
game.ball1.ymov = game.ball1.ymov * 0.91;
game.ball1.tempx = game.ball1.clip._x;
if (game.ball1.ymov > 12) {
game.ball1.ymov = 12;
}
}
}
function renderBalls() {
var _local2 = game.ball1;
if (_root.exitlevel == true) {
_local2.tempx = 2000;
}
if (i == 2) {
_local2.tempx = _root.ball2._x;
trace(_local2.xpos);
}
_local2.xpos = _local2.tempx;
_local2.ypos = _local2.tempy;
_local2.clip._x = _local2.xpos;
_local2.clip._y = _local2.ypos;
if (ballscroll == 0) {
_local2.clip.ball_design._rotation = _local2.xpos * 5;
} else {
_local2.clip.ball_design._rotation = _local2.xpos + (Math.floor(midscroll) * 5);
}
if (_root.exitlevel == false) {
ball_shadow._x = game.ball1.clip._x;
ball_shadow._y = floor + 12;
jay_Shadow._x = _root.jay._x - 55;
jay_Shadow._y = floor - 10;
jay_Shadow._alpha = jay._y * 0.1289;
}
}
function checkfoot() {
if (foot_mc._y <= (390 + (foot_mc._width / 2))) {
foot_mc._y = foot_mc._y + 1;
}
xfoot = foot_mc._x;
var _local5 = foot_mc._x;
var _local2 = foot_mc._y;
var _local4 = ball_mc._x;
var _local1 = ball_mc._y;
var _local6 = ball_mc._width / 2;
var _local3 = foot_mc._width / 2;
var _local7 = Math.sqrt(((_local4 - _local5) * (_local4 - _local5)) + ((_local1 - _local2) * (_local1 - _local2)));
if (_local7 <= (_local6 + _local3)) {
if (decay <= 1.06) {
decay = decay + 0.13;
ball_mc._y = (_local2 - abradius) - _local3;
foot_mc._y = (_local1 + abradius) + _local3;
ymov = ymov * (-1 * decay);
}
}
}
function checkmovey() {
if (oldbally >= newbally) {
onthewaydown = 0;
} else {
onthewaydown = 1;
}
}
function checkedges() {
if (_root.ball1._x >= 800) {
_root.ball1._x = 800;
game.ball1.xmov = game.ball1.xmov * -1;
}
if (_root.ball1._x <= ((_root.ball1._width / 2) - random(10))) {
_root.ball1._x = (_root.ball1._width / 2) - random(10);
game.ball1.xmov = game.ball1.xmov * -1;
}
}
function checkscroll() {
if (_root.superkicker == 0) {
if (game.ball1.xpos >= 189) {
scrollokay = true;
} else {
scrollokay = false;
}
if ((scrollokay == true) && (background001._x > -130)) {
if (Key.isDown(39) || (Key.isDown(rhmoveright))) {
background001._x = background001._x - _root.backscroll;
collision006._x = collision006._x - _root.backscroll;
collision007._x = collision007._x - _root.backscroll;
collision006a._x = collision006a._x - _root.backscroll;
collision007a._x = collision007a._x - _root.backscroll;
_root.ballscroll = 1;
_root.hole1._x = _root.hole1._x - _root.backscroll;
_root.hole2._x = _root.hole2._x - _root.backscroll;
_root.hole3._x = _root.hole3._x - _root.backscroll;
_root.hole4._x = _root.hole4._x - _root.backscroll;
_root.hole5._x = _root.hole5._x - _root.backscroll;
_root.hole6._x = _root.hole6._x - _root.backscroll;
_root.hole7._x = _root.hole7._x - _root.backscroll;
_root.hole8._x = _root.hole8._x - _root.backscroll;
_root.hole9._x = _root.hole9._x - _root.backscroll;
_root.hole10._x = _root.hole10._x - _root.backscroll;
collision008._x = collision008._x - _root.backscroll;
midground000._x = midground000._x - _root.midscroll;
midground001._x = midground001._x - _root.midscroll;
midground002._x = midground002._x - _root.midscroll;
midground003._x = midground003._x - _root.midscroll;
midground004._x = midground004._x - _root.midscroll;
midground010._x = midground010._x - _root.midscroll;
collision003._x = collision003._x - _root.midscroll;
collision004._x = collision004._x - _root.midscroll;
collision005._x = collision005._x - _root.midscroll;
foreground001._x = foreground001._x - _root.forescroll;
foreground002._x = foreground002._x - _root.forescroll;
foreground003._x = foreground003._x - _root.forescroll;
foreground004._x = foreground004._x - _root.forescroll;
ball4._x = ball4._x - _root.midscroll;
ball5._x = ball5._x - _root.midscroll;
ball6._x = ball6._x - _root.midscroll;
ball7._x = ball7._x - _root.midscroll;
ball8._x = ball8._x - _root.midscroll;
ball9._x = ball9._x - _root.midscroll;
ball10._x = ball10._x - _root.midscroll;
ball11._x = ball11._x - _root.midscroll;
ball12._x = ball12._x - _root.midscroll;
ball13._x = ball13._x - _root.midscroll;
ball14._x = ball14._x - _root.midscroll;
ball15._x = ball15._x - _root.midscroll;
ball16._x = ball16._x - _root.midscroll;
ball17._x = ball17._x - _root.midscroll;
ball18._x = ball18._x - _root.midscroll;
ball19._x = ball19._x - _root.midscroll;
ball20._x = ball20._x - _root.midscroll;
ball21._x = ball21._x - _root.midscroll;
ball22._x = ball22._x - _root.midscroll;
ball23._x = ball23._x - _root.midscroll;
ball24._x = ball24._x - _root.midscroll;
ball25._x = ball25._x - _root.midscroll;
ball26._x = ball26._x - _root.midscroll;
ball27._x = ball27._x - _root.midscroll;
ball28._x = ball28._x - _root.midscroll;
ball29._x = ball29._x - _root.midscroll;
ball30._x = ball30._x - _root.midscroll;
_root.game.ball4.xpos = ball4._x;
_root.game.ball5.xpos = ball5._x;
_root.game.ball6.xpos = ball6._x;
_root.game.ball7.xpos = ball7._x;
_root.game.ball8.xpos = ball8._x;
_root.game.ball9.xpos = ball9._x;
_root.game.ball10.xpos = ball10._x;
_root.game.ball11.xpos = ball11._x;
_root.game.ball12.xpos = ball12_x;
_root.game.ball13.xpos = ball13._x;
_root.game.ball14.xpos = ball14._x;
_root.game.ball15.xpos = ball15._x;
_root.game.ball16.xpos = ball16._x;
_root.game.ball17.xpos = ball17._x;
_root.game.ball18.xpos = ball18._x;
_root.game.ball19.xpos = ball19._x;
_root.game.ball20.xpos = ball20._x;
_root.game.ball21.xpos = ball21._x;
_root.game.ball22.xpos = ball22._x;
_root.game.ball23.xpos = ball23._x;
_root.game.ball24.xpos = ball24._x;
_root.game.ball25.xpos = ball25._x;
_root.game.ball26.xpos = ball26._x;
_root.game.ball27.xpos = ball27._x;
_root.game.ball28.xpos = ball28._x;
_root.game.ball29.xpos = ball29._x;
_root.game.ball30.xpos = ball30._x;
}
}
}
}
function collisionscheck() {
if (_root.collision006.hitTest(_root.ball1._x, _root.ball1._y, true) || (_root.collision006a.hitTest(_root.ball1._x, _root.ball1._y, true))) {
if (_root.ring._currentframe == 1) {
_root.specialsuperkick = true;
_root.ring.gotoAndPlay(2);
}
} else {
_root.specialsuperkick = false;
_root.ring.gotoAndStop(1);
}
if ((_root.collision003.hitTest(jay._x, jay._y, true) || (_root.collision004.hitTest(jay._x, jay._y, true))) || (_root.collision005.hitTest(jay._x, jay._y, true))) {
_root.jay.yspeed = 0;
_root.jay.xspeed = 0;
_root.jay._x = oldjayx;
_root.jay._y = oldjayy;
if (_root.collision003.hitTest(jay._x, jay._y, true) && (oldjayy < 355)) {
_root.jay._y = 335 - (_root.jay._height / 2);
}
_root.jay.floor = _root.jay._y;
} else {
_root.jay.floor = _root.floor - 38;
}
if (_root.collision008.hitTest(jay._x, jay._y, true) && (_root.collision008.hitTest(ball1._x, ball2._y, true))) {
_root.exitlevel = true;
_root.ball1._alpha = 0;
_root.ball_shadow._alpha = 0;
_root.jay_Shadow._x = 2000;
_root.jay.gotoAndStop(6);
_root.jay.jay_exit.gotoAndPlay(1);
hornsound = new Sound();
hornsound.attachSound("horn");
hornsound.start(0, 1);
}
}
function chipup() {
if ((Key.isDown(40) || (Key.isDown(_root.rhchip))) && (ballOutOfPlay)) {
if (_root.game.ball1.tempy > 350) {
_root.game.ball1.ymov = _root.game.ball1.ymov - 3;
_root.game.ball1.tempy = _root.game.ball1.tempy + game.ball1.ymov;
decay = 7.01;
}
}
}
function nowzoomball() {
if (_root.zoomcounter >= 1) {
_root.zoomcounter = _root.zoomcounter - 1;
_root.ballspeed = _root.ballspeed + 0.015;
_root.superball._xscale = _root.superball._xscale - _root.ballspeed;
_root.superball._yscale = _root.superball._yscale - _root.ballspeed;
if (_root.superball._y >= 318) {
_root.superball._y = _root.superball._y - _root.amounttomoveup;
} else {
_root.superball._y = _root.superball._y + _root.amounttomoveup;
}
} else {
if (_root.collision007.hitTest(superball._x, superball._y, true) || (_root.collision007a.hitTest(superball._x, superball._y, true))) {
_root.score = _root.score + 100;
scoresound = new Sound();
scoresound.attachSound("score");
scoresound.start(0, 1);
if (numOfBalls <= 9) {
numOfBalls = numOfBalls + 1;
newballsound = new Sound();
newballsound.attachSound("newball");
newballsound.start(0, 1);
_root.scoreballs.gotoAndStop(11 - numOfBalls);
}
}
holesound = new Sound();
holesound.attachSound("hole");
holesound.start(0, 1);
_root.superball._x = -100;
_root.superball._xscale = 21;
_root.superball._yscale = 21;
_root.superball._alpha = 0;
_root.ball1._alpha = 100;
_root.zoomball = 0;
_root.superkickcounter = 0;
_root.superkicker = 0;
}
}
stopAllSounds();
stop();
jay.gravity = 1.85;
jay.yspeed = 0;
jay.jump = true;
jay.jumpHeight = 20;
jay.floor = 430 - (_root.jay._height / 2);
var gravity = 0.95;
var decay = 1.5;
var friction = 0.995111;
var floor = 400;
var rot = 0;
var ballcount = 0;
var onthewaydown = 0;
var oldbally = 0;
var newbally = 0;
var edgelean = 0;
var bounce = false;
var gamePause = eval("True");
var scrollokay = false;
var scrollspeed = 0;
var playerxpos = 0;
var playerypos = 0;
var ballOutOfPlay = false;
var oldjayx = _root.jay._x;
var oldjayy = _root.jay._y;
var backscroll = 2;
var midscroll = 3;
var forescroll = 4;
var ballscroll = 0;
var lhHead = 82;
var lhKnee = 70;
var lhKick = 86;
var rhHead = 79;
var rhKnee = 75;
var rhKick = 77;
var rhchip = 78;
var rhmoveleft = 90;
var rhmoveright = 88;
var rhjump = 67;
var faceeast = true;
var superkicker = 0;
var newframe = 0;
var superkickcounter = 0;
var oldballx = 0;
var zoomball = 0;
var zoomcounter = 0;
var amounttomoveup = 0;
var ballspeed = 0;
var holdthisxposition = 0;
var totalcollectables = 0;
var lookangle = 0;
var ballcounter = 0;
var keydownLeft = false;
var keydownRight = false;
var keyhead = false;
var keyknee = false;
var keykick = false;
var floorit = 0;
var objectbounces = false;
var jayx = 0;
var specialsuperkick = false;
var exitlevel = false;
var continuescreen = "endoflevel3";
numOfBalls = numOfBalls + 1;
ball_shadow._y = floor - 10;
_root.jay_Shadow._alpha = 100;
var scoring = new Array();
scoring[0] = 1;
scoring[1] = 2;
scoring[2] = 5;
scoring[3] = 10;
scoring[4] = 20;
scoring[5] = 40;
scoring[6] = 40;
scoring[7] = 40;
scoring[8] = 40;
var bounces = new Array();
bounces[0] = 10;
bounces[1] = 20;
bounces[2] = 30;
bounces[3] = 40;
bounces[4] = 50;
bounces[5] = 60;
bounces[6] = 70;
bounces[7] = 80;
bounces[8] = 90000 /* 0x015F90 */;
_root.ball1._alpha = 100;
_root.ball2._alpha = 0;
_root.ball3._alpha = 0;
_root.jay_Shadow._alpha = 100;
_root.ball_shadow._alpha = 100;
game.ball1._alpha = 100;
var game = {};
game.numBalls = 30;
var i = 1;
while (i <= game.numBalls) {
var name = ("ball" + i);
game[name] = {};
game[name].clip = _root[name];
game[name].xpos = game[name].clip._x;
game[name].ypos = game[name].clip._y;
game[name].radius = game[name].clip._width / 2;
game[name].xmov = 0;
game[name].ymov = 0;
game[name].rotation = game[name].clip._rotation;
game[name].number = i;
i++;
}
game.ball1.xmov = 1.2;
game.ball1.mass = 20;
game.ball1.ymov = 2;
game.ball2.xpos = _root.ball2._x;
game.ball2.ypos = _root.ball2._y;
game.ball3.xpos = _root.ball3._x;
game.ball3.ypos = _root.ball3._y;
_root.scoreballs.gotoAndStop(1);
var hole = {};
hole.numHoles = 10;
var holeindex = 0;
var i = 1;
while (i <= hole.numHoles) {
var name = ("hole" + i);
hole[name] = {};
hole[name].clip = _root[name];
hole[name].xpos = game[name].clip._x;
hole[name].ypos = game[name].clip._y;
hole[name].rotation = game[name].clip._rotation;
i++;
}
streetsound = new Sound();
streetsound.attachSound("crowd");
streetsound.start(0, 99);
_root.scoreballs.gotoAndStop(11 - numOfBalls);
_root.onEnterFrame = function () {
if (_root.exitlevel == true) {
_root.jay._y = floor - 38;
renderBalls();
}
if (_root.exitlevel == false) {
_root.jayx = _root.jay._x;
_root.ballx = _root.ball1._x;
_root.bgdx = _root.background001._x;
if (superkicker != 0) {
_root.game.ball1._x = Math.floor(_root.holdthisxposition);
_root.game.ball1.xpos = Math.floor(_root.holdthisxposition);
_root.game.ball1.tempx = Math.floor(_root.holdthisxposition);
if (superkicker < 2) {
_root.superball._x = _root.game.ball1.tempx;
_root.superball._y = _root.game.ball1.tempy;
}
}
if (_root.numOfBalls <= 9) {
if (_root.totalcollectables >= 5) {
_root.numOfBalls = _root.numOfBalls + 1;
newballsound = new Sound();
newballsound.attachSound("newball");
newballsound.start(0, 1);
_root.scoreballs.gotoAndStop(11 - numOfBalls);
_root.totalcollectables = _root.totalcollectables - 5;
}
}
_root.ring._x = _root.ball1._x;
_root.ring._y = _root.ball1._y;
if (_root.zoomball == 2) {
nowzoomball();
}
chipup();
ballscroll = 0;
checkscroll();
if (game.ball1.ymov > 12) {
game.ball1.ymov = 12;
}
if (ballOutOfPlay == true) {
currentBounces = 0;
scoreLevel = 0;
}
oldjayx = _root.jay._x;
oldjayy = _root.jay._y;
game.ball2.ypos = -10;
game.ball3.ypos = -10;
if (ballcount != 0) {
ballcount = ballcount - 1;
}
reducedecay();
checkedges();
moveBalls();
fallball();
checkmovey();
if (onthewaydown == 1) {
ballToBallDetection(game.ball1, game.ball2);
ballToBallDetection(game.ball1, game.ball3);
ballToBallDetection(game.ball1, game.ball4);
ballToBallDetection(game.ball1, game.ball5);
ballToBallDetection(game.ball1, game.ball6);
ballToBallDetection(game.ball1, game.ball7);
ballToBallDetection(game.ball1, game.ball8);
ballToBallDetection(game.ball1, game.ball9);
ballToBallDetection(game.ball1, game.ball10);
ballToBallDetection(game.ball1, game.ball11);
}
ballToBallDetection(game.ball1, game.ball12);
ballToBallDetection(game.ball1, game.ball13);
ballToBallDetection(game.ball1, game.ball14);
ballToBallDetection(game.ball1, game.ball15);
ballToBallDetection(game.ball1, game.ball16);
ballToBallDetection(game.ball1, game.ball17);
ballToBallDetection(game.ball1, game.ball18);
ballToBallDetection(game.ball1, game.ball19);
ballToBallDetection(game.ball1, game.ball20);
ballToBallDetection(game.ball1, game.ball21);
ballToBallDetection(game.ball1, game.ball22);
ballToBallDetection(game.ball1, game.ball23);
ballToBallDetection(game.ball1, game.ball24);
ballToBallDetection(game.ball1, game.ball25);
ballToBallDetection(game.ball1, game.ball26);
ballToBallDetection(game.ball1, game.ball27);
ballToBallDetection(game.ball1, game.ball28);
ballToBallDetection(game.ball1, game.ball29);
ballToBallDetection(game.ball1, game.ball30);
collisionscheck();
renderBalls();
ball_shadow._x = game.ball1.xpos;
ball_shadow._alpha = game.ball1.ypos * 0.092;
ball_shadow._xscale = game.ball1.ypos / 3;
if ((Key.isDown(32) && (_root.superkickcounter == 0)) && (_root.superkicker == 0)) {
_root.holdthisxposition = _root.game.ball1.xpos;
_root.superkickcounter = _root.superkickcounter + 1;
_root.superkicker = 1;
_root.jay.gotoAndStop(5);
_root.jay.superkick.gotoAndPlay(1);
bionicsound = new Sound();
bionicsound.attachSound("bionic");
bionicsound.start(0, 1);
_root.superball._x = _root.ball1._x;
_root.superball._y = _root.ball1._y;
_root.superball._xscale = _root.ball1._xscale;
_root.superball._yscale = _root.ball1._yscale;
_root.superball._rotation = _root.ball1._rotation;
_root.superball._alpha = 100;
_root.ball1._alpha = 0;
}
if ((Key.isDown(32) && (_root.superkickcounter >= 20)) && (_root.superkicker == 1)) {
_root.superkicker = 2;
_root.newframe = _root.jay.superkick._currentframe;
_root.newframe = Math.floor((_root.newframe / 4) + 2) + 209;
if ((_root.newframe >= 223) && (_root.newframe <= 240)) {
trace(Math.abs(_root.jay._y - _root.ball1._y));
if ((((_root.ball1._x > _root.jay._x) && (Math.abs(_root.jay._x - _root.ball1._x) < 50)) && (Math.abs(_root.jay._y - _root.ball1._y) < 50)) && (faceeast)) {
trace("Hit!");
zoomball = 1;
}
if ((((_root.ball1._x < _root.jay._x) && (Math.abs(_root.jay._x - _root.ball1._x) < 50)) && (Math.abs(_root.jay._y - _root.ball1._y) < 50)) && (faceeast != true)) {
trace("Hit!");
zoomball = 1;
}
if (_root.zoomball == 1) {
_root.superball._rotation = _root.ball1._rotation;
_root.superball._x = _root.ball1._x;
_root.superball._y = _root.ball1._y;
_root.superball._xscale = _root.ball1._xscale;
_root.superball._yscale = _root.ball1._yscale;
_root.zoomball = 2;
_root.zoomcounter = 10;
_root.ballspeed = 1.5;
_root.amounttomoveup = Math.abs(_root.superball._y - 237) / 10;
trace(_root.amounttomoveup);
kicksound = new Sound();
kicksound.attachSound("kick");
kicksound.start(0, 1);
}
}
_root.jay.superkick.gotoAndPlay(_root.newframe);
}
if ((_root.superkickcounter >= 1) && (_root.superkickcounter <= 100)) {
_root.superkickcounter = _root.superkickcounter + 1;
} else {
_root.superkickcounter = 0;
_root.superkicker = 0;
_root.superball._x = _root.ball1._x;
_root.superball._y = _root.ball1._y;
_root.ball1._rotation = _root.superball._rotation;
_root.ball1._alpha = 100;
}
}
};
Frame 139
gotoAndPlay (5);
Frame 140
stopAllSounds();
Frame 141
stopAllSounds();
Frame 142
stopAllSounds();
_root.onEnterFrame = function () {
if (Key.isDown(17)) {
gotoAndPlay (4);
}
};
Frame 145
stopAllSounds();
_root.onEnterFrame = function () {
if (Key.isDown(17)) {
gotoAndPlay (4);
}
};
hornsound = new Sound();
hornsound.attachSound("horn");
hornsound.start(0, 1);
Symbol 27 MovieClip Frame 1
bar.stop();
Symbol 44 Button
on (press) {
getURL ("http:/www.matmi.com", "_blank");
}
Symbol 55 Button
on (release) {
getURL ("http://www.dtz.com/portal/site/Global/menuitem.5dcbbd7e8b7c49739d37a210da80cb3c/?vgnextoid=0c80f8377e480010VgnVCM100000ad08bcc3RCRD", "_blank");
}
Symbol 56 Button
on (release) {
getURL ("http://www.dtz.com/portal/site/Global/menuitem.d537721d5f2c49739d37a210da80cb3c/?vgnextoid=8a11f8377e480010VgnVCM100000ad08bcc3RCRD", "_blank");
}
Symbol 57 Button
on (release) {
getURL ("http://www.dtz.com/portal/site/Global/menuitem.53ba54b2de3d49739d37a210da80cb3c/?vgnextoid=a8f1f8377e480010VgnVCM100000ad08bcc3RCRD", "blank");
}
Symbol 77 Button
on (press) {
play();
_root.navigate = 1;
}
Symbol 78 Button
on (press) {
play();
_root.navigate = 2;
}
Symbol 79 Button
on (press) {
getURL ("http://www.matmi.com/dtz/football/showscores.html", "blank");
}
Symbol 80 Button
on (press) {
play();
_root.navigate = 4;
}
Symbol 81 MovieClip Frame 19
stop();
Symbol 91 Button
on (press) {
play();
_root.navigate = 5;
}
Symbol 97 Button
on (press) {
play();
_root.navigate = 6;
}
Symbol 109 Button
on (press) {
gotoAndStop ("how");
}
Symbol 110 Button
on (press) {
gotoAndStop ("feedback");
}
Symbol 111 Button
on (press) {
gotoAndStop ("credits");
}
Symbol 113 Button
on (press) {
gotoAndStop ("prize");
}
Symbol 114 Button
on (press) {
gotoAndStop ("begin");
}
Symbol 124 Button
on (release) {
gotoAndStop ("fucker");
}
Symbol 126 Button
on (release) {
nextFrame();
}
Symbol 127 Button
on (release) {
prevFrame();
}
Symbol 414 MovieClip Frame 1
stop();
Symbol 414 MovieClip Frame 2
stop();
Symbol 418 Button
on (release) {
_root.sss.gotoAndStop(1);
}
Symbol 419 Button
on (release) {
_root.sss.gotoAndStop(2);
}
Symbol 431 Button
on (press) {
getURL ("http:/www.matmi.com", "_blank");
}
Symbol 440 Button
on (release) {
nextFrame();
}
Symbol 442 Button
on (press) {
if (_root.playername.length < 2) {
_root.namebox._visible = 1;
} else if (_root.nat.length < 2) {
_root.natbox._visible = 1;
} else {
loadVariablesNum ("get_top_data.php?rnd=" + random(9999), 0, "POST");
play();
}
}
Symbol 451 Button
on (press) {
this.gotoAndStop(2);
}
Symbol 519 Button
on (press) {
this.gotoAndStop(1);
}
Symbol 523 Button
on (press) {
gotoAndStop (1);
_root.nat = "Angola";
_root.nat2 = _root.nat;
}
Symbol 524 Button
on (press) {
gotoAndStop (1);
_root.nat = "Argentina";
_root.nat2 = _root.nat;
}
Symbol 525 Button
on (press) {
gotoAndStop (1);
_root.nat = "Australia";
_root.nat2 = _root.nat;
}
Symbol 526 Button
on (press) {
gotoAndStop (1);
_root.nat = "Brazil";
_root.nat2 = _root.nat;
}
Symbol 527 Button
on (press) {
gotoAndStop (1);
_root.nat = "Costa Rica";
}
Symbol 528 Button
on (press) {
gotoAndStop (1);
_root.nat = "Cote d'Ivoire";
}
Symbol 529 Button
on (press) {
gotoAndStop (1);
_root.nat = "Croatia";
}
Symbol 530 Button
on (press) {
gotoAndStop (1);
_root.nat = "Czech Republic";
}
Symbol 531 Button
on (press) {
gotoAndStop (1);
_root.nat = "Iran";
}
Symbol 532 Button
on (press) {
gotoAndStop (1);
_root.nat = "Italy";
}
Symbol 533 Button
on (press) {
gotoAndStop (1);
_root.nat = "Japan";
}
Symbol 534 Button
on (press) {
gotoAndStop (1);
_root.nat = "Korea Republic";
}
Symbol 535 Button
on (press) {
gotoAndStop (1);
_root.nat = "Mexico";
}
Symbol 536 Button
on (press) {
gotoAndStop (1);
_root.nat = "Netherlands";
}
Symbol 537 Button
on (press) {
gotoAndStop (1);
_root.nat = "Paraguay";
}
Symbol 538 Button
on (press) {
gotoAndStop (1);
_root.nat = "Poland";
}
Symbol 539 Button
on (press) {
gotoAndStop (1);
_root.nat = "Sweden";
}
Symbol 540 Button
on (press) {
gotoAndStop (1);
_root.nat = "Togo";
}
Symbol 541 Button
on (press) {
gotoAndStop (1);
_root.nat = "Trinidad and Tobago";
}
Symbol 542 Button
on (press) {
gotoAndStop (1);
_root.nat = "Tunisia";
}
Symbol 543 Button
on (press) {
gotoAndStop (1);
_root.nat = "Ukraine";
}
Symbol 544 Button
on (press) {
gotoAndStop (1);
_root.nat = "USA";
}
Symbol 545 Button
on (press) {
gotoAndStop (1);
_root.nat = "Portugal";
}
Symbol 546 Button
on (press) {
gotoAndStop (1);
_root.nat = "Saudi Arabia";
}
Symbol 547 Button
on (press) {
gotoAndStop (1);
_root.nat = "Serbia and Montenegro";
}
Symbol 548 Button
on (press) {
gotoAndStop (1);
_root.nat = "Spain";
}
Symbol 549 Button
on (press) {
gotoAndStop (1);
_root.nat = "Switzerland";
}
Symbol 550 Button
on (press) {
gotoAndStop (1);
_root.nat = "Ecuador";
}
Symbol 551 Button
on (press) {
gotoAndStop (1);
_root.nat = "England";
}
Symbol 552 Button
on (press) {
gotoAndStop (1);
_root.nat = "France";
}
Symbol 553 Button
on (press) {
gotoAndStop (1);
_root.nat = "Germany";
}
Symbol 554 Button
on (press) {
gotoAndStop (1);
_root.nat = "Ghana";
}
Symbol 555 MovieClip Frame 1
stop();
_root.nat2 = _root.nat;
Symbol 555 MovieClip Frame 2
stop();
Symbol 562 MovieClip Frame 1
if (_root.emailme == "1") {
gotoAndStop (2);
} else {
stop();
}
Symbol 562 MovieClip Frame 2
stop();
Symbol 577 Button
on (press) {
if (((_root.email != "") && (_root.country != "")) && (_root.score != "")) {
gotoAndPlay (2);
}
}
Symbol 581 MovieClip Frame 1
stop();
_root.score = _root.bestScore;
_root.keepy = _root.bestKeepyUps;
score = _root.score;
playername = _root.playername;
nat = _root.nat;
keepy = _root.keepy;
_root.xx = 0;
_root.done = "false";
_root.error = "false";
Symbol 581 MovieClip Frame 2
email = _root.email;
emailme = _root.emailme;
emailme2 = 0;
_root.emailme2 = emailme2;
rnd = random(3);
if (rnd == 0) {
_root.score = _root.score * 25;
_root.keepy = _root.keepy * 15;
} else if (rnd == 1) {
_root.score = _root.score * 95;
_root.keepy = _root.keepy * 25;
} else if (rnd == 2) {
_root.score = _root.score * 105;
_root.keepy = _root.keepy * 95;
}
getURL ((((((((((((((("http://www.matmi.com/dtz/football/external_store_data.php?jfhjd=245ervggvscgsdgcsdg5cggs&345345hkfgf=34jrgkijijjieij&hfgg=" + _root.playername) + "&348hyfhudfhujdfbjbhjdbjjdfg=egre33g3g3&sewfff=") + _root.score) + "&alfdv3=") + rnd) + "&kjee=") + _root.email) + "&jhje=150&scr=3778&ffez=") + _root.nat) + "&ryuuee=") + _root.keepy) + "&emailme=") + _root.emailme) + "&emailme2=") + _root.emailme2, "blank");
Symbol 581 MovieClip Frame 11
stop();
Symbol 584 Button
on (press) {
if (_root.emailme == "0") {
_root.emailme = "1";
_root.tik.gotoAndStop(2);
} else {
_root.emailme = "0";
_root.tik.gotoAndStop(1);
}
}
Symbol 608 MovieClip Frame 1
stop();
Symbol 742 MovieClip Frame 1
stop();
Symbol 769 MovieClip Frame 1
Symbol 769 MovieClip Frame 14
gotoAndPlay ("jayrunstop");
Symbol 792 MovieClip Frame 11
if (((Key.isDown(37) || (Key.isDown(39))) || (Key.isDown(_root.rhmoveright))) || (Key.isDown(_root.rhmoveleft))) {
_root.jay.gotoAndStop(1);
_root.jay.Jay_Run.gotoAndPlay();
} else {
gotoAndStop ("jaykneestop");
}
Symbol 815 MovieClip Frame 11
if (((Key.isDown(37) || (Key.isDown(39))) || (Key.isDown(_root.rhmoveright))) || (Key.isDown(_root.rhmoveleft))) {
_root.jay.gotoAndStop(1);
_root.jay.Jay_Run.gotoAndPlay();
} else {
gotoAndStop ("jaykickstop");
}
Symbol 836 MovieClip Frame 10
if (((Key.isDown(37) || (Key.isDown(39))) || (Key.isDown(_root.rhmoveright))) || (Key.isDown(_root.rhmoveleft))) {
_root.jay.gotoAndStop(1);
_root.jay.Jay_Run.gotoAndPlay();
} else {
gotoAndStop ("jayheadstop");
}
Symbol 937 MovieClip Frame 191
_root.superkicker = 0;
_root.superball._alpha = 0;
_root.ball1._alpha = 100;
stop();
Symbol 937 MovieClip Frame 259
_root.superkicker = 0;
_root.superball._alpha = 0;
_root.ball1._alpha = 100;
stop();
Symbol 938 MovieClip Frame 1
_root.jay_Shadow._alpha = 0;
this._xscale = 100;
Symbol 938 MovieClip Frame 50
_root.gotoAndStop(_root.continuescreen);
Symbol 939 MovieClip Frame 1
stop();
Symbol 939 MovieClip Frame 2
stop();
Symbol 939 MovieClip Frame 3
stop();
Symbol 939 MovieClip Frame 4
stop();
Symbol 939 MovieClip Frame 5
stop();
Symbol 939 MovieClip Frame 6
stop();
Symbol 947 MovieClip Frame 1
stop();
Symbol 947 MovieClip Frame 15
this.gotoAndPlay(2);
Symbol 962 MovieClip Frame 1
stop();
Symbol 1024 Button
on (release) {
gotoAndPlay ("level2");
}
Symbol 1031 Button
on (release) {
gotoAndPlay ("level3");
}