Frame 1
OnePercent = this.getBytesTotal() / 100;
difficulty = 0;
diftext = new Array("Novice", "Normal", "Expert");
teamScroll = 5;
teamLeft = 7;
teamRight = 14;
teamNumber = 15;
Teams = new Array(teamNumber);
torsColors = new Array(teamNumber);
legColors = new Array(teamNumber);
Teams[0] = "Japan";
torsColors[0] = "-255,-255,90";
legColors[0] = "255,255,255";
Teams[1] = "Korea Republic";
torsColors[1] = "255,255,255";
legColors[1] = "255,-150,-120";
Teams[2] = "England";
torsColors[2] = "180,180,180";
legColors[2] = "180,180,180";
Teams[3] = "Netherlands";
torsColors[3] = "-255,-75,90";
legColors[3] = " 255, -30,-120";
Teams[4] = "Spain";
torsColors[4] = "-15,-255,-255";
legColors[4] = "-255,-255,-45";
Teams[5] = "Portugal";
torsColors[5] = "-90,-255,-255";
legColors[5] = "-255,-75,-75";
Teams[6] = "Italy";
torsColors[6] = "255,255,255";
legColors[6] = "-255,-30,255";
Teams[7] = "Russia";
torsColors[7] = "-255,-60,30";
legColors[7] = "-255,-60,30";
Teams[8] = "Ukraine";
torsColors[8] = "-255,-75,90";
legColors[8] = "120,160,-255";
Teams[9] = "Brasil";
torsColors[9] = "255,255,-255";
legColors[9] = "-255,-255,135";
Teams[10] = "Turkey";
torsColors[10] = "210,-225,-225";
legColors[10] = "210,-225,-225";
Teams[11] = "Saudi-Arabia";
torsColors[11] = "-165,-15,-30";
legColors[11] = "-165,-15,-30";
Teams[12] = "USA";
torsColors[12] = "255,45,45";
legColors[12] = "-255,-255,-60";
Teams[13] = "Senegal";
torsColors[13] = "-150,-15,-15";
legColors[13] = "255,255,255";
Teams[14] = "Germany";
torsColors[14] = "255,255,255";
legColors[14] = "-255,-255,-255";
borderbannerURL = "http://www.vrtainment.de";
endgameURL = "http://www.vrtainment.de";
coryrightURL = "http://www.vrtainment.de";
Frame 2
title._alpha = Math.round(getBytesLoaded() / OnePercent);
tellTarget ("Progress Bar") {
gotoAndStop(Math.round(this.getBytesLoaded() / _parent.OnePercent));
};
if (this.getBytesLoaded() >= this.getBytesTotal()) {
gotoAndPlay (5);
}
Frame 3
gotoAndPlay (2);
Frame 17
stop();
Frame 25
stop();
Frame 30
stop();
Frame 36
stop();
Symbol 28 MovieClip Frame 234
_parent.gotoAndStop("title");
Symbol 54 MovieClip Frame 1
stop();
Symbol 54 MovieClip Frame 2
stop();
Symbol 59 MovieClip Frame 9
if (this._name == "curve3") {
this._parent.caption.title.gotoAndStop(2);
}
Symbol 59 MovieClip Frame 12
if (this._name == "curve3") {
this._parent.gotoAndPlay("scene2");
}
stop();
Symbol 60 MovieClip Frame 9
if (this._name == "curve3") {
this._parent.caption.title.gotoAndStop(2);
}
Symbol 60 MovieClip Frame 12
if (this._name == "curve3") {
this._parent.gotoAndPlay("scene2");
}
stop();
Symbol 76 Button
on (release) {
_parent._parent.gotoAndPlay("endscene");
}
Symbol 82 Button
on (release) {
_root.difficulty = 0;
_parent.gotoAndPlay("close");
_parent._parent.dif = _root.diftext[_root.difficulty];
}
Symbol 84 Button
on (release) {
_root.difficulty = 1;
_parent.gotoAndPlay("close");
_parent._parent.dif = _root.diftext[_root.difficulty];
}
Symbol 86 Button
on (release) {
_root.difficulty = 2;
_parent.gotoAndPlay("close");
_parent._parent.dif = _root.diftext[_root.difficulty];
}
Symbol 88 MovieClip Frame 1
mainStopTime = _parent.stoppedTime;
pauseTime = 1000 * _parent.pauseTime;
_parent.stop();
if (Number(getTimer()) >= (pauseTime + mainStopTime)) {
_parent.play();
}
Symbol 89 MovieClip Frame 1
opening = false;
stop();
Symbol 89 MovieClip Frame 2
opening = true;
Symbol 89 MovieClip Frame 10
stoppedTime = getTimer();
pauseTime = 3;
Symbol 89 MovieClip Frame 15
opening = false;
Symbol 90 Button
on (rollOver) {
if (switcher.opening == false) {
switcher.gotoAndPlay("open");
}
}
Symbol 96 Button
on (release) {
_parent.teamselect.gotoAndStop("open");
_parent.gotoAndStop("nobuttons");
}
Symbol 107 Button
on (release) {
_parent._parent.gotoAndStop("buttons");
_parent.gotoAndStop("hide");
}
Symbol 109 Button
on (rollOver) {
list1.scrolling = _root.teamScroll;
}
on (rollOut) {
list1.scrolling = 0;
}
Symbol 110 Button
on (rollOver) {
list1.scrolling = -_root.teamScroll;
}
on (rollOut) {
list1.scrolling = 0;
}
Symbol 111 Button
on (rollOver) {
list2.scrolling = _root.teamScroll;
}
on (rollOut) {
list2.scrolling = 0;
}
Symbol 112 Button
on (rollOver) {
list2.scrolling = -_root.teamScroll;
}
on (rollOut) {
list2.scrolling = 0;
}
Symbol 117 Button
on (release) {
if (_parent._parent._name == "list1") {
if (number == _root.teamRight) {
success = false;
_parent._parent._parent.error.gotoAndPlay("show");
} else {
success = true;
teamTemp = _root.teamLeft;
_root.teamLeft = number;
_parent._parent._parent._parent._parent.teamLeft = _root.teams[_root.teamLeft];
var baller = eval (_parent._parent._parent.fballer1);
baller.SetColors(_root.teamLeft);
}
} else if (number == _root.teamLeft) {
success = false;
_parent._parent._parent.error.gotoAndPlay("show");
} else {
success = true;
teamTemp = _root.teamRight;
_root.teamRight = number;
_parent._parent._parent._parent._parent.teamRight = _root.teams[_root.teamRight];
_parent._parent._parent.fballer2.SetColors(_root.teamRight);
}
if (success == true) {
oldBtn = eval ("_parent.team" + teamTemp);
oldBtn.bg._alpha = 0;
bg._alpha = 18;
}
}
Symbol 119 MovieClip Frame 1
i = 0;
while (i < _root.teamNumber) {
if (i != 0) {
duplicateMovieClip ("team0", "team" + i, i);
btn = eval ("team" + i);
btn._x = team0._x;
btn._y = team0._y + (team0._height * i);
}
btn = eval ("team" + i);
btn.caption = _root.teams[i];
btn.number = i;
if (_parent._name == "list1") {
((i == _root.teamLeft) ? ((btn.bg._alpha = 18)) : ((btn.bg._alpha = 0)));
} else if (_parent._name == "list2") {
((i == _root.teamRight) ? ((btn.bg._alpha = 18)) : ((btn.bg._alpha = 0)));
}
i++;
}
stop();
Symbol 120 MovieClip Frame 1
var enabled = (((0 < _parent.scrolling) && (_parent.list._y < 0)) || ((_parent.scrolling < 0) && ((162 - _parent.list._y) < _parent.list._height)));
((enabled == true) ? ((_parent.list._y = _parent.list._y + _parent.scrolling)) : ((_parent.list._y = _parent.list._y)));
Symbol 375 MovieClip Frame 1
stop();
Symbol 375 MovieClip Frame 2
stop();
Symbol 375 MovieClip Frame 3
stop();
Symbol 375 MovieClip Frame 4
stop();
Symbol 375 MovieClip Frame 5
stop();
Symbol 375 MovieClip Frame 6
stop();
Symbol 375 MovieClip Frame 7
stop();
Symbol 375 MovieClip Frame 8
stop();
Symbol 375 MovieClip Frame 9
stop();
Symbol 375 MovieClip Frame 10
stop();
Symbol 375 MovieClip Frame 11
stop();
Symbol 375 MovieClip Frame 12
stop();
Symbol 375 MovieClip Frame 13
stop();
Symbol 375 MovieClip Frame 14
stop();
Symbol 375 MovieClip Frame 15
stop();
Symbol 375 MovieClip Frame 16
stop();
Symbol 375 MovieClip Frame 17
stop();
Symbol 377 MovieClip Frame 1
stop();
Symbol 377 MovieClip Frame 2
stop();
Symbol 377 MovieClip Frame 3
stop();
Symbol 377 MovieClip Frame 4
stop();
Symbol 377 MovieClip Frame 5
stop();
Symbol 377 MovieClip Frame 6
stop();
Symbol 377 MovieClip Frame 7
stop();
Symbol 377 MovieClip Frame 8
stop();
Symbol 377 MovieClip Frame 9
stop();
Symbol 377 MovieClip Frame 10
stop();
Symbol 377 MovieClip Frame 11
stop();
Symbol 377 MovieClip Frame 12
stop();
Symbol 377 MovieClip Frame 13
stop();
Symbol 377 MovieClip Frame 14
stop();
Symbol 377 MovieClip Frame 15
stop();
Symbol 377 MovieClip Frame 16
stop();
Symbol 377 MovieClip Frame 17
stop();
Symbol 378 MovieClip Frame 1
function BallDistance() {
return(Math.distance(this.x, this.y, this._parent.ball.x, this._parent.ball.y));
}
function PartnerBallDistance() {
return(Math.distance(partner.x, partner.y, this._parent.ball.x, this._parent.ball.y));
}
function PartnerDistance() {
return(Math.distance(this.x, this.y, partner.x, partner.y));
}
function KeeperBallDistance() {
return(Math.distance(this.keeper.x, this.keeper.y, this._parent.ball.x, this._parent.ball.y));
}
function CloselyToBall() {
var dist = Math.distance(this.x, this.y, this._parent.ball.x, this._parent.ball.y);
if (dist < _parent.CLOSEDIST) {
return(true);
}
return(false);
}
function CloselyToKickPoint() {
var kx = _parent.ball.getKickX(_parent.gates[engates]);
var ky = _parent.ball.getKickY(_parent.gates[engates]);
var point;
((this.keeper == "enemy3") ? ((point = "_parent.ball.red")) : ((point = "_parent.ball.yel")));
point.x = kx - _parent.ball.x;
point.y = ky - _parent.ball.y;
var dist = Math.distance(this.x, this.y, kx, ky);
if (dist < (_parent.CLOSEDIST / 2)) {
return(true);
}
return(false);
}
function EnemyMinDistance() {
var dist1 = Math.distance(this.x, this.y, this.en1.x, this.en1.y);
var dist2 = Math.distance(this.x, this.y, this.en2.x, this.en2.y);
if (dist1 < dist2) {
return(dist1);
}
return(dist2);
}
function BallToEnemyGatesDistance() {
return(Math.distance(this._parent.ball.x, this._parent.ball.y, this._parent.gates[engates], this._parent.gates[engates + 1]));
}
function PenaltyArea(keeperX) {
if (keeperX >= 0) {
var result = _parent.ball.inArea((_parent.WIDTH / 2) - _parent.PENALTY, (-_parent.PENALTYH) / 2, _parent.WIDTH / 2, _parent.PENALTYH / 2);
} else {
result = _parent.ball.inArea((-_parent.WIDTH) / 2, (-_parent.PENALTYH) / 2, ((-_parent.WIDTH) / 2) + _parent.PENALTY, _parent.PENALTYH / 2);
}
return(result);
}
function MakeFBallerStrategy() {
var ballDist1 = BallDistance();
var ballDist2 = partner.BallDistance();
if (ballDist1 < ballDist2) {
if (!CloselyToKickPoint()) {
strategy = 1;
run = true;
} else {
strategy = 2;
run = true;
}
} else if (keeper.BallDistance() < en1.keeper.BallDistance()) {
var posX;
((_parent.gates[gates] < 0) ? ((posX = _parent.gates[gates] + GATEDIST)) : ((posX = _parent.gates[gates] - GATEDIST)));
if (_parent.CLOSEDIST < Math.distance(x, y, posX, _parent.gates[gates + 1])) {
strategy = 3;
run = true;
} else {
strategy = 1;
run = false;
}
} else {
((_parent.gates[engates] < 0) ? ((posX = _parent.gates[engates] + GATEDIST)) : ((posX = _parent.gates[engates] - GATEDIST)));
if (_parent.CLOSEDIST < Math.distance(x, y, posX, _parent.gates[en1.gates + 1])) {
strategy = 4;
run = true;
} else {
strategy = 1;
run = false;
}
}
}
function MakeKeeperStrategy() {
if (PenaltyArea(this.x) == true) {
if (!CloselyToKickPoint()) {
strategy = 1;
run = true;
} else {
strategy = 2;
run = true;
}
} else {
var gateDistance = Math.distance(x, y, Math.sign(x) * _parent.friends[4], _parent.friends[5]);
if (_parent.CLOSEDIST < gateDistance) {
strategy = 5;
run = true;
} else {
strategy = 1;
run = false;
}
}
}
function MakeStrategy() {
if ((this._name == "enemy3") || (this._name == "friend3")) {
MakeKeeperStrategy();
} else {
MakeFBallerStrategy();
}
}
function SelectDirection() {
if (control == true) {
return(0);
}
if (strategy == 1) {
var angle = this.calcAngle(_parent.ball.getKickX(_parent.gates[engates]), _parent.ball.getKickY(_parent.gates[engates]));
dir = (angle - (angle % _parent.ASTEP)) / _parent.ASTEP;
} else if (strategy == 2) {
angle = calcAngle(_parent.gates[engates], (_parent.gates[engates + 1] + random(_parent.GATE)) - (_parent.GATE / 2));
dir = (angle - (angle % _parent.ASTEP)) / _parent.ASTEP;
} else if (strategy == 3) {
var posX;
((_parent.gates[gates] < 0) ? ((posX = _parent.gates[gates] + GATEDIST)) : ((posX = _parent.gates[gates] - GATEDIST)));
angle = calcAngle(posX, _parent.gates[gates + 1]);
dir = (angle - (angle % _parent.ASTEP)) / _parent.ASTEP;
} else if (strategy == 4) {
((_parent.gates[engates] < 0) ? ((posX = _parent.gates[engates] + GATEDIST)) : ((posX = _parent.gates[engates] - GATEDIST)));
angle = calcAngle(posX, _parent.gates[engates + 1]);
dir = (angle - (angle % _parent.ASTEP)) / _parent.ASTEP;
} else if (strategy == 5) {
angle = calcAngle(Math.sign(x) * _parent.friends[4], _parent.friends[5]);
dir = (angle - (angle % _parent.ASTEP)) / _parent.ASTEP;
}
}
function SetSteps() {
if ((2 < dir) && (dir < 6)) {
dx = -step;
} else if ((dir == 2) || (dir == 6)) {
dx = 0;
} else {
dx = step;
}
if ((0 < dir) && (dir < 4)) {
dy = -step;
} else if ((dir == 4) || (dir == 0)) {
dy = 0;
} else {
dy = step;
}
}
function Update() {
if (_parent.enabled == false) {
return(undefined);
}
if (control == false) {
SelectDirection();
}
SetSteps();
if (run == true) {
body.gotoAndStop("run" + dir);
RestoreColors();
} else {
body.gotoAndStop("stay" + dir);
RestoreColors();
}
if (run) {
x = x + dx;
y = y - dy;
(((_parent.WIDTH / 2) < x) ? ((x = x - dx)) : ((x = x)));
((x < ((-_parent.WIDTH) / 2)) ? ((x = x - dx)) : ((x = x)));
(((_parent.HEIGHT / 2) < y) ? ((y = y + dy)) : ((y = y)));
((y < ((-_parent.HEIGHT) / 2)) ? ((y = y + dy)) : ((y = y)));
}
if (CloselyToBall() && ((strategy == 2) || (control == true))) {
_parent.ball.Kick(dir, strength);
}
SetScreenPos();
}
function SetColors(index) {
var colorstr = new String(_root.torsColors[index]);
rb = Number(colorstr.substring(0, colorstr.indexOf(",")));
colorstr = colorstr.substring(colorstr.indexOf(",") + 1);
gb = Number(colorstr.substring(0, colorstr.indexOf(",")));
colorstr = colorstr.substring(colorstr.indexOf(",") + 1);
bb = Number(colorstr);
torsColorTransform.ra = 100;
torsColorTransform.ga = 100;
torsColorTransform.ba = 100;
torsColorTransform.rb = rb;
torsColorTransform.gb = gb;
torsColorTransform.bb = bb;
torsColorTransform.aa = 100;
torsColorTransform.ab = 0;
torsColor.setTransform(torsColorTransform);
handsColor.setTransform(torsColorTransform);
colorstr = String(_root.legColors[index]);
rb = Number(colorstr.substring(0, colorstr.indexOf(",")));
colorstr = colorstr.substring(colorstr.indexOf(",") + 1);
gb = Number(colorstr.substring(0, colorstr.indexOf(",")));
colorstr = colorstr.substring(colorstr.indexOf(",") + 1);
bb = Number(colorstr);
handsColorTransform.ra = 100;
handsColorTransform.ga = 100;
handsColorTransform.ba = 100;
handsColorTransform.rb = rb;
handsColorTransform.gb = gb;
handsColorTransform.bb = bb;
handsColorTransform.aa = 100;
handsColorTransform.ab = 0;
legsColor.setTransform(handsColorTransform);
}
function RestoreColors() {
torsColor.setTransform(torsColorTransform);
handsColor.setTransform(torsColorTransform);
legsColor.setTransform(handsColorTransform);
}
GATEDIST = _parent.WIDTH / 4;
torsColor = new Color(this.body.body.tors);
handsColor = new Color(this.body.body.hands);
legsColor = new Color(this.body.body.legs);
torsColorTransform = new Object();
handsColorTransform = new Object();
stop();
Symbol 378 MovieClip Frame 2
Update();
stop();
Symbol 378 MovieClip Frame 3
Update();
stop();
Symbol 382 MovieClip Frame 1
stop();
Symbol 382 MovieClip Frame 35
gotoAndStop (1);
Symbol 383 MovieClip Frame 2
scrollLeft = 0;
scrollRight = 0;
fballer1.body.gotoAndStop("stay7");
fballer1.SetColors(_root.teamLeft);
fballer2.body.gotoAndStop("stay5");
fballer2.SetColors(_root.teamRight);
stop();
Symbol 384 MovieClip Frame 1
stop();
Symbol 384 MovieClip Frame 6
stop();
Symbol 385 MovieClip Frame 1
teamRight = _root.teams[_root.teamRight];
teamLeft = _root.teams[_root.teamLeft];
btns.dif = _root.diftext[_root.difficulty];
stop();
Symbol 385 MovieClip Frame 2
stop();
Symbol 386 MovieClip Frame 45
stop();
Symbol 386 MovieClip Frame 46
stop();
Symbol 386 MovieClip Frame 76
this._parent.gotoAndStop("game");
Symbol 389 MovieClip Frame 1
stop();
Symbol 389 MovieClip Frame 2
stop();
Symbol 392 MovieClip Frame 1
stop();
Symbol 392 MovieClip Frame 105
gotoAndStop (1);
Symbol 393 Button
on (release) {
credits.gotoAndPlay("go");
}
Symbol 396 Button
on (release) {
getURL (_root.copyrightURL, "blank");
}
Symbol 398 Button
on (release) {
getURL (_root.copyrightURL, "_blank");
}
Symbol 402 Button
on (release) {
getURL (_root.borderbannerURL, "_blank");
}
Symbol 403 MovieClip Frame 1
mainStopTime = _parent.stoppedTime;
pauseTime = 1000 * _parent.pauseTime;
_parent.stop();
if (Number(getTimer()) >= (pauseTime + mainStopTime)) {
_parent.play();
}
Symbol 404 MovieClip Frame 1
stoppedTime = getTimer();
pauseTime = 15;
Symbol 404 MovieClip Frame 15
stoppedTime = getTimer();
pauseTime = 15;
stop();
Symbol 404 MovieClip Frame 30
gotoAndStop (1);
Symbol 411 MovieClip Frame 1
function inGates() {
if ((x >= (((-_parent.WIDTH) / 2) + 5)) && (((_parent.WIDTH / 2) - 5) >= x)) {
return(false);
}
if ((((-_parent.GATE) / 2) >= y) || (y >= (_parent.GATE / 2))) {
return(false);
}
return(true);
}
function Kick(dir, strength) {
_parent.sound.gotoAndPlay("kick");
if ((2 < dir) && (dir < 6)) {
dx = (-_parent.BALLSPEED) * strength;
} else if ((dir == 2) || (dir == 6)) {
dx = 0;
} else {
dx = _parent.STEP * strength;
}
if ((0 < dir) && (dir < 4)) {
dy = (-_parent.STEP) * strength;
} else if ((dir == 4) || (dir == 0)) {
dy = 0;
} else {
dy = _parent.STEP * strength;
}
frame = 1;
}
function Update() {
if (_parent.paused == true) {
return(undefined);
}
x = x + dx;
y = y - dy;
if ((inGates() == true) && (goalStarted == false)) {
_parent.enabled = false;
_parent.StopFootballers();
_parent.panel.gotoAndPlay("goal");
goalStarted = true;
x = x - dx;
y = y + dy;
}
frame++;
if ((frame % 20) == 0) {
frame = 1;
if (dx != 0) {
dx = dx - (Math.abs(dx) / dx);
}
if (dy != 0) {
dy = dy - (Math.abs(dy) / dy);
}
}
if ((_parent.WIDTH / 2) < x) {
dx = -dx;
x = (_parent.WIDTH / 2) - 5;
}
if (x < ((-_parent.WIDTH) / 2)) {
dx = -dx;
x = ((-_parent.WIDTH) / 2) + 5;
}
if ((_parent.HEIGHT / 2) < y) {
dy = -dy;
y = (_parent.HEIGHT / 2) - 5;
}
if (y < ((-_parent.HEIGHT) / 2)) {
dy = -dy;
y = ((-_parent.HEIGHT) / 2) + 5;
}
SetScreenPos();
}
function getKickX(gatesX) {
var angle = calcAngle(gatesX, 0);
var dir = ((angle - (angle % _parent.ASTEP)) / _parent.ASTEP);
if ((2 < dir) && (dir < 6)) {
return(x + _parent.STEP);
}
if ((dir == 2) || (dir == 6)) {
return(x);
}
return(x - _parent.STEP);
}
function getKickY(gatesX) {
var angle = calcAngle(gatesX, 0);
var dir = ((angle - (angle % _parent.ASTEP)) / _parent.ASTEP);
if ((0 < dir) && (dir < 4)) {
return(y + _parent.STEP);
}
if ((dir == 4) || (dir == 0)) {
return(y);
}
return(y - _parent.STEP);
}
Symbol 411 MovieClip Frame 16
gotoAndStop (1);
Symbol 412 MovieClip Frame 1
function BallDistance() {
return(Math.distance(this.x, this.y, this._parent.ball.x, this._parent.ball.y));
}
function PartnerBallDistance() {
return(Math.distance(partner.x, partner.y, this._parent.ball.x, this._parent.ball.y));
}
function PartnerDistance() {
return(Math.distance(this.x, this.y, partner.x, partner.y));
}
function KeeperBallDistance() {
return(Math.distance(this.keeper.x, this.keeper.y, this._parent.ball.x, this._parent.ball.y));
}
function CloselyToBall() {
var dist = Math.distance(this.x, this.y, this._parent.ball.x, this._parent.ball.y);
if (dist < _parent.CLOSEDIST) {
return(true);
}
return(false);
}
function CloselyToKickPoint() {
var kx = _parent.ball.getKickX(_parent.gates[engates]);
var ky = _parent.ball.getKickY(_parent.gates[engates]);
var point;
((this.keeper == "enemy3") ? ((point = "_parent.ball.red")) : ((point = "_parent.ball.yel")));
point.x = kx - _parent.ball.x;
point.y = ky - _parent.ball.y;
var dist = Math.distance(this.x, this.y, kx, ky);
if (dist < (_parent.CLOSEDIST / 2)) {
return(true);
}
return(false);
}
function EnemyMinDistance() {
var dist1 = Math.distance(this.x, this.y, this.en1.x, this.en1.y);
var dist2 = Math.distance(this.x, this.y, this.en2.x, this.en2.y);
if (dist1 < dist2) {
return(dist1);
}
return(dist2);
}
function BallToEnemyGatesDistance() {
return(Math.distance(this._parent.ball.x, this._parent.ball.y, this._parent.gates[engates], this._parent.gates[engates + 1]));
}
function PenaltyArea(keeperX) {
if (keeperX >= 0) {
var result = _parent.ball.inArea((_parent.WIDTH / 2) - _parent.PENALTY, (-_parent.PENALTYH) / 2, _parent.WIDTH / 2, _parent.PENALTYH / 2);
} else {
result = _parent.ball.inArea((-_parent.WIDTH) / 2, (-_parent.PENALTYH) / 2, ((-_parent.WIDTH) / 2) + _parent.PENALTY, _parent.PENALTYH / 2);
}
return(result);
}
function MakeFBallerStrategy() {
var ballDist1 = BallDistance();
var ballDist2 = partner.BallDistance();
if (ballDist1 < ballDist2) {
if (!CloselyToKickPoint()) {
strategy = 1;
run = true;
} else {
strategy = 2;
run = true;
}
} else if (keeper.BallDistance() < en1.keeper.BallDistance()) {
var posX;
((_parent.gates[gates] < 0) ? ((posX = _parent.gates[gates] + GATEDIST)) : ((posX = _parent.gates[gates] - GATEDIST)));
if (_parent.CLOSEDIST < Math.distance(x, y, posX, _parent.gates[gates + 1])) {
strategy = 3;
run = true;
} else {
strategy = 1;
run = false;
}
} else {
((_parent.gates[engates] < 0) ? ((posX = _parent.gates[engates] + GATEDIST)) : ((posX = _parent.gates[engates] - GATEDIST)));
if (_parent.CLOSEDIST < Math.distance(x, y, posX, _parent.gates[en1.gates + 1])) {
strategy = 4;
run = true;
} else {
strategy = 1;
run = false;
}
}
}
function MakeKeeperStrategy() {
if (PenaltyArea(this.x) == true) {
if (!CloselyToKickPoint()) {
strategy = 1;
run = true;
} else {
strategy = 2;
run = true;
}
} else {
var gateDistance = Math.distance(x, y, Math.sign(x) * _parent.friends[4], _parent.friends[5]);
if (_parent.CLOSEDIST < gateDistance) {
strategy = 5;
run = true;
} else {
strategy = 1;
run = false;
}
}
}
function MakeStrategy() {
if ((this._name == "enemy3") || (this._name == "friend3")) {
MakeKeeperStrategy();
} else {
MakeFBallerStrategy();
}
}
function SelectDirection() {
if (control == true) {
return(0);
}
if (strategy == 1) {
var angle = this.calcAngle(_parent.ball.getKickX(_parent.gates[engates]), _parent.ball.getKickY(_parent.gates[engates]));
dir = (angle - (angle % _parent.ASTEP)) / _parent.ASTEP;
} else if (strategy == 2) {
angle = calcAngle(_parent.gates[engates], (_parent.gates[engates + 1] + random(_parent.GATE)) - (_parent.GATE / 2));
dir = (angle - (angle % _parent.ASTEP)) / _parent.ASTEP;
} else if (strategy == 3) {
var posX;
((_parent.gates[gates] < 0) ? ((posX = _parent.gates[gates] + GATEDIST)) : ((posX = _parent.gates[gates] - GATEDIST)));
angle = calcAngle(posX, _parent.gates[gates + 1]);
dir = (angle - (angle % _parent.ASTEP)) / _parent.ASTEP;
} else if (strategy == 4) {
((_parent.gates[engates] < 0) ? ((posX = _parent.gates[engates] + GATEDIST)) : ((posX = _parent.gates[engates] - GATEDIST)));
angle = calcAngle(posX, _parent.gates[engates + 1]);
dir = (angle - (angle % _parent.ASTEP)) / _parent.ASTEP;
} else if (strategy == 5) {
angle = calcAngle(Math.sign(x) * _parent.friends[4], _parent.friends[5]);
dir = (angle - (angle % _parent.ASTEP)) / _parent.ASTEP;
}
}
function SetSteps() {
if ((2 < dir) && (dir < 6)) {
dx = -step;
} else if ((dir == 2) || (dir == 6)) {
dx = 0;
} else {
dx = step;
}
if ((0 < dir) && (dir < 4)) {
dy = -step;
} else if ((dir == 4) || (dir == 0)) {
dy = 0;
} else {
dy = step;
}
}
function Update() {
if (_parent.enabled == false) {
return(undefined);
}
if (control == false) {
SelectDirection();
}
SetSteps();
if (run == true) {
body.gotoAndStop("run" + dir);
RestoreColors();
} else {
body.gotoAndStop("stay" + dir);
RestoreColors();
}
if (run) {
x = x + dx;
y = y - dy;
(((_parent.WIDTH / 2) < x) ? ((x = x - dx)) : ((x = x)));
((x < ((-_parent.WIDTH) / 2)) ? ((x = x - dx)) : ((x = x)));
(((_parent.HEIGHT / 2) < y) ? ((y = y + dy)) : ((y = y)));
((y < ((-_parent.HEIGHT) / 2)) ? ((y = y + dy)) : ((y = y)));
}
if (CloselyToBall() && ((strategy == 2) || (control == true))) {
_parent.ball.Kick(dir, strength);
}
SetScreenPos();
}
function SetColors(index) {
var colorstr = new String(_root.torsColors[index]);
rb = Number(colorstr.substring(0, colorstr.indexOf(",")));
colorstr = colorstr.substring(colorstr.indexOf(",") + 1);
gb = Number(colorstr.substring(0, colorstr.indexOf(",")));
colorstr = colorstr.substring(colorstr.indexOf(",") + 1);
bb = Number(colorstr);
torsColorTransform.ra = 100;
torsColorTransform.ga = 100;
torsColorTransform.ba = 100;
torsColorTransform.rb = rb;
torsColorTransform.gb = gb;
torsColorTransform.bb = bb;
torsColorTransform.aa = 100;
torsColorTransform.ab = 0;
torsColor.setTransform(torsColorTransform);
handsColor.setTransform(torsColorTransform);
colorstr = String(_root.legColors[index]);
rb = Number(colorstr.substring(0, colorstr.indexOf(",")));
colorstr = colorstr.substring(colorstr.indexOf(",") + 1);
gb = Number(colorstr.substring(0, colorstr.indexOf(",")));
colorstr = colorstr.substring(colorstr.indexOf(",") + 1);
bb = Number(colorstr);
handsColorTransform.ra = 100;
handsColorTransform.ga = 100;
handsColorTransform.ba = 100;
handsColorTransform.rb = rb;
handsColorTransform.gb = gb;
handsColorTransform.bb = bb;
handsColorTransform.aa = 100;
handsColorTransform.ab = 0;
legsColor.setTransform(handsColorTransform);
}
function RestoreColors() {
torsColor.setTransform(torsColorTransform);
handsColor.setTransform(torsColorTransform);
legsColor.setTransform(handsColorTransform);
}
GATEDIST = _parent.WIDTH / 4;
torsColor = new Color(this.body.body.tors);
handsColor = new Color(this.body.body.hands);
legsColor = new Color(this.body.body.legs);
torsColorTransform = new Object();
handsColorTransform = new Object();
stop();
Symbol 412 MovieClip Frame 2
Update();
stop();
Symbol 412 MovieClip Frame 3
Update();
stop();
Symbol 413 MovieClip Frame 1
function CheckKeys() {
var footballer = eval ("_parent.friend" + _parent.selected);
if (Key.isDown(37)) {
footballer.dir = (footballer.dir + 1) % 8;
}
if (Key.isDown(39)) {
footballer.dir = footballer.dir - 1;
((footballer.dir < 0) ? ((footballer.dir = 7)) : ((footballer.dir = footballer.dir)));
}
if ((Key.isDown(40) || (Key.isDown(90))) && (downJustPressed == false)) {
footballer.dir = (footballer.dir + 4) % 8;
downJustPressed = true;
}
if (Key.isDown(88)) {
footballer.step = _parent.USERSTEP;
} else {
footballer.step = _parent.STEP;
}
if (Key.isDown(80) && (300 < (getTimer() - lastTimePaused))) {
lastTimePaused = getTimer();
if (_parent.paused == true) {
_parent.panel.gotoAndPlay("closepause");
} else if ((_parent.panel.stopped == true) && (_parent.enabled == true)) {
_parent.enabled = false;
_parent.paused = true;
_parent.StopFootballers();
_parent.table.StopTimer();
_parent.panel.gotoAndStop("pause");
}
}
if (Key.isDown(38)) {
footballer.run = true;
downJustPressed = false;
} else {
footballer.run = false;
}
if (_parent.enabled == false) {
return(undefined);
}
if (Key.isDown(67) && (300 < (getTimer() - lastTimeSwitched))) {
lastTimeSwitched = getTimer();
if (_parent.friend1.control == true) {
_parent.friend1.control = false;
_parent.friend1.gotoAndStop("normal1");
_parent.friend1.SetColors(_root.teamRight);
_parent.friend1.step = _parent.STEP;
_parent.friend2.control = true;
_parent.friend2.gotoAndStop("selected");
_parent.friend2.SetColors(_root.teamRight);
_parent.selected = 2;
} else {
_parent.friend2.control = false;
_parent.friend2.gotoAndStop("normal1");
_parent.friend2.SetColors(_root.teamRight);
_parent.friend2.step = _parent.STEP;
_parent.friend1.control = true;
_parent.friend1.gotoAndStop("selected");
_parent.friend1.SetColors(_root.teamRight);
_parent.selected = 1;
}
}
}
downJustPressed = false;
lastTimePaused = getTimer();
lastTimeSwitched = getTimer();
Symbol 413 MovieClip Frame 2
CheckKeys();
Symbol 413 MovieClip Frame 4
gotoAndPlay (2);
Symbol 419 MovieClip Frame 1
stop();
kickTime = getTimer();
Symbol 419 MovieClip Frame 2
stop();
Symbol 419 MovieClip Frame 3
stop();
Symbol 419 MovieClip Frame 4
stop();
Symbol 419 MovieClip Frame 5
var curTime = getTimer();
if ((curTimer - kickTime) < 500) {
stop();
}
Symbol 419 MovieClip Frame 7
stop();
Symbol 419 MovieClip Frame 9
stop();
Symbol 423 Button
on (release) {
_parent.gotoAndStop("title");
}
Symbol 434 MovieClip Frame 1
stopped = true;
stop();
Symbol 434 MovieClip Frame 5
stop();
Symbol 434 MovieClip Frame 24
_parent.enabled = true;
_parent.paused = false;
_parent.switchable = true;
_parent.table.StartTimer();
gotoAndStop (1);
Symbol 434 MovieClip Frame 25
stopped = false;
Symbol 434 MovieClip Frame 35
stoppedTime = getTimer();
pauseTime = 3;
stop();
Symbol 434 MovieClip Frame 36
gotoAndStop (1);
Symbol 434 MovieClip Frame 40
stopped = false;
Symbol 434 MovieClip Frame 50
stoppedTime = getTimer();
pauseTime = 3;
stop();
Symbol 434 MovieClip Frame 51
gotoAndStop (1);
Symbol 434 MovieClip Frame 55
stopped = false;
_parent.table.StopTimer();
_parent.enabled = false;
_parent.table.periodNumber = 0;
Symbol 434 MovieClip Frame 87
((_parent.ball.x < 0) ? (_parent.table.AddYellow()) : (_parent.table.AddRed()));
_parent.gotoAndStop("start");
gotoAndStop (1);
Symbol 448 MovieClip Frame 1
function StartTimer() {
timerEnabled = true;
}
function StopTimer() {
timerEnabled = false;
}
function ResetTable() {
this.periodNumber = 1;
red = 0;
yellow = 0;
min = 0;
period = 1;
teamLeft = _root.teams[_root.teamLeft];
teamRight = _root.teams[_root.teamRight];
startTime = getTimer();
lastTick = getTimer();
}
function AddRed() {
red++;
}
function AddYellow() {
yellow++;
}
function NextPeriod() {
if (period == 1) {
period++;
this.periodNumber = 2;
min = 0;
lastTick = getTimer();
_parent.sound.gotoAndStop("whistle");
_parent.gotoAndStop("start");
} else {
_parent.sound.gotoAndStop("siren");
_parent.gotoAndPlay("endgame");
_parent.StopFootballers();
}
}
function UpdateTimer(curTime) {
if ((timerEnabled == false) || (_parent.paused == true)) {
lastTick = curTime;
return(undefined);
}
if (_parent.MINUTE < (curTime - lastTick)) {
lastTick = curTime;
((min < 45) ? (min++) : (NextPeriod()));
}
}
ResetTable();
Symbol 448 MovieClip Frame 3
UpdateTimer(getTimer());
gotoAndPlay (2);
Symbol 449 MovieClip Frame 1
function ResetObjects() {
ball.x = 0;
ball.y = 0;
ball.dx = 0;
ball.dy = 0;
ball.goalStarted = false;
ball.SetScreenPos();
ball.gotoAndPlay("place");
i = 1;
while (3 >= i) {
var obj = eval ("friend" + i);
obj.strategy = -1;
obj.hasBall = false;
obj.x = friends[(i - 1) * 2];
obj.y = friends[((i - 1) * 2) + 1];
obj.SetScreenPos();
obj.dir = 4;
obj.hasBall = false;
obj.strength = 1;
obj.run = false;
((i == 3) ? ((obj.step = KEEPER)) : ((obj.step = STEP)));
obj.body.gotoAndStop("stay4");
obj.RestoreColors();
obj = eval ("enemy" + i);
obj.strategy = -1;
obj.hasBall = false;
obj.x = enemies[(i - 1) * 2];
obj.y = enemies[((i - 1) * 2) + 1];
obj.SetScreenPos();
obj.dir = 0;
obj.hasBall = false;
obj.strength = 1;
obj.run = false;
((i == 3) ? ((obj.step = KEEPER)) : ((obj.step = STEP)));
obj.body.gotoAndStop("stay0");
obj.RestoreColors();
i++;
}
enabled = true;
}
function StopFootballers() {
i = 1;
while (3 >= i) {
var obj = eval ("friend" + i);
obj.body.gotoAndStop("stay" + obj.dir);
obj.RestoreColors();
var obj = eval ("enemy" + i);
obj.body.gotoAndStop("stay" + obj.dir);
obj.RestoreColors();
i++;
}
}
function OneTimeInit() {
DIFFICULTY = _root.difficulty;
ResetObjects();
if (DIFFICULTY == 0) {
STEP = 2;
USERSTEP = 4;
KEEPER = 3;
} else if (DIFFICULTY == 1) {
STEP = 3;
USERSTEP = 5;
KEEPER = 3;
} else if (DIFFICULTY == 2) {
STEP = 3;
USERSTEP = 3;
KEEPER = 4;
}
enabled = true;
paused = false;
table.ResetTable;
table.StopTimer;
i = 1;
while (3 >= i) {
var obj = eval ("friend" + i);
obj.en1 = enemy1;
obj.en2 = enemy2;
obj.gates = 0;
obj.engates = 2;
obj.keeper = friend3;
obj.control = false;
if (i == 1) {
obj.partner = friend2;
obj.control = true;
obj.gotoAndStop("selected");
obj.RestoreColors();
}
if (i == 2) {
obj.partner = friend1;
}
if (i == 3) {
obj.isKeeper = true;
}
obj.SetColors(_root.teamRight);
obj = eval ("enemy" + i);
obj.en1 = friend1;
obj.en2 = friend2;
obj.gates = 2;
obj.engates = 0;
obj.keeper = enemy3;
obj.control = false;
if (i == 1) {
obj.partner = enemy2;
}
if (i == 2) {
obj.partner = enemy1;
}
if (i == 3) {
obj.isKeeper = true;
}
obj.SetColors(_root.teamLeft);
trace(obj._name);
i++;
}
_root.red = 0;
_root.yellow = 0;
}
function UpdateScene() {
i = 1;
while (3 >= i) {
var obj = eval ("friend" + i);
obj.Update();
obj = eval ("enemy" + i);
obj.Update();
ball.Update();
i++;
}
}
function MakeStrategy() {
i = 1;
while (3 >= i) {
var obj = eval ("friend" + i);
if (obj.control == false) {
obj.MakeStrategy();
}
obj = eval ("enemy" + i);
obj.MakeStrategy();
i++;
}
}
WIDTH = 530;
HEIGHT = 300;
MAXHIT = 400;
CLOSEDIST = 20;
DX = 1;
DY = 1;
ASTEP = 45;
GATE = 150;
PENALTY = 100;
PENALTYH = 240;
BALLSPEED = 3;
MINUTE = 3000;
friends = new Array(50, 50, 70, -40, (WIDTH / 2) - 20, 0);
enemies = new Array(-50, -50, -70, 40, ((-WIDTH) / 2) + 20, 0);
gates = new Array(WIDTH / 2, 0, (-WIDTH) / 2, 0);
selected = 1;
MovieClip.prototype.SetScreenPos = function () {
this._x = this.x;
this._y = -this.y;
};
Math.distance = function (x1, y1, x2, y2) {
var deltaX = (x2 - x1);
var deltaY = (y2 - y1);
return(Math.sqrt((deltaX * deltaX) + (deltaY * deltaY)));
};
Math.sign = function (n) {
var result;
((n >= 0) ? ((result = 1)) : ((result = -1)));
return(result);
};
Movieclip.prototype.inArea = function (x1, y1, x2, y2) {
if ((this.x < x1) || (x2 < this.x)) {
return(false);
}
if ((this.y < y1) || (y2 < this.y)) {
return(false);
}
return(true);
};
Movieclip.prototype.calcAngle = function (x1, y1) {
var deltax = (this.x - x1);
var deltay = (this.y - y1);
angle = Math.atan2(deltay, deltax) - (Math.pi / 2);
angle = angle / (Math.pi / 180);
angle = angle - 90;
((angle < 0) ? ((angle = angle + 360)) : ((angle = angle)));
return(angle);
};
Movieclip.prototype.distance = function (targetclip) {
var deltaX = (this.x - targetclip.x);
var deltaY = (this.y - targetclip.y);
return(Math.sqrt((deltaX * deltaX) + (deltaY * deltaY)));
};
Movieclip.prototype.goalAngle = function (isRight) {
var gateY = random(_parent.GATE - (_parent.GATE / 2));
var gateX;
((isRight == true) ? ((gateX = WIDTH / 2)) : ((gateX = (-WIDTH) / 2)));
var deltax = (this.x - gateX);
var deltay = (this.y - gateY);
angle = Math.atan2(deltay, deltax) - (Math.pi / 2);
angle = angle / (Math.pi / 180);
angle = angle - 90;
((angle < 0) ? ((angle = angle + 360)) : ((angle = angle)));
return(angle);
};
sound.gotoAndStop("derby");
Symbol 449 MovieClip Frame 2
OneTimeInit();
Symbol 449 MovieClip Frame 31
ResetObjects();
stoppedTime = getTimer();
pauseTime = 4;
if (0 < table.periodNumber) {
panel.gotoAndPlay("period" + table.periodNumber);
}
stop();
Symbol 449 MovieClip Frame 32
panel.gotoAndStop("none");
sound.gotoAndStop("whistle");
table.StartTimer();
Symbol 449 MovieClip Frame 33
MakeStrategy();
table.StartTimer();
Symbol 449 MovieClip Frame 34
UpdateScene();
Symbol 449 MovieClip Frame 35
UpdateScene();
gotoAndPlay (33);
Symbol 449 MovieClip Frame 44
stoppedTime = getTimer();
pauseTime = 3;
_root.red = table.red;
_root.yellow = table.yellow;
stop();
Symbol 449 MovieClip Frame 74
_parent.gotoAndStop("endgame");
Symbol 457 Button
on (release) {
again = true;
gotoAndPlay (32);
}
Symbol 462 Button
on (release) {
again = false;
gotoAndPlay (32);
}
Symbol 466 MovieClip Frame 1
stop();
Symbol 466 MovieClip Frame 2
stop();
Symbol 466 MovieClip Frame 3
stop();
Symbol 471 MovieClip Frame 1
if (_root.red < _root.yellow) {
text.gotoAndStop("won");
} else if (_root.yellow < _root.red) {
text.gotoAndStop("lose");
} else {
text.gotoAndStop("draw");
}
teamLeft = _root.teams[_root.teamLeft];
teamRight = _root.teams[_root.teamRight];
trace(_root.red);
trace(_root.yellow);
if (0 < _root.red) {
scoreLeft = _root.red;
} else {
scoreLeft = 0;
}
if (0 < _root.yellow) {
scoreRight = _root.yellow;
} else {
scoreRight = 0;
}
if (condition) {
}
Symbol 471 MovieClip Frame 31
stop();
Symbol 471 MovieClip Frame 62
if (again == true) {
_root.gotoAndStop("title");
} else {
getURL (_root.endgameURL, "_self");
}
stop();