Frame 1
function defineCalls() {
dbInterface.startGame = function () {
lc.send(lcBaseString + lcString, "startGame");
_root.scorenewx = 0;
_root.dbInterface.updateScore(_root.scorenewx);
};
dbInterface.endGame = function () {
lc.send(lcBaseString + lcString, "endGame");
};
dbInterface.endGameUncompleted = function () {
lc.send(lcBaseString + lcString, "endGameUncompleted");
};
dbInterface.setFeedbackType = function (fbType) {
lc.send(lcBaseString + lcString, "setFeedbackType", fbType);
};
dbInterface.updateTime = function (strTime) {
lc.send(lcBaseString + lcString, "updateTime", strTime);
};
dbInterface.updateScore = function (strScore) {
lc.send(lcBaseString + lcString, "updateScore", strScore);
};
setActive();
}
function setActive() {
connection.text = "Connection: made";
dbInterface.setFeedbackType("score");
dbInterface.startGame();
}
function setDeactive() {
}
function testConnection() {
lcTest.send(lcBaseString + lcString, "active");
feedback.text = lcBaseString + lcString;
}
function trigerConnection() {
iTestConnectionIntervalID = setInterval(testConnection, 500);
}
stop();
count = 0;
countsound = 0;
_root.slidemusic_X = 0;
_root.slidesound_X = 0;
var lc = new LocalConnection();
var lcTest = new LocalConnection();
var lcBaseString = "IKONCITY_GAMES";
var dbInterface = new Object();
var iTestConnectionIntervalID;
var iTimerIntervalID;
lcTest.onStatus = function (infoObject) {
if (infoObject.level == "error") {
clearInterval(iTestConnectionIntervalID);
defineCalls();
}
};
Instance of Symbol 53 MovieClip in Frame 1
onClipEvent (load) {
this.swapDepths(35555);
}
Frame 2
Frame 3
_root.snd1.musicObj.start(0, 10000);
Frame 4
function seconds_time() {
if (_root.numeral < 10) {
_root.numeral = _root.numeral + 1;
_root.countSecond = _root.countSecond - 1;
}
if ((_root.numeral == 10) && (_root.countSecond == 0)) {
clearInterval(intervalID);
_root.anca1._x = _root.anca1._x - 60;
_root.anca2._x = _root.anca2._x + 60;
_root.numeral = 0;
}
}
function barrierRamp(countSecond) {
clearInterval(intervalID);
_root.numeral = 0;
intervalID = setInterval(seconds_time, 1000);
}
function distance(x0, y0) {
var _local2 = (((this.a * x0) + (this.b * y0)) + this.c) / this.module;
return(_local2);
}
function distancePoint(point) {
var _local3 = point._x;
var _local2 = point._y;
var _local4 = (((this.a * _local3) + (this.b * _local2)) + this.c) / this.module;
return(_local4);
}
function distancePointAbs(point) {
var _local3 = point._x;
var _local2 = point._y;
var _local4 = (((this.a * _local3) + (this.b * _local2)) + this.c) / this.module;
distanceAbs = Math.abs(_local4);
return(distanceAbs);
}
function distanceTo(point) {
var _local2 = ((((this.a * point.x) + (this.b * point.y)) + this.c) / this.module) - (point._width / 2);
return(_local2);
}
function getIntersection(a, b, c) {
var _local2 = new Object();
_local2.x0 = (-((this.c * b) - (c * this.b))) / ((this.a * b) - (a * this.b));
_local2.y0 = ((this.c * a) - (c * this.a)) / ((this.a * b) - (a * this.b));
return(_local2);
}
function isPartSegment(x0, y0) {
if (((((x0 < this.x1) && (x0 < this.x2)) || ((this.x1 < x0) && (this.x2 < x0))) || ((y0 < this.y1) && (y0 < this.y2))) || ((this.y1 < y0) && (this.y2 < y0))) {
return(false);
}
return(true);
}
function isPossibleTarget(myBall) {
if (!this.active) {
return(false);
}
var _local3 = this.getIntersection(myBall.a, myBall.b, myBall.c);
var _local4 = (((this.a * myBall.x) + (this.b * myBall.y)) + this.c) / this.module;
this.cachedDistance = _local4 - (myBall._width / 2);
if (!this.isPartSegment(_local3.x0, _local3.y0)) {
if ((_local4 >= 0) && (this.cachedDistance <= 0)) {
var _local5 = ((this.a * myBall.x) - (this.b * myBall.y)) - this.c;
var _local6 = ((this.b * myBall.y) - (this.a * myBall.x)) - this.c;
if (this.isPartSegment(_local5, _local6)) {
return(true);
}
}
return(false);
}
if ((((_local3.x0 >= myBall._x) && (myBall.limit_x >= _local3.x0)) || ((myBall._x >= _local3.x0) && (_local3.x0 >= myBall.limit_x))) && (((_local3.y0 >= myBall._y) && (myBall.limit_y >= _local3.y0)) || ((myBall._y >= _local3.y0) && (_local3.y0 >= myBall.limit_y)))) {
this.isCrossed = true;
return(true);
}
this.isCrossed = false;
return(true);
}
function Segment(a, b, c, x1, y1, x2, y2, point1, point2, clipObj) {
this.a = a;
this.b = b;
this.c = c;
this.x1 = x1;
this.y1 = y1;
this.x2 = x2;
this.y2 = y2;
this.point1 = point1;
this.point2 = point2;
this.clipObj = clipObj;
this.module = Math.sqrt((this.a * this.a) + (this.b * this.b));
this.angle = (Math.acos(this.b / this.module) / 3.141593) * 180;
if (this.y1 < this.y2) {
this.angle = 180 - this.angle;
}
this.active = true;
this.distanceTo = distanceTo;
this.distancePoint = distancePoint;
this.distancePointAbs = distancePointAbs;
this.isPossibleTarget = isPossibleTarget;
this.getIntersection = getIntersection;
this.mark = mark;
this.isPartSegment = isPartSegment;
}
function mark(flag) {
if (flag == 1) {
this.point1.gotoAndStop(2);
this.point2.gotoAndStop(2);
} else {
this.point1.gotoAndStop(1);
this.point2.gotoAndStop(1);
}
}
function getSegment(point1, point2) {
var _local4;
if ((point1._name == "b2") && (point2._name == "b3")) {
_local4 = _root.electricR;
} else if ((point1._name == "a2") && (point2._name == "a3")) {
_local4 = _root.electricL;
} else if ((point1._name == "d1b") && (point2._name == "d1a")) {
_local4 = _root.holdRight_mc;
} else if ((point1._name == "d1a") && (point2._name == "d1")) {
_local4 = _root.holdRight_mc;
} else if ((point1._name == "c7") && (point2._name == "c8")) {
_local4 = _root.holdLeft_mc;
} else if ((point1._name == "c8") && (point2._name == "c1")) {
_local4 = _root.holdLeft_mc;
} else {
_local4 = null;
}
var _local8 = point1._x;
var _local6 = point1._y;
var _local7 = point2._x;
var _local5 = point2._y;
var _local11 = _local5 - _local6;
var _local10 = _local8 - _local7;
var _local9 = ((-_local8) * _local5) + (_local7 * _local6);
return(new Segment(_local11, _local10, _local9, _local8, _local6, _local7, _local5, point1, point2, _local4));
}
lives = 5;
score = 0;
countSecond = 0;
numeral = 0;
gamenumeral = 0;
bonusHit = 0;
allSegments = new Array();
allSegments1 = new Array();
allSegments2 = new Array();
allBalls = new Array();
allBalls1 = new Array();
allBalls2 = new Array();
Instance of Symbol 384 MovieClip "Event" in Frame 4
onClipEvent (load) {
function nudgefn(npos) {
_root.ball._x = _root.ball._x + npos;
_root.ancaqw._x = _root.ancaqw._x + npos;
_root.ancaq._x = _root.ancaq._x + npos;
_root.holdLeft_mc._x = _root.holdLeft_mc._x + npos;
_root.holdRight_mc._x = _root.holdRight_mc._x + npos;
i = 1;
while (i <= 42) {
_root["p" + i]._x = _root["p" + i]._x + npos;
i++;
}
i = 1;
while (i <= 10) {
_root["y" + i]._x = _root["y" + i]._x + npos;
_root["t" + i]._x = _root["t" + i]._x + npos;
_root["n" + i]._x = _root["n" + i]._x + npos;
i++;
}
i = 1;
while (i <= 7) {
_root["b" + i]._x = _root["b" + i]._x + npos;
i++;
}
i = 1;
while (i <= 6) {
_root["d" + i]._x = _root["d" + i]._x + npos;
i++;
}
i = 1;
while (i <= 8) {
_root["c" + i]._x = _root["c" + i]._x + npos;
i++;
}
i = 1;
while (i <= 4) {
_root["j" + i]._x = _root["j" + i]._x + npos;
_root["h" + i]._x = _root["h" + i]._x + npos;
_root["f" + i]._x = _root["f" + i]._x + npos;
_root["g" + i]._x = _root["g" + i]._x + npos;
i++;
}
i = 1;
while (i <= 6) {
_root["a" + i]._x = _root["a" + i]._x + npos;
i++;
}
i = 0;
while (i <= 6) {
_root["st" + i]._x = _root["st" + i]._x + npos;
i++;
}
i = 0;
while (i <= 9) {
_root["flare" + i]._x = _root["flare" + i]._x + npos;
i++;
}
i = 0;
while (i <= 5) {
_root["ralu" + i]._x = _root["ralu" + i]._x + npos;
i++;
}
i = 0;
while (i <= 4) {
_root["cris" + i]._x = _root["cris" + i]._x + npos;
_root["cr" + i]._x = _root["cr" + i]._x + npos;
i++;
}
i = 0;
while (i <= 3) {
_root["maria" + i]._x = _root["maria" + i]._x + npos;
_root["daria" + i]._x = _root["daria" + i]._x + npos;
_root["du" + i]._x = _root["du" + i]._x + npos;
_root["do" + i]._x = _root["do" + i]._x + npos;
i++;
}
_root.min._x = _root.min._x + npos;
_root.kin._x = _root.kin._x + npos;
_root.kout._x = _root.kout._x + npos;
_root.vin._x = _root.vin._x + npos;
_root.vout._x = _root.vout._x + npos;
_root.fin._x = _root.fin._x + npos;
_root.fout._x = _root.fout._x + npos;
_root.lin._x = _root.lin._x + npos;
_root.lout._x = _root.lout._x + npos;
_root.d1a._x = _root.d1a._x + npos;
_root.d1b._x = _root.d1b._x + npos;
_root.ch._x = _root.ch._x + npos;
_root.cj._x = _root.cj._x + npos;
_root.cn._x = _root.cn._x + npos;
_root.cb._x = _root.cb._x + npos;
_root.cg._x = _root.cg._x + npos;
_root.cd._x = _root.cd._x + npos;
_root.cd1._x = _root.cd1._x + npos;
_root.cc._x = _root.cc._x + npos;
_root.cc1._x = _root.cc1._x + npos;
_root.cf._x = _root.cf._x + npos;
_root.cx._x = _root.cx._x + npos;
_root.cy._x = _root.cy._x + npos;
_root.design_mc._x = _root.design_mc._x + npos;
_root.shadow_mc._x = _root.shadow_mc._x + npos;
_root.bg_mc._x = _root.bg_mc._x + npos;
_root.elements_mc._x = _root.elements_mc._x + npos;
_root.electricL._x = _root.electricL._x + npos;
_root.electricR._x = _root.electricR._x + npos;
_root.star_mc._x = _root.star_mc._x + npos;
_root.center_sink._x = _root.center_sink._x + npos;
_root.logo_mc._x = _root.logo_mc._x + npos;
_root.mc_handler._x = _root.mc_handler._x + npos;
_root.flipLeft._x = _root.flipLeft._x + npos;
_root.flipRight._x = _root.flipRight._x + npos;
_root.ralu._x = _root.ralu._x + npos;
_root.anca._x = _root.anca._x + npos;
_root.ancaClip._x = _root.ancaClip._x + npos;
_root.raluClip._x = _root.raluClip._x + npos;
_root.rampLeft._x = _root.rampLeft._x + npos;
_root.rampRight._x = _root.rampRight._x + npos;
i = 1;
while (i <= 9) {
_root["x" + i]._x = _root["x" + i]._x + npos;
i++;
}
_root.ik_tblock._x = _root.ik_tblock._x + npos;
_root.k_tblock._x = _root.k_tblock._x + npos;
_root.o_tblock._x = _root.o_tblock._x + npos;
_root.n_tblock._x = _root.n_tblock._x + npos;
_root.c_tblock._x = _root.c_tblock._x + npos;
_root.i_tblock._x = _root.i_tblock._x + npos;
_root.t_tblock._x = _root.t_tblock._x + npos;
_root.y_tblock._x = _root.y_tblock._x + npos;
}
countSpace = 0;
countSpaceRelease = 0;
sTime = getTimer();
}
onClipEvent (keyDown) {
if (_root.lives < 6) {
_root.keyCode = Key.getCode();
if (_root.keyCode == 32) {
if (countSpace == 0) {
if (((getTimer() - sTime) > 100) && (_root.ball.waitToLaunch == true)) {
_root.mc_handler._visible = true;
_root.mc_handler.inc();
sTime = getTimer();
updateAfterEvent();
}
}
} else {
_root.mc_handler.gotoAndStop(1);
}
if ((_root.ball._x != _root.st0._x) && (_root.ball._y != (_root.st0._y + 10))) {
if (countSpace == 3) {
countSpaceRelease = 3;
}
if (countSpaceRelease < 3) {
if (countSpace < 3) {
_root.keyCode = Key.getCode();
if (_root.keyCode == 32) {
countSpace = countSpace + 1;
npos = 2;
nudgefn(npos);
}
}
}
}
}
}
onClipEvent (keyUp) {
_root.keyCode = Key.getCode();
if (_root.lives < 6) {
if (_root.keyCode == 32) {
if ((_root.Event.countSpaceRelease == 3) && (_root.Event.countSpace == 3)) {
npos = -6;
nudgefn(npos);
}
if (countSpace == 0) {
if (_root.lives >= 0) {
_root.mc_handler.startBall();
}
_root.mc_handler.gotoAndStop(1);
}
}
if ((_root.ball._x != _root.st0._x) && (_root.ball._y != (_root.st0._y + 10))) {
if (countSpace == 3) {
countSpace = countSpace - 1;
}
if (countSpaceRelease < 3) {
if (countSpace <= 2) {
if (_root.keyCode == 32) {
countSpaceRelease = countSpaceRelease + 1;
npos = -2;
nudgefn(npos);
}
}
}
if ((countSpace == 2) && (countSpaceRelease == 1)) {
countSpaceRelease = countSpaceRelease + 2;
npos = -4;
nudgefn(npos);
}
}
}
}
Frame 6
_root.addBalls = false;
_root.leftzerodist = 0;
_root.rightzerodist = 0;
_root.leftTwoBallsHolded = 0;
_root.rightTwoBallsHolded = 0;
_root.holdRightTargetIs = "";
_root.holdLeftTargetIs = "";
_root.ballMax = 1;
_root.allFalls = 0;
function initialize() {
if (this.type == CORP_OUTER) {
i = 0;
while (i < this.segments.length) {
if (this.segments[i].distancePoint(this.centerPoint) < 0) {
this.segments[i].a = this.segments[i].a * -1;
this.segments[i].b = this.segments[i].b * -1;
this.segments[i].c = this.segments[i].c * -1;
}
i++;
}
} else {
i = 0;
while (i < this.segments.length) {
if (this.segments[i].distancePoint(this.centerPoint) > 0) {
this.segments[i].a = this.segments[i].a * -1;
this.segments[i].b = this.segments[i].b * -1;
this.segments[i].c = this.segments[i].c * -1;
}
i++;
}
}
}
function Corp(segments, center, type, valNum) {
this.segments = segments;
this.centerPoint = center;
this.type = type;
this.initialize = initialize;
this["allSegments" + valNum] = this.segments;
_root["splitSegment" + valNum] = this["allSegments" + valNum];
_root["ball1splitSegment" + valNum] = this["allSegments" + valNum];
_root["ball2splitSegment" + valNum] = this["allSegments" + valNum];
}
i = 0;
allSegments = new Array();
CORP_INNER = 0;
CORP_OUTER = 1;
i = 1;
while (lives >= i) {
_root["life" + i]._visible = true;
i++;
}
mainSegs = new Array();
mainSegs.push(getSegment(_root.p1, _root.p2));
mainSegs.push(getSegment(_root.p2, _root.p3));
mainSegs.push(getSegment(_root.p3, _root.p4));
mainSegs.push(getSegment(_root.p4, _root.p5));
mainSegs.push(getSegment(_root.p5, _root.p6));
mainSegs.push(getSegment(_root.p6, _root.p7));
mainSegs.push(getSegment(_root.p7, _root.p8));
mainSegs.push(getSegment(_root.p8, _root.p9));
mainSegs.push(getSegment(_root.p9, _root.p10));
mainSegs.push(getSegment(_root.p10, _root.p11));
mainSegs.push(getSegment(_root.p11, _root.p12));
mainSegs.push(getSegment(_root.p12, _root.p13));
mainSegs.push(getSegment(_root.p13, _root.p14));
mainSegs.push(getSegment(_root.p14, _root.p15));
mainSegs.push(getSegment(_root.p15, _root.p16));
mainSegs.push(getSegment(_root.p16, _root.p17));
mainSegs.push(getSegment(_root.p17, _root.p18));
mainSegs.push(getSegment(_root.p18, _root.p19));
mainSegs.push(getSegment(_root.p19, _root.p20));
mainSegs.push(getSegment(_root.p20, _root.p21));
mainSegs.push(getSegment(_root.p21, _root.p22));
mainSegs.push(getSegment(_root.p22, _root.p23));
mainSegs.push(getSegment(_root.p23, _root.p24));
mainSegs.push(getSegment(_root.p24, _root.p25));
mainSegs.push(getSegment(_root.p25, _root.p26));
mainSegs.push(getSegment(_root.p26, _root.p27));
mainSegs.push(getSegment(_root.p27, _root.p28));
mainSegs.push(getSegment(_root.p28, _root.p29));
mainSegs.push(getSegment(_root.p29, _root.p30));
mainSegs.push(getSegment(_root.p30, _root.p31));
mainSegs.push(getSegment(_root.p31, _root.p32));
mainSegs.push(getSegment(_root.p32, _root.p33));
mainSegs.push(getSegment(_root.p33, _root.p34));
mainSegs.push(getSegment(_root.p34, _root.p35));
mainSegs.push(getSegment(_root.p35, _root.p36));
mainSegs.push(getSegment(_root.p36, _root.p37));
mainSegs.push(getSegment(_root.p37, _root.p38));
mainSegs.push(getSegment(_root.p38, _root.p39));
mainSegs.push(getSegment(_root.p39, _root.p40));
mainSegs.push(getSegment(_root.p40, _root.p41));
mainSegs.push(getSegment(_root.p41, _root.p42));
mainSegs.push(getSegment(_root.p42, _root.p1));
tempCorp = new Corp(mainSegs, _root.cp, CORP_OUTER, 1);
tempCorp.initialize();
corpSegs = new Array();
corpSegs.push(getSegment(_root.a1, _root.a2));
corpSegs.push(getSegment(_root.a2, _root.a3));
corpSegs.push(getSegment(_root.a3, _root.a4));
corpSegs.push(getSegment(_root.a4, _root.a5));
corpSegs.push(getSegment(_root.a5, _root.a6));
corpSegs.push(getSegment(_root.a6, _root.a1));
tempCorp = new Corp(corpSegs, _root.ca, CORP_INNER, 2);
tempCorp.initialize();
corpSegs = new Array();
corpSegs.push(getSegment(_root.b1, _root.b2));
corpSegs.push(getSegment(_root.b2, _root.b3));
corpSegs.push(getSegment(_root.b3, _root.b4));
corpSegs.push(getSegment(_root.b4, _root.b5));
corpSegs.push(getSegment(_root.b5, _root.b6));
corpSegs.push(getSegment(_root.b6, _root.b7));
corpSegs.push(getSegment(_root.b7, _root.b1));
tempCorp = new Corp(corpSegs, _root.cb, CORP_INNER, 3);
tempCorp.initialize();
corpSegs = new Array();
corpSegs.push(getSegment(_root.g1, _root.g2));
corpSegs.push(getSegment(_root.g2, _root.g3));
corpSegs.push(getSegment(_root.g3, _root.g4));
corpSegs.push(getSegment(_root.g4, _root.g1));
tempCorp = new Corp(corpSegs, _root.cg, CORP_INNER, 4);
tempCorp.initialize();
corpSegs = new Array();
corpSegs.push(getSegment(_root.t1, _root.t2));
corpSegs.push(getSegment(_root.t2, _root.t3));
corpSegs.push(getSegment(_root.t3, _root.t4));
corpSegs.push(getSegment(_root.t4, _root.t5));
corpSegs.push(getSegment(_root.t5, _root.t6));
corpSegs.push(getSegment(_root.t6, _root.t7));
corpSegs.push(getSegment(_root.t7, _root.t8));
corpSegs.push(getSegment(_root.t8, _root.t9));
corpSegs.push(getSegment(_root.t9, _root.t10));
corpSegs.push(getSegment(_root.t10, _root.t1));
tempCorp = new Corp(corpSegs, _root.ct, CORP_INNER, 5);
tempCorp.initialize();
corpSegs = new Array();
corpSegs.push(getSegment(_root.n1, _root.n2));
corpSegs.push(getSegment(_root.n2, _root.n3));
corpSegs.push(getSegment(_root.n3, _root.n4));
corpSegs.push(getSegment(_root.n4, _root.n5));
corpSegs.push(getSegment(_root.n5, _root.n6));
corpSegs.push(getSegment(_root.n6, _root.n7));
corpSegs.push(getSegment(_root.n7, _root.n8));
corpSegs.push(getSegment(_root.n8, _root.n9));
corpSegs.push(getSegment(_root.n9, _root.n10));
corpSegs.push(getSegment(_root.n10, _root.n1));
tempCorp = new Corp(corpSegs, _root.cn, CORP_INNER, 6);
tempCorp.initialize();
corpSegs = new Array();
corpSegs.push(getSegment(_root.c1, _root.c2));
corpSegs.push(getSegment(_root.c2, _root.c5));
corpSegs.push(getSegment(_root.c5, _root.c6));
corpSegs.push(getSegment(_root.c6, _root.c7));
corpSegs.push(getSegment(_root.c7, _root.c8));
corpSegs.push(getSegment(_root.c8, _root.c1));
tempCorp = new Corp(corpSegs, _root.cc, CORP_INNER, 7);
tempCorp.initialize();
corpSegs = new Array();
corpSegs.push(getSegment(_root.c2, _root.c3));
corpSegs.push(getSegment(_root.c3, _root.c4));
corpSegs.push(getSegment(_root.c4, _root.c5));
corpSegs.push(getSegment(_root.c5, _root.c2));
tempCorp = new Corp(corpSegs, _root.cc1, CORP_INNER, 8);
tempCorp.initialize();
corpSegs = new Array();
corpSegs.push(getSegment(_root.d1, _root.d2));
corpSegs.push(getSegment(_root.d2, _root.d3));
corpSegs.push(getSegment(_root.d3, _root.d4));
corpSegs.push(getSegment(_root.d4, _root.d1b));
corpSegs.push(getSegment(_root.d1b, _root.d1a));
corpSegs.push(getSegment(_root.d1a, _root.d1));
tempCorp = new Corp(corpSegs, _root.cd, CORP_INNER, 9);
tempCorp.initialize();
corpSegs = new Array();
corpSegs.push(getSegment(_root.d2, _root.d3));
corpSegs.push(getSegment(_root.d3, _root.d5));
corpSegs.push(getSegment(_root.d5, _root.d6));
corpSegs.push(getSegment(_root.d6, _root.d2));
tempCorp = new Corp(corpSegs, _root.cd1, CORP_INNER, 10);
tempCorp.initialize();
corpSegs = new Array();
corpSegs.push(getSegment(_root.j1, _root.j2));
corpSegs.push(getSegment(_root.j2, _root.j3));
corpSegs.push(getSegment(_root.j3, _root.j4));
corpSegs.push(getSegment(_root.j4, _root.j1));
tempCorp = new Corp(corpSegs, _root.cj, CORP_INNER, 11);
tempCorp.initialize();
corpSegs = new Array();
corpSegs.push(getSegment(_root.h1, _root.h2));
corpSegs.push(getSegment(_root.h2, _root.h3));
corpSegs.push(getSegment(_root.h3, _root.h4));
corpSegs.push(getSegment(_root.h4, _root.h1));
tempCorp = new Corp(corpSegs, _root.ch, CORP_INNER, 12);
tempCorp.initialize();
corpSegs = new Array();
corpSegs.push(getSegment(_root.x1, _root.x2));
corpSegs.push(getSegment(_root.x2, _root.x3));
corpSegs.push(getSegment(_root.x3, _root.x4));
corpSegs.push(getSegment(_root.x4, _root.x5));
corpSegs.push(getSegment(_root.x5, _root.x6));
corpSegs.push(getSegment(_root.x6, _root.x7));
corpSegs.push(getSegment(_root.x7, _root.x8));
corpSegs.push(getSegment(_root.x8, _root.x9));
corpSegs.push(getSegment(_root.x9, _root.x1));
tempCorp = new Corp(corpSegs, _root.cx, CORP_INNER, 13);
tempCorp.initialize();
corpSegs = new Array();
corpSegs.push(getSegment(_root.y1, _root.y2));
corpSegs.push(getSegment(_root.y2, _root.y3));
corpSegs.push(getSegment(_root.y3, _root.y4));
corpSegs.push(getSegment(_root.y4, _root.y5));
corpSegs.push(getSegment(_root.y5, _root.y6));
corpSegs.push(getSegment(_root.y6, _root.y7));
corpSegs.push(getSegment(_root.y7, _root.y8));
corpSegs.push(getSegment(_root.y8, _root.y9));
corpSegs.push(getSegment(_root.y9, _root.y10));
corpSegs.push(getSegment(_root.y10, _root.y1));
tempCorp = new Corp(corpSegs, _root.cy, CORP_INNER, 14);
tempCorp.initialize();
corpSegs = new Array();
flipRight.upSegment = getSegment(_root.d1, _root.f3);
flipRight.downSegment = getSegment(_root.d1, _root.f4);
flipRight.upSegment.active = false;
flipRight.centreX = _root.d1._x;
flipRight.centreY = _root.d1._y;
corpSegs.push(flipRight.upSegment);
corpSegs.push(flipRight.downSegment);
tempCorp = new Corp(corpSegs, _root.cf, CORP_INNER, 15);
tempCorp.initialize();
corpSegs = new Array();
flipLeft.upSegment = getSegment(_root.c1, _root.f1);
flipLeft.downSegment = getSegment(_root.c1, _root.f2);
flipLeft.upSegment.active = false;
flipLeft.centreX = _root.c1._x;
flipLeft.centreY = _root.c1._y;
corpSegs.push(flipLeft.upSegment);
corpSegs.push(flipLeft.downSegment);
tempCorp = new Corp(corpSegs, _root.cf, CORP_INNER, 16);
tempCorp.initialize();
corpSegs = new Array();
corpSegs.push(getSegment(_root.k1, _root.k2));
corpSegs.push(getSegment(_root.k2, _root.k3));
corpSegs.push(getSegment(_root.k3, _root.k4));
corpSegs.push(getSegment(_root.k4, _root.k1));
tempCorp = new Corp(corpSegs, _root.ck, CORP_INNER, 17);
tempCorp.initialize();
Frame 7
function barrier() {
if (_root.gamenumeral == 0) {
if ((_root.numeral != 0) && (_root.countSecond != 0)) {
_root.countSecond = 0;
_root.numeral = 0;
clearInterval(_root.intervalID);
_root.anca1._x = _root.anca1._x - 60;
_root.anca2._x = _root.anca2._x + 60;
}
if (_root.countSecond == 0) {
_root.anca1._x = _root.anca1._x + 60;
_root.anca2._x = _root.anca2._x - 60;
}
_root.countSecond = _root.countSecond + 10;
_root.barrierRamp(_root.countSecond);
}
}
function onceTarget(targetBall, i) {
if ((((_root.st0.hitTest(targetBall) && (targetBall.isOnPath != true)) && (_root.st0.angleMin < targetBall.angle)) && (targetBall.angle < _root.st0.angleMax)) && (targetBall.speed >= _root.st0.speedMin)) {
targetBall.destination = "st0";
targetBall.isOnPath = true;
ranNum = random(8);
if (ranNum >= 2) {
if (ranNum == 4) {
targetBall.angleOut = 65;
} else if (ranNum == 7) {
targetBall.angleOut = 5;
} else {
targetBall.angleOut = _root.st0.angleOut - (ranNum * 20);
}
} else {
targetBall.angleOut = _root.st0.angleOut + (ranNum * 2);
}
targetBall.speedInc = _root.st0.speedInc;
targetBall._x = _root.st0._x;
targetBall._y = _root.st0._y;
if (_root.st0.speedOut > 0) {
targetBall.speedOut = _root.st0.speedOut;
} else {
targetBall.speedOut = null;
}
_root.ranvalue = "ranNum = " + ranNum;
_root.anglevalue = "angle = " + targetBall.angleOut;
_root.speedvalue = "speed = " + targetBall.speedOut;
trace("targetBall.angleOut = " + targetBall.angleOut);
trace("targetBall.speedOut = " + targetBall.speedOut);
targetBall.updateDestination();
} else if ((((_root.daria0.hitTest(targetBall) && (targetBall.isOnPath != true)) && (_root.daria0.angleMin < targetBall.angle)) && (targetBall.angle < _root.daria0.angleMax)) && (targetBall.speed >= _root.daria0.speedMin)) {
_root.snd10.spinObj.start(0, 1);
targetBall.destination = "daria0";
targetBall.isOnPath = true;
targetBall.angleOut = _root.daria0.angleOut;
targetBall.speedInc = _root.daria0.speedInc;
targetBall._x = _root.daria0._x;
targetBall._y = _root.daria0._y;
if (_root.daria0.speedOut > 0) {
targetBall.speedOut = _root.daria0.speedOut;
} else {
targetBall.speedOut = null;
}
targetBall.updateDestination();
} else if ((((_root.du0.hitTest(targetBall) && (targetBall.isOnPath != true)) && (_root.du0.angleMin < targetBall.angle)) && (targetBall.angle < _root.du0.angleMax)) && (targetBall.speed >= _root.du0.speedMin)) {
targetBall.destination = "du0";
targetBall.isOnPath = true;
targetBall.angleOut = 145;
targetBall.speedInc = _root.du0.speedInc;
targetBall._x = _root.du0._x;
targetBall._y = _root.du0._y;
if (_root.du0.speedOut > 0) {
targetBall.speedOut = _root.du0.speedOut;
} else {
targetBall.speedOut = null;
}
targetBall.updateDestination();
} else if ((((_root.do0.hitTest(targetBall) && (targetBall.isOnPath != true)) && (_root.do0.angleMin < targetBall.angle)) && (targetBall.angle < _root.do0.angleMax)) && (targetBall.speed >= _root.do0.speedMin)) {
_root.snd10.spinObj.start(0, 1);
targetBall.destination = "do0";
targetBall.isOnPath = true;
targetBall.angleOut = _root.do0.angleOut;
targetBall.speedInc = _root.do0.speedInc;
targetBall._x = _root.do0._x;
targetBall._y = _root.do0._y;
if (_root.do0.speedOut > 0) {
targetBall.speedOut = _root.do0.speedOut;
} else {
targetBall.speedOut = null;
}
targetBall.updateDestination();
} else if ((((_root.maria0.hitTest(targetBall) && (targetBall.isOnPath != true)) && (_root.maria0.angleMin < targetBall.angle)) && (targetBall.angle < _root.maria0.angleMax)) && (targetBall.speed >= _root.maria0.speedMin)) {
targetBall.destination = "maria0";
targetBall.isOnPath = true;
targetBall.angleOut = 35;
targetBall.speedInc = _root.maria0.speedInc;
targetBall._x = _root.maria0._x;
targetBall._y = _root.maria0._y;
if (_root.maria0.speedOut > 0) {
targetBall.speedOut = _root.maria0.speedOut;
} else {
targetBall.speedOut = null;
}
targetBall.updateDestination();
} else if ((((_root.cris0.hitTest(targetBall) && (targetBall.isOnPath != true)) && (_root.cris0.angleMin < targetBall.angle)) && (targetBall.angle < _root.cris0.angleMax)) && (targetBall.speed >= _root.cris0.speedMin)) {
targetBall.destination = "cris0";
targetBall.isOnPath = true;
targetBall.angleOut = _root.cris0.angleOut;
targetBall.speedInc = _root.cris0.speedInc;
targetBall._x = _root.cris0._x;
targetBall._y = _root.cris0._y;
if (_root.cris0.speedOut > 0) {
targetBall.speedOut = _root.cris0.speedOut;
} else {
targetBall.speedOut = null;
}
targetBall.updateDestination();
} else if ((((_root.cr0.hitTest(targetBall) && (targetBall.isOnPath != true)) && (_root.cr0.angleMin < targetBall.angle)) && (targetBall.angle < _root.cr0.angleMax)) && (targetBall.speed >= _root.cr0.speedMin)) {
targetBall.destination = "cr0";
targetBall.isOnPath = true;
targetBall.angleOut = _root.cr0.angleOut;
targetBall.speedInc = _root.cr0.speedInc;
targetBall._x = _root.cr0._x;
targetBall._y = _root.cr0._y;
if (_root.cr0.speedOut > 0) {
targetBall.speedOut = _root.cr0.speedOut;
} else {
targetBall.speedOut = null;
}
targetBall.updateDestination();
} else if ((((_root.ralu0.hitTest(targetBall) && (targetBall.isOnPath != true)) && (_root.ralu0.angleMin < targetBall.angle)) && (targetBall.angle < _root.ralu0.angleMax)) && (targetBall.speed >= _root.ralu0.speedMin)) {
targetBall.destination = "ralu0";
targetBall.isOnPath = true;
targetBall.angleOut = 145;
targetBall.speedInc = _root.ralu0.speedInc;
targetBall._x = _root.ralu0._x;
targetBall._y = _root.ralu0._y;
if (_root.ralu0.speedOut > 0) {
targetBall.speedOut = _root.ralu0.speedOut;
} else {
targetBall.speedOut = null;
}
targetBall.updateDestination();
} else if ((((_root.mout.hitTest(targetBall) && (targetBall.isOnPath != true)) && (_root.mout.angleMin < targetBall.angle)) && (targetBall.angle < _root.mout.angleMax)) && (targetBall.speed >= _root.mout.speedMin)) {
targetBall.destination = "mout";
targetBall.isOnPath = true;
ranNum_mout = random(8);
if (ranNum_mout >= 4) {
targetBall.angleOut = _root.mout.angleOut + (ranNum_mout * 10);
} else {
targetBall.angleOut = _root.mout.angleOut - (ranNum_mout * 10);
}
targetBall.speedInc = _root.mout.speedInc;
targetBall._x = _root.mout._x;
targetBall._y = _root.mout._y;
if (_root.mout.speedOut > 0) {
targetBall.speedOut = _root.mout.speedOut;
} else {
targetBall.speedOut = null;
}
targetBall.updateDestination();
_root.mout._x = 134.6;
_root.mout._y = 218.6;
if (_root.ballMax < 3) {
if (i == 1) {
if (_root.ballMax == 1) {
if (_root.bonusHit < 3) {
_root.bonusHit = _root.bonusHit + 1;
trace("_root.bonusHit increment = " + _root.bonusHit);
trace("_root.ballMax = " + _root.ballMax);
if (_root.bonusHit == 3) {
_root.allFalls = 0;
_root.ballMax = 3;
_root.addBalls = true;
}
}
}
} else if (i == 2) {
if (_root.ballMax == 1) {
if (_root.bonusHit < 3) {
_root.bonusHit = _root.bonusHit + 1;
trace("_root.bonusHit increment = " + _root.bonusHit);
trace("_root.ballMax = " + _root.ballMax);
if (_root.bonusHit == 3) {
_root.allFalls = 0;
_root.ballMax = 3;
_root.addBalls = true;
}
}
}
} else if (i == 3) {
if (_root.ballMax == 1) {
if (_root.bonusHit < 3) {
_root.bonusHit = _root.bonusHit + 1;
trace("_root.bonusHit increment = " + _root.bonusHit);
trace("_root.ballMax = " + _root.ballMax);
if (_root.bonusHit == 3) {
_root.allFalls = 0;
_root.ballMax = 3;
_root.addBalls = true;
}
}
}
}
}
_root.snd8.tblockObj.start(0, 1);
_root.barrier();
} else if ((((_root.fout.hitTest(targetBall) && (targetBall.isOnPath != true)) && (_root.fout.angleMin < targetBall.angle)) && (targetBall.angle < _root.fout.angleMax)) && (targetBall.speed >= _root.fout.speedMin)) {
targetBall.destination = "fout";
targetBall.isOnPath = true;
ranNum_fout = random(6);
if (ranNum_fout >= 3) {
targetBall.angleOut = _root.fout.angleOut + (ranNum_fout * 2);
} else {
targetBall.angleOut = _root.fout.angleOut + (ranNum_fout * 3);
}
targetBall.speedInc = _root.fout.speedInc;
targetBall._x = _root.fout._x;
targetBall._y = _root.fout._y;
if (_root.fout.speedOut > 0) {
targetBall.speedOut = _root.fout.speedOut;
} else {
targetBall.speedOut = null;
}
targetBall.updateDestination();
_root.snd15.centerObj.start(0, 1);
_root.barrier();
} else if ((((_root.lout.hitTest(targetBall) && (targetBall.isOnPath != true)) && (_root.lout.angleMin < targetBall.angle)) && (targetBall.angle < _root.lout.angleMax)) && (targetBall.speed >= _root.lout.speedMin)) {
targetBall.destination = "lout";
targetBall.isOnPath = true;
ranNum_lout = random(7);
if (ranNum_lout >= 3) {
targetBall.angleOut = _root.lout.angleOut + (ranNum_lout * 10);
} else {
targetBall.angleOut = _root.lout.angleOut + (ranNum_lout * 7);
}
targetBall.speedInc = _root.lout.speedInc;
targetBall._x = _root.lout._x;
targetBall._y = _root.lout._y;
if (_root.lout.speedOut > 0) {
targetBall.speedOut = _root.lout.speedOut;
} else {
targetBall.speedOut = null;
}
targetBall.updateDestination();
_root.snd14.tripleObj.start(0, 1);
_root.barrier();
} else if ((((_root.kout.hitTest(targetBall) && (targetBall.isOnPath != true)) && (_root.kout.angleMin < targetBall.angle)) && (targetBall.angle < _root.kout.angleMax)) && (targetBall.speed >= _root.kout.speedMin)) {
targetBall.destination = "kout";
targetBall.isOnPath = true;
ranNum_kout = random(8);
if (ranNum_kout >= 4) {
targetBall.angleOut = _root.kout.angleOut + (ranNum_kout * 1);
} else {
targetBall.angleOut = _root.kout.angleOut - (ranNum_kout * 1);
}
targetBall.speedInc = _root.kout.speedInc;
targetBall._x = _root.kout._x;
targetBall._y = _root.kout._y;
if (_root.kout.speedOut > 0) {
targetBall.speedOut = _root.kout.speedOut;
} else {
targetBall.speedOut = null;
}
targetBall.updateDestination();
_root.snd13.doubleObj.start(0, 1);
_root.barrier();
} else if ((((_root.vout.hitTest(targetBall) && (targetBall.isOnPath != true)) && (_root.vout.angleMin < targetBall.angle)) && (targetBall.angle < _root.vout.angleMax)) && (targetBall.speed >= _root.vout.speedMin)) {
targetBall.destination = "vout";
targetBall.isOnPath = true;
targetBall.angleOut = _root.vout.angleOut;
targetBall.speedInc = _root.vout.speedInc;
targetBall._x = _root.vout._x;
targetBall._y = _root.vout._y;
if (_root.vout.speedOut > 0) {
targetBall.speedOut = _root.vout.speedOut;
} else {
targetBall.speedOut = null;
}
targetBall.updateDestination();
_root.snd12.singleObj.start(0, 1);
_root.barrier();
}
if ((_root.bonusHit == 3) && (_root.addBalls == true)) {
if (targetBall == _level0.ball) {
_root.multiBalls(_level0.ball1, _level0.ball2);
_root.CenterBall = targetBall;
} else if (targetBall == _level0.ball1) {
_root.multiBalls(_level0.ball2, _level0.ball);
_root.CenterBall = targetBall;
} else if (targetBall == _level0.ball2) {
_root.multiBalls(_level0.ball, _level0.ball1);
_root.CenterBall = targetBall;
}
}
if (targetBall.waitToLaunch) {
} else if (targetBall.isOnPath) {
if (targetBall.step < targetBall.steps) {
targetBall.stepByStep();
} else {
targetBall.updateDestination();
}
} else if (targetBall.timeToWait != null) {
if ((getTimer() - targetBall.sTime) >= targetBall.timeToWait) {
targetBall.timeToWait = null;
targetBall.angle = targetBall.angle_wait;
targetBall.speed = targetBall.speed_wait;
if (targetBall._visible == false) {
targetBall._visible = true;
}
if ((targetBall.xOutPosition != null) & (targetBall.yOutPosition != null)) {
targetBall._x = targetBall.xOutPosition;
targetBall._y = targetBall.yOutPosition;
targetBall.xOutPosition = null;
targetBall.yOutPosition = null;
}
}
} else {
if (targetBall.MAX_SPEED < targetBall.speed) {
targetBall.speed = targetBall.MAX_SPEED;
}
targetBall.cCos = Math.cos(targetBall.angle * targetBall.radToDeg);
targetBall.cSin = Math.sin(targetBall.angle * targetBall.radToDeg);
targetBall.speedX = targetBall.speed * targetBall.cCos;
targetBall.speedY = targetBall.speed * targetBall.cSin;
if ((targetBall.speedY < -0.3) && ((targetBall.speedY + targetBall.GRAV_Y) > 0)) {
targetBall.y = targetBall._y + targetBall.speedY;
targetBall.speedY = 0;
} else {
targetBall.speedY = targetBall.speedY + ((targetBall.speedY < 9) ? (targetBall.GRAV_Y) : 0);
targetBall.y = targetBall._y + targetBall.speedY;
}
targetBall.x = targetBall._x + targetBall.speedX;
targetBall.limit_x = targetBall.x + ((targetBall._width / 2) * targetBall.cCos);
targetBall.limit_y = targetBall.y + ((targetBall._width / 2) * targetBall.cSin);
targetBall.spe = Math.sqrt((targetBall.speedX * targetBall.speedX) + (targetBall.speedY * targetBall.speedY));
if ((targetBall.speedY < 0.1) && (targetBall.speedY >= 0)) {
targetBall.speedY = 0;
if (targetBall.speedX < 0) {
targetBall.angle = 180;
} else {
targetBall.angle = 0;
}
} else if ((targetBall.speedX < 0.1) && (targetBall.speedX >= 0)) {
targetBall.speedX = 0;
if (targetBall.speedY < 0) {
targetBall.angle = 270;
} else if (_root.leftzerodist != 1) {
targetBall.angle = 90;
}
} else {
targetBall.angle = (Math.atan(Math.abs(targetBall.speedY / targetBall.speedX)) * 180) / 3.141593;
}
if ((targetBall.speedX < 0) && (targetBall.speedY < 0)) {
targetBall.angle = targetBall.angle + 180;
} else if ((targetBall.speedX < 0) && (targetBall.speedY > 0)) {
targetBall.angle = 180 - targetBall.angle;
} else if ((targetBall.speedX > 0) && (targetBall.speedY < 0)) {
targetBall.angle = 360 - targetBall.angle;
}
targetBall.calculateDirection(targetBall.angle);
targetBall.findPossibleTarget();
if (targetBall.flipRightToggled && (_root.flipRight.inRange(targetBall))) {
_root.snd7.flipObj.start(0, 1);
targetBall.collisionFlipperRight();
} else if (targetBall.flipLeftToggled && (_root.flipLeft.inRange(targetBall))) {
_root.snd7.flipObj.start(0, 1);
targetBall.collisionFlipperLeft();
} else if ((targetBall.segmentT != null) && (targetBall.segmentT.distanceTo(targetBall) < 0)) {
targetBall.x = targetBall._x;
targetBall.y = targetBall._y;
targetBall.actualDist = targetBall.segmentT.distancePointAbs(targetBall);
_root.holdLeftTarget = targetBall;
_root.holdRightTarget = targetBall;
if (_root.leftzerodist == 1) {
if (_root.leftTwoBallsHolded != 1) {
} else if (_root.thirdball != targetBall) {
targetBall.speed = 0;
if (_root.leftThreeBallsHolded != 1) {
if (targetBall._x > _root.holdLeft_mc._x) {
targetBall._x = 260.65;
targetBall._y = 332.65;
} else if (targetBall._x < _root.holdLeft_mc._x) {
targetBall._x = 250.1;
targetBall._y = 330.25;
}
}
} else {
targetBall.collisionSegment();
}
} else if (_root.rightzerodist == 1) {
if (_root.rightTwoBallsHolded != 1) {
} else if (_root.thirdball != targetBall) {
targetBall.speed = 0;
if (_root.rightThreeBallsHolded != 1) {
if (targetBall._x > _root.holdRight_mc._x) {
targetBall._x = 351.25;
targetBall._y = 330.15;
} else if (targetBall._x < _root.holdRight_mc._x) {
targetBall._x = 340.1;
targetBall._y = 332.25;
}
}
} else {
targetBall.collisionSegment();
}
} else {
targetBall.collisionSegment();
}
} else if ((targetBall.ballT != null) && ((targetBall.ballT.distancePoint(targetBall) - ((targetBall._width / 2) + (targetBall.ballT._width / 2))) < 0)) {
if (targetBall.ballT == _level0.anca) {
_root.design_mc.gotoAndPlay(2);
}
_root.holdLeftTarget = targetBall;
_root.holdRightTarget = targetBall;
if (_root.leftzerodist == 1) {
if (_root.leftTwoBallsHolded != 1) {
} else if (_root.thirdball != targetBall) {
targetBall.speed = 0;
if (_root.leftThreeBallsHolded != 1) {
if (targetBall._x > _root.holdLeft_mc._x) {
targetBall._x = 260.65;
targetBall._y = 332.65;
} else if (targetBall._x < _root.holdLeft_mc._x) {
targetBall._x = 250.1;
targetBall._y = 330.25;
}
}
} else {
targetBall.collisionBall();
}
} else if (_root.rightzerodist == 1) {
if (_root.rightTwoBallsHolded != 1) {
} else if (_root.thirdball != targetBall) {
targetBall.speed = 0;
if (_root.rightThreeBallsHolded != 1) {
if (targetBall._x > _root.holdRight_mc._x) {
targetBall._x = 351.25;
targetBall._y = 330.15;
} else if (targetBall._x < _root.holdRight_mc._x) {
targetBall._x = 340.1;
targetBall._y = 332.25;
}
}
} else {
targetBall.collisionBall();
}
} else {
targetBall.collisionBall();
}
} else if (_root.leftzerodist == 1) {
if (_root.leftTwoBallsHolded != 1) {
trace("Dummy");
} else if (_root.thirdball != targetBall) {
targetBall.speed = 0;
if (_root.leftThreeBallsHolded != 1) {
if (targetBall._x > _root.holdLeft_mc._x) {
targetBall._x = 260.65;
targetBall._y = 332.65;
} else if (targetBall._x < _root.holdLeft_mc._x) {
targetBall._x = 250.1;
targetBall._y = 330.25;
}
}
} else {
targetBall._x = targetBall.x;
targetBall._y = targetBall.y;
targetBall.speed = targetBall.spe;
targetBall.isCollision = false;
}
} else if (_root.rightzerodist == 1) {
if (_root.rightTwoBallsHolded != 1) {
trace("Dummy");
} else if (_root.thirdball != targetBall) {
targetBall.speed = 0;
if (_root.rightThreeBallsHolded != 1) {
if (targetBall._x > _root.holdRight_mc._x) {
targetBall._x = 351.25;
targetBall._y = 330.15;
} else if (targetBall._x < _root.holdRight_mc._x) {
targetBall._x = 340.1;
targetBall._y = 332.25;
}
}
} else {
targetBall._x = targetBall.x;
targetBall._y = targetBall.y;
targetBall.speed = targetBall.spe;
targetBall.isCollision = false;
}
} else {
targetBall._x = targetBall.x;
targetBall._y = targetBall.y;
targetBall.speed = targetBall.spe;
targetBall.isCollision = false;
}
}
if (targetBall.ballFlipped) {
targetBall._y = targetBall._y - 120;
if (targetBall.flipLeftToggled == true) {
_root.flipLeft.gotoAndStop(2);
}
if (targetBall.flipRightToggled == true) {
_root.flipRight.gotoAndStop(2);
}
_root.flipRight.upSegment.active = false;
_root.flipLeft.upSegment.active = false;
targetBall.ballFlipped = false;
} else {
targetBall.flipRightToggled = false;
targetBall.flipLeftToggled = false;
}
if (targetBall.hitTest(_root.rampRight)) {
_root.rampRight.rampR = 1;
_root.rampRight.gotoAndPlay(2);
}
if (targetBall.hitTest(_root.rampLeft)) {
_root.rampLeft.rampL = 1;
_root.rampLeft.gotoAndPlay(2);
}
if (_root.tblockall != true) {
if (targetBall.hitTest(_root.ik_tblock)) {
if (_root.ik_tblock.ik == 0) {
_root.ik_tblock.gotoAndStop(2);
}
}
if (targetBall.hitTest(_root.k_tblock)) {
if (_root.k_tblock.k == 0) {
_root.k_tblock.gotoAndStop(2);
}
}
if (targetBall.hitTest(_root.o_tblock)) {
if (_root.o_tblock.o == 0) {
_root.o_tblock.gotoAndStop(2);
}
}
if (targetBall.hitTest(_root.n_tblock)) {
if (_root.n_tblock.n == 0) {
_root.n_tblock.gotoAndStop(2);
}
}
if (targetBall.hitTest(_root.c_tblock)) {
if (_root.c_tblock.c == 0) {
_root.c_tblock.gotoAndStop(2);
}
}
if (targetBall.hitTest(_root.i_tblock)) {
if (_root.i_tblock.i == 0) {
_root.i_tblock.gotoAndStop(2);
}
}
if (targetBall.hitTest(_root.t_tblock)) {
if (_root.t_tblock.t == 0) {
_root.t_tblock.gotoAndStop(2);
}
}
if (targetBall.hitTest(_root.y_tblock)) {
if (_root.y_tblock.y == 0) {
_root.y_tblock.gotoAndStop(2);
}
}
}
if ((((((((_root.ik_tblock.ik == 1) && (_root.k_tblock.k == 1)) && (_root.o_tblock.o == 1)) && (_root.n_tblock.n == 1)) && (_root.c_tblock.c == 1)) && (_root.i_tblock.i == 1)) && (_root.t_tblock.t == 1)) && (_root.y_tblock.y == 1)) {
_root.tblockall = true;
_root.score = _root.score + 3000;
_root.y_tblock.gotoAndStop(3);
}
if (_root.tblockall == true) {
_root.center_sink.gotoAndStop(2);
_root.raluClip.gotoAndStop(2);
} else {
_root.center_sink.gotoAndStop(1);
_root.raluClip.gotoAndStop(1);
}
if (targetBall._y < _root.topBLine._y) {
j = 1;
while (j <= 3) {
flareValue = "sco" + j;
if (targetBall.hitTest(_root[flareValue])) {
_root[_root[flareValue].clipObj].action();
_root.snd5.sparkObj.start(0, 1);
}
j++;
}
}
if (_root.fin.hitTest(targetBall) && (targetBall.timeToWait == null)) {
targetBall._x = _root.fin._x;
targetBall._y = _root.fin._y;
_root.score = _root.score + 5000;
targetBall.wait(_root.fin.timeWait, _root.fin.angleOut, _root.fin.speedOut, _root[_root.fin.outVortex]._x, _root[_root.fin.outVortex]._y);
if (_root.fin.clipObj != null) {
_root[_root.fin.clipObj].action();
}
} else if (_root.lin.hitTest(targetBall) && (targetBall.timeToWait == null)) {
targetBall._x = _root.lin._x;
targetBall._y = _root.lin._y;
_root.score = _root.score + 7500;
targetBall.wait(_root.lin.timeWait, _root.lin.angleOut, _root.lin.speedOut, _root[_root.lin.outVortex]._x, _root[_root.lin.outVortex]._y);
if (_root.lin.clipObj != null) {
_root[_root.lin.clipObj].action();
}
} else if (_root.kin.hitTest(targetBall) && (targetBall.timeToWait == null)) {
targetBall._x = _root.kin._x;
targetBall._y = _root.kin._y;
_root.score = _root.score + 5000;
targetBall.wait(_root.kin.timeWait, _root.kin.angleOut, _root.kin.speedOut, _root[_root.kin.outVortex]._x, _root[_root.kin.outVortex]._y);
if (_root.kin.clipObj != null) {
_root[_root.kin.clipObj].action();
}
} else if (_root.vin.hitTest(targetBall) && (targetBall.timeToWait == null)) {
targetBall._x = _root.vin._x;
targetBall._y = _root.vin._y;
_root.score = _root.score + 2500;
targetBall.wait(_root.vin.timeWait, _root.vin.angleOut, _root.vin.speedOut, _root[_root.vin.outVortex]._x, _root[_root.vin.outVortex]._y);
if (_root.vin.clipObj != null) {
_root[_root.vin.clipObj].action();
}
} else if ((_root.min.hitTest(targetBall) && (targetBall.timeToWait == null)) && (_root.tblockall == true)) {
_root.mout._x = 298.7;
_root.mout._y = 218.4;
targetBall._x = _root.min._x;
targetBall._y = _root.min._y;
_root.score = _root.score + 10000;
targetBall.wait(_root.min.timeWait, _root.min.angleOut, _root.min.speedOut, _root[_root.min.outVortex]._x, _root[_root.min.outVortex]._y);
if (_root.min.clipObj != null) {
_root[_root.min.clipObj].action();
}
}
}
function multiBalls(name1, name2) {
name1.waitToLaunch = false;
name2.waitToLaunch = false;
name1._x = _root.kout._x;
name1._y = _root.kout._y;
name2._x = _root.fout._x;
name2._y = _root.fout._y;
_root.addBalls = false;
name2.speed = 7;
name1.speed = 7;
}
function mBallsActivated(hitball) {
if (hitball == _level0.ball) {
targetBall = _root.ball;
onceTarget(_root.ball, 1);
targetBall = _root.ball1;
onceTarget(_root.ball1, 2);
targetBall = _root.ball2;
onceTarget(_root.ball2, 3);
} else if (hitball == _level0.ball1) {
targetBall = _root.ball;
onceTarget(_root.ball, 1);
targetBall = _root.ball1;
onceTarget(_root.ball1, 2);
targetBall = _root.ball2;
onceTarget(_root.ball2, 3);
} else if (hitball == _level0.ball2) {
targetBall = _root.ball;
onceTarget(_root.ball, 1);
targetBall = _root.ball1;
onceTarget(_root.ball1, 2);
targetBall = _root.ball2;
onceTarget(_root.ball2, 3);
}
}
function ballHandle() {
if (_root.CenterBall == undefined) {
targetBall = _root.ball;
onceTarget(targetBall, 1);
}
if (ballMax >= 1) {
_root.mBallsActivated(_root.CenterBall);
}
if (_root.Event.countSpaceRelease < 3) {
if (Key.isDown(37)) {
_root.flipLeft.flipsLT();
_root.ball.flipLeftToggled = false;
if (_root.ball1.waitToLaunch) {
_root.ball1.flipLeftToggled = false;
}
if (_root.ball2.waitToLaunch) {
_root.ball2.flipLeftToggled = false;
}
}
if (Key.isDown(37) && (!_root.Event.leftDown)) {
_root.flipLeft.flipUp();
_root.Event.leftDown = true;
}
if (Key.isDown(39)) {
_root.flipRight.flipsRT();
_root.ball.flipRightToggled = false;
if (_root.ball1.waitToLaunch) {
_root.ball1.flipRightToggled = false;
}
if (_root.ball2.waitToLaunch) {
_root.ball2.flipRightToggled = false;
}
}
if (Key.isDown(39) && (!_root.Event.rightDown)) {
_root.flipRight.flipUp();
_root.Event.rightDown = true;
}
if ((!Key.isDown(37)) && (_root.Event.leftDown)) {
_root.flipLeft.flipDown();
_root.Event.leftDown = false;
}
if ((!Key.isDown(39)) && (_root.Event.rightDown)) {
_root.flipRight.flipDown();
_root.Event.rightDown = false;
}
}
if (_root.Event.countSpaceRelease == 3) {
_root.flipLeft.flipDown();
_root.Event.leftDown = false;
_root.flipRight.flipDown();
_root.Event.rightDown = false;
}
if (_root.outClip.hitTest(_root.ball)) {
_root.allFalls = _root.allFalls + 1;
if (_root.bonusHit == 0) {
if (_root.lives >= 0) {
_root["life" + _root.lives]._visible = false;
}
_root.lives--;
_root.adjustMainBall = false;
} else if (_root.bonusHit >= 1) {
_root.bonusHit = _root.bonusHit - 1;
_root.ball._x = _root.bhold._x;
_root.ball._y = _root.bhold._y;
_root.ball.waitToLaunch = true;
_root.adjustMainBall = true;
if (_root.bonusHit == 1) {
_root.bonusHit = 0;
}
if (_root.bonusHit == 0) {
if ((_root.allFalls <= 3) && (_root.ballMax == 1)) {
_root["life" + _root.lives]._visible = false;
_root.lives--;
}
_root.adjustMainBall = false;
}
if (_root.ballMax > 1) {
_root.ballMax = _root.ballMax - 1;
}
} else if ((_root.bonusHit == 0) && (_root.allFalls == 3)) {
_root["life" + _root.lives]._visible = false;
_root.lives--;
_root.adjustMainBall = false;
}
if (_root.adjustMainBall == false) {
if (_root.lives > 0) {
if ((_root.allFalls < 3) && (_root.allFalls > 1)) {
_root.ball._x = _root.bhold._x;
_root.ball._y = _root.bhold._y;
_root.ball.waitToLaunch = true;
_root.adjustMainBall = true;
} else {
_root.ball._x = _root.st0._x;
_root.ball._y = _root.st0._y + 10;
_root.ball.angle = 271;
_root.ball.speed = 5;
_root.ball.waitToLaunch = true;
if (_root.bonusHit != 0) {
_root["life" + _root.lives]._visible = false;
_root.lives--;
}
}
}
}
if (_root.lives == 0) {
_root.messages.gotoAndStop(2);
_root.ball.removeMovieClip();
_root.Event.countSpace = 5;
_root.Event.countSpaceRelease = 5;
_root.gotoAndStop(8);
} else if (_root.lives < 5) {
_root.snd6.lostObj.start(0, 1);
_root.snd9.booObj.start(0, 1);
autoCount = _root.Event.countSpace - _root.Event.countSpaceRelease;
if (_root.Event.countSpace > 2) {
if (autoCount <= 0) {
loopNum = Number(autoCount + 3);
i = 1;
while (i <= loopNum) {
_root.Event.nudgefn(-2);
i++;
}
}
}
if ((autoCount > 0) && (autoCount <= 3)) {
i = 1;
while (i <= autoCount) {
_root.Event.nudgefn(-2);
i++;
}
}
}
_root.Event.countSpace = 0;
_root.Event.countSpaceRelease = 0;
if ((_root.numeral != 0) && (_root.countSecond != 0)) {
_root.countSecond = 0;
_root.numeral = 0;
clearInterval(_root.intervalID);
_root.anca1._x = _root.anca1._x - 60;
_root.anca2._x = _root.anca2._x + 60;
}
if (_root.gamenumeral != 0) {
clearInterval(_root.mc_handler.intervalID1);
_root.anca1._x = _root.anca1._x - 60;
_root.anca2._x = _root.anca2._x + 60;
_root.gamenumeral = 0;
}
_root.tblockall = false;
_root.ik_tblock.gotoAndPlay(3);
_root.k_tblock.gotoAndPlay(3);
_root.o_tblock.gotoAndPlay(3);
_root.n_tblock.gotoAndPlay(3);
_root.c_tblock.gotoAndPlay(3);
_root.i_tblock.gotoAndPlay(3);
_root.t_tblock.gotoAndPlay(3);
_root.y_tblock.gotoAndPlay(4);
}
if ((_root.bonusHit <= 3) && (_root.bonusHit >= 0)) {
if (_root.bonusHit > 1) {
_root.handleCollisions();
}
if (_root.outClip.hitTest(_root.ball1)) {
_root.allFalls = _root.allFalls + 1;
if (_root.bonusHit >= 1) {
_root.bonusHit = _root.bonusHit - 1;
if (_root.bonusHit == 1) {
_root.bonusHit = 0;
}
if (_root.ballMax > 1) {
_root.ballMax = _root.ballMax - 1;
}
_root.snd6.lostObj.start(0, 1);
_root.snd9.booObj.start(0, 1);
if ((_root.bonusHit == 0) && (_root.allFalls == 3)) {
_root["life" + _root.lives]._visible = false;
_root.lives--;
_root.adjustMainBall = false;
if (_root.adjustMainBall == false) {
if (_root.lives > 0) {
_root.ball._x = _root.st0._x;
_root.ball._y = _root.st0._y + 10;
_root.ball.angle = 271;
_root.ball.speed = 5;
_root.ball.waitToLaunch = true;
_root.Event.countSpace = 0;
_root.Event.countSpaceRelease = 0;
}
if (_root.lives == 0) {
_root.messages.gotoAndStop(2);
_root.ball.removeMovieClip();
_root.Event.countSpace = 5;
_root.Event.countSpaceRelease = 5;
_root.gotoAndStop(7);
}
}
}
} else if ((_root.bonusHit == 0) && (_root.allFalls == 3)) {
_root["life" + _root.lives]._visible = false;
_root.lives--;
_root.adjustMainBall = false;
if (_root.adjustMainBall == false) {
if (_root.lives > 0) {
_root.ball._x = _root.st0._x;
_root.ball._y = _root.st0._y + 10;
_root.ball.angle = 271;
_root.ball.speed = 5;
_root.ball.waitToLaunch = true;
_root.Event.countSpace = 0;
_root.Event.countSpaceRelease = 0;
}
if (_root.lives == 0) {
_root.messages.gotoAndStop(2);
_root.ball.removeMovieClip();
_root.Event.countSpace = 5;
_root.Event.countSpaceRelease = 5;
_root.gotoAndStop(7);
}
}
}
_root.ball1._x = _root.b1hold._x;
_root.ball1._y = _root.b1hold._y;
_root.ball1.gotoAndStop(1);
_root.ball1.waitToLaunch = true;
_root.tblockall = false;
_root.ik_tblock.gotoAndPlay(3);
_root.k_tblock.gotoAndPlay(3);
_root.o_tblock.gotoAndPlay(3);
_root.n_tblock.gotoAndPlay(3);
_root.c_tblock.gotoAndPlay(3);
_root.i_tblock.gotoAndPlay(3);
_root.t_tblock.gotoAndPlay(3);
_root.y_tblock.gotoAndPlay(4);
}
if (_root.outClip.hitTest(_root.ball2)) {
_root.allFalls = _root.allFalls + 1;
if (_root.bonusHit >= 1) {
_root.bonusHit = _root.bonusHit - 1;
if (_root.bonusHit == 1) {
_root.bonusHit = 0;
}
if (_root.ballMax > 1) {
_root.ballMax = _root.ballMax - 1;
}
_root.snd6.lostObj.start(0, 1);
_root.snd9.booObj.start(0, 1);
if ((_root.bonusHit == 0) && (_root.allFalls == 3)) {
_root["life" + _root.lives]._visible = false;
_root.lives--;
_root.adjustMainBall = false;
if (_root.adjustMainBall == false) {
if (_root.lives > 0) {
_root.ball._x = _root.st0._x;
_root.ball._y = _root.st0._y + 10;
_root.ball.angle = 271;
_root.ball.speed = 5;
_root.ball.waitToLaunch = true;
_root.Event.countSpace = 0;
_root.Event.countSpaceRelease = 0;
}
if (_root.lives == 0) {
_root.messages.gotoAndStop(2);
_root.ball.removeMovieClip();
_root.Event.countSpace = 5;
_root.Event.countSpaceRelease = 5;
_root.gotoAndStop(7);
}
}
}
} else if ((_root.bonusHit == 0) && (_root.allFalls == 3)) {
_root["life" + _root.lives]._visible = false;
_root.lives--;
_root.adjustMainBall = false;
if (_root.adjustMainBall == false) {
if (_root.lives > 0) {
_root.ball._x = _root.st0._x;
_root.ball._y = _root.st0._y + 10;
_root.ball.angle = 271;
_root.ball.speed = 5;
_root.ball.waitToLaunch = true;
_root.Event.countSpace = 0;
_root.Event.countSpaceRelease = 0;
}
if (_root.lives == 0) {
_root.messages.gotoAndStop(2);
_root.ball.removeMovieClip();
_root.Event.countSpace = 5;
_root.Event.countSpaceRelease = 5;
_root.gotoAndStop(7);
}
}
}
_root.ball2._x = _root.b2hold._x;
_root.ball2._y = _root.b2hold._y;
_root.ball2.gotoAndStop(1);
_root.ball2.waitToLaunch = true;
_root.tblockall = false;
_root.ik_tblock.gotoAndPlay(3);
_root.k_tblock.gotoAndPlay(3);
_root.o_tblock.gotoAndPlay(3);
_root.n_tblock.gotoAndPlay(3);
_root.c_tblock.gotoAndPlay(3);
_root.i_tblock.gotoAndPlay(3);
_root.t_tblock.gotoAndPlay(3);
_root.y_tblock.gotoAndPlay(4);
}
}
}
clearInterval(mainintervalID);
mainintervalID = setInterval(ballHandle, 35);
function leftTargetPos() {
if (_root.thirdball._x > 260.65) {
_root.thirdball._x = 268;
_root.thirdball._y = 329.65;
} else if (_root.thirdball._x < 250.1) {
_root.thirdball._x = 245.8;
_root.thirdball._y = 325.25;
}
_root.thirdball = "";
_root.leftThreeBallsHolded = 1;
}
function rightTargetPos() {
if (_root.thirdball._x > 351.25) {
_root.thirdball._x = 355.55;
_root.thirdball._y = 325.15;
} else if (_root.thirdball._x < 340.1) {
_root.thirdball._x = 334.8;
_root.thirdball._y = 330;
}
_root.thirdball = "";
_root.rightThreeBallsHolded = 1;
}
bounce = -0.9;
grav = 0;
b = [ball, ball1, ball2];
handleCollisions = function () {
i = 0;
while (i < (b.length - 1)) {
j = i + 1;
while (j < b.length) {
var _local3 = b[i];
var _local2 = b[j];
var _local10 = _local2._x - _local3._x;
var _local9 = _local2._y - _local3._y;
var _local12 = (_local10 * _local10) + (_local9 * _local9);
var _local8 = ((grav * _local3.m) * _local2.m) / _local12;
var _local4 = Math.atan2(_local9, _local10);
b1_vx = b1_vx + ((Math.cos(_local4) * _local8) / _local3.m);
b1_vy = b1_vy + ((Math.sin(_local4) * _local8) / _local3.m);
b2_vx = b2_vx - ((Math.cos(_local4) * _local8) / _local2.m);
b2_vy = b2_vy - ((Math.sin(_local4) * _local8) / _local2.m);
var _local14 = Math.sqrt(_local12);
if (_local14 < (_local3.ballRadius + _local2.ballRadius)) {
cosa = Math.cos(_local4);
sina = Math.sin(_local4);
var _local5 = (b1_vx * cosa) + (b1_vy * sina);
var _local13 = (b1_vy * cosa) - (b1_vx * sina);
var _local6 = (b2_vx * cosa) + (b2_vy * sina);
var _local11 = (b2_vy * cosa) - (b2_vx * sina);
var _local16 = (_local5 * _local3.m) + (_local6 * _local2.m);
var _local15 = _local5 - _local6;
_local5 = (_local16 - (_local2.m * _local15)) / (_local3.m + _local2.m);
_local6 = _local15 + _local5;
b1_vx = ((_local5 * cosa) - (_local13 * sina)) * (-bounce);
b1_vy = ((_local13 * cosa) + (_local5 * sina)) * (-bounce);
b2_vx = ((_local6 * cosa) - (_local11 * sina)) * (-bounce);
b2_vy = ((_local11 * cosa) + (_local6 * sina)) * (-bounce);
var _local7 = (_local3.ballRadius + _local2.ballRadius) - _local14;
if (_root.leftHolded == 1) {
if (i == 0) {
if (((_root.holdLeftTargetIs == _level0.ball) && (_root.leftzerodist != 1)) && (_root.leftThreeBallsHolded != 1)) {
if (j == 1) {
_root.thirdball = _level0.ball2;
} else if (j == 2) {
_root.thirdball = _level0.ball1;
}
_root.leftTwoBallsHolded = 1;
_root.leftzerodist = 1;
} else if (j == 1) {
if (((_root.holdLeftTargetIs == _level0.ball1) && (_root.leftzerodist != 1)) && (_root.leftThreeBallsHolded != 1)) {
_root.thirdball = _level0.ball2;
_root.leftTwoBallsHolded = 1;
_root.leftzerodist = 1;
} else if ((_root.holdLeftTargetIs == _level0.ball) && (_root.leftzerodist == 1)) {
if (_root.thirdball == _level0.ball1) {
trace("MGPl");
_root.thirdball = "";
_root.leftThreeBallsHolded = 1;
}
} else if ((_root.holdLeftTargetIs == _level0.ball2) && (_root.leftzerodist == 1)) {
if (_root.thirdball == _level0.ball) {
_root.leftTargetPos();
trace("GPMr");
} else if (_root.thirdball == _level0.ball1) {
_root.leftTargetPos();
trace("GMPr");
}
} else if ((_root.holdLeftTargetIs == _level0.ball1) && (_root.leftzerodist == 1)) {
if (_root.thirdball == _level0.ball) {
trace("PGMl");
_root.thirdball = "";
_root.leftThreeBallsHolded = 1;
}
}
} else if (j == 2) {
if (((_root.holdLeftTargetIs == _level0.ball2) && (_root.leftzerodist != 1)) && (_root.leftThreeBallsHolded != 1)) {
trace("success when green ball is holded");
_root.thirdball = _level0.ball1;
_root.leftTwoBallsHolded = 1;
_root.leftzerodist = 1;
} else if ((_root.holdLeftTargetIs == _level0.ball) && (_root.leftzerodist == 1)) {
if (_root.thirdball == _level0.ball2) {
trace("MPGl");
_root.thirdball = "";
_root.leftThreeBallsHolded = 1;
}
} else if ((_root.holdLeftTargetIs == _level0.ball2) && (_root.leftzerodist == 1)) {
if (_root.thirdball == _level0.ball) {
trace("GPMl");
_root.thirdball = "";
_root.leftThreeBallsHolded = 1;
}
} else if ((_root.holdLeftTargetIs == _level0.ball1) && (_root.leftzerodist == 1)) {
if (_root.thirdball == _level0.ball) {
trace("PGMr");
_root.leftTargetPos();
} else if (_root.thirdball == _level0.ball2) {
trace("PMGr");
_root.leftTargetPos();
}
}
}
}
if (i == 1) {
if (j == 2) {
if (_root.leftThreeBallsHolded != 1) {
if ((_root.holdLeftTargetIs == _level0.ball1) && (_root.leftzerodist != 1)) {
_root.thirdball = _level0.ball;
_root.leftTwoBallsHolded = 1;
_root.leftzerodist = 1;
} else if ((_root.holdLeftTargetIs == _level0.ball2) && (_root.leftzerodist != 1)) {
_root.thirdball = _level0.ball;
_root.leftTwoBallsHolded = 1;
_root.leftzerodist = 1;
} else if ((_root.holdLeftTargetIs == _level0.ball2) && (_root.leftzerodist == 1)) {
if (_root.thirdball == _level0.ball1) {
trace("GMPl");
_root.thirdball = "";
_root.leftThreeBallsHolded = 1;
}
} else if ((_root.holdLeftTargetIs == _level0.ball1) && (_root.leftzerodist == 1)) {
if (_root.thirdball == _level0.ball2) {
trace("PMGl");
_root.thirdball = "";
_root.leftThreeBallsHolded = 1;
}
} else if ((_root.holdLeftTargetIs == _level0.ball) && (_root.leftzerodist == 1)) {
if (_root.thirdball == _level0.ball1) {
trace("MGPr");
_root.leftTargetPos();
} else if (_root.thirdball == _level0.ball2) {
trace("MPGr");
_root.leftTargetPos();
}
}
}
}
}
}
if (_root.rightHolded == 1) {
if (i == 0) {
if (((_root.holdRightTargetIs == _level0.ball) && (_root.rightzerodist != 1)) && (_root.rightThreeBallsHolded != 1)) {
trace("success when metal ball is holded");
if (j == 1) {
_root.thirdball = _level0.ball2;
} else if (j == 2) {
_root.thirdball = _level0.ball1;
}
_root.rightTwoBallsHolded = 1;
_root.rightzerodist = 1;
} else if (j == 1) {
if (((_root.holdRightTargetIs == _level0.ball1) && (_root.rightzerodist != 1)) && (_root.rightThreeBallsHolded != 1)) {
_root.thirdball = _level0.ball2;
_root.rightTwoBallsHolded = 1;
_root.rightzerodist = 1;
} else if ((_root.holdRightTargetIs == _level0.ball) && (_root.rightzerodist == 1)) {
if (_root.thirdball == _level0.ball1) {
trace("MGPl");
_root.thirdball = "";
_root.rightThreeBallsHolded = 1;
}
} else if ((_root.holdRightTargetIs == _level0.ball2) && (_root.rightzerodist == 1)) {
if (_root.thirdball == _level0.ball) {
_root.rightTargetPos();
trace("GPMr");
} else if (_root.thirdball == _level0.ball1) {
_root.rightTargetPos();
trace("GMPr");
}
} else if ((_root.holdRightTargetIs == _level0.ball1) && (_root.rightzerodist == 1)) {
if (_root.thirdball == _level0.ball) {
trace("PGMl");
_root.thirdball = "";
_root.rightThreeBallsHolded = 1;
}
}
} else if (j == 2) {
if (((_root.holdRightTargetIs == _level0.ball2) && (_root.rightzerodist != 1)) && (_root.rightThreeBallsHolded != 1)) {
trace("success when green ball is holded");
_root.thirdball = _level0.ball1;
_root.rightTwoBallsHolded = 1;
_root.rightzerodist = 1;
} else if ((_root.holdRightTargetIs == _level0.ball) && (_root.rightzerodist == 1)) {
if (_root.thirdball == _level0.ball2) {
trace("MPGl");
_root.thirdball = "";
_root.rightThreeBallsHolded = 1;
}
} else if ((_root.holdRightTargetIs == _level0.ball2) && (_root.rightzerodist == 1)) {
if (_root.thirdball == _level0.ball) {
trace("GPMl");
_root.thirdball = "";
_root.rightThreeBallsHolded = 1;
}
} else if ((_root.holdRightTargetIs == _level0.ball1) && (_root.rightzerodist == 1)) {
if (_root.thirdball == _level0.ball) {
trace("PGMr");
_root.rightTargetPos();
} else if (_root.thirdball == _level0.ball2) {
trace("PMGr");
_root.rightTargetPos();
}
}
}
}
if (i == 1) {
if (j == 2) {
if (_root.rightThreeBallsHolded != 1) {
if ((_root.holdRightTargetIs == _level0.ball1) && (_root.rightzerodist != 1)) {
_root.thirdball = _level0.ball;
_root.rightTwoBallsHolded = 1;
_root.rightzerodist = 1;
} else if ((_root.holdRightTargetIs == _level0.ball2) && (_root.rightzerodist != 1)) {
_root.thirdball = _level0.ball;
_root.rightTwoBallsHolded = 1;
_root.rightzerodist = 1;
} else if ((_root.holdRightTargetIs == _level0.ball2) && (_root.rightzerodist == 1)) {
if (_root.thirdball == _level0.ball1) {
trace("GMPl");
_root.thirdball = "";
_root.rightThreeBallsHolded = 1;
}
} else if ((_root.holdRightTargetIs == _level0.ball1) && (_root.rightzerodist == 1)) {
if (_root.thirdball == _level0.ball2) {
trace("PMGl");
_root.thirdball = "";
_root.rightThreeBallsHolded = 1;
}
} else if ((_root.holdRightTargetIs == _level0.ball) && (_root.rightzerodist == 1)) {
if (_root.thirdball == _level0.ball1) {
trace("MGPr");
_root.rightTargetPos();
} else if (_root.thirdball == _level0.ball2) {
trace("MPGr");
_root.rightTargetPos();
}
}
}
}
}
}
if ((((_root.leftHolded != 1) && (_root.rightHolded != 1)) && (_local3._y <= _root.brBLine._y)) && (_local2._y <= _root.brBLine._y)) {
trace(_root.brBLine._y);
trace(_local2._y);
trace(_local3._y);
trace("collided");
_local3._x = _local3._x - ((Math.cos(_local4) * _local7) / 2);
_local3._y = _local3._y - ((Math.sin(_local4) * _local7) / 2);
_local2._x = _local2._x + ((Math.cos(_local4) * _local7) / 2);
_local2._y = _local2._y + ((Math.sin(_local4) * _local7) / 2);
}
}
j++;
}
i++;
}
};
stop();
Instance of Symbol 430 MovieClip "ball" in Frame 7
onClipEvent (load) {
waitToLaunch = true;
_x = _root.st0._x;
_y = (_root.st0._y + 10);
angle = 271;
speed = 5;
}
Instance of Symbol 434 MovieClip "ball1" in Frame 7
onClipEvent (load) {
waittolaunch = true;
angle = 271;
speed = 5;
}
Instance of Symbol 435 MovieClip "ball2" in Frame 7
onClipEvent (load) {
waittolaunch = true;
angle = 271;
speed = 5;
}
Instance of Symbol 438 MovieClip in Frame 7
onClipEvent (load) {
prevScore = 0;
}
Frame 8
stop();
Symbol 20 MovieClip Frame 1
musicObj = new Sound(this);
musicObj.attachSound("bgmusic");
Symbol 21 MovieClip Frame 1
correctObj = new Sound(this);
correctObj.attachSound("startball1");
Symbol 22 MovieClip Frame 1
wrongObj = new Sound(this);
wrongObj.attachSound("paddle1");
Symbol 23 MovieClip Frame 1
bouncerObj = new Sound(this);
bouncerObj.attachSound("ballObstacole1");
Symbol 24 MovieClip Frame 1
sparkObj = new Sound(this);
sparkObj.attachSound("point1");
Symbol 25 MovieClip Frame 1
lostObj = new Sound(this);
lostObj.attachSound("out1");
Symbol 26 MovieClip Frame 1
flipObj = new Sound(this);
flipObj.attachSound("flip1");
Symbol 27 MovieClip Frame 1
tblockObj = new Sound(this);
tblockObj.attachSound("tblocker1");
Symbol 28 MovieClip Frame 1
booObj = new Sound(this);
booObj.attachSound("boo1");
Symbol 29 MovieClip Frame 1
spinObj = new Sound(this);
spinObj.attachSound("spin1");
Symbol 30 MovieClip Frame 1
padObj = new Sound(this);
padObj.attachSound("pad1");
Symbol 31 MovieClip Frame 1
singleObj = new Sound(this);
singleObj.attachSound("single");
Symbol 32 MovieClip Frame 1
doubleObj = new Sound(this);
doubleObj.attachSound("double");
Symbol 33 MovieClip Frame 1
tripleObj = new Sound(this);
tripleObj.attachSound("triple");
Symbol 34 MovieClip Frame 1
centerObj = new Sound(this);
centerObj.attachSound("center");
Symbol 52 MovieClip Frame 1
stop();
Symbol 53 MovieClip Frame 1
stop();
LoaderBlk.useHandCursor = false;
Instance of Symbol 52 MovieClip in Symbol 53 MovieClip Frame 1
onClipEvent (load) {
total = _parent._parent.getBytesTotal();
}
onClipEvent (enterFrame) {
loaded = _parent._parent.getBytesLoaded();
percent = int((loaded / total) * 100);
gotoAndStop(percent);
perText = percent + "%";
if (percent >= 100) {
_parent.gotoAndStop(2);
}
}
Symbol 53 MovieClip Frame 2
stop();
_parent.gotoAndStop(2);
Symbol 73 Button
on (release) {
gotoAndPlay ("start");
}
Symbol 77 Button
on (release) {
getURL ("http://www.ikoncity.com", "_blank");
}
Symbol 117 MovieClip Frame 1
stop();
Symbol 145 MovieClip Frame 1
stop();
rampR = 0;
Symbol 145 MovieClip Frame 2
if (rampR == 1) {
_root.score = _root.score + 1500;
}
_root.snd10.spinObj.start(0, 1);
Symbol 145 MovieClip Frame 3
rampR = 0;
Symbol 164 MovieClip Frame 1
stop();
rampL = 0;
Symbol 164 MovieClip Frame 2
if (rampL == 1) {
_root.score = _root.score + 1500;
}
_root.snd10.spinObj.start(0, 1);
Symbol 164 MovieClip Frame 3
rampL = 0;
Symbol 177 MovieClip Frame 1
stop();
Symbol 192 MovieClip Frame 1
stop();
Instance of Symbol 192 MovieClip "skin" in Symbol 193 MovieClip Frame 1
onClipEvent (load) {
this.gotoAndStop(2);
}
Symbol 204 Button
on (press) {
startDrag (this, true, left_M, top_M, right_M, bottom_M);
}
on (release, releaseOutside) {
setvol1();
stopDrag();
}
Symbol 206 Button
on (press) {
startDrag (this, false, left_j, top_j, right_j, bottom_j);
}
on (release, releaseOutside) {
setVol();
stopDrag();
}
Symbol 208 MovieClip Frame 1
stop();
Instance of Symbol 205 MovieClip "slidemusic" in Symbol 208 MovieClip Frame 1
onClipEvent (load) {
function setvol1() {
_root.count = 1;
_root.snd1.musicObj.setVolume(_x - left_M);
}
right_M = _x + 100;
top_M = _y;
bottom_M = _y;
left_M = _x;
if (_root.count == 0) {
_x = (_x + 100);
} else {
_x = _root.slidemusic_X;
}
}
Instance of Symbol 207 MovieClip "slidesound" in Symbol 208 MovieClip Frame 1
onClipEvent (load) {
function setVol() {
_root.countsound = 1;
_root.snd2.correctObj.setVolume(_x - left_j);
_root.snd3.wrongObj.setVolume(_x - left_j);
_root.snd4.bouncerObj.setVolume(_x - left_j);
_root.snd5.sparkObj.setVolume(_x - left_j);
_root.snd6.lostObj.setVolume(_x - left_j);
_root.snd7.flipObj.setVolume(_x - left_j);
_root.snd8.tblockObj.setVolume(_x - left_j);
_root.snd9.booObj.setVolume(_x - left_j);
_root.snd10.spinObj.setVolume(_x - left_j);
_root.snd11.padObj.setVolume(_x - left_j);
_root.snd12.singleObj.setVolume(_x - left_j);
_root.snd13.doubleObj.setVolume(_x - left_j);
_root.snd14.tripleObj.setVolume(_x - left_j);
_root.snd15.centerObj.setVolume(_x - left_j);
}
top_j = _y;
bottom_j = _y;
left_j = _x;
right_j = _x + 100;
if (_root.countsound == 0) {
_x = (_x + 100);
} else {
_x = _root.slidesound_X;
}
}
Symbol 214 Button
on (release) {
_root.mc_scorebrd.skin.gotoAndStop(1);
soundset = _root.controls.slidesound._x - _root.controls.slidesound.left_j;
musicset = _root.controls.slidemusic._x - _root.controls.slidemusic.left_M;
_root.snd1.musicObj.setVolume(0);
_root.snd2.correctObj.setVolume(0);
_root.snd3.wrongObj.setVolume(0);
_root.snd4.bouncerObj.setVolume(0);
_root.snd5.sparkObj.setVolume(0);
_root.snd6.lostObj.setVolume(0);
_root.snd7.flipObj.setVolume(0);
_root.snd8.tblockObj.setVolume(0);
_root.snd9.booObj.setVolume(0);
_root.snd10.spinObj.setVolume(0);
_root.snd11.padObj.setVolume(0);
_root.snd12.singleObj.setVolume(0);
_root.snd13.doubleObj.setVolume(0);
_root.snd14.tripleObj.setVolume(0);
_root.snd15.centerObj.setVolume(0);
gotoAndStop (2);
}
Symbol 217 Button
on (release) {
_root.mc_scorebrd.skin.gotoAndStop(2);
_root.snd1.musicObj.setVolume(musicset);
_root.snd2.correctObj.setVolume(soundset);
_root.snd3.wrongObj.setVolume(soundset);
_root.snd4.bouncerObj.setVolume(soundset);
_root.snd5.sparkObj.setVolume(soundset);
_root.snd6.lostObj.setVolume(soundset);
_root.snd7.flipObj.setVolume(soundset);
_root.snd8.tblockObj.setVolume(soundset);
_root.snd9.booObj.setVolume(soundset);
_root.snd10.spinObj.setVolume(soundset);
_root.snd11.padObj.setVolume(soundset);
_root.snd12.singleObj.setVolume(soundset);
_root.snd13.doubleObj.setVolume(soundset);
_root.snd14.tripleObj.setVolume(soundset);
_root.snd15.centerObj.setVolume(soundset);
gotoAndStop (1);
}
Symbol 220 MovieClip Frame 1
stop();
Symbol 220 MovieClip Frame 2
stop();
bt_restrict.useHandCursor = false;
Symbol 226 MovieClip Frame 1
stop();
Symbol 226 MovieClip Frame 2
stop();
Symbol 229 MovieClip Frame 1
stop();
Symbol 236 MovieClip Frame 1
stop();
ik = 0;
Symbol 236 MovieClip Frame 2
ik = 1;
_root.snd5.sparkObj.start(0, 1);
score = 750;
_root.score = _root.score + score;
Symbol 239 MovieClip Frame 1
stop();
k = 0;
Symbol 239 MovieClip Frame 2
k = 1;
_root.snd5.sparkObj.start(0, 1);
score = 750;
_root.score = _root.score + score;
Symbol 242 MovieClip Frame 1
stop();
o = 0;
Symbol 242 MovieClip Frame 2
stop();
o = 1;
_root.snd5.sparkObj.start(0, 1);
score = 750;
_root.score = _root.score + score;
Symbol 245 MovieClip Frame 1
stop();
n = 0;
Symbol 245 MovieClip Frame 2
stop();
n = 1;
_root.snd5.sparkObj.start(0, 1);
score = 750;
_root.score = _root.score + score;
Symbol 248 MovieClip Frame 1
stop();
c = 0;
Symbol 248 MovieClip Frame 2
stop();
c = 1;
_root.snd5.sparkObj.start(0, 1);
score = 750;
_root.score = _root.score + score;
Symbol 249 MovieClip Frame 1
stop();
i = 0;
Symbol 249 MovieClip Frame 2
stop();
i = 1;
_root.snd5.sparkObj.start(0, 1);
score = 750;
_root.score = _root.score + score;
Symbol 252 MovieClip Frame 1
stop();
t = 0;
Symbol 252 MovieClip Frame 2
stop();
t = 1;
_root.snd5.sparkObj.start(0, 1);
score = 750;
_root.score = _root.score + score;
Symbol 255 MovieClip Frame 1
stop();
y = 0;
Symbol 255 MovieClip Frame 2
stop();
y = 1;
_root.snd5.sparkObj.start(0, 1);
score = 750;
_root.score = _root.score + score;
Symbol 255 MovieClip Frame 3
stop();
y = 2;
Symbol 260 MovieClip Frame 1
function action() {
_root.score = _root.score + score;
gotoAndPlay (2);
}
score = 500;
deltaSpeed = 5 + random(3);
stop();
Symbol 260 MovieClip Frame 2
_root.snd3.wrongObj.start(0, 1);
Symbol 260 MovieClip Frame 7
gotoAndStop (1);
Symbol 265 MovieClip Frame 1
function action() {
_root.score = _root.score + score;
gotoAndPlay (2);
}
deltaSpeed = 5 + random(3);
score = 500;
stop();
Symbol 265 MovieClip Frame 2
_root.snd3.wrongObj.start(0, 1);
Symbol 265 MovieClip Frame 7
gotoAndStop (1);
Symbol 328 MovieClip Frame 1
Symbol 332 MovieClip Frame 1
stop();
Symbol 334 MovieClip Frame 1
Symbol 337 MovieClip Frame 1
stop();
Symbol 337 MovieClip Frame 2
stop();
Symbol 344 MovieClip Frame 1
directions = new Array();
directions = _name.split("-");
nextStep = directions[1];
_name = directions[0];
angleMin = Number(directions[2]);
angleMax = Number(directions[3]);
speedMin = Number(directions[4]);
speedInc = Number(directions[5]);
angleOut = Number(directions[6]);
speedOut = Number(directions[7]);
score = Number(directions[8]);
stop();
Symbol 346 MovieClip Frame 1
stop();
directions = new Array();
directions = _name.split("-");
outVortex = directions[1];
_name = directions[0];
timeWait = Number(directions[2]);
angleOut = Number(directions[3]);
speedOut = Number(directions[4]);
clipObj = directions[5];
stop();
Symbol 347 MovieClip Frame 1
stop();
directions = new Array();
directions = _name.split("-");
outVortex = directions[1];
_name = directions[0];
timeWait = Number(directions[2]);
angleOut = Number(directions[3]);
speedOut = Number(directions[4]);
clipObj = directions[5];
stop();
Symbol 348 MovieClip Frame 1
stop();
directions = new Array();
directions = _name.split("-");
outVortex = directions[1];
_name = directions[0];
timeWait = Number(directions[2]);
angleOut = Number(directions[3]);
speedOut = Number(directions[4]);
clipObj = directions[5];
stop();
Symbol 349 MovieClip Frame 1
stop();
directions = new Array();
directions = _name.split("-");
outVortex = directions[1];
_name = directions[0];
timeWait = Number(directions[2]);
angleOut = Number(directions[3]);
speedOut = Number(directions[4]);
clipObj = directions[5];
stop();
Symbol 351 MovieClip Frame 1
directions = new Array();
directions = _name.split("-");
nextStep = directions[1];
_name = directions[0];
if (nextStep == "wait") {
angle_wait = directions[2];
speed_wait = directions[3];
}
Symbol 351 MovieClip Frame 2
stop();
Symbol 353 MovieClip Frame 1
function distancePoint(point) {
var _local2 = Math.sqrt(((_x - point.x) * (_x - point.x)) + ((_y - point.y) * (_y - point.y)));
return(_local2);
}
function distanceDirection(a, b, c) {
var _local1 = Math.sqrt((a * a) + (b * b));
var _local4 = (((a * _x) + (b * _y)) + c) / _local1;
return(_local4);
}
function isPossibleTarget(myBall) {
if (((this._width / 2) + (myBall._width / 2)) < Math.abs(distanceDirection(myBall.a, myBall.b, myBall.c))) {
return(false);
}
if (Math.abs(Math.sqrt(((_x - myBall._x) * (_x - myBall._x)) + ((_y - myBall._y) * (_y - myBall._y)))) < Math.abs(Math.sqrt(((_x - myBall.x) * (_x - myBall.x)) + ((_y - myBall.y) * (_y - myBall.y))))) {
return(false);
}
return(true);
}
parameters = new Array();
parameters = _name.split("-");
_name = parameters[0];
deltaSpeed = Number(parameters[1]);
if ((parameters[2] != null) && (parameters[2] != "")) {
clipObj = _root[parameters[2]];
} else {
clipObj = null;
}
_root.allBalls.push(this);
_root.allBalls1.push(this);
_root.allBalls2.push(this);
stop();
Symbol 355 MovieClip Frame 1
stop();
directions = new Array();
directions = _name.split("-");
outVortex = directions[1];
_name = directions[0];
timeWait = Number(directions[2]);
angleOut = Number(directions[3]);
speedOut = Number(directions[4]);
clipObj = directions[5];
Symbol 357 MovieClip Frame 1
stop();
param = new Array();
param = _name.split("-");
_name = param[0];
clipObj = param[1];
Symbol 369 MovieClip Frame 1
function action() {
_root.score = _root.score + score;
gotoAndPlay (2);
}
score = 250;
stop();
Symbol 369 MovieClip Frame 2
_root.snd4.bouncerObj.start(0, 1);
Symbol 369 MovieClip Frame 10
gotoAndStop (1);
Symbol 372 MovieClip Frame 1
function action() {
if (_currentframe == 1) {
gotoAndPlay (2);
}
}
stop();
Symbol 372 MovieClip Frame 2
_root.snd5.sparkObj.start(0, 1);
Symbol 372 MovieClip Frame 14
gotoAndStop (1);
Symbol 376 MovieClip Frame 1
function flipUp() {
upSegment.active = true;
downSegment.active = false;
_root.ball.flipRightToggled = true;
_root.ball1.flipRightToggled = true;
_root.ball2.flipRightToggled = true;
}
function flipsRT() {
upSegment.active = true;
downSegment.active = false;
gotoAndStop (2);
}
function flipDown() {
upSegment.active = false;
downSegment.active = true;
_root.rightHolded = 0;
_root.rightzerodist = 0;
_root.rightTwoBallsHolded = 0;
_root.rightThreeBallsHolded = 0;
_root.holdRightTargetIs = "";
gotoAndStop (1);
}
function distanceTo(myBall) {
var _local2 = Math.sqrt(((centreX - myBall.x) * (centreX - myBall.x)) + ((centreY - myBall.y) * (centreY - myBall.y)));
return(_local2);
}
function inRange(ballName) {
var _local1 = ballName;
var _local2 = distanceTo(_local1);
if (upSegment.module < (_local2 - (_local1._width / 2))) {
return(false);
}
if (((_local1._y < centreY) && (centreY < _local1.y)) && (centreX >= _local1.x)) {
trace("YES");
return(true);
}
var _local5 = Math.sqrt(Math.abs((_local2 * _local2) - (((_local1._width / 2) * _local1._width) / 2)));
var _local3 = (_local2 - _local5) / _local5;
var _local6 = (_local1.x + (_local3 * centreX)) / (1 + _local3);
var _local4 = (_local1.y + (_local3 * centreY)) / (1 + _local3);
var _local7 = (_local1._width / 2) / _local2;
var _local8 = Math.sqrt((_local2 * _local2) - (((_local1._width / 2) * _local1._width) / 2)) / _local2;
x2 = (centreX + ((_local6 - centreX) * _local8)) + ((_local4 - centreY) * _local7);
y2 = (centreY + ((_local4 - centreY) * _local8)) - ((_local6 - centreX) * _local7);
if (centreY >= _local1.y) {
if (Math.abs((y2 - centreY) / (x2 - centreX)) >= Math.abs((upSegment.y2 - centreY) / (upSegment.x2 - centreX))) {
return(false);
}
}
if (_local1.y >= centreY) {
if (Math.abs((centreY - _local1._y) / (_local1._x - centreX)) >= Math.abs((centreY - downSegment.y2) / (downSegment.x2 - centreX))) {
return(false);
}
}
return(true);
}
stop();
Symbol 376 MovieClip Frame 2
stop();
_root.snd11.padObj.start(0, 1);
Symbol 380 MovieClip Frame 1
function flipUp() {
upSegment.active = true;
downSegment.active = false;
_root.ball.flipLeftToggled = true;
_root.ball1.flipLeftToggled = true;
_root.ball2.flipLeftToggled = true;
}
function flipsLT() {
upSegment.active = true;
downSegment.active = false;
gotoAndStop (2);
}
function flipDown() {
upSegment.active = false;
downSegment.active = true;
_root.leftHolded = 0;
_root.leftzerodist = 0;
_root.leftTwoBallsHolded = 0;
_root.leftThreeBallsHolded = 0;
_root.holdLeftTargetIs = "";
gotoAndStop (1);
}
function distanceTo(myBall) {
var _local2 = Math.sqrt(((centreX - myBall.x) * (centreX - myBall.x)) + ((centreY - myBall.y) * (centreY - myBall.y)));
return(_local2);
}
function inRange(ballName) {
var _local1 = ballName;
var _local2 = distanceTo(_local1);
if (upSegment.module < (_local2 - (_local1._width / 2))) {
return(false);
}
if (((_local1._y < centreY) && (centreY < _local1.y)) && (centreX < _local1.x)) {
return(true);
}
var _local5 = Math.sqrt(Math.abs((_local2 * _local2) - (((_local1._width / 2) * _local1._width) / 2)));
var _local3 = (_local2 - _local5) / _local5;
var _local6 = (_local1.x + (_local3 * centreX)) / (1 + _local3);
var _local4 = (_local1.y + (_local3 * centreY)) / (1 + _local3);
var _local7 = (_local1._width / 2) / _local2;
var _local8 = Math.sqrt((_local2 * _local2) - (((_local1._width / 2) * _local1._width) / 2)) / _local2;
x2 = (centreX + ((_local6 - centreX) * _local8)) - ((_local4 - centreY) * _local7);
y2 = (centreY + ((_local4 - centreY) * _local8)) + ((_local6 - centreX) * _local7);
if (centreY >= y2) {
if (Math.abs((y2 - centreY) / (x2 - centreX)) >= Math.abs((upSegment.y2 - centreY) / (upSegment.x2 - centreX))) {
return(false);
}
}
if (y2 >= centreY) {
if (Math.abs((centreY - _local1._y) / (_local1._x - centreX)) >= Math.abs((centreY - downSegment.y2) / (downSegment.x2 - centreX))) {
return(false);
}
}
return(true);
}
stop();
Symbol 380 MovieClip Frame 2
stop();
_root.snd11.padObj.start(0, 1);
Symbol 386 MovieClip Frame 1
function action() {
deltaSpeed = 0;
if (_root.flipRight.upSegment.active == true) {
if (((_root.holdRightTarget == _level0.ball) && (_root.holdRightTargetIs != _level0.ball1)) && (_root.holdRightTargetIs != _level0.ball2)) {
_root.ball._x = _x;
_root.ball._y = _y;
_root.ball.speed = 0;
_root.rightHolded = 1;
_root.holdRightTargetIs = _level0.ball;
} else if (((_root.holdRightTarget == _level0.ball1) && (_root.holdRightTargetIs != _level0.ball)) && (_root.holdRightTargetIs != _level0.ball2)) {
_root.ball1._x = _x;
_root.ball1._y = _y;
_root.ball1.speed = 0;
_root.rightHolded = 1;
_root.holdRightTargetIs = _level0.ball1;
} else if (((_root.holdRightTarget == _level0.ball2) && (_root.holdRightTargetIs != _level0.ball1)) && (_root.holdRightTargetIs != _level0.ball)) {
_root.ball2._x = _x;
_root.ball2._y = _y;
_root.ball2.speed = 0;
_root.rightHolded = 1;
_root.holdRightTargetIs = _level0.ball2;
}
}
}
stop();
Symbol 387 MovieClip Frame 1
function action() {
deltaSpeed = 0;
if (_root.flipLeft.upSegment.active == true) {
if (((_root.holdLeftTarget == _level0.ball) && (_root.holdLeftTargetIs != _level0.ball1)) && (_root.holdLeftTargetIs != _level0.ball2)) {
_root.ball._x = _x;
_root.ball._y = _y;
_root.ball.speed = 0;
_root.leftHolded = 1;
_root.holdLeftTargetIs = _level0.ball;
} else if (((_root.holdLeftTarget == _level0.ball1) && (_root.holdLeftTargetIs != _level0.ball)) && (_root.holdLeftTargetIs != _level0.ball2)) {
_root.ball1._x = _x;
_root.ball1._y = _y;
_root.ball1.speed = 0;
_root.leftHolded = 1;
_root.holdLeftTargetIs = _level0.ball1;
} else if (((_root.holdLeftTarget == _level0.ball2) && (_root.holdLeftTargetIs != _level0.ball)) && (_root.holdLeftTargetIs != _level0.ball1)) {
_root.ball2._x = _x;
_root.ball2._y = _y;
_root.ball2.speed = 0;
_root.leftHolded = 1;
_root.holdLeftTargetIs = _level0.ball2;
}
}
}
stop();
Symbol 401 MovieClip Frame 1
function inc() {
if (_currentframe != 43) {
gotoAndStop(_currentframe + 1);
} else {
gotoAndStop (1);
}
}
function seconds_timea() {
if (_root.gamenumeral < 10) {
_root.gamenumeral = _root.gamenumeral + 1;
}
if (_root.gamenumeral == 10) {
clearInterval(intervalID1);
_root.anca1._x = _root.anca1._x - 60;
_root.anca2._x = _root.anca2._x + 60;
_root.gamenumeral = 0;
}
}
function startBall() {
if (startSpeed > 3) {
_root.ball.gotoAndPlay(2);
_root.ball.waitToLaunch = false;
_root.ball.speed = startSpeed;
_root.st0.speedOut = startSpeed;
_root.snd2.correctObj.start(0, 1);
_root.allFalls = 0;
if (_root.numeral == 0) {
if (_root.gamenumeral == 0) {
_root.anca1._x = _root.anca1._x + 60;
_root.anca2._x = _root.anca2._x - 60;
}
intervalID1 = setInterval(seconds_timea, 1000);
}
} else {
_root.ballclip.gotoAndPlay(2);
}
}
stop();
stop();
Symbol 401 MovieClip Frame 2
startSpeed = 3;
stop();
Symbol 401 MovieClip Frame 4
startSpeed = 12;
stop();
Symbol 401 MovieClip Frame 7
startSpeed = 17;
stop();
Symbol 401 MovieClip Frame 10
startSpeed = 19;
stop();
Symbol 401 MovieClip Frame 12
startSpeed = 21;
stop();
Symbol 401 MovieClip Frame 14
startSpeed = 23;
stop();
Symbol 401 MovieClip Frame 16
startSpeed = 25;
stop();
Symbol 401 MovieClip Frame 18
startSpeed = 28;
stop();
Symbol 418 Button
on (release) {
clearInterval(_parent.mainintervalID);
_parent.gotoAndStop(2);
}
Symbol 424 Button
on (release) {
getURL ("http://www.ikoncity.com/html/games/icplaygame.aspx?Token=5F23DA98-2FE4-493D-ABB0-D1F65234717D", "_blank");
}
Symbol 425 MovieClip Frame 1
stop();
Symbol 425 MovieClip Frame 2
stop();
stopAllSounds();
blocking_bt.useHandCursor = false;
_parent.setDeactive();
score = _parent.score;
Symbol 430 MovieClip Frame 1
function calculateDirection(angle) {
var _local4 = _x;
var _local2 = _y;
var _local3 = x;
var _local1 = y;
a = _local1 - _local2;
b = _local4 - _local3;
c = ((-_local4) * _local1) + (_local3 * _local2);
}
function collisionSegment() {
var _local2 = segmentT.getIntersection(a, b, c);
var _local4 = segmentT.angle >= 90;
var _local5 = (_local4 ? (180 - segmentT.angle) : (segmentT.angle));
if (isCollision == true) {
if (_local5 > 2) {
speed = speed + 1;
}
}
var _local3 = Math.sqrt(((_local2.x0 - _x) * (_local2.x0 - _x)) + ((_local2.y0 - _y) * (_local2.y0 - _y)));
_x = (_local2.x0 - (((_local3 * (_width / 2)) / actualDist) * Math.cos(angle * radToDeg)));
_y = (_local2.y0 - (((_local3 * (_width / 2)) / actualDist) * Math.sin(angle * radToDeg)));
if (segmentT.clipObj != null) {
segmentT.clipObj.action();
}
if (segmentT.clipObj == null) {
segmentT.clipObj = _root.null_mc;
segmentT.clipObj.action();
}
speed = speed + segmentT.clipObj.deltaSpeed;
angle = (2 * segmentT.angle) - angle;
angle = angle + ((angle < 0) ? 360 : 0);
angle = angle + ((angle > 360) ? -360 : 0);
isCollision = true;
inactiveTuneling = true;
speedErr = 4.25;
if (speed > 6) {
speed = (speed - AMORTIZATION) - speedErr;
}
if ((speed > 3) && (speed < 6)) {
speedErr = 1.6;
speed = speed - speedErr;
}
}
function collisionBall() {
var _local7 = ballT._x;
var _local6 = ballT._y;
var _local11 = _width / 2;
var _local10 = ballT._width / 2;
var _local5 = _local11 + _local10;
var _local8 = ballT.distancePoint(this);
_x = (_local7 + ((_local5 * (x - _local7)) / _local8));
_y = (_local6 + ((_local5 * (y - _local6)) / _local8));
var _local4 = (-(_x - _local7)) / _local5;
var _local3 = (-(_y - _local6)) / _local5;
var _local2 = (speedX * _local4) + (speedY * _local3);
var _local9 = ((-speedX) * _local3) + (speedY * _local4);
_local2 = _local2 * -1;
speedX = (_local2 * _local4) - (_local9 * _local3);
speedY = (_local2 * _local3) + (_local9 * _local4);
speed = Math.sqrt((speedX * speedX) + (speedY * speedY)) + ballT.deltaSpeed;
angle = (Math.atan(Math.abs(speedY / speedX)) * 180) / 3.141593;
if ((speedX < 0) && (speedY < 0)) {
angle = angle + 180;
} else if ((speedX < 0) && (speedY > 0)) {
angle = 180 - angle;
} else if ((speedX > 0) && (speedY < 0)) {
angle = 360 - angle;
}
if (ballT.clipObj != null) {
ballT.clipObj.action();
}
inactiveTuneling = true;
}
function collisionFlipperRight() {
var _local5 = _width / 2;
var _local3 = _root.flipRight.distanceTo(this);
var _local7 = x;
var _local6 = y;
var _local4 = Math.abs(_root.flipRight.centreX - x) / _root.flipRight.upSegment.module;
angle = 335 - Math.round(80 * _local4);
speed = speed + (7 + ((8 * _local3) / _root.flipRight.upSegment.module));
_root.flipRight.upSegment.active = false;
ballFlipped = true;
inactiveTuneling = true;
}
function collisionFlipperLeft() {
var _local5 = _width / 2;
var _local3 = _root.flipLeft.distanceTo(this);
var _local7 = x;
var _local6 = y;
var _local4 = Math.abs(x - _root.flipLeft.centreX) / _root.flipLeft.upSegment.module;
angle = 205 + Math.round(80 * _local4);
speed = speed + (7 + ((8 * _local3) / _root.flipLeft.upSegment.module));
_root.flipLeft.upSegment.active = false;
ballFlipped = true;
inactiveTuneling = true;
}
function findPossibleTarget() {
findPossibleSegmentTarget();
findPossibleBallTarget();
}
function findPossibleBallTarget() {
tempBalls = new Array();
var _local5 = 0;
while (_local5 < _root.allBalls.length) {
if (_root.allBalls[_local5].isPossibleTarget(this)) {
tempBalls.push(_root.allBalls[_local5]);
}
_local5++;
}
if (tempBalls.length == 1) {
ballT = tempBalls[0];
return(undefined);
}
ballMinDistance = 100000 /* 0x0186A0 */;
var _local4 = -1;
for (_local5 in tempBalls) {
var _local3 = tempBalls[_local5].distancePoint(this);
if ((_local3 < ballMinDistance) && ((_local3 > 0) || (ballT == tempBalls[_local5]))) {
ballMinDistance = _local3;
_local4 = _local5;
}
}
if (_local4 != -1) {
ballT = tempBalls[_local4];
} else {
ballT = null;
}
}
function startClip() {
angle = startAngle;
}
function stepByStep() {
_x = (_x + stepX);
_y = (_y + stepY);
step++;
}
function updateDestination() {
if (inactiveTuneling == false) {
isOnPath = false;
}
speed = speed + ((speedInc != null) ? (speedInc) : 0.5);
if (MAX_SPEED < speed) {
speed = MAX_SPEED;
}
antDestination = destination;
destination = _root[destination].nextStep;
if (destination == "out") {
isOnPath = false;
trace("----------------");
trace("before angle = " + angle);
trace("angleOut = " + angleOut);
angle = angleOut;
trace("after angle = " + angle);
trace("----------------");
if (speedOut != null) {
speed = speedOut;
}
} else if (destination == "wait") {
isOnPath = false;
speed = 0;
timeToWait = 2000;
speed_wait = _root[antDestination].speed_wait;
angle_wait = _root[antDestination].angle_wait;
sTime = getTimer();
inactiveTuneling = true;
} else {
deltaX = _root[destination]._x - _x;
deltaY = _root[destination]._y - _y;
distanceToBeacon = Math.sqrt((deltaX * deltaX) + (deltaY * deltaY));
steps = distanceToBeacon / speed;
stepX = deltaX / steps;
stepY = deltaY / steps;
step = 1;
}
}
function wait(time, ang_wait, spe_wait, xOut, yOut) {
timeToWait = time;
sTime = getTimer();
angle_wait = ang_wait;
speed_wait = spe_wait;
xOutPosition = xOut;
yOutPosition = yOut;
}
x = 0;
y = 0;
radToDeg = 0.017453;
flipRightToggled = false;
flipLeftToggled = false;
speed = 0;
startAngle = 270;
GRAV_Y = 0.43;
AMORTIZATION = 1.4;
MAX_SPEED = 14;
timeToWait = null;
startClip();
ballRadius = 4.3;
activate = 0;
m = 8.6;
tempAngle = 0;
function findPossibleSegmentTarget() {
antSeg = segmentT;
_root.ballrightBumper = false;
_root.ballleftBumper = false;
_root.ballrightTargetBlock = false;
_root.ballleftTargetBlock = false;
_root.ballrightFlipper = false;
_root.ballleftFlipper = false;
_root.ballrightRamp2 = false;
_root.ballleftRamp2 = false;
_root.ballrightRamp1 = false;
_root.ballleftRamp1 = false;
tempSegments = new Array();
if (((((((((_root.ballrightBumper != true) && (_root.ballrightTargetBlock != true)) && (_root.ballleftTargetBlock != true)) && (_root.ballrightFlipper != true)) && (_root.ballleftFlipper != true)) && (_root.ballrightRamp2 != true)) && (_root.ballleftRamp2 != true)) && (_root.ballrightRamp1 != true)) && (_root.ballleftRamp1 != true)) {
for (var _local5 in _root.splitSegment1) {
if (_root.splitSegment1[_local5].isPossibleTarget(this)) {
tempSegments[tempSegments.length] = _root.splitSegment1[_local5];
}
}
}
if (this._x > _root.tbRLine._x) {
for (var _local5 in _root.splitSegment6) {
if (_root.splitSegment6[_local5].isPossibleTarget(this)) {
tempSegments[tempSegments.length] = _root.splitSegment6[_local5];
}
}
}
for (var _local5 in _root.splitSegment2) {
if (_root.splitSegment2[_local5].isPossibleTarget(this)) {
tempSegments[tempSegments.length] = _root.splitSegment2[_local5];
}
}
if (this._y > _root.brTLine._y) {
if (this._x > _root.brRLine2._x) {
if (this._x < _root.brRLine1._x) {
_root.ballrightBumper = true;
for (var _local5 in _root.splitSegment3) {
if (_root.splitSegment3[_local5].isPossibleTarget(this)) {
tempSegments[tempSegments.length] = _root.splitSegment3[_local5];
}
}
}
}
}
if (this._y < _root.topBLine._y) {
for (var _local5 in _root.splitSegment4) {
if (_root.splitSegment4[_local5].isPossibleTarget(this)) {
tempSegments[tempSegments.length] = _root.splitSegment4[_local5];
}
}
for (var _local5 in _root.splitSegment5) {
if (_root.splitSegment5[_local5].isPossibleTarget(this)) {
tempSegments[tempSegments.length] = _root.splitSegment5[_local5];
}
}
}
if (this._y > _root.ramp2T._y) {
if (this._y < _root.ramp2B._y) {
if (this._x > _root.ramp2L1._x) {
if (this._x < _root.ramp2L2._x) {
_root.ballleftRamp2 = true;
for (var _local5 in _root.splitSegment7) {
if (_root.splitSegment7[_local5].isPossibleTarget(this)) {
tempSegments[tempSegments.length] = _root.splitSegment7[_local5];
}
}
for (var _local5 in _root.splitSegment11) {
if (_root.splitSegment11[_local5].isPossibleTarget(this)) {
tempSegments[tempSegments.length] = _root.splitSegment11[_local5];
}
}
for (var _local5 in _root.splitSegment17) {
if (_root.splitSegment17[_local5].isPossibleTarget(this)) {
tempSegments[tempSegments.length] = _root.splitSegment17[_local5];
}
}
}
}
if (this._x > _root.ramp2R2._x) {
if (this._x < _root.ramp2R1._x) {
_root.ballrightRamp2 = true;
for (var _local5 in _root.splitSegment9) {
if (_root.splitSegment9[_local5].isPossibleTarget(this)) {
tempSegments[tempSegments.length] = _root.splitSegment9[_local5];
}
}
for (var _local5 in _root.splitSegment12) {
if (_root.splitSegment12[_local5].isPossibleTarget(this)) {
tempSegments[tempSegments.length] = _root.splitSegment12[_local5];
}
}
}
}
}
}
if (this._y > _root.ramp1T._y) {
if (this._y < _root.ramp1B._y) {
if (this._x > _root.ramp1L1._x) {
if (this._x < _root.ramp1L2._x) {
_root.ballleftRamp1 = true;
for (var _local5 in _root.splitSegment8) {
if (_root.splitSegment8[_local5].isPossibleTarget(this)) {
tempSegments[tempSegments.length] = _root.splitSegment8[_local5];
}
}
}
}
if (this._x > _root.ramp1R2._x) {
if (this._x < _root.ramp1R1._x) {
_root.ballrightRamp1 = true;
for (var _local5 in _root.splitSegment10) {
if (_root.splitSegment10[_local5].isPossibleTarget(this)) {
tempSegments[tempSegments.length] = _root.splitSegment10[_local5];
}
}
}
}
}
}
if (this._y > _root.frTLine._y) {
if (this._y < _root.frBLine._y) {
if (this._x > _root.frLLine1._x) {
if (this._x < _root.frLLine2._x) {
_root.ballleftFlipper = true;
for (var _local5 in _root.splitSegment16) {
if (_root.splitSegment16[_local5].isPossibleTarget(this)) {
tempSegments[tempSegments.length] = _root.splitSegment16[_local5];
}
}
}
}
if (this._x > _root.frRLine2._x) {
if (this._x < _root.frRLine1._x) {
_root.ballrightFlipper = true;
for (var _local5 in _root.splitSegment15) {
if (_root.splitSegment15[_local5].isPossibleTarget(this)) {
tempSegments[tempSegments.length] = _root.splitSegment15[_local5];
}
}
}
}
}
}
if (this._y > _root.tbTLine._y) {
if (this._y < _root.tbBLine._y) {
if (this._x > _root.tbRLine._x) {
_root.ballrightTargetBlock = true;
for (var _local5 in _root.splitSegment13) {
if (_root.splitSegment13[_local5].isPossibleTarget(this)) {
tempSegments[tempSegments.length] = _root.splitSegment13[_local5];
}
}
} else if (this._x < _root.tbLLine._x) {
_root.ballleftTargetBlock = true;
for (var _local5 in _root.splitSegment14) {
if (_root.splitSegment14[_local5].isPossibleTarget(this)) {
tempSegments[tempSegments.length] = _root.splitSegment14[_local5];
}
}
}
}
}
if (tempSegments.length == 1) {
segmentT = tempSegments[0];
return(undefined);
}
segMinDistance = 100000 /* 0x0186A0 */;
var _local4 = -1;
for (var _local5 in tempSegments) {
var _local3 = tempSegments[_local5].cachedDistance;
if ((_local3 < segMinDistance) && (((_local3 > 0) || (segmentT == tempSegments[_local5])) || (tempSegments[_local5].isCrossed))) {
segMinDistance = _local3;
_local4 = _local5;
}
}
if (_local4 != -1) {
segmentT = tempSegments[_local4];
} else {
segmentT = null;
}
}
Symbol 431 MovieClip Frame 1
stop();
_root.ball._visible = true;
Symbol 431 MovieClip Frame 2
_root.ball._visible = false;
Symbol 434 MovieClip Frame 1
function calculateDirection(angle) {
var _local4 = _x;
var _local2 = _y;
var _local3 = x;
var _local1 = y;
a = _local1 - _local2;
b = _local4 - _local3;
c = ((-_local4) * _local1) + (_local3 * _local2);
}
function collisionSegment() {
var _local2 = segmentT.getIntersection(a, b, c);
var _local4 = segmentT.angle >= 90;
var _local5 = (_local4 ? (180 - segmentT.angle) : (segmentT.angle));
if (isCollision == true) {
if (_local5 > 2) {
speed = speed + 1;
}
}
var _local3 = Math.sqrt(((_local2.x0 - _x) * (_local2.x0 - _x)) + ((_local2.y0 - _y) * (_local2.y0 - _y)));
_x = (_local2.x0 - (((_local3 * (_width / 2)) / actualDist) * Math.cos(angle * radToDeg)));
_y = (_local2.y0 - (((_local3 * (_width / 2)) / actualDist) * Math.sin(angle * radToDeg)));
if (segmentT.clipObj != null) {
segmentT.clipObj.action();
}
if (segmentT.clipObj == null) {
segmentT.clipObj = _root.null_mc;
segmentT.clipObj.action();
}
speed = speed + segmentT.clipObj.deltaSpeed;
angle = (2 * segmentT.angle) - angle;
angle = angle + ((angle < 0) ? 360 : 0);
angle = angle + ((angle > 360) ? -360 : 0);
isCollision = true;
inactiveTuneling = true;
speedErr = 4.25;
if (speed > 6) {
speed = (speed - AMORTIZATION) - speedErr;
}
if ((speed > 3) && (speed < 6)) {
speedErr = 1.6;
speed = speed - speedErr;
}
}
function collisionBall() {
var _local7 = ballT._x;
var _local6 = ballT._y;
var _local11 = _width / 2;
var _local10 = ballT._width / 2;
var _local5 = _local11 + _local10;
var _local8 = ballT.distancePoint(this);
_x = (_local7 + ((_local5 * (x - _local7)) / _local8));
_y = (_local6 + ((_local5 * (y - _local6)) / _local8));
var _local4 = (-(_x - _local7)) / _local5;
var _local3 = (-(_y - _local6)) / _local5;
var _local2 = (speedX * _local4) + (speedY * _local3);
var _local9 = ((-speedX) * _local3) + (speedY * _local4);
_local2 = _local2 * -1;
speedX = (_local2 * _local4) - (_local9 * _local3);
speedY = (_local2 * _local3) + (_local9 * _local4);
speed = Math.sqrt((speedX * speedX) + (speedY * speedY)) + ballT.deltaSpeed;
angle = (Math.atan(Math.abs(speedY / speedX)) * 180) / 3.141593;
if ((speedX < 0) && (speedY < 0)) {
angle = angle + 180;
} else if ((speedX < 0) && (speedY > 0)) {
angle = 180 - angle;
} else if ((speedX > 0) && (speedY < 0)) {
angle = 360 - angle;
}
if (ballT.clipObj != null) {
ballT.clipObj.action();
}
inactiveTuneling = true;
}
function collisionFlipperRight() {
var _local5 = _width / 2;
var _local3 = _root.flipRight.distanceTo(this);
var _local7 = x;
var _local6 = y;
var _local4 = Math.abs(_root.flipRight.centreX - x) / _root.flipRight.upSegment.module;
angle = 335 - Math.round(80 * _local4);
speed = speed + (7 + ((8 * _local3) / _root.flipRight.upSegment.module));
_root.flipRight.upSegment.active = false;
ballFlipped = true;
inactiveTuneling = true;
}
function collisionFlipperLeft() {
var _local5 = _width / 2;
var _local3 = _root.flipLeft.distanceTo(this);
var _local7 = x;
var _local6 = y;
var _local4 = Math.abs(x - _root.flipLeft.centreX) / _root.flipLeft.upSegment.module;
angle = 205 + Math.round(80 * _local4);
speed = speed + (7 + ((8 * _local3) / _root.flipLeft.upSegment.module));
_root.flipLeft.upSegment.active = false;
ballFlipped = true;
inactiveTuneling = true;
}
function findPossibleTarget() {
findPossibleSegmentTarget();
findPossibleBallTarget();
}
function findPossibleBallTarget() {
tempBalls = new Array();
for (var _local5 in _root.allBalls1) {
if (_root.allBalls1[_local5].isPossibleTarget(this)) {
tempBalls.push(_root.allBalls1[_local5]);
}
}
if (tempBalls.length == 1) {
ballT = tempBalls[0];
return(undefined);
}
ballMinDistance = 100000 /* 0x0186A0 */;
var _local4 = -1;
for (var _local5 in tempBalls) {
var _local3 = tempBalls[_local5].distancePoint(this);
if ((_local3 < ballMinDistance) && ((_local3 > 0) || (ballT == tempBalls[_local5]))) {
ballMinDistance = _local3;
_local4 = _local5;
}
}
if (_local4 != -1) {
ballT = tempBalls[_local4];
} else {
ballT = null;
}
}
function startClip() {
angle = startAngle;
}
function stepByStep() {
_x = (_x + stepX);
_y = (_y + stepY);
step++;
}
function updateDestination() {
if (inactiveTuneling == false) {
isOnPath = false;
}
speed = speed + ((speedInc != null) ? (speedInc) : 0.5);
if (MAX_SPEED < speed) {
speed = MAX_SPEED;
}
antDestination = destination;
destination = _root[destination].nextStep;
if (destination == "out") {
isOnPath = false;
angle = angleOut;
if (speedOut != null) {
speed = speedOut;
}
} else if (destination == "wait") {
isOnPath = false;
speed = 0;
timeToWait = 2000;
speed_wait = _root[antDestination].speed_wait;
angle_wait = _root[antDestination].angle_wait;
sTime = getTimer();
inactiveTuneling = true;
} else {
deltaX = _root[destination]._x - _x;
deltaY = _root[destination]._y - _y;
distanceToBeacon = Math.sqrt((deltaX * deltaX) + (deltaY * deltaY));
steps = distanceToBeacon / speed;
stepX = deltaX / steps;
stepY = deltaY / steps;
step = 1;
}
}
function wait(time, ang_wait, spe_wait, xOut, yOut) {
timeToWait = time;
sTime = getTimer();
angle_wait = ang_wait;
speed_wait = spe_wait;
xOutPosition = xOut;
yOutPosition = yOut;
}
radToDeg = 0.017453;
flipRightToggled = false;
flipLeftToggled = false;
speed = 0;
startAngle = 270;
GRAV_Y = 0.43;
AMORTIZATION = 1.4;
MAX_SPEED = 14;
timeToWait = null;
startClip();
ballRadius = 4.3;
activate = 0;
m = 8.6;
tempAngle = 0;
function findPossibleSegmentTarget() {
antSeg = segmentT;
_root.ball1rightBumper = false;
_root.ball1leftBumper = false;
_root.ball1rightTargetBlock = false;
_root.ball1leftTargetBlock = false;
_root.ball1rightFlipper = false;
_root.ball1leftFlipper = false;
_root.ball1rightRamp2 = false;
_root.ball1leftRamp2 = false;
_root.ball1rightRamp1 = false;
_root.ball1leftRamp1 = false;
tempSegments = new Array();
if ((((((((((_root.ball1rightBumper != true) && (_root.ball1leftBumper != true)) && (_root.ball1rightTargetBlock != true)) && (_root.ball1leftTargetBlock != true)) && (_root.ball1rightFlipper != true)) && (_root.ball1leftFlipper != true)) && (_root.ball1rightRamp2 != true)) && (_root.ball1leftRamp2 != true)) && (_root.ball1rightRamp1 != true)) && (_root.ball1leftRamp1 != true)) {
for (var _local5 in _root.ball1splitSegment1) {
if (_root.ball1splitSegment1[_local5].isPossibleTarget(this)) {
tempSegments[tempSegments.length] = _root.ball1splitSegment1[_local5];
}
}
}
if (this._x > _root.tbRLine._x) {
for (var _local5 in _root.splitSegment6) {
if (_root.splitSegment6[_local5].isPossibleTarget(this)) {
tempSegments[tempSegments.length] = _root.splitSegment6[_local5];
}
}
}
if (this._y < _root.topBLine._y) {
for (var _local5 in _root.splitSegment4) {
if (_root.splitSegment4[_local5].isPossibleTarget(this)) {
tempSegments[tempSegments.length] = _root.splitSegment4[_local5];
}
}
for (var _local5 in _root.splitSegment5) {
if (_root.splitSegment5[_local5].isPossibleTarget(this)) {
tempSegments[tempSegments.length] = _root.splitSegment5[_local5];
}
}
}
if (this._y > _root.ramp2T._y) {
if (this._y < _root.ramp2B._y) {
if (this._x > _root.ramp2L1._x) {
if (this._x < _root.ramp2L2._x) {
_root.ball1leftRamp2 = true;
for (var _local5 in _root.splitSegment7) {
if (_root.splitSegment7[_local5].isPossibleTarget(this)) {
tempSegments[tempSegments.length] = _root.splitSegment7[_local5];
}
}
for (var _local5 in _root.ball1splitSegment11) {
if (_root.ball1splitSegment11[_local5].isPossibleTarget(this)) {
tempSegments[tempSegments.length] = _root.ball1splitSegment11[_local5];
}
}
for (var _local5 in _root.splitSegment17) {
if (_root.splitSegment17[_local5].isPossibleTarget(this)) {
tempSegments[tempSegments.length] = _root.splitSegment17[_local5];
}
}
}
}
if (this._x > _root.ramp2R2._x) {
if (this._x < _root.ramp2R1._x) {
_root.ball1rightRamp2 = true;
for (var _local5 in _root.splitSegment9) {
if (_root.splitSegment9[_local5].isPossibleTarget(this)) {
tempSegments[tempSegments.length] = _root.splitSegment9[_local5];
}
}
for (var _local5 in _root.ball1splitSegment12) {
if (_root.ball1splitSegment12[_local5].isPossibleTarget(this)) {
tempSegments[tempSegments.length] = _root.ball1splitSegment12[_local5];
}
}
}
}
}
}
if (this._y > _root.ramp1T._y) {
if (this._y < _root.ramp1B._y) {
if (this._x > _root.ramp1L1._x) {
if (this._x < _root.ramp1L2._x) {
_root.ball1leftRamp1 = true;
for (var _local5 in _root.splitSegment8) {
if (_root.splitSegment8[_local5].isPossibleTarget(this)) {
tempSegments[tempSegments.length] = _root.splitSegment8[_local5];
}
}
}
}
if (this._x > _root.ramp1R2._x) {
if (this._x < _root.ramp1R1._x) {
_root.ball1rightRamp1 = true;
for (var _local5 in _root.ball1splitSegment10) {
if (_root.ball1splitSegment10[_local5].isPossibleTarget(this)) {
tempSegments[tempSegments.length] = _root.ball1splitSegment10[_local5];
}
}
}
}
}
}
if (this._y > _root.frTLine._y) {
if (this._y < _root.frBLine._y) {
if (this._x > _root.frLLine1._x) {
if (this._x < _root.frLLine2._x) {
_root.ball1leftFlipper = true;
for (var _local5 in _root.ball1splitSegment16) {
if (_root.ball1splitSegment16[_local5].isPossibleTarget(this)) {
tempSegments[tempSegments.length] = _root.ball1splitSegment16[_local5];
}
}
}
}
if (this._x > _root.frRLine2._x) {
if (this._x < _root.frRLine1._x) {
_root.ball1rightFlipper = true;
for (var _local5 in _root.ball1splitSegment15) {
if (_root.ball1splitSegment15[_local5].isPossibleTarget(this)) {
tempSegments[tempSegments.length] = _root.ball1splitSegment15[_local5];
}
}
}
}
}
}
if (this._y > _root.brTLine._y) {
if (this._y < _root.brBLine._y) {
if (this._x > _root.brLLine1._x) {
if (this._x < _root.brLLine2._x) {
_root.ball1leftBumper = true;
for (var _local5 in _root.splitSegment2) {
if (_root.splitSegment2[_local5].isPossibleTarget(this)) {
tempSegments[tempSegments.length] = _root.splitSegment2[_local5];
}
}
}
}
if (this._x > _root.brRLine2._x) {
if (this._x < _root.brRLine1._x) {
_root.ball1rightBumper = true;
for (var _local5 in _root.splitSegment3) {
if (_root.splitSegment3[_local5].isPossibleTarget(this)) {
tempSegments[tempSegments.length] = _root.splitSegment3[_local5];
}
}
}
}
}
}
if (this._y > _root.tbTLine._y) {
if (this._y < _root.tbBLine._y) {
if (this._x > _root.tbRLine._x) {
_root.ball1rightTargetBlock = true;
for (var _local5 in _root.ball1splitSegment13) {
if (_root.ball1splitSegment13[_local5].isPossibleTarget(this)) {
tempSegments[tempSegments.length] = _root.ball1splitSegment13[_local5];
}
}
} else if (this._x < _root.tbLLine._x) {
_root.ball1leftTargetBlock = true;
for (var _local5 in _root.ball1splitSegment14) {
if (_root.ball1splitSegment14[_local5].isPossibleTarget(this)) {
tempSegments[tempSegments.length] = _root.ball1splitSegment14[_local5];
}
}
}
}
}
if (tempSegments.length == 1) {
segmentT = tempSegments[0];
return(undefined);
}
segMinDistance = 100000 /* 0x0186A0 */;
var _local4 = -1;
for (var _local5 in tempSegments) {
var _local3 = tempSegments[_local5].cachedDistance;
if ((_local3 < segMinDistance) && (((_local3 > 0) || (segmentT == tempSegments[_local5])) || (tempSegments[_local5].isCrossed))) {
segMinDistance = _local3;
_local4 = _local5;
}
}
if (_local4 != -1) {
segmentT = tempSegments[_local4];
} else {
segmentT = null;
}
}
Symbol 435 MovieClip Frame 1
function calculateDirection(angle) {
var _local4 = _x;
var _local2 = _y;
var _local3 = x;
var _local1 = y;
a = _local1 - _local2;
b = _local4 - _local3;
c = ((-_local4) * _local1) + (_local3 * _local2);
}
function collisionSegment() {
var _local2 = segmentT.getIntersection(a, b, c);
var _local4 = segmentT.angle >= 90;
var _local5 = (_local4 ? (180 - segmentT.angle) : (segmentT.angle));
if (isCollision == true) {
if (_local5 > 2) {
speed = speed + 1;
}
}
var _local3 = Math.sqrt(((_local2.x0 - _x) * (_local2.x0 - _x)) + ((_local2.y0 - _y) * (_local2.y0 - _y)));
_x = (_local2.x0 - (((_local3 * (_width / 2)) / actualDist) * Math.cos(angle * radToDeg)));
_y = (_local2.y0 - (((_local3 * (_width / 2)) / actualDist) * Math.sin(angle * radToDeg)));
if (segmentT.clipObj != null) {
segmentT.clipObj.action();
}
if (segmentT.clipObj == null) {
segmentT.clipObj = _root.null_mc;
segmentT.clipObj.action();
}
speed = speed + segmentT.clipObj.deltaSpeed;
angle = (2 * segmentT.angle) - angle;
angle = angle + ((angle < 0) ? 360 : 0);
angle = angle + ((angle > 360) ? -360 : 0);
isCollision = true;
inactiveTuneling = true;
speedErr = 4.25;
if (speed > 6) {
speed = (speed - AMORTIZATION) - speedErr;
}
if ((speed > 3) && (speed < 6)) {
speedErr = 1.6;
speed = speed - speedErr;
}
}
function collisionBall() {
var _local7 = ballT._x;
var _local6 = ballT._y;
var _local11 = _width / 2;
var _local10 = ballT._width / 2;
var _local5 = _local11 + _local10;
var _local8 = ballT.distancePoint(this);
_x = (_local7 + ((_local5 * (x - _local7)) / _local8));
_y = (_local6 + ((_local5 * (y - _local6)) / _local8));
var _local4 = (-(_x - _local7)) / _local5;
var _local3 = (-(_y - _local6)) / _local5;
var _local2 = (speedX * _local4) + (speedY * _local3);
var _local9 = ((-speedX) * _local3) + (speedY * _local4);
_local2 = _local2 * -1;
speedX = (_local2 * _local4) - (_local9 * _local3);
speedY = (_local2 * _local3) + (_local9 * _local4);
speed = Math.sqrt((speedX * speedX) + (speedY * speedY)) + ballT.deltaSpeed;
angle = (Math.atan(Math.abs(speedY / speedX)) * 180) / 3.141593;
if ((speedX < 0) && (speedY < 0)) {
angle = angle + 180;
} else if ((speedX < 0) && (speedY > 0)) {
angle = 180 - angle;
} else if ((speedX > 0) && (speedY < 0)) {
angle = 360 - angle;
}
if (ballT.clipObj != null) {
ballT.clipObj.action();
}
inactiveTuneling = true;
}
function collisionFlipperRight() {
var _local5 = _width / 2;
var _local3 = _root.flipRight.distanceTo(this);
var _local7 = x;
var _local6 = y;
var _local4 = Math.abs(_root.flipRight.centreX - x) / _root.flipRight.upSegment.module;
angle = 335 - Math.round(80 * _local4);
speed = speed + (7 + ((8 * _local3) / _root.flipRight.upSegment.module));
_root.flipRight.upSegment.active = false;
ballFlipped = true;
inactiveTuneling = true;
}
function collisionFlipperLeft() {
var _local5 = _width / 2;
var _local3 = _root.flipLeft.distanceTo(this);
var _local7 = x;
var _local6 = y;
var _local4 = Math.abs(x - _root.flipLeft.centreX) / _root.flipLeft.upSegment.module;
angle = 205 + Math.round(80 * _local4);
speed = speed + (7 + ((8 * _local3) / _root.flipLeft.upSegment.module));
_root.flipLeft.upSegment.active = false;
ballFlipped = true;
inactiveTuneling = true;
}
function findPossibleTarget() {
findPossibleSegmentTarget();
findPossibleBallTarget();
}
function findPossibleBallTarget() {
tempBalls = new Array();
for (var _local5 in _root.allBalls2) {
if (_root.allBalls2[_local5].isPossibleTarget(this)) {
tempBalls.push(_root.allBalls2[_local5]);
}
}
if (tempBalls.length == 1) {
ballT = tempBalls[0];
return(undefined);
}
ballMinDistance = 100000 /* 0x0186A0 */;
var _local4 = -1;
for (var _local5 in tempBalls) {
var _local3 = tempBalls[_local5].distancePoint(this);
if ((_local3 < ballMinDistance) && ((_local3 > 0) || (ballT == tempBalls[_local5]))) {
ballMinDistance = _local3;
_local4 = _local5;
}
}
if (_local4 != -1) {
ballT = tempBalls[_local4];
} else {
ballT = null;
}
}
function startClip() {
angle = startAngle;
}
function stepByStep() {
_x = (_x + stepX);
_y = (_y + stepY);
step++;
}
function updateDestination() {
if (inactiveTuneling == false) {
isOnPath = false;
}
speed = speed + ((speedInc != null) ? (speedInc) : 0.5);
if (MAX_SPEED < speed) {
speed = MAX_SPEED;
}
antDestination = destination;
destination = _root[destination].nextStep;
if (destination == "out") {
isOnPath = false;
angle = angleOut;
if (speedOut != null) {
speed = speedOut;
}
} else if (destination == "wait") {
isOnPath = false;
speed = 0;
timeToWait = 2000;
speed_wait = _root[antDestination].speed_wait;
angle_wait = _root[antDestination].angle_wait;
sTime = getTimer();
inactiveTuneling = true;
} else {
deltaX = _root[destination]._x - _x;
deltaY = _root[destination]._y - _y;
distanceToBeacon = Math.sqrt((deltaX * deltaX) + (deltaY * deltaY));
steps = distanceToBeacon / speed;
stepX = deltaX / steps;
stepY = deltaY / steps;
step = 1;
}
}
function wait(time, ang_wait, spe_wait, xOut, yOut) {
timeToWait = time;
sTime = getTimer();
angle_wait = ang_wait;
speed_wait = spe_wait;
xOutPosition = xOut;
yOutPosition = yOut;
}
radToDeg = 0.017453;
flipRightToggled = false;
flipLeftToggled = false;
speed = 0;
startAngle = 270;
GRAV_Y = 0.43;
AMORTIZATION = 1.4;
MAX_SPEED = 14;
timeToWait = null;
startClip();
ballRadius = 4.3;
activate = 0;
m = 8.6;
tempAngle = 0;
function findPossibleSegmentTarget() {
antSeg = segmentT;
_root.ball2rightBumper = false;
_root.ball2leftBumper = false;
_root.ball2rightTargetBlock = false;
_root.ball2leftTargetBlock = false;
_root.ball2rightFlipper = false;
_root.ball2leftFlipper = false;
_root.ball2rightRamp2 = false;
_root.ball2leftRamp2 = false;
_root.ball2rightRamp1 = false;
_root.ball2leftRamp1 = false;
tempSegments = new Array();
if ((((((((((_root.ball2rightBumper != true) && (_root.ball2leftBumper != true)) && (_root.ball2rightTargetBlock != true)) && (_root.ball2leftTargetBlock != true)) && (_root.ball2rightFlipper != true)) && (_root.ball2leftFlipper != true)) && (_root.ball2rightRamp2 != true)) && (_root.ball2leftRamp2 != true)) && (_root.ball2rightRamp1 != true)) && (_root.ball2leftRamp1 != true)) {
for (var _local5 in _root.ball2splitSegment1) {
if (_root.ball2splitSegment1[_local5].isPossibleTarget(this)) {
tempSegments[tempSegments.length] = _root.ball2splitSegment1[_local5];
}
}
}
if (this._x > _root.tbRLine._x) {
for (var _local5 in _root.splitSegment6) {
if (_root.splitSegment6[_local5].isPossibleTarget(this)) {
tempSegments[tempSegments.length] = _root.splitSegment6[_local5];
}
}
}
if (this._y < _root.topBLine._y) {
for (var _local5 in _root.splitSegment4) {
if (_root.splitSegment4[_local5].isPossibleTarget(this)) {
tempSegments[tempSegments.length] = _root.splitSegment4[_local5];
}
}
for (var _local5 in _root.splitSegment5) {
if (_root.splitSegment5[_local5].isPossibleTarget(this)) {
tempSegments[tempSegments.length] = _root.splitSegment5[_local5];
}
}
}
if (this._y > _root.ramp2T._y) {
if (this._y < _root.ramp2B._y) {
if (this._x > _root.ramp2L1._x) {
if (this._x < _root.ramp2L2._x) {
_root.ball2leftRamp2 = true;
for (var _local5 in _root.splitSegment7) {
if (_root.splitSegment7[_local5].isPossibleTarget(this)) {
tempSegments[tempSegments.length] = _root.splitSegment7[_local5];
}
}
for (var _local5 in _root.ball2splitSegment11) {
if (_root.ball2splitSegment11[_local5].isPossibleTarget(this)) {
tempSegments[tempSegments.length] = _root.ball2splitSegment11[_local5];
}
}
for (var _local5 in _root.splitSegment17) {
if (_root.splitSegment17[_local5].isPossibleTarget(this)) {
tempSegments[tempSegments.length] = _root.splitSegment17[_local5];
}
}
}
}
if (this._x > _root.ramp2R2._x) {
if (this._x < _root.ramp2R1._x) {
_root.ball2rightRamp2 = true;
for (var _local5 in _root.splitSegment9) {
if (_root.splitSegment9[_local5].isPossibleTarget(this)) {
tempSegments[tempSegments.length] = _root.splitSegment9[_local5];
}
}
for (var _local5 in _root.ball2splitSegment12) {
if (_root.ball2splitSegment12[_local5].isPossibleTarget(this)) {
tempSegments[tempSegments.length] = _root.ball2splitSegment12[_local5];
}
}
}
}
}
}
if (this._y > _root.ramp1T._y) {
if (this._y < _root.ramp1B._y) {
if (this._x > _root.ramp1L1._x) {
if (this._x < _root.ramp1L2._x) {
_root.ball2leftRamp1 = true;
for (var _local5 in _root.splitSegment8) {
if (_root.splitSegment8[_local5].isPossibleTarget(this)) {
tempSegments[tempSegments.length] = _root.splitSegment8[_local5];
}
}
}
}
if (this._x > _root.ramp1R2._x) {
if (this._x < _root.ramp1R1._x) {
_root.ball2rightRamp1 = true;
for (var _local5 in _root.ball2splitSegment10) {
if (_root.ball2splitSegment10[_local5].isPossibleTarget(this)) {
tempSegments[tempSegments.length] = _root.ball2splitSegment10[_local5];
}
}
}
}
}
}
if (this._y > _root.frTLine._y) {
if (this._y < _root.frBLine._y) {
if (this._x > _root.frLLine1._x) {
if (this._x < _root.frLLine2._x) {
_root.ball2leftFlipper = true;
for (var _local5 in _root.ball2splitSegment16) {
if (_root.ball2splitSegment16[_local5].isPossibleTarget(this)) {
tempSegments[tempSegments.length] = _root.ball2splitSegment16[_local5];
}
}
}
}
if (this._x > _root.frRLine2._x) {
if (this._x < _root.frRLine1._x) {
_root.ball2rightFlipper = true;
for (var _local5 in _root.ball2splitSegment15) {
if (_root.ball2splitSegment15[_local5].isPossibleTarget(this)) {
tempSegments[tempSegments.length] = _root.ball2splitSegment15[_local5];
}
}
}
}
}
}
if (this._y > _root.brTLine._y) {
if (this._y < _root.brBLine._y) {
if (this._x > _root.brLLine1._x) {
if (this._x < _root.brLLine2._x) {
_root.ball2leftBumper = true;
for (var _local5 in _root.splitSegment2) {
if (_root.splitSegment2[_local5].isPossibleTarget(this)) {
tempSegments[tempSegments.length] = _root.splitSegment2[_local5];
}
}
}
}
if (this._x > _root.brRLine2._x) {
if (this._x < _root.brRLine1._x) {
_root.ball2rightBumper = true;
for (var _local5 in _root.splitSegment3) {
if (_root.splitSegment3[_local5].isPossibleTarget(this)) {
tempSegments[tempSegments.length] = _root.splitSegment3[_local5];
}
}
}
}
}
}
if (this._y > _root.tbTLine._y) {
if (this._y < _root.tbBLine._y) {
if (this._x > _root.tbRLine._x) {
_root.ball2rightTargetBlock = true;
for (var _local5 in _root.ball2splitSegment13) {
if (_root.ball2splitSegment13[_local5].isPossibleTarget(this)) {
tempSegments[tempSegments.length] = _root.ball2splitSegment13[_local5];
}
}
} else if (this._x < _root.tbLLine._x) {
_root.ball2leftTargetBlock = true;
for (var _local5 in _root.ball2splitSegment14) {
if (_root.ball2splitSegment14[_local5].isPossibleTarget(this)) {
tempSegments[tempSegments.length] = _root.ball2splitSegment14[_local5];
}
}
}
}
}
if (tempSegments.length == 1) {
segmentT = tempSegments[0];
return(undefined);
}
segMinDistance = 100000 /* 0x0186A0 */;
var _local4 = -1;
for (var _local5 in tempSegments) {
var _local3 = tempSegments[_local5].cachedDistance;
if ((_local3 < segMinDistance) && (((_local3 > 0) || (segmentT == tempSegments[_local5])) || (tempSegments[_local5].isCrossed))) {
segMinDistance = _local3;
_local4 = _local5;
}
}
if (_local4 != -1) {
segmentT = tempSegments[_local4];
} else {
segmentT = null;
}
}
Symbol 436 MovieClip Frame 1
function action() {
deltaSpeed = 0;
}