Frame 2
function rightclick() {
getURL ("http://www.girly.com/");
}
function cargando() {
var _local2;
var _local3;
var _local4;
_local2 = _root.getBytesTotal();
_local3 = _root.getBytesLoaded();
_local4 = Math.floor((_local3 * 100) / _local2);
barra_mc.gotoAndStop(_local4);
if (_local3 == _local2) {
clearInterval(hiloPrecarga);
barra_mc._visible = false;
play();
}
}
var fmm01_menu = new ContextMenu();
fmm01_menu.hideBuiltInItems();
_root.menu = fmm01_menu;
var item = new ContextMenuItem("Created by www.girly.com", rightclick);
fmm01_menu.customItems[0] = item;
fscommand ("showmenu", false);
var hiloPrecarga = setInterval(cargando, 1);
Sonido = new Sound(this);
Sonido.attachSound("Music");
Sonido.start(0, 99);
stop();
Frame 283
stop();
Frame 284
function __com_mochibot__(swfid, mc, lv, trk) {
var x;
var g;
var s;
var fv;
var sb;
var u;
var res;
var mb;
var mbc;
var pv;
mb = "__mochibot__";
mbc = "mochibot.com";
g = (_global ? (_global) : (_level0._root));
if (g[mb + swfid]) {
return(g[mb + swfid]);
}
s = System.security;
x = mc._root.getSWFVersion;
fv = (x ? (mc.getSWFVersion()) : ((_global ? 6 : 5)));
if (!s) {
s = {};
}
sb = s.sandboxType;
if (sb == "localWithFile") {
return(null);
}
x = s.allowDomain;
if (x) {
s.allowDomain(mbc);
}
x = s.allowInsecureDomain;
if (x) {
s.allowInsecureDomain(mbc);
}
pv = ((fv == 5) ? (getVersion()) : (System.capabilities.version));
u = (((((((((((("http://" + mbc) + "/my/core.swf?mv=8&fv=") + fv) + "&v=") + escape(pv)) + "&swfid=") + escape(swfid)) + "&l=") + lv) + "&f=") + mc) + (sb ? ("&sb=" + sb) : "")) + (trk ? "&t=1" : "");
lv = ((fv > 6) ? (mc.getNextHighestDepth()) : ((g[mb + "level"] ? (g[mb + "level"] + 1) : (lv))));
g[mb + "level"] = lv;
if (fv == 5) {
res = "_level" + lv;
if (!eval (res)) {
loadMovieNum (u, lv);
}
} else {
res = mc.createEmptyMovieClip(mb + swfid, lv);
res.loadMovie(u);
}
return(res);
}
__com_mochibot__("87152091", this, 10301, true);
stop();
onclick = function () {
if (mussnd._currentframe == 1) {
if (_global.Behaviors == null) {
_global.Behaviors = {};
}
if (_global.Behaviors.Sound == null) {
_global.Behaviors.Sound = {};
}
if (typeof(this.createEmptyMovieClip) == "undefined") {
this._parent.createEmptyMovieClip("BS_clickins", new Date().getTime() - (Math.floor(new Date().getTime() / 10000) * 10000));
_global.Behaviors.Sound.clickins = new Sound(this._parent.BS_clickins);
} else {
this.createEmptyMovieClip("_clickins_", new Date().getTime() - (Math.floor(new Date().getTime() / 10000) * 10000));
_global.Behaviors.Sound.clickins = new Sound(this.BS_clickins);
}
_global.Behaviors.Sound.clickins.attachSound("clicksnd");
_global.Behaviors.Sound.clickins.start(0, 1);
} else {
_global.Behaviors.Sound.clickins.stop("clicksnd");
}
};
onroll = function () {
if (mussnd._currentframe == 1) {
if (_global.Behaviors == null) {
_global.Behaviors = {};
}
if (_global.Behaviors.Sound == null) {
_global.Behaviors.Sound = {};
}
if (typeof(this.createEmptyMovieClip) == "undefined") {
this._parent.createEmptyMovieClip("BS_rollins", new Date().getTime() - (Math.floor(new Date().getTime() / 10000) * 10000));
_global.Behaviors.Sound.rollins = new Sound(this._parent.BS_rollins);
} else {
this.createEmptyMovieClip("_rollins_", new Date().getTime() - (Math.floor(new Date().getTime() / 10000) * 10000));
_global.Behaviors.Sound.rollins = new Sound(this.BS_rollins);
}
_global.Behaviors.Sound.rollins.attachSound("rollover");
_global.Behaviors.Sound.rollins.start(0, 1);
} else {
_global.Behaviors.Sound.rollins.stop("rollover");
}
};
shootSound = function () {
if (mussnd._currentframe == 1) {
if (_global.Behaviors == null) {
_global.Behaviors = {};
}
if (_global.Behaviors.Sound == null) {
_global.Behaviors.Sound = {};
}
if (typeof(this.createEmptyMovieClip) == "undefined") {
this._parent.createEmptyMovieClip("BS_dreamins", new Date().getTime() - (Math.floor(new Date().getTime() / 10000) * 10000));
_global.Behaviors.Sound.dreamins = new Sound(this._parent.BS_dreamins);
} else {
this.createEmptyMovieClip("_dreamins_", new Date().getTime() - (Math.floor(new Date().getTime() / 10000) * 10000));
_global.Behaviors.Sound.dreamins = new Sound(this.BS_dreamins);
}
_global.Behaviors.Sound.dreamins.attachSound("dream");
_global.Behaviors.Sound.dreamins.start(0, 1);
} else {
_global.Behaviors.Sound.dreamins.stop("dream");
}
};
cong = function () {
if (mussnd._currentframe == 1) {
if (_global.Behaviors == null) {
_global.Behaviors = {};
}
if (_global.Behaviors.Sound == null) {
_global.Behaviors.Sound = {};
}
if (typeof(this.createEmptyMovieClip) == "undefined") {
this._parent.createEmptyMovieClip("BS_congins", new Date().getTime() - (Math.floor(new Date().getTime() / 10000) * 10000));
_global.Behaviors.Sound.congins = new Sound(this._parent.BS_congins);
} else {
this.createEmptyMovieClip("_congins_", new Date().getTime() - (Math.floor(new Date().getTime() / 10000) * 10000));
_global.Behaviors.Sound.congins = new Sound(this.BS_congins);
}
_global.Behaviors.Sound.congins.attachSound("cong");
_global.Behaviors.Sound.congins.start(0, 1);
} else {
_global.Behaviors.Sound.congins.stop("cong");
}
};
pointssound = function () {
if (mussnd._currentframe == 1) {
if (_global.Behaviors == null) {
_global.Behaviors = {};
}
if (_global.Behaviors.Sound == null) {
_global.Behaviors.Sound = {};
}
if (typeof(this.createEmptyMovieClip) == "undefined") {
this._parent.createEmptyMovieClip("BS_pointsndins", new Date().getTime() - (Math.floor(new Date().getTime() / 10000) * 10000));
_global.Behaviors.Sound.pointsndins = new Sound(this._parent.BS_pointsndins);
} else {
this.createEmptyMovieClip("_pointsndins_", new Date().getTime() - (Math.floor(new Date().getTime() / 10000) * 10000));
_global.Behaviors.Sound.pointsndins = new Sound(this.BS_pointsndins);
}
_global.Behaviors.Sound.pointsndins.attachSound("pointsnd");
_global.Behaviors.Sound.pointsndins.start(0, 1);
} else {
_global.Behaviors.Sound.pointsndins.stop("pointsnd");
}
};
gameoversound = function () {
if (mussnd._currentframe == 1) {
if (_global.Behaviors == null) {
_global.Behaviors = {};
}
if (_global.Behaviors.Sound == null) {
_global.Behaviors.Sound = {};
}
if (typeof(this.createEmptyMovieClip) == "undefined") {
this._parent.createEmptyMovieClip("BS_gameoverins", new Date().getTime() - (Math.floor(new Date().getTime() / 10000) * 10000));
_global.Behaviors.Sound.gameoverins = new Sound(this._parent.BS_gameoverins);
} else {
this.createEmptyMovieClip("_gameoverins_", new Date().getTime() - (Math.floor(new Date().getTime() / 10000) * 10000));
_global.Behaviors.Sound.gameoverins = new Sound(this.BS_gameoverins);
}
_global.Behaviors.Sound.gameoverins.attachSound("gameoversnd");
_global.Behaviors.Sound.gameoverins.start(0, 1);
} else {
_global.Behaviors.Sound.gameoverins.stop("gameoversnd");
}
};
reloadalertsound = function () {
if (mussnd._currentframe == 1) {
if (_global.Behaviors == null) {
_global.Behaviors = {};
}
if (_global.Behaviors.Sound == null) {
_global.Behaviors.Sound = {};
}
if (typeof(this.createEmptyMovieClip) == "undefined") {
this._parent.createEmptyMovieClip("BS_reloadalertins", new Date().getTime() - (Math.floor(new Date().getTime() / 10000) * 10000));
_global.Behaviors.Sound.reloadalertins = new Sound(this._parent.BS_reloadalertins);
} else {
this.createEmptyMovieClip("_reloadalertins_", new Date().getTime() - (Math.floor(new Date().getTime() / 10000) * 10000));
_global.Behaviors.Sound.reloadalertins = new Sound(this.BS_reloadalertins);
}
_global.Behaviors.Sound.reloadalertins.attachSound("reloadalertsnd");
_global.Behaviors.Sound.reloadalertins.start(0, 1);
} else {
_global.Behaviors.Sound.reloadalertins.stop("reloadalertsnd");
}
};
_global.Behaviors.Sound.gameoverins.stop("gameoversnd");
_global.Behaviors.Sound.reloadalertins.stop("reloadalertsnd");
_global.Behaviors.Sound.congins.stop("cong");
_global.Behaviors.Sound.dreamins.stop("dream");
Frame 285
this.onLoad = function () {
_global.gameon = true;
};
startbtn._visible = true;
start_bg._visible = true;
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].targetalpha = 0;
this["tuhlaus" + i].targetscale = 0;
}
i++;
}
i = 1;
while (i <= tuhlailu) {
if (!this["tuhlaus" + i]) {
attachMovie("tileydinpommi", "tuhlaus" + i, 789789 + i);
}
this["tuhlaus" + i].targetalpha = 100;
this["tuhlaus" + i].targetscale = 68;
this["tuhlaus" + i]._y = 908.374;
this["tuhlaus" + i]._x = ((10 + (30 * i)) * 0.9) * 0.926;
i++;
}
}
function init() {
i = 0;
while (i <= Erivareja) {
_root["tatavaria" + i] = 1;
i++;
}
kutistuu = false;
pistekerroin = 1;
multiplier = "";
gridspeed = 20;
tuhlailulim = 6;
tuhlailu = 6;
axis1x = 1;
axis1y = 0;
axis2x = 0.5;
axis2y = 0.8660254;
asetainfo(6);
palloilmassa = 0;
pallojainklimppi = 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";
_root.oikeapalkki.scorepalkki_red._visible = false;
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);
_root.lopputiski._visible = false;
_root.lopputiski._x = 250.02;
_root.lopputiski._y = 250.02;
_root.infotiski._visible = true;
_root.infotiski.gotoAndPlay(1);
infotiskijulkaistu = getTimer();
gamesinthislevel = 3;
tempPoints = 0;
Points = 0;
_global.lopputulema = Points;
Score = "" + Math.round(tempPoints);
valitunpallonkoko = 105;
valitsemattomankoko = 90;
level = 1;
levelper6 = level + "/6";
if (infotiski.getDepth() != 100000) {
infotiski.swapDepths(100000);
}
if (dwnappi2.getDepth() != 490000) {
dwnappi2.swapDepths(490000);
}
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();
}
function kiinnita(luku, ii, jj, nimi, xv, yv, poistetaanko) {
pallojainklimppi++;
grid.attachMovie("file" + luku, nimi, grid.getNextHighestDepth());
grid[nimi]._xscale = (grid[nimi]._yscale = 100 * kokokerroin);
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 + pallojainklimppi), 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 - (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 _local4 = new Array();
var _local5 = new Array();
var _local2 = 0;
var _local3 = 0;
_local4[_local3] = ii;
_local5[_local3] = jj;
BFStunnus++;
id = grid[(("t_" + ii) + "_") + jj].munsisalto;
while (_local3 <= _local2) {
iii = _local4[_local3] - 1;
jjj = _local5[_local3];
if (grid[(("t_" + iii) + "_") + jjj]) {
if ((grid[(("t_" + iii) + "_") + jjj].BFS != BFStunnus) && (grid[(("t_" + iii) + "_") + jjj].munsisalto == id)) {
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].munsisalto == id)) {
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].munsisalto == id)) {
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].munsisalto == id)) {
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].munsisalto == id)) {
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].munsisalto == id)) {
grid[(("t_" + iii) + "_") + jjj].BFS = BFStunnus;
_local2++;
_local4[_local2] = iii;
_local5[_local2] = jjj;
}
}
_local3++;
}
if (_local2 > 2) {
var _local8 = new Array();
var _local9 = new Array();
indexa3 = 0;
indexl3 = 0;
_local8[0] = 0;
_local9[0] = 0;
BFStunnus++;
while (indexa3 <= indexl3) {
iii = _local8[indexa3] - 1;
jjj = _local9[indexa3];
if (grid[(("t_" + iii) + "_") + jjj]) {
if (grid[(("t_" + iii) + "_") + jjj].BFS != BFStunnus) {
grid[(("t_" + iii) + "_") + jjj].BFS = BFStunnus;
indexl3++;
_local8[indexl3] = iii;
_local9[indexl3] = jjj;
}
}
iii = _local8[indexa3] + 1;
jjj = _local9[indexa3];
if (grid[(("t_" + iii) + "_") + jjj]) {
if (grid[(("t_" + iii) + "_") + jjj].BFS != BFStunnus) {
grid[(("t_" + iii) + "_") + jjj].BFS = BFStunnus;
indexl3++;
_local8[indexl3] = iii;
_local9[indexl3] = jjj;
}
}
iii = _local8[indexa3];
jjj = _local9[indexa3] - 1;
if (grid[(("t_" + iii) + "_") + jjj]) {
if (grid[(("t_" + iii) + "_") + jjj].BFS != BFStunnus) {
grid[(("t_" + iii) + "_") + jjj].BFS = BFStunnus;
indexl3++;
_local8[indexl3] = iii;
_local9[indexl3] = jjj;
}
}
iii = _local8[indexa3];
jjj = _local9[indexa3] + 1;
if (grid[(("t_" + iii) + "_") + jjj]) {
if (grid[(("t_" + iii) + "_") + jjj].BFS != BFStunnus) {
grid[(("t_" + iii) + "_") + jjj].BFS = BFStunnus;
indexl3++;
_local8[indexl3] = iii;
_local9[indexl3] = jjj;
}
}
iii = _local8[indexa3] + 1;
jjj = _local9[indexa3] - 1;
if (grid[(("t_" + iii) + "_") + jjj]) {
if (grid[(("t_" + iii) + "_") + jjj].BFS != BFStunnus) {
grid[(("t_" + iii) + "_") + jjj].BFS = BFStunnus;
indexl3++;
_local8[indexl3] = iii;
_local9[indexl3] = jjj;
}
}
iii = _local8[indexa3] - 1;
jjj = _local9[indexa3] + 1;
if (grid[(("t_" + iii) + "_") + jjj]) {
if (grid[(("t_" + iii) + "_") + jjj].BFS != BFStunnus) {
grid[(("t_" + iii) + "_") + jjj].BFS = BFStunnus;
indexl3++;
_local8[indexl3] = iii;
_local9[indexl3] = jjj;
}
}
indexa3++;
}
_local4 = new Array();
_local5 = new Array();
_local2 = 0;
_local3 = 0;
_local4[_local3] = ii;
_local5[_local3] = jj;
BFStunnus++;
while (_local3 <= _local2) {
iii = _local4[_local3] - 1;
jjj = _local5[_local3];
if (grid[(("t_" + iii) + "_") + jjj]) {
if ((grid[(("t_" + iii) + "_") + jjj].BFS != BFStunnus) && (grid[(("t_" + iii) + "_") + jjj].munsisalto == id)) {
ThrowPoints(pistekerroin, grid._x + setx(jjj * tileW, iii * tileH), grid._y + sety(jjj * tileW, iii * tileH), grid[(("t_" + iii) + "_") + jjj]);
grid[(("t_" + iii) + "_") + jjj].removeMovieClip();
_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].munsisalto == id)) {
ThrowPoints(pistekerroin, grid._x + setx(jjj * tileW, iii * tileH), grid._y + sety(jjj * tileW, iii * tileH), grid[(("t_" + iii) + "_") + jjj]);
grid[(("t_" + iii) + "_") + jjj].removeMovieClip();
_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].munsisalto == id)) {
ThrowPoints(pistekerroin, grid._x + setx(jjj * tileW, iii * tileH), grid._y + sety(jjj * tileW, iii * tileH), grid[(("t_" + iii) + "_") + jjj]);
grid[(("t_" + iii) + "_") + jjj].removeMovieClip();
_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].munsisalto == id)) {
ThrowPoints(pistekerroin, grid._x + setx(jjj * tileW, iii * tileH), grid._y + sety(jjj * tileW, iii * tileH), grid[(("t_" + iii) + "_") + jjj]);
grid[(("t_" + iii) + "_") + jjj].removeMovieClip();
_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].munsisalto == id)) {
ThrowPoints(pistekerroin, grid._x + setx(jjj * tileW, iii * tileH), grid._y + sety(jjj * tileW, iii * tileH), grid[(("t_" + iii) + "_") + jjj]);
grid[(("t_" + iii) + "_") + jjj].removeMovieClip();
_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].munsisalto == id)) {
ThrowPoints(pistekerroin, grid._x + setx(jjj * tileW, iii * tileH), grid._y + sety(jjj * tileW, iii * tileH), grid[(("t_" + iii) + "_") + jjj]);
grid[(("t_" + iii) + "_") + jjj].removeMovieClip();
_local2++;
_local4[_local2] = iii;
_local5[_local2] = jjj;
}
}
_local3++;
}
var _local6 = new Array();
var _local7 = new Array();
indexa2 = 0;
indexl2 = 0;
_local6[0] = 0;
_local7[0] = 0;
BFStunnus++;
while (indexa2 <= indexl2) {
iii = _local6[indexa2];
jjj = _local7[indexa2];
grid[(("t_" + iii) + "_") + jjj].BFS = BFStunnus;
iii = _local6[indexa2] - 1;
jjj = _local7[indexa2];
if (grid[(("t_" + iii) + "_") + jjj]) {
if (grid[(("t_" + iii) + "_") + jjj].BFS != BFStunnus) {
grid[(("t_" + iii) + "_") + jjj].BFS = BFStunnus;
indexl2++;
_local6[indexl2] = iii;
_local7[indexl2] = jjj;
}
}
iii = _local6[indexa2] + 1;
jjj = _local7[indexa2];
if (grid[(("t_" + iii) + "_") + jjj]) {
if (grid[(("t_" + iii) + "_") + jjj].BFS != BFStunnus) {
grid[(("t_" + iii) + "_") + jjj].BFS = BFStunnus;
indexl2++;
_local6[indexl2] = iii;
_local7[indexl2] = jjj;
}
}
iii = _local6[indexa2];
jjj = _local7[indexa2] + 1;
if (grid[(("t_" + iii) + "_") + jjj]) {
if (grid[(("t_" + iii) + "_") + jjj].BFS != BFStunnus) {
grid[(("t_" + iii) + "_") + jjj].BFS = BFStunnus;
indexl2++;
_local6[indexl2] = iii;
_local7[indexl2] = jjj;
}
}
iii = _local6[indexa2];
jjj = _local7[indexa2] - 1;
if (grid[(("t_" + iii) + "_") + jjj]) {
if (grid[(("t_" + iii) + "_") + jjj].BFS != BFStunnus) {
grid[(("t_" + iii) + "_") + jjj].BFS = BFStunnus;
indexl2++;
_local6[indexl2] = iii;
_local7[indexl2] = jjj;
}
}
iii = _local6[indexa2] - 1;
jjj = _local7[indexa2] + 1;
if (grid[(("t_" + iii) + "_") + jjj]) {
if (grid[(("t_" + iii) + "_") + jjj].BFS != BFStunnus) {
grid[(("t_" + iii) + "_") + jjj].BFS = BFStunnus;
indexl2++;
_local6[indexl2] = iii;
_local7[indexl2] = jjj;
}
}
iii = _local6[indexa2] + 1;
jjj = _local7[indexa2] - 1;
if (grid[(("t_" + iii) + "_") + jjj]) {
if (grid[(("t_" + iii) + "_") + jjj].BFS != BFStunnus) {
grid[(("t_" + iii) + "_") + jjj].BFS = BFStunnus;
indexl2++;
_local6[indexl2] = iii;
_local7[indexl2] = jjj;
}
}
indexa2++;
}
poistettuja = 0;
var _local10 = 0;
while (_local10 <= indexl3) {
iii = _local8[_local10];
jjj = _local9[_local10];
if (grid[(("t_" + iii) + "_") + jjj]) {
if (grid[(("t_" + iii) + "_") + jjj].BFS != BFStunnus) {
ThrowPoints(pistekerroin, grid._x + setx(jjj * tileW, iii * tileH), grid._y + sety(jjj * tileW, iii * tileH), grid[(("t_" + iii) + "_") + jjj]);
grid[(("t_" + iii) + "_") + jjj].removeMovieClip();
poistettuja++;
}
}
_local10++;
}
poistettuja = poistettuja + _local2;
pallojainklimppi = pallojainklimppi - poistettuja;
Points = Points + (poistettuja * pistekerroin);
Score = (_global.lopputulos = "" + Points);
_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 _local4 = 0;
var _local5 = GridWidth;
var _local6 = rowsCurrentlyInGrid;
var _local3 = 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) {
_local4 = _local4 + int(grid[(("t_" + _local3) + "_") + _local2].munsisalto);
}
}
_local2++;
}
_local3++;
}
currentselectedsum = _local4 + " / 10";
if (_local4 > 10) {
_root.oikeapalkki.scorepalkki_red._visible = true;
}
if (_local4 <= 10) {
_root.oikeapalkki.scorepalkki_red._visible = false;
}
if (_local4 == 10) {
removeSelectedFromGrid();
}
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(pistekerroin, grid[(("t_" + _local3) + "_") + _local2]._x + grid._x, grid[(("t_" + _local3) + "_") + _local2]._y + grid._y);
grid[(("t_" + _local3) + "_") + _local2].removeMovieClip();
_local4++;
Points = Points + pistekerroin;
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 satuluku() {
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 satuluku2() {
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 {
pallojainklimppi++;
}
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 = kokokerroin * 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 = satuluku();
grid.attachMovie("file" + luku, (("t_" + _local2) + "_") + _local1, grid.getNextHighestDepth());
pallojainklimppi++;
grid[(("t_" + _local2) + "_") + _local1].munsisalto = luku;
grid[(("t_" + _local2) + "_") + _local1]._xscale = (grid[(("t_" + _local2) + "_") + _local1]._yscale = kokokerroin * 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 * kokokerroin) * kokokerroin)) {
return(true);
}
}
_local2++;
}
_local3++;
}
return(false);
}
function shootrandom() {
palloilmassa++;
luku = satuluku();
nimi = "t_" + palloja_ammuttu;
palloja_ammuttu++;
shots.attachMovie("file" + luku, nimi, shots.getNextHighestDepth());
shots[nimi].pomppuja = 0;
shots[nimi]._xscale = (shots[nimi]._yscale = 100 * kokokerroin);
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 = 27.78;
ammuttavapallo._xscale = (ammuttavapallo._yscale = 46.3);
ammuttavapallo.targety = nuoli._y;
ammuttavapallo.targetscale = 100 * kokokerroin;
ammuttavapallo._x = nuoli._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 = satuluku();
attachMovie("file" + seuraavaseuraavapallo, "ammuttavaammuttavapallo", 29);
ammuttavaammuttavapallo._y = 25.002;
ammuttavaammuttavapallo.targety = 25.002;
ammuttavaammuttavapallo._x = GridCenterX;
ammuttavaammuttavapallo._xscale = (ammuttavaammuttavapallo._yscale = 0);
ammuttavaammuttavapallo.targetscale = 41.67;
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].pomppuja = 0;
shots[nimi]._xscale = (shots[nimi]._yscale = 100 * kokokerroin);
shots[nimi].koko = 100;
shots[nimi].munsisalto = luku;
shots[nimi]._visible = true;
shots[nimi]._x = nuoli._x;
shots[nimi]._y = nuoli._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 / Pallonspeedi;
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;
shots[nimi].onEnterFrame = function () {
if (!_global.gameon) {
this.removeMovieClip();
}
this.eletty++;
if ((!this.solid) && (_global.gameon)) {
if (this.pomppuja > 5) {
ThrowPoints2(this._x, this._y, this);
_root.tuhlailu--;
asetainfo(_root.tuhlailu);
ammuttavapallo.targetscale = 100;
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.pomppuja++;
}
if ((this._x - _root.GridCenterX) > (_root.rightBound - (tileW / 2))) {
this._x = (_root.rightBound - (tileW / 2)) + _root.GridCenterX;
this.xv = -Math.abs(this.xv);
this.pomppuja++;
}
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.pomppuja++;
}
if ((this._y - _root.GridCenterY) > (_root.lowerBound - (tileH / 2))) {
this._y = (_root.lowerBound - (tileH / 2)) + _root.GridCenterY;
this.yv = -Math.abs(this.yv);
this.pomppuja++;
}
};
}
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 + 1;
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 + 1;
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 = 150;
scoreEffects["ScoreEffect" + PointsThrown]._yscale = 150;
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)) {
addRowToGrid();
}
}
function initGrid() {
i = 0;
while (i <= Erivareja) {
_root["tatavaria" + i] = 1;
i++;
}
i = Alkuklimpinkoko - 1;
while (i > 0) {
j = 0;
while (j < (((2 * Alkuklimpinkoko) - 1) - i)) {
asetaitte(-i, (((-Alkuklimpinkoko) + 1) + i) + j, satuluku());
j++;
}
j = 0;
while (j < (((Alkuklimpinkoko * 2) - 1) - i)) {
asetaitte(i, ((Alkuklimpinkoko - 1) - i) - j, satuluku());
j++;
}
i--;
}
j = 0;
while (j < ((Alkuklimpinkoko * 2) - 1)) {
asetaitte(0, ((-Alkuklimpinkoko) + 1) + j, satuluku());
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 = kokokerroin * 100);
asetaitte(-1, 0, 1);
asetaitte(1, 0, 2);
asetaitte(0, 1, 3);
asetaitte(0, -1, 4);
asetaitte(1, -1, 5);
asetaitte(-1, 1, 6);
}
Pallojapersatsi = 10;
kokokerroin = 0.75006;
Pallonspeedi = 20.835;
Alkuklimpinkoko = 1;
Erivareja = 6;
GridCenterX = 250.02;
GridCenterY = 291.69;
multiplier = "";
pistekerroin = 1;
kutistuu = false;
if (ollaankodeadwhalessa) {
dwnappi2._visible = false;
}
lowerBound = 241.686;
upperBound = -241.686;
leftBound = -241.686;
rightBound = 241.686;
this.createEmptyMovieClip("line_mc", 10);
gridspeed = 0;
pallojainklimppi = 0;
palloilmassa = 0;
nuoli._x = GridCenterX;
seuraavapallo = 1;
seuraavaseuraavapallo = 2;
_root.oikeapalkki._y = -100;
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;
tileW = 34 * kokokerroin;
tileH = 34 * kokokerroin;
hiirialhaalla = false;
_root.onMouseDown = function () {
hiirialhaalla = true;
};
_root.onMouseUp = function () {
hiirialhaalla = false;
shootSound();
};
edellinenaika = getTimer();
aikakerroin = 1;
var spacepohjassaviimeframessa = false;
edaika = 0;
_root.onEnterFrame = function () {
_root.oikeapalkki.frosmonappi._xscale = (_root.oikeapalkki.frosmonappi._yscale = (0.8 * _root.oikeapalkki.frosmonappi._xscale) + (0.2 * _root.targetnappiscale2));
dwnappi2._xscale = (dwnappi2._yscale = (0.8 * dwnappi2._xscale) + (0.2 * _root.targetnappiscale));
_root.oikeapalkki._y = (0.9 * _root.oikeapalkki._y) + 24.33528;
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 ((pallojainklimppi == 1) && (kutistuu == false)) {
kutistuu = true;
grid.targetscale = 0;
}
if ((kutistuu == true) && (grid._xscale < 2)) {
kutistuu = false;
initGrid();
grid._xscale = (grid._yscale = 0);
grid.targetscale = 100;
pistekerroin = pistekerroin + 1;
multiplier = pistekerroin + "x";
gotoAndStop ("game1end");
}
grid._xscale = (grid._yscale = (0.95 * grid._xscale) + (0.05 * grid.targetscale));
i = 1;
while (i <= 10) {
if (this["tuhlaus" + i]) {
this["tuhlaus" + i]._rotation = Math.sin((getTimer() / 1800) + (i * 0.2)) * 200;
this["tuhlaus" + i]._alpha = (this["tuhlaus" + i]._alpha * 0.95) + (this["tuhlaus" + i].targetalpha * 0.05);
this["tuhlaus" + i]._xscale = (this["tuhlaus" + i]._yscale = (this["tuhlaus" + i]._xscale * 0.95) + (this["tuhlaus" + i].targetscale * 0.05));
}
i++;
}
gridspeed = gridspeed * 0.97;
if (_root._ymouse > ((GridCenterY + upperBound) + 5)) {
nuoli._rotation = (Math.atan2(_root._ymouse - nuoli._y, _root._xmouse - nuoli._x) / 3.14159) * 180;
}
line_mc._visible = true;
hidastuskerroin = 1;
if (getTimer() < (kellonalkuaika + kellonkesto)) {
hidastuskerroin = 0.3;
}
if (((((!kutistuu) && (hiirialhaalla)) && (_root._ymouse > ((GridCenterY + upperBound) + 5))) && (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);
hiirialhaalla = false;
}
}
if (tuhlailu == 0) {
reloadalertsound();
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)) {
pointssound();
}
oldpo = Points;
if ((GameOver == true) && (_global.gameon == true)) {
if (kelloefekti) {
kelloefekti.removeMovieClip();
}
_root.lopputiski.julkaisuaika = getTimer();
_root.gotoAndStop("gameover1");
}
};
init();
stop();
Frame 286
_global.gameon = false;
grid.removeMovieClip();
shots.removeMovieClip();
scoreEffects.removeMovieClip();
ammuttavapallo.removeMovieClip();
ammuttavaammuttavapallo.removeMovieClip();
tuhlaus.removeMovieClip();
gameoversound();
Frame 287
var level1score = Score;
level1scoretxt.text = level1score;
_global.gameon = false;
grid.removeMovieClip();
shots.removeMovieClip();
scoreEffects.removeMovieClip();
ammuttavapallo.removeMovieClip();
ammuttavaammuttavapallo.removeMovieClip();
tuhlaus.removeMovieClip();
cong();
Frame 288
_global.gameon = true;
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].targetalpha = 0;
this["tuhlaus" + i].targetscale = 0;
}
i++;
}
i = 1;
while (i <= tuhlailu) {
if (!this["tuhlaus" + i]) {
attachMovie("tileydinpommi", "tuhlaus" + i, 789789 + i);
}
this["tuhlaus" + i].targetalpha = 100;
this["tuhlaus" + i].targetscale = 68;
this["tuhlaus" + i]._y = 908.374;
this["tuhlaus" + i]._x = ((10 + (30 * i)) * 0.9) * 0.926;
i++;
}
}
function init() {
i = 0;
while (i <= Erivareja) {
_root["tatavaria" + i] = 1;
i++;
}
kutistuu = false;
pistekerroin = 1;
multiplier = "";
gridspeed = 20;
tuhlailulim = 6;
tuhlailu = 6;
axis1x = 1;
axis1y = 0;
axis2x = 0.5;
axis2y = 0.8660254;
asetainfo(6);
palloilmassa = 0;
pallojainklimppi = 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";
_root.oikeapalkki.scorepalkki_red._visible = false;
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);
_root.lopputiski._visible = false;
_root.lopputiski._x = 250.02;
_root.lopputiski._y = 250.02;
_root.infotiski._visible = true;
_root.infotiski.gotoAndPlay(1);
infotiskijulkaistu = getTimer();
gamesinthislevel = 3;
tempPoints = 0;
Points = 0;
_global.lopputulema = Points;
Score = "" + Math.round(tempPoints);
valitunpallonkoko = 105;
valitsemattomankoko = 90;
level = 1;
levelper6 = level + "/6";
if (infotiski.getDepth() != 100000) {
infotiski.swapDepths(100000);
}
if (dwnappi2.getDepth() != 490000) {
dwnappi2.swapDepths(490000);
}
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();
}
function kiinnita(luku, ii, jj, nimi, xv, yv, poistetaanko) {
pallojainklimppi++;
grid.attachMovie("file" + luku, nimi, grid.getNextHighestDepth());
grid[nimi]._xscale = (grid[nimi]._yscale = 100 * kokokerroin);
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 + pallojainklimppi), 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 - (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 _local4 = new Array();
var _local5 = new Array();
var _local2 = 0;
var _local3 = 0;
_local4[_local3] = ii;
_local5[_local3] = jj;
BFStunnus++;
id = grid[(("t_" + ii) + "_") + jj].munsisalto;
while (_local3 <= _local2) {
iii = _local4[_local3] - 1;
jjj = _local5[_local3];
if (grid[(("t_" + iii) + "_") + jjj]) {
if ((grid[(("t_" + iii) + "_") + jjj].BFS != BFStunnus) && (grid[(("t_" + iii) + "_") + jjj].munsisalto == id)) {
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].munsisalto == id)) {
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].munsisalto == id)) {
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].munsisalto == id)) {
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].munsisalto == id)) {
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].munsisalto == id)) {
grid[(("t_" + iii) + "_") + jjj].BFS = BFStunnus;
_local2++;
_local4[_local2] = iii;
_local5[_local2] = jjj;
}
}
_local3++;
}
if (_local2 > 2) {
var _local8 = new Array();
var _local9 = new Array();
indexa3 = 0;
indexl3 = 0;
_local8[0] = 0;
_local9[0] = 0;
BFStunnus++;
while (indexa3 <= indexl3) {
iii = _local8[indexa3] - 1;
jjj = _local9[indexa3];
if (grid[(("t_" + iii) + "_") + jjj]) {
if (grid[(("t_" + iii) + "_") + jjj].BFS != BFStunnus) {
grid[(("t_" + iii) + "_") + jjj].BFS = BFStunnus;
indexl3++;
_local8[indexl3] = iii;
_local9[indexl3] = jjj;
}
}
iii = _local8[indexa3] + 1;
jjj = _local9[indexa3];
if (grid[(("t_" + iii) + "_") + jjj]) {
if (grid[(("t_" + iii) + "_") + jjj].BFS != BFStunnus) {
grid[(("t_" + iii) + "_") + jjj].BFS = BFStunnus;
indexl3++;
_local8[indexl3] = iii;
_local9[indexl3] = jjj;
}
}
iii = _local8[indexa3];
jjj = _local9[indexa3] - 1;
if (grid[(("t_" + iii) + "_") + jjj]) {
if (grid[(("t_" + iii) + "_") + jjj].BFS != BFStunnus) {
grid[(("t_" + iii) + "_") + jjj].BFS = BFStunnus;
indexl3++;
_local8[indexl3] = iii;
_local9[indexl3] = jjj;
}
}
iii = _local8[indexa3];
jjj = _local9[indexa3] + 1;
if (grid[(("t_" + iii) + "_") + jjj]) {
if (grid[(("t_" + iii) + "_") + jjj].BFS != BFStunnus) {
grid[(("t_" + iii) + "_") + jjj].BFS = BFStunnus;
indexl3++;
_local8[indexl3] = iii;
_local9[indexl3] = jjj;
}
}
iii = _local8[indexa3] + 1;
jjj = _local9[indexa3] - 1;
if (grid[(("t_" + iii) + "_") + jjj]) {
if (grid[(("t_" + iii) + "_") + jjj].BFS != BFStunnus) {
grid[(("t_" + iii) + "_") + jjj].BFS = BFStunnus;
indexl3++;
_local8[indexl3] = iii;
_local9[indexl3] = jjj;
}
}
iii = _local8[indexa3] - 1;
jjj = _local9[indexa3] + 1;
if (grid[(("t_" + iii) + "_") + jjj]) {
if (grid[(("t_" + iii) + "_") + jjj].BFS != BFStunnus) {
grid[(("t_" + iii) + "_") + jjj].BFS = BFStunnus;
indexl3++;
_local8[indexl3] = iii;
_local9[indexl3] = jjj;
}
}
indexa3++;
}
_local4 = new Array();
_local5 = new Array();
_local2 = 0;
_local3 = 0;
_local4[_local3] = ii;
_local5[_local3] = jj;
BFStunnus++;
while (_local3 <= _local2) {
iii = _local4[_local3] - 1;
jjj = _local5[_local3];
if (grid[(("t_" + iii) + "_") + jjj]) {
if ((grid[(("t_" + iii) + "_") + jjj].BFS != BFStunnus) && (grid[(("t_" + iii) + "_") + jjj].munsisalto == id)) {
ThrowPoints(pistekerroin, grid._x + setx(jjj * tileW, iii * tileH), grid._y + sety(jjj * tileW, iii * tileH), grid[(("t_" + iii) + "_") + jjj]);
grid[(("t_" + iii) + "_") + jjj].removeMovieClip();
_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].munsisalto == id)) {
ThrowPoints(pistekerroin, grid._x + setx(jjj * tileW, iii * tileH), grid._y + sety(jjj * tileW, iii * tileH), grid[(("t_" + iii) + "_") + jjj]);
grid[(("t_" + iii) + "_") + jjj].removeMovieClip();
_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].munsisalto == id)) {
ThrowPoints(pistekerroin, grid._x + setx(jjj * tileW, iii * tileH), grid._y + sety(jjj * tileW, iii * tileH), grid[(("t_" + iii) + "_") + jjj]);
grid[(("t_" + iii) + "_") + jjj].removeMovieClip();
_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].munsisalto == id)) {
ThrowPoints(pistekerroin, grid._x + setx(jjj * tileW, iii * tileH), grid._y + sety(jjj * tileW, iii * tileH), grid[(("t_" + iii) + "_") + jjj]);
grid[(("t_" + iii) + "_") + jjj].removeMovieClip();
_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].munsisalto == id)) {
ThrowPoints(pistekerroin, grid._x + setx(jjj * tileW, iii * tileH), grid._y + sety(jjj * tileW, iii * tileH), grid[(("t_" + iii) + "_") + jjj]);
grid[(("t_" + iii) + "_") + jjj].removeMovieClip();
_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].munsisalto == id)) {
ThrowPoints(pistekerroin, grid._x + setx(jjj * tileW, iii * tileH), grid._y + sety(jjj * tileW, iii * tileH), grid[(("t_" + iii) + "_") + jjj]);
grid[(("t_" + iii) + "_") + jjj].removeMovieClip();
_local2++;
_local4[_local2] = iii;
_local5[_local2] = jjj;
}
}
_local3++;
}
var _local6 = new Array();
var _local7 = new Array();
indexa2 = 0;
indexl2 = 0;
_local6[0] = 0;
_local7[0] = 0;
BFStunnus++;
while (indexa2 <= indexl2) {
iii = _local6[indexa2];
jjj = _local7[indexa2];
grid[(("t_" + iii) + "_") + jjj].BFS = BFStunnus;
iii = _local6[indexa2] - 1;
jjj = _local7[indexa2];
if (grid[(("t_" + iii) + "_") + jjj]) {
if (grid[(("t_" + iii) + "_") + jjj].BFS != BFStunnus) {
grid[(("t_" + iii) + "_") + jjj].BFS = BFStunnus;
indexl2++;
_local6[indexl2] = iii;
_local7[indexl2] = jjj;
}
}
iii = _local6[indexa2] + 1;
jjj = _local7[indexa2];
if (grid[(("t_" + iii) + "_") + jjj]) {
if (grid[(("t_" + iii) + "_") + jjj].BFS != BFStunnus) {
grid[(("t_" + iii) + "_") + jjj].BFS = BFStunnus;
indexl2++;
_local6[indexl2] = iii;
_local7[indexl2] = jjj;
}
}
iii = _local6[indexa2];
jjj = _local7[indexa2] + 1;
if (grid[(("t_" + iii) + "_") + jjj]) {
if (grid[(("t_" + iii) + "_") + jjj].BFS != BFStunnus) {
grid[(("t_" + iii) + "_") + jjj].BFS = BFStunnus;
indexl2++;
_local6[indexl2] = iii;
_local7[indexl2] = jjj;
}
}
iii = _local6[indexa2];
jjj = _local7[indexa2] - 1;
if (grid[(("t_" + iii) + "_") + jjj]) {
if (grid[(("t_" + iii) + "_") + jjj].BFS != BFStunnus) {
grid[(("t_" + iii) + "_") + jjj].BFS = BFStunnus;
indexl2++;
_local6[indexl2] = iii;
_local7[indexl2] = jjj;
}
}
iii = _local6[indexa2] - 1;
jjj = _local7[indexa2] + 1;
if (grid[(("t_" + iii) + "_") + jjj]) {
if (grid[(("t_" + iii) + "_") + jjj].BFS != BFStunnus) {
grid[(("t_" + iii) + "_") + jjj].BFS = BFStunnus;
indexl2++;
_local6[indexl2] = iii;
_local7[indexl2] = jjj;
}
}
iii = _local6[indexa2] + 1;
jjj = _local7[indexa2] - 1;
if (grid[(("t_" + iii) + "_") + jjj]) {
if (grid[(("t_" + iii) + "_") + jjj].BFS != BFStunnus) {
grid[(("t_" + iii) + "_") + jjj].BFS = BFStunnus;
indexl2++;
_local6[indexl2] = iii;
_local7[indexl2] = jjj;
}
}
indexa2++;
}
poistettuja = 0;
var _local10 = 0;
while (_local10 <= indexl3) {
iii = _local8[_local10];
jjj = _local9[_local10];
if (grid[(("t_" + iii) + "_") + jjj]) {
if (grid[(("t_" + iii) + "_") + jjj].BFS != BFStunnus) {
ThrowPoints(pistekerroin, grid._x + setx(jjj * tileW, iii * tileH), grid._y + sety(jjj * tileW, iii * tileH), grid[(("t_" + iii) + "_") + jjj]);
grid[(("t_" + iii) + "_") + jjj].removeMovieClip();
poistettuja++;
}
}
_local10++;
}
poistettuja = poistettuja + _local2;
pallojainklimppi = pallojainklimppi - poistettuja;
Points = Points + (poistettuja * pistekerroin);
Score = (_global.lopputulos = "" + Points);
_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 _local4 = 0;
var _local5 = GridWidth;
var _local6 = rowsCurrentlyInGrid;
var _local3 = 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) {
_local4 = _local4 + int(grid[(("t_" + _local3) + "_") + _local2].munsisalto);
}
}
_local2++;
}
_local3++;
}
currentselectedsum = _local4 + " / 10";
if (_local4 > 10) {
_root.oikeapalkki.scorepalkki_red._visible = true;
}
if (_local4 <= 10) {
_root.oikeapalkki.scorepalkki_red._visible = false;
}
if (_local4 == 10) {
removeSelectedFromGrid();
}
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(pistekerroin, grid[(("t_" + _local3) + "_") + _local2]._x + grid._x, grid[(("t_" + _local3) + "_") + _local2]._y + grid._y);
grid[(("t_" + _local3) + "_") + _local2].removeMovieClip();
_local4++;
Points = Points + pistekerroin;
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 satuluku() {
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 satuluku2() {
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 {
pallojainklimppi++;
}
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 = kokokerroin * 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 = satuluku();
grid.attachMovie("file" + luku, (("t_" + _local2) + "_") + _local1, grid.getNextHighestDepth());
pallojainklimppi++;
grid[(("t_" + _local2) + "_") + _local1].munsisalto = luku;
grid[(("t_" + _local2) + "_") + _local1]._xscale = (grid[(("t_" + _local2) + "_") + _local1]._yscale = kokokerroin * 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 * kokokerroin) * kokokerroin)) {
return(true);
}
}
_local2++;
}
_local3++;
}
return(false);
}
function shootrandom() {
palloilmassa++;
luku = satuluku();
nimi = "t_" + palloja_ammuttu;
palloja_ammuttu++;
shots.attachMovie("file" + luku, nimi, shots.getNextHighestDepth());
shots[nimi].pomppuja = 0;
shots[nimi]._xscale = (shots[nimi]._yscale = 100 * kokokerroin);
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 = 27.78;
ammuttavapallo._xscale = (ammuttavapallo._yscale = 46.3);
ammuttavapallo.targety = nuoli._y;
ammuttavapallo.targetscale = 100 * kokokerroin;
ammuttavapallo._x = nuoli._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 = satuluku();
attachMovie("file" + seuraavaseuraavapallo, "ammuttavaammuttavapallo", 29);
ammuttavaammuttavapallo._y = 25.002;
ammuttavaammuttavapallo.targety = 25.002;
ammuttavaammuttavapallo._x = GridCenterX;
ammuttavaammuttavapallo._xscale = (ammuttavaammuttavapallo._yscale = 0);
ammuttavaammuttavapallo.targetscale = 41.67;
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].pomppuja = 0;
shots[nimi]._xscale = (shots[nimi]._yscale = 100 * kokokerroin);
shots[nimi].koko = 100;
shots[nimi].munsisalto = luku;
shots[nimi]._visible = true;
shots[nimi]._x = nuoli._x;
shots[nimi]._y = nuoli._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 / Pallonspeedi;
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;
shots[nimi].onEnterFrame = function () {
if (!_global.gameon) {
this.removeMovieClip();
}
this.eletty++;
if ((!this.solid) && (_global.gameon)) {
if (this.pomppuja > 5) {
ThrowPoints2(this._x, this._y, this);
_root.tuhlailu--;
asetainfo(_root.tuhlailu);
ammuttavapallo.targetscale = 100;
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.pomppuja++;
}
if ((this._x - _root.GridCenterX) > (_root.rightBound - (tileW / 2))) {
this._x = (_root.rightBound - (tileW / 2)) + _root.GridCenterX;
this.xv = -Math.abs(this.xv);
this.pomppuja++;
}
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.pomppuja++;
}
if ((this._y - _root.GridCenterY) > (_root.lowerBound - (tileH / 2))) {
this._y = (_root.lowerBound - (tileH / 2)) + _root.GridCenterY;
this.yv = -Math.abs(this.yv);
this.pomppuja++;
}
};
}
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 + 1;
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 + 1;
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 = 150;
scoreEffects["ScoreEffect" + PointsThrown]._yscale = 150;
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)) {
addRowToGrid();
}
}
function initGrid() {
i = 0;
while (i <= Erivareja) {
_root["tatavaria" + i] = 1;
i++;
}
i = Alkuklimpinkoko - 1;
while (i > 0) {
j = 0;
while (j < (((2 * Alkuklimpinkoko) - 1) - i)) {
asetaitte(-i, (((-Alkuklimpinkoko) + 1) + i) + j, satuluku());
j++;
}
j = 0;
while (j < (((Alkuklimpinkoko * 2) - 1) - i)) {
asetaitte(i, ((Alkuklimpinkoko - 1) - i) - j, satuluku());
j++;
}
i--;
}
j = 0;
while (j < ((Alkuklimpinkoko * 2) - 1)) {
asetaitte(0, ((-Alkuklimpinkoko) + 1) + j, satuluku());
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 = kokokerroin * 100);
asetaitte(-1, 0, 1);
asetaitte(1, 0, 2);
asetaitte(0, 1, 3);
asetaitte(0, -1, 4);
asetaitte(1, -1, 5);
asetaitte(-1, 1, 6);
}
Pallojapersatsi = 10;
kokokerroin = 0.75006;
Pallonspeedi = 20.835;
Alkuklimpinkoko = 3;
Erivareja = 6;
GridCenterX = 250.02;
GridCenterY = 291.69;
multiplier = "";
pistekerroin = 1;
kutistuu = false;
if (ollaankodeadwhalessa) {
dwnappi2._visible = false;
}
lowerBound = 241.686;
upperBound = -241.686;
leftBound = -241.686;
rightBound = 241.686;
this.createEmptyMovieClip("line_mc", 10);
gridspeed = 0;
pallojainklimppi = 0;
palloilmassa = 0;
nuoli._x = GridCenterX;
seuraavapallo = 1;
seuraavaseuraavapallo = 2;
_root.oikeapalkki._y = -100;
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;
tileW = 34 * kokokerroin;
tileH = 34 * kokokerroin;
hiirialhaalla = false;
_root.onMouseDown = function () {
hiirialhaalla = true;
};
_root.onMouseUp = function () {
hiirialhaalla = false;
shootSound();
};
edellinenaika = getTimer();
aikakerroin = 1;
var spacepohjassaviimeframessa = false;
edaika = 0;
_root.onEnterFrame = function () {
_root.oikeapalkki.frosmonappi._xscale = (_root.oikeapalkki.frosmonappi._yscale = (0.8 * _root.oikeapalkki.frosmonappi._xscale) + (0.2 * _root.targetnappiscale2));
dwnappi2._xscale = (dwnappi2._yscale = (0.8 * dwnappi2._xscale) + (0.2 * _root.targetnappiscale));
_root.oikeapalkki._y = (0.9 * _root.oikeapalkki._y) + 24.33528;
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 ((pallojainklimppi == 1) && (kutistuu == false)) {
kutistuu = true;
grid.targetscale = 0;
}
if ((kutistuu == true) && (grid._xscale < 2)) {
kutistuu = false;
initGrid();
grid._xscale = (grid._yscale = 0);
grid.targetscale = 100;
pistekerroin = pistekerroin + 1;
multiplier = pistekerroin + "x";
gotoAndStop ("game2end");
}
grid._xscale = (grid._yscale = (0.95 * grid._xscale) + (0.05 * grid.targetscale));
i = 1;
while (i <= 10) {
if (this["tuhlaus" + i]) {
this["tuhlaus" + i]._rotation = Math.sin((getTimer() / 1800) + (i * 0.2)) * 200;
this["tuhlaus" + i]._alpha = (this["tuhlaus" + i]._alpha * 0.95) + (this["tuhlaus" + i].targetalpha * 0.05);
this["tuhlaus" + i]._xscale = (this["tuhlaus" + i]._yscale = (this["tuhlaus" + i]._xscale * 0.95) + (this["tuhlaus" + i].targetscale * 0.05));
}
i++;
}
gridspeed = gridspeed * 0.97;
if (_root._ymouse > ((GridCenterY + upperBound) + 5)) {
nuoli._rotation = (Math.atan2(_root._ymouse - nuoli._y, _root._xmouse - nuoli._x) / 3.14159) * 180;
}
line_mc._visible = true;
hidastuskerroin = 1;
if (getTimer() < (kellonalkuaika + kellonkesto)) {
hidastuskerroin = 0.3;
}
if (((((!kutistuu) && (hiirialhaalla)) && (_root._ymouse > ((GridCenterY + upperBound) + 5))) && (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);
hiirialhaalla = false;
}
}
if (tuhlailu == 0) {
reloadalertsound();
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)) {
pointssound();
}
oldpo = Points;
if ((GameOver == true) && (_global.gameon == true)) {
if (kelloefekti) {
kelloefekti.removeMovieClip();
}
_root.lopputiski.julkaisuaika = getTimer();
_root.gotoAndStop("gameover2");
}
};
init();
stop();
Frame 289
_global.gameon = false;
grid.removeMovieClip();
shots.removeMovieClip();
scoreEffects.removeMovieClip();
ammuttavapallo.removeMovieClip();
ammuttavaammuttavapallo.removeMovieClip();
tuhlaus.removeMovieClip();
gameoversound();
Frame 290
var level2score = Score;
level2scoretxt.text = level2score;
_global.gameon = false;
grid.removeMovieClip();
shots.removeMovieClip();
scoreEffects.removeMovieClip();
ammuttavapallo.removeMovieClip();
ammuttavaammuttavapallo.removeMovieClip();
tuhlaus.removeMovieClip();
cong();
Frame 291
_global.gameon = true;
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].targetalpha = 0;
this["tuhlaus" + i].targetscale = 0;
}
i++;
}
i = 1;
while (i <= tuhlailu) {
if (!this["tuhlaus" + i]) {
attachMovie("tileydinpommi", "tuhlaus" + i, 789789 + i);
}
this["tuhlaus" + i].targetalpha = 100;
this["tuhlaus" + i].targetscale = 68;
this["tuhlaus" + i]._y = 908.374;
this["tuhlaus" + i]._x = ((10 + (30 * i)) * 0.9) * 0.926;
i++;
}
}
function init() {
i = 0;
while (i <= Erivareja) {
_root["tatavaria" + i] = 1;
i++;
}
kutistuu = false;
pistekerroin = 1;
multiplier = "";
gridspeed = 20;
tuhlailulim = 6;
tuhlailu = 6;
axis1x = 1;
axis1y = 0;
axis2x = 0.5;
axis2y = 0.8660254;
asetainfo(6);
palloilmassa = 0;
pallojainklimppi = 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";
_root.oikeapalkki.scorepalkki_red._visible = false;
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);
_root.lopputiski._visible = false;
_root.lopputiski._x = 250.02;
_root.lopputiski._y = 250.02;
_root.infotiski._visible = true;
_root.infotiski.gotoAndPlay(1);
infotiskijulkaistu = getTimer();
gamesinthislevel = 3;
tempPoints = 0;
Points = 0;
_global.lopputulema = Points;
Score = "" + Math.round(tempPoints);
valitunpallonkoko = 105;
valitsemattomankoko = 90;
level = 1;
levelper6 = level + "/6";
if (infotiski.getDepth() != 100000) {
infotiski.swapDepths(100000);
}
if (dwnappi2.getDepth() != 490000) {
dwnappi2.swapDepths(490000);
}
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();
}
function kiinnita(luku, ii, jj, nimi, xv, yv, poistetaanko) {
pallojainklimppi++;
grid.attachMovie("file" + luku, nimi, grid.getNextHighestDepth());
grid[nimi]._xscale = (grid[nimi]._yscale = 100 * kokokerroin);
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 + pallojainklimppi), 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 - (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 _local4 = new Array();
var _local5 = new Array();
var _local2 = 0;
var _local3 = 0;
_local4[_local3] = ii;
_local5[_local3] = jj;
BFStunnus++;
id = grid[(("t_" + ii) + "_") + jj].munsisalto;
while (_local3 <= _local2) {
iii = _local4[_local3] - 1;
jjj = _local5[_local3];
if (grid[(("t_" + iii) + "_") + jjj]) {
if ((grid[(("t_" + iii) + "_") + jjj].BFS != BFStunnus) && (grid[(("t_" + iii) + "_") + jjj].munsisalto == id)) {
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].munsisalto == id)) {
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].munsisalto == id)) {
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].munsisalto == id)) {
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].munsisalto == id)) {
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].munsisalto == id)) {
grid[(("t_" + iii) + "_") + jjj].BFS = BFStunnus;
_local2++;
_local4[_local2] = iii;
_local5[_local2] = jjj;
}
}
_local3++;
}
if (_local2 > 2) {
var _local8 = new Array();
var _local9 = new Array();
indexa3 = 0;
indexl3 = 0;
_local8[0] = 0;
_local9[0] = 0;
BFStunnus++;
while (indexa3 <= indexl3) {
iii = _local8[indexa3] - 1;
jjj = _local9[indexa3];
if (grid[(("t_" + iii) + "_") + jjj]) {
if (grid[(("t_" + iii) + "_") + jjj].BFS != BFStunnus) {
grid[(("t_" + iii) + "_") + jjj].BFS = BFStunnus;
indexl3++;
_local8[indexl3] = iii;
_local9[indexl3] = jjj;
}
}
iii = _local8[indexa3] + 1;
jjj = _local9[indexa3];
if (grid[(("t_" + iii) + "_") + jjj]) {
if (grid[(("t_" + iii) + "_") + jjj].BFS != BFStunnus) {
grid[(("t_" + iii) + "_") + jjj].BFS = BFStunnus;
indexl3++;
_local8[indexl3] = iii;
_local9[indexl3] = jjj;
}
}
iii = _local8[indexa3];
jjj = _local9[indexa3] - 1;
if (grid[(("t_" + iii) + "_") + jjj]) {
if (grid[(("t_" + iii) + "_") + jjj].BFS != BFStunnus) {
grid[(("t_" + iii) + "_") + jjj].BFS = BFStunnus;
indexl3++;
_local8[indexl3] = iii;
_local9[indexl3] = jjj;
}
}
iii = _local8[indexa3];
jjj = _local9[indexa3] + 1;
if (grid[(("t_" + iii) + "_") + jjj]) {
if (grid[(("t_" + iii) + "_") + jjj].BFS != BFStunnus) {
grid[(("t_" + iii) + "_") + jjj].BFS = BFStunnus;
indexl3++;
_local8[indexl3] = iii;
_local9[indexl3] = jjj;
}
}
iii = _local8[indexa3] + 1;
jjj = _local9[indexa3] - 1;
if (grid[(("t_" + iii) + "_") + jjj]) {
if (grid[(("t_" + iii) + "_") + jjj].BFS != BFStunnus) {
grid[(("t_" + iii) + "_") + jjj].BFS = BFStunnus;
indexl3++;
_local8[indexl3] = iii;
_local9[indexl3] = jjj;
}
}
iii = _local8[indexa3] - 1;
jjj = _local9[indexa3] + 1;
if (grid[(("t_" + iii) + "_") + jjj]) {
if (grid[(("t_" + iii) + "_") + jjj].BFS != BFStunnus) {
grid[(("t_" + iii) + "_") + jjj].BFS = BFStunnus;
indexl3++;
_local8[indexl3] = iii;
_local9[indexl3] = jjj;
}
}
indexa3++;
}
_local4 = new Array();
_local5 = new Array();
_local2 = 0;
_local3 = 0;
_local4[_local3] = ii;
_local5[_local3] = jj;
BFStunnus++;
while (_local3 <= _local2) {
iii = _local4[_local3] - 1;
jjj = _local5[_local3];
if (grid[(("t_" + iii) + "_") + jjj]) {
if ((grid[(("t_" + iii) + "_") + jjj].BFS != BFStunnus) && (grid[(("t_" + iii) + "_") + jjj].munsisalto == id)) {
ThrowPoints(pistekerroin, grid._x + setx(jjj * tileW, iii * tileH), grid._y + sety(jjj * tileW, iii * tileH), grid[(("t_" + iii) + "_") + jjj]);
grid[(("t_" + iii) + "_") + jjj].removeMovieClip();
_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].munsisalto == id)) {
ThrowPoints(pistekerroin, grid._x + setx(jjj * tileW, iii * tileH), grid._y + sety(jjj * tileW, iii * tileH), grid[(("t_" + iii) + "_") + jjj]);
grid[(("t_" + iii) + "_") + jjj].removeMovieClip();
_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].munsisalto == id)) {
ThrowPoints(pistekerroin, grid._x + setx(jjj * tileW, iii * tileH), grid._y + sety(jjj * tileW, iii * tileH), grid[(("t_" + iii) + "_") + jjj]);
grid[(("t_" + iii) + "_") + jjj].removeMovieClip();
_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].munsisalto == id)) {
ThrowPoints(pistekerroin, grid._x + setx(jjj * tileW, iii * tileH), grid._y + sety(jjj * tileW, iii * tileH), grid[(("t_" + iii) + "_") + jjj]);
grid[(("t_" + iii) + "_") + jjj].removeMovieClip();
_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].munsisalto == id)) {
ThrowPoints(pistekerroin, grid._x + setx(jjj * tileW, iii * tileH), grid._y + sety(jjj * tileW, iii * tileH), grid[(("t_" + iii) + "_") + jjj]);
grid[(("t_" + iii) + "_") + jjj].removeMovieClip();
_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].munsisalto == id)) {
ThrowPoints(pistekerroin, grid._x + setx(jjj * tileW, iii * tileH), grid._y + sety(jjj * tileW, iii * tileH), grid[(("t_" + iii) + "_") + jjj]);
grid[(("t_" + iii) + "_") + jjj].removeMovieClip();
_local2++;
_local4[_local2] = iii;
_local5[_local2] = jjj;
}
}
_local3++;
}
var _local6 = new Array();
var _local7 = new Array();
indexa2 = 0;
indexl2 = 0;
_local6[0] = 0;
_local7[0] = 0;
BFStunnus++;
while (indexa2 <= indexl2) {
iii = _local6[indexa2];
jjj = _local7[indexa2];
grid[(("t_" + iii) + "_") + jjj].BFS = BFStunnus;
iii = _local6[indexa2] - 1;
jjj = _local7[indexa2];
if (grid[(("t_" + iii) + "_") + jjj]) {
if (grid[(("t_" + iii) + "_") + jjj].BFS != BFStunnus) {
grid[(("t_" + iii) + "_") + jjj].BFS = BFStunnus;
indexl2++;
_local6[indexl2] = iii;
_local7[indexl2] = jjj;
}
}
iii = _local6[indexa2] + 1;
jjj = _local7[indexa2];
if (grid[(("t_" + iii) + "_") + jjj]) {
if (grid[(("t_" + iii) + "_") + jjj].BFS != BFStunnus) {
grid[(("t_" + iii) + "_") + jjj].BFS = BFStunnus;
indexl2++;
_local6[indexl2] = iii;
_local7[indexl2] = jjj;
}
}
iii = _local6[indexa2];
jjj = _local7[indexa2] + 1;
if (grid[(("t_" + iii) + "_") + jjj]) {
if (grid[(("t_" + iii) + "_") + jjj].BFS != BFStunnus) {
grid[(("t_" + iii) + "_") + jjj].BFS = BFStunnus;
indexl2++;
_local6[indexl2] = iii;
_local7[indexl2] = jjj;
}
}
iii = _local6[indexa2];
jjj = _local7[indexa2] - 1;
if (grid[(("t_" + iii) + "_") + jjj]) {
if (grid[(("t_" + iii) + "_") + jjj].BFS != BFStunnus) {
grid[(("t_" + iii) + "_") + jjj].BFS = BFStunnus;
indexl2++;
_local6[indexl2] = iii;
_local7[indexl2] = jjj;
}
}
iii = _local6[indexa2] - 1;
jjj = _local7[indexa2] + 1;
if (grid[(("t_" + iii) + "_") + jjj]) {
if (grid[(("t_" + iii) + "_") + jjj].BFS != BFStunnus) {
grid[(("t_" + iii) + "_") + jjj].BFS = BFStunnus;
indexl2++;
_local6[indexl2] = iii;
_local7[indexl2] = jjj;
}
}
iii = _local6[indexa2] + 1;
jjj = _local7[indexa2] - 1;
if (grid[(("t_" + iii) + "_") + jjj]) {
if (grid[(("t_" + iii) + "_") + jjj].BFS != BFStunnus) {
grid[(("t_" + iii) + "_") + jjj].BFS = BFStunnus;
indexl2++;
_local6[indexl2] = iii;
_local7[indexl2] = jjj;
}
}
indexa2++;
}
poistettuja = 0;
var _local10 = 0;
while (_local10 <= indexl3) {
iii = _local8[_local10];
jjj = _local9[_local10];
if (grid[(("t_" + iii) + "_") + jjj]) {
if (grid[(("t_" + iii) + "_") + jjj].BFS != BFStunnus) {
ThrowPoints(pistekerroin, grid._x + setx(jjj * tileW, iii * tileH), grid._y + sety(jjj * tileW, iii * tileH), grid[(("t_" + iii) + "_") + jjj]);
grid[(("t_" + iii) + "_") + jjj].removeMovieClip();
poistettuja++;
}
}
_local10++;
}
poistettuja = poistettuja + _local2;
pallojainklimppi = pallojainklimppi - poistettuja;
Points = Points + (poistettuja * pistekerroin);
Score = (_global.lopputulos = "" + Points);
_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 _local4 = 0;
var _local5 = GridWidth;
var _local6 = rowsCurrentlyInGrid;
var _local3 = 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) {
_local4 = _local4 + int(grid[(("t_" + _local3) + "_") + _local2].munsisalto);
}
}
_local2++;
}
_local3++;
}
currentselectedsum = _local4 + " / 10";
if (_local4 > 10) {
_root.oikeapalkki.scorepalkki_red._visible = true;
}
if (_local4 <= 10) {
_root.oikeapalkki.scorepalkki_red._visible = false;
}
if (_local4 == 10) {
removeSelectedFromGrid();
}
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(pistekerroin, grid[(("t_" + _local3) + "_") + _local2]._x + grid._x, grid[(("t_" + _local3) + "_") + _local2]._y + grid._y);
grid[(("t_" + _local3) + "_") + _local2].removeMovieClip();
_local4++;
Points = Points + pistekerroin;
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 satuluku() {
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 satuluku2() {
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 {
pallojainklimppi++;
}
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 = kokokerroin * 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 = satuluku();
grid.attachMovie("file" + luku, (("t_" + _local2) + "_") + _local1, grid.getNextHighestDepth());
pallojainklimppi++;
grid[(("t_" + _local2) + "_") + _local1].munsisalto = luku;
grid[(("t_" + _local2) + "_") + _local1]._xscale = (grid[(("t_" + _local2) + "_") + _local1]._yscale = kokokerroin * 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 * kokokerroin) * kokokerroin)) {
return(true);
}
}
_local2++;
}
_local3++;
}
return(false);
}
function shootrandom() {
palloilmassa++;
luku = satuluku();
nimi = "t_" + palloja_ammuttu;
palloja_ammuttu++;
shots.attachMovie("file" + luku, nimi, shots.getNextHighestDepth());
shots[nimi].pomppuja = 0;
shots[nimi]._xscale = (shots[nimi]._yscale = 100 * kokokerroin);
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 = 27.78;
ammuttavapallo._xscale = (ammuttavapallo._yscale = 46.3);
ammuttavapallo.targety = nuoli._y;
ammuttavapallo.targetscale = 100 * kokokerroin;
ammuttavapallo._x = nuoli._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 = satuluku();
attachMovie("file" + seuraavaseuraavapallo, "ammuttavaammuttavapallo", 29);
ammuttavaammuttavapallo._y = 25.002;
ammuttavaammuttavapallo.targety = 25.002;
ammuttavaammuttavapallo._x = GridCenterX;
ammuttavaammuttavapallo._xscale = (ammuttavaammuttavapallo._yscale = 0);
ammuttavaammuttavapallo.targetscale = 41.67;
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].pomppuja = 0;
shots[nimi]._xscale = (shots[nimi]._yscale = 100 * kokokerroin);
shots[nimi].koko = 100;
shots[nimi].munsisalto = luku;
shots[nimi]._visible = true;
shots[nimi]._x = nuoli._x;
shots[nimi]._y = nuoli._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 / Pallonspeedi;
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;
shots[nimi].onEnterFrame = function () {
if (!_global.gameon) {
this.removeMovieClip();
}
this.eletty++;
if ((!this.solid) && (_global.gameon)) {
if (this.pomppuja > 5) {
ThrowPoints2(this._x, this._y, this);
_root.tuhlailu--;
asetainfo(_root.tuhlailu);
ammuttavapallo.targetscale = 100;
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.pomppuja++;
}
if ((this._x - _root.GridCenterX) > (_root.rightBound - (tileW / 2))) {
this._x = (_root.rightBound - (tileW / 2)) + _root.GridCenterX;
this.xv = -Math.abs(this.xv);
this.pomppuja++;
}
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.pomppuja++;
}
if ((this._y - _root.GridCenterY) > (_root.lowerBound - (tileH / 2))) {
this._y = (_root.lowerBound - (tileH / 2)) + _root.GridCenterY;
this.yv = -Math.abs(this.yv);
this.pomppuja++;
}
};
}
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 + 1;
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 + 1;
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 = 150;
scoreEffects["ScoreEffect" + PointsThrown]._yscale = 150;
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)) {
addRowToGrid();
}
}
function initGrid() {
i = 0;
while (i <= Erivareja) {
_root["tatavaria" + i] = 1;
i++;
}
i = Alkuklimpinkoko - 1;
while (i > 0) {
j = 0;
while (j < (((2 * Alkuklimpinkoko) - 1) - i)) {
asetaitte(-i, (((-Alkuklimpinkoko) + 1) + i) + j, satuluku());
j++;
}
j = 0;
while (j < (((Alkuklimpinkoko * 2) - 1) - i)) {
asetaitte(i, ((Alkuklimpinkoko - 1) - i) - j, satuluku());
j++;
}
i--;
}
j = 0;
while (j < ((Alkuklimpinkoko * 2) - 1)) {
asetaitte(0, ((-Alkuklimpinkoko) + 1) + j, satuluku());
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 = kokokerroin * 100);
asetaitte(-1, 0, 1);
asetaitte(1, 0, 2);
asetaitte(0, 1, 3);
asetaitte(0, -1, 4);
asetaitte(1, -1, 5);
asetaitte(-1, 1, 6);
}
Pallojapersatsi = 10;
kokokerroin = 0.75006;
Pallonspeedi = 20.835;
Alkuklimpinkoko = 4;
Erivareja = 6;
GridCenterX = 250.02;
GridCenterY = 291.69;
multiplier = "";
pistekerroin = 1;
kutistuu = false;
if (ollaankodeadwhalessa) {
dwnappi2._visible = false;
}
lowerBound = 241.686;
upperBound = -241.686;
leftBound = -241.686;
rightBound = 241.686;
this.createEmptyMovieClip("line_mc", 10);
gridspeed = 0;
pallojainklimppi = 0;
palloilmassa = 0;
nuoli._x = GridCenterX;
seuraavapallo = 1;
seuraavaseuraavapallo = 2;
_root.oikeapalkki._y = -100;
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;
tileW = 34 * kokokerroin;
tileH = 34 * kokokerroin;
hiirialhaalla = false;
_root.onMouseDown = function () {
hiirialhaalla = true;
};
_root.onMouseUp = function () {
hiirialhaalla = false;
shootSound();
};
edellinenaika = getTimer();
aikakerroin = 1;
var spacepohjassaviimeframessa = false;
edaika = 0;
_root.onEnterFrame = function () {
_root.oikeapalkki.frosmonappi._xscale = (_root.oikeapalkki.frosmonappi._yscale = (0.8 * _root.oikeapalkki.frosmonappi._xscale) + (0.2 * _root.targetnappiscale2));
dwnappi2._xscale = (dwnappi2._yscale = (0.8 * dwnappi2._xscale) + (0.2 * _root.targetnappiscale));
_root.oikeapalkki._y = (0.9 * _root.oikeapalkki._y) + 24.33528;
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 ((pallojainklimppi == 1) && (kutistuu == false)) {
kutistuu = true;
grid.targetscale = 0;
}
if ((kutistuu == true) && (grid._xscale < 2)) {
kutistuu = false;
initGrid();
grid._xscale = (grid._yscale = 0);
grid.targetscale = 100;
pistekerroin = pistekerroin + 1;
multiplier = pistekerroin + "x";
gotoAndStop ("congrats");
}
grid._xscale = (grid._yscale = (0.95 * grid._xscale) + (0.05 * grid.targetscale));
i = 1;
while (i <= 10) {
if (this["tuhlaus" + i]) {
this["tuhlaus" + i]._rotation = Math.sin((getTimer() / 1800) + (i * 0.2)) * 200;
this["tuhlaus" + i]._alpha = (this["tuhlaus" + i]._alpha * 0.95) + (this["tuhlaus" + i].targetalpha * 0.05);
this["tuhlaus" + i]._xscale = (this["tuhlaus" + i]._yscale = (this["tuhlaus" + i]._xscale * 0.95) + (this["tuhlaus" + i].targetscale * 0.05));
}
i++;
}
gridspeed = gridspeed * 0.97;
if (_root._ymouse > ((GridCenterY + upperBound) + 5)) {
nuoli._rotation = (Math.atan2(_root._ymouse - nuoli._y, _root._xmouse - nuoli._x) / 3.14159) * 180;
}
line_mc._visible = true;
hidastuskerroin = 1;
if (getTimer() < (kellonalkuaika + kellonkesto)) {
hidastuskerroin = 0.3;
}
if (((((!kutistuu) && (hiirialhaalla)) && (_root._ymouse > ((GridCenterY + upperBound) + 5))) && (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);
hiirialhaalla = false;
}
}
if (tuhlailu == 0) {
reloadalertsound();
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)) {
pointssound();
}
oldpo = Points;
if ((GameOver == true) && (_global.gameon == true)) {
if (kelloefekti) {
kelloefekti.removeMovieClip();
}
_root.lopputiski.julkaisuaika = getTimer();
_root.gotoAndStop("gameover3");
}
};
init();
stop();
Frame 292
_global.gameon = false;
grid.removeMovieClip();
shots.removeMovieClip();
scoreEffects.removeMovieClip();
ammuttavapallo.removeMovieClip();
ammuttavaammuttavapallo.removeMovieClip();
tuhlaus.removeMovieClip();
gameoversound();
Frame 293
var level3score = Score;
level3scoretxt.text = (level3score + level1score) + level2score;
_global.gameon = false;
grid.removeMovieClip();
shots.removeMovieClip();
scoreEffects.removeMovieClip();
ammuttavapallo.removeMovieClip();
ammuttavaammuttavapallo.removeMovieClip();
tuhlaus.removeMovieClip();
cong();
Symbol 14 Button
on (release) {
kirupaSound = new Sound(this);
kirupaSound.attachSound("Clicki");
kirupaSound.start(0, 1);
_root.GameOver = true;
}
Symbol 18 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 19 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 26 MovieClip [tile_show_on] Frame 1
stop();
Symbol 27 MovieClip [tile] Frame 8
stop();
Symbol 27 MovieClip [tile] Frame 16
stop();
Symbol 28 MovieClip [tileydinpommi] Frame 1
stop();
Symbol 37 MovieClip [tilepommi] Frame 1
stop();
Symbol 41 MovieClip [file1] Frame 1
stop();
Symbol 45 MovieClip [file2] Frame 1
stop();
Symbol 49 MovieClip [file3] Frame 1
stop();
Symbol 53 MovieClip [file4] Frame 1
stop();
Symbol 56 MovieClip [file5] Frame 1
stop();
Symbol 60 MovieClip [file6] Frame 1
stop();
Symbol 78 MovieClip Frame 1
function init_boucle(mc, vx, vy) {
mc.onEnterFrame = function () {
this._y = this._y + (vy / 2);
this._x = this._x + (vx / 2);
if ((this._x < (0 + (this._width / 2))) || (this._x > (Stage.width - (this._width / 2)))) {
delete this.onEnterFrame;
this.removeMovieClip();
}
if (this._y > (Stage.height - (this._height / 2))) {
nbre++;
if (nbre > 80) {
delete this.onEnterFrame;
removeMovieClip(this);
} else {
delete this.onEnterFrame;
impact[nbre] = this;
}
}
};
}
var nbre = 0;
var count = 0;
var randomtime = 0;
var impact = new Array();
var taille = new Object();
chuteobjet._visible = false;
onEnterFrame = function () {
time = getTimer();
if (time >= randomtime) {
count = count + 1;
duplicateMovieClip ("chuteobjet", "chuteobjet" + count, count);
setProperty("chuteobjet" + count, _x , random(Stage.width));
setProperty("chuteobjet" + count, _y , 0);
var _local2 = 40 + random(50);
setProperty("chuteobjet" + count, _yscale , _local2);
setProperty("chuteobjet" + count, _xscale , _local2);
randomtime = (Math.random() * 40) + time;
var _local3 = random(3) * (1 - random(3));
var _local4 = 3 + random(3);
init_boucle(this["chuteobjet" + count], _local3, _local4);
}
};
Stage.addListener(taille);
taille.onResize = function () {
j = 0;
while (j < impact.length) {
impact[j]._y = Stage.height - (impact[j]._height / 2);
j++;
}
};
Symbol 80 Button
on (press) {
var localDomainLC = new LocalConnection();
flashCurrentDomainName = localDomainLC.domain();
var gametitle = "title";
var btnUrl = (("http://www.girly.com/?utm_source=" + flashCurrentDomainName) + "&utm_medium=flashgames&utm_term=fruit-shoot&utm_content=preloader&utm_campaign=brandedgames");
}
on (release) {
getURL (_root.btnUrl, "_blank");
}
Symbol 103 MovieClip Frame 20
this.removeMovieClip();
Symbol 104 MovieClip Frame 1
Frame_num = 1;
angle = 360;
plus_angle = 0;
scene_width = 400;
scene_height = 45;
bar_mc.i = 0;
bar_mc._visible = 0;
bar_mc.onEnterFrame = function () {
var _local2 = this;
if ((_local2.i % Frame_num) == 0) {
mc = _local2.duplicateMovieClip("bar_mc" + _local2.i, _local2.i);
mc._x = random(scene_width);
mc._y = random(scene_height);
mc._rotation = random(angle) + plus_angle;
}
_local2.i++;
};
Symbol 108 MovieClip Frame 30
stop();
Symbol 113 MovieClip Frame 81
stop();
Symbol 150 Button
on (release) {
getURL ("http://www.girly.com/", "_blank");
}
Symbol 151 Button
on (press) {
var localDomainLC = new LocalConnection();
flashCurrentDomainName = localDomainLC.domain();
var gametitle = "title";
var btnUrl = (("http://www.girly.com/?utm_source=" + flashCurrentDomainName) + "&utm_medium=flashgames&utm_term=fruit-shoot&utm_content=moregames-preloader&utm_campaign=brandedgames");
}
on (release) {
getURL (_root.btnUrl, "_blank");
}
Symbol 156 MovieClip Frame 18
stop();
Symbol 157 Button
on (release) {
gotoAndStop ("playscreen");
}
Symbol 366 MovieClip Frame 18
stop();
Symbol 377 MovieClip Frame 20
this.removeMovieClip();
Symbol 378 MovieClip Frame 1
Frame_num = 1;
angle = 360;
plus_angle = 0;
scene_width = 400;
scene_height = 45;
bar_mc.i = 0;
bar_mc._visible = 0;
bar_mc.onEnterFrame = function () {
var _local2 = this;
if ((_local2.i % Frame_num) == 0) {
mc = _local2.duplicateMovieClip("bar_mc" + _local2.i, _local2.i);
mc._x = random(scene_width);
mc._y = random(scene_height);
mc._rotation = random(angle) + plus_angle;
}
_local2.i++;
};
Symbol 381 MovieClip Frame 30
stop();
Symbol 393 Button
on (press) {
var localDomainLC = new LocalConnection();
flashCurrentDomainName = localDomainLC.domain();
var gametitle = "title";
var btnUrl = (("http://www.girly.com/?utm_source=" + flashCurrentDomainName) + "&utm_medium=flashgames&utm_term=fruit-shoot&utm_content=logo-splash&utm_campaign=brandedgames");
}
on (release) {
getURL (_root.btnUrl, "_blank");
onclick();
}
on (rollOver) {
onroll();
}
Symbol 403 Button
on (release) {
gotoAndStop ("game1");
onclick();
}
on (rollOver) {
onroll();
}
Symbol 408 Button
on (release) {
gotoAndStop (1);
}
Symbol 411 Button
on (release) {
stopAllSounds();
gotoAndStop (2);
}
Symbol 412 MovieClip Frame 1
stop();
btn1._visible = true;
btn2._visible = false;
if (_global.Behaviors == null) {
_global.Behaviors = {};
}
if (_global.Behaviors.Sound == null) {
_global.Behaviors.Sound = {};
}
if (typeof(this.createEmptyMovieClip) == "undefined") {
this._parent.createEmptyMovieClip("BS_bgbmins", new Date().getTime() - (Math.floor(new Date().getTime() / 10000) * 10000));
_global.Behaviors.Sound.bgbmins = new Sound(this._parent.BS_bgbmins);
} else {
this.createEmptyMovieClip("_bgbmins_", new Date().getTime() - (Math.floor(new Date().getTime() / 10000) * 10000));
_global.Behaviors.Sound.bgbmins = new Sound(this.BS_bgbmins);
}
_global.Behaviors.Sound.bgbmins.attachSound("bgbm");
_global.Behaviors.Sound.bgbmins.start(0, 10000);
Symbol 412 MovieClip Frame 2
stop();
stopAllSounds();
btn1._visible = false;
btn2._visible = true;
Symbol 427 Button
on (press) {
var localDomainLC = new LocalConnection();
flashCurrentDomainName = localDomainLC.domain();
var gametitle = "title";
var btnUrl = (("http://www.girly.com/?utm_source=" + flashCurrentDomainName) + "&utm_medium=flashgames&utm_term=fruit-shoot&utm_content=logo-level-1&utm_campaign=brandedgames");
}
on (release) {
getURL (_root.btnUrl, "_blank");
onclick();
}
on (rollOver) {
onroll();
}
Symbol 430 Button
on (press) {
var localDomainLC = new LocalConnection();
flashCurrentDomainName = localDomainLC.domain();
var gametitle = "title";
var btnUrl = (("http://www.girly.com/?utm_source=" + flashCurrentDomainName) + "&utm_medium=flashgames&utm_term=fruit-shoot&utm_content=moregames-level-1-start&utm_campaign=brandedgames");
}
on (release) {
getURL (_root.btnUrl, "_blank");
onclick();
}
on (rollOver) {
onroll();
}
Symbol 441 Button
on (release) {
_global.gameon = true;
_root.start_bg._visible = false;
_root.startbtn._visible = false;
onclick();
}
on (rollOver) {
onroll();
}
Symbol 443 Button
on (press) {
var localDomainLC = new LocalConnection();
flashCurrentDomainName = localDomainLC.domain();
var gametitle = "title";
var btnUrl = (("http://www.girly.com/?utm_source=" + flashCurrentDomainName) + "&utm_medium=flashgames&utm_term=fruit-shoot&utm_content=logo-level-1-end&utm_campaign=brandedgames");
}
on (release) {
getURL (_root.btnUrl, "_blank");
onclick();
}
on (rollOver) {
onroll();
}
Symbol 450 Button
on (release) {
gotoAndStop ("game1");
onclick();
}
on (rollOver) {
onroll();
}
Symbol 451 Button
on (press) {
var localDomainLC = new LocalConnection();
flashCurrentDomainName = localDomainLC.domain();
var gametitle = "title";
var btnUrl = (("http://www.girly.com/?utm_source=" + flashCurrentDomainName) + "&utm_medium=flashgames&utm_term=fruit-shoot&utm_content=moregames-level-1-end&utm_campaign=brandedgames");
}
on (release) {
getURL (_root.btnUrl, "_blank");
onclick();
}
on (rollOver) {
onroll();
}
Symbol 457 Button
on (release) {
gotoAndStop ("game2");
onclick();
}
on (rollOver) {
onroll();
}
Symbol 465 Button
on (press) {
var localDomainLC = new LocalConnection();
flashCurrentDomainName = localDomainLC.domain();
var gametitle = "title";
var btnUrl = (("http://www.girly.com/?utm_source=" + flashCurrentDomainName) + "&utm_medium=flashgames&utm_term=fruit-shoot&utm_content=logo-level-2&utm_campaign=brandedgames");
}
on (release) {
getURL (_root.btnUrl, "_blank");
onclick();
}
on (rollOver) {
onroll();
}
Symbol 466 Button
on (press) {
var localDomainLC = new LocalConnection();
flashCurrentDomainName = localDomainLC.domain();
var gametitle = "title";
var btnUrl = (("http://www.girly.com/?utm_source=" + flashCurrentDomainName) + "&utm_medium=flashgames&utm_term=fruit-shoot&utm_content=moregames-level-2-start&utm_campaign=brandedgames");
}
on (release) {
getURL (_root.btnUrl, "_blank");
onclick();
}
on (rollOver) {
onroll();
}
Symbol 469 Button
on (press) {
var localDomainLC = new LocalConnection();
flashCurrentDomainName = localDomainLC.domain();
var gametitle = "title";
var btnUrl = (("http://www.girly.com/?utm_source=" + flashCurrentDomainName) + "&utm_medium=flashgames&utm_term=fruit-shoot&utm_content=logo-level-2-end&utm_campaign=brandedgames");
}
on (release) {
getURL (_root.btnUrl, "_blank");
onclick();
}
on (rollOver) {
onroll();
}
Symbol 470 Button
on (release) {
gotoAndStop ("game2");
onclick();
}
on (rollOver) {
onroll();
}
Symbol 471 Button
on (press) {
var localDomainLC = new LocalConnection();
flashCurrentDomainName = localDomainLC.domain();
var gametitle = "title";
var btnUrl = (("http://www.girly.com/?utm_source=" + flashCurrentDomainName) + "&utm_medium=flashgames&utm_term=fruit-shoot&utm_content=moregames-level-2-end&utm_campaign=brandedgames");
}
on (release) {
getURL (_root.btnUrl, "_blank");
onclick();
}
on (rollOver) {
onroll();
}
Symbol 472 Button
on (release) {
gotoAndStop ("game3");
onclick();
}
on (rollOver) {
onroll();
}
Symbol 476 Button
on (press) {
var localDomainLC = new LocalConnection();
flashCurrentDomainName = localDomainLC.domain();
var gametitle = "title";
var btnUrl = (("http://www.girly.com/?utm_source=" + flashCurrentDomainName) + "&utm_medium=flashgames&utm_term=fruit-shoot&utm_content=logo-level-3&utm_campaign=brandedgames");
}
on (release) {
getURL (_root.btnUrl, "_blank");
onclick();
}
on (rollOver) {
onroll();
}
Symbol 477 Button
on (press) {
var localDomainLC = new LocalConnection();
flashCurrentDomainName = localDomainLC.domain();
var gametitle = "title";
var btnUrl = (("http://www.girly.com/?utm_source=" + flashCurrentDomainName) + "&utm_medium=flashgames&utm_term=fruit-shoot&utm_content=moregames-level-3-start&utm_campaign=brandedgames");
}
on (release) {
getURL (_root.btnUrl, "_blank");
onclick();
}
on (rollOver) {
onroll();
}
Symbol 479 Button
on (release) {
_global.gameon = true;
_root.start_bg._visible = false;
_root.startbtn._visible = false;
onclick();
}
on (rollOver) {
onroll();
}
Symbol 481 Button
on (press) {
var localDomainLC = new LocalConnection();
flashCurrentDomainName = localDomainLC.domain();
var gametitle = "title";
var btnUrl = (("http://www.girly.com/?utm_source=" + flashCurrentDomainName) + "&utm_medium=flashgames&utm_term=fruit-shoot&utm_content=logo-level-3-end&utm_campaign=brandedgames");
}
on (release) {
getURL (_root.btnUrl, "_blank");
onclick();
}
on (rollOver) {
onroll();
}
Symbol 482 Button
on (release) {
gotoAndStop ("game3");
onclick();
}
on (rollOver) {
onroll();
}
Symbol 483 Button
on (press) {
var localDomainLC = new LocalConnection();
flashCurrentDomainName = localDomainLC.domain();
var gametitle = "title";
var btnUrl = (("http://www.girly.com/?utm_source=" + flashCurrentDomainName) + "&utm_medium=flashgames&utm_term=fruit-shoot&utm_content=moregames-level-3-end&utm_campaign=brandedgames");
}
on (release) {
getURL (_root.btnUrl, "_blank");
onclick();
}
on (rollOver) {
onroll();
}
Symbol 488 Button
on (press) {
var localDomainLC = new LocalConnection();
flashCurrentDomainName = localDomainLC.domain();
var gametitle = "title";
var btnUrl = (("http://www.girly.com/?utm_source=" + flashCurrentDomainName) + "&utm_medium=flashgames&utm_term=fruit-shoot&utm_content=logo-congrats&utm_campaign=brandedgames");
}
on (release) {
getURL (_root.btnUrl, "_blank");
onclick();
}
on (rollOver) {
onroll();
}
Symbol 492 Button
on (press) {
var localDomainLC = new LocalConnection();
flashCurrentDomainName = localDomainLC.domain();
var gametitle = "title";
var btnUrl = (("http://www.girly.com/?utm_source=" + flashCurrentDomainName) + "&utm_medium=flashgames&utm_term=fruit-shoot&utm_content=moregames-congrats&utm_campaign=brandedgames");
}
on (release) {
getURL (_root.btnUrl, "_blank");
onclick();
}
on (rollOver) {
onroll();
}
Symbol 496 Button
on (release) {
gotoAndStop ("playscreen");
onclick();
}
on (rollOver) {
onroll();
}
Symbol 521 MovieClip Frame 40
stop();
Symbol 523 MovieClip Frame 21
stop();
Symbol 524 Button
on (release) {
getURL ("http://www.girlgames1.com", "_blank");
}
Symbol 530 Button
on (release) {
gotoAndStop (284);
onclick();
}
on (rollOver) {
onroll();
}