Frame 1
powerBar._alpha = 0;
var keyListener2 = new Object();
keyListener2.onKeyUp = function () {
if (Key.getAscii() == 32) {
if (justStarted == 1) {
justStarted = 2;
}
}
};
Key.addListener(keyListener2);
ml = Math.round((_root.getBytesLoaded() / _root.getBytesTotal()) * 100);
Frame 2
if (ml < 100) {
gotoAndPlay (1);
} else {
gotoAndPlay (5);
}
Frame 5
firstTurn = true;
PLAYER1 = 1;
PLAYER2 = 2;
BASKET1 = 1;
BASKET2 = -1;
MAXPOWER = 800;
MAXPASS = 400;
CDIST = MAXPASS - 50;
HCDIST = MAXPASS - 50;
S_NET = 1;
S_GUARD_NET = 2;
S_BALL = 3;
S_BALL_LEFT = 4;
S_BALL_RIGHT = 5;
S_GUARD_BACK = 6;
O_BALL = 3;
O_GUARD = 2;
O_FORWARD = 1;
MAXX = 1080;
MINX = -440;
MAXY = 100;
MINY = -125;
allowMiss = 0;
TIMETOPLAY = 181000 /* 0x02C308 */;
NEEDTOWIN = 20;
DEBUG = false;
_global.team1P = 0;
_global.team2P = 0;
turnNow = PLAYER2;
FPOS = 560;
_global.chance = 0;
ballPass = 20;
compBallPass = 9;
var keyListener = new Object();
keyListener.onKeyDown = function () {
if (Key.getAscii() == 49) {
setStrategey(O_FORWARD);
} else if (Key.getAscii() == 50) {
setStrategey(O_GUARD);
} else if (Key.getAscii() == 51) {
setStrategey(O_BALL);
} else if (Key.getAscii() == 32) {
if (justStarted == 0) {
justStarted = 1;
} else if (justStarted == 2) {
justStarted = 3;
}
}
};
Key.addListener(keyListener);
baner._visible = false;
allreadyPassed = 0;
mess._alpha = 0;
mess.gotoAndPlay(1);
startDate = getTimer();
sound = true;
var loop_sound = new Sound();
loop_sound.attachSound("loop", false);
loop_sound.start(0.1);
loop_sound.setVolume(50);
menu.sb.onPress = function () {
if (sound) {
loop_sound.stop();
} else {
loop_sound.start();
}
sound = !sound;
};
stop();
P_EASY = 5;
P_MEDIUM = 8;
P_HARD = 12;
S_EASY = 50;
S_MEDIUM = 70;
S_HARD = 90;
A_EASY = 200;
A_MEDIUM = 140;
A_HARD = 80;
gameType = "points";
Frame 6
function shoot(player, basket, ballPass) {
_global.shootPlayer = player;
_global.shootBasket = basket;
_global.basketSide = ((basket == field.basket2) ? (BASKET1) : (BASKET2));
_global.distance = Math.sqrt(Math.pow(field.ball._x - basket._x, 2) + Math.pow(field.ball._y - basket._y, 2)) * _global.wind;
_global.bounch = Math.sqrt(Math.pow(field.ball._x - basket._x, 2) + Math.pow(field.ball._y - basket._y, 2));
_global.shootParam = _global.power - _global.distance;
field.ball.gotoAndPlay(60);
_global.mode = "shoot";
_global.ballX = -1 * Math.abs((field.ball._x - basket._x) / ballPass);
_global.ballY = -1 * Math.abs((field.ball._y - basket._y) / ballPass);
_global.ballPos = 0;
_global.helpingY = 20;
_global.ballAt = 0;
_global.arc = 24;
player._withBall = false;
}
function eshoot(player, ballPass) {
field.ball.gotoAndPlay(60);
_global.mode = "eshoot";
_global.ballX = (field.ball._x - field.basket1._x) / ballPass;
_global.ballY = (field.ball._y - field.basket1._y) / ballPass;
_global.ballPos = 0;
_global.helpingY = 20;
_global.justGotIt = false;
player._withBall = false;
}
function getBall(player, side) {
if (sound) {
audio.gotoAndPlay("steal");
}
dir = ((side == PLAYER1) ? 1 : -1);
field.ball._x = player._x + (dir * _global.aligX);
field.ball._y = player._y + (dir * _global.aligY);
field.ball.gotoAndPlay(1);
_global.chance = 10;
player._withBall = true;
_global.mode = "normal";
if (side == PLAYER2) {
_global.player2 = player;
if (_global.player1._withBall) {
_global.player1._withBall = false;
}
} else {
_global.player2._withBall = false;
}
_global.ballAt = side;
if (field.ball.getDepth() < player.getDepth()) {
player.swapDepths(field.ball);
}
}
function pass(fromPlayer, toPlayer, ballPass) {
fromPlayer.current._visible = false;
toPlayer.current._visible = true;
_global.pass = true;
_global.ballX = (toPlayer._x - fromPlayer._x) / ballPass;
_global.ballY = (toPlayer._y - fromPlayer._y) / ballPass;
_global.ballPos = 0;
_global.chance = 10;
if (_global.player1._withBall) {
_global.mode = "pass";
fromPlayer._withBall = false;
toPlayer._withBall = true;
}
_global.player1 = toPlayer;
if (field.ball.getDepth() < toPlayer.getDepth()) {
toPlayer.swapDepths(field.ball);
}
}
function compPass(fromPlayer, toPlayer, ballPass) {
_global.player2 = toPlayer;
_global.player2._withBall = true;
fromPlayer._withBall = false;
_global.ballX = (toPlayer._x - fromPlayer._x) / ballPass;
_global.ballY = (toPlayer._y - fromPlayer._y) / ballPass;
_global.compBallPos = 0;
_global.compPass = true;
field.ball.gotoAndPlay(60);
if (field.ball.getDepth() < toPlayer.getDepth()) {
toPlayer.swapDepths(field.ball);
}
}
function distance(player1, player2) {
return(Math.sqrt(Math.pow(player1._x - player2._x, 2) + Math.pow(player1._y - player2._y, 2)));
}
function setOrders() {
netClosnes = sortClosnes(_global.players, field.basket2);
hasBall = false;
ballPlayer = null;
i = 1;
while (i <= 3) {
if (_global.eplayers[i]._withBall) {
hasBall = true;
ballPlayer = _global.eplayers[i];
break;
}
i++;
}
if (hasBall) {
order = sortClosnes(_global.eplayers, field.basket1);
second = ((order[1] == ballPlayer) ? 2 : 1);
third = ((order[3] == ballPlayer) ? 2 : 3);
ballPlayer._hTarget = field.basket1;
ballPlayer._tactic = S_NET;
if ((order[second]._x - ballPlayer._x) > 0) {
order[second]._hTarget = ballPlayer;
order[second]._tactic = S_BALL_RIGHT;
} else {
order[second]._hTarget = ballPlayer;
order[second]._tactic = S_BALL_LEFT;
}
order[third]._hTarget = (netClosnes[1]._x + netClosnes[2]._x) / 2;
order[third]._tactic = S_GUARD_BACK;
} else {
order = sortClosnes(_global.eplayers, field.ball);
order[1]._hTarget = field.ball;
order[1]._tactic = S_BALL;
order[2]._hTarget = field.ball;
order[2]._tactic = evaluateChance(order[1]);
order[3]._hTarget = netClosnes[1];
order[3]._tactic = S_GUARD_NET;
}
}
function evaluateChance(player) {
if (_global.player1._withBall or (distance(player, field.ball) > distance(_global.player1, field.ball))) {
return(S_BALL_LEFT);
}
return(S_BALL_RIGHT);
}
function sortClosnes(team, target) {
order = new Array();
t1 = distance(team[1], target);
t2 = distance(team[2], target);
t3 = distance(team[3], target);
if (t1 < t2) {
if (t2 < t3) {
order[1] = team[1];
order[2] = team[2];
order[3] = team[3];
} else if (t1 < t3) {
order[1] = team[1];
order[2] = team[3];
order[3] = team[2];
} else {
order[1] = team[3];
order[2] = team[1];
order[3] = team[2];
}
} else if (t1 < t3) {
order[1] = team[2];
order[2] = team[1];
order[3] = team[3];
} else if (t2 < t3) {
order[1] = team[2];
order[2] = team[3];
order[3] = team[1];
} else {
order[1] = team[3];
order[2] = team[2];
order[3] = team[1];
}
return(order);
}
function eMove(player) {
speed = (player._withBall ? (bspeed) : (nspeed));
targetX = (targetY = 0);
switch (player._tactic) {
case S_BALL_LEFT :
targetX = player._hTarget._x - CDIST;
targetY = player._hTarget._y - randomY();
break;
case S_BALL_RIGHT :
targetX = player._hTarget._x + CDIST;
targetY = player._hTarget._y + randomY();
break;
case S_GUARD_NET :
targetX = player._hTarget._x - CDIST;
targetY = player._hTarget._y + (CDIST / 8);
break;
case S_GUARD_BACK :
targetX = player._hTarget;
targetY = _global.randomY;
break;
default :
targetX = player._hTarget._x;
targetY = player._hTarget._y;
}
if (((player._x > targetX) and ((_global.chance == 0) or player._withBall)) and (player._x > MINX)) {
player._x = player._x - speed;
if (player._withBall) {
audio.gotoAndPlay("bounch");
field.ball._x = field.ball._x - speed;
}
}
if (((player._x < targetX) and ((_global.chance == 0) or player._withBall)) and (player._x < MAXX)) {
player._x = player._x + speed;
if (player._withBall) {
field.ball._x = field.ball._x + speed;
audio.gotoAndPlay("bounch");
}
}
if (((player._y > targetY) and ((_global.chance == 0) or player._withBall)) and (player._y > MINY)) {
player._y = player._y - speed;
if (player._withBall) {
audio.gotoAndPlay("bounch");
field.ball._y = field.ball._y - speed;
}
}
if (((player._y < targetY) and ((_global.chance == 0) or player._withBall)) and (player._y < MAXY)) {
player._y = player._y + speed;
if (player._withBall) {
field.ball._y = field.ball._y + speed;
audio.gotoAndPlay("bounch");
}
}
if ((player.hitTest(field.ball) and (_global.chance == 0)) and (!_global.player2._withBall)) {
getBall(player, PLAYER2);
}
}
function randomY() {
if (random(10) == 0) {
_global.randomY = -50 + (Math.random() * 100);
}
return(_global.randomY);
}
function setPlayerOrders() {
order2 = sortClosnes(_global.players, field.basket2);
second = ((order2[1] == _global.player1) ? 2 : 1);
third = ((order2[3] == _global.player1) ? 2 : 3);
if (_global.orders == O_GUARD) {
order2[second]._tactic = S_BALL_LEFT;
order2[third]._tactic = S_BALL_LEFT;
order2[second]._hTarget = _global.player1;
order2[third]._hTarget = field.basket1;
} else if (_global.orders == O_BALL) {
order[second]._tactic = S_BALL_LEFT;
order[third]._tactic = S_BALL_RIGHT;
order[third]._hTarget = (order[second]._hTarget = field.ball);
} else {
order[second]._tactic = S_NET;
order[third]._tactic = S_BALL_LEFT;
order[third]._hTarget = (order[second]._hTarget = _global.player1);
}
}
function pMove(player) {
modY = random(75) + 50;
speed = (player._withBall ? (bspeed) : (nspeed));
switch (player._tactic) {
case S_BALL_RIGHT :
modX = -1 * HCDIST;
break;
case S_NET :
modX = 1.5 * HCDIST;
modY = 60 + random(25);
break;
case S_GUARD_NET :
modX = -0.5 * HCDIST;
break;
default :
modY = random(25) - 80;
modX = HCDIST;
}
if ((player._x > (player._hTarget._x - modX)) and (player._x > MINX)) {
player._x = player._x - speed;
if (player._withBall) {
field.ball._x = field.ball._x - speed;
}
}
if ((player._x < (player._hTarget._x - modX)) and (player._x < MAXX)) {
player._x = player._x + speed;
if (player._withBall) {
field.ball._x = field.ball._x + speed;
}
}
if ((player._y > (player._hTarget._y - modY)) and (player._y > MINY)) {
player._y = player._y - speed;
if (player._withBall) {
field.ball._y = field.ball._y - speed;
}
}
if ((player._y < (player._hTarget._y - modY)) and (player._y < MAXY)) {
player._y = player._y + speed;
if (player._withBall) {
field.ball._y = field.ball._y + speed;
}
}
}
function setStrategey(strategy) {
if (strategy == _global.orders) {
return(undefined);
}
_global.orders = strategy;
orderPanel.gotoAndPlay(strategy);
}
function zoom() {
if (_global.turnPass) {
if (_global.turnCount == 5) {
_global.turnPass = false;
} else {
_global.turnCount++;
field._x = FPOS - ((_global.player1._x * (_global.turnCount / 5)) + (_global.xplayer1._x * (1 - (_global.turnCount / 5))));
}
} else if ((!_global.pass) and ((_global.mode == "normal") or (_global.mode == "ballDown"))) {
field._x = FPOS - _global.player1._x;
if (field._x > 700) {
field._x = 700;
}
} else if (((_global.pass or (_global.mode == "shoot")) or (_global.mode == "eshoot")) or (_global.mode == "bad")) {
field._x = FPOS - field.ball._x;
} else if (_global.mode == "ok") {
field._x = FPOS - field.a1._x;
}
}
function shootMove(ballPass, orientX, orientY, trackField) {
field.ball._x = field.ball._x + ((_global.ballX * trackField) * orientX);
if (trackField >= 1) {
field.ball._y = field.ball._y + (_global.ballY * orientY);
}
if (_global.ballPos <= ((2 * ballPass) / 5)) {
field.ball._y = field.ball._y - _global.arc;
_global.arc = _global.arc - 3;
} else if (_global.ballPos >= ((3 * ballPass) / 5)) {
field.ball._y = field.ball._y + _global.arc;
_global.arc = _global.arc + 3.3;
}
}
function startTurn() {
field.a1._x = 700;
field.a1._y = 10;
field.a2._x = 860;
field.a2._y = -61;
field.a3._x = 649;
field.a3._y = -118;
field.b1._x = -73;
field.b1._y = -55;
field.b2._x = -210;
field.b2._y = 2.6;
field.b3._x = -190;
field.b3._y = -79;
zoom();
}
if (firstTurn) {
loop_sound.stop();
firstTurn = false;
field.attachMovie("namnum", "a1", 1001);
field.attachMovie("namnum", "a2", 1002);
field.attachMovie("namnum", "a3", 1003);
field.attachMovie("enamnum", "b1", 1004);
field.attachMovie("enamnum", "b2", 1005);
field.attachMovie("enamnum", "b3", 1006);
field.attachMovie("ball", "ball", 1007);
field.attachMovie("basket", "basket2", 1008);
field.attachMovie("basket", "basket1", 1009);
field.attachMovie("board", "board1", 1010);
field.basket2._x = -520;
field.basket2._y = -100;
field.basket1._x = 1113;
field.basket1._y = -65;
field.board1._x = 1110;
field.board1._y = -140;
_global.players = new Array(null, field.a1, field.a2, field.a3);
_global.eplayers = new Array(null, field.b1, field.b2, field.b3);
everybody = new Array(field.a1, field.a2, field.a3, field.b1, field.b2, field.b3);
}
_global.player1 = field.a1;
_global.player2 = field.b1;
_global.player2b = field.b2;
_global.power = 0;
t1p.text = _global.team1P;
t2p.text = _global.team2P;
side = PLAYER1;
powerUp = false;
_global.mode = "wait";
_global.pass = false;
changePlayer = 2;
_root.secIn = false;
_global.turnPass = false;
field.a1._withBall = true;
field.a2._withBall = false;
field.a3._withBall = false;
field.a1.current._visible = true;
field.a2.current._visible = false;
field.a3.current._visible = false;
field.a1._xPos = 0;
field.a2._xPos = -40;
field.a3._xPos = 40;
_global.player1Number = 1;
_global.aligX = -15;
_global.aligY = 0;
nspeed = 10;
bspeed = 7;
_global.shootParam = 0;
_global.randomY = randomY();
_global.wind = 0.4 + (Math.random() * 1.2);
trackField = 1;
loop = 0;
side = 0;
powerBar._alpha = 0;
mess._alpha = 0;
mess.gotoAndPlay(1);
startTurn();
zoom();
allreadyPassed = allreadyPassed + (getTimer() - startDate);
startDate = getTimer();
timeToAdd = 0;
turnNow = ((turnNow == PLAYER1) ? (PLAYER2) : (PLAYER1));
clock._visible = ((gameType == "time") ? true : false);
if (turnNow == PLAYER1) {
getBall(_global.player1, PLAYER1);
_global.mode = "wait";
_global.ballAt = PLAYER1;
justStarted = 0;
baner._visible = true;
baner.gotoAndPlay(13);
} else {
getBall(_global.player2, PLAYER2);
_global.mode = "wait";
_global.ballAt = PLAYER2;
justStarted = 0;
baner._visible = true;
baner.gotoAndPlay(1);
}
if (_global.wind > 1) {
rightBar._xscale = 100;
leftBar._xscale = 100 * ((1.6 - _global.wind) / 0.6);
} else {
rightBar._xscale = 100 * (1 - ((1 - _global.wind) / 0.6));
leftBar._xscale = 100;
}
Frame 8
pspeed = (_global.player1._withBall ? (bspeed) : (nspeed));
if ((Key.isDown(37) and ((_global.mode == "normal") or (_global.mode == "ballDown"))) and (_global.player1._x > MINX)) {
_global.player1._x = _global.player1._x - pspeed;
_global.player1._xPos = _global.player1._xPos - pspeed;
if (_global.player1._withBall) {
field.ball._x = field.ball._x - pspeed;
audio.gotoAndPlay("bounch");
}
}
if ((Key.isDown(39) and ((_global.mode == "normal") or (_global.mode == "ballDown"))) and (_global.player1._x < MAXX)) {
_global.player1._x = _global.player1._x + pspeed;
_global.player1._xPos = _global.player1._xPos + pspeed;
if (_global.player1._withBall) {
audio.gotoAndPlay("bounch");
field.ball._x = field.ball._x + pspeed;
}
}
if ((Key.isDown(40) and ((_global.mode == "normal") or (_global.mode == "ballDown"))) and (_global.player1._y < MAXY)) {
_global.player1._y = _global.player1._y + pspeed;
if (_global.player1._withBall) {
audio.gotoAndPlay("bounch");
field.ball._y = field.ball._y + pspeed;
}
}
if ((Key.isDown(38) and ((_global.mode == "normal") or (_global.mode == "ballDown"))) and (_global.player1._y > MINY)) {
_global.player1._y = _global.player1._y - pspeed;
if (_global.player1._withBall) {
audio.gotoAndPlay("bounch");
field.ball._y = field.ball._y - pspeed;
}
}
if ((Key.isDown(32) and (_global.chance == 0)) and (((_global.mode == "normal") or (_global.mode == "powerUp")) or (_global.mode == "wait"))) {
if (_global.mode == "wait") {
TIMETOPLAY = TIMETOPLAY + timeToAdd;
_global.mode = "normal";
baner.play();
} else if ((justStarted == 3) and secIn) {
if (_global.player1._withBall) {
if (powerBar._alpha < 90) {
powerBar._alpha = powerBar._alpha + 20;
}
powerBar.powerBar._xscale = 100 * ((800 - _global.power) / 800);
_global.mode = "powerUp";
_global.power = _global.power + 40;
if (_global.power > MAXPOWER) {
_global.power = MAXPOWER;
}
powerUp = true;
} else if (_global.player1.namnum.hitTest(_global.player2) and _global.player2._withBall) {
getBall(_global.player1, PLAYER1);
}
}
}
if ((((((!Key.isDown(32)) and powerUp) and (_global.chance == 0)) and (!_global.compPass)) and (!_global.pass)) and secIn) {
if (justStarted == 3) {
powerUp = false;
ballPass = 20;
dis = distance(_global.player1, field.basket2);
need = dis * _global.wind;
if ((dis > 610) and (_global.power >= (need - (acuracyDif + 20)))) {
trace("need :" + need);
_global.power = (need - acuracyDif) / 2;
}
shoot(_global.player1, field.basket2, 20);
}
}
if ((Key.isDown(17) and (!_global.pass)) and ((_global.mode == "normal") or (_global.mode == "ballDown"))) {
_global.player1Number = (((_global.player1Number + 1) <= 3) ? (_global.player1Number + 1) : 1);
if (_global.player1._withBall) {
ballPass = 7;
backupP = _global.player1Number;
if (changePlayer != 0) {
_global.player1Number = changePlayer;
}
if ((distance(_global.player1, _global.players[_global.player1Number]) > MAXPASS) and _global.player1._withBall) {
changePlayer = _global.player1Number;
_global.player1Number = (((_global.player1Number + 1) <= 3) ? (_global.player1Number + 1) : 1);
if (_global.player1Number == backupP) {
_global.player1Number = (((_global.player1Number + 1) <= 3) ? (_global.player1Number + 1) : 1);
}
} else {
changePlayer = 0;
}
if ((distance(_global.player1, _global.players[_global.player1Number]) <= MAXPASS) or (!_global.player1._withBall)) {
pass(_global.player1, _global.players[_global.player1Number], ballPass);
} else {
_global.player1Number = backupP;
}
} else if (!_global.turnPass) {
_global.turnPass = true;
_global.turnCount = 0;
num = 0;
i = 1;
while (i <= 3) {
if (_global.player1 == _global.players[i]) {
num = i;
}
i++;
}
num = (num % 3) + 1;
_global.player1.current._visible = false;
_global.xplayer1 = _global.player1;
_global.player1 = _global.players[num];
_global.player1.current._visible = true;
zoom();
}
}
if (_global.mode == "ballDown") {
if (_global.player1.namnum.hitTest(field.ball)) {
getBall(_global.player1, PLAYER1);
}
}
if (_global.mode == "shoot") {
if (powerBar._alpha > 0) {
powerBar._alpha = powerBar._alpha - 20;
}
trackField = _global.power / _global.bounch;
_global.badP = 1;
allowMiss = ((_global.shootPlayer == _global.player1) ? (acuracyDif) : (A_HARD));
if ((Math.abs(_global.shootParam) <= allowMiss) and (((aw = distance(_global.shootPlayer, _global.shootBasket))) <= 610)) {
trackField = 1;
}
if (_global.ballPos == ballPass) {
if (sound) {
audio.gotoAndPlay("backboard");
}
if ((Math.abs(_global.shootParam) <= allowMiss) and (((aw = distance(_global.shootPlayer, _global.shootBasket))) <= 610)) {
_global.mode = "ok";
tempDate = getTimer();
mess._visible = true;
if (_global.shootPlayer == _global.player1) {
if (aw >= 530) {
_global.team1P = _global.team1P + 3;
mess.gotoAndPlay(5);
} else {
_global.team1P = _global.team1P + 2;
mess.gotoAndPlay(4);
}
} else if (aw >= 530) {
_global.team2P = _global.team2P + 3;
mess.gotoAndPlay(3);
} else {
_global.team2P = _global.team2P + 2;
mess.gotoAndPlay(2);
}
if (gameType == "points") {
if (_global.team1P >= NEEDTOWIN) {
mess.gotoAndPlay(7);
_global.mode = "over";
} else if (_global.team2P >= NEEDTOWIN) {
mess.gotoAndPlay(6);
_global.mode = "over";
}
}
} else {
_global.ballPos = 0;
_global.mode = "bad";
side = 1;
}
} else {
_global.ballPos++;
if (_global.shootParam >= (-1 * allowMiss)) {
shootMove(ballPass, _global.basketSide, 1, 1);
} else {
if (trackField > 0.8) {
trackField = 0.8;
}
shootMove(ballPass, _global.basketSide, 1, trackField);
}
}
}
if (_global.pass) {
if (_global.ballPos == ballPass) {
_global.pass = false;
if (_global.mode == "pass") {
field.ball.gotoAndPlay(1);
_global.mode = "normal";
}
} else {
_global.ballPos++;
if (_global.mode == "pass") {
field.ball._x = field.ball._x + _global.ballX;
field.ball._y = field.ball._y + _global.ballY;
}
}
}
if (_global.compPass) {
if (_global.compBallPos == compBallPass) {
_global.compPass = false;
field.ball.gotoAndPlay(1);
} else {
_global.compBallPos++;
field.ball._x = field.ball._x + _global.ballX;
field.ball._y = field.ball._y + _global.ballY;
}
}
if (_global.mode == "bad") {
if ((_global.ballPos == ballPass) or (_global.shootParam < 1)) {
_global.mode = "ballDown";
_global.power = 0;
} else {
_global.ballPos++;
if (_global.shootParam >= 0) {
shootMove(20, -1 * _global.basketSide, -1, trackField);
} else {
field.ball.gotoAndStop(60);
}
}
}
if (_global.mode == "ok") {
if ((getTimer() - tempDate) > 3000) {
startTurn();
gotoAndPlay (6);
}
if (mess._alpha < 90) {
mess._alpha = mess._alpha + 10;
}
}
if (_global.mode == "over") {
if (mess._alpha < 95) {
mess._alpha = mess._alpha + 10;
} else {
stop();
}
}
if (((!DEBUG) and (!_global.compPass)) and (!_global.pass)) {
if ((_global.mode == "normal") or (_global.mode == "ballDown")) {
toDo = true;
i = 1;
while (i <= 3) {
dif = _global.eplayers[i]._x - _global.player2._x;
if ((((((_global.player2._withBall and (_global.player2 != _global.eplayers[i])) and (dif > 50)) and (dif <= MAXPASS)) and toDo) and (distance(_global.player1, _global.eplayers[i]) > 120)) and (random(100) <= passDif)) {
toDo = false;
compPass(_global.player2, _global.eplayers[i], compBallPass);
}
i++;
}
if ((_global.player2._withBall and toDo) and (distance(_global.player1, _global.player2) < 90)) {
i = 1;
while (i <= 3) {
dif = distance(_global.eplayers[i], _global.player2);
if (((((_global.player2 != _global.eplayers[i]) and (dif <= MAXPASS)) and toDo) and (distance(_global.player1, _global.eplayers[i]) > 200)) and (random(100) <= passDif)) {
toDo = false;
compPass(_global.player2, _global.eplayers[i], compBallPass);
}
i++;
}
}
if ((_global.player2._withBall and (distance(_global.player2, field.basket1) < 410)) and toDo) {
toDo = false;
ballPass = 20;
_global.power = distance(_global.player2, field.basket1) * _global.wind;
if (random(100) >= scoreDif) {
_global.power = _global.power + (100 * (1.1 + (Math.random() * 2)));
}
shoot(_global.player2, field.basket1, 20);
}
if (toDo) {
setOrders();
i = 1;
while (i <= 3) {
eMove(_global.eplayers[i]);
i++;
}
}
}
}
if ((_global.mode == "normal") or (_global.mode == "ballDown")) {
setPlayerOrders();
i = 1;
while (i <= 3) {
if (_global.players[i] != _global.player1) {
pMove(_global.players[i]);
}
i++;
}
}
zoom();
if (_global.chance > 0) {
_global.chance--;
}
if (_global.mode == "wait") {
timeToAdd = getTimer() - startDate;
}
if (((gameType == "time") and (_global.mode != "wait")) and (_global.mode != "over")) {
timeLeft = TIMETOPLAY - (allreadyPassed + (getTimer() - startDate));
if (timeLeft < 0) {
timeLeft = 0;
}
minLeftValue = timeLeft / 60000;
clock.minLeft.text = Math.floor(minLeftValue);
secLeftValue = Math.floor(timeLeft / 1000) % 60;
if (secLeftValue >= 10) {
clock.secLeft.text = secLeftValue;
} else {
clock.secLeft.text = "0" + secLeftValue;
}
if (timeLeft <= 0) {
_global.mode = "over";
if (_global.team1P > _global.team2P) {
mess.gotoAndPlay(7);
} else if (_global.team1P < _global.team2P) {
mess.gotoAndPlay(6);
} else {
mess.gotoAndPlay(8);
}
}
}
i = 0;
while (i < 6) {
j = 0;
while (j < 6) {
if (((i != j) and (everybody[i]._y > everybody[j]._y)) and (everybody[i].getDepth() < everybody[j].getDepth())) {
if (everybody[i]._withBall) {
everybody[i].swapDepths(everybody[j]);
if (field.ball.getDepth() < everybody[i].getDepth()) {
everybody[i].swapDepths(field.ball);
}
} else if (everybody[j]._withBall) {
if (field.ball.getDepth() > everybody[i].getDepth()) {
everybody[i].swapDepths(field.ball);
}
if (field.ball.getDepth() < everybody[j].getDepth()) {
everybody[j].swapDepths(field.ball);
}
} else {
everybody[i].swapDepths(everybody[j]);
}
}
j++;
}
i++;
}
gotoAndPlay (7);
trace("dis :" + _global.distance);
trace("pow: " + _global.power);
Symbol 15 MovieClip [ball] Frame 9
gotoAndPlay (1);
Symbol 15 MovieClip [ball] Frame 47
Symbol 15 MovieClip [ball] Frame 57
stop();
Symbol 15 MovieClip [ball] Frame 60
stop();
Symbol 48 Button
on (press) {
getURL ("http://www.firefrogs.com", "_blank");
}
Symbol 50 Button
on (rollOver) {
b1.moveNow = true;
b1.play();
}
on (rollOut) {
b1.moveNow = false;
}
on (release) {
_root.gameType = "points";
nextFrame();
}
Symbol 51 Button
on (rollOver) {
b2.moveNow = true;
b2.play();
}
on (rollOut) {
b2.moveNow = false;
}
on (release) {
_root.gameType = "time";
nextFrame();
}
Symbol 52 Button
on (rollOver) {
b3.moveNow = true;
b3.play();
}
on (rollOut) {
b3.moveNow = false;
}
on (release) {
gotoAndlay(3);
}
Symbol 60 MovieClip Frame 1
SIZEX = -30;
SIZEY = 2;
SPEED = 10;
if ((!moveNow) and (_xscale == 100)) {
dir = "up";
stop();
} else if (dir == "up") {
if (_xscale < 150) {
_xscale = (_xscale + SPEED);
_x = (_x + SIZEX);
_yscale = (_yscale + SPEED);
_y = (_y - SIZEY);
} else {
dir = "down";
}
} else if (_xscale > 100) {
_xscale = (_xscale - SPEED);
_x = (_x - SIZEX);
_yscale = (_yscale - SPEED);
_y = (_y + SIZEY);
} else {
dir = "up";
}
Symbol 60 MovieClip Frame 2
gotoAndPlay (1);
Symbol 62 MovieClip Frame 1
SIZEX = -30;
SIZEY = 2;
SPEED = 10;
if ((!moveNow) and (_xscale == 100)) {
dir = "up";
stop();
} else if (dir == "up") {
if (_xscale < 150) {
_xscale = (_xscale + SPEED);
_x = (_x + SIZEX);
_yscale = (_yscale + SPEED);
_y = (_y - SIZEY);
} else {
dir = "down";
}
} else if (_xscale > 100) {
_xscale = (_xscale - SPEED);
_x = (_x - SIZEX);
_yscale = (_yscale - SPEED);
_y = (_y + SIZEY);
} else {
dir = "up";
}
Symbol 62 MovieClip Frame 2
gotoAndPlay (1);
Symbol 64 MovieClip Frame 1
SIZEX = -30;
SIZEY = 2;
SPEED = 10;
if ((!moveNow) and (_xscale == 100)) {
dir = "up";
stop();
} else if (dir == "up") {
if (_xscale < 150) {
_xscale = (_xscale + SPEED);
_x = (_x + SIZEX);
_yscale = (_yscale + SPEED);
_y = (_y - SIZEY);
} else {
dir = "down";
}
} else if (_xscale > 100) {
_xscale = (_xscale - SPEED);
_x = (_x - SIZEX);
_yscale = (_yscale - SPEED);
_y = (_y + SIZEY);
} else {
dir = "up";
}
Symbol 64 MovieClip Frame 2
gotoAndPlay (1);
Symbol 65 Button
on (rollOver) {
b1.moveNow = true;
b1.play();
}
on (rollOut) {
b1.moveNow = false;
}
on (release) {
_root.gameType = "points";
b1.moveNow = false;
b1._xscale = 100;
b1.stop();
play();
}
Symbol 66 Button
on (rollOver) {
b2.moveNow = true;
b2.play();
}
on (rollOut) {
b2.moveNow = false;
}
on (release) {
_root.gameType = "time";
play();
}
Symbol 67 Button
on (rollOver) {
b3.moveNow = true;
b3.play();
}
on (rollOut) {
b3.moveNow = false;
}
on (release) {
gotoAndPlay (27);
}
Symbol 68 Button
on (release) {
_root.passDif = _root.P_EASY;
_root.scoreDif = _root.S_EASY;
_root.acuracyDif = _root.A_EASY;
_root.startDate = getTimer();
_root.gotoAndPlay(5);
}
Symbol 69 Button
on (release) {
_root.passDif = _root.P_MEDIUM;
_root.scoreDif = _root.S_MEDIUM;
_root.acuracyDif = _root.A_MEDIUM;
_root.startDate = getTimer();
_root.gotoAndPlay(5);
}
Symbol 70 Button
on (release) {
_root.passDif = _root.P_HARD;
_root.scoreDif = _root.S_HARD;
_root.acuracyDif = _root.A_HARD;
_root.startDate = getTimer();
_root.gotoAndPlay(5);
}
Symbol 74 Button
on (release) {
play();
}
Symbol 102 MovieClip Frame 1
stop();
Symbol 110 Button
on (release) {
gotoAndPlay (1);
}
Symbol 111 MovieClip Frame 1
order = "none";
Instance of Symbol 60 MovieClip "b1" in Symbol 111 MovieClip Frame 1
onClipEvent (load) {
but1.text = "score";
but2.text = "match";
moveNow = false;
dir = "up";
}
Symbol 111 MovieClip Frame 7
stop();
Symbol 111 MovieClip Frame 20
stop();
Symbol 111 MovieClip Frame 26
gotoAndPlay (1);
Symbol 111 MovieClip Frame 27
stop();
Symbol 113 MovieClip Frame 1
if (_root.loop_sound.position >= 11000) {
_root.loop_sound.stop();
_root.loop_sound.start(0.09);
}
Symbol 113 MovieClip Frame 2
gotoAndPlay (1);
Symbol 119 MovieClip Frame 1
stop();
Symbol 129 MovieClip Frame 1
stop();
Symbol 129 MovieClip Frame 2
stop();
Symbol 129 MovieClip Frame 3
stop();
Symbol 155 MovieClip Frame 6
_root.justStarted = 0;
stop();
Symbol 155 MovieClip Frame 11
_root.secIn = true;
Symbol 155 MovieClip Frame 12
_visible = false;
stop();
Symbol 155 MovieClip Frame 18
_root.justStarted = 0;
stop();
Symbol 155 MovieClip Frame 23
_root.secIn = true;
Symbol 155 MovieClip Frame 24
_visible = false;
stop();
Symbol 162 Button
on (press) {
_root.gotoAndPlay(5);
}
Symbol 166 MovieClip Frame 1
stop();
Symbol 166 MovieClip Frame 2
stop();
Symbol 166 MovieClip Frame 3
stop();
Symbol 166 MovieClip Frame 4
stop();
Symbol 166 MovieClip Frame 5
stop();
Symbol 166 MovieClip Frame 6
stop();
Symbol 166 MovieClip Frame 7
stop();
Symbol 166 MovieClip Frame 8
stop();
Symbol 178 MovieClip Frame 1
stop();
Symbol 178 MovieClip Frame 2
gotoAndPlay ("start");
Symbol 178 MovieClip Frame 3
if (!_root.sound) {
gotoAndPlay ("start");
}
Symbol 178 MovieClip Frame 4
gotoAndPlay ("start");
Symbol 178 MovieClip Frame 5
gotoAndPlay ("start");
Symbol 178 MovieClip Frame 6
gotoAndPlay ("start");
Symbol 178 MovieClip Frame 7
gotoAndPlay ("start");
Symbol 179 Button
on (press) {
sound = !sound;
}