Frame 1
var vidas = 4;
var start = 1;
var x = 2;
var y = 1;
var points = 0;
var dificultad = 0;
fscommand ("allowscale", "false");
fscommand ("showmenu", "false");
stop();
Instance of Symbol 128 MovieClip [empty] in Frame 1
onClipEvent (enterFrame) {
_root.barra._xscale = A;
A = (_root.getBytesLoaded() / _root.getBytesTotal()) * 100;
_root.porcentaje = ("Completado: " + Math.round(A)) + "%";
if (_parent.getBytesTotal() == _parent.getBytesLoaded()) {
_root.gotoAndPlay("inicio");
}
}
Frame 2
function buildMap(map) {
_root.attachMovie("empty", "tiles", 2);
_root.attachMovie("fondo", "fondo", 0);
game.fondo = _root.fondo;
game.fondo._x = game.tileW;
game.fondo._y = 0;
game.clip = _root.tiles;
game.mapWidth = map[0].length;
game.mapHeight = map.length;
game.mapW = map[0].length * game.tileW;
var i = 0;
while (i < game.mapHeight) {
var j = 0;
while (j < game.mapWidth) {
var name = ((("t_" + i) + "_") + j);
game[name] = new game["Tile" + map[i][j]]();
game.clip.attachMovie("tile", name, (i * 100) + (j * 2));
game.clip[name]._x = j * game.tileW;
game.clip[name]._y = i * game.tileH;
game.clip[name].gotoAndStop(game[name].frame);
j++;
}
i++;
}
var doors = myDoors[game.currentMap];
var i = 0;
while (i < doors.length) {
var name = ((("t_" + doors[i][0]) + "_") + doors[i][1]);
game[name].nextMap = doors[i][2];
game[name].nextY = doors[i][3];
game[name].nextX = doors[i][4];
i++;
}
game.auxY = myStart[game.currentMap][0];
game.auxX = myStart[game.currentMap][1];
game.openName = (("t_" + myOpen[game.currentMap][0]) + "_") + myOpen[game.currentMap][1];
if (_root.dificultad == 0) {
var enemies = myEnemies[game.currentMap];
}
if (_root.dificultad == 1) {
var enemies = myEnemies2[game.currentMap];
}
game.currentEnemies = enemies.length;
var i = 0;
while (i < game.currentEnemies) {
var name = ("enemy" + i);
game[name] = new game["Enemyp" + enemies[i][0]]();
if (game[name].brain == 3) {
game.clip.attachMovie("enemy" + enemies[i][0], name, 1);
} else {
game.clip.attachMovie("enemy" + enemies[i][0], name, 11001 + i);
}
game[name].clip = game.clip[name];
game[name].xtile = enemies[i][1];
game[name].ytile = enemies[i][2];
game[name].startx = enemies[i][1];
game[name].starty = enemies[i][2];
game[name].width = game.clip[name]._width / 2;
game[name].height = game.clip[name]._height / 2;
game[name].x = (game[name].xtile * game.tileW) + (game.tileW / 2);
game[name].y = ((game[name].ytile + 1) * game.tileH) - game[name].height;
game[name].clip._x = game[name].x;
game[name].clip._y = game[name].y;
i++;
}
game.movingtiles = myMovingTiles[game.currentMap];
var i = 0;
while (i < game.movingtiles.length) {
var name = ("movingtile" + i);
game[name] = new game["MovingTile" + game.movingtiles[i][0]]();
game.clip.attachMovie("movingtiles", name, 12001 + i);
game[name].clip = game.clip[name];
game[name].clip.gotoAndStop(game.movingtiles[i][0]);
game[name].xtile = game.movingtiles[i][1];
game[name].ytile = game.movingtiles[i][2];
game[name].x = (game[name].xtile * game.tileW) + (game.tileW / 2);
game[name].y = (game[name].ytile * game.tileH) + (game.tileH / 2);
game[name].clip._x = game[name].x;
game[name].clip._y = game[name].y;
game[name].minx = game[name].minx + game[name].xtile;
game[name].maxx = game[name].maxx + game[name].xtile;
game[name].miny = game[name].miny + game[name].ytile;
game[name].maxy = game[name].maxy + game[name].ytile;
i++;
}
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.tileW) - char.height;
char.clip._x = char.x;
char.clip._y = char.y;
char.clip.gotoAndStop(8);
if (_root.dificultad == 0) {
game.items = myItems[game.currentMap];
}
if (_root.dificultad == 1) {
game.items = myItems2[game.currentMap];
}
var i = 0;
while (i < game.items.length) {
var name = ((("item" + game.items[i][2]) + "_") + game.items[i][1]);
game[name] = new game["Itemp" + game.items[i][0]]();
game[name].position = i;
game.clip.attachMovie("items", name, 10001 + i);
game[name].clip = game.clip[name];
game[name].clip._x = (game.items[i][1] * game.tileW) + (game.tileW / 2);
game[name].clip._y = (game.items[i][2] * game.tileH) + (game.tileH / 2);
game[name].clip.gotoAndStop(game.items[i][0]);
i++;
}
_root.variable = game.currentMap;
_root.vidas = game.vidas;
}
function changeMap(ob) {
var tempitems = [];
var i = 0;
while (i < game.items.length) {
var name = ((("item" + game.items[i][2]) + "_") + game.items[i][1]);
delete game[name];
if (game.items[i]) {
tempitems.push(game.items[i]);
}
i++;
}
if (_root.dificultad == 0) {
myItems[game.currentMap] = tempitems;
}
if (_root.dificultad == 1) {
myItems2[game.currentMap] = tempitems;
}
var name = ((("t_" + ob.ytile) + "_") + ob.xtile);
game.currentMap = game[name].nextMap;
ob.ytile = game[name].nextY;
ob.xtile = game[name].nextX;
ob.frame = ob.clip._currentframe;
buildMap(_root["myMap" + game.currentMap]);
fall(ob);
}
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) + 1) / 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, fspeed) {
if (Math.abs(jump) == 1) {
speed = ob.jumpspeed * jump;
} else {
speed = fspeed;
}
ob.lasty = ob.y;
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) and (!checkMovingTiles(speed * diry))) {
ob.y = ob.y + (speed * diry);
} else {
ob.jump = false;
if (ob.onMovingTile) {
ob.y = (ob.onMovingTile.y - ob.onMovingTile.height) - ob.height;
} else {
ob.y = ((ob.ytile + 1) * game.tileH) - ob.height;
}
}
}
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 {
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 {
ob.x = ((ob.xtile + 1) * game.tileW) - ob.width;
}
}
updateChar(ob, dirx, diry);
return(true);
}
function updateChar(ob, dirx, diry) {
ob.clip._x = ob.x;
ob.clip._y = ob.y;
if (dirx or diry) {
if (dirx == -1) {
ob.clip.gotoAndStop(1);
ob.lastface = "izq";
}
if (dirx == 1) {
ob.clip.gotoAndStop(2);
ob.lastface = "der";
}
if (diry == -1) {
if (ob.lastface == "izq") {
ob.clip.gotoAndStop(3);
} else {
ob.clip.gotoAndStop(4);
}
}
if (diry == 1) {
if (ob.lastface == "izq") {
ob.clip.gotoAndStop(5);
} else {
ob.clip.gotoAndStop(6);
}
}
}
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);
}
if (game[(("t_" + ob.ytile) + "_") + ob.xtile].end and (ob == _root.char)) {
removeMovieClip(_root.char.clip);
game.clip.attachMovie("char_anim", "char_anim", 10000);
game.clip.char_anim._x = ob.x;
game.clip.char_anim._y = ob.y;
}
if (game.clip[game.openName].puerta.open) {
game[game.openName.position] = 0;
game[game.openName].walkable = true;
}
var itemname = game[(("item" + ob.ytile) + "_") + ob.xtile];
if (itemname and (ob == _root.char)) {
_root.points = _root.points + itemname.points;
removeMovieClip(itemname.clip);
if (itemname.key) {
puerta.start();
game.clip[game.openName].jose.play();
game[game.openName.position] = 0;
game[game.openName].walkable = true;
} else if (itemname.light) {
luz.start();
game.fondo.play();
var i = 0;
while (i < game.mapHeight) {
var j = 0;
while (j < game.mapWidth) {
var name = ((("t_" + i) + "_") + j);
if (game[name].night) {
game.clip[name].anim.play();
}
j++;
}
i++;
}
} else {
game.items[itemname.position] = 0;
puntos.start();
}
delete game[(("item" + ob.ytile) + "_") + ob.xtile];
}
if (ob.ytile == (game.mapHeight - 1)) {
lose();
}
}
function moveEnemy(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);
fallEnemy(ob);
} else {
ob.x = (ob.xtile * game.tileW) + ob.width;
}
}
if (dirx == 1) {
if (ob.upright and ob.downright) {
ob.x = ob.x + (speed * dirx);
fallEnemy(ob);
} else {
ob.x = ((ob.xtile + 1) * game.tileW) - ob.width;
}
}
ob.clip._x = ob.x;
ob.clip._y = ob.y;
ob.clip.gotoAndStop((dirx + (diry * 2)) + 3);
ob.xtile = Math.floor(ob.clip._x / game.tileW);
ob.ytile = Math.floor(ob.clip._y / game.tileH);
return(true);
}
function lose() {
_root.vidas--;
moo.start();
removeMovieClip(_root.char.clip);
if (_root.char.lastface == "izq") {
game.clip.attachMovie("char_die_left", "char_die", 10000);
} else {
game.clip.attachMovie("char_die_right", "char_die", 10000);
}
game.clip.char_die._x = char.x;
game.clip.char_die._y = char.y;
delete char;
}
function ComprobarVidas() {
if (_root.vidas == 0) {
_root.s.stop();
gameover = new Sound();
gameover.attachSound("gameover");
gameover.start();
removeMovieClip(_root.tiles);
removeMovieClip(_root.fondo);
_root.gotoAndPlay("gameover");
} else {
_root.s.stop();
_root.y = _root.game.auxY;
_root.x = _root.game.auxX;
_root.start = _root.game.currentMap;
removeMovieClip(_root.tiles);
removeMovieClip(_root.fondo);
_root.gotoAndStop("vidamenos");
}
}
function enemyBrain() {
var i = 0;
while (i < game.currentEnemies) {
var name = ("enemy" + i);
var ob = game[name];
var flag = true;
if (ob.brain == 0) {
getMyCorners(ob.x + (ob.speed * ob.xMove), ob.y + (ob.speed * ob.yMove), ob);
if (ob.downleft and ob.downright) {
fallEnemy(ob);
moveEnemy(ob, ob.xMove, 0, 0, ob.speed);
_root.jumpEnemy(ob);
} else {
var distan = (_root.char.x - ob.x);
var balance = ((distan * 100) / (game.mapW - 150));
var volumen = (100 - Math.abs(balance / 2));
gota.setPan(balance);
gota.setVolume(volumen);
gota.start();
ob.ytile = ob.starty;
moveEnemy(ob, ob.xMove, ob.yMove, 0, ob.speed);
}
}
if (ob.brain == 1) {
getMyCorners(ob.x + (ob.speed * ob.xMove), (ob.y + (ob.speed * ob.yMove)) + 1, ob);
if ((!ob.downleft) and (!ob.downright)) {
if (random(150) == 5) {
ob.xMove = -ob.xMove;
ob.yMove = -ob.yMove;
}
if (random(200) == 10) {
ob.timer = 1;
}
if (ob.timer == 0) {
moveEnemy(ob, ob.xMove, ob.yMove, 0, ob.speed);
} else {
ob.timer++;
}
if (ob.timer == 40) {
ob.timer = 0;
}
} else {
ob.xMove = -ob.xMove;
ob.yMove = -ob.yMove;
}
}
if (ob.brain == 2) {
fallEnemy(ob);
getMyCorners(ob.x + (ob.speed * ob.xMove), ob.y + (ob.speed * ob.yMove), ob);
if (((!ob.upleft) and (!ob.downleft)) or ((!ob.upright) and (!ob.downright))) {
ob.xMove = -ob.xMove;
}
moveEnemy(ob, ob.xMove, 0, 0, ob.speed);
if (!ob.jump) {
ob.jump = true;
ob.jumpspeed = ob.jumpstart;
}
if (ob.jump) {
_root.jumpEnemy(ob);
}
}
if (ob.brain == 3) {
ob.y = ob.y + (ob.speed * ob.yMove);
ob.pincho = ob.pincho + ob.speed;
if (ob.pincho > (ob.height + (ob.height / 2))) {
ob.yMove = -ob.yMove;
ob.pincho = 0;
}
ob.clip._x = ob.x;
ob.clip._y = ob.y;
var uno = Math.abs(char.x - ob.x);
var dos = Math.abs(char.y - ob.y);
if ((uno < (char.width + ob.width)) and (dos < (char.heigth + ob.height))) {
lose();
}
}
if (ob.brain == 4) {
getMyCorners(ob.x + (ob.speed * ob.xMove), ob.y + (ob.speed * ob.yMove), ob);
if ((!ob.downleft) and (!ob.downright)) {
ob.yMove = -ob.yMove;
golpe.start();
if (ob.acelerar) {
ob.speed++;
}
if (ob.decelerar) {
ob.speed--;
}
}
if ((!ob.upleft) and (!ob.upright)) {
ob.yMove = -ob.yMove;
golpe.start();
if (ob.acelerar) {
ob.speed++;
}
if (ob.decelerar) {
ob.speed--;
}
}
if ((!ob.upright) and (!ob.downright)) {
ob.xMove = -ob.xMove;
golpe.start();
if (ob.acelerar) {
ob.speed++;
}
if (ob.decelerar) {
ob.speed--;
}
}
if ((!ob.upleft) and (!ob.downleft)) {
ob.xMove = -ob.xMove;
golpe.start();
if (ob.acelerar) {
ob.speed++;
}
if (ob.decelerar) {
ob.speed--;
}
}
if (_root.dificultad == 0) {
if (ob.speed > 8) {
ob.acelerar = false;
}
}
if (_root.dificultad == 1) {
if (ob.speed > 3) {
ob.acelerar = false;
}
}
if (ob.timer > 300) {
ob.decelerar = true;
}
if (ob.speed < 4) {
ob.decelerar = false;
}
if (!ob.stop) {
ob.timer++;
}
moveEnemy(ob, ob.xMove, ob.yMove, 0, ob.speed);
}
if (ob.brain == 5) {
var distancia = (_root.char.clip._x - ob.clip._x);
if (distancia > 2) {
ob.xMove = 1;
} else if (distancia < -2) {
ob.xMove = -1;
} else {
ob.xMove = 0;
}
moveEnemy(ob, ob.xMove, ob.yMove);
getMyCorners(ob.x + (ob.speed * ob.xMove), ob.y + (ob.speed * ob.yMove), ob);
if (((((!ob.downleft) and (!ob.downright)) or ((!ob.upleft) and (!ob.upright))) or (ob.ytile == (game.mapHeight - 2))) or (random(70) == 5)) {
ob.yMove = -ob.yMove;
}
}
if (ob.brain == 6) {
getMyCorners(ob.x + (ob.Speed * ob.xMove), ob.y + (ob.Speed * ob.yMove), ob);
ob.y = ob.y + (ob.Speed * ob.yMove);
ob.clip._y = ob.y;
if (((!ob.downleft) and (!ob.downright)) or ((!ob.upleft) and (!ob.upright))) {
ob.yMove = -ob.yMove;
}
}
if (ob.brain == 7) {
getMyCorners(ob.x + (ob.Speed * ob.xMove), ob.y + (ob.Speed * ob.yMove), ob);
ob.x = ob.x + (ob.Speed * ob.xMove);
ob.clip._x = ob.x;
if (((!ob.downleft) and (!ob.upleft)) or ((!ob.downright) and (!ob.upright))) {
ob.xMove = -ob.xMove;
}
}
var xdist = (ob.x - char.x);
var ydist = (ob.y - char.y);
if (Math.sqrt((xdist * xdist) + (ydist * ydist)) < (ob.width + char.width)) {
lose();
}
i++;
}
}
function jump(ob) {
ob.jumpspeed = ob.jumpspeed + ob.gravity;
if (ob.jumpspeed > (game.tileH / 1.5)) {
ob.jumpspeed = game.tileH / 1.5;
}
if (ob.jumpspeed < 0) {
moveChar(ob, 0, -1, -1);
} else if (ob.jumpspeed > 0) {
moveChar(ob, 0, 1, 1);
}
}
function fall(ob) {
if (!ob.jump) {
getMyCorners(ob.x, ob.y + 1, ob);
if ((ob.downleft and ob.downright) and (!checkMovingTiles(1))) {
ob.onMovingTile = false;
ob.jumpspeed = 0;
ob.jump = true;
}
}
}
function fallEnemy(ob) {
if (!ob.jump) {
getMyCorners(ob.x, ob.y + 1, ob);
if (ob.downleft and ob.downright) {
ob.jumpspeed = 0;
ob.jump = true;
}
}
}
function jumpEnemy(ob) {
ob.jumpspeed = ob.jumpspeed + ob.gravity;
if (ob.jumpspeed > (game.tileH / 1.5)) {
ob.jumpspeed = game.tileH / 1.5;
}
if (ob.jumpspeed < 0) {
moveEnemy(ob, 0, -1, -1);
} else if (ob.jumpspeed > 0) {
moveEnemy(ob, 0, 1, 1);
}
}
function checkMovingTiles(y) {
var heroymax = ((char.y + char.height) + y);
var heroxmax = (char.x + char.width);
var heroxmin = (char.x - char.width);
foundit = false;
var i = 0;
while (i < game.movingtiles.length) {
var ob = game["movingtile" + i];
if (char.diry != -1) {
var tileymax = (ob.y + ob.height);
var tileymin = (ob.y - ob.height);
var tilexmax = (ob.x + ob.width);
var tilexmin = (ob.x - ob.width);
if ((char.lasty + char.height) <= tileymin) {
if ((heroymax <= tileymax) and (heroymax >= tileymin)) {
if ((heroxmax > tilexmin) and (heroxmax < tilexmax)) {
char.onMovingTile = ob;
foundit = true;
break;
}
if ((heroxmin > tilexmin) and (heroxmin < tilexmax)) {
char.onMovingTile = ob;
foundit = true;
break;
}
}
}
}
i++;
}
return(foundit);
}
function moveTiles() {
var i = 0;
while (i < game.movingtiles.length) {
var ob = game["movingtile" + i];
getMyCorners(ob.x + (ob.speed * ob.dirx), ob.y + (ob.speed * ob.diry), ob);
if ((ob.miny > ob.upY) or (ob.maxy < ob.downY)) {
ob.diry = -ob.diry;
}
if ((ob.minx > ob.leftX) or (ob.maxx < ob.rightX)) {
ob.dirx = -ob.dirx;
}
ob.x = ob.x + (ob.speed * ob.dirx);
ob.y = ob.y + (ob.speed * ob.diry);
ob.xtile = Math.floor(ob.x / game.tileW);
ob.ytile = Math.floor(ob.y / game.tileH);
ob.clip._x = ob.x;
ob.clip._y = ob.y;
if (ob.diry == -1) {
checkMovingTiles(0);
}
i++;
}
if (char.onMovingTile) {
getMyCorners(char.x, char.y + (char.onMovingTile.speed * char.onMovingTile.diry), char);
if (char.onMovingTile.diry == -1) {
if (char.upleft and char.upright) {
char.y = (char.onMovingTile.y - char.onMovingTile.height) - char.height;
} else {
char.y = (char.ytile * game.tileH) + char.height;
char.jumpspeed = 0;
char.jump = true;
char.onMovingTile = false;
}
}
if (char.onMovingTile.diry == 1) {
if (char.downleft and char.downright) {
char.y = (char.onMovingTile.y - char.onMovingTile.height) - char.height;
} else {
char.onMovingTile = false;
char.y = ((char.ytile + 1) * game.tileH) - char.height;
}
}
getMyCorners(char.x + (char.onMovingTile.speed * char.onMovingTile.dirx), char.y, char);
if (char.onMovingTile.dirx == -1) {
if (char.downleft and char.upleft) {
char.x = char.x + (char.onMovingTile.speed * char.onMovingTile.dirx);
} else {
char.x = (char.xtile * game.tileW) + char.width;
fall(char);
}
}
if (char.onMovingTile.dirx == 1) {
if (char.upright and char.downright) {
char.x = char.x + (char.onMovingTile.speed * char.onMovingTile.dirx);
} else {
fall(char);
char.x = ((char.xtile + 1) * game.tileW) - char.width;
}
}
updateChar(char);
}
}
function detectKeys() {
moveTiles();
var ob = _root.char;
var fric = 0.95;
var keyPressed = false;
if ((Key.isDown(32) and (!ob.jump)) and char) {
salto.start();
ob.onMovingTile = false;
ob.jump = true;
ob.jumpspeed = ob.jumpstart;
}
if (Key.isDown(39)) {
keyPressed = _root.moveChar(ob, 1, 0, 0, ob.speed);
frictionright = true;
frictionleft = false;
fspeed = ob.speed;
} else if (Key.isDown(37)) {
keyPressed = _root.moveChar(ob, -1, 0, 0, ob.speed);
frictionleft = true;
frictionright = false;
fspeed = ob.speed;
} else if ((frictionleft or frictionright) and game[(("t_" + (ob.ytile + 1)) + "_") + ob.xtile].snow) {
fspeed = fspeed * fric;
if (frictionleft) {
_root.moveChar(ob, -1, 0, 0, fspeed);
if (fspeed < 0.5) {
frictionleft = false;
}
}
if (frictionright) {
_root.moveChar(ob, 1, 0, 0, fspeed);
if (fspeed < 0.5) {
frictionright = false;
}
}
}
if (ob.jump) {
keyPressed = _root.jump(ob);
}
if (keyPressed or ob.jump) {
ob.clip.char.play();
} else if (ob.lastface == "izq") {
ob.clip.gotoAndStop(7);
} else {
ob.clip.gotoAndStop(8);
}
_root.enemyBrain();
_root.moveBullets();
}
fscommand ("allowscale", false);
salto = new Sound();
salto.attachSound("salto");
golpe = new Sound();
golpe.attachSound("golpe");
puntos = new Sound();
puntos.attachSound("puntos");
puerta = new Sound();
puerta.attachSound("puerta");
moo = new Sound();
moo.attachSound("moo");
luz = new Sound();
luz.attachSound("luz");
gota = new Sound(sonidogota);
gota.attachSound("gota");
var pan = -100;
s = new Sound();
s.attachSound("musica");
s.start(0, 9999);
myDoors = [[0], [[6, 11, 2, 6, 1]], [[6, 0, 1, 6, 10], [6, 11, 3, 6, 1]], [[6, 0, 2, 6, 10], [6, 11, 4, 6, 1]], [[6, 0, 3, 6, 10], [5, 11, 5, 5, 1], [6, 11, 5, 6, 1]], [[5, 0, 4, 5, 10], [6, 0, 4, 6, 10], [1, 11, 6, 1, 1]], [[1, 0, 5, 1, 10], [1, 11, 7, 1, 1], [6, 11, 7, 6, 1]], [[1, 0, 6, 1, 10], [8, 4, 8, 0, 4]], [[6, 11, 9, 6, 1]], [[6, 0, 8, 6, 10], [2, 11, 10, 2, 1], [6, 11, 10, 6, 1]], [[2, 0, 9, 2, 10], [6, 0, 9, 6, 10], [1, 11, 11, 1, 1]], [[1, 0, 10, 1, 10], [8, 2, 12, 0, 2]], [[1, 11, 13, 1, 1]], [[1, 0, 12, 1, 10], [8, 2, 14, 0, 2]]];
myEnemies = [[0], [[1, 4, 1]], [[1, 9, 1], [2, 5, 3]], [[2, 7, 3]], [[8, 2, 2]], [[4, 9, 6], [6, 8, 1]], [[1, 6, 1], [3, 4, 1], [2, 5, 6]], [[9, 8, 5]], [[4, 6, 6], [1, 8, 3]], [], [[1, 3, 4], [10, 9, 6]], [[4, 3, 3], [10, 9, 5], [10, 7, 5], [10, 6, 5], [10, 5, 5], [10, 4, 5]], [[1, 6, 1], [8, 3, 1], [8, 5, 6], [8, 7, 3], [8, 9, 5]], [[11, 4, 6]], [[5, 4, 4]]];
myEnemies2 = [[0], [], [], [], [], [], [], [], [], [], [], [], [[2, 2, 6]], [[12, 4, 6]], [[5, 4, 4]]];
myStart = [[0], [1, 2], [6, 1], [6, 1], [6, 1], [5, 1], [1, 1], [1, 1], [0, 4], [6, 1], [2, 1], [1, 1], [0, 2], [1, 1], [0, 2]];
myOpen = [[0], [6, 8], [], [6, 9], [], [], [], [7, 4], [], [], [6, 5], [], [], [], [6, 9]];
myItems = [[0], [[1, 3, 5], [2, 7, 4]], [[2, 6, 3], [4, 8, 2]], [[1, 9, 1], [2, 2, 2], [2, 2, 1], [2, 9, 4]], [[4, 4, 1], [2, 6, 1], [2, 6, 2], [2, 8, 4]], [[2, 3, 5], [2, 4, 2], [2, 7, 6], [2, 8, 3], [4, 6, 1]], [[4, 10, 6]], [[1, 6, 6], [2, 4, 3], [2, 6, 3], [4, 9, 4]], [[2, 7, 3]], [[3, 2, 6], [4, 10, 6], [4, 10, 5]], [[1, 4, 6], [2, 7, 6], [4, 8, 3]], [[4, 9, 2], [2, 4, 4], [2, 4, 3]], [[2, 2, 6], [2, 4, 6], [2, 6, 6], [2, 8, 6]], [[4, 3, 6], [2, 5, 6], [4, 7, 6], [2, 9, 6]], [[5, 10, 6]]];
myItems2 = [[0], [[1, 3, 5], [2, 7, 4]], [[2, 8, 2]], [[1, 9, 1], [2, 2, 2]], [[2, 4, 1], [2, 8, 4]], [[2, 3, 5], [4, 6, 1]], [[4, 10, 6]], [[1, 6, 6], [2, 4, 3], [2, 6, 3]], [[2, 7, 3]], [[3, 2, 6]], [[1, 4, 6], [2, 7, 6], [4, 8, 3]], [[2, 9, 2], [2, 4, 3]], [], [[4, 3, 6], [2, 9, 6]], [[5, 10, 6]]];
myMovingTiles = [[0], [], [], [], [], [], [], [[1, 8, 7]], [], [], [[2, 6, 7], [3, 9, 3]], [[4, 6, 5], [5, 6, 7]], [[10, 2, 4], [7, 4, 3], [8, 6, 4], [9, 8, 1]], [[6, 6, 7]], []];
myMap1 = [[0, 1, 18, 1, 1, 18, 18, 18, 1, 1, 1, 0], [0, 16, 0, 0, 10, 0, 0, 0, 17, 1, 1, 0], [0, 1, 4, 19, 0, 0, 0, 0, 17, 1, 1, 0], [0, 1, 1, 16, 0, 0, 0, 0, 1, 1, 1, 0], [0, 1, 1, 18, 0, 0, 0, 0, 17, 1, 1, 0], [0, 1, 16, 0, 0, 0, 0, 0, 17, 18, 18, 0], [0, 1, 16, 0, 0, 0, 0, 0, 6, 0, 0, 2], [0, 1, 1, 4, 4, 4, 4, 4, 1, 4, 4, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]];
myMap2 = [[0, 1, 18, 1, 18, 18, 1, 1, 18, 1, 1, 0], [0, 16, 0, 0, 0, 0, 0, 0, 0, 10, 1, 0], [0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0], [0, 16, 0, 0, 0, 0, 0, 0, 21, 0, 17, 0], [0, 16, 0, 0, 21, 21, 21, 0, 0, 0, 17, 0], [0, 1, 21, 0, 0, 0, 0, 0, 0, 0, 17, 0], [2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2], [0, 7, 7, 7, 9, 7, 7, 9, 9, 7, 7, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]];
myMap3 = [[0, 1, 18, 18, 18, 18, 1, 18, 18, 18, 1, 0], [0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0], [0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0], [0, 1, 16, 0, 0, 0, 0, 0, 0, 0, 17, 0], [0, 16, 0, 0, 0, 0, 21, 21, 4, 0, 17, 0], [0, 16, 0, 20, 0, 0, 0, 0, 17, 4, 18, 0], [2, 0, 0, 16, 0, 21, 0, 0, 0, 6, 0, 2], [0, 4, 4, 1, 5, 5, 5, 4, 4, 1, 4, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]];
myMap4 = [[0, 1, 18, 1, 18, 1, 18, 1, 18, 18, 1, 0], [0, 16, 0, 0, 0, 17, 0, 0, 0, 0, 17, 0], [0, 16, 0, 0, 17, 16, 0, 0, 0, 0, 17, 0], [0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0], [0, 1, 16, 0, 0, 8, 7, 8, 0, 0, 17, 0], [0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2], [2, 0, 0, 8, 7, 8, 0, 0, 0, 0, 0, 2], [0, 4, 19, 5, 5, 5, 5, 5, 5, 5, 20, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]];
myMap5 = [[0, 1, 1, 18, 1, 18, 18, 18, 18, 18, 18, 0], [0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2], [0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0], [0, 16, 0, 0, 20, 0, 0, 0, 0, 0, 1, 0], [0, 1, 19, 0, 0, 0, 0, 0, 19, 0, 1, 0], [2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0], [2, 0, 0, 19, 0, 0, 0, 0, 0, 20, 1, 0], [0, 4, 5, 5, 5, 5, 5, 4, 5, 1, 1, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0]];
myMap6 = [[0, 1, 18, 18, 1, 18, 1, 18, 1, 18, 18, 0], [2, 0, 0, 0, 10, 0, 10, 0, 0, 0, 0, 2], [0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 20, 0], [0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0], [0, 16, 0, 0, 0, 0, 0, 0, 0, 20, 1, 0], [0, 16, 0, 0, 0, 0, 0, 0, 20, 1, 1, 0], [0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2], [0, 1, 5, 5, 20, 4, 4, 4, 4, 4, 4, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]];
myMap7 = [[0, 18, 18, 18, 1, 18, 18, 1, 18, 18, 1, 0], [2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0], [0, 4, 21, 4, 21, 21, 4, 21, 0, 0, 1, 0], [0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0], [0, 1, 0, 21, 21, 21, 21, 0, 0, 0, 17, 0], [0, 1, 0, 0, 0, 0, 0, 21, 0, 0, 17, 0], [0, 0, 0, 0, 0, 20, 0, 0, 0, 0, 17, 0], [0, 5, 5, 16, 14, 1, 5, 5, 5, 5, 1, 0], [0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0]];
myMap8 = [[0, 1, 1, 16, 0, 17, 1, 1, 1, 1, 1, 0], [0, 1, 1, 16, 0, 17, 1, 1, 1, 1, 1, 0], [0, 1, 1, 16, 0, 17, 1, 18, 1, 1, 1, 0], [0, 1, 1, 16, 0, 17, 18, 0, 10, 17, 1, 0], [0, 1, 1, 16, 0, 0, 0, 0, 0, 18, 1, 0], [0, 1, 1, 16, 0, 0, 0, 0, 0, 0, 18, 0], [0, 1, 1, 16, 0, 20, 4, 4, 19, 0, 0, 2], [0, 1, 1, 1, 5, 17, 1, 1, 1, 4, 4, 0], [0, 0, 0, 0, 0, 0, 13, 0, 0, 0, 0, 0]];
myMap9 = [[0, 27, 0, 0, 0, 0, 0, 0, 0, 26, 12, 0], [0, 27, 0, 22, 24, 0, 0, 0, 0, 26, 25, 0], [0, 27, 0, 0, 27, 0, 0, 0, 0, 0, 0, 2], [0, 27, 0, 22, 25, 24, 0, 0, 0, 0, 23, 0], [0, 27, 0, 0, 0, 26, 0, 0, 0, 23, 25, 0], [0, 25, 22, 22, 0, 27, 0, 0, 0, 26, 0, 0], [2, 0, 0, 0, 0, 26, 24, 0, 0, 27, 0, 2], [0, 11, 11, 11, 11, 12, 27, 28, 28, 26, 11, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]];
myMap10 = [[0, 1, 18, 18, 1, 18, 18, 18, 18, 18, 18, 0], [0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2], [2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0], [0, 19, 0, 4, 4, 19, 0, 0, 0, 0, 17, 0], [0, 16, 0, 10, 17, 16, 0, 0, 0, 0, 17, 0], [0, 18, 19, 0, 17, 16, 0, 0, 0, 0, 17, 0], [2, 0, 0, 0, 0, 6, 0, 0, 0, 0, 17, 0], [0, 4, 4, 4, 4, 19, 5, 5, 5, 5, 1, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]];
myMap11 = [[0, 18, 18, 18, 18, 18, 18, 18, 1, 18, 1, 0], [2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0], [0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0], [0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0], [0, 1, 4, 19, 0, 0, 0, 0, 0, 0, 1, 0], [0, 1, 18, 18, 0, 0, 0, 0, 0, 0, 17, 0], [0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0], [0, 16, 0, 5, 5, 5, 5, 5, 5, 5, 1, 0], [0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0]];
myMap12 = [[0, 16, 0, 18, 18, 18, 18, 18, 18, 1, 18, 0], [0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2], [0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0], [0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0], [0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0], [0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0], [0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0], [0, 1, 4, 4, 4, 4, 4, 4, 4, 4, 1, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]];
myMap13 = [[0, 18, 18, 18, 1, 18, 18, 18, 1, 18, 1, 0], [2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0], [0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0], [0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0], [0, 16, 0, 20, 21, 21, 21, 21, 19, 0, 17, 0], [0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0], [0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0], [0, 16, 0, 5, 5, 5, 5, 5, 5, 5, 17, 0], [0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0]];
myMap14 = [[0, 16, 0, 18, 1, 18, 18, 18, 18, 1, 1, 0], [0, 16, 0, 0, 0, 0, 0, 0, 0, 17, 1, 0], [0, 16, 0, 0, 0, 0, 0, 0, 0, 17, 1, 0], [0, 16, 0, 0, 0, 0, 0, 0, 0, 17, 1, 0], [0, 1, 0, 0, 0, 0, 0, 0, 0, 17, 1, 0], [0, 16, 0, 0, 0, 0, 0, 0, 0, 17, 1, 0], [0, 16, 0, 0, 0, 0, 0, 0, 0, 29, 0, 15], [0, 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]];
game = {tileW:30, tileH:30, currentMap:_root.start, vidas:_root.vidas};
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 = 3;
game.Tile2.prototype.door = true;
game.Tile3 = function () {
};
game.Tile3.prototype.walkable = false;
game.Tile3.prototype.frame = 4;
game.Tile4 = function () {
};
game.Tile4.prototype.walkable = false;
game.Tile4.prototype.frame = 5;
game.Tile5 = function () {
};
game.Tile5.prototype.walkable = true;
game.Tile5.prototype.frame = 6;
game.Tile6 = function () {
};
game.Tile6.prototype.walkable = false;
game.Tile6.prototype.frame = 7;
game.Tile7 = function () {
};
game.Tile7.prototype.walkable = false;
game.Tile7.prototype.frame = 8;
game.Tile7.prototype.snow = true;
game.Tile8 = function () {
};
game.Tile8.prototype.walkable = true;
game.Tile8.prototype.frame = 9;
game.Tile8.prototype.snow = true;
game.Tile9 = function () {
};
game.Tile9.prototype.walkable = true;
game.Tile9.prototype.frame = 10;
game.Tile9.prototype.snow = true;
game.Tile10 = function () {
};
game.Tile10.prototype.walkable = true;
game.Tile10.prototype.frame = 11;
game.Tile11 = function () {
};
game.Tile11.prototype.walkable = false;
game.Tile11.prototype.frame = 12;
game.Tile11.prototype.night = true;
game.Tile12 = function () {
};
game.Tile12.prototype.walkable = false;
game.Tile12.prototype.frame = 13;
game.Tile12.prototype.night = true;
game.Tile13 = function () {
};
game.Tile13.prototype.walkable = true;
game.Tile13.prototype.frame = 14;
game.Tile14 = function () {
};
game.Tile14.prototype.walkable = false;
game.Tile14.prototype.frame = 15;
game.Tile15 = function () {
};
game.Tile15.prototype.walkable = true;
game.Tile15.prototype.frame = 16;
game.Tile15.prototype.end = true;
game.Tile16 = function () {
};
game.Tile16.prototype.walkable = false;
game.Tile16.prototype.frame = 17;
game.Tile17 = function () {
};
game.Tile17.prototype.walkable = false;
game.Tile17.prototype.frame = 18;
game.Tile18 = function () {
};
game.Tile18.prototype.walkable = false;
game.Tile18.prototype.frame = 19;
game.Tile19 = function () {
};
game.Tile19.prototype.walkable = false;
game.Tile19.prototype.frame = 20;
game.Tile20 = function () {
};
game.Tile20.prototype.walkable = false;
game.Tile20.prototype.frame = 21;
game.Tile21 = function () {
};
game.Tile21.prototype.walkable = false;
game.Tile21.prototype.frame = 22;
game.Tile22 = function () {
};
game.Tile22.prototype.walkable = false;
game.Tile22.prototype.frame = 23;
game.Tile22.prototype.night = true;
game.Tile23 = function () {
};
game.Tile23.prototype.walkable = false;
game.Tile23.prototype.frame = 24;
game.Tile23.prototype.night = true;
game.Tile24 = function () {
};
game.Tile24.prototype.walkable = false;
game.Tile24.prototype.frame = 25;
game.Tile24.prototype.night = true;
game.Tile25 = function () {
};
game.Tile25.prototype.walkable = false;
game.Tile25.prototype.frame = 26;
game.Tile25.prototype.night = true;
game.Tile26 = function () {
};
game.Tile26.prototype.walkable = false;
game.Tile26.prototype.frame = 27;
game.Tile26.prototype.night = true;
game.Tile27 = function () {
};
game.Tile27.prototype.walkable = false;
game.Tile27.prototype.frame = 28;
game.Tile27.prototype.night = true;
game.Tile28 = function () {
};
game.Tile28.prototype.walkable = true;
game.Tile28.prototype.frame = 29;
game.Tile28.prototype.night = true;
game.Tile29 = function () {
};
game.Tile29.prototype.walkable = false;
game.Tile29.prototype.frame = 30;
game.MovingTile1 = function () {
};
game.MovingTile1.prototype.speed = 2;
game.MovingTile1.prototype.dirx = 1;
game.MovingTile1.prototype.diry = 0;
game.MovingTile1.prototype.minx = -2;
game.MovingTile1.prototype.maxx = 1;
game.MovingTile1.prototype.width = game.tileW / 2;
game.MovingTile1.prototype.height = game.tileH / 2;
game.MovingTile2 = function () {
};
game.MovingTile2.prototype.speed = 5;
game.MovingTile2.prototype.dirx = 1;
game.MovingTile2.prototype.diry = 0;
game.MovingTile2.prototype.minx = 0;
game.MovingTile2.prototype.maxx = 3;
game.MovingTile2.prototype.width = game.tileW / 2;
game.MovingTile2.prototype.height = game.tileH / 2;
game.MovingTile3 = function () {
};
game.MovingTile3.prototype.speed = 4;
game.MovingTile3.prototype.dirx = 0;
game.MovingTile3.prototype.diry = 1;
game.MovingTile3.prototype.miny = 0;
game.MovingTile3.prototype.maxy = 3;
game.MovingTile3.prototype.width = game.tileW / 2;
game.MovingTile3.prototype.height = game.tileH / 2;
game.MovingTile4 = function () {
};
game.MovingTile4.prototype.speed = 5;
game.MovingTile4.prototype.dirx = 1;
game.MovingTile4.prototype.diry = 0;
game.MovingTile4.prototype.minx = -2;
game.MovingTile4.prototype.maxx = 3;
game.MovingTile4.prototype.width = game.tileW / 2;
game.MovingTile4.prototype.height = game.tileH / 2;
game.MovingTile5 = function () {
};
game.MovingTile5.prototype.speed = 4;
game.MovingTile5.prototype.dirx = 1;
game.MovingTile5.prototype.diry = 0;
game.MovingTile5.prototype.minx = -3;
game.MovingTile5.prototype.maxx = 3;
game.MovingTile5.prototype.width = game.tileW / 2;
game.MovingTile5.prototype.height = game.tileH / 2;
game.MovingTile6 = function () {
};
game.MovingTile6.prototype.speed = 4;
game.MovingTile6.prototype.dirx = 1;
game.MovingTile6.prototype.diry = 0;
game.MovingTile6.prototype.minx = -3;
game.MovingTile6.prototype.maxx = 3;
game.MovingTile6.prototype.width = game.tileW / 2;
game.MovingTile6.prototype.height = game.tileH / 2;
game.MovingTile7 = function () {
};
game.MovingTile7.prototype.speed = 3;
game.MovingTile7.prototype.dirx = 0;
game.MovingTile7.prototype.diry = 1;
game.MovingTile7.prototype.miny = -1;
game.MovingTile7.prototype.maxy = 1;
game.MovingTile7.prototype.width = game.tileW / 2;
game.MovingTile7.prototype.height = game.tileH / 2;
game.MovingTile8 = function () {
};
game.MovingTile8.prototype.speed = 2;
game.MovingTile8.prototype.dirx = 0;
game.MovingTile8.prototype.diry = 1;
game.MovingTile8.prototype.miny = -2;
game.MovingTile8.prototype.maxy = 0;
game.MovingTile8.prototype.width = game.tileW / 2;
game.MovingTile8.prototype.height = game.tileH / 2;
game.MovingTile9 = function () {
};
game.MovingTile9.prototype.speed = 2;
game.MovingTile9.prototype.dirx = 0;
game.MovingTile9.prototype.diry = 1;
game.MovingTile9.prototype.miny = 0;
game.MovingTile9.prototype.maxy = 3;
game.MovingTile9.prototype.width = game.tileW / 2;
game.MovingTile9.prototype.height = game.tileH / 2;
game.MovingTile10 = function () {
};
game.MovingTile10.prototype.speed = 1;
game.MovingTile10.prototype.dirx = 0;
game.MovingTile10.prototype.diry = 1;
game.MovingTile10.prototype.miny = -1;
game.MovingTile10.prototype.maxy = 1;
game.MovingTile10.prototype.width = game.tileW / 2;
game.MovingTile10.prototype.height = game.tileH / 2;
game.Enemyp1 = function () {
};
game.Enemyp1.prototype.xMove = 0;
game.Enemyp1.prototype.yMove = 1;
game.Enemyp1.prototype.speed = 5;
game.Enemyp1.prototype.brain = 0;
game.Enemyp1.prototype.gravity = 1;
game.Enemyp2 = function () {
};
game.Enemyp2.prototype.xMove = 1;
game.Enemyp2.prototype.yMove = 0;
game.Enemyp2.prototype.speed = 2;
game.Enemyp2.prototype.brain = 1;
game.Enemyp2.prototype.timer = 0;
game.Enemyp3 = function () {
};
game.Enemyp3.prototype.xMove = 0;
game.Enemyp3.prototype.yMove = 1;
game.Enemyp3.prototype.speed = 4;
game.Enemyp3.prototype.brain = 0;
game.Enemyp3.prototype.gravity = 1.2;
game.Enemyp4 = function () {
};
game.Enemyp4.prototype.xMove = 0;
game.Enemyp4.prototype.yMove = 1;
game.Enemyp4.prototype.speed = 4;
game.Enemyp4.prototype.brain = 3;
game.Enemyp4.prototype.pincho = 0;
game.Enemyp5 = function () {
};
game.Enemyp5.prototype.xMove = 1;
game.Enemyp5.prototype.yMove = 1;
game.Enemyp5.prototype.speed = 3;
game.Enemyp5.prototype.brain = 4;
game.Enemyp5.prototype.acelerar = true;
game.Enemyp5.prototype.decelerar = false;
game.Enemyp5.prototype.timer = 0;
game.Enemyp5.prototype.stop = false;
game.Enemyp6 = function () {
};
game.Enemyp6.prototype.xMove = 0;
game.Enemyp6.prototype.yMove = 1;
game.Enemyp6.prototype.speed = 2;
game.Enemyp6.prototype.brain = 5;
game.Enemyp7 = function () {
};
game.Enemyp7.prototype.xMove = 1;
game.Enemyp7.prototype.yMove = 0;
game.Enemyp7.prototype.speed = 4;
game.Enemyp7.prototype.jumpstart = -20;
game.Enemyp7.prototype.jump = false;
game.Enemyp7.prototype.gravity = 2;
game.Enemyp7.prototype.brain = 2;
game.Enemyp8 = function () {
};
game.Enemyp8.prototype.xMove = 0;
game.Enemyp8.prototype.yMove = 1;
game.Enemyp8.prototype.speed = 2;
game.Enemyp8.prototype.brain = 6;
game.Enemyp9 = function () {
};
game.Enemyp9.prototype.xMove = 1;
game.Enemyp9.prototype.yMove = 0;
game.Enemyp9.prototype.speed = 2;
game.Enemyp9.prototype.brain = 7;
game.Enemyp10 = function () {
};
game.Enemyp10.prototype.xMove = 0;
game.Enemyp10.prototype.yMove = 0;
game.Enemyp10.prototype.speed = 0;
game.Enemyp10.prototype.brain = 7;
game.Enemyp11 = function () {
};
game.Enemyp11.prototype.xMove = 0;
game.Enemyp11.prototype.yMove = 1;
game.Enemyp11.prototype.speed = 3.5;
game.Enemyp11.prototype.brain = 5;
game.Enemyp12 = function () {
};
game.Enemyp12.prototype.xMove = 0;
game.Enemyp12.prototype.yMove = 1;
game.Enemyp12.prototype.speed = 2;
game.Enemyp12.prototype.brain = 5;
game.Itemp1 = function () {
};
game.Itemp1.prototype.points = 0;
game.Itemp1.prototype.key = true;
game.Itemp2 = function () {
};
game.Itemp2.prototype.points = 5;
game.Itemp3 = function () {
};
game.Itemp3.prototype.points = 0;
game.Itemp3.prototype.light = true;
game.Itemp4 = function () {
};
game.Itemp4.prototype.points = 15;
game.Itemp5 = function () {
};
game.Itemp5.prototype.points = 50;
char = {xtile:_root.x, ytile:_root.y, speed:4, jumpstart:-17, gravity:2, jump:false, onMovingTile:false};
buildMap(_root["myMap" + game.currentMap]);
fall(_root.char);
stop();
Instance of Symbol 128 MovieClip [empty] "controller" in Frame 2
onClipEvent (enterFrame) {
_root.detectKeys();
}
Frame 3
stop();
Instance of Symbol 128 MovieClip [empty] in Frame 4
onClipEvent (load) {
_root.fac._visible = false;
_root.facil._visible = false;
_root.dificil._visible = false;
}
Frame 83
gotoAndPlay (4);
Frame 164
stop();
Frame 165
Frame 284
stop();
Frame 285
puntos = _root.points;
_root.nom = "";
stop();
Frame 286
texto0 = "";
puntos0 = "";
texto1 = "";
puntos1 = "";
texto2 = "";
puntos2 = "";
texto3 = "";
puntos3 = "";
texto4 = "";
puntos4 = "";
var lv = new LoadVars();
lv.onLoad = function (success) {
if (success) {
texto0 = lv.texto0;
texto1 = lv.texto1;
texto2 = lv.texto2;
texto3 = lv.texto3;
texto4 = lv.texto4;
puntos0 = lv.puntos0;
puntos1 = lv.puntos1;
puntos2 = lv.puntos2;
puntos3 = lv.puntos3;
puntos4 = lv.puntos4;
} else {
gotoAndStop (285);
}
};
lv.puntos = _root.points;
lv.nombre = _root.nom;
lv.sendAndLoad("valor.php", lv, "POST");
stop();
Frame 287
function interprete() {
primerNivel = this.firstChild;
segundoNivel = primerNivel.childNodes;
teclas = segundoNivel[0].childNodes;
objetos = segundoNivel[1].childNodes;
texto0 = segundoNivel[0].nodeName;
texto1 = (teclas[0].nodeName + " * ") + teclas[0].firstChild;
texto2 = (teclas[1].nodeName + " * ") + teclas[1].firstChild;
texto3 = (teclas[2].nodeName + " * ") + teclas[2].firstChild;
texto4 = segundoNivel[1].nodeName;
texto5 = objetos[0].firstChild;
texto6 = objetos[1].firstChild;
texto7 = objetos[2].firstChild;
texto8 = objetos[3].firstChild;
_root.uno._visible = true;
_root.dos._visible = true;
_root.tres._visible = true;
_root.cuatro._visible = true;
}
texto0 = "";
texto1 = "";
texto2 = "";
texto3 = "";
texto4 = "";
_root.uno._visible = false;
_root.dos._visible = false;
_root.tres._visible = false;
_root.cuatro._visible = false;
nombres = new XML();
nombres.load("datos.xml");
nombres.onLoad = interprete;
nombres.ignoreWhite = 1;
Symbol 24 MovieClip [char_die_left] Frame 20
_root.ComprobarVidas();
stop();
Symbol 25 MovieClip [char_anim] Frame 12
removeMovieClip(_root.tiles);
removeMovieClip(_root.fondo);
_root.gotoAndPlay("fin");
s.stop();
Symbol 26 MovieClip [char_die_right] Frame 20
_root.ComprobarVidas();
stop();
Symbol 46 MovieClip [char] Frame 1
stop();
Symbol 53 MovieClip Frame 1
stop();
Symbol 53 MovieClip Frame 10
stop();
Symbol 57 MovieClip Frame 1
stop();
Symbol 57 MovieClip Frame 80
stop();
Symbol 58 MovieClip Frame 1
stop();
Symbol 58 MovieClip Frame 80
stop();
Symbol 67 MovieClip Frame 1
stop();
Symbol 67 MovieClip Frame 80
stop();
Symbol 69 MovieClip Frame 1
stop();
Symbol 69 MovieClip Frame 80
stop();
Symbol 71 MovieClip Frame 1
stop();
Symbol 71 MovieClip Frame 80
stop();
Symbol 73 MovieClip Frame 1
stop();
Symbol 73 MovieClip Frame 80
stop();
Symbol 75 MovieClip Frame 1
stop();
Symbol 75 MovieClip Frame 80
stop();
Symbol 77 MovieClip Frame 1
stop();
Symbol 77 MovieClip Frame 80
stop();
Symbol 78 MovieClip Frame 1
stop();
Symbol 78 MovieClip Frame 80
stop();
Symbol 79 MovieClip Frame 1
var open = false;
Symbol 79 MovieClip Frame 356
var open = true;
Symbol 79 MovieClip Frame 400
stop();
Symbol 92 MovieClip [fondo] Frame 1
stop();
Symbol 92 MovieClip [fondo] Frame 80
stop();
Symbol 126 Button [boton_facil]
on (press) {
_root.dificultad = 0;
_root.fac._visible = false;
_root.dific._visible = true;
_root.facil._visible = false;
_root.dificil._visible = false;
}
Symbol 127 Button [boton_dificil]
on (press) {
_root.dificultad = 1;
_root.fac._visible = true;
_root.dific._visible = false;
_root.facil._visible = false;
_root.dificil._visible = false;
}
Symbol 149 Button
on (release, keyPress "<Enter>") {
var s = _root.mystart;
_root.vidas = 4;
_root.start = stage;
_root.y = s[stage][0];
_root.x = s[stage][1];
gotoAndStop (2);
}
Symbol 165 MovieClip Frame 10
stop();
Symbol 167 Button
on (release) {
_root.dificil._visible = true;
_root.facil._visible = true;
}
Symbol 170 MovieClip Frame 10
stop();
Symbol 172 Button
on (release) {
_root.gotoAndStop("instrucciones");
}
Symbol 175 MovieClip Frame 10
stop();
Symbol 177 Button
on (release) {
_root.gotoAndPlay("juego");
}
Symbol 182 MovieClip Frame 10
stop();
Symbol 183 Button
on (release) {
_root.dificil._visible = true;
_root.facil._visible = true;
}
Symbol 186 MovieClip Frame 10
stop();
Symbol 187 Button
on (release) {
_root.gotoAndPlay("puntuaciones");
}
Symbol 214 MovieClip Frame 14
stop();
Symbol 219 Button
on (release) {
_root.gotoAndStop(2);
}
Symbol 224 Button
on (release) {
_root.gotoAndPlay("records");
}
Symbol 236 Button
on (press) {
gotoAndStop (286);
}
Symbol 244 Button
on (release) {
s.stop();
gameover.stop();
var vidas = 4;
var start = 1;
var x = 2;
var y = 1;
var points = 0;
_root.gotoAndPlay("inicio");
}
Symbol 271 Button
on (press) {
_root.gotoAndPlay("inicio");
}