Frame 1
stop();
Frame 2
_global.jugado = false;
Frame 3
if (_global.jugado == true) {
trace("hola");
_global.cargado = true;
this.menuinicio.gotoAndStop(75);
this.menuinicio.circulo.gotoAndStop(50);
this.menuinicio.franjah1.gotoAndStop(20);
this.menuinicio.franjah2.gotoAndStop(35);
this.menuinicio.secciones.gotoAndStop(15);
this.menuinicio.cuadraditos.gotoAndStop(24);
}
_global.jugado = true;
stop();
Frame 4
stop();
Frame 5
stop();
Frame 6
stop();
Frame 7
stop();
Frame 8
gotoAndStop ("facil");
Frame 9
gotoAndStop ("medio");
Frame 10
gotoAndStop ("medio_avanzado");
Frame 11
gotoAndStop ("dificil");
Frame 12
stop();
Symbol 1 MovieClip [info] Frame 1
var objeto;
this.cacheAsBitmap = true;
bolasmarcador.actualizar.onPress = function () {
objeto.actualizar();
};
bolasmarcador.borrar.onPress = function () {
objeto.borrar();
};
Symbol 3 MovieClip [sonidoboton] Frame 1
this.removeMovieClip();
Symbol 6 MovieClip [nopuedes] Frame 10
this.removeMovieClip();
Symbol 10 MovieClip [nodinero] Frame 10
this.removeMovieClip();
Symbol 12 MovieClip [markerbi] Frame 1
var enemigo;
onEnterFrame = function () {
this._x = enemigo._x;
this._y = enemigo._y;
};
this.cacheAsBitmap = true;
Symbol 15 MovieClip Frame 1
this.cacheAsBitmap = true;
Symbol 16 MovieClip [marker] Frame 1
this.cacheAsBitmap = true;
Symbol 21 MovieClip [barritaac] Frame 1
this.cacheAsBitmap = true;
this.cuerpo._xscale = 1;
Symbol 26 MovieClip Frame 13
this._parent.removeMovieClip();
stop();
Symbol 27 MovieClip [bala5] Frame 1
var blanco;
var da\u00F1os;
var aux = blanco;
var auxx;
var auxy;
var impacto = false;
this.attachMovie("disparo2", this + "d", this.getNextHighestDepth());
onEnterFrame = function () {
if (_global.STOP == false) {
if (blanco == null) {
this.removeMovieClip();
}
auxx = this._x;
auxy = this._y;
dist = Math.sqrt(Math.pow(this._x - blanco._x, 2) + Math.pow(this._y - blanco._y, 2));
coseno = Math.abs(this._x - blanco._x) / dist;
seno = Math.abs(this._y - blanco._y) / dist;
if (this._x < blanco._x) {
this._x = this._x + (10 * coseno);
}
if (this._x > blanco._x) {
this._x = this._x - (10 * coseno);
}
if (this._y < blanco._y) {
this._y = this._y + (10 * seno);
}
if (this._y > blanco._y) {
this._y = this._y - (10 * seno);
}
if ((dist <= 20) and (impacto == false)) {
impacto = true;
blanco.vida = blanco.vida - da\u00F1os;
gotoAndStop (2);
}
}
};
stop();
Symbol 32 MovieClip Frame 11
this._parent.removeMovieClip();
Symbol 33 MovieClip [bala4] Frame 1
var blanco;
var da\u00F1os;
var aux = blanco;
var auxx;
var auxy;
var impacto = false;
var velocidad = 18;
this.attachMovie("disparo1", this + "d", this.getNextHighestDepth());
this.cacheAsBitmap = true;
onEnterFrame = function () {
if (_global.STOP == false) {
if (aux != blanco) {
this.removeMovieClip();
}
auxx = this._x;
auxy = this._y;
dist = Math.sqrt(Math.pow(this._x - blanco._x, 2) + Math.pow(this._y - blanco._y, 2));
coseno = Math.abs(this._x - blanco._x) / dist;
seno = Math.abs(this._y - blanco._y) / dist;
if (this._x < blanco._x) {
this._x = this._x + (velocidad * coseno);
}
if (this._x > blanco._x) {
this._x = this._x - (velocidad * coseno);
}
if (this._y < blanco._y) {
this._y = this._y + (velocidad * seno);
}
if (this._y > blanco._y) {
this._y = this._y - (velocidad * seno);
}
if ((dist <= 20) and (impacto == false)) {
impacto = true;
blanco.vida = blanco.vida - da\u00F1os;
velocidad = 0;
gotoAndStop (2);
}
}
};
stop();
Symbol 33 MovieClip [bala4] Frame 2
stop();
Symbol 34 MovieClip [bala3] Frame 1
onEnterFrame = function () {
this.removeMovieClip();
};
stop();
Symbol 38 MovieClip [balahielo] Frame 1
this.attachMovie("disparo3", this + "d", this.getNextHighestDepth());
Symbol 38 MovieClip [balahielo] Frame 10
stop();
Symbol 40 MovieClip Frame 40
stop();
this.cacheAsBitmap = true;
Symbol 43 MovieClip Frame 13
this._parent.removeMovieClip();
stop();
Symbol 44 MovieClip [bala] Frame 1
var blanco;
var da\u00F1os;
var aux = blanco;
var auxx;
var auxy;
var cancion = new Sound();
var impacto = false;
var velocidad = 25;
onEnterFrame = function () {
if (_global.STOP == false) {
if (aux != blanco) {
this.removeMovieClip();
}
}
auxx = this._x;
auxy = this._y;
dist = Math.sqrt(Math.pow(this._x - blanco._x, 2) + Math.pow(this._y - blanco._y, 2));
coseno = Math.abs(this._x - blanco._x) / dist;
seno = Math.abs(this._y - blanco._y) / dist;
if (cuerpo._currentFrame > 39) {
if (this._x < blanco._x) {
this._x = this._x + (velocidad * coseno);
}
if (this._x > blanco._x) {
this._x = this._x - (velocidad * coseno);
}
if (this._y < blanco._y) {
this._y = this._y + (velocidad * seno);
}
if (this._y > blanco._y) {
this._y = this._y - (velocidad * seno);
}
}
if ((dist <= 25) and (impacto == false)) {
impacto = true;
blanco.vida = blanco.vida - da\u00F1os;
velocidad = 0;
this.gotoAndPlay(2);
}
};
stop();
Symbol 44 MovieClip [bala] Frame 2
stop();
Symbol 52 MovieClip [jefe_ dificil] Frame 1
var contador = 0;
var cont = 0;
var rand;
var nivel = 0;
var randomaux = 3;
_global.empezar = 0;
this._visible = false;
i = 1;
while (i <= 100) {
_root["contador" + i] = 0;
i++;
}
var nachotipo = new Array(5, 4, 2, 4, 3, 2, 4, 2, 5, 6, 2, 3, 5, 1, 2, 4, 2, 3, 1, 6, 3, 4, 2, 2, 3, 1, 5, 4, 2, 6, 5, 4, 5, 2, 1, 3, 5, 2, 4, 6, 5, 2, 3, 1, 4, 5, 5, 1, 5, 6, 2, 4, 3, 1, 4, 5, 1, 3, 5, 6, 2, 5, 3, 2, 4, 5, 1, 3, 5, 6, 5, 4, 3, 2, 4, 5, 1, 4, 5, 6, 3, 4, 2, 2, 3, 1, 5, 4, 2, 6, 5, 4, 3, 2, 4, 5, 6, 1, 3, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
var nachovida = new Array(35, 47, 45, 70, 37, 100, 125, 100, 150, 998, 100, 150, 175, 180, 198, 220, 220, 120, 220, 2794, 345, 380, 423, 460, 252, 465, 586, 712, 920, 15891, 1026, 1105, 1190, 1436, 1697, 785, 1812, 1931, 2089, 57700, 4402, 4900, 2700, 5974, 6600, 7120, 7320, 7780, 4074, 120290, 6104, 2468, 4406, 8336, 8738, 9072, 8738, 4912, 7400, 181122, 8460, 9504, 7642, 11672, 12702, 13280, 11672, 11000, 15046, 401128, 15790, 15790, 12023, 16620, 8024, 17446, 15970, 18656, 19264, 601136, 16000, 19810, 21304, 21930, 18462, 21006, 23080, 24068, 25368, 1041368, 28642, 30472, 20000, 31792, 32702, 33970, 2000000, 35264, 27390, 40000);
var nachodinero = new Array(1, 1, 1, 2, 2, 2, 2, 2, 2, 40, 2, 3, 3, 8, 3, 3, 4, 4, 12, 75, 4, 4, 5, 5, 5, 16, 5, 6, 6, 100, 6, 6, 6, 6, 15, 7, 7, 9, 9, 150, 9, 9, 9, 20, 11, 11, 11, 11, 11, 150, 12, 12, 12, 12, 12, 12, 25, 12, 12, 200, 14, 14, 14, 14, 14, 14, 14, 14, 14, 200, 16, 16, 16, 16, 16, 16, 16, 16, 16, 200, 17, 18, 19, 20, 21, 22, 23, 24, 25, 200, 26, 27, 28, 29, 30, 31, 200, 32, 33, 34);
var numerohijos = new Array();
i = 1;
while (i <= 100) {
numerohijos[i] = 0;
i++;
}
numerohijos[1] = 4;
numerohijos[14] = 4;
numerohijos[19] = 4;
numerohijos[26] = 4;
numerohijos[35] = 4;
numerohijos[44] = 4;
numerohijos[48] = 4;
numerohijos[54] = 4;
numerohijos[57] = 4;
numerohijos[67] = 4;
numerohijos[77] = 4;
numerohijos[86] = 4;
numerohijos[98] = 4;
i = 0;
while (i <= 6) {
_level0.terreno["altar" + (i + 1)].cambioestado(nachotipo[nivel + i]);
i++;
}
onEnterFrame = function () {
var _local6 = false;
if (_global.empezar == 0) {
i = 0;
while (i <= 6) {
_level0.terreno["altar" + (i + 1)].cambioestado(nachotipo[nivel + i]);
i++;
}
}
if (_global.STOP == false) {
if (_global.empezar == 1) {
contador++;
_level0.terreno.reloj.text = Math.ceil(30 - (_root["contador" + (nivel + 1)] / 25));
do {
rand = Math.floor(Math.random() * 10);
if ((rand >= 0) and (rand <= 2)) {
rand = 1;
}
if ((rand > 2) and (rand <= 5)) {
rand = -1;
}
if ((rand > 5) and (rand <= 7)) {
rand = 0;
}
if ((rand > 7) and (rand <= 12)) {
rand = 2;
}
} while (rand == randomaux);
randomaux = rand;
var _local5;
var _local4;
var _local3;
_local3 = 1;
while (_local3 <= 100) {
if (nivel >= (_local3 - 1)) {
if (_root["contador" + _local3] <= 749) {
if (nachotipo[_local3 - 1] == 1) {
_local5 = 34;
} else if (nachotipo[_local3 - 1] == 6) {
_local5 = 1;
} else {
_local5 = 135;
}
if (((_root["contador" + _local3] % 17) == 0) and (_root["contador" + _local3] <= _local5)) {
if (nachotipo[_local3 - 1] == 3) {
_local4 = 25;
} else {
_local4 = 0;
}
_level0.terreno.attachMovie("bicho" + nachotipo[_local3 - 1], "bich" + cont, _level0.terreno.getNextHighestDepth(), {_x:-230, _y:290, _xscale:133, _yscale:133, fila:12 + rand, columna:_local4, vida:Math.ceil(nachovida[_local3 - 1] * 1.85), dinero:Math.floor(nachodinero[_local3 - 1] * 1.55), contadorhijos:numerohijos[_local3], ultimoboss:_local6});
_level0.terreno.attachMovie(("bicho" + nachotipo[_local3 - 1]) + "v", "bichv" + cont, _level0.terreno.getNextHighestDepth(), {_x:260, _y:-130, _xscale:133, _yscale:133, fila:_local4, columna:12 + rand, vida:Math.ceil(nachovida[_local3 - 1] * 1.87), dinero:Math.floor(nachodinero[_local3 - 1] * 1.55), contadorhijos:numerohijos[_local3], ultimoboss:_local6});
if (_root.contador100 == 119) {
_level0.terreno.ultimonivel = true;
}
}
if (((_root["contador" + _local3] == 749) and (nivel == (_local3 - 1))) and (nivel < 99)) {
nivel++;
_level0.terreno.nivelactual.text = nivel;
i = 0;
while (i <= 6) {
_level0.terreno["altar" + (i + 1)].cambioestado(nachotipo[nivel + i]);
i++;
}
}
_root["contador" + _local3]++;
cont++;
_level0.terreno.nivelactual.text = nivel + 1;
}
}
_local3++;
}
}
}
};
Symbol 92 MovieClip Frame 1
onEnterFrame = function () {
if (_global.STOP == false) {
this.play();
} else {
this.stop();
}
};
Symbol 92 MovieClip Frame 20
gotoAndPlay (1);
Symbol 92 MovieClip Frame 40
gotoAndPlay (21);
Symbol 92 MovieClip Frame 60
gotoAndPlay (41);
Symbol 92 MovieClip Frame 80
gotoAndPlay (61);
Symbol 92 MovieClip Frame 100
gotoAndPlay (81);
Symbol 92 MovieClip Frame 120
gotoAndPlay (101);
Symbol 92 MovieClip Frame 140
gotoAndPlay (121);
Symbol 92 MovieClip Frame 160
gotoAndPlay (141);
Symbol 93 MovieClip [bicho6v] Frame 1
function mover(tabIA, long) {
var _local3 = new Array(3);
var _local4;
var _local5;
var _local7 = 0;
if ((pensar == 1) and (_global.tableroIAv[fila][columna] != 1)) {
i = 0;
while (i <= 7) {
_local3[i] = 9999;
i++;
}
if ((this.fila + 1) <= long) {
_local3[0] = tabIA[this.fila + 1][this.columna];
_local3[4] = tabIA[this.fila + 1][this.columna - 1];
_local3[5] = tabIA[this.fila + 1][this.columna + 1];
}
if ((this.fila - 1) >= 0) {
_local3[1] = tabIA[this.fila - 1][this.columna];
_local3[6] = tabIA[this.fila - 1][this.columna - 1];
_local3[7] = tabIA[this.fila - 1][this.columna + 1];
}
if ((this.columna + 1) <= long) {
_local3[2] = tabIA[this.fila][this.columna + 1];
}
if ((this.columna - 1) >= 0) {
_local3[3] = tabIA[this.fila][this.columna - 1];
}
_local4 = _local3[0];
_local5 = 0;
i = 1;
while (i <= 7) {
if (_local3[i] < _local4) {
_local4 = _local3[i];
_local5 = i;
}
i++;
}
_local4 = 0;
switch (_local5) {
case 0 :
filsig = this.fila + 1;
columsig = this.columna;
_local4++;
if ((((cuerpo._currentframe > 20) and (estoyentablero == true)) and (estoyentablero == true)) and (estoyentablero == true)) {
cuerpo.gotoAndPlay(1);
}
actorretas(filsig, columsig);
break;
case 1 :
filsig = this.fila - 1;
columsig = this.columna;
_local4++;
if (((cuerpo._currentframe < 21) and (estoyentablero == true)) or ((cuerpo._currentframe > 40) and (estoyentablero == true))) {
cuerpo.gotoAndPlay(21);
}
actorretas(filsig, columsig);
break;
case 2 :
columsig = this.columna + 1;
filsig = this.fila;
_local4++;
if (((cuerpo._currentframe < 81) and (estoyentablero == true)) or ((cuerpo._currentframe > 100) and (estoyentablero == true))) {
cuerpo.gotoAndPlay(81);
}
actorretas(filsig, columsig);
break;
case 3 :
columsig = this.columna - 1;
filsig = this.fila;
_local4++;
if (((cuerpo._currentframe < 141) and (estoyentablero == true)) or ((cuerpo._currentframe > 160) and (estoyentablero == true))) {
cuerpo.gotoAndPlay(141);
}
actorretas(filsig, columsig);
break;
case 4 :
if ((_global.tablero[fila][columna - 1] == 1) and (_global.tablero[fila + 1][columna] == 1)) {
columsig = this.columna - 1;
filsig = this.fila + 1;
_local4++;
if (((cuerpo._currentframe < 61) and (estoyentablero == true)) or ((cuerpo._currentframe > 80) and (estoyentablero == true))) {
cuerpo.gotoAndPlay(61);
}
actorretas(filsig, columsig);
}
break;
case 5 :
if ((_global.tablero[fila][columna + 1] == 1) and (_global.tablero[fila + 1][columna] == 1)) {
columsig = this.columna + 1;
filsig = this.fila + 1;
_local4++;
if (((cuerpo._currentframe < 121) and (estoyentablero == true)) or ((cuerpo._currentframe > 140) and (estoyentablero == true))) {
cuerpo.gotoAndPlay(121);
}
actorretas(filsig, columsig);
}
break;
case 6 :
if ((_global.tablero[fila][columna - 1] == 1) and (_global.tablero[fila - 1][columna] == 1)) {
columsig = this.columna - 1;
filsig = this.fila - 1;
_local4++;
if (((cuerpo._currentframe < 101) and (estoyentablero == true)) or ((cuerpo._currentframe > 120) and (estoyentablero == true))) {
cuerpo.gotoAndPlay(101);
}
actorretas(filsig, columsig);
}
break;
case 7 :
if (!((_global.tablero[fila][columna + 1] == 1) and (_global.tablero[fila - 1][columna] == 1))) {
break;
}
columsig = this.columna + 1;
filsig = this.fila - 1;
_local4++;
if (((cuerpo._currentframe < 41) and (estoyentablero == true)) or ((cuerpo._currentframe > 60) and (estoyentablero == true))) {
cuerpo.gotoAndPlay(41);
}
actorretas(filsig, columsig);
}
if (_local4 == 0) {
_local4 = _local3[0];
_local5 = 0;
i = 1;
while (i <= 3) {
if (_local3[i] <= _local4) {
_local4 = _local3[i];
_local5 = i;
}
i++;
}
switch (_local5) {
case 0 :
filsig = this.fila + 1;
columsig = this.columna;
if ((cuerpo._currentframe > 20) and (estoyentablero == true)) {
cuerpo.gotoAndPlay(1);
}
actorretas(filsig, columsig);
break;
case 1 :
filsig = this.fila - 1;
columsig = this.columna;
if (((cuerpo._currentframe < 21) and (estoyentablero == true)) or ((cuerpo._currentframe > 40) and (estoyentablero == true))) {
cuerpo.gotoAndPlay(21);
}
actorretas(filsig, columsig);
break;
case 2 :
columsig = this.columna + 1;
filsig = this.fila;
if (((cuerpo._currentframe < 81) and (estoyentablero == true)) or ((cuerpo._currentframe > 100) and (estoyentablero == true))) {
cuerpo.gotoAndPlay(81);
}
actorretas(filsig, columsig);
break;
case 3 :
columsig = this.columna - 1;
filsig = this.fila;
if (((cuerpo._currentframe < 141) and (estoyentablero == true)) or ((cuerpo._currentframe > 160) and (estoyentablero == true))) {
cuerpo.gotoAndPlay(141);
}
actorretas(filsig, columsig);
}
}
pensar = 0;
}
if (estoyentablero == false) {
filsig = fila;
columsig = columna;
while (tabIA[fila][columna] >= 999) {
columna = 11 + _local7;
columsig = columna;
columsig = columna;
_local7++;
}
}
if (_global.tablero[filsig][columsig] == 0) {
pensar = 1;
}
if (frenatorreta != null) {
if (this.hitTest(frenatorreta.alcance) == false) {
lento = 1;
frenatorreta = null;
}
}
if (this._x < ((columsig * 20) + 10)) {
this._x = this._x + (this.velocidad * lento);
}
if (this._x > ((columsig * 20) + 10)) {
this._x = this._x - (this.velocidad * lento);
}
if (this._y < ((filsig * 20) + 10)) {
this._y = this._y + (this.velocidad * lento);
}
if (this._y > ((filsig * 20) + 10)) {
this._y = this._y - (this.velocidad * lento);
}
if (Math.abs(this._x - ((columsig * 20) + 10)) <= 2) {
if (Math.abs(this._y - ((filsig * 20) + 10)) <= 2) {
this.fila = filsig;
this.columna = columsig;
pensar = 1;
if (estoyentablero == false) {
estoyentablero = true;
}
}
}
}
function eliminar() {
if (_global.tableroIAv[fila][columna] == 1) {
filsig = 100;
if ((cuerpo._currentframe > 20) and (estoyentablero == true)) {
cuerpo.gotoAndPlay(1);
}
}
if (this._y > 600) {
delete _global.enemigos[this];
_global.vida = _global.vida - 1;
_level0.terreno.attachMovie("laugh", "D" + this, _level0.terreno.getNextHighestDepth());
if (_level0.terreno.info.objeto == this) {
_level0.terreno.info.gotoAndStop(1);
_level0.terreno.info.ataque1.text = "";
_level0.terreno.info.distancia1.text = "";
_level0.terreno.info.coste1.text = "";
_level0.terreno.info.ataque2.text = "";
_level0.terreno.info.distancia2.text = "";
_level0.terreno.info.coste2.text = "";
}
if (_level0.terreno.markerbi.enemigo == this) {
_level0.terreno.markerbi.removeMovieClip();
}
this.removeMovieClip();
}
if (vida <= 0) {
delete _global.enemigos[this];
_global.puntos = _global.puntos + (100 * factorpuntos);
_global.dinero = _global.dinero + dinero;
if (_level0.terreno.info.objeto == this) {
_level0.terreno.info.gotoAndStop(1);
_level0.terreno.info.ataque1.text = "";
_level0.terreno.info.distancia1.text = "";
_level0.terreno.info.coste1.text = "";
_level0.terreno.info.ataque2.text = "";
_level0.terreno.info.distancia2.text = "";
_level0.terreno.info.coste2.text = "";
}
if (_level0.terreno.markerbi.enemigo == this) {
_level0.terreno.markerbi.removeMovieClip();
}
_level0.terreno.attachMovie("DWEE", "D" + this, _level0.terreno.getNextHighestDepth());
_level0.terreno.attachMovie("sumadinero", "Di" + this, _level0.terreno.getNextHighestDepth(), {_x:_level0.terreno.dinero._x + 45, _y:_level0.terreno.dinero._y + 5, coste:dinero});
this.removeMovieClip();
}
}
function actorretas(fil, colum) {
for (k in _global.tableroalcance[fil][colum]) {
_global.tableroalcance[fil][colum][k].activardisparo = true;
_global.tableroalcance[fil][colum][k].enemigosatiro[this] = this;
}
}
var fila;
var columna;
var velocidad = 2;
var vida;
var factordinero = 1;
var factorpuntos = 1;
var factorvida = 1;
var tipo = "normal";
var lento = 1;
var dinero;
var vidatotal = vida;
var clase = "V";
var pensar = 1;
var filsig;
var columsig;
var vidafutura = vida;
var estoyentablero = false;
var ultimoboss;
this.cacheAsBitmap = true;
cuerpo.gotoAndPlay("frente");
vida = vida * factorvida;
this.swapDepths(_parent.getNextHighestDepth());
indice = _global.enemigos.length;
_global.enemigos[this] = this;
if (ultimoboss == true) {
}
if (_global.tableroIA[fila][columna] >= 999) {
i = 11;
while (i <= 14) {
if (_global.tableroIA[0][i] < 999) {
fila = 0;
columna = i;
break;
}
i++;
}
}
onPress = function () {
if (_global.STOP == false) {
_level0.terreno.info.objeto = this;
_level0.terreno.info.gotoAndStop(2);
_level0.terreno.info.foto.gotoAndStop("boss");
_level0.terreno.markerbi.removeMovieClip();
_level0.terreno.attachMovie("markerbi", "markerbi", _level0.terreno.getNextHighestDepth(), {_x:this._x, _y:this._y, _alpha:50, enemigo:this});
}
};
onEnterFrame = function () {
if (_global.STOP == false) {
mover(_global.tableroIAv, _global.longtab);
this.eliminar();
}
};
Symbol 96 MovieClip [bala2] Frame 1
var blanco;
var da\u00F1os;
var aux = blanco;
var auxx;
var auxy;
onEnterFrame = function () {
if (blanco == null) {
this.removeMovieClip();
}
auxx = this._x;
auxy = this._y;
dist = Math.sqrt(Math.pow(this._x - blanco._x, 2) + Math.pow(this._y - blanco._y, 2));
coseno = Math.abs(this._x - blanco._x) / dist;
seno = Math.abs(this._y - blanco._y) / dist;
if (this._x < blanco._x) {
this._x = this._x + (10 * coseno);
}
if (this._x > blanco._x) {
this._x = this._x - (10 * coseno);
}
if (this._y < blanco._y) {
this._y = this._y + (10 * seno);
}
if (this._y > blanco._y) {
this._y = this._y - (10 * seno);
}
if (dist <= 20) {
blanco.vida = blanco.vida - da\u00F1os;
this.removeMovieClip();
}
};
Symbol 136 MovieClip Frame 1
onEnterFrame = function () {
if (_global.STOP == false) {
this.play();
} else {
this.stop();
}
};
Symbol 136 MovieClip Frame 20
gotoAndPlay (1);
Symbol 136 MovieClip Frame 40
gotoAndPlay (21);
Symbol 136 MovieClip Frame 60
gotoAndPlay (41);
Symbol 136 MovieClip Frame 80
gotoAndPlay (61);
Symbol 136 MovieClip Frame 100
gotoAndPlay (81);
Symbol 136 MovieClip Frame 120
gotoAndPlay (101);
Symbol 136 MovieClip Frame 140
gotoAndPlay (121);
Symbol 136 MovieClip Frame 160
gotoAndPlay (141);
Symbol 137 MovieClip [bicho5] Frame 1
function mover(tabIA, long) {
var _local3 = new Array(7);
var _local4;
var _local5;
var _local7 = 0;
var _local9 = 0;
var _local8 = 0;
_local7 = 0;
if ((pensar == 1) and (_global.tableroIA[fila][columna] != 1)) {
i = 0;
while (i <= 7) {
_local3[i] = 9999;
i++;
}
if ((this.fila + 1) <= long) {
_local3[0] = tabIA[this.fila + 1][this.columna];
_local3[4] = tabIA[this.fila + 1][this.columna - 1];
_local3[5] = tabIA[this.fila + 1][this.columna + 1];
}
if ((this.fila - 1) >= 0) {
_local3[1] = tabIA[this.fila - 1][this.columna];
_local3[6] = tabIA[this.fila - 1][this.columna - 1];
_local3[7] = tabIA[this.fila - 1][this.columna + 1];
}
if ((this.columna + 1) <= long) {
_local3[2] = tabIA[this.fila][this.columna + 1];
}
if ((this.columna - 1) >= 0) {
_local3[3] = tabIA[this.fila][this.columna - 1];
}
_local4 = _local3[0];
_local5 = 0;
i = 1;
while (i <= 7) {
if (_local3[i] < _local4) {
_local4 = _local3[i];
_local5 = i;
}
i++;
}
_local4 = 0;
switch (_local5) {
case 0 :
filsig = this.fila + 1;
columsig = this.columna;
_local4++;
if ((((cuerpo._currentframe > 20) and (estoyentablero == true)) and (estoyentablero == true)) and (estoyentablero == true)) {
cuerpo.gotoAndPlay(1);
}
actorretas(filsig, columsig);
break;
case 1 :
filsig = this.fila - 1;
columsig = this.columna;
_local4++;
if (((cuerpo._currentframe < 21) and (estoyentablero == true)) or ((cuerpo._currentframe > 40) and (estoyentablero == true))) {
cuerpo.gotoAndPlay(21);
}
actorretas(filsig, columsig);
break;
case 2 :
columsig = this.columna + 1;
filsig = this.fila;
_local4++;
if (((cuerpo._currentframe < 81) and (estoyentablero == true)) or ((cuerpo._currentframe > 100) and (estoyentablero == true))) {
cuerpo.gotoAndPlay(81);
}
actorretas(filsig, columsig);
break;
case 3 :
columsig = this.columna - 1;
filsig = this.fila;
_local4++;
if (((cuerpo._currentframe < 141) and (estoyentablero == true)) or ((cuerpo._currentframe > 160) and (estoyentablero == true))) {
cuerpo.gotoAndPlay(141);
}
actorretas(filsig, columsig);
break;
case 4 :
if ((_global.tablero[fila][columna - 1] == 1) and (_global.tablero[fila + 1][columna] == 1)) {
columsig = this.columna - 1;
filsig = this.fila + 1;
_local4++;
if (((cuerpo._currentframe < 61) and (estoyentablero == true)) or ((cuerpo._currentframe > 80) and (estoyentablero == true))) {
cuerpo.gotoAndPlay(61);
}
actorretas(filsig, columsig);
}
break;
case 5 :
if ((_global.tablero[fila][columna + 1] == 1) and (_global.tablero[fila + 1][columna] == 1)) {
columsig = this.columna + 1;
filsig = this.fila + 1;
_local4++;
if (((cuerpo._currentframe < 121) and (estoyentablero == true)) or ((cuerpo._currentframe > 140) and (estoyentablero == true))) {
cuerpo.gotoAndPlay(121);
}
actorretas(filsig, columsig);
}
break;
case 6 :
if ((_global.tablero[fila][columna - 1] == 1) and (_global.tablero[fila - 1][columna] == 1)) {
columsig = this.columna - 1;
filsig = this.fila - 1;
_local4++;
if (((cuerpo._currentframe < 101) and (estoyentablero == true)) or ((cuerpo._currentframe > 120) and (estoyentablero == true))) {
cuerpo.gotoAndPlay(101);
}
actorretas(filsig, columsig);
}
break;
case 7 :
if (!((_global.tablero[fila][columna + 1] == 1) and (_global.tablero[fila - 1][columna] == 1))) {
break;
}
columsig = this.columna + 1;
filsig = this.fila - 1;
_local4++;
if (((cuerpo._currentframe < 41) and (estoyentablero == true)) or ((cuerpo._currentframe > 60) and (estoyentablero == true))) {
cuerpo.gotoAndPlay(41);
}
actorretas(filsig, columsig);
}
if (_local4 == 0) {
_local4 = _local3[0];
_local5 = 0;
i = 1;
while (i <= 3) {
if (_local3[i] <= _local4) {
_local4 = _local3[i];
_local5 = i;
}
i++;
}
switch (_local5) {
case 0 :
filsig = this.fila + 1;
columsig = this.columna;
if ((cuerpo._currentframe > 20) and (estoyentablero == true)) {
cuerpo.gotoAndPlay(1);
}
actorretas(filsig, columsig);
break;
case 1 :
filsig = this.fila - 1;
columsig = this.columna;
if (((cuerpo._currentframe < 21) and (estoyentablero == true)) or ((cuerpo._currentframe > 40) and (estoyentablero == true))) {
cuerpo.gotoAndPlay(21);
}
actorretas(filsig, columsig);
break;
case 2 :
columsig = this.columna + 1;
filsig = this.fila;
if (((cuerpo._currentframe < 81) and (estoyentablero == true)) or ((cuerpo._currentframe > 100) and (estoyentablero == true))) {
cuerpo.gotoAndPlay(81);
}
actorretas(filsig, columsig);
break;
case 3 :
columsig = this.columna - 1;
filsig = this.fila;
if (((cuerpo._currentframe < 141) and (estoyentablero == true)) or ((cuerpo._currentframe > 160) and (estoyentablero == true))) {
cuerpo.gotoAndPlay(141);
}
actorretas(filsig, columsig);
}
}
pensar = 0;
}
if (estoyentablero == false) {
filsig = fila;
columsig = columna;
while (tabIA[fila][columna] >= 999) {
fila = 11 + _local7;
filsig = fila;
columsig = columna;
_local7++;
}
}
if (frenatorreta != null) {
if (this.hitTest(frenatorreta.alcance) == false) {
lento = 1;
frenatorreta = null;
}
}
if (_global.tablero[filsig][columsig] == 0) {
pensar = 1;
}
if (this._x < ((columsig * 20) + 10)) {
this._x = this._x + (this.velocidad * lento);
_local9 = 1;
}
if (this._x > ((columsig * 20) + 10)) {
this._x = this._x - (this.velocidad * lento);
_local9 = -1;
}
if (this._y < ((filsig * 20) + 10)) {
this._y = this._y + (this.velocidad * lento);
_local8 = 1;
}
if (this._y > ((filsig * 20) + 10)) {
this._y = this._y - (this.velocidad * lento);
_local8 = -1;
}
if (Math.abs(this._x - ((columsig * 20) + 10)) <= velocidad) {
if (Math.abs(this._y - ((filsig * 20) + 10)) <= velocidad) {
this.fila = filsig;
this.columna = columsig;
pensar = 1;
if (estoyentablero == false) {
estoyentablero = true;
}
}
}
}
function eliminar() {
if (_global.tableroIA[fila][columna] == 1) {
columsig = 100;
if ((cuerpo._currentframe < 81) or (cuerpo._currentframe > 100)) {
cuerpo.gotoAndPlay(81);
}
}
if (this._x > 700) {
delete _global.enemigos[this];
_global.vida = _global.vida - 1;
_level0.terreno.attachMovie("laugh", "D" + this, _level0.terreno.getNextHighestDepth());
if (_level0.terreno.info.objeto == this) {
_level0.terreno.info.gotoAndStop(1);
_level0.terreno.info.ataque1.text = "";
_level0.terreno.info.distancia1.text = "";
_level0.terreno.info.coste1.text = "";
_level0.terreno.info.ataque2.text = "";
_level0.terreno.info.distancia2.text = "";
_level0.terreno.info.coste2.text = "";
}
if (_level0.terreno.markerbi.enemigo == this) {
_level0.terreno.markerbi.removeMovieClip();
}
this.removeMovieClip();
}
if (vida <= 0) {
delete _global.enemigos[this];
_global.puntos = _global.puntos + (100 * factorpuntos);
_global.dinero = _global.dinero + dinero;
if (_level0.terreno.info.objeto == this) {
_level0.terreno.info.gotoAndStop(1);
_level0.terreno.info.ataque1.text = "";
_level0.terreno.info.distancia1.text = "";
_level0.terreno.info.coste1.text = "";
_level0.terreno.info.ataque2.text = "";
_level0.terreno.info.distancia2.text = "";
_level0.terreno.info.coste2.text = "";
}
if (_level0.terreno.markerbi.enemigo == this) {
_level0.terreno.markerbi.removeMovieClip();
}
_level0.terreno.attachMovie("DWEE", "D" + this, _level0.terreno.getNextHighestDepth());
_level0.terreno.attachMovie("sumadinero", "Di" + this, _level0.terreno.getNextHighestDepth(), {_x:_level0.terreno.dinero._x + 45, _y:_level0.terreno.dinero._y + 5, coste:dinero});
this.removeMovieClip();
}
}
function actorretas(fil, colum) {
for (k in _global.tableroalcance[fil][colum]) {
_global.tableroalcance[fil][colum][k].activardisparo = true;
_global.tableroalcance[fil][colum][k].enemigosatiro[this] = this;
}
}
var fila;
var columna;
var velocidad = 3;
var vida;
var factordinero = 1;
var factorpuntos = 1;
var factorvida = 1;
var tipo = "normal";
var lento = 1;
var dinero;
var vidatotal = vida;
var clase = "H";
var indice;
var pensar = 1;
var filsig;
var columsig;
var frenatorreta = null;
var vidafutura = vida;
var estoyentablero = false;
hitArea = hitcuerpo;
hitcuerpo._visible = false;
this.cacheAsBitmap = true;
cuerpo.gotoAndPlay("lado");
vida = vida * factorvida;
this.swapDepths(_parent.getNextHighestDepth());
_global.enemigos[this] = this;
if (_global.tableroIA[fila][columna] >= 999) {
i = 11;
while (i <= 14) {
if (_global.tableroIA[i][0] < 999) {
fila = i;
columna = 0;
break;
}
i++;
}
}
onPress = function () {
if (_global.STOP == false) {
_level0.terreno.info.objeto = this;
_level0.terreno.info.gotoAndStop(2);
_level0.terreno.info.foto.gotoAndStop("common");
_level0.terreno.markerbi.removeMovieClip();
_level0.terreno.attachMovie("markerbi", "markerbi", _level0.terreno.getNextHighestDepth(), {_x:this._x, _y:this._y, _alpha:50, enemigo:this});
}
};
onEnterFrame = function () {
if (_global.STOP == false) {
mover(_global.tableroIA, _global.longtab);
this.eliminar();
}
};
stop();
Symbol 157 MovieClip Frame 1
this.onPress = function () {
this.getURL("http://www.doyugames.com", "_blank");
};
Symbol 166 MovieClip Frame 1
onEnterFrame = function () {
this.porcen.text = Math.floor(this._parent.carga);
this.mascara._xscale = (326 * this._parent.carga) / 100;
};
Symbol 171 MovieClip Frame 1
var loadsession = new LoadVars();
var cont = 0;
var aux = false;
var carga;
onEnterFrame = function () {
cont++;
carga = (this._parent.getBytesLoaded() / this._parent.getBytesTotal()) * 100;
if (this._currentframe == 220) {
this.gotoAndPlay(70);
}
if ((((this._parent.getBytesLoaded() / this._parent.getBytesTotal()) == 1) and (cont <= 50)) and (aux == false)) {
cont = 0;
aux = true;
this.gotoAndPlay("cargado");
}
if ((((this._parent.getBytesLoaded() / this._parent.getBytesTotal()) == 1) and (this._currentframe >= 100)) and (cont > 50)) {
_level0.gotoAndStop("menu");
}
};
Symbol 171 MovieClip Frame 221
stop();
Symbol 171 MovieClip Frame 254
_level0.gotoAndStop("menu");
stop();
Symbol 178 MovieClip Frame 1
this.cacheAsBitmap = true;
Symbol 180 MovieClip Frame 1
this.cacheAsBitmap = true;
Symbol 200 MovieClip Frame 1
this.cacheAsBitmap = true;
Symbol 235 MovieClip [info_juego] Frame 1
var foto;
this.gotoAndStop(foto);
stop();
Symbol 235 MovieClip [info_juego] Frame 2
stop();
Symbol 235 MovieClip [info_juego] Frame 3
stop();
Symbol 235 MovieClip [info_juego] Frame 4
stop();
Symbol 235 MovieClip [info_juego] Frame 5
stop();
Symbol 235 MovieClip [info_juego] Frame 6
stop();
Symbol 235 MovieClip [info_juego] Frame 7
stop();
Symbol 239 MovieClip [sumadinero] Frame 1
var coste;
var aux = false;
var cont = 0;
dinero.text = coste;
onEnterFrame = function () {
this._y++;
cont++;
if (cont >= 15) {
this.removeMovieClip();
}
};
Symbol 244 MovieClip [suelo_roto] Frame 1
this.cacheAsBitmap = true;
stop();
Symbol 244 MovieClip [suelo_roto] Frame 2
stop();
Symbol 244 MovieClip [suelo_roto] Frame 3
stop();
Symbol 249 MovieClip [Press_ next] Frame 1
var control;
var existo = true;
control = _level0.jefe.nivel;
this.cacheAsBitmap = true;
onEnterFrame = function () {
if (control != _level0.jefe.nivel) {
this.removeMovieClip();
}
for (i in _global.enemigos) {
this.removeMovieClip();
}
};
Symbol 259 MovieClip Frame 1
onPress = function () {
_level0.pressnext.removeMovieClip();
_level0.gotoAndPlay("menu");
this._parent.removeMovieClip();
};
Symbol 261 MovieClip Frame 1
onPress = function () {
_global.STOP = false;
_level0.terreno.musica.cancion.stop();
delete _level0.terreno.musica.cancion;
_level0.pressnext.removeMovieClip();
switch (this._parent._parent.terreno.dificultad) {
case "facil" :
_level0.gotoAndPlay("loadingfacil");
break;
case "medio" :
_level0.gotoAndPlay("loading");
break;
case "medio_avanzado" :
_level0.gotoAndPlay("loagingmedioavanzado");
break;
case "dificil" :
_level0.gotoAndPlay("loadingdificil");
}
this._parent.removeMovieClip();
};
Symbol 266 MovieClip [finjuego] Frame 1
puntucionfinal.text = _global.puntos;
nivelfinal.text = _level0.jefe.nivel + 1;
stop();
Symbol 269 MovieClip Frame 1
onPress = function () {
_global.STOP = false;
_level0.terreno.botonSTOP.activado = false;
this._parent.removeMovieClip();
};
Symbol 277 MovieClip [BLOQUEAS] Frame 30
this.removeMovieClip();
Symbol 281 MovieClip Frame 1
this.onPress = function () {
var _local2;
_local2 = this._parent._target;
if (_local2 == "/menu2") {
_level0.menuinicio.secciones.plays.enabled = true;
_level0.menuinicio.secciones.how.enabled = true;
_level0.menuinicio.secciones.more_games.enabled = true;
_level0.menuinicio.secciones.instruc.enabled = true;
}
if (((((((((((_local2 == "/sky") or (_local2 == "/normal")) or (_local2 == "/slow")) or (_local2 == "/fast")) or (_local2 == "/power")) or (_local2 == "/crazy")) or (_local2 == "/family")) or (_local2 == "/flyer")) or (_local2 == "/master")) or (_local2 == "/runner")) or (_local2 == "/common")) {
_level0.menu2.bsky.enabled = true;
_level0.menu2.bnormal.enabled = true;
_level0.menu2.bslow.enabled = true;
_level0.menu2.bfast.enabled = true;
_level0.menu2.bpower.enabled = true;
_level0.menu2.bcrazy.enabled = true;
_level0.menu2.bcommon.enabled = true;
_level0.menu2.bfamily.enabled = true;
_level0.menu2.bflyer.enabled = true;
_level0.menu2.bmaster.enabled = true;
_level0.menu2.brunner.enabled = true;
_level0.menu2.cerrar.enabled = true;
}
this._parent.removeMovieClip();
};
Symbol 285 MovieClip Frame 1
this.onPress = function () {
_level0.attachMovie("menu3", "common", 8000, {_x:620, _y:320});
_level0.common.gotoAndStop("common");
_level0.menu2.bsky.enabled = false;
_level0.menu2.bnormal.enabled = false;
_level0.menu2.bslow.enabled = false;
_level0.menu2.bfast.enabled = false;
_level0.menu2.bpower.enabled = false;
_level0.menu2.bcrazy.enabled = true;
_level0.menu2.bcommon.enabled = true;
_level0.menu2.bfamily.enabled = true;
_level0.menu2.bflyer.enabled = true;
_level0.menu2.bmaster.enabled = true;
_level0.menu2.brunner.enabled = true;
_level0.menu2.cerrar.enabled = false;
};
Symbol 288 MovieClip Frame 1
this.onPress = function () {
_level0.attachMovie("menu3", "master", 8000, {_x:620, _y:320});
_level0.master.gotoAndStop("master");
_level0.menu2.bsky.enabled = false;
_level0.menu2.bnormal.enabled = false;
_level0.menu2.bslow.enabled = false;
_level0.menu2.bfast.enabled = false;
_level0.menu2.bpower.enabled = false;
_level0.menu2.bcrazy.enabled = true;
_level0.menu2.bcommon.enabled = true;
_level0.menu2.bfamily.enabled = true;
_level0.menu2.bflyer.enabled = true;
_level0.menu2.bmaster.enabled = true;
_level0.menu2.brunner.enabled = true;
_level0.menu2.cerrar.enabled = false;
};
Symbol 291 MovieClip Frame 1
this.onPress = function () {
_level0.attachMovie("menu3", "flyer", 8000, {_x:620, _y:320});
_level0.flyer.gotoAndStop("flyer");
_level0.menu2.bsky.enabled = false;
_level0.menu2.bnormal.enabled = false;
_level0.menu2.bslow.enabled = false;
_level0.menu2.bfast.enabled = false;
_level0.menu2.bpower.enabled = false;
_level0.menu2.bcrazy.enabled = true;
_level0.menu2.bcommon.enabled = true;
_level0.menu2.bfamily.enabled = true;
_level0.menu2.bflyer.enabled = true;
_level0.menu2.bmaster.enabled = true;
_level0.menu2.brunner.enabled = true;
_level0.menu2.cerrar.enabled = false;
};
Symbol 294 MovieClip Frame 1
this.onPress = function () {
_level0.attachMovie("menu3", "crazy", 8000, {_x:620, _y:320});
_level0.crazy.gotoAndStop("crazy");
_level0.menu2.bsky.enabled = false;
_level0.menu2.bnormal.enabled = false;
_level0.menu2.bslow.enabled = false;
_level0.menu2.bfast.enabled = false;
_level0.menu2.bpower.enabled = false;
_level0.menu2.bcrazy.enabled = true;
_level0.menu2.bcommon.enabled = true;
_level0.menu2.bfamily.enabled = true;
_level0.menu2.bflyer.enabled = true;
_level0.menu2.bmaster.enabled = true;
_level0.menu2.brunner.enabled = true;
_level0.menu2.cerrar.enabled = false;
};
Symbol 297 MovieClip Frame 1
this.onPress = function () {
_level0.attachMovie("menu3", "family", 8000, {_x:620, _y:320});
_level0.family.gotoAndStop("family");
_level0.menu2.bsky.enabled = false;
_level0.menu2.bnormal.enabled = false;
_level0.menu2.bslow.enabled = false;
_level0.menu2.bfast.enabled = false;
_level0.menu2.bpower.enabled = false;
_level0.menu2.bcrazy.enabled = true;
_level0.menu2.bcommon.enabled = true;
_level0.menu2.bfamily.enabled = true;
_level0.menu2.bflyer.enabled = true;
_level0.menu2.bmaster.enabled = true;
_level0.menu2.brunner.enabled = true;
_level0.menu2.cerrar.enabled = false;
};
Symbol 300 MovieClip Frame 1
this.onPress = function () {
_level0.attachMovie("menu3", "runner", 8000, {_x:620, _y:320});
_level0.runner.gotoAndStop("runner");
_level0.menu2.bsky.enabled = false;
_level0.menu2.bnormal.enabled = false;
_level0.menu2.bslow.enabled = false;
_level0.menu2.bfast.enabled = false;
_level0.menu2.bpower.enabled = false;
_level0.menu2.bcrazy.enabled = true;
_level0.menu2.bcommon.enabled = true;
_level0.menu2.bfamily.enabled = true;
_level0.menu2.bflyer.enabled = true;
_level0.menu2.bmaster.enabled = true;
_level0.menu2.brunner.enabled = true;
_level0.menu2.cerrar.enabled = false;
};
Symbol 303 MovieClip Frame 1
this.onPress = function () {
_level0.attachMovie("menu4", "sky", 8000, {_x:620, _y:320});
_level0.sky.gotoAndStop("sky");
_level0.menu2.bsky.enabled = true;
_level0.menu2.bnormal.enabled = true;
_level0.menu2.bslow.enabled = true;
_level0.menu2.bfast.enabled = true;
_level0.menu2.bpower.enabled = true;
_level0.menu2.bcrazy.enabled = false;
_level0.menu2.bcommon.enabled = false;
_level0.menu2.bfamily.enabled = false;
_level0.menu2.bflyer.enabled = false;
_level0.menu2.bmaster.enabled = false;
_level0.menu2.brunner.enabled = false;
_level0.menu2.cerrar.enabled = false;
};
Symbol 305 MovieClip Frame 1
this.onPress = function () {
_level0.attachMovie("menu4", "slow", 8000, {_x:620, _y:320});
_level0.slow.gotoAndStop("slow");
_level0.menu2.bsky.enabled = true;
_level0.menu2.bnormal.enabled = true;
_level0.menu2.bslow.enabled = true;
_level0.menu2.bfast.enabled = true;
_level0.menu2.bpower.enabled = true;
_level0.menu2.bcrazy.enabled = false;
_level0.menu2.bcommon.enabled = false;
_level0.menu2.bfamily.enabled = false;
_level0.menu2.bflyer.enabled = false;
_level0.menu2.bmaster.enabled = false;
_level0.menu2.brunner.enabled = false;
_level0.menu2.cerrar.enabled = false;
};
Symbol 307 MovieClip Frame 1
this.onPress = function () {
_level0.attachMovie("menu4", "power", 8000, {_x:620, _y:320});
_level0.power.gotoAndStop("power");
_level0.menu2.bsky.enabled = true;
_level0.menu2.bnormal.enabled = true;
_level0.menu2.bslow.enabled = true;
_level0.menu2.bfast.enabled = true;
_level0.menu2.bpower.enabled = true;
_level0.menu2.bcrazy.enabled = false;
_level0.menu2.bcommon.enabled = false;
_level0.menu2.bfamily.enabled = false;
_level0.menu2.bflyer.enabled = false;
_level0.menu2.bmaster.enabled = false;
_level0.menu2.brunner.enabled = false;
_level0.menu2.cerrar.enabled = false;
};
Symbol 309 MovieClip Frame 1
this.onPress = function () {
_level0.attachMovie("menu4", "fast", 8000, {_x:620, _y:320});
_level0.fast.gotoAndStop("fast");
_level0.menu2.bsky.enabled = true;
_level0.menu2.bnormal.enabled = true;
_level0.menu2.bslow.enabled = true;
_level0.menu2.bfast.enabled = true;
_level0.menu2.bpower.enabled = true;
_level0.menu2.bcrazy.enabled = false;
_level0.menu2.bcommon.enabled = false;
_level0.menu2.bfamily.enabled = false;
_level0.menu2.bflyer.enabled = false;
_level0.menu2.bmaster.enabled = false;
_level0.menu2.brunner.enabled = false;
_level0.menu2.cerrar.enabled = false;
};
Symbol 311 MovieClip Frame 1
this.onPress = function () {
_level0.attachMovie("menu4", "normal", 8000, {_x:620, _y:320});
_level0.normal.gotoAndStop("normal");
_level0.menu2.bsky.enabled = true;
_level0.menu2.bnormal.enabled = true;
_level0.menu2.bslow.enabled = true;
_level0.menu2.bfast.enabled = true;
_level0.menu2.bpower.enabled = true;
_level0.menu2.bcrazy.enabled = false;
_level0.menu2.bcommon.enabled = false;
_level0.menu2.bfamily.enabled = false;
_level0.menu2.bflyer.enabled = false;
_level0.menu2.bmaster.enabled = false;
_level0.menu2.brunner.enabled = false;
_level0.menu2.cerrar.enabled = false;
};
Symbol 344 MovieClip [menu2] Frame 10
stop();
Symbol 352 MovieClip [menu3] Frame 1
stop();
Symbol 352 MovieClip [menu3] Frame 2
stop();
Symbol 352 MovieClip [menu3] Frame 3
stop();
Symbol 352 MovieClip [menu3] Frame 4
stop();
Symbol 352 MovieClip [menu3] Frame 5
stop();
Symbol 352 MovieClip [menu3] Frame 6
stop();
Symbol 385 MovieClip [menu4] Frame 1
stop();
Symbol 385 MovieClip [menu4] Frame 2
stop();
Symbol 385 MovieClip [menu4] Frame 3
stop();
Symbol 385 MovieClip [menu4] Frame 4
stop();
Symbol 385 MovieClip [menu4] Frame 5
stop();
Symbol 388 MovieClip Frame 1
var cancion = new Sound();
cancion.attachSound("059rgg_5");
cancion.setVolume(_global.volumen);
Symbol 389 MovieClip [p_torreta] Frame 1
var cancion = new Sound();
cancion.attachSound("s_ptorreta");
cancion.setVolume(_global.volumen);
cancion.start(0, 1);
this.removeMovieClip();
Symbol 390 MovieClip [laugh] Frame 1
var cancion = new Sound();
cancion.attachSound("s_risa");
cancion.setVolume(_global.volumen);
cancion.start(0, 1);
this.removeMovieClip();
Symbol 391 MovieClip [DWEE] Frame 1
var cancion = new Sound();
cancion.attachSound("b_muere");
cancion.setVolume(_global.volumen);
cancion.start(0, 1);
this.removeMovieClip();
Symbol 392 MovieClip [disparo4] Frame 1
var cancion = new Sound();
cancion.attachSound("sonido_sonico");
cancion.setVolume(_global.volumen);
cancion.start(0, 1);
this.removeMovieClip();
Symbol 393 MovieClip [disparo3] Frame 1
var cancion = new Sound();
cancion.attachSound("s_hielo");
cancion.setVolume(_global.volumen);
cancion.start(0, 1);
this.removeMovieClip();
Symbol 394 MovieClip [disparo2] Frame 1
var cancion = new Sound();
cancion.attachSound("s_torretaaerea");
cancion.setVolume(_global.volumen);
cancion.start(0, 1);
this.removeMovieClip();
Symbol 395 MovieClip [disparo1] Frame 1
var cancion = new Sound();
cancion.attachSound("s_torreta1");
cancion.setVolume(_global.volumen);
cancion.start(0, 1);
this.removeMovieClip();
Symbol 405 MovieClip [todosonido] Frame 1
stop();
Symbol 407 MovieClip Frame 1
this._visible = false;
this.cacheAsBitmap = true;
Symbol 416 MovieClip Frame 1
this.cacheAsBitmap = true;
Symbol 422 MovieClip Frame 1
this.cacheAsBitmap = true;
Symbol 423 MovieClip [Torreta5] Frame 1
function disparo(enem) {
var _local7 = false;
if (activardisparo == true) {
for (i in enem) {
if (this.alcance.hitTest(enem[i]) and (enem[i].vidafutura > 0)) {
if (enem[i].tipo == "aereo") {
enemigofijado = enem[i];
this._parent.attachMovie("bala5", k, this._parent.getNextHighestDepth(), {_x:this._x, _y:this._y, blanco:enemigofijado, da\u00F1os:fuego[nivel]});
_local7 = true;
enem[i].vidafutura = enem[i].vidafutura - fuego[nivel];
} else {
delete enem[i];
}
}
}
if (_local7 == true) {
disparando = true;
} else {
contador = 1;
disparando = false;
}
for (i in enem) {
if (this.alcance2.hitTest(enem[i])) {
return(undefined);
}
}
}
activardisparo = false;
}
function actualizar() {
_level0.terreno.info.gotoAndStop(1);
if ((_global.dinero - (coste[nivel + 1] - coste[nivel])) < 0) {
_level0.attachMovie("nodinero", "nodinero", _level0.getNextHighestDepth(), {_x:600, _y:500});
}
if (nivel >= 5) {
_level0.attachMovie("nopuedes", "nopuedes", _level0.getNextHighestDepth(), {_x:600, _y:490});
}
if (((_global.dinero - (coste[nivel + 1] - coste[nivel])) >= 0) and (actualizando == false)) {
if (nivel < 5) {
if (_global.empezar == 0) {
_global.dinero = _global.dinero - (coste[nivel + 1] - coste[nivel]);
nivel++;
this.alcance._height = distancia[nivel];
this.alcance._width = distancia[nivel];
this.alcance2._height = distancia[nivel] + 20;
this.alcance2._width = distancia[nivel] + 20;
numerito.cuerpo._x = numerito.cuerpo._x - 30;
_level0.terreno.info.ataque.text = fuego[nivel];
_level0.terreno.info.distancia.text = distancia[nivel];
_level0.terreno.info.coste.text = coste[nivel];
if (nivel < 5) {
_level0.terreno.info.ataque2.text = fuego[nivel + 1];
_level0.terreno.info.distancia2.text = distancia[nivel + 1];
_level0.terreno.info.coste2.text = coste[nivel + 1];
_level0.terreno.info.costeactualizar.text = coste[nivel + 1] - coste[nivel];
} else {
_level0.terreno.info.ataque2.text = "";
_level0.terreno.info.distancia2.text = "";
_level0.terreno.info.coste2.text = "";
_level0.terreno.info.costeactualizar.text = "";
}
return(undefined);
}
clearInterval(this.intervalID);
this.intervalId = setInterval(this, "barrita", 40);
_level0.terreno.marker.removeMovieClip();
this.attachMovie("barritaac", "barriac1", this._parent.getNextHighestDepth(), {_x:-20, _y:0});
_global.dinero = _global.dinero - (coste[nivel + 1] - coste[nivel]);
actualizando = true;
}
}
}
function barrita() {
conttiempo++;
porcenac = (0.04 * conttiempo) / tiempo[nivel];
this.barriac1.cuerpo._xscale = porcenac * 100;
if (porcenac == 1) {
this.barriac1.removeMovieClip();
nivel++;
this.alcance._height = distancia[nivel];
this.alcance._width = distancia[nivel];
this.alcance2._height = distancia[nivel] + 20;
this.alcance2._width = distancia[nivel] + 20;
if (_level0.terreno.info.objeto == this) {
_level0.terreno.info.ataque.text = fuego[nivel];
_level0.terreno.info.distancia.text = distancia[nivel];
_level0.terreno.info.coste.text = coste[nivel];
if (nivel < 5) {
_level0.terreno.info.ataque2.text = fuego[nivel + 1];
_level0.terreno.info.distancia2.text = distancia[nivel + 1];
_level0.terreno.info.coste2.text = coste[nivel + 1];
_level0.terreno.info.costeactualizar.text = coste[nivel + 1] - coste[nivel];
} else {
_level0.terreno.info.ataque2.text = "";
_level0.terreno.info.distancia2.text = "";
_level0.terreno.info.coste2.text = "";
_level0.terreno.info.costeactualizar.text = "";
}
_level0.terreno.marker.removeMovieClip();
_level0.terreno.attachMovie("marker", "marker", this.getDepth() - 1, {_x:this._x, _y:this._y});
}
clearInterval(this.intervalId);
delete this.intervalID;
actualizando = false;
conttiempo = 0;
numerito.cuerpo._x = numerito.cuerpo._x - 30;
}
}
function borrar() {
var _local4;
var _local3;
var _local6;
var _local5;
_local4 = -1;
while (_local4 <= 0) {
_local3 = -1;
while (_local3 <= 0) {
_global.tablero[(this._y / 20) + _local4][(this._x / 20) + _local3] = 1;
_local3++;
}
_local4++;
}
if (_global.empezar != 0) {
_local4 = -1;
while (_local4 <= 0) {
_local3 = -1;
while (_local3 <= 0) {
_level0.terreno.suelo[(this._y / 20) + _local4][(this._x / 20) + _local3]++;
_local6 = (this._y / 20) + _local4;
_local5 = (this._x / 20) + _local3;
switch (_level0.terreno.suelo[_local6][_local5]) {
case 1 :
_level0.terreno.attachMovie("suelo_roto", ("suelo" + _local6) + _local5, ((26 * _local6) + _local5) + 1, {_x:(Math.ceil(this._x / 20) + _local3) * 20, _y:(Math.ceil(this._y / 20) + _local4) * 20});
break;
case 2 :
_level0.terreno[("suelo" + _local6) + _local5].gotoAndStop(2);
break;
case 3 :
_level0.terreno[("suelo" + _local6) + _local5].gotoAndStop(3);
}
_local3++;
}
_local4++;
}
}
this._parent.IA3(_global.tablero, _global.tableroIA, _global.tableroaux, _global.longtab, 0);
this._parent.IA3(_global.tablero, _global.tableroIAv, _global.tableroaux, _global.longtab, 1);
if (_global.empezar == 0) {
_global.dinero = _global.dinero + coste[nivel];
}
this.removeMovieClip();
}
function segenem() {
if (activardisparo == true) {
var _local3;
var _local2;
var _local4;
_local3 = this._x - enemigofijado._x;
_local2 = this._y - enemigofijado._y;
_local4 = Math.atan2(_local2, _local3);
this.cuerpo._rotation = (360 * _local4) / (Math.PI*2);
}
}
var nivel = 0;
var fuego = new Array();
fuego[0] = 30;
fuego[1] = 50;
fuego[2] = 100;
fuego[3] = 200;
fuego[4] = 350;
fuego[5] = 840;
var coste = new Array();
coste[0] = 40;
coste[1] = 75;
coste[2] = 120;
coste[3] = 200;
coste[4] = 300;
coste[5] = 600;
var distancia = new Array();
distancia[0] = 100;
distancia[1] = 110;
distancia[2] = 120;
distancia[3] = 130;
distancia[4] = 140;
distancia[5] = 150;
var tiempo = new Array();
tiempo[0] = 2;
tiempo[1] = 3;
tiempo[2] = 4;
tiempo[3] = 5;
tiempo[4] = 6;
var frecdisparo = 25;
var activar = 1;
var enemigofijado;
var contador = 0;
var aux = 0;
var aux2 = 0;
var activardisparo = false;
var disparando = false;
_global.activarboton = false;
var actualizando = false;
var conttiempo = 0;
var porcenac = 0;
var intervalId;
var enemigosatiro = new Array();
var profundidad = this.getDepth();
actualizacionactual.text = nivel;
this.cacheAsBitmap = true;
for (i in enemigosflier) {
if (this.getDepth >= enemigosflier[i].getDepth) {
this.swapDepths(enemigosflier[i]);
}
}
cuerpo.onPress = function () {
if (_global.STOP == false) {
var _local4 = new Array();
i = 0;
while (i <= _global.longtab) {
_local4[i] = new Array();
i++;
}
var _local3 = new Array();
i = 0;
while (i <= _global.longtab) {
_local3[i] = new Array();
i++;
}
var _local5 = false;
if ((activar == 0) and (aux2 == 1)) {
_level0.terreno.info.gotoAndStop(1);
_level0.terreno.info.ataque.text = fuego[nivel];
_level0.terreno.info.distancia.text = distancia[nivel];
_level0.terreno.info.coste.text = coste[nivel];
if (nivel < 5) {
_level0.terreno.info.ataque2.text = fuego[nivel + 1];
_level0.terreno.info.distancia2.text = distancia[nivel + 1];
_level0.terreno.info.coste2.text = coste[nivel + 1];
_level0.terreno.info.costeactualizar.text = coste[nivel + 1] - coste[nivel];
} else {
_level0.terreno.info.ataque2.text = "";
_level0.terreno.info.distancia2.text = "";
_level0.terreno.info.coste2.text = "";
_level0.terreno.info.costeactualizar.text = "";
}
_level0.terreno.info.objeto = this._parent;
this._parent.alcance._alpha = 100;
_level0.terreno.marker.removeMovieClip();
_level0.terreno.attachMovie("marker", "marker", profundidad - 1, {_x:this._parent._x, _y:this._parent._y});
}
i = -1;
while (i <= 0) {
j = -1;
while (j <= 0) {
if (_level0.terreno.suelo[(this._parent._y / 20) + j][(this._parent._x / 20) + i] >= 3) {
_local5 = true;
}
j++;
}
i++;
}
if (activar == 1) {
if (((((_global.tablero[this._parent._y / 20][this._parent._x / 20] == 1) and (_global.tablero[(this._parent._y / 20) - 1][this._parent._x / 20] == 1)) and (_global.tablero[this._parent._y / 20][(this._parent._x / 20) - 1] == 1)) and (_global.tablero[(this._parent._y / 20) - 1][(this._parent._x / 20) - 1] == 1)) and (_local5 == false)) {
activar = 0;
_global.tablero[this._parent._y / 20][this._parent._x / 20] = 0;
_global.tablero[(this._parent._y / 20) - 1][this._parent._x / 20] = 0;
_global.tablero[this._parent._y / 20][(this._parent._x / 20) - 1] = 0;
_global.tablero[(this._parent._y / 20) - 1][(this._parent._x / 20) - 1] = 0;
aux = 0;
i = 0;
while (i <= _global.longtab) {
j = 0;
while (j <= _global.longtab) {
_local4[i][j] = _global.tableroIA[i][j];
j++;
}
i++;
}
i = 0;
while (i <= _global.longtab) {
j = 0;
while (j <= _global.longtab) {
_local3[i][j] = _global.tableroIAv[i][j];
j++;
}
i++;
}
this._parent._parent.IA3(_global.tablero, _global.tableroIA, _global.tableroaux, _global.longtab, 0);
this._parent._parent.IA3(_global.tablero, _global.tableroIAv, _global.tableroaux, _global.longtab, 1);
for (i in _global.enemigos) {
if ((((_global.tableroIA[_global.enemigos[i].fila][_global.enemigos[i].columna] > 999) and (_global.enemigos[i].clase == "H")) and (enemigos[i].estoyentablero == true)) and (enemigos[i].tipo != "aereo")) {
aux++;
trace("Tipo: bloqueas el paso a un Doyu horizontal");
break;
}
if ((((_global.tableroIAv[_global.enemigos[i].fila][_global.enemigos[i].columna] > 999) and (_global.enemigos[i].clase == "V")) and (enemigos[i].estoyentablero == true)) and (enemigos[i].tipo != "aereo")) {
aux++;
trace("Tipo: bloqueas el paso a un Doyu vertical");
break;
}
}
if ((((_global.tableroIA[11][0] > 999) and (_global.tableroIA[12][0] > 999)) and (_global.tableroIA[13][0] > 999)) and (_global.tableroIA[14][0] > 999)) {
aux++;
trace("Tipo: bloqueas la entrada horizontal");
}
if ((((_global.tableroIAv[0][11] > 999) and (_global.tableroIAv[0][12] > 999)) and (_global.tableroIAv[0][13] > 999)) and (_global.tableroIAv[0][14] > 999)) {
aux++;
trace("Tipo: bloqueas la entrada vertical");
}
if (aux > 0) {
activar = 1;
_global.tablero[this._parent._y / 20][this._parent._x / 20] = 1;
_global.tablero[(this._parent._y / 20) - 1][this._parent._x / 20] = 1;
_global.tablero[this._parent._y / 20][(this._parent._x / 20) - 1] = 1;
_global.tablero[(this._parent._y / 20) - 1][(this._parent._x / 20) - 1] = 1;
_global.tableroIA = _local4;
_global.tableroIAv = _local3;
_level0.attachMovie("BLOQUEAS", "bloqueas", getNextHighestDepth(), {_x:640, _y:400, _xscale:80, _yscale:80});
} else {
_global.newtorreta++;
this._parent._alpha = 100;
this._parent.alcance._alpha = 0;
_level0.btorreta5.activar = 1;
_global.dinero = _global.dinero - coste[nivel];
i = -6;
while (i <= 5) {
j = -6;
while (j <= 5) {
_global.tableroalcance[(this._parent._y / 20) + i][(this._parent._x / 20) + j][this._parent] = this._parent;
j++;
}
i++;
}
delete _global.tableroalcance[(this._parent._y / 20) + -4][(this._parent._x / 20) + 4][this._parent];
delete _global.tableroalcance[(this._parent._y / 20) + -5][(this._parent._x / 20) + 4][this._parent];
delete _global.tableroalcance[(this._parent._y / 20) + -5][(this._parent._x / 20) + 3][this._parent];
delete _global.tableroalcance[(this._parent._y / 20) + 4][(this._parent._x / 20) + 4][this._parent];
delete _global.tableroalcance[(this._parent._y / 20) + 3][(this._parent._x / 20) + 4][this._parent];
delete _global.tableroalcance[(this._parent._y / 20) + 4][(this._parent._x / 20) + 3][this._parent];
delete _global.tableroalcance[(this._parent._y / 20) + 4][(this._parent._x / 20) + -5][this._parent];
delete _global.tableroalcance[(this._parent._y / 20) + 4][(this._parent._x / 20) + -4][this._parent];
delete _global.tableroalcance[(this._parent._y / 20) + 3][(this._parent._x / 20) + -5][this._parent];
delete _global.tableroalcance[(this._parent._y / 20) + -5][(this._parent._x / 20) + -5][this._parent];
delete _global.tableroalcance[(this._parent._y / 20) + -5][(this._parent._x / 20) + -4][this._parent];
delete _global.tableroalcance[(this._parent._y / 20) + -4][(this._parent._x / 20) + -5][this._parent];
_global.pretorreta = null;
if ((_global.dinero - coste[nivel]) >= 0) {
_level0.terreno.attachMovie("torreta5", "torr" + _global.cont, 700 + (2 * _global.cont), {_x:_level0.terreno._xmouse, _y:_level0.terreno._ymouse});
_global.pretorreta = _level0.terreno["torr" + _global.cont];
_global.cont++;
}
_global.activarboton = true;
this.attachMovie("p_torreta", this + "d", this.getNextHighestDepth());
aux2 = 1;
}
}
if (((((this._parent._y / 20) > _global.longtab) or ((this._parent._x / 20) > _global.longtab)) or ((this._parent._y / 20) < 0)) or ((this._parent._x / 20) < 0)) {
_level0.btorreta5.activar = 1;
_global.activarboton = true;
this._parent.removeMovieClip();
}
}
}
};
cuerpo.onRollOut = function () {
if (activar == 0) {
this._parent.alcance._alpha = 0;
}
};
onEnterFrame = function () {
if (_global.STOP == false) {
if (activar == 1) {
this._x = Math.floor(Math.floor(_parent._xmouse + (this.cuerpo._width / 4)) / 20) * 20;
this._y = Math.floor(Math.floor(_parent._ymouse + (this.cuerpo._width / 4)) / 20) * 20;
this._alpha = 50;
}
if ((((contador == 0) and (activar == 0)) and (disparando == true)) and (actualizando == false)) {
this.disparo(enemigosatiro);
}
if (((activar == 0) and (disparando == false)) and (actualizando == false)) {
this.disparo(enemigosatiro);
}
if (disparando == true) {
contador++;
}
if (contador == frecdisparo) {
contador = 0;
}
if (actualizando == false) {
segenem();
}
}
};
Symbol 427 MovieClip [Torreta4] Frame 1
function disparo(enem) {
if (activardisparo == true) {
if (((enemigofijado != null) and this.alcance.hitTest(enemigofijado)) and (enemigofijado.vidafutura > 0)) {
this._parent.attachMovie("bala", k, this._parent.getNextHighestDepth(), {_x:this._x, _y:this._y, blanco:enemigofijado, da\u00F1os:fuego[nivel]});
disparando = true;
enemigofijado.vidafutura = enemigofijado.vidafutura - fuego[nivel];
return(undefined);
}
for (i in enem) {
if (((this.alcance.hitTest(enem[i]) and (enem[i].vidafutura > 0)) and (enem[i].tipo != "aereo")) and (enem[i].activar != false)) {
enemigofijado = enem[i];
this._parent.attachMovie("bala", k, this._parent.getNextHighestDepth(), {_x:this._x, _y:this._y, blanco:enemigofijado, da\u00F1os:fuego[nivel]});
disparando = true;
enemigofijado.vidafutura = enemigofijado.vidafutura - fuego[nivel];
return(undefined);
}
delete enem[i];
}
for (i in enem) {
if (this.alcance2.hitTest(enem[i])) {
disparando = false;
return(undefined);
}
}
}
disparando = false;
activardisparo = false;
}
function actualizar() {
_level0.terreno.info.gotoAndStop(1);
if ((_global.dinero - (coste[nivel + 1] - coste[nivel])) < 0) {
_level0.attachMovie("nodinero", "nodinero", _level0.getNextHighestDepth(), {_x:600, _y:500});
}
if (nivel >= 5) {
_level0.attachMovie("nopuedes", "nopuedes", _level0.getNextHighestDepth(), {_x:600, _y:490});
}
if (((_global.dinero - (coste[nivel + 1] - coste[nivel])) >= 0) and (actualizando == false)) {
if (nivel < 5) {
if (_global.empezar == 0) {
_global.dinero = _global.dinero - (coste[nivel + 1] - coste[nivel]);
nivel++;
this.alcance._height = distancia[nivel];
this.alcance._width = distancia[nivel];
this.alcance2._height = distancia[nivel] + 20;
this.alcance2._width = distancia[nivel] + 20;
numerito.cuerpo._x = numerito.cuerpo._x - 30;
_level0.terreno.info.ataque.text = fuego[nivel];
_level0.terreno.info.distancia.text = distancia[nivel];
_level0.terreno.info.coste.text = coste[nivel];
if (nivel < 5) {
_level0.terreno.info.ataque2.text = fuego[nivel + 1];
_level0.terreno.info.distancia2.text = distancia[nivel + 1];
_level0.terreno.info.coste2.text = coste[nivel + 1];
_level0.terreno.info.costeactualizar.text = coste[nivel + 1] - coste[nivel];
} else {
_level0.terreno.info.ataque2.text = "";
_level0.terreno.info.distancia2.text = "";
_level0.terreno.info.coste2.text = "";
_level0.terreno.info.costeactualizar.text = "";
}
return(undefined);
}
clearInterval(this.intervalID);
this.intervalId = setInterval(this, "barrita", 40);
_level0.terreno.marker.removeMovieClip();
this.attachMovie("barritaac", "barriac1", this._parent.getNextHighestDepth(), {_x:-20, _y:0});
_global.dinero = _global.dinero - (coste[nivel + 1] - coste[nivel]);
actualizando = true;
}
}
}
function barrita() {
conttiempo++;
porcenac = (0.04 * conttiempo) / tiempo[nivel];
this.barriac1.cuerpo._xscale = porcenac * 100;
if (porcenac == 1) {
this.barriac1.removeMovieClip();
nivel++;
this.alcance._height = distancia[nivel];
this.alcance._width = distancia[nivel];
this.alcance2._height = distancia[nivel] + 20;
this.alcance2._width = distancia[nivel] + 20;
if (_level0.terreno.info.objeto == this) {
_level0.terreno.info.ataque.text = fuego[nivel];
_level0.terreno.info.distancia.text = distancia[nivel];
_level0.terreno.info.coste.text = coste[nivel];
if (nivel < 5) {
_level0.terreno.info.ataque2.text = fuego[nivel + 1];
_level0.terreno.info.distancia2.text = distancia[nivel + 1];
_level0.terreno.info.coste2.text = coste[nivel + 1];
_level0.terreno.info.costeactualizar.text = coste[nivel + 1] - coste[nivel];
} else {
_level0.terreno.info.ataque2.text = "";
_level0.terreno.info.distancia2.text = "";
_level0.terreno.info.coste2.text = "";
_level0.terreno.info.costeactualizar.text = "";
}
_level0.terreno.marker.removeMovieClip();
_level0.terreno.attachMovie("marker", "marker", this.getDepth() - 1, {_x:this._x, _y:this._y});
}
clearInterval(this.intervalId);
delete this.intervalID;
actualizando = false;
conttiempo = 0;
numerito.cuerpo._x = numerito.cuerpo._x - 30;
}
}
function borrar() {
var _local4;
var _local3;
var _local6;
var _local5;
_local4 = -1;
while (_local4 <= 0) {
_local3 = -1;
while (_local3 <= 0) {
_global.tablero[(this._y / 20) + _local4][(this._x / 20) + _local3] = 1;
_local3++;
}
_local4++;
}
if (_global.empezar != 0) {
_local4 = -1;
while (_local4 <= 0) {
_local3 = -1;
while (_local3 <= 0) {
_level0.terreno.suelo[(this._y / 20) + _local4][(this._x / 20) + _local3]++;
_local6 = (this._y / 20) + _local4;
_local5 = (this._x / 20) + _local3;
switch (_level0.terreno.suelo[_local6][_local5]) {
case 1 :
_level0.terreno.attachMovie("suelo_roto", ("suelo" + _local6) + _local5, ((26 * _local6) + _local5) + 1, {_x:(Math.ceil(this._x / 20) + _local3) * 20, _y:(Math.ceil(this._y / 20) + _local4) * 20});
break;
case 2 :
_level0.terreno[("suelo" + _local6) + _local5].gotoAndStop(2);
break;
case 3 :
_level0.terreno[("suelo" + _local6) + _local5].gotoAndStop(3);
}
_local3++;
}
_local4++;
}
}
this._parent.IA3(_global.tablero, _global.tableroIA, _global.tableroaux, _global.longtab, 0);
this._parent.IA3(_global.tablero, _global.tableroIAv, _global.tableroaux, _global.longtab, 1);
if (_global.empezar == 0) {
_global.dinero = _global.dinero + coste[nivel];
}
this.removeMovieClip();
}
function segenem() {
if (activardisparo == true) {
var _local3;
var _local2;
var _local4;
_local3 = this._x - enemigofijado._x;
_local2 = this._y - enemigofijado._y;
_local4 = Math.atan2(_local2, _local3);
this.cuerpo._rotation = (360 * _local4) / (Math.PI*2);
}
}
var nivel = 0;
var fuego = new Array();
fuego[0] = 180;
fuego[1] = 500;
fuego[2] = 1000;
fuego[3] = 2500;
fuego[4] = 6000;
fuego[5] = 15000;
var coste = new Array();
coste[0] = 100;
coste[1] = 220;
coste[2] = 365;
coste[3] = 540;
coste[4] = 1000;
coste[5] = 2000;
var distancia = new Array();
distancia[0] = 150;
distancia[1] = 155;
distancia[2] = 160;
distancia[3] = 165;
distancia[4] = 170;
distancia[5] = 200;
var tiempo = new Array();
tiempo[0] = 2;
tiempo[1] = 3;
tiempo[2] = 4;
tiempo[3] = 5;
tiempo[4] = 6;
var frecdisparo = 50;
var activar = 1;
var enemigofijado;
var contador = 0;
var aux = 0;
var aux2 = 0;
var activardisparo = false;
var disparando = false;
_global.activarboton = false;
var actualizando = false;
var conttiempo = 0;
var porcenac = 0;
var intervalId;
var enemigosatiro = new Array();
var profundidad = this.getDepth();
actualizacionactual.text = nivel;
this.cacheAsBitmap = true;
for (i in enemigosflier) {
if (this.getDepth >= enemigosflier[i].getDepth) {
this.swapDepths(enemigosflier[i]);
}
}
cuerpo.onPress = function () {
if (_global.STOP == false) {
var _local4 = new Array();
i = 0;
while (i <= _global.longtab) {
_local4[i] = new Array();
i++;
}
var _local3 = new Array();
i = 0;
while (i <= _global.longtab) {
_local3[i] = new Array();
i++;
}
var _local5 = false;
if ((activar == 0) and (aux2 == 1)) {
_level0.terreno.info.gotoAndStop(1);
_level0.terreno.info.ataque.text = fuego[nivel];
_level0.terreno.info.distancia.text = distancia[nivel];
_level0.terreno.info.coste.text = coste[nivel];
if (nivel < 5) {
_level0.terreno.info.ataque2.text = fuego[nivel + 1];
_level0.terreno.info.distancia2.text = distancia[nivel + 1];
_level0.terreno.info.coste2.text = coste[nivel + 1];
_level0.terreno.info.costeactualizar.text = coste[nivel + 1] - coste[nivel];
} else {
_level0.terreno.info.ataque2.text = "";
_level0.terreno.info.distancia2.text = "";
_level0.terreno.info.coste2.text = "";
_level0.terreno.info.costeactualizar.text = "";
}
_level0.terreno.info.objeto = this._parent;
this._parent.alcance._alpha = 100;
_level0.terreno.marker.removeMovieClip();
_level0.terreno.attachMovie("marker", "marker", profundidad - 1, {_x:this._parent._x, _y:this._parent._y});
}
i = -1;
while (i <= 0) {
j = -1;
while (j <= 0) {
if (_level0.terreno.suelo[(this._parent._y / 20) + j][(this._parent._x / 20) + i] >= 3) {
_local5 = true;
}
j++;
}
i++;
}
if (activar == 1) {
if (((((_global.tablero[this._parent._y / 20][this._parent._x / 20] == 1) and (_global.tablero[(this._parent._y / 20) - 1][this._parent._x / 20] == 1)) and (_global.tablero[this._parent._y / 20][(this._parent._x / 20) - 1] == 1)) and (_global.tablero[(this._parent._y / 20) - 1][(this._parent._x / 20) - 1] == 1)) and (_local5 == false)) {
activar = 0;
_global.tablero[this._parent._y / 20][this._parent._x / 20] = 0;
_global.tablero[(this._parent._y / 20) - 1][this._parent._x / 20] = 0;
_global.tablero[this._parent._y / 20][(this._parent._x / 20) - 1] = 0;
_global.tablero[(this._parent._y / 20) - 1][(this._parent._x / 20) - 1] = 0;
aux = 0;
i = 0;
while (i <= _global.longtab) {
j = 0;
while (j <= _global.longtab) {
_local4[i][j] = _global.tableroIA[i][j];
j++;
}
i++;
}
i = 0;
while (i <= _global.longtab) {
j = 0;
while (j <= _global.longtab) {
_local3[i][j] = _global.tableroIAv[i][j];
j++;
}
i++;
}
this._parent._parent.IA3(_global.tablero, _global.tableroIA, _global.tableroaux, _global.longtab, 0);
this._parent._parent.IA3(_global.tablero, _global.tableroIAv, _global.tableroaux, _global.longtab, 1);
for (i in _global.enemigos) {
if ((((_global.tableroIA[_global.enemigos[i].fila][_global.enemigos[i].columna] > 999) and (_global.enemigos[i].clase == "H")) and (enemigos[i].estoyentablero == true)) and (enemigos[i].tipo != "aereo")) {
aux++;
trace("Tipo: bloqueas el paso a un Doyu horizontal");
break;
}
if ((((_global.tableroIAv[_global.enemigos[i].fila][_global.enemigos[i].columna] > 999) and (_global.enemigos[i].clase == "V")) and (enemigos[i].estoyentablero == true)) and (enemigos[i].tipo != "aereo")) {
aux++;
trace("Tipo: bloqueas el paso a un Doyu vertical");
break;
}
}
if ((((_global.tableroIA[11][0] > 999) and (_global.tableroIA[12][0] > 999)) and (_global.tableroIA[13][0] > 999)) and (_global.tableroIA[14][0] > 999)) {
aux++;
trace("Tipo: bloqueas la entrada horizontal");
}
if ((((_global.tableroIAv[0][11] > 999) and (_global.tableroIAv[0][12] > 999)) and (_global.tableroIAv[0][13] > 999)) and (_global.tableroIAv[0][14] > 999)) {
aux++;
trace("Tipo: bloqueas la entrada vertical");
}
if (aux > 0) {
activar = 1;
_global.tablero[this._parent._y / 20][this._parent._x / 20] = 1;
_global.tablero[(this._parent._y / 20) - 1][this._parent._x / 20] = 1;
_global.tablero[this._parent._y / 20][(this._parent._x / 20) - 1] = 1;
_global.tablero[(this._parent._y / 20) - 1][(this._parent._x / 20) - 1] = 1;
_global.tableroIA = _local4;
_global.tableroIAv = _local3;
_level0.attachMovie("BLOQUEAS", "bloq", getNextHighestDepth(), {_x:640, _y:400, _xscale:80, _yscale:80});
} else {
_global.newtorreta++;
this._parent._alpha = 100;
this._parent.alcance._alpha = 0;
_level0.btorreta4.activar = 1;
_global.dinero = _global.dinero - coste[nivel];
i = -5;
while (i <= 4) {
j = -5;
while (j <= 4) {
_global.tableroalcance[(this._parent._y / 20) + i][(this._parent._x / 20) + j][this._parent] = this._parent;
j++;
}
i++;
}
delete _global.tableroalcance[(this._parent._y / 20) + -4][(this._parent._x / 20) + 4][this._parent];
delete _global.tableroalcance[(this._parent._y / 20) + -5][(this._parent._x / 20) + 4][this._parent];
delete _global.tableroalcance[(this._parent._y / 20) + -5][(this._parent._x / 20) + 3][this._parent];
delete _global.tableroalcance[(this._parent._y / 20) + 4][(this._parent._x / 20) + 4][this._parent];
delete _global.tableroalcance[(this._parent._y / 20) + 3][(this._parent._x / 20) + 4][this._parent];
delete _global.tableroalcance[(this._parent._y / 20) + 4][(this._parent._x / 20) + 3][this._parent];
delete _global.tableroalcance[(this._parent._y / 20) + 4][(this._parent._x / 20) + -5][this._parent];
delete _global.tableroalcance[(this._parent._y / 20) + 4][(this._parent._x / 20) + -4][this._parent];
delete _global.tableroalcance[(this._parent._y / 20) + 3][(this._parent._x / 20) + -5][this._parent];
delete _global.tableroalcance[(this._parent._y / 20) + -5][(this._parent._x / 20) + -5][this._parent];
delete _global.tableroalcance[(this._parent._y / 20) + -5][(this._parent._x / 20) + -4][this._parent];
delete _global.tableroalcance[(this._parent._y / 20) + -4][(this._parent._x / 20) + -5][this._parent];
_global.pretorreta = null;
if ((_global.dinero - coste[nivel]) >= 0) {
_level0.terreno.attachMovie("torreta4", "torr" + _global.cont, 700 + (2 * _global.cont), {_x:_level0.terreno._xmouse, _y:_level0.terreno._ymouse});
_global.pretorreta = _level0.terreno["torr" + _global.cont];
_global.cont++;
}
_global.activarboton = true;
this.attachMovie("p_torreta", this + "d", this.getNextHighestDepth());
aux2 = 1;
}
}
if (((((this._parent._y / 20) > _global.longtab) or ((this._parent._x / 20) > _global.longtab)) or ((this._parent._y / 20) < 0)) or ((this._parent._x / 20) < 0)) {
_level0.btorreta4.activar = 1;
_global.activarboton = true;
this._parent.removeMovieClip();
}
}
}
};
cuerpo.onRollOut = function () {
if (activar == 0) {
this._parent.alcance._alpha = 0;
}
};
onEnterFrame = function () {
if (_global.STOP == false) {
if (activar == 1) {
this._x = Math.floor(Math.floor(_parent._xmouse + (this.cuerpo._width / 4)) / 20) * 20;
this._y = Math.floor(Math.floor(_parent._ymouse + (this.cuerpo._width / 4)) / 20) * 20;
this._alpha = 50;
}
if ((((contador == 0) and (activar == 0)) and (disparando == true)) and (actualizando == false)) {
this.disparo(enemigosatiro);
}
if (((activar == 0) and (disparando == false)) and (actualizando == false)) {
this.disparo(enemigosatiro);
}
if (disparando == true) {
contador++;
}
if (contador == frecdisparo) {
contador = 0;
}
if (actualizando == false) {
segenem();
}
}
};
Symbol 432 MovieClip [Torreta3] Frame 1
function disparo(enem) {
if (activardisparo == false) {
this._parent["bala" + this].removeMovieClip();
disparorealizado = false;
activardisparo = true;
}
for (i in enem) {
if (this.alcance.hitTest(enem[i]) and (enem[i].lento > fuego[nivel])) {
if (disparorealizado == false) {
_level0.terreno.attachMovie("balahielo", "bala" + this, this._parent.getNextHighestDepth(), {_x:this._x, _y:this._y, _width:distancia[nivel] * 0.85, _height:distancia[nivel] * 0.85, blanco:enemigofijado, da\u00F1os:fuego[nivel], _alpha:40});
disparorealizado = true;
}
enem[i].lento = fuego[nivel];
enem[i].frenatorreta = this;
}
if (this.alcance.hitTest(enem[i]) == false) {
delete enem[i];
}
}
for (i in enem) {
if (this.alcance2.hitTest(enem[i])) {
return(undefined);
}
}
activardisparo = false;
}
function actualizar() {
_level0.terreno.info.gotoAndStop(1);
if ((_global.dinero - (coste[nivel + 1] - coste[nivel])) < 0) {
_level0.attachMovie("nodinero", "nodinero", _level0.getNextHighestDepth(), {_x:600, _y:500});
}
if (nivel >= 5) {
_level0.attachMovie("nopuedes", "nopuedes", _level0.getNextHighestDepth(), {_x:600, _y:490});
}
if (((_global.dinero - (coste[nivel + 1] - coste[nivel])) >= 0) and (actualizando == false)) {
if (nivel < 5) {
if (_global.empezar == 0) {
_global.dinero = _global.dinero - (coste[nivel + 1] - coste[nivel]);
nivel++;
this.alcance._height = distancia[nivel];
this.alcance._width = distancia[nivel];
this.alcance2._height = distancia[nivel] + 20;
this.alcance2._width = distancia[nivel] + 20;
numerito.cuerpo._x = numerito.cuerpo._x - 30;
_level0.terreno.info.ataque.text = fuego[nivel];
_level0.terreno.info.distancia.text = distancia[nivel];
_level0.terreno.info.coste.text = coste[nivel];
if (nivel < 5) {
_level0.terreno.info.ataque2.text = fuego[nivel + 1];
_level0.terreno.info.distancia2.text = distancia[nivel + 1];
_level0.terreno.info.coste2.text = coste[nivel + 1];
_level0.terreno.info.costeactualizar.text = coste[nivel + 1] - coste[nivel];
} else {
_level0.terreno.info.ataque2.text = "";
_level0.terreno.info.distancia2.text = "";
_level0.terreno.info.coste2.text = "";
_level0.terreno.info.costeactualizar.text = "";
}
return(undefined);
}
clearInterval(this.intervalID);
this.intervalId = setInterval(this, "barrita", 40);
_level0.terreno.marker.removeMovieClip();
this.attachMovie("barritaac", "barriac1", this._parent.getNextHighestDepth(), {_x:-20, _y:0});
_global.dinero = _global.dinero - (coste[nivel + 1] - coste[nivel]);
actualizando = true;
}
}
}
function barrita() {
conttiempo++;
porcenac = (0.04 * conttiempo) / tiempo[nivel];
this.barriac1.cuerpo._xscale = porcenac * 100;
if (porcenac == 1) {
this.barriac1.removeMovieClip();
nivel++;
this.alcance._height = distancia[nivel];
this.alcance._width = distancia[nivel];
this.alcance2._height = distancia[nivel] + 20;
this.alcance2._width = distancia[nivel] + 20;
if (_level0.terreno.info.objeto == this) {
_level0.terreno.info.ataque.text = fuego[nivel];
_level0.terreno.info.distancia.text = distancia[nivel];
_level0.terreno.info.coste.text = coste[nivel];
if (nivel < 5) {
_level0.terreno.info.ataque2.text = fuego[nivel + 1];
_level0.terreno.info.distancia2.text = distancia[nivel + 1];
_level0.terreno.info.coste2.text = coste[nivel + 1];
_level0.terreno.info.costeactualizar.text = coste[nivel + 1] - coste[nivel];
} else {
_level0.terreno.info.ataque2.text = "";
_level0.terreno.info.distancia2.text = "";
_level0.terreno.info.coste2.text = "";
_level0.terreno.info.costeactualizar.text = "";
}
_level0.terreno.marker.removeMovieClip();
_level0.terreno.attachMovie("marker", "marker", this.getDepth() - 1, {_x:this._x, _y:this._y});
}
clearInterval(this.intervalId);
delete this.intervalID;
actualizando = false;
conttiempo = 0;
numerito.cuerpo._x = numerito.cuerpo._x - 30;
}
}
function borrar() {
var _local4;
var _local3;
var _local6;
var _local5;
_local4 = -1;
while (_local4 <= 0) {
_local3 = -1;
while (_local3 <= 0) {
_global.tablero[(this._y / 20) + _local4][(this._x / 20) + _local3] = 1;
_local3++;
}
_local4++;
}
if (_global.empezar != 0) {
_local4 = -1;
while (_local4 <= 0) {
_local3 = -1;
while (_local3 <= 0) {
_level0.terreno.suelo[(this._y / 20) + _local4][(this._x / 20) + _local3]++;
_local6 = (this._y / 20) + _local4;
_local5 = (this._x / 20) + _local3;
switch (_level0.terreno.suelo[_local6][_local5]) {
case 1 :
_level0.terreno.attachMovie("suelo_roto", ("suelo" + _local6) + _local5, ((26 * _local6) + _local5) + 1, {_x:(Math.ceil(this._x / 20) + _local3) * 20, _y:(Math.ceil(this._y / 20) + _local4) * 20});
break;
case 2 :
_level0.terreno[("suelo" + _local6) + _local5].gotoAndStop(2);
break;
case 3 :
_level0.terreno[("suelo" + _local6) + _local5].gotoAndStop(3);
}
_local3++;
}
_local4++;
}
}
this._parent.IA3(_global.tablero, _global.tableroIA, _global.tableroaux, _global.longtab, 0);
this._parent.IA3(_global.tablero, _global.tableroIAv, _global.tableroaux, _global.longtab, 1);
if (_global.empezar == 0) {
_global.dinero = _global.dinero + coste[nivel];
}
this.removeMovieClip();
}
function segenem() {
if (activardisparo == true) {
var _local3;
var _local2;
var _local4;
_local3 = this._x - enemigofijado._x;
_local2 = this._y - enemigofijado._y;
_local4 = Math.atan2(_local2, _local3);
this.cuerpo._rotation = (360 * _local4) / (Math.PI*2);
}
}
var nivel = 0;
var fuego = new Array();
fuego[0] = 0.8;
fuego[1] = 0.75;
fuego[2] = 0.7;
fuego[3] = 0.65;
fuego[4] = 0.6;
fuego[5] = 0.5;
var coste = new Array();
coste[0] = 40;
coste[1] = 60;
coste[2] = 90;
coste[3] = 160;
coste[4] = 315;
coste[5] = 480;
var distancia = new Array();
distancia[0] = 120;
distancia[1] = 120;
distancia[2] = 120;
distancia[3] = 125;
distancia[4] = 130;
distancia[5] = 135;
var tiempo = new Array();
tiempo[0] = 2;
tiempo[1] = 3;
tiempo[2] = 4;
tiempo[3] = 5;
tiempo[4] = 6;
var frecdisparo = 1;
var activar = 1;
var enemigofijado;
var contador = 0;
var aux = 0;
var aux2 = 0;
var activardisparo = false;
var disparorealizado = false;
_global.activarboton = false;
var actualizando = false;
var conttiempo = 0;
var porcenac = 0;
var intervalId;
var enemigosatiro = new Array();
var profundidad = this.getDepth();
actualizacionactual.text = nivel;
this.cacheAsBitmap = true;
for (i in enemigosflier) {
if (this.getDepth >= enemigosflier[i].getDepth) {
this.swapDepths(enemigosflier[i]);
}
}
cuerpo.onPress = function () {
if (_global.STOP == false) {
var _local4 = new Array();
i = 0;
while (i <= _global.longtab) {
_local4[i] = new Array();
i++;
}
var _local3 = new Array();
i = 0;
while (i <= _global.longtab) {
_local3[i] = new Array();
i++;
}
var _local5 = false;
if ((activar == 0) and (aux2 == 1)) {
_level0.terreno.info.gotoAndStop(1);
_level0.terreno.info.ataque.text = fuego[nivel];
_level0.terreno.info.distancia.text = distancia[nivel];
_level0.terreno.info.coste.text = coste[nivel];
if (nivel < 5) {
_level0.terreno.info.ataque2.text = fuego[nivel + 1];
_level0.terreno.info.distancia2.text = distancia[nivel + 1];
_level0.terreno.info.coste2.text = coste[nivel + 1];
_level0.terreno.info.costeactualizar.text = coste[nivel + 1] - coste[nivel];
} else {
_level0.terreno.info.ataque2.text = "";
_level0.terreno.info.distancia2.text = "";
_level0.terreno.info.coste2.text = "";
_level0.terreno.info.costeactualizar.text = "";
}
_level0.terreno.info.objeto = this._parent;
this._parent.alcance._alpha = 100;
_level0.terreno.marker.removeMovieClip();
_level0.terreno.attachMovie("marker", "marker", profundidad - 1, {_x:this._parent._x, _y:this._parent._y});
}
i = -1;
while (i <= 0) {
j = -1;
while (j <= 0) {
if (_level0.terreno.suelo[(this._parent._y / 20) + j][(this._parent._x / 20) + i] >= 3) {
_local5 = true;
}
j++;
}
i++;
}
if (activar == 1) {
if (((((_global.tablero[this._parent._y / 20][this._parent._x / 20] == 1) and (_global.tablero[(this._parent._y / 20) - 1][this._parent._x / 20] == 1)) and (_global.tablero[this._parent._y / 20][(this._parent._x / 20) - 1] == 1)) and (_global.tablero[(this._parent._y / 20) - 1][(this._parent._x / 20) - 1] == 1)) and (_local5 == false)) {
activar = 0;
_global.tablero[this._parent._y / 20][this._parent._x / 20] = 0;
_global.tablero[(this._parent._y / 20) - 1][this._parent._x / 20] = 0;
_global.tablero[this._parent._y / 20][(this._parent._x / 20) - 1] = 0;
_global.tablero[(this._parent._y / 20) - 1][(this._parent._x / 20) - 1] = 0;
aux = 0;
i = 0;
while (i <= _global.longtab) {
j = 0;
while (j <= _global.longtab) {
_local4[i][j] = _global.tableroIA[i][j];
j++;
}
i++;
}
i = 0;
while (i <= _global.longtab) {
j = 0;
while (j <= _global.longtab) {
_local3[i][j] = _global.tableroIAv[i][j];
j++;
}
i++;
}
this._parent._parent.IA3(_global.tablero, _global.tableroIA, _global.tableroaux, _global.longtab, 0);
this._parent._parent.IA3(_global.tablero, _global.tableroIAv, _global.tableroaux, _global.longtab, 1);
for (i in _global.enemigos) {
if ((((_global.tableroIA[_global.enemigos[i].fila][_global.enemigos[i].columna] > 999) and (_global.enemigos[i].clase == "H")) and (enemigos[i].estoyentablero == true)) and (enemigos[i].tipo != "aereo")) {
aux++;
trace("Tipo: bloqueas el paso a un Doyu horizontal");
break;
}
if ((((_global.tableroIAv[_global.enemigos[i].fila][_global.enemigos[i].columna] > 999) and (_global.enemigos[i].clase == "V")) and (enemigos[i].estoyentablero == true)) and (enemigos[i].tipo != "aereo")) {
aux++;
trace("Tipo: bloqueas el paso a un Doyu vertical");
break;
}
}
if ((((_global.tableroIA[11][0] > 999) and (_global.tableroIA[12][0] > 999)) and (_global.tableroIA[13][0] > 999)) and (_global.tableroIA[14][0] > 999)) {
aux++;
trace("Tipo: bloqueas la entrada horizontal");
}
if ((((_global.tableroIAv[0][11] > 999) and (_global.tableroIAv[0][12] > 999)) and (_global.tableroIAv[0][13] > 999)) and (_global.tableroIAv[0][14] > 999)) {
aux++;
trace("Tipo: bloqueas la entrada vertical");
}
if (aux > 0) {
activar = 1;
_global.tablero[this._parent._y / 20][this._parent._x / 20] = 1;
_global.tablero[(this._parent._y / 20) - 1][this._parent._x / 20] = 1;
_global.tablero[this._parent._y / 20][(this._parent._x / 20) - 1] = 1;
_global.tablero[(this._parent._y / 20) - 1][(this._parent._x / 20) - 1] = 1;
_global.tableroIA = _local4;
_global.tableroIAv = _local3;
_level0.attachMovie("BLOQUEAS", "bloq", getNextHighestDepth(), {_x:640, _y:400, _xscale:100, _yscale:100});
} else {
_global.newtorreta++;
this._parent._alpha = 100;
this._parent.alcance._alpha = 0;
_level0.btorreta3.activar = 1;
_global.dinero = _global.dinero - coste[nivel];
i = -5;
while (i <= 4) {
j = -5;
while (j <= 4) {
_global.tableroalcance[(this._parent._y / 20) + i][(this._parent._x / 20) + j][this._parent] = this._parent;
j++;
}
i++;
}
delete _global.tableroalcance[(this._parent._y / 20) + -4][(this._parent._x / 20) + 4][this._parent];
delete _global.tableroalcance[(this._parent._y / 20) + -5][(this._parent._x / 20) + 4][this._parent];
delete _global.tableroalcance[(this._parent._y / 20) + -5][(this._parent._x / 20) + 3][this._parent];
delete _global.tableroalcance[(this._parent._y / 20) + 4][(this._parent._x / 20) + 4][this._parent];
delete _global.tableroalcance[(this._parent._y / 20) + 3][(this._parent._x / 20) + 4][this._parent];
delete _global.tableroalcance[(this._parent._y / 20) + 4][(this._parent._x / 20) + 3][this._parent];
delete _global.tableroalcance[(this._parent._y / 20) + 4][(this._parent._x / 20) + -5][this._parent];
delete _global.tableroalcance[(this._parent._y / 20) + 4][(this._parent._x / 20) + -4][this._parent];
delete _global.tableroalcance[(this._parent._y / 20) + 3][(this._parent._x / 20) + -5][this._parent];
delete _global.tableroalcance[(this._parent._y / 20) + -5][(this._parent._x / 20) + -5][this._parent];
delete _global.tableroalcance[(this._parent._y / 20) + -5][(this._parent._x / 20) + -4][this._parent];
delete _global.tableroalcance[(this._parent._y / 20) + -4][(this._parent._x / 20) + -5][this._parent];
_global.tableroalcance[this._parent._y / 20][(this._parent._x / 20) - 2][this._parent] = this._parent;
_global.tableroalcance[this._parent._y / 20][(this._parent._x / 20) - 3][this._parent] = this._parent;
_global.tableroalcance[this._parent._y / 20][(this._parent._x / 20) + 1][this._parent] = this._parent;
_global.tableroalcance[this._parent._y / 20][(this._parent._x / 20) + 2][this._parent] = this._parent;
_global.tableroalcance[(this._parent._y / 20) - 1][(this._parent._x / 20) - 2][this._parent] = this._parent;
_global.tableroalcance[(this._parent._y / 20) - 1][(this._parent._x / 20) - 3][this._parent] = this._parent;
_global.tableroalcance[(this._parent._y / 20) - 1][(this._parent._x / 20) + 1][this._parent] = this._parent;
_global.tableroalcance[(this._parent._y / 20) - 1][(this._parent._x / 20) + 2][this._parent] = this._parent;
_global.tableroalcance[(this._parent._y / 20) - 2][(this._parent._x / 20) - 2][this._parent] = this._parent;
_global.tableroalcance[(this._parent._y / 20) - 2][(this._parent._x / 20) - 3][this._parent] = this._parent;
_global.tableroalcance[(this._parent._y / 20) - 2][(this._parent._x / 20) + 1][this._parent] = this._parent;
_global.tableroalcance[(this._parent._y / 20) - 2][(this._parent._x / 20) + 2][this._parent] = this._parent;
_global.tableroalcance[(this._parent._y / 20) - 2][(this._parent._x / 20) - 1][this._parent] = this._parent;
_global.tableroalcance[(this._parent._y / 20) - 2][this._parent._x / 20][this._parent] = this._parent;
_global.tableroalcance[(this._parent._y / 20) + 1][(this._parent._x / 20) - 2][this._parent] = this._parent;
_global.tableroalcance[(this._parent._y / 20) + 1][(this._parent._x / 20) - 3][this._parent] = this._parent;
_global.tableroalcance[(this._parent._y / 20) + 1][(this._parent._x / 20) + 1][this._parent] = this._parent;
_global.tableroalcance[(this._parent._y / 20) + 1][(this._parent._x / 20) + 2][this._parent] = this._parent;
_global.tableroalcance[(this._parent._y / 20) + 1][(this._parent._x / 20) - 1][this._parent] = this._parent;
_global.tableroalcance[(this._parent._y / 20) + 1][this._parent._x / 20][this._parent] = this._parent;
_global.tableroalcance[(this._parent._y / 20) - 3][(this._parent._x / 20) + 1][this._parent] = this._parent;
_global.tableroalcance[(this._parent._y / 20) - 3][(this._parent._x / 20) - 2][this._parent] = this._parent;
_global.tableroalcance[(this._parent._y / 20) - 3][(this._parent._x / 20) - 1][this._parent] = this._parent;
_global.tableroalcance[(this._parent._y / 20) - 3][this._parent._x / 20][this._parent] = this._parent;
_global.tableroalcance[(this._parent._y / 20) + 2][(this._parent._x / 20) + 1][this._parent] = this._parent;
_global.tableroalcance[(this._parent._y / 20) + 2][(this._parent._x / 20) - 2][this._parent] = this._parent;
_global.tableroalcance[(this._parent._y / 20) + 2][(this._parent._x / 20) - 1][this._parent] = this._parent;
_global.tableroalcance[(this._parent._y / 20) + 2][this._parent._x / 20][this._parent] = this._parent;
_global.pretorreta = null;
if ((_global.dinero - coste[nivel]) >= 0) {
_level0.terreno.attachMovie("torreta3", "torr" + _global.cont, 700 + (2 * _global.cont), {_x:_level0.terreno._xmouse, _y:_level0.terreno._ymouse});
_global.pretorreta = _level0.terreno["torr" + _global.cont];
_global.cont++;
}
_global.activarboton = true;
this.attachMovie("p_torreta", this + "d", this.getNextHighestDepth());
aux2 = 1;
}
}
if (((((this._parent._y / 20) > _global.longtab) or ((this._parent._x / 20) > _global.longtab)) or ((this._parent._y / 20) < 0)) or ((this._parent._x / 20) < 0)) {
_level0.btorreta3.activar = 1;
_global.activarboton = true;
this._parent.removeMovieClip();
}
}
}
};
cuerpo.onRollOut = function () {
if (activar == 0) {
this._parent.alcance._alpha = 0;
}
};
onEnterFrame = function () {
if (_global.STOP == false) {
if (activar == 1) {
this._x = Math.floor(Math.floor(_parent._xmouse + (this.cuerpo._width / 4)) / 20) * 20;
this._y = Math.floor(Math.floor(_parent._ymouse + (this.cuerpo._width / 4)) / 20) * 20;
this._alpha = 50;
}
if (((contador == 0) and (activar == 0)) and (actualizando == false)) {
this.disparo(enemigosatiro);
}
contador++;
if (contador == frecdisparo) {
contador = 0;
}
if (actualizando == false) {
segenem();
}
}
};
Symbol 437 MovieClip [Torreta2] Frame 1
function disparo(enem) {
if (activardisparo == true) {
if (((enemigofijado != null) and this.alcance.hitTest(enemigofijado)) and (enemigofijado.vidafutura > 0)) {
this._parent.attachMovie("bala4", k, this._parent.getNextHighestDepth(), {_x:this._x, _y:this._y, blanco:enemigofijado, da\u00F1os:fuego[nivel]});
disparando = true;
enemigofijado.vidafutura = enemigofijado.vidafutura - fuego[nivel];
return(undefined);
}
for (i in enem) {
if ((this.alcance.hitTest(enem[i]) and (enem[i].vidafutura > 0)) and (enem[i].activar != false)) {
enemigofijado = enem[i];
this._parent.attachMovie("bala4", k, this._parent.getNextHighestDepth(), {_x:this._x, _y:this._y, blanco:enemigofijado, da\u00F1os:fuego[nivel]});
disparando = true;
enemigofijado.vidafutura = enemigofijado.vidafutura - fuego[nivel];
return(undefined);
}
delete enem[i];
}
for (i in enem) {
if (this.alcance2.hitTest(enem[i])) {
contador = 1;
disparando = false;
return(undefined);
}
}
}
contador = 1;
disparando = false;
activardisparo = false;
}
function actualizar() {
_level0.terreno.info.gotoAndStop(1);
if ((_global.dinero - (coste[nivel + 1] - coste[nivel])) < 0) {
_level0.attachMovie("nodinero", "nodinero", _level0.getNextHighestDepth(), {_x:600, _y:500});
}
if (nivel >= 5) {
_level0.attachMovie("nopuedes", "nopuedes", _level0.getNextHighestDepth(), {_x:600, _y:490});
}
if (((_global.dinero - (coste[nivel + 1] - coste[nivel])) >= 0) and (actualizando == false)) {
if (nivel < 5) {
if (_global.empezar == 0) {
_global.dinero = _global.dinero - (coste[nivel + 1] - coste[nivel]);
nivel++;
this.alcance._height = distancia[nivel];
this.alcance._width = distancia[nivel];
this.alcance2._height = distancia[nivel] + 20;
this.alcance2._width = distancia[nivel] + 20;
numerito.cuerpo._x = numerito.cuerpo._x - 30;
_level0.terreno.info.ataque.text = fuego[nivel];
_level0.terreno.info.distancia.text = distancia[nivel];
_level0.terreno.info.coste.text = coste[nivel];
if (nivel < 5) {
_level0.terreno.info.ataque2.text = fuego[nivel + 1];
_level0.terreno.info.distancia2.text = distancia[nivel + 1];
_level0.terreno.info.coste2.text = coste[nivel + 1];
_level0.terreno.info.costeactualizar.text = coste[nivel + 1] - coste[nivel];
} else {
_level0.terreno.info.ataque2.text = "";
_level0.terreno.info.distancia2.text = "";
_level0.terreno.info.coste2.text = "";
_level0.terreno.info.costeactualizar.text = "";
}
return(undefined);
}
clearInterval(this.intervalID);
this.intervalId = setInterval(this, "barrita", 40);
_level0.terreno.marker.removeMovieClip();
this.attachMovie("barritaac", "barriac1", this._parent.getNextHighestDepth(), {_x:-20, _y:0});
_global.dinero = _global.dinero - (coste[nivel + 1] - coste[nivel]);
actualizando = true;
}
}
}
function barrita() {
conttiempo++;
porcenac = (0.04 * conttiempo) / tiempo[nivel];
this.barriac1.cuerpo._xscale = porcenac * 100;
if (porcenac == 1) {
this.barriac1.removeMovieClip();
nivel++;
this.alcance._height = distancia[nivel];
this.alcance._width = distancia[nivel];
this.alcance2._height = distancia[nivel] + 20;
this.alcance2._width = distancia[nivel] + 20;
if (_level0.terreno.info.objeto == this) {
_level0.terreno.info.ataque.text = fuego[nivel];
_level0.terreno.info.distancia.text = distancia[nivel];
_level0.terreno.info.coste.text = coste[nivel];
if (nivel < 5) {
_level0.terreno.info.ataque2.text = fuego[nivel + 1];
_level0.terreno.info.distancia2.text = distancia[nivel + 1];
_level0.terreno.info.coste2.text = coste[nivel + 1];
_level0.terreno.info.costeactualizar.text = coste[nivel + 1] - coste[nivel];
} else {
_level0.terreno.info.ataque2.text = "";
_level0.terreno.info.distancia2.text = "";
_level0.terreno.info.coste2.text = "";
_level0.terreno.info.costeactualizar.text = "";
}
_level0.terreno.marker.removeMovieClip();
_level0.terreno.attachMovie("marker", "marker", this.getDepth() - 1, {_x:this._x, _y:this._y});
}
clearInterval(this.intervalId);
delete this.intervalID;
actualizando = false;
conttiempo = 0;
numerito.cuerpo._x = numerito.cuerpo._x - 30;
}
}
function borrar() {
var _local4;
var _local3;
var _local6;
var _local5;
_local4 = -1;
while (_local4 <= 0) {
_local3 = -1;
while (_local3 <= 0) {
_global.tablero[(this._y / 20) + _local4][(this._x / 20) + _local3] = 1;
_local3++;
}
_local4++;
}
if (_global.empezar != 0) {
_local4 = -1;
while (_local4 <= 0) {
_local3 = -1;
while (_local3 <= 0) {
_level0.terreno.suelo[(this._y / 20) + _local4][(this._x / 20) + _local3]++;
_local6 = (this._y / 20) + _local4;
_local5 = (this._x / 20) + _local3;
switch (_level0.terreno.suelo[_local6][_local5]) {
case 1 :
_level0.terreno.attachMovie("suelo_roto", ("suelo" + _local6) + _local5, ((26 * _local6) + _local5) + 1, {_x:(Math.ceil(this._x / 20) + _local3) * 20, _y:(Math.ceil(this._y / 20) + _local4) * 20});
break;
case 2 :
_level0.terreno[("suelo" + _local6) + _local5].gotoAndStop(2);
break;
case 3 :
_level0.terreno[("suelo" + _local6) + _local5].gotoAndStop(3);
}
_local3++;
}
_local4++;
}
}
this._parent.IA3(_global.tablero, _global.tableroIA, _global.tableroaux, _global.longtab, 0);
this._parent.IA3(_global.tablero, _global.tableroIAv, _global.tableroaux, _global.longtab, 1);
if (_global.empezar == 0) {
_global.dinero = _global.dinero + coste[nivel];
}
this.removeMovieClip();
}
function segenem() {
if (activardisparo == true) {
var _local3;
var _local2;
var _local4;
_local3 = this._x - enemigofijado._x;
_local2 = this._y - enemigofijado._y;
_local4 = Math.atan2(_local2, _local3);
this.cuerpo._rotation = (360 * _local4) / (Math.PI*2);
}
}
var nivel = 0;
var fuego = new Array();
fuego[0] = 12;
fuego[1] = 25;
fuego[2] = 45;
fuego[3] = 70;
fuego[4] = 100;
fuego[5] = 240;
var coste = new Array();
coste[0] = 5;
coste[1] = 11;
coste[2] = 18;
coste[3] = 27;
coste[4] = 40;
coste[5] = 100;
var distancia = new Array();
distancia[0] = 80;
distancia[1] = 80;
distancia[2] = 85;
distancia[3] = 85;
distancia[4] = 90;
distancia[5] = 100;
var tiempo = new Array();
tiempo[0] = 2;
tiempo[1] = 3;
tiempo[2] = 4;
tiempo[3] = 5;
tiempo[4] = 6;
var frecdisparo = 25;
var activar = 1;
var enemigofijado;
var contador = 1;
var aux = 0;
var aux2 = 0;
var activardisparo = false;
var disparando = false;
_global.activarboton = false;
var actualizando = false;
var conttiempo = 0;
var porcenac = 0;
var intervalId;
var enemigosatiro = new Array();
var profundidad = this.getDepth();
actualizacionactual.text = nivel;
this.cacheAsBitmap = true;
for (i in enemigosflier) {
if (this.getDepth >= enemigosflier[i].getDepth) {
this.swapDepths(enemigosflier[i]);
}
}
cuerpo.onPress = function () {
if (_global.STOP == false) {
var _local4 = new Array();
i = 0;
while (i <= _global.longtab) {
_local4[i] = new Array();
i++;
}
var _local3 = new Array();
i = 0;
while (i <= _global.longtab) {
_local3[i] = new Array();
i++;
}
var _local5 = false;
if ((activar == 0) and (aux2 == 1)) {
_level0.terreno.info.gotoAndStop(1);
_level0.terreno.info.ataque.text = fuego[nivel];
_level0.terreno.info.distancia.text = distancia[nivel];
_level0.terreno.info.coste.text = coste[nivel];
if (nivel < 5) {
_level0.terreno.info.ataque2.text = fuego[nivel + 1];
_level0.terreno.info.distancia2.text = distancia[nivel + 1];
_level0.terreno.info.coste2.text = coste[nivel + 1];
_level0.terreno.info.costeactualizar.text = coste[nivel + 1] - coste[nivel];
} else {
_level0.terreno.info.ataque2.text = "";
_level0.terreno.info.distancia2.text = "";
_level0.terreno.info.coste2.text = "";
_level0.terreno.info.costeactualizar.text = "";
}
_level0.terreno.info.objeto = this._parent;
this._parent.alcance._alpha = 100;
_level0.terreno.marker.removeMovieClip();
_level0.terreno.attachMovie("marker", "marker", profundidad - 1, {_x:this._parent._x, _y:this._parent._y});
}
if (activar == 1) {
i = -1;
while (i <= 0) {
j = -1;
while (j <= 0) {
if (_level0.terreno.suelo[(this._parent._y / 20) + j][(this._parent._x / 20) + i] >= 3) {
_local5 = true;
}
j++;
}
i++;
}
if (((((_global.tablero[this._parent._y / 20][this._parent._x / 20] == 1) and (_global.tablero[(this._parent._y / 20) - 1][this._parent._x / 20] == 1)) and (_global.tablero[this._parent._y / 20][(this._parent._x / 20) - 1] == 1)) and (_global.tablero[(this._parent._y / 20) - 1][(this._parent._x / 20) - 1] == 1)) and (_local5 == false)) {
activar = 0;
_global.tablero[this._parent._y / 20][this._parent._x / 20] = 0;
_global.tablero[(this._parent._y / 20) - 1][this._parent._x / 20] = 0;
_global.tablero[this._parent._y / 20][(this._parent._x / 20) - 1] = 0;
_global.tablero[(this._parent._y / 20) - 1][(this._parent._x / 20) - 1] = 0;
aux = 0;
i = 0;
while (i <= _global.longtab) {
j = 0;
while (j <= _global.longtab) {
_local4[i][j] = _global.tableroIA[i][j];
j++;
}
i++;
}
i = 0;
while (i <= _global.longtab) {
j = 0;
while (j <= _global.longtab) {
_local3[i][j] = _global.tableroIAv[i][j];
j++;
}
i++;
}
this._parent._parent.IA3(_global.tablero, _global.tableroIA, _global.tableroaux, _global.longtab, 0);
this._parent._parent.IA3(_global.tablero, _global.tableroIAv, _global.tableroaux, _global.longtab, 1);
for (i in _global.enemigos) {
if ((((_global.tableroIA[_global.enemigos[i].fila][_global.enemigos[i].columna] > 999) and (_global.enemigos[i].clase == "H")) and (enemigos[i].estoyentablero == true)) and (enemigos[i].tipo != "aereo")) {
aux++;
trace("Tipo: bloqueas el paso a un Doyu horizontal");
break;
}
if ((((_global.tableroIAv[_global.enemigos[i].fila][_global.enemigos[i].columna] > 999) and (_global.enemigos[i].clase == "V")) and (enemigos[i].estoyentablero == true)) and (enemigos[i].tipo != "aereo")) {
aux++;
trace("Tipo: bloqueas el paso a un Doyu vertical");
break;
}
}
if ((((_global.tableroIA[11][0] > 999) and (_global.tableroIA[12][0] > 999)) and (_global.tableroIA[13][0] > 999)) and (_global.tableroIA[14][0] > 999)) {
aux++;
trace("Tipo: bloqueas la entrada horizontal");
}
if ((((_global.tableroIAv[0][11] > 999) and (_global.tableroIAv[0][12] > 999)) and (_global.tableroIAv[0][13] > 999)) and (_global.tableroIAv[0][14] > 999)) {
aux++;
trace("Tipo: bloqueas la entrada vertical");
}
if (aux > 0) {
activar = 1;
_global.tablero[this._parent._y / 20][this._parent._x / 20] = 1;
_global.tablero[(this._parent._y / 20) - 1][this._parent._x / 20] = 1;
_global.tablero[this._parent._y / 20][(this._parent._x / 20) - 1] = 1;
_global.tablero[(this._parent._y / 20) - 1][(this._parent._x / 20) - 1] = 1;
_global.tableroIA = _local4;
_global.tableroIAv = _local3;
_level0.attachMovie("BLOQUEAS", "bloq", getNextHighestDepth(), {_x:640, _y:400, _xscale:80, _yscale:80});
} else {
_global.newtorreta++;
this._parent._alpha = 100;
this._parent.alcance._alpha = 0;
_level0.btorreta2.activar = 1;
_global.dinero = _global.dinero - coste[nivel];
_global.tableroalcance[this._parent._y / 20][(this._parent._x / 20) - 2][this._parent] = this._parent;
_global.tableroalcance[this._parent._y / 20][(this._parent._x / 20) - 3][this._parent] = this._parent;
_global.tableroalcance[this._parent._y / 20][(this._parent._x / 20) + 1][this._parent] = this._parent;
_global.tableroalcance[this._parent._y / 20][(this._parent._x / 20) + 2][this._parent] = this._parent;
_global.tableroalcance[(this._parent._y / 20) - 1][(this._parent._x / 20) - 2][this._parent] = this._parent;
_global.tableroalcance[(this._parent._y / 20) - 1][(this._parent._x / 20) - 3][this._parent] = this._parent;
_global.tableroalcance[(this._parent._y / 20) - 1][(this._parent._x / 20) + 1][this._parent] = this._parent;
_global.tableroalcance[(this._parent._y / 20) - 1][(this._parent._x / 20) + 2][this._parent] = this._parent;
_global.tableroalcance[(this._parent._y / 20) - 2][(this._parent._x / 20) - 2][this._parent] = this._parent;
_global.tableroalcance[(this._parent._y / 20) - 2][(this._parent._x / 20) - 3][this._parent] = this._parent;
_global.tableroalcance[(this._parent._y / 20) - 2][(this._parent._x / 20) + 1][this._parent] = this._parent;
_global.tableroalcance[(this._parent._y / 20) - 2][(this._parent._x / 20) + 2][this._parent] = this._parent;
_global.tableroalcance[(this._parent._y / 20) - 2][(this._parent._x / 20) - 1][this._parent] = this._parent;
_global.tableroalcance[(this._parent._y / 20) - 2][this._parent._x / 20][this._parent] = this._parent;
_global.tableroalcance[(this._parent._y / 20) + 1][(this._parent._x / 20) - 2][this._parent] = this._parent;
_global.tableroalcance[(this._parent._y / 20) + 1][(this._parent._x / 20) - 3][this._parent] = this._parent;
_global.tableroalcance[(this._parent._y / 20) + 1][(this._parent._x / 20) + 1][this._parent] = this._parent;
_global.tableroalcance[(this._parent._y / 20) + 1][(this._parent._x / 20) + 2][this._parent] = this._parent;
_global.tableroalcance[(this._parent._y / 20) + 1][(this._parent._x / 20) - 1][this._parent] = this._parent;
_global.tableroalcance[(this._parent._y / 20) + 1][this._parent._x / 20][this._parent] = this._parent;
_global.tableroalcance[(this._parent._y / 20) - 3][(this._parent._x / 20) + 1][this._parent] = this._parent;
_global.tableroalcance[(this._parent._y / 20) - 3][(this._parent._x / 20) - 2][this._parent] = this._parent;
_global.tableroalcance[(this._parent._y / 20) - 3][(this._parent._x / 20) - 1][this._parent] = this._parent;
_global.tableroalcance[(this._parent._y / 20) - 3][this._parent._x / 20][this._parent] = this._parent;
_global.tableroalcance[(this._parent._y / 20) + 2][(this._parent._x / 20) + 1][this._parent] = this._parent;
_global.tableroalcance[(this._parent._y / 20) + 2][(this._parent._x / 20) - 2][this._parent] = this._parent;
_global.tableroalcance[(this._parent._y / 20) + 2][(this._parent._x / 20) - 1][this._parent] = this._parent;
_global.tableroalcance[(this._parent._y / 20) + 2][this._parent._x / 20][this._parent] = this._parent;
_global.pretorreta = null;
if ((_global.dinero - coste[nivel]) >= 0) {
_level0.terreno.attachMovie("torreta2", "torr" + _global.cont, 700 + (2 * _global.cont), {_x:_level0.terreno._xmouse, _y:_level0.terreno._ymouse});
_global.pretorreta = _level0.terreno["torr" + _global.cont];
_global.cont++;
}
_global.activarboton = true;
this.attachMovie("p_torreta", this + "d", this.getNextHighestDepth());
aux2 = 1;
}
}
if (((((this._parent._y / 20) > _global.longtab) or ((this._parent._x / 20) > _global.longtab)) or ((this._parent._y / 20) < 0)) or ((this._parent._x / 20) < 0)) {
_level0.btorreta2.activar = 1;
_global.activarboton = true;
this._parent.removeMovieClip();
}
}
}
};
cuerpo.onRollOut = function () {
if (activar == 0) {
this._parent.alcance._alpha = 0;
}
};
onEnterFrame = function () {
if (_global.STOP == false) {
if (activar == 1) {
this._x = Math.floor(Math.floor(_parent._xmouse + (this.cuerpo._width / 4)) / 20) * 20;
this._y = Math.floor(Math.floor(_parent._ymouse + (this.cuerpo._width / 4)) / 20) * 20;
this._alpha = 50;
}
if ((((contador == 0) and (activar == 0)) and (disparando == true)) and (actualizando == false)) {
this.disparo(enemigosatiro);
}
if (((activar == 0) and (disparando == false)) and (actualizando == false)) {
this.disparo(enemigosatiro);
}
if (disparando == true) {
contador++;
}
if (contador == frecdisparo) {
contador = 0;
}
if (actualizando == false) {
segenem();
}
}
};
Symbol 443 MovieClip [torreta1] Frame 1
function disparo(enem) {
if (activardisparo == true) {
if (((enemigofijado != null) and this.alcance.hitTest(enemigofijado)) and (enemigofijado.vidafutura > 0)) {
this._parent.attachMovie("bala4", k, this._parent.getNextHighestDepth(), {_x:this._x, _y:this._y, blanco:enemigofijado, da\u00F1os:fuego[nivel]});
disparando = true;
enemigofijado.vidafutura = enemigofijado.vidafutura - fuego[nivel];
return(undefined);
}
for (i in enem) {
if ((this.alcance.hitTest(enem[i]) and (enem[i].vidafutura > 0)) and (enem[i].activar != false)) {
enemigofijado = enem[i];
this._parent.attachMovie("bala4", k, this._parent.getNextHighestDepth(), {_x:this._x, _y:this._y, blanco:enemigofijado, da\u00F1os:fuego[nivel]});
disparando = true;
enemigofijado.vidafutura = enemigofijado.vidafutura - fuego[nivel];
return(undefined);
}
delete enem[i];
}
for (i in enem) {
if (this.alcance2.hitTest(enem[i])) {
contador = 1;
disparando = false;
return(undefined);
}
}
}
contador = 1;
disparando = false;
activardisparo = false;
}
function actualizar() {
_level0.terreno.info.gotoAndStop(1);
if ((_global.dinero - (coste[nivel + 1] - coste[nivel])) < 0) {
_level0.attachMovie("nodinero", "nodinero", _level0.getNextHighestDepth(), {_x:600, _y:500});
}
if (nivel >= 5) {
_level0.attachMovie("nopuedes", "nopuedes", _level0.getNextHighestDepth(), {_x:600, _y:490});
}
if (((_global.dinero - (coste[nivel + 1] - coste[nivel])) >= 0) and (actualizando == false)) {
if (nivel < 5) {
if (_global.empezar == 0) {
_global.dinero = _global.dinero - (coste[nivel + 1] - coste[nivel]);
nivel++;
this.alcance._height = distancia[nivel];
this.alcance._width = distancia[nivel];
this.alcance2._height = distancia[nivel] + 20;
this.alcance2._width = distancia[nivel] + 20;
numerito.cuerpo._x = numerito.cuerpo._x - 30;
_level0.terreno.info.ataque.text = fuego[nivel];
_level0.terreno.info.distancia.text = distancia[nivel];
_level0.terreno.info.coste.text = coste[nivel];
if (nivel < 5) {
_level0.terreno.info.ataque2.text = fuego[nivel + 1];
_level0.terreno.info.distancia2.text = distancia[nivel + 1];
_level0.terreno.info.coste2.text = coste[nivel + 1];
_level0.terreno.info.costeactualizar.text = coste[nivel + 1] - coste[nivel];
} else {
_level0.terreno.info.ataque2.text = "";
_level0.terreno.info.distancia2.text = "";
_level0.terreno.info.coste2.text = "";
_level0.terreno.info.costeactualizar.text = "";
}
return(undefined);
}
clearInterval(this.intervalID);
this.intervalId = setInterval(this, "barrita", 40);
_level0.terreno.marker.removeMovieClip();
this.attachMovie("barritaac", "barriac1", this._parent.getNextHighestDepth(), {_x:-20, _y:0});
_global.dinero = _global.dinero - (coste[nivel + 1] - coste[nivel]);
actualizando = true;
}
}
}
function barrita() {
conttiempo++;
porcenac = (0.04 * conttiempo) / tiempo[nivel];
this.barriac1.cuerpo._xscale = porcenac * 100;
if (porcenac == 1) {
this.barriac1.removeMovieClip();
nivel++;
this.alcance._height = distancia[nivel];
this.alcance._width = distancia[nivel];
this.alcance2._height = distancia[nivel] + 20;
this.alcance2._width = distancia[nivel] + 20;
if (_level0.terreno.info.objeto == this) {
_level0.terreno.info.ataque.text = fuego[nivel];
_level0.terreno.info.distancia.text = distancia[nivel];
_level0.terreno.info.coste.text = coste[nivel];
if (nivel < 5) {
_level0.terreno.info.ataque2.text = fuego[nivel + 1];
_level0.terreno.info.distancia2.text = distancia[nivel + 1];
_level0.terreno.info.coste2.text = coste[nivel + 1];
_level0.terreno.info.costeactualizar.text = coste[nivel + 1] - coste[nivel];
} else {
_level0.terreno.info.ataque2.text = "";
_level0.terreno.info.distancia2.text = "";
_level0.terreno.info.coste2.text = "";
_level0.terreno.info.costeactualizar.text = "";
}
_level0.terreno.marker.removeMovieClip();
_level0.terreno.attachMovie("marker", "marker", this.getDepth() - 1, {_x:this._x, _y:this._y});
}
clearInterval(this.intervalId);
delete this.intervalID;
actualizando = false;
conttiempo = 0;
numerito.cuerpo._x = numerito.cuerpo._x - 30;
}
}
function borrar() {
var _local4;
var _local3;
var _local6;
var _local5;
_local4 = -1;
while (_local4 <= 0) {
_local3 = -1;
while (_local3 <= 0) {
_global.tablero[(this._y / 20) + _local4][(this._x / 20) + _local3] = 1;
_local3++;
}
_local4++;
}
if (_global.empezar != 0) {
_local4 = -1;
while (_local4 <= 0) {
_local3 = -1;
while (_local3 <= 0) {
_level0.terreno.suelo[(this._y / 20) + _local4][(this._x / 20) + _local3]++;
_local6 = (this._y / 20) + _local4;
_local5 = (this._x / 20) + _local3;
switch (_level0.terreno.suelo[_local6][_local5]) {
case 1 :
_level0.terreno.attachMovie("suelo_roto", ("suelo" + _local6) + _local5, ((26 * _local6) + _local5) + 1, {_x:(Math.ceil(this._x / 20) + _local3) * 20, _y:(Math.ceil(this._y / 20) + _local4) * 20});
break;
case 2 :
_level0.terreno[("suelo" + _local6) + _local5].gotoAndStop(2);
break;
case 3 :
_level0.terreno[("suelo" + _local6) + _local5].gotoAndStop(3);
}
_local3++;
}
_local4++;
}
}
this._parent.IA3(_global.tablero, _global.tableroIA, _global.tableroaux, _global.longtab, 0);
this._parent.IA3(_global.tablero, _global.tableroIAv, _global.tableroaux, _global.longtab, 1);
if (_global.empezar == 0) {
_global.dinero = _global.dinero + coste[nivel];
}
this.removeMovieClip();
}
function segenem() {
if (activardisparo == true) {
var _local3;
var _local2;
var _local4;
_local3 = this._x - enemigofijado._x;
_local2 = this._y - enemigofijado._y;
_local4 = Math.atan2(_local2, _local3);
this.cuerpo._rotation = ((360 * _local4) / (Math.PI*2)) - 90;
}
}
var nivel = 0;
var fuego = new Array();
fuego[0] = 7;
fuego[1] = 15;
fuego[2] = 35;
fuego[3] = 60;
fuego[4] = 115;
fuego[5] = 480;
var coste = new Array();
coste[0] = 16;
coste[1] = 28;
coste[2] = 55;
coste[3] = 85;
coste[4] = 150;
coste[5] = 435;
var distancia = new Array();
distancia[0] = 120;
distancia[1] = 125;
distancia[2] = 130;
distancia[3] = 135;
distancia[4] = 140;
distancia[5] = 145;
var tiempo = new Array();
tiempo[0] = 2;
tiempo[1] = 3;
tiempo[2] = 4;
tiempo[3] = 5;
tiempo[4] = 6;
var frecdisparo = 12;
var activar = 1;
var enemigofijado;
var contador = 0;
var aux = 0;
var aux2 = 0;
var activardisparo = false;
var disparando = false;
_global.activarboton = false;
var actualizando = false;
var conttiempo = 0;
var porcenac = 0;
var intervalId;
var enemigosatiro = new Array();
var profundidad = this.getDepth();
actualizacionactual.text = nivel;
this.cacheAsBitmap = true;
for (i in enemigosflier) {
if (this.getDepth >= enemigosflier[i].getDepth) {
this.swapDepths(enemigosflier[i]);
}
}
cuerpo.onPress = function () {
if (_global.STOP == false) {
var _local4 = new Array();
i = 0;
while (i <= _global.longtab) {
_local4[i] = new Array();
i++;
}
var _local3 = new Array();
i = 0;
while (i <= _global.longtab) {
_local3[i] = new Array();
i++;
}
var _local5 = false;
if ((activar == 0) and (aux2 == 1)) {
_level0.terreno.info.gotoAndStop(1);
_level0.terreno.info.ataque.text = fuego[nivel];
_level0.terreno.info.distancia.text = distancia[nivel];
_level0.terreno.info.coste.text = coste[nivel];
if (nivel < 5) {
_level0.terreno.info.ataque2.text = fuego[nivel + 1];
_level0.terreno.info.distancia2.text = distancia[nivel + 1];
_level0.terreno.info.coste2.text = coste[nivel + 1];
_level0.terreno.info.costeactualizar.text = coste[nivel + 1] - coste[nivel];
} else {
_level0.terreno.info.ataque2.text = "";
_level0.terreno.info.distancia2.text = "";
_level0.terreno.info.coste2.text = "";
_level0.terreno.info.costeactualizar.text = "";
}
_level0.terreno.info.objeto = this._parent;
this._parent.alcance._alpha = 100;
_level0.terreno.marker.removeMovieClip();
_level0.terreno.attachMovie("marker", "marker", profundidad - 1, {_x:this._parent._x, _y:this._parent._y});
}
i = -1;
while (i <= 0) {
j = -1;
while (j <= 0) {
if (_level0.terreno.suelo[(this._parent._y / 20) + j][(this._parent._x / 20) + i] >= 3) {
_local5 = true;
}
j++;
}
i++;
}
if (activar == 1) {
if (((((_global.tablero[this._parent._y / 20][this._parent._x / 20] == 1) and (_global.tablero[(this._parent._y / 20) - 1][this._parent._x / 20] == 1)) and (_global.tablero[this._parent._y / 20][(this._parent._x / 20) - 1] == 1)) and (_global.tablero[(this._parent._y / 20) - 1][(this._parent._x / 20) - 1] == 1)) and (_local5 == false)) {
activar = 0;
_global.tablero[this._parent._y / 20][this._parent._x / 20] = 0;
_global.tablero[(this._parent._y / 20) - 1][this._parent._x / 20] = 0;
_global.tablero[this._parent._y / 20][(this._parent._x / 20) - 1] = 0;
_global.tablero[(this._parent._y / 20) - 1][(this._parent._x / 20) - 1] = 0;
aux = 0;
i = 0;
while (i <= _global.longtab) {
j = 0;
while (j <= _global.longtab) {
_local4[i][j] = _global.tableroIA[i][j];
j++;
}
i++;
}
i = 0;
while (i <= _global.longtab) {
j = 0;
while (j <= _global.longtab) {
_local3[i][j] = _global.tableroIAv[i][j];
j++;
}
i++;
}
this._parent._parent.IA3(_global.tablero, _global.tableroIA, _global.tableroaux, _global.longtab, 0);
this._parent._parent.IA3(_global.tablero, _global.tableroIAv, _global.tableroaux, _global.longtab, 1);
for (i in _global.enemigos) {
if ((((_global.tableroIA[_global.enemigos[i].fila][_global.enemigos[i].columna] > 999) and (_global.enemigos[i].clase == "H")) and (enemigos[i].estoyentablero == true)) and (enemigos[i].tipo != "aereo")) {
aux++;
trace("Tipo: bloqueas el paso a un Doyu horizontal");
break;
}
if ((((_global.tableroIAv[_global.enemigos[i].fila][_global.enemigos[i].columna] > 999) and (_global.enemigos[i].clase == "V")) and (enemigos[i].estoyentablero == true)) and (enemigos[i].tipo != "aereo")) {
aux++;
trace("Tipo: bloqueas el paso a un Doyu vertical");
break;
}
}
if ((((_global.tableroIA[11][0] > 999) and (_global.tableroIA[12][0] > 999)) and (_global.tableroIA[13][0] > 999)) and (_global.tableroIA[14][0] > 999)) {
aux++;
trace("Tipo: bloqueas la entrada horizontal");
}
if ((((_global.tableroIAv[0][11] > 999) and (_global.tableroIAv[0][12] > 999)) and (_global.tableroIAv[0][13] > 999)) and (_global.tableroIAv[0][14] > 999)) {
aux++;
trace("Tipo: bloqueas la entrada vertical");
}
if (aux > 0) {
activar = 1;
_global.tablero[this._parent._y / 20][this._parent._x / 20] = 1;
_global.tablero[(this._parent._y / 20) - 1][this._parent._x / 20] = 1;
_global.tablero[this._parent._y / 20][(this._parent._x / 20) - 1] = 1;
_global.tablero[(this._parent._y / 20) - 1][(this._parent._x / 20) - 1] = 1;
_global.tableroIA = _local4;
_global.tableroIAv = _local3;
_level0.attachMovie("BLOQUEAS", "bloq", getNextHighestDepth(), {_x:640, _y:400, _xscale:80, _yscale:80});
} else {
_global.newtorreta++;
this._parent._alpha = 100;
this._parent.alcance._alpha = 0;
_level0.btorreta.activar = 1;
_global.dinero = _global.dinero - coste[nivel];
i = -5;
while (i <= 4) {
j = -5;
while (j <= 4) {
_global.tableroalcance[(this._parent._y / 20) + i][(this._parent._x / 20) + j][this._parent] = this._parent;
j++;
}
i++;
}
delete _global.tableroalcance[(this._parent._y / 20) + -4][(this._parent._x / 20) + 4][this._parent];
delete _global.tableroalcance[(this._parent._y / 20) + -5][(this._parent._x / 20) + 4][this._parent];
delete _global.tableroalcance[(this._parent._y / 20) + -5][(this._parent._x / 20) + 3][this._parent];
delete _global.tableroalcance[(this._parent._y / 20) + 4][(this._parent._x / 20) + 4][this._parent];
delete _global.tableroalcance[(this._parent._y / 20) + 3][(this._parent._x / 20) + 4][this._parent];
delete _global.tableroalcance[(this._parent._y / 20) + 4][(this._parent._x / 20) + 3][this._parent];
delete _global.tableroalcance[(this._parent._y / 20) + 4][(this._parent._x / 20) + -5][this._parent];
delete _global.tableroalcance[(this._parent._y / 20) + 4][(this._parent._x / 20) + -4][this._parent];
delete _global.tableroalcance[(this._parent._y / 20) + 3][(this._parent._x / 20) + -5][this._parent];
delete _global.tableroalcance[(this._parent._y / 20) + -5][(this._parent._x / 20) + -5][this._parent];
delete _global.tableroalcance[(this._parent._y / 20) + -5][(this._parent._x / 20) + -4][this._parent];
delete _global.tableroalcance[(this._parent._y / 20) + -4][(this._parent._x / 20) + -5][this._parent];
_global.pretorreta = null;
if ((_global.dinero - coste[nivel]) >= 0) {
_level0.terreno.attachMovie("torreta1", "torr" + _global.cont, 700 + (2 * _global.cont), {_x:_level0.terreno._xmouse, _y:_level0.terreno._ymouse});
_global.pretorreta = _level0.terreno["torr" + _global.cont];
_global.cont++;
}
_global.activarboton = true;
this.attachMovie("p_torreta", this + "d", this.getNextHighestDepth());
aux2 = 1;
}
}
if (((((this._parent._y / 20) > _global.longtab) or ((this._parent._x / 20) > _global.longtab)) or ((this._parent._y / 20) < 0)) or ((this._parent._x / 20) < 0)) {
_level0.btorreta.activar = 1;
_global.activarboton = true;
this._parent.removeMovieClip();
}
}
}
};
cuerpo.onRollOut = function () {
if (activar == 0) {
this._parent.alcance._alpha = 0;
}
};
onEnterFrame = function () {
if (_global.STOP == false) {
if (activar == 1) {
this._x = Math.floor(Math.floor(_parent._xmouse + (this.cuerpo._width / 4)) / 20) * 20;
this._y = Math.floor(Math.floor(_parent._ymouse + (this.cuerpo._width / 4)) / 20) * 20;
this._alpha = 50;
}
if ((((contador == 0) and (activar == 0)) and (disparando == true)) and (actualizando == false)) {
this.disparo(enemigosatiro);
}
if (((activar == 0) and (disparando == false)) and (actualizando == false)) {
this.disparo(enemigosatiro);
}
if (disparando == true) {
contador++;
}
if (contador == frecdisparo) {
contador = 0;
}
if (actualizando == false) {
segenem();
}
}
};
this.cacheAsBitmap = true;
Symbol 470 MovieClip Frame 1
this.cacheAsBitmap = true;
Symbol 482 MovieClip Frame 1
var contador = 0;
var cont = 0;
var rand;
var nivel = 0;
var randomaux = 3;
_global.empezar = 0;
this._visible = false;
i = 1;
while (i <= 100) {
_root["contador" + i] = 0;
i++;
}
var nachotipo = new Array(5, 4, 2, 4, 3, 2, 4, 2, 5, 6, 2, 3, 5, 1, 2, 4, 2, 3, 1, 6, 3, 4, 2, 2, 3, 1, 5, 4, 2, 6, 5, 4, 5, 2, 1, 3, 5, 2, 4, 6, 5, 2, 3, 1, 4, 5, 5, 1, 5, 6, 2, 4, 3, 1, 4, 5, 1, 3, 5, 6, 2, 5, 3, 2, 4, 5, 1, 3, 5, 6, 5, 4, 3, 2, 4, 5, 6, 1, 3, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
var nachovida = new Array(35, 47, 45, 70, 37, 100, 125, 100, 150, 998, 100, 150, 175, 180, 198, 220, 220, 120, 220, 2794, 345, 380, 423, 460, 252, 465, 586, 712, 920, 15891, 1026, 1105, 1190, 1436, 1697, 785, 1812, 1931, 2089, 57700, 4402, 4900, 2700, 5974, 6600, 7120, 7320, 7780, 4074, 120290, 6104, 2468, 4406, 8336, 8738, 9072, 8738, 4912, 7400, 181122, 8460, 9504, 7642, 11672, 12702, 13280, 11672, 11000, 15046, 401128, 15790, 15790, 12023, 16620, 8024, 17446, 601136, 18970, 15656, 19264);
var nachodinero = new Array(1, 1, 1, 1, 1, 2, 2, 2, 2, 40, 2, 2, 3, 8, 3, 3, 3, 4, 12, 75, 4, 4, 4, 5, 5, 16, 5, 6, 6, 100, 6, 6, 6, 6, 15, 7, 7, 9, 9, 125, 9, 9, 9, 20, 11, 11, 11, 11, 11, 150, 12, 12, 12, 12, 12, 12, 25, 12, 12, 150, 14, 14, 14, 14, 14, 14, 14, 14, 14, 200, 16, 16, 16, 16, 16, 16, 200, 16, 16, 16);
var numerohijos = new Array();
i = 1;
while (i <= 100) {
numerohijos[i] = 0;
i++;
}
numerohijos[1] = 4;
numerohijos[14] = 4;
numerohijos[19] = 4;
numerohijos[26] = 4;
numerohijos[35] = 4;
numerohijos[44] = 4;
numerohijos[48] = 4;
numerohijos[54] = 4;
numerohijos[57] = 4;
numerohijos[67] = 4;
numerohijos[78] = 4;
numerohijos[86] = 4;
numerohijos[97] = 4;
i = 0;
while (i <= 6) {
_level0.terreno["altar" + (i + 1)].cambioestado(nachotipo[nivel + i]);
i++;
}
onEnterFrame = function () {
var _local6 = false;
if (_global.empezar == 0) {
i = 0;
while (i <= 6) {
_level0.terreno["altar" + (i + 1)].cambioestado(nachotipo[nivel + i]);
i++;
}
}
if (_global.STOP == false) {
if (_global.empezar == 1) {
contador++;
_level0.terreno.reloj.text = Math.ceil(30 - (_root["contador" + (nivel + 1)] / 25));
do {
rand = Math.floor(Math.random() * 10);
if ((rand >= 0) and (rand <= 2)) {
rand = 1;
}
if ((rand > 2) and (rand <= 5)) {
rand = -1;
}
if ((rand > 5) and (rand <= 7)) {
rand = 0;
}
if ((rand > 7) and (rand <= 12)) {
rand = 2;
}
} while (rand == randomaux);
randomaux = rand;
var _local5;
var _local4;
var _local3;
_local3 = 1;
while (_local3 <= 100) {
if (nivel >= (_local3 - 1)) {
if (_root["contador" + _local3] <= 749) {
if (nachotipo[_local3 - 1] == 1) {
_local5 = 34;
} else if (nachotipo[_local3 - 1] == 6) {
_local5 = 1;
} else {
_local5 = 135;
}
if (((_root["contador" + _local3] % 17) == 0) and (_root["contador" + _local3] <= _local5)) {
if (nachotipo[_local3 - 1] == 3) {
_local4 = 25;
} else {
_local4 = 0;
}
_level0.terreno.attachMovie("bicho" + nachotipo[_local3 - 1], "bich" + cont, _level0.terreno.getNextHighestDepth(), {_x:-230, _y:290, _xscale:133, _yscale:133, fila:12 + rand, columna:_local4, vida:Math.floor(nachovida[_local3 - 1] * 1.5), dinero:Math.floor(nachodinero[_local3 - 1] * 1.4), contadorhijos:numerohijos[_local3], ultimoboss:_local6});
_level0.terreno.attachMovie(("bicho" + nachotipo[_local3 - 1]) + "v", "bichv" + cont, _level0.terreno.getNextHighestDepth(), {_x:260, _y:-130, _xscale:133, _yscale:133, fila:_local4, columna:12 + rand, vida:Math.floor(nachovida[_local3 - 1] * 1.5), dinero:Math.floor(nachodinero[_local3 - 1] * 1.4), contadorhijos:numerohijos[_local3], ultimoboss:_local6});
if (_root.contador80 == 119) {
_level0.terreno.ultimonivel = true;
}
}
if (((_root["contador" + _local3] == 749) and (nivel == (_local3 - 1))) and (nivel < 79)) {
nivel++;
_level0.terreno.nivelactual.text = nivel;
i = 0;
while (i <= 6) {
_level0.terreno["altar" + (i + 1)].cambioestado(nachotipo[nivel + i]);
i++;
}
}
_root["contador" + _local3]++;
cont++;
_level0.terreno.nivelactual.text = nivel + 1;
}
}
_local3++;
}
}
}
};
Symbol 487 MovieClip Frame 1
var contador = 0;
var cont = 0;
var rand;
var nivel = 0;
var randomaux = 3;
_global.empezar = 0;
this._visible = false;
i = 1;
while (i <= 100) {
_root["contador" + i] = 0;
i++;
}
var nachotipo = new Array(5, 4, 2, 4, 3, 2, 4, 2, 5, 6, 2, 3, 5, 1, 2, 4, 2, 3, 1, 6, 3, 4, 2, 2, 3, 1, 5, 4, 2, 6, 5, 4, 5, 2, 1, 3, 5, 2, 4, 6, 5, 2, 3, 1, 4, 5, 5, 1, 5, 6, 2, 4, 3, 1, 4, 5, 6, 1, 3, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
var nachovida = new Array(35, 47, 45, 70, 37, 100, 125, 100, 150, 998, 100, 150, 175, 180, 198, 220, 220, 120, 220, 2794, 345, 380, 423, 460, 252, 465, 586, 712, 920, 15891, 1026, 1105, 1190, 1436, 1697, 785, 1812, 1931, 2089, 57700, 4402, 4900, 2700, 5974, 6600, 7120, 7320, 7780, 4074, 120290, 6104, 2468, 4406, 8336, 8738, 9072, 181122, 8738, 4912, 7400);
var nachodinero = new Array(1, 1, 1, 1, 1, 1, 2, 2, 2, 40, 2, 2, 2, 8, 3, 3, 3, 3, 12, 75, 4, 4, 4, 5, 5, 16, 5, 6, 6, 100, 7, 7, 7, 7, 15, 9, 9, 9, 9, 150, 11, 11, 11, 20, 11, 11, 11, 11, 11, 175, 12, 12, 12, 12, 12, 12, 200, 25, 12, 12, 0, 14, 14, 14, 14, 14, 14, 14, 14, 14, 200, 16, 16, 16, 16, 16, 16, 200, 16, 16, 16);
var numerohijos = new Array();
i = 1;
while (i <= 100) {
numerohijos[i] = 0;
i++;
}
numerohijos[1] = 4;
numerohijos[14] = 4;
numerohijos[19] = 4;
numerohijos[26] = 4;
numerohijos[35] = 4;
numerohijos[44] = 4;
numerohijos[48] = 4;
numerohijos[54] = 4;
numerohijos[58] = 4;
numerohijos[67] = 4;
numerohijos[77] = 4;
i = 0;
while (i <= 6) {
_level0.terreno["altar" + (i + 1)].cambioestado(nachotipo[nivel + i]);
i++;
}
onEnterFrame = function () {
var _local6 = false;
if (_global.empezar == 0) {
i = 0;
while (i <= 6) {
_level0.terreno["altar" + (i + 1)].cambioestado(nachotipo[nivel + i]);
i++;
}
}
if (_global.STOP == false) {
if (_global.empezar == 1) {
contador++;
_level0.terreno.reloj.text = Math.ceil(30 - (_root["contador" + (nivel + 1)] / 25));
do {
rand = Math.floor(Math.random() * 10);
if ((rand >= 0) and (rand <= 2)) {
rand = 1;
}
if ((rand > 2) and (rand <= 5)) {
rand = -1;
}
if ((rand > 5) and (rand <= 7)) {
rand = 0;
}
if ((rand > 7) and (rand <= 12)) {
rand = 2;
}
} while (rand == randomaux);
randomaux = rand;
var _local5;
var _local4;
var _local3;
_local3 = 1;
while (_local3 <= 100) {
if (nivel >= (_local3 - 1)) {
if (_root["contador" + _local3] <= 749) {
if (nachotipo[_local3 - 1] == 1) {
_local5 = 34;
} else if (nachotipo[_local3 - 1] == 6) {
_local5 = 1;
} else {
_local5 = 135;
}
if (((_root["contador" + _local3] % 17) == 0) and (_root["contador" + _local3] <= _local5)) {
if (nachotipo[_local3 - 1] == 3) {
_local4 = 25;
} else {
_local4 = 0;
}
_level0.terreno.attachMovie("bicho" + nachotipo[_local3 - 1], "bich" + cont, _level0.terreno.getNextHighestDepth(), {_x:-230, _y:290, _xscale:133, _yscale:133, fila:12 + rand, columna:_local4, vida:Math.ceil(nachovida[_local3 - 1] * 1.1), dinero:Math.floor(nachodinero[_local3 - 1] * 1.9), contadorhijos:numerohijos[_local3], ultimoboss:_local6});
_level0.terreno.attachMovie(("bicho" + nachotipo[_local3 - 1]) + "v", "bichv" + cont, _level0.terreno.getNextHighestDepth(), {_x:260, _y:-130, _xscale:133, _yscale:133, fila:_local4, columna:12 + rand, vida:Math.ceil(nachovida[_local3 - 1] * 1.1), dinero:Math.floor(nachodinero[_local3 - 1] * 1.9), contadorhijos:numerohijos[_local3], ultimoboss:_local6});
if (_root.contador60 == 119) {
_level0.terreno.ultimonivel = true;
}
}
if (((_root["contador" + _local3] == 749) and (nivel == (_local3 - 1))) and (nivel < 59)) {
nivel++;
_level0.terreno.nivelactual.text = nivel;
i = 0;
while (i <= 6) {
_level0.terreno["altar" + (i + 1)].cambioestado(nachotipo[nivel + i]);
i++;
}
}
_root["contador" + _local3]++;
cont++;
_level0.terreno.nivelactual.text = nivel + 1;
}
}
_local3++;
}
}
}
};
Symbol 492 MovieClip Frame 1
var contador = 0;
var cont = 0;
var rand;
var nivel = 0;
var randomaux = 3;
var tiemporeloj;
_global.empezar = 0;
this._visible = false;
i = 1;
while (i <= 100) {
_root["contador" + i] = 0;
i++;
}
var nachotipo = new Array(5, 4, 2, 4, 3, 2, 4, 2, 5, 6, 2, 3, 5, 1, 2, 4, 2, 3, 1, 6, 3, 4, 2, 2, 3, 1, 5, 4, 2, 6, 5, 4, 5, 2, 1, 3, 6, 1, 3, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
var nachovida = new Array(35, 47, 54, 98, 37, 130, 145, 100, 190, 998, 100, 150, 175, 180, 198, 220, 220, 120, 220, 2794, 345, 380, 423, 460, 252, 465, 586, 712, 920, 15891, 1026, 1105, 1190, 1436, 1697, 785, 28900, 1812, 1031, 2089);
var nachodinero = new Array(1, 1, 1, 1, 1, 1, 1, 1, 2, 40, 2, 2, 2, 8, 3, 3, 3, 3, 12, 75, 4, 4, 4, 5, 5, 16, 5, 6, 6, 200, 6, 6, 6, 6, 15, 7, 250, 7, 9, 9);
var numerohijos = new Array();
i = 1;
while (i <= 100) {
numerohijos[i] = 0;
i++;
}
numerohijos[1] = 3;
numerohijos[14] = 3;
numerohijos[19] = 3;
numerohijos[26] = 3;
numerohijos[35] = 3;
numerohijos[38] = 3;
i = 0;
while (i <= 6) {
_level0.terreno["altar" + (i + 1)].cambioestado(nachotipo[nivel + i]);
i++;
}
onEnterFrame = function () {
var _local6 = false;
if (_global.empezar == 0) {
i = 0;
while (i <= 6) {
_level0.terreno["altar" + (i + 1)].cambioestado(nachotipo[nivel + i]);
i++;
}
}
if (_global.STOP == false) {
if (_global.empezar == 1) {
contador++;
tiemporeloj = Math.ceil(30 - (_root["contador" + (nivel + 1)] / 25));
_level0.terreno.reloj.text = tiemporeloj;
do {
rand = Math.floor(Math.random() * 10);
if ((rand >= 0) and (rand <= 2)) {
rand = 1;
}
if ((rand > 2) and (rand <= 5)) {
rand = -1;
}
if ((rand > 5) and (rand <= 7)) {
rand = 0;
}
if ((rand > 7) and (rand <= 12)) {
rand = 2;
}
} while (rand == randomaux);
randomaux = rand;
var _local5;
var _local4;
var _local3;
_local3 = 1;
while (_local3 <= 40) {
if (nivel >= (_local3 - 1)) {
if (_root["contador" + _local3] <= 749) {
if (nachotipo[_local3 - 1] == 1) {
_local5 = 34;
} else if (nachotipo[_local3 - 1] == 6) {
_local5 = 1;
} else {
_local5 = 135;
}
if (((_root["contador" + _local3] % 17) == 0) and (_root["contador" + _local3] <= _local5)) {
if (nachotipo[_local3 - 1] == 3) {
_local4 = 25;
} else {
_local4 = 0;
}
if ((_local3 % 2) != 0) {
_level0.terreno.attachMovie("bicho" + nachotipo[_local3 - 1], "bich" + cont, _level0.terreno.getNextHighestDepth(), {_x:-230, _y:290, _xscale:133, _yscale:133, fila:12 + rand, columna:_local4, vida:Math.floor(nachovida[_local3 - 1] * 0.47), dinero:Math.floor(nachodinero[_local3 - 1] * 2.5), contadorhijos:numerohijos[_local3], ultimoboss:_local6});
} else {
_level0.terreno.attachMovie(("bicho" + nachotipo[_local3 - 1]) + "v", "bichv" + cont, _level0.terreno.getNextHighestDepth(), {_x:260, _y:-130, _xscale:133, _yscale:133, fila:_local4, columna:12 + rand, vida:Math.floor(nachovida[_local3 - 1] * 0.47), dinero:Math.floor(nachodinero[_local3 - 1] * 2.5), contadorhijos:numerohijos[_local3], ultimoboss:_local6});
}
if (_root.contador40 == 119) {
trace("----------");
_level0.terreno.ultimonivel = true;
}
}
if (((_root["contador" + _local3] == 749) and (nivel == (_local3 - 1))) and (nivel < 39)) {
nivel++;
_level0.terreno.nivelactual.text = nivel;
i = 0;
while (i <= 6) {
_level0.terreno["altar" + (i + 1)].cambioestado(nachotipo[nivel + i]);
i++;
}
}
_root["contador" + _local3]++;
cont++;
_level0.terreno.nivelactual.text = nivel + 1;
}
}
_local3++;
}
}
}
};
Symbol 493 MovieClip [bicho6] Frame 1
function mover(tabIA, long) {
var _local3 = new Array(7);
var _local4;
var _local5;
var _local7 = 0;
var _local9 = 0;
var _local8 = 0;
if ((pensar == 1) and (_global.tableroIA[fila][columna] != 1)) {
i = 0;
while (i <= 7) {
_local3[i] = 9999;
i++;
}
if ((this.fila + 1) <= long) {
_local3[0] = tabIA[this.fila + 1][this.columna];
_local3[4] = tabIA[this.fila + 1][this.columna - 1];
_local3[5] = tabIA[this.fila + 1][this.columna + 1];
}
if ((this.fila - 1) >= 0) {
_local3[1] = tabIA[this.fila - 1][this.columna];
_local3[6] = tabIA[this.fila - 1][this.columna - 1];
_local3[7] = tabIA[this.fila - 1][this.columna + 1];
}
if ((this.columna + 1) <= long) {
_local3[2] = tabIA[this.fila][this.columna + 1];
}
if ((this.columna - 1) >= 0) {
_local3[3] = tabIA[this.fila][this.columna - 1];
}
_local4 = _local3[0];
_local5 = 0;
i = 1;
while (i <= 7) {
if (_local3[i] < _local4) {
_local4 = _local3[i];
_local5 = i;
}
i++;
}
_local4 = 0;
switch (_local5) {
case 0 :
filsig = this.fila + 1;
columsig = this.columna;
_local4++;
if ((((cuerpo._currentframe > 20) and (estoyentablero == true)) and (estoyentablero == true)) and (estoyentablero == true)) {
cuerpo.gotoAndPlay(1);
}
actorretas(filsig, columsig);
break;
case 1 :
filsig = this.fila - 1;
columsig = this.columna;
_local4++;
if (((cuerpo._currentframe < 21) and (estoyentablero == true)) or ((cuerpo._currentframe > 40) and (estoyentablero == true))) {
cuerpo.gotoAndPlay(21);
}
actorretas(filsig, columsig);
break;
case 2 :
columsig = this.columna + 1;
filsig = this.fila;
_local4++;
if (((cuerpo._currentframe < 81) and (estoyentablero == true)) or ((cuerpo._currentframe > 100) and (estoyentablero == true))) {
cuerpo.gotoAndPlay(81);
}
actorretas(filsig, columsig);
break;
case 3 :
columsig = this.columna - 1;
filsig = this.fila;
_local4++;
if (((cuerpo._currentframe < 141) and (estoyentablero == true)) or ((cuerpo._currentframe > 160) and (estoyentablero == true))) {
cuerpo.gotoAndPlay(141);
}
actorretas(filsig, columsig);
break;
case 4 :
if ((_global.tablero[fila][columna - 1] == 1) and (_global.tablero[fila + 1][columna] == 1)) {
columsig = this.columna - 1;
filsig = this.fila + 1;
_local4++;
if (((cuerpo._currentframe < 61) and (estoyentablero == true)) or ((cuerpo._currentframe > 80) and (estoyentablero == true))) {
cuerpo.gotoAndPlay(61);
}
actorretas(filsig, columsig);
}
break;
case 5 :
if ((_global.tablero[fila][columna + 1] == 1) and (_global.tablero[fila + 1][columna] == 1)) {
columsig = this.columna + 1;
filsig = this.fila + 1;
_local4++;
if (((cuerpo._currentframe < 121) and (estoyentablero == true)) or ((cuerpo._currentframe > 140) and (estoyentablero == true))) {
cuerpo.gotoAndPlay(121);
}
actorretas(filsig, columsig);
}
break;
case 6 :
if ((_global.tablero[fila][columna - 1] == 1) and (_global.tablero[fila - 1][columna] == 1)) {
columsig = this.columna - 1;
filsig = this.fila - 1;
_local4++;
if (((cuerpo._currentframe < 101) and (estoyentablero == true)) or ((cuerpo._currentframe > 120) and (estoyentablero == true))) {
cuerpo.gotoAndPlay(101);
}
actorretas(filsig, columsig);
}
break;
case 7 :
if (!((_global.tablero[fila][columna + 1] == 1) and (_global.tablero[fila - 1][columna] == 1))) {
break;
}
columsig = this.columna + 1;
filsig = this.fila - 1;
_local4++;
if (((cuerpo._currentframe < 41) and (estoyentablero == true)) or ((cuerpo._currentframe > 60) and (estoyentablero == true))) {
cuerpo.gotoAndPlay(41);
}
actorretas(filsig, columsig);
}
if (_local4 == 0) {
_local4 = _local3[0];
_local5 = 0;
i = 1;
while (i <= 3) {
if (_local3[i] <= _local4) {
_local4 = _local3[i];
_local5 = i;
}
i++;
}
switch (_local5) {
case 0 :
filsig = this.fila + 1;
columsig = this.columna;
if ((cuerpo._currentframe > 20) and (estoyentablero == true)) {
cuerpo.gotoAndPlay(1);
}
actorretas(filsig, columsig);
break;
case 1 :
filsig = this.fila - 1;
columsig = this.columna;
if (((cuerpo._currentframe < 21) and (estoyentablero == true)) or ((cuerpo._currentframe > 40) and (estoyentablero == true))) {
cuerpo.gotoAndPlay(21);
}
actorretas(filsig, columsig);
break;
case 2 :
columsig = this.columna + 1;
filsig = this.fila;
if (((cuerpo._currentframe < 81) and (estoyentablero == true)) or ((cuerpo._currentframe > 100) and (estoyentablero == true))) {
cuerpo.gotoAndPlay(81);
}
actorretas(filsig, columsig);
break;
case 3 :
columsig = this.columna - 1;
filsig = this.fila;
if (((cuerpo._currentframe < 141) and (estoyentablero == true)) or ((cuerpo._currentframe > 160) and (estoyentablero == true))) {
cuerpo.gotoAndPlay(141);
}
actorretas(filsig, columsig);
}
}
pensar = 0;
}
if (estoyentablero == false) {
filsig = fila;
columsig = columna;
while (tabIA[fila][columna] >= 999) {
fila = 11 + _local7;
filsig = fila;
columsig = columna;
_local7++;
}
}
if (frenatorreta != null) {
if (this.hitTest(frenatorreta.alcance) == false) {
lento = 1;
frenatorreta = null;
}
}
if (_global.tablero[filsig][columsig] == 0) {
pensar = 1;
}
if (this._x < ((columsig * 20) + 10)) {
this._x = this._x + (this.velocidad * lento);
_local9 = 1;
}
if (this._x > ((columsig * 20) + 10)) {
this._x = this._x - (this.velocidad * lento);
_local9 = -1;
}
if (this._y < ((filsig * 20) + 10)) {
this._y = this._y + (this.velocidad * lento);
_local8 = 1;
}
if (this._y > ((filsig * 20) + 10)) {
this._y = this._y - (this.velocidad * lento);
_local8 = -1;
}
if (Math.abs(this._x - ((columsig * 20) + 10)) <= 2) {
if (Math.abs(this._y - ((filsig * 20) + 10)) <= 2) {
this.fila = filsig;
this.columna = columsig;
pensar = 1;
if (estoyentablero == false) {
estoyentablero = true;
}
}
}
}
function eliminar() {
if (_global.tableroIA[fila][columna] == 1) {
columsig = 100;
if ((cuerpo._currentframe < 81) or (cuerpo._currentframe > 100)) {
cuerpo.gotoAndPlay(81);
}
}
if (this._x > 700) {
delete _global.enemigos[this];
_global.vida = _global.vida - 1;
_level0.terreno.attachMovie("laugh", "D" + this, _level0.terreno.getNextHighestDepth());
if (_level0.terreno.info.objeto == this) {
_level0.terreno.info.gotoAndStop(1);
_level0.terreno.info.ataque1.text = "";
_level0.terreno.info.distancia1.text = "";
_level0.terreno.info.coste1.text = "";
_level0.terreno.info.ataque2.text = "";
_level0.terreno.info.distancia2.text = "";
_level0.terreno.info.coste2.text = "";
}
if (_level0.terreno.markerbi.enemigo == this) {
_level0.terreno.markerbi.removeMovieClip();
}
this.removeMovieClip();
}
if (vida <= 0) {
delete _global.enemigos[this];
_global.puntos = _global.puntos + (100 * factorpuntos);
_global.dinero = _global.dinero + dinero;
if (_level0.terreno.info.objeto == this) {
_level0.terreno.info.gotoAndStop(1);
_level0.terreno.info.ataque1.text = "";
_level0.terreno.info.distancia1.text = "";
_level0.terreno.info.coste1.text = "";
_level0.terreno.info.ataque2.text = "";
_level0.terreno.info.distancia2.text = "";
_level0.terreno.info.coste2.text = "";
}
if (_level0.terreno.markerbi.enemigo == this) {
_level0.terreno.markerbi.removeMovieClip();
}
_level0.terreno.attachMovie("DWEE", "D" + this, _level0.terreno.getNextHighestDepth());
_level0.terreno.attachMovie("sumadinero", "Di" + this, _level0.terreno.getNextHighestDepth(), {_x:_level0.terreno.dinero._x + 45, _y:_level0.terreno.dinero._y + 5, coste:dinero});
this.removeMovieClip();
}
}
function actorretas(fil, colum) {
for (k in _global.tableroalcance[fil][colum]) {
_global.tableroalcance[fil][colum][k].activardisparo = true;
_global.tableroalcance[fil][colum][k].enemigosatiro[this] = this;
}
}
var fila;
var columna;
var velocidad = 2;
var vida;
var factordinero = 1;
var factorpuntos = 1;
var factorvida = 1;
var tipo = "normal";
var lento = 1;
var dinero;
var vidatotal = vida;
var clase = "H";
var indice;
var pensar = 1;
var filsig;
var columsig;
var frenatorreta = null;
var vidafutura = vida;
var estoyentablero = false;
var ultimoboss;
trace(ultimoboss);
this.cacheAsBitmap = true;
cuerpo.gotoAndPlay("lado");
vida = vida * factorvida;
this.swapDepths(_parent.getNextHighestDepth());
_global.enemigos[this] = this;
if (ultimoboss == true) {
}
if (_global.tableroIA[fila][columna] >= 999) {
i = 11;
while (i <= 14) {
if (_global.tableroIA[i][0] < 999) {
fila = i;
columna = 0;
break;
}
i++;
}
}
onPress = function () {
if (_global.STOP == false) {
_level0.terreno.info.objeto = this;
_level0.terreno.info.gotoAndStop(2);
_level0.terreno.info.foto.gotoAndStop("boss");
_level0.terreno.markerbi.removeMovieClip();
_level0.terreno.attachMovie("markerbi", "markerbi", _level0.terreno.getNextHighestDepth(), {_x:this._x, _y:this._y, _alpha:50, enemigo:this});
}
};
onEnterFrame = function () {
if (_global.STOP == false) {
mover(_global.tableroIA, _global.longtab);
this.eliminar();
}
};
stop();
Symbol 494 MovieClip [bicho5v] Frame 1
function mover(tabIA, long) {
var _local3 = new Array(3);
var _local4;
var _local5;
var _local7 = 0;
if ((pensar == 1) and (_global.tableroIAv[fila][columna] != 1)) {
i = 0;
while (i <= 7) {
_local3[i] = 9999;
i++;
}
if ((this.fila + 1) <= long) {
_local3[0] = tabIA[this.fila + 1][this.columna];
_local3[4] = tabIA[this.fila + 1][this.columna - 1];
_local3[5] = tabIA[this.fila + 1][this.columna + 1];
}
if ((this.fila - 1) >= 0) {
_local3[1] = tabIA[this.fila - 1][this.columna];
_local3[6] = tabIA[this.fila - 1][this.columna - 1];
_local3[7] = tabIA[this.fila - 1][this.columna + 1];
}
if ((this.columna + 1) <= long) {
_local3[2] = tabIA[this.fila][this.columna + 1];
}
if ((this.columna - 1) >= 0) {
_local3[3] = tabIA[this.fila][this.columna - 1];
}
_local4 = _local3[0];
_local5 = 0;
i = 1;
while (i <= 7) {
if (_local3[i] < _local4) {
_local4 = _local3[i];
_local5 = i;
}
i++;
}
_local4 = 0;
switch (_local5) {
case 0 :
filsig = this.fila + 1;
columsig = this.columna;
_local4++;
if ((((cuerpo._currentframe > 20) and (estoyentablero == true)) and (estoyentablero == true)) and (estoyentablero == true)) {
cuerpo.gotoAndPlay(1);
}
actorretas(filsig, columsig);
break;
case 1 :
filsig = this.fila - 1;
columsig = this.columna;
_local4++;
if (((cuerpo._currentframe < 21) and (estoyentablero == true)) or ((cuerpo._currentframe > 40) and (estoyentablero == true))) {
cuerpo.gotoAndPlay(21);
}
actorretas(filsig, columsig);
break;
case 2 :
columsig = this.columna + 1;
filsig = this.fila;
_local4++;
if (((cuerpo._currentframe < 81) and (estoyentablero == true)) or ((cuerpo._currentframe > 100) and (estoyentablero == true))) {
cuerpo.gotoAndPlay(81);
}
actorretas(filsig, columsig);
break;
case 3 :
columsig = this.columna - 1;
filsig = this.fila;
_local4++;
if (((cuerpo._currentframe < 141) and (estoyentablero == true)) or ((cuerpo._currentframe > 160) and (estoyentablero == true))) {
cuerpo.gotoAndPlay(141);
}
actorretas(filsig, columsig);
break;
case 4 :
if ((_global.tablero[fila][columna - 1] == 1) and (_global.tablero[fila + 1][columna] == 1)) {
columsig = this.columna - 1;
filsig = this.fila + 1;
_local4++;
if (((cuerpo._currentframe < 61) and (estoyentablero == true)) or ((cuerpo._currentframe > 80) and (estoyentablero == true))) {
cuerpo.gotoAndPlay(61);
}
actorretas(filsig, columsig);
}
break;
case 5 :
if ((_global.tablero[fila][columna + 1] == 1) and (_global.tablero[fila + 1][columna] == 1)) {
columsig = this.columna + 1;
filsig = this.fila + 1;
_local4++;
if (((cuerpo._currentframe < 121) and (estoyentablero == true)) or ((cuerpo._currentframe > 140) and (estoyentablero == true))) {
cuerpo.gotoAndPlay(121);
}
actorretas(filsig, columsig);
}
break;
case 6 :
if ((_global.tablero[fila][columna - 1] == 1) and (_global.tablero[fila - 1][columna] == 1)) {
columsig = this.columna - 1;
filsig = this.fila - 1;
_local4++;
if (((cuerpo._currentframe < 101) and (estoyentablero == true)) or ((cuerpo._currentframe > 120) and (estoyentablero == true))) {
cuerpo.gotoAndPlay(101);
}
actorretas(filsig, columsig);
}
break;
case 7 :
if (!((_global.tablero[fila][columna + 1] == 1) and (_global.tablero[fila - 1][columna] == 1))) {
break;
}
columsig = this.columna + 1;
filsig = this.fila - 1;
_local4++;
if (((cuerpo._currentframe < 41) and (estoyentablero == true)) or ((cuerpo._currentframe > 60) and (estoyentablero == true))) {
cuerpo.gotoAndPlay(41);
}
actorretas(filsig, columsig);
}
if (_local4 == 0) {
_local4 = _local3[0];
_local5 = 0;
i = 1;
while (i <= 3) {
if (_local3[i] <= _local4) {
_local4 = _local3[i];
_local5 = i;
}
i++;
}
switch (_local5) {
case 0 :
filsig = this.fila + 1;
columsig = this.columna;
if ((cuerpo._currentframe > 20) and (estoyentablero == true)) {
cuerpo.gotoAndPlay(1);
}
actorretas(filsig, columsig);
break;
case 1 :
filsig = this.fila - 1;
columsig = this.columna;
if (((cuerpo._currentframe < 21) and (estoyentablero == true)) or ((cuerpo._currentframe > 40) and (estoyentablero == true))) {
cuerpo.gotoAndPlay(21);
}
actorretas(filsig, columsig);
break;
case 2 :
columsig = this.columna + 1;
filsig = this.fila;
if (((cuerpo._currentframe < 81) and (estoyentablero == true)) or ((cuerpo._currentframe > 100) and (estoyentablero == true))) {
cuerpo.gotoAndPlay(81);
}
actorretas(filsig, columsig);
break;
case 3 :
columsig = this.columna - 1;
filsig = this.fila;
if (((cuerpo._currentframe < 141) and (estoyentablero == true)) or ((cuerpo._currentframe > 160) and (estoyentablero == true))) {
cuerpo.gotoAndPlay(141);
}
actorretas(filsig, columsig);
}
}
pensar = 0;
}
if (estoyentablero == false) {
filsig = fila;
columsig = columna;
while (tabIA[fila][columna] >= 999) {
columna = 11 + _local7;
columsig = columna;
columsig = columna;
_local7++;
}
}
if (_global.tablero[filsig][columsig] == 0) {
pensar = 1;
}
if (frenatorreta != null) {
if (this.hitTest(frenatorreta.alcance) == false) {
lento = 1;
frenatorreta = null;
}
}
if (this._x < ((columsig * 20) + 10)) {
this._x = this._x + (this.velocidad * lento);
}
if (this._x > ((columsig * 20) + 10)) {
this._x = this._x - (this.velocidad * lento);
}
if (this._y < ((filsig * 20) + 10)) {
this._y = this._y + (this.velocidad * lento);
}
if (this._y > ((filsig * 20) + 10)) {
this._y = this._y - (this.velocidad * lento);
}
if (Math.abs(this._x - ((columsig * 20) + 10)) <= 3) {
if (Math.abs(this._y - ((filsig * 20) + 10)) <= 3) {
this.fila = filsig;
this.columna = columsig;
pensar = 1;
if (estoyentablero == false) {
estoyentablero = true;
}
}
}
}
function eliminar() {
if (_global.tableroIAv[fila][columna] == 1) {
filsig = 100;
if ((cuerpo._currentframe > 20) and (estoyentablero == true)) {
cuerpo.gotoAndPlay(1);
}
}
if (this._y > 600) {
delete _global.enemigos[this];
_global.vida = _global.vida - 1;
_level0.terreno.attachMovie("laugh", "D" + this, _level0.terreno.getNextHighestDepth());
if (_level0.terreno.info.objeto == this) {
_level0.terreno.info.gotoAndStop(1);
_level0.terreno.info.ataque1.text = "";
_level0.terreno.info.distancia1.text = "";
_level0.terreno.info.coste1.text = "";
_level0.terreno.info.ataque2.text = "";
_level0.terreno.info.distancia2.text = "";
_level0.terreno.info.coste2.text = "";
}
if (_level0.terreno.markerbi.enemigo == this) {
_level0.terreno.markerbi.removeMovieClip();
}
this.removeMovieClip();
}
if (vida <= 0) {
delete _global.enemigos[this];
_global.puntos = _global.puntos + (100 * factorpuntos);
_global.dinero = _global.dinero + dinero;
if (_level0.terreno.info.objeto == this) {
_level0.terreno.info.gotoAndStop(1);
_level0.terreno.info.ataque1.text = "";
_level0.terreno.info.distancia1.text = "";
_level0.terreno.info.coste1.text = "";
_level0.terreno.info.ataque2.text = "";
_level0.terreno.info.distancia2.text = "";
_level0.terreno.info.coste2.text = "";
}
if (_level0.terreno.markerbi.enemigo == this) {
_level0.terreno.markerbi.removeMovieClip();
}
_level0.terreno.attachMovie("DWEE", "D" + this, _level0.terreno.getNextHighestDepth());
_level0.terreno.attachMovie("sumadinero", "Di" + this, _level0.terreno.getNextHighestDepth(), {_x:_level0.terreno.dinero._x + 45, _y:_level0.terreno.dinero._y + 5, coste:dinero});
this.removeMovieClip();
}
}
function actorretas(fil, colum) {
for (k in _global.tableroalcance[fil][colum]) {
_global.tableroalcance[fil][colum][k].activardisparo = true;
_global.tableroalcance[fil][colum][k].enemigosatiro[this] = this;
}
}
var fila;
var columna;
var velocidad = 3;
var vida;
var factordinero = 1;
var factorpuntos = 1;
var factorvida = 1;
var tipo = "normal";
var lento = 1;
var dinero;
var vidatotal = vida;
var clase = "V";
var pensar = 1;
var filsig;
var columsig;
var vidafutura = vida;
var estoyentablero = false;
hitArea = hitcuerpo;
hitcuerpo._visible = false;
this.cacheAsBitmap = true;
cuerpo.gotoAndPlay("frente");
vida = vida * factorvida;
this.swapDepths(_parent.getNextHighestDepth());
indice = _global.enemigos.length;
_global.enemigos[this] = this;
if (_global.tableroIA[fila][columna] >= 999) {
i = 10;
while (i <= 14) {
if (_global.tableroIA[0][i] < 999) {
fila = 0;
columna = i;
break;
}
i++;
}
}
onPress = function () {
if (_global.STOP == false) {
_level0.terreno.info.objeto = this;
_level0.terreno.info.gotoAndStop(2);
_level0.terreno.info.foto.gotoAndStop("common");
_level0.terreno.markerbi.removeMovieClip();
_level0.terreno.attachMovie("markerbi", "markerbi", _level0.terreno.getNextHighestDepth(), {_x:this._x, _y:this._y, _alpha:50, enemigo:this});
}
};
onEnterFrame = function () {
if (_global.STOP == false) {
mover(_global.tableroIAv, _global.longtab);
this.eliminar();
}
};
Symbol 534 MovieClip Frame 1
onEnterFrame = function () {
if (_global.STOP == false) {
this.play();
} else {
this.stop();
}
};
Symbol 534 MovieClip Frame 20
gotoAndPlay (1);
Symbol 534 MovieClip Frame 40
gotoAndPlay (21);
Symbol 534 MovieClip Frame 60
gotoAndPlay (41);
Symbol 534 MovieClip Frame 80
gotoAndPlay (61);
Symbol 534 MovieClip Frame 100
gotoAndPlay (81);
Symbol 534 MovieClip Frame 120
gotoAndPlay (101);
Symbol 534 MovieClip Frame 140
gotoAndPlay (121);
Symbol 534 MovieClip Frame 160
gotoAndPlay (141);
Symbol 534 MovieClip Frame 180
stop();
Symbol 535 MovieClip [bicho4v] Frame 1
function mover(tabIA, long) {
var _local3 = new Array(3);
var _local4;
var _local5;
var _local7 = 0;
var _local8;
if ((pensar == 1) and (_global.tableroIAv[fila][columna] != 1)) {
i = 0;
while (i <= 7) {
_local3[i] = 9999;
i++;
}
if ((this.fila + 1) <= long) {
_local3[0] = tabIA[this.fila + 1][this.columna];
_local3[4] = tabIA[this.fila + 1][this.columna - 1];
_local3[5] = tabIA[this.fila + 1][this.columna + 1];
}
if ((this.fila - 1) >= 0) {
_local3[1] = tabIA[this.fila - 1][this.columna];
_local3[6] = tabIA[this.fila - 1][this.columna - 1];
_local3[7] = tabIA[this.fila - 1][this.columna + 1];
}
if ((this.columna + 1) <= long) {
_local3[2] = tabIA[this.fila][this.columna + 1];
}
if ((this.columna - 1) >= 0) {
_local3[3] = tabIA[this.fila][this.columna - 1];
}
_local4 = _local3[0];
_local5 = 0;
i = 1;
while (i <= 7) {
if (_local3[i] < _local4) {
_local4 = _local3[i];
_local5 = i;
}
i++;
}
_local4 = 0;
switch (_local5) {
case 0 :
filsig = this.fila + 1;
columsig = this.columna;
_local4++;
if ((((cuerpo._currentframe > 20) and (estoyentablero == true)) and (estoyentablero == true)) and (estoyentablero == true)) {
cuerpo.gotoAndPlay(1);
}
actorretas(filsig, columsig);
break;
case 1 :
filsig = this.fila - 1;
columsig = this.columna;
_local4++;
if (((cuerpo._currentframe < 21) and (estoyentablero == true)) or ((cuerpo._currentframe > 40) and (estoyentablero == true))) {
cuerpo.gotoAndPlay(21);
}
actorretas(filsig, columsig);
break;
case 2 :
columsig = this.columna + 1;
filsig = this.fila;
_local4++;
if (((cuerpo._currentframe < 81) and (estoyentablero == true)) or ((cuerpo._currentframe > 100) and (estoyentablero == true))) {
cuerpo.gotoAndPlay(81);
}
actorretas(filsig, columsig);
break;
case 3 :
columsig = this.columna - 1;
filsig = this.fila;
_local4++;
if (((cuerpo._currentframe < 141) and (estoyentablero == true)) or ((cuerpo._currentframe > 160) and (estoyentablero == true))) {
cuerpo.gotoAndPlay(141);
}
actorretas(filsig, columsig);
break;
case 4 :
if ((_global.tablero[fila][columna - 1] == 1) and (_global.tablero[fila + 1][columna] == 1)) {
columsig = this.columna - 1;
filsig = this.fila + 1;
_local4++;
if (((cuerpo._currentframe < 61) and (estoyentablero == true)) or ((cuerpo._currentframe > 80) and (estoyentablero == true))) {
cuerpo.gotoAndPlay(61);
}
actorretas(filsig, columsig);
}
break;
case 5 :
if ((_global.tablero[fila][columna + 1] == 1) and (_global.tablero[fila + 1][columna] == 1)) {
columsig = this.columna + 1;
filsig = this.fila + 1;
_local4++;
if (((cuerpo._currentframe < 121) and (estoyentablero == true)) or ((cuerpo._currentframe > 140) and (estoyentablero == true))) {
cuerpo.gotoAndPlay(121);
}
actorretas(filsig, columsig);
}
break;
case 6 :
if ((_global.tablero[fila][columna - 1] == 1) and (_global.tablero[fila - 1][columna] == 1)) {
columsig = this.columna - 1;
filsig = this.fila - 1;
_local4++;
if (((cuerpo._currentframe < 101) and (estoyentablero == true)) or ((cuerpo._currentframe > 120) and (estoyentablero == true))) {
cuerpo.gotoAndPlay(101);
}
actorretas(filsig, columsig);
}
break;
case 7 :
if (!((_global.tablero[fila][columna + 1] == 1) and (_global.tablero[fila - 1][columna] == 1))) {
break;
}
columsig = this.columna + 1;
filsig = this.fila - 1;
_local4++;
if (((cuerpo._currentframe < 41) and (estoyentablero == true)) or ((cuerpo._currentframe > 60) and (estoyentablero == true))) {
cuerpo.gotoAndPlay(41);
}
actorretas(filsig, columsig);
}
if (_local4 == 0) {
_local4 = _local3[0];
_local5 = 0;
i = 1;
while (i <= 3) {
if (_local3[i] <= _local4) {
_local4 = _local3[i];
_local5 = i;
}
i++;
}
switch (_local5) {
case 0 :
filsig = this.fila + 1;
columsig = this.columna;
if ((cuerpo._currentframe > 20) and (estoyentablero == true)) {
cuerpo.gotoAndPlay(1);
}
actorretas(filsig, columsig);
break;
case 1 :
filsig = this.fila - 1;
columsig = this.columna;
if (((cuerpo._currentframe < 21) and (estoyentablero == true)) or ((cuerpo._currentframe > 40) and (estoyentablero == true))) {
cuerpo.gotoAndPlay(21);
}
actorretas(filsig, columsig);
break;
case 2 :
columsig = this.columna + 1;
filsig = this.fila;
if (((cuerpo._currentframe < 81) and (estoyentablero == true)) or ((cuerpo._currentframe > 100) and (estoyentablero == true))) {
cuerpo.gotoAndPlay(81);
}
actorretas(filsig, columsig);
break;
case 3 :
columsig = this.columna - 1;
filsig = this.fila;
if (((cuerpo._currentframe < 141) and (estoyentablero == true)) or ((cuerpo._currentframe > 160) and (estoyentablero == true))) {
cuerpo.gotoAndPlay(141);
}
actorretas(filsig, columsig);
}
}
pensar = 0;
}
if (estoyentablero == false) {
filsig = fila;
columsig = columna;
while (tabIA[fila][columna] >= 999) {
columna = 11 + _local7;
columsig = columna;
columsig = columna;
_local7++;
}
}
if (_global.tablero[filsig][columsig] == 0) {
pensar = 1;
}
if (((estoyentablero == true) and (giro_crazy == false)) and (llego_meta == false)) {
_local8 = Math.random() * 10;
if (_local8 >= 9.9) {
velo_memo = velocidad;
frame_memo = this._currentframe;
giro_crazy = true;
velocidad = 0;
cuerpo.gotoAndPlay("giro");
}
}
if ((giro_crazy == true) and (cuerpo._currentframe == 180)) {
cuerpo.gotoAndPlay(frame_memo);
velocidad = velo_memo * 1.5;
}
if (giro_crazy == true) {
tempo++;
}
if (tempo == 50) {
tempo = 0;
velocidad = velo_memo;
giro_crazy = false;
}
if (frenatorreta != null) {
if (this.hitTest(frenatorreta.alcance) == false) {
lento = 1;
frenatorreta = null;
}
}
if (this._x < ((columsig * 20) + 10)) {
this._x = this._x + (this.velocidad * lento);
}
if (this._x > ((columsig * 20) + 10)) {
this._x = this._x - (this.velocidad * lento);
}
if (this._y < ((filsig * 20) + 10)) {
this._y = this._y + (this.velocidad * lento);
}
if (this._y > ((filsig * 20) + 10)) {
this._y = this._y - (this.velocidad * lento);
}
if (Math.abs(this._x - ((columsig * 20) + 10)) <= velocidad) {
if (Math.abs(this._y - ((filsig * 20) + 10)) <= velocidad) {
this.fila = filsig;
this.columna = columsig;
pensar = 1;
if (estoyentablero == false) {
estoyentablero = true;
}
}
}
}
function eliminar() {
if (_global.tableroIAv[fila][columna] == 1) {
filsig = 100;
llego_meta = true;
if ((cuerpo._currentframe > 20) and (estoyentablero == true)) {
cuerpo.gotoAndPlay(1);
}
}
if (this._y > 600) {
delete _global.enemigos[this];
_global.vida = _global.vida - 1;
_level0.terreno.attachMovie("laugh", "D" + this, _level0.terreno.getNextHighestDepth());
if (_level0.terreno.info.objeto == this) {
_level0.terreno.info.gotoAndStop(1);
_level0.terreno.info.ataque1.text = "";
_level0.terreno.info.distancia1.text = "";
_level0.terreno.info.coste1.text = "";
_level0.terreno.info.ataque2.text = "";
_level0.terreno.info.distancia2.text = "";
_level0.terreno.info.coste2.text = "";
}
if (_level0.terreno.markerbi.enemigo == this) {
_level0.terreno.markerbi.removeMovieClip();
}
this.removeMovieClip();
}
if (vida <= 0) {
delete _global.enemigos[this];
_global.puntos = _global.puntos + (100 * factorpuntos);
_global.dinero = _global.dinero + dinero;
if (_level0.terreno.info.objeto == this) {
_level0.terreno.info.gotoAndStop(1);
_level0.terreno.info.ataque1.text = "";
_level0.terreno.info.distancia1.text = "";
_level0.terreno.info.coste1.text = "";
_level0.terreno.info.ataque2.text = "";
_level0.terreno.info.distancia2.text = "";
_level0.terreno.info.coste2.text = "";
}
if (_level0.terreno.markerbi.enemigo == this) {
_level0.terreno.markerbi.removeMovieClip();
}
_level0.terreno.attachMovie("DWEE", "D" + this, _level0.terreno.getNextHighestDepth());
_level0.terreno.attachMovie("sumadinero", "Di" + this, _level0.terreno.getNextHighestDepth(), {_x:_level0.terreno.dinero._x + 45, _y:_level0.terreno.dinero._y + 5, coste:dinero});
this.removeMovieClip();
}
}
function actorretas(fil, colum) {
for (k in _global.tableroalcance[fil][colum]) {
_global.tableroalcance[fil][colum][k].activardisparo = true;
_global.tableroalcance[fil][colum][k].enemigosatiro[this] = this;
}
}
var fila;
var columna;
var velocidad = 3.5;
var vida;
var factordinero = 1;
var factorpuntos = 1;
var factorvida = 1;
var tipo = "normal";
var lento = 1;
var dinero;
var vidatotal = vida;
var clase = "V";
var pensar = 1;
var filsig;
var columsig;
var vidafutura = vida;
var estoyentablero = false;
var velo_memo;
var frame_memo;
var tempo = 0;
var giro_crazy = false;
var llego_meta = false;
hitArea = hitcuerpo;
hitcuerpo._visible = false;
this.cacheAsBitmap = true;
cuerpo.gotoAndPlay("frente");
vida = vida * factorvida;
this.swapDepths(_parent.getNextHighestDepth());
indice = _global.enemigos.length;
_global.enemigos[this] = this;
if (_global.tableroIA[fila][columna] >= 999) {
i = 11;
while (i <= 14) {
if (_global.tableroIA[0][i] < 999) {
fila = 0;
columna = i;
break;
}
i++;
}
}
onPress = function () {
if (_global.STOP == false) {
_level0.terreno.info.objeto = this;
_level0.terreno.info.gotoAndStop(2);
_level0.terreno.info.foto.gotoAndStop("crazy");
_level0.terreno.markerbi.removeMovieClip();
_level0.terreno.attachMovie("markerbi", "markerbi", _level0.terreno.getNextHighestDepth(), {_x:this._x, _y:this._y, _alpha:50, enemigo:this});
}
};
onEnterFrame = function () {
if (_global.STOP == false) {
mover(_global.tableroIAv, _global.longtab);
this.eliminar();
}
};
Symbol 536 MovieClip [bicho4] Frame 1
function mover(tabIA, long) {
var _local3 = new Array(7);
var _local4;
var _local5;
var _local7 = 0;
var _local8;
if ((pensar == 1) and (_global.tableroIA[fila][columna] != 1)) {
i = 0;
while (i <= 7) {
_local3[i] = 9999;
i++;
}
if ((this.fila + 1) <= long) {
_local3[0] = tabIA[this.fila + 1][this.columna];
_local3[4] = tabIA[this.fila + 1][this.columna - 1];
_local3[5] = tabIA[this.fila + 1][this.columna + 1];
}
if ((this.fila - 1) >= 0) {
_local3[1] = tabIA[this.fila - 1][this.columna];
_local3[6] = tabIA[this.fila - 1][this.columna - 1];
_local3[7] = tabIA[this.fila - 1][this.columna + 1];
}
if ((this.columna + 1) <= long) {
_local3[2] = tabIA[this.fila][this.columna + 1];
}
if ((this.columna - 1) >= 0) {
_local3[3] = tabIA[this.fila][this.columna - 1];
}
_local4 = _local3[0];
_local5 = 0;
i = 1;
while (i <= 7) {
if (_local3[i] < _local4) {
_local4 = _local3[i];
_local5 = i;
}
i++;
}
_local4 = 0;
switch (_local5) {
case 0 :
filsig = this.fila + 1;
columsig = this.columna;
_local4++;
if ((((cuerpo._currentframe > 20) and (estoyentablero == true)) and (estoyentablero == true)) and (estoyentablero == true)) {
cuerpo.gotoAndPlay(1);
}
actorretas(filsig, columsig);
break;
case 1 :
filsig = this.fila - 1;
columsig = this.columna;
_local4++;
if (((cuerpo._currentframe < 21) and (estoyentablero == true)) or ((cuerpo._currentframe > 40) and (estoyentablero == true))) {
cuerpo.gotoAndPlay(21);
}
actorretas(filsig, columsig);
break;
case 2 :
columsig = this.columna + 1;
filsig = this.fila;
_local4++;
if (((cuerpo._currentframe < 81) and (estoyentablero == true)) or ((cuerpo._currentframe > 100) and (estoyentablero == true))) {
cuerpo.gotoAndPlay(81);
}
actorretas(filsig, columsig);
break;
case 3 :
columsig = this.columna - 1;
filsig = this.fila;
_local4++;
if (((cuerpo._currentframe < 141) and (estoyentablero == true)) or ((cuerpo._currentframe > 160) and (estoyentablero == true))) {
cuerpo.gotoAndPlay(141);
}
actorretas(filsig, columsig);
break;
case 4 :
if ((_global.tablero[fila][columna - 1] == 1) and (_global.tablero[fila + 1][columna] == 1)) {
columsig = this.columna - 1;
filsig = this.fila + 1;
_local4++;
if (((cuerpo._currentframe < 61) and (estoyentablero == true)) or ((cuerpo._currentframe > 80) and (estoyentablero == true))) {
cuerpo.gotoAndPlay(61);
}
actorretas(filsig, columsig);
}
break;
case 5 :
if ((_global.tablero[fila][columna + 1] == 1) and (_global.tablero[fila + 1][columna] == 1)) {
columsig = this.columna + 1;
filsig = this.fila + 1;
_local4++;
if (((cuerpo._currentframe < 121) and (estoyentablero == true)) or ((cuerpo._currentframe > 140) and (estoyentablero == true))) {
cuerpo.gotoAndPlay(121);
}
actorretas(filsig, columsig);
}
break;
case 6 :
if ((_global.tablero[fila][columna - 1] == 1) and (_global.tablero[fila - 1][columna] == 1)) {
columsig = this.columna - 1;
filsig = this.fila - 1;
_local4++;
if (((cuerpo._currentframe < 101) and (estoyentablero == true)) or ((cuerpo._currentframe > 120) and (estoyentablero == true))) {
cuerpo.gotoAndPlay(101);
}
actorretas(filsig, columsig);
}
break;
case 7 :
if (!((_global.tablero[fila][columna + 1] == 1) and (_global.tablero[fila - 1][columna] == 1))) {
break;
}
columsig = this.columna + 1;
filsig = this.fila - 1;
_local4++;
if (((cuerpo._currentframe < 41) and (estoyentablero == true)) or ((cuerpo._currentframe > 60) and (estoyentablero == true))) {
cuerpo.gotoAndPlay(41);
}
actorretas(filsig, columsig);
}
if (_local4 == 0) {
_local4 = _local3[0];
_local5 = 0;
i = 1;
while (i <= 3) {
if (_local3[i] <= _local4) {
_local4 = _local3[i];
_local5 = i;
}
i++;
}
switch (_local5) {
case 0 :
filsig = this.fila + 1;
columsig = this.columna;
if ((cuerpo._currentframe > 20) and (estoyentablero == true)) {
cuerpo.gotoAndPlay(1);
}
actorretas(filsig, columsig);
break;
case 1 :
filsig = this.fila - 1;
columsig = this.columna;
if (((cuerpo._currentframe < 21) and (estoyentablero == true)) or ((cuerpo._currentframe > 40) and (estoyentablero == true))) {
cuerpo.gotoAndPlay(21);
}
actorretas(filsig, columsig);
break;
case 2 :
columsig = this.columna + 1;
filsig = this.fila;
if (((cuerpo._currentframe < 81) and (estoyentablero == true)) or ((cuerpo._currentframe > 100) and (estoyentablero == true))) {
cuerpo.gotoAndPlay(81);
}
actorretas(filsig, columsig);
break;
case 3 :
columsig = this.columna - 1;
filsig = this.fila;
if (((cuerpo._currentframe < 141) and (estoyentablero == true)) or ((cuerpo._currentframe > 160) and (estoyentablero == true))) {
cuerpo.gotoAndPlay(141);
}
actorretas(filsig, columsig);
}
}
pensar = 0;
}
if (estoyentablero == false) {
filsig = fila;
columsig = columna;
while (tabIA[fila][columna] >= 999) {
fila = 11 + _local7;
filsig = fila;
columsig = columna;
_local7++;
}
}
if (frenatorreta != null) {
if (this.hitTest(frenatorreta.alcance) == false) {
lento = 1;
frenatorreta = null;
}
}
if (_global.tablero[filsig][columsig] == 0) {
pensar = 1;
}
if (((estoyentablero == true) and (giro_crazy == false)) and (llego_meta == false)) {
_local8 = Math.random() * 10;
if (_local8 >= 9.9) {
velo_memo = velocidad;
frame_memo = this._currentframe;
giro_crazy = true;
velocidad = 0;
cuerpo.gotoAndPlay("giro");
}
}
if ((giro_crazy == true) and (cuerpo._currentframe == 180)) {
cuerpo.gotoAndPlay(frame_memo);
velocidad = velo_memo * 1.5;
}
if (giro_crazy == true) {
tempo++;
}
if (tempo == 50) {
tempo = 0;
velocidad = velo_memo;
giro_crazy = false;
}
if (this._x < ((columsig * 20) + 10)) {
this._x = this._x + (this.velocidad * lento);
auxA = 1;
}
if (this._x > ((columsig * 20) + 10)) {
this._x = this._x - (this.velocidad * lento);
auxA = -1;
}
if (this._y < ((filsig * 20) + 10)) {
this._y = this._y + (this.velocidad * lento);
auxB = 1;
}
if (this._y > ((filsig * 20) + 10)) {
this._y = this._y - (this.velocidad * lento);
auxB = -1;
}
if (Math.abs(this._x - ((columsig * 20) + 10)) <= velocidad) {
if (Math.abs(this._y - ((filsig * 20) + 10)) <= velocidad) {
this.fila = filsig;
this.columna = columsig;
pensar = 1;
if (estoyentablero == false) {
estoyentablero = true;
}
}
}
}
function eliminar() {
if (_global.tableroIA[fila][columna] == 1) {
columsig = 100;
llego_meta = true;
if ((cuerpo._currentframe < 81) or (cuerpo._currentframe > 100)) {
cuerpo.gotoAndPlay(81);
}
}
if (this._x > 700) {
delete _global.enemigos[this];
_global.vida = _global.vida - 1;
_level0.terreno.attachMovie("laugh", "D" + this, _level0.terreno.getNextHighestDepth());
if (_level0.terreno.info.objeto == this) {
_level0.terreno.info.gotoAndStop(1);
_level0.terreno.info.ataque1.text = "";
_level0.terreno.info.distancia1.text = "";
_level0.terreno.info.coste1.text = "";
_level0.terreno.info.ataque2.text = "";
_level0.terreno.info.distancia2.text = "";
_level0.terreno.info.coste2.text = "";
}
if (_level0.terreno.markerbi.enemigo == this) {
_level0.terreno.markerbi.removeMovieClip();
}
this.removeMovieClip();
}
if (vida <= 0) {
delete _global.enemigos[this];
_global.puntos = _global.puntos + (100 * factorpuntos);
_global.dinero = _global.dinero + dinero;
if (_level0.terreno.info.objeto == this) {
_level0.terreno.info.gotoAndStop(1);
_level0.terreno.info.ataque1.text = "";
_level0.terreno.info.distancia1.text = "";
_level0.terreno.info.coste1.text = "";
_level0.terreno.info.ataque2.text = "";
_level0.terreno.info.distancia2.text = "";
_level0.terreno.info.coste2.text = "";
}
if (_level0.terreno.markerbi.enemigo == this) {
_level0.terreno.markerbi.removeMovieClip();
}
_level0.terreno.attachMovie("DWEE", "D" + this, _level0.terreno.getNextHighestDepth());
_level0.terreno.attachMovie("sumadinero", "Di" + this, _level0.terreno.getNextHighestDepth(), {_x:_level0.terreno.dinero._x + 45, _y:_level0.terreno.dinero._y + 5, coste:dinero});
this.removeMovieClip();
}
}
function actorretas(fil, colum) {
for (k in _global.tableroalcance[fil][colum]) {
_global.tableroalcance[fil][colum][k].activardisparo = true;
_global.tableroalcance[fil][colum][k].enemigosatiro[this] = this;
}
}
var fila;
var columna;
var velocidad = 3.5;
var vida;
var factordinero = 1;
var factorpuntos = 1;
var factorvida = 1;
var tipo = "normal";
var lento = 1;
var dinero;
var vidatotal = vida;
var clase = "H";
var indice;
var pensar = 1;
var filsig;
var columsig;
var frenatorreta = null;
var vidafutura = vida;
var estoyentablero = false;
var velo_memo;
var frame_memo;
var tempo = 0;
var giro_crazy = false;
var llego_meta = false;
hitArea = hitcuerpo;
hitcuerpo._visible = false;
this.cacheAsBitmap = true;
cuerpo.gotoAndPlay("lado");
vida = vida * factorvida;
this.swapDepths(_parent.getNextHighestDepth());
_global.enemigos[this] = this;
if (_global.tableroIA[fila][columna] >= 999) {
i = 11;
while (i <= 14) {
if (_global.tableroIA[i][0] < 999) {
fila = i;
columna = 0;
break;
}
i++;
}
}
onPress = function () {
if (_global.STOP == false) {
_level0.terreno.info.objeto = this;
_level0.terreno.info.gotoAndStop(2);
_level0.terreno.info.foto.gotoAndStop("crazy");
_level0.terreno.markerbi.removeMovieClip();
_level0.terreno.attachMovie("markerbi", "markerbi", _level0.terreno.getNextHighestDepth(), {_x:this._x, _y:this._y, _alpha:50, enemigo:this});
}
};
onEnterFrame = function () {
if (_global.STOP == false) {
mover(_global.tableroIA, _global.longtab);
this.eliminar();
}
};
stop();
Symbol 543 MovieClip Frame 1
onEnterFrame = function () {
if (_global.STOP == false) {
this.play();
} else {
this.stop();
}
};
Symbol 543 MovieClip Frame 20
gotoAndPlay (1);
Symbol 544 MovieClip [bicho3v] Frame 1
function mover(tabIA, long) {
var _local5;
var _local4;
var _local3 = 0;
var _local2 = 0;
if (frenatorreta != null) {
if (this.hitTest(frenatorreta.alcance) == false) {
lento = 1;
frenatorreta = null;
}
}
if (frenatorreta != null) {
if (this.hitTest(frenatorreta.alcance) == false) {
lento = 1;
frenatorreta = null;
}
}
filaaux = Math.round(this._y / 20);
columnaaux = Math.round(this._x / 20);
if (this._x < ((columna * 20) + 10)) {
this._x = this._x + (this.velocidad * lento);
}
if (this._x > ((columna * 20) + 10)) {
this._x = this._x - (this.velocidad * lento);
}
if (this._y < 1070) {
this._y = this._y + (this.velocidad * lento);
}
if ((filaaux != Math.round(this._y / 20)) or (columnaaux != Math.round(this._x / 20))) {
actorretas();
}
}
function eliminar() {
if (_global.tableroIAv[fila][columna] == 1) {
filsig = 100;
estoyentablero = false;
if ((cuerpo._currentframe > 20) and (estoyentablero == true)) {
cuerpo.gotoAndPlay(1);
}
}
if (this._y > 600) {
delete _global.enemigos[this];
delete _global.enemigosflier[this];
_global.vida = _global.vida - 1;
_level0.terreno.attachMovie("laugh", "D" + this, _level0.terreno.getNextHighestDepth());
if (_level0.terreno.info.objeto == this) {
_level0.terreno.info.gotoAndStop(1);
_level0.terreno.info.ataque1.text = "";
_level0.terreno.info.distancia1.text = "";
_level0.terreno.info.coste1.text = "";
_level0.terreno.info.ataque2.text = "";
_level0.terreno.info.distancia2.text = "";
_level0.terreno.info.coste2.text = "";
}
if (_level0.terreno.markerbi.enemigo == this) {
_level0.terreno.markerbi.removeMovieClip();
}
this.removeMovieClip();
}
if (vida <= 0) {
delete _global.enemigos[this];
delete _global.enemigosflier[this];
_global.puntos = _global.puntos + (100 * factorpuntos);
_global.dinero = _global.dinero + dinero;
if (_level0.terreno.info.objeto == this) {
_level0.terreno.info.gotoAndStop(1);
_level0.terreno.info.ataque1.text = "";
_level0.terreno.info.distancia1.text = "";
_level0.terreno.info.coste1.text = "";
_level0.terreno.info.ataque2.text = "";
_level0.terreno.info.distancia2.text = "";
_level0.terreno.info.coste2.text = "";
}
if (_level0.terreno.markerbi.enemigo == this) {
_level0.terreno.markerbi.removeMovieClip();
}
_level0.terreno.attachMovie("DWEE", "D" + this, _level0.terreno.getNextHighestDepth());
_level0.terreno.attachMovie("sumadinero", "Di" + this, _level0.terreno.getNextHighestDepth(), {_x:_level0.terreno.dinero._x + 45, _y:_level0.terreno.dinero._y + 5, coste:dinero});
this.removeMovieClip();
}
}
function actorretas() {
var _local3;
var _local4;
_local3 = Math.round(this._y / 20);
_local4 = Math.round(this._x / 20);
for (k in _global.tableroalcance[_local3][_local4]) {
_global.tableroalcance[_local3][_local4][k].activardisparo = true;
_global.tableroalcance[_local3][_local4][k].enemigosatiro[this] = this;
}
}
var fila;
var columna;
var velocidad = 2.5;
var vida;
var factordinero = 1;
var factorpuntos = 1;
var factorvida = 1;
var tipo = "aereo";
var lento = 1;
var vidatotal = vida;
var clase = "V";
var pensar = 1;
var filsig;
var columsig;
var vidafutura = vida;
hitArea = cuerpo;
cuerpo._visible = false;
this.cacheAsBitmap = true;
vida = vida * factorvida;
this.swapDepths(_parent.getNextHighestDepth());
indice = _global.enemigos.length;
_global.enemigos[this] = this;
_global.enemigosflier[this] = this;
if (_global.tableroIA[fila][columna] >= 999) {
i = 11;
while (i <= 14) {
if (_global.tableroIA[0][i] < 999) {
fila = 0;
columna = i;
break;
}
i++;
}
}
onPress = function () {
if (_global.STOP == false) {
_level0.terreno.info.objeto = this;
_level0.terreno.info.gotoAndStop(2);
_level0.terreno.info.foto.gotoAndStop("flyer");
_level0.terreno.markerbi.removeMovieClip();
_level0.terreno.attachMovie("markerbi", "markerbi", _level0.terreno.getNextHighestDepth(), {_x:this._x, _y:this._y, _alpha:50, enemigo:this});
}
};
onEnterFrame = function () {
if (_global.STOP == false) {
mover(_global.tableroIA, _global.longtab);
this.eliminar();
}
};
Symbol 551 MovieClip Frame 1
onEnterFrame = function () {
if (_global.STOP == false) {
this.play();
} else {
this.stop();
}
};
Symbol 551 MovieClip Frame 20
gotoAndPlay (1);
Symbol 552 MovieClip [bicho3] Frame 1
function mover(tabIA, long) {
var _local5;
var _local4;
var _local3 = 0;
var _local2 = 0;
if (frenatorreta != null) {
if (this.hitTest(frenatorreta.alcance) == false) {
lento = 1;
frenatorreta = null;
}
}
if (frenatorreta != null) {
if (this.hitTest(frenatorreta.alcance) == false) {
lento = 1;
frenatorreta = null;
}
}
filaaux = Math.round(this._y / 20);
columnaaux = Math.round(this._x / 20);
if (this._x <= (columa * 20)) {
this._x = this._x + (this.velocidad * lento);
}
if (this._x > ((columa * 20) + 10)) {
this._x = this._x - (this.velocidad * lento);
}
if (this._y < ((fila * 20) + 10)) {
this._y = this._y + (this.velocidad * lento);
}
if (this._y > ((fila * 20) + 10)) {
this._y = this._y - (this.velocidad * lento);
}
if ((filaaux != Math.round(this._y / 20)) or (columnaaux != Math.round(this._x / 20))) {
actorretas();
}
}
function eliminar() {
if (_global.tableroIA[fila][columna] == 1) {
columsig = 100;
estoyentablero = false;
if ((cuerpo._currentframe < 81) or (cuerpo._currentframe > 100)) {
cuerpo.gotoAndPlay(81);
}
}
if (this._x > 700) {
delete _global.enemigos[this];
delete _global.enemigosflier[this];
_global.vida = _global.vida - 1;
_level0.terreno.attachMovie("laugh", "D" + this, _level0.terreno.getNextHighestDepth());
if (_level0.terreno.info.objeto == this) {
_level0.terreno.info.gotoAndStop(1);
_level0.terreno.info.ataque1.text = "";
_level0.terreno.info.distancia1.text = "";
_level0.terreno.info.coste1.text = "";
_level0.terreno.info.ataque2.text = "";
_level0.terreno.info.distancia2.text = "";
_level0.terreno.info.coste2.text = "";
}
if (_level0.terreno.markerbi.enemigo == this) {
_level0.terreno.markerbi.removeMovieClip();
}
this.removeMovieClip();
}
if (vida <= 0) {
delete _global.enemigos[this];
delete _global.enemigosflier[this];
_global.puntos = _global.puntos + (100 * factorpuntos);
_global.dinero = _global.dinero + dinero;
if (_level0.terreno.info.objeto == this) {
_level0.terreno.info.gotoAndStop(1);
_level0.terreno.info.ataque1.text = "";
_level0.terreno.info.distancia1.text = "";
_level0.terreno.info.coste1.text = "";
_level0.terreno.info.ataque2.text = "";
_level0.terreno.info.distancia2.text = "";
_level0.terreno.info.coste2.text = "";
}
if (_level0.terreno.markerbi.enemigo == this) {
_level0.terreno.markerbi.removeMovieClip();
}
_level0.terreno.attachMovie("DWEE", "D" + this, _level0.terreno.getNextHighestDepth());
_level0.terreno.attachMovie("sumadinero", "Di" + this, _level0.terreno.getNextHighestDepth(), {_x:_level0.terreno.dinero._x + 45, _y:_level0.terreno.dinero._y + 5, coste:dinero});
this.removeMovieClip();
}
}
function actorretas() {
var _local3;
var _local4;
_local3 = Math.round(this._y / 20);
_local4 = Math.round(this._x / 20);
for (k in _global.tableroalcance[_local3][_local4]) {
_global.tableroalcance[_local3][_local4][k].activardisparo = true;
_global.tableroalcance[_local3][_local4][k].enemigosatiro[this] = this;
}
}
var fila;
var columna;
var velocidad = 2.5;
var vida;
var factordinero = 1;
var factorpuntos = 1;
var factorvida = 1;
var tipo = "aereo";
var lento = 1;
var dinero;
var vidatotal = vida;
var clase = "H";
var filaaux;
var columnaaux;
var indice;
var pensar = 1;
var filsig;
var columsig;
var frenatorreta = null;
var vidafutura = vida;
hitArea = cuerpo;
cuerpo._visible = false;
this.cacheAsBitmap = true;
vida = vida * factorvida;
this.swapDepths(_parent.getNextHighestDepth());
_global.enemigos[this] = this;
_global.enemigosflier[this] = this;
if (_global.tableroIA[fila][columna] >= 999) {
i = 11;
while (i <= 14) {
if (_global.tableroIA[i][0] < 999) {
fila = i;
columna = 0;
break;
}
i++;
}
}
onPress = function () {
if (_global.STOP == false) {
_level0.terreno.info.objeto = this;
_level0.terreno.info.gotoAndStop(2);
_level0.terreno.info.foto.gotoAndStop("flyer");
_level0.terreno.markerbi.removeMovieClip();
_level0.terreno.attachMovie("markerbi", "markerbi", _level0.terreno.getNextHighestDepth(), {_x:this._x, _y:this._y, _alpha:50, enemigo:this});
}
};
onEnterFrame = function () {
if (_global.STOP == false) {
mover(_global.tableroIA, _global.longtab);
this.eliminar();
}
};
Symbol 592 MovieClip Frame 1
onEnterFrame = function () {
if (_global.STOP == false) {
this.play();
} else {
this.stop();
}
};
Symbol 592 MovieClip Frame 20
gotoAndPlay (1);
Symbol 592 MovieClip Frame 40
gotoAndPlay (21);
Symbol 592 MovieClip Frame 60
gotoAndPlay (41);
Symbol 592 MovieClip Frame 80
gotoAndPlay (61);
Symbol 592 MovieClip Frame 100
gotoAndPlay (81);
Symbol 592 MovieClip Frame 120
gotoAndPlay (101);
Symbol 592 MovieClip Frame 140
gotoAndPlay (121);
Symbol 592 MovieClip Frame 160
gotoAndPlay (141);
Symbol 593 MovieClip [bicho2v] Frame 1
function mover(tabIA, long) {
var _local3 = new Array(3);
var _local4;
var _local5;
var _local7 = 0;
if ((pensar == 1) and (_global.tableroIAv[fila][columna] != 1)) {
i = 0;
while (i <= 7) {
_local3[i] = 9999;
i++;
}
if ((this.fila + 1) <= long) {
_local3[0] = tabIA[this.fila + 1][this.columna];
_local3[4] = tabIA[this.fila + 1][this.columna - 1];
_local3[5] = tabIA[this.fila + 1][this.columna + 1];
}
if ((this.fila - 1) >= 0) {
_local3[1] = tabIA[this.fila - 1][this.columna];
_local3[6] = tabIA[this.fila - 1][this.columna - 1];
_local3[7] = tabIA[this.fila - 1][this.columna + 1];
}
if ((this.columna + 1) <= long) {
_local3[2] = tabIA[this.fila][this.columna + 1];
}
if ((this.columna - 1) >= 0) {
_local3[3] = tabIA[this.fila][this.columna - 1];
}
_local4 = _local3[0];
_local5 = 0;
i = 1;
while (i <= 7) {
if (_local3[i] < _local4) {
_local4 = _local3[i];
_local5 = i;
}
i++;
}
_local4 = 0;
switch (_local5) {
case 0 :
filsig = this.fila + 1;
columsig = this.columna;
_local4++;
if ((((cuerpo._currentframe > 20) and (estoyentablero == true)) and (estoyentablero == true)) and (estoyentablero == true)) {
cuerpo.gotoAndPlay(1);
}
actorretas(filsig, columsig);
break;
case 1 :
filsig = this.fila - 1;
columsig = this.columna;
_local4++;
if (((cuerpo._currentframe < 21) and (estoyentablero == true)) or ((cuerpo._currentframe > 40) and (estoyentablero == true))) {
cuerpo.gotoAndPlay(21);
}
actorretas(filsig, columsig);
break;
case 2 :
columsig = this.columna + 1;
filsig = this.fila;
_local4++;
if (((cuerpo._currentframe < 81) and (estoyentablero == true)) or ((cuerpo._currentframe > 100) and (estoyentablero == true))) {
cuerpo.gotoAndPlay(81);
}
actorretas(filsig, columsig);
break;
case 3 :
columsig = this.columna - 1;
filsig = this.fila;
_local4++;
if (((cuerpo._currentframe < 141) and (estoyentablero == true)) or ((cuerpo._currentframe > 160) and (estoyentablero == true))) {
cuerpo.gotoAndPlay(141);
}
actorretas(filsig, columsig);
break;
case 4 :
if ((_global.tablero[fila][columna - 1] == 1) and (_global.tablero[fila + 1][columna] == 1)) {
columsig = this.columna - 1;
filsig = this.fila + 1;
_local4++;
if (((cuerpo._currentframe < 61) and (estoyentablero == true)) or ((cuerpo._currentframe > 80) and (estoyentablero == true))) {
cuerpo.gotoAndPlay(61);
}
actorretas(filsig, columsig);
}
break;
case 5 :
if ((_global.tablero[fila][columna + 1] == 1) and (_global.tablero[fila + 1][columna] == 1)) {
columsig = this.columna + 1;
filsig = this.fila + 1;
_local4++;
if (((cuerpo._currentframe < 121) and (estoyentablero == true)) or ((cuerpo._currentframe > 140) and (estoyentablero == true))) {
cuerpo.gotoAndPlay(121);
}
actorretas(filsig, columsig);
}
break;
case 6 :
if ((_global.tablero[fila][columna - 1] == 1) and (_global.tablero[fila - 1][columna] == 1)) {
columsig = this.columna - 1;
filsig = this.fila - 1;
_local4++;
if (((cuerpo._currentframe < 101) and (estoyentablero == true)) or ((cuerpo._currentframe > 120) and (estoyentablero == true))) {
cuerpo.gotoAndPlay(101);
}
actorretas(filsig, columsig);
}
break;
case 7 :
if (!((_global.tablero[fila][columna + 1] == 1) and (_global.tablero[fila - 1][columna] == 1))) {
break;
}
columsig = this.columna + 1;
filsig = this.fila - 1;
_local4++;
if (((cuerpo._currentframe < 41) and (estoyentablero == true)) or ((cuerpo._currentframe > 60) and (estoyentablero == true))) {
cuerpo.gotoAndPlay(41);
}
actorretas(filsig, columsig);
}
if (_local4 == 0) {
_local4 = _local3[0];
_local5 = 0;
i = 1;
while (i <= 3) {
if (_local3[i] <= _local4) {
_local4 = _local3[i];
_local5 = i;
}
i++;
}
switch (_local5) {
case 0 :
filsig = this.fila + 1;
columsig = this.columna;
if ((cuerpo._currentframe > 20) and (estoyentablero == true)) {
cuerpo.gotoAndPlay(1);
}
actorretas(filsig, columsig);
break;
case 1 :
filsig = this.fila - 1;
columsig = this.columna;
if (((cuerpo._currentframe < 21) and (estoyentablero == true)) or ((cuerpo._currentframe > 40) and (estoyentablero == true))) {
cuerpo.gotoAndPlay(21);
}
actorretas(filsig, columsig);
break;
case 2 :
columsig = this.columna + 1;
filsig = this.fila;
if (((cuerpo._currentframe < 81) and (estoyentablero == true)) or ((cuerpo._currentframe > 100) and (estoyentablero == true))) {
cuerpo.gotoAndPlay(81);
}
actorretas(filsig, columsig);
break;
case 3 :
columsig = this.columna - 1;
filsig = this.fila;
if (((cuerpo._currentframe < 141) and (estoyentablero == true)) or ((cuerpo._currentframe > 160) and (estoyentablero == true))) {
cuerpo.gotoAndPlay(141);
}
actorretas(filsig, columsig);
}
}
pensar = 0;
}
if (estoyentablero == false) {
filsig = fila;
columsig = columna;
while (tabIA[fila][columna] >= 999) {
columna = 11 + _local7;
columsig = columna;
columsig = columna;
_local7++;
}
}
if (_global.tablero[filsig][columsig] == 0) {
pensar = 1;
}
if (frenatorreta != null) {
if (this.hitTest(frenatorreta.alcance) == false) {
lento = 1;
frenatorreta = null;
}
}
if (this._x < ((columsig * 20) + 10)) {
this._x = this._x + (this.velocidad * lento);
}
if (this._x > ((columsig * 20) + 10)) {
this._x = this._x - (this.velocidad * lento);
}
if (this._y < ((filsig * 20) + 10)) {
this._y = this._y + (this.velocidad * lento);
}
if (this._y > ((filsig * 20) + 10)) {
this._y = this._y - (this.velocidad * lento);
}
if (Math.abs(this._x - ((columsig * 20) + 10)) <= 5) {
if (Math.abs(this._y - ((filsig * 20) + 10)) <= 5) {
this.fila = filsig;
this.columna = columsig;
pensar = 1;
if (estoyentablero == false) {
estoyentablero = true;
}
}
}
}
function eliminar() {
if (_global.tableroIAv[fila][columna] == 1) {
filsig = 100;
if ((cuerpo._currentframe > 20) and (estoyentablero == true)) {
cuerpo.gotoAndPlay(1);
}
}
if (this._y > 600) {
delete _global.enemigos[this];
_global.vida = _global.vida - 1;
_level0.terreno.attachMovie("laugh", "D" + this, _level0.terreno.getNextHighestDepth());
if (_level0.terreno.info.objeto == this) {
_level0.terreno.info.gotoAndStop(1);
_level0.terreno.info.ataque1.text = "";
_level0.terreno.info.distancia1.text = "";
_level0.terreno.info.coste1.text = "";
_level0.terreno.info.ataque2.text = "";
_level0.terreno.info.distancia2.text = "";
_level0.terreno.info.coste2.text = "";
}
if (_level0.terreno.markerbi.enemigo == this) {
_level0.terreno.markerbi.removeMovieClip();
}
this.removeMovieClip();
}
if (vida <= 0) {
delete _global.enemigos[this];
_global.puntos = _global.puntos + (100 * factorpuntos);
_global.dinero = _global.dinero + dinero;
if (_level0.terreno.info.objeto == this) {
_level0.terreno.info.gotoAndStop(1);
_level0.terreno.info.ataque1.text = "";
_level0.terreno.info.distancia1.text = "";
_level0.terreno.info.coste1.text = "";
_level0.terreno.info.ataque2.text = "";
_level0.terreno.info.distancia2.text = "";
_level0.terreno.info.coste2.text = "";
}
if (_level0.terreno.markerbi.enemigo == this) {
_level0.terreno.markerbi.removeMovieClip();
}
_level0.terreno.attachMovie("DWEE", "D" + this, _level0.terreno.getNextHighestDepth());
_level0.terreno.attachMovie("sumadinero", "Di" + this, _level0.terreno.getNextHighestDepth(), {_x:_level0.terreno.dinero._x + 45, _y:_level0.terreno.dinero._y + 5, coste:dinero});
this.removeMovieClip();
}
}
function actorretas(fil, colum) {
for (k in _global.tableroalcance[fil][colum]) {
_global.tableroalcance[fil][colum][k].activardisparo = true;
_global.tableroalcance[fil][colum][k].enemigosatiro[this] = this;
}
}
var fila;
var columna;
var velocidad = 5;
var vida;
var factordinero = 1;
var factorpuntos = 1;
var factorvida = 1;
var tipo = "normal";
var lento = 1;
var dinero;
var vidatotal = vida;
var clase = "V";
var pensar = 1;
var filsig;
var columsig;
var vidafutura = vida;
var estoyentablero = false;
hitArea = hitcuerpo;
hitcuerpo._visible = false;
this.cacheAsBitmap = true;
cuerpo.gotoAndPlay("frente");
vida = vida * factorvida;
this.swapDepths(_parent.getNextHighestDepth());
indice = _global.enemigos.length;
_global.enemigos[this] = this;
if (_global.tableroIA[fila][columna] >= 999) {
i = 11;
while (i <= 14) {
if (_global.tableroIA[0][i] < 999) {
fila = 0;
columna = i;
break;
}
i++;
}
}
onPress = function () {
if (_global.STOP == false) {
_level0.terreno.info.objeto = this;
_level0.terreno.info.gotoAndStop(2);
_level0.terreno.info.foto.gotoAndStop("runner");
_level0.terreno.markerbi.removeMovieClip();
_level0.terreno.attachMovie("markerbi", "markerbi", _level0.terreno.getNextHighestDepth(), {_x:this._x, _y:this._y, _alpha:50, enemigo:this});
}
};
onEnterFrame = function () {
if (_global.STOP == false) {
mover(_global.tableroIAv, _global.longtab);
this.eliminar();
}
};
Symbol 594 MovieClip [bicho2] Frame 1
function mover(tabIA, long) {
var _local3 = new Array(7);
var _local4;
var _local5;
var _local9 = 0;
var _local8 = 0;
var _local7 = 0;
if ((pensar == 1) and (_global.tableroIA[fila][columna] != 1)) {
i = 0;
while (i <= 7) {
_local3[i] = 9999;
i++;
}
if ((this.fila + 1) <= long) {
_local3[0] = tabIA[this.fila + 1][this.columna];
_local3[4] = tabIA[this.fila + 1][this.columna - 1];
_local3[5] = tabIA[this.fila + 1][this.columna + 1];
}
if ((this.fila - 1) >= 0) {
_local3[1] = tabIA[this.fila - 1][this.columna];
_local3[6] = tabIA[this.fila - 1][this.columna - 1];
_local3[7] = tabIA[this.fila - 1][this.columna + 1];
}
if ((this.columna + 1) <= long) {
_local3[2] = tabIA[this.fila][this.columna + 1];
}
if ((this.columna - 1) >= 0) {
_local3[3] = tabIA[this.fila][this.columna - 1];
}
_local4 = _local3[0];
_local5 = 0;
i = 1;
while (i <= 7) {
if (_local3[i] < _local4) {
_local4 = _local3[i];
_local5 = i;
}
i++;
}
_local4 = 0;
switch (_local5) {
case 0 :
filsig = this.fila + 1;
columsig = this.columna;
_local4++;
if ((((cuerpo._currentframe > 20) and (estoyentablero == true)) and (estoyentablero == true)) and (estoyentablero == true)) {
cuerpo.gotoAndPlay(1);
}
actorretas(filsig, columsig);
break;
case 1 :
filsig = this.fila - 1;
columsig = this.columna;
_local4++;
if (((cuerpo._currentframe < 21) and (estoyentablero == true)) or ((cuerpo._currentframe > 40) and (estoyentablero == true))) {
cuerpo.gotoAndPlay(21);
}
actorretas(filsig, columsig);
break;
case 2 :
columsig = this.columna + 1;
filsig = this.fila;
_local4++;
if (((cuerpo._currentframe < 81) and (estoyentablero == true)) or ((cuerpo._currentframe > 100) and (estoyentablero == true))) {
cuerpo.gotoAndPlay(81);
}
actorretas(filsig, columsig);
break;
case 3 :
columsig = this.columna - 1;
filsig = this.fila;
_local4++;
if (((cuerpo._currentframe < 141) and (estoyentablero == true)) or ((cuerpo._currentframe > 160) and (estoyentablero == true))) {
cuerpo.gotoAndPlay(141);
}
actorretas(filsig, columsig);
break;
case 4 :
if ((_global.tablero[fila][columna - 1] == 1) and (_global.tablero[fila + 1][columna] == 1)) {
columsig = this.columna - 1;
filsig = this.fila + 1;
_local4++;
if (((cuerpo._currentframe < 61) and (estoyentablero == true)) or ((cuerpo._currentframe > 80) and (estoyentablero == true))) {
cuerpo.gotoAndPlay(61);
}
actorretas(filsig, columsig);
}
break;
case 5 :
if ((_global.tablero[fila][columna + 1] == 1) and (_global.tablero[fila + 1][columna] == 1)) {
columsig = this.columna + 1;
filsig = this.fila + 1;
_local4++;
if (((cuerpo._currentframe < 121) and (estoyentablero == true)) or ((cuerpo._currentframe > 140) and (estoyentablero == true))) {
cuerpo.gotoAndPlay(121);
}
actorretas(filsig, columsig);
}
break;
case 6 :
if ((_global.tablero[fila][columna - 1] == 1) and (_global.tablero[fila - 1][columna] == 1)) {
columsig = this.columna - 1;
filsig = this.fila - 1;
_local4++;
if (((cuerpo._currentframe < 101) and (estoyentablero == true)) or ((cuerpo._currentframe > 120) and (estoyentablero == true))) {
cuerpo.gotoAndPlay(101);
}
actorretas(filsig, columsig);
}
break;
case 7 :
if (!((_global.tablero[fila][columna + 1] == 1) and (_global.tablero[fila - 1][columna] == 1))) {
break;
}
columsig = this.columna + 1;
filsig = this.fila - 1;
_local4++;
if (((cuerpo._currentframe < 41) and (estoyentablero == true)) or ((cuerpo._currentframe > 60) and (estoyentablero == true))) {
cuerpo.gotoAndPlay(41);
}
actorretas(filsig, columsig);
}
if (_local4 == 0) {
_local4 = _local3[0];
_local5 = 0;
i = 1;
while (i <= 3) {
if (_local3[i] <= _local4) {
_local4 = _local3[i];
_local5 = i;
}
i++;
}
switch (_local5) {
case 0 :
filsig = this.fila + 1;
columsig = this.columna;
if ((cuerpo._currentframe > 20) and (estoyentablero == true)) {
cuerpo.gotoAndPlay(1);
}
actorretas(filsig, columsig);
break;
case 1 :
filsig = this.fila - 1;
columsig = this.columna;
if (((cuerpo._currentframe < 21) and (estoyentablero == true)) or ((cuerpo._currentframe > 40) and (estoyentablero == true))) {
cuerpo.gotoAndPlay(21);
}
actorretas(filsig, columsig);
break;
case 2 :
columsig = this.columna + 1;
filsig = this.fila;
if (((cuerpo._currentframe < 81) and (estoyentablero == true)) or ((cuerpo._currentframe > 100) and (estoyentablero == true))) {
cuerpo.gotoAndPlay(81);
}
actorretas(filsig, columsig);
break;
case 3 :
columsig = this.columna - 1;
filsig = this.fila;
if (((cuerpo._currentframe < 141) and (estoyentablero == true)) or ((cuerpo._currentframe > 160) and (estoyentablero == true))) {
cuerpo.gotoAndPlay(141);
}
actorretas(filsig, columsig);
}
}
pensar = 0;
}
if (estoyentablero == false) {
filsig = fila;
columsig = columna;
while (tabIA[fila][columna] >= 999) {
fila = 11 + _local7;
filsig = fila;
columsig = columna;
_local7++;
}
}
if (frenatorreta != null) {
if (this.hitTest(frenatorreta.alcance) == false) {
lento = 1;
frenatorreta = null;
}
}
if (_global.tablero[filsig][columsig] == 0) {
pensar = 1;
}
if (this._x < ((columsig * 20) + 10)) {
this._x = this._x + (this.velocidad * lento);
_local9 = 1;
}
if (this._x > ((columsig * 20) + 10)) {
this._x = this._x - (this.velocidad * lento);
_local9 = -1;
}
if (this._y < ((filsig * 20) + 10)) {
this._y = this._y + (this.velocidad * lento);
_local8 = 1;
}
if (this._y > ((filsig * 20) + 10)) {
this._y = this._y - (this.velocidad * lento);
_local8 = -1;
}
if (Math.abs(this._x - ((columsig * 20) + 10)) <= 5) {
if (Math.abs(this._y - ((filsig * 20) + 10)) <= 5) {
this.fila = filsig;
this.columna = columsig;
pensar = 1;
if (estoyentablero == false) {
estoyentablero = true;
}
}
}
}
function eliminar() {
if (_global.tableroIA[fila][columna] == 1) {
columsig = 100;
if ((cuerpo._currentframe < 81) or (cuerpo._currentframe > 100)) {
cuerpo.gotoAndPlay(81);
}
}
if (this._x > 700) {
delete _global.enemigos[this];
_global.vida = _global.vida - 1;
_level0.terreno.attachMovie("laugh", "D" + this, _level0.terreno.getNextHighestDepth());
if (_level0.terreno.info.objeto == this) {
_level0.terreno.info.gotoAndStop(1);
_level0.terreno.info.ataque1.text = "";
_level0.terreno.info.distancia1.text = "";
_level0.terreno.info.coste1.text = "";
_level0.terreno.info.ataque2.text = "";
_level0.terreno.info.distancia2.text = "";
_level0.terreno.info.coste2.text = "";
}
if (_level0.terreno.markerbi.enemigo == this) {
_level0.terreno.markerbi.removeMovieClip();
}
this.removeMovieClip();
}
if (vida <= 0) {
delete _global.enemigos[this];
_global.puntos = _global.puntos + (100 * factorpuntos);
_global.dinero = _global.dinero + dinero;
if (_level0.terreno.info.objeto == this) {
_level0.terreno.info.gotoAndStop(1);
_level0.terreno.info.ataque1.text = "";
_level0.terreno.info.distancia1.text = "";
_level0.terreno.info.coste1.text = "";
_level0.terreno.info.ataque2.text = "";
_level0.terreno.info.distancia2.text = "";
_level0.terreno.info.coste2.text = "";
}
if (_level0.terreno.markerbi.enemigo == this) {
_level0.terreno.markerbi.removeMovieClip();
}
_level0.terreno.attachMovie("DWEE", "D" + this, _level0.terreno.getNextHighestDepth());
_level0.terreno.attachMovie("sumadinero", "Di" + this, _level0.terreno.getNextHighestDepth(), {_x:_level0.terreno.dinero._x + 35, _y:_level0.terreno.dinero._y, coste:dinero});
this.removeMovieClip();
}
}
function actorretas(fil, colum) {
for (k in _global.tableroalcance[fil][colum]) {
_global.tableroalcance[fil][colum][k].activardisparo = true;
_global.tableroalcance[fil][colum][k].enemigosatiro[this] = this;
}
}
var fila;
var columna;
var velocidad = 5;
var vida;
var factordinero = 1;
var factorpuntos = 1;
var factorvida = 1;
var tipo = "normal";
var lento = 1;
var dinero;
var vidatotal = vida;
var clase = "H";
var indice;
var pensar = 1;
var filsig;
var columsig;
var vidafutura = vida;
var estoyentablero = false;
hitArea = hitcuerpo;
hitcuerpo._visible = false;
this.cacheAsBitmap = true;
cuerpo.gotoAndPlay("lado");
vida = vida * factorvida;
this.swapDepths(_parent.getNextHighestDepth());
_global.enemigos[this] = this;
if (_global.tableroIA[fila][columna] >= 999) {
i = 11;
while (i <= 14) {
if (_global.tableroIA[i][0] < 999) {
fila = i;
columna = 0;
break;
}
i++;
}
}
onPress = function () {
if (_global.STOP == false) {
_level0.terreno.info.objeto = this;
_level0.terreno.info.gotoAndStop(2);
_level0.terreno.info.foto.gotoAndStop("runner");
_level0.terreno.markerbi.removeMovieClip();
_level0.terreno.attachMovie("markerbi", "markerbi", _level0.terreno.getNextHighestDepth(), {_x:this._x, _y:this._y, _alpha:50, enemigo:this});
}
};
onEnterFrame = function () {
if (_global.STOP == false) {
mover(_global.tableroIA, _global.longtab);
this.eliminar();
}
};
stop();
Symbol 637 MovieClip Frame 1
!!!ERROR
Symbol 637 MovieClip Frame 20
!!!ERROR
Symbol 637 MovieClip Frame 40
!!!ERROR
Symbol 637 MovieClip Frame 60
!!!ERROR
Symbol 637 MovieClip Frame 80
!!!ERROR
Symbol 637 MovieClip Frame 100
!!!ERROR
Symbol 637 MovieClip Frame 120
!!!ERROR
Symbol 637 MovieClip Frame 140
!!!ERROR
Symbol 637 MovieClip Frame 160
!!!ERROR
Symbol 638 MovieClip [bicho1vhijo] Frame 1
function mover(tabIA, long) {
var _local3 = new Array(3);
var _local4;
var _local5;
var _local7 = 0;
if ((pensar == 1) and (_global.tableroIAv[fila][columna] != 1)) {
i = 0;
while (i <= 7) {
_local3[i] = 9999;
i++;
}
if ((this.fila + 1) <= long) {
_local3[0] = tabIA[this.fila + 1][this.columna];
_local3[4] = tabIA[this.fila + 1][this.columna - 1];
_local3[5] = tabIA[this.fila + 1][this.columna + 1];
}
if ((this.fila - 1) >= 0) {
_local3[1] = tabIA[this.fila - 1][this.columna];
_local3[6] = tabIA[this.fila - 1][this.columna - 1];
_local3[7] = tabIA[this.fila - 1][this.columna + 1];
}
if ((this.columna + 1) <= long) {
_local3[2] = tabIA[this.fila][this.columna + 1];
}
if ((this.columna - 1) >= 0) {
_local3[3] = tabIA[this.fila][this.columna - 1];
}
_local4 = _local3[0];
_local5 = 0;
i = 1;
while (i <= 7) {
if (_local3[i] < _local4) {
_local4 = _local3[i];
_local5 = i;
}
i++;
}
_local4 = 0;
switch (_local5) {
case 0 :
filsig = this.fila + 1;
columsig = this.columna;
_local4++;
if ((((cuerpo._currentframe > 20) and (estoyentablero == true)) and (estoyentablero == true)) and (estoyentablero == true)) {
cuerpo.gotoAndPlay(1);
}
actorretas(filsig, columsig);
break;
case 1 :
filsig = this.fila - 1;
columsig = this.columna;
_local4++;
if (((cuerpo._currentframe < 21) and (estoyentablero == true)) or ((cuerpo._currentframe > 40) and (estoyentablero == true))) {
cuerpo.gotoAndPlay(21);
}
actorretas(filsig, columsig);
break;
case 2 :
columsig = this.columna + 1;
filsig = this.fila;
_local4++;
if (((cuerpo._currentframe < 81) and (estoyentablero == true)) or ((cuerpo._currentframe > 100) and (estoyentablero == true))) {
cuerpo.gotoAndPlay(81);
}
actorretas(filsig, columsig);
break;
case 3 :
columsig = this.columna - 1;
filsig = this.fila;
_local4++;
if (((cuerpo._currentframe < 141) and (estoyentablero == true)) or ((cuerpo._currentframe > 160) and (estoyentablero == true))) {
cuerpo.gotoAndPlay(141);
}
actorretas(filsig, columsig);
break;
case 4 :
if ((_global.tablero[fila][columna - 1] == 1) and (_global.tablero[fila + 1][columna] == 1)) {
columsig = this.columna - 1;
filsig = this.fila + 1;
_local4++;
if (((cuerpo._currentframe < 61) and (estoyentablero == true)) or ((cuerpo._currentframe > 80) and (estoyentablero == true))) {
cuerpo.gotoAndPlay(61);
}
actorretas(filsig, columsig);
}
break;
case 5 :
if ((_global.tablero[fila][columna + 1] == 1) and (_global.tablero[fila + 1][columna] == 1)) {
columsig = this.columna + 1;
filsig = this.fila + 1;
_local4++;
if (((cuerpo._currentframe < 121) and (estoyentablero == true)) or ((cuerpo._currentframe > 140) and (estoyentablero == true))) {
cuerpo.gotoAndPlay(121);
}
actorretas(filsig, columsig);
}
break;
case 6 :
if ((_global.tablero[fila][columna - 1] == 1) and (_global.tablero[fila - 1][columna] == 1)) {
columsig = this.columna - 1;
filsig = this.fila - 1;
_local4++;
if (((cuerpo._currentframe < 101) and (estoyentablero == true)) or ((cuerpo._currentframe > 120) and (estoyentablero == true))) {
cuerpo.gotoAndPlay(101);
}
actorretas(filsig, columsig);
}
break;
case 7 :
if (!((_global.tablero[fila][columna + 1] == 1) and (_global.tablero[fila - 1][columna] == 1))) {
break;
}
columsig = this.columna + 1;
filsig = this.fila - 1;
_local4++;
if (((cuerpo._currentframe < 41) and (estoyentablero == true)) or ((cuerpo._currentframe > 60) and (estoyentablero == true))) {
cuerpo.gotoAndPlay(41);
}
actorretas(filsig, columsig);
}
if (_local4 == 0) {
_local4 = _local3[0];
_local5 = 0;
i = 1;
while (i <= 3) {
if (_local3[i] <= _local4) {
_local4 = _local3[i];
_local5 = i;
}
i++;
}
switch (_local5) {
case 0 :
filsig = this.fila + 1;
columsig = this.columna;
if ((cuerpo._currentframe > 20) and (estoyentablero == true)) {
cuerpo.gotoAndPlay(1);
}
actorretas(filsig, columsig);
break;
case 1 :
filsig = this.fila - 1;
columsig = this.columna;
if (((cuerpo._currentframe < 21) and (estoyentablero == true)) or ((cuerpo._currentframe > 40) and (estoyentablero == true))) {
cuerpo.gotoAndPlay(21);
}
actorretas(filsig, columsig);
break;
case 2 :
columsig = this.columna + 1;
filsig = this.fila;
if (((cuerpo._currentframe < 81) and (estoyentablero == true)) or ((cuerpo._currentframe > 100) and (estoyentablero == true))) {
cuerpo.gotoAndPlay(81);
}
actorretas(filsig, columsig);
break;
case 3 :
columsig = this.columna - 1;
filsig = this.fila;
if (((cuerpo._currentframe < 141) and (estoyentablero == true)) or ((cuerpo._currentframe > 160) and (estoyentablero == true))) {
cuerpo.gotoAndPlay(141);
}
actorretas(filsig, columsig);
}
}
pensar = 0;
}
if (estoyentablero == false) {
filsig = fila;
columsig = columna;
while (tabIA[fila][columna] >= 999) {
columna = 11 + _local7;
columsig = columna;
columsig = columna;
_local7++;
}
}
if (_global.tablero[filsig][columsig] == 0) {
pensar = 1;
}
if (frenatorreta != null) {
if (this.hitTest(frenatorreta.alcance) == false) {
lento = 1;
frenatorreta = null;
}
}
if (this._x < ((columsig * 20) + 10)) {
this._x = this._x + (this.velocidad * lento);
}
if (this._x > ((columsig * 20) + 10)) {
this._x = this._x - (this.velocidad * lento);
}
if (this._y < ((filsig * 20) + 10)) {
this._y = this._y + (this.velocidad * lento);
}
if (this._y > ((filsig * 20) + 10)) {
this._y = this._y - (this.velocidad * lento);
}
if (Math.abs(this._x - ((columsig * 20) + 10)) <= velocidad) {
if (Math.abs(this._y - ((filsig * 20) + 10)) <= velocidad) {
this.fila = filsig;
this.columna = columsig;
pensar = 1;
if (velocidad == veloinicio) {
velocidad = 3;
}
if (estoyentablero == false) {
estoyentablero = true;
}
}
}
}
function eliminar() {
if (_global.tableroIAv[fila][columna] == 1) {
filsig = 100;
if ((cuerpo._currentframe > 20) and (estoyentablero == true)) {
cuerpo.gotoAndPlay(1);
}
}
if (this._y > 600) {
delete _global.enemigos[this];
_global.vida = _global.vida - 1;
_level0.terreno.attachMovie("laugh", "D" + this, _level0.terreno.getNextHighestDepth());
if (_level0.terreno.info.objeto == this) {
_level0.terreno.info.gotoAndStop(1);
_level0.terreno.info.ataque1.text = "";
_level0.terreno.info.distancia1.text = "";
_level0.terreno.info.coste1.text = "";
_level0.terreno.info.ataque2.text = "";
_level0.terreno.info.distancia2.text = "";
_level0.terreno.info.coste2.text = "";
}
if (_level0.terreno.markerbi.enemigo == this) {
_level0.terreno.markerbi.removeMovieClip();
}
this.removeMovieClip();
}
if (vida <= 0) {
delete _global.enemigos[this];
_global.puntos = _global.puntos + (100 * factorpuntos);
_global.dinero = _global.dinero + dinero;
if (_level0.terreno.info.objeto == this) {
_level0.terreno.info.gotoAndStop(1);
_level0.terreno.info.ataque1.text = "";
_level0.terreno.info.distancia1.text = "";
_level0.terreno.info.coste1.text = "";
_level0.terreno.info.ataque2.text = "";
_level0.terreno.info.distancia2.text = "";
_level0.terreno.info.coste2.text = "";
}
if (_level0.terreno.markerbi.enemigo == this) {
_level0.terreno.markerbi.removeMovieClip();
}
_level0.terreno.attachMovie("DWEE", "D" + this, _level0.terreno.getNextHighestDepth());
_level0.terreno.attachMovie("sumadinero", "Di" + this, _level0.terreno.getNextHighestDepth(), {_x:_level0.terreno.dinero._x + 45, _y:_level0.terreno.dinero._y + 5, coste:dinero});
this.removeMovieClip();
}
}
function actorretas(fil, colum) {
for (k in _global.tableroalcance[fil][colum]) {
_global.tableroalcance[fil][colum][k].activardisparo = true;
_global.tableroalcance[fil][colum][k].enemigosatiro[this] = this;
}
}
function convertirenemigo() {
var _local3 = false;
var _local4;
activar = true;
do {
_local4 = Math.floor(Math.random() * 4);
switch (_local4) {
case 0 :
if ((_global.tableroIAv[this.fila + 1][this.columna] < 999) and ((this.fila + 1) <= 26)) {
velocidad = veloinicio;
filsig = this.fila + 1;
columsig = this.columna;
_local3 = true;
if ((((cuerpo._currentframe > 20) and (estoyentablero == true)) and (estoyentablero == true)) and (estoyentablero == true)) {
cuerpo.gotoAndPlay(1);
}
actorretas(filsig, columsig);
}
break;
case 1 :
if ((_global.tableroIAv[this.fila - 1][this.columna] < 999) and ((this.fila - 1) >= 0)) {
velocidad = veloinicio;
filsig = this.fila - 1;
columsig = this.columna;
_local3 = true;
if (((cuerpo._currentframe < 21) and (estoyentablero == true)) or ((cuerpo._currentframe > 40) and (estoyentablero == true))) {
cuerpo.gotoAndPlay(21);
}
actorretas(filsig, columsig);
}
break;
case 2 :
if ((_global.tableroIAv[this.fila][this.columna + 1] < 999) and ((this.columna + 1) <= 26)) {
velocidad = veloinicio;
columsig = this.columna + 1;
filsig = this.fila;
_local3 = true;
if (((cuerpo._currentframe < 81) and (estoyentablero == true)) or ((cuerpo._currentframe > 100) and (estoyentablero == true))) {
cuerpo.gotoAndPlay(81);
}
actorretas(filsig, columsig);
}
break;
case 3 :
if (!((_global.tableroIAv[this.fila][this.columna - 1] < 999) and ((this.columna - 1) >= 0))) {
break;
}
velocidad = veloinicio;
columsig = this.columna - 1;
filsig = this.fila;
_local3 = true;
if (((cuerpo._currentframe < 141) and (estoyentablero == true)) or ((cuerpo._currentframe > 160) and (estoyentablero == true))) {
cuerpo.gotoAndPlay(141);
}
actorretas(filsig, columsig);
}
} while (_local3 == false);
}
var fila;
var columna;
var velocidad = 3;
var vida;
var factordinero = 1;
var factorpuntos = 1;
var factorvida = 1;
var tipo = "normal";
var lento = 1;
var dinero;
var vidatotal = vida;
var clase = "V";
var pensar = 1;
var filsig;
var columsig;
var vidafutura = vida;
var estoyentablero = false;
var veloinicio = 5;
var activar = false;
_global.enemigos[this] = this;
hitArea = hitcuerpo;
hitcuerpo._visible = false;
this.cacheAsBitmap = true;
cuerpo.gotoAndPlay("frente");
vida = vida * factorvida;
this.swapDepths(_parent.getNextHighestDepth());
if (_global.tableroIA[fila][columna] >= 999) {
i = 11;
while (i <= 14) {
if (_global.tableroIA[0][i] < 999) {
fila = 0;
columna = i;
break;
}
i++;
}
}
onPress = function () {
if (_global.STOP == false) {
_level0.terreno.info.objeto = this;
_level0.terreno.info.gotoAndStop(2);
_level0.terreno.info.foto.gotoAndStop("family");
_level0.terreno.markerbi.removeMovieClip();
_level0.terreno.attachMovie("markerbi", "markerbi", _level0.terreno.getNextHighestDepth(), {_x:this._x, _y:this._y, _alpha:50, enemigo:this});
}
};
onEnterFrame = function () {
if (_global.STOP == false) {
mover(_global.tableroIAv, _global.longtab);
this.eliminar();
}
};
Symbol 678 MovieClip Frame 1
!!!ERROR
Symbol 678 MovieClip Frame 20
!!!ERROR
Symbol 678 MovieClip Frame 40
!!!ERROR
Symbol 678 MovieClip Frame 60
!!!ERROR
Symbol 678 MovieClip Frame 80
!!!ERROR
Symbol 678 MovieClip Frame 100
!!!ERROR
Symbol 678 MovieClip Frame 120
!!!ERROR
Symbol 678 MovieClip Frame 140
!!!ERROR
Symbol 678 MovieClip Frame 160
!!!ERROR
Symbol 679 MovieClip [bicho1v] Frame 1
function mover(tabIA, long) {
var _local3 = new Array(3);
var _local4;
var _local5;
var _local7 = 0;
if ((pensar == 1) and _global.tableroIAv[fila][columna]) {
i = 0;
while (i <= 7) {
_local3[i] = 9999;
i++;
}
if ((this.fila + 1) <= long) {
_local3[0] = tabIA[this.fila + 1][this.columna];
_local3[4] = tabIA[this.fila + 1][this.columna - 1];
_local3[5] = tabIA[this.fila + 1][this.columna + 1];
}
if ((this.fila - 1) >= 0) {
_local3[1] = tabIA[this.fila - 1][this.columna];
_local3[6] = tabIA[this.fila - 1][this.columna - 1];
_local3[7] = tabIA[this.fila - 1][this.columna + 1];
}
if ((this.columna + 1) <= long) {
_local3[2] = tabIA[this.fila][this.columna + 1];
}
if ((this.columna - 1) >= 0) {
_local3[3] = tabIA[this.fila][this.columna - 1];
}
_local4 = _local3[0];
_local5 = 0;
i = 1;
while (i <= 7) {
if (_local3[i] < _local4) {
_local4 = _local3[i];
_local5 = i;
}
i++;
}
_local4 = 0;
switch (_local5) {
case 0 :
filsig = this.fila + 1;
columsig = this.columna;
_local4++;
if ((((cuerpo._currentframe > 20) and (estoyentablero == true)) and (estoyentablero == true)) and (estoyentablero == true)) {
cuerpo.gotoAndPlay(1);
}
actorretas(filsig, columsig);
break;
case 1 :
filsig = this.fila - 1;
columsig = this.columna;
_local4++;
if (((cuerpo._currentframe < 21) and (estoyentablero == true)) or ((cuerpo._currentframe > 40) and (estoyentablero == true))) {
cuerpo.gotoAndPlay(21);
}
actorretas(filsig, columsig);
break;
case 2 :
columsig = this.columna + 1;
filsig = this.fila;
_local4++;
if (((cuerpo._currentframe < 81) and (estoyentablero == true)) or ((cuerpo._currentframe > 100) and (estoyentablero == true))) {
cuerpo.gotoAndPlay(81);
}
actorretas(filsig, columsig);
break;
case 3 :
columsig = this.columna - 1;
filsig = this.fila;
_local4++;
if (((cuerpo._currentframe < 141) and (estoyentablero == true)) or ((cuerpo._currentframe > 160) and (estoyentablero == true))) {
cuerpo.gotoAndPlay(141);
}
actorretas(filsig, columsig);
break;
case 4 :
if ((_global.tablero[fila][columna - 1] == 1) and (_global.tablero[fila + 1][columna] == 1)) {
columsig = this.columna - 1;
filsig = this.fila + 1;
_local4++;
if (((cuerpo._currentframe < 61) and (estoyentablero == true)) or ((cuerpo._currentframe > 80) and (estoyentablero == true))) {
cuerpo.gotoAndPlay(61);
}
actorretas(filsig, columsig);
}
break;
case 5 :
if ((_global.tablero[fila][columna + 1] == 1) and (_global.tablero[fila + 1][columna] == 1)) {
columsig = this.columna + 1;
filsig = this.fila + 1;
_local4++;
if (((cuerpo._currentframe < 121) and (estoyentablero == true)) or ((cuerpo._currentframe > 140) and (estoyentablero == true))) {
cuerpo.gotoAndPlay(121);
}
actorretas(filsig, columsig);
}
break;
case 6 :
if ((_global.tablero[fila][columna - 1] == 1) and (_global.tablero[fila - 1][columna] == 1)) {
columsig = this.columna - 1;
filsig = this.fila - 1;
_local4++;
if (((cuerpo._currentframe < 101) and (estoyentablero == true)) or ((cuerpo._currentframe > 120) and (estoyentablero == true))) {
cuerpo.gotoAndPlay(101);
}
actorretas(filsig, columsig);
}
break;
case 7 :
if (!((_global.tablero[fila][columna + 1] == 1) and (_global.tablero[fila - 1][columna] == 1))) {
break;
}
columsig = this.columna + 1;
filsig = this.fila - 1;
_local4++;
if (((cuerpo._currentframe < 41) and (estoyentablero == true)) or ((cuerpo._currentframe > 60) and (estoyentablero == true))) {
cuerpo.gotoAndPlay(41);
}
actorretas(filsig, columsig);
}
if (_local4 == 0) {
_local4 = _local3[0];
_local5 = 0;
i = 1;
while (i <= 3) {
if (_local3[i] <= _local4) {
_local4 = _local3[i];
_local5 = i;
}
i++;
}
switch (_local5) {
case 0 :
filsig = this.fila + 1;
columsig = this.columna;
if ((cuerpo._currentframe > 20) and (estoyentablero == true)) {
cuerpo.gotoAndPlay(1);
}
actorretas(filsig, columsig);
break;
case 1 :
filsig = this.fila - 1;
columsig = this.columna;
if (((cuerpo._currentframe < 21) and (estoyentablero == true)) or ((cuerpo._currentframe > 40) and (estoyentablero == true))) {
cuerpo.gotoAndPlay(21);
}
actorretas(filsig, columsig);
break;
case 2 :
columsig = this.columna + 1;
filsig = this.fila;
if (((cuerpo._currentframe < 81) and (estoyentablero == true)) or ((cuerpo._currentframe > 100) and (estoyentablero == true))) {
cuerpo.gotoAndPlay(81);
}
actorretas(filsig, columsig);
break;
case 3 :
columsig = this.columna - 1;
filsig = this.fila;
if (((cuerpo._currentframe < 141) and (estoyentablero == true)) or ((cuerpo._currentframe > 160) and (estoyentablero == true))) {
cuerpo.gotoAndPlay(141);
}
actorretas(filsig, columsig);
}
}
pensar = 0;
}
if (estoyentablero == false) {
filsig = fila;
columsig = columna;
while (tabIA[fila][columna] >= 999) {
columna = 11 + _local7;
columsig = columna;
columsig = columna;
_local7++;
}
}
if (_global.tablero[filsig][columsig] == 0) {
pensar = 1;
}
if (frenatorreta != null) {
if (this.hitTest(frenatorreta.alcance) == false) {
lento = 1;
frenatorreta = null;
}
}
if (this._x < ((columsig * 20) + 10)) {
this._x = this._x + (this.velocidad * lento);
}
if (this._x > ((columsig * 20) + 10)) {
this._x = this._x - (this.velocidad * lento);
}
if (this._y < ((filsig * 20) + 10)) {
this._y = this._y + (this.velocidad * lento);
}
if (this._y > ((filsig * 20) + 10)) {
this._y = this._y - (this.velocidad * lento);
}
if (Math.abs(this._x - ((columsig * 20) + 10)) <= 3) {
if (Math.abs(this._y - ((filsig * 20) + 10)) <= 3) {
this.fila = filsig;
this.columna = columsig;
pensar = 1;
if (estoyentablero == false) {
estoyentablero = true;
}
}
}
}
function eliminar() {
if (_global.tableroIAv[fila][columna] == 1) {
filsig = 100;
if ((cuerpo._currentframe > 20) and (estoyentablero == true)) {
cuerpo.gotoAndPlay(1);
}
}
if (this._y > 600) {
delete _global.enemigos[this];
_global.vida = _global.vida - 1;
_level0.terreno.attachMovie("laugh", "D" + this, _level0.terreno.getNextHighestDepth());
if (_level0.terreno.info.objeto == this) {
_level0.terreno.info.gotoAndStop(1);
_level0.terreno.info.ataque1.text = "";
_level0.terreno.info.distancia1.text = "";
_level0.terreno.info.coste1.text = "";
_level0.terreno.info.ataque2.text = "";
_level0.terreno.info.distancia2.text = "";
_level0.terreno.info.coste2.text = "";
}
if (_level0.terreno.markerbi.enemigo == this) {
_level0.terreno.markerbi.removeMovieClip();
}
this.removeMovieClip();
}
if (vida <= 0) {
delete _global.enemigos[this];
_global.puntos = _global.puntos + (100 * factorpuntos);
_global.dinero = _global.dinero + dinero;
if (_level0.terreno.info.objeto == this) {
_level0.terreno.info.gotoAndStop(1);
_level0.terreno.info.ataque1.text = "";
_level0.terreno.info.distancia1.text = "";
_level0.terreno.info.coste1.text = "";
_level0.terreno.info.ataque2.text = "";
_level0.terreno.info.distancia2.text = "";
_level0.terreno.info.coste2.text = "";
}
if (_level0.terreno.markerbi.enemigo == this) {
_level0.terreno.markerbi.removeMovieClip();
}
i = 0;
while (i < contadorhijos) {
_level0.terreno[("bichhijov" + auxcont) + i]._alpha = 100;
_level0.terreno[("bichhijov" + auxcont) + i].convertirenemigo();
i++;
}
_level0.terreno.attachMovie("DWEE", "D" + this, _level0.terreno.getNextHighestDepth());
_level0.terreno.attachMovie("sumadinero", "Di" + this, _level0.terreno.getNextHighestDepth(), {_x:_level0.terreno.dinero._x + 45, _y:_level0.terreno.dinero._y + 5, coste:dinero});
this.removeMovieClip();
}
}
function actorretas(fil, colum) {
for (k in _global.tableroalcance[fil][colum]) {
_global.tableroalcance[fil][colum][k].activardisparo = true;
_global.tableroalcance[fil][colum][k].enemigosatiro[this] = this;
}
}
var fila;
var columna;
var velocidad = 3;
var vida;
var factordinero = 1;
var factorpuntos = 1;
var factorvida = 1;
var tipo = "normal";
var lento = 1;
var dinero;
var vidatotal = vida;
var clase = "V";
var contadorhijos;
var pensar = 1;
var filsig;
var columsig;
var vidafutura = vida;
var estoyentablero = false;
var distanciahijos;
distanciahijos = Math.floor((Math.random() * 5) + 21);
hitArea = hitcuerpo;
hitcuerpo._visible = false;
this.cacheAsBitmap = true;
cuerpo.gotoAndPlay("frente");
this.swapDepths(_parent.getNextHighestDepth());
indice = _global.enemigos.length;
_global.enemigos[this] = this;
if (_global.tableroIA[fila][columna] >= 999) {
i = 11;
while (i <= 14) {
if (_global.tableroIA[0][i] < 999) {
fila = 0;
columna = i;
break;
}
i++;
}
}
var auxid = this;
var aux_y = this._y;
var auxvida = Math.ceil(vida * 0.8);
var auxcont = _level0.jefe.cont;
i = 0;
while (i < contadorhijos) {
aux_y = aux_y - distanciahijos;
_level0.terreno.attachMovie("bicho1vhijo", ("bichhijov" + auxcont) + i, _level0.terreno.getNextHighestDepth(), {_x:260, _y:aux_y, _xscale:133, _yscale:133, fila:fila, columna:columna, vida:auxvida, dinero:0, _alpha:50});
_level0.jefe.cont++;
i++;
}
delete auxid;
delete aux_x;
delete auxvida;
onPress = function () {
if (_global.STOP == false) {
_level0.terreno.info.objeto = this;
_level0.terreno.info.gotoAndStop(2);
_level0.terreno.info.foto.gotoAndStop("family");
_level0.terreno.markerbi.removeMovieClip();
_level0.terreno.attachMovie("markerbi", "markerbi", _level0.terreno.getNextHighestDepth(), {_x:this._x, _y:this._y, _alpha:50, enemigo:this});
}
};
onEnterFrame = function () {
if (_global.STOP == false) {
mover(_global.tableroIAv, _global.longtab);
this.eliminar();
}
};
Symbol 680 MovieClip [bicho1hijo] Frame 1
function mover(tabIA, long) {
var _local3 = new Array(7);
var _local4;
var _local5;
var _local9 = 0;
var _local8 = 0;
var _local7 = 0;
if ((pensar == 1) and (_global.tableroIA[fila][columna] != 1)) {
i = 0;
while (i <= 7) {
_local3[i] = 9999;
i++;
}
if ((this.fila + 1) <= long) {
_local3[0] = tabIA[this.fila + 1][this.columna];
_local3[4] = tabIA[this.fila + 1][this.columna - 1];
_local3[5] = tabIA[this.fila + 1][this.columna + 1];
}
if ((this.fila - 1) >= 0) {
_local3[1] = tabIA[this.fila - 1][this.columna];
_local3[6] = tabIA[this.fila - 1][this.columna - 1];
_local3[7] = tabIA[this.fila - 1][this.columna + 1];
}
if ((this.columna + 1) <= long) {
_local3[2] = tabIA[this.fila][this.columna + 1];
}
if ((this.columna - 1) >= 0) {
_local3[3] = tabIA[this.fila][this.columna - 1];
}
_local4 = _local3[0];
_local5 = 0;
i = 1;
while (i <= 7) {
if (_local3[i] < _local4) {
_local4 = _local3[i];
_local5 = i;
}
i++;
}
_local4 = 0;
switch (_local5) {
case 0 :
filsig = this.fila + 1;
columsig = this.columna;
_local4++;
if ((((cuerpo._currentframe > 20) and (estoyentablero == true)) and (estoyentablero == true)) and (estoyentablero == true)) {
cuerpo.gotoAndPlay(1);
}
actorretas(filsig, columsig);
break;
case 1 :
filsig = this.fila - 1;
columsig = this.columna;
_local4++;
if (((cuerpo._currentframe < 21) and (estoyentablero == true)) or ((cuerpo._currentframe > 40) and (estoyentablero == true))) {
cuerpo.gotoAndPlay(21);
}
actorretas(filsig, columsig);
break;
case 2 :
columsig = this.columna + 1;
filsig = this.fila;
_local4++;
if (((cuerpo._currentframe < 81) and (estoyentablero == true)) or ((cuerpo._currentframe > 100) and (estoyentablero == true))) {
cuerpo.gotoAndPlay(81);
}
actorretas(filsig, columsig);
break;
case 3 :
columsig = this.columna - 1;
filsig = this.fila;
_local4++;
if (((cuerpo._currentframe < 141) and (estoyentablero == true)) or ((cuerpo._currentframe > 160) and (estoyentablero == true))) {
cuerpo.gotoAndPlay(141);
}
actorretas(filsig, columsig);
break;
case 4 :
if ((_global.tablero[fila][columna - 1] == 1) and (_global.tablero[fila + 1][columna] == 1)) {
columsig = this.columna - 1;
filsig = this.fila + 1;
_local4++;
if (((cuerpo._currentframe < 61) and (estoyentablero == true)) or ((cuerpo._currentframe > 80) and (estoyentablero == true))) {
cuerpo.gotoAndPlay(61);
}
actorretas(filsig, columsig);
}
break;
case 5 :
if ((_global.tablero[fila][columna + 1] == 1) and (_global.tablero[fila + 1][columna] == 1)) {
columsig = this.columna + 1;
filsig = this.fila + 1;
_local4++;
if (((cuerpo._currentframe < 121) and (estoyentablero == true)) or ((cuerpo._currentframe > 140) and (estoyentablero == true))) {
cuerpo.gotoAndPlay(121);
}
actorretas(filsig, columsig);
}
break;
case 6 :
if ((_global.tablero[fila][columna - 1] == 1) and (_global.tablero[fila - 1][columna] == 1)) {
columsig = this.columna - 1;
filsig = this.fila - 1;
_local4++;
if (((cuerpo._currentframe < 101) and (estoyentablero == true)) or ((cuerpo._currentframe > 120) and (estoyentablero == true))) {
cuerpo.gotoAndPlay(101);
}
actorretas(filsig, columsig);
}
break;
case 7 :
if (!((_global.tablero[fila][columna + 1] == 1) and (_global.tablero[fila - 1][columna] == 1))) {
break;
}
columsig = this.columna + 1;
filsig = this.fila - 1;
_local4++;
if (((cuerpo._currentframe < 41) and (estoyentablero == true)) or ((cuerpo._currentframe > 60) and (estoyentablero == true))) {
cuerpo.gotoAndPlay(41);
}
actorretas(filsig, columsig);
}
if (_local4 == 0) {
_local4 = _local3[0];
_local5 = 0;
i = 1;
while (i <= 3) {
if (_local3[i] <= _local4) {
_local4 = _local3[i];
_local5 = i;
}
i++;
}
switch (_local5) {
case 0 :
filsig = this.fila + 1;
columsig = this.columna;
if ((cuerpo._currentframe > 20) and (estoyentablero == true)) {
cuerpo.gotoAndPlay(1);
}
actorretas(filsig, columsig);
break;
case 1 :
filsig = this.fila - 1;
columsig = this.columna;
if (((cuerpo._currentframe < 21) and (estoyentablero == true)) or ((cuerpo._currentframe > 40) and (estoyentablero == true))) {
cuerpo.gotoAndPlay(21);
}
actorretas(filsig, columsig);
break;
case 2 :
columsig = this.columna + 1;
filsig = this.fila;
if (((cuerpo._currentframe < 81) and (estoyentablero == true)) or ((cuerpo._currentframe > 100) and (estoyentablero == true))) {
cuerpo.gotoAndPlay(81);
}
actorretas(filsig, columsig);
break;
case 3 :
columsig = this.columna - 1;
filsig = this.fila;
if (((cuerpo._currentframe < 141) and (estoyentablero == true)) or ((cuerpo._currentframe > 160) and (estoyentablero == true))) {
cuerpo.gotoAndPlay(141);
}
actorretas(filsig, columsig);
}
}
pensar = 0;
}
if (estoyentablero == false) {
filsig = fila;
columsig = columna;
while (tabIA[fila][columna] >= 999) {
fila = 11 + _local7;
filsig = fila;
columsig = columna;
_local7++;
}
}
if (frenatorreta != null) {
if (this.hitTest(frenatorreta.alcance) == false) {
lento = 1;
frenatorreta = null;
}
}
if (_global.tablero[filsig][columsig] == 0) {
pensar = 1;
}
if (this._x < ((columsig * 20) + 10)) {
this._x = this._x + (this.velocidad * lento);
_local9 = 1;
}
if (this._x > ((columsig * 20) + 10)) {
this._x = this._x - (this.velocidad * lento);
_local9 = -1;
}
if (this._y < ((filsig * 20) + 10)) {
this._y = this._y + (this.velocidad * lento);
_local8 = 1;
}
if (this._y > ((filsig * 20) + 10)) {
this._y = this._y - (this.velocidad * lento);
_local8 = -1;
}
if (Math.abs(this._x - ((columsig * 20) + 10)) <= velocidad) {
if (Math.abs(this._y - ((filsig * 20) + 10)) <= velocidad) {
this.fila = filsig;
this.columna = columsig;
pensar = 1;
if (velocidad == veloinicio) {
velocidad = 3;
}
if (estoyentablero == false) {
estoyentablero = true;
}
}
}
}
function eliminar() {
if (_global.tableroIA[fila][columna] == 1) {
columsig = 100;
if ((cuerpo._currentframe < 81) or (cuerpo._currentframe > 100)) {
cuerpo.gotoAndPlay(81);
}
}
if (this._x > 700) {
delete _global.enemigos[this];
_global.vida = _global.vida - 1;
_level0.terreno.attachMovie("laugh", "D" + this, _level0.terreno.getNextHighestDepth());
if (_level0.terreno.info.objeto == this) {
_level0.terreno.info.gotoAndStop(1);
_level0.terreno.info.ataque1.text = "";
_level0.terreno.info.distancia1.text = "";
_level0.terreno.info.coste1.text = "";
_level0.terreno.info.ataque2.text = "";
_level0.terreno.info.distancia2.text = "";
_level0.terreno.info.coste2.text = "";
}
if (_level0.terreno.markerbi.enemigo == this) {
_level0.terreno.markerbi.removeMovieClip();
}
this.removeMovieClip();
}
if (vida <= 0) {
delete _global.enemigos[this];
_global.puntos = _global.puntos + (100 * factorpuntos);
_global.dinero = _global.dinero + dinero;
if (_level0.terreno.info.objeto == this) {
_level0.terreno.info.gotoAndStop(1);
_level0.terreno.info.ataque1.text = "";
_level0.terreno.info.distancia1.text = "";
_level0.terreno.info.coste1.text = "";
_level0.terreno.info.ataque2.text = "";
_level0.terreno.info.distancia2.text = "";
_level0.terreno.info.coste2.text = "";
}
if (_level0.terreno.markerbi.enemigo == this) {
_level0.terreno.markerbi.removeMovieClip();
}
_level0.terreno.attachMovie("DWEE", "D" + this, _level0.terreno.getNextHighestDepth());
_level0.terreno.attachMovie("sumadinero", "Di" + this, _level0.terreno.getNextHighestDepth(), {_x:_level0.terreno.dinero._x + 45, _y:_level0.terreno.dinero._y + 5, coste:dinero});
this.removeMovieClip();
}
}
function actorretas(fil, colum) {
for (k in _global.tableroalcance[fil][colum]) {
_global.tableroalcance[fil][colum][k].activardisparo = true;
_global.tableroalcance[fil][colum][k].enemigosatiro[this] = this;
}
}
function convertirenemigo() {
var _local3 = false;
var _local4;
activar = true;
if (estoyentablero == true) {
do {
_local4 = Math.floor(Math.random() * 4);
switch (_local4) {
case 0 :
if ((_global.tableroIA[this.fila + 1][this.columna] < 999) and ((this.fila + 1) <= 26)) {
velocidad = veloinicio;
filsig = this.fila + 1;
columsig = this.columna;
_local3 = true;
if ((cuerpo._currentframe > 20) and (estoyentablero == true)) {
cuerpo.gotoAndPlay(1);
}
actorretas(filsig, columsig);
}
break;
case 1 :
if ((_global.tableroIA[this.fila - 1][this.columna] < 999) and ((this.fila - 1) >= 0)) {
velocidad = veloinicio;
filsig = this.fila - 1;
columsig = this.columna;
_local3 = true;
if (((cuerpo._currentframe < 21) and (estoyentablero == true)) or ((cuerpo._currentframe > 40) and (estoyentablero == true))) {
cuerpo.gotoAndPlay(21);
}
actorretas(filsig, columsig);
}
break;
case 2 :
if ((_global.tableroIA[this.fila][this.columna + 1] < 999) and ((this.columna + 1) <= 26)) {
velocidad = veloinicio;
columsig = this.columna + 1;
filsig = this.fila;
_local3 = true;
if (((cuerpo._currentframe < 81) and (estoyentablero == true)) or ((cuerpo._currentframe > 100) and (estoyentablero == true))) {
cuerpo.gotoAndPlay(81);
}
actorretas(filsig, columsig);
}
break;
case 3 :
if (!((_global.tableroIA[this.fila][this.columna - 1] < 999) and ((this.columna - 1) >= 0))) {
break;
}
velocidad = veloinicio;
columsig = this.columna - 1;
filsig = this.fila;
_local3 = true;
if (((cuerpo._currentframe < 141) and (estoyentablero == true)) or ((cuerpo._currentframe > 160) and (estoyentablero == true))) {
cuerpo.gotoAndPlay(141);
}
actorretas(filsig, columsig);
}
} while (_local3 == false);
}
indice = _global.enemigos.length;
_global.enemigos[this] = this;
this.actorreta(fila, columna);
}
var fila;
var columna;
var velocidad = 3;
var vida;
var factordinero = 1;
var factorpuntos = 1;
var factorvida = 1;
var tipo = "normal";
var lento = 1;
var dinero;
var vidatotal = vida;
var clase = "H";
var indice;
var pensar = 1;
var filsig = fila;
var columsig = columna;
var frenatorreta = null;
var vidafutura = vida;
var estoyentablero = false;
var veloinicio = 5;
var activar = false;
_global.enemigos[this] = this;
hitArea = hitcuerpo;
hitcuerpo._visible = false;
this.cacheAsBitmap = true;
cuerpo.gotoAndPlay("lado");
vida = vida * factorvida;
this.swapDepths(_parent.getNextHighestDepth());
if (_global.tableroIA[fila][columna] >= 999) {
i = 11;
while (i <= 14) {
if (_global.tableroIA[i][0] < 999) {
fila = i;
columna = 0;
break;
}
i++;
}
}
onPress = function () {
if (_global.STOP == false) {
_level0.terreno.info.objeto = this;
_level0.terreno.info.gotoAndStop(2);
_level0.terreno.info.foto.gotoAndStop("family");
_level0.terreno.markerbi.removeMovieClip();
_level0.terreno.attachMovie("markerbi", "markerbi", _level0.terreno.getNextHighestDepth(), {_x:this._x, _y:this._y, _alpha:50, enemigo:this});
}
};
onEnterFrame = function () {
if (_global.STOP == false) {
mover(_global.tableroIA, _global.longtab);
this.eliminar();
}
};
stop();
Symbol 681 MovieClip [bicho1] Frame 1
function mover(tabIA, long) {
var _local3 = new Array(7);
var _local4;
var _local5;
var _local9 = 0;
var _local8 = 0;
var _local7 = 0;
if ((pensar == 1) and (_global.tabreroIA[fila][columna] != 1)) {
i = 0;
while (i <= 7) {
_local3[i] = 9999;
i++;
}
if ((this.fila + 1) <= long) {
_local3[0] = tabIA[this.fila + 1][this.columna];
_local3[4] = tabIA[this.fila + 1][this.columna - 1];
_local3[5] = tabIA[this.fila + 1][this.columna + 1];
}
if ((this.fila - 1) >= 0) {
_local3[1] = tabIA[this.fila - 1][this.columna];
_local3[6] = tabIA[this.fila - 1][this.columna - 1];
_local3[7] = tabIA[this.fila - 1][this.columna + 1];
}
if ((this.columna + 1) <= long) {
_local3[2] = tabIA[this.fila][this.columna + 1];
}
if ((this.columna - 1) >= 0) {
_local3[3] = tabIA[this.fila][this.columna - 1];
}
_local4 = _local3[0];
_local5 = 0;
i = 1;
while (i <= 7) {
if (_local3[i] < _local4) {
_local4 = _local3[i];
_local5 = i;
}
i++;
}
_local4 = 0;
switch (_local5) {
case 0 :
filsig = this.fila + 1;
columsig = this.columna;
_local4++;
if ((((cuerpo._currentframe > 20) and (estoyentablero == true)) and (estoyentablero == true)) and (estoyentablero == true)) {
cuerpo.gotoAndPlay(1);
}
actorretas(filsig, columsig);
break;
case 1 :
filsig = this.fila - 1;
columsig = this.columna;
_local4++;
if (((cuerpo._currentframe < 21) and (estoyentablero == true)) or ((cuerpo._currentframe > 40) and (estoyentablero == true))) {
cuerpo.gotoAndPlay(21);
}
actorretas(filsig, columsig);
break;
case 2 :
columsig = this.columna + 1;
filsig = this.fila;
_local4++;
if (((cuerpo._currentframe < 81) and (estoyentablero == true)) or ((cuerpo._currentframe > 100) and (estoyentablero == true))) {
cuerpo.gotoAndPlay(81);
}
actorretas(filsig, columsig);
break;
case 3 :
columsig = this.columna - 1;
filsig = this.fila;
_local4++;
if (((cuerpo._currentframe < 141) and (estoyentablero == true)) or ((cuerpo._currentframe > 160) and (estoyentablero == true))) {
cuerpo.gotoAndPlay(141);
}
actorretas(filsig, columsig);
break;
case 4 :
if ((_global.tablero[fila][columna - 1] == 1) and (_global.tablero[fila + 1][columna] == 1)) {
columsig = this.columna - 1;
filsig = this.fila + 1;
_local4++;
if (((cuerpo._currentframe < 61) and (estoyentablero == true)) or ((cuerpo._currentframe > 80) and (estoyentablero == true))) {
cuerpo.gotoAndPlay(61);
}
actorretas(filsig, columsig);
}
break;
case 5 :
if ((_global.tablero[fila][columna + 1] == 1) and (_global.tablero[fila + 1][columna] == 1)) {
columsig = this.columna + 1;
filsig = this.fila + 1;
_local4++;
if (((cuerpo._currentframe < 121) and (estoyentablero == true)) or ((cuerpo._currentframe > 140) and (estoyentablero == true))) {
cuerpo.gotoAndPlay(121);
}
actorretas(filsig, columsig);
}
break;
case 6 :
if ((_global.tablero[fila][columna - 1] == 1) and (_global.tablero[fila - 1][columna] == 1)) {
columsig = this.columna - 1;
filsig = this.fila - 1;
_local4++;
if (((cuerpo._currentframe < 101) and (estoyentablero == true)) or ((cuerpo._currentframe > 120) and (estoyentablero == true))) {
cuerpo.gotoAndPlay(101);
}
actorretas(filsig, columsig);
}
break;
case 7 :
if (!((_global.tablero[fila][columna + 1] == 1) and (_global.tablero[fila - 1][columna] == 1))) {
break;
}
columsig = this.columna + 1;
filsig = this.fila - 1;
_local4++;
if (((cuerpo._currentframe < 41) and (estoyentablero == true)) or ((cuerpo._currentframe > 60) and (estoyentablero == true))) {
cuerpo.gotoAndPlay(41);
}
actorretas(filsig, columsig);
}
if (_local4 == 0) {
_local4 = _local3[0];
_local5 = 0;
i = 1;
while (i <= 3) {
if (_local3[i] <= _local4) {
_local4 = _local3[i];
_local5 = i;
}
i++;
}
switch (_local5) {
case 0 :
filsig = this.fila + 1;
columsig = this.columna;
if ((cuerpo._currentframe > 20) and (estoyentablero == true)) {
cuerpo.gotoAndPlay(1);
}
actorretas(filsig, columsig);
break;
case 1 :
filsig = this.fila - 1;
columsig = this.columna;
if (((cuerpo._currentframe < 21) and (estoyentablero == true)) or ((cuerpo._currentframe > 40) and (estoyentablero == true))) {
cuerpo.gotoAndPlay(21);
}
actorretas(filsig, columsig);
break;
case 2 :
columsig = this.columna + 1;
filsig = this.fila;
if (((cuerpo._currentframe < 81) and (estoyentablero == true)) or ((cuerpo._currentframe > 100) and (estoyentablero == true))) {
cuerpo.gotoAndPlay(81);
}
actorretas(filsig, columsig);
break;
case 3 :
columsig = this.columna - 1;
filsig = this.fila;
if (((cuerpo._currentframe < 141) and (estoyentablero == true)) or ((cuerpo._currentframe > 160) and (estoyentablero == true))) {
cuerpo.gotoAndPlay(141);
}
actorretas(filsig, columsig);
}
}
pensar = 0;
}
if (estoyentablero == false) {
filsig = fila;
columsig = columna;
while (tabIA[fila][columna] >= 999) {
fila = 11 + _local7;
filsig = fila;
columsig = columna;
_local7++;
}
}
if (frenatorreta != null) {
if (this.hitTest(frenatorreta.alcance) == false) {
lento = 1;
frenatorreta = null;
}
}
if (_global.tablero[filsig][columsig] == 0) {
pensar = 1;
}
if (frenatorreta != null) {
if (this.hitTest(frenatorreta.alcance) == false) {
lento = 1;
frenatorreta = null;
}
}
if (this._x < ((columsig * 20) + 10)) {
this._x = this._x + (this.velocidad * lento);
_local9 = 1;
}
if (this._x > ((columsig * 20) + 10)) {
this._x = this._x - (this.velocidad * lento);
_local9 = -1;
}
if (this._y < ((filsig * 20) + 10)) {
this._y = this._y + (this.velocidad * lento);
_local8 = 1;
}
if (this._y > ((filsig * 20) + 10)) {
this._y = this._y - (this.velocidad * lento);
_local8 = -1;
}
if (Math.abs(this._x - ((columsig * 20) + 10)) <= 3) {
if (Math.abs(this._y - ((filsig * 20) + 10)) <= 3) {
this.fila = filsig;
this.columna = columsig;
pensar = 1;
if (estoyentablero == false) {
estoyentablero = true;
}
}
}
}
function eliminar() {
if (_global.tableroIA[fila][columna] == 1) {
columsig = 100;
if ((cuerpo._currentframe < 81) or (cuerpo._currentframe > 100)) {
cuerpo.gotoAndPlay(81);
}
}
if (this._x > 700) {
delete _global.enemigos[this];
_global.vida = _global.vida - 1;
_level0.terreno.attachMovie("laugh", "D" + this, _level0.terreno.getNextHighestDepth());
if (_level0.terreno.info.objeto == this) {
_level0.terreno.info.gotoAndStop(1);
_level0.terreno.info.ataque1.text = "";
_level0.terreno.info.distancia1.text = "";
_level0.terreno.info.coste1.text = "";
_level0.terreno.info.ataque2.text = "";
_level0.terreno.info.distancia2.text = "";
_level0.terreno.info.coste2.text = "";
}
if (_level0.terreno.markerbi.enemigo == this) {
_level0.terreno.markerbi.removeMovieClip();
}
this.removeMovieClip();
}
if (vida <= 0) {
delete _global.enemigos[this];
_global.puntos = _global.puntos + (100 * factorpuntos);
_global.dinero = _global.dinero + dinero;
if (_level0.terreno.info.objeto == this) {
_level0.terreno.info.gotoAndStop(1);
_level0.terreno.info.ataque1.text = "";
_level0.terreno.info.distancia1.text = "";
_level0.terreno.info.coste1.text = "";
_level0.terreno.info.ataque2.text = "";
_level0.terreno.info.distancia2.text = "";
_level0.terreno.info.coste2.text = "";
}
if (_level0.terreno.markerbi.enemigo == this) {
_level0.terreno.markerbi.removeMovieClip();
}
i = 0;
while (i < contadorhijos) {
_level0.terreno[("bichhijo" + auxcont) + i]._alpha = 100;
_level0.terreno[("bichhijo" + auxcont) + i].convertirenemigo();
i++;
}
_level0.terreno.attachMovie("DWEE", "D" + this, _level0.terreno.getNextHighestDepth());
_level0.terreno.attachMovie("sumadinero", "Di" + this, _level0.terreno.getNextHighestDepth(), {_x:_level0.terreno.dinero._x + 45, _y:_level0.terreno.dinero._y + 5, coste:dinero});
this.removeMovieClip();
}
}
function actorretas(fil, colum) {
for (k in _global.tableroalcance[fil][colum]) {
_global.tableroalcance[fil][colum][k].activardisparo = true;
_global.tableroalcance[fil][colum][k].enemigosatiro[this] = this;
}
}
var fila;
var columna;
var velocidad = 3;
var vida;
var factordinero = 1;
var factorpuntos = 1;
var factorvida = 1;
var tipo = "normal";
var lento = 1;
var dinero;
var vidatotal = vida;
var clase = "H";
var indice;
var contadorhijos;
var pensar = 1;
var filsig;
var columsig;
var frenatorreta = null;
var vidafutura = vida;
var estoyentablero = false;
var distanciahijos;
hitArea = hitcuerpo;
hitcuerpo._visible = false;
distanciahijos = Math.floor((Math.random() * 5) + 21);
this.cacheAsBitmap = true;
cuerpo.gotoAndPlay("lado");
vida = vida * factorvida;
this.swapDepths(_parent.getNextHighestDepth());
_global.enemigos[this] = this;
if (_global.tableroIA[fila][columna] >= 999) {
i = 11;
while (i <= 14) {
if (_global.tableroIA[i][0] < 999) {
fila = i;
columna = 0;
break;
}
i++;
}
}
var auxid = this;
var aux_x = this._x;
var auxvida = Math.ceil(vida * 0.8);
var auxcont = _level0.jefe.cont;
i = 0;
while (i < contadorhijos) {
aux_x = aux_x - distanciahijos;
_level0.terreno.attachMovie("bicho1hijo", ("bichhijo" + auxcont) + i, _level0.terreno.getNextHighestDepth(), {_x:aux_x, _y:290, _xscale:133, _yscale:133, fila:fila, columna:columna, vida:auxvida, dinero:0, _alpha:50});
_level0.jefe.cont++;
i++;
}
delete auxid;
delete aux_x;
delete auxvida;
onPress = function () {
if (_global.STOP == false) {
_level0.terreno.info.objeto = this;
_level0.terreno.info.gotoAndStop(2);
_level0.terreno.info.foto.gotoAndStop("family");
_level0.terreno.markerbi.removeMovieClip();
_level0.terreno.attachMovie("markerbi", "markerbi", _level0.terreno.getNextHighestDepth(), {_x:this._x, _y:this._y, _alpha:50, enemigo:this});
}
};
onEnterFrame = function () {
if (_global.STOP == false) {
mover(_global.tableroIA, _global.longtab);
this.eliminar();
}
};
stop();
Symbol 934 MovieClip [__Packages.casilla] Frame 0
!!!ERROR
Symbol 685 MovieClip Frame 50
!!!ERROR
Symbol 686 MovieClip Frame 13
!!!ERROR
Symbol 693 MovieClip Frame 20
!!!ERROR
Symbol 697 MovieClip Frame 35
!!!ERROR
Symbol 706 MovieClip Frame 24
!!!ERROR
Symbol 718 MovieClip Frame 1
!!!ERROR
Symbol 720 MovieClip Frame 1
!!!ERROR
Symbol 723 MovieClip Frame 1
this.onPress = function () {
_level0.attachMovie("menu2", "menu2", _level0.getNextHighestDepth(), {_x:260, _y:330});
this._parent.plays.enabled = false;
this._parent.more_games.enabled = false;
this._parent.instruc.enabled = false;
this.enabled = false;
};
Symbol 725 MovieClip Frame 1
!!!ERROR
Symbol 727 MovieClip Frame 1
this.onPress = function () {
_level0.attachMovie("sonidoboton", "sonido", _level0.getNextHighestDepth());
_level0.gotoAndStop("dificil");
};
Symbol 729 MovieClip Frame 25
this.onPress = function () {
_level0.attachMovie("sonidoboton", "sonido", _level0.getNextHighestDepth());
_level0.gotoAndPlay("medio");
};
Symbol 731 MovieClip Frame 25
this.onPress = function () {
_level0.attachMovie("sonidoboton", "sonido", _level0.getNextHighestDepth());
_level0.gotoAndStop("medio_avanzado");
};
Symbol 733 MovieClip Frame 25
this.onPress = function () {
_level0.attachMovie("sonidoboton", "sonido", _level0.getNextHighestDepth());
_level0.gotoAndPlay("facil");
};
Symbol 735 MovieClip Frame 15
!!!ERROR
Symbol 735 MovieClip Frame 16
!!!ERROR
Symbol 736 MovieClip Frame 75
!!!ERROR
Symbol 741 MovieClip Frame 1
var frames = 0;
var time = 1000;
var enem;
var tope = 0;
this._visible = false;
sacaframes = function () {
enem = 0;
for (i in _global.enemigos) {
enem++;
}
_level0.terreno.numbichos.text = enem;
};
onEnterFrame = function () {
frames++;
};
intervalId = setInterval(this, "sacaframes", time);
Symbol 746 MovieClip Frame 1
var cont = 0;
var activar = 1;
var ataque = 30;
var distancia = 100;
var coste = 40;
var costeac = 35;
this.onPress = function () {
if (_global.STOP == false) {
_level0.terreno.info.ataque.text = ataque;
_level0.terreno.info.distancia.text = distancia;
_level0.terreno.info.coste.text = coste;
_level0.terreno.info.ataque2.text = "";
_level0.terreno.info.distancia2.text = "";
_level0.terreno.info.coste2.text = "";
if ((_global.dinero - coste) >= 0) {
_global.pretorreta.removeMovieClip();
_level0.terreno.attachMovie("torreta5", "torr" + _global.cont, 700 + (2 * _global.cont), {_x:this._x + 40, _y:this._y - 40});
_global.pretorreta = _level0.terreno["torr" + _global.cont];
_global.cont++;
_global.activarboton = false;
activar = 0;
}
if ((_global.dinero - coste) < 0) {
_level0.attachMovie("nodinero", "nodinero", _level0.getNextHighestDepth(), {_x:this._x, _y:this._y});
}
}
};
this.cacheAsBitmap = true;
Symbol 749 MovieClip Frame 1
var cont = 0;
var activar = 1;
var ataque = 180;
var distancia = 150;
var coste = 100;
var costeac = 120;
this.onPress = function () {
if (_global.STOP == false) {
_level0.terreno.info.ataque.text = ataque;
_level0.terreno.info.distancia.text = distancia;
_level0.terreno.info.coste.text = coste;
_level0.terreno.info.ataque2.text = "";
_level0.terreno.info.distancia2.text = "";
_level0.terreno.info.coste2.text = "";
if ((_global.dinero - coste) >= 0) {
_global.pretorreta.removeMovieClip();
_level0.terreno.attachMovie("torreta4", "torr" + _global.cont, 700 + (2 * _global.cont), {_x:this._x + 40, _y:this._y - 40});
_global.pretorreta = _level0.terreno["torr" + _global.cont];
_global.cont++;
_global.activarboton = false;
activar = 0;
}
if ((_global.dinero - coste) < 0) {
_level0.attachMovie("nodinero", "nodinero", _level0.getNextHighestDepth(), {_x:this._x, _y:this._y});
}
}
};
this.cacheAsBitmap = true;
Symbol 752 MovieClip Frame 1
var cont = 0;
var activar = 1;
var ataque = 0.8;
var distancia = 120;
var coste = 40;
var costeac = 20;
this.onPress = function () {
if (_global.STOP == false) {
_level0.terreno.info.ataque.text = ataque;
_level0.terreno.info.distancia.text = distancia;
_level0.terreno.info.coste.text = coste;
_level0.terreno.info.ataque2.text = "";
_level0.terreno.info.distancia2.text = "";
_level0.terreno.info.coste2.text = "";
if ((_global.dinero - coste) >= 0) {
_global.pretorreta.removeMovieClip();
_level0.terreno.attachMovie("torreta3", "torr" + _global.cont, 700 + (2 * _global.cont), {_x:this._x + 40, _y:this._y - 40});
_global.pretorreta = _level0.terreno["torr" + _global.cont];
_global.cont++;
_global.activarboton = false;
activar = 0;
}
if ((_global.dinero - coste) < 0) {
_level0.attachMovie("nodinero", "nodinero", _level0.getNextHighestDepth(), {_x:this._x, _y:this._y});
}
}
};
this.cacheAsBitmap = true;
Symbol 755 MovieClip Frame 1
var cont = 0;
var activar = 1;
var ataque = 12;
var distancia = 80;
var coste = 5;
var costeac = 6;
this.onPress = function () {
if (_global.STOP == false) {
_level0.terreno.info.ataque.text = ataque;
_level0.terreno.info.distancia.text = distancia;
_level0.terreno.info.coste.text = coste;
_level0.terreno.info.ataque2.text = "";
_level0.terreno.info.distancia2.text = "";
_level0.terreno.info.coste2.text = "";
if ((_global.dinero - coste) >= 0) {
_global.pretorreta.removeMovieClip();
_level0.terreno.attachMovie("torreta2", "torr" + _global.cont, 700 + (2 * _global.cont), {_x:this._x + 40, _y:this._y - 40});
_global.pretorreta = _level0.terreno["torr" + _global.cont];
_global.cont++;
_global.activarboton = false;
activar = 0;
}
if ((_global.dinero - coste) < 0) {
_level0.attachMovie("nodinero", "nodinero", _level0.getNextHighestDepth(), {_x:this._x, _y:this._y});
}
}
};
this.cacheAsBitmap = true;
Symbol 758 MovieClip Frame 1
var activar = 1;
var ataque = 7;
var distancia = 120;
var coste = 16;
var costeac = 12;
this.onPress = function () {
if (_global.STOP == false) {
_level0.terreno.info.ataque.text = ataque;
_level0.terreno.info.distancia.text = distancia;
_level0.terreno.info.coste.text = coste;
_level0.terreno.info.ataque2.text = "";
_level0.terreno.info.distancia2.text = "";
_level0.terreno.info.coste2.text = "";
if ((_global.dinero - coste) >= 0) {
_global.pretorreta.removeMovieClip();
_level0.terreno.attachMovie("torreta1", "torr" + _global.cont, 700 + (2 * _global.cont), {_x:this._x + 40, _y:this._y - 40});
_global.pretorreta = _level0.terreno["torr" + _global.cont];
_global.cont++;
_global.activarboton = false;
activar = 0;
}
if ((_global.dinero - coste) < 0) {
_level0.attachMovie("nodinero", "nodinero", _level0.getNextHighestDepth(), {_x:this._x, _y:this._y});
}
}
};
this.cacheAsBitmap = true;
Symbol 764 MovieClip Frame 1
!!!ERROR
Symbol 773 MovieClip Frame 1
var activado = false;
this.cacheAsBitmap = true;
onPress = function () {
if (_global.STOP == false) {
if (activado == false) {
_global.STOP = true;
_level0.attachMovie("stopjuego", "stopjuego", this._parent.getNextHighestDepth(), {_x:180, _y:100});
activado = true;
}
}
};
Symbol 778 MovieClip Frame 1
!!!ERROR
Symbol 784 MovieClip Frame 1
!!!ERROR
Symbol 803 MovieClip Frame 1
this.cacheAsBitmap = true;
this.cuerpo._xscale = 1;
Symbol 815 MovieClip Frame 1
!!!ERROR
Symbol 815 MovieClip Frame 2
!!!ERROR
Symbol 815 MovieClip Frame 3
!!!ERROR
Symbol 815 MovieClip Frame 5
!!!ERROR
Symbol 815 MovieClip Frame 8
!!!ERROR
Symbol 815 MovieClip Frame 9
!!!ERROR
Symbol 815 MovieClip Frame 11
!!!ERROR
Symbol 817 MovieClip Frame 1
var objeto;
this.cacheAsBitmap = true;
this.logotipo.enabled = false;
actualizar.onPress = function () {
if (_global.STOP == false) {
objeto.actualizar();
}
};
borrar.onPress = function () {
if (_global.STOP == false) {
objeto.borrar();
this._parent._parent.marker.removeMovieClip();
}
};
onEnterFrame = function () {
var _local2;
if (this._currentframe == 2) {
vidatotal.text = objeto.vidatotal;
vidaactual.text = objeto.vida;
dinerobicho.text = objeto.dinero;
_local2 = objeto.vida / objeto.vidatotal;
barrita.cuerpo._xscale = _local2 * 100;
}
};
stop();
Symbol 817 MovieClip Frame 2
!!!ERROR
Symbol 852 MovieClip Frame 1
!!!ERROR
Symbol 874 MovieClip Frame 1
function cambioestado(estado) {
switch (estado) {
case 1 :
gotoAndStop (2);
break;
case 2 :
gotoAndStop (1);
break;
case 3 :
gotoAndStop (3);
break;
case 4 :
gotoAndStop (5);
break;
case 5 :
gotoAndStop (8);
break;
case 6 :
gotoAndStop (9);
break;
case 0 :
gotoAndStop (10);
}
}
var aux = 1;
this.brillo.stop();
this.cacheAsBitmap = true;
stop();
Symbol 874 MovieClip Frame 2
!!!ERROR
Symbol 874 MovieClip Frame 3
!!!ERROR
Symbol 874 MovieClip Frame 4
!!!ERROR
Symbol 874 MovieClip Frame 5
!!!ERROR
Symbol 874 MovieClip Frame 6
!!!ERROR
Symbol 874 MovieClip Frame 7
!!!ERROR
Symbol 874 MovieClip Frame 8
!!!ERROR
Symbol 874 MovieClip Frame 9
!!!ERROR
Symbol 874 MovieClip Frame 10
!!!ERROR
Symbol 878 MovieClip Frame 1
onPress = function () {
var _local4 = true;
if (_global.STOP == false) {
if (this._currentframe == 1) {
this.gotoAndPlay(2);
_global.empezar = 1;
} else {
var _local3;
if ((_level0.terreno.dificultad == "facil") and (_level0.jefe.nivel >= 39)) {
this.enabled = false;
_local4 = false;
}
if ((_level0.terreno.dificultad == "medio") and (_level0.jefe.nivel >= 59)) {
this.enabled = false;
_local4 = false;
}
if ((_level0.terreno.dificultad == "medio_avanzado") and (_level0.jefe.nivel >= 79)) {
this.enabled = false;
_local4 = false;
}
if ((_level0.terreno.dificultad == "dificil") and (_level0.jefe.nivel >= 99)) {
this.enabled = false;
_local4 = false;
}
if (_local4 == true) {
_level0.jefe.nivel++;
}
_level0.terreno.nivelactual.text = _level0.jefe.nivel + 1;
_local3 = 0;
while (_local3 <= 6) {
_level0.terreno["altar" + (_local3 + 1)].cambioestado(_level0.jefe.nachotipo[_level0.jefe.nivel + _local3]);
_local3++;
}
}
}
};
stop();
Symbol 878 MovieClip Frame 2
!!!ERROR
Symbol 883 MovieClip Frame 1
!!!ERROR
Symbol 888 MovieClip Frame 1
function IA3(tab, tabIA, tabaux2, long, HoV) {
var _local4 = new Array();
var _local8 = new Array(long);
var _local5 = 0;
var _local11;
var _local2 = null;
var _local1 = null;
var _local7 = 0;
var _local10;
_local5 = 0;
while (_local5 <= long) {
j = 0;
while (j <= long) {
tabIA[_local5][j] = 9999;
j++;
}
_local5++;
}
if (HoV == 0) {
_local5 = -3;
while (_local5 <= 1) {
if (tab[(long / 2) + _local5][long] == 1) {
_local2 = (long / 2) + _local5;
_local1 = long;
tabIA[(long / 2) + _local5][long] = 1;
}
_local5++;
}
} else {
_local5 = -3;
while (_local5 <= 1) {
if (tab[long][(long / 2) + _local5] == 1) {
_local2 = long;
_local1 = (long / 2) + _local5;
tabIA[long][(long / 2) + _local5] = 1;
}
_local5++;
}
}
_local5 = 0;
while (_local5 <= long) {
_local8[_local5] = new Array(long);
j = 0;
while (j <= long) {
_local8[_local5][j] = 0;
j++;
}
_local5++;
}
if ((_local2 == null) or (_local1 == null)) {
return(undefined);
}
_local4[(("f" + _local2) + "c") + _local1] = new casilla(_local2, _local1);
_local7++;
do {
for (_local10 in _local4) {
_local2 = _local4[_local10].fila;
_local1 = _local4[_local10].columna;
_local8[_local2][_local1] = 1;
if (tab[_local2 + 1][_local1] != 0) {
if ((_local2 + 1) <= long) {
if (_local8[_local2 + 1][_local1] == 0) {
if (_local4[(("f" + (_local2 + 1)) + "c") + _local1] == null) {
_local4[(("f" + (_local2 + 1)) + "c") + _local1] = new casilla(_local2 + 1, _local1);
_local7++;
}
}
if (tabIA[_local2 + 1][_local1] > (tabIA[_local2][_local1] + 1)) {
tabIA[_local2 + 1][_local1] = tabIA[_local2][_local1] + 1;
}
}
}
if (tab[_local2 - 1][_local1] != 0) {
if ((_local2 - 1) >= 0) {
if (_local8[_local2 - 1][_local1] == 0) {
if (_local4[(("f" + (_local2 - 1)) + "c") + _local1] == null) {
_local4[(("f" + (_local2 - 1)) + "c") + _local1] = new casilla(_local2 - 1, _local1);
_local7++;
}
}
if (tabIA[_local2 - 1][_local1] > (tabIA[_local2][_local1] + 1)) {
tabIA[_local2 - 1][_local1] = tabIA[_local2][_local1] + 1;
}
}
}
if (tab[_local2][_local1 + 1] != 0) {
if ((_local1 + 1) <= long) {
if (_local8[_local2][_local1 + 1] == 0) {
if (_local4[(("f" + _local2) + "c") + (_local1 + 1)] == null) {
_local4[(("f" + _local2) + "c") + (_local1 + 1)] = new casilla(_local2, _local1 + 1);
_local7++;
}
if (_local11 == 0) {
_local4[(("f" + _local2) + "c") + (_local1 + 1)] = new casilla(_local2, _local1 + 1);
_local7++;
}
}
if (tabIA[_local2][_local1 + 1] > (tabIA[_local2][_local1] + 1)) {
tabIA[_local2][_local1 + 1] = tabIA[_local2][_local1] + 1;
}
}
}
if (tab[_local2][_local1 - 1] != 0) {
if ((_local1 - 1) >= 0) {
if (_local8[_local2][_local1 - 1] == 0) {
if (_local4[(("f" + _local2) + "c") + (_local1 - 1)] == null) {
_local4[(("f" + _local2) + "c") + (_local1 - 1)] = new casilla(_local2, _local1 - 1);
_local7++;
}
if (_local11 == 0) {
_local4[(("f" + _local2) + "c") + (_local1 - 1)] = new casilla(_local2, _local1 - 1);
_local7++;
}
}
if (tabIA[_local2][_local1 - 1] > (tabIA[_local2][_local1] + 1)) {
tabIA[_local2][_local1 - 1] = tabIA[_local2][_local1] + 1;
}
}
}
delete _local4[_local10];
_local7--;
}
} while (_local7 >= 1);
}
var dificultad = "facil";
var aux;
var aux2 = true;
var ultimonivel = false;
var suelo = new Array(_global.longtab);
var cont_pressnext = 0;
var loadgame = new LoadVars();
this.attachMovie("bloq_prof", "bloq_prof", 2000);
_global.longtab = 26;
_global.tablero = new Array(_global.longtab);
_global.tableroIA = new Array(_global.longtab);
_global.tableroaux = new Array(_global.longtab);
_global.tableroIAv = new Array(_global.longtab);
_global.tableroalcance = new Array(_global.longtab);
_global.enemigos = new Array();
_global.enemigosflier = new Array();
_global.hijos = new Array();
_global.dinero = 85;
_global.puntos = 0;
_global.vida = 25;
_global.activarboton = true;
_global.cont = 0;
_global.torretacursor = false;
_global.STOP = false;
_global.volumen = 75;
_global.sonidoactivos = new Array();
_global.pretorreta = null;
this.cacheAsBitmap = true;
trace(dificultad);
i = 0;
while (i <= _global.longtab) {
suelo[i] = new Array(_global.longtab);
j = 0;
while (j <= _global.longtab) {
suelo[i][j] = 0;
j++;
}
i++;
}
i = 0;
while (i <= _global.longtab) {
_global.tableroalcance[i] = new Array(_global.longtab);
j = 0;
while (j <= _global.longtab) {
_global.tableroalcance[i][j] = new Array();
j++;
}
i++;
}
i = 0;
while (i <= _global.longtab) {
_global.tablero[i] = new Array(_global.longtab);
j = 0;
while (j <= _global.longtab) {
_global.tablero[i][j] = 1;
j++;
}
i++;
}
i = 0;
while (i <= _global.longtab) {
_global.tableroIA[i] = new Array(_global.longtab);
i++;
}
i = 0;
while (i <= _global.longtab) {
_global.tableroIAv[i] = new Array(_global.longtab);
i++;
}
i = 0;
while (i <= _global.longtab) {
_global.tableroaux[i] = new Array(_global.longtab);
i++;
}
i = 0;
while (i <= _global.longtab) {
j = 0;
while (j <= _global.longtab) {
j++;
}
i++;
}
this.onMouseDown = function () {
if (((((this._xmouse / 20) > _global.longtab) or ((this._ymouse / 20) > _global.longtab)) or ((this._xmouse / 20) < 0)) or ((this._ymouse / 20) < 0)) {
_level0.terreno.info.gotoAndStop(1);
if ((this.info.actualizar.hitTest(_level0._xmouse, _level0._ymouse) == false) and (this.info.borrar.hitTest(_level0._xmouse, _level0._ymouse) == false)) {
this.marker.removeMovieClip();
this.markerbi.removeMovieClip();
this.info.objeto = null;
}
_level0.terreno.info.ataque.text = "";
_level0.terreno.info.distancia.text = "";
_level0.terreno.info.coste.text = "";
_level0.terreno.info.ataque2.text = "";
_level0.terreno.info.distancia2.text = "";
_level0.terreno.info.coste2.text = "";
_level0.terreno.info.costeactualizar.text = "";
}
};
accesorapido = function () {
if (Key.isDown(49)) {
if (_global.STOP == false) {
this.marker.removeMovieClip();
this.markerbi.removeMovieClip();
_level0.terreno.info.gotoAndStop(1);
_level0.terreno.info.objeto = null;
_level0.terreno.info.ataque.text = _level0.btorreta2.ataque;
_level0.terreno.info.distancia.text = _level0.btorreta2.distancia;
_level0.terreno.info.coste.text = _level0.btorreta2.coste;
_level0.terreno.info.ataque2.text = "";
_level0.terreno.info.distancia2.text = "";
_level0.terreno.info.coste2.text = "";
if ((_global.dinero - _level0.btorreta2.coste) >= 0) {
_global.pretorreta.removeMovieClip();
_level0.terreno.attachMovie("torreta2", "torr" + _global.cont, 700 + (2 * _global.cont), {_x:this._xmouse, _y:this._ymouse});
_global.pretorreta = _level0.terreno["torr" + _global.cont];
_global.cont++;
}
if (((_global.dinero - _level0.btorreta2.coste) < 0) and (_level0.nodinero == undefined)) {
}
}
}
if (Key.isDown(50)) {
if (_global.STOP == false) {
this.marker.removeMovieClip();
this.markerbi.removeMovieClip();
_level0.terreno.info.gotoAndStop(1);
_level0.terreno.info.objeto = null;
_level0.terreno.info.ataque.text = _level0.btorreta.ataque;
_level0.terreno.info.distancia.text = _level0.btorreta.distancia;
_level0.terreno.info.coste.text = _level0.btorreta.coste;
_level0.terreno.info.ataque2.text = "";
_level0.terreno.info.distancia2.text = "";
_level0.terreno.info.coste2.text = "";
if ((_global.dinero - _level0.btorreta.coste) >= 0) {
_global.pretorreta.removeMovieClip();
_level0.terreno.attachMovie("torreta1", "torr" + _global.cont, 700 + (2 * _global.cont), {_x:this._xmouse, _y:this._ymouse});
_global.pretorreta = _level0.terreno["torr" + _global.cont];
_global.cont++;
}
if ((_global.dinero - _level0.btorreta.coste) < 0) {
}
}
}
if (Key.isDown(51)) {
if (_global.STOP == false) {
this.marker.removeMovieClip();
this.markerbi.removeMovieClip();
_level0.terreno.info.gotoAndStop(1);
_level0.terreno.info.objeto = null;
_level0.terreno.info.ataque.text = _level0.btorreta3.ataque;
_level0.terreno.info.distancia.text = _level0.btorreta3.distancia;
_level0.terreno.info.coste.text = _level0.btorreta3.coste;
_level0.terreno.info.ataque2.text = "";
_level0.terreno.info.distancia2.text = "";
_level0.terreno.info.coste2.text = "";
if ((_global.dinero - _level0.btorreta3.coste) >= 0) {
_global.pretorreta.removeMovieClip();
_level0.terreno.attachMovie("torreta3", "torr" + _global.cont, 700 + (2 * _global.cont), {_x:this._xmouse, _y:this._ymouse});
_global.pretorreta = _level0.terreno["torr" + _global.cont];
_global.cont++;
}
if ((_global.dinero - _level0.btorreta3.coste) < 0) {
}
}
}
if (Key.isDown(52)) {
if (_global.STOP == false) {
this.marker.removeMovieClip();
this.markerbi.removeMovieClip();
_level0.terreno.info.gotoAndStop(1);
_level0.terreno.info.objeto = null;
_level0.terreno.info.ataque.text = _level0.btorreta4.ataque;
_level0.terreno.info.distancia.text = _level0.btorreta4.distancia;
_level0.terreno.info.coste.text = _level0.btorreta4.coste;
_level0.terreno.info.ataque2.text = "";
_level0.terreno.info.distancia2.text = "";
_level0.terreno.info.coste2.text = "";
if ((_global.dinero - _level0.btorreta4.coste) >= 0) {
_global.pretorreta.removeMovieClip();
_level0.terreno.attachMovie("torreta4", "torr" + _global.cont, 700 + (2 * _global.cont), {_x:this._xmouse, _y:this._ymouse});
_global.pretorreta = _level0.terreno["torr" + _global.cont];
_global.cont++;
}
if ((_global.dinero - _level0.btorreta4.coste) < 0) {
}
}
}
if (Key.isDown(53)) {
if (_global.STOP == false) {
this.marker.removeMovieClip();
this.markerbi.removeMovieClip();
_level0.terreno.info.gotoAndStop(1);
_level0.terreno.info.objeto = null;
_level0.terreno.info.ataque.text = _level0.btorreta5.ataque;
_level0.terreno.info.distancia.text = _level0.btorreta5.distancia;
_level0.terreno.info.coste.text = _level0.btorreta5.coste;
_level0.terreno.info.ataque2.text = "";
_level0.terreno.info.distancia2.text = "";
_level0.terreno.info.coste2.text = "";
if ((_global.dinero - _level0.btorreta5.coste) >= 0) {
_global.pretorreta.removeMovieClip();
_level0.terreno.attachMovie("torreta5", "torr" + _global.cont, 700 + (2 * _global.cont), {_x:this._xmouse, _y:this._ymouse});
_global.pretorreta = _level0.terreno["torr" + _global.cont];
_global.cont++;
}
if ((_global.dinero - _level0.btorreta5.coste) < 0) {
}
}
}
if (Key.isDown(46)) {
if ((_level0.terreno.info.objeto != null) and (_level0.terreno.info._currentframe == 1)) {
_level0.terreno.info.objeto.borrar();
this.marker.removeMovieClip();
this.markerbi.removeMovieClip();
}
}
};
IA3(_global.tablero, _global.tableroIAv, _global.tableroaux, _global.longtab, 1);
IA3(_global.tablero, _global.tableroIA, _global.tableroaux, _global.longtab, 0);
onEnterFrame = function () {
var _local4 = 0;
var _local3 = true;
accesorapido();
if (aux2 == true) {
dinero.text = _global.dinero;
puntos.text = _global.puntos;
vidas.text = _global.vida;
aux2 = false;
} else {
aux2 = true;
}
if (_global.vida <= 0) {
if (_global.STOP == false) {
_level0.attachMovie("finjuego", "finjuego", this._parent.getNextHighestDepth(), {_x:180, _y:100});
_global.STOP = true;
}
}
if (ultimonivel == true) {
for (i in _global.enemigos) {
_local4++;
}
if ((_local4 == 0) and (_global.STOP == false)) {
_level0.attachMovie("finjuego", "finjuego", this._parent.getNextHighestDepth(), {_x:180, _y:100, finalestado:"You have won!"});
_global.STOP = true;
}
}
for (i in _global.enemigos) {
_local3 = false;
break;
}
if (((((((_local3 == true) and (_level0.pressnext.existo != true)) and (_global.empezar == 1)) and (_level0.jefe.tiemporeloj >= 10)) and (_level0.jefe.tiemporeloj < 30)) and (cont_pressnext <= 10)) and (ultimonivel == false)) {
_level0.attachMovie("Press_ next", "pressnext", _level0.getNextHighestDepth(), {_x:60, _y:420});
cont_pressnext++;
}
};
stop();
this.addListener(mouseListener);
Key.addListener(this);
Symbol 899 MovieClip Frame 1
function IA3(tab, tabIA, tabaux2, long, HoV) {
var _local4 = new Array();
var _local8 = new Array(long);
var _local5 = 0;
var _local11;
var _local2 = null;
var _local1 = null;
var _local7 = 0;
var _local10;
_local5 = 0;
while (_local5 <= long) {
j = 0;
while (j <= long) {
tabIA[_local5][j] = 9999;
j++;
}
_local5++;
}
if (HoV == 0) {
_local5 = -3;
while (_local5 <= 1) {
if (tab[(long / 2) + _local5][long] == 1) {
_local2 = (long / 2) + _local5;
_local1 = long;
tabIA[(long / 2) + _local5][long] = 1;
}
_local5++;
}
} else {
_local5 = -3;
while (_local5 <= 1) {
if (tab[long][(long / 2) + _local5] == 1) {
_local2 = long;
_local1 = (long / 2) + _local5;
tabIA[long][(long / 2) + _local5] = 1;
}
_local5++;
}
}
_local5 = 0;
while (_local5 <= long) {
_local8[_local5] = new Array(long);
j = 0;
while (j <= long) {
_local8[_local5][j] = 0;
j++;
}
_local5++;
}
if ((_local2 == null) or (_local1 == null)) {
return(undefined);
}
_local4[(("f" + _local2) + "c") + _local1] = new casilla(_local2, _local1);
_local7++;
do {
for (_local10 in _local4) {
_local2 = _local4[_local10].fila;
_local1 = _local4[_local10].columna;
_local8[_local2][_local1] = 1;
if (tab[_local2 + 1][_local1] != 0) {
if ((_local2 + 1) <= long) {
if (_local8[_local2 + 1][_local1] == 0) {
if (_local4[(("f" + (_local2 + 1)) + "c") + _local1] == null) {
_local4[(("f" + (_local2 + 1)) + "c") + _local1] = new casilla(_local2 + 1, _local1);
_local7++;
}
}
if (tabIA[_local2 + 1][_local1] > (tabIA[_local2][_local1] + 1)) {
tabIA[_local2 + 1][_local1] = tabIA[_local2][_local1] + 1;
}
}
}
if (tab[_local2 - 1][_local1] != 0) {
if ((_local2 - 1) >= 0) {
if (_local8[_local2 - 1][_local1] == 0) {
if (_local4[(("f" + (_local2 - 1)) + "c") + _local1] == null) {
_local4[(("f" + (_local2 - 1)) + "c") + _local1] = new casilla(_local2 - 1, _local1);
_local7++;
}
}
if (tabIA[_local2 - 1][_local1] > (tabIA[_local2][_local1] + 1)) {
tabIA[_local2 - 1][_local1] = tabIA[_local2][_local1] + 1;
}
}
}
if (tab[_local2][_local1 + 1] != 0) {
if ((_local1 + 1) <= long) {
if (_local8[_local2][_local1 + 1] == 0) {
if (_local4[(("f" + _local2) + "c") + (_local1 + 1)] == null) {
_local4[(("f" + _local2) + "c") + (_local1 + 1)] = new casilla(_local2, _local1 + 1);
_local7++;
}
if (_local11 == 0) {
_local4[(("f" + _local2) + "c") + (_local1 + 1)] = new casilla(_local2, _local1 + 1);
_local7++;
}
}
if (tabIA[_local2][_local1 + 1] > (tabIA[_local2][_local1] + 1)) {
tabIA[_local2][_local1 + 1] = tabIA[_local2][_local1] + 1;
}
}
}
if (tab[_local2][_local1 - 1] != 0) {
if ((_local1 - 1) >= 0) {
if (_local8[_local2][_local1 - 1] == 0) {
if (_local4[(("f" + _local2) + "c") + (_local1 - 1)] == null) {
_local4[(("f" + _local2) + "c") + (_local1 - 1)] = new casilla(_local2, _local1 - 1);
_local7++;
}
if (_local11 == 0) {
_local4[(("f" + _local2) + "c") + (_local1 - 1)] = new casilla(_local2, _local1 - 1);
_local7++;
}
}
if (tabIA[_local2][_local1 - 1] > (tabIA[_local2][_local1] + 1)) {
tabIA[_local2][_local1 - 1] = tabIA[_local2][_local1] + 1;
}
}
}
delete _local4[_local10];
_local7--;
}
} while (_local7 >= 1);
}
var dificultad = "medio";
var aux;
var aux2 = true;
var ultimonivel = false;
var suelo = new Array(_global.longtab);
var loadgame = new LoadVars();
this.attachMovie("bloq_prof", "bloq_prof", 2000);
_global.longtab = 26;
_global.tablero = new Array(_global.longtab);
_global.tableroIA = new Array(_global.longtab);
_global.tableroaux = new Array(_global.longtab);
_global.tableroIAv = new Array(_global.longtab);
_global.tableroalcance = new Array(_global.longtab);
_global.enemigos = new Array();
_global.enemigosflier = new Array();
_global.hijos = new Array();
_global.dinero = 95;
_global.puntos = 0;
_global.vida = 25;
_global.activarboton = true;
_global.cont = 0;
_global.torretacursor = false;
_global.STOP = false;
_global.volumen = 75;
_global.sonidoactivos = new Array();
_global.pretorreta = null;
this.cacheAsBitmap = true;
trace(dificultad);
i = 0;
while (i <= _global.longtab) {
suelo[i] = new Array(_global.longtab);
j = 0;
while (j <= _global.longtab) {
suelo[i][j] = 0;
j++;
}
i++;
}
i = 0;
while (i <= _global.longtab) {
_global.tableroalcance[i] = new Array(_global.longtab);
j = 0;
while (j <= _global.longtab) {
_global.tableroalcance[i][j] = new Array();
j++;
}
i++;
}
i = 0;
while (i <= _global.longtab) {
_global.tablero[i] = new Array(_global.longtab);
j = 0;
while (j <= _global.longtab) {
_global.tablero[i][j] = 1;
j++;
}
i++;
}
i = 0;
while (i <= _global.longtab) {
_global.tableroIA[i] = new Array(_global.longtab);
i++;
}
i = 0;
while (i <= _global.longtab) {
_global.tableroIAv[i] = new Array(_global.longtab);
i++;
}
i = 0;
while (i <= _global.longtab) {
_global.tableroaux[i] = new Array(_global.longtab);
i++;
}
i = 0;
while (i <= _global.longtab) {
j = 0;
while (j <= _global.longtab) {
j++;
}
i++;
}
this.onMouseDown = function () {
if (((((this._xmouse / 20) > _global.longtab) or ((this._ymouse / 20) > _global.longtab)) or ((this._xmouse / 20) < 0)) or ((this._ymouse / 20) < 0)) {
_level0.terreno.info.gotoAndStop(1);
if ((this.info.actualizar.hitTest(_level0._xmouse, _level0._ymouse) == false) and (this.info.borrar.hitTest(_level0._xmouse, _level0._ymouse) == false)) {
this.marker.removeMovieClip();
this.markerbi.removeMovieClip();
this.info.objeto = null;
}
_level0.terreno.info.ataque.text = "";
_level0.terreno.info.distancia.text = "";
_level0.terreno.info.coste.text = "";
_level0.terreno.info.ataque2.text = "";
_level0.terreno.info.distancia2.text = "";
_level0.terreno.info.coste2.text = "";
_level0.terreno.info.costeactualizar.text = "";
}
};
accesorapido = function () {
if (Key.isDown(49)) {
if (_global.STOP == false) {
this.marker.removeMovieClip();
this.markerbi.removeMovieClip();
_level0.terreno.info.gotoAndStop(1);
_level0.terreno.info.objeto = null;
_level0.terreno.info.ataque.text = _level0.btorreta2.ataque;
_level0.terreno.info.distancia.text = _level0.btorreta2.distancia;
_level0.terreno.info.coste.text = _level0.btorreta2.coste;
_level0.terreno.info.ataque2.text = "";
_level0.terreno.info.distancia2.text = "";
_level0.terreno.info.coste2.text = "";
if ((_global.dinero - _level0.btorreta2.coste) >= 0) {
_global.pretorreta.removeMovieClip();
_level0.terreno.attachMovie("torreta2", "torr" + _global.cont, 700 + (2 * _global.cont), {_x:this._xmouse, _y:this._ymouse});
_global.pretorreta = _level0.terreno["torr" + _global.cont];
_global.cont++;
}
if (((_global.dinero - _level0.btorreta2.coste) < 0) and (_level0.nodinero == undefined)) {
}
}
}
if (Key.isDown(50)) {
if (_global.STOP == false) {
this.marker.removeMovieClip();
this.markerbi.removeMovieClip();
_level0.terreno.info.gotoAndStop(1);
_level0.terreno.info.objeto = null;
_level0.terreno.info.ataque.text = _level0.btorreta.ataque;
_level0.terreno.info.distancia.text = _level0.btorreta.distancia;
_level0.terreno.info.coste.text = _level0.btorreta.coste;
_level0.terreno.info.ataque2.text = "";
_level0.terreno.info.distancia2.text = "";
_level0.terreno.info.coste2.text = "";
if ((_global.dinero - _level0.btorreta.coste) >= 0) {
_global.pretorreta.removeMovieClip();
_level0.terreno.attachMovie("torreta1", "torr" + _global.cont, 700 + (2 * _global.cont), {_x:this._xmouse, _y:this._ymouse});
_global.pretorreta = _level0.terreno["torr" + _global.cont];
_global.cont++;
}
if ((_global.dinero - _level0.btorreta.coste) < 0) {
}
}
}
if (Key.isDown(51)) {
if (_global.STOP == false) {
this.marker.removeMovieClip();
this.markerbi.removeMovieClip();
_level0.terreno.info.gotoAndStop(1);
_level0.terreno.info.objeto = null;
_level0.terreno.info.ataque.text = _level0.btorreta3.ataque;
_level0.terreno.info.distancia.text = _level0.btorreta3.distancia;
_level0.terreno.info.coste.text = _level0.btorreta3.coste;
_level0.terreno.info.ataque2.text = "";
_level0.terreno.info.distancia2.text = "";
_level0.terreno.info.coste2.text = "";
if ((_global.dinero - _level0.btorreta3.coste) >= 0) {
_global.pretorreta.removeMovieClip();
_level0.terreno.attachMovie("torreta3", "torr" + _global.cont, 700 + (2 * _global.cont), {_x:this._xmouse, _y:this._ymouse});
_global.pretorreta = _level0.terreno["torr" + _global.cont];
_global.cont++;
}
if ((_global.dinero - _level0.btorreta3.coste) < 0) {
}
}
}
if (Key.isDown(52)) {
if (_global.STOP == false) {
this.marker.removeMovieClip();
this.markerbi.removeMovieClip();
_level0.terreno.info.gotoAndStop(1);
_level0.terreno.info.objeto = null;
_level0.terreno.info.ataque.text = _level0.btorreta4.ataque;
_level0.terreno.info.distancia.text = _level0.btorreta4.distancia;
_level0.terreno.info.coste.text = _level0.btorreta4.coste;
_level0.terreno.info.ataque2.text = "";
_level0.terreno.info.distancia2.text = "";
_level0.terreno.info.coste2.text = "";
if ((_global.dinero - _level0.btorreta4.coste) >= 0) {
_global.pretorreta.removeMovieClip();
_level0.terreno.attachMovie("torreta4", "torr" + _global.cont, 700 + (2 * _global.cont), {_x:this._xmouse, _y:this._ymouse});
_global.pretorreta = _level0.terreno["torr" + _global.cont];
_global.cont++;
}
if ((_global.dinero - _level0.btorreta4.coste) < 0) {
}
}
}
if (Key.isDown(53)) {
if (_global.STOP == false) {
this.marker.removeMovieClip();
this.markerbi.removeMovieClip();
_level0.terreno.info.gotoAndStop(1);
_level0.terreno.info.objeto = null;
_level0.terreno.info.ataque.text = _level0.btorreta5.ataque;
_level0.terreno.info.distancia.text = _level0.btorreta5.distancia;
_level0.terreno.info.coste.text = _level0.btorreta5.coste;
_level0.terreno.info.ataque2.text = "";
_level0.terreno.info.distancia2.text = "";
_level0.terreno.info.coste2.text = "";
if ((_global.dinero - _level0.btorreta5.coste) >= 0) {
_global.pretorreta.removeMovieClip();
_level0.terreno.attachMovie("torreta5", "torr" + _global.cont, 700 + (2 * _global.cont), {_x:this._xmouse, _y:this._ymouse});
_global.pretorreta = _level0.terreno["torr" + _global.cont];
_global.cont++;
}
if ((_global.dinero - _level0.btorreta5.coste) < 0) {
}
}
}
if (Key.isDown(46)) {
if ((_level0.terreno.info.objeto != null) and (_level0.terreno.info._currentframe == 1)) {
_level0.terreno.info.objeto.borrar();
this.marker.removeMovieClip();
this.markerbi.removeMovieClip();
}
}
};
IA3(_global.tablero, _global.tableroIAv, _global.tableroaux, _global.longtab, 1);
IA3(_global.tablero, _global.tableroIA, _global.tableroaux, _global.longtab, 0);
onEnterFrame = function () {
var _local3 = 0;
accesorapido();
if (aux2 == true) {
dinero.text = _global.dinero;
puntos.text = _global.puntos;
vidas.text = _global.vida;
aux2 = false;
} else {
aux2 = true;
}
if (_global.vida <= 0) {
if (_global.STOP == false) {
_level0.attachMovie("finjuego", "finjuego", this._parent.getNextHighestDepth(), {_x:180, _y:100});
_global.STOP = true;
}
}
if (ultimonivel == true) {
for (i in _global.enemigos) {
_local3++;
break;
}
if ((_local3 == 0) and (_global.STOP == false)) {
_level0.attachMovie("finjuego", "finjuego", this._parent.getNextHighestDepth(), {_x:180, _y:100, finalestado:"You have won!"});
_global.STOP = true;
}
}
};
this.addListener(mouseListener);
Key.addListener(this);
Symbol 907 MovieClip Frame 1
function IA3(tab, tabIA, tabaux2, long, HoV) {
var _local4 = new Array();
var _local8 = new Array(long);
var _local5 = 0;
var _local11;
var _local2 = null;
var _local1 = null;
var _local7 = 0;
var _local10;
_local5 = 0;
while (_local5 <= long) {
j = 0;
while (j <= long) {
tabIA[_local5][j] = 9999;
j++;
}
_local5++;
}
if (HoV == 0) {
_local5 = -3;
while (_local5 <= 1) {
if (tab[(long / 2) + _local5][long] == 1) {
_local2 = (long / 2) + _local5;
_local1 = long;
tabIA[(long / 2) + _local5][long] = 1;
}
_local5++;
}
} else {
_local5 = -3;
while (_local5 <= 1) {
if (tab[long][(long / 2) + _local5] == 1) {
_local2 = long;
_local1 = (long / 2) + _local5;
tabIA[long][(long / 2) + _local5] = 1;
}
_local5++;
}
}
_local5 = 0;
while (_local5 <= long) {
_local8[_local5] = new Array(long);
j = 0;
while (j <= long) {
_local8[_local5][j] = 0;
j++;
}
_local5++;
}
if ((_local2 == null) or (_local1 == null)) {
return(undefined);
}
_local4[(("f" + _local2) + "c") + _local1] = new casilla(_local2, _local1);
_local7++;
do {
for (_local10 in _local4) {
_local2 = _local4[_local10].fila;
_local1 = _local4[_local10].columna;
_local8[_local2][_local1] = 1;
if (tab[_local2 + 1][_local1] != 0) {
if ((_local2 + 1) <= long) {
if (_local8[_local2 + 1][_local1] == 0) {
if (_local4[(("f" + (_local2 + 1)) + "c") + _local1] == null) {
_local4[(("f" + (_local2 + 1)) + "c") + _local1] = new casilla(_local2 + 1, _local1);
_local7++;
}
}
if (tabIA[_local2 + 1][_local1] > (tabIA[_local2][_local1] + 1)) {
tabIA[_local2 + 1][_local1] = tabIA[_local2][_local1] + 1;
}
}
}
if (tab[_local2 - 1][_local1] != 0) {
if ((_local2 - 1) >= 0) {
if (_local8[_local2 - 1][_local1] == 0) {
if (_local4[(("f" + (_local2 - 1)) + "c") + _local1] == null) {
_local4[(("f" + (_local2 - 1)) + "c") + _local1] = new casilla(_local2 - 1, _local1);
_local7++;
}
}
if (tabIA[_local2 - 1][_local1] > (tabIA[_local2][_local1] + 1)) {
tabIA[_local2 - 1][_local1] = tabIA[_local2][_local1] + 1;
}
}
}
if (tab[_local2][_local1 + 1] != 0) {
if ((_local1 + 1) <= long) {
if (_local8[_local2][_local1 + 1] == 0) {
if (_local4[(("f" + _local2) + "c") + (_local1 + 1)] == null) {
_local4[(("f" + _local2) + "c") + (_local1 + 1)] = new casilla(_local2, _local1 + 1);
_local7++;
}
if (_local11 == 0) {
_local4[(("f" + _local2) + "c") + (_local1 + 1)] = new casilla(_local2, _local1 + 1);
_local7++;
}
}
if (tabIA[_local2][_local1 + 1] > (tabIA[_local2][_local1] + 1)) {
tabIA[_local2][_local1 + 1] = tabIA[_local2][_local1] + 1;
}
}
}
if (tab[_local2][_local1 - 1] != 0) {
if ((_local1 - 1) >= 0) {
if (_local8[_local2][_local1 - 1] == 0) {
if (_local4[(("f" + _local2) + "c") + (_local1 - 1)] == null) {
_local4[(("f" + _local2) + "c") + (_local1 - 1)] = new casilla(_local2, _local1 - 1);
_local7++;
}
if (_local11 == 0) {
_local4[(("f" + _local2) + "c") + (_local1 - 1)] = new casilla(_local2, _local1 - 1);
_local7++;
}
}
if (tabIA[_local2][_local1 - 1] > (tabIA[_local2][_local1] + 1)) {
tabIA[_local2][_local1 - 1] = tabIA[_local2][_local1] + 1;
}
}
}
delete _local4[_local10];
_local7--;
}
} while (_local7 >= 1);
}
var dificultad = "medio_avanzado";
var aux;
var aux2 = true;
var ultimonivel = false;
var suelo = new Array(_global.longtab);
var loadgame = new LoadVars();
this.attachMovie("bloq_prof", "bloq_prof", 2000);
_global.longtab = 26;
_global.tablero = new Array(_global.longtab);
_global.tableroIA = new Array(_global.longtab);
_global.tableroaux = new Array(_global.longtab);
_global.tableroIAv = new Array(_global.longtab);
_global.tableroalcance = new Array(_global.longtab);
_global.enemigos = new Array();
_global.enemigosflier = new Array();
_global.hijos = new Array();
_global.dinero = 95;
_global.puntos = 0;
_global.vida = 25;
_global.activarboton = true;
_global.cont = 0;
_global.torretacursor = false;
_global.STOP = false;
_global.volumen = 75;
_global.sonidoactivos = new Array();
_global.pretorreta = null;
this.cacheAsBitmap = true;
trace(dificultad);
i = 0;
while (i <= _global.longtab) {
suelo[i] = new Array(_global.longtab);
j = 0;
while (j <= _global.longtab) {
suelo[i][j] = 0;
j++;
}
i++;
}
i = 0;
while (i <= _global.longtab) {
_global.tableroalcance[i] = new Array(_global.longtab);
j = 0;
while (j <= _global.longtab) {
_global.tableroalcance[i][j] = new Array();
j++;
}
i++;
}
i = 0;
while (i <= _global.longtab) {
_global.tablero[i] = new Array(_global.longtab);
j = 0;
while (j <= _global.longtab) {
_global.tablero[i][j] = 1;
j++;
}
i++;
}
i = 0;
while (i <= _global.longtab) {
_global.tableroIA[i] = new Array(_global.longtab);
i++;
}
i = 0;
while (i <= _global.longtab) {
_global.tableroIAv[i] = new Array(_global.longtab);
i++;
}
i = 0;
while (i <= _global.longtab) {
_global.tableroaux[i] = new Array(_global.longtab);
i++;
}
i = 0;
while (i <= _global.longtab) {
j = 0;
while (j <= _global.longtab) {
j++;
}
i++;
}
this.onMouseDown = function () {
if (((((this._xmouse / 20) > _global.longtab) or ((this._ymouse / 20) > _global.longtab)) or ((this._xmouse / 20) < 0)) or ((this._ymouse / 20) < 0)) {
_level0.terreno.info.gotoAndStop(1);
if ((this.info.actualizar.hitTest(_level0._xmouse, _level0._ymouse) == false) and (this.info.borrar.hitTest(_level0._xmouse, _level0._ymouse) == false)) {
this.marker.removeMovieClip();
this.markerbi.removeMovieClip();
this.info.objeto = null;
}
_level0.terreno.info.ataque.text = "";
_level0.terreno.info.distancia.text = "";
_level0.terreno.info.coste.text = "";
_level0.terreno.info.ataque2.text = "";
_level0.terreno.info.distancia2.text = "";
_level0.terreno.info.coste2.text = "";
_level0.terreno.info.costeactualizar.text = "";
}
};
accesorapido = function () {
if (Key.isDown(49)) {
if (_global.STOP == false) {
this.marker.removeMovieClip();
this.markerbi.removeMovieClip();
_level0.terreno.info.gotoAndStop(1);
_level0.terreno.info.objeto = null;
_level0.terreno.info.ataque.text = _level0.btorreta2.ataque;
_level0.terreno.info.distancia.text = _level0.btorreta2.distancia;
_level0.terreno.info.coste.text = _level0.btorreta2.coste;
_level0.terreno.info.ataque2.text = "";
_level0.terreno.info.distancia2.text = "";
_level0.terreno.info.coste2.text = "";
if ((_global.dinero - _level0.btorreta2.coste) >= 0) {
_global.pretorreta.removeMovieClip();
_level0.terreno.attachMovie("torreta2", "torr" + _global.cont, 700 + (2 * _global.cont), {_x:this._xmouse, _y:this._ymouse});
_global.pretorreta = _level0.terreno["torr" + _global.cont];
_global.cont++;
}
if (((_global.dinero - _level0.btorreta2.coste) < 0) and (_level0.nodinero == undefined)) {
}
}
}
if (Key.isDown(50)) {
if (_global.STOP == false) {
this.marker.removeMovieClip();
this.markerbi.removeMovieClip();
_level0.terreno.info.gotoAndStop(1);
_level0.terreno.info.objeto = null;
_level0.terreno.info.ataque.text = _level0.btorreta.ataque;
_level0.terreno.info.distancia.text = _level0.btorreta.distancia;
_level0.terreno.info.coste.text = _level0.btorreta.coste;
_level0.terreno.info.ataque2.text = "";
_level0.terreno.info.distancia2.text = "";
_level0.terreno.info.coste2.text = "";
if ((_global.dinero - _level0.btorreta.coste) >= 0) {
_global.pretorreta.removeMovieClip();
_level0.terreno.attachMovie("torreta1", "torr" + _global.cont, 700 + (2 * _global.cont), {_x:this._xmouse, _y:this._ymouse});
_global.pretorreta = _level0.terreno["torr" + _global.cont];
_global.cont++;
}
if ((_global.dinero - _level0.btorreta.coste) < 0) {
}
}
}
if (Key.isDown(51)) {
if (_global.STOP == false) {
this.marker.removeMovieClip();
this.markerbi.removeMovieClip();
_level0.terreno.info.gotoAndStop(1);
_level0.terreno.info.objeto = null;
_level0.terreno.info.ataque.text = _level0.btorreta3.ataque;
_level0.terreno.info.distancia.text = _level0.btorreta3.distancia;
_level0.terreno.info.coste.text = _level0.btorreta3.coste;
_level0.terreno.info.ataque2.text = "";
_level0.terreno.info.distancia2.text = "";
_level0.terreno.info.coste2.text = "";
if ((_global.dinero - _level0.btorreta3.coste) >= 0) {
_global.pretorreta.removeMovieClip();
_level0.terreno.attachMovie("torreta3", "torr" + _global.cont, 700 + (2 * _global.cont), {_x:this._xmouse, _y:this._ymouse});
_global.pretorreta = _level0.terreno["torr" + _global.cont];
_global.cont++;
}
if ((_global.dinero - _level0.btorreta3.coste) < 0) {
}
}
}
if (Key.isDown(52)) {
if (_global.STOP == false) {
this.marker.removeMovieClip();
this.markerbi.removeMovieClip();
_level0.terreno.info.gotoAndStop(1);
_level0.terreno.info.objeto = null;
_level0.terreno.info.ataque.text = _level0.btorreta4.ataque;
_level0.terreno.info.distancia.text = _level0.btorreta4.distancia;
_level0.terreno.info.coste.text = _level0.btorreta4.coste;
_level0.terreno.info.ataque2.text = "";
_level0.terreno.info.distancia2.text = "";
_level0.terreno.info.coste2.text = "";
if ((_global.dinero - _level0.btorreta4.coste) >= 0) {
_global.pretorreta.removeMovieClip();
_level0.terreno.attachMovie("torreta4", "torr" + _global.cont, 700 + (2 * _global.cont), {_x:this._xmouse, _y:this._ymouse});
_global.pretorreta = _level0.terreno["torr" + _global.cont];
_global.cont++;
}
if ((_global.dinero - _level0.btorreta4.coste) < 0) {
}
}
}
if (Key.isDown(53)) {
if (_global.STOP == false) {
this.marker.removeMovieClip();
this.markerbi.removeMovieClip();
_level0.terreno.info.gotoAndStop(1);
_level0.terreno.info.objeto = null;
_level0.terreno.info.ataque.text = _level0.btorreta5.ataque;
_level0.terreno.info.distancia.text = _level0.btorreta5.distancia;
_level0.terreno.info.coste.text = _level0.btorreta5.coste;
_level0.terreno.info.ataque2.text = "";
_level0.terreno.info.distancia2.text = "";
_level0.terreno.info.coste2.text = "";
if ((_global.dinero - _level0.btorreta5.coste) >= 0) {
_global.pretorreta.removeMovieClip();
_level0.terreno.attachMovie("torreta5", "torr" + _global.cont, 700 + (2 * _global.cont), {_x:this._xmouse, _y:this._ymouse});
_global.pretorreta = _level0.terreno["torr" + _global.cont];
_global.cont++;
}
if ((_global.dinero - _level0.btorreta5.coste) < 0) {
}
}
}
if (Key.isDown(46)) {
if ((_level0.terreno.info.objeto != null) and (_level0.terreno.info._currentframe == 1)) {
_level0.terreno.info.objeto.borrar();
this.marker.removeMovieClip();
this.markerbi.removeMovieClip();
}
}
};
IA3(_global.tablero, _global.tableroIAv, _global.tableroaux, _global.longtab, 1);
IA3(_global.tablero, _global.tableroIA, _global.tableroaux, _global.longtab, 0);
onEnterFrame = function () {
var _local3 = 0;
accesorapido();
if (aux2 == true) {
dinero.text = _global.dinero;
puntos.text = _global.puntos;
vidas.text = _global.vida;
aux2 = false;
} else {
aux2 = true;
}
if (_global.vida <= 0) {
if (_global.STOP == false) {
_level0.attachMovie("finjuego", "finjuego", this._parent.getNextHighestDepth(), {_x:180, _y:100});
_global.STOP = true;
}
}
if (ultimonivel == true) {
for (i in _global.enemigos) {
_local3++;
}
if ((_local3 == 0) and (_global.STOP == false)) {
_level0.attachMovie("finjuego", "finjuego", this._parent.getNextHighestDepth(), {_x:180, _y:100, finalestado:"You have won!"});
_global.STOP = true;
}
}
};
this.addListener(mouseListener);
Key.addListener(this);
Symbol 915 MovieClip Frame 1
function IA3(tab, tabIA, tabaux2, long, HoV) {
var _local4 = new Array();
var _local8 = new Array(long);
var _local5 = 0;
var _local11;
var _local2 = null;
var _local1 = null;
var _local7 = 0;
var _local10;
_local5 = 0;
while (_local5 <= long) {
j = 0;
while (j <= long) {
tabIA[_local5][j] = 9999;
j++;
}
_local5++;
}
if (HoV == 0) {
_local5 = -3;
while (_local5 <= 1) {
if (tab[(long / 2) + _local5][long] == 1) {
_local2 = (long / 2) + _local5;
_local1 = long;
tabIA[(long / 2) + _local5][long] = 1;
}
_local5++;
}
} else {
_local5 = -3;
while (_local5 <= 1) {
if (tab[long][(long / 2) + _local5] == 1) {
_local2 = long;
_local1 = (long / 2) + _local5;
tabIA[long][(long / 2) + _local5] = 1;
}
_local5++;
}
}
_local5 = 0;
while (_local5 <= long) {
_local8[_local5] = new Array(long);
j = 0;
while (j <= long) {
_local8[_local5][j] = 0;
j++;
}
_local5++;
}
if ((_local2 == null) or (_local1 == null)) {
return(undefined);
}
_local4[(("f" + _local2) + "c") + _local1] = new casilla(_local2, _local1);
_local7++;
do {
for (_local10 in _local4) {
_local2 = _local4[_local10].fila;
_local1 = _local4[_local10].columna;
_local8[_local2][_local1] = 1;
if (tab[_local2 + 1][_local1] != 0) {
if ((_local2 + 1) <= long) {
if (_local8[_local2 + 1][_local1] == 0) {
if (_local4[(("f" + (_local2 + 1)) + "c") + _local1] == null) {
_local4[(("f" + (_local2 + 1)) + "c") + _local1] = new casilla(_local2 + 1, _local1);
_local7++;
}
}
if (tabIA[_local2 + 1][_local1] > (tabIA[_local2][_local1] + 1)) {
tabIA[_local2 + 1][_local1] = tabIA[_local2][_local1] + 1;
}
}
}
if (tab[_local2 - 1][_local1] != 0) {
if ((_local2 - 1) >= 0) {
if (_local8[_local2 - 1][_local1] == 0) {
if (_local4[(("f" + (_local2 - 1)) + "c") + _local1] == null) {
_local4[(("f" + (_local2 - 1)) + "c") + _local1] = new casilla(_local2 - 1, _local1);
_local7++;
}
}
if (tabIA[_local2 - 1][_local1] > (tabIA[_local2][_local1] + 1)) {
tabIA[_local2 - 1][_local1] = tabIA[_local2][_local1] + 1;
}
}
}
if (tab[_local2][_local1 + 1] != 0) {
if ((_local1 + 1) <= long) {
if (_local8[_local2][_local1 + 1] == 0) {
if (_local4[(("f" + _local2) + "c") + (_local1 + 1)] == null) {
_local4[(("f" + _local2) + "c") + (_local1 + 1)] = new casilla(_local2, _local1 + 1);
_local7++;
}
if (_local11 == 0) {
_local4[(("f" + _local2) + "c") + (_local1 + 1)] = new casilla(_local2, _local1 + 1);
_local7++;
}
}
if (tabIA[_local2][_local1 + 1] > (tabIA[_local2][_local1] + 1)) {
tabIA[_local2][_local1 + 1] = tabIA[_local2][_local1] + 1;
}
}
}
if (tab[_local2][_local1 - 1] != 0) {
if ((_local1 - 1) >= 0) {
if (_local8[_local2][_local1 - 1] == 0) {
if (_local4[(("f" + _local2) + "c") + (_local1 - 1)] == null) {
_local4[(("f" + _local2) + "c") + (_local1 - 1)] = new casilla(_local2, _local1 - 1);
_local7++;
}
if (_local11 == 0) {
_local4[(("f" + _local2) + "c") + (_local1 - 1)] = new casilla(_local2, _local1 - 1);
_local7++;
}
}
if (tabIA[_local2][_local1 - 1] > (tabIA[_local2][_local1] + 1)) {
tabIA[_local2][_local1 - 1] = tabIA[_local2][_local1] + 1;
}
}
}
delete _local4[_local10];
_local7--;
}
} while (_local7 >= 1);
}
var dificultad = "dificil";
var aux;
var aux2 = true;
var ultimonivel = false;
var suelo = new Array(_global.longtab);
var loadgame = new LoadVars();
this.attachMovie("bloq_prof", "bloq_prof", 2000);
_global.longtab = 26;
_global.tablero = new Array(_global.longtab);
_global.tableroIA = new Array(_global.longtab);
_global.tableroaux = new Array(_global.longtab);
_global.tableroIAv = new Array(_global.longtab);
_global.tableroalcance = new Array(_global.longtab);
_global.enemigos = new Array();
_global.enemigosflier = new Array();
_global.hijos = new Array();
_global.dinero = 105;
_global.puntos = 0;
_global.vida = 25;
_global.activarboton = true;
_global.cont = 0;
_global.torretacursor = false;
_global.STOP = false;
_global.volumen = 75;
_global.sonidoactivos = new Array();
_global.pretorreta = null;
this.cacheAsBitmap = true;
trace(dificultad);
i = 0;
while (i <= _global.longtab) {
suelo[i] = new Array(_global.longtab);
j = 0;
while (j <= _global.longtab) {
suelo[i][j] = 0;
j++;
}
i++;
}
i = 0;
while (i <= _global.longtab) {
_global.tableroalcance[i] = new Array(_global.longtab);
j = 0;
while (j <= _global.longtab) {
_global.tableroalcance[i][j] = new Array();
j++;
}
i++;
}
i = 0;
while (i <= _global.longtab) {
_global.tablero[i] = new Array(_global.longtab);
j = 0;
while (j <= _global.longtab) {
_global.tablero[i][j] = 1;
j++;
}
i++;
}
i = 0;
while (i <= _global.longtab) {
_global.tableroIA[i] = new Array(_global.longtab);
i++;
}
i = 0;
while (i <= _global.longtab) {
_global.tableroIAv[i] = new Array(_global.longtab);
i++;
}
i = 0;
while (i <= _global.longtab) {
_global.tableroaux[i] = new Array(_global.longtab);
i++;
}
i = 0;
while (i <= _global.longtab) {
j = 0;
while (j <= _global.longtab) {
j++;
}
i++;
}
this.onMouseDown = function () {
if (((((this._xmouse / 20) > _global.longtab) or ((this._ymouse / 20) > _global.longtab)) or ((this._xmouse / 20) < 0)) or ((this._ymouse / 20) < 0)) {
_level0.terreno.info.gotoAndStop(1);
if ((this.info.actualizar.hitTest(_level0._xmouse, _level0._ymouse) == false) and (this.info.borrar.hitTest(_level0._xmouse, _level0._ymouse) == false)) {
this.marker.removeMovieClip();
this.markerbi.removeMovieClip();
this.info.objeto = null;
}
_level0.terreno.info.ataque.text = "";
_level0.terreno.info.distancia.text = "";
_level0.terreno.info.coste.text = "";
_level0.terreno.info.ataque2.text = "";
_level0.terreno.info.distancia2.text = "";
_level0.terreno.info.coste2.text = "";
_level0.terreno.info.costeactualizar.text = "";
}
};
accesorapido = function () {
if (Key.isDown(49)) {
if (_global.STOP == false) {
this.marker.removeMovieClip();
this.markerbi.removeMovieClip();
_level0.terreno.info.gotoAndStop(1);
_level0.terreno.info.objeto = null;
_level0.terreno.info.ataque.text = _level0.btorreta2.ataque;
_level0.terreno.info.distancia.text = _level0.btorreta2.distancia;
_level0.terreno.info.coste.text = _level0.btorreta2.coste;
_level0.terreno.info.ataque2.text = "";
_level0.terreno.info.distancia2.text = "";
_level0.terreno.info.coste2.text = "";
if ((_global.dinero - _level0.btorreta2.coste) >= 0) {
_global.pretorreta.removeMovieClip();
_level0.terreno.attachMovie("torreta2", "torr" + _global.cont, 700 + (2 * _global.cont), {_x:this._xmouse, _y:this._ymouse});
_global.pretorreta = _level0.terreno["torr" + _global.cont];
_global.cont++;
}
if (((_global.dinero - _level0.btorreta2.coste) < 0) and (_level0.nodinero == undefined)) {
}
}
}
if (Key.isDown(50)) {
if (_global.STOP == false) {
this.marker.removeMovieClip();
this.markerbi.removeMovieClip();
_level0.terreno.info.gotoAndStop(1);
_level0.terreno.info.objeto = null;
_level0.terreno.info.ataque.text = _level0.btorreta.ataque;
_level0.terreno.info.distancia.text = _level0.btorreta.distancia;
_level0.terreno.info.coste.text = _level0.btorreta.coste;
_level0.terreno.info.ataque2.text = "";
_level0.terreno.info.distancia2.text = "";
_level0.terreno.info.coste2.text = "";
if ((_global.dinero - _level0.btorreta.coste) >= 0) {
_global.pretorreta.removeMovieClip();
_level0.terreno.attachMovie("torreta1", "torr" + _global.cont, 700 + (2 * _global.cont), {_x:this._xmouse, _y:this._ymouse});
_global.pretorreta = _level0.terreno["torr" + _global.cont];
_global.cont++;
}
if ((_global.dinero - _level0.btorreta.coste) < 0) {
}
}
}
if (Key.isDown(51)) {
if (_global.STOP == false) {
this.marker.removeMovieClip();
this.markerbi.removeMovieClip();
_level0.terreno.info.gotoAndStop(1);
_level0.terreno.info.objeto = null;
_level0.terreno.info.ataque.text = _level0.btorreta3.ataque;
_level0.terreno.info.distancia.text = _level0.btorreta3.distancia;
_level0.terreno.info.coste.text = _level0.btorreta3.coste;
_level0.terreno.info.ataque2.text = "";
_level0.terreno.info.distancia2.text = "";
_level0.terreno.info.coste2.text = "";
if ((_global.dinero - _level0.btorreta3.coste) >= 0) {
_global.pretorreta.removeMovieClip();
_level0.terreno.attachMovie("torreta3", "torr" + _global.cont, 700 + (2 * _global.cont), {_x:this._xmouse, _y:this._ymouse});
_global.pretorreta = _level0.terreno["torr" + _global.cont];
_global.cont++;
}
if ((_global.dinero - _level0.btorreta3.coste) < 0) {
}
}
}
if (Key.isDown(52)) {
if (_global.STOP == false) {
this.marker.removeMovieClip();
this.markerbi.removeMovieClip();
_level0.terreno.info.gotoAndStop(1);
_level0.terreno.info.objeto = null;
_level0.terreno.info.ataque.text = _level0.btorreta4.ataque;
_level0.terreno.info.distancia.text = _level0.btorreta4.distancia;
_level0.terreno.info.coste.text = _level0.btorreta4.coste;
_level0.terreno.info.ataque2.text = "";
_level0.terreno.info.distancia2.text = "";
_level0.terreno.info.coste2.text = "";
if ((_global.dinero - _level0.btorreta4.coste) >= 0) {
_global.pretorreta.removeMovieClip();
_level0.terreno.attachMovie("torreta4", "torr" + _global.cont, 700 + (2 * _global.cont), {_x:this._xmouse, _y:this._ymouse});
_global.pretorreta = _level0.terreno["torr" + _global.cont];
_global.cont++;
}
if ((_global.dinero - _level0.btorreta4.coste) < 0) {
}
}
}
if (Key.isDown(53)) {
if (_global.STOP == false) {
this.marker.removeMovieClip();
this.markerbi.removeMovieClip();
_level0.terreno.info.gotoAndStop(1);
_level0.terreno.info.objeto = null;
_level0.terreno.info.ataque.text = _level0.btorreta5.ataque;
_level0.terreno.info.distancia.text = _level0.btorreta5.distancia;
_level0.terreno.info.coste.text = _level0.btorreta5.coste;
_level0.terreno.info.ataque2.text = "";
_level0.terreno.info.distancia2.text = "";
_level0.terreno.info.coste2.text = "";
if ((_global.dinero - _level0.btorreta5.coste) >= 0) {
_global.pretorreta.removeMovieClip();
_level0.terreno.attachMovie("torreta5", "torr" + _global.cont, 700 + (2 * _global.cont), {_x:this._xmouse, _y:this._ymouse});
_global.pretorreta = _level0.terreno["torr" + _global.cont];
_global.cont++;
}
if ((_global.dinero - _level0.btorreta5.coste) < 0) {
}
}
}
if (Key.isDown(46)) {
if ((_level0.terreno.info.objeto != null) and (_level0.terreno.info._currentframe == 1)) {
_level0.terreno.info.objeto.borrar();
this.marker.removeMovieClip();
this.markerbi.removeMovieClip();
}
}
};
IA3(_global.tablero, _global.tableroIAv, _global.tableroaux, _global.longtab, 1);
IA3(_global.tablero, _global.tableroIA, _global.tableroaux, _global.longtab, 0);
onEnterFrame = function () {
var _local3 = 0;
accesorapido();
if (aux2 == true) {
dinero.text = _global.dinero;
puntos.text = _global.puntos;
vidas.text = _global.vida;
aux2 = false;
} else {
aux2 = true;
}
if (_global.vida <= 0) {
if (_global.STOP == false) {
_level0.attachMovie("finjuego", "finjuego", this._parent.getNextHighestDepth(), {_x:180, _y:100});
_global.STOP = true;
}
}
if (ultimonivel == true) {
for (i in _global.enemigos) {
_local3++;
}
if ((_local3 == 0) and (_global.STOP == false)) {
_level0.attachMovie("finjuego", "finjuego", this._parent.getNextHighestDepth(), {_x:180, _y:100, finalestado:"You have won!"});
_global.STOP = true;
}
}
};
this.addListener(mouseListener);
Key.addListener(this);
Symbol 932 MovieClip Frame 1
!!!ERROR
Symbol 933 MovieClip Frame 1
this.onMouseDown = function () {
this.info_juego.removeMovieClip();
};
this.addListener(mouseListener);
Instance of Symbol 919 MovieClip in Symbol 933 MovieClip Frame 1
on (press) {
!!!ERROR
Instance of Symbol 922 MovieClip in Symbol 933 MovieClip Frame 1
on (press) {
this._parent.attachMovie("info_juego", "info_juego", 300, {_x:100, _y:100, foto:6});
}
Instance of Symbol 922 MovieClip in Symbol 933 MovieClip Frame 1
on (press) {
this._parent.attachMovie("info_juego", "info_juego", 300, {_x:-150, _y:150, foto:5});
}
Instance of Symbol 922 MovieClip in Symbol 933 MovieClip Frame 1
on (press) {
this._parent.attachMovie("info_juego", "info_juego", 300, {_x:-150, _y:-50, foto:4});
}
Instance of Symbol 922 MovieClip in Symbol 933 MovieClip Frame 1
on (press) {
this._parent.attachMovie("info_juego", "info_juego", 300, {_x:40, _y:-50, foto:3});
}
Instance of Symbol 922 MovieClip in Symbol 933 MovieClip Frame 1
on (press) {
this._parent.attachMovie("info_juego", "info_juego", 300, {_x:100, _y:0, foto:7});
}
Instance of Symbol 922 MovieClip in Symbol 933 MovieClip Frame 1
on (press) {
this._parent.attachMovie("info_juego", "info_juego", 300, {_x:50, _y:-50, foto:2});
}
Instance of Symbol 922 MovieClip in Symbol 933 MovieClip Frame 1
on (press) {
this._parent.attachMovie("info_juego", "info_juego", 300, {_x:-100, _y:-50, foto:1});
}