Frame 1
urlStart = _url.indexOf("://") + 3;
urlEnd = _url.indexOf("/", urlStart);
domain = _url.substring(urlStart, urlEnd);
LastDot = domain.lastIndexOf(".") - 1;
domEnd = domain.lastIndexOf(".", LastDot) + 1;
domain = domain.substring(domEnd, domain.length);
if (domain != "armorgames.com") {
_root._y = -480;
_root.gotoAndStop(1);
}
Frame 2
totalBytes = Math.round(_root.getBytesTotal() / 1024);
loadedBytes = Math.round(_root.getBytesLoaded() / 1024);
percentDone = Math.round((loadedBytes / totalBytes) * 100);
preloaderBar._xscale = percentDone;
preloaderEff._x = percentDone * 6.4;
if (percentDone >= 100) {
_root.gotoAndStop(4);
}
Frame 3
gotoAndPlay (2);
Frame 4
function stepCoord(dif) {
switch (dif) {
case 0 :
xx = 100;
yy = 0;
break;
case 1 :
xx = 50;
yy = -38;
break;
case 2 :
xx = 0;
yy = -75;
break;
case 3 :
xx = -50;
yy = -38;
break;
case 4 :
xx = -100;
yy = 0;
break;
case 5 :
xx = -50;
yy = 38;
break;
case 6 :
xx = 0;
yy = 75;
break;
case 7 :
xx = 50;
yy = 38;
}
}
fscommand ("showmenu", "false");
Stage.scaleMode = "noScale";
var my_so = SharedObject.getLocal("shared", "/");
my_lvl = my_so.data.my_lvl;
if (my_lvl == undefined) {
my_lvl = 1;
}
lvlmedal = new Array();
lvlmedal[0] = 0;
if (my_so.data.lvlmedal[0] == undefined) {
my_so.data.lvlmedal = new Array();
my_so.data.lvlmedal[0] = 0;
}
i = 1;
while (i < 29) {
lvlmedal[i] = my_so.data.lvlmedal[i];
if (lvlmedal[i] == undefined) {
lvlmedal[i] = 1;
}
i++;
}
var play_laser1 = new Sound(_root);
play_laser1.attachSound("snd_laser1");
var play_laser2 = new Sound(_root);
play_laser2.attachSound("snd_laser2");
var play_laser3 = new Sound(_root);
play_laser3.attachSound("snd_laser3");
var play_powerdown = new Sound(_root);
play_powerdown.attachSound("snd_powerdown");
inter._visible = false;
tesla._visible = false;
text_addscore._visible = false;
select._visible = false;
fly._visible = false;
fly.stop();
star._visible = false;
marker.select._visible = false;
menu_screen.swapDepths(99999);
win_screen.swapDepths(99998);
level_screen.swapDepths(99997);
inter.swapDepths(99990);
select.swapDepths(10000);
marker.swapDepths(9999);
eff.swapDepths(9998);
_root.stop();
back.gotoAndStop(2);
menu_screen.gotoAndPlay(2);
inter._xscale = (inter._yscale = 134);
begin = -1;
menu_type = 0;
begin_type = 0;
level1 = [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0], [0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0], [0, 0, 0, 8, 1, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]];
level1timer = 20;
level1score = 50;
level2 = [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 2, 1, 1, 0, 9, 0, 0, 0], [0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0], [0, 0, 0, 8, 1, 1, 1, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]];
level2timer = 20;
level2score = 150;
level3 = [[0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0], [0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0], [0, 0, 0, 0, 2, 1, 1, 0, 0, 0, 0], [0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0], [0, 0, 0, 0, 1, 1, 2, 0, 0, 0, 0], [0, 0, 0, 0, 1, 8, 1, 0, 0, 0, 0]];
level3timer = 25;
level3score = 250;
level4 = [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 8, 0, 1, 0, 0, 0, 0, 0], [0, 0, 1, 1, 1, 2, 1, 1, 0, 0, 0], [0, 0, 1, 1, 2, 2, 2, 1, 9, 0, 0], [0, 0, 1, 8, 1, 1, 1, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]];
level4timer = 25;
level4score = 400;
level5 = [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0], [0, 0, 0, 8, 1, 2, 1, 8, 0, 0, 0], [0, 0, 0, 0, 1, 8, 1, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]];
level5timer = 20;
level5score = 150;
level6 = [[0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0], [0, 0, 0, 4, 1, 0, 9, 1, 0, 0, 0], [0, 2, 1, 0, 0, 8, 0, 0, 1, 1, 0], [0, 0, 1, 2, 0, 0, 1, 1, 1, 0, 0], [0, 2, 1, 0, 0, 1, 0, 1, 1, 0, 0], [0, 0, 1, 1, 1, 0, 1, 0, 0, 0, 0]];
level6timer = 25;
level6score = 550;
level7 = [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 3, 1, 1, 0, 1, 9, 0, 0], [0, 1, 1, 0, 0, 0, 4, 1, 0, 0, 0], [1, 1, 0, 1, 8, 0, 0, 2, 1, 0, 0], [0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0], [0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0]];
level7timer = 25;
level7score = 300;
level8 = [[0, 0, 0, 0, 0, 1, 2, 1, 0, 0, 0], [0, 0, 0, 4, 1, 0, 0, 0, 8, 1, 0], [0, 1, 1, 0, 0, 1, 4, 1, 0, 0, 9], [2, 1, 0, 0, 9, 0, 0, 0, 1, 2, 0], [0, 0, 1, 1, 0, 0, 0, 8, 1, 0, 0], [0, 0, 0, 0, 1, 2, 1, 0, 0, 0, 0]];
level8timer = 15;
level8score = 600;
level9 = [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0], [0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0], [0, 0, 8, 1, 1, 2, 2, 1, 8, 0, 0], [0, 0, 0, 0, 1, 8, 1, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]];
level9timer = 20;
level9score = 450;
level10 = [[0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0], [0, 0, 9, 1, 1, 0, 1, 2, 0, 0, 0], [0, 4, 1, 0, 1, 2, 1, 0, 1, 1, 0], [0, 0, 1, 1, 0, 0, 1, 1, 0, 1, 2], [0, 8, 0, 1, 2, 1, 0, 1, 1, 0, 0], [0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0]];
level10timer = 15;
level10score = 500;
level11 = [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 8, 1, 1, 0, 9, 0, 0, 0], [0, 0, 1, 1, 3, 1, 1, 1, 0, 0, 0], [0, 0, 1, 8, 2, 1, 4, 8, 1, 0, 0], [0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]];
level11timer = 15;
level11score = 350;
level12 = [[0, 0, 0, 1, 1, 4, 1, 1, 0, 0, 0], [0, 1, 9, 0, 1, 2, 1, 0, 9, 1, 0], [0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0], [0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0], [0, 0, 1, 1, 0, 8, 0, 1, 1, 0, 0], [0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0]];
level12timer = 15;
level12score = 500;
level13 = [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 1, 0, 1, 1, 1, 9, 0, 0], [0, 1, 2, 0, 4, 1, 0, 1, 1, 0, 0], [0, 8, 1, 1, 8, 0, 2, 1, 0, 0, 0], [1, 2, 0, 8, 1, 1, 4, 0, 0, 0, 0], [0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0]];
level13timer = 20;
level13score = 500;
level14 = [[0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0], [0, 0, 0, 1, 1, 1, 1, 2, 0, 0, 0], [0, 8, 1, 1, 1, 1, 2, 1, 1, 8, 0], [0, 0, 1, 2, 2, 1, 1, 1, 1, 0, 0], [0, 0, 0, 0, 1, 8, 1, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]];
level14timer = 20;
level14score = 600;
level15 = [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 1, 1, 9, 0, 0, 0], [0, 0, 0, 1, 1, 0, 0, 11, 1, 0, 0], [0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 8, 1, 1, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]];
level15timer = 10;
level15score = 150;
level16 = [[0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0], [0, 0, 10, 0, 10, 0, 10, 0, 10, 1, 0], [0, 8, 0, 0, 0, 0, 0, 0, 0, 9, 1], [1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 2, 14, 2, 14, 2, 14, 2, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]];
level16timer = 10;
level16score = 550;
level17 = [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 17, 0, 0, 0, 11, 0, 0, 0], [0, 8, 1, 0, 0, 0, 0, 0, 1, 8, 0], [1, 9, 2, 0, 0, 0, 0, 0, 2, 9, 1], [0, 0, 1, 15, 0, 0, 0, 13, 1, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]];
level17timer = 15;
level17score = 300;
level18 = [[0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0], [0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0], [0, 1, 1, 1, 1, 2, 1, 1, 1, 1, 0], [8, 2, 1, 1, 12, 2, 16, 1, 1, 2, 8], [0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0], [0, 0, 0, 0, 1, 8, 1, 0, 0, 0, 0]];
level18timer = 20;
level18score = 650;
level19 = [[0, 0, 0, 0, 0, 1, 0, 1, 0, 9, 0], [16, 0, 0, 1, 2, 0, 1, 2, 1, 1, 0], [0, 8, 1, 1, 1, 8, 1, 0, 1, 4, 0], [0, 1, 1, 1, 1, 1, 1, 1, 2, 0, 0], [0, 0, 3, 1, 1, 8, 17, 0, 0, 0, 0], [14, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0]];
level19timer = 20;
level19score = 700;
level20 = [[0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0], [0, 0, 0, 0, 1, 9, 17, 0, 0, 0, 0], [0, 15, 0, 0, 0, 0, 0, 0, 0, 1, 0], [2, 1, 9, 0, 0, 0, 0, 0, 9, 11, 2], [0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0], [0, 0, 0, 0, 13, 8, 1, 0, 0, 0, 0]];
level20timer = 15;
level20score = 200;
level21 = [[0, 1, 1, 1, 1, 3, 1, 1, 1, 1, 0], [1, 1, 4, 1, 1, 1, 1, 1, 1, 1, 1], [1, 9, 1, 2, 1, 1, 1, 1, 1, 8, 1], [1, 1, 1, 1, 1, 4, 1, 1, 1, 1, 1], [4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3], [0, 0, 2, 1, 1, 1, 1, 1, 1, 0, 0]];
level21timer = 25;
level21score = 1000;
level22 = [[0, 0, 0, 1, 1, 0, 0, 1, 12, 0, 0], [0, 8, 2, 0, 1, 9, 1, 0, 0, 8, 12], [16, 0, 0, 2, 1, 0, 0, 1, 2, 0, 0], [0, 1, 1, 9, 0, 2, 1, 0, 9, 1, 1], [8, 15, 0, 1, 1, 0, 0, 2, 1, 0, 0], [0, 0, 8, 0, 0, 14, 8, 0, 0, 0, 0]];
level22timer = 25;
level22score = 800;
level23 = [[0, 8, 3, 2, 3, 9, 3, 2, 3, 2, 0], [3, 2, 3, 2, 8, 2, 3, 8, 3, 2, 8], [3, 2, 8, 2, 3, 8, 3, 2, 3, 2, 3], [3, 8, 3, 2, 3, 3, 3, 2, 3, 8, 3], [3, 2, 3, 2, 8, 2, 3, 2, 3, 2, 3], [0, 0, 8, 2, 3, 8, 3, 2, 8, 0, 0]];
level23timer = 20;
level23score = 1550;
level24 = [[0, 8, 1, 16, 0, 0, 0, 1, 12, 2, 0], [1, 10, 9, 1, 0, 0, 0, 1, 8, 10, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [15, 8, 16, 1, 0, 0, 0, 0, 1, 2, 13], [0, 0, 2, 16, 0, 0, 0, 14, 8, 0, 0]];
level24timer = 20;
level24score = 400;
level25 = [[0, 8, 0, 1, 1, 4, 0, 1, 1, 9, 0], [0, 1, 1, 3, 0, 1, 1, 2, 0, 1, 1], [1, 4, 0, 1, 1, 1, 0, 1, 1, 4, 0], [0, 1, 1, 2, 0, 1, 1, 1, 0, 2, 1], [1, 9, 0, 1, 1, 0, 0, 1, 1, 8, 0], [0, 0, 1, 0, 1, 1, 3, 0, 8, 0, 0]];
level25timer = 15;
level25score = 900;
level26 = [[0, 2, 10, 0, 0, 17, 2, 10, 2, 11, 0], [10, 0, 0, 13, 9, 0, 0, 0, 0, 13, 2], [0, 2, 16, 0, 0, 12, 14, 0, 0, 2, 0], [0, 17, 10, 0, 2, 10, 0, 8, 12, 0, 0], [2, 15, 0, 16, 0, 0, 0, 2, 0, 0, 14], [0, 0, 2, 0, 0, 15, 0, 0, 15, 0, 0]];
level26timer = 15;
level26score = 550;
level27 = [[0, 1, 2, 16, 0, 0, 0, 0, 12, 1, 0], [8, 1, 0, 1, 17, 0, 0, 11, 9, 0, 10], [0, 1, 4, 0, 2, 1, 0, 0, 0, 0, 0], [0, 1, 1, 8, 1, 0, 10, 1, 2, 1, 0], [14, 1, 0, 1, 1, 1, 4, 1, 0, 1, 8], [0, 0, 3, 0, 0, 0, 0, 0, 12, 0, 0]];
level27timer = 10;
level27score = 700;
level28 = [[0, 8, 2, 15, 2, 11, 2, 13, 2, 9, 0], [2, 14, 2, 15, 2, 12, 2, 10, 2, 10, 2], [2, 15, 2, 10, 2, 12, 2, 10, 2, 12, 2], [2, 14, 2, 11, 2, 15, 2, 13, 2, 15, 2], [2, 16, 2, 16, 2, 13, 2, 15, 2, 12, 2], [0, 0, 2, 16, 2, 15, 2, 13, 2, 0, 0]];
level28timer = 10;
level28score = 450;
totalscore = 0;
bonus = 0;
medal = 0;
lvl = 1;
aim = 0;
inform = 1;
music = 2;
step = 5;
stepmax = 5;
minute = 0;
sec = 0;
sec_str = "00";
msec = 0;
score = 0;
need_score = 0;
global_score = 0;
plus = 0;
obj = 0;
fly = 0;
xx = 0;
yy = 0;
ii = 0;
target = 0;
targ = 0;
targ_cur = 0;
targ_cur_last = 0;
targ_true = false;
tar1 = 0;
tar2 = 0;
tar3 = 0;
tar4 = 0;
addscore_count = 0;
fly_count = 0;
tutor_count = 0;
eff_count = 0;
i = 0;
while (i < 6) {
j = 0;
while (j < 11) {
map[j] = 0;
j = j + 1;
}
i = i + 1;
}
i = 0;
while (i < 6) {
j = 0;
while (j < 11) {
if ((j % 2) == 0) {
plus = 0;
} else {
plus = 50;
}
obj = tesla.duplicateMovieClip(("tesla" + i) + j, (j * 10) + i);
obj._x = (plus + 45) + (i * 100);
obj._y = 50 + (j * 38);
obj.posx = i;
obj.posy = j;
obj.stop();
obj._visible = false;
j = j + 1;
}
i = i + 1;
}
loadLevel = function (map) {
inter._visible = true;
inter._xscale = (inter._yscale = 134);
aim = 0;
begin = 0;
step = 5;
stepmax = 5;
score = 0;
record = 0;
combo = 1;
addscore_count = 0;
fly_count = 0;
tutor_count = 0;
eff_count = 0;
combo_count = 0;
minute = 0;
sec = 0;
sec_str = "0:00";
msec = 0;
need_min = Math.floor(_root[("level" + lvl) + "timer"] / 60);
need_sec = _root[("level" + lvl) + "timer"] % 60;
need_str = (need_min + ":") + need_sec;
need_score = _root[("level" + lvl) + "score"];
i = 0;
while (i < 6) {
j = 0;
while (j < 11) {
obj = this[("tesla" + i) + j];
obj.type = map[i][j];
obj.gotoAndStop(obj.type);
obj.ramka.gotoAndStop(1);
if (obj.type == 0) {
obj._visible = false;
} else {
obj._visible = true;
if (inform == 1) {
obj.inform._visible = false;
}
}
if (obj.type == 8) {
aim = aim + 1;
obj.select._visible = false;
}
if (obj.type == 9) {
obj.select._visible = true;
}
j = j + 1;
}
i = i + 1;
}
switch (lvl) {
case 1 :
createTutor(195, 316, 1, "Base", "Click here to start");
createTutor(395, 164, 4, "Nexus", "Finish here");
break;
case 2 :
createTutor(195, 164, 1, "Charger", "+5 energy");
createTutor(33, 435, 2, "Energy Amount", "1 move takes 1 energy unit");
break;
case 3 :
createTutor(135, 460, 2, "Helper", "Click here to show hints");
break;
case 4 :
createTutor(70, 30, 4, "Time record", "Try to finish level in time");
createTutor(574, 30, 3, "Score record", "Speed up to get more scores");
break;
case 6 :
createTutor(195, 164, 1, "Storage", "+5 energy limit");
createTutor(70, 458, 2, "Energy Limit", "Maximum energy stock");
break;
case 7 :
createTutor(195, 164, 1, "Extra Charger", "+10 energy");
break;
case 15 :
createTutor(295, 316, 4, "Launcher", "Transfers light ray");
break;
case 28 :
createTutor(95, 88, 2, "Last Nexus", "But not last record");
}
};
lengthdir_x = function (len, dir) {
return(Math.cos((dir * Math.PI) / 180) * len);
};
lengthdir_y = function (len, dir) {
return((-Math.sin((dir * Math.PI) / 180)) * len);
};
collisionPoint = function (x, y) {
i = 0;
while (i < 6) {
j = 0;
while (j < 11) {
obj = this[("tesla" + i) + j];
if (x > (obj._x - 25)) {
if (x < (obj._x + 25)) {
if (y > (obj._y - 19)) {
if (y < (obj._y + 19)) {
if (target.type == -1) {
if (obj.type < 1) {
obj = undefined;
}
}
return(obj);
}
}
}
}
j = j + 1;
}
i = i + 1;
}
};
createEff = function (x1, y1, x2, y2) {
eff.lineStyle(10, 7208956, 10);
eff.moveTo(x1 - ((x1 - x2) / 5), (y1 - ((y1 - y2) / 5)) - 20);
eff.lineTo(x2 - ((x2 - x1) / 5), (y2 - ((y2 - y1) / 5)) - 20);
eff.lineStyle(6, 12058617, 30);
eff.moveTo(x1 - ((x1 - x2) / 10), (y1 - ((y1 - y2) / 10)) - 20);
eff.lineTo(x2 - ((x2 - x1) / 10), (y2 - ((y2 - y1) / 10)) - 20);
eff.lineStyle(3, 16777215, 60);
eff.moveTo(x1, y1 - 20);
eff.lineTo(x2, y2 - 20);
eff_count++;
obj = eff.attachMovie("eff_bitmap", "eff" + eff_count, eff.getNextHighestDepth());
obj._x = x1;
obj._y = y1 - 20;
obj._rotation = Math.random() * 360;
};
createFly = function (x, y, count) {
i = count;
stepCoord(Math.floor(marker.select._rotation / 45));
xx = xx / count;
yy = yy / count;
while (i--) {
fly_count++;
obj = this.attachMovie("fly", "fly" + fly_count, 11000 + fly_count);
obj._x = x;
obj._y = y;
obj._rotation = Math.random() * 360;
}
};
createStar = function (x, y, w, h, count) {
i = count;
while (i--) {
fly_count++;
obj = this.attachMovie("star", "star" + fly_count, 110000 + fly_count);
obj._x = x + (Math.random() * w);
obj._y = y + (Math.random() * h);
obj.gotoAndPlay(Math.random() * 15);
}
};
createTutor = function (x, y, typ, nam, des) {
tutor_count++;
obj = this.attachMovie("tutor" + typ, "tutor" + tutor_count, 99990 + tutor_count);
obj._x = x;
obj._y = y;
obj.nam = nam;
obj.des = des;
};
addScore = function () {
this["play_laser" + combo].start();
addscore_count = addscore_count + 1;
combo_count = 30;
score = score + (10 * combo);
inter.text_score._yscale = 150;
obj = text_addscore.duplicateMovieClip("text_addscore_" + addscore_count, 10000 + addscore_count);
if ((score >= need_score) and (record == 0)) {
obj.txt.text = String("Record!");
snd_laser.start();
record = 1;
} else {
obj.txt.text = String("+" + (10 * combo));
}
obj._x = target._x;
obj._y = target._y;
if (target.type < 10) {
if (combo < 3) {
combo = combo + 1;
}
}
};
endLevel = function (die) {
if (begin != -1) {
eff.clear();
if (eff_count > 0) {
i = 1;
while (i <= eff_count) {
obj = _root.eff["eff" + i];
obj.removeMovieClip();
i = i + 1;
}
eff_count = 0;
}
if (tutor_count > 0) {
i = 1;
while (i <= tutor_count) {
obj = _root["tutor" + i];
obj.removeMovieClip();
i = i + 1;
}
tutor_count = 0;
}
marker._visible = false;
select._visible = false;
begin = -1;
switch (die) {
case 0 :
win_screen.gotoAndPlay(2);
fly_count = 0;
break;
case 1 :
level_screen.text_level.text = String("Level " + lvl);
level_screen.gotoAndPlay(2);
break;
case 2 :
level_screen.text_level.text = String("Not Enough Energy");
level_screen.gotoAndPlay(3);
play_powerdown.start();
break;
case 3 :
level_screen.text_level.text = String("No Moves Left");
level_screen.gotoAndPlay(3);
play_powerdown.start();
}
}
};
heroPos = function () {
herox = target.posx;
heroy = target.posy;
marker._x = target._x;
marker._y = target._y;
marker.select._visible = false;
};
targetSet = function () {
heroPos();
tar1 = collisionPoint(marker._x + 50, marker._y - 38);
tar2 = collisionPoint(marker._x - 50, marker._y - 38);
tar3 = collisionPoint(marker._x - 50, marker._y + 38);
tar4 = collisionPoint(marker._x + 50, marker._y + 38);
if ((((tar1 == undefined) and (tar2 == undefined)) and (tar3 == undefined)) and (tar4 == undefined)) {
endLevel(3);
}
marker.t1._alpha = (marker.t2._alpha = (marker.t3._alpha = (marker.t4._alpha = 0)));
if (tar1 == undefined) {
marker.t1._visible = false;
} else {
marker.t1._visible = true;
}
if (tar2 == undefined) {
marker.t2._visible = false;
} else {
marker.t2._visible = true;
}
if (tar3 == undefined) {
marker.t3._visible = false;
} else {
marker.t3._visible = true;
}
if (tar4 == undefined) {
marker.t4._visible = false;
} else {
marker.t4._visible = true;
}
};
changeTesla = function () {
marker.effect._xscale = (marker.effect._yscale = 250);
createEff(marker._x, marker._y, target._x, target._y);
addScore();
if (target._currentframe == 8) {
aim = aim - 1;
}
if (aim == 0) {
endLevel(0);
}
step = step - 1;
switch (target._currentframe) {
case 2 :
step = Math.min(stepmax, step + 5);
inter.text_step._yscale = 150;
break;
case 3 :
step = Math.min(stepmax, step + 10);
inter.text_step._yscale = 150;
break;
case 4 :
stepmax = stepmax + 5;
inter.text_stepmax._yscale = 150;
break;
case 9 :
step = stepmax;
inter.text_step._yscale = 150;
}
if (step < 1) {
endLevel(2);
}
eff._alpha = Math.min(120, 70 + (10 * step));
marker.select._alpha = Math.min(120, 70 + (10 * step));
select._alpha = Math.min(120, 90 + (5 * step));
if ((target._currentframe > 9) and (step > 0)) {
stepCoord(target._currentframe - 10);
ii = 0;
if (true) {
ii = ii + 1;
targ = collisionPoint(target._x + (ii * xx), target._y + (ii * yy));
if (targ != undefined) {
if (targ.type != 0) {
if (targ.type < 0) {
endLevel(3);
// unexpected jump
}
createEff(target._x, target._y, targ._x, targ._y);
target.type = -2;
target.gotoAndStop(target._currentframe + 20);
target = targ;
heroPos();
changeTesla();
// unexpected jump
}
// unexpected jump
}
endLevel(3);
}
} else {
target.type = -1;
target.gotoAndStop(target._currentframe + 20);
targetSet();
}
};
onEnterFrame = function () {
if (begin > -1) {
targ_cur = collisionPoint(_root._xmouse, _root._ymouse);
if ((((targ_cur == tar1) or (targ_cur == tar2)) or (targ_cur == tar3)) or (targ_cur == tar4)) {
targ_true = true;
} else {
targ_true = false;
}
if (begin == 0) {
if (targ_cur_last != targ_cur) {
if (targ_cur._currentframe == 9) {
targ_cur.ramka.gotoAndPlay(2);
}
if (targ_cur_last._currentframe == 9) {
targ_cur_last.ramka.gotoAndPlay(12);
}
targ_cur_last = targ_cur;
}
}
if (begin == 1) {
if (targ_true == true) {
if (targ_cur_last != targ_cur) {
targ_cur_last.ramka.gotoAndPlay(12);
targ_cur.ramka.gotoAndPlay(2);
}
targ_cur_last = targ_cur;
}
marker.select._visible = false;
select._visible = false;
if (targ_cur != undefined) {
if (targ_true == true) {
marker.select._xscale = Math.sqrt(Math.pow(marker._x - _xmouse, 2) + Math.pow((marker._y - 20) - _ymouse, 2));
marker.select._rotation = (Math.atan2(_ymouse - (marker._y - 20), _xmouse - marker._x) / Math.PI) * 180;
marker.select._visible = true;
select._visible = true;
select._x = _root._xmouse;
select._y = _root._ymouse;
if ((msec % 5) == 0) {
createFly(_root._xmouse, _root._ymouse, 1);
}
}
}
if (combo_count > 0) {
combo_count = combo_count - 1;
} else {
combo = 1;
}
if (msec == 30) {
msec = 1;
if (sec == 59) {
minute = minute + 1;
sec = 0;
sec_str = "00";
} else {
sec = sec + 1;
if (sec < 10) {
sec_str = (minute + ":0") + sec;
} else {
sec_str = (minute + ":") + sec;
}
}
} else {
msec = msec + 1;
}
}
if (inter._xscale > 100) {
inter._xscale = (inter._yscale = inter._yscale - 2);
}
if (inter.text_step._yscale > 100) {
inter.text_step._yscale = inter.text_step._yscale - 10;
}
if (inter.text_stepmax._yscale > 100) {
inter.text_stepmax._yscale = inter.text_stepmax._yscale - 10;
}
if (inter.text_score._yscale > 100) {
inter.text_score._yscale = inter.text_score._yscale - 10;
}
} else if (inter._xscale < 134) {
inter._xscale = (inter._yscale = inter._yscale + 2);
} else {
inter._visible = false;
}
if (mousePressed == true) {
if (begin == 0) {
target = collisionPoint(_root._xmouse, _root._ymouse);
if (target != undefined) {
if (_root.target._currentframe == 9) {
marker.effect._xscale = (marker.effect._yscale = 250);
target.type = -1;
target.gotoAndStop(target._currentframe + 20);
begin = 1;
addScore();
targetSet();
marker._visible = true;
i = 0;
while (i < 6) {
j = 0;
while (j < 11) {
obj = this[("tesla" + i) + j];
if (obj.type == 8) {
obj.select._visible = true;
}
if (obj.type == 9) {
obj.select._visible = false;
}
j = j + 1;
}
i = i + 1;
}
}
}
} else if (begin == 1) {
target = collisionPoint(_root._xmouse, _root._ymouse);
if (target != undefined) {
if (target.type > 0) {
if ((((target == tar1) || (target == tar2)) || (target == tar3)) || (target == tar4)) {
changeTesla();
}
}
}
}
}
};
onMouseDown = function () {
mousePressed = true;
};
onMouseUp = function () {
mousePressed = false;
};
Symbol 9 MovieClip [tutor4] Frame 1
gotoAndPlay(Math.floor(Math.random() * 10));
Symbol 9 MovieClip [tutor4] Frame 21
name.text = nam;
Symbol 9 MovieClip [tutor4] Frame 29
desc.text = des;
Symbol 9 MovieClip [tutor4] Frame 35
stop();
Symbol 12 MovieClip [tutor3] Frame 1
gotoAndPlay(Math.floor(Math.random() * 10));
Symbol 12 MovieClip [tutor3] Frame 21
name.text = nam;
Symbol 12 MovieClip [tutor3] Frame 29
desc.text = des;
Symbol 12 MovieClip [tutor3] Frame 35
stop();
Symbol 15 MovieClip [tutor2] Frame 1
gotoAndPlay(Math.floor(Math.random() * 10));
Symbol 15 MovieClip [tutor2] Frame 21
name.text = nam;
Symbol 15 MovieClip [tutor2] Frame 29
desc.text = des;
Symbol 15 MovieClip [tutor2] Frame 35
stop();
Symbol 18 MovieClip [tutor1] Frame 1
gotoAndPlay(Math.floor(Math.random() * 10));
Symbol 18 MovieClip [tutor1] Frame 21
name.text = nam;
Symbol 18 MovieClip [tutor1] Frame 29
desc.text = des;
Symbol 18 MovieClip [tutor1] Frame 35
stop();
Symbol 26 Button
on (release) {
if (_root.begin == -2) {
_root.menu_screen.tablo.play();
_root.menu_screen.play();
_root.begin = -1;
_root.menu_type = 0;
_root.lvl = numb;
}
}
Symbol 31 Button
on (release) {
if (_root.begin == -2) {
_root.menu_screen.tablo.play();
_root.menu_screen.play();
_root.begin = -1;
_root.menu_type = 0;
_root.lvl = numb;
}
}
Symbol 35 Button
on (release) {
if (_root.begin == -2) {
_root.menu_screen.tablo.play();
_root.menu_screen.play();
_root.begin = -1;
_root.menu_type = 0;
_root.lvl = numb;
}
}
Symbol 39 MovieClip [star] Frame 1
rot = Math.ceil((Math.random() * 6) - 3);
alp = Math.ceil((Math.random() * 3) + 3);
onEnterFrame = function () {
_y = (_y - (Math.random() * 1));
_rotation = (_rotation + rot);
_alpha = (_alpha - alp);
if (_alpha < 1) {
this.removeMovieClip();
}
};
Symbol 44 MovieClip [fly] Frame 31
this.removeMovieClip();
Symbol 46 MovieClip Frame 1
onEnterFrame = function () {
_rotation = (_rotation + 1);
_yscale = (80 + (Math.random() * 20));
_xscale = (80 + (Math.random() * 20));
};
Symbol 48 MovieClip Frame 1
onEnterFrame = function () {
_alpha = (90 + (Math.random() * 20));
};
Symbol 57 Button
on (rollOver) {
playSound("over");
}
on (release) {
playSound("click");
getURL ("http://armorgames.com/", "_blank");
}
Symbol 67 MovieClip Frame 1
stop();
Symbol 67 MovieClip Frame 11
stop();
Symbol 85 MovieClip Frame 1
onEnterFrame = function () {
if (_alpha < 100) {
_alpha = (_alpha + 10);
}
};
Symbol 136 MovieClip Frame 1
onEnterFrame = function () {
_rotation = (_rotation + 1);
_yscale = (80 + (Math.random() * 40));
_xscale = (80 + (Math.random() * 40));
};
Symbol 138 MovieClip Frame 30
onEnterFrame = function () {
if (_currentframe == 30) {
xx = Math.round(Math.random() * 7);
yy = Math.round(Math.random() * 6);
_x = (45 + (xx * 100));
_y = (50 + (yy * 75.5));
}
};
Symbol 139 MovieClip Frame 1
onEnterFrame = function () {
_rotation = (_rotation + 1);
_alpha = (100 + (Math.random() * 20));
if (_xscale > 125) {
_yscale = (_yscale - 25);
_xscale = (_yscale - 25);
}
};
Symbol 144 MovieClip Frame 20
this.removeMovieClip();
Symbol 163 Button
on (release) {
if (_root.begin > -1) {
_root.endLevel(1);
_root.begin = -1;
}
}
Symbol 170 Button
on (release) {
if (_root.begin > -1) {
_root.menu_screen.gotoAndPlay(2);
_root.begin = -1;
_root.menu_type = 2;
_root.begin_type = 2;
}
}
Symbol 179 Button
on (release) {
if (_root.inform == 2) {
_root.inform = 1;
i = 0;
while (i < 6) {
j = 0;
while (j < 11) {
obj = _root[("tesla" + i) + j];
obj.inform._visible = false;
j = j + 1;
}
i = i + 1;
}
} else {
_root.inform = 2;
i = 0;
while (i < 6) {
j = 0;
while (j < 11) {
obj = _root[("tesla" + i) + j];
obj.inform._visible = true;
j = j + 1;
}
i = i + 1;
}
}
}
Symbol 181 MovieClip Frame 1
onEnterFrame = function () {
gotoAndStop(_root.inform);
};
Symbol 188 Button
on (release) {
if (_root.music == 2) {
_root.music = 1;
new Sound().setVolume(0);
} else {
_root.music = 2;
new Sound().setVolume(100);
}
}
Symbol 189 MovieClip Frame 1
onEnterFrame = function () {
gotoAndStop(_root.music);
};
Symbol 203 MovieClip Frame 1
_visible = false;
stop();
Symbol 203 MovieClip Frame 3
_visible = true;
Symbol 203 MovieClip Frame 30
_root.back.gotoAndStop(1);
_root.loadLevel(_root["level" + _root.lvl]);
Symbol 206 MovieClip Frame 1
onEnterFrame = function () {
_rotation = (_rotation + 1);
_yscale = (250 + (Math.random() * 100));
_xscale = (250 + (Math.random() * 100));
};
Symbol 220 Button
on (release) {
if (_root.begin == -2) {
_root.totalscore = _root.totalscore + (_root.score + _root.bonus);
_root.win_screen.tablo.play();
_root.begin = -1;
_root.win_screen.play();
_root.menu_type = 2;
}
}
Symbol 227 Button
on (release) {
if (_root.begin == -2) {
_root.win_screen.tablo.play();
_root.begin = -1;
_root.win_screen.play();
_root.menu_type = 3;
_root.begin_type = 1;
}
}
Symbol 228 Button
on (release) {
if (_root.begin == -2) {
_root.win_screen.tablo.play();
_root.begin = -1;
_root.win_screen.play();
_root.menu_type = 1;
}
}
Symbol 229 Button
on (release) {
if (_root.begin == -2) {
_root.win_screen.tablo.play();
_root.begin = -1;
_root.win_screen.play();
_root.menu_type = 2;
_root.begin_type = 2;
}
}
Symbol 230 MovieClip Frame 1
stop();
Symbol 260 MovieClip Frame 1
stop();
Symbol 260 MovieClip Frame 2
if (_root.score < _root.need_score) {
text1.rec.gotoAndStop(1);
} else {
text1.rec.gotoAndStop(2);
_root.createStar(320 - (text1.rec._width / 2), 400 + text1._y, text1.rec._width, text1.rec._height, 10);
_root.play_laser1.start();
}
text1.txt.text = _root.score;
Symbol 260 MovieClip Frame 12
_root.bonus = 0;
have = ((_root.minute * 1800) + (_root.sec * 30)) + _root.msec;
need = (_root.need_min * 1800) + (_root.need_sec * 30);
if (have < need) {
_root.bonus = Math.round((need - have) / 5);
}
if (need < have) {
text2.rec.gotoAndStop(1);
} else {
text2.rec.gotoAndStop(2);
_root.createStar(320 - (text2.rec._width / 2), 400 + text2._y, text2.rec._width, text2.rec._height, 10);
_root.play_laser2.start();
}
text2.txt.text = _root.bonus;
Symbol 260 MovieClip Frame 22
_root.medal = (text1.rec._currentframe + text2.rec._currentframe) - 1;
text3.rec.gotoAndStop(_root.medal);
if (_root.medal > 1) {
_root.createStar(320 - (text3.rec._width / 2), 400 + text3._y, text3.rec._width, text3.rec._height, 20);
_root.play_laser3.start();
}
text3.txt.text = (_root.totalscore + _root.score) + _root.bonus;
Symbol 260 MovieClip Frame 27
stop();
Symbol 263 MovieClip Frame 1
_visible = false;
stop();
Symbol 263 MovieClip Frame 2
_visible = true;
Symbol 263 MovieClip Frame 9
_root.back.gotoAndStop(2);
i = 0;
while (i < 6) {
j = 0;
while (j < 11) {
obj = _root[("tesla" + i) + j];
obj._visible = false;
j = j + 1;
}
i = i + 1;
}
marker._visible = false;
select._visible = false;
Symbol 263 MovieClip Frame 10
if (_root.lvl == 28) {
text_win.text = "Game Complete!";
} else {
text_win.text = "Level Complete";
}
Symbol 263 MovieClip Frame 23
if (_root.lvl == 28) {
buttons.gotoAndStop(2);
} else {
buttons.gotoAndStop(1);
}
Symbol 263 MovieClip Frame 43
stop();
tablo.play();
_root.begin = -2;
Symbol 263 MovieClip Frame 60
if (_root.lvl >= _root.my_lvl) {
_root.my_lvl = _root.lvl + 1;
_root.my_so.data.my_lvl = _root.my_lvl;
_root.my_so.flush();
}
if (_root.lvlmedal[_root.lvl] < _root.medal) {
_root.lvlmedal[_root.lvl] = _root.medal;
_root.my_so.data.lvlmedal[_root.lvl] = _root.medal;
_root.my_so.flush();
}
switch (_root.menu_type) {
case 1 :
_root.level_screen.text_level.text = String("Level " + _root.lvl);
_root.level_screen.gotoAndPlay(2);
break;
case 2 :
_root.lvl = _root.lvl + 1;
if (_root.lvl == 29) {
_root.lvl = 1;
_root.menu_screen.gotoAndPlay(2);
} else {
_root.level_screen.text_level.text = String("Level " + _root.lvl);
_root.level_screen.gotoAndPlay(2);
}
break;
case 3 :
_root.menu_screen.gotoAndPlay(2);
}
Symbol 274 Button
on (release) {
if (_root.begin == -2) {
if (_root.menu_type != 2) {
_root.menu_screen.tablo.play();
_root.menu_screen.play();
_root.begin = -1;
_root.menu_type = 2;
}
}
}
Symbol 281 Button
on (release) {
if (_root.begin == -2) {
if (_root.menu_type != 3) {
_root.menu_screen.tablo.play();
_root.menu_screen.play();
_root.begin = -1;
_root.menu_type = 3;
}
}
}
Symbol 295 MovieClip Frame 1
if (_root.menu_type == 2) {
menu_count = 0;
j = 0;
while (j < 4) {
i = 0;
while (i < 7) {
menu_count++;
obj = this.attachMovie("menu_level", "menu_level_" + menu_count, 111000 + menu_count);
obj._x = 15 + (i * 50);
obj._y = 10 + (j * 34);
if (menu_count <= _root.my_lvl) {
obj.numb = menu_count;
if (_root.lvlmedal[menu_count] != undefined) {
obj.gotoAndStop(_root.lvlmedal[menu_count] + 1);
} else {
obj.gotoAndStop(2);
}
} else {
obj.numb = 0;
obj.gotoAndStop(1);
}
obj.stop();
i = i + 1;
}
j = j + 1;
}
}
Symbol 299 MovieClip Frame 1
stop();
Symbol 299 MovieClip Frame 2
switch (_root.menu_type) {
case 1 :
text1._visible = true;
text2._visible = false;
text3._visible = false;
break;
case 2 :
text1._visible = false;
text2._visible = true;
text3._visible = false;
break;
case 3 :
text1._visible = false;
text2._visible = false;
text3._visible = true;
}
Symbol 299 MovieClip Frame 6
stop();
_root.begin = -2;
Symbol 300 MovieClip Frame 1
_visible = false;
stop();
Symbol 300 MovieClip Frame 2
_visible = true;
play();
Symbol 300 MovieClip Frame 9
_root.back.gotoAndStop(2);
_root.eff.clear();
i = 0;
while (i < 6) {
j = 0;
while (j < 11) {
obj = _root[("tesla" + i) + j];
obj._visible = false;
j = j + 1;
}
i = i + 1;
}
if (_root.eff_count > 0) {
i = 1;
while (i <= _root.eff_count) {
obj = _root.eff["eff" + i];
obj.removeMovieClip();
i = i + 1;
}
}
if (_root.tutor_count > 0) {
i = 1;
while (i <= _root.tutor_count) {
obj = _root["tutor" + i];
obj.removeMovieClip();
i = i + 1;
}
}
_root.marker._visible = false;
_root.select._visible = false;
_root.totalscore = 0;
_root.menu_type = 0;
Symbol 300 MovieClip Frame 31
_root.menu_type = _root.begin_type;
if (_root.menu_type == 0) {
stop();
_root.begin = -2;
}
Symbol 300 MovieClip Frame 44
stop();
tablo.play();
Symbol 300 MovieClip Frame 58
if (_root.menu_type > 0) {
this.gotoAndPlay(32);
} else {
_root.level_screen.text_level.text = String("Level " + _root.lvl);
_root.level_screen.gotoAndPlay(2);
}
Symbol 300 MovieClip Frame 70
_root.back.gotoAndStop(1);
_root.loadLevel(_root.lvl);