Frame 1
Frame 2
function preloadSite() {
var _local4 = _root.getBytesLoaded();
var _local3 = _root.getBytesTotal();
var _local2 = Math.round((_local4 / _local3) * 100);
percentage_txt.text = _local2;
loader_mc.gotoAndStop(_local2);
loadedText.text = _local2 + "%";
if (_local4 >= _local3) {
clearInterval(loadingCall);
start_bnt._visible = true;
}
}
function moreGames() {
getURL ("http://www.gamesjolly.com/", "_blank");
}
start_bnt._visible = false;
stop();
loadingBar._xscale = 1;
var loadingCall = setInterval(preloadSite, 50);
var myMenu = new ContextMenu();
myMenu.hideBuiltInItems();
var copyrightNotice = new ContextMenuItem("@ www.gamesjolly.com", moreGames);
myMenu.customItems.push(copyrightNotice);
_root.menu = myMenu;
fscommand ("alloscale", false);
var tempLevel = 1;
playerDetails = SharedObject.getLocal("user");
if (playerDetails.data.lev == undefined) {
playerDetails.data.lev = tempLevel;
} else {
tempLevel = playerDetails.data.lev;
trace(playerDetails.data.lev + " playerDetails.data.lev");
}
var asound = true;
Frame 3
grid.removeMovieClip();
_root.Musiikki = new Sound(_root);
_global.allsound = new Sound(_root);
whoosh = new Sound(this);
whoosh.attachSound("swoosh");
whoosh.start(0, 1);
_global.dummy = "Kopd";
_root.Musiikki.attachSound("musicBG");
_root.Musiikki.start(0, 999);
var gameover_sound = new Sound();
gameover_sound.attachSound("gameoverSnd");
haiskoreteksti = "Submit to highscores";
virhenappi._visible = false;
frosmosplashi._alpha = 0;
aloitusaika = getTimer();
var alevel = false;
var a_sound = false;
_global.allsound = new Sound(_root);
var btn_snd = new Sound();
btn_snd.attachSound("buttonsnd");
Frame 5
function showShot(n) {
shot1._visible = false;
shot2._visible = false;
shot3._visible = false;
clearInterval(shotId);
shotId = setInterval(function () {
shot1._visible = false;
shot2._visible = false;
shot3._visible = false;
clearInterval(shotId);
if (n == 1) {
kirupaSound = new Sound(this);
kirupaSound.attachSound("startSnd");
kirupaSound.start(0, 1);
gotoAndPlay ("Main");
} else if (n == 2) {
howtoplay_mc._visible = true;
howtoplay_mc.gotoAndPlay(1);
if (howtoplay_mc.getDepth() != 100000) {
howtoplay_mc.swapDepths(100000);
}
} else if (n == 3) {
getURL ("http://www.gamesgeni.com/", "_blank");
}
}, 200);
if (n == 1) {
shot1._visible = true;
} else if (n == 2) {
shot2._visible = true;
} else if (n == 3) {
shot3._visible = true;
}
}
_global.gameon = false;
pyorii.onEnterFrame = function () {
this._rotation = this._rotation + 1;
};
stop();
shot1._visible = false;
shot2._visible = false;
shot3._visible = false;
howtoplay_mc._visible = false;
Instance of Symbol 235 MovieClip "howtoplay_mc" in Frame 5
on (release) {
_visible = false;
_parent.showShot(1);
}
Frame 6
function setyf(xx, yy) {
xx = xx * 1;
yy = yy * 1;
return((0 * xx) + (0.8660254 * yy));
}
function setxf(xx, yy) {
xx = xx * 1;
yy = yy * 1;
return((1 * xx) + (0.5 * yy));
}
function gety(xx, yy) {
xx = xx * 1;
yy = yy * 1;
return(((axis1x * yy) - (xx * axis1y)) / ((axis1x * axis2y) - (axis2x * axis1y)));
}
function getx(xx, yy) {
xx = xx * 1;
yy = yy * 1;
return(((xx * axis2y) - (axis2x * yy)) / ((axis1x * axis2y) - (axis2x * axis1y)));
}
function sety(xx, yy) {
xx = xx * 1;
yy = yy * 1;
return((axis1y * xx) + (axis2y * yy));
}
function setx(xx, yy) {
xx = xx * 1;
yy = yy * 1;
return((axis1x * xx) + (axis2x * yy));
}
function asetainfo(tuhlailu) {
i = 1;
while (i < 10) {
if (this["tuhlaus" + i]) {
this["tuhlaus" + i].mc.targetalpha = 0;
this["tuhlaus" + i].mc.targetscale = 0;
}
i++;
}
i = 1;
while (i <= tuhlailu) {
if (!this["tuhlaus" + i]) {
attachMovie("tileydinpommi", "tuhlaus" + i, 789789 + i);
}
this["tuhlaus" + i].mc.targetalpha = 100;
this["tuhlaus" + i]._xscale = (this["tuhlaus" + i]._yscale = 50);
this["tuhlaus" + i]._x = (320 + (i * 20)) - 5;
this["tuhlaus" + i]._y = -152;
i++;
}
}
function init() {
i = 0;
while (i <= Erivareja) {
_root["tatavaria" + i] = 1;
i++;
}
if (!isReset) {
levelCntr = tempLevel;
scoring = 10;
multiplier = "";
gridspeed = 20;
}
isGridClear = false;
tuhlailulim = 6;
tuhlailu = 6;
axis1x = 1;
axis1y = 0;
axis2x = 0.5;
axis2y = 0.8660254;
asetainfo(6);
palloilmassa = 0;
gridsBallCntr = 0;
seuraavapallo = 1;
seuraavaseuraavapallo = 2;
asetaseuraavapallo();
line_mc._visible = true;
ammuttu = 0;
d = 100;
rowsCurrentlyInGrid = -2;
popattavia = 0;
framerate = 0;
framejalaskettu = 0;
framenalkuaika = 0;
attachMovie("Tausta", "Tausta", 20);
kellonalkuaika = -999999;
kellonkesto = 7000;
Tausta._x = 275;
Tausta._y = 200;
Tausta._visible = false;
palloja_ammuttu = 0;
currentselectedsum = "0 / 10";
GridWidth = 5;
GameOver = false;
_global.gameon = false;
gametime = 20000;
levelper6 = "0";
_global.onnitteluja = false;
PointsThrown = 0;
animaationpituus = 9;
kerroin = 0.1;
attachMovie("Lopputiski", "lopputiski", 19);
attachMovie("nextlevelmc", "nextlevelmc", 20);
nextlevelmc._visible = false;
_root.lopputiski._visible = false;
_root.lopputiski._x = 250.02;
_root.lopputiski._y = 250.02;
_root.nextlevelmc._x = 250.02;
_root.nextlevelmc._y = 250.02;
if (!_global.onnitteluja) {
_root.samplegrid._visible = true;
_root.transformationlist._visible = true;
_global.gameon = true;
}
gamesinthislevel = 3;
tempPoints = 0;
Points = 0;
_global.lopputulema = Points;
Score = "" + Math.round(tempPoints);
valitunpallonkoko = 105;
valitsemattomankoko = 90;
level = tempLevel;
edellinenoikein = 0;
oikein = 0;
_global.lopputulos = "0";
Copiesleft = "" + ((gamesinthislevel + edellinenoikein) - oikein);
hiirenseuraaja._xscale = 10;
hiirenseuraaja._yscale = 10;
hiirenseuraaja._x = 100;
hiirenseuraaja._y = 100;
rotationtime = -10000;
hiirenseuraaja._visible = false;
this.attachMovie("empty", "grid", 0);
this.attachMovie("empty", "shots", 2);
this.attachMovie("empty", "scoreEffects", 1);
scoreEffects._x = (scoreEffects._y = 0);
this.grid._x = GridCenterX;
this.grid._y = GridCenterY;
this.grid._xscale = (this.grid._yscale = 0);
this.grid.targetscale = 100;
this.shots._x = 0;
this.shots._y = 0;
initGrid();
isReset = false;
}
function kiinnita(luku, ii, jj, nimi, xv, yv, poistetaanko) {
gridsBallCntr++;
grid.attachMovie("file" + luku, nimi, grid.getNextHighestDepth());
grid[nimi]._xscale = (grid[nimi]._yscale = 100 * GRID_SIZE);
grid[nimi].muni = ii;
grid[nimi].munj = jj;
grid[nimi].munsisalto = luku;
grid[nimi]._visible = true;
grid[nimi]._x = setxf(jj * tileW, ii * tileH);
grid[nimi]._y = setyf(jj * tileW, ii * tileH);
grid[nimi].gotoAndPlay(1);
grid[nimi]._rotation = -grid._rotation;
xxx = setx(jj * tileW, ii * tileH);
yyy = sety(jj * tileW, ii * tileH);
lenin = Math.sqrt((xxx * xxx) + (yyy * yyy));
xxx = xxx / lenin;
yyy = yyy / lenin;
uusxxx = -yyy;
uusyyy = xxx;
dpdp = (uusxxx * xv) + (uusyyy * yv);
gridspeed = gridspeed + ((7 * (dpdp - (lenin * Math.sin((gridspeed / 180) * 3.141592)))) * Math.pow(1 / (1 + gridsBallCntr), 1));
grid[nimi].solid = true;
grid[nimi].onEnterFrame = function () {
oikeax = setx(this.munj * tileW, this.muni * tileH);
oikeay = sety(this.munj * tileW, this.muni * tileH);
if (!_root.GameOver) {
if ((((oikeax < (_root.leftBound + 50)) || (oikeax > (_root.rightBound - 50))) || (oikeay < (_root.upperBound + 50))) || (oikeay > (_root.lowerBound - 50))) {
if (!this.varo) {
this.attachMovie("varopallo", "varo", this.getNextHighestDepth());
this.varo._alpha = 0;
}
this.varo._alpha = (this.varo._alpha * 0.9) + 6;
this.varo._x = 0;
this.varo._y = 0;
} else if (this.varo) {
if (this.varo._alpha < 5) {
this.varo.removeMovieClip();
} else {
this.varo._alpha = this.varo._alpha * 0.95;
}
}
if ((oikeax < (_root.leftBound + (tileW * 0.4))) || (oikeax > (_root.rightBound - (tileW * 0.4)))) {
_root.GameOver = true;
ThrowError(oikeax + grid._x, oikeay + grid._y);
}
if ((oikeay < (_root.upperBound + (tileH * 0.4))) || (oikeay > ((_root.lowerBound - 50) - (tileH * 0.4)))) {
_root.GameOver = true;
ThrowError(oikeax + grid._x, oikeay + grid._y);
}
}
};
if (poistetaanko) {
removeBlock(ii, jj);
}
laskeEriVarit();
}
function laskeEriVarit() {
var _local4 = new Array();
var _local5 = new Array();
var _local2 = 0;
var _local3 = 0;
i = 0;
while (i <= Erivareja) {
_root["tatavaria" + i] = 0;
i++;
}
_local4[_local3] = 0;
_local5[_local3] = 0;
BFStunnus++;
while (_local3 <= _local2) {
iii = _local4[_local3];
jjj = _local5[_local3];
_root["tatavaria" + grid[(("t_" + iii) + "_") + jjj].munsisalto]++;
iii = _local4[_local3] - 1;
jjj = _local5[_local3];
if (grid[(("t_" + iii) + "_") + jjj]) {
if (grid[(("t_" + iii) + "_") + jjj].BFS != BFStunnus) {
grid[(("t_" + iii) + "_") + jjj].BFS = BFStunnus;
_local2++;
_local4[_local2] = iii;
_local5[_local2] = jjj;
}
}
iii = _local4[_local3] + 1;
jjj = _local5[_local3];
if (grid[(("t_" + iii) + "_") + jjj]) {
if (grid[(("t_" + iii) + "_") + jjj].BFS != BFStunnus) {
grid[(("t_" + iii) + "_") + jjj].BFS = BFStunnus;
_local2++;
_local4[_local2] = iii;
_local5[_local2] = jjj;
}
}
iii = _local4[_local3];
jjj = _local5[_local3] + 1;
if (grid[(("t_" + iii) + "_") + jjj]) {
if (grid[(("t_" + iii) + "_") + jjj].BFS != BFStunnus) {
grid[(("t_" + iii) + "_") + jjj].BFS = BFStunnus;
_local2++;
_local4[_local2] = iii;
_local5[_local2] = jjj;
}
}
iii = _local4[_local3];
jjj = _local5[_local3] - 1;
if (grid[(("t_" + iii) + "_") + jjj]) {
if (grid[(("t_" + iii) + "_") + jjj].BFS != BFStunnus) {
grid[(("t_" + iii) + "_") + jjj].BFS = BFStunnus;
_local2++;
_local4[_local2] = iii;
_local5[_local2] = jjj;
}
}
iii = _local4[_local3] - 1;
jjj = _local5[_local3] + 1;
if (grid[(("t_" + iii) + "_") + jjj]) {
if (grid[(("t_" + iii) + "_") + jjj].BFS != BFStunnus) {
grid[(("t_" + iii) + "_") + jjj].BFS = BFStunnus;
_local2++;
_local4[_local2] = iii;
_local5[_local2] = jjj;
}
}
iii = _local4[_local3] + 1;
jjj = _local5[_local3] - 1;
if (grid[(("t_" + iii) + "_") + jjj]) {
if (grid[(("t_" + iii) + "_") + jjj].BFS != BFStunnus) {
grid[(("t_" + iii) + "_") + jjj].BFS = BFStunnus;
_local2++;
_local4[_local2] = iii;
_local5[_local2] = jjj;
}
}
_local3++;
}
}
function removeBlock(ii, jj) {
var _local5 = new Array();
var _local6 = new Array();
var _local3 = 0;
var _local4 = 0;
_local5[_local4] = ii;
_local6[_local4] = jj;
BFStunnus++;
id = grid[(("t_" + ii) + "_") + jj].munsisalto;
while (_local4 <= _local3) {
iii = _local5[_local4] - 1;
jjj = _local6[_local4];
if (grid[(("t_" + iii) + "_") + jjj]) {
if ((grid[(("t_" + iii) + "_") + jjj].BFS != BFStunnus) && (grid[(("t_" + iii) + "_") + jjj].munsisalto == id)) {
grid[(("t_" + iii) + "_") + jjj].BFS = BFStunnus;
_local3++;
_local5[_local3] = iii;
_local6[_local3] = jjj;
}
}
iii = _local5[_local4] + 1;
jjj = _local6[_local4];
if (grid[(("t_" + iii) + "_") + jjj]) {
if ((grid[(("t_" + iii) + "_") + jjj].BFS != BFStunnus) && (grid[(("t_" + iii) + "_") + jjj].munsisalto == id)) {
grid[(("t_" + iii) + "_") + jjj].BFS = BFStunnus;
_local3++;
_local5[_local3] = iii;
_local6[_local3] = jjj;
}
}
iii = _local5[_local4];
jjj = _local6[_local4] + 1;
if (grid[(("t_" + iii) + "_") + jjj]) {
if ((grid[(("t_" + iii) + "_") + jjj].BFS != BFStunnus) && (grid[(("t_" + iii) + "_") + jjj].munsisalto == id)) {
grid[(("t_" + iii) + "_") + jjj].BFS = BFStunnus;
_local3++;
_local5[_local3] = iii;
_local6[_local3] = jjj;
}
}
iii = _local5[_local4];
jjj = _local6[_local4] - 1;
if (grid[(("t_" + iii) + "_") + jjj]) {
if ((grid[(("t_" + iii) + "_") + jjj].BFS != BFStunnus) && (grid[(("t_" + iii) + "_") + jjj].munsisalto == id)) {
grid[(("t_" + iii) + "_") + jjj].BFS = BFStunnus;
_local3++;
_local5[_local3] = iii;
_local6[_local3] = jjj;
}
}
iii = _local5[_local4] - 1;
jjj = _local6[_local4] + 1;
if (grid[(("t_" + iii) + "_") + jjj]) {
if ((grid[(("t_" + iii) + "_") + jjj].BFS != BFStunnus) && (grid[(("t_" + iii) + "_") + jjj].munsisalto == id)) {
grid[(("t_" + iii) + "_") + jjj].BFS = BFStunnus;
_local3++;
_local5[_local3] = iii;
_local6[_local3] = jjj;
}
}
iii = _local5[_local4] + 1;
jjj = _local6[_local4] - 1;
if (grid[(("t_" + iii) + "_") + jjj]) {
if ((grid[(("t_" + iii) + "_") + jjj].BFS != BFStunnus) && (grid[(("t_" + iii) + "_") + jjj].munsisalto == id)) {
grid[(("t_" + iii) + "_") + jjj].BFS = BFStunnus;
_local3++;
_local5[_local3] = iii;
_local6[_local3] = jjj;
}
}
_local4++;
}
if (_local3 > 2) {
var _local9 = new Array();
var _local10 = new Array();
indexa3 = 0;
indexl3 = 0;
_local9[0] = 0;
_local10[0] = 0;
BFStunnus++;
while (indexa3 <= indexl3) {
iii = _local9[indexa3] - 1;
jjj = _local10[indexa3];
if (grid[(("t_" + iii) + "_") + jjj]) {
if (grid[(("t_" + iii) + "_") + jjj].BFS != BFStunnus) {
grid[(("t_" + iii) + "_") + jjj].BFS = BFStunnus;
indexl3++;
_local9[indexl3] = iii;
_local10[indexl3] = jjj;
}
}
iii = _local9[indexa3] + 1;
jjj = _local10[indexa3];
if (grid[(("t_" + iii) + "_") + jjj]) {
if (grid[(("t_" + iii) + "_") + jjj].BFS != BFStunnus) {
grid[(("t_" + iii) + "_") + jjj].BFS = BFStunnus;
indexl3++;
_local9[indexl3] = iii;
_local10[indexl3] = jjj;
}
}
iii = _local9[indexa3];
jjj = _local10[indexa3] - 1;
if (grid[(("t_" + iii) + "_") + jjj]) {
if (grid[(("t_" + iii) + "_") + jjj].BFS != BFStunnus) {
grid[(("t_" + iii) + "_") + jjj].BFS = BFStunnus;
indexl3++;
_local9[indexl3] = iii;
_local10[indexl3] = jjj;
}
}
iii = _local9[indexa3];
jjj = _local10[indexa3] + 1;
if (grid[(("t_" + iii) + "_") + jjj]) {
if (grid[(("t_" + iii) + "_") + jjj].BFS != BFStunnus) {
grid[(("t_" + iii) + "_") + jjj].BFS = BFStunnus;
indexl3++;
_local9[indexl3] = iii;
_local10[indexl3] = jjj;
}
}
iii = _local9[indexa3] + 1;
jjj = _local10[indexa3] - 1;
if (grid[(("t_" + iii) + "_") + jjj]) {
if (grid[(("t_" + iii) + "_") + jjj].BFS != BFStunnus) {
grid[(("t_" + iii) + "_") + jjj].BFS = BFStunnus;
indexl3++;
_local9[indexl3] = iii;
_local10[indexl3] = jjj;
}
}
iii = _local9[indexa3] - 1;
jjj = _local10[indexa3] + 1;
if (grid[(("t_" + iii) + "_") + jjj]) {
if (grid[(("t_" + iii) + "_") + jjj].BFS != BFStunnus) {
grid[(("t_" + iii) + "_") + jjj].BFS = BFStunnus;
indexl3++;
_local9[indexl3] = iii;
_local10[indexl3] = jjj;
}
}
indexa3++;
}
_local5 = new Array();
_local6 = new Array();
_local3 = 0;
_local4 = 0;
_local5[_local4] = ii;
_local6[_local4] = jj;
BFStunnus++;
while (_local4 <= _local3) {
iii = _local5[_local4] - 1;
jjj = _local6[_local4];
if (grid[(("t_" + iii) + "_") + jjj]) {
if ((grid[(("t_" + iii) + "_") + jjj].BFS != BFStunnus) && (grid[(("t_" + iii) + "_") + jjj].munsisalto == id)) {
ThrowPoints(scoring, grid._x + setx(jjj * tileW, iii * tileH), grid._y + sety(jjj * tileW, iii * tileH), grid[(("t_" + iii) + "_") + jjj]);
grid[(("t_" + iii) + "_") + jjj].removeMovieClip();
_local3++;
_local5[_local3] = iii;
_local6[_local3] = jjj;
}
}
iii = _local5[_local4] + 1;
jjj = _local6[_local4];
if (grid[(("t_" + iii) + "_") + jjj]) {
if ((grid[(("t_" + iii) + "_") + jjj].BFS != BFStunnus) && (grid[(("t_" + iii) + "_") + jjj].munsisalto == id)) {
ThrowPoints(scoring, grid._x + setx(jjj * tileW, iii * tileH), grid._y + sety(jjj * tileW, iii * tileH), grid[(("t_" + iii) + "_") + jjj]);
grid[(("t_" + iii) + "_") + jjj].removeMovieClip();
_local3++;
_local5[_local3] = iii;
_local6[_local3] = jjj;
}
}
iii = _local5[_local4];
jjj = _local6[_local4] + 1;
if (grid[(("t_" + iii) + "_") + jjj]) {
if ((grid[(("t_" + iii) + "_") + jjj].BFS != BFStunnus) && (grid[(("t_" + iii) + "_") + jjj].munsisalto == id)) {
ThrowPoints(scoring, grid._x + setx(jjj * tileW, iii * tileH), grid._y + sety(jjj * tileW, iii * tileH), grid[(("t_" + iii) + "_") + jjj]);
grid[(("t_" + iii) + "_") + jjj].removeMovieClip();
_local3++;
_local5[_local3] = iii;
_local6[_local3] = jjj;
}
}
iii = _local5[_local4];
jjj = _local6[_local4] - 1;
if (grid[(("t_" + iii) + "_") + jjj]) {
if ((grid[(("t_" + iii) + "_") + jjj].BFS != BFStunnus) && (grid[(("t_" + iii) + "_") + jjj].munsisalto == id)) {
ThrowPoints(scoring, grid._x + setx(jjj * tileW, iii * tileH), grid._y + sety(jjj * tileW, iii * tileH), grid[(("t_" + iii) + "_") + jjj]);
grid[(("t_" + iii) + "_") + jjj].removeMovieClip();
_local3++;
_local5[_local3] = iii;
_local6[_local3] = jjj;
}
}
iii = _local5[_local4] - 1;
jjj = _local6[_local4] + 1;
if (grid[(("t_" + iii) + "_") + jjj]) {
if ((grid[(("t_" + iii) + "_") + jjj].BFS != BFStunnus) && (grid[(("t_" + iii) + "_") + jjj].munsisalto == id)) {
ThrowPoints(scoring, grid._x + setx(jjj * tileW, iii * tileH), grid._y + sety(jjj * tileW, iii * tileH), grid[(("t_" + iii) + "_") + jjj]);
grid[(("t_" + iii) + "_") + jjj].removeMovieClip();
_local3++;
_local5[_local3] = iii;
_local6[_local3] = jjj;
}
}
iii = _local5[_local4] + 1;
jjj = _local6[_local4] - 1;
if (grid[(("t_" + iii) + "_") + jjj]) {
if ((grid[(("t_" + iii) + "_") + jjj].BFS != BFStunnus) && (grid[(("t_" + iii) + "_") + jjj].munsisalto == id)) {
ThrowPoints(scoring, grid._x + setx(jjj * tileW, iii * tileH), grid._y + sety(jjj * tileW, iii * tileH), grid[(("t_" + iii) + "_") + jjj]);
grid[(("t_" + iii) + "_") + jjj].removeMovieClip();
_local3++;
_local5[_local3] = iii;
_local6[_local3] = jjj;
}
}
_local4++;
}
var _local7 = new Array();
var _local8 = new Array();
indexa2 = 0;
indexl2 = 0;
_local7[0] = 0;
_local8[0] = 0;
BFStunnus++;
while (indexa2 <= indexl2) {
iii = _local7[indexa2];
jjj = _local8[indexa2];
grid[(("t_" + iii) + "_") + jjj].BFS = BFStunnus;
iii = _local7[indexa2] - 1;
jjj = _local8[indexa2];
if (grid[(("t_" + iii) + "_") + jjj]) {
if (grid[(("t_" + iii) + "_") + jjj].BFS != BFStunnus) {
grid[(("t_" + iii) + "_") + jjj].BFS = BFStunnus;
indexl2++;
_local7[indexl2] = iii;
_local8[indexl2] = jjj;
}
}
iii = _local7[indexa2] + 1;
jjj = _local8[indexa2];
if (grid[(("t_" + iii) + "_") + jjj]) {
if (grid[(("t_" + iii) + "_") + jjj].BFS != BFStunnus) {
grid[(("t_" + iii) + "_") + jjj].BFS = BFStunnus;
indexl2++;
_local7[indexl2] = iii;
_local8[indexl2] = jjj;
}
}
iii = _local7[indexa2];
jjj = _local8[indexa2] + 1;
if (grid[(("t_" + iii) + "_") + jjj]) {
if (grid[(("t_" + iii) + "_") + jjj].BFS != BFStunnus) {
grid[(("t_" + iii) + "_") + jjj].BFS = BFStunnus;
indexl2++;
_local7[indexl2] = iii;
_local8[indexl2] = jjj;
}
}
iii = _local7[indexa2];
jjj = _local8[indexa2] - 1;
if (grid[(("t_" + iii) + "_") + jjj]) {
if (grid[(("t_" + iii) + "_") + jjj].BFS != BFStunnus) {
grid[(("t_" + iii) + "_") + jjj].BFS = BFStunnus;
indexl2++;
_local7[indexl2] = iii;
_local8[indexl2] = jjj;
}
}
iii = _local7[indexa2] - 1;
jjj = _local8[indexa2] + 1;
if (grid[(("t_" + iii) + "_") + jjj]) {
if (grid[(("t_" + iii) + "_") + jjj].BFS != BFStunnus) {
grid[(("t_" + iii) + "_") + jjj].BFS = BFStunnus;
indexl2++;
_local7[indexl2] = iii;
_local8[indexl2] = jjj;
}
}
iii = _local7[indexa2] + 1;
jjj = _local8[indexa2] - 1;
if (grid[(("t_" + iii) + "_") + jjj]) {
if (grid[(("t_" + iii) + "_") + jjj].BFS != BFStunnus) {
grid[(("t_" + iii) + "_") + jjj].BFS = BFStunnus;
indexl2++;
_local7[indexl2] = iii;
_local8[indexl2] = jjj;
}
}
indexa2++;
}
poistettuja = 0;
var _local11 = 0;
while (_local11 <= indexl3) {
iii = _local9[_local11];
jjj = _local10[_local11];
if (grid[(("t_" + iii) + "_") + jjj]) {
if (grid[(("t_" + iii) + "_") + jjj].BFS != BFStunnus) {
ThrowPoints(scoring, grid._x + setx(jjj * tileW, iii * tileH), grid._y + sety(jjj * tileW, iii * tileH), grid[(("t_" + iii) + "_") + jjj]);
grid[(("t_" + iii) + "_") + jjj].removeMovieClip();
poistettuja++;
}
}
_local11++;
}
kirupaSound = new Sound(this);
kirupaSound.attachSound("startSnd");
kirupaSound.start(0, 1);
poistettuja = poistettuja + _local3;
gridsBallCntr = gridsBallCntr - poistettuja;
Points = Points + (poistettuja * scoring);
Score = (_global.lopputulos = "" + Points);
mylevelScore = Score;
_global.lopputulema = Points;
}
}
function cleanUp() {
var _local3 = GridWidth;
var _local4 = rowsCurrentlyInGrid;
var _local2 = 0;
while (_local2 < _local4) {
var _local1 = 0;
while (_local1 < _local3) {
if (grid[(("t_" + _local2) + "_") + _local1]) {
grid[(("t_" + _local2) + "_") + _local1].removeMovieClip();
}
_local1++;
}
_local2++;
}
}
function removeSumsFromGrid() {
var _local3 = 0;
var _local4 = GridWidth;
var _local5 = rowsCurrentlyInGrid;
var _local2 = 0;
if (rowsCurrentlyInGrid > 30) {
}
_local2 = rowsCurrentlyInGrid - 30;
while (_local2 < _local5) {
var _local1 = 0;
while (_local1 < _local4) {
if (grid[(("t_" + _local2) + "_") + _local1]) {
tulos = 1;
if (grid[(("t_" + _local2) + "_") + _local1].valittu) {
tulos = 2;
}
if (tulos == 2) {
_local3 = _local3 + int(grid[(("t_" + _local2) + "_") + _local1].munsisalto);
}
}
_local1++;
}
_local2++;
}
currentselectedsum = _local3 + " / 10";
return(false);
}
function removeSelectedFromGrid() {
var _local5 = GridWidth;
var _local6 = rowsCurrentlyInGrid;
var _local3 = 0;
var _local4 = 0;
if (rowsCurrentlyInGrid > 30) {
}
_local3 = rowsCurrentlyInGrid - 30;
while (_local3 < _local6) {
var _local2 = 0;
while (_local2 < _local5) {
if (grid[(("t_" + _local3) + "_") + _local2]) {
tulos = 1;
if (grid[(("t_" + _local3) + "_") + _local2].valittu) {
tulos = 2;
}
if (tulos == 2) {
ThrowPoints(scoring, grid[(("t_" + _local3) + "_") + _local2]._x + grid._x, grid[(("t_" + _local3) + "_") + _local2]._y + grid._y);
grid[(("t_" + _local3) + "_") + _local2].removeMovieClip();
_local4++;
Points = Points + scoring;
Score = (_global.lopputulos = "" + Points);
_global.lopputulema = Points;
haiskore.send("scoreboard", "update_score", "Haasto", Points);
}
}
_local2++;
}
_local3++;
}
}
function poppaa() {
bubblePop = new Sound(_root);
bubblePop.attachSound("bubble");
bubblePop.start(0, 1);
popattavia--;
if (popattavia <= 0) {
clearInterval(ID);
}
}
function setNumbers(container, Width, Height) {
koko = Width * Height;
var _local1 = new Array();
do {
nyk = 0;
temppisum = 0;
while (nyk < koko) {
_local1[nyk] = random(9) + 1;
if ((temppisum + _local1[nyk]) > 10) {
_local1[nyk] = 10 - temppisum;
}
temppisum = temppisum + _local1[nyk];
if (temppisum == 10) {
temppisum = 0;
}
if (nyk == (koko - 1)) {
if (temppisum > 0) {
_local1[nyk] = _local1[nyk] + (10 - temppisum);
}
}
nyk++;
}
} while (_local1[koko - 1] == 10);
var _local3 = 0;
while (_local3 < koko) {
indeksi1 = _local3 + random(koko - _local3);
tempvalue = _local1[_local3];
_local1[_local3] = _local1[indeksi1];
_local1[indeksi1] = tempvalue;
_local3++;
}
nyk = 0;
_local3 = 0;
while (_local3 < Height) {
var _local2 = 0;
while (_local2 < Width) {
container[(("t_" + _local3) + "_") + _local2].munsisalto = _local1[nyk];
nyk++;
_local2++;
}
_local3++;
}
}
function randomColor() {
juritus = 0;
do {
juritus++;
tulos = random(Erivareja) + 1;
} while ((_root["tatavaria" + tulos] == 0) && (juritus < 100));
return(tulos);
while (_local2 < 9) {
todnaksum = todnaksum + todnakit[_local2];
_local2++;
}
tulos = random(todnaksum);
todnaksum = 0;
indeksi = 0;
while (indeksi < 9) {
todnaksum = todnaksum + todnakit[indeksi];
if (todnaksum > tulos) {
return(indeksi + 1);
}
indeksi++;
}
return(-1);
}
function randomColor2() {
tulos = random(Erivareja) + 1;
return(tulos);
while (_local1 < 9) {
todnaksum = todnaksum + todnakit[_local1];
_local1++;
}
tulos = random(todnaksum);
todnaksum = 0;
indeksi = 0;
while (indeksi < 9) {
todnaksum = todnaksum + todnakit[indeksi];
if (todnaksum > tulos) {
return(indeksi + 1);
}
indeksi++;
}
return(-1);
}
function asetaitte(i, j, luku) {
if (grid[(("t_" + i) + "_") + j]) {
grid[(("t_" + i) + "_") + j].removeMovieClip();
} else {
gridsBallCntr++;
}
grid.attachMovie("file" + luku, (("t_" + i) + "_") + j, grid.getNextHighestDepth());
grid[(("t_" + i) + "_") + j].munsisalto = luku;
grid[(("t_" + i) + "_") + j]._xscale = (grid[(("t_" + i) + "_") + j]._yscale = GRID_SIZE * 100);
grid[(("t_" + i) + "_") + j]._x = setxf(tileW * j, tileH * i);
grid[(("t_" + i) + "_") + j]._y = setyf(tileW * j, tileH * i);
grid[(("t_" + i) + "_") + j].gotoAndPlay(1);
grid[(("t_" + i) + "_") + j].solid = true;
}
function addRowToGrid() {
var _local2 = rowsCurrentlyInGrid;
var _local1 = -Math.floor(Alkuklimpinkoko / 2);
while (_local1 < ((-Math.floor(Alkuklimpinkoko / 2)) + Alkuklimpinkoko)) {
luku = randomColor();
grid.attachMovie("file" + luku, (("t_" + _local2) + "_") + _local1, grid.getNextHighestDepth());
gridsBallCntr++;
grid[(("t_" + _local2) + "_") + _local1].munsisalto = luku;
grid[(("t_" + _local2) + "_") + _local1]._xscale = (grid[(("t_" + _local2) + "_") + _local1]._yscale = GRID_SIZE * 100);
grid[(("t_" + _local2) + "_") + _local1]._x = setxf(tileW * _local1, tileH * _local2);
grid[(("t_" + _local2) + "_") + _local1]._y = setyf(tileW * _local1, tileH * _local2);
grid[(("t_" + _local2) + "_") + _local1].gotoAndPlay(1);
grid[(("t_" + _local2) + "_") + _local1].solid = true;
_local1++;
}
rowsCurrentlyInGrid++;
}
function dist2(x1, y1, x2, y2) {
return(((x1 - x2) * (x1 - x2)) + ((y1 - y2) * (y1 - y2)));
}
function testhit(xx, yy) {
var _local8 = Math.round(gety(xx - _root.grid._x, yy - _root.grid._y) / tileW) - 1;
var _local9 = _local8 + 2;
var _local4 = Math.round(getx(xx - _root.grid._x, yy - _root.grid._y) / tileH) - 1;
var _local5 = _local4 + 2;
var _local3 = _local8;
while (_local3 <= _local9) {
var _local2 = _local4;
while (_local2 <= _local5) {
if (_root.grid[(("t_" + _local3) + "_") + _local2]) {
if (dist2(setx(_local2 * tileW, _local3 * tileH) + _root.grid._x, sety(_local2 * tileW, _local3 * tileH) + _root.grid._y, xx, yy) < ((900 * GRID_SIZE) * GRID_SIZE)) {
return(true);
}
}
_local2++;
}
_local3++;
}
return(false);
}
function shootrandom() {
palloilmassa++;
luku = randomColor();
nimi = "t_" + palloja_ammuttu;
palloja_ammuttu++;
shots.attachMovie("file" + luku, nimi, shots.getNextHighestDepth());
shots[nimi].bounceCntr = 0;
shots[nimi]._xscale = (shots[nimi]._yscale = 100 * GRID_SIZE);
shots[nimi].koko = 100;
shots[nimi].munsisalto = luku;
shots[nimi]._visible = true;
ang = (Math.random() * 2) * 3.141592;
factori = 1 + Math.random();
shots[nimi]._x = GridCenterX + ((Math.cos(ang) * 420) * factori);
shots[nimi]._y = GridCenterY + ((Math.sin(ang) * 420) * factori);
shots[nimi].xv = GridCenterX - shots[nimi]._x;
shots[nimi].yv = GridCenterY - shots[nimi]._y;
len = Math.sqrt((shots[nimi].xv * shots[nimi].xv) + (shots[nimi].yv * shots[nimi].yv));
len = len / 15;
shots[nimi].xv = shots[nimi].xv / len;
shots[nimi].yv = shots[nimi].yv / len;
shots[nimi]._alpha = 100;
shots[nimi].gotoAndPlay(1);
shots[nimi].solid = false;
shots[nimi].eletty = 0;
shots[nimi].onEnterFrame = function () {
if (!_global.gameon) {
this.removeMovieClip();
}
this.eletty++;
if ((!this.solid) && (_global.gameon)) {
this._y = this._y + (this.yv * 0.5);
this._x = this._x + (this.xv * 0.5);
if (testhit(this._x, this._y)) {
var _local8 = Math.round(gety(this._x - _root.grid._x, this._y - _root.grid._y) / tileW) - 1;
var _local9 = _local8 + 2;
var _local6 = Math.round(getx(this._x - _root.grid._x, this._y - _root.grid._y) / tileH) - 1;
var _local7 = _local6 + 2;
parasnimi = "";
parasdist = 9999999 /* 0x98967F */;
var _local5 = _local8;
while (_local5 <= _local9) {
var _local4 = _local6;
while (_local4 <= _local7) {
if (!_root.grid[(("t_" + _local5) + "_") + _local4]) {
ddd222 = dist2(_root.grid._x + setx(_local4 * tileW, _local5 * tileH), _root.grid._y + sety(_local4 * tileW, _local5 * tileH), this._x, this._y);
if (parasdist > ddd222) {
parasdist = ddd222;
parasii = _local5;
parasjj = _local4;
}
}
_local4++;
}
_local5++;
}
kiinnita(this.munsisalto, parasii, parasjj, (("t_" + parasii) + "_") + parasjj, this.xv, this.yv, false);
palloilmassa--;
this.removeMovieClip();
return(undefined);
}
this._y = this._y + (this.yv * 0.5);
this._x = this._x + (this.xv * 0.5);
if (testhit(this._x, this._y)) {
var _local8 = Math.round(gety(this._x - _root.grid._x, this._y - _root.grid._y) / tileW) - 1;
var _local9 = _local8 + 2;
var _local6 = Math.round(getx(this._x - _root.grid._x, this._y - _root.grid._y) / tileH) - 1;
var _local7 = _local6 + 2;
parasnimi = "";
parasdist = 9999999 /* 0x98967F */;
var _local5 = _local8;
while (_local5 <= _local9) {
var _local4 = _local6;
while (_local4 <= _local7) {
if (!_root.grid[(("t_" + _local5) + "_") + _local4]) {
ddd222 = dist2(_root.grid._x + setx(_local4 * tileW, _local5 * tileH), _root.grid._y + sety(_local4 * tileW, _local5 * tileH), this._x, this._y);
if (parasdist > ddd222) {
parasdist = ddd222;
parasii = _local5;
parasjj = _local4;
}
}
_local4++;
}
_local5++;
}
kiinnita(this.munsisalto, parasii, parasjj, (("t_" + parasii) + "_") + parasjj, this.xv, this.yv, false);
palloilmassa--;
this.removeMovieClip();
return(undefined);
}
}
};
}
function asetaseuraavapallo() {
seuraavapallo = seuraavaseuraavapallo;
attachMovie("file" + seuraavapallo, "ammuttavapallo", 28);
ammuttavapallo._y = canon._y;
ammuttavapallo._xscale = (ammuttavapallo._yscale = 50);
ammuttavapallo.targety = canon._y;
ammuttavapallo.targetscale = 80 * GRID_SIZE;
ammuttavapallo._x = canon._x;
ammuttavapallo.onEnterFrame = function () {
this._xscale = (this._yscale = (0.95 * this._xscale) + (0.05 * this.targetscale));
this._y = (0.95 * this._y) + (0.05 * this.targety);
};
seuraavaseuraavapallo = randomColor();
attachMovie("file" + seuraavaseuraavapallo, "ammuttavaammuttavapallo", 29);
ammuttavaammuttavapallo._y = canon._y + 27;
ammuttavaammuttavapallo.targety = canon._y + 27;
ammuttavaammuttavapallo._x = GridCenterX;
ammuttavaammuttavapallo._xscale = (ammuttavaammuttavapallo._yscale = 0);
ammuttavaammuttavapallo.targetscale = 45 * GRID_SIZE;
ammuttavaammuttavapallo.onEnterFrame = function () {
this._xscale = (this._yscale = (0.95 * this._xscale) + (0.05 * this.targetscale));
this._y = (0.95 * this._y) + (0.05 * this.targety);
};
}
function shoot() {
if (palloilmassa > 0) {
return(undefined);
}
palloilmassa++;
luku = seuraavapallo;
ammuttavapallo._xscale = (ammuttavapallo._yscale = 0);
ammuttavapallo.targetscale = 0;
nimi = "t_" + palloja_ammuttu;
palloja_ammuttu++;
shots.attachMovie("file" + luku, nimi, shots.getNextHighestDepth());
shots[nimi].bounceCntr = 0;
shots[nimi]._xscale = (shots[nimi]._yscale = 100 * GRID_SIZE);
shots[nimi].koko = 100;
shots[nimi].munsisalto = luku;
shots[nimi]._visible = true;
shots[nimi]._x = canon._x;
shots[nimi]._y = canon._y;
shots[nimi].xv = _root._xmouse - shots[nimi]._x;
shots[nimi].yv = _root._ymouse - shots[nimi]._y;
len = Math.sqrt((shots[nimi].xv * shots[nimi].xv) + (shots[nimi].yv * shots[nimi].yv));
len = len / BALL_SPEED;
shots[nimi].xv = shots[nimi].xv / len;
shots[nimi].yv = shots[nimi].yv / len;
shots[nimi].ekaframe = true;
shots[nimi]._alpha = 100;
shots[nimi].gotoAndPlay(1);
shots[nimi].solid = false;
shots[nimi].eletty = 0;
shotSnd = new Sound(_root);
shotSnd.attachSound("shootSnd");
shotSnd.start(0, 1);
shots[nimi].onEnterFrame = function () {
if (!_global.gameon) {
this.removeMovieClip();
}
this.eletty++;
if ((!this.solid) && (_global.gameon)) {
if (this.bounceCntr > 5) {
ThrowPoints2(this._x, this._y, this);
_root.tuhlailu--;
asetainfo(_root.tuhlailu);
ammuttavapallo.targetscale = 50;
palloilmassa--;
this.removeMovieClip();
return(undefined);
}
if (!this.ekaframe) {
this._y = this._y + (this.yv * 0.5);
this._x = this._x + (this.xv * 0.5);
} else {
this.ekaframe = false;
}
if (testhit(this._x, this._y)) {
var _local8 = Math.round(gety(this._x - _root.grid._x, this._y - _root.grid._y) / tileW) - 1;
var _local9 = _local8 + 2;
var _local6 = Math.round(getx(this._x - _root.grid._x, this._y - _root.grid._y) / tileH) - 1;
var _local7 = _local6 + 2;
parasnimi = "";
parasdist = 9999999 /* 0x98967F */;
var _local5 = _local8;
while (_local5 <= _local9) {
var _local4 = _local6;
while (_local4 <= _local7) {
if (!_root.grid[(("t_" + _local5) + "_") + _local4]) {
ddd222 = dist2(_root.grid._x + setx(_local4 * tileW, _local5 * tileH), _root.grid._y + sety(_local4 * tileW, _local5 * tileH), this._x, this._y);
if (parasdist > ddd222) {
parasdist = ddd222;
parasii = _local5;
parasjj = _local4;
}
}
_local4++;
}
_local5++;
}
oldpiste = Points;
kiinnita(this.munsisalto, parasii, parasjj, (("t_" + parasii) + "_") + parasjj, this.xv, this.yv, true);
if (oldpiste == Points) {
tuhlailu--;
}
asetainfo(tuhlailu);
palloilmassa--;
asetaseuraavapallo();
this.removeMovieClip();
return(undefined);
}
this._y = this._y + (this.yv * 0.5);
this._x = this._x + (this.xv * 0.5);
if (testhit(this._x, this._y)) {
var _local8 = Math.round(gety(this._x - _root.grid._x, this._y - _root.grid._y) / tileH) - 1;
var _local9 = _local8 + 2;
var _local6 = Math.round(getx(this._x - _root.grid._x, this._y - _root.grid._y) / tileW) - 1;
var _local7 = _local6 + 2;
parasnimi = "";
parasdist = 9999999 /* 0x98967F */;
var _local5 = _local8;
while (_local5 <= _local9) {
var _local4 = _local6;
while (_local4 <= _local7) {
if (!_root.grid[(("t_" + _local5) + "_") + _local4]) {
ddd222 = dist2(_root.grid._x + setx(_local4 * tileW, _local5 * tileH), _root.grid._y + sety(_local4 * tileW, _local5 * tileH), this._x, this._y);
if (parasdist > ddd222) {
parasdist = ddd222;
parasii = _local5;
parasjj = _local4;
}
}
_local4++;
}
_local5++;
}
oldpiste = Points;
kiinnita(this.munsisalto, parasii, parasjj, (("t_" + parasii) + "_") + parasjj, this.xv, this.yv, true);
if (oldpiste == Points) {
tuhlailu--;
}
asetainfo(tuhlailu);
palloilmassa--;
asetaseuraavapallo();
this.removeMovieClip();
return(undefined);
}
}
if ((this._x - _root.GridCenterX) < (_root.leftBound + (tileW / 2))) {
this._x = (_root.leftBound + (tileW / 2)) + _root.GridCenterX;
this.xv = Math.abs(this.xv);
this.bounceCntr++;
} else if ((this._x - _root.GridCenterX) > (_root.rightBound - (tileW / 2))) {
this._x = (_root.rightBound - (tileW / 2)) + _root.GridCenterX;
this.xv = -Math.abs(this.xv);
this.bounceCntr++;
} else if (((this._y - _root.GridCenterY) < (_root.upperBound + (tileH / 2))) && (this.eletty > 20)) {
this._y = (_root.upperBound + (tileH / 2)) + _root.GridCenterY;
this.yv = Math.abs(this.yv);
this.bounceCntr++;
} else if ((this._y - _root.GridCenterY) > (_root.lowerBound - (tileH / 2))) {
this._y = (_root.lowerBound - (tileH / 2)) + _root.GridCenterY;
this.yv = -Math.abs(this.yv);
this.bounceCntr++;
}
};
}
function ThrowPoints(numbertothrow, xthrow, ythrow, alkupmovie) {
if (numbertothrow < 0) {
scoreEffects.attachMovie("ScoreEffectMinus", "ScoreEffect" + PointsThrown, 700000 + PointsThrown);
} else {
scoreEffects.attachMovie("ScoreEffectPlus", "ScoreEffect" + PointsThrown, 700000 + PointsThrown);
}
scoreEffects["ScoreEffect" + PointsThrown]._x = xthrow;
scoreEffects["ScoreEffect" + PointsThrown]._y = ythrow;
scoreEffects["ScoreEffect" + PointsThrown]._xscale = 150;
scoreEffects["ScoreEffect" + PointsThrown]._yscale = 150;
if (numbertothrow > 0) {
scoreEffects["ScoreEffect" + PointsThrown].Scoreaddition = "+" + numbertothrow;
} else {
scoreEffects["ScoreEffect" + PointsThrown].Scoreaddition = numbertothrow;
}
scoreEffects["ScoreEffect" + PointsThrown].onEnterFrame = function () {
this._xscale = this._xscale + 1;
this._yscale = this._yscale + 1;
this._alpha = this._alpha - 1.5;
if (this._alpha < 1.5) {
this.removeMovieClip();
}
};
PointsThrown++;
scoreEffects.attachMovie("file" + alkupmovie.munsisalto, "ScoreEffect" + PointsThrown, 700000 + PointsThrown);
scoreEffects["ScoreEffect" + PointsThrown]._x = xthrow;
scoreEffects["ScoreEffect" + PointsThrown]._y = ythrow;
scoreEffects["ScoreEffect" + PointsThrown]._rotation = alkupmovie._rotation + grid._rotation;
scoreEffects["ScoreEffect" + PointsThrown].xv = (Math.random() * 10) - 5;
scoreEffects["ScoreEffect" + PointsThrown].yv = (Math.random() * 10) - 5;
scoreEffects["ScoreEffect" + PointsThrown].onEnterFrame = function () {
this._xscale = this._xscale - 2;
this._yscale = this._yscale - 2;
this._alpha = this._alpha - 1.5;
this._x = this._x + this.xv;
this._y = this._y + this.yv;
this._rotation = this._rotation + (this.xv * 10);
this.yv = this.yv + 3;
if (this._alpha < 1.5) {
this.removeMovieClip();
}
};
PointsThrown++;
}
function ThrowPoints2(xthrow, ythrow, alkupmovie) {
scoreEffects.attachMovie("file" + alkupmovie.munsisalto, "ScoreEffect" + PointsThrown, 700000 + PointsThrown);
scoreEffects["ScoreEffect" + PointsThrown]._x = xthrow;
scoreEffects["ScoreEffect" + PointsThrown]._y = ythrow;
scoreEffects["ScoreEffect" + PointsThrown]._rotation = alkupmovie._rotation + _root.grid._rotation;
scoreEffects["ScoreEffect" + PointsThrown].xv = (Math.random() * 10) - 5;
scoreEffects["ScoreEffect" + PointsThrown].yv = (Math.random() * 10) - 5;
scoreEffects["ScoreEffect" + PointsThrown].onEnterFrame = function () {
this._xscale = this._xscale - 2;
this._yscale = this._yscale - 2;
this._alpha = this._alpha - 1.5;
this._x = this._x + this.xv;
this._y = this._y + this.yv;
this._rotation = this._rotation + (this.xv * 10);
this.yv = this.yv + 3;
if (this._alpha < 1.5) {
this.removeMovieClip();
}
};
PointsThrown++;
}
function ThrowParticles(xthrow, ythrow) {
scoreEffects.attachMovie("file3", "ScoreEffect" + PointsThrown, 700000 + PointsThrown);
scoreEffects["ScoreEffect" + PointsThrown]._x = xthrow;
scoreEffects["ScoreEffect" + PointsThrown]._y = ythrow;
scoreEffects["ScoreEffect" + PointsThrown]._xscale = 50;
scoreEffects["ScoreEffect" + PointsThrown]._yscale = 50;
scoreEffects["ScoreEffect" + PointsThrown].xv = (Math.random() * 10) - 5;
scoreEffects["ScoreEffect" + PointsThrown].yv = (Math.random() * 10) - 5;
if (xthrow < -250) {
scoreEffects["ScoreEffect" + PointsThrown].xv = scoreEffects["ScoreEffect" + PointsThrown].xv + 4;
}
if (xthrow > 250) {
scoreEffects["ScoreEffect" + PointsThrown].xv = scoreEffects["ScoreEffect" + PointsThrown].xv - 4;
}
if (ythrow > 250) {
scoreEffects["ScoreEffect" + PointsThrown].yv = scoreEffects["ScoreEffect" + PointsThrown].yv - 4;
}
scoreEffects["ScoreEffect" + PointsThrown].onEnterFrame = function () {
this._xscale = this._xscale - 2;
this._yscale = this._yscale - 2;
this._alpha = this._alpha - 1.5;
this._x = this._x + this.xv;
this._y = this._y + this.yv;
this._rotation = this._rotation + (this.xv * 10);
this.yv = this.yv + 1;
if (this._alpha < 1.5) {
this.removeMovieClip();
}
};
PointsThrown++;
}
function ThrowError(xthrow, ythrow) {
scoreEffects.attachMovie("ScoreEffectMinus", "ScoreEffect" + PointsThrown, 700000 + PointsThrown);
scoreEffects["ScoreEffect" + PointsThrown]._x = xthrow;
scoreEffects["ScoreEffect" + PointsThrown]._y = ythrow;
scoreEffects["ScoreEffect" + PointsThrown]._xscale = 110;
scoreEffects["ScoreEffect" + PointsThrown]._yscale = 110;
scoreEffects["ScoreEffect" + PointsThrown].Scoreaddition = "";
scoreEffects["ScoreEffect" + PointsThrown].onEnterFrame = function () {
this._xscale = this._xscale + 1;
this._yscale = this._yscale + 1;
this._alpha = this._alpha - 0.7;
if (this._alpha < 1.5) {
this.removeMovieClip();
}
};
PointsThrown++;
aj = 0;
while (aj < 30) {
ThrowParticles(xthrow, ythrow);
aj++;
}
}
function updateGrid() {
while ((!grid[(("t_" + (rowsCurrentlyInGrid - 1)) + "_") + 0]) || ((grid._y + grid[(("t_" + (rowsCurrentlyInGrid - 1)) + "_") + 0]._y) > -20)) {
}
}
function initGrid() {
level_txt.text = levelCntr;
rand = 1;
if (rand == 1) {
i = 0;
while (i <= Erivareja) {
_root["tatavaria" + i] = 1;
i++;
}
j = 0;
while (j < ((Alkuklimpinkoko * 2) - 1)) {
asetaitte(0, ((-Alkuklimpinkoko) + 1) + j, randomColor());
asetaitte(1, (-Alkuklimpinkoko) + j, randomColor());
asetaitte(-1, ((-Alkuklimpinkoko) + 2) + j, randomColor());
asetaitte(((-Alkuklimpinkoko) + 1) + j, 0, randomColor());
asetaitte(((-Alkuklimpinkoko) + 2) + j, -1, randomColor());
asetaitte((-Alkuklimpinkoko) + j, 1, randomColor());
j++;
}
}
grid.t_0_0.removeMovieClip();
grid.attachMovie("tilepommi", "t_0_0", grid.getNextHighestDepth());
grid.t_0_0.munsisalto = -1;
grid.t_0_0._xscale = (grid.t_0_0._yscale = GRID_SIZE * 100);
}
stopAllSounds();
var playbgsnd = new Sound();
playbgsnd.attachSound("musicplaybg");
playbgsnd.start(0, 999);
isInited = false;
Pallojapersatsi = 10;
GRID_SIZE = 0.75006;
BALL_SPEED = 20;
Alkuklimpinkoko = 6;
if (tempLevel == 2) {
Erivareja = 2;
} else if ((tempLevel == 3) || (tempLevel == 5)) {
Erivareja = 3;
} else if (tempLevel == 4) {
Erivareja = 4;
} else if (tempLevel == 6) {
Erivareja = 5;
} else if ((tempLevel == 7) || (tempLevel == 9)) {
Erivareja = 6;
} else if (tempLevel == 8) {
Erivareja = 7;
} else if (tempLevel == 10) {
Erivareja = 8;
} else {
Erivareja = 0;
}
ArrowCenterX = 450;
GridCenterX = 253;
GridCenterY = 240;
multiplier = "";
scoring = 10;
isGridClear = false;
lowerBound = 255;
upperBound = -215;
leftBound = -215;
rightBound = 215;
this.createEmptyMovieClip("line_mc", 10);
gridspeed = 0;
gridsBallCntr = 0;
palloilmassa = 0;
canon._x = GridCenterX;
canon._y = 490;
seuraavapallo = 1;
seuraavaseuraavapallo = 2;
vasein = 99999 /* 0x01869F */;
oikein = -99999;
ylin = -99999;
alin = 99999 /* 0x01869F */;
BFStunnus = 0;
ampuaika = getTimer() + 1000;
ammuttu = 0;
axis1x = 1;
axis1y = 0;
axis2x = 0.5;
axis2y = 0.8660254;
levelCntr = tempLevel;
isReset = false;
lastScore = 0;
tileW = 26 * GRID_SIZE;
tileH = 26 * GRID_SIZE;
isMouseDown = false;
_root.onMouseDown = function () {
isMouseDown = true;
};
_root.onMouseUp = function () {
isMouseDown = false;
};
edellinenaika = getTimer();
aikakerroin = 1;
var spacepohjassaviimeframessa = false;
edaika = 0;
_root.onEnterFrame = function () {
uusiaika = getTimer();
aikakerroin = (uusiaika - edellinenaika) / 33;
edellinenaika = uusiaika;
framejalaskettu++;
if (framejalaskettu >= 30) {
framerate = (1000 * (framejalaskettu * 1)) / ((1 * (getTimer() - framenalkuaika)) + 0.001);
framenalkuaika = getTimer();
framejalaskettu = 0;
}
if (!_global.gameon) {
gridinaloitus = getTimer();
} else {
if ((gridsBallCntr <= 1) && (isGridClear == false)) {
if (tempLevel == 10) {
_global.gameon = false;
ammuttavaammuttavapallo._visible = false;
ammuttavapallo._visible = false;
gotoAndStop ("complete");
} else {
_global.gameon = false;
ammuttavaammuttavapallo._visible = false;
ammuttavapallo._visible = false;
nextlevelmc._visible = true;
nextlevelmc.gotoAndPlay(2);
nextlevelmc.nextlevel_btn.onRollOver = function () {
_root.btn_snd.start(0, 1);
};
nextlevelmc.nextlevel_btn.onPress = function () {
_root.jolly_logo.gotoAndPlay(2);
nextlevelmc._visible = false;
ammuttavaammuttavapallo._visible = true;
ammuttavapallo._visible = true;
_global.gameon = true;
levelCntr++;
tempLevel = levelCntr;
playerDetails.data.lev = tempLevel;
isGridClear = true;
grid.targetscale = 0;
if (levelCntr == 1) {
Erivareja = 1;
tuhlailulim = 6;
tuhlailu = 6;
asetainfo(tuhlailu);
i = 0;
while (i <= Erivareja) {
this["tatavaria" + i] = 1;
i++;
}
} else if (levelCntr == 2) {
Erivareja = 2;
tuhlailulim = 6;
tuhlailu = 6;
asetainfo(tuhlailu);
i = 0;
while (i <= Erivareja) {
this["tatavaria" + i] = 1;
i++;
}
} else if (levelCntr == 3) {
Erivareja = 3;
tuhlailulim = 6;
tuhlailu = 6;
asetainfo(tuhlailu);
i = 0;
while (i <= Erivareja) {
this["tatavaria" + i] = 1;
i++;
}
} else if (levelCntr == 4) {
Erivareja = 4;
tuhlailulim = 6;
tuhlailu = 6;
asetainfo(tuhlailu);
i = 0;
while (i <= Erivareja) {
this["tatavaria" + i] = 1;
i++;
}
} else if (levelCntr == 5) {
Erivareja = 3;
tuhlailulim = 6;
tuhlailu = 6;
asetainfo(tuhlailu);
i = 0;
while (i <= Erivareja) {
this["tatavaria" + i] = 1;
i++;
}
} else if (levelCntr == 6) {
Erivareja = 5;
tuhlailulim = 6;
tuhlailu = 6;
asetainfo(tuhlailu);
i = 0;
while (i <= Erivareja) {
this["tatavaria" + i] = 1;
i++;
}
} else if (levelCntr == 7) {
Erivareja = 6;
tuhlailulim = 6;
tuhlailu = 6;
asetainfo(tuhlailu);
i = 0;
while (i <= Erivareja) {
this["tatavaria" + i] = 1;
i++;
}
} else if (levelCntr == 8) {
Erivareja = 7;
tuhlailulim = 6;
tuhlailu = 6;
asetainfo(tuhlailu);
i = 0;
while (i <= Erivareja) {
this["tatavaria" + i] = 1;
i++;
}
}
if (levelCntr == 9) {
Erivareja = 6;
tuhlailulim = 6;
tuhlailu = 6;
asetainfo(tuhlailu);
i = 0;
while (i <= Erivareja) {
this["tatavaria" + i] = 1;
i++;
}
} else if (levelCntr == 10) {
Erivareja = 8;
tuhlailulim = 6;
tuhlailu = 6;
asetainfo(tuhlailu);
i = 0;
while (i <= Erivareja) {
this["tatavaria" + i] = 1;
i++;
}
}
};
}
}
if ((isGridClear == true) && (grid._xscale < 2)) {
isGridClear = false;
initGrid();
grid._xscale = (grid._yscale = 0);
grid.targetscale = 100;
scoring = scoring + 10;
multiplier = scoring + "x";
}
grid._xscale = (grid._yscale = (0.95 * grid._xscale) + (0.05 * grid.targetscale));
i = 1;
while (i <= 10) {
if (this["tuhlaus" + i]) {
this["tuhlaus" + i].mc._alpha = (this["tuhlaus" + i].mc._alpha * 0.95) + (this["tuhlaus" + i].mc.targetalpha * 0.05);
}
i++;
}
gridspeed = gridspeed * 0.95455;
if (_root._ymouse < 450) {
canon._rotation = (Math.atan2(_root._ymouse - canon._y, _root._xmouse - canon._x) / 3.14159) * 180;
}
line_mc._visible = true;
hidastuskerroin = 1;
if (getTimer() < (kellonalkuaika + kellonkesto)) {
hidastuskerroin = 0.3;
}
if (((((!isGridClear) && (isMouseDown)) && (_root._ymouse < 480)) && (Math.abs(gridspeed) < 2)) && (palloilmassa == 0)) {
hiirenseuraaja._x = _root._xmouse;
hiirenseuraaja._y = _root._ymouse;
if (!hiirenseuraaja.hitTest(Neppula)) {
shoot();
bubblePop = new Sound(_root);
bubblePop.attachSound("FOLEY WHIP WHOOSH DOUBLE ALUMINUM ROD 01");
bubblePop.start(0, 1);
isMouseDown = false;
}
}
if (tuhlailu == 0) {
whoosi = new Sound(_root);
whoosi.attachSound("ropes_whoosh");
whoosi.start(0, 1);
i = 0;
while (i < Pallojapersatsi) {
shootrandom();
i++;
}
tuhlailulim--;
if (tuhlailulim == 0) {
tuhlailulim = 6;
}
tuhlailu = tuhlailulim;
asetainfo(tuhlailu);
}
grid._x = GridCenterX;
grid._y = GridCenterY;
grid._rotation = grid._rotation + gridspeed;
ang = (grid._rotation * 3.141593) / 180;
axis1x = Math.cos(ang);
axis1y = Math.sin(ang);
axis2x = Math.cos(ang + 1.047197);
axis2y = Math.sin(ang + 1.047197);
line_mc._x = grid._x;
line_mc._y = grid._y;
vasein = 99999 /* 0x01869F */;
oikein = -99999;
ylin = -99999;
alin = 99999 /* 0x01869F */;
}
Score = "" + Math.round(tempPoints);
tempPoints = (0.93 * tempPoints) + (0.07 * Points);
if ((Points > 0) && (oldpo != Points)) {
bubblePop = new Sound(this);
bubblePop.attachSound("bubble");
bubblePop.start(0, 1);
}
oldpo = Points;
if ((GameOver == true) && (_global.gameon == true)) {
if (kelloefekti) {
kelloefekti.removeMovieClip();
}
whoosh = new Sound(_root);
whoosh.attachSound("Descending Gamey Blip");
whoosh.start(0, 1);
_global.gameon = false;
_root.lopputiski._visible = true;
ammuttavaammuttavapallo._visible = false;
ammuttavapallo._visible = false;
_global.gameon = false;
_root.lopputiski.julkaisuaika = getTimer();
_root.lopputiski.gotoAndPlay(1);
}
};
init();
stop();
Instance of Symbol 275 MovieClip "Neppula" in Frame 6
on (release) {
if (_root.asound) {
this.gotoAndStop(2);
_root.asound = false;
} else {
this.gotoAndStop(1);
_root.asound = true;
}
}
on (rollOver) {
_global.gameon = false;
}
on (rollOut) {
_global.gameon = true;
}
Frame 7
_global.gameon = false;
stop();
Frame 12
gotoAndStop ("Main");
Frame 13
stop();
grid.t_0_0._visible = false;
_root.isInited = false;
_global.gameon = false;
trace(_root.tempLevel + " 1223566");
_root.levels_sound.start();
if (_root.a_sound) {
a1_sound.gotoAndStop(1);
a2_sound.gotoAndStop(1);
}
var i = 1;
while (i <= 10) {
var mc = eval ("lev_selaction.ab_" + i);
var mca = eval ("lev_selaction.abc_" + i);
trace(mc + " mc");
mc.num = i;
mc.gotoAndStop(1);
mc.enabled = false;
mca._visible = true;
mc.useHandCursor = false;
mc.onPress = function () {
_root.tempLevel = this.num;
fNewGame = true;
_root.gotoAndStop("Main");
};
i++;
}
j = 1;
while (j <= _root.tempLevel) {
var mc1 = eval ("lev_selaction.ab_" + j);
var mca1 = eval ("lev_selaction.abc_" + j);
mca1._visible = false;
mc1._alpha = 70;
mc1.enabled = true;
mc1.useHandCursor = true;
j++;
}
Instance of Symbol 275 MovieClip "Neppula" in Frame 13
on (release) {
if (_root.asound) {
this.gotoAndStop(2);
_root.asound = false;
} else {
this.gotoAndStop(1);
_root.asound = true;
}
}
on (rollOver) {
_global.gameon = false;
}
on (rollOut) {
_global.gameon = true;
}
Frame 17
function submit1() {
var _local5 = subname.text;
var _local4 = completeScore;
var _local2 = "";
if (_local4 == "") {
_local2 = _local2 + "The score is required\n";
}
if (_local2 != "") {
status_txt.text = _local2;
trace("hello1231233");
return(undefined);
}
var _local3 = new LoadVars();
_local3.name = _local5;
_local3.score = _local4;
_local3.send(path, "_blank", "POST");
_root.gotoAndStop("Start");
}
stop();
grid.removeMovieClip();
_root.grid.t_0_0._visible = false;
_root.isInited = false;
_global.gameon = false;
trace(gameon);
completeScore = _root.Score;
stopAllSounds();
_root.gameover_sound.start(0, 1);
var path = "http://www.gamesjolly.com/scores/xballs/submit.php";
Symbol 17 Button
on (release) {
_root.gotoAndStop("Preloader");
}
Symbol 22 MovieClip Frame 1
stop();
Symbol 22 MovieClip Frame 100
stop();
Symbol 37 MovieClip Frame 158
stop();
Symbol 39 Button
on (release) {
_root.moreGames();
}
Symbol 43 Button
on (release) {
_root.showShot(1);
_root.tempLevel = 1;
}
Symbol 46 Button
on (release) {
_root.moreGames();
}
Symbol 49 Button
on (release) {
_root.gotoAndStop("help_help");
}
Symbol 55 Button
on (press) {
_root.gotoAndStop("levels");
}
Symbol 72 Button
on (release) {
_root.showShot(1);
_root.gotoAndStop("levels");
}
on (rollOver) {
_root.btn_snd.start(0, 1);
}
Symbol 73 Button
on (release) {
_root.moreGames();
}
on (rollOver) {
_root.btn_snd.start(0, 1);
}
Symbol 74 Button
on (release) {
_root.gotoAndStop("help_help");
}
on (rollOver) {
_root.btn_snd.start(0, 1);
}
Symbol 75 Button
on (release) {
getURL ("http://www.gamesjolly.com/scores/xballs/index.php", "_blank");
}
on (rollOver) {
_root.btn_snd.start(0, 1);
}
Symbol 76 Button
on (press) {
_root.gotoAndStop("levels");
}
on (rollOver) {
_root.btn_snd.start(0, 1);
}
Symbol 77 MovieClip Frame 192
stop();
Symbol 125 MovieClip Frame 1
stop();
Symbol 126 MovieClip [tile] Frame 8
stop();
Symbol 126 MovieClip [tile] Frame 16
stop();
Symbol 130 Button
on (press, releaseOutside) {
if ((_root.lopputiski.julkaisuaika + 100) < getTimer()) {
_root.isInited = false;
_root.gotoAndStop("levels");
kirupaSound = new Sound();
kirupaSound.attachSound("Clicki");
kirupaSound.start(0, 1);
this._visible = false;
_root.init();
}
}
Symbol 143 Button
on (release) {
submit();
}
on (rollOver) {
_root.btn_snd.start(0, 1);
}
Symbol 147 Button
on (press, releaseOutside) {
if ((_root.lopputiski.julkaisuaika + 100) < getTimer()) {
_root.isInited = false;
_root.gotoAndStop("levels");
kirupaSound = new Sound();
kirupaSound.attachSound("Clicki");
kirupaSound.start(0, 1);
this._visible = false;
_root.init();
}
}
on (rollOver) {
_root.btn_snd.start(0, 1);
}
Symbol 148 MovieClip [Lopputiski] Frame 1
stop();
Instance of Symbol 128 MovieClip in Symbol 148 MovieClip [Lopputiski] Frame 1
on (rollOver) {
useHandCursor = false;
}
Symbol 148 MovieClip [Lopputiski] Frame 75
function submit() {
var _local6 = name_txt.text;
var _local5 = overScore;
var _local3 = "";
if (_local5 == "") {
_local3 = _local3 + "The score is required\n";
}
if (_local3 != "") {
status_txt.text = _local3;
trace("hello1231233");
return(undefined);
}
var _local4 = new LoadVars();
_local4.name = _local6;
_local4.score = _local5;
_local4.send(path, "_blank", "POST");
this._visible = false;
_root.gotoAndStop("Preloader");
}
stop();
overScore = _root.Score;
stopAllSounds();
_root.gameover_sound.start(0, 2);
var path = "http://www.gamesjolly.com/scores/xballs/submit.php";
Symbol 152 MovieClip [tileydinpommi] Frame 1
stop();
Symbol 156 MovieClip [file7] Frame 1
stop();
Symbol 160 MovieClip [file1] Frame 1
stop();
Symbol 164 MovieClip [file2] Frame 1
stop();
Symbol 168 MovieClip [file3] Frame 1
stop();
Symbol 172 MovieClip [file4] Frame 1
stop();
Symbol 199 MovieClip [tilekello] Frame 1
stop();
Symbol 200 MovieClip [kelloefekti] Frame 1
function onEnterFrame() {
if (getTimer() < (_root.kellonalkuaika + _root.kellonkesto)) {
this.kellopalkki._yscale = (((_root.kellonkesto - getTimer()) + _root.kellonalkuaika) / _root.kellonkesto) * 100;
} else {
this.removeMovieClip();
}
}
Symbol 202 MovieClip [Tausta] Frame 1
function onEnterFrame() {
aikakerroin = (getTimer() - edellinenaika) / 33;
edellinenaika = getTimer();
if (this._visible) {
this._alpha = this._alpha - (1 * aikakerroin);
}
if (this._alpha < 0) {
this._visible = false;
}
}
edellinenaika = 0;
stop();
Symbol 221 Button
on (release) {
_root.moreGames();
}
on (rollOver) {
_root.btn_snd.start(0, 1);
}
Instance of Symbol 209 MovieClip in Symbol 222 MovieClip [nextlevelmc] Frame 109
on (rollOver) {
useHandCursor = false;
}
Symbol 222 MovieClip [nextlevelmc] Frame 189
stop();
levelscore = _root.mylevelScore;
Symbol 225 MovieClip [tilepommi] Frame 1
stop();
Symbol 230 MovieClip [file8] Frame 1
stop();
Symbol 235 MovieClip Frame 1
stop();
Symbol 235 MovieClip Frame 8
stop();
Symbol 242 MovieClip Frame 9
stop();
Symbol 244 Button
on (release) {
showShot(3);
}
Symbol 245 Button
on (release) {
_root.tempLevel = 1;
showShot(2);
}
Symbol 258 MovieClip Frame 158
stop();
Symbol 263 Button
on (release) {
_root.moreGames();
}
on (rollOver) {
_root.btn_snd.start(0, 1);
}
Symbol 268 Button
on (release) {
_root.moreGames();
}
on (rollOver) {
_root.btn_snd.start(0, 1);
_global.gameon = false;
}
on (rollOut) {
_global.gameon = true;
}
Symbol 275 MovieClip Frame 1
stop();
_global.allsound.setVolume(100);
Symbol 275 MovieClip Frame 2
stop();
_global.allsound.setVolume(0);
Symbol 305 MovieClip Frame 38
stop();
Symbol 322 Button
on (release) {
_root.tempLevel = 1;
_root.gotoAndStop("Main");
}
on (rollOver) {
_root.btn_snd.start(0, 1);
}
Symbol 323 MovieClip Frame 59
stop();
Symbol 329 Button
on (release) {
_root.submit1();
}
on (rollOver) {
_root.btn_snd.start(0, 1);
}
Symbol 330 Button
on (release) {
_root.gotoAndStop("levels");
}
on (rollOver) {
_root.btn_snd.start(0, 1);
}
Symbol 331 MovieClip Frame 1
completeScore._visible = false;
subname._visible = false;
Symbol 331 MovieClip Frame 66
stop();
completeScore._visible = true;
subname._visible = true;