Frame 1
version = "040501";
Frame 2
if (_level0.getBytesLoaded() < _level0.getBytesTotal()) {
gotoAndPlay (1);
title = ("loading " + int(_level0.getBytesTotal() / 1024)) + " kbyte...";
percent = int((_level0.getBytesLoaded() / _level0.getBytesTotal()) * 100) + " %";
}
Frame 4
_global.v2d = new Object();
_global.v2d.math = new Object();
_global.v2d.math.p2pDistance = function (x1, y1, x2, y2) {
var tx = (x2 - x1);
var ty = (y2 - y1);
return(Math.sqrt((tx * tx) + (ty * ty)));
};
_global.v2d.math.squareHit = function (x1, y1, x2, y2, s) {
return((Math.abs(x1 - x2) <= s) && (Math.abs(y1 - y2) <= s));
};
_global.v2d.math.rectHit = function (x1, y1, x2, y2, sx, sy) {
return((Math.abs(x1 - x2) <= sx) && (Math.abs(y1 - y2) <= sy));
};
_global.v2d.math.withinRect = function (x1, y1, x2, y2, x3, y3) {
return((_global.v2d.math.numBetween(x1, x3, x2) == true) && (_global.v2d.math.numBetween(y1, y3, y2) == true));
};
_global.v2d.math.r2vertSgnAngle = function (x1, y1, x2, y2) {
var rad = Math.asin((x2 - x1) / _global.v2d.math.p2pDistance(x1, y1, x2, y2));
return(((y2 <= y1) ? (rad) : (Math.PI - rad)));
};
_global.v2d.math.r2vertCwAngle = function (x1, y1, x2, y2) {
var temp = Math.asin((x2 - x1) / _global.v2d.math.p2pDistance(x1, y1, x2, y2));
if (temp < 0) {
temp = temp + (Math.PI*2);
}
return(temp);
};
_global.v2d.math.numBetween = function (a, b, c) {
if (a == c) {
return(b == a);
}
if (c > a) {
return((b > a) && (b < c));
}
return((b > c) && (b < a));
};
_global.v2d.math.unify = function (v) {
var l = Math.sqrt((v.x * v.x) + (v.y * v.y));
v.x = v.x / l;
v.y = v.y / l;
return(v);
};
CPlayer = function () {
this.ball = undefined;
};
CPlayer.prototype.move = function () {
this.ball.tx = _xmouse;
this.ball.ty = _ymouse;
var distance = Math.sqrt(Math.pow(this.ball.tx - this.ball.x, 2) + Math.pow(this.ball.ty - this.ball.y, 2));
if (distance > 40) {
var dx = (this.ball.tx - this.ball.x);
var dy = (this.ball.ty - this.ball.y);
dx = dx * (40 / distance);
dy = dy * (40 / distance);
this.ball.tx = this.ball.x + dx;
this.ball.ty = this.ball.y + dy;
}
};
CBot = function () {
this.ball = undefined;
this.a = 1.3;
this.f = 0.8;
this.vx = 0;
this.vy = 0;
this.attackZoneY1 = _root.table.y0 + (1 * (_root.table.y1 - _root.table.y0));
this.prios = new Array();
this.prios.goaly = 0;
this.prios.attack = 0;
this.prios.idea = 0;
this.prioFade = 0.96;
};
CBot.prototype.loadPreset = function (id) {
this.ideaP = _root.presets[id].ideaP;
this.ideaA = _root.presets[id].ideaA;
this.ideaS = _root.presets[id].ideaS;
this.attack = _root.presets[id].attack;
this.attackA0 = _root.presets[id].attackA0;
this.attackA1 = _root.presets[id].attackA1;
this.goalyA = _root.presets[id].goalyA;
this.goalPause = _root.presets[id].goalPause;
this.defense = _root.presets[id].defense;
};
CBot.prototype.collision = function (ball) {
if (ball.id != 2) {
return(undefined);
}
this.prios.goaly = this.prios.goaly + 1;
};
CBot.prototype.goal = function () {
if (this.ball.y > _root.table.centerY) {
if (this.ball.x > _root.table.centerX) {
this.ideaX = _root.table.centerX + 100;
} else {
this.ideaX = _root.table.centerX - 150;
}
this.ideaY = _root.table.centerY - 150;
this.prios.idea = this.goalPause;
}
};
CBot.prototype.idea = function (p) {
if (Math.random() <= p) {
this.ideaX = _root.table.centerX + ((Math.random() - 0.5) * 80);
this.ideaY = _root.table.y0 + (Math.random() * (this.attackZoneY1 - _root.table.y0));
this.prios.idea = this.prios.idea + (Math.random() * this.ideaS);
}
};
CBot.prototype.move = function () {
_root.gstep.clear();
var ball = this.ball;
var puk = _root.balls[2];
for (var i in this.prios) {
_root.debugMeters[i]._height = this.prios[i] * 10;
this.prios[i] = this.prios[i] * this.prioFade;
}
if ((puk.y < _root.table.centerY) && (puk.vy < -3)) {
this.prios.goaly = this.prios.goaly + 1;
}
if (puk.vy > 5) {
this.prios.goaly = this.prios.goaly + this.defense;
} else {
this.prios.attack = this.prios.attack + this.attack;
}
if (puk.vy > 15) {
this.prios.goaly = this.prios.goaly + 1;
}
this.idea(this.ideaP);
var strategy;
for (var i in this.prios) {
if (this.prios[strategy] < this.prios[i]) {
strategy = i;
}
}
var tx;
var ty;
switch (strategy) {
case "idea" :
tx = this.ideaX;
ty = this.ideaY;
this.a = this.ideaA;
break;
case "goaly" :
tx = _root.table.centerX + (0.3 * (puk.x - _root.table.centerX));
var goalyY = (_root.table.y0 + ball.radius);
ty = goalyY + (0.3 * (puk.y - goalyY));
this.a = this.goalyA;
break;
case "attack" :
if (puk.y > _root.table.centerY) {
var shootX;
var shootY;
shootX = puk.x - _root.table.centerX;
shootY = puk.y - _root.table.y1;
shootSum = Math.sqrt((shootX * shootX) + (shootY * shootY));
shootX = shootX * (((puk.radius + ball.radius) - 3) / shootSum);
shootY = shootY * (((puk.radius + ball.radius) - 3) / shootSum);
tx = puk.x + shootX;
ty = puk.y + shootY;
if (this.prios.goaly < 5) {
ty = ty + 15;
}
this.a = this.attackA0;
} else {
tx = puk.x;
ty = ((puk.y - puk.radius) - ball.radius) + 3;
this.a = this.attackA1;
}
}
var ax = (tx - ball.x);
var ay = (ty - ball.y);
var asum = Math.sqrt((ax * ax) + (ay * ay));
ax = ax / asum;
ay = ay / asum;
ax = ax * this.a;
ay = ay * this.a;
this.vx = (this.vx * this.f) + ax;
this.vy = (this.vy * this.f) + ay;
ball.tx = ball.x + this.vx;
ball.ty = ball.y + this.vy;
};
_root.createEmptyMovieClip("g", 100);
_root.createEmptyMovieClip("gstep", 101);
CBall = function (id, mc, radius, brain) {
this.id = id;
this.value = id;
this.mc = mc;
this.x = mc._x;
this.y = mc._y;
this.radius = radius;
if (brain) {
this.brain = brain;
this.brain.ball = this;
}
this.mc.engine = this;
this.mc.defaultWidth = this.radius * 2;
this.mc.defaultHeight = this.radius * 2;
this.reset();
};
CBall.prototype.reset = function () {
this.vx = 0;
this.vy = 0;
this.mc._x = this.x;
this.mc._y = this.y;
this.mc._xscale = 100;
this.mc._yscale = 100;
this.mc._width = this.mc.defaultWidth;
this.mc._height = this.mc.defaultHeight;
this.mc._alpha = 100;
this.mc._visible = true;
this.potted = -1;
this.spot = 0;
this.mc.style.gotoAndStop(this.value + 1);
};
CBall.prototype.move = function () {
if (this.id < 2) {
this.brain.move();
this.radius = this.radius - 4;
if (this.tx < (_root.table.x0 + this.radius)) {
this.tx = _root.table.x0 + this.radius;
}
if (this.tx > (_root.table.x1 - this.radius)) {
this.tx = _root.table.x1 - this.radius;
}
this.radius = this.radius - 2;
if (this.ty < (_root.table.y0 + this.radius)) {
this.ty = _root.table.y0 + this.radius;
}
if (this.ty > (_root.table.y1 - this.radius)) {
this.ty = _root.table.y1 - this.radius;
}
this.radius = this.radius + 6;
this.tvx = this.tx - this.x;
this.tvy = this.ty - this.y;
this.vx = this.tvx / _global.dt;
this.vy = this.tvy / _global.dt;
} else {
var vsum = Math.sqrt((this.vx * this.vx) + (this.vy * this.vy));
if (vsum > 30) {
this.vx = this.vx * (30 / vsum);
this.vy = this.vy * (30 / vsum);
}
this.tvx = this.vx * _global.dt;
this.tvy = this.vy * _global.dt;
this.tv = Math.sqrt((this.tvx * this.tvx) + (this.tvy * this.tvy));
this.tx = this.x + this.tvx;
this.ty = this.y + this.tvy;
}
this.col = {pos:1, type:0, pvx:this.vx, pvy:this.vy};
this.tv = Math.sqrt((this.tvx * this.tvx) + (this.tvy * this.tvy));
if (!((this.vx == 0) && (this.vy == 0))) {
var colPosTemp;
for (var i in _root.table.hwalls) {
if (this.id != 2) {
break;
}
var wall = _root.table.hwalls[i];
if (((Math.min(this.y, this.ty) - this.radius) <= wall.y0) && ((Math.max(this.y, this.ty) + this.radius) >= wall.y0)) {
if (((this.ty * wall.dir) <= ((wall.y0 * wall.dir) + this.radius)) && ((this.y * wall.dir) >= (((wall.y0 * wall.dir) + this.radius) - 1E-6))) {
var hitX = (this.x + ((((wall.y0 + (this.radius * wall.dir)) - this.y) / this.tvy) * this.tvx));
if ((hitX >= wall.x0) && (hitX <= wall.x1)) {
colPosTemp = 1 - ((this.ty - (wall.y0 + (this.radius * wall.dir))) / this.tvy);
if (colPosTemp < this.col.pos) {
this.col.type = 1;
this.col.pos = colPosTemp;
this.col.pvx = (this.tvx * _root.table.flex) / _global.dt;
this.col.pvy = (Math.abs(this.tvy * _root.table.flex) * wall.dir) / _global.dt;
if (this.id == 2) {
_root.snd.playSound("reflect");
}
}
}
}
this.pointCollision({x:wall.x0, y:wall.y0});
this.pointCollision({x:wall.x1, y:wall.y1});
}
}
for (var i in _root.table.vwalls) {
if (this.id != 2) {
break;
}
var wall = _root.table.vwalls[i];
if (((Math.min(this.x, this.tx) - this.radius) <= wall.x0) && ((Math.max(this.x, this.tx) + this.radius) >= wall.x0)) {
if (((this.tx * wall.dir) <= ((wall.x0 * wall.dir) + this.radius)) && ((this.x * wall.dir) >= (((wall.x0 * wall.dir) + this.radius) - 1E-6))) {
var hitY = (this.y + ((((wall.x0 + (this.radius * wall.dir)) - this.x) / this.tvx) * this.tvy));
if ((hitY >= wall.y0) && (hitY <= wall.y1)) {
colPosTemp = 1 - ((this.tx - (wall.x0 + (this.radius * wall.dir))) / this.tvx);
if (colPosTemp < this.col.pos) {
this.col.type = 1;
this.col.pos = colPosTemp;
this.col.pvy = this.tvy / _global.dt;
this.col.pvx = (Math.abs(this.tvx * _root.table.flex) * wall.dir) / _global.dt;
if (this.id == 2) {
_root.snd.playSound("reflect");
}
}
}
}
this.pointCollision({x:wall.x0, y:wall.y0});
this.pointCollision({x:wall.x1, y:wall.y1});
}
}
if (this.colTypeHistory ne "b2b2b2") {
var i = 0;
while (i < _root.ballsAmount) {
if ((i != this.id) && ((i == 2) || (this.id == 2))) {
this.sphereCollision(_root.balls[i]);
}
i++;
}
}
if (this.col.type == 1) {
this.tx = this.x + (this.tvx * this.col.pos);
this.ty = this.y + (this.tvy * this.col.pos);
}
if (this.col.type == 2) {
this.colTypeHistory = ("b" + this.col.q.id) + this.colTypeHistory.substr(0, 4);
} else {
this.colTypeHistory = ("t" + this.col.type) + this.colTypeHistory.substr(0, 4);
}
if (this.tx < (_root.table.x0 + this.radius)) {
this.tx = _root.table.x0 + this.radius;
}
if (this.tx > (_root.table.x1 - this.radius)) {
this.tx = _root.table.x1 - this.radius;
}
this.x = this.tx;
this.y = this.ty;
this.vx = this.col.pvx;
this.vy = this.col.pvy;
if (this.col.type == 2) {
this.col.q.vx = this.col.qvx;
this.col.q.vy = this.col.qvy;
}
var f = (1 - (0.09 * (1 - (Math.min(Math.abs(this.vx) + Math.abs(this.vy), 3) * 0.33))));
f = Math.pow(f * _root.table.friction, _global.dt);
this.vx = this.vx * f;
this.vy = this.vy * f;
if (this.y < _root.table.y0) {
_root.snd.playSound("goal");
_root.balls[1].brain.goal();
_root.actScore0++;
this.setPos(_root.table.centerX, _root.table.centerY);
this.reset();
} else if (this.y > _root.table.y1) {
_root.snd.playSound("goal");
_root.balls[1].brain.goal();
_root.actScore1++;
this.setPos(_root.table.centerX, _root.table.centerY);
this.reset();
}
this.redraw();
}
};
CBall.prototype.sphereCollision = function (ball) {
if (ball.potted != -1) {
return(undefined);
}
var a = (ball.x - this.x);
var b = (ball.y - this.y);
var c = (Math.pow(this.tvx, 2) + Math.pow(this.tvy, 2));
var d = (((((this.tvy * a) - (this.tvx * b)) / c) * this.tv) * -1);
var j = Math.sqrt(Math.pow(this.radius + ball.radius, 2) - (d * d));
if (!isNaN(j)) {
var p = (((this.tvx * a) + (this.tvy * b)) / c);
p = p * (1 - (j / (p * this.tv)));
if ((p < 0) && (p > -1E-6)) {
p = 0;
}
if ((p >= 0) && (p < this.col.pos)) {
var qax;
var qay;
var pvx;
var pvy;
var colvx;
var colvy;
var pv;
var qv;
this.col.pos = p;
this.col.type = 2;
this.tx = this.x + (this.tvx * p);
this.ty = this.y + (this.tvy * p);
qax = ball.x - this.tx;
qay = ball.y - this.ty;
pvx = qay * -1;
pvy = qax;
colvx = this.vx - ball.vx;
colvy = this.vy - ball.vy;
pv = ((colvx * qay) - (colvy * qax)) / ((pvx * qay) - (pvy * qax));
this.col.q = ball;
ball.brain.collision(this);
this.brain.collision(ball);
qv = (colvy - (pv * qax)) / qay;
if (qv eq "NaN") {
this.col.qvx = this.vx;
this.col.qvy = this.vy;
} else {
qax = qax * qv;
qay = qay * qv;
this.col.qvx = ball.vx + qax;
this.col.qvy = ball.vy + qay;
}
pvx = pvx * pv;
pvy = pvy * pv;
this.col.pvx = pvx;
this.col.pvy = pvy;
_root.snd.playSound("hit");
}
}
};
CBall.prototype.pointCollision = function (point) {
var a = (point.x - this.x);
var b = (point.y - this.y);
var c = (Math.pow(this.tvx, 2) + Math.pow(this.tvy, 2));
var d = (((((this.tvy * a) - (this.tvx * b)) / c) * this.tv) * -1);
var j = Math.sqrt((this.radius * this.radius) - (d * d));
if (!isNaN(j)) {
var p = (((this.tvx * a) + (this.tvy * b)) / c);
p = p * (1 - (j / (p * this.tv)));
if ((p < 0) && (p > -1E-6)) {
p = 0;
}
if ((p >= 0) && (p < this.col.pos)) {
this.col.pos = p;
this.col.type = 3;
this.tx = this.x + (this.tvx * p);
this.ty = this.y + (this.tvy * p);
var x1 = (point.x - this.x);
var y1 = (point.y - this.y);
var n1 = ((((((x1 * x1) + (y1 * y1)) / ((this.tvx * x1) + (this.tvy * y1))) * this.tvy) - y1) / x1);
var pvx = (((y1 * n1) * -1) - x1);
var pvy = ((x1 * n1) - y1);
var pv = (((this.tv * _root.table.flex) / _global.dt) / Math.sqrt((pvx * pvx) + (pvy * pvy)));
this.col.pvx = pvx * pv;
this.col.pvy = Pvy * pv;
}
}
};
CBall.prototype.redraw = function () {
this.mc._x = this.x;
this.mc._y = this.y;
};
CBall.prototype.setSpeed = function (vx, vy) {
this.vx = vx;
this.vy = vy;
};
CBall.prototype.setPos = function (x, y) {
this.x = x;
this.y = y;
this.redraw();
};
CBall.prototype.toString = function () {
return(((((((((((((((((("[CBall mc:" + this.mc) + ", x:") + this.x) + ", y:") + this.y) + ", vx:") + this.vx) + ", vy:") + this.vy) + ", tx:") + this.tx) + ", ty:") + this.ty) + ", tvx:") + this.tvx) + ", tvy:") + this.tvy) + "]");
};
ballsAmount = 3;
timePerHalf = 45;
timeExtension = 15;
names = new Array();
names[0] = "Peter";
names[1] = "Juana";
names[2] = "M.Pac";
names[3] = "Nivette";
names[4] = "Wolfram";
names[5] = "Maceba";
names[6] = "Bartoldi";
names[7] = "Lu Bang";
_root.presets = new Array();
_root.presets[0] = {ideaP:0.02, ideaA:2, ideaS:10, attack:0.9, attackA0:2, attackA1:3, goalyA:3, goalPause:50, defense:0.2};
_root.presets[1] = {ideaP:0.03, ideaA:2, ideaS:10, attack:0.5, attackA0:4, attackA1:2, goalyA:3, goalPause:40, defense:0.2};
_root.presets[2] = {ideaP:0.02, ideaA:5, ideaS:10, attack:1.1, attackA0:4, attackA1:6, goalyA:2, goalPause:30, defense:0.2};
_root.presets[3] = {ideaP:0.02, ideaA:5, ideaS:10, attack:0.7, attackA0:2, attackA1:7, goalyA:4, goalPause:30, defense:0.2};
_root.presets[4] = {ideaP:0.005, ideaA:5, ideaS:10, attack:0.8, attackA0:8, attackA1:4, goalyA:4, goalPause:10, defense:0.2};
_root.presets[5] = {ideaP:0.02, ideaA:5, ideaS:10, attack:0.7, attackA0:7, attackA1:7, goalyA:4, goalPause:30, defense:0.2};
_root.presets[6] = {ideaP:0.015, ideaA:3, ideaS:10, attack:0.5, attackA0:5, attackA1:10, goalyA:5, goalPause:20, defense:0.2};
_root.presets[7] = {ideaP:0.01, ideaA:5, ideaS:10, attack:1.2, attackA0:12, attackA1:7, goalyA:6, goalPause:20, defense:0.2};
table = new Object();
table.flex = 0.9;
table.friction = 0.978;
table.x0 = 110;
table.x1 = 450;
table.y0 = 10;
table.y1 = 440;
table.centerX = table.x0 + (0.5 * (table.x1 - table.x0));
table.centerY = table.y0 + (0.5 * (table.y1 - table.y0));
table.cornerHoleSize = 10;
table.centerHoleSize = 90;
table.height = _height - 40;
table.vwalls = new Array();
table.vwalls[0] = {y0:table.y0, y1:table.y1, x0:table.x0, x1:table.x0, dir:1};
table.vwalls[1] = {y0:table.y0, y1:table.y1, x0:table.x1, x1:table.x1, dir:-1};
table.hwalls = new Array();
table.hwalls[0] = {y0:table.y0, y1:table.y0, x0:table.x0, x1:(table.x0 + (0.5 * (table.x1 - table.x0))) - (table.centerHoleSize / 2), dir:1};
table.hwalls[1] = {y0:table.y0, y1:table.y0, x0:(table.x0 + (0.5 * (table.x1 - table.x0))) + (table.centerHoleSize / 2), x1:table.x1, dir:1};
table.hwalls[2] = {y0:table.y1, y1:table.y1, x0:table.x0, x1:(table.x0 + (0.5 * (table.x1 - table.x0))) - (table.centerHoleSize / 2), dir:-1};
table.hwalls[3] = {y0:table.y1, y1:table.y1, x0:(table.x0 + (0.5 * (table.x1 - table.x0))) + (table.centerHoleSize / 2), x1:table.x1, dir:-1};
table.holes = new Array();
ballSize = 28;
lvls = new Array();
lvls[0] = new CLevel(new XML("<lvl><b y=\"164.95\" x=\"170\" id=\"0\" /><b y=\"258.95\" x=\"490.95\" id=\"1\" /><b y=\"84\" x=\"492.95\" id=\"2\" /></lvl>"));
this.timer = createEmptyMovieClip("timer", 99);
this.timer.running = false;
timer.init = function (timeTotal) {
this.timeTotal = timeTotal * 1000;
this.timeStart = getTimer();
_root.timeLeft = this.timeTotal;
this.running = false;
};
timer.onEnterFrame = function () {
_global.dt = (((getTimer() - this.timestamp) / 33) * 0.2) + (_global.dt * 0.8);
this.timestamp = getTimer();
if (this.running) {
_root.timeLeft = _root.timeLeft - (_global.dt * 33);
}
this.update();
};
timer.update = function () {
_root.bg.time.clock.gotoAndStop(Math.max(Math.floor(_root.timeLeft / 1000) + 2, 1));
if ((_root.timeLeft <= -0.5) && (this.running)) {
this.running = false;
if (_root.onEnterFrame == stepRoll) {
_root.startLevelOver();
}
}
};
timer.timestamp = getTimer();
initGame = function () {
_root.actScore0 = 0;
_root.actScore1 = 0;
_root.totalScore = 0;
_root.actBreak = 0;
_root.actHalf = 0;
_root.timeLeft = -1;
_root.pointer.gotoAndStop("wait");
_root.timer.running = false;
initTable();
_root.actLevel = _root.actLvl + 1;
loadLevel();
_root.face0.gotoAndStop(_root.playerId0 + 1);
_root.face1.gotoAndStop(_root.actLvl + 1);
_root.startLevel();
};
initTable = function () {
this.balls = new Array();
this.balls[0] = new CBall(0, this.b0, 20, new CPlayer());
this.balls[1] = new CBall(1, this.b1, 20, new CBot());
this.balls[1].brain.loadPreset(_root.actLvl);
this.balls[2] = new CBall(2, this.b2, 10);
};
loadLevel = function () {
_root.balls[0].x = _root.table.x0 + (0.5 * (_root.table.x1 - _root.table.x0));
_root.balls[0].y = _root.table.y0 + (0.8 * (_root.table.y1 - _root.table.y0));
_root.balls[0].reset();
_root.balls[1].x = _root.table.x0 + (0.5 * (_root.table.x1 - _root.table.x0));
_root.balls[1].y = _root.table.y0 + (0.2 * (_root.table.y1 - _root.table.y0));
_root.balls[1].reset();
_root.balls[2].x = _root.table.x0 + (0.5 * (_root.table.x1 - _root.table.x0));
_root.balls[2].y = _root.table.y0 + (0.5 * (_root.table.y1 - _root.table.y0));
_root.balls[2].reset();
};
startLevel = function (phase, time) {
this.phase = int(phase);
_root.timer.init((time ? (time) : (_root.timePerHalf)));
this.onEnterFrame = this.stepLevel;
this.nominated = 1;
};
stepLevel = function () {
if (this.phaseDelay > 0) {
this.phaseDelay = this.phaseDelay - _global.dt;
return(undefined);
}
switch (this.phase) {
case 0 :
_root.osd.gotoAndPlay("startMatch");
_root.phase++;
return;
case 1 :
return;
case 2 :
_root.timer.running = true;
startRoll();
return;
default :
trace("stepLevel - unknown phase: " + this.phase);
}
};
startRoll = function () {
this.onEnterFrame = this.stepRoll;
};
stepRoll = function () {
var i = 0;
while (i < this.ballsAmount) {
this.balls[i].move();
i++;
}
};
startLevelOver = function () {
this.phase = 0;
trace("half: " + _root.actHalf);
if (_root.actHalf == 0) {
this.phase = 10;
} else if (_root.actScore0 == _root.actScore1) {
this.phase = 20;
}
this.phaseDelay = 0;
this.onEnterFrame = this.stepLevelOver;
};
stepLevelOver = function () {
if (this.phaseDelay > 0) {
this.phaseDelay = this.phaseDelay - _global.dt;
return(undefined);
}
switch (this.phase) {
case 0 :
_root.osd.gotoAndPlay("endMatch");
this.phaseDelay = 100;
this.phase++;
return;
case 1 :
_root.osd.gotoAndPlay("endMatch2");
this.phaseDelay = 20;
this.phase++;
return;
case 2 :
_root.actLvl++;
_root.actLevel++;
if (_root.actScore0 > _root.actScore1) {
if (_root.actLvl == 8) {
_root.gotoAndStop("victory");
} else {
_root.gotoAndStop("chooseCpu");
}
} else {
_root.gotoAndStop("gameOver");
}
this.onEnterFrame = undefined;
return;
case 10 :
_root.osd.gotoAndPlay("startMatch2");
this.phaseDelay = 10;
this.phase++;
case 11 :
_root.actHalf++;
_root.loadLevel();
_root.phase++;
return;
case 12 :
return;
case 13 :
_root.startLevel(2);
return;
case 20 :
_root.osd.gotoAndPlay("startMatch3");
this.phaseDelay = 10;
this.phase++;
case 21 :
_root.loadLevel();
_root.phase++;
return;
case 22 :
return;
case 23 :
_root.startLevel(2, _root.timeExtension);
return;
default :
trace("unknown phase: " + this.phase);
}
};
score = function (value) {
_root.actBreak = _root.actBreak + value;
_root.actScore = _root.actScore + (value * Math.floor(_root.timeLeft / 1000));
_root.totalScore = _root.totalScore + (value * Math.floor(_root.timeLeft / 1000));
trace("act score: " + _root.actScore);
};
stop();
_root.actLvl = 0;
Frame 5
_root.snd.playSound("goal");
Frame 6
choosePlayer = function (id) {
_root.snd.playSound("click");
_root.playerId0 = id;
_root.playerName0 = _root.names[id];
if (_root.version eq "nkcheat") {
_root.actLvl = id;
} else {
_root.actLvl = 0;
}
gotoAndStop (13);
};
hilitePlayer = function (id) {
_root.hilite.gotoAndStop(id + 2);
_root.display = _root.names[id];
};
Frame 7
play();
this.wait = 150;
_root.snd.playSound("gameover");
Frame 9
if ((this.wait--) > 0) {
gotoAndPlay (8);
} else {
gotoAndStop (4);
}
Frame 10
play();
this.wait = 150;
Frame 12
if ((this.wait--) > 0) {
gotoAndPlay (11);
} else {
gotoAndStop (4);
}
Frame 13
_root.playerName1 = _root.names[_root.actLvl];
face0.gotoAndStop(_root.playerId0 + 1);
face1.gotoAndStop(_root.actLvl + 1);
display = "Round " + (_root.actLvl + 1);
_root.snd.playSound("match");
play();
this.wait = 110;
Frame 15
if ((this.wait--) > 0) {
gotoAndPlay (14);
}
Frame 16
stop();
initGame();
Symbol 5 MovieClip [ball] Frame 1
stop();
Symbol 7 MovieClip Frame 1
stop();
Symbol 13 Button
on (release) {
getURL ("http://www.neodelight.com?ref=hockey&ref_loc=intro&ref_ver=" + _root.version, "_BLANK");
}
Symbol 21 MovieClip Frame 1
trace((_parent._currentframe + "/") + _parent._totalframes);
Symbol 21 MovieClip Frame 2
trace((_parent._currentframe + "/") + _parent._totalframes);
Symbol 27 MovieClip Frame 46
stop();
Symbol 33 MovieClip Frame 80
gotoAndPlay (22);
Symbol 34 MovieClip Frame 1
debug = false;
if (!init) {
init = true;
if (_level0.getBytesLoaded() >= _level0.getBytesTotal()) {
progress._visible = false;
}
}
if ((_level0.getBytesLoaded() < _level0.getBytesTotal()) || (debug)) {
_parent.stop();
percent = int((_level0.getBytesLoaded() / _level0.getBytesTotal()) * 100) + " %";
} else {
_parent.play();
}
Symbol 35 MovieClip Frame 1
startFrame = _parent._currentframe;
Symbol 35 MovieClip Frame 2
vol = (1 - ((_parent._currentFrame - startFrame) / (_parent._totalFrames - startFrame))) * 100;
if (vol < 0) {
vol = 0;
}
_parent.snd.setVolume(vol);
Symbol 35 MovieClip Frame 3
gotoAndPlay (2);
Symbol 36 MovieClip Frame 1
snd = new Sound(this);
snd.setVolume(100);
_parent.stop();
Symbol 36 MovieClip Frame 123
stop();
_parent.play();
Symbol 42 Button
on (release) {
_root.snd.playSound("click");
gotoAndStop (6);
}
Symbol 44 Button
on (release) {
_root.snd.playSound("click");
gotoAndStop (5);
}
Symbol 46 Button
on (release) {
_root.snd.playSound("click");
getURL ("http://www.neodelight.com?ref=hockey&ref_loc=moregames&ref_ver=" + _root.version, "_BLANK");
}
Symbol 50 Button
on (release) {
_root.snd.playSound("click");
getURL ("http://www.neodelight.com?ref=hockey&ref_loc=moregames&ref_ver=" + _root.version, "_BLANK");
}
Symbol 62 MovieClip Frame 1
stop();
Symbol 64 MovieClip Frame 1
stop();
Symbol 66 MovieClip Frame 1
stop();
Symbol 68 MovieClip Frame 1
stop();
Symbol 70 MovieClip Frame 1
stop();
Symbol 72 MovieClip Frame 1
stop();
Symbol 73 MovieClip Frame 1
stop();
Symbol 75 MovieClip Frame 1
stop();
Symbol 77 MovieClip Frame 1
stop();
Symbol 79 MovieClip Frame 1
stop();
Symbol 80 MovieClip Frame 1
this.active = 1;
playSound = function (name) {
if (this.active) {
this[name].gotoAndPlay(2);
}
};
Symbol 82 Button
on (release) {
_root.snd.playSound("click");
gotoAndStop (4);
}
Symbol 97 MovieClip Frame 1
stop();
Symbol 101 Button
on (release) {
choosePlayer(0);
}
on (rollOver) {
hilitePlayer(0);
}
Symbol 102 Button
on (release) {
choosePlayer(1);
}
on (rollOver) {
hilitePlayer(1);
}
Symbol 103 Button
on (release) {
choosePlayer(2);
}
on (rollOver) {
hilitePlayer(2);
}
Symbol 104 Button
on (release) {
choosePlayer(3);
}
on (rollOver) {
hilitePlayer(3);
}
Symbol 105 Button
on (release) {
choosePlayer(7);
}
on (rollOver) {
hilitePlayer(7);
}
Symbol 106 Button
on (release) {
choosePlayer(6);
}
on (rollOver) {
hilitePlayer(6);
}
Symbol 107 Button
on (release) {
choosePlayer(5);
}
on (rollOver) {
hilitePlayer(5);
}
Symbol 108 Button
on (release) {
choosePlayer(4);
}
on (rollOver) {
hilitePlayer(4);
}
Symbol 237 MovieClip Frame 1
_parent.gotoAndStop("default");
Symbol 237 MovieClip Frame 2
_parent.gotoAndPlay("hurry");
Symbol 237 MovieClip Frame 3
_parent.gotoAndPlay("hurry");
Symbol 237 MovieClip Frame 4
_parent.gotoAndPlay("hurry");
Symbol 237 MovieClip Frame 5
_parent.gotoAndPlay("hurry");
Symbol 237 MovieClip Frame 6
_parent.gotoAndPlay("hurry");
Symbol 237 MovieClip Frame 7
_parent.gotoAndPlay("hurry");
Symbol 237 MovieClip Frame 8
_parent.gotoAndPlay("hurry");
Symbol 237 MovieClip Frame 9
_parent.gotoAndPlay("hurry");
Symbol 237 MovieClip Frame 10
_parent.gotoAndPlay("hurry");
Symbol 237 MovieClip Frame 11
_parent.gotoAndPlay("hurry");
Symbol 237 MovieClip Frame 12
_parent.gotoAndPlay("hurry");
Symbol 238 MovieClip Frame 1
stop();
Symbol 238 MovieClip Frame 12
gotoAndStop (1);
Symbol 238 MovieClip Frame 16
gotoAndStop (1);
Symbol 239 MovieClip Frame 1
stop();
Symbol 239 MovieClip Frame 2
play();
Symbol 239 MovieClip Frame 9
_root.timer.init(_root.timePerLevel);
Symbol 239 MovieClip Frame 17
_root.phase++;
Symbol 255 MovieClip Frame 1
if (_root.actScore0 > _root.actScore1) {
name = _root.playerName0.toUpperCase();
_root.snd.playSound("won");
stop();
} else {
_root.snd.playSound("lost");
name = _root.playerName1.toUpperCase();
}
Symbol 255 MovieClip Frame 2
stop();
Symbol 256 MovieClip Frame 1
stop();
Symbol 256 MovieClip Frame 19
_root.snd.playSound("half");
Symbol 256 MovieClip Frame 104
stop();
_root.phase++;
Symbol 256 MovieClip Frame 124
_root.snd.playSound("half");
Symbol 256 MovieClip Frame 209
stop();
_root.phase++;
Symbol 256 MovieClip Frame 228
_root.snd.playSound("half");
Symbol 256 MovieClip Frame 313
stop();
_root.phase++;
Symbol 256 MovieClip Frame 315
stop();
play();
Symbol 256 MovieClip Frame 333
stop();
Symbol 256 MovieClip Frame 343
stop();
Symbol 260 Button
on (release) {
_root.snd.playSound("click");
gotoAndStop (2);
}
Symbol 266 Button
on (release) {
_root.snd.playSound("click");
prevFrame();
}
Symbol 270 Button
on (release) {
_root.snd.playSound("click");
_root.onEnterFrame = undefined;
_root.gotoAndStop("menu");
}
Symbol 271 MovieClip Frame 1
stop();
Symbol 274 Button
on (release) {
_root.snd.active = 0;
nextFrame();
}
Symbol 277 Button
on (release) {
_root.snd.active = 1;
_root.snd.playSound("click");
prevFrame();
}
Symbol 278 MovieClip Frame 1
stop();
Symbol 290 Button
on (release) {
this.init();
}
Symbol 291 MovieClip Frame 1
this.init = function () {
this.time0 = getTimer();
this.frames = 0;
};
init();
Symbol 291 MovieClip Frame 2
stop();
this.onEnterFrame = function () {
this.frames++;
this.time1 = getTimer();
this.dtime = this.time1 - this.time0;
this.display_fps = int((this.frames * 1000) / this.dtime);
};