[Tools][Expand/Collapse All]Note that automatic extraction of ActionScript 3 is still pretty much unsupported by swfchan. AS1/AS2 works okay most of the time.Frame 1 (370 B)
var debug = false;
var gameID = 221;
var gameName = "gringo_bandido";
stop();
fscommand ("showmenu", "false");
prel.onEnterFrame = function () {
prel.procent.text = Math.floor((_root.getBytesLoaded() / _root.getBytesTotal()) * 100);
prel.gotoAndStop(prel.procent.text);
if (Number(prel.procent.text) > 99) {
play();
delete this.onEnterFrame;
}
};
Frame 2 (8 B)
stop();
Frame 3 (39 B)
if (!okToPlay) {
gotoAndStop (2);
}
Frame 4 (355 B)
stop();
Mouse.show();
var score = 0;
var stageChoose = 1;
fgfyw_btn.onRelease = function () {
getURL ("http://www.freegamesforyourwebsite.com/?" + _root.gameName, "_blank");
};
play_btn.onRelease = (howToPlay_btn.onRelease = function () {
gotoAndStop ("howToPlay");
});
highScore_btn.onRelease = function () {
gotoAndStop ("highScore");
};
Instance of Symbol 289 MovieClip in Frame 4 (89 B)
on (release) {
getURL ("http://www.freeonlinegames.com/?" + _root.gameName, "_blank");
}
Frame 8 (191 B)
stop();
Mouse.show();
var score = 0;
var stageChoose = 1;
back_btn.onRelease = function () {
gotoAndStop ("title");
};
play_btn.onRelease = function () {
gotoAndStop ("story");
};
Frame 13 (73 B)
stop();
back_btn.onRelease = function () {
gotoAndStop ("title");
};
Instance of Symbol 407 MovieClip [TMP6pbk6uzm9i] in Frame 13 (65 B)
//component parameters
onClipEvent (construct) {
gameID = 221;
}
Frame 18 (607 B)
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 +3);
};
Frame 23 (205 B)
stop();
play_btn.onRelease = function () {
bounty = 10;
enemyMoveSpeed = 1;
stageChoose = 1;
gotoAndStop ("gameScreen1");
};
back_btn.onRelease = function () {
gotoAndStop ("townSelect");
};
Frame 28 (208 B)
stop();
back_btn.onRelease = function () {
gotoAndStop ("townSelect");
};
play_btn.onRelease = function () {
bounty = 10;
enemyMoveSpeed = 1.25;
stageChoose = 2;
gotoAndStop ("gameScreen2");
};
Frame 33 (207 B)
stop();
back_btn.onRelease = function () {
gotoAndStop ("townSelect");
};
play_btn.onRelease = function () {
bounty = 10;
enemyMoveSpeed = 1.5;
stageChoose = 3;
gotoAndStop ("gameScreen3");
};
Frame 38 (208 B)
stop();
back_btn.onRelease = function () {
gotoAndStop ("townSelect");
};
play_btn.onRelease = function () {
bounty = 10;
enemyMoveSpeed = 1.75;
stageChoose = 4;
gotoAndStop ("gameScreen4");
};
Frame 43 (205 B)
stop();
back_btn.onRelease = function () {
gotoAndStop ("townSelect");
};
play_btn.onRelease = function () {
bounty = 10;
enemyMoveSpeed = 2;
stageChoose = 5;
gotoAndStop ("gameScreen5");
};
Frame 48 (82 B)
stop();
continue_btn.onRelease = function () {
gotoAndStop ("townSelect");
};
Frame 53 (82 B)
stop();
continue_btn.onRelease = function () {
gotoAndStop ("townSelect");
};
Frame 58 (82 B)
stop();
continue_btn.onRelease = function () {
gotoAndStop ("townSelect");
};
Frame 63 (158 B)
stop();
Mouse.show();
back_btn.onRelease = function () {
gotoAndStop ("title");
};
play_btn.onRelease = function () {
gotoAndStop ("townSelect");
};
Frame 68 (27.25 KiB) ● ● ●
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 + 20;
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 + 20;
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 + 20;
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 - 25;
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 <= 19) {
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 > 365)) {
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();
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 < 10) {
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");
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() {
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);
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 <= 19) {
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);
}
function initItems() {
i = 1;
while (i <= 4) {
stats_mc["item_mc" + i]._alpha = 10;
stats_mc["item_box" + i]._visible = false;
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 = 10;
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 () {
this._parent._visible = false;
pause_mc._visible = true;
};
pause_mc.continue_btn.onRelease = function () {
this._parent._visible = false;
pause_btn._visible = true;
};
Frame 72 (27.3 KiB) ● ● ●
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 + 20;
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 + 20;
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 + 20;
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 - 25;
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 <= 19) {
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 > 365)) {
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();
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 < 10) {
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");
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);
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 <= 19) {
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);
}
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 = 10;
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 77 (27.29 KiB) ● ● ●
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 + 20;
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 + 20;
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 + 20;
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 - 25;
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 <= 19) {
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 > 365)) {
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();
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 < 10) {
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");
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);
target_mc.removeMovieClip();
Mouse.show();
pause_btn._visible = false;
pause_mc._visible = false;
Key.removeListener(keyListener);
}
function goBack() {
removeObjects();
stopAllSounds();
gotoAndStop ("weapon3");
}
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 <= 19) {
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);
}
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 = 10;
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 82 (27.47 KiB) ● ● ●
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 + 20;
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 + 20;
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 + 20;
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 - 25;
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 <= 19) {
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 > 365)) {
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();
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 < 10) {
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");
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);
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 <= 19) {
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);
}
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 = 10;
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 87 (27.87 KiB) ● ● ●
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 + 20;
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 + 20;
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 + 20;
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 - 25;
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 <= 19) {
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 > 365)) {
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();
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 < 10) {
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");
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);
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();
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 <= 19) {
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);
}
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 = 10;
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;
};
pause_mc.playmore_btn.onRelease = function () {
getURL ("http://www.freeonlinegames.com/?" + _root.gameName, "_blank");
};
Frame 92 (200 B)
stop();
score_txt.text = score;
submitScore.Score = score;
back_btn.onRelease = function () {
getURL ("http://www.freeonlinegames.com/?" + _root.gameName, "_blank");
gotoAndStop ("title");
};
Instance of Symbol 1934 MovieClip [TMPd4lzhusf84] "submitScore" in Frame 92 (86 B)
//component parameters
onClipEvent (construct) {
btnMC = "submitMe";
gameID = 221;
}
Symbol 83 MovieClip Frame 1 (62 B)
stop();
var tagctr = (random(55) + 1);
gotoAndStop(tagctr);
Symbol 84 MovieClip Frame 105 (8 B)
stop();
Symbol 88 MovieClip Frame 1 (649 B)
_root.earl223 = function (val) {
var _local3 = new Array("_", "Z", "y", "x", "W", "v", "u", "T", "s", "r", "Q", "P", "O", "n", "m", "L", "K", "j", "i", "H", "g", "F", "e", "d", "C", "B", "a");
var _local2 = "";
val1 = 0;
while (val1 < val.length) {
if (val.substr(val1, 1) == ":") {
_local2 = _local2 + ":";
} else if (Number(val.substr(val1, 2)) > 26) {
_local2 = _local2 + _local3[Number(val.substr(val1, 1))];
} else if (Number(val.substr(val1, 1)) == 0) {
_local2 = _local2 + "_";
} else {
_local2 = _local2 + _local3[Number(val.substr(val1, 2))];
val1++;
}
val1++;
}
return(_local2);
};
Symbol 95 MovieClip Frame 1 (8 B)
stop();
Symbol 102 Button (89 B)
on (release) {
getURL ("http://www.freeonlinegames.com/?" + _root.gameName, "_blank");
}
Instance of Symbol 110 MovieClip "mcNotice" in Symbol 147 MovieClip Frame 1 (42 B)
onClipEvent (load) {
_visible = false;
}
Symbol 147 MovieClip Frame 120 (290 B)
stop();
if ((_url.indexOf("freeonlinegames.com") >= 0) && (_url.indexOf("file:") == -1)) {
_root.okToPlay = true;
_root.play();
} else if (_root.debug) {
_root.okToPlay = true;
_root.play();
} else {
_root.mcTaglines._visible = false;
mcNotice._visible = true;
}
Symbol 148 MovieClip Frame 71 (182 B)
stop();
var fogsound = new Sound();
fogsound.onSoundComplete = function () {
_root.okToPlay = true;
_root.play();
};
fogsound.attachSound("fogaudio");
fogsound.start(0, 1);
Symbol 152 MovieClip Frame 1 (8 B)
stop();
Symbol 189 MovieClip [molotov_mc] Frame 1 (8 B)
stop();
Symbol 216 MovieClip [explode_mc] Frame 1 (8 B)
stop();
Symbol 216 MovieClip [explode_mc] Frame 2 (22 B)
_parent.bg_mc.play();
Symbol 216 MovieClip [explode_mc] Frame 15 (1 B)
Symbol 389 Button (73 B)
on (press) {
sboard.dir = "up";
}
on (release) {
sboard.dir = "stop";
}
Symbol 390 Button (75 B)
on (press) {
sboard.dir = "down";
}
on (release) {
sboard.dir = "stop";
}
Symbol 397 MovieClip Frame 1 (8 B)
stop();
Symbol 397 MovieClip Frame 2 (8 B)
stop();
Symbol 407 MovieClip [TMP6pbk6uzm9i] Frame 1 (1.88 KiB) ●
var arrScore = new Array();
mcScoreboard.sboard.dir = "stop";
mcScoreboard.sboard.mcScoreHolder.mcScore._visible = false;
mcLabel._visible = false;
var main = this;
xmlPlayer = new XML();
xmlPlayer.ignoreWhite = true;
xmlPlayer.onLoad = function (success) {
if (success) {
myPlayer = xmlPlayer.firstChild.childNodes;
ctr2 = 0;
while (ctr2 < myPlayer.length) {
thisPlayer = main.mcScoreboard.sboard.mcScoreHolder.mcScore.duplicateMovieClip("mcScore" + ctr2, ctr2);
thisPlayer._y = ctr2 * thisPlayer._height;
thisPlayer._visible = true;
if ((ctr2 % 2) > 0) {
thisPlayer.gotoAndStop(2);
}
thisPlayer.txtNumber.text = (ctr2 + 1) + ")";
thisPlayer.txtNickname.text = myPlayer[ctr2].attributes.player;
thisPlayer.txtScore.text = myPlayer[ctr2].attributes.score;
ctr2++;
}
main.mcScoreboard.mcLoading._visible = false;
main.mcScoreboard.sboard.mcScoreHolder.item = myPlayer.length;
main.mcScoreboard.sboard.mcScoreHolder.speedy = 0;
main.mcScoreboard.sboard.mcScoreHolder.desty = 0;
main.mcScoreboard.sboard.mcScoreHolder.onEnterFrame = function () {
if ((this.desty < 0) && (this._parent.dir == "up")) {
this.desty = this.desty + 10;
if (this.desty > 0) {
this.desty = 0;
}
}
if ((this.desty > (this._parent.mcBlock._height - (this.mcScore._height * this.item))) && (this._parent.dir == "down")) {
this.desty = this.desty - 10;
if (this.desty < (this._parent.mcBlock._height - (this.mcScore._height * this.item))) {
this.desty = this._parent.mcBlock._height - (this.mcScore._height * this.item);
}
}
this.speedy = (this.desty - this._y) + (this.speedy * 0.4);
this._y = this._y + this.speedy;
};
}
};
xmlPlayer.load(((("http://www.freeonlinegames.com/scoreboard/getTopPlayer.php?id=" + gameID) + "&rand=") + random(999999)) + "&filt=1");
Symbol 789 MovieClip Frame 10 (8 B)
stop();
Symbol 809 MovieClip Frame 30 (8 B)
stop();
Symbol 810 Button (45 B)
on (release) {
gotoAndStop ("townSelect");
}
Symbol 811 Button (99 B)
on (release) {
bounty = 10;
enemyMoveSpeed = 1;
stageChoose = 1;
gotoAndStop ("gameScreen1");
}
Symbol 817 MovieClip Frame 30 (8 B)
stop();
Symbol 818 Button (102 B)
on (release) {
bounty = 10;
enemyMoveSpeed = 1.25;
stageChoose = 2;
gotoAndStop ("gameScreen2");
}
Symbol 824 MovieClip Frame 30 (8 B)
stop();
Symbol 825 Button (101 B)
on (release) {
bounty = 10;
enemyMoveSpeed = 1.5;
stageChoose = 3;
gotoAndStop ("gameScreen3");
}
Symbol 831 MovieClip Frame 30 (8 B)
stop();
Symbol 832 Button (102 B)
on (release) {
bounty = 10;
enemyMoveSpeed = 1.75;
stageChoose = 4;
gotoAndStop ("gameScreen4");
}
Symbol 838 MovieClip Frame 30 (8 B)
stop();
Symbol 839 Button (99 B)
on (release) {
bounty = 10;
enemyMoveSpeed = 2;
stageChoose = 5;
gotoAndStop ("gameScreen5");
}
Symbol 880 MovieClip Frame 1 (8 B)
stop();
Symbol 902 MovieClip Frame 1 (1 B)
Symbol 902 MovieClip Frame 181 (33 B)
stop();
this.removeMovieClip();
Symbol 929 MovieClip Frame 1 (8 B)
stop();
Symbol 929 MovieClip Frame 2 (22 B)
_parent.bg_mc.play();
Symbol 929 MovieClip Frame 15 (24 B)
this.removeMovieClip();
Symbol 941 MovieClip Frame 1 (1 B)
Symbol 941 MovieClip Frame 181 (33 B)
stop();
this.removeMovieClip();
Symbol 944 MovieClip Frame 1 (8 B)
stop();
Symbol 970 MovieClip Frame 1 (8 B)
stop();
Symbol 970 MovieClip Frame 2 (8 B)
stop();
Symbol 970 MovieClip Frame 3 (8 B)
stop();
Symbol 970 MovieClip Frame 4 (8 B)
stop();
Symbol 970 MovieClip Frame 5 (8 B)
stop();
Symbol 970 MovieClip Frame 6 (8 B)
stop();
Symbol 970 MovieClip Frame 7 (8 B)
stop();
Symbol 970 MovieClip Frame 8 (8 B)
stop();
Symbol 970 MovieClip Frame 9 (8 B)
stop();
Symbol 970 MovieClip Frame 10 (8 B)
stop();
Symbol 970 MovieClip Frame 11 (8 B)
stop();
Symbol 970 MovieClip Frame 12 (8 B)
stop();
Symbol 993 MovieClip Frame 1 (8 B)
stop();
Symbol 993 MovieClip Frame 2 (8 B)
stop();
Symbol 993 MovieClip Frame 3 (8 B)
stop();
Symbol 993 MovieClip Frame 4 (8 B)
stop();
Symbol 993 MovieClip Frame 5 (8 B)
stop();
Symbol 993 MovieClip Frame 6 (8 B)
stop();
Symbol 993 MovieClip Frame 7 (8 B)
stop();
Symbol 993 MovieClip Frame 8 (8 B)
stop();
Symbol 993 MovieClip Frame 9 (8 B)
stop();
Symbol 993 MovieClip Frame 10 (8 B)
stop();
Symbol 993 MovieClip Frame 11 (8 B)
stop();
Symbol 993 MovieClip Frame 12 (8 B)
stop();
Symbol 1016 MovieClip Frame 1 (8 B)
stop();
Symbol 1016 MovieClip Frame 2 (8 B)
stop();
Symbol 1016 MovieClip Frame 3 (8 B)
stop();
Symbol 1016 MovieClip Frame 4 (8 B)
stop();
Symbol 1016 MovieClip Frame 5 (8 B)
stop();
Symbol 1016 MovieClip Frame 6 (8 B)
stop();
Symbol 1016 MovieClip Frame 7 (8 B)
stop();
Symbol 1016 MovieClip Frame 8 (8 B)
stop();
Symbol 1016 MovieClip Frame 9 (8 B)
stop();
Symbol 1016 MovieClip Frame 10 (8 B)
stop();
Symbol 1016 MovieClip Frame 11 (8 B)
stop();
Symbol 1016 MovieClip Frame 12 (8 B)
stop();
Symbol 1039 MovieClip Frame 1 (8 B)
stop();
Symbol 1039 MovieClip Frame 2 (8 B)
stop();
Symbol 1039 MovieClip Frame 3 (8 B)
stop();
Symbol 1039 MovieClip Frame 4 (8 B)
stop();
Symbol 1039 MovieClip Frame 5 (8 B)
stop();
Symbol 1039 MovieClip Frame 6 (8 B)
stop();
Symbol 1039 MovieClip Frame 7 (8 B)
stop();
Symbol 1039 MovieClip Frame 8 (8 B)
stop();
Symbol 1039 MovieClip Frame 9 (8 B)
stop();
Symbol 1039 MovieClip Frame 10 (8 B)
stop();
Symbol 1039 MovieClip Frame 11 (8 B)
stop();
Symbol 1039 MovieClip Frame 12 (8 B)
stop();
Symbol 1062 MovieClip Frame 1 (8 B)
stop();
Symbol 1062 MovieClip Frame 2 (8 B)
stop();
Symbol 1062 MovieClip Frame 3 (8 B)
stop();
Symbol 1062 MovieClip Frame 4 (8 B)
stop();
Symbol 1062 MovieClip Frame 5 (8 B)
stop();
Symbol 1062 MovieClip Frame 6 (8 B)
stop();
Symbol 1062 MovieClip Frame 7 (8 B)
stop();
Symbol 1062 MovieClip Frame 8 (8 B)
stop();
Symbol 1062 MovieClip Frame 9 (8 B)
stop();
Symbol 1062 MovieClip Frame 10 (8 B)
stop();
Symbol 1062 MovieClip Frame 11 (8 B)
stop();
Symbol 1062 MovieClip Frame 12 (8 B)
stop();
Symbol 1063 MovieClip Frame 1 (8 B)
stop();
Symbol 1063 MovieClip Frame 10 (8 B)
stop();
Symbol 1063 MovieClip Frame 20 (8 B)
stop();
Symbol 1063 MovieClip Frame 30 (8 B)
stop();
Symbol 1063 MovieClip Frame 40 (8 B)
stop();
Symbol 1086 MovieClip Frame 1 (8 B)
stop();
Symbol 1086 MovieClip Frame 2 (8 B)
stop();
Symbol 1086 MovieClip Frame 3 (8 B)
stop();
Symbol 1086 MovieClip Frame 4 (8 B)
stop();
Symbol 1086 MovieClip Frame 5 (8 B)
stop();
Symbol 1086 MovieClip Frame 6 (8 B)
stop();
Symbol 1086 MovieClip Frame 7 (8 B)
stop();
Symbol 1086 MovieClip Frame 8 (8 B)
stop();
Symbol 1086 MovieClip Frame 9 (8 B)
stop();
Symbol 1086 MovieClip Frame 10 (8 B)
stop();
Symbol 1086 MovieClip Frame 11 (8 B)
stop();
Symbol 1086 MovieClip Frame 12 (8 B)
stop();
Symbol 1109 MovieClip Frame 1 (8 B)
stop();
Symbol 1109 MovieClip Frame 2 (8 B)
stop();
Symbol 1109 MovieClip Frame 3 (8 B)
stop();
Symbol 1109 MovieClip Frame 4 (8 B)
stop();
Symbol 1109 MovieClip Frame 5 (8 B)
stop();
Symbol 1109 MovieClip Frame 6 (8 B)
stop();
Symbol 1109 MovieClip Frame 7 (8 B)
stop();
Symbol 1109 MovieClip Frame 8 (8 B)
stop();
Symbol 1109 MovieClip Frame 9 (8 B)
stop();
Symbol 1109 MovieClip Frame 10 (8 B)
stop();
Symbol 1109 MovieClip Frame 11 (8 B)
stop();
Symbol 1109 MovieClip Frame 12 (8 B)
stop();
Symbol 1132 MovieClip Frame 1 (8 B)
stop();
Symbol 1132 MovieClip Frame 2 (8 B)
stop();
Symbol 1132 MovieClip Frame 3 (8 B)
stop();
Symbol 1132 MovieClip Frame 4 (8 B)
stop();
Symbol 1132 MovieClip Frame 5 (8 B)
stop();
Symbol 1132 MovieClip Frame 6 (8 B)
stop();
Symbol 1132 MovieClip Frame 7 (8 B)
stop();
Symbol 1132 MovieClip Frame 8 (8 B)
stop();
Symbol 1132 MovieClip Frame 9 (8 B)
stop();
Symbol 1132 MovieClip Frame 10 (8 B)
stop();
Symbol 1132 MovieClip Frame 11 (8 B)
stop();
Symbol 1132 MovieClip Frame 12 (8 B)
stop();
Symbol 1155 MovieClip Frame 1 (8 B)
stop();
Symbol 1155 MovieClip Frame 2 (8 B)
stop();
Symbol 1155 MovieClip Frame 3 (8 B)
stop();
Symbol 1155 MovieClip Frame 4 (8 B)
stop();
Symbol 1155 MovieClip Frame 5 (8 B)
stop();
Symbol 1155 MovieClip Frame 6 (8 B)
stop();
Symbol 1155 MovieClip Frame 7 (8 B)
stop();
Symbol 1155 MovieClip Frame 8 (8 B)
stop();
Symbol 1155 MovieClip Frame 9 (8 B)
stop();
Symbol 1155 MovieClip Frame 10 (8 B)
stop();
Symbol 1155 MovieClip Frame 11 (8 B)
stop();
Symbol 1155 MovieClip Frame 12 (8 B)
stop();
Symbol 1178 MovieClip Frame 1 (8 B)
stop();
Symbol 1178 MovieClip Frame 2 (8 B)
stop();
Symbol 1178 MovieClip Frame 3 (8 B)
stop();
Symbol 1178 MovieClip Frame 4 (8 B)
stop();
Symbol 1178 MovieClip Frame 5 (8 B)
stop();
Symbol 1178 MovieClip Frame 6 (8 B)
stop();
Symbol 1178 MovieClip Frame 7 (8 B)
stop();
Symbol 1178 MovieClip Frame 8 (8 B)
stop();
Symbol 1178 MovieClip Frame 9 (8 B)
stop();
Symbol 1178 MovieClip Frame 10 (8 B)
stop();
Symbol 1178 MovieClip Frame 11 (8 B)
stop();
Symbol 1178 MovieClip Frame 12 (8 B)
stop();
Symbol 1179 MovieClip Frame 1 (8 B)
stop();
Symbol 1179 MovieClip Frame 10 (8 B)
stop();
Symbol 1179 MovieClip Frame 20 (8 B)
stop();
Symbol 1179 MovieClip Frame 30 (8 B)
stop();
Symbol 1179 MovieClip Frame 40 (8 B)
stop();
Symbol 1206 MovieClip Frame 1 (8 B)
stop();
Symbol 1206 MovieClip Frame 2 (8 B)
stop();
Symbol 1206 MovieClip Frame 3 (8 B)
stop();
Symbol 1206 MovieClip Frame 4 (8 B)
stop();
Symbol 1206 MovieClip Frame 5 (8 B)
stop();
Symbol 1206 MovieClip Frame 6 (8 B)
stop();
Symbol 1206 MovieClip Frame 7 (8 B)
stop();
Symbol 1206 MovieClip Frame 8 (8 B)
stop();
Symbol 1206 MovieClip Frame 9 (8 B)
stop();
Symbol 1206 MovieClip Frame 10 (8 B)
stop();
Symbol 1206 MovieClip Frame 11 (8 B)
stop();
Symbol 1206 MovieClip Frame 12 (8 B)
stop();
Symbol 1229 MovieClip Frame 1 (8 B)
stop();
Symbol 1229 MovieClip Frame 2 (8 B)
stop();
Symbol 1229 MovieClip Frame 3 (8 B)
stop();
Symbol 1229 MovieClip Frame 4 (8 B)
stop();
Symbol 1229 MovieClip Frame 5 (8 B)
stop();
Symbol 1229 MovieClip Frame 6 (8 B)
stop();
Symbol 1229 MovieClip Frame 7 (8 B)
stop();
Symbol 1229 MovieClip Frame 8 (8 B)
stop();
Symbol 1229 MovieClip Frame 9 (8 B)
stop();
Symbol 1229 MovieClip Frame 10 (8 B)
stop();
Symbol 1229 MovieClip Frame 11 (8 B)
stop();
Symbol 1229 MovieClip Frame 12 (8 B)
stop();
Symbol 1252 MovieClip Frame 1 (8 B)
stop();
Symbol 1252 MovieClip Frame 2 (8 B)
stop();
Symbol 1252 MovieClip Frame 3 (8 B)
stop();
Symbol 1252 MovieClip Frame 4 (8 B)
stop();
Symbol 1252 MovieClip Frame 5 (8 B)
stop();
Symbol 1252 MovieClip Frame 6 (8 B)
stop();
Symbol 1252 MovieClip Frame 7 (8 B)
stop();
Symbol 1252 MovieClip Frame 8 (8 B)
stop();
Symbol 1252 MovieClip Frame 9 (8 B)
stop();
Symbol 1252 MovieClip Frame 10 (8 B)
stop();
Symbol 1252 MovieClip Frame 11 (8 B)
stop();
Symbol 1252 MovieClip Frame 12 (8 B)
stop();
Symbol 1275 MovieClip Frame 1 (8 B)
stop();
Symbol 1275 MovieClip Frame 2 (8 B)
stop();
Symbol 1275 MovieClip Frame 3 (8 B)
stop();
Symbol 1275 MovieClip Frame 4 (8 B)
stop();
Symbol 1275 MovieClip Frame 5 (8 B)
stop();
Symbol 1275 MovieClip Frame 6 (8 B)
stop();
Symbol 1275 MovieClip Frame 7 (8 B)
stop();
Symbol 1275 MovieClip Frame 8 (8 B)
stop();
Symbol 1275 MovieClip Frame 9 (8 B)
stop();
Symbol 1275 MovieClip Frame 10 (8 B)
stop();
Symbol 1275 MovieClip Frame 11 (8 B)
stop();
Symbol 1275 MovieClip Frame 12 (8 B)
stop();
Symbol 1296 MovieClip Frame 1 (8 B)
stop();
Symbol 1296 MovieClip Frame 2 (8 B)
stop();
Symbol 1296 MovieClip Frame 3 (8 B)
stop();
Symbol 1296 MovieClip Frame 4 (8 B)
stop();
Symbol 1296 MovieClip Frame 5 (8 B)
stop();
Symbol 1296 MovieClip Frame 6 (8 B)
stop();
Symbol 1296 MovieClip Frame 7 (8 B)
stop();
Symbol 1296 MovieClip Frame 8 (8 B)
stop();
Symbol 1296 MovieClip Frame 9 (8 B)
stop();
Symbol 1296 MovieClip Frame 10 (8 B)
stop();
Symbol 1296 MovieClip Frame 11 (8 B)
stop();
Symbol 1296 MovieClip Frame 12 (8 B)
stop();
Symbol 1297 MovieClip Frame 1 (8 B)
stop();
Symbol 1297 MovieClip Frame 10 (8 B)
stop();
Symbol 1297 MovieClip Frame 20 (8 B)
stop();
Symbol 1297 MovieClip Frame 30 (8 B)
stop();
Symbol 1297 MovieClip Frame 40 (8 B)
stop();
Symbol 1320 MovieClip Frame 1 (8 B)
stop();
Symbol 1320 MovieClip Frame 2 (8 B)
stop();
Symbol 1320 MovieClip Frame 3 (8 B)
stop();
Symbol 1320 MovieClip Frame 4 (8 B)
stop();
Symbol 1320 MovieClip Frame 5 (8 B)
stop();
Symbol 1320 MovieClip Frame 6 (8 B)
stop();
Symbol 1320 MovieClip Frame 7 (8 B)
stop();
Symbol 1320 MovieClip Frame 8 (8 B)
stop();
Symbol 1320 MovieClip Frame 9 (8 B)
stop();
Symbol 1320 MovieClip Frame 10 (8 B)
stop();
Symbol 1320 MovieClip Frame 11 (8 B)
stop();
Symbol 1320 MovieClip Frame 12 (8 B)
stop();
Symbol 1343 MovieClip Frame 1 (8 B)
stop();
Symbol 1343 MovieClip Frame 2 (8 B)
stop();
Symbol 1343 MovieClip Frame 3 (8 B)
stop();
Symbol 1343 MovieClip Frame 4 (8 B)
stop();
Symbol 1343 MovieClip Frame 5 (8 B)
stop();
Symbol 1343 MovieClip Frame 6 (8 B)
stop();
Symbol 1343 MovieClip Frame 7 (8 B)
stop();
Symbol 1343 MovieClip Frame 8 (8 B)
stop();
Symbol 1343 MovieClip Frame 9 (8 B)
stop();
Symbol 1343 MovieClip Frame 10 (8 B)
stop();
Symbol 1343 MovieClip Frame 11 (8 B)
stop();
Symbol 1343 MovieClip Frame 12 (8 B)
stop();
Symbol 1366 MovieClip Frame 1 (8 B)
stop();
Symbol 1366 MovieClip Frame 2 (8 B)
stop();
Symbol 1366 MovieClip Frame 3 (8 B)
stop();
Symbol 1366 MovieClip Frame 4 (8 B)
stop();
Symbol 1366 MovieClip Frame 5 (8 B)
stop();
Symbol 1366 MovieClip Frame 6 (8 B)
stop();
Symbol 1366 MovieClip Frame 7 (8 B)
stop();
Symbol 1366 MovieClip Frame 8 (8 B)
stop();
Symbol 1366 MovieClip Frame 9 (8 B)
stop();
Symbol 1366 MovieClip Frame 10 (8 B)
stop();
Symbol 1366 MovieClip Frame 11 (8 B)
stop();
Symbol 1366 MovieClip Frame 12 (8 B)
stop();
Symbol 1389 MovieClip Frame 1 (8 B)
stop();
Symbol 1389 MovieClip Frame 2 (8 B)
stop();
Symbol 1389 MovieClip Frame 3 (8 B)
stop();
Symbol 1389 MovieClip Frame 4 (8 B)
stop();
Symbol 1389 MovieClip Frame 5 (8 B)
stop();
Symbol 1389 MovieClip Frame 6 (8 B)
stop();
Symbol 1389 MovieClip Frame 7 (8 B)
stop();
Symbol 1389 MovieClip Frame 8 (8 B)
stop();
Symbol 1389 MovieClip Frame 9 (8 B)
stop();
Symbol 1389 MovieClip Frame 10 (8 B)
stop();
Symbol 1389 MovieClip Frame 11 (8 B)
stop();
Symbol 1389 MovieClip Frame 12 (8 B)
stop();
Symbol 1412 MovieClip Frame 1 (8 B)
stop();
Symbol 1412 MovieClip Frame 2 (8 B)
stop();
Symbol 1412 MovieClip Frame 3 (8 B)
stop();
Symbol 1412 MovieClip Frame 4 (8 B)
stop();
Symbol 1412 MovieClip Frame 5 (8 B)
stop();
Symbol 1412 MovieClip Frame 6 (8 B)
stop();
Symbol 1412 MovieClip Frame 7 (8 B)
stop();
Symbol 1412 MovieClip Frame 8 (8 B)
stop();
Symbol 1412 MovieClip Frame 9 (8 B)
stop();
Symbol 1412 MovieClip Frame 10 (8 B)
stop();
Symbol 1412 MovieClip Frame 11 (8 B)
stop();
Symbol 1412 MovieClip Frame 12 (8 B)
stop();
Symbol 1413 MovieClip Frame 1 (8 B)
stop();
Symbol 1413 MovieClip Frame 10 (8 B)
stop();
Symbol 1413 MovieClip Frame 20 (8 B)
stop();
Symbol 1413 MovieClip Frame 30 (8 B)
stop();
Symbol 1413 MovieClip Frame 40 (8 B)
stop();
Symbol 1436 MovieClip Frame 1 (8 B)
stop();
Symbol 1436 MovieClip Frame 2 (8 B)
stop();
Symbol 1436 MovieClip Frame 3 (8 B)
stop();
Symbol 1436 MovieClip Frame 4 (8 B)
stop();
Symbol 1436 MovieClip Frame 5 (8 B)
stop();
Symbol 1436 MovieClip Frame 6 (8 B)
stop();
Symbol 1436 MovieClip Frame 7 (8 B)
stop();
Symbol 1436 MovieClip Frame 8 (8 B)
stop();
Symbol 1436 MovieClip Frame 9 (8 B)
stop();
Symbol 1436 MovieClip Frame 10 (8 B)
stop();
Symbol 1436 MovieClip Frame 11 (8 B)
stop();
Symbol 1436 MovieClip Frame 12 (8 B)
stop();
Symbol 1459 MovieClip Frame 1 (8 B)
stop();
Symbol 1459 MovieClip Frame 2 (8 B)
stop();
Symbol 1459 MovieClip Frame 3 (8 B)
stop();
Symbol 1459 MovieClip Frame 4 (8 B)
stop();
Symbol 1459 MovieClip Frame 5 (8 B)
stop();
Symbol 1459 MovieClip Frame 6 (8 B)
stop();
Symbol 1459 MovieClip Frame 7 (8 B)
stop();
Symbol 1459 MovieClip Frame 8 (8 B)
stop();
Symbol 1459 MovieClip Frame 9 (8 B)
stop();
Symbol 1459 MovieClip Frame 10 (8 B)
stop();
Symbol 1459 MovieClip Frame 11 (8 B)
stop();
Symbol 1459 MovieClip Frame 12 (8 B)
stop();
Symbol 1482 MovieClip Frame 1 (8 B)
stop();
Symbol 1482 MovieClip Frame 2 (8 B)
stop();
Symbol 1482 MovieClip Frame 3 (8 B)
stop();
Symbol 1482 MovieClip Frame 4 (8 B)
stop();
Symbol 1482 MovieClip Frame 5 (8 B)
stop();
Symbol 1482 MovieClip Frame 6 (8 B)
stop();
Symbol 1482 MovieClip Frame 7 (8 B)
stop();
Symbol 1482 MovieClip Frame 8 (8 B)
stop();
Symbol 1482 MovieClip Frame 9 (8 B)
stop();
Symbol 1482 MovieClip Frame 10 (8 B)
stop();
Symbol 1482 MovieClip Frame 11 (8 B)
stop();
Symbol 1482 MovieClip Frame 12 (8 B)
stop();
Symbol 1505 MovieClip Frame 1 (8 B)
stop();
Symbol 1505 MovieClip Frame 2 (8 B)
stop();
Symbol 1505 MovieClip Frame 3 (8 B)
stop();
Symbol 1505 MovieClip Frame 4 (8 B)
stop();
Symbol 1505 MovieClip Frame 5 (8 B)
stop();
Symbol 1505 MovieClip Frame 6 (8 B)
stop();
Symbol 1505 MovieClip Frame 7 (8 B)
stop();
Symbol 1505 MovieClip Frame 8 (8 B)
stop();
Symbol 1505 MovieClip Frame 9 (8 B)
stop();
Symbol 1505 MovieClip Frame 10 (8 B)
stop();
Symbol 1505 MovieClip Frame 11 (8 B)
stop();
Symbol 1505 MovieClip Frame 12 (8 B)
stop();
Symbol 1528 MovieClip Frame 1 (8 B)
stop();
Symbol 1528 MovieClip Frame 2 (8 B)
stop();
Symbol 1528 MovieClip Frame 3 (8 B)
stop();
Symbol 1528 MovieClip Frame 4 (8 B)
stop();
Symbol 1528 MovieClip Frame 5 (8 B)
stop();
Symbol 1528 MovieClip Frame 6 (8 B)
stop();
Symbol 1528 MovieClip Frame 7 (8 B)
stop();
Symbol 1528 MovieClip Frame 8 (8 B)
stop();
Symbol 1528 MovieClip Frame 9 (8 B)
stop();
Symbol 1528 MovieClip Frame 10 (8 B)
stop();
Symbol 1528 MovieClip Frame 11 (8 B)
stop();
Symbol 1528 MovieClip Frame 12 (8 B)
stop();
Symbol 1529 MovieClip Frame 1 (8 B)
stop();
Symbol 1529 MovieClip Frame 10 (8 B)
stop();
Symbol 1529 MovieClip Frame 20 (8 B)
stop();
Symbol 1529 MovieClip Frame 30 (8 B)
stop();
Symbol 1529 MovieClip Frame 40 (8 B)
stop();
Symbol 1552 MovieClip Frame 1 (8 B)
stop();
Symbol 1552 MovieClip Frame 2 (8 B)
stop();
Symbol 1552 MovieClip Frame 3 (8 B)
stop();
Symbol 1552 MovieClip Frame 4 (8 B)
stop();
Symbol 1552 MovieClip Frame 5 (8 B)
stop();
Symbol 1552 MovieClip Frame 6 (8 B)
stop();
Symbol 1552 MovieClip Frame 7 (8 B)
stop();
Symbol 1552 MovieClip Frame 8 (8 B)
stop();
Symbol 1552 MovieClip Frame 9 (8 B)
stop();
Symbol 1552 MovieClip Frame 10 (8 B)
stop();
Symbol 1552 MovieClip Frame 11 (8 B)
stop();
Symbol 1552 MovieClip Frame 12 (8 B)
stop();
Symbol 1575 MovieClip Frame 1 (8 B)
stop();
Symbol 1575 MovieClip Frame 2 (8 B)
stop();
Symbol 1575 MovieClip Frame 3 (8 B)
stop();
Symbol 1575 MovieClip Frame 4 (8 B)
stop();
Symbol 1575 MovieClip Frame 5 (8 B)
stop();
Symbol 1575 MovieClip Frame 6 (8 B)
stop();
Symbol 1575 MovieClip Frame 7 (8 B)
stop();
Symbol 1575 MovieClip Frame 8 (8 B)
stop();
Symbol 1575 MovieClip Frame 9 (8 B)
stop();
Symbol 1575 MovieClip Frame 10 (8 B)
stop();
Symbol 1575 MovieClip Frame 11 (8 B)
stop();
Symbol 1575 MovieClip Frame 12 (8 B)
stop();
Symbol 1598 MovieClip Frame 1 (8 B)
stop();
Symbol 1598 MovieClip Frame 2 (8 B)
stop();
Symbol 1598 MovieClip Frame 3 (8 B)
stop();
Symbol 1598 MovieClip Frame 4 (8 B)
stop();
Symbol 1598 MovieClip Frame 5 (8 B)
stop();
Symbol 1598 MovieClip Frame 6 (8 B)
stop();
Symbol 1598 MovieClip Frame 7 (8 B)
stop();
Symbol 1598 MovieClip Frame 8 (8 B)
stop();
Symbol 1598 MovieClip Frame 9 (8 B)
stop();
Symbol 1598 MovieClip Frame 10 (8 B)
stop();
Symbol 1598 MovieClip Frame 11 (8 B)
stop();
Symbol 1598 MovieClip Frame 12 (8 B)
stop();
Symbol 1621 MovieClip Frame 1 (8 B)
stop();
Symbol 1621 MovieClip Frame 2 (8 B)
stop();
Symbol 1621 MovieClip Frame 3 (8 B)
stop();
Symbol 1621 MovieClip Frame 4 (8 B)
stop();
Symbol 1621 MovieClip Frame 5 (8 B)
stop();
Symbol 1621 MovieClip Frame 6 (8 B)
stop();
Symbol 1621 MovieClip Frame 7 (8 B)
stop();
Symbol 1621 MovieClip Frame 8 (8 B)
stop();
Symbol 1621 MovieClip Frame 9 (8 B)
stop();
Symbol 1621 MovieClip Frame 10 (8 B)
stop();
Symbol 1621 MovieClip Frame 11 (8 B)
stop();
Symbol 1621 MovieClip Frame 12 (8 B)
stop();
Symbol 1644 MovieClip Frame 1 (8 B)
stop();
Symbol 1644 MovieClip Frame 2 (8 B)
stop();
Symbol 1644 MovieClip Frame 3 (8 B)
stop();
Symbol 1644 MovieClip Frame 4 (8 B)
stop();
Symbol 1644 MovieClip Frame 5 (8 B)
stop();
Symbol 1644 MovieClip Frame 6 (8 B)
stop();
Symbol 1644 MovieClip Frame 7 (8 B)
stop();
Symbol 1644 MovieClip Frame 8 (8 B)
stop();
Symbol 1644 MovieClip Frame 9 (8 B)
stop();
Symbol 1644 MovieClip Frame 10 (8 B)
stop();
Symbol 1644 MovieClip Frame 11 (8 B)
stop();
Symbol 1644 MovieClip Frame 12 (8 B)
stop();
Symbol 1645 MovieClip Frame 1 (8 B)
stop();
Symbol 1645 MovieClip Frame 10 (8 B)
stop();
Symbol 1645 MovieClip Frame 20 (8 B)
stop();
Symbol 1645 MovieClip Frame 30 (8 B)
stop();
Symbol 1645 MovieClip Frame 40 (8 B)
stop();
Symbol 1670 MovieClip Frame 1 (8 B)
stop();
Symbol 1670 MovieClip Frame 2 (8 B)
stop();
Symbol 1670 MovieClip Frame 3 (8 B)
stop();
Symbol 1670 MovieClip Frame 4 (8 B)
stop();
Symbol 1670 MovieClip Frame 5 (8 B)
stop();
Symbol 1670 MovieClip Frame 6 (8 B)
stop();
Symbol 1670 MovieClip Frame 7 (8 B)
stop();
Symbol 1670 MovieClip Frame 8 (8 B)
stop();
Symbol 1670 MovieClip Frame 9 (8 B)
stop();
Symbol 1670 MovieClip Frame 10 (8 B)
stop();
Symbol 1670 MovieClip Frame 11 (8 B)
stop();
Symbol 1670 MovieClip Frame 12 (8 B)
stop();
Symbol 1693 MovieClip Frame 1 (8 B)
stop();
Symbol 1693 MovieClip Frame 2 (8 B)
stop();
Symbol 1693 MovieClip Frame 3 (8 B)
stop();
Symbol 1693 MovieClip Frame 4 (8 B)
stop();
Symbol 1693 MovieClip Frame 5 (8 B)
stop();
Symbol 1693 MovieClip Frame 6 (8 B)
stop();
Symbol 1693 MovieClip Frame 7 (8 B)
stop();
Symbol 1693 MovieClip Frame 8 (8 B)
stop();
Symbol 1693 MovieClip Frame 9 (8 B)
stop();
Symbol 1693 MovieClip Frame 10 (8 B)
stop();
Symbol 1693 MovieClip Frame 11 (8 B)
stop();
Symbol 1693 MovieClip Frame 12 (8 B)
stop();
Symbol 1716 MovieClip Frame 1 (8 B)
stop();
Symbol 1716 MovieClip Frame 2 (8 B)
stop();
Symbol 1716 MovieClip Frame 3 (8 B)
stop();
Symbol 1716 MovieClip Frame 4 (8 B)
stop();
Symbol 1716 MovieClip Frame 5 (8 B)
stop();
Symbol 1716 MovieClip Frame 6 (8 B)
stop();
Symbol 1716 MovieClip Frame 7 (8 B)
stop();
Symbol 1716 MovieClip Frame 8 (8 B)
stop();
Symbol 1716 MovieClip Frame 9 (8 B)
stop();
Symbol 1716 MovieClip Frame 10 (8 B)
stop();
Symbol 1716 MovieClip Frame 11 (8 B)
stop();
Symbol 1716 MovieClip Frame 12 (8 B)
stop();
Symbol 1739 MovieClip Frame 1 (8 B)
stop();
Symbol 1739 MovieClip Frame 2 (8 B)
stop();
Symbol 1739 MovieClip Frame 3 (8 B)
stop();
Symbol 1739 MovieClip Frame 4 (8 B)
stop();
Symbol 1739 MovieClip Frame 5 (8 B)
stop();
Symbol 1739 MovieClip Frame 6 (8 B)
stop();
Symbol 1739 MovieClip Frame 7 (8 B)
stop();
Symbol 1739 MovieClip Frame 8 (8 B)
stop();
Symbol 1739 MovieClip Frame 9 (8 B)
stop();
Symbol 1739 MovieClip Frame 10 (8 B)
stop();
Symbol 1739 MovieClip Frame 11 (8 B)
stop();
Symbol 1739 MovieClip Frame 12 (8 B)
stop();
Symbol 1762 MovieClip Frame 1 (8 B)
stop();
Symbol 1762 MovieClip Frame 2 (8 B)
stop();
Symbol 1762 MovieClip Frame 3 (8 B)
stop();
Symbol 1762 MovieClip Frame 4 (8 B)
stop();
Symbol 1762 MovieClip Frame 5 (8 B)
stop();
Symbol 1762 MovieClip Frame 6 (8 B)
stop();
Symbol 1762 MovieClip Frame 7 (8 B)
stop();
Symbol 1762 MovieClip Frame 8 (8 B)
stop();
Symbol 1762 MovieClip Frame 9 (8 B)
stop();
Symbol 1762 MovieClip Frame 10 (8 B)
stop();
Symbol 1762 MovieClip Frame 11 (8 B)
stop();
Symbol 1762 MovieClip Frame 12 (8 B)
stop();
Symbol 1763 MovieClip Frame 1 (8 B)
stop();
Symbol 1763 MovieClip Frame 10 (8 B)
stop();
Symbol 1763 MovieClip Frame 20 (8 B)
stop();
Symbol 1763 MovieClip Frame 30 (8 B)
stop();
Symbol 1763 MovieClip Frame 40 (8 B)
stop();
Symbol 1794 MovieClip Frame 1 (8 B)
stop();
Symbol 1811 MovieClip Frame 1 (8 B)
stop();
Symbol 1811 MovieClip Frame 42 (8 B)
stop();
Symbol 1821 MovieClip Frame 1 (8 B)
stop();
Symbol 1821 MovieClip Frame 41 (117 B)
stop();
back_btn.onRelease = function () {
_parent.stageChoose = _parent.stageChoose + 1;
_parent.goBack();
};
Symbol 1825 MovieClip Frame 1 (8 B)
stop();
Symbol 1825 MovieClip Frame 41 (117 B)
stop();
back_btn.onRelease = function () {
_parent.stageChoose = _parent.stageChoose + 1;
_parent.goBack();
};
Symbol 1829 MovieClip Frame 1 (8 B)
stop();
Symbol 1829 MovieClip Frame 41 (117 B)
stop();
back_btn.onRelease = function () {
_parent.stageChoose = _parent.stageChoose + 1;
_parent.goBack();
};
Symbol 1833 MovieClip Frame 1 (8 B)
stop();
Symbol 1833 MovieClip Frame 41 (117 B)
stop();
back_btn.onRelease = function () {
_parent.stageChoose = _parent.stageChoose + 1;
_parent.goBack();
};
Symbol 1837 MovieClip Frame 1 (8 B)
stop();
Symbol 1837 MovieClip Frame 41 (116 B)
stop();
back_btn.onRelease = function () {
_parent.stageChoose = _parent.stageChoose + 1;
_parent.goEnd();
};
Symbol 1839 MovieClip Frame 1 (8 B)
stop();
Symbol 1839 MovieClip Frame 2 (8 B)
stop();
Symbol 1839 MovieClip Frame 3 (8 B)
stop();
Symbol 1839 MovieClip Frame 4 (8 B)
stop();
Symbol 1839 MovieClip Frame 5 (8 B)
stop();
Symbol 1846 MovieClip Frame 1 (8 B)
stop();
Symbol 1846 MovieClip Frame 31 (17 B)
charDead.play();
Symbol 1846 MovieClip Frame 32 (17 B)
charDead.play();
Symbol 1846 MovieClip Frame 33 (17 B)
charDead.play();
Symbol 1846 MovieClip Frame 34 (17 B)
charDead.play();
Symbol 1846 MovieClip Frame 45 (132 B)
stop();
quit_btn.onRelease = function () {
_parent.goQuit();
};
continue_btn.onRelease = function () {
_parent.goTown();
};
Symbol 1853 MovieClip Frame 1 (8 B)
stop();
Symbol 1853 MovieClip Frame 9 (17 B)
gotoAndStop (1);
Symbol 1853 MovieClip Frame 19 (17 B)
gotoAndStop (1);
Symbol 1853 MovieClip Frame 29 (17 B)
gotoAndStop (1);
Symbol 1853 MovieClip Frame 39 (17 B)
gotoAndStop (1);
Symbol 1853 MovieClip Frame 49 (17 B)
gotoAndStop (1);
Symbol 1853 MovieClip Frame 59 (17 B)
gotoAndStop (1);
Symbol 1853 MovieClip Frame 69 (17 B)
gotoAndStop (1);
Symbol 1856 MovieClip Frame 1 (8 B)
stop();
Symbol 1863 MovieClip Frame 1 (8 B)
stop();
Symbol 1882 MovieClip Frame 1 (8 B)
stop();
Symbol 1895 MovieClip Frame 1 (8 B)
stop();
Symbol 1911 MovieClip Frame 1 (8 B)
stop();
Symbol 1934 MovieClip [TMPd4lzhusf84] Frame 1 (1.18 KiB) ●
function earl223(val) {
var _local3 = new Array("_", "Z", "y", "x", "W", "v", "u", "T", "s", "r", "Q", "P", "O", "n", "m", "L", "K", "j", "i", "H", "g", "F", "e", "d", "C", "B", "a");
var _local2 = "";
val1 = 0;
while (val1 < val.length) {
if (val.substr(val1, 1) == ":") {
_local2 = _local2 + ":";
} else if (Number(val.substr(val1, 2)) > 26) {
_local2 = _local2 + _local3[Number(val.substr(val1, 1))];
} else if (Number(val.substr(val1, 1)) == 0) {
_local2 = _local2 + "_";
} else {
_local2 = _local2 + _local3[Number(val.substr(val1, 2))];
val1++;
}
val1++;
}
return(_local2);
}
mcButtonMain.mcButton.FOG.swapDepths(0);
mcButtonMain.mcButton.attachMovie(btnMC, "btnMC", 0);
mcButtonMain.mcButton.btnMC.onRelease = function () {
var _local2 = new LoadVars();
_local2.onLoad = function () {
getURL ("http://www.freeonlinegames.com/scoreboard.php?", "_blank");
};
_local2.score = Score;
_local2.score2 = earl223(String(Score));
_local2.gamer = gameID;
_local2.id = random(9999999);
_local2.toString();
_local2.sendAndLoad("http://www.freeonlinegames.com/scoreboard/score_c.php", _local2, "POST");
delete this.onRelease;
};