Frame 1
DATOS = _root.inicioJuego(1);
record = _root.maxPuntuacion[1];
if (!_root.isLogon) {
logonado = "no";
} else {
logonado = "si";
}
this.onEnterFrame = function () {
var _local2 = this.getBytesLoaded() / this.getBytesTotal();
cargando.setPercent(_local2);
if (_local2 >= 1) {
this.onEnterFrame = null;
play();
}
};
stop();
Frame 10
_quality = "high";
stop();
Frame 16
_quality = "high";
stop();
Frame 26
_global.initCrcPunts();
Frame 27
function boomerScrollerGFX(idFons, idTerres, idTerresSota, idPlataformes, idElementsFons, idPrimerpla, idNuvols, idBandera, idItems, idBombolla, idMusica) {
this.fons = flash.display.BitmapData.loadBitmap(idFons);
this.elementsFons = new Array();
var _local3 = 0;
while (_local3 < idElementsFons.length) {
this.elementsFons[_local3] = {y:idElementsFons[_local3].y, o:flash.display.BitmapData.loadBitmap(idElementsFons[_local3].o)};
_local3++;
}
this.primerPla = new Array();
_local3 = 0;
while (_local3 < idPrimerpla.length) {
this.primerPla[_local3] = flash.display.BitmapData.loadBitmap(idPrimerpla[_local3]);
_local3++;
}
this.nuvols = new Array();
_local3 = 0;
while (_local3 < idNuvols.length) {
this.nuvols[_local3] = flash.display.BitmapData.loadBitmap(idNuvols[_local3]);
_local3++;
}
this.terres = new Array();
_local3 = 0;
while (_local3 < idTerres.length) {
this.terres[_local3] = flash.display.BitmapData.loadBitmap(idTerres[_local3]);
_local3++;
}
this.terresSota = new Array();
_local3 = 0;
while (_local3 < idTerresSota.length) {
this.terresSota[_local3] = flash.display.BitmapData.loadBitmap(idTerresSota[_local3]);
_local3++;
}
this.plataformes = new Array();
_local3 = 0;
while (_local3 < idPlataformes.length) {
this.plataformes[_local3] = flash.display.BitmapData.loadBitmap(idPlataformes[_local3]);
_local3++;
}
this.bandera = flash.display.BitmapData.loadBitmap(idBandera);
this.items = new Array();
_local3 = 0;
while (_local3 < idItems.length) {
var _local4 = idItems[_local3];
this.items[_local3] = new Array();
var _local2 = 0;
while (_local2 < _local4.length) {
this.items[_local3][_local2] = flash.display.BitmapData.loadBitmap(_local4[_local2]);
_local2++;
}
this.nItems = _local2;
_local3++;
}
this.bombolla = flash.display.BitmapData.loadBitmap(idBombolla);
this.idMusica = idMusica;
}
function boomerScroller(bmap, clipMonstrus, dificultat, gfx, fondo) {
this.pantalla = bmap;
this.amplePantalla = this.pantalla.width;
this.altPantalla = this.pantalla.height;
this.clipMonstrus = clipMonstrus;
this.dificultat = dificultat;
this.gfx = gfx;
this.fondo = fondo;
this.buffer = new flash.display.BitmapData(this.amplePantalla, this.altPantalla);
this.llargada = boomerScroller.llargadaMinima + Math.round((boomerScroller.llargadaMaxima - boomerScroller.llargadaMinima) * Math.random());
this.viewport = new flash.geom.Rectangle(0, 0, this.amplePantalla, this.altPantalla);
this.camerax = this.amplePantalla / 2;
this.cameray = this.altPantalla / 2;
this.cuadricula = new Array();
var _local4 = 0;
while (_local4 < this.llargada) {
this.cuadricula[_local4] = new Array();
_local4++;
}
this.monstrus = new Array();
this.primerMonstru = 0;
this.elementsFondo = new Array();
this.nuvols = new Array();
this.vent = 0;
this.elementsEscenari = new Array();
this.primerEscenari = 0;
this.posicioBandera = 0;
this.caselles = new Array();
this.primera_casella = 0;
this.altures = new Array();
this.cuadriculaItems = new Array();
_local4 = 0;
while (_local4 < this.llargada) {
this.cuadriculaItems[_local4] = new Array();
_local4++;
}
this.items = new Array();
this.primer_item = 0;
this.animacioItems = 0;
this.genera();
this.caselles.sortOn("x", Array.NUMERIC);
this.elementsEscenari.sortOn("x", Array.NUMERIC);
this.items.sortOn("x", Array.NUMERIC);
this.monstrus.sortOn("x", Array.NUMERIC);
this.zonesMonstru = new Array();
_local4 = 0;
while (_local4 <= (this.llargada / 10)) {
this.zonesMonstru[_local4] = new Array();
var _local5 = (5 + (10 * _local4)) * boomerScroller.tamanyCuadricula;
var _local2 = 0;
while (_local2 < this.monstrus.length) {
var _local3 = this.monstrus[_local2];
if (Math.abs(_local3.x - _local5) < (15 * boomerScroller.tamanyCuadricula)) {
this.zonesMonstru[_local4][this.zonesMonstru[_local4].length] = _local3;
}
_local2++;
}
_local4++;
}
this.altura = 0;
_local4 = 0;
while (_local4 < this.llargada) {
if (this.cuadricula[_local4].length > this.altura) {
this.altura = this.cuadricula[_local4].length;
}
_local4++;
}
this.altura = this.altura + (this.altPantalla / boomerScroller.tamanyCuadricula);
}
function iniJoc() {
nVides = 3;
nPunts = 0;
nMon = 1;
nNivell = 1;
elsMons = [1, 2, 3];
var _local1 = 0;
while (_local1 < 10) {
var _local3 = random(3);
var _local2 = random(3);
var _local4 = elsMons[_local3];
elsMons[_local3] = elsMons[_local2];
elsMons[_local2] = _local4;
_local1++;
}
iniNivell();
}
function iniNivell() {
if (nNivell != 1) {
iniNivell2();
return(undefined);
}
marcadors._visible = false;
var _local2 = nMon;
while (_local2 > 3) {
_local2 = _local2 - 3;
}
_local2 = elsMons[_local2 - 1];
cobj = this["Intro" + _local2];
cobj.gotoAndPlay(2);
this.onEnterFrame = function () {
cobj.play();
if (cobj._currentframe == cobj._totalframes) {
this.onEnterFrame = null;
iniNivell2();
}
};
}
function iniNivell2() {
marcadors._visible = true;
var _local2 = (nivellsPerMon * (nMon - 1)) + nNivell;
var _local1 = nMon;
while (_local1 > 3) {
_local1 = _local1 - 3;
}
_local1 = elsMons[_local1 - 1];
if (_local1 == 1) {
game = new boomerScroller(pantalla, canvas.monstrus, _local2, gfx_dia, 4278190080);
}
if (_local1 == 2) {
game = new boomerScroller(pantalla, canvas.monstrus, _local2, gfx_nit, 4278190080);
}
if (_local1 == 3) {
game = new boomerScroller(pantalla, canvas.monstrus, _local2, gfx_psi, 4278190080);
}
game.gfx.musica = new Sound(canvas.audioMusiques);
game.gfx.musica.attachSound(game.gfx.idMusica);
game.gfx.musica.start(0, 1000);
canvas.attachMovie("personatge", "boomer", 5);
boomer = canvas.boomer;
iniVida();
}
function iniVida() {
nBonus = game.llargada * Math.round(3.2 + (game.dificultat * 1.1));
marcadors.bonus.txt = nBonus;
_quality = "high";
posx = 50;
posy = boomerScroller.tamanyCuadricula;
vx = 0;
vy = 0;
aTerra = false;
victoria = false;
casellaActual = getCasella(posx, posy);
estatcorrer = 0;
boomer.gotoAndStop("Parat");
game.gfx.musica.start(0, 1000);
var _local2 = 0;
while (_local2 < game.items.length) {
game.items[_local2].agafat = false;
_local2++;
}
nItems = (marcadors.items.txt = game.items.length);
marcadors.vides = nVides;
_local2 = 0;
while (_local2 < game.monstrus.length) {
game.monstrus[_local2].mort = false;
game.monstrus[_local2].desactiva();
game.monstrus[_local2].x = game.monstrus[_local2].inix;
game.monstrus[_local2].y = game.monstrus[_local2].iniy;
_local2++;
}
cartelaNivell.gotoAndPlay(2);
this.onEnterFrame = function () {
actualitzaMotor();
if (cartelaNivell._currentframe == cartelaNivell._totalframes) {
_quality = "low";
this.onEnterFrame = control;
}
};
}
function fiPantalla() {
this.onEnterFrame = null;
game.gfx.musica.stop();
boomer.gotoAndPlay("Victoria");
bonusCompleto = ((nItems == 0) ? (bonusPerItems) : 0);
cartelaFinal.gotoAndPlay(2);
_quality = "high";
this.onEnterFrame = function () {
if (cartelaFinal._currentframe == cartelaFinal._totalframes) {
this.onEnterFrame = null;
soVictoria.stop();
nPunts = nPunts + bonusCompleto;
_global.apuntaCrcPunts(bonusCompleto);
nPunts = nPunts + nBonus;
_global.apuntaCrcPunts(nBonus);
nPunts = nPunts + puntsPerNivell;
_global.apuntaCrcPunts(puntsPerNivell);
marcadors.punts.txt = nPunts;
nNivell++;
if (nNivell > nivellsPerMon) {
nMon++;
nNivell = 1;
}
iniNivell();
}
};
}
function perdoVida() {
game.gfx.musica.stop();
this.onEnterFrame = null;
boomer.gotoAndPlay("Mort");
soMort.start();
soMort.ref = this;
soMort.onSoundComplete = function () {
this.ref.continua();
};
}
function continua() {
nVides--;
if (nVides > 0) {
iniVida();
} else {
gameOver();
}
}
function gameOver() {
gotoAndPlay ("Gameover");
}
function mouPersonatge() {
if (aTerra) {
if (Key.isDown(37)) {
if (vx > 0) {
vx = Math.round(vx * frenada);
} else if (vx > -18) {
vx = vx - 1;
}
var _local1 = 1 + Math.floor(Math.abs(vx) / 7);
if (_local1 != estatcorrer) {
estatcorrer = _local1;
boomer.gotoAndPlay("Camina " + estatcorrer);
}
} else if (Key.isDown(39)) {
if (vx < 0) {
vx = Math.round(vx * frenada);
} else if (vx < 18) {
vx = vx + 1;
}
var _local1 = 1 + Math.floor(Math.abs(vx) / 7);
if (_local1 != estatcorrer) {
estatcorrer = _local1;
boomer.gotoAndPlay("Camina " + estatcorrer);
}
} else {
vx = vx * frenada;
estatcorrer = 0;
boomer.gotoAndStop("Parat");
}
if (Key.isDown(32)) {
vy = Math.abs(potenciaSalt + (inerciaSalt * Math.abs(vx)));
aTerra = false;
soSalt.start();
if (estatcorrer == 3) {
boomer.gotoAndPlay("Salta 3");
} else {
boomer.gotoAndPlay("Salta");
}
}
} else {
if (Key.isDown(37)) {
if (vx > 0) {
vx = vx - 3;
} else if (vx > -18) {
vx = vx - 0.5;
}
}
if (Key.isDown(39)) {
if (vx < 0) {
vx = vx + 3;
} else if (vx < 18) {
vx = vx + 0.5;
}
}
}
vy = vy + gravetat;
if (vy < (-boomerScroller.tamanyCuadricula)) {
vy = (-boomerScroller.tamanyCuadricula) + 1;
}
posx = posx + vx;
posy = posy + vy;
if (vx > 0) {
boomer._xscale = 100;
}
if (vx < 0) {
boomer._xscale = -100;
}
casellaActual = getCasella(posx, posy);
if (casellaActual) {
posy = casellaActual.y;
vy = 0;
if (!aTerra) {
boomer.gotoAndPlay("Camina " + estatcorrer);
}
aTerra = true;
if (victoria == true) {
fiPantalla();
}
} else {
aTerra = false;
}
var _local4 = getCasella(posx, posy + alturaBoomer);
if (_local4) {
vy = 0;
posy = ((_local4.y - boomerScroller.tamanyCuadricula) - alturaBoomer) - 1;
}
if (vx < 0) {
_local4 = getCasella(posx - ampladaBoomer, posy);
var _local3 = getCasella(posx - ampladaBoomer, posy + (alturaBoomer / 2));
var _local2 = getCasella(posx - ampladaBoomer, posy + alturaBoomer);
if ((posx - ampladaBoomer) < 0) {
vx = 0;
posx = ampladaBoomer;
}
if (_local4) {
vx = 0;
posx = (_local4.x + boomerScroller.tamanyCuadricula) + ampladaBoomer;
}
if (_local3) {
vx = 0;
posx = (_local3.x + boomerScroller.tamanyCuadricula) + ampladaBoomer;
}
if (_local2) {
vx = 0;
posx = (_local2.x + boomerScroller.tamanyCuadricula) + ampladaBoomer;
}
}
if (vx > 0) {
_local4 = getCasella(posx + ampladaBoomer, posy);
var _local3 = getCasella(posx + ampladaBoomer, posy + (alturaBoomer / 2));
var _local2 = getCasella(posx + ampladaBoomer, posy + alturaBoomer);
if ((posx + ampladaBoomer) > (game.llargada * boomerScroller.tamanyCuadricula)) {
vx = 0;
posx = (game.llargada * boomerScroller.tamanyCuadricula) - ampladaBoomer;
}
if (_local4) {
vx = 0;
posx = _local4.x - ampladaBoomer;
}
if (_local3) {
vx = 0;
posx = _local3.x - ampladaBoomer;
}
if (_local2) {
vx = 0;
posx = _local2.x - ampladaBoomer;
}
}
}
function control() {
mouPersonatge();
casellaItem = getCasellaItem(posx, posy);
if (casellaItem && (casellaItem.agafat == false)) {
casellaItem.agafat = true;
nItems--;
marcadors.items.txt = nItems;
if (nItems == 0) {
soUltimItem.start();
} else {
soItem.start();
}
nPunts = nPunts + puntsPerItem;
_global.apuntaCrcPunts(puntsPerItem);
marcadors.punts.txt = nPunts;
}
actualitzaMotor();
var _local6 = game.getMonstrus(posx);
var _local3 = 0;
while (_local3 < _local6.length) {
var _local2 = _local6[_local3];
var _local4 = false;
var _local5 = _local2.distanciaA(posx, posy);
if (_local5 < rangDeMonstrus) {
_local2.actualitza(posx, posy);
if ((inmunitat <= 0) && (_local2.impacta(posx, posy, ampladaBoomer, alturaBoomer))) {
if ((!aTerra) && (_local2.esticASobre(posx, posy))) {
_local2.mor();
_local4 = true;
nPunts = nPunts + puntsPerMonstru;
_global.apuntaCrcPunts(puntsPerMonstru);
marcadors.punts.txt = nPunts;
} else {
perdoVida();
}
}
} else {
_local2.desactiva();
}
if (_local4) {
vy = impulsImpacte;
inmunitat = 10;
} else {
inmunitat--;
}
_local3++;
}
if (posy < -100) {
perdoVida();
}
if (posx > game.posicioBandera) {
victoria = true;
}
}
function actualitzaMotor() {
nBonus--;
if (nBonus < 0) {
nBonus = 0;
}
marcadors.bonus.txt = nBonus;
game.setCamera(posx, posy);
game.update();
game.posaSprite(boomer, posx, posy);
game.dibuixa();
}
function getCasella(x, y) {
return(game.getCasella(x, y));
}
function getCasellaItem(x, y) {
return(game.getCasellaItem(x, y));
}
function boomerMonstruCamina(scroller, canvas, library, x, y, dif) {
this.scroller = scroller;
this.canvas = canvas;
this.library = library;
this.dificultat = dif;
this.inix = x;
this.iniy = y;
this.x = x;
this.y = y;
this.moviment = 100 + (200 * Math.random());
this.vx = -1;
this.mort = false;
this.clip = null;
}
function boomerMonstruSalta(scroller, canvas, library, x, y, dif) {
this.scroller = scroller;
this.canvas = canvas;
this.library = library;
this.dificultat = dif;
this.inix = x;
this.iniy = y;
this.x = x;
this.y = y;
this.moviment = 100 + (200 * Math.random());
this.vx = 0;
this.vy = 0;
this.mort = false;
this.aTerra = true;
this.contador = 20;
this.clip = null;
}
function boomerMonstruVola(scroller, canvas, library, x, y, dif) {
this.scroller = scroller;
this.canvas = canvas;
this.library = library;
this.dificultat = dif;
this.inix = x;
this.iniy = y;
this.x = x;
this.y = y;
this.moviment = 100 + (200 * Math.random());
this.vx = -2;
this.vy = 0;
this.mort = false;
this.atacant = false;
this.contador = 50 - (3 * this.dificultat);
this.clip = null;
}
boomerScroller.prototype.genera = function () {
this.generositat = 0.1 + Math.min(0.3, this.dificultat / 20);
this.escalabilitat = 0.1 + (Math.random() * Math.min(0.4, this.dificultat / 12));
var _local3 = 0;
while (_local3 < this.llargada) {
this.altures[_local3] = 0;
_local3++;
}
this.creaTerra(0, 10, 0, true, true);
this.posaEscenari(0, 10, 1);
this.tempAltura = 0;
this.contador = 10;
var _local10 = Math.round(this.dificultat / 2) + Math.round((Math.random() * this.dificultat) / 2);
while (this.contador < (this.llargada - 20)) {
var _local5 = Math.round((_local10 * Math.random()) - (_local10 / 2));
var _local9 = this.tempAltura + _local5;
if (_local9 < 0) {
_local9 = this.tempAltura - _local5;
}
var _local2 = 1 + Math.round(10 * Math.random());
if (((!anteriorForat) && (_local2 < boomerScroller.foratMaxim)) && (Math.random() < (0.1 * this.dificultat))) {
anteriorForat = true;
} else {
if ((_local9 - alturaAnterior) > boomerScroller.saltMaxim) {
this.posaSecundari(this.contador - 2, 1, 1, (alturaAnterior + boomerScroller.saltMaxim) - boomerScroller.alturaMinima, 2);
}
duradaAnterior = _local2;
alturaAnterior = _local9;
anteriorForat = false;
this.creaTerra(this.contador, _local2, _local9);
this.posaEscenari(this.contador, _local2, _local9 + 1);
}
this.tempAltura = _local9;
this.contador = this.contador + _local2;
}
this.creaTerra(this.contador, this.llargada - this.contador, this.tempAltura, true, true);
this.posaEscenari(temp, (this.llargada - temp) - 6, this.tempAltura + 1);
this.posaBandera(this.llargada - 5, this.tempAltura + 1);
_local3 = 0;
while (_local3 < this.llargada) {
this.altures[_local3] = this.cuadricula[_local3].length || 0;
_local3++;
}
this.contador = 20;
while (this.contador < (this.llargada - 20)) {
this.contador = this.contador + Math.max(15, Math.round(Math.random() * (50 - (5 * this.dificultat))));
if (this.contador < (this.llargada - 20)) {
this.posaSecundari(this.contador, 1, 1, 0);
}
}
_local3 = 0;
while (_local3 < this.llargada) {
this.altures[_local3] = this.cuadricula[_local3].length || 0;
_local3++;
}
this.contador = 20;
var _local14 = -0.2 + (0.1 * this.dificultat);
while (this.contador < (this.llargada - 20)) {
if (Math.random() <= _local14) {
var _local13 = this.contador * boomerScroller.tamanyCuadricula;
var _local12 = Math.round((this.altures[this.contador] + 2) + (5 * Math.random())) * boomerScroller.tamanyCuadricula;
this.monstrus[this.monstrus.length] = new boomerMonstruVola(this, this.clipMonstrus, "Monstru que vola", _local13, _local12, this.dificultat);
}
this.contador = this.contador + Math.round(5 + (10 * Math.random()));
}
this.maxScrollFondo = (this.llargada * boomerScroller.tamanyCuadricula) / 5;
this.fondo = new flash.display.BitmapData(this.maxScrollFondo, this.altPantalla);
_local3 = 0;
while (_local3 < Math.ceil(this.maxScrollFondo / this.gfx.fons.width)) {
this.fondo.copyPixels(this.gfx.fons, new flash.geom.Rectangle(0, 0, this.gfx.fons.width, this.altPantalla), new flash.geom.Point(this.gfx.fons.width * _local3, 0));
_local3++;
}
this.contador = 0;
while (this.contador < this.maxScrollFondo) {
var _local13 = this.contador;
var _local4 = this.gfx.elementsFons[Math.round((this.gfx.elementsFons.length - 1) * Math.random())];
var _local11 = _local4.o;
var _local9 = _local4.y + Math.round(20 * Math.random());
var _local8 = new flash.geom.Point(_local13, (this.altPantalla - _local9) - _local11.height);
this.fondo.copyPixels(_local11, new flash.geom.Rectangle(0, 0, _local11.width, _local11.height), _local8, null, null, true);
this.contador = this.contador + (80 + Math.round(Math.random() * 100));
}
do {
this.vent = -3 + Math.round(6 * Math.random());
var nNuvols = Math.round(4 * Math.random());
} while ((Math.abs(this.vent) == 0) || (nNuvols == 0));
_local3 = 0;
while (_local3 < nNuvols) {
var _local7 = Math.round(((_local3 + 1) * this.amplePantalla) / nNuvols);
var _local6 = Math.round(-20 + ((this.altPantalla / 2) * Math.random()));
var _local11 = this.gfx.nuvols[Math.round((this.gfx.nuvols.length - 1) * Math.random())];
this.nuvols[this.nuvols.length] = {x:_local7, y:_local6, obj:_local11};
_local3++;
}
};
boomerScroller.prototype.posaSecundari = function (x, probabilitat, direccio, alt, dur) {
var _local6 = dur || (1 + Math.round(5 * Math.random()));
var _local4 = (Math.max(alt, this.altures[x]) + boomerScroller.alturaMinima) + Math.floor(Math.random() * (boomerScroller.saltMaxim - boomerScroller.alturaMinima));
var _local3 = probabilitat || 1;
var _local2 = direccio || 1;
if (Math.random() <= _local3) {
var _local7 = this.creaPlataforma(x, _local6, _local4);
this.posaSecundari(x + (((_local6 + 1) + Math.round((Math.random() * this.dificultat) / 2)) * _local2), _local3 * this.escalabilitat, _local2, _local4);
if (_local2 > 0) {
this.posaSecundari(x + (1 + (Math.round((Math.random() * this.dificultat) / 2) * (-_local2))), _local3 * this.escalabilitat, -_local2, _local4);
} else {
this.posaSecundari((x + 2) + (0 + (Math.round((Math.random() * this.dificultat) / 2) * (-_local2))), _local3 * this.escalabilitat, -_local2, _local4);
}
}
};
boomerScroller.prototype.posaEscenari = function (origen, durada, alt) {
var _local2 = origen * boomerScroller.tamanyCuadricula;
var _local4 = _local2 + (durada * boomerScroller.tamanyCuadricula);
var _local7 = alt * boomerScroller.tamanyCuadricula;
while (_local2 < _local4) {
_local2 = _local2 + (10 + Math.round(60 * Math.random()));
var _local3 = this.gfx.primerPla[Math.round((this.gfx.primerPla.length - 1) * Math.random())];
if ((_local2 + _local3.width) <= _local4) {
this.elementsEscenari[this.elementsEscenari.length] = {x:_local2, y:_local7 - Math.round(20 * Math.random()), obj:_local3};
_local2 = _local2 + _local3.width;
}
}
};
boomerScroller.prototype.posaBandera = function (posicio, alt) {
var _local2 = posicio * boomerScroller.tamanyCuadricula;
var _local3 = alt * boomerScroller.tamanyCuadricula;
var _local4 = this.gfx.bandera;
this.elementsEscenari[this.elementsEscenari.length] = {x:_local2, y:_local3, obj:_local4};
this.posicioBandera = _local2;
};
boomerScroller.prototype.creaTerra = function (xini, durada, y, senseItems, senseMonstrus) {
var _local2 = new flash.display.BitmapData(durada * boomerScroller.tamanyCuadricula, (y + 1) * boomerScroller.tamanyCuadricula);
var _local15 = xini;
while (_local15 < (xini + durada)) {
var _local13 = 0;
while (_local13 < y) {
var _local4 = this.gfx.terresSota[Math.round((this.gfx.terresSota.length - 1) * Math.random())];
this.cuadricula[_local15][_local13] = {i:_local15, j:_local13, x:_local15 * boomerScroller.tamanyCuadricula, y:(_local13 + 1) * boomerScroller.tamanyCuadricula, obj:_local4};
var _local5 = new flash.geom.Point((_local15 - xini) * boomerScroller.tamanyCuadricula, _local2.height - ((_local13 + 1) * boomerScroller.tamanyCuadricula));
_local2.copyPixels(_local4, new flash.geom.Rectangle(0, 0, boomerScroller.tamanyCuadricula, boomerScroller.tamanyCuadricula), _local5);
_local13++;
}
var _local4 = this.gfx.terres[Math.round((this.gfx.terres.length - 1) * Math.random())];
this.cuadricula[_local15][y] = {i:_local15, j:y, x:_local15 * boomerScroller.tamanyCuadricula, y:(y + 1) * boomerScroller.tamanyCuadricula, obj:_local4};
var _local5 = new flash.geom.Point((_local15 - xini) * boomerScroller.tamanyCuadricula, _local2.height - ((y + 1) * boomerScroller.tamanyCuadricula));
_local2.copyPixels(_local4, new flash.geom.Rectangle(0, 0, boomerScroller.tamanyCuadricula, boomerScroller.tamanyCuadricula), _local5);
if (((!senseItems) && (!this.cuadriculaItems[_local15][y + 1])) && (Math.random() < this.generositat)) {
this.cuadriculaItems[_local15][y + 1] = {i:_local15, j:y + 1, x:_local15 * boomerScroller.tamanyCuadricula, y:((y + 2) * boomerScroller.tamanyCuadricula) + Math.round(20 * Math.random()), obj:this.gfx.items[Math.round((this.gfx.items.length - 1) * Math.random())]};
this.items[this.items.length] = this.cuadriculaItems[_local15][y + 1];
}
_local15++;
}
this.caselles[this.caselles.length] = {i:_local15, j:y, x:xini * boomerScroller.tamanyCuadricula, y:(y + 1) * boomerScroller.tamanyCuadricula, obj:_local2, esTerra:true};
var _local10 = this.dificultat / 12;
var _local9 = this.dificultat / 14;
if ((!senseMonstrus) && (durada > 2)) {
if (Math.random() < _local10) {
this.monstrus[this.monstrus.length] = new boomerMonstruCamina(this, this.clipMonstrus, "Monstru que camina", (xini + (durada / 2)) * boomerScroller.tamanyCuadricula, (y + 1) * boomerScroller.tamanyCuadricula, this.dificultat);
}
if (Math.random() < _local9) {
this.monstrus[this.monstrus.length] = new boomerMonstruSalta(this, this.clipMonstrus, "Monstru que salta", (xini + (durada / 2)) * boomerScroller.tamanyCuadricula, (y + 1) * boomerScroller.tamanyCuadricula, this.dificultat);
}
}
};
boomerScroller.prototype.creaPlataforma = function (xini, durada, y) {
var _local9 = new flash.display.BitmapData(durada * boomerScroller.tamanyCuadricula, boomerScroller.tamanyCuadricula);
var _local8 = false;
var _local2 = xini;
while (_local2 < (xini + durada)) {
if ((!this.cuadricula[_local2][y - 1]) && (!this.cuadricula[_local2][y - 2])) {
var _local4 = this.gfx.plataformes[Math.round((this.gfx.plataformes.length - 1) * Math.random())];
this.cuadricula[_local2][y] = {i:_local2, j:y, x:_local2 * boomerScroller.tamanyCuadricula, y:(y + 1) * boomerScroller.tamanyCuadricula, obj:_local4};
var _local6 = new flash.geom.Point((_local2 - xini) * boomerScroller.tamanyCuadricula, 0);
_local9.copyPixels(_local4, new flash.geom.Rectangle(0, 0, boomerScroller.tamanyCuadricula, boomerScroller.tamanyCuadricula), _local6);
if ((!this.cuadriculaItems[_local2][y + 1]) && (Math.random() < (this.generositat * 1.5))) {
this.cuadriculaItems[_local2][y + 1] = {i:_local2, j:y + 1, x:_local2 * boomerScroller.tamanyCuadricula, y:((y + 2) * boomerScroller.tamanyCuadricula) + Math.round(20 * Math.random()), obj:this.gfx.items[Math.round((this.gfx.items.length - 1) * Math.random())]};
this.items[this.items.length] = this.cuadriculaItems[_local2][y + 1];
}
} else {
_local8 = true;
}
_local2++;
}
if (!_local8) {
this.caselles[this.caselles.length] = {i:_local2, j:y, x:xini * boomerScroller.tamanyCuadricula, y:(y + 1) * boomerScroller.tamanyCuadricula, obj:_local9, esTerra:false};
var _local11 = this.dificultat / 12;
var _local10 = this.dificultat / 14;
if ((!senseMonstrus) && (durada > 2)) {
if (Math.random() < _local11) {
this.monstrus[this.monstrus.length] = new boomerMonstruCamina(this, this.clipMonstrus, "Monstru que camina", (xini + (durada / 2)) * boomerScroller.tamanyCuadricula, (y + 1) * boomerScroller.tamanyCuadricula, this.dificultat);
}
if (Math.random() < _local10) {
this.monstrus[this.monstrus.length] = new boomerMonstruSalta(this, this.clipMonstrus, "Monstru que salta", (xini + (durada / 2)) * boomerScroller.tamanyCuadricula, (y + 1) * boomerScroller.tamanyCuadricula, this.dificultat);
}
}
} else {
_local2 = xini;
while (_local2 < (xini + durada)) {
this.cuadricula[_local2][y] = null;
if (this.cuadriculaItems[_local2][y + 1]) {
this.cuadriculaItems[_local2][y + 1] = null;
this.items.length--;
}
_local2++;
}
}
return(_local8);
};
boomerScroller.prototype.getCasella = function (x, y) {
var _local3 = Math.floor(x / boomerScroller.tamanyCuadricula);
var _local2 = Math.floor(y / boomerScroller.tamanyCuadricula);
return(this.cuadricula[_local3][_local2]);
};
boomerScroller.prototype.getAltura = function (x, y) {
var _local2 = Math.floor(x / boomerScroller.tamanyCuadricula);
return(this.altures[_local2]);
};
boomerScroller.prototype.getCasellaItem = function (x, y) {
var _local3 = Math.floor(x / boomerScroller.tamanyCuadricula);
var _local2 = Math.floor(y / boomerScroller.tamanyCuadricula);
return(this.cuadriculaItems[_local3][_local2]);
};
boomerScroller.prototype.getMonstrus = function (x) {
var _local2 = Math.floor(x / (10 * boomerScroller.tamanyCuadricula));
return(this.zonesMonstru[_local2]);
};
boomerScroller.prototype.setCamera = function (x, y) {
this.camerax = x;
this.cameray = y;
this.viewport = new flash.geom.Rectangle(x - (this.amplePantalla / 2), y - (this.altPantalla / 2), this.amplePantalla, this.altPantalla);
if (this.viewport.left < 0) {
this.viewport.offset(-this.viewport.left, 0);
}
if (this.viewport.top < 0) {
this.viewport.offset(0, -this.viewport.top);
}
if (this.viewport.right > (this.llargada * boomerScroller.tamanyCuadricula)) {
this.viewport.offset(-(this.viewport.right - (this.llargada * boomerScroller.tamanyCuadricula)), 0);
}
if (this.viewport.bottom > (this.altura * boomerScroller.tamanyCuadricula)) {
this.viewport.offset(0, -(this.viewport.bottom - (this.altura * boomerScroller.tamanyCuadricula)), 0);
}
this.camerax = this.viewport.left + (this.viewport.width / 2);
this.cameray = this.viewport.top + (this.viewport.height / 2);
};
boomerScroller.prototype.posaSprite = function (mc, x, y) {
var _local2 = new flash.geom.Point(x - this.viewport.left, this.altPantalla - (y - this.viewport.top));
mc._x = _local2.x;
mc._y = _local2.y;
};
boomerScroller.prototype.update = function () {
this.buffer.copyPixels(this.fondo, new flash.geom.Rectangle(this.camerax / 15, 0, this.amplePantalla, this.altPantalla), new flash.geom.Point());
var _local6 = 0;
while (_local6 < this.nuvols.length) {
var _local2 = this.nuvols[_local6];
_local2.x = _local2.x + this.vent;
if ((this.vent > 0) && (_local2.x > this.amplePantalla)) {
_local2.x = (-_local2.obj.width) - 100;
}
if ((this.vent < 0) && (_local2.x < (-_local2.obj.width))) {
_local2.x = this.amplePantalla + 100;
}
var _local7 = new flash.geom.Point(_local2.x, _local2.y);
this.buffer.copyPixels(_local2.obj, new flash.geom.Rectangle(0, 0, _local2.obj.width, _local2.obj.height), _local7, null, null, true);
_local6++;
}
while ((this.primerEscenari > 0) && (this.elementsEscenari[this.primerEscenari].x >= (this.viewport.left - this.elementsEscenari[this.primerEscenari].obj.width))) {
this.primerEscenari--;
}
while ((this.primerEscenari < (this.elementsEscenari.length - 1)) && (this.elementsEscenari[this.primerEscenari].x < (this.viewport.left - this.elementsEscenari[this.primerEscenari].obj.width))) {
this.primerEscenari++;
}
_local6 = this.primerEscenari;
while ((_local6 < this.elementsEscenari.length) && (this.elementsEscenari[_local6].x < this.viewport.right)) {
var _local4 = this.elementsEscenari[_local6];
var _local8 = new flash.geom.Rectangle(_local4.x, _local4.y, _local4.obj.width, _local4.obj.height);
if (this.viewport.intersects(_local8)) {
var _local7 = new flash.geom.Point(_local4.x - this.viewport.left, (this.altPantalla - (_local4.y - this.viewport.top)) - _local4.obj.height);
this.buffer.copyPixels(_local4.obj, new flash.geom.Rectangle(0, 0, _local4.obj.width, _local4.obj.height), _local7, null, null, true);
}
_local6++;
}
this.animacioItems++;
if (this.animacioItems >= this.gfx.nItems) {
this.animacioItems = 0;
}
while ((this.primer_item > 0) && (this.items[this.primer_item].x >= (this.viewport.left - boomerScroller.tamanyCuadricula))) {
this.primer_item--;
}
while ((this.primer_item < (this.items.length - 1)) && (this.items[this.primer_item].x < (this.viewport.left - boomerScroller.tamanyCuadricula))) {
this.primer_item++;
}
_local6 = this.primer_item;
while ((_local6 < this.items.length) && (this.items[_local6].x < this.viewport.right)) {
var _local5 = this.items[_local6];
var _local8 = new flash.geom.Rectangle(_local5.x, _local5.y - boomerScroller.tamanyCuadricula, boomerScroller.tamanyCuadricula, boomerScroller.tamanyCuadricula);
if ((_local5.agafat == false) && (this.viewport.intersects(_local8))) {
var _local7 = new flash.geom.Point(_local5.x - this.viewport.left, this.altPantalla - (_local5.y - this.viewport.top));
this.buffer.copyPixels(this.gfx.bombolla, new flash.geom.Rectangle(0, 0, boomerScroller.tamanyCuadricula, boomerScroller.tamanyCuadricula), _local7, null, null, true);
this.buffer.copyPixels(_local5.obj[this.animacioItems], new flash.geom.Rectangle(0, 0, boomerScroller.tamanyCuadricula, boomerScroller.tamanyCuadricula), _local7, null, null, true);
}
_local6++;
}
while ((this.primera_casella > 0) && ((!this.caselles[this.primera_casella].esTerra) || (this.caselles[this.primera_casella].x >= (this.viewport.left - this.caselles[this.primera_casella].obj.width)))) {
this.primera_casella--;
}
while ((this.primera_casella < (this.caselles.length - 1)) && (this.caselles[this.primera_casella].x < (this.viewport.left - this.caselles[this.primera_casella].obj.width))) {
this.primera_casella++;
}
_local6 = this.primera_casella;
while ((_local6 < this.caselles.length) && (this.caselles[_local6].x < this.viewport.right)) {
var _local3 = this.caselles[_local6];
var _local8 = new flash.geom.Rectangle(_local3.x, _local3.y - _local3.obj.height, _local3.obj.width, _local3.obj.height);
if (this.viewport.intersects(_local8)) {
var _local7 = new flash.geom.Point(_local3.x - this.viewport.left, this.altPantalla - (_local3.y - this.viewport.top));
this.buffer.copyPixels(_local3.obj, new flash.geom.Rectangle(0, 0, _local3.obj.width, _local3.obj.height), _local7);
}
_local6++;
}
};
boomerScroller.prototype.dibuixa = function () {
this.pantalla.copyPixels(this.buffer, new flash.geom.Rectangle(0, 0, this.amplePantalla, this.altPantalla), new flash.geom.Point(0, 0));
};
boomerScroller.tamanyCuadricula = 54;
boomerScroller.llargadaMinima = 160;
boomerScroller.llargadaMaxima = 250;
boomerScroller.alturaMaxima = 30;
boomerScroller.foratMaxim = 8;
boomerScroller.saltMaxim = 4;
boomerScroller.alturaMinima = 3;
var gfx_dia = new boomerScrollerGFX("dia_fons", ["dia_terra1", "dia_terra2"], ["dia_terra1sota", "dia_terra2sota"], ["dia_plataforma"], ["dia_raig", "dia_nubolfons1", "dia_nubolfons2", "dia_nubolfons3"], ["dia_muntanyapetita", "dia_muntanyamitjana", "dia_muntanyagran", "dia_muntanya", "dia_valla", "dia_valla"], ["dia_nubolgran", "dia_nubolpetit"], "bandera", [["item1_1", "item1_1", "item1_1", "item1_1", "item1_2", "item1_2", "item1_2", "item1_2", "item1_3", "item1_3", "item1_3", "item1_3", "item1_4", "item1_4", "item1_4", "item1_4"], ["item2_1", "item2_1", "item2_1", "item2_1", "item2_2", "item2_2", "item2_2", "item2_2", "item2_3", "item2_3", "item2_3", "item2_3", "item2_4", "item2_4", "item2_4", "item2_4"], ["item3_1", "item3_1", "item3_1", "item3_1", "item3_2", "item3_2", "item3_2", "item3_2", "item3_3", "item3_3", "item3_3", "item3_3", "item3_4", "item3_4", "item3_4", "item3_4"]], "bombolla", "bommusica1");
var gfx_psi = new boomerScrollerGFX("psi_fons", ["psi_terra1", "psi_terra2", "psi_terra3"], ["psi_terra1", "psi_terra2", "psi_terra3"], ["psi_terra1", "psi_terra2", "psi_terra3"], [{o:"psi_planetagros", y:100}, {o:"psi_muntanya1", y:50}, {o:"psi_muntanya2", y:50}, {o:"psi_muntanya3", y:50}, {o:"psi_planetamitja", y:150}, {o:"psi_planetapetit", y:170}, {o:"psi_muntanya1", y:50}, {o:"psi_muntanya2", y:50}, {o:"psi_muntanya3", y:50}, {o:"psi_planetamitja", y:150}, {o:"psi_planetapetit", y:170}, {o:"psi_muntanya1", y:50}, {o:"psi_muntanya2", y:50}, {o:"psi_muntanya3", y:50}, {o:"psi_planetamitja", y:150}, {o:"psi_planetapetit", y:170}], ["psi_basto1", "psi_basto2", "psi_basto3", "psi_basto4", "psi_basto5"], ["psi_sol", "psi_solpetit"], "bandera", [["item1_1", "item1_1", "item1_1", "item1_1", "item1_2", "item1_2", "item1_2", "item1_2", "item1_3", "item1_3", "item1_3", "item1_3", "item1_4", "item1_4", "item1_4", "item1_4"], ["item2_1", "item2_1", "item2_1", "item2_1", "item2_2", "item2_2", "item2_2", "item2_2", "item2_3", "item2_3", "item2_3", "item2_3", "item2_4", "item2_4", "item2_4", "item2_4"], ["item3_1", "item3_1", "item3_1", "item3_1", "item3_2", "item3_2", "item3_2", "item3_2", "item3_3", "item3_3", "item3_3", "item3_3", "item3_4", "item3_4", "item3_4", "item3_4"]], "bombolla3", "bommusica2");
var gfx_nit = new boomerScrollerGFX("nit_fons", ["nit_terra"], ["nit_terrasota"], ["nit_plataforma"], [""], ["nit_valla", "nit_arbre", "nit_arbre2", "nit_lapida"], ["nit_nubolgran", "nit_nubolpetit"], "bandera", [["item1_1", "item1_1", "item1_1", "item1_1", "item1_2", "item1_2", "item1_2", "item1_2", "item1_3", "item1_3", "item1_3", "item1_3", "item1_4", "item1_4", "item1_4", "item1_4"], ["item2_1", "item2_1", "item2_1", "item2_1", "item2_2", "item2_2", "item2_2", "item2_2", "item2_3", "item2_3", "item2_3", "item2_3", "item2_4", "item2_4", "item2_4", "item2_4"], ["item3_1", "item3_1", "item3_1", "item3_1", "item3_2", "item3_2", "item3_2", "item3_2", "item3_3", "item3_3", "item3_3", "item3_3", "item3_4", "item3_4", "item3_4", "item3_4"]], "bombolla2", "bommusica3");
var pantalla = (new flash.display.BitmapData(760, 440, false));
canvas.attachBitmap(pantalla, 2, "auto", false);
canvas.createEmptyMovieClip("monstrus", 3);
canvas.createEmptyMovieClip("audiosalt", 10);
canvas.createEmptyMovieClip("audioExit", 11);
canvas.createEmptyMovieClip("audioExit2", 12);
canvas.createEmptyMovieClip("audioMort", 13);
canvas.createEmptyMovieClip("audioMusiques", 14);
soSalt = new Sound(canvas.audiosalt);
soSalt.attachSound("salt");
soItem = new Sound(canvas.audioExit);
soItem.attachSound("unItem");
soUltimItem = new Sound(canvas.audioExit2);
soUltimItem.attachSound("ultimItem");
soMort = new Sound(canvas.audioMort);
soMort.attachSound("muerte");
var gravetat = -1.5;
var potenciaSalt = 25;
var inerciaSalt = 0.11;
var ampladaBoomer = 20;
var alturaBoomer = 70;
var frenada = 0.4;
var puntsPerItem = 2;
var bonusPerItems = 250;
var nivellsPerMon = 3;
var rangDeMonstrus = 500;
var impulsImpacte = 10;
var puntsPerMonstru = 15;
var puntsPerNivell = 150;
iniJoc();
boomerMonstruCamina.prototype.distanciaA = function (x, y) {
return(Math.sqrt(((x - this.x) * (x - this.x)) + ((y - this.y) * (y - this.y))));
};
boomerMonstruCamina.prototype.actualitza = function () {
if (this.clip == null) {
if (this.mort) {
return(undefined);
}
var _local2 = this.canvas.getNextHighestDepth();
this.canvas.attachMovie(this.library, "m_" + _local2, _local2);
this.clip = this.canvas["m_" + _local2];
if (this.vx > 0) {
this.clip._xscale = -100;
} else {
this.clip._xscale = 100;
}
}
if (!this.mort) {
this.x = this.x + this.vx;
if (this.vx > 0) {
var _local4 = this.scroller.getCasella(this.x + (this.clip._width / 2), this.y + 10);
var _local3 = this.scroller.getCasella(this.x + (this.clip._width / 2), this.y - 10);
if ((((this.x - this.inix) > this.moviment) || (_local4)) || (!_local3)) {
this.vx = this.vx * -1;
this.clip._xscale = 100;
}
}
if (this.vx < 0) {
var _local4 = this.scroller.getCasella(this.x - (this.clip._width / 2), this.y + 10);
var _local3 = this.scroller.getCasella(this.x - (this.clip._width / 2), this.y - 10);
if ((((this.x - this.inix) < (-this.moviment)) || (_local4)) || (!_local3)) {
this.vx = this.vx * -1;
this.clip._xscale = -100;
}
}
}
this.scroller.posaSprite(this.clip, this.x, this.y);
};
boomerMonstruCamina.prototype.impacta = function (x, y, amplada, altura) {
var _local3 = new flash.geom.Rectangle(x - (amplada / 2), y, amplada, altura);
var _local2 = new flash.geom.Rectangle(this.x - (this.clip._width / 2), this.y, this.clip._width, this.clip._height);
return((!this.mort) && (_local3.intersects(_local2)));
};
boomerMonstruCamina.prototype.esticASobre = function (x, y) {
return(y > this.y);
};
boomerMonstruCamina.prototype.mor = function () {
this.mort = true;
this.clip.gotoAndPlay("Mort");
};
boomerMonstruCamina.prototype.desactiva = function () {
this.clip.removeMovieClip();
this.clip = null;
};
boomerMonstruSalta.prototype.distanciaA = function (x, y) {
return(Math.sqrt(((x - this.x) * (x - this.x)) + ((y - this.y) * (y - this.y))));
};
boomerMonstruSalta.prototype.actualitza = function () {
if (this.clip == null) {
if (this.mort) {
return(undefined);
}
var _local2 = this.canvas.getNextHighestDepth();
this.canvas.attachMovie(this.library, "m_" + _local2, _local2);
this.clip = this.canvas["m_" + _local2];
this.clip.gotoAndStop("Repos");
}
if (!this.mort) {
if (this.aTerra) {
this.contador--;
if (this.contador == 1) {
this.clip.gotoAndPlay("Salta");
}
if (this.contador == 0) {
this.vy = 10 + (15 * Math.random());
this.vx = -5 + (10 * Math.random());
this.aTerra = false;
this.clip.gotoAndPlay("Salta");
}
}
this.vy = this.vy + gravetat;
if (this.vy < (-boomerScroller.tamanyCuadricula)) {
this.vy = (-boomerScroller.tamanyCuadricula) + 1;
}
this.x = this.x + this.vx;
this.y = this.y + this.vy;
casellaActual = this.scroller.getCasella(this.x, this.y);
if (casellaActual) {
this.y = casellaActual.y;
this.vy = 0;
if (!this.aTerra) {
this.clip.gotoAndPlay("Baixa");
this.vx = 0;
this.contador = 40 - (2 * this.dificultat);
}
this.aTerra = true;
} else {
this.aTerra = false;
}
var _local5 = this.scroller.getCasella(this.x, this.y + this.clip._height);
if (_local5) {
this.vy = 0;
this.y = ((_local5.y - boomerScroller.tamanyCuadricula) - this.clip._height) - 1;
}
if (this.vx < 0) {
_local5 = this.scroller.getCasella(this.x - this.clip._width, this.y);
var _local4 = this.scroller.getCasella(this.x - this.clip._width, this.y + (this.clip._height / 2));
var _local3 = this.scroller.getCasella(this.x - this.clip._width, this.y + this.clip._height);
if ((this.x - this.clip._width) < 0) {
this.vx = this.vx * -1;
this.x = this.clip._width;
}
if (_local5) {
this.vx = this.vx * -1;
this.x = (_local5.x + boomerScroller.tamanyCuadricula) + this.clip._width;
}
if (_local4) {
this.vx = this.vx * -1;
this.x = (_local4.x + boomerScroller.tamanyCuadricula) + this.clip._width;
}
if (_local3) {
this.vx = this.vx * -1;
this.x = (_local3.x + boomerScroller.tamanyCuadricula) + this.clip._width;
}
if (this.scroller.getAltura(this.x - this.clip._width) <= 0) {
this.vx = this.vx * -1;
}
}
if (this.vx > 0) {
_local5 = this.scroller.getCasella(this.x + this.clip._width, this.y);
var _local4 = this.scroller.getCasella(this.x + this.clip._width, this.y + (this.clip._height / 2));
var _local3 = this.scroller.getCasella(this.x + this.clip._width, this.y + this.clip._height);
if ((this.x + this.clip._width) > (this.scroller.llargada * boomerScroller.tamanyCuadricula)) {
this.vx = this.vx * -1;
this.x = (this.scroller.llargada * boomerScroller.tamanyCuadricula) - this.clip._width;
}
if (_local5) {
this.vx = this.vx * -1;
this.x = _local5.x - this.clip._width;
}
if (_local4) {
this.vx = this.vx * -1;
this.x = _local4.x - this.clip._width;
}
if (_local3) {
this.vx = this.vx * -1;
this.x = _local3.x - this.clip._width;
}
if (this.scroller.getAltura(this.x + this.clip._width) <= 0) {
this.vx = this.vx * -1;
}
}
}
this.scroller.posaSprite(this.clip, this.x, this.y);
};
boomerMonstruSalta.prototype.impacta = function (x, y, amplada, altura) {
var _local3 = new flash.geom.Rectangle(x - (amplada / 2), y, amplada, altura);
var _local2 = new flash.geom.Rectangle(this.x - (this.clip._width / 2), this.y, this.clip._width, this.clip._height);
return((!this.mort) && (_local3.intersects(_local2)));
};
boomerMonstruSalta.prototype.esticASobre = function (x, y) {
return(y > (this.y - 30));
};
boomerMonstruSalta.prototype.mor = function () {
this.mort = true;
this.clip.gotoAndPlay("Mort");
};
boomerMonstruSalta.prototype.desactiva = function () {
this.clip.removeMovieClip();
this.clip = null;
};
boomerMonstruVola.prototype.distanciaA = function (x, y) {
return(Math.sqrt(((x - this.x) * (x - this.x)) + ((y - this.y) * (y - this.y))));
};
boomerMonstruVola.prototype.actualitza = function (posx, py) {
var _local4 = (py + alturaBoomer) - 20;
if (this.clip == null) {
if (this.mort) {
return(undefined);
}
var _local3 = this.canvas.getNextHighestDepth();
this.canvas.attachMovie(this.library, "m_" + _local3, _local3);
this.clip = this.canvas["m_" + _local3];
if (this.vx > 0) {
this.clip._xscale = -100;
} else {
this.clip._xscale = 100;
}
}
if (!this.mort) {
if (!this.atacant) {
this.x = this.x + this.vx;
if (this.vx > 0) {
if ((this.x - this.inix) > this.moviment) {
this.vx = this.vx * -1;
this.clip._xscale = 100;
}
}
if (this.vx < 0) {
if ((this.x - this.inix) < (-this.moviment)) {
this.vx = this.vx * -1;
this.clip._xscale = -100;
}
}
if ((((this.vx > 0) && ((posx - this.x) < 100)) && ((posx - this.x) > 0)) || (((this.vx < 0) && ((posx - this.x) > -100)) && ((posx - this.x) < 0))) {
this.contador--;
if (this.contador >= 0) {
this.atacant = true;
this.tornant = false;
this.desty = _local4;
this.destx = posx;
this.clip.gotoAndPlay("Ataca");
this.contador = 50 - (3 * this.dificultat);
}
}
} else if (!this.tornant) {
this.y = this.y + ((this.desty - this.y) / 12);
this.x = this.x + ((this.destx - this.x) / 10);
if (Math.abs(this.desty - this.y) < 2) {
this.tornant = true;
this.clip.gotoAndPlay("Vola");
}
} else {
this.y = this.y + 3;
this.x = this.x + ((this.destx - this.x) / 10);
if (this.y > this.iniy) {
this.y = this.iniy;
this.tornant = false;
this.atacant = false;
}
}
}
this.scroller.posaSprite(this.clip, this.x, this.y);
};
boomerMonstruVola.prototype.impacta = function (x, y, amplada, altura) {
var _local3 = new flash.geom.Rectangle(x - (amplada / 2), y, amplada, altura);
var _local2 = new flash.geom.Rectangle(this.x - (this.clip._width / 2), this.y, this.clip._width, this.clip._height);
return((!this.mort) && (_local3.intersects(_local2)));
};
boomerMonstruVola.prototype.esticASobre = function (x, y) {
return(y > this.y);
};
boomerMonstruVola.prototype.mor = function () {
this.mort = true;
this.clip.gotoAndPlay("Mort");
};
boomerMonstruVola.prototype.desactiva = function () {
this.clip.removeMovieClip();
this.clip = null;
};
stop();
Frame 36
_quality = "high";
stop();
Symbol 11 MovieClip [Monstru que vola] Frame 9
gotoAndPlay ("Vola");
Symbol 11 MovieClip [Monstru que vola] Frame 18
stop();
Symbol 11 MovieClip [Monstru que vola] Frame 29
stop();
Symbol 22 MovieClip [Monstru que salta] Frame 4
stop();
Symbol 22 MovieClip [Monstru que salta] Frame 12
stop();
Symbol 22 MovieClip [Monstru que salta] Frame 25
stop();
Symbol 29 MovieClip [Monstru que camina] Frame 13
gotoAndPlay (1);
Symbol 29 MovieClip [Monstru que camina] Frame 24
stop();
Symbol 49 MovieClip Frame 1
function setPercent(p) {
mascara._xscale = 100 * p;
}
setPercent(0);
Symbol 49 MovieClip Frame 160
gotoAndPlay (2);
Symbol 157 MovieClip [personatge] Frame 1
stop();
Symbol 157 MovieClip [personatge] Frame 15
gotoAndPlay ("Camina 1");
Symbol 157 MovieClip [personatge] Frame 30
gotoAndPlay ("Camina 2");
Symbol 157 MovieClip [personatge] Frame 34
gotoAndPlay ("Camina 3");
Symbol 157 MovieClip [personatge] Frame 43
stop();
Symbol 157 MovieClip [personatge] Frame 51
gotoAndPlay ("s3 loop");
Symbol 157 MovieClip [personatge] Frame 55
gotoAndPlay ("Camina 3");
Symbol 157 MovieClip [personatge] Frame 65
gotoAndPlay ("Victoria");
Symbol 157 MovieClip [personatge] Frame 77
gotoAndPlay ("Mort");
Symbol 168 MovieClip Frame 1
stop();
Symbol 175 Button
on (release) {
_parent.gotoAndPlay("Partida");
}
Symbol 179 Button
on (release) {
_parent.gotoAndPlay("Instrucciones");
}
Symbol 182 MovieClip Frame 1
stop();
Symbol 182 MovieClip Frame 2
_parent.play();
stop();
Symbol 193 Button
on (release) {
play();
}
Symbol 209 MovieClip Frame 29
stop();
Symbol 209 MovieClip Frame 43
_parent.gotoAndPlay("Home");
stop();
Symbol 215 MovieClip Frame 1
txt = (txt2 = _parent._parent.nMon);
Symbol 221 MovieClip Frame 1
txt = (txt2 = _parent._parent.nNivell);
Symbol 222 MovieClip Frame 1
stop();
Symbol 222 MovieClip Frame 82
stop();
Symbol 230 MovieClip Frame 1
stop();
Symbol 230 MovieClip Frame 130
stop();
Symbol 233 MovieClip Frame 1
stop();
Symbol 233 MovieClip Frame 130
stop();
Symbol 236 MovieClip Frame 1
stop();
Symbol 236 MovieClip Frame 130
stop();
Symbol 247 MovieClip Frame 1
tpuntos = _parent._parent.record;
Symbol 261 MovieClip Frame 1
txt = (txt2 = _parent._parent._parent.puntsPerNivell);
Symbol 267 MovieClip Frame 1
txt = (txt2 = _parent._parent.bonusCompleto);
Symbol 272 MovieClip Frame 1
txt = (txt2 = _parent._parent.nBonus);
Symbol 277 MovieClip Frame 1
stop();
Symbol 288 MovieClip Frame 1
if (_parent._parent.nPunts >= _parent._parent.record) {
gotoAndPlay ("record");
} else {
gotoAndPlay ("normal");
}
Symbol 288 MovieClip Frame 2
punts = "PUNTOS: " + _parent._parent.nPunts;
record = "R\u00C9CORD: " + _parent._parent.record;
stop();
Symbol 288 MovieClip Frame 9
txt = "NUEVO R\u00C9CORD: " + _parent._parent.nPunts;
_parent._parent.record = _parent._parent.nPunts;
stop();
Symbol 295 Button
on (press) {
_parent.gotoAndStop("Home");
}
Symbol 297 MovieClip Frame 22
stop();