Frame 1
offline = false;
Frame 2
if (_level0.getBytesLoaded() < _level0.getBytesTotal()) {
gotoAndPlay (1);
title = ("loading " + int(_level0.getBytesTotal() / 1024)) + " kbyte...";
percent = int((_level0.getBytesLoaded() / _level0.getBytesTotal()) * 100) + " %";
}
Frame 3
Frame 4
borderLeft = 19;
borderRight = 530;
borderUp = 20;
borderDown = 355;
borderLeftShot = 13;
borderRightShot = 535;
borderUpShot = borderUp - 5;
borderDownShot = borderDown + 4;
Frame 5
stop();
actLives = 10;
Frame 6
score = 0;
highscores.initSession();
Frame 394
stop();
jackpot = 0;
Instance of Symbol 100 MovieClip "pl1" in Frame 394
//component parameters
onClipEvent (initialize) {
playerID = 1;
}
Instance of Symbol 104 MovieClip "cannon" in Frame 394
onClipEvent (load) {
this.swapDepths(10000);
}
Instance of Symbol 100 MovieClip "pl2" in Frame 394
//component parameters
onClipEvent (initialize) {
playerID = 2;
}
Frame 395
gameOver.gotoAndPlay(1);
Instance of Symbol 131 MovieClip "gameOver" in Frame 395
onClipEvent (load) {
this.swapDepths(10005);
}
Frame 396
i = 0;
while (i < cannon.reg.length) {
removeMovieClip("shot_" + cannon.reg[i]);
i++;
}
cannon.removeMovieClip();
if (score > 0) {
gotoAndPlay ("enterscore");
} else {
gotoAndStop ("menu");
}
Frame 397
stop();
Symbol 9 MovieClip Frame 1
function getCurrentFrame() {
trace("gcf");
return(this._currentframe);
}
stop();
Symbol 14 MovieClip Frame 1
stop();
Symbol 14 MovieClip Frame 2
trace("color: " + color.getCurrentFrame());
if (_root.multiply > 1) {
points.display = (_root.multiply + "x ") + (color._currentframe * 10);
} else {
points.display = color._currentframe * 10;
}
_root.jackpot = _root.jackpot + 50;
_root.score = Number(_root.score) + ((color._currentframe * 10) * _root.multiply);
if (color._currentframe >= 80) {
i = 0;
while (i < _root.cannon.reg.length) {
tellTarget (("/shot_" + _root.cannon.reg[i]) + "/shot") {
gotoAndPlay ("hit");
};
i++;
}
_root.cannon.reg = new Array();
_root.actLives = _root.actLives + 2;
_root.smartbomb2.play();
} else if (color._currentframe >= 40) {
_root.actLives++;
_root.bonuslive.play();
} else if (color._currentframe >= 20) {
i = 0;
while (i < _root.cannon.reg.length) {
tellTarget (("/shot_" + _root.cannon.reg[i]) + "/shot") {
gotoAndPlay ("hit");
};
i++;
}
_root.smartbomb.play();
}
Symbol 14 MovieClip Frame 30
_parent.removeMovieClip();
Symbol 15 MovieClip [shot] Frame 1
_x = (_root.cannon.cannon._x + 38);
_y = 380;
vy = (Math.cos((_root.cannon.cannon._rotation / 180) * Math.PI) * _root.cannon.shotspeed) * -1;
vx = Math.sin((_root.cannon.cannon._rotation / 180) * Math.PI) * _root.cannon.shotspeed;
reflect = new Sound();
reflect.attachSound("reflect2");
Symbol 15 MovieClip [shot] Frame 2
tx = _x + vx;
ty = _y + vy;
if (tx > _root.borderRightShot) {
tx = (2 * _root.borderRightShot) - tx;
vx = vx * -1;
if (shot.color._currentframe < shot.color._totalframes) {
shot.color.nextFrame();
}
reflect.start();
} else if (tx < _root.borderLeftShot) {
tx = (2 * _root.borderLeftShot) - tx;
vx = vx * -1;
if (shot.color._currentframe < shot.color._totalframes) {
shot.color.nextFrame();
}
reflect.start();
}
if (ty < _root.borderDownShot) {
gotoAndPlay ("move");
}
_x = tx;
_y = ty;
Symbol 15 MovieClip [shot] Frame 3
gotoAndPlay ("enter");
Symbol 15 MovieClip [shot] Frame 4
tx = _x + vx;
ty = _y + vy;
if (tx > _root.borderRightShot) {
tx = (2 * _root.borderRightShot) - tx;
vx = vx * -1;
if (shot.color._currentframe < shot.color._totalframes) {
shot.color.nextFrame();
}
reflect.start();
} else if (tx < _root.borderLeftShot) {
tx = (2 * _root.borderLeftShot) - tx;
vx = vx * -1;
if (shot.color._currentframe < shot.color._totalframes) {
shot.color.nextFrame();
}
reflect.start();
}
if (ty > _root.borderDownShot) {
ty = (2 * _root.borderDownShot) - ty;
vy = vy * -1;
if (shot.color._currentframe < shot.color._totalframes) {
shot.color.nextFrame();
}
reflect.start();
} else if (ty < _root.borderUpShot) {
ty = (2 * _root.borderUpShot) - ty;
vy = vy * -1;
if (shot.color._currentframe < shot.color._totalframes) {
shot.color.nextFrame();
}
reflect.start();
}
_x = tx;
_y = ty;
Symbol 15 MovieClip [shot] Frame 5
gotoAndPlay ("move");
Symbol 20 MovieClip Frame 1
function initSession() {
session = "";
i = 0;
while (i < 20) {
pos = Math.round(Math.random() * (charTable.length - 4));
session = session + charTable.charAt(pos);
i++;
}
}
function submit(pGame, pDisciple, pScore0, pScore2) {
_global.api.highscore.submit(pGame, pDisciple, pScore0, pScore2);
return(undefined);
}
function encrypt(pString, pKey) {
var _local1 = pKey;
trace("------encrypt-------");
text = pString;
crypt = "";
checkSum = 0;
i = 0;
while (i < text.length) {
char = tableIndex(text.charCodeAt(i), charTable);
shift = tableIndex(_local1.charCodeAt(i % _local1.length), charTable);
code = (char + shift) + checkSum;
code = code % charTable.length;
trace((((("char: " + char) + " shift: ") + shift) + " code: ") + code);
crypt = crypt + charTableCrypt.charAt(code);
checkSum = checkSum + code;
i++;
}
checkSum = checkSum % charTable.length;
trace("checksum: " + checkSum);
return((crypt + "") + charTableCrypt.charAt(checkSum));
}
function shuffle(pString) {
trace("------shuffle-------");
text = pString;
crypt = "";
i = 0;
while (text.length > 0) {
code = tableIndex(text.charCodeAt(i), charTable);
text = text.substring(0, i) + text.substring(i + 1, text.length);
code = code % charTable.length;
i = (i + code) % text.length;
crypt = crypt + charTableCrypt.charAt(code);
}
return(crypt);
}
function tableIndex(pCharCode, pTable) {
var _local1 = pTable;
var _local2 = pCharCode;
j = 0;
while (j < _local1.length) {
if (_local2 == _local1.charCodeAt(j)) {
return(j);
}
j++;
}
return(undefined);
}
_name = "highscores";
_visible = false;
charTable = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz&=.";
charTableCrypt = charTable;
initSession();
stop();
Symbol 20 MovieClip Frame 2
stop();
Symbol 23 MovieClip Frame 1
#initclip 1
_global.api = new Object();
_global.api.highscore = new Object();
_global.api.highscore.initSession = function () {
var _local1 = this;
_local1.session = "";
while (_local1.session.length < 20) {
_local1.session = _local1.session + _local1.charTable.charAt(Math.round(Math.random() * (_local1.charTable.length - 4)));
}
_local1.charTableIndex = new Array();
var _local2 = 0;
while (_local2 < _local1.charTable.length) {
_local1.charTableIndex[_local1.charTable.charCodeAt(_local2)] = _local2;
_local2++;
}
};
_global.api.highscore.submit = function (pGame, pDisciple, pScore0, pScore1) {
var _local2 = this;
var _local1 = ("g=" + pGame) + "&";
_local1 = _local1 + (("d=" + pDisciple) + "&");
_local1 = _local1 + (("s0=" + pScore0) + "&");
_local1 = _local1 + (("s1=" + pScore1) + "&");
_local1 = _local1 + ("se=" + escape(session));
_local1 = _local1 + "&c=42";
var _local3 = (_local2.urlSubmit + "?s=") + escape(_local2.encrypt(_local2.encrypt(_local1, _local2.keystring), _local2.keystring2)).split("%").join("_");
trace(_local3);
getURL (_local3, "_blank");
};
_global.api.highscore.encrypt = function (text, pKey) {
var _local2 = this;
var crypt = "";
var checkSum = 0;
var shift;
var _local3;
var _local1 = 0;
while (_local1 < text.length) {
char = _local2.charTableIndex[text.charCodeAt(_local1)];
shift = _local2.charTableIndex[pKey.charCodeAt(_local1 % pKey.length)];
_local3 = (char + shift) + checkSum;
_local3 = _local3 % _local2.charTable.length;
crypt = crypt + _local2.charTable.charAt(_local3);
checkSum = checkSum + _local3;
_local1++;
}
checkSum = checkSum % _local2.charTable.length;
return((crypt + "") + _local2.charTable.charAt(checkSum));
};
_global.api.highscore.charTable = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz&=.";
_global.api.highscore.keystring = "whytheheckdoyouwasteyourtimehackingthishighscorelist";
_global.api.highscore.keystring2 = "AnotherKey4You2FindOut4815jiagIOm30JK";
_global.api.highscore.urlSubmit = "http://www.neodelight.com/v4/high_enter.php";
if (_root.branding == "bigfish") {
_global.api.highscore.urlSubmit = "http://www.bigfishgames.com/online/neodelight/submitscore.php";
}
_global.api.highscore.initSession();
#endinitclip
_visible = false;
Symbol 28 Button
on (release) {
getURL ("http://www.neodelight.com?ref=teamball&ref_loc=intro", "_BLANK");
}
Symbol 34 MovieClip Frame 1
trace((_parent._currentframe + "/") + _parent._totalframes);
Symbol 34 MovieClip Frame 2
trace((_parent._currentframe + "/") + _parent._totalframes);
Symbol 40 MovieClip Frame 1
startFrame = _parent._currentframe;
Symbol 40 MovieClip Frame 2
vol = (1 - ((_parent._currentFrame - startFrame) / (_parent._totalFrames - startFrame))) * 100;
if (vol < 0) {
vol = 0;
}
_parent.snd.setVolume(vol);
Symbol 40 MovieClip Frame 3
gotoAndPlay ("loop");
Symbol 41 MovieClip Frame 1
snd = new Sound(this);
snd.setVolume(100);
_parent.stop();
Symbol 41 MovieClip Frame 123
stop();
_parent.play();
Symbol 48 MovieClip Frame 1
_name = "v2d";
_visible = false;
if (_target ne "/v2d") {
_root.v2d.fatalerror("Vector2D-Modul must be in _root");
}
fatalerror = function (error) {
trace("############# VECTOR-2D ERROR ###############");
trace(error);
trace("############# VECTOR-2D ERROR ###############");
};
p2pDistance = function (x1, y1, x2, y2) {
var _local2 = x2 - x1;
var _local1 = y2 - y1;
return(Math.sqrt((_local2 * _local2) + (_local1 * _local1)));
};
squareHit = function (x1, y1, x2, y2, s) {
return((Math.abs(x1 - x2) <= s) && (Math.abs(y1 - y2) <= s));
};
rectHit = function (x1, y1, x2, y2, sx, sy) {
return((Math.abs(x1 - x2) <= sx) && (Math.abs(y1 - y2) <= sy));
};
p2rDistance = function (x1, y1, x2, y2, x3, y3) {
var _local1 = new Object();
_local1 = _root.v2d.cross(x2, y2, x3, y3, x1, y1, x1 + (y3 - y2), y1 + ((x3 - x2) * -1));
};
triangleHit = function (x1, y1, x2, y2, x3, y3, x4, y4) {
};
withinRect = function (x1, y1, x2, y2, x3, y3) {
return((_root.v2d.numBetween(x1, x3, x2) == true) && (_root.v2d.numBetween(y1, y3, y2) == true));
};
r2vertSgnAngle = function (x1, y1, x2, y2) {
return(Math.asin((x2 - x1) / _root.v2d.p2pDistance(x1, y1, x2, y2)));
};
r2vertCwAngle = function (x1, y1, x2, y2) {
var _local1 = Math.asin((x2 - x1) / _root.v2d.p2pDistance(x1, y1, x2, y2));
if (_local1 < 0) {
_local1 = _local1 + (Math.PI*2);
}
return(_local1);
};
r2rSgnAngle = function (x1, y1, x2, y2, x3, y3, x4, y4) {
return(_root.v2d.r2vertCwAngle(x1, y1, x2, y2) - _root.v2d.r2vertCwAngle(x3, y3, x4, y4));
};
cross = function (x1, y1, x2, y2, x3, y3, x4, y4, hitCheck) {
var v1x = (x2 - x1);
var v3x = (x4 - x3);
var v1y = (y2 - y1);
var v3y = (y4 - y3);
var _local1 = new Object();
var _local2 = (v3x * v1y) - (v3y * v1x);
if (_local2 == 0) {
var _local3 = (x3 - x1) / v1x;
var ty = ((y3 - y1) / v1y);
if (_local3 == ty) {
if (hitCheck == true) {
if ((_local3 >= 0) && (_local3 <= 1)) {
_local1.hit = true;
} else {
_local3 = (x4 - x1) / v1x;
if ((_local3 >= 0) && (_local3 <= 1)) {
_local1.hit = true;
} else {
_local1.hit = false;
}
}
}
_local1.code = 2;
} else {
_local1.code = -2;
_local1.hit = false;
}
} else {
_local2 = ((v3x * (y3 - y1)) + (v3y * (x1 - x3))) / _local2;
if (hitcheck == true) {
if ((_local2 >= 0) && (_local2 <= 1)) {
n = ((x1 + (_local2 * v1x)) - x3) / v3x;
_local1.hit = (n >= 0) && (n <= 1);
} else {
_local1.hit = false;
}
}
_local1.x = x1 + (_local2 * v1x);
_local1.y = y1 + (_local2 * v1y);
_local1.code = 1;
_local1.pos = _local2;
}
return(_local1);
};
numBetween = function (a, b, c) {
var _local1 = c;
var _local2 = b;
var _local3 = a;
if (_local3 == _local1) {
return(true);
}
if (_local1 > _local3) {
return((_local2 > _local3) && (_local2 < _local1));
}
return((_local2 > _local1) && (_local2 < _local3));
};
Instance of Symbol 47 MovieClip "icon" in Symbol 48 MovieClip Frame 1
onClipEvent (load) {
_visible = false;
}
Symbol 55 Button
on (release) {
getURL ("http://www.neodelight.com", "_blank");
}
Symbol 64 Button
on (release, keyPress "<Space>") {
menu._visible = false;
gotoAndPlay ("startgame");
}
Symbol 67 Button
on (release) {
getURL ("http://www.neodelight.com/v4/highscores.php?game=teamball");
}
Symbol 69 Button
on (release) {
getURL ("http://www.neodelight.com?ref=teamball&ref_loc=moregames", "_top");
}
Symbol 89 Button
on (release, keyPress "<Space>") {
menu._visible = false;
gotoAndStop ("play");
}
Symbol 91 MovieClip Frame 1
_parent.setlaser();
Symbol 91 MovieClip Frame 2
gotoAndPlay (1);
Symbol 92 MovieClip Frame 1
setlaser = function () {
var _local1 = _root;
_local1.laser._x = _local1.pl1._x;
_local1.laser._y = _local1.pl1._y;
_local1.laser._yscale = _local1.v2d.p2pDistance(_local1.pl1._x, _local1.pl1._y, _local1.pl2._x, _local1.pl2._y);
rot = (_local1.v2d.r2vertSgnAngle(_local1.pl1._x, _local1.pl1._y, _local1.pl2._x, _local1.pl2._y) * 180) / Math.PI;
if (_local1.pl1._y < _local1.pl2._y) {
rot = 180 - rot;
}
_local1.laser._rotation = rot;
};
Symbol 92 MovieClip Frame 2
stop();
Symbol 92 MovieClip Frame 3
play();
Symbol 92 MovieClip Frame 7
gotoAndStop ("standby");
Symbol 94 MovieClip Frame 1
stop();
Symbol 95 MovieClip Frame 1
gotoAndStop(_parent._parent.playerID);
Symbol 97 MovieClip Frame 1
display = _root.actLives;
Symbol 99 MovieClip Frame 1
_parent.invulnerable = false;
stop();
Symbol 99 MovieClip Frame 2
_parent.invulnerable = true;
Symbol 100 MovieClip Frame 1
vx = 0;
vy = 0;
a = 0.4;
vmax = 5;
if (PlayerID == 1) {
key_UP = 38;
key_Down = 40;
key_left = 37;
key_right = 39;
} else {
key_UP = 87;
key_Down = 83;
key_Left = 65;
key_Right = 68;
}
reflect = new Sound();
reflect.attachSound("reflect2");
Symbol 100 MovieClip Frame 2
if (Key.isDown(Key_LEFT)) {
vx = vx - a;
if (vx < (-1 * vmax)) {
vx = -1 * vmax;
}
}
if (Key.isDown(Key_RIGHT)) {
vx = vx + a;
if (vx > vmax) {
vx = vmax;
}
}
if (Key.isDown(key_Up)) {
vy = vy - a;
if (vy < (-1 * vmax)) {
vy = -1 * vmax;
}
}
if (Key.isDown(Key_DOWN)) {
vy = vy + a;
if (vy > vmax) {
vy = vmax;
}
}
tx = _x + vx;
ty = _y + vy;
if (tx > _root.borderRight) {
tx = (2 * _root.borderRight) - tx;
vx = vx * -1;
reflect.start();
} else if (tx < _root.borderLeft) {
tx = (2 * _root.borderLeft) - tx;
vx = vx * -1;
reflect.start();
}
if (ty > _root.borderDown) {
ty = (2 * _root.borderDown) - ty;
vy = vy * -1;
reflect.start();
} else if (ty < _root.borderUp) {
ty = (2 * _root.borderUp) - ty;
vy = vy * -1;
reflect.start();
}
_x = tx;
_y = ty;
if (_name == "pl1") {
if (Key.isDown(32)) {
if (energy._currentframe == 1) {
_root.pl1.energy.play();
_root.pl2.energy.play();
_root.laser.setlaser();
_root.laser.gotoAndPlay("shoot");
var t = new Object();
lotX = _root.pl2._y - _root.pl1._y;
lotY = (_root.pl2._x - _root.pl1._y) * -1;
lotLength = _root.v2d.p2pDistance(0, 0, lotX, lotY);
lotX = (lotX / lotLength) * 25;
lotY = (lotY / lotLength) * 25;
hitlist = new Array();
i = 0;
while (i < _root.cannon.reg.length) {
cx = eval (("/shot_" + _root.cannon.reg[i]) + "._x");
cy = eval (("/shot_" + _root.cannon.reg[i]) + "._y");
t = _root.v2d.cross(_root.pl1._x, _root.pl1._y, _root.pl2._x, _root.pl2._y, cx - lotX, cy - lotY, cx + lotX, cy + lotY, true);
if (t.hit == true) {
hitlist.push(_root.cannon.reg[i]);
_root.cannon.reg.splice(i, 1);
i--;
}
i++;
}
_root.multiply = hitlist.length;
if (_root.multiply > 1) {
_root.multibonus.play();
}
i = 0;
while (i < hitlist.length) {
tellTarget (("/shot_" + hitlist[i]) + "/shot") {
gotoAndPlay ("hit");
};
i++;
}
}
}
}
i = 0;
while (i < _root.cannon.reg.length) {
if (_root.v2d.p2pDistance(_x, _y, eval (("/shot_" + _root.cannon.reg[i]) + "._x"), eval (("/shot_" + _root.cannon.reg[i]) + "._y")) < 20) {
if (invulnerable != true) {
action.gotoAndPlay("hit");
if (_root.actLives == 1) {
_root.pl1.gotoAndStop("gameOver");
_root.pl2.gotoAndStop("gameOver");
_root.gotoAndStop("gameOver");
}
_root.actLives--;
}
}
i++;
}
Symbol 100 MovieClip Frame 3
gotoAndPlay ("loop");
Symbol 104 MovieClip Frame 1
i = 0;
while (i < reg.length) {
unloadMovie ("/shot_" + reg[i]);
i++;
}
Symbol 104 MovieClip Frame 2
idle = true;
shotID = 10;
vx = 10;
vr = 5;
shotspeed = 5;
startTime = getTimer();
waitTime = 5000;
reg = new Array();
Symbol 104 MovieClip Frame 3
gox = Math.random() * 460;
gor = (Math.random() * 170) - 85;
gotoAndPlay ("move");
Symbol 104 MovieClip Frame 4
Symbol 104 MovieClip Frame 5
if (Math.abs(gox - cannon._x) > vx) {
if (gox > cannon._x) {
cannon._x = cannon._x + vx;
} else {
cannon._x = cannon._x - vx;
}
} else {
gotoAndPlay ("turn");
}
Symbol 104 MovieClip Frame 6
gotoAndPlay ("move");
Symbol 104 MovieClip Frame 7
if (Math.abs(gor - cannon._rotation) > vr) {
if (gor > cannon._rotation) {
cannon._rotation = cannon._rotation + vr;
} else {
cannon._rotation = cannon._rotation - vr;
}
} else {
gotoAndPlay ("shoot");
}
Symbol 104 MovieClip Frame 8
gotoAndPlay ("turn");
Symbol 104 MovieClip Frame 9
_root.attachMovie("shot", "shot_" + shotID, shotID);
reg.push(shotID);
shotID++;
if (shotID > 5000) {
shotID = 5;
}
Symbol 104 MovieClip Frame 20
if (Math.abs(cannon._rotation) > 3) {
if (cannon._rotation > 0) {
cannon._rotation = cannon._rotation - 3;
} else {
cannon._rotation = cannon._rotation + 3;
}
} else {
startWait = getTimer();
waitTime = waitTime * 0.98;
gotoAndPlay ("wait");
}
Symbol 104 MovieClip Frame 21
gotoAndPlay ("turnback");
Symbol 104 MovieClip Frame 23
if ((getTimer() - startWait) > waitTime) {
gotoAndPlay ("standby");
} else {
gotoAndPlay ("wait");
}
Symbol 107 MovieClip Frame 1
stop();
Symbol 112 MovieClip Frame 1
stop();
Symbol 112 MovieClip Frame 2
display.display = "x" + _root.multiply;
bonus = 200;
bonus = bonus * _root.multiply;
_root.score = _root.score + bonus;
display.display2 = bonus + " Points";
Symbol 116 MovieClip Frame 1
stop();
Symbol 116 MovieClip Frame 2
display.display = "x" + _root.multiply;
Symbol 121 MovieClip Frame 1
stop();
Symbol 121 MovieClip Frame 2
display.display = "x" + _root.multiply;
_root.score = _root.score + _root.jackpot;
Symbol 125 MovieClip Frame 1
summe = 0;
i = 0;
while (i < _root.cannon.reg.length) {
tellTarget (("/shot_" + _root.cannon.reg[i]) + "/shot/color") {
_root.summe.summe = _root.summe.summe + (_currentframe * 10);
};
i++;
}
display = summe;
Symbol 131 MovieClip Frame 179
stop();
_root.play();
Symbol 134 Button
on (release) {
_root.highscores.submit("teamball", "", _root.score, 0);
_root.gotoAndStop("menu");
}
Symbol 136 Button
on (release) {
_root.gotoAndStop("menu");
}