Frame 1
MochiAd.showPreGameAd({id:"3d7e7506e3a79e91", res:"600x550"});
Frame 3
Frame 5
function __com_mochibot__(swfid, mc, lv, trk) {
var x;
var g;
var s;
var fv;
var sb;
var u;
var res;
var mb;
var mbc;
mb = "__mochibot__";
mbc = "mochibot.com";
g = (_global ? (_global) : (_level0._root));
if (g[mb + swfid]) {
return(g[mb + swfid]);
}
s = System.security;
x = mc._root.getSWFVersion;
fv = (x ? (mc.getSWFVersion()) : ((_global ? 6 : 5)));
if (!s) {
s = {};
}
sb = s.sandboxType;
if (sb == "localWithFile") {
return(null);
}
x = s.allowDomain;
if (x) {
s.allowDomain(mbc);
}
x = s.allowInsecureDomain;
if (x) {
s.allowInsecureDomain(mbc);
}
u = (((((((((((("http://" + mbc) + "/my/core.swf?mv=7&fv=") + fv) + "&v=") + escape(getVersion())) + "&swfid=") + escape(swfid)) + "&l=") + lv) + "&f=") + mc) + (sb ? ("&sb=" + sb) : "")) + (trk ? "&t=1" : "");
lv = ((fv > 6) ? (mc.getNextHighestDepth()) : ((g[mb + "level"] ? (g[mb + "level"] + 1) : (lv))));
g[mb + "level"] = lv;
if (fv == 5) {
res = "_level" + lv;
if (!eval (res)) {
loadMovieNum (u, lv);
}
} else {
res = mc.createEmptyMovieClip(mb + swfid, lv);
res.loadMovie(u);
}
return(res);
}
__com_mochibot__("8e5c533a", this, 10301, true);
Frame 17
yipc_count = 1;
var introSound = new Sound();
introSound.attachSound("logoIntroSong");
introSound.start();
Frame 19
_root[yipc_count].play();
yipc_count++;
Frame 20
if (yipc_count == 270) {
delete introSound;
gotoAndStop ("game");
} else {
gotoAndPlay ("looper");
}
Frame 33
function arraySet() {
_root.arrayintro = undefined;
_root.arrayoutro = 1;
_root.arraySpeed = 0.25;
_root.arraySelTamanho = 6;
}
function fargrndmove() {
if (this._y >= 1199) {
this._y = 600;
} else {
this._y = this._y + 1;
}
}
function bckgrndmove() {
if (this._y >= 1198) {
this._y = 600;
} else {
this._y = this._y + 2;
}
}
function setupJogo() {
Mouse.hide();
_root.startScreen._visible = false;
_root.attachMovie("introScreen", "screen", 1000);
_root.screen._x = 0;
_root.screen._y = 0;
_root.musicnm = ("musica" + fase) + "_snd";
_root[musicnm].start(0, 9999);
_root.menu._visible = true;
_root.menu.swapDepths(100);
_root.menu.balaScreen.attachMovie("balaImg", "balaImg", 1);
_root.menu.amigoScreen.attachMovie("amigoImg", "amigoImg", 1);
_root.menu.mudar = function () {
this.pontos_txt.text = pontos;
this.fase_txt.text = fase;
this.vidaImg.gotoAndStop(naveLife + 1);
this.balaImg.gotoAndStop(balaTipo);
this.rocketImg.gotoAndStop(rocketTipo + 1);
this.speedImg.gotoAndStop((naveSpeed - origNaveSpeed) + 1);
if (amigoMeteorz == false) {
this.meteorzImg.gotoAndStop(1);
} else if (amigoMeteorz == true) {
this.meteorzImg.gotoAndStop(2);
}
if (amigoHitmanjoe == false) {
this.hitmanjoeImg.gotoAndStop(1);
} else if (amigoHitmanjoe == true) {
this.hitmanjoeImg.gotoAndStop(2);
}
if (amigoKanguru == false) {
this.kanguruImg.gotoAndStop(1);
} else if (amigoKanguru == true) {
this.kanguruImg.gotoAndStop(2);
}
};
_root.menu.mudar();
_root.createEmptyMovieClip("playerLayer", 10);
_root.createEmptyMovieClip("balaLayer", 9);
_root.createEmptyMovieClip("enemyLayer", 8);
_root.enemyLayer.check = true;
_root.createEmptyMovieClip("bonusLayer", 7);
_root.createEmptyMovieClip("bckgrndLayer", 1);
_root.playerLayer.attachMovie("nave", "nave", 1);
_root.playerLayer.nave._x = Stage.width / 2;
_root.playerLayer.nave._y = (Stage.height / 3) * 2;
_root.playerLayer.nave.onEnterFrame = naveAction;
clearInterval(_root.arrInt);
_root.arrInt = setInterval(faseBuilder, faseMonstroFreq);
fargrndnm = "farground" + fase;
_root.bckgrndLayer.attachMovie(fargrndnm, "fargrnd", 1);
_root.bckgrndLayer.fargrnd._x = 0;
_root.bckgrndLayer.fargrnd._y = 600;
_root.bckgrndLayer.fargrnd.onEnterFrame = fargrndmove;
bckgrndnm = "background" + fase;
_root.bckgrndLayer.attachMovie(bckgrndnm, "bckgrnd", 10);
_root.bckgrndLayer.bckgrnd._x = 0;
_root.bckgrndLayer.bckgrnd._y = 600;
_root.bckgrndLayer.bckgrnd.onEnterFrame = bckgrndmove;
}
function gameOver() {
stopAllSounds();
_root.musicaGameOver_snd.start();
delete _root.playerLayer.nave.onEnterFrame;
_root.enemyLayer.removeMovieClip();
_root.bckgrndLayer.removeMovieClip();
_root.bonusLayer.removeMovieClip();
_root.balaLayer.removeMovieClip();
clearInterval(_root.arrInt);
_root.attachMovie("gameOverScreen", "screen", 1000);
_root.screen._x = 0;
_root.screen._y = 0;
}
function unloadJogo() {
Mouse.show();
stopAllSounds();
delete menu.onEnterFrame;
_root.screen.removeMovieClip();
delete bckgrndLayer.fargrnd.onEnterFrame;
bckgrndLayer.fargrnd.removeMovieClip();
delete bckgrndLayer.bckgrnd.onEnterFrame;
bckgrndLayer.bckgrnd.removeMovieClip();
clearInterval(arrInt);
delete playerLayer.nave.onEnterFrame;
playerLayer.removeMovieClip();
balaLayer.removeMovieClip();
enemyLayer.removeMovieClip();
bonusLayer.removeMovieClip();
bckgrndLayer.removeMovieClip();
menu._visible = false;
startScreen._visible = true;
startScreen.gotoAndStop(1);
pontos = 0;
fase = 1;
naveLife = origNaveLife;
naveContinues = 3;
naveSpeed = origNaveSpeed;
balaTipo = 1;
balaFreq = origBalaFreq;
rocketTipo = (oldRocketTipo = 0);
amigoMeteorz = false;
amigoHitmanjoe = false;
amigoKanguru = false;
pontos_boni_div = pontos_boni_orig;
arraySet();
enemyVSbossCnt = 0;
}
function finalDaFase() {
puxarCnt = 0;
_root.createEmptyMovieClip("ffcounter", 4375);
_root.ffcounter.onEnterFrame = function () {
if (puxarCnt == 180) {
delete _root.ffcounter.onEnterFrame;
_root.ffcounter.removeMovieClip();
if (fase == faseMax) {
finalDoJogo();
} else {
_root.passarDeFase();
}
} else if (puxarCnt >= 90) {
if (puxarCnt == 90) {
delete _root.playerLayer.nave.onEnterFrame;
}
_root.playerLayer.nave._y = _root.playerLayer.nave._y - 6;
if (_root.playerLayer.nave._x < ((stagex / 2) - 10)) {
_root.playerLayer.nave._x = _root.playerLayer.nave._x + 6;
} else if (_root.playerLayer.nave._x > ((stagex / 2) + 10)) {
_root.playerLayer.nave._x = _root.playerLayer.nave._x - 6;
}
}
puxarCnt++;
};
}
function passarDeFase() {
_root.salvar();
Mouse.show();
_root.arraySet();
stopAllSounds();
_root.musicaTema_snd.start(0, 16);
delete _root.playerLayer.nave.onEnterFrame;
_root.enemyLayer.removeMovieClip();
_root.bckgrndLayer.removeMovieClip();
_root.bonusLayer.removeMovieClip();
_root.balaLayer.removeMovieClip();
clearInterval(_root.arrInt);
_root.attachMovie("passarDeFase", "screen", 1000);
_root.screen._x = 0;
_root.screen._y = 0;
_root.screen.button.onRelease = function () {
_root.musicaTema_snd.stop();
_root.mudarDeFase();
};
_root.screen.pode = true;
_root.screen.onEnterFrame = function () {
if (Key.isDown(13)) {
if (this.pode == true) {
_root.musicaTema_snd.stop();
_root.mudarDeFase();
delete this.onEnterFrame;
}
this.pode = false;
} else {
this.pode = true;
}
};
}
function mudarDeFase() {
Mouse.hide();
_root.naveLife = origNaveLife;
_root.screen.removeMovieClip();
_root.fase++;
_root.faseMonstroFreq = _root.faseMonstroFreq - 15;
_root.pontos_boni_div = _root.pontos_boni_orig;
_root.pontos_boni_div = _root.pontos_boni_div + 30;
_root.arraySet();
enemyVSbossCnt = 0;
if (balaTipo < fase) {
balaTipo = fase;
}
musicnm = ("musica" + fase) + "_snd";
_root[musicnm].start(0, 9999);
_root.createEmptyMovieClip("balaLayer", 9);
_root.createEmptyMovieClip("enemyLayer", 8);
_root.enemyLayer.check = true;
_root.createEmptyMovieClip("bonusLayer", 7);
_root.createEmptyMovieClip("bckgrndLayer", 1);
_root.playerLayer.nave._x = Stage.width / 2;
_root.playerLayer.nave._y = (Stage.height / 3) * 2;
_root.playerLayer.nave.onEnterFrame = naveAction;
fargrndnm = "farground" + fase;
_root.bckgrndLayer.attachMovie(fargrndnm, "fargrnd", 1);
_root.bckgrndLayer.fargrnd._x = 0;
_root.bckgrndLayer.fargrnd._y = 600;
_root.bckgrndLayer.fargrnd.onEnterFrame = fargrndmove;
bckgrndnm = "background" + fase;
_root.bckgrndLayer.attachMovie(bckgrndnm, "bckgrnd", 10);
_root.bckgrndLayer.bckgrnd._x = 0;
_root.bckgrndLayer.bckgrnd._y = 600;
_root.bckgrndLayer.bckgrnd.onEnterFrame = bckgrndmove;
clearInterval(_root.arrInt);
_root.arrInt = setInterval(faseBuilder, faseMonstroFreq);
menu.mudar();
}
function continuar() {
Mouse.show();
_root.arraySet();
stopAllSounds();
_root.musicaTema_snd.start(0, 16);
_root.menu.pontos_txt.text = (_root.pontos = 0);
delete _root.playerLayer.nave.onEnterFrame;
_root.enemyLayer.removeMovieClip();
_root.bckgrndLayer.removeMovieClip();
_root.bonusLayer.removeMovieClip();
_root.balaLayer.removeMovieClip();
clearInterval(_root.arrInt);
_root.attachMovie("continuar", "screen", 1000);
_root.screen._x = 0;
_root.screen._y = 0;
_root.screen.continues.text = _root.naveContinues;
_root.screen.button.onRelease = function () {
_root.musicaTema_snd.stop();
_root.repetirFase();
};
_root.screen.pode = true;
_root.screen.onEnterFrame = function () {
if (Key.isDown(13)) {
if (this.pode == true) {
_root.musicaTema_snd.stop();
_root.repetirFase();
delete this.onEnterFrame;
}
this.pode = false;
} else {
this.pode = true;
}
};
}
function repetirFase() {
Mouse.hide();
_root.screen.removeMovieClip();
_root.naveLife = origNaveLife;
_root.naveSpeed = origNaveSpeed;
_root.balaFreq = origBalaFreq;
_root.rocketTipo = (oldRocketTipo = 0);
_root.amigoMeteorz = false;
_root.amigoHitmanjoe = false;
_root.amigoKanguru = false;
_root.playerLayer.meteorz.removeMovieClip();
_root.playerLayer.kanguru.removeMovieClip();
_root.playerLayer.hitmanjoe.removeMovieClip();
_root.arraySet();
_root.pontos_boni_div = _root.pontos_boni_orig;
_root.enemyVSbossCnt = 0;
_root.balaTipo = fase;
musicnm = ("musica" + fase) + "_snd";
_root[musicnm].start(0, 9999);
_root.createEmptyMovieClip("balaLayer", 9);
_root.createEmptyMovieClip("enemyLayer", 8);
_root.enemyLayer.check = true;
_root.createEmptyMovieClip("bonusLayer", 7);
_root.createEmptyMovieClip("bckgrndLayer", 1);
_root.playerLayer.attachMovie("nave", "nave", 1);
_root.playerLayer.nave._x = Stage.width / 2;
_root.playerLayer.nave._y = (Stage.height / 3) * 2;
_root.playerLayer.nave.onEnterFrame = naveAction;
fargrndnm = "farground" + fase;
_root.bckgrndLayer.attachMovie(fargrndnm, "fargrnd", 1);
_root.bckgrndLayer.fargrnd._x = 0;
_root.bckgrndLayer.fargrnd._y = 600;
_root.bckgrndLayer.fargrnd.onEnterFrame = fargrndmove;
bckgrndnm = "background" + fase;
_root.bckgrndLayer.attachMovie(bckgrndnm, "bckgrnd", 10);
_root.bckgrndLayer.bckgrnd._x = 0;
_root.bckgrndLayer.bckgrnd._y = 600;
_root.bckgrndLayer.bckgrnd.onEnterFrame = bckgrndmove;
clearInterval(_root.arrInt);
_root.arrInt = setInterval(faseBuilder, faseMonstroFreq);
_root.naveContinues--;
menu.mudar();
}
function finalDoJogo() {
Mouse.show();
_root.arraySet();
stopAllSounds();
_root.musicaTema_snd.start(0, 16);
_root.menu.pontos_txt.text = (_root.pontos = 0);
delete _root.playerLayer.nave.onEnterFrame;
_root.enemyLayer.removeMovieClip();
_root.bckgrndLayer.removeMovieClip();
_root.bonusLayer.removeMovieClip();
_root.balaLayer.removeMovieClip();
clearInterval(_root.arrInt);
_root.attachMovie("finalScreen", "screen", 1000);
_root.screen._x = 0;
_root.screen._y = 0;
_root.screen.button.onRelease = function () {
_root.musicaTema_snd.stop();
_root.unloadJogo();
};
_root.screen.pode = true;
_root.screen.onEnterFrame = function () {
if (Key.isDown(13)) {
if (this.pode == true) {
_root.musicaTema_snd.stop();
_root.unloadJogo();
delete this.onEnterFrame;
}
this.pode = false;
} else {
this.pode = true;
}
};
}
function salvar() {
_root.playerInfo = new Object();
_root.playerInfo.fase = fase;
_root.playerInfo.continues = naveContinues;
_root.playerInfo.speed = naveSpeed;
_root.playerInfo.balaFreq = balaFreq;
_root.playerInfo.bala = balaTipo;
_root.playerInfo.rocket = rocketTipo;
_root.playerInfo.temMeteorz = amigoMeteorz;
_root.playerInfo.temHitmanjoe = amigoHitmanjoe;
_root.playerInfo.temKanguru = amigoKanguru;
_root.playerSO = SharedObject.getLocal("hareFighterSAVE");
_root.playerSO.data.playerDados = playerInfo;
_root.playerSO.flush();
}
function carregar() {
stopAllSounds();
_root.playerSO = SharedObject.getLocal("hareFighterSAVE");
if (_root.playerSO.data.playerDados.fase != undefined) {
_root.fase = playerSO.data.playerDados.fase;
_root.naveContinues = playerSO.data.playerDados.continues;
_root.naveSpeed = playerSO.data.playerDados.speed;
_root.balaFreq = playerSO.data.playerDados.balaFreq;
_root.balaTipo = playerSO.data.playerDados.bala;
_root.rocketTipo = playerSO.data.playerDados.rocket;
_root.amigoMeteorz = playerSO.data.playerDados.temMeteorz;
_root.amigoHitmanjoe = playerSO.data.playerDados.temHitmanjoe;
_root.amigoKanguru = playerSO.data.playerDados.temKanguru;
_root.naveLife = origNaveLife;
_root.fase++;
_root.faseMonstroFreq = _root.faseMonstroFreq - 15;
_root.pontos_boni_div = _root.pontos_boni_div + 30;
_root.arraySet();
_root.enemyVSbossCnt = 0;
_root.setupJogo();
if (_root.amigoKanguru) {
_root.makeKanguru();
}
if (_root.amigoHitmanjoe) {
_root.makeHitmanjoe();
}
if (_root.amigoMeteorz) {
_root.makeMeteorz();
}
}
}
function naveAction() {
fdx = Math.abs(dx);
fdy = Math.abs(dy);
if (((Key.isDown(37) && (!Key.isDown(39))) && (!Key.isDown(38))) && (!Key.isDown(40))) {
if (fdx <= naveSpeed) {
dx = dx - naveAcel;
this.d4.play();
}
}
if (((Key.isDown(39) && (!Key.isDown(37))) && (!Key.isDown(38))) && (!Key.isDown(40))) {
if (fdx <= naveSpeed) {
dx = dx + naveAcel;
this.d3.play();
}
}
if (((Key.isDown(38) && (!Key.isDown(40))) && (!Key.isDown(39))) && (!Key.isDown(37))) {
if (fdy <= naveSpeed) {
dy = dy - naveAcel;
this.d5.play();
this.d6.play();
}
}
if (((Key.isDown(40) && (!Key.isDown(38))) && (!Key.isDown(39))) && (!Key.isDown(37))) {
if (fdy <= naveSpeed) {
dy = dy + naveAcel;
this.d1.play();
this.d2.play();
}
}
if (((Key.isDown(37) && (!Key.isDown(39))) && (Key.isDown(38))) && (!Key.isDown(40))) {
if (fdx <= (naveSpeed * naveDiag)) {
dx = dx - (naveAcel * naveDiag);
}
if (fdy <= (naveSpeed * naveDiag)) {
dy = dy - (naveAcel * naveDiag);
}
this.dd1.play();
}
if ((((!Key.isDown(37)) && (Key.isDown(39))) && (Key.isDown(38))) && (!Key.isDown(40))) {
if (fdx <= (naveSpeed * naveDiag)) {
dx = dx + (naveAcel * naveDiag);
}
if (fdy <= (naveSpeed * naveDiag)) {
dy = dy - (naveAcel * naveDiag);
}
this.dd2.play();
}
if (((Key.isDown(37) && (!Key.isDown(39))) && (!Key.isDown(38))) && (Key.isDown(40))) {
if (fdx <= (naveSpeed * naveDiag)) {
dx = dx - (naveAcel * naveDiag);
}
if (fdy <= (naveSpeed * naveDiag)) {
dy = dy + (naveAcel * naveDiag);
}
this.dd3.play();
}
if ((((!Key.isDown(37)) && (Key.isDown(39))) && (!Key.isDown(38))) && (Key.isDown(40))) {
if (fdx <= (naveSpeed * naveDiag)) {
dx = dx + (naveAcel * naveDiag);
}
if (fdy <= (naveSpeed * naveDiag)) {
dy = dy + (naveAcel * naveDiag);
}
this.dd4.play();
}
if (Math.abs(dx) > 0.2) {
dx = dx * naveFriction;
} else {
dx = 0;
}
if (Math.abs(dy) > 0.2) {
dy = dy * naveFriction;
} else {
dy = 0;
}
this._x = this._x + dx;
this._y = this._y + dy;
if (this._x > (stagex - (this._width / 2))) {
this._x = stagex - (this._width / 2);
} else if (this._x < (this._width / 2)) {
this._x = this._width / 2;
}
if (this._y > (stagey - (this._height / 2))) {
this._y = stagey - (this._height / 2);
} else if (this._y < (this._height / 2)) {
this._y = this._height / 2;
}
i = 0;
while (i < 23) {
nm = "enemy" + i;
if ((enemyLayer[nm].hitTest(this._x, this._y + 20, true) && (!hurt)) || (enemyLayer[nm].hitTest(this._x, this._y - 20, true) && (!hurt))) {
hurt = true;
hurtCnt++;
enemyLayer[nm].life--;
naveLife--;
menu.mudar();
}
i++;
}
if (hurtCnt == 0) {
hurt = false;
} else if (hurtCnt == 1) {
this.gotoAndPlay("blink");
hurtCnt++;
if (balaTipo > 1) {
balaTipo--;
pontos_boni_div = pontos_boni_div - pontos_boni_grow;
}
if (rocketTipo > 0) {
rocketTipo--;
pontos_boni_div = pontos_boni_div - pontos_boni_grow;
}
if (naveSpeed > origNaveSpeed) {
naveSpeed = naveSpeed - 2;
pontos_boni_div = pontos_boni_div - pontos_boni_grow;
}
amgzrndm = Math.round(Math.random() * 3);
if (amgzrndm == 0) {
if (!amigoMeteorz) {
if (!amigoKanguru) {
amigoHitmanjoe = false;
pontos_boni_div = pontos_boni_div - pontos_boni_grow;
} else {
amigoKanguru = false;
pontos_boni_div = pontos_boni_div - pontos_boni_grow;
}
} else {
amigoMeteorz = false;
pontos_boni_div = pontos_boni_div - pontos_boni_grow;
}
} else if (amgzrndm == 1) {
if (!amigoKanguru) {
if (!amigoHitmanjoe) {
amigoMeteorz = false;
pontos_boni_div = pontos_boni_div - pontos_boni_grow;
} else {
amigoHitmanjoe = false;
pontos_boni_div = pontos_boni_div - pontos_boni_grow;
}
} else {
amigoKanguru = false;
pontos_boni_div = pontos_boni_div - pontos_boni_grow;
}
} else if (amgzrndm == 2) {
if (!amigoHitmanjoe) {
if (!amigoMeteorz) {
amigoKanguru = false;
pontos_boni_div = pontos_boni_div - pontos_boni_grow;
} else {
amigoMeteorz = false;
pontos_boni_div = pontos_boni_div - pontos_boni_grow;
}
} else {
amigoHitmanjoe = false;
pontos_boni_div = pontos_boni_div - pontos_boni_grow;
}
}
if (!amigoMeteorz) {
delete playerLayer.meteorz.onEnterFrame;
playerLayer.meteorz.removeMovieClip();
}
if (!amigoKanguru) {
delete playerLayer.kanguru.onEnterFrame;
playerLayer.kanguru.removeMovieClip();
}
if (!amigoHitmanjoe) {
delete playerLayer.hitmanjoe.onEnterFrame;
playerLayer.hitmanjoe.removeMovieClip();
}
menu.mudar();
if (naveLife == 0) {
delete this.onEnterFrame;
this.gotoAndPlay("stirb");
}
} else {
hurtCnt++;
}
hurtCnt = hurtCnt % 30;
if (Key.isDown(65)) {
if (this.hold == false) {
atirar(this._x, this._y - 15);
balaTimer = 0;
rocketTimer = rocketTimer + balaFreq;
this.hold = true;
}
atirar(this._x, this._y - 15);
balaTimer++;
rocketTimer++;
} else {
this.hold = false;
if (balaTimer == 0) {
} else {
balaTimer++;
}
if (rocketTimer == 0) {
} else {
rocketTimer++;
}
}
balaTimer = balaTimer % balaFreq;
rocketTimer = rocketTimer % (balaFreq * 3);
}
function atirar(x, y) {
if (balaTimer == 0) {
laser1_snd.start();
if (balaTipo == 1) {
bnm = "bala_" + balaCnt;
balaLayer.attachMovie("bala1", bnm, 99 + balaCnt);
balaLayer[bnm].dy = -balaSpeed;
balaLayer[bnm]._x = x;
balaLayer[bnm]._y = y;
balaLayer[bnm].onEnterFrame = balaviver;
balaCnt++;
balaCnt = balaCnt % balaCntMax;
} else if (balaTipo == 2) {
bnm1 = "bala_" + balaCnt;
balaLayer.attachMovie("bala1", bnm1, 99 + balaCnt);
balaLayer[bnm1].dy = -balaSpeed;
balaLayer[bnm1]._x = x + 6;
balaCnt++;
balaCnt = balaCnt % balaCntMax;
bnm2 = "bala_" + balaCnt;
balaLayer.attachMovie("bala1", bnm2, 99 + balaCnt);
balaCnt++;
balaCnt = balaCnt % balaCntMax;
balaLayer[bnm2].dy = -balaSpeed;
balaLayer[bnm2]._x = x - 6;
balaLayer[bnm1]._y = (balaLayer[bnm2]._y = y);
balaLayer[bnm1].onEnterFrame = (balaLayer[bnm2].onEnterFrame = balaviver);
} else if (balaTipo == 3) {
bnm1 = "bala_" + balaCnt;
balaLayer.attachMovie("bala1", bnm1, 99 + balaCnt);
balaLayer[bnm1].dy = -balaSpeed;
balaLayer[bnm1]._x = x + 6;
balaCnt++;
balaCnt = balaCnt % balaCntMax;
bnm2 = "bala_" + balaCnt;
balaLayer.attachMovie("bala1", bnm2, 99 + balaCnt);
balaCnt++;
balaCnt = balaCnt % balaCntMax;
balaLayer[bnm2].dy = -balaSpeed;
balaLayer[bnm2]._x = x - 6;
balaLayer[bnm1]._y = (balaLayer[bnm2]._y = y);
balaLayer[bnm1].onEnterFrame = (balaLayer[bnm2].onEnterFrame = balaviver);
bnm1 = "bala_" + balaCnt;
balaLayer.attachMovie("bala1", bnm1, 99 + balaCnt);
balaCnt++;
balaCnt = balaCnt % balaCntMax;
if (_root.dx > 0) {
balaLEFT = false;
} else if (_root.dx < 0) {
balaLEFT = true;
}
if (!balaLEFT) {
balaLayer[bnm1].dx = balaSpeed;
balaLayer[bnm1]._rotation = balaLayer[bnm1]._rotation + 90;
balaLayer[bnm1]._x = x + 40;
} else {
balaLayer[bnm1].dx = -balaSpeed;
balaLayer[bnm1]._rotation = balaLayer[bnm1]._rotation - 90;
balaLayer[bnm1]._x = x - 40;
}
balaLayer[bnm1]._y = y + 16;
balaLayer[bnm1].onEnterFrame = balaviver;
} else if (balaTipo == 4) {
bnm1 = "bala_" + balaCnt;
balaLayer.attachMovie("bala1", bnm1, 99 + balaCnt);
balaLayer[bnm1].dy = -balaSpeed;
balaLayer[bnm1]._x = x + 6;
balaCnt++;
balaCnt = balaCnt % balaCntMax;
bnm2 = "bala_" + balaCnt;
balaLayer.attachMovie("bala1", bnm2, 99 + balaCnt);
balaCnt++;
balaCnt = balaCnt % balaCntMax;
balaLayer[bnm2].dy = -balaSpeed;
balaLayer[bnm2]._x = x - 6;
balaLayer[bnm1]._y = (balaLayer[bnm2]._y = y);
balaLayer[bnm1].onEnterFrame = (balaLayer[bnm2].onEnterFrame = balaviver);
bnm1 = "bala_" + balaCnt;
balaLayer.attachMovie("bala1", bnm1, 99 + balaCnt);
balaCnt++;
balaCnt = balaCnt % balaCntMax;
balaLayer[bnm1].dx = balaSpeed;
balaLayer[bnm1]._rotation = balaLayer[bnm1]._rotation + 90;
balaLayer[bnm1]._x = x + 40;
bnm2 = "bala_" + balaCnt;
balaLayer.attachMovie("bala1", bnm2, 99 + balaCnt);
balaCnt++;
balaCnt = balaCnt % balaCntMax;
balaLayer[bnm2].dx = -balaSpeed;
balaLayer[bnm2]._rotation = balaLayer[bnm2]._rotation - 90;
balaLayer[bnm2]._x = x - 40;
balaLayer[bnm1]._y = (balaLayer[bnm2]._y = y + 16);
balaLayer[bnm1].onEnterFrame = (balaLayer[bnm2].onEnterFrame = balaviver);
} else if (balaTipo == 5) {
bnm1 = "bala_" + balaCnt;
balaLayer.attachMovie("bala1", bnm1, 99 + balaCnt);
balaLayer[bnm1].dy = -balaSpeed;
balaLayer[bnm1]._x = x + 6;
balaCnt++;
balaCnt = balaCnt % balaCntMax;
bnm2 = "bala_" + balaCnt;
balaLayer.attachMovie("bala1", bnm2, 99 + balaCnt);
balaCnt++;
balaCnt = balaCnt % balaCntMax;
balaLayer[bnm2].dy = -balaSpeed;
balaLayer[bnm2]._x = x - 6;
balaLayer[bnm1]._y = (balaLayer[bnm2]._y = y);
balaLayer[bnm1].onEnterFrame = (balaLayer[bnm2].onEnterFrame = balaviver);
bnm1 = "bala_" + balaCnt;
balaLayer.attachMovie("bala1", bnm1, 99 + balaCnt);
balaCnt++;
balaCnt = balaCnt % balaCntMax;
balaLayer[bnm1].dx = balaSpeed;
balaLayer[bnm1]._rotation = balaLayer[bnm1]._rotation + 90;
balaLayer[bnm1]._x = x + 40;
bnm2 = "bala_" + balaCnt;
balaLayer.attachMovie("bala1", bnm2, 99 + balaCnt);
balaCnt++;
balaCnt = balaCnt % balaCntMax;
balaLayer[bnm2].dx = -balaSpeed;
balaLayer[bnm2]._rotation = balaLayer[bnm2]._rotation - 90;
balaLayer[bnm2]._x = x - 40;
balaLayer[bnm1]._y = (balaLayer[bnm2]._y = y + 16);
balaLayer[bnm1].onEnterFrame = (balaLayer[bnm2].onEnterFrame = balaviver);
bnm1 = "bala_" + balaCnt;
balaLayer.attachMovie("bala1", bnm1, 99 + balaCnt);
balaCnt++;
balaCnt = balaCnt % balaCntMax;
balaLayer[bnm1].dy = balaSpeed;
balaLayer[bnm1]._x = x;
balaLayer[bnm1]._y = y;
balaLayer[bnm1].onEnterFrame = balaviver;
}
}
if (rocketTimer == 0) {
if (rocketTipo == 1) {
xold = 10000;
yold = 10000;
i = 0;
while (i < 35) {
nm = "enemy" + i;
xdist = Math.abs(enemyLayer[nm]._x - x);
ydist = Math.abs(enemyLayer[nm]._y - y);
if ((ydist < yold) || (xdist < xold)) {
if (enemyLayer[nm].life > 0) {
nome = nm;
xold = xdist;
yold = ydist;
}
}
i++;
}
if (enemyLayer[nome].life > 0) {
rocket_snd.start();
rnm = "bala_" + balaCnt;
balaLayer.attachMovie("rocket1", rnm, 99 + balaCnt);
balaCnt++;
balaCnt = balaCnt % balaCntMax;
balaLayer[rnm].nome = nome;
balaLayer[rnm].dx = 0;
balaLayer[rnm].dy = 0;
balaLayer[rnm].maxx = 0;
balaLayer[rnm].maxy = 0;
balaLayer[rnm]._x = x;
balaLayer[rnm]._y = y;
balaLayer[rnm]._visible = false;
balaLayer[rnm].onEnterFrame = function () {
X = enemyLayer[this.nome]._x - x;
Y = enemyLayer[this.nome]._y - y;
hypotenuse = Math.sqrt((X * X) + (Y * Y));
radian = Math.acos(X / hypotenuse);
winkel = radian * 57.2957795130823;
rdx = Math.cos(radian);
if (Y < 0) {
rdy = -Math.sin(radian);
} else {
rdy = Math.sin(radian);
}
if (Y > 0) {
this._rotation = winkel;
} else {
this._rotation = -winkel;
}
this._visible = true;
this.maxx = rdx * rocketSpeed;
this.maxy = rdy * rocketSpeed;
if (this.dx < this.maxx) {
this.dx = this.dx + rocketAcel;
} else if (this.dx > this.maxx) {
this.dx = this.dx - rocketAcel;
}
if (this.dy < this.maxy) {
this.dy = this.dy + rocketAcel;
} else if (this.dy > this.maxy) {
this.dy = this.dy - rocketAcel;
}
this._x = this._x + this.dx;
this._y = this._y + this.dy;
i = 0;
while (i < 35) {
nm = "enemy" + i;
if (enemyLayer[nm].hitTest(this._x, this._y, true)) {
enemyLayer[nm].life = enemyLayer[nm].life - 1;
enemyLayer[nm].blink.play();
delete this.onEnterFrame;
this.play();
}
i++;
}
if ((((this._y < -5) || (this._y > (stagey + 80))) || (this._x < -80)) || (this._x > (stagex + 80))) {
this.removeMovieClip();
delete this.onEnterFrame;
}
};
}
}
if (rocketTipo == 2) {
xold = 10000;
yold = 10000;
i = 0;
while (i < 35) {
nm = "enemy" + i;
xdist = Math.abs(enemyLayer[nm]._x - x);
ydist = Math.abs(enemyLayer[nm]._y - y);
if ((ydist < yold) || (xdist < xold)) {
if (enemyLayer[nm].life > 0) {
nome = nm;
xold = xdist;
yold = ydist;
}
}
i++;
}
if (enemyLayer[nome].life > 0) {
rocket_snd.start();
rnm = "bala_" + balaCnt;
balaLayer.attachMovie("rocket2", rnm, 99 + balaCnt);
balaCnt++;
balaCnt = balaCnt % balaCntMax;
balaLayer[rnm].nome = nome;
balaLayer[rnm].dx = 0;
balaLayer[rnm].dy = 0;
balaLayer[rnm].maxx = 0;
balaLayer[rnm].maxy = 0;
balaLayer[rnm]._x = x;
balaLayer[rnm]._y = y;
balaLayer[rnm]._visible = false;
balaLayer[rnm].onEnterFrame = function () {
X = enemyLayer[this.nome]._x - x;
Y = enemyLayer[this.nome]._y - y;
hypotenuse = Math.sqrt((X * X) + (Y * Y));
radian = Math.acos(X / hypotenuse);
winkel = radian * 57.2957795130823;
rdx = Math.cos(radian);
if (Y < 0) {
rdy = -Math.sin(radian);
} else {
rdy = Math.sin(radian);
}
if (Y > 0) {
this._rotation = winkel;
} else {
this._rotation = -winkel;
}
this._visible = true;
this.maxx = rdx * rocketSpeed;
this.maxy = rdy * rocketSpeed;
if (this.dx < this.maxx) {
this.dx = this.dx + (rocketAcel * 1.5);
} else if (this.dx > this.maxx) {
this.dx = this.dx - (rocketAcel * 1.5);
}
if (this.dy < this.maxy) {
this.dy = this.dy + (rocketAcel * 1.5);
} else if (this.dy > this.maxy) {
this.dy = this.dy - (rocketAcel * 1.5);
}
this._x = this._x + this.dx;
this._y = this._y + this.dy;
i = 0;
while (i < 35) {
nm = "enemy" + i;
if (enemyLayer[nm].hitTest(this._x, this._y, true)) {
enemyLayer[nm].life = enemyLayer[nm].life - 2;
enemyLayer[nm].blink.play();
delete this.onEnterFrame;
this.play();
}
i++;
}
if ((((this._y < -5) || (this._y > (stagey + 80))) || (this._x < -80)) || (this._x > (stagex + 80))) {
this.removeMovieClip();
delete this.onEnterFrame;
}
};
}
}
if (rocketTipo == 3) {
xold = 10000;
yold = 10000;
decide = true;
i = 0;
while (i < 35) {
nm = "enemy" + i;
xdist = Math.abs(enemyLayer[nm]._x - x);
ydist = Math.abs(enemyLayer[nm]._y - y);
if ((ydist < yold) || (xdist < xold)) {
if (enemyLayer[nm].life > 0) {
if (decide) {
nome1 = nm;
decide = false;
} else {
nome2 = nm;
decide = true;
}
xold = xdist;
yold = ydist;
}
}
i++;
}
if (enemyLayer[nome2].life <= 0) {
nome2 = nome1;
}
if ((enemyLayer[nome2].life > 0) && (enemyLayer[nome1].life > 0)) {
rocket_snd.start();
rnm1 = "bala_" + balaCnt;
balaLayer.attachMovie("rocket3", rnm1, 99 + balaCnt);
balaCnt++;
balaCnt = balaCnt % balaCntMax;
rnm2 = "bala_" + balaCnt;
balaLayer.attachMovie("rocket3", rnm2, 99 + balaCnt);
balaCnt++;
balaCnt = balaCnt % balaCntMax;
balaLayer[rnm1].nome = nome1;
balaLayer[rnm1].dx = 0;
balaLayer[rnm1].dy = 0;
balaLayer[rnm1].maxx = 0;
balaLayer[rnm1].maxy = 0;
balaLayer[rnm1]._x = x + 8;
balaLayer[rnm1]._y = y;
balaLayer[rnm1]._visible = false;
balaLayer[rnm2].nome = nome2;
balaLayer[rnm2].dx = 0;
balaLayer[rnm2].dy = 0;
balaLayer[rnm2].maxx = 0;
balaLayer[rnm2].maxy = 0;
balaLayer[rnm2]._x = x - 8;
balaLayer[rnm2]._y = y;
balaLayer[rnm2]._visible = false;
balaLayer[rnm1].onEnterFrame = (balaLayer[rnm2].onEnterFrame = function () {
X = enemyLayer[this.nome]._x - x;
Y = enemyLayer[this.nome]._y - y;
hypotenuse = Math.sqrt((X * X) + (Y * Y));
radian = Math.acos(X / hypotenuse);
winkel = radian * 57.2957795130823;
rdx = Math.cos(radian);
if (Y < 0) {
rdy = -Math.sin(radian);
} else {
rdy = Math.sin(radian);
}
if (Y > 0) {
this._rotation = winkel;
} else {
this._rotation = -winkel;
}
this._visible = true;
this.maxx = rdx * rocketSpeed;
this.maxy = rdy * rocketSpeed;
if (this.dx < this.maxx) {
this.dx = this.dx + (rocketAcel * 1.5);
} else if (this.dx > this.maxx) {
this.dx = this.dx - (rocketAcel * 1.5);
}
if (this.dy < this.maxy) {
this.dy = this.dy + (rocketAcel * 1.5);
} else if (this.dy > this.maxy) {
this.dy = this.dy - (rocketAcel * 1.5);
}
this._x = this._x + this.dx;
this._y = this._y + this.dy;
i = 0;
while (i < 35) {
nm = "enemy" + i;
if (enemyLayer[nm].hitTest(this._x, this._y, true)) {
enemyLayer[nm].life = enemyLayer[nm].life - 1.5;
enemyLayer[nm].blink.play();
this.play();
delete this.onEnterFrame;
}
i++;
}
if ((((this._y < -16) || (this._y > (stagey + 80))) || (this._x < -80)) || (this._x > (stagex + 80))) {
this.removeMovieClip();
delete this.onEnterFrame;
}
});
}
}
}
}
function makeEnemy(imagem, tipo, x, y, enmSpeed, bonustipo, atira, atiraFreq) {
img = imagem;
nm = "enemy" + enemyCnt;
enemyCnt++;
enemyCnt = enemyCnt % 22;
enemyLayer.attachMovie(img, nm, 99 + enemyCnt);
enemyLayer[nm]._x = x;
enemyLayer[nm]._y = y;
enemyLayer[nm].w = enemyLayer[nm]._width / 2;
if (enemyLayer[nm]._x < enemyLayer[nm].w) {
enemyLayer[nm]._x = enemyLayer[nm].w;
} else if (enemyLayer[nm]._x > (stagex - enemyLayer[nm].w)) {
enemyLayer[nm]._x = (stagex - enemyLayer[nm].w) - 1;
}
enemyLayer[nm].tipo = tipo;
enemyLayer[nm].enmSpeed = enmSpeed;
enemyLayer[nm].atira = atira;
enemyLayer[nm].freq = atiraFreq;
enemyLayer[nm].bonustipo = bonustipo;
enemyLayer[nm].timer = 0;
enemyLayer[nm].cnt = 0;
enemyLayer[nm].viver = function () {
if ((this.life <= 0) && (this._currentframe == 1)) {
explosion_snd.start();
this.gotoAndPlay("stirb");
pontos = pontos + this.lifepoints;
pontos_boni = pontos_boni + this.lifepoints;
bonusmaker(this.bonustipo, this._x, this._y);
menu.mudar();
}
if (this.atira == 1) {
if (this.timer == (this.freq / 2)) {
enmAtirar(this._x, this._y, enmBalaSpeed);
}
this.timer++;
this.timer = this.timer % this.freq;
}
if ((((this._y > (stagey + 50)) || (this._y < -50)) || (this._x < -50)) || (this._x > (stagex + 50))) {
this.removeMovieClip();
delete this.onEnterFrame;
}
};
if (tipo == 1) {
enemyLayer[nm].dy = enemyLayer[nm].enmSpeed;
enmtipo1(nm);
}
if (tipo == 1.1) {
enemyLayer[nm].dy = enemyLayer[nm].enmSpeed;
enemyLayer[nm].dx = 0;
enmtipo1_1(nm);
}
if (tipo == 1.2) {
enemyLayer[nm]._y = stagey - enemyLayer[nm]._y;
enemyLayer[nm].dy = -enemyLayer[nm].enmSpeed;
enmtipo1(nm);
}
if (tipo == 1.3) {
enemyLayer[nm]._y = stagey - enemyLayer[nm]._y;
enemyLayer[nm].dy = -enemyLayer[nm].enmSpeed;
enemyLayer[nm].dx = 0;
enmtipo1_3(nm);
} else if (tipo == 2) {
if (enemyLayer[nm]._x > (stagex - 100)) {
enemyLayer[nm]._x = stagex - 130;
}
enemyLayer[nm].dy = enemyLayer[nm].enmSpeed;
enemyLayer[nm].dx = 0;
enemyLayer[nm].praDir = true;
enemyLayer[nm].cnt = 0;
enmtipo2(nm);
} else if (tipo == 3) {
enemyLayer[nm].dx = enemyLayer[nm].enmSpeed / 2;
enemyLayer[nm].dy = enemyLayer[nm].enmSpeed / 2;
enmtipo3(nm);
} else if (tipo == 4) {
enemyLayer[nm].middle = Math.round((Math.random() * 100) - 50);
enemyLayer[nm].dy = enemyLayer[nm].enmSpeed;
if (enemyLayer[nm]._x < (stagex / 2)) {
enemyLayer[nm].dx = enemyLayer[nm].enmSpeed;
} else {
enemyLayer[nm].dx = -enemyLayer[nm].enmSpeed;
}
enmtipo4(nm);
} else if (tipo == 4.1) {
enemyLayer[nm].middle = Math.round((Math.random() * 100) - 50);
enemyLayer[nm].dy = enemyLayer[nm].enmSpeed;
if (enemyLayer[nm]._x < (stagex / 2)) {
enemyLayer[nm].dx = enemyLayer[nm].enmSpeed;
} else {
enemyLayer[nm].dx = -enemyLayer[nm].enmSpeed;
}
enmtipo4_1(nm);
} else if (tipo == 4.2) {
enemyLayer[nm]._x = (stagex / 2) + Math.abs((Math.random() * 200) - 100);
enemyLayer[nm].breakpoint = (stagey / 2) + Math.abs((Math.random() * 350) - 175);
whichway = Math.floor((Math.random() * 2) - 1);
if (whichway != 0) {
enemyLayer[nm].dx = -enemyLayer[nm].enmSpeed;
} else {
enemyLayer[nm].dx = enemyLayer[nm].enmSpeed;
}
enemyLayer[nm].dy = enemyLayer[nm].enmSpeed;
enmtipo4_2(nm);
} else if (tipo == 5) {
enemyLayer[nm].dx = 0;
enemyLayer[nm].dy = enemyLayer[nm].enmSpeed;
enmtipo5(nm);
} else if (tipo == 5.1) {
enemyLayer[nm].dx = 0;
enemyLayer[nm].dy = enemyLayer[nm].enmSpeed;
enmtipo5_1(nm);
} else if (tipo == 5.2) {
enemyLayer[nm]._y = stagey - enemyLayer[nm]._y;
enemyLayer[nm].dx = 0;
enemyLayer[nm].dy = -enemyLayer[nm].enmSpeed;
enmtipo5_2(nm);
} else if (tipo == 5.3) {
enemyLayer[nm]._y = stagey - enemyLayer[nm]._y;
enemyLayer[nm].dx = 0;
enemyLayer[nm].dy = -enemyLayer[nm].enmSpeed;
enmtipo5_3(nm);
} else if (tipo == 6) {
if (enemyLayer[nm]._x < 320) {
enemyLayer[nm].dx = enemyLayer[nm].enmSpeed;
} else {
enemyLayer[nm].dx = -enemyLayer[nm].enmSpeed;
}
enemyLayer[nm].dy = Math.abs(enemyLayer[nm].dx / 3);
enmtipo6(nm);
} else if (tipo == 8) {
enmtipo8(nm);
} else if (tipo == 8.1) {
enmtipo8_1(nm);
} else if (tipo == 100) {
enemyLayer[nm].dx = enemyLayer[nm].enmSpeed * 0.75;
enemyLayer[nm].dy = enemyLayer[nm].enmSpeed;
enmtipo100(nm);
} else if (tipo == 101) {
enemyLayer[nm].dx = 0;
enemyLayer[nm].dy = 0;
enemyLayer[nm].xmax = enemyLayer[nm].enmSpeed * 2;
enemyLayer[nm].ymax = enemyLayer[nm].enmSpeed * 2;
enmtipo101(nm);
} else if (tipo == 102) {
enemyLayer[nm].dy = -3;
i = 1;
while (i < 6) {
imgi = (imagem + "c") + i;
cnm = "c" + i;
enemyLayer.attachMovie(imgi, cnm, 123123 + i);
i++;
}
enmtipo102(nm);
}
if (tipo == 200) {
enemyLayer[nm].dy = enemyLayer[nm].enmSpeed;
enmtipo200(nm);
}
}
function enmtipo1(nm) {
enemyLayer[nm].onEnterFrame = function () {
this._y = this._y + this.dy;
this.viver();
};
}
function enmtipo1_1(nm) {
enemyLayer[nm].onEnterFrame = function () {
this._y = this._y + this.dy;
this._x = this._x + this.dx;
if (this._y > (stagey - this.w)) {
this._y = stagey - this.w;
this.dy = this.dy * -1;
this.dx = ((random(4) * 2) - 3) / 2;
}
if (this.dy < 0) {
this._yscale = -100;
} else {
this._yscale = 100;
}
this.viver();
};
}
function enmtipo1_3(nm) {
enemyLayer[nm].onEnterFrame = function () {
this._y = this._y + this.dy;
this._x = this._x + this.dx;
if (this._y < this.w) {
this._y = this.w;
this.dy = this.dy * -1;
this.dx = ((random(4) * 2) - 3) / 2;
}
if (this.dy < 0) {
this._yscale = -100;
} else {
this._yscale = 100;
}
this.viver();
};
}
function enmtipo2(nm) {
enemyLayer[nm].onEnterFrame = function () {
if (this.cnt == 0) {
this.praDir = true;
this.cnt++;
} else if (this.cnt == 30) {
this.praDir = false;
this.cnt++;
} else if (this.cnt == 60) {
this.cnt = 0;
} else {
this.cnt++;
}
if (this.praDir && (this.dx < 3)) {
this.dx = this.dx + 0.5;
} else if ((!this.praDir) && (this.dx > -3)) {
this.dx = this.dx - 0.5;
}
this._x = this._x + this.dx;
this._y = this._y + this.dy;
this.viver();
};
}
function enmtipo3(nm) {
enemyLayer[nm].onEnterFrame = function () {
if (this._x < 50) {
while (this._x < 50) {
this._x++;
}
this.dx = this.dx * -1;
} else if (this._x > (stagex - 50)) {
while (this._x > (stagex - 50)) {
this._x--;
}
this.dx = this.dx * -1;
} else if (this._y > (stagey - 50)) {
while (this._y > (stagey - 50)) {
this._y--;
}
this.dy = this.dy * -1;
} else if (this._y < -50) {
delete this.onEnterFrame;
this.removeMovieClip();
}
this._x = this._x + this.dx;
this._y = this._y + this.dy;
this.viver();
};
}
function enmtipo4(nm) {
enemyLayer[nm].onEnterFrame = function () {
if (this.dx > 0) {
if (this._x < ((stagex / 2) + this.middle)) {
this._x = this._x + this.dx;
}
} else if (this._x > ((stagex / 2) + this.middle)) {
this._x = this._x + this.dx;
}
this._y = this._y + this.dy;
this.viver();
};
}
function enmtipo4_1(nm) {
enemyLayer[nm].onEnterFrame = function () {
if (this._y < (stagey - this.w)) {
if (this.dx > 0) {
if (this._x < ((stagex / 2) + this.middle)) {
this._x = this._x + this.dx;
}
} else if (this._x > ((stagex / 2) + this.middle)) {
this._x = this._x + this.dx;
}
this._y = this._y + this.dy;
} else {
this._y = stagey - this.w;
this._x = this._x + this.dx;
}
this.viver();
};
}
function enmtipo4_2(nm) {
enemyLayer[nm].onEnterFrame = function () {
if (this._y > this.breakpoint) {
this._x = this._x + this.dx;
this._y = this._y + (this.dy / 2);
} else {
this._y = this._y + this.dy;
}
this.viver();
};
}
function enmtipo5(nm) {
enemyLayer[nm].onEnterFrame = function () {
if (this._y > (stagey - this.w)) {
this._y = stagey - this.w;
if (this._x < (stagex / 2)) {
this.dx = this.enmSpeed;
} else {
this.dx = -this.enmSpeed;
}
this.dy = 0;
} else if (this._x < this.w) {
this._x = this.w;
this.dy = -this.enmSpeed;
this.dx = 0;
} else if (this._x > (stagex - this.w)) {
this._x = stagex - this.w;
this.dy = -this.enmSpeed;
this.dx = 0;
}
this._x = this._x + this.dx;
this._y = this._y + this.dy;
this.viver();
};
}
function enmtipo5_1(nm) {
enemyLayer[nm].upPoint = (random(stagex - 30) * 1) + 15;
if (enemyLayer[nm]._x < (stagex / 2)) {
enemyLayer[nm]._x = enemyLayer[nm].w;
} else {
enemyLayer[nm]._x = stagex - enemyLayer[nm].w;
}
enemyLayer[nm].onEnterFrame = function () {
if (this._y > (stagey - this.w)) {
this._y = stagey - this.w;
if (this._x < (stagex / 2)) {
this.dx = this.enmSpeed;
} else {
this.dx = -this.enmSpeed;
}
this.dy = 0;
} else if ((this.dx < 0) && (this._x < this.upPoint)) {
this.dy = -this.enmSpeed;
this.dx = 0;
} else if ((this.dx > 0) && (this._x > this.upPoint)) {
this.dy = -this.enmSpeed;
this.dx = 0;
}
this._x = this._x + this.dx;
this._y = this._y + this.dy;
this.viver();
};
}
function enmtipo5_2(nm) {
enemyLayer[nm].onEnterFrame = function () {
if (this._y < this.w) {
this._y = this.w + 2;
if (this._x < (stagex / 2)) {
this.dx = this.enmSpeed;
} else {
this.dx = -this.enmSpeed;
}
this.dy = 0;
} else if (this._x < this.w) {
this._x = this.w;
this.dy = this.enmSpeed;
this.dx = 0;
} else if (this._x > (stagex - this.w)) {
this._x = stagex - this.w;
this.dy = this.enmSpeed;
this.dx = 0;
}
this._x = this._x + this.dx;
this._y = this._y + this.dy;
this.viver();
};
}
function enmtipo5_3(nm) {
enemyLayer[nm].upPoint = (random(stagex - 30) * 1) + 15;
if (enemyLayer[nm]._x < (stagex / 2)) {
enemyLayer[nm]._x = enemyLayer[nm].w;
} else {
enemyLayer[nm]._x = stagex - enemyLayer[nm].w;
}
enemyLayer[nm].onEnterFrame = function () {
if (this._y < this.w) {
this._y = this.w;
if (this._x < (stagex / 2)) {
this.dx = this.enmSpeed;
} else {
this.dx = -this.enmSpeed;
}
this.dy = 0;
} else if ((this.dx < 0) && (this._x < this.upPoint)) {
this.dy = this.enmSpeed;
this.dx = 0;
} else if ((this.dx > 0) && (this._x > this.upPoint)) {
this.dy = this.enmSpeed;
this.dx = 0;
}
this._x = this._x + this.dx;
this._y = this._y + this.dy;
this.viver();
};
}
function enmtipo6(nm) {
enemyLayer[nm].onEnterFrame = function () {
if (this._x < this.w) {
this._x = this.w;
this.dx = this.dx * -1;
} else if (this._x > (stagex - this.w)) {
this._x = stagex - this.w;
this.dx = this.dx * -1;
}
this._x = this._x + this.dx;
this._y = this._y + this.dy;
if (this.dx < 0) {
this._xscale = -100;
} else {
this._xscale = 100;
}
this.viver();
};
}
function enmtipo8(nm) {
if (enemyLayer[nm]._x < (stagex / 2)) {
enemyLayer[nm]._x = -10;
enemyLayer[nm].dx = enemyLayer[nm].enmSpeed;
enemyLayer[nm]._rotation = enemyLayer[nm]._rotation - 90;
} else {
enemyLayer[nm]._x = stagex + 10;
enemyLayer[nm].dx = -enemyLayer[nm].enmSpeed;
enemyLayer[nm]._rotation = enemyLayer[nm]._rotation + 90;
}
enemyLayer[nm]._y = random(stagey - 40) * 1;
enemyLayer[nm].dy = Math.floor((Math.random() * 2) + 1);
enemyLayer[nm].onEnterFrame = function () {
this._x = this._x + this.dx;
this._y = this._y + this.dy;
this.viver();
};
}
function enmtipo8_1(nm) {
if (enemyLayer[nm]._x < (stagex / 2)) {
enemyLayer[nm]._x = -10;
enemyLayer[nm].dx = enemyLayer[nm].enmSpeed;
enemyLayer[nm]._rotation = enemyLayer[nm]._rotation - 90;
enemyLayer[nm]._xscale = -100;
} else {
enemyLayer[nm]._x = stagex + 10;
enemyLayer[nm].dx = -enemyLayer[nm].enmSpeed;
enemyLayer[nm]._rotation = enemyLayer[nm]._rotation + 90;
enemyLayer[nm]._xscale = 100;
}
enemyLayer[nm]._y = random(stagey - 40) * 1;
enemyLayer[nm].dy = Math.floor((Math.random() * 2) + 1);
enemyLayer[nm].onEnterFrame = function () {
if (this._x < this.w) {
this._x = this.w;
this.dx = this.dx * -1;
this._rotation = -90;
this._xscale = -100;
} else if (this._x > (stagex - this.w)) {
this._x = stagex - this.w;
this.dx = this.dx * -1;
this._rotation = 90;
this._xscale = 100;
}
this._x = this._x + this.dx;
this._y = this._y + this.dy;
this.viver();
};
}
function enmtipo100(nm) {
enemyLayer[nm].onEnterFrame = function () {
if (this._x < 100) {
while (this._x < 100) {
this._x++;
}
this.dx = this.dx * -1;
} else if (this._x > (stagex - 100)) {
while (this._x > (stagex - 100)) {
this._x--;
}
this.dx = this.dx * -1;
} else if (this._y > (stagey - 60)) {
while (this._y > (stagey - 60)) {
this._y--;
}
this.dy = this.dy * -1;
} else if (this._y < 100) {
while (this._y < 100) {
this._y++;
}
this.dy = this.dy * -1;
}
this._x = this._x + this.dx;
this._y = this._y + this.dy;
this.viver();
};
}
function enmtipo101(nm) {
enemyLayer[nm].onEnterFrame = function () {
seguirx = playerLayer.nave._x - this._x;
seguiry = playerLayer.nave._y - this._y;
if ((seguirx > 0) && (Math.abs(this.dx) <= this.xmax)) {
this.dx = this.dx + 0.2;
} else if ((seguirx < 0) && (Math.abs(this.dx) <= this.xmax)) {
this.dx = this.dx - 0.2;
}
if ((seguiry > 0) && (Math.abs(this.dy) <= this.ymax)) {
this.dy = this.dy + 0.2;
} else if ((seguiry < 0) && (Math.abs(this.dy) <= this.ymax)) {
this.dy = this.dy - 0.2;
}
if (this._x < 50) {
while (this._x < 50) {
this._x++;
}
this.dx = 0;
} else if (this._x > (stagex - 50)) {
while (this._x > (stagex - 50)) {
this._x--;
}
this.dx = 0;
} else if (this._y > (stagey - 50)) {
while (this._y > (stagey - 50)) {
this._y--;
}
this.dy = 0;
} else if (this._y < 50) {
while (this._y < 50) {
this._y++;
}
this.dy = 0;
}
this._x = this._x + this.dx;
this._y = this._y + this.dy;
this.viver();
};
}
function enmtipo102(nm) {
enemyLayer[nm].onEnterFrame = function () {
if (this._y > stagey) {
while (this._y > stagey) {
this._y--;
}
this.dy = this.dy * -0.1;
this._yscale = -100;
} else if (this._y < 24) {
while (this._y < 24) {
this._y++;
}
this.dy = this.dy * -10;
this._yscale = 100;
}
this._x = this._x + ((_root.playerLayer.nave._x - this._x) / 32);
this._y = this._y + this.dy;
this.viver();
};
i = 1;
while (i < 6) {
cnm = "c" + i;
if (i == 1) {
enemyLayer[cnm].nm = nm;
} else {
enemyLayer[cnm].nm = "c" + (i - 1);
}
enemyLayer[cnm].w = enemyLayer[enemyLayer[cnm].nm]._height;
enemyLayer[cnm].onEnterFrame = function () {
if (this.hitTest(playerLayer.nave._x, playerLayer.nave._y, true) && (!hurt)) {
hurt = true;
hurtCnt++;
naveLife--;
menu.mudar();
}
cx = _root.enemyLayer[this.nm]._x - this._x;
if (_root.enemyLayer[this.nm]._yscale == 100) {
cy = _root.enemyLayer[this.nm]._y - this._y;
this._yscale = 100;
} else {
cy = (_root.enemyLayer[this.nm]._y + this.w) - this._y;
this._yscale = -100;
}
this._x = this._x + (cx / 6);
this._y = this._y + (cy / 6);
};
i++;
}
}
function enmtipo200(nm) {
enemyLayer[nm].onEnterFrame = function () {
this._y = this._y + this.dy;
if (this.hitTest(playerLayer.nave._x, playerLayer.nave._y, true)) {
playerLayer.nave._x = playerLayer.nave._x + (-2 * dx);
playerLayer.nave._y = playerLayer.nave._y + (-2 * dy);
if (dy == 0) {
playerLayer.nave._y = playerLayer.nave._y + (2 * this.dy);
}
dx = 0;
dy = 0;
if (!hurt) {
hurt = true;
hurtCnt++;
naveLife--;
menu.mudar();
}
}
};
}
function bonusmaker(tipo, x, y) {
if ((tipo == 1) && (naveLife == origNaveLife)) {
} else if ((tipo == 2) && (naveSpeed == maxNaveSpeed)) {
} else if ((tipo == 3) && (balaTipo == 5)) {
} else if ((tipo == 4) && (rocketTipo == 3)) {
} else if ((tipo == 5) && (amigoMeteorz)) {
} else if ((tipo == 6) && (amigoHitmanjoe)) {
} else if ((tipo == 7) && (amigoKanguru)) {
} else {
nm = "bonus" + tipo;
bonusnm = "bonus" + bonuscnt;
bonuscnt++;
bonuscnt = bonuscnt % 16;
bonusLayer.attachMovie(nm, bonusnm, 999 + bonuscnt);
bonusLayer[bonusnm].tipo = tipo;
bonusLayer[bonusnm]._x = x;
bonusLayer[bonusnm]._y = y;
bonusLayer[bonusnm].onEnterFrame = bonusaction;
}
}
function bonusaction() {
this._y = this._y + 2;
if (this.hitTest(playerLayer.nave)) {
bonus_snd.start();
pontos_boni_div = pontos_boni_div + pontos_boni_grow;
if (this.tipo == 1) {
if (naveLife < origNaveLife) {
naveLife++;
}
} else if (this.tipo == 2) {
if (naveSpeed < maxNaveSpeed) {
naveSpeed = naveSpeed + 2;
}
} else if (this.tipo == 3) {
if (balaTipo < 5) {
balaTipo++;
}
} else if (this.tipo == 4) {
if (rocketTipo < 3) {
rocketTipo++;
}
} else if (this.tipo == 5) {
if (!amigoMeteorz) {
makeMeteorz();
}
amigoMeteorz = true;
} else if (this.tipo == 6) {
if (!amigoHitmanjoe) {
makeHitmanjoe();
}
amigoHitmanjoe = true;
} else if (this.tipo == 7) {
if (!amigoKanguru) {
makeKanguru();
}
amigoKanguru = true;
}
menu.mudar();
delete this.onEnterFrame;
this.removeMovieClip();
}
if (this._y > (stagey + 15)) {
delete this.onEnterFrame;
this.removeMovieClip();
}
}
function enmAtirar(x, y, mspeed) {
laser2_snd.start();
X = playerLayer.nave._x - x;
Y = playerLayer.nave._y - y;
hypotenuse = Math.sqrt((X * X) + (Y * Y));
radian = Math.acos(X / hypotenuse);
winkel = radian * 57.2957795130823;
mbdx = Math.cos(radian);
if (Y < 0) {
mbdy = -Math.sin(radian);
} else {
mbdy = Math.sin(radian);
}
bnm = "bala_" + balaCnt;
balaLayer.attachMovie("mbala1", bnm, 99 + balaCnt);
balaLayer[bnm].dx = mbdx * mspeed;
balaLayer[bnm].dy = mbdy * mspeed;
balaLayer[bnm]._x = x;
balaLayer[bnm]._y = y;
balaLayer[bnm].onEnterFrame = function () {
if (this.hitTest(playerLayer.nave._x, playerLayer.nave._y, true) && (!hurt)) {
hurt = true;
hurtCnt++;
naveLife--;
this.removeMovieClip();
delete this.onEnterFrame;
menu.mudar();
} else if (this.hitTest(playerLayer.meteorz)) {
this.removeMovieClip();
delete this.onEnterFrame;
} else if ((((this._x < 0) || (this._x > 460)) || (this._y < 0)) || (this._y > 600)) {
this.removeMovieClip();
delete this.onEnterFrame;
}
this._x = this._x + this.dx;
this._y = this._y + this.dy;
};
balaCnt++;
balaCnt = balaCnt % balaCntMax;
}
function faseBuilder() {
if (faseLength == undefined) {
arrnm = ("fase" + fase) + "Array";
arraySel = _root[arrnm].length - arraySelTamanho;
faseLength = Math.round(arraySel / arraySpeed);
}
if (enemyVSbossCnt == faseLength) {
if (bosswait == bossdemora) {
stopAllSounds();
musicaBoss_snd.start(0, 9999);
clearInterval(arrInt);
rndmImg = 0;
fimg = _root[arrnm][rndmImg][0];
ftipo = _root[arrnm][rndmImg][1];
fx = stagex / 2;
fy = -30;
fspeed = _root[arrnm][rndmImg][4];
bonustipo = Math.floor((Math.random() * 5) + 1);
fatira = _root[arrnm][rndmImg][2];
fafreq = _root[arrnm][rndmImg][3];
makeEnemy(fimg, ftipo, fx, fy, fspeed, bonustipo, fatira, fafreq);
enemyVSbossCnt = 0;
bosswait = 0;
faseLength = undefined;
} else {
bosswait++;
}
} else {
if (arrayintro == undefined) {
arrayintro = _root[arrnm].length - 1;
}
if (arrayintro > arraySel) {
arrayintro = arrayintro - arraySpeed;
}
if ((arrayoutro < arraySel) && (arrayintro > (-arraySelTamanho))) {
arrayoutro = arrayoutro + arraySpeed;
}
rndmImg = Math.floor(Math.random() * ((_root[arrnm].length - Math.floor(arrayintro)) - 1)) + Math.floor(arrayoutro);
if (_root[arrnm][rndmImg][5] == 0) {
if (repetir) {
clonarMonstros();
clonarStop = Math.floor(Math.random() * 5);
if (clonarStop == 0) {
repetir = false;
}
} else {
criarMonstrosNormalmente(false);
}
} else if (_root[arrnm][rndmImg][5] == 2) {
criarMonstrosNormalmente(true);
} else if (_root[arrnm][rndmImg][5] == 1) {
repetir = true;
criarMonstrosNormalmente(false);
}
enemyVSbossCnt++;
}
}
function makeMeteorz() {
playerLayer.attachMovie("meteorz", "meteorz", 100);
playerLayer.meteorz.viver = function () {
meteorzdx = playerLayer.nave._x - this._x;
meteorzdy = playerLayer.nave._y - this._y;
this._x = this._x + (meteorzdx / 2);
this._y = this._y + (meteorzdy / 2);
i = 0;
while (i < 30) {
nm = "enemy" + i;
if (this.hitTest(enemyLayer[nm]) && (this.rock._currentframe == 1)) {
enemyLayer[nm].life = enemyLayer[nm].life - 0.5;
this.rock.play();
enemyLayer[nm].blink.play();
}
i++;
}
};
playerLayer.meteorz.onEnterFrame = playerLayer.meteorz.viver;
}
function makeHitmanjoe() {
playerLayer.attachMovie("hitmanjoe", "hitmanjoe", 110);
playerLayer.hitmanjoe.xside = stagex - (playerLayer.hitmanjoe._width / 2);
playerLayer.hitmanjoe.viver = function () {
joedx = (playerLayer.nave._x - this._x) + 50;
joedy = (playerLayer.nave._y - this._y) + 16;
this._x = this._x + (joedx / 4);
this._y = this._y + (joedy / 4);
if (this._x > this.xside) {
this._x = this.xside;
}
if ((balaTimer == 1) || (balaTimer == 5)) {
playerLayer.hitmanjoe.tirofire.play();
bnm = "bala_" + balaCnt;
balaLayer.attachMovie("joebala", bnm, 99 + balaCnt);
balaLayer[bnm].dx = (Math.random() * 3) - 1;
balaLayer[bnm].dy = balaSpeed + 2;
balaLayer[bnm]._x = this._x;
balaLayer[bnm]._y = this._y - 50;
balaLayer[bnm].onEnterFrame = function () {
i = 0;
while (i < 23) {
nm = "enemy" + i;
if (this.hitTest(enemyLayer[nm])) {
enemyLayer[nm].life = enemyLayer[nm].life - 0.25;
delete this.onEnterFrame;
this.play();
}
i++;
}
if (this._y < -5) {
this.removeMovieClip();
delete this.onEnterFrame;
}
this._x = this._x + this.dx;
this._y = this._y - this.dy;
};
balaCnt++;
balaCnt = balaCnt % balaCntMax;
}
};
playerLayer.hitmanjoe.onEnterFrame = playerLayer.hitmanjoe.viver;
}
function makeKanguru() {
playerLayer.attachMovie("kanguru", "kanguru", 120);
playerLayer.kanguru._x = playerLayer.nave._x - 50;
playerLayer.kanguru._y = playerLayer.nave._y;
playerLayer.kanguru.dx = -12;
playerLayer.kanguru.dy = -12;
playerLayer.kanguru.count = 0;
playerLayer.kanguru.w = playerLayer.kanguru._width;
playerLayer.kanguru.viver = function () {
if (this.count < 4) {
if (((this._x + this.dx) < this.w) || ((this._x + this.dx) > (stagex - this.w))) {
this.dx = this.dx * -1;
this.count++;
}
if (((this._y + this.dy) < this.w) || ((this._y + this.dy) > (stagey - this.w))) {
this.dy = this.dy * -1;
this.count++;
}
} else {
randomdir = Math.round((Math.random() * 2) - 1);
if (randomdir != 0) {
randomdx = Math.ceil((Math.random() * 8) + 8) * randomdir;
} else {
randomdx = Math.ceil((Math.random() * 8) + 8);
}
if ((this._x > (playerLayer.nave._x - 58)) && (this._x < (playerLayer.nave._x - 42))) {
if ((this._y > (playerLayer.nave._y - 8)) && (this._y < (playerLayer.nave._y + 8))) {
this.dx = -randomdx;
this.dy = Math.abs(randomdx) - 24;
this.count = 0;
}
} else {
kangdx = (playerLayer.nave._x - 50) - this._x;
kangdy = playerLayer.nave._y - this._y;
this.dx = kangdx / 12;
this.dy = kangdy / 12;
}
}
this._x = this._x + this.dx;
this._y = this._y + this.dy;
i = 0;
while (i < 30) {
nm = "enemy" + i;
if (this.hitTest(enemyLayer[nm]) && (this.boomerang._currentframe == 1)) {
this.boomerang.play();
enemyLayer[nm].life = enemyLayer[nm].life - 1;
}
i++;
}
};
playerLayer.kanguru.onEnterFrame = playerLayer.kanguru.viver;
}
stop();
fase = 1;
faseMax = 3;
faseMonstroFreq = 600;
arrayintro = undefined;
arrayoutro = 1;
arraySpeed = 0.25;
arraySelTamanho = 6;
bosswait = 0;
bossdemora = 3;
enemyVSbossCnt = 0;
pontos_boni_div = (pontos_boni_orig = 140);
pontos_boni_grow = 10;
mLife1 = 2;
mLife2 = 3;
mLife3 = 4;
mLife4 = 6;
mLife5 = 12;
bossLife1 = 180;
bossLife2 = 210;
bossLife3 = 155;
mSpeed1 = 4.5;
mSpeed2 = 5;
mSpeed3 = 5.5;
mSpeed4 = 5.9;
mSpeed5 = 6.2;
mAtFreq1 = 200;
mAtFreq2 = 170;
mAtFreq3 = 140;
mAtFreq4 = 108;
stagex = 460;
stagey = 550;
naveLife = (origNaveLife = 3);
naveContinues = 3;
naveSpeed = (origNaveSpeed = 8);
maxNaveSpeed = 14;
balaTipo = 1;
balaFreq = (origBalaFreq = 7);
rocketTipo = (oldRocketTipo = 0);
amigoMeteorz = false;
amigoHitmanjoe = false;
amigoKanguru = false;
menu._visible = false;
fase1Array = [["boss1", 100, 1, mAtFreq4 - 50, mSpeed2, 0], ["obj4", 200, 0, 0, mSpeed3, 0], ["obj4", 200, 0, 0, mSpeed2, 2], ["lvl1_n1", 4.2, 0, mAtFreq2, mSpeed2, 1], ["lvl1_n1", 4, 0, mAtFreq2, mSpeed2, 1], [" ", undefined, undefined], ["obj4", 200, 0, 0, mSpeed2, 2], ["lvl1_n6", 6, 0, mAtFreq3, mSpeed3, 0], ["lvl1_n6", 6, 0, mAtFreq3, mSpeed3, 0], [" ", undefined, undefined], ["lvl1_n1", 4.2, 0, mAtFreq2, mSpeed2, 1], ["lvl1_n1", 4, 0, mAtFreq2, mSpeed4 + 3, 1], [" ", undefined, undefined], ["lvl1_n2", 1.2, 0, mAtFreq2, mSpeed2, 0], ["lvl1_n2", 1.2, 0, mAtFreq2, mSpeed2, 0], ["obj4", 200, 0, 0, mSpeed1, 2], ["lvl1_n6", 8, 1, mAtFreq2, mSpeed2, 0], ["lvl1_n6", 8, 0, mAtFreq3, mSpeed2, 0], [" ", undefined, undefined], ["lvl1_n3", 8, 1, mAtFreq2, mSpeed2, 0], ["lvl1_n3", 8, 0, mAtFreq3, mSpeed3, 0], [" ", undefined, undefined], ["obj1", 1, 0, 0, mSpeed1, 2], ["lvl1_n6", 6, 1, mAtFreq1, mSpeed2, 0], ["lvl1_n6", 6, 1, mAtFreq1, mSpeed2, 0], [" ", undefined, undefined], ["obj1", 1, 0, 0, mSpeed1, 2], ["lvl1_n6", 6, 1, mAtFreq1, mSpeed2, 0], ["lvl1_n6", 6, 1, mAtFreq1, mSpeed2, 0], [" ", undefined, undefined], ["obj5", 200, 0, 0, mSpeed1, 2], ["lvl1_n6", 8, 1, mAtFreq4, mSpeed4, 1], [" ", undefined, undefined], ["lvl1_n6", 5.2, 1, mAtFreq3, mSpeed2, 1], ["lvl1_n6", 5.3, 0, mAtFreq4, mSpeed2, 1], ["obj3", 200, 0, 0, mSpeed1, 2], ["obj5", 200, 0, 0, mSpeed1, 0], [" ", undefined, undefined], ["lvl1_n4", 3, 0, mAtFreq1, mSpeed2, 2], ["lvl1_n1", 1.1, 0, mAtFreq2, mSpeed2, 1], ["lvl1_n2", 1, 0, mAtFreq2, mSpeed2, 0], ["lvl1_n1", 5, 0, mAtFreq2, mSpeed2, 1], [" ", undefined, undefined], ["lvl1_n5", 1, 0, mAtFreq2, mSpeed4, 1], ["lvl1_n5", 1, 0, mAtFreq2, mSpeed5, 1], ["lvl1_n1", 4.1, 0, mAtFreq2, mSpeed4, 1], ["lvl1_n5", 8, 0, mAtFreq2, mSpeed3, 1], ["lvl1_n5", 8, 0, mAtFreq2, mSpeed3, 1], [" ", undefined, undefined], ["lvl1_n3", 5.1, 0, mAtFreq2, mSpeed3, 0], ["lvl1_n3", 5.3, 0, mAtFreq2, mSpeed3, 0], ["lvl1_n6", 5.2, 1, mAtFreq2, mSpeed5, 1], ["lvl1_n6", 5.2, 1, mAtFreq1, mSpeed5, 1], [" ", undefined, undefined], ["obj1", 1, 0, 0, mSpeed1, 2], ["lvl1_n2", 1.2, 0, mAtFreq2, mSpeed2, 0], ["lvl1_n4", 3, 0, mAtFreq2, mSpeed3, 0], ["lvl1_n6", 5.2, 1, mAtFreq3, mSpeed5, 1], ["lvl1_n6", 5.2, 1, mAtFreq2, mSpeed5, 1], [" ", undefined, undefined], ["lvl1_n1", 5, 0, mAtFreq3, mSpeed2, 0], ["lvl1_n3", 8, 0, mAtFreq3, mSpeed5, 0], ["lvl1_n6", 2, 1, mAtFreq3, mSpeed5, 1], ["lvl1_n6", 3, 0, mAtFreq2, mSpeed5, 1], ["lvl1_n1", 5, 0, mAtFreq3, mSpeed2, 0], ["lvl1_n3", 8, 0, mAtFreq3, mSpeed5, 0], [" ", undefined, undefined], [" ", undefined, undefined]];
fase2Array = [["boss2", 101, 1, mAtFreq4, mSpeed2, 0], ["lvl2_n3", 8, 0, mAtFreq1, mSpeed2, 0], [" ", undefined, undefined], ["lvl2_n3", 8.1, 0, mAtFreq1, mSpeed1, 1], ["lvl2_n3", 8.1, 1, mAtFreq1, mSpeed1, 0], ["lvl2_n1", 1, 0, mAtFreq1, mSpeed2, 0], ["lvl2_n1", 1, 0, mAtFreq1, mSpeed2, 0], [" ", undefined, undefined], ["lvl2_n6", 8, 0, mAtFreq1, mSpeed2, 1], ["obj3", 200, 0, 0, mSpeed1, 0], [" ", undefined, undefined], ["lvl2_n5", 3, 1, mAtFreq3, mSpeed1, 0], ["lvl2_n3", 7, 0, mAtFreq1, mSpeed2, 0], ["lvl1_n6", 5.1, 0, mAtFreq1, mSpeed4, 1], ["lvl1_n6", 5.3, 0, mAtFreq1, mSpeed4, 1], ["lvl2_n3", 7, 0, mAtFreq1, mSpeed2, 0], [" ", undefined, undefined], ["lvl2_n1", 4, 1, mAtFreq1, mSpeed2, 0], ["lvl2_n1", 4.2, 0, mAtFreq1, mSpeed3, 1], ["lvl2_n7", 8, 0, mAtFreq1, mSpeed3, 0], ["lvl2_n7", 8, 0, mAtFreq1, mSpeed3, 1], ["lvl2_n7", 8, 0, mAtFreq1, mSpeed3, 0], [" ", undefined, undefined], ["obj2", 200, 0, 0, mSpeed1, 0], ["obj6", 200, 0, 0, mSpeed1, 0], ["lvl2_n4", 6, 1, mAtFreq2, mSpeed2, 0], ["lvl2_n2", 1, 0, mAtFreq1, mSpeed4, 0], ["lvl1_n5", 1, 0, mAtFreq1, mSpeed4, 0], [" ", undefined, undefined], ["lvl1_n4", 3, 0, mAtFreq1, mSpeed3, 0], ["lvl2_n4", 6, 1, mAtFreq2, mSpeed2, 0], ["lvl2_n2", 1, 0, mAtFreq1, mSpeed4, 1], ["lvl2_n5", 3, 1, mAtFreq3, mSpeed1, 0], ["lvl2_n1", 1.3, 0, mAtFreq4, mSpeed3, 1], ["lvl2_n1", 1.3, 0, mAtFreq3, mSpeed3, 1], [" ", undefined, undefined], ["lvl2_n5", 3, 1, mAtFreq3, mSpeed1, 0], ["lvl2_n6", 5.1, 1, mAtFreq4, mSpeed3, 0], ["lvl2_n6", 5.1, 0, mAtFreq1, mSpeed3, 1], ["lvl2_n6", 5.1, 0, mAtFreq1, mSpeed3, 1], ["lvl1_n4", 1.3, 0, mAtFreq1, mSpeed4, 0], [" ", undefined, undefined], ["obj3", 200, 0, 0, mSpeed2, 2], ["obj5", 200, 0, 0, mSpeed3, 0], ["obj4", 200, 0, 0, mSpeed4, 0], ["lvl2_n3", 4.1, 0, mAtFreq1, mSpeed4, 0], ["lvl2_n3", 4.1, 0, mAtFreq1, mSpeed4, 0], ["obj1", 1, 0, 0, mSpeed1, 2], ["lvl2_n3", 4.2, 0, mAtFreq1, mSpeed3, 0], ["lvl2_n4", 6, 1, mAtFreq2, mSpeed2, 0], ["lvl2_n3", 4.2, 0, mAtFreq1, mSpeed3, 0], [" ", undefined, undefined], ["lvl2_n7", 1, 1, mAtFreq3, mSpeed2, 1], ["lvl2_n7", 1, 1, mAtFreq3, mSpeed2, 0], ["lvl2_n7", 1, 1, mAtFreq3, mSpeed2, 1], ["obj6", 200, 0, 0, mSpeed1, 0], ["obj7", 200, 0, 0, mSpeed1, 2], [" ", undefined, undefined], ["lvl2_n2", 1, 0, mAtFreq1, mSpeed3, 1], ["lvl2_n2", 1, 0, mAtFreq1, mSpeed3, 1], ["lvl2_n5", 3, 1, mAtFreq3, mSpeed1, 0], ["lvl2_n2", 1, 0, mAtFreq1, mSpeed3, 1], ["lvl2_n2", 1, 0, mAtFreq1, mSpeed3, 1], ["lvl2_n5", 3, 1, mAtFreq3, mSpeed1, 0], [" ", undefined, undefined], ["lvl2_n1", 2, 0, mAtFreq4, mSpeed3, 0], ["lvl2_n1", 2, 0, mAtFreq4, mSpeed3, 0], ["lvl2_n1", 2, 0, mAtFreq4, mSpeed4, 0], ["lvl2_n1", 2, 0, mAtFreq4, mSpeed5, 0], [" ", undefined, undefined], [" ", undefined, undefined]];
fase3Array = [["boss3", 102, 1, 40, 1, 0], ["obj8", 200, 0, 0, mSpeed1, 2], [" ", undefined, undefined], ["lvl3_n2", 1.2, 0, mAtFreq4, mSpeed1, 1], [" ", undefined, undefined], ["lvl3_n4", 2, 0, mAtFreq4, mSpeed2, 2], [" ", undefined, undefined], ["lvl1_n5", 1, 1, mAtFreq1, mSpeed3, 2], ["lvl1_n5", 1, 0, mAtFreq1, mSpeed3, 0], ["lvl1_n5", 2, 0, mAtFreq4, mSpeed3, 0], ["lvl1_n5", 2, 0, mAtFreq4, mSpeed3, 0], [" ", undefined, undefined], ["lvl1_n1", 4, 0, mAtFreq4, mSpeed3, 0], ["lvl2_n6", 4.2, 0, mAtFreq4, mSpeed3, 0], ["lvl1_n1", 4.2, 0, mAtFreq4, mSpeed4, 0], ["lvl2_n6", 4, 0, mAtFreq4, mSpeed4, 0], ["obj1", 1, 0, 0, mSpeed1, 2], [" ", undefined, undefined], ["lvl1_n1", 4.2, 0, mAtFreq4, mSpeed4, 0], ["lvl2_n4", 6, 0, mAtFreq4, mSpeed5, 2], ["lvl2_n4", 6, 0, mAtFreq4, mSpeed3, 1], ["lvl1_n3", 1.3, 1, mAtFreq1, mSpeed4, 0], ["obj9", 200, 0, 0, mSpeed1, 0], ["lvl1_n3", 1.3, 0, mAtFreq4, mSpeed4, 0], ["obj10", 200, 0, 0, mSpeed1, 0], [" ", undefined, undefined], ["lvl1_n2", 1, 0, mAtFreq4, mSpeed2, 0], ["lvl1_n4", 3, 0, mAtFreq4, mSpeed4, 2], ["lvl1_n2", 1, 0, mAtFreq4, mSpeed2, 0], ["obj8", 200, 0, 0, mSpeed1, 2], ["lvl3_n4", 2, 0, mAtFreq4, mSpeed1, 2], ["lvl1_n2", 1, 0, mAtFreq4, mSpeed2, 0], [" ", undefined, undefined], ["obj9", 200, 0, 0, mSpeed1, 2], ["lvl1_n1", 5, 0, mAtFreq4, mSpeed2, 1], ["lvl1_n1", 5, 1, mAtFreq3, mSpeed2, 0], ["lvl2_n7", 1, 0, mAtFreq4, mSpeed3, 0], ["lvl2_n1", 1, 0, mAtFreq4, mSpeed4, 0], [" ", undefined, undefined], ["obj2", 200, 0, 0, mSpeed1, 2], ["lvl3_n3", 2, 0, mAtFreq4, mSpeed4, 0], ["lvl3_n1", 3, 1, mAtFreq2, mSpeed2, 0], [" ", undefined, undefined], ["lvl3_n2", 8, 0, mAtFreq4, mSpeed3, 0], ["lvl3_n2", 8, 0, mAtFreq4, mSpeed3, 0], ["lvl2_n6", 5.2, 0, mAtFreq4, mSpeed3, 0], [" ", undefined, undefined], ["obj4", 200, 0, 0, mSpeed1, 2], ["lvl3_n2", 8.1, 1, mAtFreq1, mSpeed3, 0], ["lvl3_n2", 8.1, 0, mAtFreq4, mSpeed3, 0], ["lvl2_n6", 5, 0, mAtFreq4, mSpeed3, 0], ["obj3", 200, 0, 0, mSpeed1, 2], ["lvl3_n4", 2, 0, mAtFreq4, mSpeed2, 0], ["lvl3_n3", 8, 0, mAtFreq4, mSpeed5, 0], ["lvl3_n1", 1, 0, mAtFreq4, mSpeed5, 1], ["lvl1_n3", 4.1, 0, mAtFreq4, mSpeed4, 1], ["lvl1_n3", 4.1, 0, mAtFreq4, mSpeed4, 1], [" ", undefined, undefined], ["lvl3_n1", 1, 1, mAtFreq4, mSpeed5, 1], ["lvl3_n1", 1, 0, mAtFreq4, mSpeed5, 1], ["lvl2_n3", 4.2, 0, mAtFreq4, mSpeed4, 1], ["lvl2_n3", 4.2, 0, mAtFreq4, mSpeed4, 1], ["lvl1_n2", 1.2, 0, mAtFreq2, mSpeed2, 0], ["lvl1_n4", 1.3, 0, mAtFreq2, mSpeed3, 2], ["lvl2_n6", 5.2, 1, mAtFreq4, mSpeed5, 1], ["lvl1_n6", 5.2, 0, mAtFreq3, mSpeed5, 0], [" ", undefined, undefined], ["lvl2_n1", 8.1, 0, mAtFreq3, mSpeed4, 1], ["lvl2_n1", 8.1, 0, mAtFreq3, mSpeed4, 1], [" ", undefined, undefined], ["lvl3_n2", 4.2, 0, mAtFreq3, mSpeed4, 1], ["lvl3_n3", 4.2, 0, mAtFreq3, mSpeed4, 1], ["obj10", 200, 0, 0, mSpeed1, 2], ["obj8", 200, 0, 0, mSpeed1, 2]];
hurt = false;
hurtCnt = 0;
naveFriction = 0.8;
naveAcel = 4;
naveDiag = 0.8;
dx = 0;
dy = 0;
balaSpeed = 16;
balaLEFT = true;
balaCnt = 0;
balaCntMax = 64;
balaTimer = 0;
rocketSpeed = 12;
rocketAcel = (origRocketAcel = 3);
rocketTimer = 0;
balaviver = function () {
i = 0;
while (i < 23) {
nm = "enemy" + i;
if (enemyLayer[nm].hitTest(this._x, this._y, true)) {
hit_snd.start();
enemyLayer[nm].life--;
delete this.onEnterFrame;
this.play();
}
i++;
}
if ((((this._y < -5) || (this._y > (stagey + 5))) || (this._x < -5)) || (this._x > (stagex + 5))) {
this.removeMovieClip();
delete this.onEnterFrame;
}
this._x = this._x + this.dx;
this._y = this._y + this.dy;
};
enemyCnt = 0;
bonuscnt = 0;
pontos = 0;
pontos_boni = 0;
enmBalaSpeed = 5;
var arrInt;
criarMonstrosNormalmente = function (nurEinerDieserArt) {
if (derEinzige) {
var _local2 = _root[arrnm][rndmImg][0];
if (fimgoldCnt >= 10) {
fimg = (fimgold = (fimgEinz = _root[arrnm][rndmImg][0]));
derEinzige = false;
fimgoldCnt = 0;
} else {
if (fimgEinz == _local2) {
rndmImg = rndmImg + 1;
}
fimg = (fimgold = _root[arrnm][rndmImg][0]);
fimgoldCnt++;
}
} else {
derEinzige = false;
fimg = (fimgold = (fimgEinz = _root[arrnm][rndmImg][0]));
}
ftipo = (ftipoold = _root[arrnm][rndmImg][1]);
fx = (fxold = Math.round(Math.random() * stagex));
fy = (fyold = -16);
fspeed = (fspeedold = _root[arrnm][rndmImg][4]);
if (pontos_boni >= pontos_boni_div) {
bdecide = Math.round((Math.random() * 16) + 1);
if (bdecide < 11) {
bonustipo = Math.round((Math.random() * 3) + 1);
} else if (bdecide < 14) {
bonustipo = 4;
} else {
bonustipo = Math.round((Math.random() * 3) + 5);
}
if ((bonustipo == 1) && (naveLife == origNaveLife)) {
bonustipo = 0;
} else if ((bonustipo == 2) && (naveSpeed == maxNaveSpeed)) {
bonustipo = 0;
} else if ((bonustipo == 3) && (balaTipo == 5)) {
bonustipo = 0;
} else if ((bonustipo == 4) && (rocketTipo == 3)) {
bonustipo = 0;
} else if ((bonustipo == 5) && (amigoMeteorz)) {
bonustipo = 0;
} else if ((bonustipo == 6) && (amigoHitmanjoe)) {
bonustipo = 0;
} else if ((bonustipo == 7) && (amigoKanguru)) {
bonustipo = 0;
} else {
pontos_boni = 0;
}
} else {
bonustipo = 0;
}
fatira = (fatiraold = _root[arrnm][rndmImg][2]);
fafreq = (fafreqold = _root[arrnm][rndmImg][3]);
makeEnemy(fimg, ftipo, fx, fy, fspeed, bonustipo, fatira, fafreq);
if (nurEinerDieserArt) {
derEinzige = true;
}
};
clonarMonstros = function () {
fimgoldCnt++;
fimg = fimgold;
ftipo = ftipoold;
fx = fxold;
fy = fyold;
fspeed = fspeedold;
bonustipo = 0;
fatira = fatiraold;
fafreq = fafreqold;
makeEnemy(fimg, ftipo, fx, fy, fspeed, bonustipo, fatira, fafreq);
};
_root.createEmptyMovieClip("pausador", 1024);
pausador.pausado = false;
pausador.pausable = true;
pausador.balapausa = [[]];
pausador.pausar = function () {
_root.attachMovie("pauseScreen", "screen", 1000);
_root.screen._x = 0;
_root.screen._y = 0;
delete playerLayer.nave.onEnterFrame;
i = 0;
while (i < 35) {
nm = "enemy" + i;
delete enemyLayer[nm].onEnterFrame;
enemyLayer[nm].animacao.stop();
enemyLayer[nm].animacao.animate = false;
if (enemyLayer[nm].tipo == 200) {
enemyLayer[nm].stop();
}
i++;
}
i = 0;
while (i < 17) {
nm = "bonus" + i;
delete bonusLayer[nm].onEnterFrame;
i++;
}
i = 0;
while (i < 65) {
bnm = "bala_" + i;
speed = balaLayer[bnm].speed;
dx = balaLayer[bnm].dx;
dy = balaLayer[bnm].dy;
this.balapausa[i] = [speed, dx, dy];
balaLayer[bnm].speed = 0;
balaLayer[bnm].dx = 0;
balaLayer[bnm].dy = 0;
i++;
}
rocketAcel = 0;
playerLayer.meteorz.stop();
delete playerLayer.hitmanjoe.onEnterFrame;
playerLayer.kanguru.stop();
delete playerLayer.kanguru.onEnterFrame;
clearInterval(arrInt);
delete bckgrndLayer.fargrnd.onEnterFrame;
delete bckgrndLayer.bckgrnd.onEnterFrame;
};
pausador.unpausar = function () {
_root.screen.removeMovieClip();
playerLayer.nave.onEnterFrame = naveAction;
i = 0;
while (i < 35) {
enemyLayer[nm].animacao.play();
enemyLayer[nm].animacao.animate = true;
nm = "enemy" + i;
if (enemyLayer[nm].tipo == 1) {
enmtipo1(nm);
}
if (enemyLayer[nm].tipo == 1.1) {
enmtipo1_1(nm);
}
if (enemyLayer[nm].tipo == 1.2) {
enmtipo1(nm);
}
if (enemyLayer[nm].tipo == 1.3) {
enmtipo1_3(nm);
} else if (enemyLayer[nm].tipo == 2) {
enmtipo2(nm);
} else if (enemyLayer[nm].tipo == 3) {
enmtipo3(nm);
} else if (enemyLayer[nm].tipo == 4) {
enmtipo4(nm);
} else if (enemyLayer[nm].tipo == 4.1) {
enmtipo4_1(nm);
} else if (enemyLayer[nm].tipo == 4.2) {
enmtipo4_2(nm);
} else if (enemyLayer[nm].tipo == 5) {
enmtipo5(nm);
} else if (enemyLayer[nm].tipo == 5.1) {
enmtipo5_1(nm);
} else if (enemyLayer[nm].tipo == 5.2) {
enmtipo5_2(nm);
} else if (enemyLayer[nm].tipo == 5.3) {
enmtipo5_3(nm);
} else if (enemyLayer[nm].tipo == 6) {
enmtipo6(nm);
} else if (enemyLayer[nm].tipo == 7) {
enmtipo7(nm);
} else if (enemyLayer[nm].tipo == 8) {
enmtipo8(nm);
} else if (enemyLayer[nm].tipo == 8.1) {
enmtipo8_1(nm);
} else if (enemyLayer[nm].tipo == 9) {
enmtipo9(nm);
} else if (enemyLayer[nm].tipo == 10) {
enmtipo10(nm);
} else if (enemyLayer[nm].tipo == 11) {
enmtipo11(nm);
} else if (enemyLayer[nm].tipo == 100) {
enmtipo100(nm);
} else if (enemyLayer[nm].tipo == 101) {
enmtipo101(nm);
} else if (enemyLayer[nm].tipo == 102) {
enmtipo102(nm);
} else if (enemyLayer[nm].tipo == 103) {
enmtipo103(nm);
} else if (enemyLayer[nm].tipo == 200) {
enmtipo200(nm);
enemyLayer[nm].play();
}
i++;
}
i = 0;
while (i < 17) {
nm = "bonus" + i;
bonusLayer[nm].onEnterFrame = bonusaction;
i++;
}
i = 0;
while (i < 65) {
bnm = "bala_" + i;
balaLayer[bnm].speed = this.balapausa[i][0];
balaLayer[bnm].dx = this.balapausa[i][1];
balaLayer[bnm].dy = this.balapausa[i][2];
i++;
}
rocketAcel = origRocketAcel;
playerLayer.meteorz.play();
playerLayer.hitmanjoe.onEnterFrame = playerLayer.hitmanjoe.viver;
playerLayer.kanguru.play();
playerLayer.kanguru.onEnterFrame = playerLayer.kanguru.viver;
bckgrndLayer.fargrnd.onEnterFrame = fargrndmove;
bckgrndLayer.bckgrnd.onEnterFrame = bckgrndmove;
clearInterval(arrInt);
arrInt = setInterval(faseBuilder, faseMonstroFreq);
};
pausador.onEnterFrame = function () {
if ((Key.isDown(80) && (this.pausable)) && (_root.enemyLayer.check == true)) {
this.pausable = false;
if (!this.pausado) {
this.pausar();
this.pausado = true;
} else if (this.pausado) {
this.unpausar();
this.pausado = false;
}
} else if (Key.isDown(80)) {
} else {
this.pausable = true;
}
};
var laser1_snd = new Sound();
laser1_snd.attachSound("laser1", 1);
var laser2_snd = new Sound();
laser2_snd.attachSound("laser2");
var rocket_snd = new Sound();
rocket_snd.attachSound("rocket");
var bonus_snd = new Sound();
bonus_snd.attachSound("bonus");
var hit_snd = new Sound();
hit_snd.attachSound("hitsound");
var explosion_snd = new Sound();
explosion_snd.attachSound("explosion");
var hurt_snd = new Sound();
hurt_snd.attachSound("hurtsound");
var musicaTema_snd = new Sound();
musicaTema_snd.attachSound("musicatema");
var musica1_snd = new Sound();
musica1_snd.attachSound("musica1");
var musica2_snd = new Sound();
musica2_snd.attachSound("musica2");
var musica3_snd = new Sound();
musica3_snd.attachSound("musica3");
var musicaBoss_snd = new Sound();
musicaBoss_snd.attachSound("musicaBoss");
var musicaGameOver_snd = new Sound();
musicaGameOver_snd.attachSound("musicaGameOver");
Symbol 7 MovieClip [quadrat] Frame 1
this.life = 2;
this.lifepoints = 20;
stop();
Symbol 7 MovieClip [quadrat] Frame 13
delete this.onEnterFrame;
this.unloadMovie();
Symbol 14 MovieClip [triangulo] Frame 1
this.life = 30;
this.lifepoints = 80;
stop();
Symbol 14 MovieClip [triangulo] Frame 10
delete this.onEnterFrame;
this.unloadMovie();
Symbol 31 MovieClip [boss2] Frame 1
this.life = _root.bossLife2;
this.lifepoints = this.life * 10;
stop();
Symbol 31 MovieClip [boss2] Frame 65
delete this.onEnterFrame;
this.unloadMovie();
_root.finalDaFase();
Symbol 463 MovieClip [__Packages.MochiAd] Frame 0
class MochiAd
{
function MochiAd () {
}
static function getVersion() {
return("2.2");
}
static function showPreGameAd(options) {
var _local27 = {clip:_root, ad_timeout:3000, fadeout_time:250, regpt:"o", method:"showPreloaderAd", color:16747008, background:16777161, outline:13994812, ad_started:function () {
this.clip.stop();
}, ad_finished:function () {
this.clip.play();
}};
options = _parseOptions(options, _local27);
var clip = options.clip;
var _local23 = 11000;
var _local26 = options.ad_timeout;
delete options.ad_timeout;
var fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!load(options)) {
options.ad_finished();
return(undefined);
}
options.ad_started();
var mc = clip._mochiad;
mc.onUnload = function () {
options.ad_finished();
};
var _local14 = _getRes(options);
var _local4 = _local14[0];
var _local13 = _local14[1];
mc._x = _local4 * 0.5;
mc._y = _local13 * 0.5;
var chk = mc.createEmptyMovieClip("_mochiad_wait", 3);
chk._x = _local4 * -0.5;
chk._y = _local13 * -0.5;
var _local7 = chk.createEmptyMovieClip("_mochiad_bar", 4);
_local7._x = 10;
_local7._y = _local13 - 20;
var _local22 = options.color;
delete options.color;
var _local19 = options.background;
delete options.background;
var _local24 = options.outline;
delete options.outline;
var _local5 = _local7.createEmptyMovieClip("_outline", 1);
_local5.beginFill(_local19);
_local5.moveTo(0, 0);
_local5.lineTo(_local4 - 20, 0);
_local5.lineTo(_local4 - 20, 10);
_local5.lineTo(0, 10);
_local5.lineTo(0, 0);
_local5.endFill();
var _local3 = _local7.createEmptyMovieClip("_inside", 2);
_local3.beginFill(_local22);
_local3.moveTo(0, 0);
_local3.lineTo(_local4 - 20, 0);
_local3.lineTo(_local4 - 20, 10);
_local3.lineTo(0, 10);
_local3.lineTo(0, 0);
_local3.endFill();
_local3._xscale = 0;
var _local6 = _local7.createEmptyMovieClip("_outline", 3);
_local6.lineStyle(0, _local24, 100);
_local6.moveTo(0, 0);
_local6.lineTo(_local4 - 20, 0);
_local6.lineTo(_local4 - 20, 10);
_local6.lineTo(0, 10);
_local6.lineTo(0, 0);
chk.ad_msec = _local23;
chk.ad_timeout = _local26;
chk.started = getTimer();
chk.showing = false;
chk.last_pcnt = 0;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function () {
var _local2 = 100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time));
if (_local2 > 0) {
this._parent._alpha = _local2;
} else {
var _local3 = this._parent._parent;
MochiAd.unload(_local3);
delete this.onEnterFrame;
}
};
mc.lc.adLoaded = function (width, height) {
};
mc.lc.adjustProgress = function (msec) {
var _local2 = this.mc._mochiad_wait;
_local2.server_control = true;
_local2.started = getTimer();
_local2.ad_msec = msec;
};
chk.onEnterFrame = function () {
var _local6 = this._parent._parent;
var _local12 = this._parent._mochiad_ctr;
var _local5 = getTimer() - this.started;
var _local3 = false;
var _local4 = _local6.getBytesTotal();
var _local8 = _local6.getBytesLoaded();
var _local10 = (100 * _local8) / _local4;
var _local11 = (100 * _local5) / chk.ad_msec;
var _local9 = this._mochiad_bar._inside;
var _local2 = Math.min(100, Math.min(_local10 || 0, _local11));
_local2 = Math.max(this.last_pcnt, _local2);
this.last_pcnt = _local2;
_local9._xscale = _local2;
if (!chk.showing) {
var _local7 = _local12.getBytesTotal();
if ((_local7 > 0) || (typeof(_local7) == "undefined")) {
chk.showing = true;
chk.started = getTimer();
} else if (_local5 > chk.ad_timeout) {
_local3 = true;
}
}
if (_local5 > chk.ad_msec) {
_local3 = true;
}
if (((_local4 > 0) && (_local8 >= _local4)) && (_local3)) {
if (this.server_control) {
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = chk.fadeFunction;
}
}
};
}
static function showInterLevelAd(options) {
var _local13 = {clip:_root, ad_timeout:2000, fadeout_time:250, regpt:"o", method:"showTimedAd", ad_started:function () {
this.clip.stop();
}, ad_finished:function () {
this.clip.play();
}};
options = _parseOptions(options, _local13);
var clip = options.clip;
var _local10 = 11000;
var _local12 = options.ad_timeout;
delete options.ad_timeout;
var fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!load(options)) {
options.ad_finished();
return(undefined);
}
options.ad_started();
var mc = clip._mochiad;
mc.onUnload = function () {
options.ad_finished();
};
var _local5 = _getRes(options);
var _local14 = _local5[0];
var _local11 = _local5[1];
mc._x = _local14 * 0.5;
mc._y = _local11 * 0.5;
var chk = mc.createEmptyMovieClip("_mochiad_wait", 3);
chk.ad_msec = _local10;
chk.ad_timeout = _local12;
chk.started = getTimer();
chk.showing = false;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function () {
var _local2 = 100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time));
if (_local2 > 0) {
this._parent._alpha = _local2;
} else {
var _local3 = this._parent._parent;
MochiAd.unload(_local3);
delete this.onEnterFrame;
}
};
mc.lc.adLoaded = function (width, height) {
};
mc.lc.adjustProgress = function (msec) {
var _local2 = this.mc._mochiad_wait;
_local2.server_control = true;
_local2.started = getTimer();
_local2.ad_msec = msec - 250;
};
chk.onEnterFrame = function () {
var _local5 = this._parent._mochiad_ctr;
var _local4 = getTimer() - this.started;
var _local2 = false;
if (!chk.showing) {
var _local3 = _local5.getBytesTotal();
if ((_local3 > 0) || (typeof(_local3) == "undefined")) {
chk.showing = true;
chk.started = getTimer();
} else if (_local4 > chk.ad_timeout) {
_local2 = true;
}
}
if (_local4 > chk.ad_msec) {
_local2 = true;
}
if (_local2) {
if (this.server_control) {
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = this.fadeFunction;
}
}
};
}
static function showTimedAd(options) {
showInterLevelAd(options);
}
static function showPreloaderAd(options) {
showPreGameAd(options);
}
static function _allowDomains(server) {
var _local1 = server.split("/")[2].split(":")[0];
if (System.security) {
if (System.security.allowDomain) {
System.security.allowDomain("*");
System.security.allowDomain(_local1);
}
if (System.security.allowInsecureDomain) {
System.security.allowInsecureDomain("*");
System.security.allowInsecureDomain(_local1);
}
}
return(_local1);
}
static function _loadCommunicator(options) {
var _local26 = {clip:_root, com_server:"http://x.mochiads.com/com/1/", method:"loadCommunicator", depth:10337, id:"_UNKNOWN_"};
options = _parseOptions(options, _local26);
options.swfv = options.clip.getSWFVersion() || 6;
options.mav = getVersion();
var _local18 = options.clip;
var _local20 = "_mochiad_com_" + options.id;
if (!_isNetworkAvailable()) {
return(null);
}
if (_local18[_local20]) {
return(_local18[_local20].lc);
}
var _local21 = options.com_server + options.id;
_allowDomains(_local21);
delete options.id;
delete options.com_server;
var _local25 = options.depth;
delete options.depth;
var _local17 = _local18.createEmptyMovieClip(_local20, _local25);
var _local11 = _local17.createEmptyMovieClip("_mochiad_com", 1);
for (var _local15 in options) {
_local11[_local15] = options[_local15];
}
var _local6 = new LocalConnection();
var _local16 = ["", Math.floor(new Date().getTime()), random(999999)].join("_");
_local6.mc = _local17;
_local6.name = _local16;
_local6.allowDomain = function (d) {
return(true);
};
_local6.allowInsecureDomain = _local6.allowDomain;
_local6.connect(_local16);
_local17.lc = _local6;
_local11.lc = _local16;
_local6._id = 0;
_local6._queue = [];
_local6.rpcResult = function (cb_arg) {
var _local8 = parseInt(cb_arg);
var _local4 = this._callbacks[_local8];
if (!_local4) {
return(undefined);
}
delete this._callbacks[_local8];
var _local5 = [];
var _local3 = 2;
while (_local3 < _local4.length) {
_local5.push(_local4[_local3]);
_local3++;
}
_local3 = 1;
while (_local3 < arguments.length) {
_local5.push(arguments[_local3]);
_local3++;
}
var _local6 = _local4[1];
var _local7 = _local4[0];
if (_local7 && (typeof(_local6) == "string")) {
_local6 = _local7[_local6];
}
if (_local6) {
_local6.apply(_local7, _local5);
}
};
_local6._didConnect = function (endpoint) {
this._endpoint = endpoint;
var _local4 = this._queue;
delete this._queue;
var _local5 = this.doSend;
var _local2 = 0;
while (_local2 < _local4.length) {
var _local3 = _local4[_local2];
_local5.apply(this, _local3);
_local2++;
}
};
_local6.doSend = function (args, cbobj, cbfn) {
if (this._endpoint == null) {
var _local4 = [];
var _local3 = 0;
while (_local3 < arguments.length) {
_local4.push(arguments[_local3]);
_local3++;
}
this._queue.push(_local4);
return(undefined);
}
this._id = this._id + 1;
var _local5 = this._id;
if ((cbfn === undefined) || (cbfn === null)) {
cbfn = cbobj;
}
this._callbacks[_local5] = [cbobj, cbfn];
var _local7 = new LocalConnection();
var _local9 = _local7.send(this._endpoint, "rpc", _local5, args);
};
_local6._callbacks = {};
_local6._callbacks[0] = [_local6, "_didConnect"];
_local11.st = getTimer();
_local11.loadMovie(_local21 + ".swf", "POST");
return(_local6);
}
static function fetchHighScores(options, callbackObj, callbackMethod) {
var _local1 = _loadCommunicator({id:options.id});
if (!_local1) {
return(false);
}
var _local4 = ["fetchHighScores", options];
_local1.doSend(["fetchHighScores", options], callbackObj, callbackMethod);
return(true);
}
static function sendHighScore(options, callbackObj, callbackMethod) {
var _local1 = _loadCommunicator({id:options.id});
if (!_local1) {
return(false);
}
var _local4 = ["sendHighScore", options];
_local1.doSend(["sendHighScore", options], callbackObj, callbackMethod);
return(true);
}
static function load(options) {
var _local13 = {clip:_root, server:"http://x.mochiads.com/srv/1/", method:"load", depth:10333, id:"_UNKNOWN_"};
options = _parseOptions(options, _local13);
options.swfv = options.clip.getSWFVersion() || 6;
options.mav = getVersion();
var _local9 = options.clip;
if (!_isNetworkAvailable()) {
return(null);
}
if (_local9._mochiad_loaded) {
return(null);
}
var _local12 = options.depth;
delete options.depth;
var _local6 = _local9.createEmptyMovieClip("_mochiad", _local12);
var _local11 = _getRes(options);
options.res = (_local11[0] + "x") + _local11[1];
options.server = options.server + options.id;
delete options.id;
_local9._mochiad_loaded = true;
var _local4 = _local6.createEmptyMovieClip("_mochiad_ctr", 1);
for (var _local7 in options) {
_local4[_local7] = options[_local7];
}
var _local10 = _local4.server;
delete _local4.server;
var _local14 = _allowDomains(_local10);
_local6.onEnterFrame = function () {
if (this._mochiad_ctr._url != this._url) {
this.onEnterFrame = function () {
if (!this._mochiad_ctr) {
delete this.onEnterFrame;
MochiAd.unload(this._parent);
}
};
}
};
var _local5 = new LocalConnection();
var _local8 = ["", Math.floor(new Date().getTime()), random(999999)].join("_");
_local5.mc = _local6;
_local5.name = _local8;
_local5.hostname = _local14;
_local5.allowDomain = function (d) {
return(true);
};
_local5.allowInsecureDomain = _local5.allowDomain;
_local5.connect(_local8);
_local6.lc = _local5;
_local4.lc = _local8;
_local4.st = getTimer();
_local4.loadMovie(_local10 + ".swf", "POST");
return(_local6);
}
static function unload(clip) {
if (typeof(clip) == "undefined") {
clip = _root;
}
if (clip.clip && (clip.clip._mochiad)) {
clip = clip.clip;
}
if (!clip._mochiad) {
return(false);
}
clip._mochiad.removeMovieClip();
delete clip._mochiad_loaded;
delete clip._mochiad;
return(true);
}
static function _isNetworkAvailable() {
if (System.security) {
var _local1 = System.security;
if (_local1.sandboxType == "localWithFile") {
return(false);
}
}
return(true);
}
static function _getRes(options) {
var _local3 = options.clip.getBounds();
var _local2 = 0;
var _local1 = 0;
if (typeof(options.res) != "undefined") {
var _local4 = options.res.split("x");
_local2 = parseFloat(_local4[0]);
_local1 = parseFloat(_local4[1]);
} else {
_local2 = _local3.xMax - _local3.xMin;
_local1 = _local3.yMax - _local3.yMin;
}
if ((_local2 == 0) || (_local1 == 0)) {
_local2 = Stage.width;
_local1 = Stage.height;
}
return([_local2, _local1]);
}
static function _parseOptions(options, defaults) {
var _local4 = {};
for (var _local8 in defaults) {
_local4[_local8] = defaults[_local8];
}
if (options) {
for (var _local8 in options) {
_local4[_local8] = options[_local8];
}
}
if (_root.mochiad_options) {
var _local5 = _root.mochiad_options.split("&");
var _local2 = 0;
while (_local2 < _local5.length) {
var _local3 = _local5[_local2].split("=");
_local4[unescape(_local3[0])] = unescape(_local3[1]);
_local2++;
}
}
if (_local4.id == "test") {
trace("[MochiAd] WARNING: Using the MochiAds test identifier, make sure to use the code from your dashboard, not this example!");
}
return(_local4);
}
}
Symbol 33 MovieClip Frame 1
stop();
Symbol 33 MovieClip Frame 120
this.unloadMovie();
Symbol 56 MovieClip [lvl1_n1] Frame 1
this.life = _root.mLife1 - 1;
this.lifepoints = this.life * 10;
stop();
Symbol 56 MovieClip [lvl1_n1] Frame 9
delete this.onEnterFrame;
this.unloadMovie();
Symbol 70 MovieClip [boss1] Frame 1
this.life = _root.bossLife1;
this.lifepoints = this.life * 10;
stop();
Symbol 70 MovieClip [boss1] Frame 10
Symbol 70 MovieClip [boss1] Frame 30
delete this.onEnterFrame;
this.unloadMovie();
_root.finalDaFase();
Symbol 81 MovieClip [lvl1_n2] Frame 1
this.life = _root.mLife2;
this.lifepoints = this.life * 10;
stop();
Symbol 81 MovieClip [lvl1_n2] Frame 9
delete this.onEnterFrame;
this.unloadMovie();
Symbol 88 MovieClip [lvl1_n3] Frame 1
this.life = _root.mLife2;
this.lifepoints = this.life * 10;
stop();
Symbol 88 MovieClip [lvl1_n3] Frame 9
delete this.onEnterFrame;
this.unloadMovie();
Symbol 91 MovieClip Frame 1
stop();
this.cnt = 0;
this.dy = (this.dyOrig = 10);
this.goDown = (random(50) * 1) + 50;
this.onEnterFrame = function () {
this._rotation = this._rotation - (this.dy + 1);
if (this.cnt == (this.goDown + 15)) {
this.dy = this.dy * -1;
}
if (this.cnt > this.goDown) {
this._y = this._y + this.dy;
}
if (this.cnt == (this.goDown + 28)) {
this.dy = this.dyOrig;
}
this.cnt++;
this.cnt = this.cnt % (this.goDown + 29);
};
Symbol 98 MovieClip [lvl1_n4] Frame 1
this.life = _root.mLife5;
this.lifepoints = this.life * 10;
stop();
Symbol 98 MovieClip [lvl1_n4] Frame 9
delete this.onEnterFrame;
this.unloadMovie();
Symbol 108 MovieClip [lvl1_n5] Frame 1
this.life = _root.mLife3;
this.lifepoints = this.life * 10;
stop();
Symbol 108 MovieClip [lvl1_n5] Frame 9
delete this.onEnterFrame;
this.unloadMovie();
Symbol 115 MovieClip [lvl1_n6] Frame 1
this.life = _root.mLife1 - 1;
this.lifepoints = this.life * 10;
stop();
Symbol 115 MovieClip [lvl1_n6] Frame 9
delete this.onEnterFrame;
this.unloadMovie();
Symbol 129 MovieClip [lvl2_n1] Frame 1
this.life = _root.mLife1;
this.lifepoints = this.life * 10;
stop();
Symbol 129 MovieClip [lvl2_n1] Frame 11
delete this.onEnterFrame;
this.unloadMovie();
Symbol 132 MovieClip Frame 1
this.ccnt = 0;
this.ddy = 10;
this.animate = true;
this.onEnterFrame = function () {
if (this.animate == true) {
if (this.ccnt > 55) {
this._y = this._y + this.ddy;
}
this.ccnt++;
this.ccnt = this.ccnt % 65;
}
};
Symbol 135 MovieClip [lvl2_n2] Frame 1
this.life = _root.mLife4;
this.lifepoints = this.life * 10;
stop();
Symbol 135 MovieClip [lvl2_n2] Frame 11
delete this.onEnterFrame;
this.unloadMovie();
Symbol 140 MovieClip [lvl2_n3] Frame 1
this.life = _root.mLife1;
this.lifepoints = (this.life * 10) + 5;
stop();
Symbol 140 MovieClip [lvl2_n3] Frame 11
delete this.onEnterFrame;
this.removeMovieClip();
Symbol 156 MovieClip [lvl2_n4] Frame 1
this.life = _root.mLife3;
this.lifepoints = this.life * 10;
stop();
Symbol 156 MovieClip [lvl2_n4] Frame 11
delete this.onEnterFrame;
this.unloadMovie();
Symbol 161 MovieClip [lvl2_n5] Frame 1
this.life = _root.mLife5;
this.lifepoints = this.life * 10;
stop();
Symbol 161 MovieClip [lvl2_n5] Frame 11
delete this.onEnterFrame;
this.unloadMovie();
Symbol 165 MovieClip [lvl2_n6] Frame 1
this.life = _root.mLife1;
this.lifepoints = this.life * 10;
stop();
Symbol 165 MovieClip [lvl2_n6] Frame 11
delete this.onEnterFrame;
this.unloadMovie();
Symbol 177 MovieClip [lvl2_n7] Frame 1
this.life = _root.mLife2;
this.lifepoints = this.life * 10;
stop();
Symbol 177 MovieClip [lvl2_n7] Frame 9
delete this.onEnterFrame;
this.unloadMovie();
Symbol 183 MovieClip [boss3] Frame 1
this.life = _root.bossLife3;
this.lifepoints = this.life * 10;
stop();
Symbol 183 MovieClip [boss3] Frame 10
_root.enemyLauer.c1.removeMovieClip();
_root.enemyLauer.c2.removeMovieClip();
_root.enemyLauer.c3.removeMovieClip();
_root.enemyLauer.c4.removeMovieClip();
_root.enemyLauer.c5.removeMovieClip();
_root.enemyLauer.c6.removeMovieClip();
Symbol 183 MovieClip [boss3] Frame 65
delete this.onEnterFrame;
this.unloadMovie();
_root.finalDaFase();
Symbol 190 MovieClip [boss3c2] Frame 1
this.doNotTurn = true;
Symbol 210 MovieClip [lvl3_n1] Frame 1
this.life = _root.mLife3;
this.lifepoints = this.life * 10;
stop();
Symbol 210 MovieClip [lvl3_n1] Frame 11
delete this.onEnterFrame;
this.unloadMovie();
Symbol 213 MovieClip Frame 1
stop();
this.cnt = 0;
this.animate = true;
this.onEnterFrame = function () {
if (this.animate == true) {
if (this.cnt < 90) {
this._rotation = this._rotation - 0.5;
} else {
this._rotation = this._rotation - 9;
}
this.cnt++;
this.cnt = this.cnt % 120;
}
};
Symbol 214 MovieClip [lvl3_n2] Frame 1
this.life = _root.mLife2;
this.lifepoints = this.life * 10;
stop();
Symbol 214 MovieClip [lvl3_n2] Frame 11
delete this.onEnterFrame;
this.unloadMovie();
Symbol 220 MovieClip [lvl3_n3] Frame 1
this.life = _root.mLife3;
this.lifepoints = this.life * 10;
stop();
Symbol 220 MovieClip [lvl3_n3] Frame 11
delete this.onEnterFrame;
this.unloadMovie();
Symbol 227 MovieClip [lvl3_n4] Frame 1
this.life = _root.mLife5;
this.lifepoints = this.life * 10;
stop();
Symbol 227 MovieClip [lvl3_n4] Frame 11
delete this.onEnterFrame;
this.unloadMovie();
Symbol 235 MovieClip [obj1] Frame 1
this.life = 8;
this.lifepoints = 0;
stop();
Symbol 235 MovieClip [obj1] Frame 11
i = 0;
while (i < 23) {
nm = "enemy" + i;
_root.enemyLayer[nm].life = 0;
i++;
}
this.removeMovieClip();
Symbol 267 MovieClip [bala1] Frame 1
stop();
Symbol 267 MovieClip [bala1] Frame 4
this.unloadMovie();
Symbol 269 MovieClip Frame 1
stop();
Symbol 274 MovieClip [nave] Frame 1
stop();
Symbol 274 MovieClip [nave] Frame 5
_root.hurt_snd.start();
Symbol 274 MovieClip [nave] Frame 28
gotoAndStop (1);
Symbol 274 MovieClip [nave] Frame 33
_root.explosion_snd.start();
Symbol 274 MovieClip [nave] Frame 45
_root.explosion_snd.start();
Symbol 274 MovieClip [nave] Frame 57
_root.explosion_snd.start();
Symbol 274 MovieClip [nave] Frame 78
this.unloadMovie();
if (_root.naveContinues > 0) {
_root.continuar();
} else {
_root.gameOver();
}
Symbol 278 MovieClip [rocket1] Frame 1
stop();
Symbol 278 MovieClip [rocket1] Frame 6
this.unloadMovie();
Symbol 281 MovieClip [rocket2] Frame 1
stop();
Symbol 281 MovieClip [rocket2] Frame 6
this.unloadMovie();
Symbol 284 MovieClip [rocket3] Frame 1
stop();
Symbol 284 MovieClip [rocket3] Frame 6
this.unloadMovie();
Symbol 301 MovieClip [gameOverScreen] Frame 117
_root.unloadJogo();
Symbol 302 MovieClip [introScreen] Frame 30
this.unloadMovie();
Symbol 309 MovieClip [pauseScreen] Frame 5
stop();
Symbol 313 MovieClip Frame 1
stop();
Symbol 324 MovieClip [joebala] Frame 1
stop();
Symbol 324 MovieClip [joebala] Frame 5
this.unloadMovie();
Symbol 328 MovieClip Frame 1
stop();
Symbol 337 MovieClip Frame 1
stop();
Symbol 369 MovieClip [bonus3] Frame 1
this.gotoAndStop(_root.balaTipo);
Symbol 373 MovieClip [bonus4] Frame 1
this.gotoAndStop(_root.rocketTipo + 1);
Symbol 392 MovieClip Frame 1
stop();
Symbol 394 MovieClip Frame 1
stop();
Symbol 396 MovieClip Frame 1
stop();
Symbol 399 MovieClip Frame 1
stop();
Symbol 401 MovieClip Frame 1
stop();
Symbol 403 MovieClip Frame 1
stop();
Symbol 409 MovieClip Frame 4
stop();
Symbol 429 MovieClip Frame 1
stop();
soundBtn.onRelease = function () {
_root.musicaTema_snd.setVolume(0);
gotoAndStop (2);
};
Symbol 429 MovieClip Frame 2
stop();
soundBtn.onRelease = function () {
_root.musicaTema_snd.setVolume(100);
gotoAndStop (1);
};
Symbol 446 MovieClip Frame 78
stop();
Symbol 456 MovieClip Frame 94
stop();
Symbol 458 MovieClip Frame 1
_root.musicaTema_snd.start(0, 99);
Symbol 458 MovieClip Frame 543
stop();
_root.musicaTema_snd.stop();
_root.setupJogo();
Symbol 462 MovieClip Frame 1
stop();
_root.musicaTema_snd.start(0, 16);
startBtn.onRelease = function () {
play();
};
loadBtn.onRelease = function () {
_root.carregar();
};
ybutton.onRelease = function () {
getURL ("http://www.yudanazgames.com", "_blank");
};
this.pode = true;
this.onEnterFrame = function () {
if (Key.isDown(13)) {
if (this.pode == true) {
play();
}
this.pode = false;
} else {
this.pode = true;
}
};
Symbol 462 MovieClip Frame 2
stop();
_root.musicaTema_snd.stop();
goBtn.onRelease = function () {
play();
};
Symbol 462 MovieClip Frame 3
stop();
delete this.onEnterFrame;
this.onEnterFrame = function () {
if (Key.isDown(13)) {
if (this.pode == true) {
this.theStory.gotoAndPlay(543);
delete this.onEnterFrame;
}
this.pode = false;
} else {
this.pode = true;
}
};
skipBtn.onRelease = function () {
theStory.gotoAndPlay(543);
};