Frame 1
fscommand ("showmenu", "false");
Stage.scaleMode = "noScale";
Frame 201
stop();
Frame 251
stop();
Frame 252
stop();
Frame 253
function setUpAngle() {
_root.attachMovie("empty", "screen2", 3, {_x:100, _y:80});
game.clip2 = _root.screen2;
game.clip2._xscale = 200;
game.clip2._yscale = 200;
game.clip2.attachMovie("square2", "arena", 2);
name = "enemy" + game.level;
game.clip2.attachMovie(name, "char2", 1, {_x:150, _y:0});
game.clip2.char2._xscale = 50;
game.clip2.char2._yscale = 50;
game.clip2.attachMovie("char", "char", 300, {_x:10, _y:150});
_root.hud.swapDepths(1000);
_root.hud.alert = "";
_root.hud.round = "ROUND : " + game.round;
_root.hud.time = "TIME : " + game.time;
_root.hud.p1 = "P1 : " + game.p1;
_root.hud.cpu = "CPU : " + game.cpu;
}
function setUpSounds() {
game.music = new Array();
game.sounds = new Array();
this.createEmptyMovieClip("sounds_mc", getNextHighestDepth());
_root.sounds = new Sound(sounds_mc);
sounds.sound_punch = new Sound(sounds_mc);
sounds.sound_punch.attachSound("sound_punch");
game.sounds.push("INSERT4");
sounds.sound_throw = new Sound(sounds_mc);
sounds.sound_throw.attachSound("sound_throw");
game.sounds.push("BEEPDBL");
sounds.sound_warble = new Sound(sounds_mc);
sounds.sound_warble.attachSound("sound_warble");
game.sounds.push("rs_dryfire");
sounds.sound_snooker = new Sound(sounds_mc);
sounds.sound_snooker.attachSound("sound_snooker");
game.sounds.push("rs_rocket_launcher");
}
function gametime() {
if (!game.paws) {
if (game.time > 0) {
game.time--;
_root.hud.time = "TIME : " + game.time;
} else {
game.paws = true;
checkBalls();
}
}
}
function setUp() {
setUpAngle();
destroyAll();
_root.stasis = false;
game.game = true;
_root.hud.level = "LEVEL " + game.level;
game.round++;
_root.hud.round = "ROUND : " + game.round;
game.time = 60;
game.paws = false;
_root.paws = false;
clearInterval(game.timer);
game.timer = setInterval(this, "gametime", 1000);
_root.attachMovie("empty", "screen", 2, {_x:150, _y:50});
game.clip = _root.screen;
game.clip._alpha = 0;
game.clip._xscale = 1;
game.clip._yscale = 1;
game.clip.attachMovie("char", "char2", 1, {_x:150, _y:0});
enemy = new game["enemy" + game.level]();
enemy.clip = game.clip.char2;
enemy.clip.gotoAndStop(1);
enemy.double = game.clip2.char2;
game.clip.attachMovie("char", "char", 2, {_x:10, _y:300});
char.clip = game.clip.char;
char.clip.gotoAndStop(1);
char.clip._yscale = -100;
char.double = game.clip2.char;
game.clip.attachMovie("square", "arena", 3);
game.arena = game.clip.arena;
var _local4 = 25;
var _local6 = 300;
var _local5 = 0;
i = 0;
while (i < 6) {
var _local3 = "topball" + i;
game[_local3] = new game.ball();
game.clip.attachMovie("topball", _local3, 100 + i);
game.clip2.attachMovie("topball", _local3, 100 + i);
game[_local3].clip = game.clip[_local3];
game[_local3].double = game.clip2[_local3];
game.balls.push(_local3);
game[_local3].pos = 1;
game[_local3].clip._x = _local4;
game[_local3].clip._y = _local5;
game[_local3].double._x = _local4;
game[_local3].double._y = _local5;
_local3 = "lowerball" + i;
game[_local3] = new game.ball();
game.clip.attachMovie("lowerball", _local3, 110 + i);
game.clip2.attachMovie("lowerball", _local3, 110 + i);
game[_local3].clip = game.clip[_local3];
game[_local3].double = game.clip2[_local3];
game.balls.push(_local3);
game[_local3].pos = 2;
game[_local3].clip._x = _local4;
game[_local3].clip._y = _local6;
game[_local3].double._x = _local4;
game[_local3].double._y = 150;
_local4 = _local4 + (game[_local3].diameter * 2);
i++;
}
}
function checkKeys() {
if (_root.stasis) {
if (Key.isDown(32)) {
setUp();
_root.stasis = false;
_root.hud.alert = "";
_root.hud.round = "ROUND : " + game.round;
}
}
if ((!game.paws) && (game.time > 0)) {
if (!char.stun) {
if (Key.isDown(37)) {
if (char.clip._x > 10) {
char.clip._x = char.clip._x - char.speed;
}
} else if (Key.isDown(39)) {
if (char.clip._x < 190) {
char.clip._x = char.clip._x + char.speed;
}
}
if (Key.isDown(32) && (!char.press)) {
char.press = true;
if (char.carry) {
throwBall(char, -1);
} else if (!char.carry) {
checkPickUp(char, 2);
}
}
}
if (!Key.isDown(32)) {
char.press = false;
}
}
moveBalls();
if (((!enemy.stun) && (game.time > 0)) and (!game.paws)) {
enemyAI();
}
checkBallX();
updateScreen2();
}
function checkPickUp(ob, pos) {
i = 0;
while (i < game.balls.length) {
name = game.balls[i];
obb = game[name];
if (obb.pos == pos) {
var _local2 = obb.clip._x;
var _local4 = ob.clip._x - ob.width;
var _local3 = ob.clip._x + ob.width;
if ((_local2 > _local4) && (_local2 < _local3)) {
obb.clip._alpha = 0;
obb.double._alpha = 0;
obb.pickup = true;
obb.clip._x = _local2;
ob.carry = obb;
ob.clip.gotoAndStop(2);
ob.double.gotoAndStop(2);
break;
}
}
i++;
}
}
function throwBall(ob, dir) {
sounds.sound_throw.start();
ob.clip.gotoAndStop(3);
ob.double.gotoAndStop(3);
ob.carry.pos = 0;
ob.carry.dir = dir;
ob.carry.clip._y = ob.carry.clip._y + (5 * dir);
ob.carry.clip._x = ob.clip._x;
ob.carry.clip._alpha = 100;
ob.carry.double._x = (100 - ob.carry.double._xscale) + (ob.carry.clip._x * ((ob.carry.double._y + 150) / 300));
ob.carry.double._alpha = 100;
ob.carry = false;
ob.stun = true;
clearInterval(ob.throwTimer);
ob.throwTimer = setInterval(this, "throwTime", ob.recoveryTime, ob);
}
function moveBalls() {
i = 0;
while (i < game.balls.length) {
name = game.balls[i];
ob = game[name];
if (ob.pos == 0) {
ob.clip._y = ob.clip._y + (ob.speed * ob.dir);
ob.double._y = ob.clip._y / 2;
ob.double.play();
if ((ob.clip._x < 10) or (ob.clip._x > 190)) {
ob.xmove = ob.xmove * -1;
ob.clip._x = ob.clip._x + ob.xmove;
} else {
ob.clip._x = ob.clip._x + ob.xmove;
}
switch (ob.dir) {
case -1 :
if (ob.clip._y <= 0) {
ob.pos = 1;
ob.clip._y = 0;
ob.double._y = 0;
ob.pickup = false;
checkHit(ob);
}
break;
case 1 :
if (ob.clip._y < 300) {
break;
}
ob.pos = 2;
ob.clip._y = 300;
ob.double._y = 150;
ob.pickup = false;
checkHit(ob);
}
}
ob.double._yscale = (ob.double._y + 150) / 3;
ob.double._xscale = (ob.double._y + 150) / 3;
ob.double._x = (100 - ob.double._xscale) + (ob.clip._x * ((ob.double._y + 150) / 300));
i++;
}
}
function checkHit(ob) {
sounds.sound_punch.start();
sounds.sound_warble.start();
ob.xmove = 0;
switch (ob.pos) {
case 1 :
x = ob.clip._x;
x1 = enemy.clip._x - (enemy.width * 1.5);
x2 = enemy.clip._x + (enemy.width * 1.5);
if ((x > x1) && (x < x2)) {
enemy.clip.gotoAndStop(4);
enemy.double.gotoAndStop(4);
enemy.stun = true;
clearInterval(enemy.throwTimer);
enemy.throwTimer = setInterval(this, "throwTime", enemy.recoveryTime * 2, enemy);
if (enemy.carry) {
enemy.carry.pos = 1;
enemy.carry.dir = dir;
enemy.carry.clip._y = 0;
enemy.carry.double._y = 0;
enemy.carry.clip._x = ob.clip._x;
enemy.carry.clip._alpha = 100;
enemy.carry.pickup = false;
enemy.carry.double._x = ob.clip._x;
enemy.carry.double._alpha = 100;
enemy.carry = false;
enemy.stun = true;
}
}
break;
case 2 :
x = ob.clip._x;
x1 = char.clip._x - (char.width * 1.5);
x2 = char.clip._x + (char.width * 1.5);
if (!((x > x1) && (x < x2))) {
break;
}
char.clip.gotoAndStop(4);
char.double.gotoAndStop(4);
char.stun = true;
clearInterval(char.throwTimer);
char.throwTimer = setInterval(this, "throwTime", char.recoveryTime * 2, char);
if (!char.carry) {
break;
}
char.carry.pos = 2;
char.carry.dir = dir;
char.carry.clip._y = 300;
char.carry.double._y = 150;
char.carry.clip._x = ob.clip._x;
ob.double._x = ob.clip._x;
char.carry.clip._alpha = 100;
char.carry.pickup = false;
char.carry.double._x = ob.clip._x;
char.carry.double._alpha = 100;
char.carry = false;
char.stun = true;
}
checkBallX();
if (game.game) {
checkBalls();
}
}
function throwTime(ob) {
clearInterval(ob.throwTimer);
ob.stun = false;
if (!ob.carry) {
ob.clip.gotoAndStop(1);
ob.double.gotoAndStop(1);
}
}
function enemyAI() {
ob = enemy;
if (!ob.stun) {
ob.left = 0;
ob.right = 0;
if (!ob.carry) {
i = 0;
while (i < game.balls.length) {
name = game.balls[i];
obb = game[name];
if (obb.pos == 1) {
if (obb.clip._x < ob.clip._x) {
ob.left++;
} else {
ob.right++;
}
}
i++;
}
}
if (ob.carry) {
if (ob.clip._x < char.clip._x) {
ob.left = 0;
ob.right = 1;
} else {
ob.left = 1;
ob.right = 0;
}
if ((ob.clip._x > (char.clip._x - char.width)) && (ob.clip._x < (char.clip._x + char.width))) {
throwBall(ob, 1);
}
}
if (!ob.stun) {
if (ob.left > ob.right) {
if (ob.clip._x > 10) {
ob.clip._x = ob.clip._x - ob.speed;
if (!ob.carry) {
checkPickUp(ob, 1);
}
}
} else if (ob.clip._x < 200) {
ob.clip._x = ob.clip._x + ob.speed;
if (!ob.carry) {
checkPickUp(ob, 1);
}
}
}
}
}
function checkBallX() {
i = 0;
while (i < game.balls.length) {
name = game.balls[i];
ob = game[name];
x = ob.clip._x;
y = ob.clip._y;
j = 0;
while (j < game.balls.length) {
name2 = game.balls[j];
obb = game[name2];
if (j != i) {
xx = obb.clip._x;
yy = obb.clip._y;
x1 = obb.clip._x - obb.diameter;
x2 = obb.clip._x + obb.diameter;
if ((ob.pos == obb.pos) && (ob.pos != 0)) {
if ((x > x1) && (x < x2)) {
if (x > xx) {
if (x < 190) {
ob.clip._x = ob.clip._x + 2;
ob.double._x = (100 - ob.double._xscale) + (ob.clip._x * ((ob.double._y + 150) / 300));
ob.double.ball.play();
}
if (xx > 10) {
obb.clip._x = obb.clip._x - 2;
obb.double._x = (100 - obb.double._xscale) + (obb.clip._x * ((obb.double._y + 150) / 300));
obb.double.ball.play();
}
} else {
if (x > 10) {
ob.clip._x = ob.clip._x - 2;
ob.double._x = (100 - ob.double._xscale) + (ob.clip._x * ((ob.double._y + 150) / 300));
ob.double.ball.play();
}
if (xx < 190) {
obb.clip._x = obb.clip._x + 2;
obb.double._x = (100 - obb.double._xscale) + (obb.clip._x * ((obb.double._y + 150) / 300));
obb.double.ball.play();
}
}
}
}
if ((ob.pos == 0) && (obb.pos == 0)) {
var _local1 = getDistance(x, xx, y, yy);
if (_local1 < ob.diameter) {
sounds.sound_snooker.start();
if (x < xx) {
ob.xmove = -3;
obb.xmove = 3;
} else {
ob.xmove = 3;
obb.xmove = -3;
}
ob.double.ball.gotoAndPlay(11);
ob.clip._x = ob.clip._x + ob.xmove;
ob.double._x = (100 - ob.double._xscale) + (ob.clip._x * ((ob.double._y + 150) / 300));
obb.double.ball.gotoAndPlay(11);
obb.clip._x = obb.clip._x + obb.xmove;
obb.double._x = (100 - obb.double._xscale) + (obb.clip._x * ((obb.double._y + 150) / 300));
}
}
}
j++;
}
i++;
}
}
function getDistance(x1, x2, y1, y2) {
getDistance_delta_x = x1 - x2;
getDistance_delta_y = y1 - y2;
getDistance_distance = Math.sqrt((getDistance_delta_x * getDistance_delta_x) + (getDistance_delta_y * getDistance_delta_y));
return(getDistance_distance);
}
function updateScreen2() {
game.clip2.char2._x = (game.clip.char2._x / 2) + 50;
game.clip2.char._x = game.clip.char._x;
}
function checkBalls() {
roundover = false;
balls1 = 0;
balls2 = 0;
ball = 0;
i = 0;
while (i < game.balls.length) {
name = game.balls[i];
ob = game[name];
if (ob.pos == 0) {
ball = 1;
}
if (ob.pos != 0) {
if (ob.pos == 1) {
balls1++;
}
if (ob.pos == 2) {
balls2++;
}
} else {
balls1 = 1;
balls2 = 1;
}
i++;
}
if ((balls1 == 0) or (balls2 == 0)) {
if (balls2 == 0) {
game.p1++;
_root.hud.alert = "- P1 WINS -";
_root.hud.p1 = "P1 : " + game.p1;
roundover = true;
}
if (balls1 == 0) {
game.cpu++;
_root.hud.alert = "- CPU WINS -";
_root.hud.cpu = "CPU : " + game.cpu;
roundover = true;
}
}
if ((game.time <= 0) && (ball == 0)) {
_root.paws = true;
if (balls1 < balls2) {
game.cpu++;
_root.hud.alert = "- CPU WINS -";
_root.hud.cpu = "CPU : " + game.cpu;
roundover = true;
} else if (balls2 < balls1) {
game.p1++;
_root.hud.alert = "- P1 WINS -";
_root.hud.p1 = "P1 : " + game.p1;
roundover = true;
} else if (balls2 == balls1) {
game.p1++;
_root.hud.alert = "- DRAW -";
_root.hud.p1 = "P1 : " + game.p1;
game.cpu++;
_root.hud.cpu = "CPU : " + game.cpu;
roundover = true;
}
}
if (roundover) {
_root.hud.round = "ROUND : " + game.round;
game.game = false;
game.paws = true;
_root.paws = false;
if (game.p1 == (game.cpu + 2)) {
_root.hud.txt_MC.alert = "P1 WINS MATCH";
_root.hud.txt_MC.gotoAndPlay(2);
_root.hud.alert = "- WELL DONE -";
game.level++;
game.round = 0;
game.cpu = 0;
game.p1 = 0;
_root.hud.cpu = "CPU : " + game.cpu;
_root.hud.p1 = "P1 : " + game.p1;
if (game.level == 6) {
removeMovieClip(game.clip2);
removeMovieClip(_root.hud);
_root.gotoAndStop("win");
}
} else if (game.cpu == (game.p1 + 2)) {
_root.hud.alert = "CPU WINS MATCH";
removeMovieClip(game.clip2);
removeMovieClip(_root.hud);
_root.gotoAndStop("lose");
} else {
_root.hud.txt_MC.alert = "ROUND OVER";
_root.hud.txt_MC.gotoAndPlay(2);
}
}
}
function destroyAll() {
delete enemy;
char.carry = false;
char.double.gotoAndStop(1);
i = 0;
while (i < game.balls.length) {
name = game.balls[i];
ob = game[name];
removeMovieClip(game.clip[name]);
delete ob;
game.balls.splice(i);
i++;
}
}
char = {name:"plyer1", speed:3, carry:false, stun:false, press:false, width:15, recoveryTime:600};
game = {level:1, round:0, p1:0, cpu:0, time:60, paws:false};
game.ball = function () {
};
game.ball.prototype.diameter = 15;
game.ball.prototype.radius = 7.5;
game.ball.prototype.pickup = false;
game.ball.prototype.speed = 10;
game.balls = new Array();
game.enemy1 = function () {
};
game.enemy1.prototype.speed = 2;
game.enemy1.prototype.carry = false;
game.enemy1.prototype.stun = false;
game.enemy1.prototype.width = 15;
game.enemy1.prototype.recoveryTime = 600;
game.enemy1.prototype.left = 0;
game.enemy1.prototype.right = 0;
game.enemy1.prototype.target = false;
game.enemy1.prototype.dir = 0;
game.enemy1.prototype.throwTime = 300;
game.enemy1.prototype.name = "enemy1";
game.enemy2 = function () {
};
game.enemy2.prototype.speed = 2.5;
game.enemy2.prototype.carry = false;
game.enemy2.prototype.stun = false;
game.enemy2.prototype.width = 15;
game.enemy2.prototype.recoveryTime = 600;
game.enemy2.prototype.left = 0;
game.enemy2.prototype.right = 0;
game.enemy2.prototype.target = false;
game.enemy2.prototype.dir = 0;
game.enemy2.prototype.throwTime = 300;
game.enemy2.prototype.name = "enemy1";
game.enemy3 = function () {
};
game.enemy3.prototype.speed = 2.5;
game.enemy3.prototype.carry = false;
game.enemy3.prototype.stun = false;
game.enemy3.prototype.width = 15;
game.enemy3.prototype.recoveryTime = 500;
game.enemy3.prototype.left = 0;
game.enemy3.prototype.right = 0;
game.enemy3.prototype.target = false;
game.enemy3.prototype.dir = 0;
game.enemy3.prototype.throwTime = 300;
game.enemy3.prototype.name = "enemy1";
game.enemy4 = function () {
};
game.enemy4.prototype.speed = 3;
game.enemy4.prototype.carry = false;
game.enemy4.prototype.stun = false;
game.enemy4.prototype.width = 15;
game.enemy4.prototype.recoveryTime = 500;
game.enemy4.prototype.left = 0;
game.enemy4.prototype.right = 0;
game.enemy4.prototype.target = false;
game.enemy4.prototype.dir = 0;
game.enemy4.prototype.throwTime = 300;
game.enemy4.prototype.name = "enemy1";
game.enemy5 = function () {
};
game.enemy5.prototype.speed = 4;
game.enemy5.prototype.carry = false;
game.enemy5.prototype.stun = false;
game.enemy5.prototype.width = 15;
game.enemy5.prototype.recoveryTime = 400;
game.enemy5.prototype.left = 0;
game.enemy5.prototype.right = 0;
game.enemy5.prototype.target = false;
game.enemy5.prototype.dir = 0;
game.enemy5.prototype.throwTime = 300;
game.enemy5.prototype.name = "enemy1";
setUp();
setUpSounds();
stop();
Instance of Symbol 49 MovieClip [empty] in Frame 253
onClipEvent (enterFrame) {
if (!_root.paws) {
_root.checkKeys();
}
}
Symbol 11 MovieClip [ball] Frame 1
stop();
Symbol 11 MovieClip [ball] Frame 10
gotoAndPlay (1);
Symbol 28 MovieClip Frame 10
stop();
Symbol 35 MovieClip [enemy1] Frame 1
stop();
Symbol 43 MovieClip Frame 10
stop();
Symbol 48 MovieClip [char] Frame 1
stop();
Symbol 55 Button
on (release) {
getURL ("http://www.maxgames.com", "_blank");
}
Symbol 58 MovieClip Frame 60
stop();
Symbol 65 MovieClip Frame 1
var gameBytesTotal = 0;
var gameBytesLoaded = 0;
var percent = 0;
Symbol 65 MovieClip Frame 3
gameBytesTotal = _root.getBytesTotal();
gameBytesLoaded = _root.getBytesLoaded();
percent = Math.round((gameBytesLoaded / gameBytesTotal) * 100);
bar.loadbar._xscale = percent;
if (((gameBytesLoaded >= gameBytesTotal) && (gameBytesTotal > 0)) && (_root.logo._currentframe >= _root.logo._totalframes)) {
_root.play();
stop();
} else {
gotoAndPlay ("preload");
}
Symbol 80 Button
on (press) {
play();
}
Symbol 83 Button
on (press) {
getURL ("http://maxgames.com", _blank);
}
Symbol 101 MovieClip Frame 1
stop();
Symbol 101 MovieClip Frame 83
stop();
_root.hud.alert = "- PRESS SPACE -";
_root.stasis = true;
Symbol 105 MovieClip Frame 83
stop();
Symbol 109 Button
on (press) {
getURL ("http://maxgames.com", _blank);
}
Symbol 117 MovieClip Frame 10
stop();
Symbol 122 MovieClip [enemy2] Frame 1
stop();
Symbol 127 MovieClip Frame 10
stop();
Symbol 132 MovieClip [enemy3] Frame 1
stop();
Symbol 137 MovieClip Frame 10
stop();
Symbol 142 MovieClip [enemy5] Frame 1
stop();
Symbol 147 MovieClip Frame 10
stop();
Symbol 152 MovieClip [enemy4] Frame 1
stop();
Symbol 153 Button
on (press) {
stopAllSounds();
_root.gotoAndPlay(1);
}