Frame 1
stop();
this.onEnterFrame = function () {
dataloaded = _root.getBytesLoaded();
gametotalloaded = _root.getBytesTotal();
inballoaded = Math.floor((dataloaded / gametotalloaded) * 100);
pl.txtpersenloaded = inballoaded + " % ...loading";
_root.pl.loadbarx._xscale = Math.floor(inballoaded);
grapersenloaded_mc.gotoAndStop(Math.floor(inballoaded / 10));
if (dataloaded == gametotalloaded) {
nextFrame();
delete this.onEnterFrame;
}
};
Frame 2
play();
Frame 75
fscommand ("allowscale", false);
fscommand ("showmenu", false);
Frame 76
function music(ch) {
if (lastmusic != ch) {
lastmusic = ch;
MusicPack[0].stop();
MusicPack[1].stop();
MusicPack[2].stop();
MusicPack[3].stop();
MusicPack[4].stop();
MusicPack[5].stop();
MusicPack[6].stop();
if (ch == 0) {
MusicPack[0].start(0.05, 9999999);
} else if (ch == 1) {
MusicPack[1].start(0.05, 9999999);
} else if (ch == 2) {
MusicPack[2].start(0.05, 9999999);
} else if (ch == 3) {
MusicPack[3].start(0.05, 9999999);
} else if (ch == 4) {
MusicPack[4].start(0.05, 9999999);
} else if (ch == 5) {
MusicPack[5].start(0.05, 9999999);
} else if (ch == 6) {
MusicPack[6].start(0.05, 9999999);
}
}
}
var SoundPack = new Array();
Music0 = new Sound();
Music0.attachSound("Sound0");
SoundPack.push(Music0);
var MusicPack = new Array();
Music0 = new Sound();
Music0.attachSound("Music0");
MusicPack.push(Music0);
Music0 = new Sound();
Music0.attachSound("Music1");
MusicPack.push(Music0);
Music0 = new Sound();
Music0.attachSound("Music2");
MusicPack.push(Music0);
Music0 = new Sound();
Music0.attachSound("Music3");
MusicPack.push(Music0);
Music0 = new Sound();
Music0.attachSound("Music4");
MusicPack.push(Music0);
Music0 = new Sound();
Music0.attachSound("Music5");
MusicPack.push(Music0);
Music0 = new Sound();
Music0.attachSound("Music6");
MusicPack.push(Music0);
Music0 = new Sound();
Music0.attachSound("Music7");
MusicPack.push(Music0);
var lastmusic = -1;
Frame 77
_root.attachMovie("intro", "intro", 1);
intro._x = 0;
intro._y = 0;
stop();
Frame 78
function buildMap(map) {
_root.attachMovie("empty", "tiles", 1);
_root.attachMovie("bar", "bar", 2);
game.clip = _root.tiles;
var _local8 = map[0].length;
var _local9 = map.length;
var _local4 = 0;
while (_local4 < _local9) {
var _local3 = 0;
while (_local3 < _local8) {
var _local5 = (("t_" + _local4) + "_") + _local3;
game[_local5] = new game["Tile" + map[_local4][_local3]]();
game.clip.attachMovie("tile", _local5, (_local4 * 100) + (_local3 * 2));
game.clip[_local5]._x = _local3 * game.tileW;
game.clip[_local5]._y = _local4 * game.tileH;
game.clip[_local5]._xscale = (100 * game.tileW) / 30;
game.clip[_local5]._yscale = (100 * game.tileH) / 30;
game.clip[_local5].gotoAndStop(game[_local5].frame);
if (game[_local5].backnext == -1) {
var _local7 = game.clip.attachMovie("door", "door1", 100001);
_local7._x = _local3 * game.tileW;
_local7._y = _local4 * game.tileH;
_local7.gotoAndStop(1);
if (game[_local5].dir == -1) {
_local7.nextFrame();
}
} else if (game[_local5].backnext == 1) {
var _local7 = game.clip.attachMovie("door", "door2", 100000);
_local7._x = _local3 * game.tileW;
_local7._y = _local4 * game.tileH;
_local7.gotoAndStop(3);
if (game[_local5].dir == -1) {
_local7.nextFrame();
}
}
if (game.currentMap != 10) {
bossstat.isDead = true;
} else if (((game.currentMap == 10) and (_local4 == bossstat.ytile)) and (_local3 == bossstat.xtile)) {
music(1);
var _local6 = game.clip.attachMovie("boss", game.currentMap + _local5, enemystat.depth + 10002);
enemystat.depth++;
_local6.width = _local6._width / 2;
_local6.height = _local6._height / 2;
_local6.x = (_local3 * game.tileW) + (game.tileW / 2);
_local6.y = ((_local4 + 1) * game.tileH) - _local6.height;
_local6._x = _local6.x;
_local6._y = _local6.y;
_local6.dir = 1;
_local6._m = game.currentMap;
_local6._i = _local4;
_local6._j = _local3;
_local6.speed = enemystat.speed;
bossstat.clip = _local6;
bossstat.isDead = false;
}
if (map[_local4][_local3] == 1) {
var _local6 = game.clip.attachMovie("dindingx", ("i" + game.currentMap) + _local5, enemystat.depth + 10002);
enemystat.depth++;
_local6.width = _local6._width / 2;
_local6.height = _local6._height / 2;
_local6.x = (_local3 * game.tileW) + (game.tileW / 2);
_local6.y = ((_local4 + 1) * game.tileH) - _local6.height;
_local6._x = _local6.x;
_local6._y = _local6.y;
}
if (map[_local4][_local3] == 2) {
found = false;
found2 = false;
for (k in enemiesAll) {
if ((((enemiesAll[k][0] == game.currentMap) and (enemiesAll[k][1] == _local4)) and (enemiesAll[k][2] == _local3)) and (enemiesAll[k][3] == 1)) {
found = true;
break;
}
if ((((enemiesAll[k][0] == game.currentMap) and (enemiesAll[k][1] == _local4)) and (enemiesAll[k][2] == _local3)) and (enemiesAll[k][3] == 0)) {
found2 = true;
break;
}
}
if (!found) {
if (!found2) {
qwe = enemyMaps[game.currentMap][int(Math.random() * enemyMaps[game.currentMap].length)];
enemiesAll.push([game.currentMap, _local4, _local3, 0, qwe]);
} else {
qwe = enemiesAll[k][4];
}
var _local6 = game.clip.attachMovie("enemy" + qwe, game.currentMap + _local5, enemystat.depth + 10002);
enemystat.depth++;
_local6.width = _local6._width / 4;
_local6.height = _local6._height / 2;
_local6.x = (_local3 * game.tileW) + (game.tileW / 2);
_local6.y = ((_local4 + 1) * game.tileH) - _local6.height;
_local6._x = _local6.x;
_local6._y = _local6.y;
_local6.dir = 1;
_local6._m = game.currentMap;
_local6._i = _local4;
_local6._j = _local3;
_local6.health = 1;
_local6.speed = enemystat.speed;
_local6.onEnterFrame = function () {
if (this.health > 0) {
if (this.hitTest(_root.char.clip)) {
this._alpha = 50;
} else {
this._alpha = 100;
}
} else {
if (this._currentframe < 40) {
this.gotoAndPlay(40);
}
this._alpha = this._alpha - 2;
}
};
enemies.push(_local6);
}
} else if (map[_local4][_local3] == 3) {
found = false;
found2 = false;
for (k in itemsAll) {
if ((((itemsAll[k][0] == game.currentMap) and (itemsAll[k][1] == _local4)) and (itemsAll[k][2] == _local3)) and (itemsAll[k][3] == 1)) {
found = true;
break;
}
if ((((itemsAll[k][0] == game.currentMap) and (itemsAll[k][1] == _local4)) and (itemsAll[k][2] == _local3)) and (itemsAll[k][3] == 0)) {
found2 = true;
break;
}
}
if (!found) {
if (!found2) {
itemsAll.push([game.currentMap, _local4, _local3, 0]);
}
var _local6 = game.clip.attachMovie("key", ("i" + game.currentMap) + _local5, enemystat.depth + 10002);
enemystat.depth++;
_local6.isKey = true;
_local6.width = _local6._width / 2;
_local6.height = _local6._height / 2;
_local6.x = (_local3 * game.tileW) + (game.tileW / 2);
_local6.y = ((_local4 + 1) * game.tileH) - _local6.height;
_local6._x = _local6.x;
_local6._y = _local6.y;
_local6.dir = 1;
_local6._m = game.currentMap;
_local6._i = _local4;
_local6._j = _local3;
_local6.speed = enemystat.speed;
Items.push(_local6);
}
} else if (map[_local4][_local3] == 4) {
found = false;
found2 = false;
for (k in itemsAll) {
if ((((itemsAll[k][0] == game.currentMap) and (itemsAll[k][1] == _local4)) and (itemsAll[k][2] == _local3)) and (itemsAll[k][3] == 1)) {
found = true;
break;
}
if ((((itemsAll[k][0] == game.currentMap) and (itemsAll[k][1] == _local4)) and (itemsAll[k][2] == _local3)) and (itemsAll[k][3] == 0)) {
found2 = true;
break;
}
}
if (!found) {
if (!found2) {
itemsAll.push([game.currentMap, _local4, _local3, 0]);
}
var _local6 = game.clip.attachMovie("item", ("i" + game.currentMap) + _local5, enemystat.depth + 10002);
enemystat.depth++;
_local6.width = _local6._width / 2;
_local6.height = _local6._height / 2;
_local6.x = (_local3 * game.tileW) + (game.tileW / 2);
_local6.y = ((_local4 + 1) * game.tileH) - _local6.height;
_local6._x = _local6.x;
_local6._y = _local6.y;
_local6.dir = 1;
_local6._m = game.currentMap;
_local6._i = _local4;
_local6._j = _local3;
_local6.speed = enemystat.speed;
Items.push(_local6);
}
} else if (map[_local4][_local3] == 6) {
var _local6 = game.clip.attachMovie("trap", ("i" + game.currentMap) + _local5, enemystat.depth + 10002);
enemystat.depth++;
_local6.width = _local6._width / 2;
_local6.height = _local6._height / 2;
_local6.x = (_local3 * game.tileW) + (game.tileW / 2);
_local6.y = ((_local4 + 1) * game.tileH) - _local6.height;
_local6._x = _local6.x;
_local6._y = _local6.y;
_local6.health = enemyhealth;
_local6.onEnterFrame = function () {
if (this.hitTest(_root.char.clip)) {
this.play();
if ((char.gotHit <= 0) and (this._currentframe == 10)) {
_root.char.health = _root.char.health - 5;
_root.char.gotHit = hitlength;
}
}
if (this.health > 0) {
if (this.hitTest(_root.char.clip)) {
this._alpha = 50;
} else {
this._alpha = 100;
}
} else {
if (this._currentframe < 40) {
this.gotoAndPlay(40);
}
this._alpha = this._alpha - 2;
}
};
enemies.push(_local6);
}
_local3++;
}
_local4++;
}
map = game.clip.attachMovie("map" + game.currentMap, _local5, 9999);
map._xscale = 50;
map._yscale = 50;
if ((((((((game.currentMap == 1) or (game.currentMap == 2)) or (game.currentMap == 3)) or (game.currentMap == 4)) or (game.currentMap == 5)) or (game.currentMap == 9)) or (game.currentMap == 10)) or (game.currentMap == 11)) {
map = game.clip.attachMovie(("map" + game.currentMap) + "b", _local5, 100002);
map._x = 380;
map._y = 50;
map._xscale = 50;
map._yscale = 50;
game.foreclip = map;
}
game.clip.attachMovie("char", "char", 10000);
char.clip = game.clip.char;
char.width = char.clip._width / 2;
char.height = char.clip._height / 2;
char.x = (char.xtile * game.tileW) + (game.tileW / 2);
char.y = ((char.ytile + 1) * game.tileH) - char.height;
char.clip._x = char.x;
char.clip._y = char.y;
char.gotHit = 0;
char.clip.gotoAndStop(char.frame);
}
function changeMap(ob) {
var _local6 = (("t_" + ob.ytile) + "_") + ob.xtile;
if (game.currentMap != game[_local6].newMap) {
if (changeMapLock[game.currentMap] == 1) {
var _local7 = _root.attachMovie("dooropen", "door", 3);
_local7.onEnterFrame = function () {
if (this._currentframe >= 60) {
this.removeMovieClip();
}
};
game.movieDelay = 60;
game.currentMap = game[_local6].newMap;
ob.ytile = game[_local6].newchary;
ob.xtile = game[_local6].newcharx;
ob.frame = ob.clip._currentframe;
var _local3 = towers.length - 1;
while (_local3 >= 0) {
var _local4 = towers[_local3];
_local4.removeMovieClip();
towers.splice(_local3, 1);
_local3--;
}
_local3 = enemies.length - 1;
while (_local3 >= 0) {
var _local4 = enemies[_local3];
_local4.removeMovieClip();
enemies.splice(_local3, 1);
_local3--;
}
_local3 = bulets.length - 1;
while (_local3 >= 0) {
var _local4 = bulets[_local3];
_local4.removeMovieClip();
bulets.splice(_local3, 1);
_local3--;
}
enemystat.depth = 10;
if (game.currentMap == 10) {
game.movieDelay = 144;
}
buildMap(_root["myMap" + game.currentMap]);
if (game.currentMap == 11) {
_root.attachMovie("end", "end", 2);
}
} else {
ob.x = ((ob.xtile - ob.curdir) * game.tileW) + ob.width;
var _local7 = _root.attachMovie("doorclose", "door", 3);
_local7.onEnterFrame = function () {
if (this._currentframe >= 60) {
this.removeMovieClip();
}
};
game.movieDelay = 60;
}
} else {
char.x = (game[_local6].newcharx * game.tileW) + (game.tileW / 2);
char.y = ((game[_local6].newchary + 1) * game.tileH) - char.height;
char.clip._x = char.x;
char.clip._y = char.y;
}
}
function getMyCorners(x, y, ob) {
ob.downY = Math.floor(((y + ob.height) - 1) / game.tileH);
ob.upY = Math.floor((y - ob.height) / game.tileH);
ob.leftX = Math.floor((x - ob.width) / game.tileW);
ob.rightX = Math.floor(((x + ob.width) - 1) / game.tileW);
ob.upleft = game[(("t_" + ob.upY) + "_") + ob.leftX].walkable;
ob.downleft = game[(("t_" + ob.downY) + "_") + ob.leftX].walkable;
ob.upright = game[(("t_" + ob.upY) + "_") + ob.rightX].walkable;
ob.downright = game[(("t_" + ob.downY) + "_") + ob.rightX].walkable;
}
function moveChar(ob, dirx, diry, jump) {
if (Math.abs(jump) == 1) {
speed = ob.jumpspeed * jump;
} else {
speed = ob.speed;
}
getMyCorners(ob.x, ob.y + (speed * diry), ob);
if (diry == -1) {
if (ob.upleft and ob.upright) {
ob.y = ob.y + (speed * diry);
} else {
ob.y = (ob.ytile * game.tileH) + ob.height;
ob.jumpspeed = 0;
}
}
if (diry == 1) {
if (ob.downleft and ob.downright) {
ob.y = ob.y + (speed * diry);
} else {
ob.y = ((ob.ytile + 1) * game.tileH) - ob.height;
ob.jump = false;
}
}
getMyCorners(ob.x + (speed * dirx), ob.y, ob);
if (dirx == -1) {
if (ob.downleft and ob.upleft) {
ob.x = ob.x + (speed * dirx);
fall(ob);
} else if (Math.abs(jump) == 0) {
ob.x = (ob.xtile * game.tileW) + ob.width;
}
}
if (dirx == 1) {
if (ob.upright and ob.downright) {
ob.x = ob.x + (speed * dirx);
fall(ob);
} else if (Math.abs(jump) == 0) {
ob.x = ((ob.xtile + 1) * game.tileW) - ob.width;
}
}
ob.clip._x = ob.x;
ob.clip._y = ob.y;
if ((!ob.jump) or (!(((((dirx + (diry * 4)) + 6) + ob.curdir) == 4) or ((((dirx + (diry * 4)) + 6) + ob.curdir) == 8)))) {
ob.clip.gotoAndStop(((dirx + (diry * 4)) + 6) + ob.curdir);
}
ob.xtile = Math.floor(ob.clip._x / game.tileW);
ob.ytile = Math.floor(ob.clip._y / game.tileH);
if (game[(("t_" + ob.ytile) + "_") + ob.xtile].door and (ob == _root.char)) {
changeMap(ob);
}
return(true);
}
function jump(ob) {
ob.jumpspeed = ob.jumpspeed + ob.gravity;
if (ob.jumpspeed > (game.tileH - char.height)) {
ob.jumpspeed = game.tileH - char.height;
}
if (ob.jumpspeed < 0) {
moveChar(ob, 0, -1, -1);
} else if (ob.jumpspeed > 0) {
moveChar(ob, 0, 1, 1);
}
return(true);
}
function fall(ob) {
if (!ob.jump) {
getMyCorners(ob.x, ob.y + 1, ob);
if (ob.downleft and ob.downright) {
ob.jumpspeed = 0;
ob.jump = true;
}
}
}
function bulletMove(bullet1) {
endpath = false;
if (bullet1.dir == 1) {
dirx = 1;
} else {
dirx = -1;
}
getMyCorners(bullet1.x + (_root.bulet.speed * dirx), bullet1.y, bullet1);
if (dirx == -1) {
if (bullet1.downleft and bullet1.upleft) {
bullet1.x = bullet1.x + (_root.bulet.speed * dirx);
} else {
bullet1.x = (bullet1.xtile * game.tileW) + bullet1.width;
endpath = true;
}
}
if (dirx == 1) {
if (bullet1.upright and bullet1.downright) {
bullet1.x = bullet1.x + (_root.bulet.speed * dirx);
} else {
bullet1.x = ((bullet1.xtile + 1) * game.tileW) - ob.width;
endpath = true;
}
}
bullet1._x = bullet1.x;
bullet1._y = bullet1.y;
var _local4 = enemies.length - 1;
while (_local4 >= 0) {
var _local5 = enemies[_local4];
if ((_local5.health > 0) and _local5.hitTest(bullet1)) {
endpath = true;
_local5.health--;
_local5.filters = [myColorMatrix_filter];
SoundPack[0].start();
}
_local4--;
}
_local4 = towers.length - 1;
while (_local4 >= 0) {
var _local5 = towers[_local4];
if ((_local5.health > 0) and _local5.hitTest(bullet1)) {
endpath = true;
_local5.health--;
_local5.filters = [myColorMatrix_filter];
SoundPack[0].start();
}
_local4--;
}
if (bossstat.clip != undefined) {
if (bossstat.clip.hitTest(bullet1)) {
endpath = true;
bossstat.clip.filters = [myColorMatrix_filter];
bossstat.health--;
if (bossstat.health <= 0) {
bossstat.isDead = true;
bossstat.clip.gotoAndStop(4);
_local4 = towers.length - 1;
while (_local4 >= 0) {
var _local5 = towers[_local4];
_local5.health = 0;
_local4--;
}
if (enemyBulets.length > 0) {
var _local2 = enemyBulets.length - 1;
while (_local2 >= 0) {
enemyBulets[_local2].removeMovieClip();
enemyBulets.splice(_local2, 1);
_local2--;
}
}
}
}
}
if (endpath) {
bullet1.removeMovieClip();
}
return(endpath);
}
function enemyBulletMove(bulletH) {
var _local3 = _root.char;
endpath = false;
dx = Math.sin((bulletH.sudut * Math.PI) / 180);
if (isNaN(dx)) {
dx = 1;
}
dy = Math.cos((bulletH.sudut * Math.PI) / 180);
if (isNaN(dy)) {
dy = 1;
}
bulletH._x = bulletH._x - (bulletH.speed * dx);
bulletH._y = bulletH._y + (bulletH.speed * dy);
if ((char.gotHit <= 0) and _local3.clip.hitTest(bulletH)) {
_local3.health = _local3.health - bulletH.power;
_local3.gotHit = hitlength;
bulletH.removeMovieClip();
endpath = true;
}
yy = Math.floor(((bulletH._y - _local3.height) + 30) / game.tileH);
xx = Math.floor((((bulletH._x + _local3.width) - 1) - 15) / game.tileW);
if (!game[(("t_" + yy) + "_") + xx].walkable) {
bulletH.removeMovieClip();
endpath = true;
}
return(endpath);
}
function bossMove() {
bossstat.clip.filters = [];
if (bossstat.clip._x < 640) {
bossstat.clip._x = 640;
}
if (bossstat.clip._x > 1000) {
bossstat.clip._x = 1000;
}
shotnow = false;
if (((!_root.char.jump) and (Math.abs(bossstat.clip._x - _root.char.x) > 66)) and (bossstat.clip._currentframe != 3)) {
shotnow = Math.random() > 0.5;
}
if (bossstat.clip.hitTest(_root.char.clip)) {
bossstat.clip.gotoAndStop(3);
} else if ((((bossstat.shotdelay < 12) and (bossstat.clip._currentframe != 3)) and (!shotnow)) and ((bossstat.clip._x - _root.char.x) > 0)) {
bossstat.clip._x = bossstat.clip._x - 2;
bossstat.clip.gotoAndStop(2);
} else if ((((bossstat.shotdelay < 12) and (bossstat.clip._currentframe != 3)) and (!shotnow)) and ((bossstat.clip._x - _root.char.x) < 0)) {
bossstat.clip._x = bossstat.clip._x + 2;
bossstat.clip.gotoAndStop(2);
}
if ((bossstat.clip._x - _root.char.x) > 0) {
bossstat.clip._xscale = 100;
} else {
bossstat.clip._xscale = -100;
}
if (bossstat.shotdelay > 0) {
bossstat.shotdelay--;
}
if (bossstat.shotdelay > 12) {
bossstat.clip.body.stop();
} else {
bossstat.clip.body.play();
}
if (shotnow and (bossstat.shotdelay <= 0)) {
bossstat.shotdelay = 24;
var _local3 = game.clip.attachMovie("bulletboss", "eb" + enemystat.depth, enemystat.depth + 10002);
enemystat.depth++;
_local3.filters = [glow];
_local3._delay = 20;
_local3._alpha = 50;
_local3.onEnterFrame = function () {
if (this._delay > 10) {
this._alpha = this._alpha + 15;
}
this._alpha = this._alpha - 10;
this._delay = this._delay - 1;
if (this._delay <= 0) {
this.removeMovieClip();
}
};
dx = bossstat.clip._x - _root.char.x;
dy = bossstat.clip._y - _root.char.y;
distance = Math.sqrt((dx * dx) + (dy * dy));
angle = Math.acos(dy / distance);
if (dx < 0) {
_local3.sudut = ((angle * 180) / Math.PI) + 180;
} else {
_local3.sudut = 180 - ((angle * 180) / Math.PI);
}
_local3._x = bossstat.clip._x + 20;
_local3._y = bossstat.clip._y - 10;
_local3.speed = 10;
_local3.power = 10;
enemyBulets.push(_local3);
}
}
function enemyMove(enemy) {
enemy.filters = [];
del = false;
if (enemy.health > 0) {
if (enemy.dir == 1) {
dirx = 1;
} else {
dirx = -1;
}
getMyCorners(enemy.x + (enemy.speed * dirx), enemy.y, enemy);
if (dirx == -1) {
if (enemy.downleft and enemy.upleft) {
getMyCorners(enemy.x, enemy.y + 1, enemy);
if (enemy.downleft and (!enemy.downright)) {
enemy.dir = -enemy.dir;
enemy.x = enemy.x - (enemy.speed * dirx);
} else {
enemy.x = enemy.x + (enemy.speed * dirx);
}
} else {
enemy.dir = -enemy.dir;
}
} else if (dirx == 1) {
if (enemy.upright and enemy.downright) {
getMyCorners(enemy.x, enemy.y + 1, enemy);
if ((!enemy.downleft) and enemy.downright) {
enemy.dir = -enemy.dir;
enemy.x = enemy.x - (enemy.speed * dirx);
} else {
enemy.x = enemy.x + (enemy.speed * dirx);
}
} else {
enemy.dir = -enemy.dir;
}
}
enemy._xscale = enemy.dir * 100;
enemy._x = enemy.x;
enemy._y = enemy.y;
if ((_root.char.gotHit <= 0) and enemy.hitTest(_root.char.clip)) {
_root.char.gotHit = hitlength;
_root.char.health = _root.char.health - 10;
}
} else {
for (k in enemiesAll) {
if ((((enemiesAll[k][0] == enemy._m) and (enemiesAll[k][1] == enemy._i)) and (enemiesAll[k][2] == enemy._j)) and (enemiesAll[k][3] == 0)) {
enemiesAll[k][3] = 1;
break;
}
}
if (enemy._alpha <= 0) {
enemy.removeMovieClip();
del = true;
}
}
return(del);
}
function detectKeys() {
var _local3 = _root.char;
if (Key.isDown(9)) {
if (game.clip._xscale > 50) {
game.clip._xscale = 50;
}
if (game.clip._yscale > 50) {
game.clip._yscale = 50;
}
} else if (game.currentMap != 99) {
if (game.clip._xscale < 200) {
game.clip._xscale = 200;
}
if (game.clip._yscale < 200) {
game.clip._yscale = 200;
}
}
if (game.clip._xscale == 200) {
game.clip.x = (Stage.width / 2) - (_local3.clip._x * ((game.clip._xscale / 100) - 0));
game.clip.y = (Stage.height / 2) - (_local3.clip._y * ((game.clip._yscale / 100) - 0));
game.clip._x = game.clip.x;
game.clip._y = game.clip.y;
} else {
game.clip._x = (-_local3.clip._x) * ((game.clip._xscale / 100) - 1);
game.clip._y = (-_local3.clip._y) * ((game.clip._yscale / 100) - 1);
}
if (game.clip._x > 0) {
game.clip._x = 0;
}
if (game.clip._y > 0) {
game.clip._y = 0;
}
if (game.clip._x < -1880) {
game.clip._x = -1880;
}
if (game.clip._y < -1200) {
game.clip._y = -1200;
}
if (game.currentMap <= 9) {
game.foreclip._x = (Stage.width / 2) + (game.clip._x / 4);
}
if (((_local3.health > 0) and (game.currentMap == 10)) and (game.movieDelay > 0)) {
game.clip._x = ((game.clip._x + (22 * game.tileW)) * ((game.movieDelay - 72) / 40)) - (22 * game.tileW);
game.clip._y = ((game.clip._y + (14 * game.tileH)) * ((game.movieDelay - 72) / 40)) - (14 * game.tileH);
if (game.movieDelay < 72) {
game.clip._x = -(22 * game.tileW);
game.clip._y = -(14 * game.tileH);
}
}
game.movieDelay--;
if (game.movieDelay == 1) {
if (game.currentMap == 10) {
} else {
music(int((game.currentMap + 1) / 2));
}
}
if (_local3.health <= 0) {
game.movieDelay = 1;
}
if (game.movieDelay <= 0) {
if (_local3.gotHit > 0) {
_local3.gotHit--;
_local3.clip._visible = ((_local3.gotHit % 4) == 0) or ((_local3.gotHit % 4) == 1);
}
var _local8 = false;
if (((char.shotDelay == 0) and (!isSpace)) and Key.isDown(32)) {
var _local7 = game.clip.attachMovie("prana", "bullet1" + enemystat.depth, enemystat.depth + 10002);
enemystat.depth++;
_local7.x = _local3.x + 7;
_local7.y = _local3.y - 15;
_local7.width = _local7._width / 2;
_local7.height = _local7._height / 2;
_local7.dir = _local3.curdir;
if (_local7.dir < 0) {
_local7._xscale = -100;
}
bulets.push(_local7);
isSpace = true;
nyawat = 0;
char.shotDelay = 5;
} else if (!Key.isDown(32)) {
isSpace = false;
}
if (char.shotDelay > 0) {
char.shotDelay--;
}
if (nyawat < 60) {
nyawat++;
}
if (Items.length > 0) {
var _local5 = Items.length - 1;
while (_local5 >= 0) {
var _local2 = Items[_local5];
if (Items[_local5].hitTest(_local3.clip)) {
for (k in itemsAll) {
if ((((itemsAll[k][0] == _local2._m) and (itemsAll[k][1] == _local2._i)) and (itemsAll[k][2] == _local2._j)) and (itemsAll[k][3] == 0)) {
itemsAll[k][3] = 1;
break;
}
}
if (_local2.isKey) {
changeMapLock[game.currentMap] = 1;
} else {
_local3.health = _local3.health + 2;
}
_local2._alpha = _local2._alpha - 2;
_local2.removeMovieClip();
Items.splice(_local5, 1);
}
_local5--;
}
}
if ((typeof(bossstat.clip) == "movieclip") and (!bossstat.isDead)) {
bossMove();
}
if ((bossstat.clip._currentframe == 4) and (bossstat.clip.body._currentframe >= 60)) {
music(0);
bossstat.clip.removeMovieClip();
_local3 = _root.char;
_local3.ytile = _local3.ytile;
_local3.xtile = _local3.xtile;
_local3.frame = _local3.clip._currentframe;
var _local5 = enemies.length - 1;
while (_local5 >= 0) {
var _local6 = enemies[_local5];
_local6.removeMovieClip();
enemies.splice(_local5, 1);
_local5--;
}
_local5 = bulets.length - 1;
while (_local5 >= 0) {
var _local6 = bulets[_local5];
_local6.removeMovieClip();
bulets.splice(_local5, 1);
_local5--;
}
enemystat.depth = 1;
}
if (enemies.length > 0) {
var _local5 = enemies.length - 1;
while (_local5 >= 0) {
if (enemyMove(enemies[_local5])) {
enemies.splice(_local5, 1);
}
_local5--;
}
}
if (enemyBulets.length > 0) {
var _local4 = enemyBulets.length - 1;
while (_local4 >= 0) {
if (enemyBulletMove(enemyBulets[_local4])) {
enemyBulets.splice(_local4, 1);
}
_local4--;
}
}
if (bulets.length > 0) {
var _local5 = bulets.length - 1;
while (_local5 >= 0) {
if (bulletMove(bulets[_local5])) {
bulets.splice(_local5, 1);
}
_local5--;
}
}
if ((Key.isDown(38) and (!_local3.jump)) and (!isUp)) {
_local3.jump = true;
_local3.jumpspeed = _local3.jumpstart;
isUp = true;
upPower = 0;
} else if (!Key.isDown(38)) {
isUp = false;
}
upPower++;
if ((isUp and (upPower < 20)) and (_local3.jumpspeed < 0)) {
_local3.jumpspeed = -6.3;
}
if (char.speed > 4) {
char.speed = char.speed * 0.96;
}
if (char.speed < 4) {
char.speed = 4;
}
if (dashDelay > 0) {
dashDelay--;
}
if (Key.isDown(39)) {
if ((((!_local3.jump) and (dashDelay > 18)) and (dashDelay < 22)) and (_local3.curdir == 1)) {
char.speed = 12;
}
_local8 = _root.moveChar(_local3, 1, 0);
_local3.curdir = 1;
} else if (Key.isDown(37)) {
if ((((!_local3.jump) and (dashDelay > 18)) and (dashDelay < 22)) and (_local3.curdir == -1)) {
char.speed = 12;
}
_local8 = _root.moveChar(_local3, -1, 0);
_local3.curdir = -1;
}
}
if (_local3.jump) {
var _local8 = _root.jump(_local3);
}
if (nyawat < 10) {
if (_local3.health <= 0) {
_local3.clip.gotoAndStop(16);
music(-1);
var _local5 = bulets.length - 1;
while (_local5 >= 0) {
var _local6 = bulets[_local5];
_local6.removeMovieClip();
bulets.splice(_local5, 1);
_local5--;
}
} else {
_local3.clip.gotoAndStop(_local3.curdir + 14);
_local3.clip.mc.gotoAndPlay(nyawat);
}
} else if (!_local8) {
if (_local3.health <= 0) {
_local3.clip.gotoAndStop(16);
music(-1);
var _local5 = bulets.length - 1;
while (_local5 >= 0) {
var _local6 = bulets[_local5];
_local6.removeMovieClip();
bulets.splice(_local5, 1);
_local5--;
}
} else {
_local3.clip.gotoAndStop(_local3.curdir + 6);
}
} else {
_local3.clip.char.play();
}
if (Key.isDown(36)) {
_local3.health = _local3.health + 25;
}
if (_local3.health > 100) {
_local3.health = 100;
}
_root.bar.healthbar._xscale = _local3.health;
_root.bar.staminabar._xscale = ((12 - _local3.shotDelay) * 100) / 12;
if (_root.bar.healthbar._xscale < 0) {
_root.bar.healthbar._xscale = 0;
}
if (_root.bar.healthbar._xscale > 100) {
_root.bar.healthbar._xscale = 100;
}
if (_root.bar.staminabar._xscale < 0) {
_root.bar.staminabar._xscale = 0;
}
if (_root.bar.staminabar._xscale > 100) {
_root.bar.staminabar._xscale = 100;
}
}
fscommand ("allowscale", false);
fscommand ("showmenu", false);
stopAllSounds();
music(1);
enemyhealth = 1;
var glow = (new flash.filters.GlowFilter(16776960, 1, 50, 50, 1));
var myElements_array = [1, 0, 0, 0, 100, 0, 1, 0, 0, 100, 0, 0, 1, 0, 100, 0, 0, 0, 1, 0];
var myColorMatrix_filter = (new flash.filters.ColorMatrixFilter(myElements_array));
var hitlength = 48;
myMap1 = [[4, 0, 33, 1, 34, 0, 4, 6, 4, 4, 4, 0, 0, 6, 0, 6, 4, 2, 4, 4, 4], [0, 0, 1, 1, 1, 0, 0, 1, 1, 4, 4, 4, 4, 4, 4, 4, 4, 1, 1, 1, 1], [1, 0, 0, 6, 1, 0, 0, 0, 6, 1, 1, 1, 4, 4, 4, 4, 4, 2, 0, 0, 6], [1, 1, 1, 0, 1, 1, 1, 1, 0, 0, 4, 6, 4, 4, 0, 0, 0, 1, 1, 4, 4], [4, 6, 0, 2, 1, 0, 0, 0, 0, 0, 0, 2, 1, 2, 0, 2, 0, 2, 0, 1, 1], [4, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 36], [4, 1, 1, 1, 4, 0, 0, 0, 2, 0, 35, 1, 4, 1, 0, 0, 0, 0, 2, 0, 4], [0, 0, 0, 4, 0, 0, 0, 1, 1, 1, 1, 1, 4, 1, 2, 0, 4, 1, 1, 1, 1], [1, 1, 0, 1, 1, 1, 0, 0, 4, 1, 1, 1, 3, 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 2, 2, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]];
changeMapLock = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
enemyMaps = [[0], [1, 3, 9], [1, 3, 9], [11, 14], [11, 14], [8], [4, 5, 6, 7], [12], [12], [1, 3, 9], [1, 3, 9]];
game = {tileW:60, tileH:60, currentMap:1, movieDelay:2};
game.Tile0 = function () {
};
game.Tile0.prototype.walkable = true;
game.Tile0.prototype.frame = 1;
game.Tile1 = function () {
};
game.Tile1.prototype.walkable = false;
game.Tile1.prototype.frame = 2;
game.Tile2 = function () {
};
game.Tile2.prototype.walkable = true;
game.Tile2.prototype.frame = 1;
game.Tile3 = function () {
};
game.Tile3.prototype.walkable = true;
game.Tile3.prototype.frame = 1;
game.Tile4 = function () {
};
game.Tile4.prototype.walkable = true;
game.Tile4.prototype.frame = 1;
game.Tile6 = function () {
};
game.Tile6.prototype.walkable = true;
game.Tile6.prototype.frame = 1;
game.Doors = function (newmap, newcharx, newchary, backnext, dir) {
this.newMap = newmap;
this.newcharx = newcharx;
this.newchary = newchary;
this.backnext = backnext;
this.dir = dir;
};
game.Doors.prototype.walkable = true;
game.Doors.prototype.frame = 1;
game.Doors.prototype.door = true;
game.Tile10 = function () {
};
game.Tile10.prototype = new game.Doors(2, 8, 12, 1, 1);
game.Tile11 = function () {
};
game.Tile11.prototype = new game.Doors(1, 21, 12, -1, -1);
game.Tile12 = function () {
};
game.Tile12.prototype = new game.Doors(2, 18, 12, 0, -1);
game.Tile13 = function () {
};
game.Tile13.prototype = new game.Doors(2, 5, 6, 0, -1);
game.Tile14 = function () {
};
game.Tile14.prototype = new game.Doors(2, 2, 4, 0, 1);
game.Tile15 = function () {
};
game.Tile15.prototype = new game.Doors(2, 19, 10, 0, 1);
game.Tile16 = function () {
};
game.Tile16.prototype = new game.Doors(10, 19, 5, 1, -1);
game.Tile17 = function () {
};
game.Tile17.prototype = new game.Doors(11, 8, 2, 0, 1);
game.Tile18 = function () {
};
game.Tile18.prototype = new game.Doors(4, 4, 0, 0, -1);
game.Tile19 = function () {
};
game.Tile19.prototype = new game.Doors(4, 8, 0, 0, 1);
game.Tile20 = function () {
};
game.Tile20.prototype = new game.Doors(5, 9, 0, 1, -1);
game.Tile21 = function () {
};
game.Tile21.prototype = new game.Doors(4, 1, 0, -1, 1);
game.Tile22 = function () {
};
game.Tile22.prototype = new game.Doors(6, 9, 0, 1, -1);
game.Tile23 = function () {
};
game.Tile23.prototype = new game.Doors(5, 1, 0, -1, 1);
game.Tile24 = function () {
};
game.Tile24.prototype = new game.Doors(7, 1, 1, 1, 1);
game.Tile25 = function () {
};
game.Tile25.prototype = new game.Doors(6, 9, 6, -1, -1);
game.Tile26 = function () {
};
game.Tile26.prototype = new game.Doors(8, 1, 0, 1, 1);
game.Tile27 = function () {
};
game.Tile27.prototype = new game.Doors(7, 9, 0, -1, -1);
game.Tile28 = function () {
};
game.Tile28.prototype = new game.Doors(9, 1, 6, 1, 1);
game.Tile29 = function () {
};
game.Tile29.prototype = new game.Doors(8, 9, 6, -1, -1);
game.Tile30 = function () {
};
game.Tile30.prototype = new game.Doors(10, 1, 0, 1, 1);
game.Tile31 = function () {
};
game.Tile31.prototype = new game.Doors(9, 9, 0, -1, -1);
game.Tile32 = function () {
};
game.Tile32.prototype = new game.Doors(99, 5, 6);
game.Tile33 = function () {
};
game.Tile33.prototype = new game.Doors(1, 5, 0, 0, 1);
game.Tile34 = function () {
};
game.Tile34.prototype = new game.Doors(1, 1, 0, 0, -1);
game.Tile35 = function () {
};
game.Tile35.prototype = new game.Doors(1, 20, 6, 0, -1);
game.Tile36 = function () {
};
game.Tile36.prototype = new game.Doors(1, 9, 6, 0, -1);
char = {health:50, curdir:1, xtile:2, ytile:12, speed:12, jumpstart:-10, gravity:0.25, jump:false, shotDelay:0, gotHit:0};
towersAll = new Array();
towers = new Array();
bulet = {xtile:2, ytile:1, speed:10, player:true};
bulets = new Array();
enemyBulets = new Array();
enemies = new Array();
enemiesAll = new Array();
itemsAll = new Array();
Items = new Array();
enemystat = {curdir:1, xtile:2, ytile:1, speed:4, jumpstart:-18, gravity:2, jump:false, depth:10};
bossstat = {isDead:true, shotdelay:36, health:50, curdir:1, xtile:12, ytile:7, speed:8, jumpstart:-18, gravity:2, jump:false};
buildMap(_root["myMap" + game.currentMap]);
fall(_root.char);
stop();
Instance of Symbol 270 MovieClip [empty] "controller" in Frame 78
onClipEvent (enterFrame) {
_root.detectKeys();
}
Symbol 7 MovieClip [fakewall] Frame 1
stop();
Symbol 7 MovieClip [fakewall] Frame 40
play();
Symbol 7 MovieClip [fakewall] Frame 45
stop();
Symbol 46 MovieClip Frame 15
stop();
Symbol 49 MovieClip [key] Frame 15
stop();
Symbol 57 MovieClip [item] Frame 15
stop();
Symbol 58 MovieClip Frame 15
stop();
Symbol 78 MovieClip Frame 20
if (_parent.hitTest(_root.char.clip)) {
_root.char.gotHit = 48;
_root.char.health = _root.char.health - 20;
}
Symbol 78 MovieClip Frame 28
_parent.gotoAndStop(1);
Symbol 102 MovieClip Frame 30
stop();
Symbol 109 MovieClip Frame 61
stop();
Symbol 110 MovieClip [boss] Frame 1
stop();
Symbol 119 MovieClip [enemy9] Frame 30
gotoAndPlay (1);
Symbol 119 MovieClip [enemy9] Frame 69
stop();
Symbol 135 MovieClip [enemy3] Frame 12
gotoAndPlay (1);
Symbol 135 MovieClip [enemy3] Frame 60
stop();
Symbol 139 MovieClip [enemy1] Frame 11
gotoAndPlay (1);
Symbol 139 MovieClip [enemy1] Frame 75
stop();
Symbol 158 MovieClip [trap] Frame 1
stop();
Symbol 158 MovieClip [trap] Frame 39
gotoAndPlay (1);
Symbol 158 MovieClip [trap] Frame 60
stop();
Symbol 173 MovieClip [prana] Frame 2
stop();
Symbol 195 MovieClip Frame 16
gotoAndPlay (3);
Symbol 197 MovieClip Frame 35
gotoAndPlay (2);
Symbol 203 MovieClip Frame 73
stop();
_root["myMap" + game.currentMap].removeMovieClip();
_root.attachMovie("EndDead", "EndDead", 2);
Symbol 212 Button
on (release) {
_root.gotoAndPlay("MainGame");
}
Symbol 216 Button
on (release) {
_root.gotoAndPlay("intro");
}
Symbol 219 Button
on (release) {
_root.gotoAndPlay("intro");
}
Symbol 220 MovieClip [End2] Frame 198
stop();
Symbol 228 Button
on (release) {
getURL ("http://www.dailyfreegames.com/free-games.html", "_blank");
}
Symbol 230 Button
on (release) {
getURL ("http://www.dailyfreegames.com", "_blank");
}
Symbol 232 Button
on (release) {
getURL ("http://www.itsnotbadatall.com/freegames.html", "_blank");
}
Symbol 236 Button
on (release) {
gotoAndPlay ("instructions");
}
Symbol 237 Button
on (release) {
_root.gotoAndPlay("main");
}
Symbol 238 Button
on (release) {
getURL ("http://www.itsnotbadatall.com/", "_blank");
}
Symbol 240 Button
on (release) {
this.gotoAndPlay(1);
}
Symbol 241 MovieClip [intro] Frame 1
stopAllSounds();
Symbol 241 MovieClip [intro] Frame 30
stop();
Symbol 241 MovieClip [intro] Frame 31
play();
Symbol 241 MovieClip [intro] Frame 44
stop();
stop();
Symbol 246 Button
on (release) {
_root.gotoAndPlay("intro");
this.removeMovieClip();
}
Symbol 247 MovieClip [EndDead] Frame 22
stop();
Symbol 253 MovieClip Frame 23
stop();
Symbol 255 MovieClip [end] Frame 208
stop();
Symbol 264 MovieClip Frame 33
stop();
Symbol 277 MovieClip Frame 1
stop();
Symbol 277 MovieClip Frame 2
stop();
Symbol 277 MovieClip Frame 3
stop();
Symbol 277 MovieClip Frame 4
stop();
Symbol 277 MovieClip Frame 5
stop();