Frame 2
myTotal = Math.round(getBytesTotal());
myLoaded = Math.round(getBytesLoaded());
myPercent = myLoaded / myTotal;
myBar._width = myPercent * 100;
myText.text = Math.round(myPercent * 100) + "%";
if (myLoaded == myTotal) {
_root.stop();
logo.gotoAndPlay(2);
_root.createEmptyMovieClip("bgsong_mc", _root.getNextHighestDepth());
var bgsong = new Sound();
_root.bgsong.attachSound("bgsong");
_root.bgsong.setVolume(50);
_root.bgsong.start();
} else {
gotoAndPlay (1);
}
_root.bgsong.onSoundComplete = function () {
_root.bgsong.start();
};
Frame 3
_root.bgsong.onSoundComplete = function () {
_root.bgsong.start();
};
stop();
Instance of Symbol 153 MovieClip "cursor" in Frame 3
onClipEvent (load) {
Mouse.hide();
dx = 0;
dy = 0;
_x = _root._xmouse;
_y = _root._ymouse;
}
onClipEvent (enterFrame) {
_x = (_x + (dx * 0.4));
_y = (_y + (dy * 0.4));
dx = _root._xmouse - _x;
dy = _root._ymouse - _y;
}
Frame 4
stop();
ending._visible = false;
killsound = false;
blood_mc._alpha = 0;
matrix = new Matrix();
var bmp = new Array();
bmp[0] = flash.display.BitmapData.loadBitmap("gr");
bmp[1] = flash.display.BitmapData.loadBitmap("rock");
bmp[2] = flash.display.BitmapData.loadBitmap("stripes");
bmp[3] = flash.display.BitmapData.loadBitmap("wall2");
bmp[4] = flash.display.BitmapData.loadBitmap("hay");
bmp[5] = flash.display.BitmapData.loadBitmap("sand");
bmp[6] = flash.display.BitmapData.loadBitmap("wat2");
bmp[7] = flash.display.BitmapData.loadBitmap("slate");
bmp[8] = flash.display.BitmapData.loadBitmap("slate2");
bmp[9] = flash.display.BitmapData.loadBitmap("brown");
bmp[10] = flash.display.BitmapData.loadBitmap("theice");
bmp[11] = flash.display.BitmapData.loadBitmap("wall1");
bmp[12] = flash.display.BitmapData.loadBitmap("wood1");
bmp[13] = flash.display.BitmapData.loadBitmap("wallpaper1");
bmp[14] = flash.display.BitmapData.loadBitmap("seemless");
bmp[15] = flash.display.BitmapData.loadBitmap("chain1");
bmp[16] = flash.display.BitmapData.loadBitmap("moon1");
repeat = true;
smoothing = false;
gPull = 0.2;
starCoordX = new Array();
starCoordY = new Array();
starCoordH = new Array();
starCoordX[0] = -742;
starCoordY[0] = -789;
starCoordH[0] = 150;
starCoordX[1] = 130;
starCoordY[1] = -822;
starCoordH[1] = 100;
starCoordX[2] = 1692;
starCoordY[2] = -928;
starCoordH[2] = 49;
starCoordX[3] = -1068;
starCoordY[3] = -728;
starCoordH[3] = 100;
starCoordX[4] = -1399;
starCoordY[4] = -1652;
starCoordH[4] = 90;
starCoordX[5] = 1898;
starCoordY[5] = -1503;
starCoordH[5] = 120;
starCoordX[6] = 1520;
starCoordY[6] = 2363;
starCoordH[6] = 80;
starCoordX[7] = 1470;
starCoordY[7] = -2889;
starCoordH[7] = 70;
starCoordX[8] = 3620;
starCoordY[8] = 1879;
starCoordH[8] = 60;
starCoordX[9] = 625;
starCoordY[9] = -2015;
starCoordH[9] = 80;
starCoordX[10] = 719;
starCoordY[10] = -3814;
starCoordH[10] = 100;
starCoordX[11] = 1560;
starCoordY[11] = 2189;
starCoordH[11] = 120;
starCoordX[12] = 3647;
starCoordY[12] = -1587;
starCoordH[12] = 80;
starCoordX[13] = -879;
starCoordY[13] = -2933;
starCoordH[13] = 80;
starCoordX[14] = 376;
starCoordY[14] = -2250;
starCoordH[14] = 80;
starCoordX[15] = 1553;
starCoordY[15] = -1161;
starCoordH[15] = 80;
starCoordX[16] = 3581;
starCoordY[16] = -1696;
starCoordH[16] = 80;
starCoordX[17] = 2881;
starCoordY[17] = -448;
starCoordH[17] = 50;
color = new Color();
color = 16777215 /* 0xFFFFFF */;
backCol = new Array();
backCol[0] = 0;
backCol[1] = 0;
backCol[2] = 0;
backCol[3] = 0;
backCol[4] = 0;
backCol[5] = 0;
backCol[6] = 0;
backCol[7] = 0;
backCol[8] = 0;
backCol[9] = 0;
backCol[10] = 0;
backCol[11] = 0;
backCol[12] = 0;
backCol[13] = 0;
backCol[14] = 0;
backCol[15] = 0;
backCol[16] = 0;
backCol[17] = 0;
backCol[18] = 26112;
bordCol = new Array();
bordCol[0] = 39168;
bordCol[1] = 13421772 /* 0xCCCCCC */;
bordCol[2] = 16737792 /* 0xFF6600 */;
bordCol[3] = 52224;
bordCol[4] = 16724736 /* 0xFF3300 */;
bordCol[5] = 16513805 /* 0xFBFB0D */;
bordCol[6] = 0;
bordCol[7] = 10027008 /* 0x990000 */;
bordCol[8] = 0;
bordCol[9] = 11622657 /* 0xB15901 */;
bordCol[10] = 1919092 /* 0x1D4874 */;
bordCol[11] = 11047221 /* 0xA89135 */;
bordCol[12] = 2842513 /* 0x2B5F91 */;
bordCol[13] = 9371905 /* 0x8F0101 */;
bordCol[14] = 6161013 /* 0x5E0275 */;
bordCol[15] = 7566195 /* 0x737373 */;
bordCol[16] = 7566195 /* 0x737373 */;
bordCol[17] = 65280;
bordCol[18] = 65280;
bordCol1 = new Array();
bordCol1[0] = 65280;
bordCol1[1] = 16777215 /* 0xFFFFFF */;
bordCol1[2] = 16763904 /* 0xFFCC00 */;
bordCol1[3] = 6346001 /* 0x60D511 */;
bordCol1[4] = 16776960 /* 0xFFFF00 */;
bordCol1[5] = 16645514 /* 0xFDFD8A */;
bordCol1[6] = 11861757 /* 0xB4FEFD */;
bordCol1[7] = 16711680 /* 0xFF0000 */;
bordCol1[8] = 16763904 /* 0xFFCC00 */;
bordCol1[9] = 16615443 /* 0xFD8813 */;
bordCol1[10] = 65535;
bordCol1[11] = 13811833 /* 0xD2C079 */;
bordCol1[12] = 12441068 /* 0xBDD5EC */;
bordCol1[13] = 16672615 /* 0xFE6767 */;
bordCol1[14] = 14443004 /* 0xDC61FC */;
bordCol1[15] = 16777215 /* 0xFFFFFF */;
bordCol1[16] = 16777215 /* 0xFFFFFF */;
bordCol1[17] = 16776960 /* 0xFFFF00 */;
bordCol1[18] = 52479;
bgcol = new Array();
bgcol[0] = 95815 /* 0x017647 */;
bgcol[1] = 6710886 /* 0x666666 */;
bgcol[2] = 12668418 /* 0xC14E02 */;
bgcol[3] = 417878 /* 0x066056 */;
bgcol[4] = 11622657 /* 0xB15901 */;
bgcol[5] = 7631619 /* 0x747303 */;
bgcol[6] = 2587036 /* 0x27799C */;
bgcol[7] = 6619393 /* 0x650101 */;
bgcol[8] = 16750950 /* 0xFF9966 */;
bgcol[9] = 6631937 /* 0x653201 */;
bgcol[10] = 1737190 /* 0x1A81E6 */;
bgcol[11] = 14997931 /* 0xE4D9AB */;
bgcol[12] = 5542349 /* 0x5491CD */;
bgcol[13] = 16737792 /* 0xFF6600 */;
bgcol[14] = 11010473 /* 0xA801A9 */;
bgcol[15] = 9803157 /* 0x959595 */;
bgcol[16] = 7566195 /* 0x737373 */;
bgcol[17] = 16758374 /* 0xFFB666 */;
bgcol[18] = 6710886 /* 0x666666 */;
numberOfLvls = 20;
rainb = new Array();
i = 0;
while (i < numberOfLvls) {
rainb[i] = false;
i++;
}
rainb[3] = true;
rainb[5] = true;
rainb[12] = true;
rainb[15] = true;
windi = new Array();
i = 0;
while (i < numberOfLvls) {
windi[i] = 1;
i++;
}
windi[4] = 2;
windi[6] = 2;
windi[7] = 2;
windi[9] = 1.9;
windi[10] = 5;
windi[11] = 6.5;
windi[12] = 5;
windi[14] = 7;
windi[16] = 3;
eqb = new Array();
i = 0;
while (i < numberOfLvls) {
eqb[i] = false;
i++;
}
eqb[1] = true;
eqb[5] = true;
eqb[11] = true;
eqb[16] = true;
tempgrav = grav;
SETUP = function () {
if (level == 14) {
tempgrav = grav;
grav = 0.6;
} else if (level == 16) {
grav = 1.7;
} else if ((grav < 0.6) || (grav == 1.7)) {
grav = tempgrav;
}
with (bgg) {
clear();
lineStyle(1, bgcol[level], 100);
beginFill(bgcol[level], 100);
moveTo(0, 0);
lineTo(Stage.width, 0);
lineTo(Stage.width, Stage.height);
lineTo(0, Stage.height);
lineTo(0, 0);
endFill();
}
map.tr0.removeMovieClip();
e = 1;
while (e < triangles) {
map["tr" + e].removeMovieClip();
w["triangle" + e].removeMovieClip();
e++;
}
stars[0].x = starCoordX[level];
stars[0].y = starCoordY[level];
stars[0].h = starCoordH[level];
tri = new Array();
m = "";
a = s.indexOf("|", 0);
trian = s.substring(0, a);
triangles = Number(trian) / 3;
tri[0] = new Object();
i = 1;
while (i < 6) {
i++;
}
e = 1;
while (e < triangles) {
tri[e] = new Object();
duplicateMovieClip (w.triangle0, "triangle" + e, 1000 + e);
w["triangle" + e].numb.text = e;
e++;
}
tt = "";
rr = 10;
j = a + 1;
i = 0;
while (i < triangles) {
map.createEmptyMovieClip("tr" + i, map.getNextHighestDepth());
tt = "";
while (s.substring(j, j + 1) != "<") {
tt = tt + s.substring(j, j + 1);
j++;
}
w["triangle" + i]._x = Number(tt);
tri[i].x = Number(tt);
j++;
tt = "";
while (s.substring(j, j + 1) != ":") {
tt = tt + s.substring(j, j + 1);
j++;
}
w["triangle" + i]._y = Number(tt);
tri[i].y = Number(tt);
map["tr" + i]._x = tri[i].x / 5;
map["tr" + i]._y = tri[i].y / 5;
j++;
ii = 0;
while (ii < 3) {
if (ii == 0) {
tem = "A";
} else if (ii == 1) {
tem = "B";
} else {
tem = "C";
}
tt = "";
while (s.substring(j, j + 1) != ",") {
tt = tt + s.substring(j, j + 1);
j++;
}
w["triangle" + i]["point" + tem]._x = Number(tt);
j++;
tt = "";
while (s.substring(j, j + 1) != "'") {
tt = tt + s.substring(j, j + 1);
j++;
}
w["triangle" + i]["point" + tem]._y = Number(tt);
map["tr" + i].lineStyle(1, 16777215, 100);
map["tr" + i].lineTo(w["triangle" + i]["point" + tem]._x / rr, w["triangle" + i]["point" + tem]._y / rr);
j++;
tt = "";
while (s.substring(j, j + 1) != ".") {
tt = tt + s.substring(j, j + 1);
j++;
}
j++;
tri[i][("p" + tem) + "h"] = Number(tt);
map["tr" + i].lineTo(w["triangle" + i]["point" + tem]._x / rr, (w["triangle" + i]["point" + tem]._y / rr) - (tri[i][("p" + tem) + "h"] / rr));
map["tr" + i].lineTo(w["triangle" + i]["point" + tem]._x / rr, w["triangle" + i]["point" + tem]._y / rr);
ii++;
}
map["tr" + i].lineTo(0, 0);
map["tr" + i].moveTo(w["triangle" + i].pointA._x / rr, (w["triangle" + i].pointA._y / rr) - (tri[i].pAh / rr));
map["tr" + i].lineTo(w["triangle" + i].pointB._x / rr, (w["triangle" + i].pointB._y / rr) - (tri[i].pBh / rr));
map["tr" + i].lineTo(w["triangle" + i].pointC._x / rr, (w["triangle" + i].pointC._y / rr) - (tri[i].pCh / rr));
map["tr" + i].lineTo(w["triangle" + i].pointA._x / rr, (w["triangle" + i].pointA._y / rr) - (tri[i].pAh / rr));
i++;
}
q = 0;
while (q < triangles) {
tri[q].x = w["triangle" + q]._x;
tri[q].y = w["triangle" + q]._y;
tri[q].tallest = tri[q].pAh;
tri[q].tPoint = "A";
if (((tri[q].pAh == tri[q].pBh) && (tri[q].pBh == tri[q].pCh)) && (tri[q].pAh == tri[q].pCh)) {
tri[q].midT = tri[q].pBh;
tri[q].midTp = "B";
tri[q].shortest = tri[q].pCh;
tri[q].sPoint = "C";
} else {
if (tri[q].pBh > tri[q].tallest) {
tri[q].tallest = tri[q].pBh;
tri[q].tPoint = "B";
}
if (tri[q].pCh > tri[q].tallest) {
tri[q].tallest = tri[q].pCh;
tri[q].tPoint = "C";
}
tri[q].shortest = tri[q].pAh;
tri[q].sPoint = "A";
if (tri[q].pBh < tri[q].shortest) {
tri[q].shortest = tri[q].pBh;
tri[q].sPoint = "B";
}
if (tri[q].pCh < tri[q].shortest) {
tri[q].shortest = tri[q].pCh;
tri[q].sPoint = "C";
}
tri[q].midT = tri[q].pBh;
tri[q].midTp = "B";
if ((tri[q].pAh > tri[q].midT) && (tri[q].pCh > tri[q].midT)) {
if (tri[q].pAh > tri[q].pCh) {
tri[q].midT = tri[q].pCh;
tri[q].midTp = "C";
} else {
tri[q].midT = tri[q].pAh;
tri[q].midTp = "A";
}
} else if ((tri[q].pAh < tri[q].midT) && (tri[q].pCh < tri[q].midT)) {
if (tri[q].pAh > tri[q].pCh) {
tri[q].midT = tri[q].pAh;
tri[q].midTp = "A";
} else {
tri[q].midT = tri[q].pCh;
tri[q].midTp = "C";
}
if (tri[q].sPoint == tri[q].midTp) {
if (tri[q].tPoint == "A") {
tri[q].midT = tri[q].pCh;
tri[q].midTp = "C";
tri[q].shortest = tri[q].pBh;
tri[q].sPoint = "B";
} else if (tri[q].tPoint == "B") {
tri[q].midT = tri[q].pCh;
tri[q].midTp = "C";
tri[q].shortest = tri[q].pAh;
tri[q].sPoint = "A";
} else {
tri[q].midT = tri[q].pBh;
tri[q].midTp = "B";
tri[q].shortest = tri[q].pAh;
tri[q].sPoint = "A";
}
}
}
if (tri[q].tPoint == tri[q].midTp) {
if (tri[q].sPoint == "A") {
tri[q].midT = tri[q].pCh;
tri[q].midTp = "C";
tri[q].tallest = tri[q].pBh;
tri[q].tPoint = "B";
} else if (tri[q].sPoint == "B") {
tri[q].midT = tri[q].pCh;
tri[q].midTp = "C";
tri[q].tallest = tri[q].pAh;
tri[q].tPoint = "A";
} else {
tri[q].midT = tri[q].pAh;
tri[q].midTp = "A";
tri[q].tallest = tri[q].pBh;
tri[q].tPoint = "B";
}
}
}
tri[q].theHeight = 0;
if ((tri[q].midT == tri[q].shortest) == tri[q].tallest) {
tri[q].theHeight = tri[q].shortest;
} else if (tri[q].midT == tri[q].tallest) {
tri[q].theHeight = tri[q].shortest;
tri[q].midTPointX = w["triangle" + q]["point" + tri[q].sPoint]._x;
tri[q].midTPointY = w["triangle" + q]["point" + tri[q].sPoint]._y;
tri[q].shortTPointX = w["triangle" + q]["point" + tri[q].sPoint]._x;
tri[q].shortTPointY = w["triangle" + q]["point" + tri[q].sPoint]._y;
dx = w["triangle" + q]["point" + tri[q].tPoint]._x - w["triangle" + q]["point" + tri[q].midTp]._x;
dy = w["triangle" + q]["point" + tri[q].tPoint]._y - w["triangle" + q]["point" + tri[q].midTp]._y;
tri[q].angleTM = Math.atan(dx / dy);
tri[q].angleTMc = Math.cos(tri[q].angleTM);
tri[q].angleTMs = Math.sin(tri[q].angleTM);
dx = w["triangle" + q]["point" + tri[q].tPoint]._x - w["triangle" + q]["point" + tri[q].sPoint]._x;
dy = w["triangle" + q]["point" + tri[q].tPoint]._y - w["triangle" + q]["point" + tri[q].sPoint]._y;
tri[q].angleSM = Math.atan(dy / dx);
tri[q].angleSMs = Math.sin((Math.PI/2) + tri[q].angleSM);
tri[q].angleSMc = Math.cos((Math.PI/2) + tri[q].angleSM);
dd = dy / Math.sin(tri[q].angleSM);
ang = ((Math.PI/2) - tri[q].angleSM) - tri[q].angleTM;
hh = Math.sin(ang) * dd;
theAngle = Math.atan((tri[q].tallest - tri[q].shortest) / hh);
tri[q].theAngSin = Math.sin(theAngle) * gPull;
Math.tan(theAngle);
tri[q].theAnglTan = Math.tan(theAngle);
} else {
dx = w["triangle" + q]["point" + tri[q].tPoint]._x - w["triangle" + q]["point" + tri[q].midTp]._x;
dy = w["triangle" + q]["point" + tri[q].tPoint]._y - w["triangle" + q]["point" + tri[q].midTp]._y;
tri[q].angleTM = Math.atan(dy / dx);
tri[q].angleTMc = Math.cos(tri[q].angleTM);
tri[q].angleTMs = Math.sin(tri[q].angleTM);
deltaH = tri[q].tallest - tri[q].midT;
deltaD = dx / tri[q].angleTMc;
midAngle = Math.atan(deltaH / deltaD);
midDeltaH = tri[q].midT;
midDeltaD = midDeltaH / Math.tan(midAngle);
tri[q].midTPointX = w["triangle" + q]["point" + tri[q].midTp]._x - (tri[q].angleTMc * midDeltaD);
tri[q].midTPointY = w["triangle" + q]["point" + tri[q].midTp]._y - (tri[q].angleTMs * midDeltaD);
dx = w["triangle" + q]["point" + tri[q].tPoint]._x - w["triangle" + q]["point" + tri[q].sPoint]._x;
dy = w["triangle" + q]["point" + tri[q].tPoint]._y - w["triangle" + q]["point" + tri[q].sPoint]._y;
angleTS = Math.atan(dy / dx);
deltaH = tri[q].tallest - tri[q].shortest;
deltaD = dx / Math.cos(angleTS);
shortAngle = Math.atan(deltaH / deltaD);
shortDeltaH = tri[q].shortest;
shortDeltaD = shortDeltaH / Math.tan(shortAngle);
tri[q].shortTPointX = w["triangle" + q]["point" + tri[q].sPoint]._x - (Math.cos(angleTS) * shortDeltaD);
tri[q].shortTPointY = w["triangle" + q]["point" + tri[q].sPoint]._y - (Math.sin(angleTS) * shortDeltaD);
dx = tri[q].shortTPointX - tri[q].midTPointX;
dy = tri[q].shortTPointY - tri[q].midTPointY;
tri[q].angleSM = Math.atan(dx / dy);
tri[q].angleSMs = Math.sin((Math.PI/2) + tri[q].angleSM);
tri[q].angleSMc = Math.cos((Math.PI/2) + tri[q].angleSM);
dx = w["triangle" + q]["point" + tri[q].tPoint]._x - tri[q].midTPointX;
dy = w["triangle" + q]["point" + tri[q].tPoint]._y - tri[q].midTPointY;
tri[q].angleTM = Math.atan(dy / dx);
tri[q].angleTMc = Math.cos(tri[q].angleTM);
tri[q].angleTMs = Math.sin(tri[q].angleTM);
dd = dy / tri[q].angleTMs;
ang = ((Math.PI/2) - tri[q].angleTM) - tri[q].angleSM;
hh = Math.sin(ang) * dd;
theAngle = Math.atan(tri[q].tallest / hh);
tri[q].theAngSin = Math.sin(theAngle) * gPull;
Math.tan(theAngle);
tri[q].theAnglTan = Math.tan(theAngle);
}
w["triangle" + q].createEmptyMovieClip("inTri0", w["triangle" + q].getNextHighestDepth());
i = 1;
while (i < 6) {
duplicateMovieClip (w["triangle" + q].inTri0, "inTri" + i, w["triangle" + q].getNextHighestDepth());
i++;
}
w["triangle" + q].inTri1.clear();
w["triangle" + q].inTri1.lineStyle(2, bordCol[level], 100);
w["triangle" + q].inTri1.beginFill(backCol[level], 50);
w["triangle" + q].inTri1.moveTo(w["triangle" + q].pointC._x, w["triangle" + q].pointC._y);
w["triangle" + q].inTri1.lineTo(w["triangle" + q].pointC._x, w["triangle" + q].pointC._y - tri[q].pCh);
w["triangle" + q].inTri1.lineTo(w["triangle" + q].pointA._x, w["triangle" + q].pointA._y - tri[q].pAh);
w["triangle" + q].inTri1.lineTo(w["triangle" + q].pointA._x, w["triangle" + q].pointA._y);
w["triangle" + q].inTri1.endFill();
w["triangle" + q].inTri2.clear();
w["triangle" + q].inTri2.lineStyle(2, bordCol[level], 100);
w["triangle" + q].inTri2.beginFill(backCol[level], 50);
w["triangle" + q].inTri2.moveTo(w["triangle" + q].pointC._x, w["triangle" + q].pointC._y);
w["triangle" + q].inTri2.lineTo(w["triangle" + q].pointC._x, w["triangle" + q].pointC._y - tri[q].pCh);
w["triangle" + q].inTri2.lineTo(w["triangle" + q].pointB._x, w["triangle" + q].pointB._y - tri[q].pBh);
w["triangle" + q].inTri2.lineTo(w["triangle" + q].pointB._x, w["triangle" + q].pointB._y);
w["triangle" + q].inTri2.endFill();
w["triangle" + q].inTri3.clear();
w["triangle" + q].inTri3.lineStyle(2, bordCol[level], 100);
w["triangle" + q].inTri3.beginFill(backCol[level], 50);
w["triangle" + q].inTri3.moveTo(w["triangle" + q].pointA._x, w["triangle" + q].pointA._y);
w["triangle" + q].inTri3.lineTo(w["triangle" + q].pointA._x, w["triangle" + q].pointA._y - tri[q].pAh);
w["triangle" + q].inTri3.lineTo(w["triangle" + q].pointB._x, w["triangle" + q].pointB._y - tri[q].pBh);
w["triangle" + q].inTri3.lineTo(w["triangle" + q].pointB._x, w["triangle" + q].pointB._y);
w["triangle" + q].inTri3.endFill();
repeat = true;
smoothing = false;
w["triangle" + q].inTri4.clear();
if (level > -1) {
w["triangle" + q].inTri4.lineStyle(3, bordCol1[level], 100);
w["triangle" + q].inTri4.beginBitmapFill(bmp[level], matrix, repeat, smoothing);
if (level == 17) {
w["triangle" + q].inTri4.beginFill(16724736, 60);
}
w["triangle" + q].inTri4.moveTo(w["triangle" + q].pointC._x, w["triangle" + q].pointC._y - tri[q].pCh);
w["triangle" + q].inTri4.lineTo(w["triangle" + q].pointA._x, w["triangle" + q].pointA._y - tri[q].pAh);
w["triangle" + q].inTri4.lineTo(w["triangle" + q].pointB._x, w["triangle" + q].pointB._y - tri[q].pBh);
w["triangle" + q].inTri4.lineTo(w["triangle" + q].pointC._x, w["triangle" + q].pointC._y - tri[q].pCh);
w["triangle" + q].inTri4.endFill();
w["triangle" + q].inTri4._alpha = 70;
} else {
w["triangle" + q].inTri4.lineStyle(3, bordCol1[level], 100);
w["triangle" + q].inTri4.beginFill(color, 60);
w["triangle" + q].inTri4.moveTo(w["triangle" + q].pointC._x, w["triangle" + q].pointC._y - tri[q].pCh);
w["triangle" + q].inTri4.lineTo(w["triangle" + q].pointA._x, w["triangle" + q].pointA._y - tri[q].pAh);
w["triangle" + q].inTri4.lineTo(w["triangle" + q].pointB._x, w["triangle" + q].pointB._y - tri[q].pBh);
w["triangle" + q].inTri4.lineTo(w["triangle" + q].pointC._x, w["triangle" + q].pointC._y - tri[q].pCh);
w["triangle" + q].inTri4.endFill();
}
w["triangle" + q].inTri5.clear();
w["triangle" + q].inTri5.lineStyle(3, bordCol1[level], 100);
w["triangle" + q].inTri5.moveTo(w["triangle" + q].pointC._x, w["triangle" + q].pointC._y - tri[q].pCh);
w["triangle" + q].inTri5.lineTo(w["triangle" + q].pointA._x, w["triangle" + q].pointA._y - tri[q].pAh);
w["triangle" + q].inTri5.lineTo(w["triangle" + q].pointB._x, w["triangle" + q].pointB._y - tri[q].pBh);
w["triangle" + q].inTri5.lineTo(w["triangle" + q].pointC._x, w["triangle" + q].pointC._y - tri[q].pCh);
w["triangle" + q].pointA.which.text = "A";
w["triangle" + q].pointB.which.text = "B";
w["triangle" + q].pointC.which.text = "C";
tri[q].highesty = w["triangle" + q].pointA._y;
tri[q].pointYh = "A";
if (tri[q].highesty < w["triangle" + q].pointB._y) {
tri[q].highesty = w["triangle" + q].pointB._y;
tri[q].pointYh = "B";
}
if (tri[q].highesty < w["triangle" + q].pointC._y) {
tri[q].highesty = w["triangle" + q].pointC._y;
tri[q].pointYh = "C";
}
tri[q].lowesty = w["triangle" + q].pointA._y;
tri[q].pointYl = "A";
if (tri[q].lowesty > w["triangle" + q].pointB._y) {
tri[q].lowesty = w["triangle" + q].pointB._y;
tri[q].pointYl = "B";
}
if (tri[q].lowesty > w["triangle" + q].pointC._y) {
tri[q].lowesty = w["triangle" + q].pointC._y;
tri[q].pointYl = "C";
}
tri[q].highestx = w["triangle" + q].pointA._x;
tri[q].pointxh = "A";
if (tri[q].highestx < w["triangle" + q].pointB._x) {
tri[q].highestx = w["triangle" + q].pointB._x;
tri[q].pointxh = "B";
}
if (tri[q].highestx < w["triangle" + q].pointC._x) {
tri[q].highestx = w["triangle" + q].pointC._x;
tri[q].pointxh = "C";
}
tri[q].lowestx = w["triangle" + q].pointA._x;
tri[q].pointxl = "A";
if (tri[q].lowestx > w["triangle" + q].pointB._x) {
tri[q].lowestx = w["triangle" + q].pointB._x;
tri[q].pointxl = "B";
}
if (tri[q].lowestx > w["triangle" + q].pointC._x) {
tri[q].lowestx = w["triangle" + q].pointC._x;
tri[q].pointxl = "C";
}
tri[q].middley = w["triangle" + q].pointA._y;
tri[q].pointym = "A";
if ((w["triangle" + q].pointB._y > tri[q].middley) && (w["triangle" + q].pointC._y > tri[q].middley)) {
if (w["triangle" + q].pointB._y > w["triangle" + q].pointC._y) {
tri[q].middley = w["triangle" + q].pointC._y;
tri[q].pointym = "C";
} else {
tri[q].middley = w["triangle" + q].pointB._y;
tri[q].pointym = "B";
}
} else if ((w["triangle" + q].pointB._y < tri[q].middley) && (w["triangle" + q].pointC._y < tri[q].middley)) {
if (w["triangle" + q].pointB._y < w["triangle" + q].pointC._y) {
tri[q].middley = w["triangle" + q].pointC._y;
tri[q].pointym = "C";
} else {
tri[q].middley = w["triangle" + q].pointB._y;
tri[q].pointym = "B";
}
}
tri[q].middlex = w["triangle" + q].pointA._x;
tri[q].pointxm = "A";
if ((w["triangle" + q].pointB._x > tri[q].middlex) && (w["triangle" + q].pointC._x > tri[q].middlex)) {
if (w["triangle" + q].pointB._x > w["triangle" + q].pointC._x) {
tri[q].middlex = w["triangle" + q].pointC._x;
tri[q].pointxm = "C";
} else {
tri[q].middlex = w["triangle" + q].pointB._x;
tri[q].pointxm = "B";
}
} else if ((w["triangle" + q].pointB._x < tri[q].middlex) && (w["triangle" + q].pointC._x < tri[q].middlex)) {
if (w["triangle" + q].pointB._x < w["triangle" + q].pointC._x) {
tri[q].middlex = w["triangle" + q].pointC._x;
tri[q].pointxm = "C";
} else {
tri[q].middlex = w["triangle" + q].pointB._x;
tri[q].pointxm = "B";
}
}
if ((w["triangle" + q]["point" + tri[q].pointxm]._y < w["triangle" + q]["point" + tri[q].pointxh]._y) && (w["triangle" + q]["point" + tri[q].pointxm]._y < w["triangle" + q]["point" + tri[q].pointxl]._y)) {
if (w["triangle" + q]["point" + tri[q].pointxl]._y < w["triangle" + q]["point" + tri[q].pointxh]._y) {
tri[q].behind1x1 = tri[q].pointxl;
tri[q].behind1x2 = tri[q].pointxh;
} else {
tri[q].behind1x1 = tri[q].pointxh;
tri[q].behind1x2 = tri[q].pointxl;
}
dx = w["triangle" + q]["point" + tri[q].behind1x2]._x - w["triangle" + q]["point" + tri[q].behind1x1]._x;
dy = w["triangle" + q]["point" + tri[q].behind1x2]._y - w["triangle" + q]["point" + tri[q].behind1x1]._y;
tri[q].tanBehind1 = dy / dx;
tri[q].behind2x1 = 0;
} else {
if (w["triangle" + q]["point" + tri[q].pointxl]._y < w["triangle" + q]["point" + tri[q].pointxm]._y) {
tri[q].behind1x1 = tri[q].pointxl;
tri[q].behind1x2 = tri[q].pointxm;
} else {
tri[q].behind1x1 = tri[q].pointxm;
tri[q].behind1x2 = tri[q].pointxl;
}
dx = w["triangle" + q]["point" + tri[q].behind1x2]._x - w["triangle" + q]["point" + tri[q].behind1x1]._x;
dy = w["triangle" + q]["point" + tri[q].behind1x2]._y - w["triangle" + q]["point" + tri[q].behind1x1]._y;
tri[q].tanBehind1 = dy / dx;
if (w["triangle" + q]["point" + tri[q].pointxh]._y < w["triangle" + q]["point" + tri[q].pointxm]._y) {
tri[q].behind2x1 = tri[q].pointxh;
tri[q].behind2x2 = tri[q].pointxm;
} else {
tri[q].behind2x1 = tri[q].pointxm;
tri[q].behind2x2 = tri[q].pointxh;
}
dx = w["triangle" + q]["point" + tri[q].behind2x2]._x - w["triangle" + q]["point" + tri[q].behind2x1]._x;
dy = w["triangle" + q]["point" + tri[q].behind2x2]._y - w["triangle" + q]["point" + tri[q].behind2x1]._y;
tri[q].tanBehind2 = dy / dx;
}
distx = w["triangle" + q]["point" + tri[q].pointYl]._x - w["triangle" + q]["point" + tri[q].pointYh]._x;
disty = tri[q].highesty - tri[q].lowesty;
tri[q].tanCol1 = disty / distx;
distx = w["triangle" + q]["point" + tri[q].pointym]._x - w["triangle" + q]["point" + tri[q].pointYh]._x;
disty = tri[q].highesty - tri[q].middley;
tri[q].tanCol2 = disty / distx;
distx = w["triangle" + q]["point" + tri[q].pointym]._x - w["triangle" + q]["point" + tri[q].pointYl]._x;
disty = tri[q].lowesty - tri[q].middley;
tri[q].tanCol3 = disty / distx;
ydiff = (-w["triangle" + q]["point" + tri[q].pointxl]._y) + w["triangle" + q]["point" + tri[q].pointxm]._y;
xdiff = (-w["triangle" + q]["point" + tri[q].pointxl]._x) + w["triangle" + q]["point" + tri[q].pointxm]._x;
tri[q].LMtan = ydiff / xdiff;
tri[q].LMa = Math.atan(tri[q].LMtan);
tri[q].LMcos = Math.cos(tri[q].LMa);
ydiff = w["triangle" + q]["point" + tri[q].pointxh]._y - w["triangle" + q]["point" + tri[q].pointxm]._y;
xdiff = w["triangle" + q]["point" + tri[q].pointxh]._x - w["triangle" + q]["point" + tri[q].pointxm]._x;
tri[q].HMtan = ydiff / xdiff;
tri[q].HMa = Math.atan(tri[q].HMtan);
tri[q].HMcos = Math.cos(tri[q].HMa);
ydiff = w["triangle" + q]["point" + tri[q].pointxh]._y - w["triangle" + q]["point" + tri[q].pointxl]._y;
xdiff = w["triangle" + q]["point" + tri[q].pointxh]._x - w["triangle" + q]["point" + tri[q].pointxl]._x;
tri[q].HLtan = ydiff / xdiff;
tri[q].HLa = Math.atan(tri[q].HLtan);
tri[q].HLcos = Math.cos(tri[q].HLa);
tri[q].onTriangle = false;
w["triangle" + q].trino.text = q;
q++;
}
depArray = new Array();
o = 0;
while (o < triangles) {
depArray[o] = o;
j = 0;
while (j < o) {
if ((tri[depArray[j]].highesty + tri[depArray[j]].y) < (tri[o].highesty + tri[o].y)) {
temp = depArray[j];
depArray[j] = o;
jj = j + 1;
while (jj <= o) {
temp2 = depArray[jj];
depArray[jj] = temp;
temp = temp2;
jj++;
}
break;
}
j++;
}
o++;
}
o = 0;
while (o < triangles) {
tri[depArray[(triangles - 1) - o]].dep = 20 + (3 * o);
w["triangle" + depArray[(triangles - 1) - o]].swapDepths(tri[depArray[(triangles - 1) - o]].dep);
o++;
}
o = 0;
while (o < triangles) {
db = Math.abs(tri[o].highestx) + Math.abs(tri[o].lowestx);
tri[o].lb = (tri[o].x + tri[o].lowestx) - 550;
tri[o].rb = (tri[o].x + tri[o].highestx) + 50;
db = Math.abs(tri[o].highesty) + Math.abs(tri[o].lowesty);
tri[o].db = ((tri[o].y + tri[o].lowesty) - tri[o].tallest) - 450;
tri[o].ub = tri[o].y + tri[o].highesty;
o++;
}
};
checkCol = function () {
yy = Y - tri[q].lowesty;
xx = yy / tri[q].tanCol1;
xx = w["triangle" + q]["point" + tri[q].pointYl]._x - xx;
rangex1 = xx;
if (Y > tri[q].middley) {
yy = Y - tri[q].middley;
xx = yy / tri[q].tanCol2;
xx = w["triangle" + q]["point" + tri[q].pointym]._x - xx;
} else {
yy = Y - tri[q].middley;
xx = yy / tri[q].tanCol3;
xx = w["triangle" + q]["point" + tri[q].pointym]._x - xx;
}
if (rangex1 > xx) {
rangex2 = rangex1;
rangex1 = xx;
} else {
rangex2 = xx;
}
};
jump = function () {
b.hv = b.hv + jumpI;
};
rangex1 = 0;
rangex2 = 0;
inAir = true;
thebx = Stage.width / 2;
theby = Stage.height / 2;
b = new Object();
b.x = thebx;
b.y = theby;
b.xv = (b.yv = 0);
b.h = 150;
b.hv = 0;
b.syh = (b.sxh = 0);
gravity = function () {
b.hv = b.hv - gPull;
if ((b.h <= b.syh) && (b.hv <= 0)) {
b.hv = 0;
b.h = b.syh;
}
if (((b.h <= b.syh) && (inAir)) && (b.hv <= 0)) {
inAir = false;
if (!killsound) {
bounce.start();
}
}
};
w.ball.swapDepths(100);
checkBehind = function () {
if (Y < w["triangle" + q]["point" + tri[q].behind1x1]._y) {
if (!tri[q].onTriangle) {
if (!low) {
w.ball.swapDepths(tri[q].dep - 1);
low = true;
}
} else {
w.ball.swapDepths(tri[q].dep + 1);
}
} else if ((Y > w["triangle" + q]["point" + tri[q].behind1x1]._y) && (((Y - b.h) - b.w) < w["triangle" + q]["point" + tri[q].behind1x2]._y)) {
xDelta = w["triangle" + q]["point" + tri[q].behind1x2]._x - X;
theY = tri[q].tanBehind1 * xDelta;
if (Y < (w["triangle" + q]["point" + tri[q].behind1x2]._y - theY)) {
if (!tri[q].onTriangle) {
if (!low) {
low = true;
w.ball.swapDepths(tri[q].dep - 1);
}
} else {
w.ball.swapDepths(tri[q].dep + 1);
}
} else if (!low) {
w.ball.swapDepths(tri[q].dep + 1);
}
}
};
checkBehindAdv = function () {
if (X < w["triangle" + q]["point" + tri[q].pointxm]._x) {
checkBehind();
return(undefined);
}
if (Y < w["triangle" + q]["point" + tri[q].behind2x1]._y) {
if (!tri[q].onTriangle) {
if (!low) {
low = true;
w.ball.swapDepths(tri[q].dep - 1);
}
} else {
w.ball.swapDepths(tri[q].dep + 1);
}
} else if ((Y > w["triangle" + q]["point" + tri[q].behind2x1]._y) && (((Y - b.h) - b.w) < w["triangle" + q]["point" + tri[q].behind2x2]._y)) {
xDelta = w["triangle" + q]["point" + tri[q].behind2x1]._x - X;
theY = tri[q].tanBehind2 * xDelta;
if (Y < (w["triangle" + q]["point" + tri[q].behind2x1]._y - theY)) {
if (!tri[q].onTriangle) {
if (!low) {
w.ball.swapDepths(tri[q].dep - 1);
low = true;
}
} else {
w.ball.swapDepths(tri[q].dep + 1);
}
} else if (!low) {
w.ball.swapDepths(tri[q].dep + 1);
}
}
};
reflected = false;
exactCol = function () {
tempx = X - w["triangle" + q]["point" + tri[q].pointxl]._x;
ty = Y - w["triangle" + q]["point" + tri[q].pointxl]._y;
tempy = tempx * tri[q].LMtan;
dist = (tempy - ty) * tri[q].LMcos;
theDist = Math.abs(dist);
reflectAngle = -tri[q].LMa;
tempx = X - w["triangle" + q]["point" + tri[q].pointxh]._x;
ty = Y - w["triangle" + q]["point" + tri[q].pointxh]._y;
tempy = tempx * tri[q].HMtan;
dist = (tempy - ty) * tri[q].HMcos;
if ((Math.abs(dist) < (theDist + 5)) && (Math.abs(dist) > (theDist - 5))) {
trace("falsed");
return(false);
}
if (theDist > Math.abs(dist)) {
theDist = Math.abs(dist);
reflectAngle = -tri[q].HMa;
}
tempx = X - w["triangle" + q]["point" + tri[q].pointxl]._x;
ty = Y - w["triangle" + q]["point" + tri[q].pointxl]._y;
tempy = tempx * tri[q].HLtan;
dist = (tempy - ty) * tri[q].HLcos;
if ((Math.abs(dist) < (theDist + 5)) && (Math.abs(dist) > (theDist - 5))) {
trace("falsed");
return(false);
}
if (theDist > Math.abs(dist)) {
theDist = Math.abs(dist);
reflectAngle = -tri[q].HLa;
}
return(true);
};
t = new Object();
t.x = 0;
t.y = 0;
var bounce = new Sound();
bounce.attachSound("bounce_s");
var applause = new Sound();
applause.attachSound("applause");
var glassbreak = new Sound();
glassbreak.attachSound("spark");
var sizzle = new Sound();
sizzle.attachSound("sizzle");
var flysound = new Sound(flysound_mc);
flysound.attachSound("fly_s");
flysound.setVolume(10);
Reflect = function () {
if (!killsound) {
bounce.start();
}
b.x = b.x - (b.xv * td2);
b.y = b.y + (b.yv * td2);
X = (b.x - t.x) - tri[q].x;
Y = (b.y - t.y) - tri[q].y;
tri[q].onTriangle = false;
onTriangle = false;
reflected = true;
b.xv = -b.xv;
b.yv = -b.yv;
if (exactCol()) {
b.syh = tempVar;
a = reflectAngle + Math.atan(b.xv / b.yv);
aa = Math.PI - (2 * a);
tempatan = Math.atan(b.yv / b.xv);
if ((b.yv == 0) || (b.xv == 0)) {
tempatan = 0;
}
aaa = aa - tempatan;
v = b.yv / Math.sin(tempatan);
b.xv = (-Math.cos(aaa)) * v;
b.yv = Math.sin(aaa) * v;
b.xv = b.xv;
b.yv = b.yv;
}
b.xv = b.xv * 0.8;
b.yv = b.yv * 0.8;
if (Math.abs(b.xv) < 1) {
b.xv = (b.xv / Math.abs(b.xv)) * 2;
}
if (Math.abs(b.yv) < 1) {
b.yv = (b.yv / Math.abs(b.yv)) * 2;
}
};
b.w = w.ball._width * 2;
fps = 0;
fpsTime = 0;
onTri1 = function () {
tempy = Y - tri[q].shortTPointY;
tempx = X - tri[q].shortTPointX;
tempAngle = Math.atan(tempx / tempy);
temp = tempy / Math.cos(tempAngle);
tempx = temp * Math.sin(tri[q].angleTM - tempAngle);
if (!inAir) {
force = tri[q].theAngSin * gPull;
cos = tri[q].angleTMc;
sin = tri[q].angleTMs;
b.xv = b.xv - ((force * cos) * 1.5);
b.yv = b.yv - ((force * sin) * 1.5);
}
tempVar = b.syh;
b.syh = Math.abs(tri[q].theAnglTan * tempx) + tri[q].theHeight;
if ((b.h + 15) < b.syh) {
Reflect();
}
};
onTri2 = function () {
tempy = (b.y - tri[q].midTPointY) - w["triangle" + q]._y;
tempx = Math.tan(tri[q].angleSM) * tempy;
tempx = ((b.x - w["triangle" + q]._x) - tri[q].midTPointX) - tempx;
tempx = tempx * Math.cos(tri[q].angleSM);
force = tri[q].theAngSin * gPull;
if (!inAir) {
b.xv = b.xv - ((force * tri[q].angleSMs) * 1.5);
b.yv = b.yv + ((force * tri[q].angleSMc) * 1.5);
}
tempVar = b.syh;
b.syh = Math.abs(tri[q].theAnglTan * tempx) + tri[q].theHeight;
if ((b.h + 15) < b.syh) {
Reflect();
}
};
onTri3 = function () {
tempVar = b.syh;
b.syh = tri[q].theHeight;
if ((b.h + 15) < b.syh) {
Reflect();
}
};
w.createEmptyMovieClip("star", 109);
w.star._x = 0;
w.star._y = 0;
w.starHeart.swapDepths(110);
distance = 10;
w.starHeart._xscale = (w.starHeart._yscale = distance * 10);
coll = new Color();
coll = 16711680 /* 0xFF0000 */;
starPoints = new Array();
stars = new Array();
starno = 1;
stars[0] = new Object();
stars[0].x = -742;
stars[0].y = -789;
stars[0].h = 100;
duplicateMovieClip (w.shade, "starShade0", 1);
w.starShade0._alpha = 50;
points = 17;
i = 0;
while (i < points) {
starPoints[i] = new Object();
starPoints[i].theXPoints = new Array();
i++;
}
starPoints[0].x = 0;
starPoints[0].y = distance * 3;
starPoints[0].z = 0;
starPoints[1].x = distance;
starPoints[1].y = distance;
starPoints[1].z = distance;
starPoints[2].x = distance * 3;
starPoints[2].y = 0;
starPoints[2].z = 0;
starPoints[3].x = distance;
starPoints[3].y = -distance;
starPoints[3].z = distance;
starPoints[4].x = 0;
starPoints[4].y = (-distance) * 3;
starPoints[4].z = 0;
starPoints[5].x = -distance;
starPoints[5].y = -distance;
starPoints[5].z = distance;
starPoints[6].x = (-distance) * 3;
starPoints[6].y = 0;
starPoints[6].z = 0;
starPoints[7].x = -distance;
starPoints[7].y = distance;
starPoints[7].z = distance;
starPoints[8].x = 0;
starPoints[8].y = distance * 3;
starPoints[8].z = 0;
starPoints[9].x = distance;
starPoints[9].y = distance;
starPoints[9].z = distance;
starPoints[10].x = 1;
starPoints[10].y = 1;
starPoints[10].z = distance * 3;
starPoints[11].x = distance;
starPoints[11].y = -distance;
starPoints[11].z = distance;
starPoints[12].x = 1;
starPoints[12].y = 1;
starPoints[12].z = distance * 3;
starPoints[13].x = -distance;
starPoints[13].y = distance;
starPoints[13].z = distance;
starPoints[14].x = 1;
starPoints[14].y = 1;
starPoints[14].z = distance * 3;
starPoints[15].x = -distance;
starPoints[15].y = -distance;
starPoints[15].z = distance;
starPoints[16].x = 1;
starPoints[16].y = 1;
starPoints[16].z = distance * 3;
starPoints[17].x = distance;
starPoints[17].y = -distance;
starPoints[17].z = distance;
i = 0;
while (i < points) {
starPoints[i].anglex = Math.atan(starPoints[i].z / starPoints[i].x);
if (isNaN(starPoints[i].anglex)) {
starPoints[i].anglex = 0;
starPoints[i].dx = Math.sin(starPoints[i].anglex) / starPoints[i].y;
} else {
starPoints[i].dx = Math.cos(starPoints[i].anglex) / starPoints[i].x;
}
i++;
}
i = 0;
while (i < points) {
a = 0;
while (a <= 62) {
starPoints[i].theXPoints[a] = Math.cos((a / 10) + starPoints[i].anglex) / starPoints[i].dx;
a = a + 1;
}
i++;
}
anglex = 0;
w.starShade0._x = (w.starHeart._x = (w.star._x = stars[0].x));
w.starHeart._y = (w.star._y = stars[0].y - stars[0].h);
w.starShade0._y = stars[0].y;
upGrade = function () {
justDied = true;
if (!killsound) {
applause.start();
}
intro_mc.intro_txt.text = introMsg[level];
intro_mc.lvl_txt.text = level;
if (level == 17) {
_root.score = _root.score + (50 + (_root.hardness * Math.round((1000 / _root.Time) * (((100 - _root.damage) / 200) + 0.5))));
_root.Time = 0;
ending._visible = true;
ending.play();
} else {
next_mc.play();
}
w.theball._visible = 1;
w.theball._x = w.ball._x;
w.theball._y = w.ball._y;
w.ball._visible = 0;
w.theball.gotoAndPlay(100);
w.shade._visible = false;
w.ball.shade2._visible = false;
if (rainb[level]) {
rn._visible = 1;
} else {
rn._visible = 0;
}
counter = 0;
dm = 0;
l = 2;
h = triangles - 2;
damage = 0;
running = false;
b.x = thebx;
b.y = theby;
t.x = (t.y = 0);
dx = (dy = 0);
rangex1 = 0;
rangex2 = 0;
inAir = true;
reflected = false;
onTriangle = false;
b.xv = (b.yv = 0);
b.h = 150;
if (level == 18) {
b.h = 400;
}
b.hv = 0;
b.syh = (b.sxh = 0);
};
reset = function () {
r = triangles - 1;
while (r >= 0) {
w["triangle" + r]._x = Math.round(t.x + tri[r].x);
w["triangle" + r]._y = Math.round(t.y + tri[r].y);
r--;
}
w.theball._x = 0;
w.theball._y = 0;
w.theball._visible = 0;
w.ball._visible = 1;
w.shade._visible = true;
running = true;
countdown.play();
if (rainb[level]) {
rn._visible = 1;
} else {
rn._visible = 0;
}
};
drawStar = function () {
w.star._visible = (w.starShade0._visible = (w.starHeart._visible = 1));
if (running) {
w.starShade0._x = (w.starHeart._x = (w.star._x = t.x + stars[0].x));
w.starHeart._y = (w.star._y = t.y + stars[0].y);
w.starShade0._y = (t.y + stars[0].y) + stars[0].h;
if (((stars[0].x + 50) > (-(t.x - b.x))) && ((stars[0].x - 50) < (-(t.x - b.x)))) {
if ((((stars[0].y + 50) + stars[0].h) > (-(t.y - b.y))) && (((stars[0].y - 50) + stars[0].h) < (-(t.y - b.y)))) {
if ((b.h > (stars[0].h - 80)) && (b.h < (stars[0].h + 80))) {
upGrade();
}
}
}
}
anglex = anglex + 1;
if ((anglex > 15) && (anglex < 45)) {
w.star.swapDepths(16);
} else {
w.star.swapDepths(17);
}
if (anglex > 62) {
anglex = 0;
}
with (w.star) {
clear();
lineStyle(5, bordCol1[level], 100);
moveTo(starPoints[0].x, starPoints[0].y);
i = 1;
while (i < points) {
lineTo(starPoints[i].theXPoints[anglex], starPoints[i].y);
i++;
}
}
};
mainLoop = function () {
tri[q].onTriangle = true;
onTriangle = true;
w.ball.shade2._visible = true;
if (tri[q].tallest != tri[q].theHeight) {
if (tri[q].tallest == tri[q].midT) {
onTri1();
} else {
onTri2();
}
} else {
onTri3();
}
if (!reflected) {
if (!inAir) {
b.h = b.syh;
}
}
};
cnt = 0;
loop = function () {
cnt++;
X = b.x - w["triangle" + q]._x;
Y = b.y - w["triangle" + q]._y;
if ((tri[q].lowestx < (X + b.w)) && (tri[q].highestx > (X - b.w))) {
if (((tri[q].lowesty - tri[q].tallest) < (Y + b.w)) && (tri[q].highesty > (Y - b.w))) {
if ((tri[q].lowestx < X) && (tri[q].highestx > X)) {
if ((tri[q].lowesty < Y) && (tri[q].highesty > Y)) {
checkCol();
if ((X > rangex1) && (X < rangex2)) {
mainLoop();
}
}
}
if (!isNaN(tri[q].behind2x1)) {
checkBehind();
} else {
checkBehindAdv();
}
}
}
if (!tri[q].onTriangle) {
counter++;
}
};
checkOver = function () {
if ((b.h < 16) && (onTriangle == false)) {
dm = 1;
if (blood_mc._alpha < 100) {
blood_mc._alpha = blood_mc._alpha + 4;
}
} else if (blood_mc._alpha > 0) {
blood_mc._alpha--;
}
if (dm > 0) {
w.ball.s._visible = true;
dm++;
damage = damage + (dam * td);
dmg.text = Math.round(damage) + "%";
if (dm > 20) {
dm = 0;
w.ball.s._visible = false;
}
if (damage >= 100) {
gameOver();
}
}
};
gameOver = function () {
justDied = true;
if (!killsound) {
glassbreak.start();
}
rn._visible = 0;
counter = 0;
dm = 0;
l = 2;
h = triangles - 2;
damage = 0;
running = false;
b.x = thebx;
b.y = theby;
t.x = (t.y = 0);
dx = (dy = 0);
rangex1 = 0;
rangex2 = 0;
inAir = true;
reflected = false;
onTriangle = false;
b.xv = (b.yv = 0);
b.h = 150;
b.hv = 0;
b.syh = (b.sxh = 0);
over_mc.play();
w.theball._visible = 1;
w.theball._x = w.ball._x;
w.theball._y = w.ball._y;
w.ball._visible = 0;
w.theball.play();
w.shade._visible = false;
w.ball.shade2._visible = false;
};
sparks = new Array();
i = 0;
while (i < 20) {
duplicateMovieClip (w.ball.s.spark, "spark" + i, w.ball.s.getNextHighestDepth());
sparks[i] = new Object();
sparks[i].x = (Math.random() * 2) - 1;
sparks[i].y = (Math.random() * 2) - 1;
if ((sparks[i].x == 0) && (sparks[i].y == 0)) {
sparks[i].x = Math.random() + 0.1;
sparks[i].y = Math.random() + 0.1;
}
i++;
}
sparkUp = function () {
i = 0;
while (i < 20) {
w.ball.s["spark" + i]._x = w.ball.s["spark" + i]._x + sparks[i].x;
w.ball.s["spark" + i]._y = w.ball.s["spark" + i]._y + sparks[i].y;
if ((Math.abs(w.ball.s["spark" + i]._x) > 10) || (Math.abs(w.ball.s["spark" + i]._y) > 10)) {
w.ball.s["spark" + i]._x = (w.ball.s["spark" + i]._y = 0);
}
i++;
}
};
rain = new Array();
rainDrops = 20;
i = 0;
while (i < rainDrops) {
duplicateMovieClip (rn.dropa, "drop" + i, rn.getNextHighestDepth());
rain[i] = new Object();
rain[i].x = Math.random() * 500;
rain[i].y = -20;
rain[i].vy = 15 + (Math.random() * 15);
rn["drop" + i]._x = rain[i].x;
rn["drop" + i]._alpha = 30 + (Math.random() * 50);
rn["drop" + i]._yscale = 50 + (Math.random() * 50);
i++;
}
rn.dropa._visible = false;
rn.dropa.removeMovieClip();
fallrain = function () {
i = 0;
while (i < rainDrops) {
rn["drop" + i]._y = rn["drop" + i]._y + rain[i].vy;
if (rn["drop" + i]._y > 400) {
rn["drop" + i]._y = -50;
rn["drop" + i]._x = Math.random() * 500;
}
i++;
}
};
w.theball._x = 0;
w.theball._y = 0;
w.theball._visible = 0;
windx = 1;
windy = 0;
windA = 0;
windInt = Math.sqrt((windx * windx) + (windy * windy));
maxInt = 1;
generateWind = function () {
windx = (windy = 0);
windS.wind_txt.text = (windInt = Math.random() * windi[level]);
xwind = Math.random();
windx = ((-windInt) / 2) + (xwind * windInt);
windy = ((-windInt) / 2) + ((1 - xwind) * windInt);
windS.arr._rotation = (windA = (Math.atan(windy / windx) * 180) / Math.PI);
};
levels = 15;
windDir = 1;
dirrr = 1.5;
dirrry = 1.5;
w._x = (w._y = 0);
introText = new Array();
introText[0] = "Grass\nFavorable/Stable\nN/A";
introText[1] = "Rocks\nFavorable/Stable\nEarthquake";
introText[2] = "Wood\nFavorable/Stable\nN/A";
introText[3] = "Bricks\nSlippery\nRain";
introText[4] = "Hay\nStable\nN/A";
introText[5] = "Sand\nStable\nEarthquake";
introText[6] = "Water\nSlippery\nN/A";
introText[7] = "Red bricks\nFavorable\nN/A";
introText[8] = "Slates\nFavorable\nN/A";
introText[9] = "Tiles\nStrong wind\nN/A";
introText[10] = "Ice\nSlippery/Strong wind\nN/A";
introText[11] = "Clay\nStrong wind\nEarthquake";
introText[12] = "Water Ice\nSlippery/Strong wind\nRain";
introText[13] = "Undefined Location\nStable\nN/A";
introText[14] = "Undefined planet\nWindy\nLow gravity";
introText[15] = "Spring layout\nCongested\nN/A";
introText[16] = "Mars\nStable\nHigh gravity/Earthquake";
introText[17] = "Plastic\nFavorable\nN/A";
introMsg = new Array();
introMsg[0] = "Introduction";
introMsg[1] = "Warm Up";
introMsg[2] = "The Easy Part";
introMsg[3] = "The Easy Part";
introMsg[4] = "The Easy Part";
introMsg[5] = "The Easy Part";
introMsg[6] = "A Little Harder";
introMsg[7] = "A Little Harder";
introMsg[8] = "A Little Harder";
introMsg[9] = "Pro Area";
introMsg[10] = "Pro Area";
introMsg[11] = "Pro Area";
introMsg[12] = "Pro Area";
introMsg[13] = "Pro Area";
introMsg[14] = "Unknown Territory";
introMsg[15] = "Unknown Territory";
introMsg[16] = "Unknown Territory";
introMsg[17] = "The Finish";
intro_mc.play();
bg = new Array();
bg[0] = "18|90<196:0,0'50.348,-2'50.203,270'0.108<75:0,0'30.250,-6'0.130,-186'40.-73<-203:0,0'0.236,92'30.7,229'0.-158<-339:0,0'0.160,69'30.-63,226'0.-469<-487:0,0'50.322,93'40.216,254'20.-692<-639:0,0'50.244,36'40.177,238'20.=1350:750";
bg[1] = "30|116<174:0,0'20.145,-68'50.266,174'70.277<119:0,0'20.202,-124'50.61,99'70.197<-33:0,0'20.222,-22'50.79,151'70.-23<-161:0,0'20.267,-76'50.22,169'20.247<-212:0,0'20.73,139'50.-245,242'20.229<-426:0,0'20.209,32'50.33,230'60.15<-429:0,0'40.134,188'50.-1,165'10.45<-408:0,0'40.112,-54'50.87,120'10.73<-654:0,0'40.357,38'50.-36,234'10.180<-672:0,0'40.325,-139'60.278,44'80.=-1500:7650";
bg[2] = "39|32<135:0,0'60.417,-20'50.191,221'40.-104<-120:0,0'60.319,219'50.0,265'40.41<-61:0,0'60.370,-16'0.196,163'40.46<-259:0,0'60.340,74'0.11,190'70.425<-191:0,0'0.261,-203'80.246,58'70.379<-215:0,0'0.-198,-195'80.235,-147'70.406<-663:0,0'50.330,130'80.173,274'70.560<-377:0,0'50.-120,-210'80.-253,-133'70.705<-359:0,0'60.169,-218'70.347,-187'40.941<-604:0,0'60.345,-11'0.257,122'40.948<-801:0,0'60.378,-3'90.-25,188'40.1342<-546:0,0'20.145,-284'30.-24,-240'60.1292<-978:0,0'20.335,20'30.42,181'60.=-12150:11850";
bg[3] = "24|150<51:0,0'10.270,-6'20.149,276'30.-89<198:0,0'45.274,-9'20.212,177'30.-339<102:0,0'45.237,-63'0.150,193'30.-639<222:0,0'45.274,-9'20.212,177'30.-855<99:0,0'5.237,-61'20.189,230'70.-1012<-86:0,0'50.182,39'20.73,138'0.-992<-330:0,0'50.223,-13'40.150,180'10.-1168<-578:0,0'50.257,138'40.119,295'80.=3750:1200";
bg[4] = "51|223<202:0,0'1.-92,-183'111.155,-182'121.231<207:0,0'1.177,-147'111.213,93'121.231<217:0,0'1.208,113'111.-148,133'22.209<207:0,0'1.-148,118'66.-131,-201'55.-243<46:0,0'40.254,68'60.-24,234'100.-262<297:0,0'80.211,-113'90.151,64'10.-514<-83:0,0'80.321,-11'90.210,261'10.-527<-382:0,0'80.353,42'90.22,285'70.-498<-86:0,0'20.349,-257'141.340,-14'50.-880<-312:0,0'120.335,20'41.28,237'50.-969<-529:0,0'120.336,17'71.50,228'80.-777<-344:0,0'20.119,-106'71.242,47'80.-1133<-783:0,0'20.295,7'71.145,257'80.-1161<-1003:0,0'20.213,5'41.41,128'11.-1019<-1232:0,0'20.114,190'41.18,222'11.-1263<-1289:0,0'20.163,-44'41.13,204'11.-1249<-1552:0,0'20.238,-26'41.113,216'11.=14850:12000";
bg[5] = "27|41<44:0,0'50.377,-7'0.385,302'30.453<6:0,0'0.-17,-273'60.287,-72'70.795<-72:0,0'30.247,-146'60.257,110'60.1066<-228:0,0'10.192,-58'20.198,116'5.1292<-374:0,0'1.0,-92'2.141,-10'20.1255<-627:0,0'20.338,-82'80.374,134'20.1564<-736:0,0'20.224,-121'40.207,61'60.1694<-1071:0,0'40.318,-17'40.19,245'60.1948<-1153:0,0'40.-62,-276'0.109,-136'60.=-4950:3750";
bg[6] = "42|120<125:0,0'10.278,56'11.56,222'12.230<397:0,0'10.266,-59'30.179,120'12.312<564:0,0'40.290,-14'30.209,233'12.513<848:0,0'0.250,-77'30.384,82'50.719<995:0,0'0.274,-23'5.173,117'10.978<1139:0,0'30.90,-156'40.227,123'20.1181<981:0,0'0.297,62'50.250,262'10.1469<1272:0,0'20.218,-181'50.297,53'10.1609<1351:0,0'20.193,121'40.-145,189'60.1479<1573:0,0'20.322,-43'40.200,205'0.1524<1750:0,0'20.273,86'80.61,208'90.1517<1984:0,0'50.265,-63'80.240,61'110.1616<2042:0,0'50.323,31'80.115,127'10.1620<2213:0,0'50.327,219'0.77,225'10.=-8400:-10050";
bg[7] = "48|103<205:0,0'10.183,-54'11.194,119'90.254<42:0,0'10.53,-168'80.189,-53'0.467<75:0,0'10.214,-96'20.237,101'80.681<-247:0,0'80.193,58'20.-88,179'0.893<-106:0,0'10.275,-104'0.279,80'90.1101<-428:0,0'80.238,40'40.-102,172'0.1314<-270:0,0'20.303,-186'40.337,21'80.1465<-745:0,0'20.258,-99'40.150,178'5.1884<-987:0,0'20.181,180'90.-71,293'5.1669<-1234:0,0'120.226,-87'10.129,213'15.1997<-1556:0,0'0.170,210'200.17,279'20.1778<-1796:0,0'60.200,-76'80.172,200'0.1866<-2189:0,0'10.313,72'50.175,267'60.1593<-2353:0,0'110.237,189'0.127,318'60.1617<-2656:0,0'10.271,89'90.167,273'20.1370<-2789:0,0'10.228,67'60.55,212'20.=-6150:10200";
bg[8] = "48|231<164:0,0'10.178,63'40.61,162'50.370<360:0,0'20.103,-89'50.241,59'21.720<227:0,0'30.173,-29'5.-45,136'10.887<350:0,0'31.231,-17'6.154,156'5.1009<561:0,0'10.239,19'40.173,195'50.1387<603:0,0'1.232,-32'5.222,121'5.1608<854:0,0'20.179,-59'10.160,103'1.1868<883:0,0'0.214,-39'70.241,235'40.2018<1220:0,0'0.204,10'30.109,165'14.2275<1437:0,0'50.161,-200'0.215,-9'80.2598<1492:0,0'10.202,-100'40.142,101'0.2785<1610:0,0'10.193,-223'20.147,-86'0.2932<1665:0,0'10.36,-118'20.201,-253'0.3068<1571:0,0'10.226,48'130.162,143'0.3062<1758:0,0'10.183,98'30.-132,111'90.3370<1779:0,0'10.225,-14'30.151,211'90.=-16500:-8550";
bg[9] = "48|184<162:0,0'10.102,-21'20.70,79'40.240<31:0,0'70.123,3'20.7,111'1.376<63:0,0'60.128,3'20.43,86'22.417<-130:0,0'50.147,52'5.-81,75'10.518<-196:0,0'5.37,-141'50.-54,-190'10.303<-526:0,0'50.171,-5'20.71,61'0.249<-600:0,0'20.93,45'20.-5,97'0.149<-659:0,0'2.118,-10'70.72,94'30.24<-817:0,0'10.97,23'30.90,116'0.-134<-894:0,0'10.112,-71'0.129,130'6.-118<-1070:0,0'10.68,28'0.-21,112'20.-299<-1127:0,0'20.138,46'10.-19,132'15.-284<-1336:0,0'200.230,8'50.116,121'15.-227<-1618:0,0'100.322,-66'90.187,175'50.191<-1822:0,0'100.174,-9'90.69,92'50.425<-2015:0,0'40.107,-3'60.147,286'10.=4350:20250";
bg[10] = "39|104<202:0,0'10.322,7'20.164,172'120.118<53:0,0'10.291,-19'20.154,-179'120.126<-330:0,0'10.139,-199'20.277,-4'120.160<-835:0,0'130.248,51'20.-39,197'0.206<-1136:0,0'30.244,-42'200.253,208'10.234<-1591:0,0'100.256,-45'60.110,185'10.387<-1938:0,0'30.275,14'20.-28,191'50.380<-2160:0,0'10.249,-72'20.374,20'0.398<-2458:0,0'100.300,-8'20.132,146'0.381<-2697:0,0'100.293,-133'20.297,90'50.464<-3074:0,0'10.252,54'20.9,150'50.402<-3330:0,0'160.360,-43'20.230,219'50.419<-3664:0,0'160.313,-31'20.202,132'6.=-1800:18000";
bg[11] = "42|336<375:0,0'10.219,-12'50.124,169'60.157<128:0,0'10.264,12'0.108,237'60.608<422:0,0'10.159,-48'50.126,82'61.678<643:0,0'10.241,33'0.86,157'61.1056<495:0,0'10.176,-18'90.84,127'1.1160<655:0,0'10.262,15'90.89,147'1.1254<847:0,0'10.232,95'90.12,249'1.1251<1181:0,0'10.117,181'120.-174,165'11.799<1380:0,0'10.266,-20'20.200,174'111.472<1348:0,0'10.305,42'20.32,201'60.228<1701:0,0'110.248,-115'20.317,132'0.560<1886:0,0'10.312,169'20.-26,249'90.921<2098:0,0'10.285,48'0.64,224'90.1310<2139:0,0'10.213,-87'40.220,116'0.=-2550:-7200";
bg[12] = "42|203<160:0,0'10.208,-13'4.86,191'60.455<252:0,0'10.258,-208'224.206,113'60.793<112:0,0'10.207,-15'14.110,250'80.918<-114:0,0'110.297,1'24.63,205'40.1236<-129:0,0'60.369,-128'224.282,147'70.1518<52:0,0'80.171,-310'224.264,-152'50.1710<-285:0,0'80.336,-26'124.91,208'50.2102<-250:0,0'80.261,-153'24.221,129'50.2452<-290:0,0'0.242,-129'24.42,197'50.2686<-542:0,0'10.296,-53'4.282,145'60.3011<-699:0,0'101.263,-15'49.139,214'60.3152<-862:0,0'101.325,10'149.16,139'50.3413<-1146:0,0'101.334,43'149.-63,273'50.3547<-1437:0,0'10.191,-3'14.46,243'50.=-15300:4950";
bg[13] = "42|116<190:0,0'20.299,10'40.101,105'60.134<-111:0,0'120.291,13'40.131,293'60.68<-360:0,0'120.338,24'140.23,266'60.48<-643:0,0'120.405,20'40.370,249'60.64<-871:0,0'120.369,5'0.-7,219'50.64<-1148:0,0'80.282,23'80.-25,276'70.85<-1440:0,0'80.365,25'80.239,293'70.-53<-1718:0,0'80.293,16'80.110,294'80.-60<-1911:0,0'0.324,43'70.161,179'80.-264<-2076:0,0'70.330,39'20.45,271'80.-423<-2307:0,0'30.212,-53'21.163,215'20.-599<-2501:0,0'30.249,22'21.145,245'60.-668<-2731:0,0'30.329,31'80.40,243'60.-979<-2783:0,0'2.185,1'11.120,270'0.=14700:39900";
bg[14] = "30|177<87:0,0'40.250,103'30.62,252'0.-109<-57:0,0'90.318,-36'30.182,233'20.4<-374:0,0'0.191,206'80.-7,288'10.73<-542:0,0'0.362,4'80.116,245'40.220<-851:0,0'100.207,157'10.-49,265'0.337<-935:0,0'60.332,-67'10.152,183'90.432<-1221:0,0'150.264,-12'100.157,136'0.457<-1519:0,0'150.181,189'100.-42,233'60.301<-1854:0,0'100.294,51'140.229,274'20.276<-2100:0,0'100.261,-11'80.158,123'20.=-300:4200";
bg[15] = "51|260<176:0,0'20.174,68'30.-69,145'50.280<93:0,0'20.226,41'30.99,128'50.158<79:0,0'20.132,44'100.-3,147'50.179<-56:0,0'120.237,23'10.45,150'50.192<-212:0,0'20.221,42'30.19,106'50.227<-81:0,0'70.279,-119'130.233,48'50.266<-372:0,0'70.330,54'130.150,200'50.437<-620:0,0'70.329,88'30.-112,213'50.389<-372:0,0'70.345,-131'90.325,60'50.708<-296:0,0'70.204,-244'90.336,-96'50.714<-307:0,0'70.37,-205'20.188,-240'50.1130<-665:0,0'20.202,44'30.70,273'21.1231<-374:0,0'20.174,-211'30.411,-207'21.1554<-860:0,0'20.150,15'30.-5,143'21.1512<-687:0,0'60.213,-131'50.205,64'41.1595<-991:0,0'60.316,51'50.124,159'41.1453<-1011:0,0'60.189,96'80.-50,187'41.=-28050:20400";
bg[16] = "99|141<264:0,0'10.181,-14'10.101,67'10.250<121:0,0'10.136,12'10.13,91'10.104<100:0,0'10.104,39'10.-19,97'10.226<-31:0,0'10.150,-33'10.91,50'10.46<-82:0,0'10.130,82'10.-20,96'10.140<-219:0,0'10.141,50'10.10,98'10.256<-111:0,0'10.145,-75'10.64,51'10.83<-374:0,0'10.164,1'10.-20,119'10.267<-308:0,0'10.141,-64'10.169,67'10.478<-338:0,0'10.147,-34'10.115,98'10.436<-537:0,0'10.155,-2'10.-33,108'10.579<-454:0,0'10.139,-105'10.142,39'10.715<-345:0,0'10.118,-78'10.188,73'10.783<-527:0,0'10.203,-29'10.195,133'10.794<-794:0,0'20.121,45'20.17,180'20.978<-636:0,0'20.185,-92'20.125,80'20.1017<-842:0,0'20.195,6'20.-2,126'20.948<-986:0,0'20.184,-7'20.36,171'20.1219<-961:0,0'20.139,11'20.100,144'20.1196<-1140:0,0'30.256,19'30.31,120'30.1468<-1052:0,0'30.81,-113'30.245,-9'30.1501<-1369:0,0'30.220,66'30.-104,123'30.1712<-1215:0,0'30.177,-135'30.187,59'30.1924<-1094:0,0'40.158,-207'40.245,-53'40.2207<-1026:0,0'40.114,-211'40.120,6'40.2072<-1001:0,0'40.220,83'40.-68,220'40.2347<-806:0,0'40.169,-173'40.183,86'40.2647<-964:0,0'50.185,-49'50.158,238'0.2840<-1280:0,0'50.248,51'50.148,243'50.3093<-1115:0,0'50.245,-14'50.171,113'50.3119<-1421:0,0'60.301,-8'60.147,203'60.3398<-1317:0,0'60.173,11'60.123,180'60.3481<-1546:0,0'60.261,79'60.-38,192'60.=-66750:44250";
bg[17] = "57|112<180:0,0'10.226,-4'30.125,167'50.419<62:0,0'30.204,-27'50.170,180'80.395<234:0,0'30.298,58'50.45,119'80.693<152:0,0'30.248,-99'50.239,195'0.768<-88:0,0'30.103,12'50.36,104'0.1023<-44:0,0'30.116,73'20.-60,105'0.902<-192:0,0'30.258,8'20.38,139'40.1153<71:0,0'30.142,-125'1.190,71'0.1261<-128:0,0'30.182,-142'50.327,118'80.1435<69:0,0'130.280,-54'50.297,182'80.1634<-257:0,0'0.322,40'50.14,271'80.1846<-85:0,0'30.156,40'40.-18,156'50.2051<-208:0,0'30.117,-9'40.106,115'0.2094<-52:0,0'30.194,-64'40.154,74'0.2285<-222:0,0'0.179,-34'40.92,165'0.2322<-23:0,0'1.173,40'2.-22,151'39.2458<-36:0,0'111.157,-195'2.321,-16'39.2600<-9:0,0'11.218,41'22.-38,213'39.2781<-198:0,0'11.153,-44'70.207,60'13.=-43650:3300";
bg[18] = "24|81<315:0,0'300.236,-33'250.356,190'270.-69<138:0,0'300.381,50'290.-17,224'280.-358<94:0,0'250.283,55'270.187,279'200.-374<211:0,0'250.221,178'270.-188,298'200.-575<535:0,0'250.385,-112'170.354,123'200.-641<487:0,0'250.183,288'170.-216,278'200.-974<402:0,0'150.281,111'170.-44,269'200.-1111<723:0,0'150.353,-124'170.202,101'200.=-1200:0";
s = bg[level];
SETUP();
tdelta = 0;
time = 0;
l = 2;
h = triangles - 2;
maxs = 6;
damage = 0;
dm = 0;
running = false;
rn._visible = true;
EQ = function () {
if ((w._x < -5) || (w._x > 5)) {
dirrr = -dirrr;
}
w._x = w._x + dirrr;
if ((w._y < -5) || (w._y > 5)) {
dirrry = -dirrry;
}
w._y = w._y + dirrry;
};
speed = 0.5;
sx = (sy = speed);
gravP = grav;
Time = 0;
score = 0;
Timee = 0;
flypoints = 100;
flyd = 0.6;
score = level * 100;
if (_root.score < 500) {
_root.f = false;
_root.fly_mc._visible = false;
} else {
_root.f = true;
_root.fly_mc._visible = true;
}
siz = false;
fls = false;
if (level == 18) {
b.h = 400;
}
w.theball.swapDepths(200);
onEnterFrame = function () {
if (running) {
if (eqb[level]) {
EQ();
}
if ((windA > (windS.arr._rotation + (windInt * 5))) || (windA < (windS.arr._rotation - (windInt * 5)))) {
windDir = -windDir;
}
windS.arr._rotation = windS.arr._rotation + (windDir * windInt);
if (rainb[level]) {
fallrain();
}
if (inAir) {
b.x = b.x + windx;
b.y = b.y + windy;
} else {
b.x = b.x + (windx / 1.5);
b.y = b.y + (windy / 1.5);
}
newTime = getTimer();
tdelta = newTime - time;
time = newTime;
td2 = td;
td = tdelta / 30;
if (td > 1) {
td = 1;
}
gPull = gravP * td;
if (newTime > (Timee + 100)) {
Timee = newTime;
time_txt.text = Math.round(Time * 10) / 10;
Time = Time + 0.1;
}
if (newTime > (fpsTime + 5000)) {
fpsTime = newTime;
generateWind();
}
w.shade._xscale = (w.shade._yscale = 100 - ((b.h + b.syh) / 10));
b.h = b.h + (b.hv * td);
w.ball.shade2._y = b.h - b.syh;
b.x = b.x + (b.xv * td);
b.y = b.y - (b.yv * td);
dx = (b.x - thebx) / 20;
dy = ((b.y - theby) - b.h) / 20;
t.x = t.x - dx;
t.y = t.y - dy;
b.x = b.x - dx;
b.y = b.y - dy;
w.shade._x = b.x;
w.shade._y = b.y;
if (b.h != b.syh) {
gravity();
}
w.ball._x = b.x;
w.ball._y = b.y - b.h;
counter = 0;
low = false;
w.ball.shade2._visible = false;
p = l;
e = h;
if ((p - 1) < 2) {
p = 2;
}
if ((e + 1) > (triangles - 2)) {
e = triangles - 2;
}
l = triangles;
h = 0;
map.lb._x = b.x / 10;
map.lb._y = b.y / 10;
r = p - 2;
while (r < (e + 2)) {
if ((tri[r].rb > (-t.x)) && (tri[r].lb < (-t.x))) {
if ((tri[r].ub > (-t.y)) && (tri[r].db < (-t.y))) {
if (r < l) {
l = r;
}
if (h < r) {
h = r;
}
w["triangle" + r]._visible = true;
w["triangle" + r]._x = Math.round(t.x + tri[r].x);
w["triangle" + r]._y = Math.round(t.y + tri[r].y);
map["tr" + r]._x = w["triangle" + r]._x / rr;
map["tr" + r]._y = w["triangle" + r]._y / rr;
map["tr" + r]._visible = true;
} else {
w["triangle" + r]._visible = false;
map["tr" + r]._visible = false;
}
} else {
w["triangle" + r]._visible = false;
map["tr" + r]._visible = false;
}
r++;
}
cnt = 0;
onTriangle = false;
r = triangles - 1;
while (r >= 0) {
q = depArray[r];
tri[q].onTriangle = false;
if ((q <= h) && (q >= l)) {
loop();
}
r--;
}
if (counter == cnt) {
sx = (sy = speed);
if (b.syh > 0) {
inAir = true;
}
b.syh = 0;
}
if (Key.isDown(40) || (Key.isDown(83))) {
if (b.yv > (-maxs)) {
b.yv = b.yv - (sy * td);
}
if (b.yv > 0) {
b.yv = b.yv * 0.92;
}
} else if (Key.isDown(38) || (Key.isDown(87))) {
if (b.yv < maxs) {
b.yv = b.yv + (sy * td);
}
if (b.yv < 0) {
b.yv = b.yv * 0.92;
}
} else {
b.yv = b.yv * 0.98;
}
if (Key.isDown(37) || (Key.isDown(65))) {
if (b.xv > (-maxs)) {
b.xv = b.xv - (sx * td);
}
if (b.xv > 0) {
b.xv = b.xv * 0.92;
}
} else if (Key.isDown(39) || (Key.isDown(68))) {
if (b.xv < maxs) {
b.xv = b.xv + (sx * td);
}
if (b.xv < 0) {
b.xv = b.xv * 0.92;
}
} else {
b.xv = b.xv * 0.98;
}
if (Key.isDown(16) || (Key.isDown(88))) {
if (((b.hv < 0) && (flypoints > 0)) && (f)) {
flypoints = flypoints - flyd;
if (flypoints < 0) {
flypoints = 0;
}
if (!fls) {
if (!killsound) {
flysound.start();
}
fls = true;
}
fly_mc.flyp_mc._yscale = flypoints;
gravP = grav * 0.2;
} else {
gravP = grav;
if (fls) {
if (!killsound) {
flysound.stop();
}
fls = false;
}
}
} else {
gravP = grav;
if (fls) {
if (!killsound) {
flysound.stop();
}
fls = false;
}
}
if (tryingJump) {
if (!inAir) {
inAir = true;
jump();
tryingJump = false;
}
}
checkOver();
if ((((-t.x) < (stars[0].x + 50)) && (((-t.x) + 600) > stars[0].x)) && (((-t.y) < (stars[0].y + 50)) && (((-t.y) + 450) > stars[0].y))) {
drawStar();
} else {
w.star._visible = (w.starShade0._visible = (w.starHeart._visible = false));
}
} else {
if (blood_mc._alpha > 0) {
blood_mc._alpha = blood_mc._alpha - 0.4;
}
if (justDied) {
drawStar();
}
if (Key.isDown(32)) {
flypoints = 100;
fly_mc.flyp_mc._yscale = flypoints;
dmg.text = "0";
if ((intro_mc._currentframe == 26) && (!resetB)) {
intro_mc.play();
justDied = false;
}
if (over_mc._currentframe == 100) {
over_mc.play();
justDied = false;
reset();
Time = 0;
}
}
}
};
keyListener = new Object();
keyListener.onKeyDown = function () {
switch (Key.getCode()) {
case 17 :
tryingJump = true;
return;
case 32 :
tryingJump = true;
return;
case 90 :
tryingJump = true;
}
};
Key.addListener(keyListener);
sizzle.onSoundComplete = function () {
siz = false;
};
flysound.onSoundComplete = function () {
fls = false;
};
_root.bgsong.onSoundComplete = function () {
_root.bgsong.start();
};
Symbol 39 Button
on (release) {
getURL ("http://www.maxgames.com", "_blank");
}
Symbol 47 Button
on (release) {
getURL ("http://www.maxgames.com", "_blank");
}
Symbol 50 MovieClip Frame 60
stop();
Symbol 64 MovieClip Frame 14
stop();
Symbol 66 MovieClip Frame 242
_root.gotoAndStop(3);
Symbol 80 MovieClip Frame 25
stop();
Symbol 89 MovieClip Frame 1
if (_parent != _root.next_mc) {
stop();
}
Symbol 89 MovieClip Frame 38
stop();
easy_btn.onRelease = function () {
_root.jumpI = 14;
_root.grav = 1;
_root.dam = 0.4;
_parent.go++;
_root.hardness = 1;
_parent.info_txt.text = "Level difficulty changed to Easy.";
};
medium_btn.onRelease = function () {
_root.jumpI = 12;
_root.grav = 1;
_root.dam = 0.6;
_parent.go++;
_root.hardness = 1.3;
_parent.info_txt.text = "Level difficulty changed to Medium.";
};
hard_btn.onRelease = function () {
_root.jumpI = 10;
_root.grav = 1;
_root.dam = 1;
_parent.go++;
_root.hardness = 1.7;
_parent.info_txt.text = "Level difficulty changed to Hard.";
};
Symbol 97 Button
on (release) {
sendme_mc.play();
}
Symbol 108 MovieClip Frame 47
stop();
Symbol 109 MovieClip Frame 31
stop();
Symbol 119 Button
on (release) {
getURL ("http://www.maxgames.com", "_blank");
}
Symbol 122 MovieClip Frame 1
stop();
Symbol 126 MovieClip Frame 1
stop();
Symbol 126 MovieClip Frame 9
stop();
Symbol 145 Button
on (release) {
play();
}
Symbol 150 MovieClip Frame 1
stop();
Symbol 150 MovieClip Frame 2
sending_mc._visible = false;
Symbol 150 MovieClip Frame 36
stop();
lvOut = new LoadVars();
lvIn = new LoadVars();
send_mc.onRelease = function () {
if (msg_txt.text != "") {
lvOut.which = (mail_txt.text + " \n") + msg_txt.text;
trace(lvOut.which);
lvOut.sendAndLoad("sendMsg.php", lvIn, "POST");
send_mc._visible = false;
sending_mc._visible = true;
sending_mc.play();
} else {
info_txt.text = "Please provide a message and then send it.";
}
};
lvIn.onLoad = function (success) {
if (success) {
outputt.text = lvIn.returnVal;
STRING = outputt.text;
if (outputt.text.substring(0, 2) != "yes") {
gotoAndPlay (80);
} else {
gotoAndPlay (36);
}
} else {
gotoAndPlay (80);
}
};
Symbol 150 MovieClip Frame 37
sending_mc._visible = false;
Symbol 150 MovieClip Frame 79
gotoAndStop (1);
Symbol 150 MovieClip Frame 80
sending_mc._visible = false;
Symbol 151 MovieClip Frame 1
go = 0;
lvlno = 20;
levels = new Array();
levels[0] = "0";
levels[1] = "1738";
levels[2] = "9534";
levels[3] = "3943";
levels[4] = "2095";
levels[5] = "2965";
levels[6] = "1253";
levels[7] = "7239";
levels[8] = "3748";
levels[9] = "4232";
levels[10] = "1240";
levels[11] = "6344";
levels[12] = "6355";
levels[13] = "3634";
levels[14] = "9887";
levels[15] = "0787";
levels[16] = "8654";
levels[17] = "6754";
loadTri_mc._visible = false;
_root.level = 0;
response_txt.text = "Current Level = 0";
playy.onRelease = function () {
i = 0;
while (i < lvlno) {
if (lvl_inp.text == levels[i]) {
_root.level = i;
response_txt.text = "Level set to " + i;
break;
}
i++;
}
if (playy2._currentframe == 1) {
playy2.gotoAndPlay(2);
}
};
onEnterFrame = function () {
if (go > 0) {
go++;
loadTri_mc._visible = true;
loadTri_mc.play();
if (go > 50) {
_root.gotoAndStop(4);
}
}
};
lvl_inp.g;
Symbol 161 MovieClip Frame 1
stop();
Symbol 161 MovieClip Frame 2
stop();
Symbol 162 MovieClip Frame 1
dragging = false;
soundkiller.onRelease = function () {
if (_root.killsound) {
_root.killsound = false;
soundkiller.play();
} else {
_root.killsound = true;
soundkiller.play();
}
};
volum.onPress = function () {
dragging = true;
};
onMouseUp = function () {
dragging = false;
};
onMouseDown = function () {
if ((_xmouse >= 0) && (_xmouse < 60)) {
volum._x = _xmouse;
_root.bgsong.setVolume(_xmouse);
dragging = true;
}
};
onEnterFrame = function () {
if (dragging) {
if (_xmouse > 60) {
volum._x = 60;
_root.bgsong.setVolume(60);
} else if (_xmouse < 0) {
volum._x = 0;
_root.bgsong.setVolume(0);
} else {
volum._x = _xmouse;
_root.bgsong.setVolume(_xmouse);
}
}
};
Symbol 163 MovieClip Frame 1
stop();
Symbol 163 MovieClip Frame 33
_root.gotoAndStop(3);
Symbol 186 MovieClip Frame 1
stop();
Symbol 186 MovieClip Frame 99
gotoAndStop (1);
Symbol 202 MovieClip Frame 1
stop();
Symbol 212 MovieClip Frame 1
stop();
Symbol 216 Button
on (release) {
_root.hlp_mc._visible = 0;
}
Symbol 221 MovieClip Frame 1
stop();
Symbol 221 MovieClip Frame 100
stop();
Symbol 221 MovieClip Frame 101
_root.countdown.play();
Symbol 221 MovieClip Frame 103
_root.running = false;
Symbol 231 MovieClip Frame 1
stop();
Symbol 231 MovieClip Frame 2
stop();
Symbol 241 MovieClip Frame 1
stop();
Symbol 241 MovieClip Frame 64
playy2.gotoAndPlay(2);
jump_bt.skill_txt.text = "Jumping";
grav_bt.skill_txt.text = "Gravity";
handl_bt.skill_txt.text = "Manoeuvrability/Handling";
endur_bt.skill_txt.text = "Endurance";
fly_bt.skill_txt.text = "Flying";
_root.score = _root.score + (50 + (_root.hardness * Math.round((1000 / _root.Time) * (((100 - _root.damage) / 200) + 0.5))));
_root.Time = 0;
score_txt.text = "SCORE: " + _root.score;
if (_root.score < 500) {
_root.f = false;
fly_bt.gotoAndStop(2);
_root.fly_mc._visible = false;
f_txt.text = "";
} else {
_root.f = true;
fly_bt.gotoAndStop(1);
_root.fly_mc._visible = true;
f_txt.text = "hold SHIFT or X to FLY";
}
Symbol 241 MovieClip Frame 100
stop();
jump_bt.go_btn.onRelease = function () {
_root.jumpI = _root.jumpI + (0.05 * _root.jumpI);
_root.level++;
_root.s = _root.bg[_root.level];
play();
_root.SETUP();
_root.intro_mc.play();
};
grav_bt.go_btn.onRelease = function () {
_root.grav = _root.grav - (0.02 * _root.grav);
_root.level++;
_root.s = _root.bg[_root.level];
play();
_root.SETUP();
_root.intro_mc.play();
};
handl_bt.go_btn.onRelease = function () {
_root.speed = _root.speed + (0.05 * _root.speed);
_root.level++;
_root.s = _root.bg[_root.level];
play();
_root.SETUP();
_root.intro_mc.play();
};
endur_bt.go_btn.onRelease = function () {
_root.dam = _root.dam - (0.05 * _root.dam);
_root.level++;
_root.s = _root.bg[_root.level];
play();
_root.SETUP();
_root.intro_mc.play();
};
fly_bt.go_btn.onRelease = function () {
_root.flyd = _root.flyd - (0.05 * _root.flyd);
trace(_root.flyd);
_root.level++;
_root.s = _root.bg[_root.level];
play();
_root.SETUP();
_root.intro_mc.play();
};
Symbol 262 Button
on (release) {
_parent.play();
}
Symbol 263 MovieClip Frame 16
stop();
Symbol 264 MovieClip Frame 1
in_txt.text = "Level: " + _root.level;
Symbol 264 MovieClip Frame 34
if (_root.level == 0) {
stop();
info1 = "--> Use ARROWS or WASD to move around. \n\n --> CTRL to jump \n\n --> Your damage rises when you are off triangles \n\n --> Objective: Get to the end of triangle path and reach the star...";
letterno = 0;
}
onEnterFrame = function () {
tut_mc.tut_txt.text = tut_mc.tut_txt.text + info1.charAt(letterno);
letterno++;
};
Symbol 264 MovieClip Frame 59
_parent.play();
Symbol 265 MovieClip Frame 1
intro_txt._visible = 1;
levels = new Array();
levels[0] = "0";
levels[1] = "1738";
levels[2] = "9534";
levels[3] = "3943";
levels[4] = "2095";
levels[5] = "2965";
levels[6] = "1253";
levels[7] = "7239";
levels[8] = "3748";
levels[9] = "4232";
levels[10] = "1240";
levels[11] = "6344";
levels[12] = "6355";
levels[13] = "3634";
levels[14] = "9887";
levels[15] = "0787";
levels[16] = "8654";
levels[17] = "6754";
tip_txt.text = _root.introText[_root.level];
intro_txt.text = _root.introMsg[_root.level];
lvl_txt.text = _root.level;
code_txt.text = levels[_root.level];
stop();
Symbol 265 MovieClip Frame 26
stop();
Symbol 265 MovieClip Frame 27
_root.reset();
_root.resetB = true;
_root.running = true;
intro_txt._visible = false;
_root.countdown.play();
Symbol 265 MovieClip Frame 30
_root.running = false;
Symbol 265 MovieClip Frame 50
stop();
_root.resetB = false;
Symbol 269 MovieClip Frame 1
stop();
Symbol 269 MovieClip Frame 36
stop();
yourscore_txt.text = "Your score:\n" + _root.score;
Instance of Symbol 120 MovieClip in Symbol 269 MovieClip Frame 36
on (release) {
getURL ("http://www.maxgames.com", "_blank");
}
Symbol 320 MovieClip Frame 1
stop();
Symbol 320 MovieClip Frame 2
_root.w.ball._alpha = 0;
Symbol 320 MovieClip Frame 89
_root.running = true;
_root.tryingJump = false;
_root.w.ball._alpha = 100;
Symbol 328 Button
on (release) {
_root.return_mc.play();
}