Frame 1
function __com_mochibot__(swfid, mc, lv) {
var x;
var g;
var s;
var fv;
var sb;
var u;
var res;
var mb;
var mbc;
mb = "__mochibot__";
mbc = "mochibot.com";
g = (_global ? (_global) : (_level0._root));
if (g[mb + swfid]) {
return(g[mb + swfid]);
}
s = System.security;
x = mc._root.getSWFVersion;
fv = (x ? (mc.getSWFVersion()) : ((_global ? 6 : 5)));
if (!s) {
s = {};
}
sb = s.sandboxType;
if (sb == "localWithFile") {
return(null);
}
x = s.allowDomain;
if (x) {
s.allowDomain(mbc);
}
x = s.allowInsecureDomain;
if (x) {
s.allowInsecureDomain(mbc);
}
u = ((((((((((("http://" + mbc) + "/my/core.swf?mv=5&fv=") + fv) + "&v=") + escape(getVersion())) + "&swfid=") + escape(swfid)) + "&l=") + lv) + "&f=") + mc) + (sb ? ("&sb=" + sb) : "");
lv = ((fv > 6) ? (mc.getNextHighestDepth()) : ((g[mb + "level"] ? (g[mb + "level"] + 1) : (lv))));
g[mb + "level"] = lv;
if (fv == 5) {
res = "_level" + lv;
if (!eval (res)) {
loadMovieNum (u, lv);
}
} else {
res = mc.createEmptyMovieClip(mb + swfid, lv);
res.loadMovie(u);
}
return(res);
}
__com_mochibot__("eb18bc92", this, 10301);
var PEPERE = (_url.indexOf("pepere.org") != -1);
var _mochiads_game_id = "1381b68e6f49e4cb";
Frame 2
function getNewCoord(v, va, vb) {
return({a:((v.y * vb.x) - (v.x * vb.y)) / ((va.y * vb.x) - (va.x * vb.y)), b:((v.y * va.x) - (v.x * va.y)) / ((vb.y * va.x) - (vb.x * va.y))});
}
function getProjection(v, va) {
return(((v.y * va.y) + (v.x * va.x)) / ((va.y * va.y) + (va.x * va.x)));
}
function getNormedProjection(v, va) {
return((v.y * va.y) + (v.x * va.x));
}
function getPolaire(v) {
dx = v.x;
dy = v.y;
d = Math.sqrt((dx * dx) + (dy * dy));
if (d == 0) {
a = 0;
} else {
a = Math.acos(dx / d);
if (dy < 0) {
a = -a;
}
}
return({a:a, d:d});
}
var screen = {w:650, h:650};
var levelManager = new Level();
var local = false;
var game_id = "3_1138720265";
if (local) {
game_id = "1_1143496769";
}
if (PEPERE) {
_root.scoreb._visible = (_root.moreb._visible = false);
}
var replay = false;
var record = new Array();
bg1._visible = true;
bg2._visible = true;
if (alreadyload != true) {
_root.muteallsounds = 0;
var levelSound = new Sound(this);
levelSound.attachSound("LevelSound");
alreadyload = true;
levelSound.start();
var exploSound = new Sound(this);
exploSound.attachSound("ExploSound");
var prelockSound = new Sound(this);
prelockSound.attachSound("PrelockSound");
var lockSound = new Sound(this);
lockSound.attachSound("LockSound");
var bumpSound = new Sound(this);
bumpSound.attachSound("BumpSound");
var memoMouseX = _xmouse;
var memoMouseY = _ymouse;
var addrot = 0;
var oldDiffX = 0;
var oldDiffY = 0;
var sign = 1;
var pepereRot = 0;
}
muter.gotoAndStop(_root.muteallsounds + 1);
welc.roue._rotation = pepereRot;
stop();
onEnterFrame = function () {
if (bg1._alpha < 100) {
bg1._alpha = bg1._alpha + 2;
}
if (bg2._alpha < 100) {
bg2._alpha = bg2._alpha + 2;
}
var _local2 = _xmouse - memoMouseX;
var _local1 = _ymouse - memoMouseY;
var _local4 = Math.sqrt((_local2 * _local2) + (_local1 * _local1));
var _local3 = (_local2 * oldDiffX) + (_local1 * oldDiffY);
if (_local3 <= 0) {
sign = -sign;
}
addrot = addrot + ((sign * _local4) / 20);
addrot = addrot * 0.9;
if (addrot > 10) {
addrot = 10;
}
if (addrot < -10) {
addrot = -10;
}
pepereRot = pepereRot + addrot;
welc.roue._rotation = pepereRot;
memoMouseX = _xmouse;
memoMouseY = _ymouse;
oldDiffX = _local2;
oldDiffY = _local1;
};
Instance of Symbol 11 MovieClip "welc" in Frame 2
onClipEvent (load) {
var nbenterkeys = 0;
var secretcode = "";
}
onClipEvent (keyDown) {
if (!_root.replay) {
t = Key.getCode();
if ((t >= 97) && (t < 107)) {
t = t - 48;
}
secretcode = secretcode + String.fromCharCode(t);
if (nbenterkeys == 8) {
var i = 0;
while (i < _root.levelManager._levels.length) {
if (_root.levelManager._levels[i][0] == secretcode.toLowerCase()) {
_root.levelSound.stop();
_root.levelstart = i;
_root.gotoAndStop(2);
break;
}
i++;
}
secretcode = secretcode.substring(1);
} else {
nbenterkeys++;
}
}
}
Instance of Symbol 15 MovieClip "muter" in Frame 2
on (press) {
_root.muteallsounds++;
if (_root.muteallsounds >= 2) {
_root.muteallsounds = 0;
}
this.gotoAndStop(_root.muteallsounds + 1);
}
Instance of Symbol 18 MovieClip in Frame 2
on (press) {
_root.gotoAndStop("help");
}
Instance of Symbol 22 MovieClip "ringmaniab" in Frame 2
on (press) {
_root.levelSound.stop();
_root.levelstart = 0;
_root.gotoAndStop("play");
}
Instance of Symbol 25 MovieClip "playb" in Frame 2
on (press) {
_root.levelSound.stop();
_root.levelstart = 0;
_root.gotoAndStop("play");
}
Instance of Symbol 28 MovieClip "pepereb" in Frame 2
on (press) {
getURL ("http://www.pepere.org/flash-games_1/", "_blank");
}
Instance of Symbol 33 MovieClip "moreb" in Frame 2
on (press) {
getURL ("http://www.pepere.org/flash-games_1/", "_blank");
}
Instance of Symbol 35 MovieClip "scoreb" in Frame 2
on (press) {
getURL ("http://www.pepere.org/flash-development_1_3x/flash-game-ringmania_u_42.html", "_blank");
}
Instance of Symbol 38 MovieClip in Frame 2
on (press) {
getURL ("http://www.pepere.org/flash-development_1_3x/flash-game-ringmania_u_25.html", "_blank");
}
Frame 3
function newLight(n) {
var _local3 = _root.getFreeLayerMin(1000);
_root.scrollpanel.light.duplicateMovieClip("light_" + _local3, _local3);
_root.layers[_local3].clip = _root.scrollpanel["light_" + _local3];
_root.layers[_local3].free = false;
_root.scrollpanel["light_" + _local3]._x = n._x;
_root.scrollpanel["light_" + _local3]._y = n._y;
lights.push({node:n, layer:_local3, frame:frame});
}
function setColorSet() {
colorset = new Array();
var _local8 = 1;
while (_local8 < groundBalls.length) {
var _local2 = groundBalls[_local8]._color;
if (_local2 > -1) {
var _local4 = false;
var _local1 = 0;
while (_local1 < colorset.length) {
if (_local2 == colorset[_local1]) {
_local4 = true;
break;
}
_local1++;
}
if (!_local4) {
colorset[colorset.length] = _local2;
}
}
_local8++;
}
var _local7 = 0;
while (_local7 < stickGroups.length) {
var _local6 = stickGroups[_local7].g;
var _local9 = _local6._nodeList.length;
var _local3 = 0;
while (_local3 < _local9) {
var _local5 = _local6._nodeList[_local3];
var _local2 = _local5._color;
if (_local2 > -1) {
var _local4 = false;
var _local1 = 0;
while (_local1 < colorset.length) {
if (_local2 == colorset[_local1]) {
_local4 = true;
break;
}
_local1++;
}
if (!_local4) {
colorset[colorset.length] = _local2;
break;
}
}
_local3++;
}
_local7++;
}
}
function getCClipArray(nb) {
var _local3 = new Array();
var _local5 = nb;
var _local2 = 1;
while ((_local5 > 0) || (_local2 == 1)) {
var _local4 = _local5 % 10;
_root["c" + _local4].duplicateMovieClip("sc" + (_local2 - 1), layerLevels[_local2 - 1]);
_root["sc" + (_local2 - 1)].filters = _root["c" + _local4].filters;
_local3[_local2 - 1] = _root["sc" + (_local2 - 1)];
_local5 = (_local5 - _local4) / 10;
_local2++;
}
_local3[_local2 - 1] = -1;
_local2++;
_local3[_local2 - 1] = _root.l2;
_local2++;
_local3[_local2 - 1] = _root.e2;
_local2++;
_local3[_local2 - 1] = _root.v;
_local2++;
_local3[_local2 - 1] = _root.e1;
_local2++;
_local3[_local2 - 1] = _root.l1;
_local2++;
_local2 = 0;
while (_local2 < _local3.length) {
if (_local3[_local2] != -1) {
_local3[_local2]._y = 60;
_local3[_local2]._x = (screen.w + 400) + ((_local3.length - _local2) * levelTextSpaceW);
}
_local2++;
}
return(_local3);
}
function getSClipArray(nb) {
var _local3 = new Array();
var _local4 = nb;
_local3[0] = _root.b3;
_local3[1] = _root.b2;
_local3[2] = -1;
var _local2 = 4;
while ((_local4 > 0) || (_local2 == 4)) {
var _local5 = _local4 % 10;
_root["c" + _local5].duplicateMovieClip("sc" + (_local2 - 4), layerLevels[_local2 - 4]);
_local3[_local2 - 1] = _root["sc" + (_local2 - 4)];
_local4 = (_local4 - _local5) / 10;
_local2++;
}
_local3[_local2 - 1] = -1;
_local2++;
_local3[_local2 - 1] = _root.b1;
_local2++;
_local3[_local2 - 1] = _root.b0;
_local2++;
_local2 = 0;
while (_local2 < _local3.length) {
if (_local3[_local2] != -1) {
_local3[_local2]._y = 200;
_local3[_local2]._x = (screen.w + 400) + ((_local3.length - _local2) * levelTextSpaceW);
}
_local2++;
}
return(_local3);
}
function clearAnimLevel() {
_root.l2._y = (_root.e2._y = (_root.v._y = (_root.e1._y = (_root.l1._y = -50))));
var _local2 = 0;
while (_local2 < 10) {
_root["sc" + _local2].removeMovieClip();
_local2++;
}
}
function dispLevel(animFrame, clips) {
var _local4 = Math.cos(animFrame * 0.9) * 17;
var _local5 = (screen.w / 2) + ((clips.length * levelTextSpaceW) / 2);
var _local1 = 0;
while (_local1 < clips.length) {
if ((clips[_local1] != -1) && (animFrame >= ((clips.length - _local1) * 5))) {
var _local3 = _local5 - (_local1 * levelTextSpaceW);
if (clips[_local1]._x < (_local3 + 1E-8)) {
clips[_local1]._x = clips[_local1]._x - (((_local3 + 1E-8) - clips[_local1]._x) * 0.2);
} else {
clips[_local1]._x = clips[_local1]._x + ((_local3 - clips[_local1]._x) * 0.09);
}
clips[_local1]._rotation = _local4;
}
_local1++;
}
}
function userDead() {
_userdead = true;
}
function lgameover() {
if (lives > 0) {
lives--;
nextLevel(0);
} else {
gameover();
}
}
function gameover() {
if (!_root.gameoverbool) {
narrow = 325;
_root.gameoverbool = true;
if (replay) {
acci = acceleration + 1;
acceleration = 1;
}
if ((!replay) && (levelstart == 0)) {
if (PEPERE) {
saving = true;
save();
}
}
displayScore();
}
}
function displayScore() {
levelSound.stop();
clearAnimLevel();
levelSound.start();
theClips = getSClipArray(_score);
scoreframe = 0;
}
function newSkyGroup(n, s) {
statechanged = true;
n._groupid = skyGroups.length;
nodegroup = new NodeGroup(n, skyGroups.length);
nodegroup._speed = s;
nodegroup.trajRandom();
skyGroups.push(nodegroup);
}
function joinSkyGroup(g, gd) {
statechanged = true;
g.addGroup(gd);
delSkyGroup(gd);
}
function delSkyGroup(g) {
statechanged = true;
skyGroups.splice(g._groupid, 1);
var _local1 = g._groupid;
while (_local1 < skyGroups.length) {
skyGroups[_local1].setGroupId(_local1);
_local1++;
}
}
function delStickGroup(g) {
statechanged = true;
stickGroups.splice(g._groupid, 1);
var _local1 = g._groupid;
while (_local1 < stickGroups.length) {
stickGroups[_local1].g.setGroupId(_local1);
_local1++;
}
}
function delGroundNode(n) {
statechanged = true;
var _local5 = false;
var _local4 = 0;
while (_local4 < groundBalls.length) {
if (n._id == groundBalls[_local4]._id) {
groundBalls.splice(_local4, 1);
_local5 = true;
break;
}
_local4++;
}
if (!_local5) {
j = 0;
while (j < stickGroups.length) {
var _local6 = stickGroups[j].g;
j++;
}
j = 0;
while (j < stickGroups.length) {
var _local6 = stickGroups[j].g;
var _local3 = _local6._nodeList;
var _local2 = 0;
while (_local2 < _local3.length) {
if (_local3[_local2]._id == n._id) {
_local3.splice(_local2, 1);
_local5 = true;
break;
}
_local2++;
}
if (_local3.length <= 0) {
delStickGroup(_local6);
}
if (_local5) {
break;
}
j++;
}
}
_root.updateGroundGrid = true;
}
function delJoins(nid) {
statechanged = true;
var _local1 = joins.length - 1;
while (_local1 >= 0) {
if ((nid == joins[_local1]._n1._id) || (nid == joins[_local1]._n2._id)) {
joins[_local1].die();
joins.splice(_local1, 1);
}
_local1--;
}
}
function newGroupOnGround(g) {
statechanged = true;
var _local2 = 0;
while (_local2 < g._nodeList.length) {
g._nodeList[_local2].attachWheel();
groundBalls.push(g._nodeList[_local2]);
_local2++;
}
delSkyGroup(g);
_root.updateGroundGrid = true;
}
function newGroupOnGround3(g) {
statechanged = true;
var _local2 = 0;
while (_local2 < g._nodeList.length) {
var _local3 = g._nodeList[_local2];
groundBalls.push(_local3);
_local2++;
}
delStickGroup(g);
_root.updateGroundGrid = true;
}
function newGroupOnGround2(g, n) {
statechanged = true;
stickGroups.push({g:g, n:n});
delSkyGroup(g);
g.setGroupId(stickGroups.length - 1);
}
function nextLevel(addy) {
_root.scrollpanel.roue._x = screen.w / 2;
_root.scrollpanel.roue._y = screen.h / 2;
var _local4 = 0;
while (_local4 < skyGroups.length) {
var _local3 = skyGroups[_local4];
var _local2 = 0;
while (_local2 < _local3._nodeList.length) {
_local3._nodeList[_local2].die();
_local2++;
}
_local4++;
}
_local4 = 0;
while (_local4 < stickGroups.length) {
var _local3 = stickGroups[_local4].g;
var _local2 = 0;
while (_local2 < _local3._nodeList.length) {
_local3._nodeList[_local2].die();
_local2++;
}
_local4++;
}
skyGroups = new Array();
stickGroups = new Array();
if (addy == 1) {
_levelscore = _levelscore + (500 + Math.ceil(1000000 / (levelframe + 1000)));
if (_root._levelscore < 0) {
_root._levelscore = 0;
}
_score = _score + _levelscore;
if ((_score % 10000) < ((_score - _levelscore) % 10000)) {
newlife = true;
}
if (level < (levelManager._levels.length - 1)) {
level++;
levelframe = 0;
levelManager.loadLevel(level);
waitgo = true;
waitgoframe = 0;
} else {
gameover();
}
if (!replay) {
levelSound.start();
}
} else {
levelframe = 0;
levelManager.loadLevel(level);
waitgo = true;
waitgoframe = 0;
}
motifMinX = 0;
motifMaxX = 0;
motifMinY = 0;
motifMaxY = 0;
narrow = 0;
setBorders();
updateGroundGrid = true;
stars = 0;
laststarframe = 0;
watches = 0;
lastwatchframe = 0;
mines = 0;
lastmineframe = 0;
_ms = 1;
_msCD = -1;
}
function newBall(p, s, c) {
var _local3 = _root.getFreeLayer();
_root.scrollpanel["color" + c].duplicateMovieClip("ball_" + _local3, _local3);
_root.layers[_local3].clip = _root.scrollpanel["ball_" + _local3];
if (c == 1000) {
_root.layers[_local3].clip.insidestar._insideframe = 0;
_root.layers[_local3].clip.insidestar.onEnterFrame = function () {
this._rotation = Math.cos(this._insideframe * 0.2) * 40;
this._insideframe++;
};
} else if (c == 1003) {
_root.layers[_local3].clip.insidelife._insideframe = 0;
_root.layers[_local3].clip.insidelife.onEnterFrame = function () {
this._rotation = Math.cos(this._insideframe * 0.2) * 40;
this._insideframe++;
};
} else if (c == 1001) {
_root.layers[_local3].clip.onEnterFrame = function () {
this.ptaigu._rotation = this.ptaigu._rotation - 1;
this.graigu._rotation = this.graigu._rotation - 6;
};
} else if (c == 1002) {
_root.layers[_local3].clip.insidemine._insideframe = 0;
_root.layers[_local3].clip.insidemine.onEnterFrame = function () {
this._rotation = Math.cos(this._insideframe * 0.2) * 20;
this._insideframe++;
};
}
_root.layers[_local3].free = false;
var _local5 = new Node(_root.scrollpanel["ball_" + _local3], p.x, p.y, 0, _local3, c);
var _local7 = {x:_local5._x - _root.scrollpanel.roue._x, y:_local5._y - _root.scrollpanel.roue._y};
var _local8 = _root.getPolaire(_local7);
_local5._rotWheel = _local8.a;
var _local4 = _root.getFreeLayerMin(500);
_root.scrollpanel["arrow" + c].duplicateMovieClip("arrow_" + _local4, _local4);
_root.layers[_local4].clip = _root.scrollpanel["arrow_" + _local4];
_root.layers[_local4].clip._layer = _local4;
_root.layers[_local4].free = false;
_local5._triangle = _root.layers[_local4].clip;
_local5.posTriangle(0);
_root.newSkyGroup(_local5, s);
}
function pseudoRand(f, max) {
return(pseudoArray[f % pseudoArray.length] * max);
}
function newFall() {
if ((frame >= (lastfallframe + period)) && (_msCD == -1)) {
var _local14 = -1000000;
if (newlife) {
_local14 = 1003;
newlife = false;
} else if (((((watches < (_root.leveldifftxt * 0.34)) && (_msCD == -1)) && ((levelframe - lastwatchframe) > 1200)) && (skyGroups.length >= 6)) && (groundBalls.length > 30)) {
_local14 = 1001;
watches++;
lastwatchframe = levelframe;
} else if (skyGroups.length < (3 + (_root.leveldifftxt * 0.7))) {
if (((mines < (1 + (_root.leveldifftxt * 0.5))) && ((levelframe - lastmineframe) > 2000)) && (pseudoRand((levelframe + narrow) + groundBalls.length, 100) >= 95)) {
_local14 = 1002;
mines++;
lastmineframe = levelframe;
} else {
_local14 = _root.colorset[Math.floor(pseudoRand(levelframe + (groundBalls.length * 5), _root.colorset.length))];
}
} else if ((((stars < _root.leveldifftxt) && ((levelframe - laststarframe) > 500)) && (skyGroups.length < (6 + (_root.leveldifftxt * 0.7)))) && (pseudoRand((levelframe + narrow) + groundBalls.length, 100) >= 90)) {
_local14 = 1000;
stars++;
laststarframe = levelframe;
}
if (_local14 != -1000000) {
var _local16 = 2 + (2 / (1 + _root.skyGroups.length));
var _local15 = {x:0, y:_local16};
var _local9;
var _local8 = true;
var _local13 = 0;
while (_local8) {
_local9 = {x:(30 + narrow) + pseudoRand((levelframe + _local13) + groundBalls.length, 590 - (2 * narrow)), y:-60};
_local8 = false;
var _local5 = 0;
while ((_local5 < _root.skyGroups.length) && (!_local8)) {
var _local6 = _root.skyGroups[_local5];
var _local10 = _local6._nodeList.length;
var _local2 = 0;
while (_local2 < _local10) {
var _local3 = _local6._nodeList[_local2];
var _local4 = {x:_local3._x - _local9.x, y:_local3._y - _local9.y};
var _local7 = Math.pow(_local4.x, 2) + Math.pow(_local4.y, 2);
if (_local7 < _local3._RQ) {
_local8 = true;
_local13++;
break;
}
_local2++;
}
_local5++;
}
}
newBall(_local9, _local15, _local14);
lastfallframe = frame;
period = ((100 / (_root.leveldifftxt + 2)) + pseudoRand(levelframe + narrow, 33)) + 7;
}
}
}
function getFreeLayerMin(ml) {
found = false;
var _local1 = ml;
while (_local1 < layers.length) {
if (layers[_local1].free == true) {
found = _local1;
break;
}
_local1++;
}
if (found == false) {
found = layers.length;
layers.push({clip:-1, free:true});
}
return(found);
}
function setBorders() {
_root.leftb._x = -162.5 + narrowreal;
_root.rightb._x = 812.5 - narrowreal;
}
function getFreeLayer() {
return(getFreeLayerMin(0));
}
function updateGrid() {
grid = [[]];
motifMinX = 0;
motifMaxX = 0;
motifMinY = 0;
motifMaxY = 0;
var _local5 = groundBalls.length - 1;
while (_local5 >= 0) {
var _local2 = groundBalls[_local5];
var _local4 = _local2._x - _root.scrollpanel.roue._x;
var _local3 = _local2._y - _root.scrollpanel.roue._y;
locabs = Math.floor((_local4 + 1000) / 16);
locord = Math.floor((_local3 + 1000) / 16);
if ((_local4 - _local2._R) < motifMinX) {
motifMinX = _local4 - _local2._R;
} else if ((_local4 + _local2._R) > motifMaxX) {
motifMaxX = _local4 + _local2._R;
}
if ((_local3 - _local2._R) < motifMinY) {
motifMinY = _local3 - _local2._R;
} else if ((_local3 + _local2._R) > motifMaxY) {
motifMaxY = _local3 + _local2._R;
}
locabs1 = Math.floor(locabs / 2);
if ((locabs % 2) == 0) {
locabs2 = locabs1 - 1;
} else {
locabs2 = locabs1 + 1;
}
if (grid[locabs1].length == undefined) {
grid[locabs1] = new Array();
}
if (grid[locabs2].length == undefined) {
grid[locabs2] = new Array();
}
locord1 = Math.floor(locord / 2);
if ((locord % 2) == 0) {
locord2 = locord1 - 1;
} else {
locord2 = locord1 + 1;
}
if (grid[locabs1][locord1].length == undefined) {
grid[locabs1][locord1] = new Array();
}
grid[locabs1][locord1].push(_local2);
if (grid[locabs1][locord2].length == undefined) {
grid[locabs1][locord2] = new Array();
}
grid[locabs1][locord2].push(_local2);
if (grid[locabs2][locord1].length == undefined) {
grid[locabs2][locord1] = new Array();
}
grid[locabs2][locord1].push(_local2);
if (grid[locabs2][locord2].length == undefined) {
grid[locabs2][locord2] = new Array();
}
grid[locabs2][locord2].push(_local2);
_local5--;
}
updateGroundGrid = false;
}
function save() {
_root.backb._visible = true;
_root.message._visible = true;
_root.message.messagerouge.text = "saving...";
srecord = new LoadVars();
srecord.params = _root.game_id;
srecord.score = _root._score;
srecord.sendAndLoad("record.php", srecord, "POST");
srecord.onLoad = function () {
if (((this.result + "") != "undefined") && (this.result > 0)) {
_root.message.messagerouge.text = (this.result + " / ") + this.total;
}
_root.saving = false;
_root.backb._visible = true;
};
}
stop();
bg1._alpha = 0;
bg2._alpha = 0;
bg1._visible = false;
bg2._visible = false;
_root.message._visible = false;
var saving = false;
var levelManager = new Level();
_root.leveldifftxt = 0;
var replayid = 0;
var narrowadd = 5;
_root.rightDown = false;
_root.leftDown = false;
_root.spaceDown = false;
var lights = new Array();
var colorset = new Array();
var nbWall = 0;
if (replay) {
demoblink._visible = (avrap._visible = (avnor._visible = true));
} else {
demoblink._visible = (avrap._visible = (avnor._visible = false));
}
var layers = new Array();
layers[0] = {clip:-1, free:false};
layers[1] = {clip:-1, free:false};
var frame = 0;
var scrollVector = {x:0, y:0};
var gameoverbool = false;
var _score = 0;
var _levelscore = 0;
var _scoredisp = 0;
backb._alpha = 0;
backb._visible = false;
var _memoMouseX = _xmouse;
var _memoMouseY = _ymouse;
var backincrease = false;
var backdecrease = false;
var wheelRotSpeed = 0;
var wheelRotMaxSpeed = 6;
var wheelRotMinSpeed = (-wheelRotMaxSpeed);
var wheelRot = 0;
var memoWheelRot = 0;
var level = 0;
if ((levelstart + "") != "undefined") {
level = levelstart;
} else {
levelstart = 0;
}
var levelframe = 0;
var levelmaxframe = 1000;
if (!replay) {
record = new Array();
}
var theClips;
var levelTextSpaceW = 25;
var layerLevels = new Array();
var i = 0;
while (i < 10) {
layerLevels[i] = getFreeLayer();
layers[layerLevels[i]].free = false;
layer++;
i++;
}
_userdead = false;
var scoreframe = -1;
var groundBalls = new Array();
var joins = new Array();
var skyGroups = new Array();
var stickGroups = new Array();
if ((nodeWheel + "") == "undefined") {
_root.scrollpanel.roue._x = screen.w / 2;
_root.scrollpanel.roue._y = screen.h / 2;
nodeWheel = new Node(-1, _root.scrollpanel.roue._x, _root.scrollpanel.roue._y, 0, 0, -1);
nodeWheel._R = 14.75;
nodeWheel._RQ = 870;
}
groundBalls.push(nodeWheel);
var statechanged = true;
var maxframe = 11;
var downframegap = 1500;
var lastfallframe = -1000;
var stars = 0;
var laststarframe = 0;
var watches = 0;
var lastwatchframe = 0;
var mines = 0;
var lastmineframe = 0;
var _ms = 1;
var _msCD = -1;
var lives = 3;
var newlife = false;
var pseudoArray = [0.1, 0.4, 0.05, 0.9, 0.24, 0.7, 0.53, 0.19, 0.48, 0.1, 0.19, 0.03, 0.59, 0.12, 0.54, 0.68, 0.71, 0.95, 0.78, 0.01, 0.98, 0.57, 0.51, 0.78, 0.91, 0.57, 0.98, 0.45, 0.62, 0.78, 0.54];
var period = 60;
var narrow = 0;
var narrowreal = 0;
levelManager.loadLevel(level);
var waitgoframe = 0;
var waitgo = true;
gogo._visible = false;
var updateGroundGrid = true;
var grid = [[]];
var motifMinX = 0;
var motifMaxX = 0;
var motifMinY = 0;
var motifMaxY = 0;
var plantage = false;
var acceleration = 1;
levelSound.start();
var startFrameTime;
var startFrameTimePart;
var startFrameTimeMain;
onEnterFrame = function () {
if (!waitgo) {
var _local107 = 0;
while (_local107 < acceleration) {
if ((frame % 30) == 0) {
startFrameTimeMain = 0;
startFrameTimePart = 0;
}
var _local109 = getTimer();
if (replay) {
while (record[replayid].frame == frame) {
if (record[replayid].down) {
scrollpanel.keyDownAction(record[replayid].code);
} else {
scrollpanel.keyUpAction(record[replayid].code);
}
replayid++;
}
}
var _local95 = {x:_xmouse - _root.scrollpanel.roue._x, y:_ymouse - _root.scrollpanel.roue._y};
var _local105 = Math.sqrt(Math.pow(_local95.x, 2) + Math.pow(_local95.y, 2));
if (_local105 > 25) {
_local95.x = _local95.x * (25 / _local105);
_local95.y = _local95.y * (25 / _local105);
}
var _local108 = {x:_root.scrollpanel.roue._x, y:_root.scrollpanel.roue._y};
_root.scrollpanel.roue._x = _root.scrollpanel.roue._x + _local95.x;
_root.scrollpanel.roue._y = _root.scrollpanel.roue._y + _local95.y;
if ((_root.scrollpanel.roue._x + motifMinX) < narrow) {
_root.scrollpanel.roue._x = _root.scrollpanel.roue._x + (((narrow - motifMinX) - _root.scrollpanel.roue._x) * 0.3);
if ((_root.scrollpanel.roue._x + motifMaxX) > (650 - narrow)) {
lgameover();
}
} else if ((_root.scrollpanel.roue._x + motifMaxX) > (650 - narrow)) {
_root.scrollpanel.roue._x = _root.scrollpanel.roue._x + ((((650 - narrow) - motifMaxX) - _root.scrollpanel.roue._x) * 0.3);
if ((_root.scrollpanel.roue._x + motifMinX) < narrow) {
lgameover();
}
}
if ((_root.scrollpanel.roue._y + motifMinY) < 0) {
_root.scrollpanel.roue._y = _root.scrollpanel.roue._y + (((-motifMinY) - _root.scrollpanel.roue._y) * 0.3);
if ((_root.scrollpanel.roue._y + motifMaxY) > 650) {
lgameover();
}
} else if ((_root.scrollpanel.roue._y + motifMaxY) > 650) {
_root.scrollpanel.roue._y = _root.scrollpanel.roue._y + (((650 - motifMaxY) - _root.scrollpanel.roue._y) * 0.3);
if ((_root.scrollpanel.roue._y + motifMinY) < 0) {
lgameover();
}
}
var _local110 = {x:_root.scrollpanel.roue._x - _local108.x, y:_root.scrollpanel.roue._y - _local108.y};
if (_root.rightDown) {
wheelRotSpeed = wheelRotSpeed + 0.8;
if (wheelRotSpeed > wheelRotMaxSpeed) {
wheelRotSpeed = wheelRotMaxSpeed;
}
} else if (_root.leftDown) {
wheelRotSpeed = wheelRotSpeed - 0.8;
if (wheelRotSpeed < wheelRotMinSpeed) {
wheelRotSpeed = wheelRotMinSpeed;
}
} else {
wheelRotSpeed = wheelRotSpeed * 0.7;
}
memoWheelRot = wheelRot;
if (Math.abs(wheelRotSpeed) < 0.05) {
wheelRotSpeed = 0;
} else {
wheelRot = wheelRot + wheelRotSpeed;
updateGroundGrid = true;
var _local106 = groundBalls.length - 1;
while (_local106 >= 0) {
var _local96 = groundBalls[_local106];
_local96.wheel(wheelRot);
_local106--;
}
_local106 = 0;
while (_local106 < joins.length) {
joins[_local106].wheel(wheelRot);
_local106++;
}
}
var _local8;
var _local113;
var _local116;
var _local7;
var _local115;
var _local114;
var _local22;
var _local106 = groundBalls.length - 1;
while (_local106 >= 0) {
var _local96 = groundBalls[_local106];
_local96.memo();
_local96.trans();
_local106--;
}
_local106 = 0;
while (_local106 < joins.length) {
joins[_local106].trans();
_local106++;
}
_local106 = 0;
while (_local106 < skyGroups.length) {
nodegroup = skyGroups[_local106];
nodegroup.memo();
nodegroup.move();
if (nodegroup._in && ((((nodegroup._x > (700 - narrow)) || (nodegroup._x < (-50 + narrow))) || (nodegroup._y > 700)) || (nodegroup._y < -50))) {
nodegroup.die();
delSkyGroup(nodegroup);
narrow = narrow + narrowadd;
if (narrow > 325) {
narrow = 325;
}
setBorders();
}
_local106++;
}
_local106 = 0;
while (_local106 < stickGroups.length) {
nodegroup = stickGroups[_local106].g;
nodegroup.memo();
nodegroup.move();
nodegroup.constraint(stickGroups[_local106].n);
_local106++;
}
var _local111 = getTimer();
if (updateGroundGrid) {
updateGrid();
}
startFrameTimePart = startFrameTimePart + (getTimer() - _local111);
var _local42 = wheelRotSpeed;
var _local10 = _local110;
var _local71 = -1;
var _local99 = 0;
var _local52 = 1;
while ((_local71 != 0) && (_local99 < 15)) {
var _local5 = new Array();
_local106 = skyGroups.length - 1;
while (_local106 >= 0) {
var nodegroup = skyGroups[_local106];
var _local87 = nodegroup._nodeList.length;
var _local43 = _local87 - 1;
while (_local43 >= 0) {
var _local11 = nodegroup._nodeList[_local43];
var _local14 = new Array();
var _local32 = (_local11._x - _root.scrollpanel.roue._x) + 1000;
var _local31 = (_local11._y - _root.scrollpanel.roue._y) + 1000;
_local22 = [{x:_local32 + _local11._R, y:_local31}, {x:_local32, y:_local31 + _local11._R}, {x:_local32 - _local11._R, y:_local31}, {x:_local32, y:_local31 - _local11._R}];
var _local29 = 0;
while (_local29 < 4) {
_local8 = Math.floor(_local22[_local29].x / 32);
_local7 = Math.floor(_local22[_local29].y / 32);
if (grid[_local8][_local7].length != undefined) {
var _local76 = grid[_local8][_local7].length - 1;
while (_local76 >= 0) {
var _local27 = grid[_local8][_local7][_local76];
var _local28 = false;
var _local65 = _local14.length - 1;
while (_local65 >= 0) {
if (_local14[_local65]._id == _local27._id) {
_local28 = true;
break;
}
_local65--;
}
if (!_local28) {
_local14.push(_local27);
}
_local76--;
}
}
_local29++;
}
_local29 = 0;
while (_local29 < _local14.length) {
var _local33 = _local14[_local29];
var _local74 = {x:_local11._x - _local33._x, y:_local11._y - _local33._y};
var _local92 = Math.pow(_local74.x, 2) + Math.pow(_local74.y, 2);
if (_local92 < _local33._RQ) {
if ((_local33._color == -2) && ((_local11._color < 1000) || (_local11._color == 1002))) {
_local5.push({ground:_local33, fly:_local11, stick:-3, rap:1});
} else {
_local5.push({ground:_local33, fly:_local11, stick:-1, rap:1});
}
}
_local29++;
}
_local29 = 0;
while (_local29 < stickGroups.length) {
var _local38 = stickGroups[_local29].g;
var _local63 = _local38._nodeList.length;
var _local76 = 0;
while (_local76 < _local63) {
var _local33 = _local38._nodeList[_local76];
var _local74 = {x:_local11._x - _local33._x, y:_local11._y - _local33._y};
var _local92 = Math.pow(_local74.x, 2) + Math.pow(_local74.y, 2);
if (_local92 < _local33._RQ) {
_local5.push({ground:_local33, fly:_local11, stick:-1, rap:1});
}
_local76++;
}
_local29++;
}
_local29 = _local106 - 1;
while (_local29 >= 0) {
var _local39 = skyGroups[_local29];
var _local62 = _local39._nodeList.length;
var _local76 = _local62 - 1;
while (_local76 >= 0) {
var _local15 = _local39._nodeList[_local76];
var _local74 = {x:_local11._x - _local15._x, y:_local11._y - _local15._y};
var _local92 = Math.pow(_local74.x, 2) + Math.pow(_local74.y, 2);
if (_local92 < _local15._RQ) {
_local5.push({ground:_local15, fly:_local11, stick:-2, rap:1});
}
_local76--;
}
_local29--;
}
_local43--;
}
_local106--;
}
_local106 = 0;
while (_local106 < stickGroups.length) {
var nodegroup = stickGroups[_local106].g;
var _local13 = stickGroups[_local106].n;
var _local50 = _local13._join._n1;
if (_local50._id == _local13._id) {
_local50 = _local13._join._n2;
}
var _local87 = nodegroup._nodeList.length;
var _local43 = 0;
while (_local43 < _local87) {
var _local11 = nodegroup._nodeList[_local43];
var _local14 = new Array();
var _local32 = (_local11._x - _root.scrollpanel.roue._x) + 1000;
var _local31 = (_local11._y - _root.scrollpanel.roue._y) + 1000;
_local22 = [{x:_local32 + _local11._R, y:_local31}, {x:_local32, y:_local31 + _local11._R}, {x:_local32 - _local11._R, y:_local31}, {x:_local32, y:_local31 - _local11._R}];
var _local29 = 0;
while (_local29 < 4) {
_local8 = Math.floor(_local22[_local29].x / 32);
_local7 = Math.floor(_local22[_local29].y / 32);
if (grid[_local8][_local7].length != undefined) {
var _local76 = grid[_local8][_local7].length - 1;
while (_local76 >= 0) {
var _local27 = grid[_local8][_local7][_local76];
var _local28 = false;
var _local65 = _local14.length - 1;
while (_local65 >= 0) {
if (_local14[_local65]._id == _local27._id) {
_local28 = true;
break;
}
_local65--;
}
if (!_local28) {
_local14.push(_local27);
}
_local76--;
}
}
_local29++;
}
_local29 = 0;
while (_local29 < _local14.length) {
var _local33 = _local14[_local29];
if (!((_local50._id == _local33._id) && (_local13._id == _local11._id))) {
if (_local33._color == -2) {
var _local9 = 5;
var _local17 = {x:_local11._xM, y:_local11._yM};
var _local54 = (_local11._x - _local11._xM) / _local9;
var _local53 = (_local11._y - _local11._yM) / _local9;
var _local16 = {x:_local33._xM, y:_local33._yM};
var _local56 = (_local33._x - _local33._xM) / _local9;
var _local55 = (_local33._y - _local33._yM) / _local9;
var _local76 = 0;
while (_local76 < _local9) {
_local17.x = _local17.x + _local54;
_local17.y = _local17.y + _local53;
_local16.x = _local16.x + _local56;
_local16.y = _local16.y + _local55;
var _local74 = {x:_local17.x - _local16.x, y:_local17.y - _local16.y};
var _local92 = Math.pow(_local74.x, 2) + Math.pow(_local74.y, 2);
if (_local92 < _local33._RQ) {
var _local21 = (_local76 + 1) / _local9;
if (_local52 >= _local21) {
_local52 = _local21;
}
_local5.push({ground:_local33, fly:_local11, stick:stickGroups[_local106], rap:_local21});
break;
}
_local76++;
}
} else {
var _local74 = {x:_local11._x - _local33._x, y:_local11._y - _local33._y};
var _local92 = Math.pow(_local74.x, 2) + Math.pow(_local74.y, 2);
if (_local92 < _local33._RQ) {
_local5.push({ground:_local33, fly:_local11, stick:stickGroups[_local106], rap:1});
}
}
}
_local29++;
}
_local29 = _local106 + 1;
while (_local29 < stickGroups.length) {
var _local39 = stickGroups[_local29].g;
var _local84 = stickGroups[_local29].n;
var _local62 = _local39._nodeList.length;
var _local76 = 0;
while (_local76 < _local62) {
var _local15 = _local39._nodeList[_local76];
var _local74 = {x:_local15._x - _local11._x, y:_local15._y - _local11._y};
var _local92 = Math.pow(_local74.x, 2) + Math.pow(_local74.y, 2);
if (_local92 < _local15._RQ) {
_local5.push({ground:_local15, fly:_local11, stick:stickGroups[_local106], rap:1});
}
_local76++;
}
_local29++;
}
_local43++;
}
_local106++;
}
_local71 = _local5.length;
if (_local71 >= 1) {
if (_local71 > 1) {
}
var _local85 = _local52;
var _local83 = 0;
var _local4;
var _local25 = _local71;
var _local86 = 0;
var _local2 = -1;
var _local3 = -1;
var _local6 = -1;
var _local88 = 1000000 /* 0x0F4240 */;
var _local89 = 1000000 /* 0x0F4240 */;
var _local67 = true;
while (((((_local25 != 1) && (_local67)) || ((_local25 != 0) && (!_local67))) || (_local88 > 0.2)) && (_local86 < 20)) {
_local4 = (_local85 + _local83) / 2;
_local25 = 0;
var _local43 = 0;
while (_local43 < _local5.length) {
var _local33 = _local5[_local43].ground;
var _local57 = {x:_local33._xM + ((_local33._x - _local33._xM) * _local4), y:_local33._yM + ((_local33._y - _local33._yM) * _local4)};
var _local11 = _local5[_local43].fly;
var _local34 = {x:_local11._xM + ((_local11._x - _local11._xM) * _local4), y:_local11._yM + ((_local11._y - _local11._yM) * _local4)};
if (_local11._stickfly != -1) {
var _local82 = _local11._stickground;
var _local59 = _local11._stickfly;
var _local35 = {x:_local59._x - _local82._x, y:_local59._y - _local82._y};
var _local61 = Math.sqrt(Math.pow(_local35.x, 2) + Math.pow(_local35.y, 2));
var _local70 = 2 * _local82._R;
var _local60 = (_local70 - _local61) / _local61;
var _local64 = {x:_local35.x * _local60, y:_local35.y * _local60};
_local34.x = _local34.x + _local64.x;
_local34.y = _local34.y + _local64.y;
}
var _local74 = {x:_local34.x - _local57.x, y:_local34.y - _local57.y};
var _local92 = Math.pow(_local74.x, 2) + Math.pow(_local74.y, 2);
if (_local92 < _local33._RQ) {
_local2 = _local11;
_local3 = _local33;
_local6 = _local5[_local43].stick;
_local67 = (_local6 > -2) && (_local3._color != -2);
_local25++;
}
_local43++;
}
if (_local25 >= 1) {
_local85 = _local4;
} else if (_local25 < 1) {
_local83 = _local4;
}
if (_local25 <= 1) {
_local88 = Math.abs(_local92 - _local89);
_local89 = _local92;
}
_local86++;
}
_local42 = (1 - _local4) * _local42;
_local10.x = (1 - _local4) * _local10.x;
_local10.y = (1 - _local4) * _local10.y;
var _local98 = {x:_local3._x - _local3._xM, y:_local3._y - _local3._yM};
_local106 = 0;
while (_local106 < groundBalls.length) {
groundBalls[_local106]._xM = groundBalls[_local106]._xM + ((groundBalls[_local106]._x - groundBalls[_local106]._xM) * _local4);
groundBalls[_local106]._yM = groundBalls[_local106]._yM + ((groundBalls[_local106]._y - groundBalls[_local106]._yM) * _local4);
_local106++;
}
_local106 = 0;
while (_local106 < skyGroups.length) {
var nodegroup = skyGroups[_local106];
var _local87 = nodegroup._nodeList.length;
var _local43 = 0;
while (_local43 < _local87) {
var _local11 = nodegroup._nodeList[_local43];
_local11._xM = _local11._xM + ((_local11._x - _local11._xM) * _local4);
_local11._yM = _local11._yM + ((_local11._y - _local11._yM) * _local4);
_local43++;
}
_local106++;
}
_local106 = 0;
while (_local106 < stickGroups.length) {
var nodegroup = stickGroups[_local106].g;
var _local87 = nodegroup._nodeList.length;
var _local43 = 0;
while (_local43 < _local87) {
var _local11 = nodegroup._nodeList[_local43];
_local11._xM = _local11._xM + ((_local11._x - _local11._xM) * _local4);
_local11._yM = _local11._yM + ((_local11._y - _local11._yM) * _local4);
_local43++;
}
nodegroup.mconstraint(stickGroups[_local106].n);
_local106++;
}
if (_local6 == -3) {
bumpSound.start();
var _local19 = skyGroups[_local2._groupid];
var _local44 = {x:_local2._xM - _local3._xM, y:_local2._yM - _local3._yM};
var _local58 = {x:_local44.y, y:-_local44.x};
var _local47 = getNewCoord(_local19._speed, _local58, _local44);
var _local46 = getNewCoord(_local98, _local58, _local44);
_local47.b = _local46.b;
_local19._speed.x = (_local47.a * _local58.x) + (_local47.b * _local44.x);
_local19._speed.y = (_local47.a * _local58.y) + (_local47.b * _local44.y);
_local106 = 0;
while (_local106 < _local19._nodeList.length) {
_local19._nodeList[_local106]._x = _local19._nodeList[_local106]._xM + ((_local19._speed.x * _root._ms) * (1 - _local4));
_local19._nodeList[_local106]._y = _local19._nodeList[_local106]._yM + ((_local19._speed.y * _root._ms) * (1 - _local4));
_local106++;
}
_local19.bari();
_local19.constraintnodes(_local3, _local2, 2, true);
} else if (_local6 == -2) {
var _local19 = skyGroups[_local2._groupid];
var _local18 = skyGroups[_local3._groupid];
var _local44 = {x:_local2._xM - _local3._xM, y:_local2._yM - _local3._yM};
var _local58 = {x:_local44.y, y:-_local44.x};
var _local47 = getNewCoord(_local19._speed, _local58, _local44);
var _local46 = getNewCoord(_local18._speed, _local58, _local44);
var _local81 = (_local47.b + _local46.b) / 2;
_local47.b = _local81 - ((_local47.b - _local81) * 0.9);
_local46.b = _local81 - ((_local46.b - _local81) * 0.9);
_local18._speed.x = (_local46.a * _local58.x) + (_local46.b * _local44.x);
_local18._speed.y = (_local46.a * _local58.y) + (_local46.b * _local44.y);
_local19._speed.x = (_local47.a * _local58.x) + (_local47.b * _local44.x);
_local19._speed.y = (_local47.a * _local58.y) + (_local47.b * _local44.y);
_local106 = 0;
while (_local106 < _local19._nodeList.length) {
_local19._nodeList[_local106]._x = _local19._nodeList[_local106]._xM + ((_local19._speed.x * _root._ms) * (1 - _local4));
_local19._nodeList[_local106]._y = _local19._nodeList[_local106]._yM + ((_local19._speed.y * _root._ms) * (1 - _local4));
_local106++;
}
_local19.bari();
_local106 = 0;
while (_local106 < _local18._nodeList.length) {
_local18._nodeList[_local106]._x = _local18._nodeList[_local106]._xM + ((_local18._speed.x * _root._ms) * (1 - _local4));
_local18._nodeList[_local106]._y = _local18._nodeList[_local106]._yM + ((_local18._speed.y * _root._ms) * (1 - _local4));
_local106++;
}
_local18.bari();
} else if (_local6 == -1) {
_local2.delTriangle();
var _local26 = skyGroups[_local2._groupid];
if (_local2._color >= 1000) {
if (_local2._color == 1000) {
exploSound.start();
_levelscore = _levelscore + 50;
var _local37 = _root.getFreeLayerMin(1000);
_root.scrollpanel.bonuspoints.duplicateMovieClip("bp_" + _local37, _local37);
_root.layers[_local37].clip = _root.scrollpanel["bp_" + _local37];
_root.layers[_local37].clip._layer = _local37;
_root.layers[_local37].clip._x = _local2._x;
_root.layers[_local37].clip._y = _local2._y;
_root.layers[_local37].free = false;
delSkyGroup(_local26);
_local2.die();
} else if (_local2._color == 1003) {
exploSound.start();
lives = lives + 1;
var _local37 = _root.getFreeLayerMin(1000);
_root.scrollpanel.bonuslife.duplicateMovieClip("live_" + _local37, _local37);
_root.layers[_local37].clip = _root.scrollpanel["live_" + _local37];
_root.layers[_local37].clip._layer = _local37;
_root.layers[_local37].clip._x = _local2._x;
_root.layers[_local37].clip._y = _local2._y;
_root.layers[_local37].free = false;
delSkyGroup(_local26);
_local2.die();
} else if (_local2._color == 1001) {
exploSound.start();
_msCD = 300;
_ms = 0.2;
var _local37 = _root.getFreeLayerMin(1000);
_root.scrollpanel.freeze.duplicateMovieClip("bp_" + _local37, _local37);
_root.layers[_local37].clip = _root.scrollpanel["bp_" + _local37];
_root.layers[_local37].clip._layer = _local37;
_root.layers[_local37].clip._x = _local2._x;
_root.layers[_local37].clip._y = _local2._y;
_root.layers[_local37].free = false;
delSkyGroup(_local26);
_local2.die();
} else if (_local2._color == 1002) {
exploSound.start();
if (_local3._color != -1) {
var _local36 = new Array();
var _local40 = new Array();
_local40.push(_local3);
var _local75 = _local3;
_local36.push(_local75);
var _local43 = 0;
while (_local43 < _local75._contactNodes.length) {
var _local30 = _local75._contactNodes[_local43];
var _local51 = false;
var _local29 = 0;
while (_local29 < _local40.length) {
var _local66 = _local40[_local29];
if (_local66._id == _local30._id) {
_local51 = true;
break;
}
_local29++;
}
if (!_local51) {
var _local41 = false;
if (_local30._color != -1) {
var _local20 = _local30.getAllNodesExcept(_local40, "");
_local29 = _local20.length - 1;
while (_local29 >= 0) {
if (_local20[_local29]._color == -1) {
_local41 = true;
break;
}
_local29--;
}
} else {
_local41 = true;
}
_local20.push(_local30);
if (!_local41) {
_local29 = _local20.length - 1;
while (_local29 >= 0) {
_local36.push(_local20[_local29]);
_local29--;
}
}
}
_local43++;
}
delSkyGroup(_local26);
_local2.die();
_local106 = 0;
while (_local106 < _local36.length) {
delGroundNode(_local36[_local106]);
_local106++;
}
updateGrid();
_local106 = 0;
while (_local106 < _local36.length) {
_local75 = _local36[_local106];
_local75.die();
delJoins(_local75._id);
_local106++;
}
if (groundBalls.length == (1 + nbWall)) {
nextLevel(1);
} else {
setColorSet();
}
} else {
delSkyGroup(_local26);
_local2.die();
}
}
} else {
if (_local3._join != -1) {
var _local80 = stickGroups[_local3._groupid].g;
_local106 = 0;
while (_local106 < _local80._nodeList.length) {
var _local13 = _local80._nodeList[_local106];
_local13._x = _local13._xM;
_local13._y = _local13._yM;
_local13._x = _local13._x + _local10.x;
_local13._y = _local13._y + _local10.y;
var _local91 = {x:_local13._x - _root.scrollpanel.roue._x, y:_local13._y - _root.scrollpanel.roue._y};
var _local78 = getPolaire(_local91);
_local13._rWheel = _local78.d;
_local13._rotWheel = _local78.a - (((wheelRot - _local42) * Math.PI) / 180);
_local13.wheelMove(wheelRot);
_local106++;
}
_local3.updateJoinPos();
var _local104 = {x:_local3._join._x - _root.scrollpanel.roue._x, y:_local3._join._y - _root.scrollpanel.roue._y};
var _local97 = getPolaire(_local104);
_local3._join._rWheel = _local97.d;
_local3._join._rotWheel = _local97.a - ((wheelRot * Math.PI) / 180);
_local3._join.wheel(wheelRot);
newGroupOnGround3(_local80);
_local3._join = -1;
}
if (_local3._color == -1) {
_local106 = 0;
while (_local106 < _local26._nodeList.length) {
var _local12 = _local26._nodeList[_local106];
_local12._x = _local12._xM;
_local12._y = _local12._yM;
_local12._x = _local12._x + _local10.x;
_local12._y = _local12._y + _local10.y;
var _local91 = {x:_local12._x - _root.scrollpanel.roue._x, y:_local12._y - _root.scrollpanel.roue._y};
var _local78 = getPolaire(_local91);
_local12._rWheel = _local78.d;
_local12._rotWheel = _local78.a - (((wheelRot - _local42) * Math.PI) / 180);
_local12.wheelMove(wheelRot);
_local106++;
}
var _local65 = 0;
while (_local65 < _local26._nodeList.length) {
var _local77 = _local26._nodeList[_local65];
var _local91 = {x:_local77._x - _root.scrollpanel.roue._x, y:_local77._y - _root.scrollpanel.roue._y};
var _local92 = Math.pow(_local91.x, 2) + Math.pow(_local91.y, 2);
_local65++;
}
lockSound.start();
}
if (_local3._color != -1) {
prelockSound.start();
var _local48 = {_x:(_local2._x + _local3._x) / 2, _y:(_local2._y + _local3._y) / 2};
var _local23 = _root.getFreeLayerMin(500);
_root.scrollpanel.joint.duplicateMovieClip("joint_" + _local23, _local23);
_root.layers[_local23].clip = _root.scrollpanel["joint_" + _local23];
_root.layers[_local23].free = false;
var _local49 = new Join(_root.scrollpanel["joint_" + _local23], _local48._x, _local48._y, 0, _local23, _local3, _local2);
joins.push(_local49);
_local2._join = _local49;
_local106 = 0;
while (_local106 < _local26._nodeList.length) {
var _local12 = _local26._nodeList[_local106];
_local12._stickground = _local3;
_local12._stickfly = _local2;
_local106++;
}
_local26.constraint(_local2);
if (_local2._color == _local3._color) {
flyColorNodes = _local2.getAllColorNodesExcept([_local2], _local2._color);
groundColorNodes = _local3.getAllColorNodesExcept([_local3], _local3._color);
if ((flyColorNodes.length + groundColorNodes.length) >= 3) {
exploSound.start();
var _local36 = new Array();
var _local40 = new Array();
var _local29 = 0;
while (_local29 < groundColorNodes.length) {
_local40.push(groundColorNodes[_local29]);
_local29++;
}
_local106 = 0;
while (_local106 < groundColorNodes.length) {
var _local75 = groundColorNodes[_local106];
_local36.push(_local75);
var _local43 = 0;
while (_local43 < _local75._contactNodes.length) {
var _local30 = _local75._contactNodes[_local43];
var _local51 = false;
_local29 = 0;
while (_local29 < _local40.length) {
var _local66 = _local40[_local29];
if (_local66._id == _local30._id) {
_local51 = true;
break;
}
_local29++;
}
if (!_local51) {
var _local41 = false;
if (_local30._color != -1) {
var _local20 = _local30.getAllNodesExcept(_local40, "");
_local29 = _local20.length - 1;
while (_local29 >= 0) {
if (_local20[_local29]._color == -1) {
_local41 = true;
break;
}
_local29--;
}
} else {
_local41 = true;
}
_local20.push(_local30);
if (!_local41) {
_local29 = _local20.length - 1;
while (_local29 >= 0) {
_local36.push(_local20[_local29]);
_local29--;
}
}
}
_local43++;
}
_local106++;
}
delSkyGroup(_local26);
_local106 = 0;
while (_local106 < _local36.length) {
delGroundNode(_local36[_local106]);
_local106++;
}
updateGrid();
_local106 = 0;
while (_local106 < _local26._nodeList.length) {
var _local75 = _local26._nodeList[_local106];
_local36.push(_local75);
_local106++;
}
_local106 = 0;
while (_local106 < _local36.length) {
var _local75 = _local36[_local106];
_local75.die();
delJoins(_local75._id);
_local106++;
}
if (groundBalls.length == (1 + nbWall)) {
nextLevel(1);
} else {
setColorSet();
}
} else {
newGroupOnGround2(_local26, _local2);
}
} else {
newGroupOnGround2(_local26, _local2);
}
} else {
newGroupOnGround(_local26);
}
_local2.newContactNode(_local3);
_local3.newContactNode(_local2);
newLight(_local2);
}
} else {
var _local26 = _local6.g;
var _local82 = _local6.n._join._n1;
if (_local82._id == _local6.n._id) {
_local82 = _local6.n._join._n2;
}
if (_local3._color == -2) {
_local26.mconstraintnodes(_local3, _local6.n, 0.01);
var _local73 = {x:_local6.n._x - _local3._x, y:_local6.n._y - _local3._y};
var _local90 = Math.sqrt(Math.pow(_local73.x, 2) + Math.pow(_local73.y, 2));
if (_local90 > 0) {
_local26._speed = {x:(_local73.x * 2) / _local90, y:(_local73.y * 2) / _local90};
}
_local106 = 0;
while (_local106 < _local26._nodeList.length) {
var _local12 = _local26._nodeList[_local106];
_local12._x = _local12._xM;
_local12._y = _local12._yM;
_local12._x = _local12._x + _local10.x;
_local12._y = _local12._y + _local10.y;
var _local91 = {x:_local12._x - _root.scrollpanel.roue._x, y:_local12._y - _root.scrollpanel.roue._y};
var _local78 = getPolaire(_local91);
_local12._rWheel = _local78.d;
_local12._rotWheel = _local78.a - (((wheelRot - _local42) * Math.PI) / 180);
_local12.wheelMove(wheelRot);
_local106++;
}
_local6.n.updateJoinPos();
bumpSound.start();
} else {
if (_local3._join != -1) {
var _local80 = stickGroups[_local3._groupid].g;
_local106 = 0;
while (_local106 < _local80._nodeList.length) {
var _local13 = _local80._nodeList[_local106];
_local13._x = _local13._xM;
_local13._y = _local13._yM;
_local13._x = _local13._x + _local10.x;
_local13._y = _local13._y + _local10.y;
var _local91 = {x:_local13._x - _root.scrollpanel.roue._x, y:_local13._y - _root.scrollpanel.roue._y};
var _local78 = getPolaire(_local91);
_local13._rWheel = _local78.d;
_local13._rotWheel = _local78.a - (((wheelRot - _local42) * Math.PI) / 180);
_local13.wheelMove(wheelRot);
_local106++;
}
_local3.updateJoinPos();
var _local104 = {x:_local3._join._x - _root.scrollpanel.roue._x, y:_local3._join._y - _root.scrollpanel.roue._y};
var _local97 = getPolaire(_local104);
_local3._join._rWheel = _local97.d;
_local3._join._rotWheel = _local97.a - ((wheelRot * Math.PI) / 180);
_local3._join.wheel(wheelRot);
newGroupOnGround3(_local80);
_local3._join = -1;
}
_local106 = 0;
while (_local106 < _local26._nodeList.length) {
var _local12 = _local26._nodeList[_local106];
_local12._x = _local12._xM;
_local12._y = _local12._yM;
_local12._x = _local12._x + _local10.x;
_local12._y = _local12._y + _local10.y;
var _local91 = {x:_local12._x - _root.scrollpanel.roue._x, y:_local12._y - _root.scrollpanel.roue._y};
var _local78 = getPolaire(_local91);
_local12._rWheel = _local78.d;
_local12._rotWheel = _local78.a - (((wheelRot - _local42) * Math.PI) / 180);
_local12.wheelMove(wheelRot);
_local106++;
}
_local6.n.updateJoinPos();
var _local104 = {x:_local6.n._join._x - _root.scrollpanel.roue._x, y:_local6.n._join._y - _root.scrollpanel.roue._y};
var _local97 = getPolaire(_local104);
_local6.n._join._rWheel = _local97.d;
_local6.n._join._rotWheel = _local97.a - ((wheelRot * Math.PI) / 180);
_local6.n._join.wheel(wheelRot);
var _local68 = Array();
var _local29 = 0;
while (_local29 < groundBalls.length) {
var _local33 = groundBalls[_local29];
if ((_local33._id != _local82._id) && (_local33._color != -2)) {
var _local74 = {x:_local2._xM - _local33._xM, y:_local2._yM - _local33._yM};
var _local92 = Math.pow(_local74.x, 2) + Math.pow(_local74.y, 2);
if (_local92 < (_local33._RQ + 150)) {
_local68.push(_local33);
}
}
_local29++;
}
var _local93 = false;
_local29 = 0;
while (_local29 < _local68.length) {
var _local24 = _local68[_local29];
_local2.newContactNode(_local24);
_local24.newContactNode(_local2);
if (_local24._color != -1) {
var _local48 = {_x:(_local2._x + _local24._x) / 2, _y:(_local2._y + _local24._y) / 2};
var _local91 = {x:_local48._x - _root.scrollpanel.roue._x, y:_local48._y - _root.scrollpanel.roue._y};
var _local69 = getPolaire(_local91);
var _local23 = _root.getFreeLayerMin(500);
_root.scrollpanel.joint.duplicateMovieClip("joint_" + _local23, _local23);
_root.layers[_local23].clip = _root.scrollpanel["joint_" + _local23];
_root.layers[_local23].free = false;
var _local49 = new Join(_root.scrollpanel["joint_" + _local23], _local48._x, _local48._y, 0, _local23, _local24, _local2);
joins.push(_local49);
_local49._rWheel = _local69.d;
_local49._rotWheel = _local69.a - ((wheelRot * Math.PI) / 180);
_local49.wheel(wheelRot);
if (_local24._color == _local2._color) {
_local93 = true;
}
}
_local29++;
}
var _local94 = false;
if (_local93) {
groundColorNodes = _local2.getAllColorNodesExcept([_local2], _local2._color);
if (groundColorNodes.length >= 3) {
_local94 = true;
newGroupOnGround3(_local26);
var _local36 = new Array();
var _local40 = new Array();
_local29 = 0;
while (_local29 < groundColorNodes.length) {
_local40.push(groundColorNodes[_local29]);
_local29++;
}
_local106 = 0;
while (_local106 < groundColorNodes.length) {
var _local75 = groundColorNodes[_local106];
_local36.push(_local75);
var _local43 = 0;
while (_local43 < _local75._contactNodes.length) {
var _local30 = _local75._contactNodes[_local43];
var _local51 = false;
_local29 = 0;
while (_local29 < _local40.length) {
var _local66 = _local40[_local29];
if (_local66._id == _local30._id) {
_local51 = true;
break;
}
_local29++;
}
if (!_local51) {
var _local41 = false;
if (_local30._color != -1) {
var _local20 = _local30.getAllNodesExcept(_local40, "");
_local29 = _local20.length - 1;
while (_local29 >= 0) {
if (_local20[_local29]._color == -1) {
_local41 = true;
break;
}
_local29--;
}
} else {
_local41 = true;
}
_local20.push(_local30);
if (!_local41) {
_local29 = _local20.length - 1;
while (_local29 >= 0) {
_local36.push(_local20[_local29]);
_local29--;
}
}
}
_local43++;
}
_local106++;
}
_local106 = 0;
while (_local106 < _local36.length) {
delGroundNode(_local36[_local106]);
_local106++;
}
updateGrid();
_local106 = 0;
while (_local106 < _local36.length) {
var _local75 = _local36[_local106];
_local75.die();
delJoins(_local75._id);
_local106++;
}
if (groundBalls.length == (1 + nbWall)) {
nextLevel(1);
} else {
setColorSet();
}
} else {
newGroupOnGround3(_local26);
}
} else {
newGroupOnGround3(_local26);
}
if (!_local94) {
lockSound.start();
} else {
exploSound.start();
}
_local2._join = -1;
}
}
}
_local99++;
}
if (!gameoverbool) {
newFall();
if (levelframe <= 175) {
if (levelframe == 1) {
theClips = getCClipArray(level + 1);
} else if (levelframe > 1) {
if (levelframe == 175) {
clearAnimLevel();
} else {
dispLevel(levelframe, theClips);
}
}
}
} else if (scoreframe >= 0) {
if (scoreframe == 250) {
if (!saving) {
clearAnimLevel();
_root.message._visible = false;
scoreframe = -1;
_root.gotoAndStop(1);
}
} else {
dispLevel(scoreframe, theClips);
scoreframe++;
}
}
if (backincrease) {
if (!_root.gameoverbool) {
backb._alpha = backb._alpha + 5;
}
if (backb._alpha > 100) {
backincrease = false;
}
} else {
if (backdecrease) {
backb._alpha = backb._alpha - 5;
if (backb._alpha <= 0) {
backb._visible = false;
backdecrease = false;
}
}
if ((_xmouse != _memoMouseX) || (_ymouse != _memoMouseY)) {
if (backb._alpha < 100) {
backincrease = true;
}
if (backb._alpha <= 0) {
backb._visible = true;
}
} else if (backb._alpha > 0) {
backdecrease = true;
}
}
_memoMouseX = _xmouse;
_memoMouseY = _ymouse;
if (!gameoverbool) {
_local106 = 0;
while (_local106 < stickGroups.length) {
nodegroup = stickGroups[_local106].g;
stickGroups[_local106].n.updateJoinPos();
nodegroup.show();
_local106++;
}
if (!waitgo) {
_local106 = 0;
while (_local106 < groundBalls.length) {
groundBalls[_local106].show();
_local106++;
}
_local106 = 0;
while (_local106 < joins.length) {
joins[_local106].show();
_local106++;
}
}
_local106 = 0;
while (_local106 < skyGroups.length) {
nodegroup = skyGroups[_local106];
nodegroup.show();
_local106++;
}
var _local76 = lights.length - 1;
while (_local76 >= 0) {
var _local45 = lights[_local76];
if ((_local45.frame + 7) < frame) {
layers[_local45.layer].free = true;
layers[_local45.layer].clip.removeMovieClip();
lights.splice(_local76, 1);
} else {
layers[_local45.layer].clip._x = _local45.node._x;
layers[_local45.layer].clip._y = _local45.node._y;
}
_local76--;
}
}
frame++;
levelframe++;
startFrameTimeMain = startFrameTimeMain + (getTimer() - _local109);
if (_msCD > -1) {
_msCD--;
if (_msCD == -1) {
_ms = 1;
}
}
_local107++;
}
} else {
waitgoframe++;
var _local112 = Math.floor(waitgoframe / 3);
var _local106 = 0;
while (_local106 < _local112) {
groundBalls[_local106].show();
_local106++;
}
if (_local112 == groundBalls.length) {
if (replay) {
waitgo = false;
_levelscore = 0;
} else {
gogo._visible = true;
gogo.gotoAndPlay(1);
_local106 = 0;
while (_local106 < joins.length) {
joins[_local106].show();
_local106++;
}
}
} else if ((_local112 % 3) == 0) {
}
}
if (((narrowreal - narrow) > 0.05) || ((narrowreal - narrow) < -0.05)) {
narrowreal = narrowreal + ((narrow - narrowreal) * 0.1);
setBorders();
}
};
Instance of Symbol 97 MovieClip "scrollpanel" in Frame 3
onClipEvent (keyUp) {
t = Key.getCode();
a = Key.getAscii();
if (a == 115) {
_root.traceState();
} else if (!_root.replay) {
if (keyUpAction(t)) {
_root.record.push({frame:_root.frame, down:false, code:t});
}
}
}
onClipEvent (keyDown) {
if (!_root.replay) {
t = Key.getCode();
if (keyDownAction(t)) {
_root.record.push({frame:_root.frame, down:true, code:t});
}
}
}
onClipEvent (load) {
function keyDownAction(t) {
toreturn = false;
return(toreturn);
}
function keyUpAction(t) {
toreturn = false;
return(toreturn);
}
_root._rs = 0;
_root.rightDown = false;
_root.leftDown = false;
}
Instance of Symbol 129 MovieClip "backb" in Frame 3
on (press) {
if (!_root.gameoverbool) {
_root.clearAnimLevel();
_root.gotoAndStop("intro");
}
}
Instance of Symbol 138 MovieClip "gogo" in Frame 3
on (press) {
_root.waitgo = false;
_root.gogo.gotoAndPlay(11);
_root._levelscore = 0;
}
Frame 4
stop();
Instance of Symbol 129 MovieClip "backb" in Frame 4
on (press) {
var i = 1;
while (i < _root.total) {
_root["tile" + i].removeMovieClip();
i++;
}
_root.tile0._visible = false;
_root.gotoAndStop("intro");
}
Symbol 156 MovieClip [__Packages.Level] Frame 0
class Level
{
var _levels;
function Level () {
_levels = Array();
_levels = [["easyrider", 5, {p:{x:295.32, y:323.94, c:4}, c:[0]}, {p:{x:354.3, y:325, c:5}, c:[0]}, {p:{x:324.96, y:354.5, c:1}, c:[0, 8]}, {p:{x:325.97, y:295.52, c:2}, c:[0, 7]}, {p:{x:243.95, y:324, c:-1}, c:[]}, {p:{x:404.95, y:324, c:-1}, c:[]}, {p:{x:325.95, y:266.02, c:1}, c:[10]}, {p:{x:324.95, y:384, c:2}, c:[9]}, {p:{x:324.95, y:413.5, c:5}, c:[]}, {p:{x:326.97, y:236.54, c:4}, c:[]}], ["triviaaaa", 9, {p:{x:326.4, y:459.25, c:-1}, c:[]}, {p:{x:324.95, y:190.65, c:-1}, c:[]}, {p:{x:439.05, y:443.35, c:-2}, c:[]}, {p:{x:210.85, y:440.45, c:-2}, c:[]}, {p:{x:236.95, y:414.95, c:1}, c:[7]}, {p:{x:414.95, y:415.95, c:1}, c:[8]}, {p:{x:257.81, y:394.09, c:7}, c:[]}, {p:{x:394.09, y:395.09, c:7}, c:[]}, {p:{x:489.6, y:324.95, c:-2}, c:[]}, {p:{x:204.97, y:208.68, c:-2}, c:[]}, {p:{x:160.3, y:324.95, c:-2}, c:[]}, {p:{x:443.35, y:207.95, c:-2}, c:[]}, {p:{x:395.95, y:255, c:7}, c:[15]}, {p:{x:252.95, y:254, c:7}, c:[16]}, {p:{x:416.81, y:234.14, c:1}, c:[]}, {p:{x:232.09, y:233.14, c:1}, c:[]}], ["corridorr", 7, {p:{x:287.95, y:173, c:-2}, c:[]}, {p:{x:363.95, y:217, c:-2}, c:[]}, {p:{x:285.95, y:215, c:-2}, c:[]}, {p:{x:364.95, y:261, c:-2}, c:[]}, {p:{x:363.95, y:173, c:-2}, c:[]}, {p:{x:283.95, y:260, c:-2}, c:[]}, {p:{x:365.95, y:309, c:-2}, c:[]}, {p:{x:283.95, y:307, c:-2}, c:[]}, {p:{x:324.97, y:295.5, c:1}, c:[0, 10]}, {p:{x:324.95, y:266, c:6}, c:[11]}, {p:{x:324.95, y:236.5, c:7}, c:[12]}, {p:{x:326.02, y:207.02, c:4}, c:[]}], ["collimaco", 10, {p:{x:315.76, y:453.97, c:7}, c:[6, 7]}, {p:{x:370.88, y:437.09, c:0}, c:[8, 6]}, {p:{x:383.32, y:381.18, c:3}, c:[4, 8]}, {p:{x:374.1, y:353.16, c:5}, c:[5]}, {p:{x:353.43, y:332.11, c:4}, c:[0]}, {p:{x:345.15, y:451.52, c:6}, c:[]}, {p:{x:289.66, y:440.21, c:1}, c:[9]}, {p:{x:384.01, y:410.67, c:2}, c:[]}, {p:{x:278.3, y:412.99, c:3}, c:[10]}, {p:{x:290.37, y:386.07, c:6}, c:[11]}, {p:{x:318.04, y:375.86, c:4}, c:[12]}, {p:{x:339.87, y:395.7, c:7}, c:[13]}, {p:{x:324.72, y:421.01, c:-1}, c:[]}], ["hamacbaby", 15, {p:{x:191.19, y:173.72, c:-1}, c:[11]}, {p:{x:468.43, y:171.67, c:-1}, c:[7]}, {p:{x:329.25, y:217.15, c:2}, c:[4, 8]}, {p:{x:360.21, y:215.15, c:1}, c:[5]}, {p:{x:389.12, y:209.25, c:6}, c:[6]}, {p:{x:417.36, y:200.73, c:4}, c:[7]}, {p:{x:444.2, y:188.49, c:2}, c:[]}, {p:{x:299.78, y:215.91, c:1}, c:[9]}, {p:{x:270.88, y:209.99, c:6}, c:[10]}, {p:{x:242.34, y:202.14, c:4}, c:[11]}, {p:{x:215.05, y:191.06, c:2}, c:[]}], ["riverball", 6, {p:{x:404.95, y:383, c:-1}, c:[6]}, {p:{x:243.95, y:384, c:-1}, c:[8]}, {p:{x:404.95, y:324, c:-1}, c:[6]}, {p:{x:243.95, y:325, c:-1}, c:[8]}, {p:{x:324.96, y:354.5, c:3}, c:[0, 9]}, {p:{x:404.95, y:353.5, c:7}, c:[]}, {p:{x:325.97, y:295.52, c:2}, c:[0]}, {p:{x:243.95, y:354.5, c:1}, c:[]}, {p:{x:324.95, y:384, c:-1}, c:[10]}, {p:{x:324.95, y:413.5, c:4}, c:[]}], ["pinocchio", 12, {p:{x:249.5, y:250.9, c:-2}, c:[]}, {p:{x:404.75, y:252.25, c:-2}, c:[]}, {p:{x:259.67, y:351.54, c:6}, c:[8, 10]}, {p:{x:298.68, y:395.64, c:6}, c:[7, 10]}, {p:{x:355.66, y:395.77, c:6}, c:[7, 11]}, {p:{x:391.79, y:350.12, c:6}, c:[9, 11]}, {p:{x:327.15, y:403.35, c:1}, c:[]}, {p:{x:245.35, y:325.75, c:-1}, c:[]}, {p:{x:406.15, y:324.35, c:-1}, c:[]}, {p:{x:277.73, y:374.87, c:4}, c:[]}, {p:{x:377.48, y:375.91, c:4}, c:[]}, {p:{x:339.09, y:299.19, c:7}, c:[0, 13]}, {p:{x:309.6, y:299.72, c:0}, c:[0]}], ["trapezeee", 7, {p:{x:186.3, y:324.95, c:-1}, c:[11]}, {p:{x:466.5, y:326.4, c:-1}, c:[12]}, {p:{x:405.8, y:246.95, c:-2}, c:[]}, {p:{x:404.4, y:402.9, c:-2}, c:[]}, {p:{x:245.5, y:404.35, c:-2}, c:[]}, {p:{x:246.95, y:248.4, c:-2}, c:[]}, {p:{x:270.95, y:383, c:1}, c:[]}, {p:{x:270.95, y:272, c:4}, c:[]}, {p:{x:383.95, y:272, c:5}, c:[]}, {p:{x:380.95, y:379, c:7}, c:[]}, {p:{x:156.8, y:324.95, c:0}, c:[]}, {p:{x:496, y:326.4, c:2}, c:[]}], ["excellent", 1, {p:{x:324.95, y:209, c:-2}, c:[]}, {p:{x:324.95, y:440.95, c:-2}, c:[]}, {p:{x:441.95, y:325, c:-2}, c:[]}, {p:{x:208, y:324, c:-2}, c:[]}, {p:{x:254.2, y:254.15, c:-1}, c:[18]}, {p:{x:397.15, y:252.75, c:-1}, c:[19]}, {p:{x:392.1, y:394.88, c:-1}, c:[17]}, {p:{x:251.3, y:394.25, c:-1}, c:[20]}, {p:{x:324.95, y:295.5, c:1}, c:[0, 13, 16]}, {p:{x:324.97, y:354.5, c:1}, c:[0, 14, 15]}, {p:{x:354.25, y:323.21, c:7}, c:[0, 13, 15]}, {p:{x:295.3, y:324.95, c:7}, c:[0, 14, 16]}, {p:{x:354.4, y:293.71, c:5}, c:[19]}, {p:{x:295.47, y:354.45, c:5}, c:[20]}, {p:{x:351.17, y:352.55, c:6}, c:[17]}, {p:{x:295.45, y:295.45, c:6}, c:[18]}, {p:{x:370.3, y:375.01, c:4}, c:[]}, {p:{x:275.85, y:274.19, c:4}, c:[]}, {p:{x:379.14, y:276.12, c:3}, c:[]}, {p:{x:273.82, y:374.48, c:3}, c:[]}], ["mountains", 15, {p:{x:326.83, y:235.85, c:7}, c:[10, 19, 2]}, {p:{x:356.14, y:239.13, c:0}, c:[5, 10, 12]}, {p:{x:257.82, y:299.2, c:3}, c:[11, 24]}, {p:{x:308.28, y:209.59, c:5}, c:[9, 13, 6, 19]}, {p:{x:374.6, y:215.42, c:7}, c:[10, 8, 12]}, {p:{x:289.81, y:186.59, c:0}, c:[9, 18]}, {p:{x:392.76, y:271.44, c:3}, c:[12, 23, 15]}, {p:{x:364.59, y:187.67, c:5}, c:[10, 16]}, {p:{x:279.12, y:214.08, c:7}, c:[19, 14]}, {p:{x:345.56, y:210.21, c:0}, c:[13]}, {p:{x:256.3, y:268.48, c:3}, c:[14, 24]}, {p:{x:385.41, y:242.87, c:5}, c:[]}, {p:{x:327.3, y:187.04, c:7}, c:[16, 18]}, {p:{x:268.19, y:241.48, c:0}, c:[19]}, {p:{x:392.47, y:300.94, c:3}, c:[23]}, {p:{x:346.33, y:164.5, c:5}, c:[17]}, {p:{x:327.87, y:141.49, c:7}, c:[18]}, {p:{x:308.85, y:164.04, c:0}, c:[]}, {p:{x:297.35, y:236.99, c:5}, c:[]}, {p:{x:309.76, y:299.62, c:1}, c:[0, 21, 22, 24, 25]}, {p:{x:341.53, y:300.7, c:1}, c:[0, 22, 23, 26]}, {p:{x:326.49, y:275.32, c:4}, c:[]}, {p:{x:367.07, y:285.93, c:6}, c:[]}, {p:{x:282.96, y:283.77, c:6}, c:[]}, {p:{x:295.3, y:325.33, c:4}, c:[0]}, {p:{x:354.21, y:327.34, c:4}, c:[0]}, {p:{x:325.95, y:426.95, c:-2}, c:[]}], ["reboundss", 10, {p:{x:243.95, y:402.95, c:-2}, c:[]}, {p:{x:323.95, y:403.95, c:-2}, c:[]}, {p:{x:404.95, y:403.95, c:-2}, c:[]}, {p:{x:244.95, y:243, c:-2}, c:[]}, {p:{x:325.95, y:244, c:-2}, c:[]}, {p:{x:404.95, y:244, c:-2}, c:[]}, {p:{x:405.95, y:326, c:-2}, c:[]}, {p:{x:243.95, y:325, c:-2}, c:[]}, {p:{x:345.78, y:345.74, c:2}, c:[0, 10, 14]}, {p:{x:317.33, y:353.54, c:1}, c:[0, 12]}, {p:{x:303.82, y:304.26, c:6}, c:[0, 12, 13]}, {p:{x:296.35, y:332.8, c:4}, c:[0]}, {p:{x:332.27, y:296.46, c:5}, c:[0, 14]}, {p:{x:353.25, y:317.2, c:3}, c:[0]}], ["umbrellaa", 12, {p:{x:228.53, y:191.28, c:-1}, c:[2]}, {p:{x:253.99, y:176.38, c:-1}, c:[3]}, {p:{x:281.63, y:166.08, c:-1}, c:[4]}, {p:{x:310.5, y:160, c:-1}, c:[5, 12]}, {p:{x:340, y:160, c:-1}, c:[6, 12]}, {p:{x:369.04, y:165.19, c:-1}, c:[7]}, {p:{x:396.33, y:176.39, c:-1}, c:[8]}, {p:{x:421.42, y:191.91, c:-1}, c:[]}, {p:{x:339.79, y:240.52, c:0}, c:[10, 11, 15]}, {p:{x:310.29, y:240.66, c:2}, c:[11, 15]}, {p:{x:324.92, y:215.05, c:1}, c:[12, 13, 14]}, {p:{x:325.25, y:185.55, c:6}, c:[13, 14]}, {p:{x:350.63, y:200.59, c:5}, c:[]}, {p:{x:299.54, y:200.01, c:3}, c:[]}, {p:{x:325.16, y:266.14, c:-1}, c:[16]}, {p:{x:324.95, y:295.5, c:-1}, c:[0]}], ["diamondss", 15, {p:{x:407.95, y:406.95, c:7}, c:[]}, {p:{x:324.95, y:463.95, c:0}, c:[]}, {p:{x:186, y:323, c:3}, c:[]}, {p:{x:463.95, y:326, c:5}, c:[]}, {p:{x:324.95, y:186, c:4}, c:[]}, {p:{x:244.95, y:244, c:6}, c:[]}, {p:{x:243.95, y:405.95, c:1}, c:[]}, {p:{x:402.95, y:245, c:2}, c:[]}], ["inposible", 3, {p:{x:295.3, y:324.95, c:5}, c:[0, 6]}, {p:{x:326.43, y:295.54, c:-2}, c:[0]}, {p:{x:354.26, y:326.49, c:5}, c:[0, 4]}, {p:{x:340.08, y:352.36, c:6}, c:[0, 6, 7]}, {p:{x:326.4, y:239.75, c:-1}, c:[]}, {p:{x:310.58, y:352.4, c:7}, c:[0, 7]}, {p:{x:325.36, y:377.93, c:1}, c:[]}, {p:{x:259.95, y:294.6, c:-2}, c:[]}, {p:{x:391.4, y:293.15, c:-2}, c:[]}, {p:{x:259.95, y:241.15, c:-1}, c:[]}, {p:{x:392.8, y:238.3, c:-1}, c:[]}, {p:{x:196.4, y:294.6, c:-2}, c:[]}, {p:{x:454.9, y:294.6, c:-2}, c:[]}], ["hexagones", 17, {p:{x:353.33, y:317.48, c:7}, c:[0, 2, 4, 12, 13, 14]}, {p:{x:345.57, y:345.95, c:0}, c:[0, 7, 14, 9, 17]}, {p:{x:296.27, y:332.52, c:3}, c:[0, 6, 7, 16, 10, 18]}, {p:{x:332.55, y:296.54, c:5}, c:[0, 6, 8, 11, 12]}, {p:{x:283.26, y:283.11, c:4}, c:[6, 8, 18]}, {p:{x:304.03, y:304.05, c:6}, c:[0, 8, 18]}, {p:{x:317.05, y:353.46, c:1}, c:[0, 17, 15, 16]}, {p:{x:311.78, y:275.59, c:2}, c:[11]}, {p:{x:366.34, y:366.89, c:2}, c:[14, 17]}, {p:{x:267.75, y:340.03, c:1}, c:[16, 18]}, {p:{x:340.31, y:268.07, c:6}, c:[12]}, {p:{x:361.08, y:289.02, c:4}, c:[13]}, {p:{x:381.85, y:309.97, c:5}, c:[14]}, {p:{x:374.1, y:338.43, c:3}, c:[]}, {p:{x:309.29, y:381.93, c:7}, c:[17, 16]}, {p:{x:288.52, y:360.98, c:0}, c:[]}, {p:{x:337.82, y:374.41, c:3}, c:[]}, {p:{x:275.5, y:311.57, c:7}, c:[]}], ["mirrorsss", 10, {p:{x:229.65, y:324.95, c:-1}, c:[10, 9]}, {p:{x:418.8, y:323.5, c:-1}, c:[12]}, {p:{x:326.4, y:426.05, c:-1}, c:[7, 8]}, {p:{x:323.5, y:228.2, c:-1}, c:[5, 6]}, {p:{x:294, y:228.2, c:5}, c:[]}, {p:{x:353, y:228.2, c:5}, c:[]}, {p:{x:297.06, y:422.95, c:5}, c:[]}, {p:{x:355.75, y:423.1, c:5}, c:[]}, {p:{x:228.09, y:295.49, c:1}, c:[]}, {p:{x:231.13, y:354.41, c:1}, c:[]}, {p:{x:418.8, y:293.15, c:1}, c:[]}, {p:{x:418.8, y:353, c:1}, c:[]}, {p:{x:295.3, y:324.95, c:4}, c:[0, 17, 19]}, {p:{x:354.3, y:324.95, c:4}, c:[0, 18, 20]}, {p:{x:323.47, y:354.47, c:7}, c:[0, 19, 20]}, {p:{x:324.95, y:295.5, c:7}, c:[0, 17, 18]}, {p:{x:295.45, y:295.45, c:3}, c:[]}, {p:{x:354.44, y:294.53, c:3}, c:[]}, {p:{x:293.97, y:354.42, c:3}, c:[]}, {p:{x:352.97, y:354.42, c:3}, c:[]}], ["groupeeer", 17, {p:{x:354.3, y:325, c:4}, c:[0, 5, 7, 9, 10]}, {p:{x:324.98, y:354.5, c:6}, c:[0, 7, 8, 16, 15]}, {p:{x:326.16, y:295.53, c:1}, c:[0, 5, 6, 11, 12]}, {p:{x:295.3, y:325, c:2}, c:[0, 8, 6, 13, 14]}, {p:{x:355.66, y:295.53, c:5}, c:[9, 11]}, {p:{x:294.94, y:295.5, c:3}, c:[12, 13]}, {p:{x:354.48, y:354.5, c:0}, c:[10, 16]}, {p:{x:295.48, y:354.5, c:7}, c:[14, 15]}, {p:{x:380.5, y:311.44, c:2}, c:[10]}, {p:{x:379.94, y:339.6, c:1}, c:[]}, {p:{x:340.91, y:269.98, c:6}, c:[12]}, {p:{x:310.57, y:270.48, c:4}, c:[]}, {p:{x:269.58, y:310.56, c:5}, c:[14]}, {p:{x:269.84, y:339.9, c:3}, c:[]}, {p:{x:310.23, y:380.05, c:0}, c:[16]}, {p:{x:339.73, y:380.05, c:7}, c:[]}, {p:{x:405.95, y:408.95, c:-2}, c:[]}, {p:{x:242.95, y:404.95, c:-2}, c:[]}, {p:{x:406.95, y:243, c:-2}, c:[]}, {p:{x:245.95, y:242, c:-2}, c:[]}], ["flowersss", 10, {p:{x:353.33, y:317.48, c:7}, c:[0, 2, 4]}, {p:{x:345.57, y:345.95, c:0}, c:[0, 7]}, {p:{x:296.27, y:332.52, c:3}, c:[0, 6, 7]}, {p:{x:332.55, y:296.54, c:5}, c:[0, 6]}, {p:{x:169.02, y:349.41, c:4}, c:[16, 20, 14]}, {p:{x:304.03, y:304.05, c:6}, c:[0]}, {p:{x:317.05, y:353.46, c:1}, c:[0]}, {p:{x:198.98, y:298.59, c:2}, c:[15, 20, 12]}, {p:{x:478.63, y:350.63, c:2}, c:[19, 17, 10]}, {p:{x:495.36, y:326.33, c:1}, c:[18, 19]}, {p:{x:453.27, y:297.37, c:6}, c:[13, 19, 18]}, {p:{x:169.48, y:298.32, c:4}, c:[20, 14]}, {p:{x:436.54, y:321.67, c:5}, c:[17, 19]}, {p:{x:154.5, y:323.73, c:3}, c:[20]}, {p:{x:213.5, y:324.27, c:7}, c:[16, 20]}, {p:{x:198.52, y:349.68, c:0}, c:[20]}, {p:{x:449.23, y:348.3, c:3}, c:[19]}, {p:{x:482.67, y:299.7, c:7}, c:[19]}, {p:{x:465.95, y:324, c:-1}, c:[]}, {p:{x:184, y:324, c:-1}, c:[]}], ["diagonale", 12, {p:{x:403.95, y:243, c:-1}, c:[6, 7]}, {p:{x:243.95, y:402.95, c:-1}, c:[5, 8]}, {p:{x:303.49, y:304.6, c:2}, c:[0]}, {p:{x:345.74, y:345.78, c:1}, c:[0]}, {p:{x:264.84, y:382.12, c:6}, c:[]}, {p:{x:385.35, y:265.9, c:4}, c:[]}, {p:{x:425.34, y:222.68, c:5}, c:[]}, {p:{x:223.09, y:423.81, c:3}, c:[]}, {p:{x:345.15, y:303.64, c:0}, c:[0]}, {p:{x:302.47, y:344.28, c:7}, c:[0]}], ["splitscre", 14, {p:{x:350.5, y:218, c:2}, c:[3, 9, 10]}, {p:{x:299.4, y:218, c:1}, c:[4, 9, 10]}, {p:{x:350.5, y:188.5, c:7}, c:[5, 10, 11]}, {p:{x:299.4, y:188.5, c:0}, c:[6, 10, 11]}, {p:{x:350.5, y:159, c:3}, c:[7, 11, 12]}, {p:{x:299.4, y:159, c:5}, c:[8, 11, 12]}, {p:{x:350.5, y:129.5, c:4}, c:[12, 13]}, {p:{x:299.4, y:129.5, c:6}, c:[12, 13]}, {p:{x:324.95, y:232.75, c:-1}, c:[0, 10]}, {p:{x:324.95, y:203.25, c:-1}, c:[11]}, {p:{x:324.95, y:173.75, c:-1}, c:[12]}, {p:{x:324.95, y:144.25, c:-1}, c:[13]}, {p:{x:324.95, y:114.75, c:-1}, c:[]}, {p:{x:324.44, y:383.9, c:-1}, c:[18, 15]}, {p:{x:323.94, y:413.39, c:-1}, c:[16]}, {p:{x:323.95, y:442.89, c:-1}, c:[17]}, {p:{x:323.95, y:472.39, c:-1}, c:[]}, {p:{x:324.96, y:354.5, c:-1}, c:[0]}], ["squaresss", 8, {p:{x:169, y:323.95, c:2}, c:[7, 2]}, {p:{x:169, y:294.45, c:1}, c:[3]}, {p:{x:169, y:264.95, c:6}, c:[4]}, {p:{x:169, y:235.45, c:4}, c:[5]}, {p:{x:169, y:205.95, c:5}, c:[9]}, {p:{x:169, y:412.45, c:3}, c:[10, 8]}, {p:{x:167.95, y:353.43, c:0}, c:[8]}, {p:{x:169, y:382.95, c:7}, c:[]}, {p:{x:169, y:176.45, c:-1}, c:[11]}, {p:{x:169, y:441.92, c:2}, c:[12]}, {p:{x:198.46, y:174.92, c:1}, c:[15]}, {p:{x:169, y:471.42, c:-1}, c:[13]}, {p:{x:198.49, y:471.98, c:6}, c:[14]}, {p:{x:228, y:470.95, c:4}, c:[19]}, {p:{x:227.96, y:175, c:5}, c:[16]}, {p:{x:257.44, y:173.82, c:3}, c:[17]}, {p:{x:286.94, y:174.07, c:0}, c:[18]}, {p:{x:316.44, y:173.99, c:7}, c:[36]}, {p:{x:257.47, y:472.04, c:2}, c:[20]}, {p:{x:286.97, y:471.98, c:1}, c:[21]}, {p:{x:316.47, y:472.04, c:6}, c:[22]}, {p:{x:345.97, y:471.94, c:4}, c:[23]}, {p:{x:375.47, y:471.95, c:5}, c:[24]}, {p:{x:404.95, y:470.91, c:3}, c:[25]}, {p:{x:434.45, y:470.9, c:0}, c:[27]}, {p:{x:464.95, y:440.33, c:7}, c:[28, 27]}, {p:{x:463.93, y:469.81, c:-1}, c:[]}, {p:{x:464.95, y:410.83, c:2}, c:[29]}, {p:{x:465.95, y:381.76, c:1}, c:[30]}, {p:{x:465.96, y:352.26, c:6}, c:[31]}, {p:{x:465.84, y:322.76, c:4}, c:[32]}, {p:{x:467, y:293.29, c:5}, c:[33]}, {p:{x:465.95, y:263.81, c:3}, c:[34]}, {p:{x:465.99, y:234.31, c:0}, c:[35]}, {p:{x:465.11, y:204.82, c:7}, c:[40]}, {p:{x:345.94, y:174, c:2}, c:[37]}, {p:{x:375.44, y:174, c:1}, c:[38]}, {p:{x:404.92, y:172.97, c:6}, c:[39]}, {p:{x:434.4, y:173.87, c:5}, c:[40]}, {p:{x:463.86, y:175.35, c:-1}, c:[]}], ["thebigone", 1, {p:{x:174.75, y:323.5, c:-2}, c:[]}, {p:{x:475.15, y:323.5, c:-2}, c:[]}, {p:{x:186.3, y:262.85, c:-1}, c:[32]}, {p:{x:463.6, y:265.75, c:-1}, c:[33]}, {p:{x:186.28, y:382.7, c:-1}, c:[19]}, {p:{x:463.6, y:382.7, c:-1}, c:[18]}, {p:{x:218.1, y:428.9, c:-2}, c:[]}, {p:{x:430.35, y:430.35, c:-2}, c:[]}, {p:{x:267.2, y:462.15, c:-1}, c:[28]}, {p:{x:385.6, y:462.15, c:-1}, c:[29]}, {p:{x:324.95, y:473.7, c:-2}, c:[]}, {p:{x:220.95, y:218.05, c:-2}, c:[]}, {p:{x:431.8, y:218.05, c:-2}, c:[]}, {p:{x:400.05, y:323.5, c:-2}, c:[]}, {p:{x:248.4, y:323.5, c:-2}, c:[]}, {p:{x:326.4, y:173.3, c:-2}, c:[]}, {p:{x:324.96, y:354.5, c:-1}, c:[0, 26, 23, 22]}, {p:{x:434.1, y:382.7, c:7}, c:[21]}, {p:{x:215.74, y:384.18, c:7}, c:[20]}, {p:{x:245.21, y:385.66, c:0}, c:[24]}, {p:{x:404.64, y:384.21, c:0}, c:[25]}, {p:{x:298.48, y:367.5, c:3}, c:[24, 26, 45]}, {p:{x:350.5, y:369.26, c:3}, c:[25, 26, 46]}, {p:{x:274.54, y:384.74, c:5}, c:[45]}, {p:{x:375.14, y:384.15, c:5}, c:[46]}, {p:{x:324.95, y:384, c:4}, c:[27]}, {p:{x:326.42, y:413.46, c:6}, c:[31, 30]}, {p:{x:282.78, y:437.1, c:1}, c:[31]}, {p:{x:371.16, y:436.43, c:1}, c:[30]}, {p:{x:355.9, y:414.47, c:2}, c:[]}, {p:{x:297.14, y:413.78, c:2}, c:[]}, {p:{x:215.76, y:264.33, c:7}, c:[34]}, {p:{x:434.1, y:265.75, c:7}, c:[35]}, {p:{x:245.26, y:264.3, c:0}, c:[36]}, {p:{x:404.6, y:265.75, c:0}, c:[37]}, {p:{x:274.76, y:264.32, c:5}, c:[38]}, {p:{x:375.1, y:265.75, c:5}, c:[39]}, {p:{x:304.75, y:264.3, c:3}, c:[40]}, {p:{x:345.6, y:265.75, c:3}, c:[40]}, {p:{x:324.42, y:286.28, c:1}, c:[41, 42]}, {p:{x:300.32, y:303.3, c:6}, c:[43]}, {p:{x:348.57, y:303.23, c:6}, c:[44]}, {p:{x:284.74, y:328.35, c:4}, c:[45]}, {p:{x:361.93, y:329.53, c:4}, c:[46]}, {p:{x:271.82, y:354.87, c:2}, c:[]}, {p:{x:376.14, y:354.67, c:2}, c:[]}, {p:{x:324.8, y:325, c:-2}, c:[]}]];
}
function loadLevel(l) {
var _local12 = _root.groundBalls.length - 1;
while (_local12 > 0) {
_root.groundBalls[1].die();
_root.delJoins(_root.groundBalls[1]._id);
_root.delGroundNode(_root.groundBalls[1]);
_local12--;
}
Node.gid = 1;
var _local13 = _levels[l];
_root.levelnametxt = _local13[0];
_root.leveldifftxt = _local13[1];
_root.nbWall = 0;
_local12 = 2;
while (_local12 < _local13.length) {
var _local19 = _local13[_local12];
if (_local19.p.c <= -1) {
_root.nbWall++;
}
var _local20 = _root.scrollpanel["color" + _local19.p.c];
var _local3 = _root.getFreeLayer();
_local20.duplicateMovieClip("ball_" + _local3, _local3);
_root.layers[_local3].clip = _root.scrollpanel["ball_" + _local3];
_root.layers[_local3].free = false;
var _local5 = new Node(_root.scrollpanel["ball_" + _local3], _local19.p.x, _local19.p.y, 0, _local3, _local19.p.c);
var _local10 = {x:_local5._x - _root.scrollpanel.roue._x, y:_local5._y - _root.scrollpanel.roue._y};
var _local16 = _root.getPolaire(_local10);
_local5._rWheel = _local16.d;
_local5._rotWheel = _local16.a - ((_root.wheelRot * Math.PI) / 180);
_root.groundBalls.push(_local5);
_local12++;
}
_local12 = 2;
while (_local12 < _local13.length) {
var _local19 = _local13[_local12];
var _local5 = _root.groundBalls[(_local12 + 1) - 2];
var _local11 = _local19.c;
var _local7 = 0;
while (_local7 < _local11.length) {
var _local4 = _root.groundBalls[_local11[_local7]];
if ((_local4._color != -1) && (_local5._color != -1)) {
var _local6 = {_x:(_local5._x + _local4._x) / 2, _y:(_local5._y + _local4._y) / 2};
var _local10 = {x:_local6._x - _root.scrollpanel.roue._x, y:_local6._y - _root.scrollpanel.roue._y};
var _local9 = _root.getPolaire(_local10);
var _local3 = _root.getFreeLayerMin(500);
_root.scrollpanel.joint.duplicateMovieClip("joint_" + _local3, _local3);
_root.layers[_local3].clip = _root.scrollpanel["joint_" + _local3];
_root.layers[_local3].free = false;
var _local8 = new Join(_root.scrollpanel["joint_" + _local3], _local6._x, _local6._y, 0, _local3, _local5, _local4);
_root.joins.push(_local8);
_local8._rWheel = _local9.d;
_local8._rotWheel = _local9.a - ((_root.wheelRot * Math.PI) / 180);
}
_local5.newContactNode(_local4);
_local4.newContactNode(_local5);
_local7++;
}
_local12++;
}
_root.setColorSet();
_local12 = 0;
while (_local12 < _root.joins.length) {
_root.joins[_local12].wheel(_root.wheelRot);
_local12++;
}
_local12 = _root.groundBalls.length - 1;
while (_local12 >= 0) {
var _local21 = _root.groundBalls[_local12];
_local21.wheel(_root.wheelRot);
_local12--;
}
}
function levelString() {
var _local5 = ((("[\"" + _root.levelname.text) + "\",") + _root.leveldiff.text) + ",";
var _local6 = 1;
while (_local6 < _root.groundBalls.length) {
var _local2 = _root.groundBalls[_local6];
if (_local6 > 1) {
_local5 = _local5 + ",";
}
_local5 = _local5 + (((((("{p:{x:" + (Math.round(_local2._x * 100) / 100)) + ",y:") + (Math.round(_local2._y * 100) / 100)) + ",c:") + _local2._color) + "},c:[");
var _local7 = true;
var _local3 = 0;
while (_local3 < _local2._contactNodes.length) {
var _local4 = _local2._contactNodes[_local3];
if ((_local4._id == 0) || (_local4._id > _local2._id)) {
if (!_local7) {
_local5 = _local5 + ",";
} else {
_local7 = false;
}
_local5 = _local5 + ("" + _local4._id);
}
_local3++;
}
_local5 = _local5 + "]}";
_local6++;
}
_local5 = _local5 + "]";
return(_local5);
}
}
Symbol 157 MovieClip [__Packages.Node] Frame 0
class Node
{
static var gid;
var _layer, _clip, _x, _y, _rot, _xM, _yM, _rotM, _contactNodes, _diffX, _diffY;
function Node (clip, x, y, rotation, l, c) {
_layer = l;
_color = c;
_clip = clip;
_x = x;
_y = y;
_rot = rotation;
_xM = _x;
_yM = _y;
_rotM = _rot;
_contactNodes = new Array();
if ((gid + "") == "undefined") {
gid = 0;
}
_id = gid++;
}
function show() {
_clip._x = _x;
_clip._y = _y;
_clip._rotation = _rot;
_clip._visible = true;
}
function hide() {
_clip._visible = false;
}
function wheel(newRot) {
var _local2 = (newRot * Math.PI) / 180;
_diffX = _rWheel * Math.cos(_rotWheel + _local2);
_diffY = _rWheel * Math.sin(_rotWheel + _local2);
}
function wheelMove(newRot) {
wheel(newRot);
trans();
}
function trans() {
_x = _root.scrollpanel.roue._x + _diffX;
_y = _root.scrollpanel.roue._y + _diffY;
}
function back() {
_x = _xM;
_y = _yM;
_rot = _rotM;
}
function memo() {
_xM = _x;
_yM = _y;
_rotM = _rot;
}
function inContactWheel() {
return(_contactWheel);
}
function attachWheel() {
if (!inContactWheel()) {
_contactWheel = true;
var _local2 = 0;
while (_local2 < _contactNodes.length) {
_contactNodes[_local2].attachWheel();
_local2++;
}
}
}
function newContactNode(n) {
_contactNodes.push(n);
if (n.inContactWheel()) {
attachWheel();
}
}
function deleteNode(n) {
var _local2 = 0;
while (_local2 < _contactNodes.length) {
if (n._id == _contactNodes[_local2]._id) {
_contactNodes.splice(_local2, 1);
break;
}
_local2++;
}
}
function getAllNodesExcept(n, traces) {
var _local7 = new Array();
_local7.push(this);
var _local2 = 0;
while (_local2 < n.length) {
_local2++;
}
n.push(this);
var _local3 = 0;
while (_local3 < _contactNodes.length) {
var _local6 = false;
_local2 = 0;
while (_local2 < n.length) {
if (n[_local2]._id == _contactNodes[_local3]._id) {
_local6 = true;
break;
}
_local2++;
}
if (!_local6) {
if (_contactNodes[_local3]._color != -1) {
var _local5 = _contactNodes[_local3].getAllNodesExcept(n, traces + " ");
_local2 = 0;
while (_local2 < _local5.length) {
_local7.push(_local5[_local2]);
_local2++;
}
} else {
_local7.push(_contactNodes[_local3]);
}
}
_local3++;
}
return(_local7);
}
function getAllColorNodesExcept(n, c) {
var _local7 = new Array();
if (_color == c) {
_local7.push(this);
}
var _local3 = 0;
while (_local3 < _contactNodes.length) {
var _local6 = false;
var _local2 = 0;
while (_local2 < n.length) {
if (n[_local2]._id == _contactNodes[_local3]._id) {
_local6 = true;
break;
}
_local2++;
}
if ((!_local6) && (_contactNodes[_local3]._color == c)) {
n.push(_contactNodes[_local3]);
var _local5 = _contactNodes[_local3].getAllColorNodesExcept(n, c);
_local2 = 0;
while (_local2 < _local5.length) {
_local7.push(_local5[_local2]);
_local2++;
}
}
_local3++;
}
return(_local7);
}
function delTriangle() {
if (_triangle != -1) {
_triangle.gotoAndPlay(6);
_triangle = -1;
}
}
function maybeDelTriangle() {
if (_triangle != -1) {
if ((((_x > (10 + _root.narrow)) && (_x < (640 - _root.narrow))) && (_y > 10)) && (_y < 640)) {
delTriangle();
return(true);
}
return(false);
}
return(false);
}
function posTriangle(r) {
if (r == 0) {
if (_x < 10) {
_triangle._x = 10;
} else if (_x > 640) {
_triangle._x = 640;
} else {
_triangle._x = _x;
}
if (_y < 10) {
_triangle._y = 10;
} else if (_y > 640) {
_triangle._y = 640;
} else {
_triangle._y = _y;
}
} else {
_triangle._x = _root.scrollpanel.roue._x + (r * Math.cos(_rotWheel));
_triangle._y = _root.scrollpanel.roue._y + (r * Math.sin(_rotWheel));
}
_triangle._rotation = (_rotWheel * 180) / Math.PI;
}
function die() {
_clip.removeMovieClip();
var _local3 = 0;
while (_local3 < _contactNodes.length) {
_contactNodes[_local3].deleteNode(this);
_local3++;
}
_root.scrollpanel.explo.duplicateMovieClip("explo_" + _layer, _layer);
_root.layers[_layer].clip = _root.scrollpanel["explo_" + _layer];
_root.layers[_layer].clip._layer = _layer;
_root.layers[_layer].clip._x = _x;
_root.layers[_layer].clip._y = _y;
if (_triangle != -1) {
delTriangle();
}
}
function updateJoinPos() {
_join.updatePos();
}
var _contactWheel = false;
var _rotWheel = 0;
var _rWheel = 0;
var _R = 14.75;
var _RQ = 870;
var _color = -1;
var _join = -1;
var _triangle = -1;
var _stickfly = -1;
var _stickground = -1;
var _id = 0;
var _groupid = -1;
}
Symbol 158 MovieClip [__Packages.Join] Frame 0
class Join
{
var _layer, _n1, _n2, _clip, _x, _y, _rot, _xM, _yM, _rotM, _diffX, _diffY;
function Join (clip, x, y, rotation, l, n1, n2) {
_layer = l;
_n1 = n1;
_n2 = n2;
_clip = clip;
_x = x;
_y = y;
_rot = rotation;
_xM = _x;
_yM = _y;
_rotM = _rot;
}
function show() {
_clip._x = _x;
_clip._y = _y;
_clip._rotation = _rot;
_clip._visible = true;
}
function hide() {
_clip._visible = false;
}
function wheel(newRot) {
if (_rWheel != false) {
var _local2 = (newRot * Math.PI) / 180;
_diffX = _rWheel * Math.cos(_rotWheel + _local2);
_diffY = _rWheel * Math.sin(_rotWheel + _local2);
}
}
function wheelMove(newRot) {
wheel(newRot);
trans();
}
function trans() {
if (_rWheel != false) {
_x = _root.scrollpanel.roue._x + _diffX;
_y = _root.scrollpanel.roue._y + _diffY;
}
}
function back() {
_x = _xM;
_y = _yM;
_rot = _rotM;
}
function memo() {
_xM = _x;
_yM = _y;
_rotM = _rot;
}
function die() {
_clip.removeMovieClip();
_root.layers[_layer].free = true;
}
function updatePos() {
_x = (_n1._x + _n2._x) / 2;
_y = (_n1._y + _n2._y) / 2;
}
var _index = -1;
var _rotWheel = 0;
var _rWheel = false;
}
Symbol 159 MovieClip [__Packages.NodeGroup] Frame 0
class NodeGroup
{
var _speed, _nodeList, _x, _y, nothing, randgoal, _traj, _speedS;
function NodeGroup (n, gid) {
_speed = {x:0, y:0};
_nodeList = new Array();
_nodeList.push(n);
_x = n._x;
_y = n._y;
_groupid = gid;
nothing = function () {
};
nothing.prototype.Compute = function (n) {
};
randgoal = function () {
this._goal = {x:_root.narrow + _root.pseudoRand(_root.levelframe + _root.skyGroups.length, 650 - (2 * _root.narrow)), y:_root.pseudoRand(_root.levelframe + _root.groundBalls.length, 650)};
};
randgoal.prototype.Compute = function (n) {
var _local5 = Math.pow(n._x - this._goal.x, 2) + Math.pow(n._y - this._goal.y, 2);
if (_local5 < 1500) {
this._goal = {x:_root.narrow + _root.pseudoRand(_root.levelframe + _root.skyGroups.length, 650 - (2 * _root.narrow)), y:_root.pseudoRand(_root.levelframe + _root.groundBalls.length, 650)};
}
var _local4 = Math.sqrt(_local5);
n._speed.x = n._speed.x + ((((-n._x) + this._goal.x) * 0.1) / _local4);
n._speed.x = n._speed.x * 0.986;
n._speed.y = n._speed.y + ((((-n._y) + this._goal.y) * 0.1) / _local4);
n._speed.y = n._speed.y * 0.986;
};
_traj = new this.nothing();
}
function trajRandom() {
_traj = new this.randgoal();
}
function setGroupId(gid) {
_groupid = gid;
var _local2 = 0;
while (_local2 < _nodeList.length) {
_nodeList[_local2]._groupid = gid;
_local2++;
}
}
function memo() {
var _local2 = 0;
while (_local2 < _nodeList.length) {
_nodeList[_local2].memo();
_local2++;
}
}
function move() {
var _local3 = 0;
while (_local3 < _nodeList.length) {
_nodeList[_local3]._x = _nodeList[_local3]._x + (_speed.x * _root._ms);
_nodeList[_local3]._y = _nodeList[_local3]._y + (_speed.y * _root._ms);
if (_nodeList[_local3].maybeDelTriangle()) {
_in = true;
}
_local3++;
}
_x = _x + (_speed.x * _root._ms);
_y = _y + (_speed.y * _root._ms);
_traj.Compute(this);
}
function show() {
var _local2 = 0;
while (_local2 < _nodeList.length) {
_nodeList[_local2].show();
_local2++;
}
}
function die() {
var _local2 = 0;
while (_local2 < _nodeList.length) {
_nodeList[_local2].die();
_local2++;
}
}
function addGroup(g) {
var _local4 = _nodeList.length + g._nodeList.length;
_x = ((_nodeList.length * _x) + (g._nodeList.length * g._x)) / _local4;
_y = ((_nodeList.length * _y) + (g._nodeList.length * g._y)) / _local4;
_speed.x = ((_nodeList.length * _speed.x) + (g._nodeList.length * g._speed.x)) / _local4;
_speed.y = ((_nodeList.length * _speed.y) + (g._nodeList.length * g._speed.y)) / _local4;
var _local2 = 0;
while (_local2 < g._nodeList.length) {
_nodeList.push(g._nodeList[_local2]);
_local2++;
}
}
function bari() {
var _local4 = 0;
var _local3 = 0;
var _local2 = 0;
while (_local2 < _nodeList.length) {
_local4 = _local4 + _nodeList[_local2]._x;
_local3 = _local3 + _nodeList[_local2]._y;
_local2++;
}
_x = _local4 / _nodeList.length;
_y = _local3 / _nodeList.length;
}
function addNode(n) {
_nodeList.push(n);
_x = (((_nodeList.length - 1) * _x) + n._x) / _nodeList.length;
_y = (((_nodeList.length - 1) * _y) + n._y) / _nodeList.length;
}
function computeNewSpeed() {
computeSpeed(_speedS);
}
function computeSpeed(s) {
_speedS = s;
var _local3 = {x:_root.scrollpanel.roue._x - _x, y:_root.scrollpanel.roue._y - _y};
var _local4 = s / Math.sqrt(Math.pow(_local3.x, 2) + Math.pow(_local3.y, 2));
_speed = {x:_local3.x * _local4, y:_local3.y * _local4};
}
function mconstraint(n) {
var _local3 = n._join;
var _local2 = _local3._n1;
if (_local2._id == n._id) {
_local2 = _local3._n2;
}
mconstraintnodes(_local2, n, 0);
}
function mconstraintnodes(fixnode, n, addy) {
var _local4 = {x:n._xM - fixnode._xM, y:n._yM - fixnode._yM};
var _local5 = Math.sqrt(Math.pow(_local4.x, 2) + Math.pow(_local4.y, 2));
var _local8 = (addy + n._R) + fixnode._R;
var _local6 = (_local8 - _local5) / _local5;
var _local3 = {x:_local4.x * _local6, y:_local4.y * _local6};
var _local2 = 0;
while (_local2 < _nodeList.length) {
_nodeList[_local2]._xM = _nodeList[_local2]._xM + _local3.x;
_nodeList[_local2]._yM = _nodeList[_local2]._yM + _local3.y;
_local2++;
}
}
function constraint(n) {
var _local3 = n._join;
var _local2 = _local3._n1;
if (_local2._id == n._id) {
_local2 = _local3._n2;
}
constraintnodes(_local2, n, 0, false);
}
function constraintnodes(fixnode, n, addy, changespeed) {
var _local4 = {x:n._x - fixnode._x, y:n._y - fixnode._y};
var _local5 = Math.sqrt(Math.pow(_local4.x, 2) + Math.pow(_local4.y, 2));
var _local8 = (addy + n._R) + fixnode._R;
var _local6 = (_local8 - _local5) / _local5;
var _local3 = {x:_local4.x * _local6, y:_local4.y * _local6};
var _local2 = 0;
while (_local2 < _nodeList.length) {
_nodeList[_local2]._x = _nodeList[_local2]._x + _local3.x;
_nodeList[_local2]._y = _nodeList[_local2]._y + _local3.y;
_local2++;
}
if (changespeed) {
_speed.x = _speed.x + _local3.x;
_speed.y = _speed.y + _local3.y;
}
}
var _groupid = -1;
var _R = 0;
var _RQ = 0;
var _in = false;
}
Symbol 15 MovieClip Frame 1
stop();
_root.levelSound.setVolume(100);
_root.exploSound.setVolume(100);
_root.prelockSound.setVolume(100);
_root.lockSound.setVolume(100);
Symbol 15 MovieClip Frame 2
stop();
_root.levelSound.setVolume(0);
_root.exploSound.setVolume(0);
_root.prelockSound.setVolume(0);
_root.lockSound.setVolume(0);
Symbol 18 MovieClip Frame 1
stop();
var mouseover = false;
var scale = 0;
onRollOut = function () {
mouseover = false;
};
onRollOver = function () {
mouseover = true;
};
onEnterFrame = function () {
if (mouseover) {
scale = scale + ((20 - scale) * 0.2);
_xscale = (100 + scale);
_yscale = (100 + scale);
} else {
scale = scale + ((-scale) * 0.2);
_xscale = (100 + scale);
_yscale = (100 + scale);
}
};
Symbol 22 MovieClip Frame 1
stop();
var mouseover = false;
var scale = 0;
onRollOut = function () {
mouseover = false;
};
onRollOver = function () {
mouseover = true;
};
onEnterFrame = function () {
if (mouseover) {
scale = scale + ((20 - scale) * 0.2);
_xscale = (100 + scale);
_yscale = (100 + scale);
} else {
scale = scale + ((-scale) * 0.2);
_xscale = (100 + scale);
_yscale = (100 + scale);
}
};
Symbol 25 MovieClip Frame 1
stop();
var mouseover = false;
var scale = 0;
onRollOut = function () {
mouseover = false;
};
onRollOver = function () {
mouseover = true;
};
onEnterFrame = function () {
if (mouseover) {
scale = scale + ((20 - scale) * 0.2);
_xscale = (100 + scale);
_yscale = (100 + scale);
} else {
scale = scale + ((-scale) * 0.2);
_xscale = (100 + scale);
_yscale = (100 + scale);
}
};
Symbol 28 MovieClip Frame 1
stop();
var mouseover = false;
var scale = 0;
onRollOut = function () {
mouseover = false;
};
onRollOver = function () {
mouseover = true;
};
onEnterFrame = function () {
if (mouseover) {
scale = scale + ((20 - scale) * 0.2);
_xscale = (100 + scale);
_yscale = (100 + scale);
} else {
scale = scale + ((-scale) * 0.2);
_xscale = (100 + scale);
_yscale = (100 + scale);
}
};
Symbol 33 MovieClip Frame 1
stop();
var mouseover = false;
var scale = 0;
onRollOut = function () {
mouseover = false;
};
onRollOver = function () {
mouseover = true;
};
onEnterFrame = function () {
if (mouseover) {
scale = scale + ((20 - scale) * 0.2);
_xscale = (100 + scale);
_yscale = (100 + scale);
} else {
scale = scale + ((-scale) * 0.2);
_xscale = (100 + scale);
_yscale = (100 + scale);
}
};
Symbol 35 MovieClip Frame 1
stop();
var mouseover = false;
var scale = 0;
onRollOut = function () {
mouseover = false;
};
onRollOver = function () {
mouseover = true;
};
onEnterFrame = function () {
if (mouseover) {
scale = scale + ((20 - scale) * 0.2);
_xscale = (100 + scale);
_yscale = (100 + scale);
} else {
scale = scale + ((-scale) * 0.2);
_xscale = (100 + scale);
_yscale = (100 + scale);
}
};
Symbol 38 MovieClip Frame 1
stop();
var mouseover = false;
var scale = 0;
onRollOut = function () {
mouseover = false;
};
onRollOver = function () {
mouseover = true;
};
onEnterFrame = function () {
if (mouseover) {
scale = scale + ((20 - scale) * 0.2);
_xscale = (100 + scale);
_yscale = (100 + scale);
} else {
scale = scale + ((-scale) * 0.2);
_xscale = (100 + scale);
_yscale = (100 + scale);
}
};
Symbol 44 MovieClip Frame 17
_root.layers[_layer].free = true;
stop();
Symbol 48 MovieClip Frame 5
stop();
Symbol 48 MovieClip Frame 13
_visible = false;
_root.layers[_layer].free = true;
stop();
Symbol 53 MovieClip Frame 6
stop();
Symbol 64 MovieClip Frame 20
_root.layers[_layer].free = true;
stop();
Symbol 67 MovieClip Frame 20
_root.layers[_layer].free = true;
stop();
Symbol 69 MovieClip Frame 1
stop();
Symbol 70 MovieClip Frame 1
stop();
Symbol 78 MovieClip Frame 20
_root.layers[_layer].free = true;
stop();
Symbol 129 MovieClip Frame 1
stop();
var mouseover = false;
var scale = 0;
onRollOut = function () {
mouseover = false;
};
onRollOver = function () {
mouseover = true;
};
onEnterFrame = function () {
if (mouseover) {
scale = scale + ((20 - scale) * 0.2);
_xscale = (100 + scale);
_yscale = (100 + scale);
} else {
scale = scale + ((-scale) * 0.2);
_xscale = (100 + scale);
_yscale = (100 + scale);
}
};
Symbol 138 MovieClip Frame 1
var mouseover = false;
var scale = 0;
onRollOut = function () {
mouseover = false;
};
onRollOver = function () {
mouseover = true;
};
if (hitTest(_root._xmouse, _root._ymouse, true)) {
mouseover = true;
} else {
mouseover = false;
}
onEnterFrame = function () {
if (mouseover) {
scale = scale + ((20 - scale) * 0.2);
_xscale = (100 + scale);
_yscale = (100 + scale);
} else {
scale = scale + ((-scale) * 0.2);
_xscale = (100 + scale);
_yscale = (100 + scale);
}
};
Symbol 138 MovieClip Frame 10
stop();
if (_root._levelscore > 0) {
scoretext.text = ((_root._levelscore + " pts\ntotal: ") + _root._score) + " pts";
} else {
scoretext.text = "";
}
leveltext.text = "code: " + _root.levelnametxt;
var i = 0;
while (i < 5) {
this["h" + i]._visible = false;
i++;
}
var i = 0;
while (i < _root.lives) {
this["h" + i]._visible = true;
i++;
}
Symbol 138 MovieClip Frame 15
_visible = false;
stop();