Frame 1
stop();
_root.ads = true;
Frame 2
stop();
Mouse.show();
_root.muteon = false;
var score = 0;
var stageChoose = 1;
play_btn.onRelease = (howToPlay_btn.onRelease = function () {
gotoAndStop ("howToPlay");
});
highScore_btn.onRelease = function () {
gotoAndStop ("highScore");
};
_root.menubg = new Sound();
_root.menubg.attachSound("menubg");
if (!_root.muteon) {
_root.menubg.stop();
_root.menubg.start(0, 999);
_root.menubg.setVolume(100);
} else {
_root.menubg.stop();
_root.menubg.start(0, 999);
_root.menubg.setVolume(0);
}
Frame 8
stop();
Mouse.show();
var score = 0;
var stageChoose = 1;
back_btn.onRelease = function () {
gotoAndStop ("title");
};
play_btn.onRelease = function () {
gotoAndStop ("townSelect");
};
Frame 16
stop();
Mouse.show();
var bounty = 10;
var enemyMoveSpeed = 1;
flag_1._visible = false;
flag_2._visible = false;
flag_3._visible = false;
flag_4._visible = false;
i = 1;
while (i < stageChoose) {
this["flag_" + i]._visible = true;
i++;
}
circle_mc1._visible = false;
circle_mc2._visible = false;
circle_mc3._visible = false;
circle_mc4._visible = false;
circle_mc5._visible = false;
this["circle_mc" + stageChoose]._visible = true;
back_btn.onRelease = function () {
gotoAndStop ("title");
};
play_btn.onRelease = function () {
gotoAndStop("intro_stage" + stageChoose +1);
};
Frame 21
stop();
Frame 26
stop();
Frame 31
stop();
back_btn.onRelease = function () {
gotoAndStop ("townSelect");
};
Frame 36
stop();
Frame 41
stop();
Frame 46
stop();
Frame 51
stop();
continue_btn.onRelease = function () {
gotoAndStop ("townSelect");
};
Frame 56
stop();
continue_btn.onRelease = function () {
gotoAndStop ("townSelect");
};
Frame 61
function mainMc() {
if (pause_mc._visible == false) {
Mouse.hide();
characterMove();
enemyMove();
bossMove();
objectMove();
bilang = bilang + 1;
}
target_mc._x = _xmouse;
target_mc._y = _ymouse;
}
function characterMove() {
radians = Math.atan2(_ymouse - char_mc._y, _xmouse - char_mc._x);
degrees = (radians / Math.PI) * 180;
char_mc._rotation = degrees;
if ((Key.isDown(38) || (Key.isDown(87))) && (char_mc._y > 0)) {
if (bg_mc._y >= -20) {
if ((char_mc._y > 0) && (char_mc._y < (Stage.height / 2))) {
char_mc._y = char_mc._y - moveSpeed;
bgMovesY = 0;
} else {
char_mc._y = char_mc._y - moveSpeed;
bgMovesY = 0;
}
} else if (char_mc._y >= (Stage.height / 2)) {
char_mc._y = char_mc._y - moveSpeed;
bgMovesY = 0;
} else {
bg_mc._y = bg_mc._y + moveSpeed;
bgMovesY = 1;
}
char_mc_dummy.char_mc.play();
} else if ((Key.isDown(40) || (Key.isDown(83))) && (char_mc._y < 400)) {
if (bg_mc._y <= ((Stage.height - 750) + 20)) {
if ((char_mc._y > (Stage.height / 2)) && (char_mc._y < Stage.height)) {
char_mc._y = char_mc._y + moveSpeed;
bgMovesY = 0;
} else {
char_mc._y = char_mc._y + moveSpeed;
bgMovesY = 0;
}
} else if (char_mc._y <= (Stage.height / 2)) {
char_mc._y = char_mc._y + moveSpeed;
bgMovesY = 0;
} else {
bg_mc._y = bg_mc._y - moveSpeed;
bgMovesY = -1;
}
char_mc_dummy.char_mc.play();
} else {
bgMovesY = 0;
}
if ((Key.isDown(37) || (Key.isDown(65))) && (char_mc._x > 0)) {
if (bg_mc._x >= -20) {
if ((char_mc._x > 0) && (char_mc._x < (Stage.width / 2))) {
char_mc._x = char_mc._x - moveSpeed;
bgMovesX = 0;
} else {
char_mc._x = char_mc._x - moveSpeed;
bgMovesX = 0;
}
} else if (char_mc._x >= (Stage.width / 2)) {
char_mc._x = char_mc._x - moveSpeed;
bgMovesX = 0;
} else {
bg_mc._x = bg_mc._x + moveSpeed;
bgMovesX = 1;
}
char_mc_dummy.char_mc.play();
} else if ((Key.isDown(39) || (Key.isDown(68))) && (char_mc._x < 640)) {
if (bg_mc._x <= ((Stage.width - 1020) + 20)) {
if ((char_mc._x > (Stage.width / 2)) && (char_mc._x < Stage.width)) {
char_mc._x = char_mc._x + moveSpeed;
bgMovesX = 0;
} else {
char_mc._x = char_mc._x + moveSpeed;
bgMovesX = 0;
}
} else if (char_mc._x <= (Stage.width / 2)) {
char_mc._x = char_mc._x + moveSpeed;
bgMovesX = 0;
} else {
bg_mc._x = bg_mc._x - moveSpeed;
bgMovesX = -1;
}
char_mc_dummy.char_mc.play();
} else {
bgMovesX = 0;
}
if ((Key.isDown(32) || (Key.isDown(17))) && (bombLimit > 0)) {
charBombNow();
}
char_mc_dummy._x = char_mc._x;
char_mc_dummy._y = char_mc._y + 30;
map_mc.map_mychar._x = char_mc._x / 8;
map_mc.map_mychar._y = char_mc._y / 8;
mouseRotate(char_mc_dummy, degrees);
if (char_mc_dummy._alpha == 50) {
hitDelay = hitDelay - 1;
}
if (hitDelay <= 0) {
char_mc_dummy._alpha = 100;
hitDelay = 5;
}
if (fireDelay > 0) {
fireDelay = fireDelay - 1;
}
if (fireHold > 0) {
charShootNow();
}
if (bombDelay > 0) {
bombDelay = bombDelay - 1;
}
multiplier_mc.multiplier_txt.text = "x" + multiplier;
if (stats_mc.combo_mc._xscale > 0) {
stats_mc.combo_mc._xscale = stats_mc.combo_mc._xscale - 1;
}
}
function enemyMove() {
i = 0;
while (i < enemyNumber) {
this["enemy_mc" + i]._visible = false;
radiansEnemy = Math.atan2(char_mc._y - this["enemy_mc" + i]._y, char_mc._x - this["enemy_mc" + i]._x);
degreesEnemy = (radiansEnemy / Math.PI) * 180;
this["enemy_mc" + i]._rotation = degreesEnemy;
mouseRotate(this["enemy_mc_dummy" + i], degreesEnemy);
if (this["enemy_mc_dummy" + i]._alpha == 50) {
this["enemy_mc" + i].enemyDelay = this["enemy_mc" + i].enemyDelay - 1;
}
if (this["enemy_mc" + i].enemyDelay <= 0) {
this["enemy_mc_dummy" + i]._alpha = 100;
this["enemy_mc" + i].enemyDelay = this["enemy_mc" + i].enemyDelay - 1;
}
collideEnemy(i);
if (this["enemy_mc" + i].enemyMove > 0) {
if ((Math.sqrt(Math.pow(char_mc._y - this["enemy_mc" + i]._y, 2) + Math.pow(char_mc._x - this["enemy_mc" + i]._x, 2)) > 100) && (collideEnemy(i) == false)) {
if ((char_mc._x < this["enemy_mc" + i]._x) && (Math.abs(char_mc._x - this["enemy_mc" + i]._x) > 1)) {
this["enemy_mc" + i]._x = this["enemy_mc" + i]._x - enemyMoveSpeed;
} else if ((char_mc._x > this["enemy_mc" + i]._x) && (Math.abs(char_mc._x - this["enemy_mc" + i]._x) > 1)) {
this["enemy_mc" + i]._x = this["enemy_mc" + i]._x + enemyMoveSpeed;
}
if ((char_mc._y < this["enemy_mc" + i]._y) && (Math.abs(char_mc._y - this["enemy_mc" + i]._y) > 1)) {
this["enemy_mc" + i]._y = this["enemy_mc" + i]._y - enemyMoveSpeed;
} else if ((char_mc._y > this["enemy_mc" + i]._y) && (Math.abs(char_mc._y - this["enemy_mc" + i]._y) > 1)) {
this["enemy_mc" + i]._y = this["enemy_mc" + i]._y + enemyMoveSpeed;
}
this["enemy_mc_dummy" + i]._x = this["enemy_mc" + i]._x;
this["enemy_mc_dummy" + i]._y = this["enemy_mc" + i]._y + 30;
map_mc["map_char" + i]._x = this["enemy_mc" + i]._x / 8;
map_mc["map_char" + i]._y = this["enemy_mc" + i]._y / 8;
this["enemy_mc_dummy" + i].char_mc.play();
this["enemy_mc_dummy" + i].swapDepths(this["enemy_mc_dummy" + i]._y);
}
this["enemy_mc" + i].enemyMove = this["enemy_mc" + i].enemyMove - 1;
} else if (this["enemy_mc" + i].enemyShoot > 0) {
this["enemy_mc" + i].enemyShoot = this["enemy_mc" + i].enemyShoot - 1;
if (this["enemy_mc" + i].enemyShoot == 30) {
enemyShootNow(i);
}
} else if (bounty > 0) {
this["enemy_mc" + i].enemyMove = 50;
this["enemy_mc" + i].enemyShoot = 50;
}
if (bounty > 0) {
mazeWalls(this["enemy_mc" + i]);
}
panningEffect(this["enemy_mc" + i]);
panningEffect(this["enemy_mc_dummy" + i]);
i++;
}
if (enemyNumber < 12) {
if (enemyBilang < 500) {
enemyBilang = enemyBilang + 1;
} else {
if (bounty > 0) {
generateEnemy();
}
enemyBilang = 0;
}
}
}
function bossMove() {
boss_mc._visible = false;
radiansEnemy = Math.atan2(char_mc._y - boss_mc._y, char_mc._x - boss_mc._x);
degreesEnemy = (radiansEnemy / Math.PI) * 180;
boss_mc._rotation = degreesEnemy;
mouseRotate(this["boss_mc_dummy" + stageChoose], degreesEnemy);
if (bounty <= 0) {
if (alert_mc._currentframe < 40) {
alert_mc.play();
} else {
alert_mc.removeMovieClip();
}
if (boss_mc.enemyMove > 0) {
if (Math.sqrt(Math.pow(char_mc._y - boss_mc._y, 2) + Math.pow(char_mc._x - boss_mc._x, 2)) > 100) {
if ((char_mc._x < boss_mc._x) && (Math.abs(char_mc._x - boss_mc._x) > 1)) {
boss_mc._x = boss_mc._x - (moveSpeed / 2);
} else if ((char_mc._x > boss_mc._x) && (Math.abs(char_mc._x - boss_mc._x) > 1)) {
boss_mc._x = boss_mc._x + (moveSpeed / 2);
}
if ((char_mc._y < boss_mc._y) && (Math.abs(char_mc._y - boss_mc._y) > 1)) {
boss_mc._y = boss_mc._y - (moveSpeed / 2);
} else if ((char_mc._y > boss_mc._y) && (Math.abs(char_mc._y - boss_mc._y) > 1)) {
boss_mc._y = boss_mc._y + (moveSpeed / 2);
}
this["boss_mc_dummy" + stageChoose]._x = boss_mc._x;
this["boss_mc_dummy" + stageChoose]._y = boss_mc._y + 30;
this["boss_mc_dummy" + stageChoose].char_mc.play();
this["boss_mc_dummy" + stageChoose].swapDepths(this["boss_mc_dummy" + stageChoose]._y);
}
boss_mc.enemyMove = boss_mc.enemyMove - 1;
} else if (boss_mc.enemyShoot > 0) {
boss_mc.enemyShoot = boss_mc.enemyShoot - 1;
if ((((boss_mc.enemyShoot == 10) || (boss_mc.enemyShoot == 20)) || (boss_mc.enemyShoot == 30)) || (boss_mc.enemyShoot == 40)) {
bossShootNow();
}
} else {
boss_mc.enemyMove = 50;
boss_mc.enemyShoot = 50;
}
}
mazeWalls(boss_mc);
panningEffect(boss_mc);
panningEffect(this["boss_mc_dummy" + stageChoose]);
bossLife_mc._x = boss_mc._x;
bossLife_mc._y = boss_mc._y - 35;
map_mc.map_boss._x = boss_mc._x / 8;
map_mc.map_boss._y = boss_mc._y / 8;
bossLife_mc.swapDepths(this["boss_mc_dummy" + stageChoose]._y);
}
function mouseRotate(charMc, charDegrees) {
if ((charDegrees >= -120) && (charDegrees < -75)) {
charMc.gotoAndStop("char_up");
} else if ((charDegrees >= -75) && (charDegrees < -30)) {
charMc.gotoAndStop("char_diag_up");
charMc._xscale = 100;
} else if ((charDegrees >= -30) && (charDegrees < 15)) {
charMc.gotoAndStop("char_side");
charMc._xscale = 100;
} else if ((charDegrees >= 15) && (charDegrees < 60)) {
charMc.gotoAndStop("char_diag_down");
charMc._xscale = 100;
} else if ((charDegrees >= 60) && (charDegrees < 105)) {
charMc.gotoAndStop("char_down");
} else if ((charDegrees >= 105) && (charDegrees < 150)) {
charMc.gotoAndStop("char_diag_down");
charMc._xscale = -100;
} else if (((charDegrees >= 150) && (charDegrees < 180)) || ((charDegrees > -180) && (charDegrees < -165))) {
charMc.gotoAndStop("char_side");
charMc._xscale = -100;
} else if ((charDegrees >= -165) && (charDegrees < 120)) {
charMc.gotoAndStop("char_diag_up");
charMc._xscale = -100;
}
charMc.swapDepths(charMc._y);
}
function objectMove() {
k = 0;
while (k <= 25) {
this["object_mc" + k].swapDepths(this["object_mc" + k]._y);
panningEffect(this["object_mc" + k]);
k++;
}
panningEffect(maze_mc);
m = 0;
while (m <= bloodCount) {
this["death_hit_mc" + m].swapDepths(this["death_hit_mc" + m]._y);
this["hit_mc" + m].swapDepths(this["hit_mc" + m]._y - 100);
panningEffect(this["death_hit_mc" + m]);
panningEffect(this["hit_mc" + m]);
m++;
}
mazeWalls(char_mc);
}
function onMouseDown() {
fireHold = 1;
}
function onMouseUp() {
fireHold = 0;
}
function charShootNow() {
start_ball_x = char_mc._x + (20 * Math.cos((degrees * Math.PI) / 180));
start_ball_y = char_mc._y + (20 * Math.sin((degrees * Math.PI) / 180));
if (fireDelay == 0) {
if (bulletCount < 20) {
if ((stats_mc.item_mc1._alpha == 100) || (stats_mc.item_mc2._alpha == 100)) {
cannonball_fired = attachMovie("bullet_mc", "bullet_mc" + bulletCount, _root.getNextHighestDepth(), {_x:start_ball_x, _y:start_ball_y});
sfx_mc.gotoAndPlay("gun");
} else if (stats_mc.item_mc3._alpha == 100) {
cannonball_fired = attachMovie("bullet_mcX", "bullet_mc" + bulletCount, _root.getNextHighestDepth(), {_x:start_ball_x, _y:start_ball_y});
sfx_mc.gotoAndPlay("shotgun");
} else if (stats_mc.item_mc4._alpha == 100) {
cannonball_fired = attachMovie("bullet_mcXX", "bullet_mc" + bulletCount, _root.getNextHighestDepth(), {_x:start_ball_x, _y:start_ball_y});
sfx_mc.gotoAndPlay("shotgun");
} else {
cannonball_fired = attachMovie("bullet_mc", "bullet_mc" + bulletCount, _root.getNextHighestDepth(), {_x:start_ball_x, _y:start_ball_y});
sfx_mc.gotoAndPlay("gun");
}
cannonball_fired.dirx = Math.cos((degrees * Math.PI) / 180) * fireSpeed;
cannonball_fired.diry = Math.sin((degrees * Math.PI) / 180) * fireSpeed;
cannonball_fired._rotation = degrees;
cannonball_fired.ID = setInterval(bulletMove, duration, this["bullet_mc" + bulletCount]);
cannonball_fired.IDx = setInterval(charbulletHit, duration, this["bullet_mc" + bulletCount]);
bulletCount = bulletCount + 1;
} else {
bulletCount = 0;
}
if (stats_mc.item_mc1._alpha == 100) {
fireDelay = 25;
} else if ((stats_mc.item_mc2._alpha == 100) || (stats_mc.item_mc4._alpha == 100)) {
fireDelay = 12;
} else {
fireDelay = 25;
}
}
}
function bulletMove(bulletMc) {
if (pause_mc._visible == false) {
bulletMc._x = bulletMc._x + bulletMc.dirx;
bulletMc._y = bulletMc._y + bulletMc.diry;
panningEffect(bulletMc);
with (bulletMc) {
if (((maze_mc.walls.hitTest(getBounds(_parent).xMax, _y, true) || (maze_mc.walls.hitTest(getBounds(_parent).xMin, _y, true))) || (maze_mc.walls.hitTest(_x, getBounds(_parent).yMax, true))) || (maze_mc.walls.hitTest(_x, getBounds(_parent).yMin, true))) {
clearInterval(bulletMc.ID);
clearInterval(bulletMc.IDx);
bulletMc.removeMovieClip();
}
}
if ((((bulletMc._x < 0) || (bulletMc._x > 640)) || (bulletMc._y < 0)) || (bulletMc._y > 450)) {
clearInterval(bulletMc.ID);
clearInterval(bulletMc.IDx);
bulletMc.removeMovieClip();
}
}
}
function charbulletHit(bulletMc) {
i = 0;
while (i < enemyNumber) {
if (bulletMc.hitTest(_root["enemy_mc" + i])) {
if ((stats_mc.item_mc1._alpha == 100) || (stats_mc.item_mc2._alpha == 100)) {
clearInterval(bulletMc.ID);
clearInterval(bulletMc.IDx);
bulletMc.removeMovieClip();
}
if (_root["enemy_mc" + i].enemyLife <= 1) {
sfx_mc.gotoAndPlay("yell");
generateBlood(i);
if (stats_mc.combo_mc._xscale > 0) {
multiplier = multiplier + 1;
multiplier_mc.multiplier_txt.text = "x" + multiplier;
} else {
multiplier = 1;
multiplier_mc.multiplier_txt.text = "x" + multiplier;
}
score = score + (1 * multiplier);
stats_mc.score_txt.text = score;
if (bounty > 0) {
bounty = bounty - 1;
stats_mc.bounty_txt.text = bounty;
}
multiplier_mc._x = _root["enemy_mc" + i]._x;
multiplier_mc._y = _root["enemy_mc" + i]._y;
multiplier_mc.gotoAndPlay(2);
stats_mc.combo_mc._xscale = 100;
_root["enemy_mc" + i].enemyLife = stageChoose;
randomEnemy(i);
} else {
_root["enemy_mc" + i].enemyLife = _root["enemy_mc" + i].enemyLife - 1;
_root["enemy_mc_dummy" + i]._alpha = 50;
}
}
i++;
}
if (bulletMc.hitTest(_root.boss_mc) && ((_root["poster_stage" + stageChoose]._currentframe == 1) && (_root.poster_char._currentframe == 1))) {
clearInterval(bulletMc.ID);
clearInterval(bulletMc.IDx);
bulletMc.removeMovieClip();
boss_mc_dummy1.gotoAndStop("die");
generateHit("boss_mc");
if (bossLife_mc.health_mc._xscale > 0) {
bossLife_mc.health_mc._xscale = bossLife_mc.health_mc._xscale - 20;
sfx_mc.gotoAndPlay("hic");
} else {
clearInterval(mainId);
_root.boss_mc.removeMovieClip();
_root.sfx_mc.gotoAndPlay("yell2");
endStage();
}
}
}
function enemybulletHit(bulletMc) {
if (bulletMc.hitTest(char_mc) && ((_root["poster_stage" + stageChoose]._currentframe == 1) && (_root.poster_char._currentframe == 1))) {
clearInterval(bulletMc.ID);
clearInterval(bulletMc.IDx);
bulletMc.removeMovieClip();
char_mc.gotoAndPlay(2);
char_mc_dummy._alpha = 50;
generateHit("char_mc");
if (stats_mc.health_mc._xscale > 0) {
stats_mc.health_mc._xscale = stats_mc.health_mc._xscale - 4;
} else {
clearInterval(mainId);
diedStage();
}
}
}
function charBombNow() {
start_bomb_x = char_mc._x + (20 * Math.cos((degrees * Math.PI) / 180));
start_bomb_y = char_mc._y + (20 * Math.sin((degrees * Math.PI) / 180));
if (bombDelay == 0) {
if (bombCount < 5) {
bombLimit = bombLimit - 1;
stats_mc.bomb_txt.text = bombLimit;
trace("HOY");
bomb_fired = attachMovie("molotov_mc", "molotov_mc" + bombCount, _root.getNextHighestDepth(), {_x:start_bomb_x, _y:start_bomb_y});
bomb_fired.dirx = (Math.cos((degrees * Math.PI) / 180) * fireSpeed) / 2;
bomb_fired.diry = (Math.sin((degrees * Math.PI) / 180) * fireSpeed) / 2;
bomb_fired._rotation = degrees;
bomb_fired.ID = setInterval(bombMove, duration / 1.5, this["molotov_mc" + bombCount]);
bombCount = bombCount + 1;
} else {
bombCount = 0;
}
bombDelay = 20;
}
}
function bombMove(bombMc) {
if (pause_mc._visible == false) {
bombMc.nextFrame();
bombMc._x = bombMc._x + (bombMc.dirx * 1);
bombMc._y = bombMc._y + (bombMc.diry * 1);
if (bombMc._currentframe == 19) {
explodeNow();
clearInterval(bombMc.ID);
bombMc.removeMovieClip();
} else {
with (bombMc) {
if (((maze_mc.walls.hitTest(getBounds(_parent).xMax, _y, true) || (maze_mc.walls.hitTest(getBounds(_parent).xMin, _y, true))) || (maze_mc.walls.hitTest(_x, getBounds(_parent).yMax, true))) || (maze_mc.walls.hitTest(_x, getBounds(_parent).yMin, true))) {
explodeNow();
clearInterval(bombMc.ID);
bombMc.removeMovieClip();
}
}
}
panningEffect(bombMc);
}
}
function explodeNow() {
sfx_mc.gotoAndPlay("bomb");
start_bomb_x = bomb_fired._x + (20 * Math.cos((degrees * Math.PI) / 180));
start_bomb_y = bomb_fired._y + (20 * Math.sin((degrees * Math.PI) / 180));
bomb_explode = attachMovie("explode_mc", "explode_mc" + bombCount, _root.getNextHighestDepth(), {_x:start_bomb_x, _y:start_bomb_y});
bomb_explode.dirx = Math.cos((degrees * Math.PI) / 180) * fireSpeed;
bomb_explode.diry = Math.sin((degrees * Math.PI) / 180) * fireSpeed;
bomb_explode.ID = setInterval(bombHit, duration, this["explode_mc" + bombCount]);
}
function bombHit(explodeMc) {
explodeMc.nextFrame();
panningEffect(explodeMc);
i = 0;
while (i < enemyNumber) {
if ((explodeMc.hitTest(_root["enemy_mc" + i]) && (explodeMc._currentframe > 2)) && (explodeMc._currentframe < 6)) {
sfx_mc.gotoAndPlay("yell");
generateBlood(i);
if (stats_mc.combo_mc._xscale > 0) {
multiplier = multiplier + 1;
multiplier_mc.multiplier_txt.text = "x" + multiplier;
} else {
multiplier = 1;
multiplier_mc.multiplier_txt.text = "x" + multiplier;
}
score = score + (1 * multiplier);
stats_mc.score_txt.text = score;
if (bounty > 0) {
bounty = bounty - 1;
stats_mc.bounty_txt.text = bounty;
}
multiplier_mc._x = _root["enemy_mc" + i]._x;
multiplier_mc._y = _root["enemy_mc" + i]._y;
multiplier_mc.gotoAndPlay(2);
stats_mc.combo_mc._xscale = 100;
randomEnemy(i);
}
i++;
}
if (((explodeMc.hitTest(_root.boss_mc) && (explodeMc._currentframe > 2)) && (explodeMc._currentframe < 5)) && ((_root["poster_stage" + stageChoose]._currentframe == 1) && (_root.poster_char._currentframe == 1))) {
boss_mc_dummy1.gotoAndStop("die");
generateHit("boss_mc");
if (bossLife_mc.health_mc._xscale > 0) {
bossLife_mc.health_mc._xscale = bossLife_mc.health_mc._xscale - 20;
sfx_mc.gotoAndPlay("hic");
} else {
clearInterval(mainId);
_root.boss_mc.removeMovieClip();
_root.sfx_mc.gotoAndPlay("yell2");
endStage();
}
}
if (((explodeMc.hitTest(_root.char_mc) && (explodeMc._currentframe > 2)) && (explodeMc._currentframe < 5)) && ((_root["poster_stage" + stageChoose]._currentframe == 1) && (_root.poster_char._currentframe == 1))) {
char_mc.gotoAndPlay(2);
char_mc_dummy._alpha = 50;
generateHit("char_mc");
if (stats_mc.health_mc._xscale > 0) {
stats_mc.health_mc._xscale = stats_mc.health_mc._xscale - 4;
} else {
clearInterval(mainId);
diedStage();
}
}
if (explodeMc._currentframe >= 15) {
clearInterval(explodeMc.ID);
explodeMc.removeMovieClip();
}
}
function generateBlood(i) {
duplicateMovieClip ("death_hit_mc", "death_hit_mc" + bloodCount, -(bloodCount + 5000));
this["death_hit_mc" + bloodCount]._x = this["enemy_mc" + i]._x;
this["death_hit_mc" + bloodCount]._y = this["enemy_mc" + i]._y;
this["death_hit_mc" + bloodCount].play();
bloodCount = bloodCount + 1;
}
function generateHit(i) {
duplicateMovieClip ("hit_mc", "hit_mc" + bloodCount, -(bloodCount + 8000));
this["hit_mc" + bloodCount]._x = this[i]._x;
this["hit_mc" + bloodCount]._y = this[i]._y;
this["hit_mc" + bloodCount]._xscale = 20;
this["hit_mc" + bloodCount]._yscale = 20;
this["hit_mc" + bloodCount].play();
bloodCount = bloodCount + 1;
}
function generateEnemy() {
trace("enemy_mc" + enemyNumber);
var _local2 = 0;
_local2 = random(4);
duplicateMovieClip ("enemy_mc", "enemy_mc" + enemyNumber, this.getNextHighestDepth());
this["enemy_mc" + enemyNumber].enemyMove = 50;
this["enemy_mc" + enemyNumber].enemyShoot = 50;
this["enemy_mc" + enemyNumber].enemyLife = stageChoose;
this["enemy_mc" + enemyNumber].enemyDelay = 10;
duplicateMovieClip ("enemy_mc_dummy", "enemy_mc_dummy" + enemyNumber, this.getNextHighestDepth());
if (_local2 == 0) {
this["enemy_mc" + enemyNumber]._x = -30;
this["enemy_mc" + enemyNumber]._y = char_mc._y;
} else if (_local2 == 1) {
this["enemy_mc" + enemyNumber]._x = 670;
this["enemy_mc" + enemyNumber]._y = char_mc._y;
} else if (_local2 == 2) {
this["enemy_mc" + enemyNumber]._x = char_mc._x;
this["enemy_mc" + enemyNumber]._y = -30;
} else if (_local2 == 3) {
this["enemy_mc" + enemyNumber]._x = char_mc._x;
this["enemy_mc" + enemyNumber]._y = 510;
}
enemyNumber = enemyNumber + 1;
}
function randomEnemy(i) {
var _local3 = 0;
_local3 = random(4);
this["enemy_mc" + i].enemyMove = 50;
this["enemy_mc" + i].enemyShoot = 50;
this["enemy_mc" + i].enemyDelay = 10;
if (_local3 == 0) {
this["enemy_mc" + i]._x = -100;
this["enemy_mc" + i]._y = char_mc._y;
} else if (_local3 == 1) {
this["enemy_mc" + i]._x = 750;
this["enemy_mc" + i]._y = char_mc._y;
} else if (_local3 == 2) {
this["enemy_mc" + i]._x = char_mc._x;
this["enemy_mc" + i]._y = -100;
} else if (_local3 == 3) {
this["enemy_mc" + i]._x = char_mc._x;
this["enemy_mc" + i]._y = 560;
}
if (bounty <= 0) {
this["enemy_mc" + i]._x = -5000;
this["enemy_mc" + i]._y = -5000;
this["enemy_mc_dummy" + i]._x = -5000;
this["enemy_mc_dummy" + i]._y = -5000;
}
}
function collideEnemy(i) {
j = 0;
if (j < enemyNumber) {
if (this["enemy_mc" + i].hitTest(this["enemy_mc" + j]) && (i != j)) {
return(true);
}
return(false);
}
}
function enemyShootNow(i) {
start_ball_xEnemy = this["enemy_mc" + i]._x + (20 * Math.cos((degreesEnemy * Math.PI) / 180));
start_ball_yEnemy = this["enemy_mc" + i]._y + (20 * Math.sin((degreesEnemy * Math.PI) / 180));
if (bulletCountEnemy < 30) {
sfx_mc.gotoAndPlay("gun");
cannonball_firedEnemy = attachMovie("bullet_mc", "bullet_mc_enemy" + bulletCountEnemy, _root.getNextHighestDepth(), {_x:start_ball_xEnemy, _y:start_ball_yEnemy});
cannonball_firedEnemy.dirx = Math.cos((degreesEnemy * Math.PI) / 180) * fireSpeed;
cannonball_firedEnemy.diry = Math.sin((degreesEnemy * Math.PI) / 180) * fireSpeed;
cannonball_firedEnemy._rotation = degreesEnemy;
cannonball_firedEnemy.ID = setInterval(bulletMove, duration, this["bullet_mc_enemy" + bulletCountEnemy]);
cannonball_firedEnemy.IDx = setInterval(enemybulletHit, duration, this["bullet_mc_enemy" + bulletCountEnemy]);
bulletCountEnemy = bulletCountEnemy + 1;
} else {
bulletCountEnemy = 0;
}
}
function bossShootNow() {
start_ball_xEnemy = boss_mc._x + (20 * Math.cos((degreesEnemy * Math.PI) / 180));
start_ball_yEnemy = boss_mc._y + (20 * Math.sin((degreesEnemy * Math.PI) / 180));
if (bulletCountBoss < 20) {
sfx_mc.gotoAndPlay("gun");
cannonball_firedEnemy = attachMovie("bullet_mc", "bullet_mc_boss" + bulletCountBoss, _root.getNextHighestDepth(), {_x:start_ball_xEnemy, _y:start_ball_yEnemy});
cannonball_firedEnemy.dirx = Math.cos((degreesEnemy * Math.PI) / 180) * fireSpeed;
cannonball_firedEnemy.diry = Math.sin((degreesEnemy * Math.PI) / 180) * fireSpeed;
cannonball_firedEnemy._rotation = degreesEnemy;
cannonball_firedEnemy.ID = setInterval(bulletMove, duration, this["bullet_mc_boss" + bulletCountBoss]);
cannonball_firedEnemy.IDx = setInterval(enemybulletHit, duration, this["bullet_mc_boss" + bulletCountBoss]);
bulletCountBoss = bulletCountBoss + 1;
} else {
bulletCountBoss = 0;
}
}
function mazeWalls(nameMc) {
with (nameMc) {
if (maze_mc.walls.hitTest(getBounds(_parent).xMax, _y, true)) {
nameMc._x = nameMc._x - (moveSpeed * 1);
}
if (maze_mc.walls.hitTest(getBounds(_parent).xMin, _y, true)) {
_x = _x + (moveSpeed * 1);
}
if (maze_mc.walls.hitTest(_x, getBounds(_parent).yMax, true)) {
_y = _y - (moveSpeed * 1);
}
if (maze_mc.walls.hitTest(_x, getBounds(_parent).yMin, true)) {
_y = _y + (moveSpeed * 1);
}
}
}
function panningEffect(nameMc) {
if (bgMovesX == -1) {
nameMc._x = nameMc._x - moveSpeed;
}
if (bgMovesX == 1) {
nameMc._x = nameMc._x + moveSpeed;
}
if (bgMovesY == -1) {
nameMc._y = nameMc._y - moveSpeed;
}
if (bgMovesY == 1) {
nameMc._y = nameMc._y + moveSpeed;
}
}
function endStage() {
this["poster_stage" + stageChoose].gotoAndPlay(2);
this["poster_stage" + stageChoose].swapDepths(1500);
score = score + (1000 * stageChoose);
stats_mc.score_txt.text = score;
target_mc.removeMovieClip();
Mouse.show();
pause_btn._visible = false;
pause_mc._visible = false;
Key.removeListener(keyListener);
}
function diedStage() {
poster_char.gotoAndPlay(2);
poster_char.swapDepths(1000);
char_mc_dummy.gotoAndStop("die");
target_mc.removeMovieClip();
Mouse.show();
pause_btn._visible = false;
pause_mc._visible = false;
Key.removeListener(keyListener);
}
function goBack() {
removeObjects();
stopAllSounds();
gotoAndStop ("weapon2");
}
function goTown() {
removeObjects();
stopAllSounds();
gotoAndStop ("townSelect");
}
function goQuit() {
removeObjects();
stopAllSounds();
gotoAndStop ("title");
}
function removeObjects() {
i2 = 0;
while (i2 < enemyNumber) {
removeMovieClip(this["enemy_mc_dummy" + i2]);
i2++;
}
k2 = 0;
while (k2 <= 30) {
removeMovieClip(this["object_mc" + k2]);
k2++;
}
m2 = 0;
while (m2 <= bloodCount) {
removeMovieClip(this["death_hit_mc" + m2]);
removeMovieClip(this["hit_mc" + m2]);
m2++;
}
removeMovieClip(stats_mc);
removeMovieClip(this["boss_mc_dummy" + stageChoose]);
removeMovieClip(this["boss_mc_dummy" + (stageChoose - 1)]);
removeMovieClip(bossLife_mc);
removeMovieClip(char_mc_dummy);
removeMovieClip(this["poster_stage" + stageChoose]);
removeMovieClip(this["poster_stage" + (stageChoose - 1)]);
removeMovieClip(poster_char);
removeMovieClip(pause_mc);
removeMovieClip(pause_btn);
removeMovieClip(map_mc);
}
function initItems() {
i = 1;
while (i <= 4) {
stats_mc["item_mc" + i]._alpha = 10;
stats_mc["item_box" + i]._visible = false;
i++;
}
}
stop();
stopAllSounds();
Mouse.hide();
sound_mc.gotoAndPlay(2);
var mainId = 0;
var duration = 32;
var bulletId;
var radians = 0;
var degrees = 0;
var radiansEnemy = 0;
var degreesEnemy = 0;
var enemyNumber = 0;
var enemyBilang = 0;
var moveSpeed = 4;
var fireSpeed = 15;
var fireDelay = 20;
var fireHold = 0;
var hitDelay = 5;
var bombDelay = 20;
var bombLimit = 5;
var bgMovesX = 0;
var bgMovesY = 0;
var bulletCount = 0;
var bombCount = 0;
var explodeCount = 0;
var bulletCountEnemy = 0;
var bulletCountBoss = 0;
var bloodCount = 0;
var multiplier = 0;
stats_mc.combo_mc._xscale = 0;
char_mc._visible = false;
generateEnemy();
stats_mc.bounty_txt.text = bounty;
stats_mc.score_txt.text = score;
stats_mc.bomb_txt.text = bombLimit;
stats_mc.swapDepths(800);
target_mc.swapDepths(900);
alert_mc.swapDepths(820);
mainId = setInterval(mainMc, 20);
initItems();
stats_mc.item_mc1._alpha = 100;
stats_mc.item_box1._visible = true;
var keyListener = new Object();
keyListener.onKeyDown = function () {
if (chr(Key.getAscii()) == "1") {
initItems();
stats_mc.item_mc1._alpha = 100;
stats_mc.item_box1._visible = true;
sfx_mc.gotoAndPlay("select");
}
};
Key.addListener(keyListener);
pause_mc._visible = false;
pause_btn._visible = true;
pause_mc.swapDepths(850);
pause_btn.swapDepths(870);
pause_btn.pause_btn.onRelease = function () {
Mouse.show();
this._parent._visible = false;
pause_mc.swapDepths(_root.getNextHighestDepth());
pause_mc._visible = true;
};
pause_mc.continue_btn.onRelease = function () {
this._parent._visible = false;
pause_btn._visible = true;
};
Instance of Symbol 1943 MovieClip "map_mc" in Frame 61
onClipEvent (load) {
this.swapDepths(_root.getNextHighestDepth());
}
Frame 65
function mainMc() {
if (pause_mc._visible == false) {
characterMove();
enemyMove();
bossMove();
objectMove();
bilang = bilang + 1;
}
target_mc._x = _xmouse;
target_mc._y = _ymouse;
}
function characterMove() {
radians = Math.atan2(_ymouse - char_mc._y, _xmouse - char_mc._x);
degrees = (radians / Math.PI) * 180;
char_mc._rotation = degrees;
if ((Key.isDown(38) || (Key.isDown(87))) && (char_mc._y > 0)) {
if (bg_mc._y >= -20) {
if ((char_mc._y > 0) && (char_mc._y < (Stage.height / 2))) {
char_mc._y = char_mc._y - moveSpeed;
bgMovesY = 0;
} else {
char_mc._y = char_mc._y - moveSpeed;
bgMovesY = 0;
}
} else if (char_mc._y >= (Stage.height / 2)) {
char_mc._y = char_mc._y - moveSpeed;
bgMovesY = 0;
} else {
bg_mc._y = bg_mc._y + moveSpeed;
bgMovesY = 1;
}
char_mc_dummy.char_mc.play();
} else if ((Key.isDown(40) || (Key.isDown(83))) && (char_mc._y < 340)) {
if (bg_mc._y <= ((Stage.height - 750) + 20)) {
if ((char_mc._y > (Stage.height / 2)) && (char_mc._y < Stage.height)) {
char_mc._y = char_mc._y + moveSpeed;
bgMovesY = 0;
} else {
char_mc._y = char_mc._y + moveSpeed;
bgMovesY = 0;
}
} else if (char_mc._y <= (Stage.height / 2)) {
char_mc._y = char_mc._y + moveSpeed;
bgMovesY = 0;
} else {
bg_mc._y = bg_mc._y - moveSpeed;
bgMovesY = -1;
}
char_mc_dummy.char_mc.play();
} else {
bgMovesY = 0;
}
if ((Key.isDown(37) || (Key.isDown(65))) && (char_mc._x > 0)) {
if (bg_mc._x >= -20) {
if ((char_mc._x > 0) && (char_mc._x < (Stage.width / 2))) {
char_mc._x = char_mc._x - moveSpeed;
bgMovesX = 0;
} else {
char_mc._x = char_mc._x - moveSpeed;
bgMovesX = 0;
}
} else if (char_mc._x >= (Stage.width / 2)) {
char_mc._x = char_mc._x - moveSpeed;
bgMovesX = 0;
} else {
bg_mc._x = bg_mc._x + moveSpeed;
bgMovesX = 1;
}
char_mc_dummy.char_mc.play();
} else if ((Key.isDown(39) || (Key.isDown(68))) && (char_mc._x < 640)) {
if (bg_mc._x <= ((Stage.width - 1020) + 20)) {
if ((char_mc._x > (Stage.width / 2)) && (char_mc._x < Stage.width)) {
char_mc._x = char_mc._x + moveSpeed;
bgMovesX = 0;
} else {
char_mc._x = char_mc._x + moveSpeed;
bgMovesX = 0;
}
} else if (char_mc._x <= (Stage.width / 2)) {
char_mc._x = char_mc._x + moveSpeed;
bgMovesX = 0;
} else {
bg_mc._x = bg_mc._x - moveSpeed;
bgMovesX = -1;
}
char_mc_dummy.char_mc.play();
} else {
bgMovesX = 0;
}
if ((Key.isDown(32) || (Key.isDown(17))) && (bombLimit > 0)) {
charBombNow();
}
char_mc_dummy._x = char_mc._x;
char_mc_dummy._y = char_mc._y + 30;
map_mc.map_mychar._x = char_mc._x / 8;
map_mc.map_mychar._y = char_mc._y / 8;
mouseRotate(char_mc_dummy, degrees);
if (char_mc_dummy._alpha == 50) {
hitDelay = hitDelay - 1;
}
if (hitDelay <= 0) {
char_mc_dummy._alpha = 100;
hitDelay = 5;
}
if (fireDelay > 0) {
fireDelay = fireDelay - 1;
}
if (fireHold > 0) {
charShootNow();
}
if (bombDelay > 0) {
bombDelay = bombDelay - 1;
}
multiplier_mc.multiplier_txt.text = "x" + multiplier;
if (stats_mc.combo_mc._xscale > 0) {
stats_mc.combo_mc._xscale = stats_mc.combo_mc._xscale - 1;
}
}
function enemyMove() {
i = 0;
while (i < enemyNumber) {
this["enemy_mc" + i]._visible = false;
radiansEnemy = Math.atan2(char_mc._y - this["enemy_mc" + i]._y, char_mc._x - this["enemy_mc" + i]._x);
degreesEnemy = (radiansEnemy / Math.PI) * 180;
this["enemy_mc" + i]._rotation = degreesEnemy;
mouseRotate(this["enemy_mc_dummy" + i], degreesEnemy);
if (this["enemy_mc_dummy" + i]._alpha == 50) {
this["enemy_mc" + i].enemyDelay = this["enemy_mc" + i].enemyDelay - 1;
}
if (this["enemy_mc" + i].enemyDelay <= 0) {
this["enemy_mc_dummy" + i]._alpha = 100;
this["enemy_mc" + i].enemyDelay = this["enemy_mc" + i].enemyDelay - 1;
}
collideEnemy(i);
if (this["enemy_mc" + i].enemyMove > 0) {
if ((Math.sqrt(Math.pow(char_mc._y - this["enemy_mc" + i]._y, 2) + Math.pow(char_mc._x - this["enemy_mc" + i]._x, 2)) > 100) && (collideEnemy(i) == false)) {
if ((char_mc._x < this["enemy_mc" + i]._x) && (Math.abs(char_mc._x - this["enemy_mc" + i]._x) > 1)) {
this["enemy_mc" + i]._x = this["enemy_mc" + i]._x - enemyMoveSpeed;
} else if ((char_mc._x > this["enemy_mc" + i]._x) && (Math.abs(char_mc._x - this["enemy_mc" + i]._x) > 1)) {
this["enemy_mc" + i]._x = this["enemy_mc" + i]._x + enemyMoveSpeed;
}
if ((char_mc._y < this["enemy_mc" + i]._y) && (Math.abs(char_mc._y - this["enemy_mc" + i]._y) > 1)) {
this["enemy_mc" + i]._y = this["enemy_mc" + i]._y - enemyMoveSpeed;
} else if ((char_mc._y > this["enemy_mc" + i]._y) && (Math.abs(char_mc._y - this["enemy_mc" + i]._y) > 1)) {
this["enemy_mc" + i]._y = this["enemy_mc" + i]._y + enemyMoveSpeed;
}
this["enemy_mc_dummy" + i]._x = this["enemy_mc" + i]._x;
this["enemy_mc_dummy" + i]._y = this["enemy_mc" + i]._y + 30;
map_mc["map_char" + i]._x = this["enemy_mc" + i]._x / 8;
map_mc["map_char" + i]._y = this["enemy_mc" + i]._y / 8;
this["enemy_mc_dummy" + i].char_mc.play();
this["enemy_mc_dummy" + i].swapDepths(this["enemy_mc_dummy" + i]._y);
}
this["enemy_mc" + i].enemyMove = this["enemy_mc" + i].enemyMove - 1;
} else if (this["enemy_mc" + i].enemyShoot > 0) {
this["enemy_mc" + i].enemyShoot = this["enemy_mc" + i].enemyShoot - 1;
if (this["enemy_mc" + i].enemyShoot == 30) {
enemyShootNow(i);
}
} else {
this["enemy_mc" + i].enemyMove = 50;
this["enemy_mc" + i].enemyShoot = 50;
}
mazeWalls(this["enemy_mc" + i]);
panningEffect(this["enemy_mc" + i]);
panningEffect(this["enemy_mc_dummy" + i]);
i++;
}
if (enemyNumber < 12) {
if (enemyBilang < 500) {
enemyBilang = enemyBilang + 1;
} else {
generateEnemy();
enemyBilang = 0;
}
}
}
function bossMove() {
boss_mc._visible = false;
radiansEnemy = Math.atan2(char_mc._y - boss_mc._y, char_mc._x - boss_mc._x);
degreesEnemy = (radiansEnemy / Math.PI) * 180;
boss_mc._rotation = degreesEnemy;
mouseRotate(this["boss_mc_dummy" + stageChoose], degreesEnemy);
if (bounty <= 0) {
if (alert_mc._currentframe < 40) {
alert_mc.play();
} else {
alert_mc.removeMovieClip();
}
if (boss_mc.enemyMove > 0) {
if (Math.sqrt(Math.pow(char_mc._y - boss_mc._y, 2) + Math.pow(char_mc._x - boss_mc._x, 2)) > 100) {
if ((char_mc._x < boss_mc._x) && (Math.abs(char_mc._x - boss_mc._x) > 1)) {
boss_mc._x = boss_mc._x - moveSpeed;
} else if ((char_mc._x > boss_mc._x) && (Math.abs(char_mc._x - boss_mc._x) > 1)) {
boss_mc._x = boss_mc._x + moveSpeed;
}
if ((char_mc._y < boss_mc._y) && (Math.abs(char_mc._y - boss_mc._y) > 1)) {
boss_mc._y = boss_mc._y - moveSpeed;
} else if ((char_mc._y > boss_mc._y) && (Math.abs(char_mc._y - boss_mc._y) > 1)) {
boss_mc._y = boss_mc._y + moveSpeed;
}
this["boss_mc_dummy" + stageChoose]._x = boss_mc._x;
this["boss_mc_dummy" + stageChoose]._y = boss_mc._y + 30;
this["boss_mc_dummy" + stageChoose].char_mc.play();
this["boss_mc_dummy" + stageChoose].swapDepths(this["boss_mc_dummy" + stageChoose]._y);
}
boss_mc.enemyMove = boss_mc.enemyMove - 1;
} else if (boss_mc.enemyShoot > 0) {
boss_mc.enemyShoot = boss_mc.enemyShoot - 1;
if ((((boss_mc.enemyShoot == 10) || (boss_mc.enemyShoot == 20)) || (boss_mc.enemyShoot == 30)) || (boss_mc.enemyShoot == 40)) {
bossShootNow();
}
} else {
boss_mc.enemyMove = 50;
boss_mc.enemyShoot = 50;
}
}
mazeWalls(boss_mc);
panningEffect(boss_mc);
panningEffect(this["boss_mc_dummy" + stageChoose]);
bossLife_mc._x = boss_mc._x;
bossLife_mc._y = boss_mc._y - 35;
map_mc.map_boss._x = boss_mc._x / 8;
map_mc.map_boss._y = boss_mc._y / 8;
bossLife_mc.swapDepths(this["boss_mc_dummy" + stageChoose]._y);
}
function mouseRotate(charMc, charDegrees) {
if ((charDegrees >= -120) && (charDegrees < -75)) {
charMc.gotoAndStop("char_up");
} else if ((charDegrees >= -75) && (charDegrees < -30)) {
charMc.gotoAndStop("char_diag_up");
charMc._xscale = 100;
} else if ((charDegrees >= -30) && (charDegrees < 15)) {
charMc.gotoAndStop("char_side");
charMc._xscale = 100;
} else if ((charDegrees >= 15) && (charDegrees < 60)) {
charMc.gotoAndStop("char_diag_down");
charMc._xscale = 100;
} else if ((charDegrees >= 60) && (charDegrees < 105)) {
charMc.gotoAndStop("char_down");
} else if ((charDegrees >= 105) && (charDegrees < 150)) {
charMc.gotoAndStop("char_diag_down");
charMc._xscale = -100;
} else if (((charDegrees >= 150) && (charDegrees < 180)) || ((charDegrees > -180) && (charDegrees < -165))) {
charMc.gotoAndStop("char_side");
charMc._xscale = -100;
} else if ((charDegrees >= -165) && (charDegrees < 120)) {
charMc.gotoAndStop("char_diag_up");
charMc._xscale = -100;
}
charMc.swapDepths(charMc._y);
}
function objectMove() {
k = 0;
while (k <= 30) {
this["object_mc" + k].swapDepths(this["object_mc" + k]._y);
panningEffect(this["object_mc" + k]);
k++;
}
panningEffect(maze_mc);
m = 0;
while (m <= bloodCount) {
this["death_hit_mc" + m].swapDepths(this["death_hit_mc" + m]._y);
this["hit_mc" + m].swapDepths(this["hit_mc" + m]._y - 100);
panningEffect(this["death_hit_mc" + m]);
panningEffect(this["hit_mc" + m]);
m++;
}
mazeWalls(char_mc);
}
function onMouseDown() {
fireHold = 1;
}
function onMouseUp() {
fireHold = 0;
}
function charShootNow() {
start_ball_x = char_mc._x + (20 * Math.cos((degrees * Math.PI) / 180));
start_ball_y = char_mc._y + (20 * Math.sin((degrees * Math.PI) / 180));
if (fireDelay == 0) {
if (bulletCount < 20) {
if ((stats_mc.item_mc1._alpha == 100) || (stats_mc.item_mc2._alpha == 100)) {
cannonball_fired = attachMovie("bullet_mc", "bullet_mc" + bulletCount, _root.getNextHighestDepth(), {_x:start_ball_x, _y:start_ball_y});
sfx_mc.gotoAndPlay("gun");
} else if (stats_mc.item_mc3._alpha == 100) {
cannonball_fired = attachMovie("bullet_mcX", "bullet_mc" + bulletCount, _root.getNextHighestDepth(), {_x:start_ball_x, _y:start_ball_y});
sfx_mc.gotoAndPlay("shotgun");
} else if (stats_mc.item_mc4._alpha == 100) {
cannonball_fired = attachMovie("bullet_mcXX", "bullet_mc" + bulletCount, _root.getNextHighestDepth(), {_x:start_ball_x, _y:start_ball_y});
sfx_mc.gotoAndPlay("shotgun");
} else {
cannonball_fired = attachMovie("bullet_mc", "bullet_mc" + bulletCount, _root.getNextHighestDepth(), {_x:start_ball_x, _y:start_ball_y});
sfx_mc.gotoAndPlay("gun");
}
cannonball_fired.dirx = Math.cos((degrees * Math.PI) / 180) * fireSpeed;
cannonball_fired.diry = Math.sin((degrees * Math.PI) / 180) * fireSpeed;
cannonball_fired._rotation = degrees;
cannonball_fired.ID = setInterval(bulletMove, duration, this["bullet_mc" + bulletCount]);
cannonball_fired.IDx = setInterval(charbulletHit, duration, this["bullet_mc" + bulletCount]);
bulletCount = bulletCount + 1;
} else {
bulletCount = 0;
}
if (stats_mc.item_mc1._alpha == 100) {
fireDelay = 25;
} else if ((stats_mc.item_mc2._alpha == 100) || (stats_mc.item_mc4._alpha == 100)) {
fireDelay = 12;
} else {
fireDelay = 25;
}
}
}
function bulletMove(bulletMc) {
if (pause_mc._visible == false) {
bulletMc._x = bulletMc._x + bulletMc.dirx;
bulletMc._y = bulletMc._y + bulletMc.diry;
panningEffect(bulletMc);
with (bulletMc) {
if (((maze_mc.walls.hitTest(getBounds(_parent).xMax, _y, true) || (maze_mc.walls.hitTest(getBounds(_parent).xMin, _y, true))) || (maze_mc.walls.hitTest(_x, getBounds(_parent).yMax, true))) || (maze_mc.walls.hitTest(_x, getBounds(_parent).yMin, true))) {
clearInterval(bulletMc.ID);
clearInterval(bulletMc.IDx);
bulletMc.removeMovieClip();
}
}
if ((((bulletMc._x < 0) || (bulletMc._x > 640)) || (bulletMc._y < 0)) || (bulletMc._y > 450)) {
clearInterval(bulletMc.ID);
clearInterval(bulletMc.IDx);
bulletMc.removeMovieClip();
}
}
}
function charbulletHit(bulletMc) {
i = 0;
while (i < enemyNumber) {
if (bulletMc.hitTest(_root["enemy_mc" + i])) {
if ((stats_mc.item_mc1._alpha == 100) || (stats_mc.item_mc2._alpha == 100)) {
clearInterval(bulletMc.ID);
clearInterval(bulletMc.IDx);
bulletMc.removeMovieClip();
}
if (_root["enemy_mc" + i].enemyLife <= 1) {
sfx_mc.gotoAndPlay("yell");
generateBlood(i);
if (stats_mc.combo_mc._xscale > 0) {
multiplier = multiplier + 1;
multiplier_mc.multiplier_txt.text = "x" + multiplier;
} else {
multiplier = 1;
multiplier_mc.multiplier_txt.text = "x" + multiplier;
}
score = score + (1 * multiplier);
stats_mc.score_txt.text = score;
if (bounty > 0) {
bounty = bounty - 1;
stats_mc.bounty_txt.text = bounty;
}
multiplier_mc._x = _root["enemy_mc" + i]._x;
multiplier_mc._y = _root["enemy_mc" + i]._y;
multiplier_mc.gotoAndPlay(2);
stats_mc.combo_mc._xscale = 100;
_root["enemy_mc" + i].enemyLife = stageChoose;
randomEnemy(i);
} else {
_root["enemy_mc" + i].enemyLife = _root["enemy_mc" + i].enemyLife - 1;
_root["enemy_mc_dummy" + i]._alpha = 50;
}
}
i++;
}
if (bulletMc.hitTest(_root.boss_mc) && ((_root["poster_stage" + stageChoose]._currentframe == 1) && (_root.poster_char._currentframe == 1))) {
clearInterval(bulletMc.ID);
clearInterval(bulletMc.IDx);
bulletMc.removeMovieClip();
boss_mc_dummy2.gotoAndStop("die");
generateHit("boss_mc");
if (bossLife_mc.health_mc._xscale > 0) {
bossLife_mc.health_mc._xscale = bossLife_mc.health_mc._xscale - 4;
sfx_mc.gotoAndPlay("hic");
} else {
clearInterval(mainId);
_root.boss_mc.removeMovieClip();
_root.sfx_mc.gotoAndPlay("yell2");
endStage();
}
}
}
function enemybulletHit(bulletMc) {
if (bulletMc.hitTest(char_mc) && ((_root["poster_stage" + stageChoose]._currentframe == 1) && (_root.poster_char._currentframe == 1))) {
clearInterval(bulletMc.ID);
clearInterval(bulletMc.IDx);
bulletMc.removeMovieClip();
char_mc.gotoAndPlay(2);
char_mc_dummy._alpha = 50;
generateHit("char_mc");
if (stats_mc.health_mc._xscale > 0) {
stats_mc.health_mc._xscale = stats_mc.health_mc._xscale - 4;
} else {
clearInterval(mainId);
diedStage();
}
}
}
function charBombNow() {
start_bomb_x = char_mc._x + (20 * Math.cos((degrees * Math.PI) / 180));
start_bomb_y = char_mc._y + (20 * Math.sin((degrees * Math.PI) / 180));
if (bombDelay == 0) {
if (bombCount < 5) {
bombLimit = bombLimit - 1;
stats_mc.bomb_txt.text = bombLimit;
trace("HOY");
bomb_fired = attachMovie("molotov_mc", "molotov_mc" + bombCount, _root.getNextHighestDepth(), {_x:start_bomb_x, _y:start_bomb_y});
bomb_fired.dirx = (Math.cos((degrees * Math.PI) / 180) * fireSpeed) / 2;
bomb_fired.diry = (Math.sin((degrees * Math.PI) / 180) * fireSpeed) / 2;
bomb_fired._rotation = degrees;
bomb_fired.ID = setInterval(bombMove, duration / 1.5, this["molotov_mc" + bombCount]);
bombCount = bombCount + 1;
} else {
bombCount = 0;
}
bombDelay = 20;
}
}
function bombMove(bombMc) {
if (pause_mc._visible == false) {
bombMc.nextFrame();
bombMc._x = bombMc._x + (bombMc.dirx * 1);
bombMc._y = bombMc._y + (bombMc.diry * 1);
if (bombMc._currentframe == 19) {
explodeNow();
clearInterval(bombMc.ID);
bombMc.removeMovieClip();
} else {
with (bombMc) {
if (((maze_mc.walls.hitTest(getBounds(_parent).xMax, _y, true) || (maze_mc.walls.hitTest(getBounds(_parent).xMin, _y, true))) || (maze_mc.walls.hitTest(_x, getBounds(_parent).yMax, true))) || (maze_mc.walls.hitTest(_x, getBounds(_parent).yMin, true))) {
explodeNow();
clearInterval(bombMc.ID);
bombMc.removeMovieClip();
}
}
}
panningEffect(bombMc);
}
}
function explodeNow() {
sfx_mc.gotoAndPlay("bomb");
start_bomb_x = bomb_fired._x + (20 * Math.cos((degrees * Math.PI) / 180));
start_bomb_y = bomb_fired._y + (20 * Math.sin((degrees * Math.PI) / 180));
bomb_explode = attachMovie("explode_mc", "explode_mc" + bombCount, _root.getNextHighestDepth(), {_x:start_bomb_x, _y:start_bomb_y});
bomb_explode.dirx = Math.cos((degrees * Math.PI) / 180) * fireSpeed;
bomb_explode.diry = Math.sin((degrees * Math.PI) / 180) * fireSpeed;
bomb_explode.ID = setInterval(bombHit, duration, this["explode_mc" + bombCount]);
}
function bombHit(explodeMc) {
explodeMc.nextFrame();
panningEffect(explodeMc);
i = 0;
while (i < enemyNumber) {
if ((explodeMc.hitTest(_root["enemy_mc" + i]) && (explodeMc._currentframe > 2)) && (explodeMc._currentframe < 6)) {
sfx_mc.gotoAndPlay("yell");
generateBlood(i);
if (stats_mc.combo_mc._xscale > 0) {
multiplier = multiplier + 1;
multiplier_mc.multiplier_txt.text = "x" + multiplier;
} else {
multiplier = 1;
multiplier_mc.multiplier_txt.text = "x" + multiplier;
}
score = score + (1 * multiplier);
stats_mc.score_txt.text = score;
if (bounty > 0) {
bounty = bounty - 1;
stats_mc.bounty_txt.text = bounty;
}
multiplier_mc._x = _root["enemy_mc" + i]._x;
multiplier_mc._y = _root["enemy_mc" + i]._y;
multiplier_mc.gotoAndPlay(2);
stats_mc.combo_mc._xscale = 100;
randomEnemy(i);
}
i++;
}
if (((explodeMc.hitTest(_root.boss_mc) && (explodeMc._currentframe > 2)) && (explodeMc._currentframe < 5)) && ((_root["poster_stage" + stageChoose]._currentframe == 1) && (_root.poster_char._currentframe == 1))) {
generateHit("boss_mc");
boss_mc_dummy2.gotoAndStop("die");
if (bossLife_mc.health_mc._xscale > 0) {
bossLife_mc.health_mc._xscale = bossLife_mc.health_mc._xscale - 4;
sfx_mc.gotoAndPlay("hic");
} else {
clearInterval(mainId);
_root.boss_mc.removeMovieClip();
_root.sfx_mc.gotoAndPlay("yell2");
endStage();
}
}
if (((explodeMc.hitTest(_root.char_mc) && (explodeMc._currentframe > 2)) && (explodeMc._currentframe < 5)) && ((_root["poster_stage" + stageChoose]._currentframe == 1) && (_root.poster_char._currentframe == 1))) {
char_mc.gotoAndPlay(2);
char_mc_dummy._alpha = 50;
generateHit("char_mc");
if (stats_mc.health_mc._xscale > 0) {
stats_mc.health_mc._xscale = stats_mc.health_mc._xscale - 4;
} else {
clearInterval(mainId);
diedStage();
}
}
if (explodeMc._currentframe >= 15) {
clearInterval(explodeMc.ID);
explodeMc.removeMovieClip();
}
}
function generateBlood(i) {
duplicateMovieClip ("death_hit_mc", "death_hit_mc" + bloodCount, -(bloodCount + 5000));
this["death_hit_mc" + bloodCount]._x = this["enemy_mc" + i]._x;
this["death_hit_mc" + bloodCount]._y = this["enemy_mc" + i]._y;
this["death_hit_mc" + bloodCount].play();
bloodCount = bloodCount + 1;
}
function generateHit(i) {
duplicateMovieClip ("hit_mc", "hit_mc" + bloodCount, this.getNextHighestDepth());
this["hit_mc" + bloodCount]._x = this[i]._x;
this["hit_mc" + bloodCount]._y = this[i]._y;
this["hit_mc" + bloodCount]._xscale = 20;
this["hit_mc" + bloodCount]._yscale = 20;
this["hit_mc" + bloodCount].play();
bloodCount = bloodCount + 1;
}
function generateEnemy() {
var _local2 = 0;
_local2 = random(4);
duplicateMovieClip ("enemy_mc", "enemy_mc" + enemyNumber, this.getNextHighestDepth());
this["enemy_mc" + enemyNumber].enemyMove = 50;
this["enemy_mc" + enemyNumber].enemyShoot = 50;
this["enemy_mc" + enemyNumber].enemyLife = stageChoose;
this["enemy_mc" + enemyNumber].enemyDelay = 10;
duplicateMovieClip ("enemy_mc_dummy", "enemy_mc_dummy" + enemyNumber, this.getNextHighestDepth());
if (_local2 == 0) {
this["enemy_mc" + enemyNumber]._x = -30;
this["enemy_mc" + enemyNumber]._y = char_mc._y;
} else if (_local2 == 1) {
this["enemy_mc" + enemyNumber]._x = 670;
this["enemy_mc" + enemyNumber]._y = char_mc._y;
} else if (_local2 == 2) {
this["enemy_mc" + enemyNumber]._x = char_mc._x;
this["enemy_mc" + enemyNumber]._y = -30;
} else if (_local2 == 3) {
this["enemy_mc" + enemyNumber]._x = char_mc._x;
this["enemy_mc" + enemyNumber]._y = 510;
}
enemyNumber = enemyNumber + 1;
}
function randomEnemy(i) {
var _local3 = 0;
_local3 = random(4);
this["enemy_mc" + i].enemyMove = 50;
this["enemy_mc" + i].enemyShoot = 50;
this["enemy_mc" + i].enemyDelay = 10;
if (_local3 == 0) {
this["enemy_mc" + i]._x = -100;
this["enemy_mc" + i]._y = char_mc._y;
} else if (_local3 == 1) {
this["enemy_mc" + i]._x = 750;
this["enemy_mc" + i]._y = char_mc._y;
} else if (_local3 == 2) {
this["enemy_mc" + i]._x = char_mc._x;
this["enemy_mc" + i]._y = -100;
} else if (_local3 == 3) {
this["enemy_mc" + i]._x = char_mc._x;
this["enemy_mc" + i]._y = 560;
}
}
function collideEnemy(i) {
j = 0;
if (j < enemyNumber) {
if (this["enemy_mc" + i].hitTest(this["enemy_mc" + j]) && (i != j)) {
return(true);
}
return(false);
}
}
function enemyShootNow(i) {
start_ball_xEnemy = this["enemy_mc" + i]._x + (20 * Math.cos((degreesEnemy * Math.PI) / 180));
start_ball_yEnemy = this["enemy_mc" + i]._y + (20 * Math.sin((degreesEnemy * Math.PI) / 180));
if (bulletCountEnemy < 30) {
sfx_mc.gotoAndPlay("gun");
cannonball_firedEnemy = attachMovie("bullet_mc", "bullet_mc_enemy" + bulletCountEnemy, _root.getNextHighestDepth(), {_x:start_ball_xEnemy, _y:start_ball_yEnemy});
cannonball_firedEnemy.dirx = Math.cos((degreesEnemy * Math.PI) / 180) * fireSpeed;
cannonball_firedEnemy.diry = Math.sin((degreesEnemy * Math.PI) / 180) * fireSpeed;
cannonball_firedEnemy._rotation = degreesEnemy;
cannonball_firedEnemy.ID = setInterval(bulletMove, duration, this["bullet_mc_enemy" + bulletCountEnemy]);
cannonball_firedEnemy.IDx = setInterval(enemybulletHit, duration, this["bullet_mc_enemy" + bulletCountEnemy]);
bulletCountEnemy = bulletCountEnemy + 1;
} else {
bulletCountEnemy = 0;
}
}
function bossShootNow() {
start_ball_xEnemy = boss_mc._x + (20 * Math.cos((degreesEnemy * Math.PI) / 180));
start_ball_yEnemy = boss_mc._y + (20 * Math.sin((degreesEnemy * Math.PI) / 180));
if (bulletCountBoss < 20) {
sfx_mc.gotoAndPlay("shotgun");
cannonball_firedEnemy = attachMovie("bullet_mcX", "bullet_mc_boss" + bulletCountBoss, _root.getNextHighestDepth(), {_x:start_ball_xEnemy, _y:start_ball_yEnemy});
cannonball_firedEnemy.dirx = Math.cos((degreesEnemy * Math.PI) / 180) * fireSpeed;
cannonball_firedEnemy.diry = Math.sin((degreesEnemy * Math.PI) / 180) * fireSpeed;
cannonball_firedEnemy._rotation = degreesEnemy;
cannonball_firedEnemy.ID = setInterval(bulletMove, duration, this["bullet_mc_boss" + bulletCountBoss]);
cannonball_firedEnemy.IDx = setInterval(enemybulletHit, duration, this["bullet_mc_boss" + bulletCountBoss]);
bulletCountBoss = bulletCountBoss + 1;
} else {
bulletCountBoss = 0;
}
}
function mazeWalls(nameMc) {
with (nameMc) {
if (maze_mc.walls.hitTest(getBounds(_parent).xMax, _y, true)) {
nameMc._x = nameMc._x - (moveSpeed * 1);
}
if (maze_mc.walls.hitTest(getBounds(_parent).xMin, _y, true)) {
_x = _x + (moveSpeed * 1);
}
if (maze_mc.walls.hitTest(_x, getBounds(_parent).yMax, true)) {
_y = _y - (moveSpeed * 1);
}
if (maze_mc.walls.hitTest(_x, getBounds(_parent).yMin, true)) {
_y = _y + (moveSpeed * 1);
}
}
}
function panningEffect(nameMc) {
if (bgMovesX == -1) {
nameMc._x = nameMc._x - moveSpeed;
}
if (bgMovesX == 1) {
nameMc._x = nameMc._x + moveSpeed;
}
if (bgMovesY == -1) {
nameMc._y = nameMc._y - moveSpeed;
}
if (bgMovesY == 1) {
nameMc._y = nameMc._y + moveSpeed;
}
}
function endStage() {
this["poster_stage" + stageChoose].gotoAndPlay(2);
this["poster_stage" + stageChoose].swapDepths(1500);
score = score + (1000 * stageChoose);
stats_mc.score_txt.text = score;
target_mc.removeMovieClip();
Mouse.show();
pause_btn._visible = false;
pause_mc._visible = false;
Key.removeListener(keyListener);
}
function diedStage() {
poster_char.gotoAndPlay(2);
poster_char.swapDepths(1000);
char_mc_dummy.gotoAndStop("die");
target_mc.removeMovieClip();
Mouse.show();
pause_btn._visible = false;
pause_mc._visible = false;
Key.removeListener(keyListener);
}
function goBack() {
removeObjects();
stopAllSounds();
gotoAndStop ("townSelect");
}
function goTown() {
removeObjects();
stopAllSounds();
gotoAndStop ("townSelect");
}
function goQuit() {
removeObjects();
stopAllSounds();
gotoAndStop ("title");
}
function removeObjects() {
i2 = 0;
while (i2 < enemyNumber) {
removeMovieClip(this["enemy_mc_dummy" + i2]);
i2++;
}
k2 = 0;
while (k2 <= 30) {
removeMovieClip(this["object_mc" + k2]);
k2++;
}
m2 = 0;
while (m2 <= bloodCount) {
removeMovieClip(this["death_hit_mc" + m2]);
removeMovieClip(this["hit_mc" + m2]);
m2++;
}
removeMovieClip(stats_mc);
removeMovieClip(this["boss_mc_dummy" + stageChoose]);
removeMovieClip(this["boss_mc_dummy" + (stageChoose - 1)]);
removeMovieClip(bossLife_mc);
removeMovieClip(char_mc_dummy);
removeMovieClip(this["poster_stage" + stageChoose]);
removeMovieClip(this["poster_stage" + (stageChoose - 1)]);
removeMovieClip(poster_char);
removeMovieClip(pause_mc);
removeMovieClip(pause_btn);
removeMovieClip(map_mc);
}
function initItems() {
i = 1;
while (i <= 4) {
stats_mc["item_mc" + i]._alpha = 10;
stats_mc["item_box" + i]._visible = false;
i++;
}
}
function initItems2() {
i = 1;
while (i <= 2) {
stats_mc["item_mc" + i]._alpha = 80;
i++;
}
}
stop();
Mouse.hide();
sound_mc.gotoAndPlay(2);
var mainId = 0;
var duration = 32;
var bulletId;
var radians = 0;
var degrees = 0;
var radiansEnemy = 0;
var degreesEnemy = 0;
var enemyNumber = 0;
var enemyBilang = 0;
var moveSpeed = 4;
var fireSpeed = 15;
var fireDelay = 20;
var fireHold = 0;
var hitDelay = 5;
var bombDelay = 20;
var bombLimit = 5;
var bgMovesX = 0;
var bgMovesY = 0;
var bulletCount = 0;
var bombCount = 0;
var explodeCount = 0;
var bulletCountEnemy = 0;
var bulletCountBoss = 0;
var bloodCount = 0;
var multiplier = 0;
stats_mc.combo_mc._xscale = 0;
char_mc._visible = false;
generateEnemy();
stats_mc.bounty_txt.text = bounty;
stats_mc.score_txt.text = score;
stats_mc.bomb_txt.text = bombLimit;
stats_mc.swapDepths(800);
target_mc.swapDepths(900);
alert_mc.swapDepths(820);
mainId = setInterval(mainMc, 20);
initItems();
initItems2();
stats_mc.item_mc1._alpha = 100;
stats_mc.item_box1._visible = true;
var keyListener = new Object();
keyListener.onKeyDown = function () {
if (chr(Key.getAscii()) == "1") {
initItems();
initItems2();
stats_mc.item_mc1._alpha = 100;
stats_mc.item_box1._visible = true;
sfx_mc.gotoAndPlay("select");
} else if (chr(Key.getAscii()) == "2") {
initItems();
initItems2();
stats_mc.item_mc2._alpha = 100;
stats_mc.item_box2._visible = true;
sfx_mc.gotoAndPlay("select");
}
};
Key.addListener(keyListener);
pause_mc._visible = false;
pause_btn._visible = true;
pause_mc.swapDepths(850);
pause_btn.swapDepths(870);
pause_btn.pause_btn.onRelease = function () {
this._parent._visible = false;
pause_mc._visible = true;
};
pause_mc.continue_btn.onRelease = function () {
this._parent._visible = false;
pause_btn._visible = true;
};
Instance of Symbol 1943 MovieClip "map_mc" in Frame 65
onClipEvent (load) {
this.swapDepths(_root.getNextHighestDepth());
}
Frame 70
function mainMc() {
if (pause_mc._visible == false) {
characterMove();
enemyMove();
bossMove();
objectMove();
bilang = bilang + 1;
}
target_mc._x = _xmouse;
target_mc._y = _ymouse;
}
function characterMove() {
radians = Math.atan2(_ymouse - char_mc._y, _xmouse - char_mc._x);
degrees = (radians / Math.PI) * 180;
char_mc._rotation = degrees;
if ((Key.isDown(38) || (Key.isDown(87))) && (char_mc._y > 0)) {
if (bg_mc._y >= -20) {
if ((char_mc._y > 0) && (char_mc._y < (Stage.height / 2))) {
char_mc._y = char_mc._y - moveSpeed;
bgMovesY = 0;
} else {
char_mc._y = char_mc._y - moveSpeed;
bgMovesY = 0;
}
} else if (char_mc._y >= (Stage.height / 2)) {
char_mc._y = char_mc._y - moveSpeed;
bgMovesY = 0;
} else {
bg_mc._y = bg_mc._y + moveSpeed;
bgMovesY = 1;
}
char_mc_dummy.char_mc.play();
} else if ((Key.isDown(40) || (Key.isDown(83))) && (char_mc._y < 340)) {
if (bg_mc._y <= ((Stage.height - 750) + 20)) {
if ((char_mc._y > (Stage.height / 2)) && (char_mc._y < Stage.height)) {
char_mc._y = char_mc._y + moveSpeed;
bgMovesY = 0;
} else {
char_mc._y = char_mc._y + moveSpeed;
bgMovesY = 0;
}
} else if (char_mc._y <= (Stage.height / 2)) {
char_mc._y = char_mc._y + moveSpeed;
bgMovesY = 0;
} else {
bg_mc._y = bg_mc._y - moveSpeed;
bgMovesY = -1;
}
char_mc_dummy.char_mc.play();
} else {
bgMovesY = 0;
}
if ((Key.isDown(37) || (Key.isDown(65))) && (char_mc._x > 0)) {
if (bg_mc._x >= -20) {
if ((char_mc._x > 0) && (char_mc._x < (Stage.width / 2))) {
char_mc._x = char_mc._x - moveSpeed;
bgMovesX = 0;
} else {
char_mc._x = char_mc._x - moveSpeed;
bgMovesX = 0;
}
} else if (char_mc._x >= (Stage.width / 2)) {
char_mc._x = char_mc._x - moveSpeed;
bgMovesX = 0;
} else {
bg_mc._x = bg_mc._x + moveSpeed;
bgMovesX = 1;
}
char_mc_dummy.char_mc.play();
} else if ((Key.isDown(39) || (Key.isDown(68))) && (char_mc._x < 640)) {
if (bg_mc._x <= ((Stage.width - 1020) + 20)) {
if ((char_mc._x > (Stage.width / 2)) && (char_mc._x < Stage.width)) {
char_mc._x = char_mc._x + moveSpeed;
bgMovesX = 0;
} else {
char_mc._x = char_mc._x + moveSpeed;
bgMovesX = 0;
}
} else if (char_mc._x <= (Stage.width / 2)) {
char_mc._x = char_mc._x + moveSpeed;
bgMovesX = 0;
} else {
bg_mc._x = bg_mc._x - moveSpeed;
bgMovesX = -1;
}
char_mc_dummy.char_mc.play();
} else {
bgMovesX = 0;
}
if ((Key.isDown(32) || (Key.isDown(17))) && (bombLimit > 0)) {
charBombNow();
}
char_mc_dummy._x = char_mc._x;
char_mc_dummy._y = char_mc._y + 30;
map_mc.map_mychar._x = char_mc._x / 8;
map_mc.map_mychar._y = char_mc._y / 8;
mouseRotate(char_mc_dummy, degrees);
if (char_mc_dummy._alpha == 50) {
hitDelay = hitDelay - 1;
}
if (hitDelay <= 0) {
char_mc_dummy._alpha = 100;
hitDelay = 5;
}
if (fireDelay > 0) {
fireDelay = fireDelay - 1;
}
if (fireHold > 0) {
charShootNow();
}
if (bombDelay > 0) {
bombDelay = bombDelay - 1;
}
multiplier_mc.multiplier_txt.text = "x" + multiplier;
if (stats_mc.combo_mc._xscale > 0) {
stats_mc.combo_mc._xscale = stats_mc.combo_mc._xscale - 1;
}
}
function enemyMove() {
i = 0;
while (i < enemyNumber) {
this["enemy_mc" + i]._visible = false;
radiansEnemy = Math.atan2(char_mc._y - this["enemy_mc" + i]._y, char_mc._x - this["enemy_mc" + i]._x);
degreesEnemy = (radiansEnemy / Math.PI) * 180;
this["enemy_mc" + i]._rotation = degreesEnemy;
mouseRotate(this["enemy_mc_dummy" + i], degreesEnemy);
if (this["enemy_mc_dummy" + i]._alpha == 50) {
this["enemy_mc" + i].enemyDelay = this["enemy_mc" + i].enemyDelay - 1;
}
if (this["enemy_mc" + i].enemyDelay <= 0) {
this["enemy_mc_dummy" + i]._alpha = 100;
this["enemy_mc" + i].enemyDelay = this["enemy_mc" + i].enemyDelay - 1;
}
collideEnemy(i);
if (this["enemy_mc" + i].enemyMove > 0) {
if ((Math.sqrt(Math.pow(char_mc._y - this["enemy_mc" + i]._y, 2) + Math.pow(char_mc._x - this["enemy_mc" + i]._x, 2)) > 100) && (collideEnemy(i) == false)) {
if ((char_mc._x < this["enemy_mc" + i]._x) && (Math.abs(char_mc._x - this["enemy_mc" + i]._x) > 1)) {
this["enemy_mc" + i]._x = this["enemy_mc" + i]._x - enemyMoveSpeed;
} else if ((char_mc._x > this["enemy_mc" + i]._x) && (Math.abs(char_mc._x - this["enemy_mc" + i]._x) > 1)) {
this["enemy_mc" + i]._x = this["enemy_mc" + i]._x + enemyMoveSpeed;
}
if ((char_mc._y < this["enemy_mc" + i]._y) && (Math.abs(char_mc._y - this["enemy_mc" + i]._y) > 1)) {
this["enemy_mc" + i]._y = this["enemy_mc" + i]._y - enemyMoveSpeed;
} else if ((char_mc._y > this["enemy_mc" + i]._y) && (Math.abs(char_mc._y - this["enemy_mc" + i]._y) > 1)) {
this["enemy_mc" + i]._y = this["enemy_mc" + i]._y + enemyMoveSpeed;
}
this["enemy_mc_dummy" + i]._x = this["enemy_mc" + i]._x;
this["enemy_mc_dummy" + i]._y = this["enemy_mc" + i]._y + 30;
map_mc["map_char" + i]._x = this["enemy_mc" + i]._x / 8;
map_mc["map_char" + i]._y = this["enemy_mc" + i]._y / 8;
this["enemy_mc_dummy" + i].char_mc.play();
this["enemy_mc_dummy" + i].swapDepths(this["enemy_mc_dummy" + i]._y);
}
this["enemy_mc" + i].enemyMove = this["enemy_mc" + i].enemyMove - 1;
} else if (this["enemy_mc" + i].enemyShoot > 0) {
this["enemy_mc" + i].enemyShoot = this["enemy_mc" + i].enemyShoot - 1;
if (this["enemy_mc" + i].enemyShoot == 30) {
enemyShootNow(i);
}
} else {
this["enemy_mc" + i].enemyMove = 50;
this["enemy_mc" + i].enemyShoot = 50;
}
mazeWalls(this["enemy_mc" + i]);
panningEffect(this["enemy_mc" + i]);
panningEffect(this["enemy_mc_dummy" + i]);
i++;
}
if (enemyNumber < 12) {
if (enemyBilang < 500) {
enemyBilang = enemyBilang + 1;
} else {
generateEnemy();
enemyBilang = 0;
}
}
}
function bossMove() {
boss_mc._visible = false;
radiansEnemy = Math.atan2(char_mc._y - boss_mc._y, char_mc._x - boss_mc._x);
degreesEnemy = (radiansEnemy / Math.PI) * 180;
boss_mc._rotation = degreesEnemy;
mouseRotate(this["boss_mc_dummy" + stageChoose], degreesEnemy);
if (bounty <= 0) {
if (alert_mc._currentframe < 40) {
alert_mc.play();
} else {
alert_mc.removeMovieClip();
}
if (boss_mc.enemyMove > 0) {
if (Math.sqrt(Math.pow(char_mc._y - boss_mc._y, 2) + Math.pow(char_mc._x - boss_mc._x, 2)) > 100) {
if ((char_mc._x < boss_mc._x) && (Math.abs(char_mc._x - boss_mc._x) > 1)) {
boss_mc._x = boss_mc._x - moveSpeed;
} else if ((char_mc._x > boss_mc._x) && (Math.abs(char_mc._x - boss_mc._x) > 1)) {
boss_mc._x = boss_mc._x + moveSpeed;
}
if ((char_mc._y < boss_mc._y) && (Math.abs(char_mc._y - boss_mc._y) > 1)) {
boss_mc._y = boss_mc._y - moveSpeed;
} else if ((char_mc._y > boss_mc._y) && (Math.abs(char_mc._y - boss_mc._y) > 1)) {
boss_mc._y = boss_mc._y + moveSpeed;
}
this["boss_mc_dummy" + stageChoose]._x = boss_mc._x;
this["boss_mc_dummy" + stageChoose]._y = boss_mc._y + 30;
this["boss_mc_dummy" + stageChoose].char_mc.play();
this["boss_mc_dummy" + stageChoose].swapDepths(this["boss_mc_dummy" + stageChoose]._y);
}
boss_mc.enemyMove = boss_mc.enemyMove - 1;
} else if (boss_mc.enemyShoot > 0) {
boss_mc.enemyShoot = boss_mc.enemyShoot - 1;
if ((((boss_mc.enemyShoot == 10) || (boss_mc.enemyShoot == 20)) || (boss_mc.enemyShoot == 30)) || (boss_mc.enemyShoot == 40)) {
bossShootNow();
}
} else {
boss_mc.enemyMove = 50;
boss_mc.enemyShoot = 50;
}
}
mazeWalls(boss_mc);
panningEffect(boss_mc);
panningEffect(this["boss_mc_dummy" + stageChoose]);
bossLife_mc._x = boss_mc._x;
bossLife_mc._y = boss_mc._y - 35;
map_mc.map_boss._x = boss_mc._x / 8;
map_mc.map_boss._y = boss_mc._y / 8;
bossLife_mc.swapDepths(this["boss_mc_dummy" + stageChoose]._y);
}
function mouseRotate(charMc, charDegrees) {
if ((charDegrees >= -120) && (charDegrees < -75)) {
charMc.gotoAndStop("char_up");
} else if ((charDegrees >= -75) && (charDegrees < -30)) {
charMc.gotoAndStop("char_diag_up");
charMc._xscale = 100;
} else if ((charDegrees >= -30) && (charDegrees < 15)) {
charMc.gotoAndStop("char_side");
charMc._xscale = 100;
} else if ((charDegrees >= 15) && (charDegrees < 60)) {
charMc.gotoAndStop("char_diag_down");
charMc._xscale = 100;
} else if ((charDegrees >= 60) && (charDegrees < 105)) {
charMc.gotoAndStop("char_down");
} else if ((charDegrees >= 105) && (charDegrees < 150)) {
charMc.gotoAndStop("char_diag_down");
charMc._xscale = -100;
} else if (((charDegrees >= 150) && (charDegrees < 180)) || ((charDegrees > -180) && (charDegrees < -165))) {
charMc.gotoAndStop("char_side");
charMc._xscale = -100;
} else if ((charDegrees >= -165) && (charDegrees < 120)) {
charMc.gotoAndStop("char_diag_up");
charMc._xscale = -100;
}
charMc.swapDepths(charMc._y);
}
function objectMove() {
k = 0;
while (k <= 30) {
this["object_mc" + k].swapDepths(this["object_mc" + k]._y);
panningEffect(this["object_mc" + k]);
k++;
}
panningEffect(maze_mc);
m = 0;
while (m <= bloodCount) {
this["death_hit_mc" + m].swapDepths(this["death_hit_mc" + m]._y);
this["hit_mc" + m].swapDepths(this["hit_mc" + m]._y - 100);
panningEffect(this["death_hit_mc" + m]);
panningEffect(this["hit_mc" + m]);
m++;
}
mazeWalls(char_mc);
}
function onMouseDown() {
fireHold = 1;
}
function onMouseUp() {
fireHold = 0;
}
function charShootNow() {
start_ball_x = char_mc._x + (20 * Math.cos((degrees * Math.PI) / 180));
start_ball_y = char_mc._y + (20 * Math.sin((degrees * Math.PI) / 180));
if (fireDelay == 0) {
if (bulletCount < 20) {
if ((stats_mc.item_mc1._alpha == 100) || (stats_mc.item_mc2._alpha == 100)) {
cannonball_fired = attachMovie("bullet_mc", "bullet_mc" + bulletCount, _root.getNextHighestDepth(), {_x:start_ball_x, _y:start_ball_y});
sfx_mc.gotoAndPlay("gun");
} else if (stats_mc.item_mc3._alpha == 100) {
cannonball_fired = attachMovie("bullet_mcX", "bullet_mc" + bulletCount, _root.getNextHighestDepth(), {_x:start_ball_x, _y:start_ball_y});
sfx_mc.gotoAndPlay("shotgun");
} else if (stats_mc.item_mc4._alpha == 100) {
cannonball_fired = attachMovie("bullet_mcXX", "bullet_mc" + bulletCount, _root.getNextHighestDepth(), {_x:start_ball_x, _y:start_ball_y});
sfx_mc.gotoAndPlay("shotgun");
} else {
cannonball_fired = attachMovie("bullet_mc", "bullet_mc" + bulletCount, _root.getNextHighestDepth(), {_x:start_ball_x, _y:start_ball_y});
sfx_mc.gotoAndPlay("gun");
}
cannonball_fired.dirx = Math.cos((degrees * Math.PI) / 180) * fireSpeed;
cannonball_fired.diry = Math.sin((degrees * Math.PI) / 180) * fireSpeed;
cannonball_fired._rotation = degrees;
cannonball_fired.ID = setInterval(bulletMove, duration, this["bullet_mc" + bulletCount]);
cannonball_fired.IDx = setInterval(charbulletHit, duration, this["bullet_mc" + bulletCount]);
bulletCount = bulletCount + 1;
} else {
bulletCount = 0;
}
if (stats_mc.item_mc1._alpha == 100) {
fireDelay = 25;
} else if ((stats_mc.item_mc2._alpha == 100) || (stats_mc.item_mc4._alpha == 100)) {
fireDelay = 12;
} else {
fireDelay = 25;
}
}
}
function bulletMove(bulletMc) {
if (pause_mc._visible == false) {
bulletMc._x = bulletMc._x + bulletMc.dirx;
bulletMc._y = bulletMc._y + bulletMc.diry;
panningEffect(bulletMc);
with (bulletMc) {
if (((maze_mc.walls.hitTest(getBounds(_parent).xMax, _y, true) || (maze_mc.walls.hitTest(getBounds(_parent).xMin, _y, true))) || (maze_mc.walls.hitTest(_x, getBounds(_parent).yMax, true))) || (maze_mc.walls.hitTest(_x, getBounds(_parent).yMin, true))) {
clearInterval(bulletMc.ID);
clearInterval(bulletMc.IDx);
bulletMc.removeMovieClip();
}
}
if ((((bulletMc._x < 0) || (bulletMc._x > 640)) || (bulletMc._y < 0)) || (bulletMc._y > 450)) {
clearInterval(bulletMc.ID);
clearInterval(bulletMc.IDx);
bulletMc.removeMovieClip();
}
}
}
function charbulletHit(bulletMc) {
i = 0;
while (i < enemyNumber) {
if (bulletMc.hitTest(_root["enemy_mc" + i])) {
if ((stats_mc.item_mc1._alpha == 100) || (stats_mc.item_mc2._alpha == 100)) {
clearInterval(bulletMc.ID);
clearInterval(bulletMc.IDx);
bulletMc.removeMovieClip();
}
if (_root["enemy_mc" + i].enemyLife <= 1) {
sfx_mc.gotoAndPlay("yell");
generateBlood(i);
if (stats_mc.combo_mc._xscale > 0) {
multiplier = multiplier + 1;
multiplier_mc.multiplier_txt.text = "x" + multiplier;
} else {
multiplier = 1;
multiplier_mc.multiplier_txt.text = "x" + multiplier;
}
score = score + (1 * multiplier);
stats_mc.score_txt.text = score;
if (bounty > 0) {
bounty = bounty - 1;
stats_mc.bounty_txt.text = bounty;
}
multiplier_mc._x = _root["enemy_mc" + i]._x;
multiplier_mc._y = _root["enemy_mc" + i]._y;
multiplier_mc.gotoAndPlay(2);
stats_mc.combo_mc._xscale = 100;
_root["enemy_mc" + i].enemyLife = stageChoose;
randomEnemy(i);
} else {
_root["enemy_mc" + i].enemyLife = _root["enemy_mc" + i].enemyLife - 1;
_root["enemy_mc_dummy" + i]._alpha = 50;
}
}
i++;
}
if (bulletMc.hitTest(_root.boss_mc) && ((_root["poster_stage" + stageChoose]._currentframe == 1) && (_root.poster_char._currentframe == 1))) {
clearInterval(bulletMc.ID);
clearInterval(bulletMc.IDx);
bulletMc.removeMovieClip();
boss_mc_dummy3.gotoAndStop("die");
generateHit("boss_mc");
if (bossLife_mc.health_mc._xscale > 0) {
bossLife_mc.health_mc._xscale = bossLife_mc.health_mc._xscale - 4;
sfx_mc.gotoAndPlay("hic");
} else {
clearInterval(mainId);
_root.boss_mc.removeMovieClip();
_root.sfx_mc.gotoAndPlay("yell2");
endStage();
}
}
}
function enemybulletHit(bulletMc) {
if (bulletMc.hitTest(char_mc) && ((_root["poster_stage" + stageChoose]._currentframe == 1) && (_root.poster_char._currentframe == 1))) {
clearInterval(bulletMc.ID);
clearInterval(bulletMc.IDx);
bulletMc.removeMovieClip();
char_mc.gotoAndPlay(2);
char_mc_dummy._alpha = 50;
generateHit("char_mc");
if (stats_mc.health_mc._xscale > 0) {
stats_mc.health_mc._xscale = stats_mc.health_mc._xscale - 4;
} else {
clearInterval(mainId);
diedStage();
}
}
}
function charBombNow() {
start_bomb_x = char_mc._x + (20 * Math.cos((degrees * Math.PI) / 180));
start_bomb_y = char_mc._y + (20 * Math.sin((degrees * Math.PI) / 180));
if (bombDelay == 0) {
if (bombCount < 5) {
bombLimit = bombLimit - 1;
stats_mc.bomb_txt.text = bombLimit;
trace("HOY");
bomb_fired = attachMovie("molotov_mc", "molotov_mc" + bombCount, _root.getNextHighestDepth(), {_x:start_bomb_x, _y:start_bomb_y});
bomb_fired.dirx = (Math.cos((degrees * Math.PI) / 180) * fireSpeed) / 2;
bomb_fired.diry = (Math.sin((degrees * Math.PI) / 180) * fireSpeed) / 2;
bomb_fired._rotation = degrees;
bomb_fired.ID = setInterval(bombMove, duration / 1.5, this["molotov_mc" + bombCount]);
bombCount = bombCount + 1;
} else {
bombCount = 0;
}
bombDelay = 20;
}
}
function bombMove(bombMc) {
if (pause_mc._visible == false) {
bombMc.nextFrame();
bombMc._x = bombMc._x + (bombMc.dirx * 1);
bombMc._y = bombMc._y + (bombMc.diry * 1);
if (bombMc._currentframe == 19) {
explodeNow();
clearInterval(bombMc.ID);
bombMc.removeMovieClip();
} else {
with (bombMc) {
if (((maze_mc.walls.hitTest(getBounds(_parent).xMax, _y, true) || (maze_mc.walls.hitTest(getBounds(_parent).xMin, _y, true))) || (maze_mc.walls.hitTest(_x, getBounds(_parent).yMax, true))) || (maze_mc.walls.hitTest(_x, getBounds(_parent).yMin, true))) {
explodeNow();
clearInterval(bombMc.ID);
bombMc.removeMovieClip();
}
}
}
panningEffect(bombMc);
}
}
function explodeNow() {
sfx_mc.gotoAndPlay("bomb");
start_bomb_x = bomb_fired._x + (20 * Math.cos((degrees * Math.PI) / 180));
start_bomb_y = bomb_fired._y + (20 * Math.sin((degrees * Math.PI) / 180));
bomb_explode = attachMovie("explode_mc", "explode_mc" + bombCount, _root.getNextHighestDepth(), {_x:start_bomb_x, _y:start_bomb_y});
bomb_explode.dirx = Math.cos((degrees * Math.PI) / 180) * fireSpeed;
bomb_explode.diry = Math.sin((degrees * Math.PI) / 180) * fireSpeed;
bomb_explode.ID = setInterval(bombHit, duration, this["explode_mc" + bombCount]);
}
function bombHit(explodeMc) {
explodeMc.nextFrame();
panningEffect(explodeMc);
i = 0;
while (i < enemyNumber) {
if ((explodeMc.hitTest(_root["enemy_mc" + i]) && (explodeMc._currentframe > 2)) && (explodeMc._currentframe < 6)) {
sfx_mc.gotoAndPlay("yell");
generateBlood(i);
if (stats_mc.combo_mc._xscale > 0) {
multiplier = multiplier + 1;
multiplier_mc.multiplier_txt.text = "x" + multiplier;
} else {
multiplier = 1;
multiplier_mc.multiplier_txt.text = "x" + multiplier;
}
score = score + (1 * multiplier);
stats_mc.score_txt.text = score;
if (bounty > 0) {
bounty = bounty - 1;
stats_mc.bounty_txt.text = bounty;
}
multiplier_mc._x = _root["enemy_mc" + i]._x;
multiplier_mc._y = _root["enemy_mc" + i]._y;
multiplier_mc.gotoAndPlay(2);
stats_mc.combo_mc._xscale = 100;
randomEnemy(i);
}
i++;
}
if (((explodeMc.hitTest(_root.boss_mc) && (explodeMc._currentframe > 2)) && (explodeMc._currentframe < 5)) && ((_root["poster_stage" + stageChoose]._currentframe == 1) && (_root.poster_char._currentframe == 1))) {
boss_mc_dummy3.gotoAndStop("die");
generateHit("boss_mc");
if (bossLife_mc.health_mc._xscale > 0) {
bossLife_mc.health_mc._xscale = bossLife_mc.health_mc._xscale - 4;
sfx_mc.gotoAndPlay("hic");
} else {
clearInterval(mainId);
_root.boss_mc.removeMovieClip();
_root.sfx_mc.gotoAndPlay("yell2");
endStage();
}
}
if (((explodeMc.hitTest(_root.char_mc) && (explodeMc._currentframe > 2)) && (explodeMc._currentframe < 5)) && ((_root["poster_stage" + stageChoose]._currentframe == 1) && (_root.poster_char._currentframe == 1))) {
char_mc.gotoAndPlay(2);
char_mc_dummy._alpha = 50;
generateHit("char_mc");
if (stats_mc.health_mc._xscale > 0) {
stats_mc.health_mc._xscale = stats_mc.health_mc._xscale - 4;
} else {
clearInterval(mainId);
diedStage();
}
}
if (explodeMc._currentframe >= 15) {
clearInterval(explodeMc.ID);
explodeMc.removeMovieClip();
}
}
function generateBlood(i) {
duplicateMovieClip ("death_hit_mc", "death_hit_mc" + bloodCount, -(bloodCount + 5000));
this["death_hit_mc" + bloodCount]._x = this["enemy_mc" + i]._x;
this["death_hit_mc" + bloodCount]._y = this["enemy_mc" + i]._y;
this["death_hit_mc" + bloodCount].play();
bloodCount = bloodCount + 1;
}
function generateHit(i) {
duplicateMovieClip ("hit_mc", "hit_mc" + bloodCount, this.getNextHighestDepth());
this["hit_mc" + bloodCount]._x = this[i]._x;
this["hit_mc" + bloodCount]._y = this[i]._y;
this["hit_mc" + bloodCount]._xscale = 20;
this["hit_mc" + bloodCount]._yscale = 20;
this["hit_mc" + bloodCount].play();
bloodCount = bloodCount + 1;
}
function generateEnemy() {
var _local2 = 0;
_local2 = random(4);
duplicateMovieClip ("enemy_mc", "enemy_mc" + enemyNumber, this.getNextHighestDepth());
this["enemy_mc" + enemyNumber].enemyMove = 50;
this["enemy_mc" + enemyNumber].enemyShoot = 50;
this["enemy_mc" + enemyNumber].enemyLife = stageChoose;
this["enemy_mc" + enemyNumber].enemyDelay = 10;
duplicateMovieClip ("enemy_mc_dummy", "enemy_mc_dummy" + enemyNumber, this.getNextHighestDepth());
if (_local2 == 0) {
this["enemy_mc" + enemyNumber]._x = -30;
this["enemy_mc" + enemyNumber]._y = char_mc._y;
} else if (_local2 == 1) {
this["enemy_mc" + enemyNumber]._x = 670;
this["enemy_mc" + enemyNumber]._y = char_mc._y;
} else if (_local2 == 2) {
this["enemy_mc" + enemyNumber]._x = char_mc._x;
this["enemy_mc" + enemyNumber]._y = -30;
} else if (_local2 == 3) {
this["enemy_mc" + enemyNumber]._x = char_mc._x;
this["enemy_mc" + enemyNumber]._y = 510;
}
enemyNumber = enemyNumber + 1;
}
function randomEnemy(i) {
var _local3 = 0;
_local3 = random(4);
this["enemy_mc" + i].enemyMove = 50;
this["enemy_mc" + i].enemyShoot = 50;
this["enemy_mc" + i].enemyDelay = 10;
if (_local3 == 0) {
this["enemy_mc" + i]._x = -100;
this["enemy_mc" + i]._y = char_mc._y;
} else if (_local3 == 1) {
this["enemy_mc" + i]._x = 750;
this["enemy_mc" + i]._y = char_mc._y;
} else if (_local3 == 2) {
this["enemy_mc" + i]._x = char_mc._x;
this["enemy_mc" + i]._y = -100;
} else if (_local3 == 3) {
this["enemy_mc" + i]._x = char_mc._x;
this["enemy_mc" + i]._y = 560;
}
}
function collideEnemy(i) {
j = 0;
if (j < enemyNumber) {
if (this["enemy_mc" + i].hitTest(this["enemy_mc" + j]) && (i != j)) {
return(true);
}
return(false);
}
}
function enemyShootNow(i) {
start_ball_xEnemy = this["enemy_mc" + i]._x + (20 * Math.cos((degreesEnemy * Math.PI) / 180));
start_ball_yEnemy = this["enemy_mc" + i]._y + (20 * Math.sin((degreesEnemy * Math.PI) / 180));
if (bulletCountEnemy < 30) {
sfx_mc.gotoAndPlay("gun");
cannonball_firedEnemy = attachMovie("bullet_mc", "bullet_mc_enemy" + bulletCountEnemy, _root.getNextHighestDepth(), {_x:start_ball_xEnemy, _y:start_ball_yEnemy});
cannonball_firedEnemy.dirx = Math.cos((degreesEnemy * Math.PI) / 180) * fireSpeed;
cannonball_firedEnemy.diry = Math.sin((degreesEnemy * Math.PI) / 180) * fireSpeed;
cannonball_firedEnemy._rotation = degreesEnemy;
cannonball_firedEnemy.ID = setInterval(bulletMove, duration, this["bullet_mc_enemy" + bulletCountEnemy]);
cannonball_firedEnemy.IDx = setInterval(enemybulletHit, duration, this["bullet_mc_enemy" + bulletCountEnemy]);
bulletCountEnemy = bulletCountEnemy + 1;
} else {
bulletCountEnemy = 0;
}
}
function bossShootNow() {
start_ball_xEnemy = boss_mc._x + (20 * Math.cos((degreesEnemy * Math.PI) / 180));
start_ball_yEnemy = boss_mc._y + (20 * Math.sin((degreesEnemy * Math.PI) / 180));
if (bulletCountBoss < 20) {
sfx_mc.gotoAndPlay("shotgun");
cannonball_firedEnemy = attachMovie("bullet_mcX", "bullet_mc_boss" + bulletCountBoss, _root.getNextHighestDepth(), {_x:start_ball_xEnemy, _y:start_ball_yEnemy});
cannonball_firedEnemy.dirx = Math.cos((degreesEnemy * Math.PI) / 180) * fireSpeed;
cannonball_firedEnemy.diry = Math.sin((degreesEnemy * Math.PI) / 180) * fireSpeed;
cannonball_firedEnemy._rotation = degreesEnemy;
cannonball_firedEnemy.ID = setInterval(bulletMove, duration, this["bullet_mc_boss" + bulletCountBoss]);
cannonball_firedEnemy.IDx = setInterval(enemybulletHit, duration, this["bullet_mc_boss" + bulletCountBoss]);
bulletCountBoss = bulletCountBoss + 1;
} else {
bulletCountBoss = 0;
}
}
function mazeWalls(nameMc) {
with (nameMc) {
if (maze_mc.walls.hitTest(getBounds(_parent).xMax, _y, true)) {
nameMc._x = nameMc._x - (moveSpeed * 1);
}
if (maze_mc.walls.hitTest(getBounds(_parent).xMin, _y, true)) {
_x = _x + (moveSpeed * 1);
}
if (maze_mc.walls.hitTest(_x, getBounds(_parent).yMax, true)) {
_y = _y - (moveSpeed * 1);
}
if (maze_mc.walls.hitTest(_x, getBounds(_parent).yMin, true)) {
_y = _y + (moveSpeed * 1);
}
}
}
function panningEffect(nameMc) {
if (bgMovesX == -1) {
nameMc._x = nameMc._x - moveSpeed;
}
if (bgMovesX == 1) {
nameMc._x = nameMc._x + moveSpeed;
}
if (bgMovesY == -1) {
nameMc._y = nameMc._y - moveSpeed;
}
if (bgMovesY == 1) {
nameMc._y = nameMc._y + moveSpeed;
}
}
function endStage() {
this["poster_stage" + stageChoose].gotoAndPlay(2);
this["poster_stage" + stageChoose].swapDepths(1500);
score = score + (1000 * stageChoose);
stats_mc.score_txt.text = score;
target_mc.removeMovieClip();
Mouse.show();
pause_btn._visible = false;
pause_mc._visible = false;
Key.removeListener(keyListener);
}
function diedStage() {
poster_char.gotoAndPlay(2);
poster_char.swapDepths(1000);
char_mc_dummy.gotoAndStop("die");
target_mc.removeMovieClip();
Mouse.show();
pause_btn._visible = false;
pause_mc._visible = false;
Key.removeListener(keyListener);
}
function goBack() {
removeObjects();
stopAllSounds();
gotoAndStop ("townSelect");
}
function goTown() {
removeObjects();
stopAllSounds();
gotoAndStop ("townSelect");
}
function goQuit() {
removeObjects();
stopAllSounds();
gotoAndStop ("title");
}
function removeObjects() {
i2 = 0;
while (i2 < enemyNumber) {
removeMovieClip(this["enemy_mc_dummy" + i2]);
i2++;
}
k2 = 0;
while (k2 <= 30) {
removeMovieClip(this["object_mc" + k2]);
k2++;
}
m2 = 0;
while (m2 <= bloodCount) {
removeMovieClip(this["death_hit_mc" + m2]);
removeMovieClip(this["hit_mc" + m2]);
m2++;
}
removeMovieClip(stats_mc);
removeMovieClip(this["boss_mc_dummy" + stageChoose]);
removeMovieClip(this["boss_mc_dummy" + (stageChoose - 1)]);
removeMovieClip(bossLife_mc);
removeMovieClip(char_mc_dummy);
removeMovieClip(this["poster_stage" + stageChoose]);
removeMovieClip(this["poster_stage" + (stageChoose - 1)]);
removeMovieClip(poster_char);
removeMovieClip(pause_mc);
removeMovieClip(pause_btn);
removeMovieClip(map_mc);
}
function initItems() {
i = 1;
while (i <= 4) {
stats_mc["item_mc" + i]._alpha = 10;
stats_mc["item_box" + i]._visible = false;
i++;
}
}
function initItems2() {
i = 1;
while (i <= 2) {
stats_mc["item_mc" + i]._alpha = 80;
i++;
}
}
stop();
Mouse.hide();
sound_mc.gotoAndPlay(2);
var mainId = 0;
var duration = 32;
var bulletId;
var radians = 0;
var degrees = 0;
var radiansEnemy = 0;
var degreesEnemy = 0;
var enemyNumber = 0;
var enemyBilang = 0;
var moveSpeed = 4;
var fireSpeed = 15;
var fireDelay = 20;
var fireHold = 0;
var hitDelay = 5;
var bombDelay = 20;
var bombLimit = 5;
var bgMovesX = 0;
var bgMovesY = 0;
var bulletCount = 0;
var bombCount = 0;
var explodeCount = 0;
var bulletCountEnemy = 0;
var bulletCountBoss = 0;
var bloodCount = 0;
var multiplier = 0;
stats_mc.combo_mc._xscale = 0;
char_mc._visible = false;
generateEnemy();
stats_mc.bounty_txt.text = bounty;
stats_mc.score_txt.text = score;
stats_mc.bomb_txt.text = bombLimit;
stats_mc.swapDepths(800);
target_mc.swapDepths(900);
alert_mc.swapDepths(820);
mainId = setInterval(mainMc, 20);
initItems();
initItems2();
stats_mc.item_mc1._alpha = 100;
stats_mc.item_box1._visible = true;
var keyListener = new Object();
keyListener.onKeyDown = function () {
if (chr(Key.getAscii()) == "1") {
initItems();
initItems2();
stats_mc.item_mc1._alpha = 100;
stats_mc.item_box1._visible = true;
sfx_mc.gotoAndPlay("select");
} else if (chr(Key.getAscii()) == "2") {
initItems();
initItems2();
stats_mc.item_mc2._alpha = 100;
stats_mc.item_box2._visible = true;
sfx_mc.gotoAndPlay("select");
}
};
Key.addListener(keyListener);
pause_mc._visible = false;
pause_btn._visible = true;
pause_mc.swapDepths(850);
pause_btn.swapDepths(870);
pause_btn.pause_btn.onRelease = function () {
this._parent._visible = false;
pause_mc._visible = true;
};
pause_mc.continue_btn.onRelease = function () {
this._parent._visible = false;
pause_btn._visible = true;
};
Frame 75
function mainMc() {
if (pause_mc._visible == false) {
characterMove();
enemyMove();
bossMove();
objectMove();
bilang = bilang + 1;
}
target_mc._x = _xmouse;
target_mc._y = _ymouse;
}
function characterMove() {
radians = Math.atan2(_ymouse - char_mc._y, _xmouse - char_mc._x);
degrees = (radians / Math.PI) * 180;
char_mc._rotation = degrees;
if ((Key.isDown(38) || (Key.isDown(87))) && (char_mc._y > 0)) {
if (bg_mc._y >= -20) {
if ((char_mc._y > 0) && (char_mc._y < (Stage.height / 2))) {
char_mc._y = char_mc._y - moveSpeed;
bgMovesY = 0;
} else {
char_mc._y = char_mc._y - moveSpeed;
bgMovesY = 0;
}
} else if (char_mc._y >= (Stage.height / 2)) {
char_mc._y = char_mc._y - moveSpeed;
bgMovesY = 0;
} else {
bg_mc._y = bg_mc._y + moveSpeed;
bgMovesY = 1;
}
char_mc_dummy.char_mc.play();
} else if ((Key.isDown(40) || (Key.isDown(83))) && (char_mc._y < 340)) {
if (bg_mc._y <= ((Stage.height - 750) + 20)) {
if ((char_mc._y > (Stage.height / 2)) && (char_mc._y < Stage.height)) {
char_mc._y = char_mc._y + moveSpeed;
bgMovesY = 0;
} else {
char_mc._y = char_mc._y + moveSpeed;
bgMovesY = 0;
}
} else if (char_mc._y <= (Stage.height / 2)) {
char_mc._y = char_mc._y + moveSpeed;
bgMovesY = 0;
} else {
bg_mc._y = bg_mc._y - moveSpeed;
bgMovesY = -1;
}
char_mc_dummy.char_mc.play();
} else {
bgMovesY = 0;
}
if ((Key.isDown(37) || (Key.isDown(65))) && (char_mc._x > 0)) {
if (bg_mc._x >= -20) {
if ((char_mc._x > 0) && (char_mc._x < (Stage.width / 2))) {
char_mc._x = char_mc._x - moveSpeed;
bgMovesX = 0;
} else {
char_mc._x = char_mc._x - moveSpeed;
bgMovesX = 0;
}
} else if (char_mc._x >= (Stage.width / 2)) {
char_mc._x = char_mc._x - moveSpeed;
bgMovesX = 0;
} else {
bg_mc._x = bg_mc._x + moveSpeed;
bgMovesX = 1;
}
char_mc_dummy.char_mc.play();
} else if ((Key.isDown(39) || (Key.isDown(68))) && (char_mc._x < 640)) {
if (bg_mc._x <= ((Stage.width - 1020) + 20)) {
if ((char_mc._x > (Stage.width / 2)) && (char_mc._x < Stage.width)) {
char_mc._x = char_mc._x + moveSpeed;
bgMovesX = 0;
} else {
char_mc._x = char_mc._x + moveSpeed;
bgMovesX = 0;
}
} else if (char_mc._x <= (Stage.width / 2)) {
char_mc._x = char_mc._x + moveSpeed;
bgMovesX = 0;
} else {
bg_mc._x = bg_mc._x - moveSpeed;
bgMovesX = -1;
}
char_mc_dummy.char_mc.play();
} else {
bgMovesX = 0;
}
if ((Key.isDown(32) || (Key.isDown(17))) && (bombLimit > 0)) {
charBombNow();
}
char_mc_dummy._x = char_mc._x;
char_mc_dummy._y = char_mc._y + 30;
map_mc.map_mychar._x = char_mc._x / 8;
map_mc.map_mychar._y = char_mc._y / 8;
mouseRotate(char_mc_dummy, degrees);
if (char_mc_dummy._alpha == 50) {
hitDelay = hitDelay - 1;
}
if (hitDelay <= 0) {
char_mc_dummy._alpha = 100;
hitDelay = 5;
}
if (fireDelay > 0) {
fireDelay = fireDelay - 1;
}
if (fireHold > 0) {
charShootNow();
}
if (bombDelay > 0) {
bombDelay = bombDelay - 1;
}
multiplier_mc.multiplier_txt.text = "x" + multiplier;
if (stats_mc.combo_mc._xscale > 0) {
stats_mc.combo_mc._xscale = stats_mc.combo_mc._xscale - 1;
}
}
function enemyMove() {
i = 0;
while (i < enemyNumber) {
this["enemy_mc" + i]._visible = false;
radiansEnemy = Math.atan2(char_mc._y - this["enemy_mc" + i]._y, char_mc._x - this["enemy_mc" + i]._x);
degreesEnemy = (radiansEnemy / Math.PI) * 180;
this["enemy_mc" + i]._rotation = degreesEnemy;
mouseRotate(this["enemy_mc_dummy" + i], degreesEnemy);
if (this["enemy_mc_dummy" + i]._alpha == 50) {
this["enemy_mc" + i].enemyDelay = this["enemy_mc" + i].enemyDelay - 1;
}
if (this["enemy_mc" + i].enemyDelay <= 0) {
this["enemy_mc_dummy" + i]._alpha = 100;
this["enemy_mc" + i].enemyDelay = this["enemy_mc" + i].enemyDelay - 1;
}
collideEnemy(i);
if (this["enemy_mc" + i].enemyMove > 0) {
if ((Math.sqrt(Math.pow(char_mc._y - this["enemy_mc" + i]._y, 2) + Math.pow(char_mc._x - this["enemy_mc" + i]._x, 2)) > 100) && (collideEnemy(i) == false)) {
if ((char_mc._x < this["enemy_mc" + i]._x) && (Math.abs(char_mc._x - this["enemy_mc" + i]._x) > 1)) {
this["enemy_mc" + i]._x = this["enemy_mc" + i]._x - enemyMoveSpeed;
} else if ((char_mc._x > this["enemy_mc" + i]._x) && (Math.abs(char_mc._x - this["enemy_mc" + i]._x) > 1)) {
this["enemy_mc" + i]._x = this["enemy_mc" + i]._x + enemyMoveSpeed;
}
if ((char_mc._y < this["enemy_mc" + i]._y) && (Math.abs(char_mc._y - this["enemy_mc" + i]._y) > 1)) {
this["enemy_mc" + i]._y = this["enemy_mc" + i]._y - enemyMoveSpeed;
} else if ((char_mc._y > this["enemy_mc" + i]._y) && (Math.abs(char_mc._y - this["enemy_mc" + i]._y) > 1)) {
this["enemy_mc" + i]._y = this["enemy_mc" + i]._y + enemyMoveSpeed;
}
this["enemy_mc_dummy" + i]._x = this["enemy_mc" + i]._x;
this["enemy_mc_dummy" + i]._y = this["enemy_mc" + i]._y + 30;
map_mc["map_char" + i]._x = this["enemy_mc" + i]._x / 8;
map_mc["map_char" + i]._y = this["enemy_mc" + i]._y / 8;
this["enemy_mc_dummy" + i].char_mc.play();
this["enemy_mc_dummy" + i].swapDepths(this["enemy_mc_dummy" + i]._y);
}
this["enemy_mc" + i].enemyMove = this["enemy_mc" + i].enemyMove - 1;
} else if (this["enemy_mc" + i].enemyShoot > 0) {
this["enemy_mc" + i].enemyShoot = this["enemy_mc" + i].enemyShoot - 1;
if (this["enemy_mc" + i].enemyShoot == 30) {
enemyShootNow(i);
}
} else {
this["enemy_mc" + i].enemyMove = 50;
this["enemy_mc" + i].enemyShoot = 50;
}
mazeWalls(this["enemy_mc" + i]);
panningEffect(this["enemy_mc" + i]);
panningEffect(this["enemy_mc_dummy" + i]);
i++;
}
if (enemyNumber < 12) {
if (enemyBilang < 500) {
enemyBilang = enemyBilang + 1;
} else {
generateEnemy();
enemyBilang = 0;
}
}
}
function bossMove() {
boss_mc._visible = false;
radiansEnemy = Math.atan2(char_mc._y - boss_mc._y, char_mc._x - boss_mc._x);
degreesEnemy = (radiansEnemy / Math.PI) * 180;
boss_mc._rotation = degreesEnemy;
mouseRotate(this["boss_mc_dummy" + stageChoose], degreesEnemy);
if (bounty <= 0) {
if (alert_mc._currentframe < 40) {
alert_mc.play();
} else {
alert_mc.removeMovieClip();
}
if (boss_mc.enemyMove > 0) {
if (Math.sqrt(Math.pow(char_mc._y - boss_mc._y, 2) + Math.pow(char_mc._x - boss_mc._x, 2)) > 100) {
if ((char_mc._x < boss_mc._x) && (Math.abs(char_mc._x - boss_mc._x) > 1)) {
boss_mc._x = boss_mc._x - moveSpeed;
} else if ((char_mc._x > boss_mc._x) && (Math.abs(char_mc._x - boss_mc._x) > 1)) {
boss_mc._x = boss_mc._x + moveSpeed;
}
if ((char_mc._y < boss_mc._y) && (Math.abs(char_mc._y - boss_mc._y) > 1)) {
boss_mc._y = boss_mc._y - moveSpeed;
} else if ((char_mc._y > boss_mc._y) && (Math.abs(char_mc._y - boss_mc._y) > 1)) {
boss_mc._y = boss_mc._y + moveSpeed;
}
this["boss_mc_dummy" + stageChoose]._x = boss_mc._x;
this["boss_mc_dummy" + stageChoose]._y = boss_mc._y + 30;
this["boss_mc_dummy" + stageChoose].char_mc.play();
this["boss_mc_dummy" + stageChoose].swapDepths(this["boss_mc_dummy" + stageChoose]._y);
}
boss_mc.enemyMove = boss_mc.enemyMove - 1;
} else if (boss_mc.enemyShoot > 0) {
boss_mc.enemyShoot = boss_mc.enemyShoot - 1;
if ((((boss_mc.enemyShoot == 10) || (boss_mc.enemyShoot == 20)) || (boss_mc.enemyShoot == 30)) || (boss_mc.enemyShoot == 40)) {
bossShootNow();
}
} else {
boss_mc.enemyMove = 50;
boss_mc.enemyShoot = 50;
}
}
mazeWalls(boss_mc);
panningEffect(boss_mc);
panningEffect(this["boss_mc_dummy" + stageChoose]);
bossLife_mc._x = boss_mc._x;
bossLife_mc._y = boss_mc._y - 35;
bossLife_mc.swapDepths(this["boss_mc_dummy" + stageChoose]._y);
}
function mouseRotate(charMc, charDegrees) {
if ((charDegrees >= -120) && (charDegrees < -75)) {
charMc.gotoAndStop("char_up");
} else if ((charDegrees >= -75) && (charDegrees < -30)) {
charMc.gotoAndStop("char_diag_up");
charMc._xscale = 100;
} else if ((charDegrees >= -30) && (charDegrees < 15)) {
charMc.gotoAndStop("char_side");
charMc._xscale = 100;
} else if ((charDegrees >= 15) && (charDegrees < 60)) {
charMc.gotoAndStop("char_diag_down");
charMc._xscale = 100;
} else if ((charDegrees >= 60) && (charDegrees < 105)) {
charMc.gotoAndStop("char_down");
} else if ((charDegrees >= 105) && (charDegrees < 150)) {
charMc.gotoAndStop("char_diag_down");
charMc._xscale = -100;
} else if (((charDegrees >= 150) && (charDegrees < 180)) || ((charDegrees > -180) && (charDegrees < -165))) {
charMc.gotoAndStop("char_side");
charMc._xscale = -100;
} else if ((charDegrees >= -165) && (charDegrees < 120)) {
charMc.gotoAndStop("char_diag_up");
charMc._xscale = -100;
}
charMc.swapDepths(charMc._y);
}
function objectMove() {
k = 0;
while (k <= 30) {
this["object_mc" + k].swapDepths(this["object_mc" + k]._y);
panningEffect(this["object_mc" + k]);
k++;
}
panningEffect(maze_mc);
m = 0;
while (m <= bloodCount) {
this["death_hit_mc" + m].swapDepths(this["death_hit_mc" + m]._y);
this["hit_mc" + m].swapDepths(this["hit_mc" + m]._y - 100);
panningEffect(this["death_hit_mc" + m]);
panningEffect(this["hit_mc" + m]);
m++;
}
mazeWalls(char_mc);
}
function onMouseDown() {
fireHold = 1;
}
function onMouseUp() {
fireHold = 0;
}
function charShootNow() {
start_ball_x = char_mc._x + (20 * Math.cos((degrees * Math.PI) / 180));
start_ball_y = char_mc._y + (20 * Math.sin((degrees * Math.PI) / 180));
if (fireDelay == 0) {
if (bulletCount < 20) {
if ((stats_mc.item_mc1._alpha == 100) || (stats_mc.item_mc2._alpha == 100)) {
cannonball_fired = attachMovie("bullet_mc", "bullet_mc" + bulletCount, _root.getNextHighestDepth(), {_x:start_ball_x, _y:start_ball_y});
sfx_mc.gotoAndPlay("gun");
} else if (stats_mc.item_mc3._alpha == 100) {
cannonball_fired = attachMovie("bullet_mcX", "bullet_mc" + bulletCount, _root.getNextHighestDepth(), {_x:start_ball_x, _y:start_ball_y});
sfx_mc.gotoAndPlay("shotgun");
} else if (stats_mc.item_mc4._alpha == 100) {
cannonball_fired = attachMovie("bullet_mcXX", "bullet_mc" + bulletCount, _root.getNextHighestDepth(), {_x:start_ball_x, _y:start_ball_y});
sfx_mc.gotoAndPlay("shotgun");
} else {
cannonball_fired = attachMovie("bullet_mc", "bullet_mc" + bulletCount, _root.getNextHighestDepth(), {_x:start_ball_x, _y:start_ball_y});
sfx_mc.gotoAndPlay("gun");
}
cannonball_fired.dirx = Math.cos((degrees * Math.PI) / 180) * fireSpeed;
cannonball_fired.diry = Math.sin((degrees * Math.PI) / 180) * fireSpeed;
cannonball_fired._rotation = degrees;
cannonball_fired.ID = setInterval(bulletMove, duration, this["bullet_mc" + bulletCount]);
cannonball_fired.IDx = setInterval(charbulletHit, duration, this["bullet_mc" + bulletCount]);
bulletCount = bulletCount + 1;
} else {
bulletCount = 0;
}
if (stats_mc.item_mc1._alpha == 100) {
fireDelay = 25;
} else if ((stats_mc.item_mc2._alpha == 100) || (stats_mc.item_mc4._alpha == 100)) {
fireDelay = 12;
} else {
fireDelay = 25;
}
}
}
function bulletMove(bulletMc) {
if (pause_mc._visible == false) {
bulletMc._x = bulletMc._x + bulletMc.dirx;
bulletMc._y = bulletMc._y + bulletMc.diry;
panningEffect(bulletMc);
with (bulletMc) {
if (((maze_mc.walls.hitTest(getBounds(_parent).xMax, _y, true) || (maze_mc.walls.hitTest(getBounds(_parent).xMin, _y, true))) || (maze_mc.walls.hitTest(_x, getBounds(_parent).yMax, true))) || (maze_mc.walls.hitTest(_x, getBounds(_parent).yMin, true))) {
clearInterval(bulletMc.ID);
clearInterval(bulletMc.IDx);
bulletMc.removeMovieClip();
}
}
if ((((bulletMc._x < 0) || (bulletMc._x > 640)) || (bulletMc._y < 0)) || (bulletMc._y > 450)) {
clearInterval(bulletMc.ID);
clearInterval(bulletMc.IDx);
bulletMc.removeMovieClip();
}
}
}
function charbulletHit(bulletMc) {
i = 0;
while (i < enemyNumber) {
if (bulletMc.hitTest(_root["enemy_mc" + i])) {
if ((stats_mc.item_mc1._alpha == 100) || (stats_mc.item_mc2._alpha == 100)) {
clearInterval(bulletMc.ID);
clearInterval(bulletMc.IDx);
bulletMc.removeMovieClip();
}
if (_root["enemy_mc" + i].enemyLife <= 1) {
sfx_mc.gotoAndPlay("yell");
generateBlood(i);
if (stats_mc.combo_mc._xscale > 0) {
multiplier = multiplier + 1;
multiplier_mc.multiplier_txt.text = "x" + multiplier;
} else {
multiplier = 1;
multiplier_mc.multiplier_txt.text = "x" + multiplier;
}
score = score + (1 * multiplier);
stats_mc.score_txt.text = score;
if (bounty > 0) {
bounty = bounty - 1;
stats_mc.bounty_txt.text = bounty;
}
multiplier_mc._x = _root["enemy_mc" + i]._x;
multiplier_mc._y = _root["enemy_mc" + i]._y;
multiplier_mc.gotoAndPlay(2);
stats_mc.combo_mc._xscale = 100;
_root["enemy_mc" + i].enemyLife = stageChoose;
randomEnemy(i);
} else {
_root["enemy_mc" + i].enemyLife = _root["enemy_mc" + i].enemyLife - 1;
_root["enemy_mc_dummy" + i]._alpha = 50;
}
}
i++;
}
if (bulletMc.hitTest(_root.boss_mc) && ((_root["poster_stage" + stageChoose]._currentframe == 1) && (_root.poster_char._currentframe == 1))) {
clearInterval(bulletMc.ID);
clearInterval(bulletMc.IDx);
bulletMc.removeMovieClip();
boss_mc_dummy4.gotoAndStop("die");
generateHit("boss_mc");
if (bossLife_mc.health_mc._xscale > 0) {
bossLife_mc.health_mc._xscale = bossLife_mc.health_mc._xscale - 4;
sfx_mc.gotoAndPlay("hic");
} else {
clearInterval(mainId);
_root.boss_mc.removeMovieClip();
_root.sfx_mc.gotoAndPlay("yell2");
endStage();
}
}
}
function enemybulletHit(bulletMc) {
if (bulletMc.hitTest(char_mc) && ((_root["poster_stage" + stageChoose]._currentframe == 1) && (_root.poster_char._currentframe == 1))) {
clearInterval(bulletMc.ID);
clearInterval(bulletMc.IDx);
bulletMc.removeMovieClip();
char_mc.gotoAndPlay(2);
char_mc_dummy._alpha = 50;
generateHit("char_mc");
if (stats_mc.health_mc._xscale > 0) {
stats_mc.health_mc._xscale = stats_mc.health_mc._xscale - 4;
} else {
clearInterval(mainId);
diedStage();
}
}
}
function charBombNow() {
start_bomb_x = char_mc._x + (20 * Math.cos((degrees * Math.PI) / 180));
start_bomb_y = char_mc._y + (20 * Math.sin((degrees * Math.PI) / 180));
if (bombDelay == 0) {
if (bombCount < 5) {
bombLimit = bombLimit - 1;
stats_mc.bomb_txt.text = bombLimit;
trace("HOY");
bomb_fired = attachMovie("molotov_mc", "molotov_mc" + bombCount, _root.getNextHighestDepth(), {_x:start_bomb_x, _y:start_bomb_y});
bomb_fired.dirx = (Math.cos((degrees * Math.PI) / 180) * fireSpeed) / 2;
bomb_fired.diry = (Math.sin((degrees * Math.PI) / 180) * fireSpeed) / 2;
bomb_fired._rotation = degrees;
bomb_fired.ID = setInterval(bombMove, duration / 1.5, this["molotov_mc" + bombCount]);
bombCount = bombCount + 1;
} else {
bombCount = 0;
}
bombDelay = 20;
}
}
function bombMove(bombMc) {
if (pause_mc._visible == false) {
bombMc.nextFrame();
bombMc._x = bombMc._x + (bombMc.dirx * 1);
bombMc._y = bombMc._y + (bombMc.diry * 1);
if (bombMc._currentframe == 19) {
explodeNow();
clearInterval(bombMc.ID);
bombMc.removeMovieClip();
} else {
with (bombMc) {
if (((maze_mc.walls.hitTest(getBounds(_parent).xMax, _y, true) || (maze_mc.walls.hitTest(getBounds(_parent).xMin, _y, true))) || (maze_mc.walls.hitTest(_x, getBounds(_parent).yMax, true))) || (maze_mc.walls.hitTest(_x, getBounds(_parent).yMin, true))) {
explodeNow();
clearInterval(bombMc.ID);
bombMc.removeMovieClip();
}
}
}
panningEffect(bombMc);
}
}
function explodeNow() {
sfx_mc.gotoAndPlay("bomb");
start_bomb_x = bomb_fired._x + (20 * Math.cos((degrees * Math.PI) / 180));
start_bomb_y = bomb_fired._y + (20 * Math.sin((degrees * Math.PI) / 180));
bomb_explode = attachMovie("explode_mc", "explode_mc" + bombCount, _root.getNextHighestDepth(), {_x:start_bomb_x, _y:start_bomb_y});
bomb_explode.dirx = Math.cos((degrees * Math.PI) / 180) * fireSpeed;
bomb_explode.diry = Math.sin((degrees * Math.PI) / 180) * fireSpeed;
bomb_explode.ID = setInterval(bombHit, duration, this["explode_mc" + bombCount]);
}
function bombHit(explodeMc) {
explodeMc.nextFrame();
panningEffect(explodeMc);
i = 0;
while (i < enemyNumber) {
if ((explodeMc.hitTest(_root["enemy_mc" + i]) && (explodeMc._currentframe > 2)) && (explodeMc._currentframe < 6)) {
sfx_mc.gotoAndPlay("yell");
generateBlood(i);
if (stats_mc.combo_mc._xscale > 0) {
multiplier = multiplier + 1;
multiplier_mc.multiplier_txt.text = "x" + multiplier;
} else {
multiplier = 1;
multiplier_mc.multiplier_txt.text = "x" + multiplier;
}
score = score + (1 * multiplier);
stats_mc.score_txt.text = score;
if (bounty > 0) {
bounty = bounty - 1;
stats_mc.bounty_txt.text = bounty;
}
multiplier_mc._x = _root["enemy_mc" + i]._x;
multiplier_mc._y = _root["enemy_mc" + i]._y;
multiplier_mc.gotoAndPlay(2);
stats_mc.combo_mc._xscale = 100;
randomEnemy(i);
}
i++;
}
if (((explodeMc.hitTest(_root.boss_mc) && (explodeMc._currentframe > 2)) && (explodeMc._currentframe < 5)) && ((_root["poster_stage" + stageChoose]._currentframe == 1) && (_root.poster_char._currentframe == 1))) {
boss_mc_dummy4.gotoAndStop("die");
generateHit("boss_mc");
if (bossLife_mc.health_mc._xscale > 0) {
bossLife_mc.health_mc._xscale = bossLife_mc.health_mc._xscale - 4;
sfx_mc.gotoAndPlay("hic");
} else {
clearInterval(mainId);
_root.boss_mc.removeMovieClip();
_root.sfx_mc.gotoAndPlay("yell2");
endStage();
}
}
if (((explodeMc.hitTest(_root.char_mc) && (explodeMc._currentframe > 2)) && (explodeMc._currentframe < 5)) && ((_root["poster_stage" + stageChoose]._currentframe == 1) && (_root.poster_char._currentframe == 1))) {
char_mc.gotoAndPlay(2);
char_mc_dummy._alpha = 50;
generateHit("char_mc");
if (stats_mc.health_mc._xscale > 0) {
stats_mc.health_mc._xscale = stats_mc.health_mc._xscale - 4;
} else {
clearInterval(mainId);
diedStage();
}
}
if (explodeMc._currentframe >= 15) {
clearInterval(explodeMc.ID);
explodeMc.removeMovieClip();
}
}
function generateBlood(i) {
duplicateMovieClip ("death_hit_mc", "death_hit_mc" + bloodCount, -(bloodCount + 5000));
this["death_hit_mc" + bloodCount]._x = this["enemy_mc" + i]._x;
this["death_hit_mc" + bloodCount]._y = this["enemy_mc" + i]._y;
this["death_hit_mc" + bloodCount].play();
bloodCount = bloodCount + 1;
}
function generateHit(i) {
duplicateMovieClip ("hit_mc", "hit_mc" + bloodCount, this.getNextHighestDepth());
this["hit_mc" + bloodCount]._x = this[i]._x;
this["hit_mc" + bloodCount]._y = this[i]._y;
this["hit_mc" + bloodCount]._xscale = 20;
this["hit_mc" + bloodCount]._yscale = 20;
this["hit_mc" + bloodCount].play();
bloodCount = bloodCount + 1;
}
function generateEnemy() {
var _local2 = 0;
_local2 = random(4);
duplicateMovieClip ("enemy_mc", "enemy_mc" + enemyNumber, this.getNextHighestDepth());
this["enemy_mc" + enemyNumber].enemyMove = 50;
this["enemy_mc" + enemyNumber].enemyShoot = 50;
this["enemy_mc" + enemyNumber].enemyLife = stageChoose;
this["enemy_mc" + enemyNumber].enemyDelay = 10;
duplicateMovieClip ("enemy_mc_dummy", "enemy_mc_dummy" + enemyNumber, this.getNextHighestDepth());
if (_local2 == 0) {
this["enemy_mc" + enemyNumber]._x = -30;
this["enemy_mc" + enemyNumber]._y = char_mc._y;
} else if (_local2 == 1) {
this["enemy_mc" + enemyNumber]._x = 670;
this["enemy_mc" + enemyNumber]._y = char_mc._y;
} else if (_local2 == 2) {
this["enemy_mc" + enemyNumber]._x = char_mc._x;
this["enemy_mc" + enemyNumber]._y = -30;
} else if (_local2 == 3) {
this["enemy_mc" + enemyNumber]._x = char_mc._x;
this["enemy_mc" + enemyNumber]._y = 510;
}
enemyNumber = enemyNumber + 1;
}
function randomEnemy(i) {
var _local3 = 0;
_local3 = random(4);
this["enemy_mc" + i].enemyMove = 50;
this["enemy_mc" + i].enemyShoot = 50;
this["enemy_mc" + i].enemyDelay = 10;
if (_local3 == 0) {
this["enemy_mc" + i]._x = -100;
this["enemy_mc" + i]._y = char_mc._y;
} else if (_local3 == 1) {
this["enemy_mc" + i]._x = 750;
this["enemy_mc" + i]._y = char_mc._y;
} else if (_local3 == 2) {
this["enemy_mc" + i]._x = char_mc._x;
this["enemy_mc" + i]._y = -100;
} else if (_local3 == 3) {
this["enemy_mc" + i]._x = char_mc._x;
this["enemy_mc" + i]._y = 560;
}
}
function collideEnemy(i) {
j = 0;
if (j < enemyNumber) {
if (this["enemy_mc" + i].hitTest(this["enemy_mc" + j]) && (i != j)) {
return(true);
}
return(false);
}
}
function enemyShootNow(i) {
start_ball_xEnemy = this["enemy_mc" + i]._x + (20 * Math.cos((degreesEnemy * Math.PI) / 180));
start_ball_yEnemy = this["enemy_mc" + i]._y + (20 * Math.sin((degreesEnemy * Math.PI) / 180));
if (bulletCountEnemy < 30) {
sfx_mc.gotoAndPlay("gun");
cannonball_firedEnemy = attachMovie("bullet_mc", "bullet_mc_enemy" + bulletCountEnemy, _root.getNextHighestDepth(), {_x:start_ball_xEnemy, _y:start_ball_yEnemy});
cannonball_firedEnemy.dirx = Math.cos((degreesEnemy * Math.PI) / 180) * fireSpeed;
cannonball_firedEnemy.diry = Math.sin((degreesEnemy * Math.PI) / 180) * fireSpeed;
cannonball_firedEnemy._rotation = degreesEnemy;
cannonball_firedEnemy.ID = setInterval(bulletMove, duration, this["bullet_mc_enemy" + bulletCountEnemy]);
cannonball_firedEnemy.IDx = setInterval(enemybulletHit, duration, this["bullet_mc_enemy" + bulletCountEnemy]);
bulletCountEnemy = bulletCountEnemy + 1;
} else {
bulletCountEnemy = 0;
}
}
function bossShootNow() {
start_ball_xEnemy = boss_mc._x + (20 * Math.cos((degreesEnemy * Math.PI) / 180));
start_ball_yEnemy = boss_mc._y + (20 * Math.sin((degreesEnemy * Math.PI) / 180));
if (bulletCountBoss < 20) {
sfx_mc.gotoAndPlay("shotgun");
cannonball_firedEnemy = attachMovie("bullet_mcXX", "bullet_mc_boss" + bulletCountBoss, _root.getNextHighestDepth(), {_x:start_ball_xEnemy, _y:start_ball_yEnemy});
cannonball_firedEnemy.dirx = Math.cos((degreesEnemy * Math.PI) / 180) * fireSpeed;
cannonball_firedEnemy.diry = Math.sin((degreesEnemy * Math.PI) / 180) * fireSpeed;
cannonball_firedEnemy._rotation = degreesEnemy;
cannonball_firedEnemy.ID = setInterval(bulletMove, duration, this["bullet_mc_boss" + bulletCountBoss]);
cannonball_firedEnemy.IDx = setInterval(enemybulletHit, duration, this["bullet_mc_boss" + bulletCountBoss]);
bulletCountBoss = bulletCountBoss + 1;
} else {
bulletCountBoss = 0;
}
}
function mazeWalls(nameMc) {
with (nameMc) {
if (maze_mc.walls.hitTest(getBounds(_parent).xMax, _y, true)) {
nameMc._x = nameMc._x - (moveSpeed * 1);
}
if (maze_mc.walls.hitTest(getBounds(_parent).xMin, _y, true)) {
_x = _x + (moveSpeed * 1);
}
if (maze_mc.walls.hitTest(_x, getBounds(_parent).yMax, true)) {
_y = _y - (moveSpeed * 1);
}
if (maze_mc.walls.hitTest(_x, getBounds(_parent).yMin, true)) {
_y = _y + (moveSpeed * 1);
}
}
}
function panningEffect(nameMc) {
if (bgMovesX == -1) {
nameMc._x = nameMc._x - moveSpeed;
}
if (bgMovesX == 1) {
nameMc._x = nameMc._x + moveSpeed;
}
if (bgMovesY == -1) {
nameMc._y = nameMc._y - moveSpeed;
}
if (bgMovesY == 1) {
nameMc._y = nameMc._y + moveSpeed;
}
}
function endStage() {
this["poster_stage" + stageChoose].gotoAndPlay(2);
this["poster_stage" + stageChoose].swapDepths(1500);
score = score + (1000 * stageChoose);
stats_mc.score_txt.text = score;
target_mc.removeMovieClip();
Mouse.show();
pause_btn._visible = false;
pause_mc._visible = false;
Key.removeListener(keyListener);
}
function diedStage() {
poster_char.gotoAndPlay(2);
poster_char.swapDepths(1000);
char_mc_dummy.gotoAndStop("die");
target_mc.removeMovieClip();
Mouse.show();
pause_btn._visible = false;
pause_mc._visible = false;
Key.removeListener(keyListener);
}
function goBack() {
removeObjects();
stopAllSounds();
gotoAndStop ("weapon4");
}
function goTown() {
removeObjects();
stopAllSounds();
gotoAndStop ("townSelect");
}
function goQuit() {
removeObjects();
stopAllSounds();
gotoAndStop ("title");
}
function removeObjects() {
i2 = 0;
while (i2 < enemyNumber) {
removeMovieClip(this["enemy_mc_dummy" + i2]);
i2++;
}
k2 = 0;
while (k2 <= 30) {
removeMovieClip(this["object_mc" + k2]);
k2++;
}
m2 = 0;
while (m2 <= bloodCount) {
removeMovieClip(this["death_hit_mc" + m2]);
removeMovieClip(this["hit_mc" + m2]);
m2++;
}
removeMovieClip(stats_mc);
removeMovieClip(this["boss_mc_dummy" + stageChoose]);
removeMovieClip(this["boss_mc_dummy" + (stageChoose - 1)]);
removeMovieClip(bossLife_mc);
removeMovieClip(char_mc_dummy);
removeMovieClip(this["poster_stage" + stageChoose]);
removeMovieClip(this["poster_stage" + (stageChoose - 1)]);
removeMovieClip(poster_char);
removeMovieClip(pause_mc);
removeMovieClip(pause_btn);
removeMovieClip(map_mc);
}
function initItems() {
i = 1;
while (i <= 4) {
stats_mc["item_mc" + i]._alpha = 10;
stats_mc["item_box" + i]._visible = false;
i++;
}
}
function initItems2() {
i = 1;
while (i <= 3) {
stats_mc["item_mc" + i]._alpha = 80;
i++;
}
}
stop();
Mouse.hide();
sound_mc.gotoAndPlay(2);
var mainId = 0;
var duration = 32;
var bulletId;
var radians = 0;
var degrees = 0;
var radiansEnemy = 0;
var degreesEnemy = 0;
var enemyNumber = 0;
var enemyBilang = 0;
var moveSpeed = 4;
var fireSpeed = 15;
var fireDelay = 20;
var fireHold = 0;
var hitDelay = 5;
var bombDelay = 20;
var bombLimit = 5;
var bgMovesX = 0;
var bgMovesY = 0;
var bulletCount = 0;
var bombCount = 0;
var explodeCount = 0;
var bulletCountEnemy = 0;
var bulletCountBoss = 0;
var bloodCount = 0;
var multiplier = 0;
stats_mc.combo_mc._xscale = 0;
char_mc._visible = false;
generateEnemy();
stats_mc.bounty_txt.text = bounty;
stats_mc.score_txt.text = score;
stats_mc.bomb_txt.text = bombLimit;
stats_mc.swapDepths(800);
target_mc.swapDepths(900);
alert_mc.swapDepths(820);
mainId = setInterval(mainMc, 20);
initItems();
initItems2();
stats_mc.item_mc1._alpha = 100;
stats_mc.item_box1._visible = true;
var keyListener = new Object();
keyListener.onKeyDown = function () {
if (chr(Key.getAscii()) == "1") {
initItems();
initItems2();
stats_mc.item_mc1._alpha = 100;
stats_mc.item_box1._visible = true;
sfx_mc.gotoAndPlay("select");
} else if (chr(Key.getAscii()) == "2") {
initItems();
initItems2();
stats_mc.item_mc2._alpha = 100;
stats_mc.item_box2._visible = true;
sfx_mc.gotoAndPlay("select");
} else if (chr(Key.getAscii()) == "3") {
initItems();
initItems2();
stats_mc.item_mc3._alpha = 100;
stats_mc.item_box3._visible = true;
sfx_mc.gotoAndPlay("select");
}
};
Key.addListener(keyListener);
pause_mc._visible = false;
pause_btn._visible = true;
pause_mc.swapDepths(850);
pause_btn.swapDepths(870);
pause_btn.pause_btn.onRelease = function () {
this._parent._visible = false;
pause_mc._visible = true;
};
pause_mc.continue_btn.onRelease = function () {
this._parent._visible = false;
pause_btn._visible = true;
};
Frame 80
function mainMc() {
if (pause_mc._visible == false) {
characterMove();
enemyMove();
bossMove();
objectMove();
bilang = bilang + 1;
}
target_mc._x = _xmouse;
target_mc._y = _ymouse;
}
function characterMove() {
radians = Math.atan2(_ymouse - char_mc._y, _xmouse - char_mc._x);
degrees = (radians / Math.PI) * 180;
char_mc._rotation = degrees;
if ((Key.isDown(38) || (Key.isDown(87))) && (char_mc._y > 0)) {
if (bg_mc._y >= -20) {
if ((char_mc._y > 0) && (char_mc._y < (Stage.height / 2))) {
char_mc._y = char_mc._y - moveSpeed;
bgMovesY = 0;
} else {
char_mc._y = char_mc._y - moveSpeed;
bgMovesY = 0;
}
} else if (char_mc._y >= (Stage.height / 2)) {
char_mc._y = char_mc._y - moveSpeed;
bgMovesY = 0;
} else {
bg_mc._y = bg_mc._y + moveSpeed;
bgMovesY = 1;
}
char_mc_dummy.char_mc.play();
} else if ((Key.isDown(40) || (Key.isDown(83))) && (char_mc._y < 340)) {
if (bg_mc._y <= ((Stage.height - 750) + 20)) {
if ((char_mc._y > (Stage.height / 2)) && (char_mc._y < Stage.height)) {
char_mc._y = char_mc._y + moveSpeed;
bgMovesY = 0;
} else {
char_mc._y = char_mc._y + moveSpeed;
bgMovesY = 0;
}
} else if (char_mc._y <= (Stage.height / 2)) {
char_mc._y = char_mc._y + moveSpeed;
bgMovesY = 0;
} else {
bg_mc._y = bg_mc._y - moveSpeed;
bgMovesY = -1;
}
char_mc_dummy.char_mc.play();
} else {
bgMovesY = 0;
}
if ((Key.isDown(37) || (Key.isDown(65))) && (char_mc._x > 0)) {
if (bg_mc._x >= -20) {
if ((char_mc._x > 0) && (char_mc._x < (Stage.width / 2))) {
char_mc._x = char_mc._x - moveSpeed;
bgMovesX = 0;
} else {
char_mc._x = char_mc._x - moveSpeed;
bgMovesX = 0;
}
} else if (char_mc._x >= (Stage.width / 2)) {
char_mc._x = char_mc._x - moveSpeed;
bgMovesX = 0;
} else {
bg_mc._x = bg_mc._x + moveSpeed;
bgMovesX = 1;
}
char_mc_dummy.char_mc.play();
} else if ((Key.isDown(39) || (Key.isDown(68))) && (char_mc._x < 640)) {
if (bg_mc._x <= ((Stage.width - 1020) + 20)) {
if ((char_mc._x > (Stage.width / 2)) && (char_mc._x < Stage.width)) {
char_mc._x = char_mc._x + moveSpeed;
bgMovesX = 0;
} else {
char_mc._x = char_mc._x + moveSpeed;
bgMovesX = 0;
}
} else if (char_mc._x <= (Stage.width / 2)) {
char_mc._x = char_mc._x + moveSpeed;
bgMovesX = 0;
} else {
bg_mc._x = bg_mc._x - moveSpeed;
bgMovesX = -1;
}
char_mc_dummy.char_mc.play();
} else {
bgMovesX = 0;
}
if ((Key.isDown(32) || (Key.isDown(17))) && (bombLimit > 0)) {
charBombNow();
}
char_mc_dummy._x = char_mc._x;
char_mc_dummy._y = char_mc._y + 30;
map_mc.map_mychar._x = char_mc._x / 8;
map_mc.map_mychar._y = char_mc._y / 8;
mouseRotate(char_mc_dummy, degrees);
if (char_mc_dummy._alpha == 50) {
hitDelay = hitDelay - 1;
}
if (hitDelay <= 0) {
char_mc_dummy._alpha = 100;
hitDelay = 5;
}
if (fireDelay > 0) {
fireDelay = fireDelay - 1;
}
if (fireHold > 0) {
charShootNow();
}
if (bombDelay > 0) {
bombDelay = bombDelay - 1;
}
multiplier_mc.multiplier_txt.text = "x" + multiplier;
if (stats_mc.combo_mc._xscale > 0) {
stats_mc.combo_mc._xscale = stats_mc.combo_mc._xscale - 1;
}
}
function enemyMove() {
i = 0;
while (i < enemyNumber) {
this["enemy_mc" + i]._visible = false;
radiansEnemy = Math.atan2(char_mc._y - this["enemy_mc" + i]._y, char_mc._x - this["enemy_mc" + i]._x);
degreesEnemy = (radiansEnemy / Math.PI) * 180;
this["enemy_mc" + i]._rotation = degreesEnemy;
mouseRotate(this["enemy_mc_dummy" + i], degreesEnemy);
if (this["enemy_mc_dummy" + i]._alpha == 50) {
this["enemy_mc" + i].enemyDelay = this["enemy_mc" + i].enemyDelay - 1;
}
if (this["enemy_mc" + i].enemyDelay <= 0) {
this["enemy_mc_dummy" + i]._alpha = 100;
this["enemy_mc" + i].enemyDelay = this["enemy_mc" + i].enemyDelay - 1;
}
collideEnemy(i);
if (this["enemy_mc" + i].enemyMove > 0) {
if ((Math.sqrt(Math.pow(char_mc._y - this["enemy_mc" + i]._y, 2) + Math.pow(char_mc._x - this["enemy_mc" + i]._x, 2)) > 100) && (collideEnemy(i) == false)) {
if ((char_mc._x < this["enemy_mc" + i]._x) && (Math.abs(char_mc._x - this["enemy_mc" + i]._x) > 1)) {
this["enemy_mc" + i]._x = this["enemy_mc" + i]._x - enemyMoveSpeed;
} else if ((char_mc._x > this["enemy_mc" + i]._x) && (Math.abs(char_mc._x - this["enemy_mc" + i]._x) > 1)) {
this["enemy_mc" + i]._x = this["enemy_mc" + i]._x + enemyMoveSpeed;
}
if ((char_mc._y < this["enemy_mc" + i]._y) && (Math.abs(char_mc._y - this["enemy_mc" + i]._y) > 1)) {
this["enemy_mc" + i]._y = this["enemy_mc" + i]._y - enemyMoveSpeed;
} else if ((char_mc._y > this["enemy_mc" + i]._y) && (Math.abs(char_mc._y - this["enemy_mc" + i]._y) > 1)) {
this["enemy_mc" + i]._y = this["enemy_mc" + i]._y + enemyMoveSpeed;
}
this["enemy_mc_dummy" + i]._x = this["enemy_mc" + i]._x;
this["enemy_mc_dummy" + i]._y = this["enemy_mc" + i]._y + 30;
map_mc["map_char" + i]._x = this["enemy_mc" + i]._x / 8;
map_mc["map_char" + i]._y = this["enemy_mc" + i]._y / 8;
this["enemy_mc_dummy" + i].char_mc.play();
this["enemy_mc_dummy" + i].swapDepths(this["enemy_mc_dummy" + i]._y);
}
this["enemy_mc" + i].enemyMove = this["enemy_mc" + i].enemyMove - 1;
} else if (this["enemy_mc" + i].enemyShoot > 0) {
this["enemy_mc" + i].enemyShoot = this["enemy_mc" + i].enemyShoot - 1;
if (this["enemy_mc" + i].enemyShoot == 30) {
enemyShootNow(i);
}
} else {
this["enemy_mc" + i].enemyMove = 50;
this["enemy_mc" + i].enemyShoot = 50;
}
mazeWalls(this["enemy_mc" + i]);
panningEffect(this["enemy_mc" + i]);
panningEffect(this["enemy_mc_dummy" + i]);
i++;
}
if (enemyNumber < 12) {
if (enemyBilang < 500) {
enemyBilang = enemyBilang + 1;
} else {
generateEnemy();
enemyBilang = 0;
}
}
}
function bossMove() {
boss_mc._visible = false;
radiansEnemy = Math.atan2(char_mc._y - boss_mc._y, char_mc._x - boss_mc._x);
degreesEnemy = (radiansEnemy / Math.PI) * 180;
boss_mc._rotation = degreesEnemy;
mouseRotate(this["boss_mc_dummy" + stageChoose], degreesEnemy);
if (bounty <= 0) {
if (alert_mc._currentframe < 40) {
alert_mc.play();
} else {
alert_mc.removeMovieClip();
}
if (boss_mc.enemyMove > 0) {
if (Math.sqrt(Math.pow(char_mc._y - boss_mc._y, 2) + Math.pow(char_mc._x - boss_mc._x, 2)) > 100) {
if ((char_mc._x < boss_mc._x) && (Math.abs(char_mc._x - boss_mc._x) > 1)) {
boss_mc._x = boss_mc._x - moveSpeed;
} else if ((char_mc._x > boss_mc._x) && (Math.abs(char_mc._x - boss_mc._x) > 1)) {
boss_mc._x = boss_mc._x + moveSpeed;
}
if ((char_mc._y < boss_mc._y) && (Math.abs(char_mc._y - boss_mc._y) > 1)) {
boss_mc._y = boss_mc._y - moveSpeed;
} else if ((char_mc._y > boss_mc._y) && (Math.abs(char_mc._y - boss_mc._y) > 1)) {
boss_mc._y = boss_mc._y + moveSpeed;
}
this["boss_mc_dummy" + stageChoose]._x = boss_mc._x;
this["boss_mc_dummy" + stageChoose]._y = boss_mc._y + 30;
this["boss_mc_dummy" + stageChoose].char_mc.play();
this["boss_mc_dummy" + stageChoose].swapDepths(this["boss_mc_dummy" + stageChoose]._y);
}
boss_mc.enemyMove = boss_mc.enemyMove - 1;
} else if (boss_mc.enemyShoot > 0) {
boss_mc.enemyShoot = boss_mc.enemyShoot - 1;
if ((((boss_mc.enemyShoot == 10) || (boss_mc.enemyShoot == 20)) || (boss_mc.enemyShoot == 30)) || (boss_mc.enemyShoot == 40)) {
bossShootNow();
}
} else {
boss_mc.enemyMove = 50;
boss_mc.enemyShoot = 50;
}
}
mazeWalls(boss_mc);
panningEffect(boss_mc);
panningEffect(this["boss_mc_dummy" + stageChoose]);
bossLife_mc._x = boss_mc._x;
bossLife_mc._y = boss_mc._y - 35;
bossLife_mc.swapDepths(this["boss_mc_dummy" + stageChoose]._y);
}
function mouseRotate(charMc, charDegrees) {
if ((charDegrees >= -120) && (charDegrees < -75)) {
charMc.gotoAndStop("char_up");
} else if ((charDegrees >= -75) && (charDegrees < -30)) {
charMc.gotoAndStop("char_diag_up");
charMc._xscale = 100;
} else if ((charDegrees >= -30) && (charDegrees < 15)) {
charMc.gotoAndStop("char_side");
charMc._xscale = 100;
} else if ((charDegrees >= 15) && (charDegrees < 60)) {
charMc.gotoAndStop("char_diag_down");
charMc._xscale = 100;
} else if ((charDegrees >= 60) && (charDegrees < 105)) {
charMc.gotoAndStop("char_down");
} else if ((charDegrees >= 105) && (charDegrees < 150)) {
charMc.gotoAndStop("char_diag_down");
charMc._xscale = -100;
} else if (((charDegrees >= 150) && (charDegrees < 180)) || ((charDegrees > -180) && (charDegrees < -165))) {
charMc.gotoAndStop("char_side");
charMc._xscale = -100;
} else if ((charDegrees >= -165) && (charDegrees < 120)) {
charMc.gotoAndStop("char_diag_up");
charMc._xscale = -100;
}
charMc.swapDepths(charMc._y);
}
function objectMove() {
k = 0;
while (k <= 30) {
this["object_mc" + k].swapDepths(this["object_mc" + k]._y);
panningEffect(this["object_mc" + k]);
k++;
}
panningEffect(maze_mc);
m = 0;
while (m <= bloodCount) {
this["death_hit_mc" + m].swapDepths(this["death_hit_mc" + m]._y);
this["hit_mc" + m].swapDepths(this["hit_mc" + m]._y - 100);
panningEffect(this["death_hit_mc" + m]);
panningEffect(this["hit_mc" + m]);
m++;
}
mazeWalls(char_mc);
}
function onMouseDown() {
fireHold = 1;
}
function onMouseUp() {
fireHold = 0;
}
function charShootNow() {
start_ball_x = char_mc._x + (20 * Math.cos((degrees * Math.PI) / 180));
start_ball_y = char_mc._y + (20 * Math.sin((degrees * Math.PI) / 180));
if (fireDelay == 0) {
if (bulletCount < 20) {
if ((stats_mc.item_mc1._alpha == 100) || (stats_mc.item_mc2._alpha == 100)) {
cannonball_fired = attachMovie("bullet_mc", "bullet_mc" + bulletCount, _root.getNextHighestDepth(), {_x:start_ball_x, _y:start_ball_y});
sfx_mc.gotoAndPlay("gun");
} else if (stats_mc.item_mc3._alpha == 100) {
cannonball_fired = attachMovie("bullet_mcX", "bullet_mc" + bulletCount, _root.getNextHighestDepth(), {_x:start_ball_x, _y:start_ball_y});
sfx_mc.gotoAndPlay("shotgun");
} else if (stats_mc.item_mc4._alpha == 100) {
cannonball_fired = attachMovie("bullet_mcXX", "bullet_mc" + bulletCount, _root.getNextHighestDepth(), {_x:start_ball_x, _y:start_ball_y});
sfx_mc.gotoAndPlay("shotgun");
} else {
cannonball_fired = attachMovie("bullet_mc", "bullet_mc" + bulletCount, _root.getNextHighestDepth(), {_x:start_ball_x, _y:start_ball_y});
sfx_mc.gotoAndPlay("gun");
}
cannonball_fired.dirx = Math.cos((degrees * Math.PI) / 180) * fireSpeed;
cannonball_fired.diry = Math.sin((degrees * Math.PI) / 180) * fireSpeed;
cannonball_fired._rotation = degrees;
cannonball_fired.ID = setInterval(bulletMove, duration, this["bullet_mc" + bulletCount]);
cannonball_fired.IDx = setInterval(charbulletHit, duration, this["bullet_mc" + bulletCount]);
bulletCount = bulletCount + 1;
} else {
bulletCount = 0;
}
if (stats_mc.item_mc1._alpha == 100) {
fireDelay = 25;
} else if ((stats_mc.item_mc2._alpha == 100) || (stats_mc.item_mc4._alpha == 100)) {
fireDelay = 12;
} else {
fireDelay = 25;
}
}
}
function bulletMove(bulletMc) {
if (pause_mc._visible == false) {
bulletMc._x = bulletMc._x + bulletMc.dirx;
bulletMc._y = bulletMc._y + bulletMc.diry;
panningEffect(bulletMc);
with (bulletMc) {
if (((maze_mc.walls.hitTest(getBounds(_parent).xMax, _y, true) || (maze_mc.walls.hitTest(getBounds(_parent).xMin, _y, true))) || (maze_mc.walls.hitTest(_x, getBounds(_parent).yMax, true))) || (maze_mc.walls.hitTest(_x, getBounds(_parent).yMin, true))) {
clearInterval(bulletMc.ID);
clearInterval(bulletMc.IDx);
bulletMc.removeMovieClip();
}
}
if ((((bulletMc._x < 0) || (bulletMc._x > 640)) || (bulletMc._y < 0)) || (bulletMc._y > 450)) {
clearInterval(bulletMc.ID);
clearInterval(bulletMc.IDx);
bulletMc.removeMovieClip();
}
}
}
function charbulletHit(bulletMc) {
i = 0;
while (i < enemyNumber) {
if (bulletMc.hitTest(_root["enemy_mc" + i])) {
if ((stats_mc.item_mc1._alpha == 100) || (stats_mc.item_mc2._alpha == 100)) {
clearInterval(bulletMc.ID);
clearInterval(bulletMc.IDx);
bulletMc.removeMovieClip();
}
if (_root["enemy_mc" + i].enemyLife <= 1) {
sfx_mc.gotoAndPlay("yell");
generateBlood(i);
if (stats_mc.combo_mc._xscale > 0) {
multiplier = multiplier + 1;
multiplier_mc.multiplier_txt.text = "x" + multiplier;
} else {
multiplier = 1;
multiplier_mc.multiplier_txt.text = "x" + multiplier;
}
score = score + (1 * multiplier);
stats_mc.score_txt.text = score;
if (bounty > 0) {
bounty = bounty - 1;
stats_mc.bounty_txt.text = bounty;
}
multiplier_mc._x = _root["enemy_mc" + i]._x;
multiplier_mc._y = _root["enemy_mc" + i]._y;
multiplier_mc.gotoAndPlay(2);
stats_mc.combo_mc._xscale = 100;
_root["enemy_mc" + i].enemyLife = stageChoose;
randomEnemy(i);
} else {
_root["enemy_mc" + i].enemyLife = _root["enemy_mc" + i].enemyLife - 1;
_root["enemy_mc_dummy" + i]._alpha = 50;
}
}
i++;
}
if (bulletMc.hitTest(_root.boss_mc) && ((_root["poster_stage" + stageChoose]._currentframe == 1) && (_root.poster_char._currentframe == 1))) {
clearInterval(bulletMc.ID);
clearInterval(bulletMc.IDx);
bulletMc.removeMovieClip();
boss_mc_dummy5.gotoAndStop("die");
generateHit("boss_mc");
if (bossLife_mc.health_mc._xscale > 0) {
bossLife_mc.health_mc._xscale = bossLife_mc.health_mc._xscale - 4;
sfx_mc.gotoAndPlay("hic");
} else {
clearInterval(mainId);
_root.boss_mc.removeMovieClip();
_root.sfx_mc.gotoAndPlay("yell2");
endStage();
}
}
}
function enemybulletHit(bulletMc) {
if (bulletMc.hitTest(char_mc) && ((_root["poster_stage" + stageChoose]._currentframe == 1) && (_root.poster_char._currentframe == 1))) {
clearInterval(bulletMc.ID);
clearInterval(bulletMc.IDx);
bulletMc.removeMovieClip();
char_mc.gotoAndPlay(2);
char_mc_dummy._alpha = 50;
generateHit("char_mc");
if (stats_mc.health_mc._xscale > 0) {
stats_mc.health_mc._xscale = stats_mc.health_mc._xscale - 4;
} else {
clearInterval(mainId);
diedStage();
}
}
}
function charBombNow() {
start_bomb_x = char_mc._x + (20 * Math.cos((degrees * Math.PI) / 180));
start_bomb_y = char_mc._y + (20 * Math.sin((degrees * Math.PI) / 180));
if (bombDelay == 0) {
if (bombCount < 5) {
bombLimit = bombLimit - 1;
stats_mc.bomb_txt.text = bombLimit;
trace("HOY");
bomb_fired = attachMovie("molotov_mc", "molotov_mc" + bombCount, _root.getNextHighestDepth(), {_x:start_bomb_x, _y:start_bomb_y});
bomb_fired.dirx = (Math.cos((degrees * Math.PI) / 180) * fireSpeed) / 2;
bomb_fired.diry = (Math.sin((degrees * Math.PI) / 180) * fireSpeed) / 2;
bomb_fired._rotation = degrees;
bomb_fired.ID = setInterval(bombMove, duration / 1.5, this["molotov_mc" + bombCount]);
bombCount = bombCount + 1;
} else {
bombCount = 0;
}
bombDelay = 20;
}
}
function bombMove(bombMc) {
if (pause_mc._visible == false) {
bombMc.nextFrame();
bombMc._x = bombMc._x + (bombMc.dirx * 1);
bombMc._y = bombMc._y + (bombMc.diry * 1);
if (bombMc._currentframe == 19) {
explodeNow();
clearInterval(bombMc.ID);
bombMc.removeMovieClip();
} else {
with (bombMc) {
if (((maze_mc.walls.hitTest(getBounds(_parent).xMax, _y, true) || (maze_mc.walls.hitTest(getBounds(_parent).xMin, _y, true))) || (maze_mc.walls.hitTest(_x, getBounds(_parent).yMax, true))) || (maze_mc.walls.hitTest(_x, getBounds(_parent).yMin, true))) {
explodeNow();
clearInterval(bombMc.ID);
bombMc.removeMovieClip();
}
}
}
panningEffect(bombMc);
}
}
function explodeNow() {
sfx_mc.gotoAndPlay("bomb");
start_bomb_x = bomb_fired._x + (20 * Math.cos((degrees * Math.PI) / 180));
start_bomb_y = bomb_fired._y + (20 * Math.sin((degrees * Math.PI) / 180));
bomb_explode = attachMovie("explode_mc", "explode_mc" + bombCount, _root.getNextHighestDepth(), {_x:start_bomb_x, _y:start_bomb_y});
bomb_explode.dirx = Math.cos((degrees * Math.PI) / 180) * fireSpeed;
bomb_explode.diry = Math.sin((degrees * Math.PI) / 180) * fireSpeed;
bomb_explode.ID = setInterval(bombHit, duration, this["explode_mc" + bombCount]);
}
function bombHit(explodeMc) {
explodeMc.nextFrame();
panningEffect(explodeMc);
i = 0;
while (i < enemyNumber) {
if ((explodeMc.hitTest(_root["enemy_mc" + i]) && (explodeMc._currentframe > 2)) && (explodeMc._currentframe < 6)) {
sfx_mc.gotoAndPlay("yell");
generateBlood(i);
if (stats_mc.combo_mc._xscale > 0) {
multiplier = multiplier + 1;
multiplier_mc.multiplier_txt.text = "x" + multiplier;
} else {
multiplier = 1;
multiplier_mc.multiplier_txt.text = "x" + multiplier;
}
score = score + (1 * multiplier);
stats_mc.score_txt.text = score;
if (bounty > 0) {
bounty = bounty - 1;
stats_mc.bounty_txt.text = bounty;
}
multiplier_mc._x = _root["enemy_mc" + i]._x;
multiplier_mc._y = _root["enemy_mc" + i]._y;
multiplier_mc.gotoAndPlay(2);
stats_mc.combo_mc._xscale = 100;
randomEnemy(i);
}
i++;
}
if (((explodeMc.hitTest(_root.boss_mc) && (explodeMc._currentframe > 2)) && (explodeMc._currentframe < 5)) && ((_root["poster_stage" + stageChoose]._currentframe == 1) && (_root.poster_char._currentframe == 1))) {
boss_mc_dummy5.gotoAndStop("die");
generateHit("boss_mc");
if (bossLife_mc.health_mc._xscale > 0) {
bossLife_mc.health_mc._xscale = bossLife_mc.health_mc._xscale - 4;
sfx_mc.gotoAndPlay("hic");
} else {
clearInterval(mainId);
_root.boss_mc.removeMovieClip();
_root.sfx_mc.gotoAndPlay("yell2");
endStage();
}
}
if (((explodeMc.hitTest(_root.char_mc) && (explodeMc._currentframe > 2)) && (explodeMc._currentframe < 5)) && ((_root["poster_stage" + stageChoose]._currentframe == 1) && (_root.poster_char._currentframe == 1))) {
char_mc.gotoAndPlay(2);
char_mc_dummy._alpha = 50;
generateHit("char_mc");
if (stats_mc.health_mc._xscale > 0) {
stats_mc.health_mc._xscale = stats_mc.health_mc._xscale - 4;
} else {
clearInterval(mainId);
diedStage();
}
}
if (explodeMc._currentframe >= 15) {
clearInterval(explodeMc.ID);
explodeMc.removeMovieClip();
}
}
function generateBlood(i) {
duplicateMovieClip ("death_hit_mc", "death_hit_mc" + bloodCount, -(bloodCount + 5000));
this["death_hit_mc" + bloodCount]._x = this["enemy_mc" + i]._x;
this["death_hit_mc" + bloodCount]._y = this["enemy_mc" + i]._y;
this["death_hit_mc" + bloodCount].play();
bloodCount = bloodCount + 1;
}
function generateHit(i) {
duplicateMovieClip ("hit_mc", "hit_mc" + bloodCount, -(bloodCount + 8000));
this["hit_mc" + bloodCount]._x = this[i]._x;
this["hit_mc" + bloodCount]._y = this[i]._y;
this["hit_mc" + bloodCount]._xscale = 20;
this["hit_mc" + bloodCount]._yscale = 20;
this["hit_mc" + bloodCount].play();
bloodCount = bloodCount + 1;
}
function generateEnemy() {
var _local2 = 0;
_local2 = random(4);
duplicateMovieClip ("enemy_mc", "enemy_mc" + enemyNumber, this.getNextHighestDepth());
this["enemy_mc" + enemyNumber].enemyMove = 50;
this["enemy_mc" + enemyNumber].enemyShoot = 50;
this["enemy_mc" + enemyNumber].enemyLife = stageChoose;
this["enemy_mc" + enemyNumber].enemyDelay = 10;
duplicateMovieClip ("enemy_mc_dummy", "enemy_mc_dummy" + enemyNumber, this.getNextHighestDepth());
if (_local2 == 0) {
this["enemy_mc" + enemyNumber]._x = -30;
this["enemy_mc" + enemyNumber]._y = char_mc._y;
} else if (_local2 == 1) {
this["enemy_mc" + enemyNumber]._x = 670;
this["enemy_mc" + enemyNumber]._y = char_mc._y;
} else if (_local2 == 2) {
this["enemy_mc" + enemyNumber]._x = char_mc._x;
this["enemy_mc" + enemyNumber]._y = -30;
} else if (_local2 == 3) {
this["enemy_mc" + enemyNumber]._x = char_mc._x;
this["enemy_mc" + enemyNumber]._y = 510;
}
enemyNumber = enemyNumber + 1;
}
function randomEnemy(i) {
var _local3 = 0;
_local3 = random(4);
this["enemy_mc" + i].enemyMove = 50;
this["enemy_mc" + i].enemyShoot = 50;
this["enemy_mc" + i].enemyDelay = 10;
if (_local3 == 0) {
this["enemy_mc" + i]._x = -100;
this["enemy_mc" + i]._y = char_mc._y;
} else if (_local3 == 1) {
this["enemy_mc" + i]._x = 750;
this["enemy_mc" + i]._y = char_mc._y;
} else if (_local3 == 2) {
this["enemy_mc" + i]._x = char_mc._x;
this["enemy_mc" + i]._y = -100;
} else if (_local3 == 3) {
this["enemy_mc" + i]._x = char_mc._x;
this["enemy_mc" + i]._y = 560;
}
}
function collideEnemy(i) {
j = 0;
if (j < enemyNumber) {
if (this["enemy_mc" + i].hitTest(this["enemy_mc" + j]) && (i != j)) {
return(true);
}
return(false);
}
}
function enemyShootNow(i) {
start_ball_xEnemy = this["enemy_mc" + i]._x + (20 * Math.cos((degreesEnemy * Math.PI) / 180));
start_ball_yEnemy = this["enemy_mc" + i]._y + (20 * Math.sin((degreesEnemy * Math.PI) / 180));
if (bulletCountEnemy < 30) {
sfx_mc.gotoAndPlay("gun");
cannonball_firedEnemy = attachMovie("bullet_mc", "bullet_mc_enemy" + bulletCountEnemy, _root.getNextHighestDepth(), {_x:start_ball_xEnemy, _y:start_ball_yEnemy});
cannonball_firedEnemy.dirx = Math.cos((degreesEnemy * Math.PI) / 180) * fireSpeed;
cannonball_firedEnemy.diry = Math.sin((degreesEnemy * Math.PI) / 180) * fireSpeed;
cannonball_firedEnemy._rotation = degreesEnemy;
cannonball_firedEnemy.ID = setInterval(bulletMove, duration, this["bullet_mc_enemy" + bulletCountEnemy]);
cannonball_firedEnemy.IDx = setInterval(enemybulletHit, duration, this["bullet_mc_enemy" + bulletCountEnemy]);
bulletCountEnemy = bulletCountEnemy + 1;
} else {
bulletCountEnemy = 0;
}
}
function bossShootNow() {
start_ball_xEnemy = boss_mc._x + (20 * Math.cos((degreesEnemy * Math.PI) / 180));
start_ball_yEnemy = boss_mc._y + (20 * Math.sin((degreesEnemy * Math.PI) / 180));
if (bulletCountBoss < 20) {
sfx_mc.gotoAndPlay("gun");
cannonball_firedEnemy = attachMovie("bullet_mc", "bullet_mc_boss" + bulletCountBoss, _root.getNextHighestDepth(), {_x:start_ball_xEnemy, _y:start_ball_yEnemy});
cannonball_firedEnemy.dirx = Math.cos((degreesEnemy * Math.PI) / 180) * (fireSpeed * 2);
cannonball_firedEnemy.diry = Math.sin((degreesEnemy * Math.PI) / 180) * (fireSpeed * 2);
cannonball_firedEnemy._rotation = degreesEnemy;
cannonball_firedEnemy.ID = setInterval(bulletMove, duration, this["bullet_mc_boss" + bulletCountBoss]);
cannonball_firedEnemy.IDx = setInterval(enemybulletHit, duration, this["bullet_mc_boss" + bulletCountBoss]);
bulletCountBoss = bulletCountBoss + 1;
} else {
bulletCountBoss = 0;
}
}
function mazeWalls(nameMc) {
with (nameMc) {
if (maze_mc.walls.hitTest(getBounds(_parent).xMax, _y, true)) {
nameMc._x = nameMc._x - (moveSpeed * 1);
}
if (maze_mc.walls.hitTest(getBounds(_parent).xMin, _y, true)) {
_x = _x + (moveSpeed * 1);
}
if (maze_mc.walls.hitTest(_x, getBounds(_parent).yMax, true)) {
_y = _y - (moveSpeed * 1);
}
if (maze_mc.walls.hitTest(_x, getBounds(_parent).yMin, true)) {
_y = _y + (moveSpeed * 1);
}
}
}
function panningEffect(nameMc) {
if (bgMovesX == -1) {
nameMc._x = nameMc._x - moveSpeed;
}
if (bgMovesX == 1) {
nameMc._x = nameMc._x + moveSpeed;
}
if (bgMovesY == -1) {
nameMc._y = nameMc._y - moveSpeed;
}
if (bgMovesY == 1) {
nameMc._y = nameMc._y + moveSpeed;
}
}
function endStage() {
this["poster_stage" + stageChoose].gotoAndPlay(2);
this["poster_stage" + stageChoose].swapDepths(1500);
score = score + (1000 * stageChoose);
stats_mc.score_txt.text = score;
target_mc.removeMovieClip();
Mouse.show();
pause_btn._visible = false;
pause_mc._visible = false;
Key.removeListener(keyListener);
}
function diedStage() {
poster_char.gotoAndPlay(2);
poster_char.swapDepths(1000);
char_mc_dummy.gotoAndStop("die");
target_mc.removeMovieClip();
Mouse.show();
pause_btn._visible = false;
pause_mc._visible = false;
Key.removeListener(keyListener);
}
function goBack() {
removeObjects();
stopAllSounds();
gotoAndStop ("townSelect");
}
function goTown() {
removeObjects();
stopAllSounds();
gotoAndStop ("townSelect");
}
function goEnd() {
removeObjects();
stopAllSounds();
_root.gotoAndStop("EndScreen");
}
function goQuit() {
removeObjects();
stopAllSounds();
gotoAndStop ("title");
}
function removeObjects() {
i2 = 0;
while (i2 < enemyNumber) {
removeMovieClip(this["enemy_mc_dummy" + i2]);
i2++;
}
k2 = 0;
while (k2 <= 30) {
removeMovieClip(this["object_mc" + k2]);
k2++;
}
m2 = 0;
while (m2 <= bloodCount) {
removeMovieClip(this["death_hit_mc" + m2]);
removeMovieClip(this["hit_mc" + m2]);
m2++;
}
removeMovieClip(stats_mc);
removeMovieClip(this["boss_mc_dummy" + stageChoose]);
removeMovieClip(this["boss_mc_dummy" + (stageChoose - 1)]);
removeMovieClip(bossLife_mc);
removeMovieClip(char_mc_dummy);
removeMovieClip(this["poster_stage" + stageChoose]);
removeMovieClip(this["poster_stage" + (stageChoose - 1)]);
removeMovieClip(poster_char);
removeMovieClip(pause_mc);
removeMovieClip(pause_btn);
removeMovieClip(map_mc);
}
function initItems() {
i = 1;
while (i <= 4) {
stats_mc["item_mc" + i]._alpha = 10;
stats_mc["item_box" + i]._visible = false;
i++;
}
}
function initItems2() {
i = 1;
while (i <= 4) {
stats_mc["item_mc" + i]._alpha = 80;
i++;
}
}
stop();
Mouse.hide();
sound_mc.gotoAndPlay(2);
var mainId = 0;
var duration = 32;
var bulletId;
var radians = 0;
var degrees = 0;
var radiansEnemy = 0;
var degreesEnemy = 0;
var enemyNumber = 0;
var enemyBilang = 0;
var moveSpeed = 4;
var fireSpeed = 15;
var fireDelay = 20;
var fireHold = 0;
var hitDelay = 5;
var bombDelay = 20;
var bombLimit = 5;
var bgMovesX = 0;
var bgMovesY = 0;
var bulletCount = 0;
var bombCount = 0;
var explodeCount = 0;
var bulletCountEnemy = 0;
var bulletCountBoss = 0;
var bloodCount = 0;
var multiplier = 0;
stats_mc.combo_mc._xscale = 0;
char_mc._visible = false;
generateEnemy();
stats_mc.bounty_txt.text = bounty;
stats_mc.score_txt.text = score;
stats_mc.bomb_txt.text = bombLimit;
stats_mc.swapDepths(800);
target_mc.swapDepths(900);
alert_mc.swapDepths(820);
mainId = setInterval(mainMc, 20);
initItems();
initItems2();
stats_mc.item_mc1._alpha = 100;
stats_mc.item_box1._visible = true;
var keyListener = new Object();
keyListener.onKeyDown = function () {
if (chr(Key.getAscii()) == "1") {
initItems();
initItems2();
stats_mc.item_mc1._alpha = 100;
stats_mc.item_box1._visible = true;
sfx_mc.gotoAndPlay("select");
} else if (chr(Key.getAscii()) == "2") {
initItems();
initItems2();
stats_mc.item_mc2._alpha = 100;
stats_mc.item_box2._visible = true;
sfx_mc.gotoAndPlay("select");
} else if (chr(Key.getAscii()) == "3") {
initItems();
initItems2();
stats_mc.item_mc3._alpha = 100;
stats_mc.item_box3._visible = true;
sfx_mc.gotoAndPlay("select");
} else if (chr(Key.getAscii()) == "4") {
initItems();
initItems2();
stats_mc.item_mc4._alpha = 100;
stats_mc.item_box4._visible = true;
sfx_mc.gotoAndPlay("select");
}
};
Key.addListener(keyListener);
pause_mc._visible = false;
pause_btn._visible = true;
pause_mc.swapDepths(850);
pause_btn.swapDepths(870);
pause_btn.pause_btn.onRelease = function () {
this._parent._visible = false;
pause_mc._visible = true;
};
pause_mc.continue_btn.onRelease = function () {
this._parent._visible = false;
pause_btn._visible = true;
};
Frame 85
stop();
score_txt.text = score;
back_btn.onRelease = function () {
gotoAndStop ("title");
};
Symbol 59 MovieClip [explode_mc] Frame 1
stop();
Symbol 59 MovieClip [explode_mc] Frame 2
Symbol 59 MovieClip [explode_mc] Frame 27
Symbol 64 MovieClip [molotov_mc] Frame 1
stop();
Symbol 183 Button
on (release) {
getURL ("http://www.gamebusted.com/", "_blank");
}
Symbol 196 Button
on (release) {
play();
}
Symbol 201 Button
on (release) {
getURL ("http://www.startonlinegames.com/", "_blank");
}
Symbol 203 MovieClip Frame 1
stop();
this.onEnterFrame = function () {
PercentLoaded = Math.round((_root.getBytesLoaded() / _root.getBytesTotal()) * 100);
bar._xscale = PercentLoaded;
if ((PercentLoaded == 100) && (_root.ads)) {
delete onEnterFrame;
gotoAndStop ("load");
}
};
Instance of Symbol 181 MovieClip in Symbol 203 MovieClip Frame 1
on (release) {
getURL ("http://www.gamebusted.com/", "_blank");
}
Symbol 203 MovieClip Frame 2
stop();
Symbol 203 MovieClip Frame 222
_root.gotoAndStop("title");
Symbol 231 Button
on (release) {
_root.gotoAndStop("howToPlay");
}
Symbol 232 Button
on (release) {
_root.gotoAndStop("howToPlay");
}
Symbol 233 Button
on (release) {
getURL ("http://www.gamebusted.com");
}
Symbol 234 MovieClip Frame 163
stop();
Symbol 237 Button
on (release) {
nextFrame();
}
Symbol 239 Button
on (release) {
prevFrame();
}
Symbol 240 MovieClip Frame 1
stop();
_root.menubg.setVolume(100);
_root.muteon = false;
Symbol 240 MovieClip Frame 2
stop();
_root.menubg.setVolume(0);
_root.muteon = true;
Symbol 250 Button
on (release) {
getURL ("http://www.gamebusted.com/", "_blank");
}
Symbol 302 Button
on (release) {
gotoAndPlay (733);
}
Symbol 604 MovieClip Frame 733
_root.bounty = 10;
_root.enemyMoveSpeed = 1;
_root.stageChoose = 1;
_root.gotoAndStop("gameScreen1");
Symbol 615 Button
on (release) {
gotoAndStop (522);
}
Symbol 861 MovieClip Frame 522
_root.bounty = 20;
_root.enemyMoveSpeed = 1.25;
_root.stageChoose = 2;
_root.gotoAndStop("gameScreen2");
Symbol 868 Button
on (release) {
gotoAndPlay (250);
}
Symbol 951 MovieClip Frame 250
_root.bounty = 25;
_root.enemyMoveSpeed = 1.5;
_root.stageChoose = 3;
_root.gotoAndStop("gameScreen3");
Symbol 956 Button
on (release) {
gotoAndPlay (420);
}
Symbol 1168 MovieClip Frame 420
_root.bounty = 30;
_root.enemyMoveSpeed = 1.75;
_root.stageChoose = 4;
_root.gotoAndStop("gameScreen4");
Symbol 1174 Button
on (release) {
gotoAndStop (241);
}
Symbol 1254 MovieClip Frame 241
_root.bounty = 30;
_root.enemyMoveSpeed = 2;
_root.stageChoose = 5;
_root.gotoAndStop("gameScreen5");
Symbol 1259 Button
on (release) {
gotoAndPlay (276);
}
Symbol 1366 MovieClip Frame 276
_parent.gotoAndStop("townSelect");
Symbol 1370 Button
on (release) {
gotoAndStop (275);
}
Symbol 1380 MovieClip Frame 276
_parent.gotoAndStop("townSelect");
Symbol 1384 Button
on (release) {
gotoAndPlay (276);
}
Symbol 1394 MovieClip Frame 276
_parent.gotoAndStop("townSelect");
Symbol 1401 MovieClip Frame 1
stop();
Symbol 1422 MovieClip Frame 1
Symbol 1422 MovieClip Frame 181
stop();
this.removeMovieClip();
Symbol 1449 MovieClip Frame 1
stop();
Symbol 1449 MovieClip Frame 2
Symbol 1449 MovieClip Frame 27
this.removeMovieClip();
Symbol 1455 MovieClip Frame 1
Symbol 1455 MovieClip Frame 181
stop();
this.removeMovieClip();
Symbol 1458 MovieClip Frame 1
stop();
Symbol 1465 MovieClip Frame 1
stop();
Symbol 1465 MovieClip Frame 2
stop();
Symbol 1465 MovieClip Frame 3
stop();
Symbol 1465 MovieClip Frame 4
stop();
Symbol 1465 MovieClip Frame 5
stop();
Symbol 1465 MovieClip Frame 6
stop();
Symbol 1465 MovieClip Frame 7
stop();
Symbol 1465 MovieClip Frame 8
stop();
Symbol 1465 MovieClip Frame 9
stop();
Symbol 1465 MovieClip Frame 10
stop();
Symbol 1465 MovieClip Frame 11
stop();
Symbol 1465 MovieClip Frame 12
stop();
Symbol 1472 MovieClip Frame 1
stop();
Symbol 1472 MovieClip Frame 2
stop();
Symbol 1472 MovieClip Frame 3
stop();
Symbol 1472 MovieClip Frame 4
stop();
Symbol 1472 MovieClip Frame 5
stop();
Symbol 1472 MovieClip Frame 6
stop();
Symbol 1472 MovieClip Frame 7
stop();
Symbol 1472 MovieClip Frame 8
stop();
Symbol 1472 MovieClip Frame 9
stop();
Symbol 1472 MovieClip Frame 10
stop();
Symbol 1472 MovieClip Frame 11
stop();
Symbol 1472 MovieClip Frame 12
stop();
Symbol 1480 MovieClip Frame 1
stop();
Symbol 1480 MovieClip Frame 2
stop();
Symbol 1480 MovieClip Frame 3
stop();
Symbol 1480 MovieClip Frame 4
stop();
Symbol 1480 MovieClip Frame 5
stop();
Symbol 1480 MovieClip Frame 6
stop();
Symbol 1480 MovieClip Frame 7
stop();
Symbol 1480 MovieClip Frame 8
stop();
Symbol 1480 MovieClip Frame 9
stop();
Symbol 1480 MovieClip Frame 10
stop();
Symbol 1480 MovieClip Frame 11
stop();
Symbol 1480 MovieClip Frame 12
stop();
Symbol 1480 MovieClip Frame 13
stop();
Symbol 1480 MovieClip Frame 14
stop();
Symbol 1486 MovieClip Frame 1
stop();
Symbol 1486 MovieClip Frame 2
stop();
Symbol 1486 MovieClip Frame 3
stop();
Symbol 1486 MovieClip Frame 4
stop();
Symbol 1486 MovieClip Frame 5
stop();
Symbol 1486 MovieClip Frame 6
stop();
Symbol 1486 MovieClip Frame 7
stop();
Symbol 1486 MovieClip Frame 8
stop();
Symbol 1486 MovieClip Frame 9
stop();
Symbol 1486 MovieClip Frame 10
stop();
Symbol 1494 MovieClip Frame 1
stop();
Symbol 1494 MovieClip Frame 2
stop();
Symbol 1494 MovieClip Frame 3
stop();
Symbol 1494 MovieClip Frame 4
stop();
Symbol 1494 MovieClip Frame 5
stop();
Symbol 1494 MovieClip Frame 6
stop();
Symbol 1494 MovieClip Frame 7
stop();
Symbol 1494 MovieClip Frame 8
stop();
Symbol 1494 MovieClip Frame 9
stop();
Symbol 1494 MovieClip Frame 10
stop();
Symbol 1494 MovieClip Frame 11
stop();
Symbol 1494 MovieClip Frame 12
stop();
Symbol 1494 MovieClip Frame 13
stop();
Symbol 1494 MovieClip Frame 14
stop();
Symbol 1495 MovieClip Frame 1
stop();
Symbol 1495 MovieClip Frame 10
stop();
Symbol 1495 MovieClip Frame 20
stop();
Symbol 1495 MovieClip Frame 30
stop();
Symbol 1495 MovieClip Frame 40
stop();
Symbol 1502 MovieClip Frame 1
stop();
Symbol 1502 MovieClip Frame 2
stop();
Symbol 1502 MovieClip Frame 3
stop();
Symbol 1502 MovieClip Frame 4
stop();
Symbol 1502 MovieClip Frame 5
stop();
Symbol 1502 MovieClip Frame 6
stop();
Symbol 1502 MovieClip Frame 7
stop();
Symbol 1502 MovieClip Frame 8
stop();
Symbol 1502 MovieClip Frame 9
stop();
Symbol 1502 MovieClip Frame 10
stop();
Symbol 1502 MovieClip Frame 11
stop();
Symbol 1502 MovieClip Frame 12
stop();
Symbol 1509 MovieClip Frame 1
stop();
Symbol 1509 MovieClip Frame 2
stop();
Symbol 1509 MovieClip Frame 3
stop();
Symbol 1509 MovieClip Frame 4
stop();
Symbol 1509 MovieClip Frame 5
stop();
Symbol 1509 MovieClip Frame 6
stop();
Symbol 1509 MovieClip Frame 7
stop();
Symbol 1509 MovieClip Frame 8
stop();
Symbol 1509 MovieClip Frame 9
stop();
Symbol 1509 MovieClip Frame 10
stop();
Symbol 1509 MovieClip Frame 11
stop();
Symbol 1509 MovieClip Frame 12
stop();
Symbol 1517 MovieClip Frame 1
stop();
Symbol 1517 MovieClip Frame 2
stop();
Symbol 1517 MovieClip Frame 3
stop();
Symbol 1517 MovieClip Frame 4
stop();
Symbol 1517 MovieClip Frame 5
stop();
Symbol 1517 MovieClip Frame 6
stop();
Symbol 1517 MovieClip Frame 7
stop();
Symbol 1517 MovieClip Frame 8
stop();
Symbol 1517 MovieClip Frame 9
stop();
Symbol 1517 MovieClip Frame 10
stop();
Symbol 1517 MovieClip Frame 11
stop();
Symbol 1517 MovieClip Frame 12
stop();
Symbol 1517 MovieClip Frame 13
stop();
Symbol 1517 MovieClip Frame 14
stop();
Symbol 1523 MovieClip Frame 1
stop();
Symbol 1523 MovieClip Frame 2
stop();
Symbol 1523 MovieClip Frame 3
stop();
Symbol 1523 MovieClip Frame 4
stop();
Symbol 1523 MovieClip Frame 5
stop();
Symbol 1523 MovieClip Frame 6
stop();
Symbol 1523 MovieClip Frame 7
stop();
Symbol 1523 MovieClip Frame 8
stop();
Symbol 1523 MovieClip Frame 9
stop();
Symbol 1523 MovieClip Frame 10
stop();
Symbol 1531 MovieClip Frame 1
stop();
Symbol 1531 MovieClip Frame 2
stop();
Symbol 1531 MovieClip Frame 3
stop();
Symbol 1531 MovieClip Frame 4
stop();
Symbol 1531 MovieClip Frame 5
stop();
Symbol 1531 MovieClip Frame 6
stop();
Symbol 1531 MovieClip Frame 7
stop();
Symbol 1531 MovieClip Frame 8
stop();
Symbol 1531 MovieClip Frame 9
stop();
Symbol 1531 MovieClip Frame 10
stop();
Symbol 1531 MovieClip Frame 11
stop();
Symbol 1531 MovieClip Frame 12
stop();
Symbol 1531 MovieClip Frame 13
stop();
Symbol 1531 MovieClip Frame 14
stop();
Symbol 1536 MovieClip Frame 78
stop();
Symbol 1537 MovieClip Frame 1
stop();
Symbol 1537 MovieClip Frame 10
stop();
Symbol 1537 MovieClip Frame 20
stop();
Symbol 1537 MovieClip Frame 30
stop();
Symbol 1537 MovieClip Frame 40
stop();
Symbol 1537 MovieClip Frame 50
stop();
Symbol 1549 MovieClip Frame 1
stop();
Symbol 1549 MovieClip Frame 2
stop();
Symbol 1549 MovieClip Frame 3
stop();
Symbol 1549 MovieClip Frame 4
stop();
Symbol 1549 MovieClip Frame 5
stop();
Symbol 1549 MovieClip Frame 6
stop();
Symbol 1549 MovieClip Frame 7
stop();
Symbol 1549 MovieClip Frame 8
stop();
Symbol 1549 MovieClip Frame 9
stop();
Symbol 1549 MovieClip Frame 10
stop();
Symbol 1549 MovieClip Frame 11
stop();
Symbol 1549 MovieClip Frame 12
stop();
Symbol 1556 MovieClip Frame 1
stop();
Symbol 1556 MovieClip Frame 2
stop();
Symbol 1556 MovieClip Frame 3
stop();
Symbol 1556 MovieClip Frame 4
stop();
Symbol 1556 MovieClip Frame 5
stop();
Symbol 1556 MovieClip Frame 6
stop();
Symbol 1556 MovieClip Frame 7
stop();
Symbol 1556 MovieClip Frame 8
stop();
Symbol 1556 MovieClip Frame 9
stop();
Symbol 1556 MovieClip Frame 10
stop();
Symbol 1556 MovieClip Frame 11
stop();
Symbol 1556 MovieClip Frame 12
stop();
Symbol 1564 MovieClip Frame 1
stop();
Symbol 1564 MovieClip Frame 2
stop();
Symbol 1564 MovieClip Frame 3
stop();
Symbol 1564 MovieClip Frame 4
stop();
Symbol 1564 MovieClip Frame 5
stop();
Symbol 1564 MovieClip Frame 6
stop();
Symbol 1564 MovieClip Frame 7
stop();
Symbol 1564 MovieClip Frame 8
stop();
Symbol 1564 MovieClip Frame 9
stop();
Symbol 1564 MovieClip Frame 10
stop();
Symbol 1564 MovieClip Frame 11
stop();
Symbol 1564 MovieClip Frame 12
stop();
Symbol 1564 MovieClip Frame 13
stop();
Symbol 1564 MovieClip Frame 14
stop();
Symbol 1570 MovieClip Frame 1
stop();
Symbol 1570 MovieClip Frame 2
stop();
Symbol 1570 MovieClip Frame 3
stop();
Symbol 1570 MovieClip Frame 4
stop();
Symbol 1570 MovieClip Frame 5
stop();
Symbol 1570 MovieClip Frame 6
stop();
Symbol 1570 MovieClip Frame 7
stop();
Symbol 1570 MovieClip Frame 8
stop();
Symbol 1570 MovieClip Frame 9
stop();
Symbol 1570 MovieClip Frame 10
stop();
Symbol 1578 MovieClip Frame 1
stop();
Symbol 1578 MovieClip Frame 2
stop();
Symbol 1578 MovieClip Frame 3
stop();
Symbol 1578 MovieClip Frame 4
stop();
Symbol 1578 MovieClip Frame 5
stop();
Symbol 1578 MovieClip Frame 6
stop();
Symbol 1578 MovieClip Frame 7
stop();
Symbol 1578 MovieClip Frame 8
stop();
Symbol 1578 MovieClip Frame 9
stop();
Symbol 1578 MovieClip Frame 10
stop();
Symbol 1578 MovieClip Frame 11
stop();
Symbol 1578 MovieClip Frame 12
stop();
Symbol 1578 MovieClip Frame 13
stop();
Symbol 1578 MovieClip Frame 14
stop();
Symbol 1583 MovieClip Frame 77
stop();
Symbol 1584 MovieClip Frame 1
stop();
Symbol 1584 MovieClip Frame 10
stop();
Symbol 1584 MovieClip Frame 20
stop();
Symbol 1584 MovieClip Frame 30
stop();
Symbol 1584 MovieClip Frame 40
stop();
Symbol 1584 MovieClip Frame 50
stop();
Symbol 1591 MovieClip Frame 1
stop();
Symbol 1591 MovieClip Frame 2
stop();
Symbol 1591 MovieClip Frame 3
stop();
Symbol 1591 MovieClip Frame 4
stop();
Symbol 1591 MovieClip Frame 5
stop();
Symbol 1591 MovieClip Frame 6
stop();
Symbol 1591 MovieClip Frame 7
stop();
Symbol 1591 MovieClip Frame 8
stop();
Symbol 1591 MovieClip Frame 9
stop();
Symbol 1591 MovieClip Frame 10
stop();
Symbol 1591 MovieClip Frame 11
stop();
Symbol 1591 MovieClip Frame 12
stop();
Symbol 1598 MovieClip Frame 1
stop();
Symbol 1598 MovieClip Frame 2
stop();
Symbol 1598 MovieClip Frame 3
stop();
Symbol 1598 MovieClip Frame 4
stop();
Symbol 1598 MovieClip Frame 5
stop();
Symbol 1598 MovieClip Frame 6
stop();
Symbol 1598 MovieClip Frame 7
stop();
Symbol 1598 MovieClip Frame 8
stop();
Symbol 1598 MovieClip Frame 9
stop();
Symbol 1598 MovieClip Frame 10
stop();
Symbol 1598 MovieClip Frame 11
stop();
Symbol 1598 MovieClip Frame 12
stop();
Symbol 1606 MovieClip Frame 1
stop();
Symbol 1606 MovieClip Frame 2
stop();
Symbol 1606 MovieClip Frame 3
stop();
Symbol 1606 MovieClip Frame 4
stop();
Symbol 1606 MovieClip Frame 5
stop();
Symbol 1606 MovieClip Frame 6
stop();
Symbol 1606 MovieClip Frame 7
stop();
Symbol 1606 MovieClip Frame 8
stop();
Symbol 1606 MovieClip Frame 9
stop();
Symbol 1606 MovieClip Frame 10
stop();
Symbol 1606 MovieClip Frame 11
stop();
Symbol 1606 MovieClip Frame 12
stop();
Symbol 1606 MovieClip Frame 13
stop();
Symbol 1606 MovieClip Frame 14
stop();
Symbol 1612 MovieClip Frame 1
stop();
Symbol 1612 MovieClip Frame 2
stop();
Symbol 1612 MovieClip Frame 3
stop();
Symbol 1612 MovieClip Frame 4
stop();
Symbol 1612 MovieClip Frame 5
stop();
Symbol 1612 MovieClip Frame 6
stop();
Symbol 1612 MovieClip Frame 7
stop();
Symbol 1612 MovieClip Frame 8
stop();
Symbol 1612 MovieClip Frame 9
stop();
Symbol 1612 MovieClip Frame 10
stop();
Symbol 1620 MovieClip Frame 1
stop();
Symbol 1620 MovieClip Frame 2
stop();
Symbol 1620 MovieClip Frame 3
stop();
Symbol 1620 MovieClip Frame 4
stop();
Symbol 1620 MovieClip Frame 5
stop();
Symbol 1620 MovieClip Frame 6
stop();
Symbol 1620 MovieClip Frame 7
stop();
Symbol 1620 MovieClip Frame 8
stop();
Symbol 1620 MovieClip Frame 9
stop();
Symbol 1620 MovieClip Frame 10
stop();
Symbol 1620 MovieClip Frame 11
stop();
Symbol 1620 MovieClip Frame 12
stop();
Symbol 1620 MovieClip Frame 13
stop();
Symbol 1620 MovieClip Frame 14
stop();
Symbol 1625 MovieClip Frame 77
stop();
Symbol 1626 MovieClip Frame 1
stop();
Symbol 1626 MovieClip Frame 10
stop();
Symbol 1626 MovieClip Frame 20
stop();
Symbol 1626 MovieClip Frame 30
stop();
Symbol 1626 MovieClip Frame 40
stop();
Symbol 1626 MovieClip Frame 50
stop();
Symbol 1633 MovieClip Frame 1
stop();
Symbol 1633 MovieClip Frame 2
stop();
Symbol 1633 MovieClip Frame 3
stop();
Symbol 1633 MovieClip Frame 4
stop();
Symbol 1633 MovieClip Frame 5
stop();
Symbol 1633 MovieClip Frame 6
stop();
Symbol 1633 MovieClip Frame 7
stop();
Symbol 1633 MovieClip Frame 8
stop();
Symbol 1633 MovieClip Frame 9
stop();
Symbol 1633 MovieClip Frame 10
stop();
Symbol 1633 MovieClip Frame 11
stop();
Symbol 1633 MovieClip Frame 12
stop();
Symbol 1640 MovieClip Frame 1
stop();
Symbol 1640 MovieClip Frame 2
stop();
Symbol 1640 MovieClip Frame 3
stop();
Symbol 1640 MovieClip Frame 4
stop();
Symbol 1640 MovieClip Frame 5
stop();
Symbol 1640 MovieClip Frame 6
stop();
Symbol 1640 MovieClip Frame 7
stop();
Symbol 1640 MovieClip Frame 8
stop();
Symbol 1640 MovieClip Frame 9
stop();
Symbol 1640 MovieClip Frame 10
stop();
Symbol 1640 MovieClip Frame 11
stop();
Symbol 1640 MovieClip Frame 12
stop();
Symbol 1648 MovieClip Frame 1
stop();
Symbol 1648 MovieClip Frame 2
stop();
Symbol 1648 MovieClip Frame 3
stop();
Symbol 1648 MovieClip Frame 4
stop();
Symbol 1648 MovieClip Frame 5
stop();
Symbol 1648 MovieClip Frame 6
stop();
Symbol 1648 MovieClip Frame 7
stop();
Symbol 1648 MovieClip Frame 8
stop();
Symbol 1648 MovieClip Frame 9
stop();
Symbol 1648 MovieClip Frame 10
stop();
Symbol 1648 MovieClip Frame 11
stop();
Symbol 1648 MovieClip Frame 12
stop();
Symbol 1648 MovieClip Frame 13
stop();
Symbol 1648 MovieClip Frame 14
stop();
Symbol 1654 MovieClip Frame 1
stop();
Symbol 1654 MovieClip Frame 2
stop();
Symbol 1654 MovieClip Frame 3
stop();
Symbol 1654 MovieClip Frame 4
stop();
Symbol 1654 MovieClip Frame 5
stop();
Symbol 1654 MovieClip Frame 6
stop();
Symbol 1654 MovieClip Frame 7
stop();
Symbol 1654 MovieClip Frame 8
stop();
Symbol 1654 MovieClip Frame 9
stop();
Symbol 1654 MovieClip Frame 10
stop();
Symbol 1662 MovieClip Frame 1
stop();
Symbol 1662 MovieClip Frame 2
stop();
Symbol 1662 MovieClip Frame 3
stop();
Symbol 1662 MovieClip Frame 4
stop();
Symbol 1662 MovieClip Frame 5
stop();
Symbol 1662 MovieClip Frame 6
stop();
Symbol 1662 MovieClip Frame 7
stop();
Symbol 1662 MovieClip Frame 8
stop();
Symbol 1662 MovieClip Frame 9
stop();
Symbol 1662 MovieClip Frame 10
stop();
Symbol 1662 MovieClip Frame 11
stop();
Symbol 1662 MovieClip Frame 12
stop();
Symbol 1662 MovieClip Frame 13
stop();
Symbol 1662 MovieClip Frame 14
stop();
Symbol 1667 MovieClip Frame 77
stop();
Symbol 1668 MovieClip Frame 1
stop();
Symbol 1668 MovieClip Frame 10
stop();
Symbol 1668 MovieClip Frame 20
stop();
Symbol 1668 MovieClip Frame 30
stop();
Symbol 1668 MovieClip Frame 40
stop();
Symbol 1668 MovieClip Frame 50
stop();
Symbol 1675 MovieClip Frame 1
stop();
Symbol 1675 MovieClip Frame 2
stop();
Symbol 1675 MovieClip Frame 3
stop();
Symbol 1675 MovieClip Frame 4
stop();
Symbol 1675 MovieClip Frame 5
stop();
Symbol 1675 MovieClip Frame 6
stop();
Symbol 1675 MovieClip Frame 7
stop();
Symbol 1675 MovieClip Frame 8
stop();
Symbol 1675 MovieClip Frame 9
stop();
Symbol 1675 MovieClip Frame 10
stop();
Symbol 1675 MovieClip Frame 11
stop();
Symbol 1675 MovieClip Frame 12
stop();
Symbol 1682 MovieClip Frame 1
stop();
Symbol 1682 MovieClip Frame 2
stop();
Symbol 1682 MovieClip Frame 3
stop();
Symbol 1682 MovieClip Frame 4
stop();
Symbol 1682 MovieClip Frame 5
stop();
Symbol 1682 MovieClip Frame 6
stop();
Symbol 1682 MovieClip Frame 7
stop();
Symbol 1682 MovieClip Frame 8
stop();
Symbol 1682 MovieClip Frame 9
stop();
Symbol 1682 MovieClip Frame 10
stop();
Symbol 1682 MovieClip Frame 11
stop();
Symbol 1682 MovieClip Frame 12
stop();
Symbol 1690 MovieClip Frame 1
stop();
Symbol 1690 MovieClip Frame 2
stop();
Symbol 1690 MovieClip Frame 3
stop();
Symbol 1690 MovieClip Frame 4
stop();
Symbol 1690 MovieClip Frame 5
stop();
Symbol 1690 MovieClip Frame 6
stop();
Symbol 1690 MovieClip Frame 7
stop();
Symbol 1690 MovieClip Frame 8
stop();
Symbol 1690 MovieClip Frame 9
stop();
Symbol 1690 MovieClip Frame 10
stop();
Symbol 1690 MovieClip Frame 11
stop();
Symbol 1690 MovieClip Frame 12
stop();
Symbol 1690 MovieClip Frame 13
stop();
Symbol 1690 MovieClip Frame 14
stop();
Symbol 1696 MovieClip Frame 1
stop();
Symbol 1696 MovieClip Frame 2
stop();
Symbol 1696 MovieClip Frame 3
stop();
Symbol 1696 MovieClip Frame 4
stop();
Symbol 1696 MovieClip Frame 5
stop();
Symbol 1696 MovieClip Frame 6
stop();
Symbol 1696 MovieClip Frame 7
stop();
Symbol 1696 MovieClip Frame 8
stop();
Symbol 1696 MovieClip Frame 9
stop();
Symbol 1696 MovieClip Frame 10
stop();
Symbol 1704 MovieClip Frame 1
stop();
Symbol 1704 MovieClip Frame 2
stop();
Symbol 1704 MovieClip Frame 3
stop();
Symbol 1704 MovieClip Frame 4
stop();
Symbol 1704 MovieClip Frame 5
stop();
Symbol 1704 MovieClip Frame 6
stop();
Symbol 1704 MovieClip Frame 7
stop();
Symbol 1704 MovieClip Frame 8
stop();
Symbol 1704 MovieClip Frame 9
stop();
Symbol 1704 MovieClip Frame 10
stop();
Symbol 1704 MovieClip Frame 11
stop();
Symbol 1704 MovieClip Frame 12
stop();
Symbol 1704 MovieClip Frame 13
stop();
Symbol 1704 MovieClip Frame 14
stop();
Symbol 1709 MovieClip Frame 77
stop();
Symbol 1710 MovieClip Frame 1
stop();
Symbol 1710 MovieClip Frame 10
stop();
Symbol 1710 MovieClip Frame 20
stop();
Symbol 1710 MovieClip Frame 30
stop();
Symbol 1710 MovieClip Frame 40
stop();
Symbol 1710 MovieClip Frame 50
stop();
Symbol 1730 MovieClip Frame 1
stop();
Symbol 1730 MovieClip Frame 2
stop();
Symbol 1730 MovieClip Frame 3
stop();
Symbol 1730 MovieClip Frame 4
stop();
Symbol 1730 MovieClip Frame 5
stop();
Symbol 1730 MovieClip Frame 6
stop();
Symbol 1730 MovieClip Frame 7
stop();
Symbol 1730 MovieClip Frame 8
stop();
Symbol 1730 MovieClip Frame 9
stop();
Symbol 1730 MovieClip Frame 10
stop();
Symbol 1730 MovieClip Frame 11
stop();
Symbol 1730 MovieClip Frame 12
stop();
Symbol 1743 MovieClip Frame 1
stop();
Symbol 1743 MovieClip Frame 2
stop();
Symbol 1743 MovieClip Frame 3
stop();
Symbol 1743 MovieClip Frame 4
stop();
Symbol 1743 MovieClip Frame 5
stop();
Symbol 1743 MovieClip Frame 6
stop();
Symbol 1743 MovieClip Frame 7
stop();
Symbol 1743 MovieClip Frame 8
stop();
Symbol 1743 MovieClip Frame 9
stop();
Symbol 1743 MovieClip Frame 10
stop();
Symbol 1743 MovieClip Frame 11
stop();
Symbol 1743 MovieClip Frame 12
stop();
Symbol 1758 MovieClip Frame 1
stop();
Symbol 1758 MovieClip Frame 2
stop();
Symbol 1758 MovieClip Frame 3
stop();
Symbol 1758 MovieClip Frame 4
stop();
Symbol 1758 MovieClip Frame 5
stop();
Symbol 1758 MovieClip Frame 6
stop();
Symbol 1758 MovieClip Frame 7
stop();
Symbol 1758 MovieClip Frame 8
stop();
Symbol 1758 MovieClip Frame 9
stop();
Symbol 1758 MovieClip Frame 10
stop();
Symbol 1758 MovieClip Frame 11
stop();
Symbol 1758 MovieClip Frame 12
stop();
Symbol 1758 MovieClip Frame 13
stop();
Symbol 1758 MovieClip Frame 14
stop();
Symbol 1769 MovieClip Frame 1
stop();
Symbol 1769 MovieClip Frame 2
stop();
Symbol 1769 MovieClip Frame 3
stop();
Symbol 1769 MovieClip Frame 4
stop();
Symbol 1769 MovieClip Frame 5
stop();
Symbol 1769 MovieClip Frame 6
stop();
Symbol 1769 MovieClip Frame 7
stop();
Symbol 1769 MovieClip Frame 8
stop();
Symbol 1769 MovieClip Frame 9
stop();
Symbol 1769 MovieClip Frame 10
stop();
Symbol 1784 MovieClip Frame 1
stop();
Symbol 1784 MovieClip Frame 2
stop();
Symbol 1784 MovieClip Frame 3
stop();
Symbol 1784 MovieClip Frame 4
stop();
Symbol 1784 MovieClip Frame 5
stop();
Symbol 1784 MovieClip Frame 6
stop();
Symbol 1784 MovieClip Frame 7
stop();
Symbol 1784 MovieClip Frame 8
stop();
Symbol 1784 MovieClip Frame 9
stop();
Symbol 1784 MovieClip Frame 10
stop();
Symbol 1784 MovieClip Frame 11
stop();
Symbol 1784 MovieClip Frame 12
stop();
Symbol 1784 MovieClip Frame 13
stop();
Symbol 1784 MovieClip Frame 14
stop();
Symbol 1790 MovieClip Frame 77
stop();
Symbol 1791 MovieClip Frame 1
stop();
Symbol 1791 MovieClip Frame 10
stop();
Symbol 1791 MovieClip Frame 20
stop();
Symbol 1791 MovieClip Frame 30
stop();
Symbol 1791 MovieClip Frame 40
stop();
Symbol 1791 MovieClip Frame 50
stop();
Symbol 1824 MovieClip Frame 1
stop();
Symbol 1840 MovieClip Frame 1
stop();
Symbol 1840 MovieClip Frame 84
stop();
Symbol 1851 Button
on (release) {
getURL ("http://www.gamebusted.com", "_blank");
}
Symbol 1879 MovieClip Frame 1
stop();
Symbol 1879 MovieClip Frame 45
stop();
continue_btn.onRelease = function () {
_parent.stageChoose = _parent.stageChoose + 1;
_parent.goBack();
};
Symbol 1880 MovieClip Frame 1
stop();
Symbol 1880 MovieClip Frame 45
stop();
continue_btn.onRelease = function () {
_parent.stageChoose = _parent.stageChoose + 1;
_parent.goBack();
};
Symbol 1881 MovieClip Frame 1
stop();
Symbol 1881 MovieClip Frame 45
stop();
continue_btn.onRelease = function () {
_parent.stageChoose = _parent.stageChoose + 1;
_parent.goBack();
};
Symbol 1882 MovieClip Frame 1
stop();
Symbol 1882 MovieClip Frame 45
stop();
continue_btn.onRelease = function () {
_parent.stageChoose = _parent.stageChoose + 1;
_parent.goBack();
};
Symbol 1883 MovieClip Frame 1
stop();
Symbol 1883 MovieClip Frame 45
stop();
continue_btn.onRelease = function () {
_parent.stageChoose = _parent.stageChoose + 1;
_parent.goEnd();
};
Symbol 1887 Button
on (release) {
getURL ("http://www.gamebusted.com/play.php?id=4192", "_blank");
}
Symbol 1892 Button
on (release) {
getURL ("http://www.gamebusted.com/play.php?id=4255", "_blank");
}
Symbol 1897 Button
on (release) {
getURL ("http://www.gamebusted.com/play.php?id=4120", "_blank");
}
Symbol 1902 Button
on (release) {
getURL ("http://www.gamebusted.com/play.php?id=3916", "_blank");
}
Symbol 1909 Button
on (release) {
getURL ("http://www.gamebusted.com", "_blank");
}
Symbol 1910 MovieClip Frame 1
stop();
Symbol 1910 MovieClip Frame 45
stop();
quit_btn.onRelease = function () {
_parent.goQuit();
};
continue_btn.onRelease = function () {
_parent.goTown();
};
Symbol 1933 MovieClip Frame 1
stop();
Symbol 1933 MovieClip Frame 9
gotoAndStop (1);
Symbol 1933 MovieClip Frame 19
gotoAndStop (1);
Symbol 1933 MovieClip Frame 29
gotoAndStop (1);
Symbol 1933 MovieClip Frame 39
gotoAndStop (1);
Symbol 1933 MovieClip Frame 49
gotoAndStop (1);
Symbol 1933 MovieClip Frame 59
gotoAndStop (1);
Symbol 1933 MovieClip Frame 69
gotoAndStop (1);
Symbol 1936 MovieClip Frame 1
stop();
Symbol 1961 MovieClip Frame 1
stop();
Symbol 1969 MovieClip Frame 1
stop();
Symbol 1975 MovieClip Frame 1
stop();