Frame 1
function saveData() {
trace("Saving Data");
myLocalSO.data.place_score_1 = place_score_1;
myLocalSO.data.place_score_2 = place_score_2;
myLocalSO.data.place_score_3 = place_score_3;
myLocalSO.data.place_name_1 = place_name_1;
myLocalSO.data.place_name_2 = place_name_2;
myLocalSO.data.place_name_3 = place_name_3;
myLocalSO.data.player_name = player_name;
myLocalSO.data.highScoreColor = highScoreColor;
}
function increaseScore(amt, x, y) {
_root.g_lvl_kills++;
_root.score = _root.score + amt;
}
function gameOver() {
return(_root.hero.hp <= 0);
}
function endGame() {
_root.paused = true;
updatedTopScores();
openGameOver();
}
function updatedTopScores() {
if (score > place_score_1) {
place_score_3 = place_score_2;
place_score_2 = place_score_1;
place_score_1 = score;
place_name_3 = place_name_2;
place_name_2 = place_name_1;
place_name_1 = player_name;
_root.end_text = "New high score! 1st Place";
} else if (score > place_score_2) {
place_score_3 = place_score_2;
place_score_2 = score;
place_name_3 = place_name_2;
place_name_2 = player_name;
_root.end_text = "New high score! 2nd Place";
} else if (score > place_score_3) {
place_score_3 = score;
place_name_3 = player_name;
_root.end_text = "New high score! 3rd Place";
} else if (score > 1000) {
_root.end_text = "Nice shooting.";
} else if (score > 700) {
_root.end_text = "Not bad. Keep Practicing";
} else if (score > 400) {
_root.end_text = "Ouch... better luck next time.";
} else {
_root.end_text = "Noob Tip: use mouse-left click to fire :P";
}
saveData();
}
function restartGame() {
cleanGameboard();
resetGame();
}
function cleanGameboard() {
for (i in enemies) {
enemies[i].unloadMovie();
}
enemies = new Array();
}
function resetGame() {
game_ended = false;
_root.level_ticker = 0;
_root.fps_ticks = 0;
_root.fps_total = 0;
_root.avg_fps = 0;
_root.max_fps = 0;
_root.min_fps = 9999;
_root.stepper.resetStepperVars();
_root.hero._alpha = 100;
_root.hero.hp = 100;
_root.hero.vx = 0;
_root.hero.vy = 0;
_root.score = 0;
_root.level = 1;
_root.ammo_grenades = 15;
_root.ammo_arrows = 25;
_root.ammo_bullets = 500;
_root.ammo_rockets = 10;
_root.ammo_prox_mines = 20;
_root.hero._x = (_root.g_width / 2) - 20;
_root.hero._y = _root.g_ground / 2;
_root.paused = false;
}
function showTopScores() {
paused = true;
temp = _root.upgrade_layer.attachMovie("top_scores", "top_scores_" + SCORES, SCORES);
temp._x = g_width / 2;
temp._y = g_ground / 2;
top_scores_screen = temp;
}
function showLevelDisplay() {
temp = _root.upgrade_layer.attachMovie("level_display", "level_display_" + LEVEL_DISPLAY, LEVEL_DISPLAY);
temp._x = g_width / 2;
temp._y = g_ground / 2;
}
function closeTopScores() {
top_scores_screen.unloadMovie();
}
function openNamer() {
trace("opening namer");
paused = true;
temp = _root.upgrade_layer.attachMovie("namer_screen", "namer" + NAMER, NAMER);
temp._x = g_width / 2;
temp._y = g_ground * 0.75;
namer_screen = temp;
}
function closeNamer() {
namer_screen.unloadMovie();
}
function openGameOver() {
trace("opening gameOver screen");
temp = _root.upgrade_layer.attachMovie("game_over_screen", "game_over_screen" + GAMEOVER_NUM, GAMEOVER_NUM);
temp._x = g_width / 2;
temp._y = g_ground / 2;
game_over_screen = temp;
}
function closeGameOver() {
game_over_screen.unloadMovie();
}
function openHelp() {
trace("opening help");
paused = true;
temp = _root.upgrade_layer.attachMovie("help_screen", "help_screen" + HELP_NUM, HELP_NUM);
temp._x = g_width / 2;
temp._y = g_ground / 2;
help_screen = temp;
}
function closeHelp() {
trace("closing help");
help_screen.unloadMovie();
}
function playHitEnemySound() {
playSound(hurtsounds[random(3)]);
}
function addRandomGoodie(x, y) {
bonus = powerups[random(powerups.length)];
if (bonus == "gas_can") {
obs = _root.addObj(bonus, _root.obstruct_layer, _root.getNextObstructionLevel());
obs._x = x;
obs._y = y;
} else {
obs = _root.addObj(bonus, _root.powerup_layer, _root.getNextPowerUpLevel());
obs._x = x;
obs._y = y;
}
}
function playSound(filename) {
mysound = new Sound();
mysound.attachSound(filename);
mysound.start(0, 1);
}
function shootArrow() {
playSound("swoosh.wav");
ammo_arrows--;
shot_speed = 8;
rads = (_root.hero.sight._rotation * Math.PI) / 180;
xfactor = Math.cos(rads);
yfactor = Math.sin(rads);
lvx = shot_speed * xfactor;
lvy = shot_speed * yfactor;
lvl = getNextProjectileLevel();
proj = _root.addObj("hero_arrow", _root.projectile_layer, lvl);
proj.vx = lvx;
proj.vy = lvy;
proj._x = (hero._x + hero.sight._x) + (xfactor * 20);
proj._y = (hero._y + hero.sight._y) + (yfactor * 20);
proj._rotation = _root.hero.sight._rotation;
}
function placeDebrisArrow(x, y, rot) {
temp = _root.addObj("arrow_debris", _root.debris_layer, _root.getNextDebrisLevel());
temp._x = x;
temp._y = y;
temp._rotation = rot;
}
function placeDebrisType(x, y, rot, dtype) {
temp = _root.addObj(dtype, _root.debris_layer, _root.getNextDebrisLevel());
temp._x = x;
temp._y = y;
temp._rotation = rot;
}
function removeEnemy(ene) {
tempArray = new Array();
for (i in enemies) {
nextEn = enemies[i];
if (ene != nextEn) {
tempArray.push(nextEn);
}
}
ene.unloadMovie();
enemies = tempArray;
}
function removeMine(mi) {
tempArray = new Array();
for (i in mines) {
nextObj = mines[i];
if (mi != nextObj) {
tempArray.push(nextObj);
}
}
mi.unloadMovie();
mines = tempArray;
}
function removeObstruction(obs) {
tempArray = new Array();
for (i in obstructions) {
nextObs = obstructions[i];
if (obs != nextObs) {
tempArray.push(nextObs);
}
}
obs.unloadMovie();
obstructions = tempArray;
}
function shootHeroProjectile() {
playSound("tat2.wav");
ammo_bullets--;
_root.hero.recoil = 5;
shot_speed = 8;
variation = (random(Math.floor(_root.gun_wild * 100)) - random(Math.floor(_root.gun_wild * 100))) / 300;
trace(variation);
rads = ((_root.hero.sight._rotation + variation) * Math.PI) / 180;
xfactor = Math.cos(rads);
yfactor = Math.sin(rads);
lvx = shot_speed * xfactor;
lvy = shot_speed * yfactor;
lvl = getNextProjectileLevel();
proj = _root.addObj("hero_bullet", _root.projectile_layer, lvl);
proj.vx = lvx;
proj.vy = lvy;
proj._x = (hero._x + hero.sight._x) + (xfactor * 20);
proj._y = (hero._y + hero.sight._y) + (yfactor * 20);
proj._rotation = _root.hero.sight._rotation;
}
function shrapnelExplosion(x, y, amt) {
ndx = 0;
while (ndx < amt) {
shot_speed = ((random(100) / 100) * 8) + 4;
rot = (90 + random(80)) - 40;
rads = (rot * Math.PI) / 180;
xfactor = Math.cos(rads);
yfactor = Math.sin(rads);
lvx = shot_speed * xfactor;
lvy = shot_speed * yfactor;
lvl = getNextProjectileLevel();
proj = _root.addObj("hero_shrap", _root.projectile_layer, lvl);
proj.vx = lvx;
proj.vy = lvy;
proj._x = x;
proj._y = y;
proj._rotation = rot;
ndx++;
}
}
function shootHeroRocket() {
playSound("shoot_rocket.wav");
rocket_smoke = 105;
rocket_flame = 130;
ammo_rockets--;
targ_ene = null;
targ_acq = false;
for (i in _root.enemies) {
if (_root.enemies[i].hitTest(_xmouse, _ymouse, 0)) {
targ_ene = _root.enemies[i];
targ_acq = true;
break;
}
}
_root.hero.sight.rifle_invert._x = _root.hero.sight.rifle_invert._x - 5;
_root.hero.sight.rifle._x = _root.hero.sight.rifle._x - 5;
shot_speed = 6;
rads = (_root.hero.sight._rotation * Math.PI) / 180;
lvx = shot_speed * Math.cos(rads);
lvy = shot_speed * Math.sin(rads);
lvl = getNextRocketLevel();
proj = _root.addObj("missile", _root.rocket_layer, lvl);
proj.vx = lvx;
proj.vy = lvy;
proj._x = (hero._x + hero.sight._x) + (lvx * 1);
proj._y = (hero._y + hero.sight._y) + (lvy * 1);
proj._rotation = _root.hero.sight._rotation;
proj.target_enemy = targ_ene;
proj.target_acquired = targ_acq;
}
function shootGrenade() {
ammo_grenades--;
shot_speed = 4;
variation = 0;
rads = ((_root.hero.sight._rotation + variation) * Math.PI) / 180;
lvx = shot_speed * Math.cos(rads);
lvy = shot_speed * Math.sin(rads);
lvl = getNextProjectileLevel();
proj = _root.addObj("hero_grenade", _root.projectile_layer, lvl);
proj.vx = lvx;
proj.vy = lvy;
proj._x = ((hero._x + hero.sight._x) + lvx) + _root.hero.vx;
proj._y = ((hero._y + hero.sight._y) + lvy) + _root.hero.vy;
}
function shootProximityMine() {
ammo_prox_mines--;
shot_speed = 2;
variation = 0;
rads = ((_root.hero.sight._rotation + variation) * Math.PI) / 180;
lvx = shot_speed * Math.cos(rads);
lvy = shot_speed * Math.sin(rads);
lvl = getNextMineLevel();
proj = _root.addObj("proximity_mine", _root.mine_layer, lvl);
proj.vx = lvx;
proj.vy = lvy;
proj._x = ((hero._x + hero.sight._x) + lvx) + _root.hero.vx;
proj._y = ((hero._y + hero.sight._y) + lvy) + _root.hero.vy;
mines.push(proj);
}
function placeBlood(x, y) {
if (_root.age >= 17) {
playSound("blood_splat.wav");
lvl = getNextCraterLevel();
temp = _root.addObj("crater2", _root.ground.crater_layer, lvl);
temp._x = x;
temp._y = y;
temp._rotation = random(360);
}
}
function placeDeadBody(btype, x, y, vx) {
lvl = getNextDebrisLevel();
temp = _root.addObj(btype, _root.debris_layer, lvl);
temp._x = x;
temp._y = y;
if (vx > 0) {
temp._xscale = -100;
}
}
function placeEnemy(etype, x, y, vx, vy) {
trace("Placing enemy specific location!!!!!!!");
lvl = getNextEnemyLevel();
temp = _root.addObj(etype, _root.enemy_layer, lvl);
temp._x = x;
temp._y = y;
temp.vx = vx;
temp.vy = vy;
enemies.push(temp);
_root.enemy_count = _root.enemies.length;
return(temp);
}
function getNextMineLevel() {
if ((mine_lvl++) > 15) {
mine_lvl = 1;
}
return(mine_lvl);
}
function getNextRocketLevel() {
if ((rocket_lvl++) > 6) {
rocket_lvl = 1;
}
return(rocket_lvl);
}
function getNextProjectileLevel() {
if ((proj_lvl++) > 15) {
proj_lvl = 1;
}
return(proj_lvl);
}
function getNextPowerUpLevel() {
if ((powerup_lvl++) > 5) {
powerup_lvl = 1;
}
return(powerup_lvl);
}
function getNextObstructionLevel() {
if ((obs_lvl++) > 10) {
obs_lvl = 1;
}
return(obs_lvl);
}
function getNextDebrisLevel() {
if ((debris_lvl++) > 20) {
debris_lvl = 1;
}
return(debris_lvl);
}
function getNextBombLevel() {
if ((bomb_lvl++) > 10) {
bomb_lvl = 1;
}
return(bomb_lvl);
}
function getNextBloodLevel() {
if ((b_drop_lvl++) > 15) {
b_drop_lvl = 1;
}
return(b_drop_lvl);
}
function getNextSmokeLevel() {
if ((smoke_lvl++) > 50) {
smoke_lvl = 1;
}
return(smoke_lvl);
}
function getNextCraterLevel() {
if ((crater_lvl++) > 6) {
crater_lvl = 1;
}
return(crater_lvl);
}
function getNextEnemyLevel() {
if ((enemy_lvl++) > 20) {
enemy_lvl = 1;
}
return(enemy_lvl);
}
function getNextFlameLevel() {
if ((flame_lvl++) > 10) {
flame_lvl = 1;
}
return(flame_lvl);
}
function getNextEnemyBulletLevel() {
if ((enemy_bullet_lvl++) > 20) {
enemy_bullet_lvl = 1;
}
return(enemy_bullet_lvl);
}
function placeSmoke(x, y) {
lvl = getNextSmokeLevel();
temp = _root.addObj("smoke", _root.smoke_layer, lvl);
temp._x = x;
temp._y = y;
}
function addGrenadeExplosion(x, y) {
dmg = 10;
radius = 60;
addExplosion(x, y, radius, dmg);
}
function getDist(x1, y1, x2, y2) {
dx = x1 - x2;
dy = y1 - y2;
return(Math.sqrt((dx * dx) + (dy * dy)));
}
function addExplosionType(x, y, radius, dmg, dtype) {
playSound("bomb_hit.wav");
lvl = getNextCraterLevel();
temp = _root.addObj("crater1", _root.ground.crater_layer, lvl);
temp._x = x;
temp._y = y;
temp._rotation = random(360);
lvl = getNextDebrisLevel();
temp = _root.addObj("explosion", _root.debris_layer, lvl);
temp._x = x;
temp._y = y;
temp._xscale = (temp._yscale = radius);
deb = Math.ceil(radius / 40);
i = 0;
while (i < deb) {
lvl = getNextDebrisLevel();
temp = _root.addObj(dtype, _root.debris_layer, lvl);
temp._x = x;
temp._y = y;
temp.vx = (random(100) - random(100)) / 50;
temp.vy = ((-random(100)) / 50) - 2;
i++;
}
for (i in _root.enemies) {
ene = enemies[i];
dx = ene._x - x;
dy = (ene._y - 20) - y;
dist = getDist(x, y, ene._x, ene._y - 25);
if (dist < radius) {
ene.deathCode = "exploded";
impact = Math.ceil((dmg * (radius - dist)) / radius);
ene.explosion_impact = impact;
ene.explosion_dx = (((-dx) / dist) * impact) * 0.4;
ene.explosion_dy = (((-dy) / dist) * impact) * 0.4;
ene.takeDamage(impact, ene._x, ene._y, vx, vy);
}
}
for (i in _root.obstructions) {
obs = obstructions[i];
dist = getDist(x, y, obs._x, obs._y);
if (dist < radius) {
obs.leaking = obs.leaking + (random(10) / 10);
obs.deathCode = "exploded";
obs.explosion_dist = -dx;
}
}
for (i in _root.mines) {
obs = mines[i];
dist = getDist(x, y, obs._x, obs._y);
if (dist < radius) {
obs.leaking = obs.leaking + (2 + (random(10) / 10));
obs.deathCode = "exploded";
}
}
dx = _root.hero._x - x;
dy = (_root.hero._y - 20) - y;
dist = getDist(x, y, _root.hero._x, _root.hero._y - 20);
if (dist < radius) {
_root.hero._y = _root.hero._y - 2;
impact = Math.ceil((dmg * (radius - dist)) / radius);
fly = impact;
if (impact > 15) {
fly = 15;
}
_root.hero.vx = (((-dx) / dist) * fly) * 0.33;
_root.hero.vy = (((-dy) / dist) * fly) * 0.33;
_root.addBloodExplosion(_root.hero._x, _root.hero._y - 20);
_root.hero.takeDamage(impact);
}
}
function addExplosion(x, y, radius, dmg) {
playSound("bomb_hit.wav");
lvl = getNextCraterLevel();
temp = _root.addObj("crater1", _root.ground.crater_layer, lvl);
temp._x = x;
temp._y = y;
temp._rotation = random(360);
lvl = getNextDebrisLevel();
temp = _root.addObj("explosion", _root.debris_layer, lvl);
temp._x = x;
temp._y = y;
temp._xscale = (temp._yscale = radius);
deb = Math.ceil(radius / 40);
i = 0;
while (i < deb) {
lvl = getNextDebrisLevel();
temp = _root.addObj("debris1", _root.debris_layer, lvl);
temp._x = x;
temp._y = y;
temp.vx = (random(100) - random(100)) / 50;
temp.vy = ((-random(100)) / 50) - 2;
i++;
}
for (i in _root.enemies) {
ene = enemies[i];
dx = ene._x - x;
dy = (ene._y - 20) - y;
dist = getDist(x, y, ene._x, ene._y - 25);
if (dist < radius) {
ene.deathCode = "exploded";
impact = Math.ceil((dmg * (radius - dist)) / radius);
ene.explosion_impact = impact;
ene.explosion_dx = (((-dx) / dist) * impact) * 0.4;
ene.explosion_dy = (((-dy) / dist) * impact) * 0.4;
ene.takeDamage(impact, ene._x, ene._y, vx, vy);
}
}
for (i in _root.obstructions) {
obs = obstructions[i];
dist = getDist(x, y, obs._x, obs._y);
if (dist < radius) {
obs.leaking = obs.leaking + (random(10) / 10);
obs.deathCode = "exploded";
obs.explosion_dist = -dx;
}
}
for (i in _root.mines) {
obs = mines[i];
dist = getDist(x, y, obs._x, obs._y);
if (dist < radius) {
obs.leaking = obs.leaking + (2 + (random(10) / 10));
obs.deathCode = "exploded";
}
}
dx = _root.hero._x - x;
dy = (_root.hero._y - 20) - y;
dist = getDist(x, y, _root.hero._x, _root.hero._y - 20);
if (dist < radius) {
_root.hero._y = _root.hero._y - 2;
impact = Math.ceil((dmg * (radius - dist)) / radius);
fly = impact;
if (impact > 15) {
fly = 15;
}
_root.hero.vx = (((-dx) / dist) * fly) * 0.33;
_root.hero.vy = (((-dy) / dist) * fly) * 0.33;
_root.addBloodExplosion(_root.hero._x, _root.hero._y - 20);
_root.hero.takeDamage(impact);
}
}
function addBloodExplosion(x, y) {
if (_root.age >= 17) {
placeBlood(x, y + 20);
c = 0;
while (c < 10) {
blood = _root.addObj("blood_drop", _root.debris_layer, _root.getNextDebrisLevel());
dx = (random(10) - random(10)) + 1;
dy = (random(10) - random(10)) + 1;
dist = Math.sqrt((dx * dx) + (dy * dy));
power = (random(150) + 25) / 50;
blood._x = x;
blood._y = y;
blood.vx = (dx / dist) * power;
blood.vy = (dy / dist) * power;
blood._xscale = (blood._yscale = 200 + random(200));
c++;
}
}
}
function addBloodExplosionAmt(x, y, amt) {
if (_root.age >= 17) {
c = 0;
while (c < amt) {
blood = _root.addObj("blood_drop", _root.debris_layer, _root.getNextDebrisLevel());
dx = (random(10) - random(10)) + 1;
dy = (random(10) - random(10)) + 1;
dist = Math.sqrt((dx * dx) + (dy * dy));
power = (random(150) + 25) / 50;
blood._x = x;
blood._y = y;
blood.vx = (dx / dist) * power;
blood.vy = (dy / dist) * power;
blood._xscale = (blood._yscale = 200 + random(200));
c++;
}
}
}
function addBloodyStump(x, y, vx, vy) {
lvl = getNextDebrisLevel();
temp = _root.addObj("blood_stump", _root.debris_layer, lvl);
temp._x = x;
temp._y = y;
temp.vx = vx;
temp.vy = vy;
}
function addFemBloodyStump(x, y, vx, vy) {
lvl = getNextDebrisLevel();
temp = _root.addObj("blood_stump_fem", _root.debris_layer, lvl);
temp._x = x;
temp._y = y;
temp.vx = vx;
temp.vy = vy;
}
function addObj(obj, layer, lvl) {
temp = layer.attachMovie(obj, (obj + "_id_") + lvl, lvl);
return(temp);
}
function addSplash(x, y) {
lvl = getNextDebrisLevel();
playSound("splash2.wav");
splash = addObj("bullet_water_splash", _root.debris_layer, lvl);
splash._x = x;
splash._y = y;
}
function inSameSection(xpos) {
code = getSectionCode(xpos);
return(_root.heroSectionCode == code);
}
function getSectionCode(xpos) {
if (xpos < s_half) {
if (xpos < s_quart) {
return(1);
}
return(2);
}
if (xpos < (s_half + s_quart)) {
return(3);
}
return(4);
}
function getDistToNextPart(xpos, vx) {
amt = xpos % s_quart;
if (vx > 0) {
return(s_quart - amt);
}
return(amt);
}
KEY_W = 87;
KEY_E = 69;
KEY_Q = 81;
KEY_A = 65;
KEY_S = 83;
KEY_D = 68;
KEY_X = 67;
KEY_C = 88;
KEY_J = 74;
KEY_K = 75;
KEY_L = 76;
KEY_U = 85;
KEY_UP = 38;
KEY_RIGHT = 39;
KEY_DOWN = 40;
KEY_LEFT = 37;
KEY_R = 82;
_root.demo_shot = 0;
KEY_SPACEBAR = 32;
KEY_LEFTCONTROL = 17;
g_width = 728;
g_ground = 400;
paused = false;
_root.age = 2;
end_text = "Nice shooting!";
LEVEL_DISPLAY = 7;
HELP_NUM = 6;
SCORES = 4;
NAMER = 5;
GAMEOVER_NUM = 3;
UG_LAYER = 1;
top_scores_screen = null;
help_screen = null;
namer_screen = null;
game_over_screen1 = null;
_root.place_score_1 = 300;
_root.place_score_2 = 200;
_root.place_score_3 = 100;
_root.place_name_1 = "Jax";
_root.place_name_2 = "Matrox";
_root.place_name_3 = "Razor";
_root.player_name = "noob";
myLocalSO = sharedobject.getLocal("gm02");
if (myLocalSO.data.place_score_1 != null) {
trace("Shared Object Data Found... loading data");
place_score_1 = myLocalSO.data.highScore;
_root.place_score_1 = myLocalSO.data.place_score_1;
_root.place_score_2 = myLocalSO.data.place_score_2;
_root.place_score_3 = myLocalSO.data.place_score_3;
_root.place_name_1 = myLocalSO.data.place_name_1;
_root.place_name_2 = myLocalSO.data.place_name_2;
_root.place_name_3 = myLocalSO.data.place_name_3;
_root.player_name = myLocalSO.data.player_name;
paused = false;
} else {
trace("no object found... loading default data");
_root.first_time_playing = true;
_root.place_score_1 = 300;
_root.place_score_2 = 200;
_root.place_score_3 = 100;
_root.place_name_1 = "Jax";
_root.place_name_2 = "Matrox";
_root.place_name_3 = "Razor";
_root.player_name = "noob";
_root.paused = true;
openNamer();
openHelp();
}
g_lvl_kills = 0;
ammo_grenades = 15;
ammo_arrows = 25;
ammo_bullets = 500;
ammo_rockets = 10;
ammo_prox_mines = 20;
score = 0;
level = 1;
game_ended = false;
resetGame();
gravity = 0.05;
gun_wild = 0;
aim_rate = 0;
shooting_mode = "gun";
obstructions = new Array();
structures = new Array();
mines = new Array();
max_enemies_on_screen = 4;
enemy_count = 0;
rocket_smoke = 0;
rocket_flame = 0;
last_throw = false;
enemies = new Array();
someListener = new Object();
someListener.onMouseDown = function () {
_root.firing = true;
};
Mouse.addListener(someListener);
someListener2 = new Object();
someListener2.onMouseUp = function () {
_root.firing = false;
};
Mouse.addListener(someListener2);
powerups = new Array("ammo_health", "gas_can", "ammo_gun", "ammo_arrow", "ammo_grenade", "ammo_rocket", "ammo_prox_mine");
hurtsounds = new Array("oreh.wav", "uh.wav", "oof.wav");
mine_lvl = 1;
rocket_lvl = 1;
proj_lvl = 1;
powerup_lvl = 1;
obs_lvl = 1;
debris_lvl = 1;
bomb_lvl = 1;
b_drop_lvl = 1;
smoke_lvl = 1;
crater_lvl = 1;
enemy_lvl = 1;
flame_lvl = 1;
enemy_bullet_lvl = 1;
s_half = 364;
s_quart = 182;
_root.heroSectionCode = 1;
Instance of Symbol 338 MovieClip "tower_right" in Frame 1
onClipEvent (load) {
_alpha = 0;
}
Instance of Symbol 404 MovieClip in Frame 1
onClipEvent (enterFrame) {
frame = 1;
if (_root.hero.hp < 0) {
frame = 100;
} else {
frame = (100 - _root.hero.hp) + 1;
}
gotoAndStop(frame);
}
Instance of Symbol 457 MovieClip in Frame 1
onClipEvent (load) {
midx = _root.g_width / 2;
midy = _root.g_ground / 2;
}
onClipEvent (enterFrame) {
if (_root.paused) {
_x = midx;
_y = midy;
} else {
_x = -999;
}
}
Instance of Symbol 317 MovieClip [game_over_screen] in Frame 1
onClipEvent (load) {
this.unloadMovie();
}
Instance of Symbol 299 MovieClip [help_screen] in Frame 1
onClipEvent (load) {
this.unloadMovie();
}
Instance of Symbol 274 MovieClip [namer_screen] in Frame 1
onClipEvent (load) {
this.unloadMovie();
}
Instance of Symbol 269 MovieClip [top_scores] in Frame 1
onClipEvent (load) {
this.unloadMovie();
}
Instance of Symbol 480 MovieClip "stepper" in Frame 1
onClipEvent (load) {
function getNextEnemy() {
lvl = (_root.level - 1) % game_levels.length;
game_set = game_levels[lvl];
return(game_set[random(game_set.length)]);
}
function resetStepperVars() {
timeToNextEnemy = 100 + random(100);
timeToNextBomber = 200 + random(100);
timeToNextChopper = 300 + random(100);
timeToNextSniper = 400 + random(100);
wave_count = 0;
bomber_wave_count = 0;
chopper_wave_count = 0;
sniper_wave_count = 0;
timeToNextDrop = 0;
}
timeToNextEnemy = 0;
timeToNextBomber = 0;
timeToNextChopper = 0;
timeToNextSniper = 0;
sniper_wave_count = 0;
wave_count = 0;
bomber_wave_count = 0;
chopper_wave_count = 0;
level01 = new Array("enemy_a10", "enemy1", "enemy1", "enemy1", "enemy1");
level02 = new Array();
i = 0;
while (i < 80) {
level02.push("enemy1");
i++;
}
i = 0;
while (i < 10) {
level02.push("enemy_drop");
i++;
}
i = 0;
while (i < 8) {
level02.push("enemy_drop_sniper");
i++;
}
i = 0;
while (i < 1) {
level02.push("enemy_chopper");
i++;
}
i = 0;
while (i < 1) {
level02.push("enemy_bomber");
i++;
}
i = 0;
while (i < 1) {
level02.push("enemy_a10");
i++;
}
level03 = new Array();
i = 0;
while (i < 70) {
level03.push("enemy1");
i++;
}
i = 0;
while (i < 20) {
level03.push("enemy_drop");
i++;
}
i = 0;
while (i < 8) {
level03.push("enemy_drop_sniper");
i++;
}
i = 0;
while (i < 1) {
level03.push("enemy_chopper");
i++;
}
i = 0;
while (i < 1) {
level03.push("enemy_bomber");
i++;
}
i = 0;
while (i < 1) {
level03.push("enemy_a10");
i++;
}
level04 = new Array();
i = 0;
while (i < 60) {
level04.push("enemy1");
i++;
}
i = 0;
while (i < 30) {
level04.push("enemy_drop");
i++;
}
i = 0;
while (i < 20) {
level04.push("enemy_drop_sniper");
i++;
}
i = 0;
while (i < 10) {
level04.push("enemy_chopper");
i++;
}
i = 0;
while (i < 5) {
level04.push("enemy_bomber");
i++;
}
i = 0;
while (i < 3) {
level04.push("enemy_a10");
i++;
}
level05 = new Array();
i = 0;
while (i < 6) {
level05.push("enemy1");
i++;
}
i = 0;
while (i < 6) {
level05.push("enemy_drop");
i++;
}
i = 0;
while (i < 3) {
level05.push("enemy_drop_sniper");
i++;
}
i = 0;
while (i < 2) {
level05.push("enemy_chopper");
i++;
}
i = 0;
while (i < 1) {
level05.push("enemy_bomber");
i++;
}
i = 0;
while (i < 1) {
level05.push("enemy_a10");
i++;
}
level06 = new Array();
i = 0;
while (i < 3) {
level06.push("enemy1");
i++;
}
i = 0;
while (i < 10) {
level06.push("enemy_drop");
i++;
}
i = 0;
while (i < 5) {
level06.push("enemy_drop_sniper");
i++;
}
i = 0;
while (i < 2) {
level06.push("enemy_chopper");
i++;
}
i = 0;
while (i < 1) {
level06.push("enemy_bomber");
i++;
}
i = 0;
while (i < 1) {
level06.push("enemy_a10");
i++;
}
level07 = new Array();
i = 0;
while (i < 2) {
level07.push("enemy1");
i++;
}
i = 0;
while (i < 10) {
level07.push("enemy_drop");
i++;
}
i = 0;
while (i < 10) {
level07.push("enemy_drop_sniper");
i++;
}
i = 0;
while (i < 5) {
level07.push("enemy_chopper");
i++;
}
i = 0;
while (i < 3) {
level07.push("enemy_bomber");
i++;
}
i = 0;
while (i < 1) {
level07.push("enemy_a10");
i++;
}
level08 = new Array();
i = 0;
while (i < 1) {
level08.push("enemy1");
i++;
}
i = 0;
while (i < 1) {
level08.push("enemy_drop");
i++;
}
i = 0;
while (i < 1) {
level08.push("enemy_drop_sniper");
i++;
}
i = 0;
while (i < 5) {
level08.push("enemy_chopper");
i++;
}
i = 0;
while (i < 2) {
level08.push("enemy_bomber");
i++;
}
i = 0;
while (i < 1) {
level08.push("enemy_a10");
i++;
}
level09 = new Array();
i = 0;
while (i < 1) {
level09.push("enemy1");
i++;
}
i = 0;
while (i < 1) {
level09.push("enemy_drop");
i++;
}
i = 0;
while (i < 1) {
level09.push("enemy_drop_sniper");
i++;
}
i = 0;
while (i < 6) {
level09.push("enemy_chopper");
i++;
}
i = 0;
while (i < 3) {
level09.push("enemy_bomber");
i++;
}
i = 0;
while (i < 1) {
level09.push("enemy_a10");
i++;
}
level10 = new Array();
i = 0;
while (i < 1) {
level10.push("enemy1");
i++;
}
i = 0;
while (i < 1) {
level10.push("enemy_drop");
i++;
}
i = 0;
while (i < 1) {
level10.push("enemy_drop_sniper");
i++;
}
i = 0;
while (i < 6) {
level10.push("enemy_chopper");
i++;
}
i = 0;
while (i < 5) {
level10.push("enemy_bomber");
i++;
}
i = 0;
while (i < 3) {
level10.push("enemy_a10");
i++;
}
level11 = new Array();
i = 0;
while (i < 1) {
level11.push("enemy1");
i++;
}
i = 0;
while (i < 1) {
level11.push("enemy_drop");
i++;
}
i = 0;
while (i < 1) {
level11.push("enemy_drop_sniper");
i++;
}
i = 0;
while (i < 1) {
level11.push("enemy_chopper");
i++;
}
i = 0;
while (i < 5) {
level11.push("enemy_bomber");
i++;
}
i = 0;
while (i < 4) {
level11.push("enemy_a10");
i++;
}
level12 = new Array();
i = 0;
while (i < 0) {
level12.push("enemy1");
i++;
}
i = 0;
while (i < 0) {
level12.push("enemy_drop");
i++;
}
i = 0;
while (i < 0) {
level12.push("enemy_drop_sniper");
i++;
}
i = 0;
while (i < 0) {
level12.push("enemy_chopper");
i++;
}
i = 0;
while (i < 1) {
level12.push("enemy_bomber");
i++;
}
i = 0;
while (i < 1) {
level12.push("enemy_a10");
i++;
}
level13 = new Array();
i = 0;
while (i < 0) {
level13.push("enemy1");
i++;
}
i = 0;
while (i < 0) {
level13.push("enemy_drop");
i++;
}
i = 0;
while (i < 0) {
level13.push("enemy_drop_sniper");
i++;
}
i = 0;
while (i < 1) {
level13.push("enemy_chopper");
i++;
}
i = 0;
while (i < 0) {
level13.push("enemy_bomber");
i++;
}
i = 0;
while (i < 1) {
level13.push("enemy_a10");
i++;
}
level14 = new Array();
i = 0;
while (i < 1) {
level14.push("enemy1");
i++;
}
i = 0;
while (i < 1) {
level14.push("enemy_drop");
i++;
}
i = 0;
while (i < 0) {
level14.push("enemy_drop_sniper");
i++;
}
i = 0;
while (i < 0) {
level14.push("enemy_chopper");
i++;
}
i = 0;
while (i < 0) {
level14.push("enemy_bomber");
i++;
}
level15 = new Array();
i = 0;
while (i < 0) {
level15.push("enemy1");
i++;
}
i = 0;
while (i < 0) {
level15.push("enemy_drop");
i++;
}
i = 0;
while (i < 0) {
level15.push("enemy_drop_sniper");
i++;
}
i = 0;
while (i < 1) {
level15.push("enemy_chopper");
i++;
}
i = 0;
while (i < 1) {
level15.push("enemy_bomber");
i++;
}
i = 0;
while (i < 1) {
level15.push("enemy_a10");
i++;
}
level16 = new Array();
i = 0;
while (i < 1) {
level16.push("enemy1");
i++;
}
i = 0;
while (i < 0) {
level16.push("enemy_drop");
i++;
}
i = 0;
while (i < 0) {
level16.push("enemy_drop_sniper");
i++;
}
i = 0;
while (i < 0) {
level16.push("enemy_chopper");
i++;
}
i = 0;
while (i < 0) {
level16.push("enemy_bomber");
i++;
}
level17 = new Array();
i = 0;
while (i < 1) {
level17.push("enemy1");
i++;
}
i = 0;
while (i < 0) {
level17.push("enemy_drop");
i++;
}
i = 0;
while (i < 0) {
level17.push("enemy_drop_sniper");
i++;
}
i = 0;
while (i < 1) {
level17.push("enemy_chopper");
i++;
}
i = 0;
while (i < 0) {
level17.push("enemy_bomber");
i++;
}
level18 = new Array();
i = 0;
while (i < 1) {
level18.push("enemy1");
i++;
}
i = 0;
while (i < 0) {
level18.push("enemy_drop");
i++;
}
i = 0;
while (i < 0) {
level18.push("enemy_drop_sniper");
i++;
}
i = 0;
while (i < 0) {
level18.push("enemy_chopper");
i++;
}
i = 0;
while (i < 1) {
level18.push("enemy_bomber");
i++;
}
game_levels = new Array(level01, level02, level03, level04, level05, level06, level07, level08, level09, level10, level11, level12, level13, level14, level15, level16, level17, level18);
timeToNextDrop = 0;
resetStepperVars();
}
onClipEvent (enterFrame) {
_root.elapsed = getTimer() - _root.prev_time;
_root.time_count = _root.time_count + _root.elapsed;
_root.prev_time = getTimer();
_root.frame_count++;
if (_root.time_count > 333) {
_root.time_count = 0;
_root.fps = _root.frame_count * 3;
_root.frame_count = 0;
}
if (((!_root.paused) && (_root.enemy_count < _root.max_enemies_on_screen)) && ((timeToNextDrop--) <= 0)) {
ene_type = getNextEnemy();
trace(("\n\n+++++++++++++++++++++++++++++++++++++ Next Enemy: " + ene_type) + "\n\n");
if (ene_type == "enemy_bomber") {
if (random(2) == 0) {
_root.placeEnemy("enemy_bomber", -44, random(100) + 20, 1 + (_root.level * 0.02), 0);
} else {
_root.placeEnemy("enemy_bomber", _root.g_width + 44, random(100) + 20, -1 - (_root.level * 0.02), 0);
}
timeToNextDrop = random(200) + 200;
}
if (ene_type == "enemy_chopper") {
if (random(2) == 0) {
ene = _root.placeEnemy("enemy_chopper", -20, -10, 0, 0);
ene._xscale = -100;
} else {
ene = _root.placeEnemy("enemy_chopper", _root.g_width + 20, -10, 0, 0);
ene._xscale = 100;
}
timeToNextDrop = random(200) + 100;
}
if (ene_type == "enemy_a10") {
if (random(2) == 0) {
_root.placeEnemy("enemy_a10", -44, random(100) + 20, 1.75, 0.1);
} else {
_root.placeEnemy("enemy_a10", _root.g_width + 44, random(100) + 20, -1.75, 0.1);
}
timeToNextDrop = random(200) + 200;
}
if (ene_type == "enemy_drop_sniper") {
if (random(2) == 0) {
_root.placeEnemy("enemy_drop_sniper", _root.tower_left._x, -10, 0, 0);
} else {
_root.placeEnemy("enemy_drop_sniper", _root.tower_right._x, -10, 0, 0);
}
timeToNextDrop = random(100) + 50;
} else if (ene_type == "enemy_drop") {
_root.placeEnemy("enemy_drop", ((_root.g_width / 2) + random(300)) - random(300), -10, 0, 0);
timeToNextDrop = random(200) + 25;
} else {
if (random(2) == 0) {
_root.placeEnemy("enemy1", -20, _root.g_ground - 50, 0, 0);
} else {
_root.placeEnemy("enemy1", _root.g_width + 20, _root.g_ground - 50, 0, 0);
}
timeToNextDrop = random(100) + 50;
}
}
if (_root.g_lvl_kills >= 20) {
_root.g_lvl_kills = 0;
trace("hit!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
_root.level++;
_root.showLevelDisplay();
}
if ((_root.fps_ticker++) > 50) {
if (_root.fps < _root.min_fps) {
_root.min_fps = _root.fps;
}
if (_root.fps > _root.max_fps) {
_root.max_fps = _root.fps;
}
_root.fps_ticks++;
_root.fps_total = _root.fps_total + _root.fps;
_root.avg_fps = _root.fps_total / _root.fps_ticks;
}
if ((_root.gameOver() && (!_root.game_ended)) && ((endDelay++) > 100)) {
_root.game_ended = true;
_root.endGame();
}
_root.enemy_count = _root.enemies.length;
_root.mine_count = _root.mines.length;
updateAfterEvent();
}
Instance of Symbol 488 MovieClip "cross_hair" in Frame 1
onClipEvent (enterFrame) {
_x = _root._xmouse;
_y = _root._ymouse;
}
Instance of Symbol 519 MovieClip in Frame 1
onClipEvent (load) {
_root.paused = true;
_x = (_root.g_width / 2);
_y = (_root.g_ground / 2);
}
Symbol 22 MovieClip [bullet_water_splash] Frame 1
function step() {
_alpha = (_alpha - 3);
if (_alpha <= 0) {
this.unloadMovie();
}
}
Instance of Symbol 21 MovieClip in Symbol 22 MovieClip [bullet_water_splash] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Symbol 31 MovieClip [enemy_bomb_drop_napalm] Frame 1
function step() {
vy = vy + (_root.gravity / 5);
_x = (_x + vx);
_y = (_y + vy);
xpos = _x;
ypos = _y;
_rotation = (_rotation + rotFactor);
if (((_x < xmin) || (_x > xmax)) || (_y > ymax)) {
_root.removeEnemy(this);
}
if ((_y > 200) || (hp <= 0)) {
hitstruct = false;
if ((_y > 200) && (_y < 260)) {
for (ndx in _root.structures) {
if (_root.structures[ndx].hitTest(_x, _y, 0)) {
hitstruct = true;
break;
}
}
}
if (((hitstruct || (hp <= 0)) || (_root.ground.ground_body.hitTest(_x, _y, 1))) || (_y > _root.g_ground)) {
_root.addExplosionType(_x, _y, 110, 1, "debris_flame");
this.unloadMovie();
}
}
}
function takeDamage(amt, x, y, vx, vy) {
hp = hp - amt;
}
hp = 1;
xpos = _x;
ypos = _y;
xmax = _root.g_width + 100;
ymax = _root.g_ground + 50;
xmin = -100;
ymin = -10;
if (vx < 0) {
_xscale = -100;
}
if (vx > 0) {
rotFactor = 0.3;
} else {
rotFactor = -0.3;
}
Instance of Symbol 30 MovieClip in Symbol 31 MovieClip [enemy_bomb_drop_napalm] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Symbol 36 MovieClip [enemy_bomb_drop] Frame 1
function step() {
vy = vy + (_root.gravity / 5);
_x = (_x + vx);
_y = (_y + vy);
xpos = _x;
ypos = _y;
_rotation = (_rotation + rotFactor);
if (((_x < xmin) || (_x > xmax)) || (_y > ymax)) {
_root.removeEnemy(this);
}
if ((_y > 200) || (hp <= 0)) {
hitstruct = false;
if ((_y > 200) && (_y < 260)) {
for (ndx in _root.structures) {
if (_root.structures[ndx].hitTest(_x, _y, 0)) {
hitstruct = true;
break;
}
}
}
if (((hitstruct || (hp <= 0)) || (_root.ground.ground_body.hitTest(_x, _y, 1))) || (_y > _root.g_ground)) {
_root.addExplosion(_x, _y, 110, 50);
_root.removeEnemy(this);
}
}
}
function takeDamage(amt, x, y, vx, vy) {
hp = hp - amt;
}
hp = 1;
xpos = _x;
ypos = _y;
xmax = _root.g_width + 100;
ymax = _root.g_ground + 50;
xmin = -100;
ymin = -10;
etype = "bomb";
if (vx < 0) {
_xscale = -100;
}
if (vx > 0) {
rotFactor = 0.3;
} else {
rotFactor = -0.3;
}
Instance of Symbol 33 MovieClip in Symbol 36 MovieClip [enemy_bomb_drop] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Instance of Symbol 35 MovieClip "hitbox" in Symbol 36 MovieClip [enemy_bomb_drop] Frame 1
onClipEvent (load) {
_alpha = 0;
}
Symbol 39 MovieClip Frame 7
this.unloadMovie();
Symbol 41 MovieClip Frame 20
this.unloadMovie();
Symbol 43 MovieClip [enemy_rocket] Frame 1
function step() {
_x = (_x + vx);
_y = (_y + vy);
placeSmoke();
if ((((_x < xmin) || (_x > xmax)) || (_y < ymin)) || (_y > ymax)) {
this.unloadMovie();
}
testHitObstructions();
testHitHero();
}
function testHitObstructions() {
hitstruct = false;
for (ndx in _root.structures) {
if (_root.structures[ndx].hitTest(_x, _y, 0)) {
hitstruct = true;
break;
}
}
if (hitstruct || (_root.ground.ground_body.hitTest(_x, _y, 1))) {
_root.addExplosion(_x, _y, radius, dmg);
this.unloadMovie();
}
for (i in _root.obstructions) {
if (_root.obstructions[i].hitTest(_x, _y, 1)) {
_root.addExplosion(_x, _y, radius, dmg);
this.unloadMovie();
}
}
}
function testHitHero() {
if (_root.hero.hitbox.hitTest(_x, _y, 0)) {
_root.addExplosion(_x, _y, radius, dmg);
this.unloadMovie();
}
}
function placeSmoke() {
lvl = _root.getNextSmokeLevel();
temp = _root.smoke_layer.attachMovie("segment", "segment_id_" + lvl, lvl);
temp._x = _x;
temp._y = _y;
temp._width = Math.sqrt((vx * vx) + (vy * vy));
temp._rotation = _rotation;
}
xmax = _root.g_width + 20;
xmin = -20;
ymax = _root.g_ground + 20;
ymin = -20;
radius = 40;
dmg = 30;
xmark = _x;
ymark = _y;
timeToMark = 0;
Instance of Symbol 27 MovieClip "rocket" in Symbol 43 MovieClip [enemy_rocket] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Symbol 44 MovieClip [missile] Frame 1
function getTarget() {
minDist = 99999 /* 0x01869F */;
for (i in _root.enemies) {
temp_distx = _root.enemies[i].xpos - _x;
temp_disty = _root.enemies[i].ypos - _y;
temp_dist = Math.sqrt((temp_distx * temp_distx) + (temp_disty * temp_disty));
if ((temp_dist < minDist) && (_root.enemies[i].ypos > 0)) {
distx = temp_distx;
disty = temp_disty;
dist = temp_dist;
minDist = temp_dist;
target_enemy = _root.enemies[i];
target_enemy.locked_on = true;
}
}
_root.testball.targ = target_enemy;
target_acquired = true;
}
function step() {
placeSmoke();
dx = _root._xmouse - _x;
dy = _root._ymouse - _y;
dist = Math.sqrt((dx * dx) + (dy * dy));
vx = vx + ((g_missile_turn_rate * dx) / dist);
vy = vy + ((g_missile_turn_rate * dy) / dist);
normDist = Math.sqrt((vx * vx) + (vy * vy));
vx = (g_missile_speed * vx) / normDist;
vy = (g_missile_speed * vy) / normDist;
if (!flying) {
flying = true;
rocket.flame._alpha = 100;
}
prevDist = newDist;
newDist = dist;
if ((prevDist < newDist) && (!change_course)) {
change_course = true;
pass_count = 20;
} else if ((prevDist > newDist) && (change_course)) {
change_course = false;
}
trace("Pass count: " + pass_count);
radians = Math.atan(vy / vx);
if (vx == 0) {
radians = radians + Math.PI;
}
if (vx > 0) {
_rotation = ((radians * 180) / 3.14159);
} else {
_rotation = (((radians * 180) / 3.14159) + 180);
}
xprev = _x;
yprev = _y;
_x = (_x + vx);
_y = (_y + vy);
xcur = _x;
ycur = _y;
target_acquired = target_enemy.hp > 0;
testHitEnemies();
testHitObstructions();
if ((fuel--) < 0) {
_root.addSpark("spark", _x, _y, 10);
_root.addExplosion(_x, _y, radius, dmg);
this.unloadMovie();
}
}
function testHitEnemies() {
for (i in _root.enemies) {
if (_root.enemies[i].hitTest(_x, _y, 1)) {
_root.addExplosion(_x, _y, radius, dmg);
this.unloadMovie();
}
}
}
function testHitObstructions() {
hitstruct = false;
for (ndx in _root.structures) {
if (_root.structures[ndx].hitTest(_x, _y, 0)) {
hitstruct = true;
break;
}
}
if (hitstruct || (_root.ground.ground_body.hitTest(_x, _y, 1))) {
_root.addExplosion(_x, _y, radius, dmg);
this.unloadMovie();
}
for (i in _root.obstructions) {
if (_root.obstructions[i].hitTest(_x, _y, 1)) {
_root.addExplosion(_x, _y, radius, dmg);
this.unloadMovie();
}
}
}
function testBlastRadius() {
hitCount = 0;
temp = _root.addObj("blast_animation", _root.debris_layer, _root.getNextDebrisLvl);
temp._x = _x;
temp._y = _y;
temp._xscale = (temp._yscale = 50);
_root.playSound("bomb.wav");
for (ndx in _root.enemies) {
distx = _root.enemies[ndx].xpos - _x;
disty = _root.enemies[ndx].ypos - _y;
range = Math.sqrt((distx * distx) + (disty * disty));
trace("Distance: " + range);
if (range < g_missile_blast_range) {
_root.enemies[ndx].takeDamage(g_missile_damage);
if ((hitCount++) > 2) {
break;
}
}
}
}
function placeSmoke() {
lvl = _root.getNextSmokeLevel();
temp = _root.smoke_layer.attachMovie("segment", "segment_id_" + lvl, lvl);
temp._x = _x;
temp._y = _y;
temp._width = Math.sqrt((vx * vx) + (vy * vy));
temp._rotation = _rotation;
}
function scan() {
minDist = 99999 /* 0x01869F */;
ndx = 0;
while ((ndx < _root.enemies.length) && (!blownUp)) {
if ((blownUp = _root.enemies[ndx].hitTest(_x, _y, 1))) {
trace("Boom");
}
ndx++;
}
}
fy = 40;
scan_time = 5;
blownUp = false;
flying = false;
adjustmentTime = 20;
g_missile_turn_rate = 0.6;
g_missile_speed = 6;
g_missile_blast_range = 50;
g_missile_damage = 200;
fuel = 600;
prevDist = 9999;
newDist = 9999;
dist = 0;
change_course = false;
pass_count = 0;
radius = 50;
dmg = 45;
xmark = _x;
ymark = _y;
timeToMark = 9999;
nextTarget = 5;
Instance of Symbol 27 MovieClip "rocket" in Symbol 44 MovieClip [missile] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Symbol 47 MovieClip [hero_arrow_bomb] Frame 1
function setVelocity(xdelta, ydelta) {
trace((("setting x and y: " + xdelta) + " ") + ydelta);
vx = xdelta;
vy = ydelta;
}
function step() {
vy = vy + (_root.gravity * 2);
_y = (_y + vy);
_x = (_x + vx);
radians = Math.atan(vy / vx);
if (vx > 0) {
_rotation = ((radians * 180) / 3.14159);
} else {
_rotation = (((radians * 180) / 3.14159) + 180);
}
if (((_x < -10) || (_x > xmax)) || (_y > ymax)) {
this.unloadMovie();
}
testHitEnemies();
testHitObstructions();
}
function testHitEnemies() {
for (i in _root.enemies) {
if (_root.enemies[i].hitbox.hitTest(_x, _y, 0)) {
_root.enemies[i].takeDamage(3, _x, _y, vx, vy);
_root.addSpark("spark", _x, _y, 3);
_root.playHitEnemySound();
_root.addExplosion(_x, _y, range, dmg);
this.unloadMovie();
}
}
}
function testHitObstructions() {
if (_root.ground.ground_body.hitTest(_x, _y, 1)) {
_root.addExplosion(_x, _y, range, dmg);
_root.placeDebrisArrow(_x, _y, _rotation);
this.unloadMovie();
}
for (i in _root.obstructions) {
if (_root.obstructions[i].hitTest(_x, _y, 1)) {
_root.obstructions[i].takeDamage(3, _x, _y, vx, vy);
_root.addExplosion(_x, _y, range, dmg);
_root.placeDebrisArrow(_x, _y, _rotation);
this.unloadMovie();
}
}
}
xmax = _root.g_width + 10;
ymax = _root.g_ground + 10;
range = 40;
dmg = 10;
Instance of Symbol 46 MovieClip in Symbol 47 MovieClip [hero_arrow_bomb] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Symbol 50 MovieClip [debris_flame] Frame 1
function setVelocity(xdelta, ydelta) {
trace((("setting x and y: " + xdelta) + " ") + ydelta);
vx = xdelta;
vy = ydelta;
}
function step() {
vy = vy + (_root.gravity * 2);
_y = (_y + vy);
_x = (_x + vx);
radians = Math.atan(vy / vx);
if (vx > 0) {
_rotation = ((radians * 180) / 3.14159);
} else {
_rotation = (((radians * 180) / 3.14159) + 180);
}
if (((_x < -10) || (_x > xmax)) || (_y > ymax)) {
this.unloadMovie();
}
testHitEnemies();
testHitObstructions();
}
function testHitEnemies() {
for (i in _root.enemies) {
ene = _root.enemies[i];
if (ene.hitbox.hitTest(_x, _y, 0)) {
if (ene.etype == "troop") {
_root.enemies[i].takeDamage(1000, _x, _y, vx, vy);
_root.playHitEnemySound();
} else {
this.unloadMovie();
}
}
}
}
function testHitObstructions() {
if (_root.ground.ground_body.hitTest(_x, _y, 1)) {
temp = _root.addObj("napalm_flame", _root.flame_layer, _root.getNextFlameLevel());
temp._x = _x;
temp._y = _y;
this.unloadMovie();
}
for (i in _root.obstructions) {
if (_root.obstructions[i].hitTest(_x, _y, 1)) {
_root.obstructions[i].takeDamage(3, _x, _y, vx, vy);
_root.placeDebrisArrow(_x, _y, _rotation);
this.unloadMovie();
}
}
}
function placeSmoke() {
lvl = _root.getNextSmokeLevel();
temp = _root.smoke_layer.attachMovie("segment_arrow", "segment_arrow_id_" + lvl, lvl);
temp._x = _x;
temp._y = _y;
temp._width = Math.sqrt((vx * vx) + (vy * vy));
temp._rotation = _rotation;
}
xmax = _root.g_width + 10;
ymax = 340;
range = 40;
dmg = 10;
Instance of Symbol 49 MovieClip in Symbol 50 MovieClip [debris_flame] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Symbol 51 MovieClip [hero_arrow] Frame 1
function setVelocity(xdelta, ydelta) {
trace((("setting x and y: " + xdelta) + " ") + ydelta);
vx = xdelta;
vy = ydelta;
}
function step() {
vy = vy + (_root.gravity * 2);
_y = (_y + vy);
_x = (_x + vx);
radians = Math.atan(vy / vx);
if (vx > 0) {
_rotation = ((radians * 180) / 3.14159);
} else {
_rotation = (((radians * 180) / 3.14159) + 180);
}
placeSmoke();
if (((_x < -10) || (_x > xmax)) || (_y > ymax)) {
this.unloadMovie();
}
testHitEnemies();
testHitObstructions();
}
function testHitEnemies() {
for (i in _root.enemies) {
ene = _root.enemies[i];
if (ene.hitbox.hitTest(_x, _y, 0)) {
if (ene.etype == "troop") {
_root.enemies[i].takeDamage(1000, _x, _y, vx, vy);
_root.playHitEnemySound();
} else {
this.unloadMovie();
}
}
}
}
function testHitObstructions() {
if (_root.ground.ground_body.hitTest(_x, _y, 1)) {
_root.placeDebrisArrow(_x, _y, _rotation);
this.unloadMovie();
}
for (i in _root.obstructions) {
if (_root.obstructions[i].hitTest(_x, _y, 1)) {
_root.obstructions[i].takeDamage(3, _x, _y, vx, vy);
_root.placeDebrisArrow(_x, _y, _rotation);
this.unloadMovie();
}
}
}
function placeSmoke() {
lvl = _root.getNextSmokeLevel();
temp = _root.smoke_layer.attachMovie("segment_arrow", "segment_arrow_id_" + lvl, lvl);
temp._x = _x;
temp._y = _y;
temp._width = Math.sqrt((vx * vx) + (vy * vy));
temp._rotation = _rotation;
}
xmax = _root.g_width + 10;
ymax = _root.g_ground + 10;
range = 40;
dmg = 10;
Instance of Symbol 46 MovieClip in Symbol 51 MovieClip [hero_arrow] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Instance of Symbol 53 MovieClip in Symbol 54 MovieClip Frame 1
onClipEvent (enterFrame) {
_rotation = (_rotation + 61);
}
Instance of Symbol 64 MovieClip in Symbol 65 MovieClip Frame 1
onClipEvent (load) {
_alpha = 0;
}
Symbol 66 MovieClip [enemy_chopper] Frame 1
function step() {
xpos = _x;
ypos = _y;
if ((move_count++) > 100) {
move_count = 0;
if (_root.hero._x < _x) {
vx = -0.25;
} else {
vx = 0.25;
}
}
vy = vy + _root.gravity;
frame = 20 - hp;
if (frame < 1) {
frame = 1;
}
frame = Math.floor(frame);
chopper_anim.gotoAndStop(frame);
if (_y > target_elev) {
ydelt = lift;
} else {
ydelt = 0;
}
if (vy < -0.5) {
ydelt = -lift;
}
if (vy > 0.5) {
ydelt = lift;
}
vy = vy + ydelt;
_x = (_x + vx);
_y = (_y + vy);
if (hp < 5) {
lift = -0.02;
hitstruct = false;
if ((_y > 200) && (_y < 260)) {
for (ndx in _root.structures) {
if (_root.structures[ndx].hitTest(_x, _y, 0)) {
hitstruct = true;
break;
}
}
}
bottom = _root.ground.ground_body.hitTest(_x, _y, 1) || (hitstruct);
}
hp = hp - leaking;
if (bottom) {
_root.increaseScore(10, _x, _y);
_root.addExplosion(_x, _y, 60, 30);
lvl = _root.getNextDebrisLevel();
temp = _root.addObj("chopper_dead", _root.debris_layer, lvl);
temp._x = _x;
temp._y = _y;
temp._xscale = _xscale;
_root.removeEnemy(this);
}
if ((timeToShoot--) <= 0) {
if (shots >= (1 + clip_size)) {
shots = 0;
timeToShoot = (400 + random(300)) - (_root.level * 5);
if (timeToShootRocket < 300) {
timeToShootRocket = 300;
}
} else {
shots++;
timeToShoot = 5;
}
shoot();
}
if (((timeToShootRocket--) <= 0) && (Math.abs(_root.hero._x - _x) > 200)) {
if (rocket_shots >= 1) {
rocket_shots = 0;
timeToShootRocket = (800 + random(400)) - (_root.level * 5);
if (timeToShootRocket < 500) {
timeToShootRocket = 500;
}
} else {
rocket_shots++;
timeToShootRocket = 10;
}
shootRocket();
}
}
function takeDamage(dmg, x, y, vx, vy) {
if (leaking <= 0) {
if (weakspot.hitTest(x, y, 0)) {
_root.increaseScore(10, _x, _y);
leaking = 0.05;
_root.addExplosion(x, y, 15, 5);
}
}
trace("Taking Damage!!!!!!!!!!!!!!!!!!");
trace("Damage: " + dmg);
hp = hp - dmg;
_root.playSound("ching1.wav");
spark_amt = random(2);
c = 0;
while (c < spark_amt) {
blood = _root.addObj("debris2", _root.debris_layer, _root.getNextDebrisLevel());
blood._x = x;
blood._y = y;
blood.vx = (vx / 3) + ((random(10) - random(10)) / 10);
blood.vy = (vy / 3) + ((random(10) - random(10)) / 10);
blood._xscale = (blood._yscale = 50 + random(100));
c++;
}
xnew = x - _x;
ynew = y - _y;
if (_xscale < 0) {
xnew = xnew * -1;
}
temp = _root.addObj("bullet_hole2", bullet_hole_layer, getNextBulletHoleLevel());
temp._x = xnew;
temp._y = ynew;
}
function getNextBulletHoleLevel() {
if ((b_level++) > 8) {
b_level = 1;
}
return(b_level);
}
function shoot() {
_root.playSound("tat3.wav");
bullet = _root.addObj("enemy_bullet", _root.enemy_bullet_layer, _root.getNextEnemyBulletLevel());
shot_speed = 2.5 * (1 + (_root.level * 0.02));
if (shot_speed > 8) {
shot_speed = 8;
}
wild_factor = 1.5;
dx = _root.hero._x - _x;
dy = _root.hero._y - _y;
variation = (random(Math.floor(wild_factor * 100)) - random(Math.floor(wild_factor * 100))) / 2000;
radians = Math.atan(dy / dx) + variation;
if (dx < 0) {
radians = radians + Math.PI;
}
bullet.vy = Math.sin(radians) * shot_speed;
bullet.vx = Math.cos(radians) * shot_speed;
bullet._x = _x;
bullet._y = _y;
bullet._rotation = (radians * 180) / Math.PI;
}
function shootRocket() {
_root.playSound("shoot_rocket4.wav");
rocket = _root.addObj("enemy_rocket", _root.enemy_bullet_layer, _root.getNextEnemyBulletLevel());
shot_speed = 3.5 * (1 + (_root.level * 0.01));
if (shot_speed > 8) {
shot_speed = 8;
}
wild_factor = 1.5;
dx = _root.hero._x - _x;
dy = _root.hero._y - _y;
variation = (random(Math.floor(wild_factor * 100)) - random(Math.floor(wild_factor * 100))) / 2000;
radians = Math.atan(dy / dx) + variation;
if (dx < 0) {
radians = radians + Math.PI;
}
rocket.vy = Math.sin(radians) * shot_speed;
rocket.vx = Math.cos(radians) * shot_speed;
rocket._x = _x;
rocket._y = _y;
rocket._rotation = (radians * 180) / Math.PI;
}
target_elev = 50 + random(200);
hp = 20;
leaking = 0;
lift = -0.06;
shots = 0;
rocket_shots = 0;
timeToShoot = 400;
timeToShootRocket = 600;
xpos = 0;
ypos = 0;
etype = "chopper";
clip_size = Math.floor(_root.level * 0.2);
if (clip_size > 5) {
clip_size = 5;
}
b_level = 1;
Instance of Symbol 61 MovieClip "chopper_anim" in Symbol 66 MovieClip [enemy_chopper] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Instance of Symbol 35 MovieClip "hitbox" in Symbol 66 MovieClip [enemy_chopper] Frame 1
onClipEvent (load) {
_alpha = 0;
}
Instance of Symbol 35 MovieClip "weakspot" in Symbol 66 MovieClip [enemy_chopper] Frame 1
onClipEvent (load) {
_alpha = 0;
}
Instance of Symbol 92 MovieClip in Symbol 93 MovieClip Frame 1
onClipEvent (load) {
if (_root.age < 17) {
this.unloadMovie();
}
}
Symbol 94 MovieClip Frame 65
stop();
Symbol 95 MovieClip [body_dieing] Frame 1
function step() {
if ((count++) > 100) {
_alpha = (_alpha - 2);
if (_alpha < 0) {
this.unloadMovie();
}
}
}
Instance of Symbol 94 MovieClip in Symbol 95 MovieClip [body_dieing] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Symbol 98 MovieClip Frame 24
this.unloadMovie();
Instance of Symbol 98 MovieClip in Symbol 99 MovieClip [smoke] Frame 1
onClipEvent (load) {
_rotation = random(360);
rate = (random(100) - 50) / 10;
}
onClipEvent (enterFrame) {
_rotation = (_rotation + rate);
}
Symbol 102 MovieClip Frame 1
stop();
Symbol 102 MovieClip Frame 70
gotoAndPlay (10);
Symbol 102 MovieClip Frame 142
gotoAndPlay (135);
Symbol 103 MovieClip [enemy1] Frame 1
function step() {
xpos = _x;
ypos = _y;
if (vx > 0) {
_xscale = -100;
} else {
_xscale = 100;
}
if ((timeToCheckDirection++) > 100) {
timeToCheckDirection = 0;
dx = _x - _root.hero._x;
if (dx > 0) {
vx = -speed;
} else {
vx = speed;
}
}
bottom = _root.ground.ground_body.hitTest(_x, _y, 1);
grounded = _root.ground.ground_body.hitTest(_x, _y + 2, 1);
if (bottom) {
if (delta > 0) {
delta = 0;
}
delta = delta - 0.1;
vy = delta;
} else if (delta < 0) {
delta = 0;
vy = 0;
}
if (!shooting) {
count = count + 1;
if (count > 60) {
count = 0;
}
vy = vy + _root.gravity;
_x = (_x + vx);
_y = (_y + vy);
body.gotoAndStop(count + mode);
} else {
shooting = (shootCount++) < 10;
}
if (((_x < -40) || (_x > xmax)) || (_y > ymax)) {
_root.removeEnemy(this);
}
if (hp <= 0) {
trace(("DEATH CODE: " + deathCode) + " !!!!!!!!!!!!!!!");
if (deathCode == "exploded") {
_root.increaseScore(5, _x, _y);
if (explosion_impact > 25) {
_root.addBloodExplosion(_x, _y - 20);
} else {
lvl = _root.getNextDebrisLevel();
temp = _root.addObj("blood_stump", _root.debris_layer, lvl);
temp._x = _x;
temp._y = _y - 5;
temp.vx = explosion_dx;
temp.vy = explosion_dy;
temp._rotation = random(360);
}
} else if (deathCode == "head_shot") {
_root.increaseScore(15, _x, _y);
_alpha = 0;
_root.addBloodExplosionAmt(_x, _y - 20, 5);
_root.placeDeadBody("body_dieing2", _x, _y, vx);
} else {
_root.increaseScore(10, _x, _y);
_alpha = 0;
lvl = _root.getNextDebrisLevel();
temp = _root.addObj("blood_stump", _root.debris_layer, lvl);
temp._x = _x;
temp._y = _y;
temp.vx = vx;
temp.vy = vy;
}
_root.removeEnemy(this);
}
if ((timeToShoot--) <= 0) {
shoot();
if ((shot_count++) >= clip_size) {
shot_count = 0;
timeToShoot = (200 + random(100)) - (_root.level * 5);
if (timeToShoot < 100) {
timeToShoot = 100;
}
} else {
timeToShoot = 10;
}
}
if ((timeToNade--) <= 0) {
dist = Math.abs(_root.hero._x - _x);
if ((dist < 300) && (dist > 100)) {
throwNade();
}
timeToNade = 600 + random(600);
}
}
function shoot() {
_root.playSound("tat3.wav");
shootCount = 1;
shooting = true;
body.gotoAndPlay("shooting");
bullet = _root.addObj("enemy_bullet", _root.enemy_bullet_layer, _root.getNextEnemyBulletLevel());
shot_speed = 2 * (1 + (_root.level * 0.02));
if (shot_speed > 8) {
shot_speed = 8;
}
wild_factor = 4;
dx = _root.hero._x - _x;
dy = _root.hero._y - _y;
variation = (random(Math.floor(wild_factor * 100)) - random(Math.floor(wild_factor * 100))) / 2000;
radians = Math.atan(dy / dx) + variation;
if (dx < 0) {
radians = radians + Math.PI;
}
bullet.vy = Math.sin(radians) * shot_speed;
bullet.vx = Math.cos(radians) * shot_speed;
bullet._x = _x;
bullet._y = _y - half_height;
bullet._rotation = (radians * 180) / Math.PI;
}
function throwNade() {
dx = _root.hero._x - _x;
dy = _root.hero._y - _y;
lvx = dx / 120;
lvy = -3 + (dy / 100);
lvl = _root.getNextEnemyBulletLevel();
proj = _root.addObj("hero_grenade", _root.enemy_bullet_layer, lvl);
proj.vx = lvx;
proj.vy = lvy;
proj._x = _x;
proj._y = _y - half_height;
}
function takeDamage(dmg, x, y, vx, vy) {
_root.playHitEnemySound();
if (weakspot.hitTest(x, y, 0)) {
deathCode = "head_shot";
hp = 0;
c = 0;
while (c < 3) {
blood = _root.addObj("blood_drop", _root.debris_layer, _root.getNextDebrisLevel());
blood._x = x;
blood._y = y;
blood.vx = (vx / 3) + ((random(10) - random(10)) / 10);
blood.vy = (vy / 3) + ((random(10) - random(10)) / 10);
blood._xscale = (blood._yscale = 100 + random(200));
c++;
}
} else {
hp = hp - dmg;
c = 0;
while (c < 1) {
blood = _root.addObj("blood_drop", _root.debris_layer, _root.getNextDebrisLevel());
blood._x = x;
blood._y = y;
blood.vx = (vx / 3) + ((random(10) - random(10)) / 10);
blood.vy = (vy / 3) + ((random(10) - random(10)) / 10);
blood._xscale = (blood._yscale = 100 + random(200));
c++;
}
}
}
stop();
mode = 71;
count = random(100);
animFactor = 0.1;
speed = _root.g_enSpeed;
helmAlpha = random(2) * 100;
hp = 5 + Math.floor(_root.level * 0.25);
timeToCheckDirection = 0;
half_height = _height / 2;
explosion_dist = 0;
timeToShoot = 300 + random(300);
timeToNade = 400 + random(600);
shot_count = 0;
speed = 0.5;
xpos = 0;
ypos = 0;
shootCount = 0;
shooting = false;
xmax = _root.g_width + 40;
ymax = _root.g_ground + 40;
etype = "troop";
clip_size = Math.floor(_root.level / 6);
if (clip_size > 5) {
clip_size = 5;
}
Instance of Symbol 35 MovieClip "hitbox" in Symbol 103 MovieClip [enemy1] Frame 1
onClipEvent (load) {
_alpha = 0;
}
Instance of Symbol 102 MovieClip "body" in Symbol 103 MovieClip [enemy1] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Instance of Symbol 35 MovieClip "weakspot" in Symbol 103 MovieClip [enemy1] Frame 1
onClipEvent (load) {
_alpha = 0;
}
Symbol 106 MovieClip [hero_shrap] Frame 1
function step() {
_y = (_y + vy);
_x = (_x + vx);
if ((((_y < -10) || (_x < -10)) || (_x > xmax)) || (_y > ymax)) {
this.unloadMovie();
}
if ((_y > 345) && (!splashed)) {
splashed = true;
_alpha = 0;
_root.addSplash(_x, _y);
}
testHitEnemies();
testHitObstructions();
}
function testHitEnemies() {
for (i in _root.enemies) {
if (_root.enemies[i].hitbox.hitTest(_x, _y, 0)) {
_root.enemies[i].takeDamage(3, _x, _y, vx, vy);
_root.addSpark("spark", _x, _y, 3);
this.unloadMovie();
}
}
}
function testHitObstructions() {
if (_root.ground.ground_body.hitTest(_x, _y, 1)) {
if (!splashed) {
_root.playSound("bomb.wav");
temp = _root.addObj("bullet_hole", _root.ground.blood_layer, _root.getNextBloodLevel());
temp._x = _x;
temp._y = _y;
}
this.unloadMovie();
}
for (i in _root.obstructions) {
if (_root.obstructions[i].hitTest(_x, _y, 0)) {
_root.obstructions[i].takeDamage(3, _x, _y, vx, vy);
_root.addSpark("spark_dust", _x, _y, 3);
_root.playSound("bomb.wav");
this.unloadMovie();
}
}
}
xmax = _root.g_width + 10;
ymax = _root.g_ground + 10;
splashed = false;
Instance of Symbol 105 MovieClip in Symbol 106 MovieClip [hero_shrap] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Symbol 109 MovieClip [hero_bullet] Frame 1
function step() {
_y = (_y + vy);
_x = (_x + vx);
if ((((_y < -10) || (_x < -10)) || (_x > xmax)) || (_y > ymax)) {
this.unloadMovie();
}
if ((_y > 345) && (!splashed)) {
splashed = true;
_alpha = 0;
_root.addSplash(_x, _y);
}
testHitEnemies();
testHitObstructions();
}
function testHitEnemies() {
for (i in _root.enemies) {
if (_root.enemies[i].hitbox.hitTest(_x, _y, 0)) {
_root.enemies[i].takeDamage(3, _x, _y, vx, vy);
_root.addSpark("spark", _x, _y, 3);
this.unloadMovie();
}
}
}
function testHitObstructions() {
if (_root.ground.ground_body.hitTest(_x, _y, 1)) {
if (!splashed) {
_root.playSound("bomb.wav");
temp = _root.addObj("bullet_hole", _root.ground.blood_layer, _root.getNextBloodLevel());
temp._x = _x;
temp._y = _y;
}
this.unloadMovie();
}
for (i in _root.obstructions) {
if (_root.obstructions[i].hitTest(_x, _y, 0)) {
_root.obstructions[i].takeDamage(3, _x, _y, vx, vy);
_root.addSpark("spark_dust", _x, _y, 3);
_root.playSound("bomb.wav");
this.unloadMovie();
}
}
}
xmax = _root.g_width + 10;
ymax = _root.g_ground + 10;
splashed = false;
Instance of Symbol 108 MovieClip in Symbol 109 MovieClip [hero_bullet] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Symbol 112 MovieClip [hero_grenade] Frame 1
function step() {
if (bounceCount < 3) {
if (vx > 0) {
_rotation = (_rotation + 3);
} else {
_rotation = (_rotation - 3);
}
vy = vy + _root.gravity;
xprev = _x;
yprev = _y;
_y = (_y + vy);
_x = (_x + vx);
if ((((_y < -10) || (_x < -10)) || (_x > xmax)) || (_y > ymax)) {
this.unloadMovie();
}
if ((timeToTest--) <= 0) {
testHitObstructions();
timeToTest = 5;
}
}
if ((timer--) < 0) {
_root.addExplosion(_x, _y, 60, 20);
this.unloadMovie();
}
}
function testHitEnemies() {
for (i in _root.enemies) {
if (_root.enemies[i].hitTest(_x, _y, 0)) {
_root.enemies[i].takeDamage(dmg);
_root.addSpark("spark", _x, _y, 3);
_root.playHitEnemySound();
this.unloadMovie();
}
}
}
function testHitObstructions() {
if (_y > max_obs_elevation) {
bottom = _root.ground.ground_body.hitTest(_x, _y + 1, 1);
left = _root.ground.ground_body.hitTest(_x - 1, _y, 1);
right = _root.ground.ground_body.hitTest(_x + 1, _y, 1);
if (bottom) {
bounceCount++;
_x = xprev;
_y = yprev;
vy = vy * -0.3;
vx = vx * 0.3;
} else if (left || (right)) {
bounceCount++;
_x = xprev;
_y = yprev;
vx = vx * -0.3;
}
}
if (_y > max_obs_elevation) {
for (i in _root.obstructions) {
bottom = _root.obstructions[i].hitTest(_x, _y, 0);
if (bottom) {
_x = xprev;
_y = yprev;
vy = vy * -0.3;
vx = vx * -0.3;
}
}
}
}
xmax = _root.g_width + 10;
ymax = _root.g_ground + 10;
timer = 150;
max_obs_elevation = 220;
bounceCount = 0;
Instance of Symbol 111 MovieClip in Symbol 112 MovieClip [hero_grenade] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Symbol 115 MovieClip [explosion] Frame 10
this.unloadMovie();
Symbol 118 MovieClip [debris2] Frame 1
function step() {
if (vx > 0) {
_rotation = (_rotation + rot_rate);
} else {
_rotation = (_rotation - rot_rate);
}
vy = vy + _root.gravity;
xprev = _x;
yprev = _y;
_y = (_y + vy);
_x = (_x + vx);
if ((((_y < -10) || (_x < -10)) || (_x > xmax)) || (_y > ymax)) {
this.unloadMovie();
}
if (timer < 15) {
_alpha = (_alpha - 5);
}
if ((timer--) < 0) {
this.unloadMovie();
}
}
function testHitEnemies() {
for (i in _root.enemies) {
if (_root.enemies[i].hitTest(_x, _y, 0)) {
_root.enemies[i].takeDamage(dmg);
_root.addSpark("spark", _x, _y, 3);
_root.playHitEnemySound();
this.unloadMovie();
}
}
}
function testHitObstructions() {
for (i in _root.obstructions) {
top = _root.obstructions[i].hitTest(_x, _y - 1, 1);
bottom = _root.obstructions[i].hitTest(_x, _y + 1, 1);
left = _root.obstructions[i].hitTest(_x - 1, _y, 1);
right = _root.obstructions[i].hitTest(_x + 1, _y, 1);
b_right = _root.obstructions[i].hitTest(_x + 0.7071, _y + 0.7071, 1);
b_left = _root.obstructions[i].hitTest(_x - 0.7071, _y + 0.7071, 1);
if (top || (bottom)) {
_x = xprev;
_y = yprev;
vy = vy * -0.5;
vx = vx * 0.5;
rot_rate = rot_rate * 0.5;
} else if (bottom && (b_right || (b_left))) {
_x = xprev;
_y = yprev;
vy = vy * -0.5;
vx = vx * -0.5;
rot_rate = rot_rate * 0.5;
} else if (b_right || (b_left)) {
_x = xprev;
_y = yprev;
vy = vy * -0.5;
vx = vx * -0.5;
rot_rate = rot_rate * 0.5;
} else if (left || (right)) {
_x = xprev;
_y = yprev;
vx = vx * -0.5;
rot_rate = rot_rate * 0.5;
}
}
}
xmax = _root.g_width + 10;
ymax = _root.g_ground + 10;
timer = 50 + random(20);
rot_rate = 6;
timeToSmoke = 10;
Instance of Symbol 117 MovieClip in Symbol 118 MovieClip [debris2] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Symbol 119 MovieClip [debris1] Frame 1
function step() {
if (vx > 0) {
_rotation = (_rotation + rot_rate);
} else {
_rotation = (_rotation - rot_rate);
}
vy = vy + _root.gravity;
xprev = _x;
yprev = _y;
_y = (_y + vy);
_x = (_x + vx);
if ((((_y < -10) || (_x < -10)) || (_x > xmax)) || (_y > ymax)) {
this.unloadMovie();
}
if (timer < 20) {
_alpha = (_alpha - 5);
}
if ((timer--) < 0) {
this.unloadMovie();
}
if ((timeToSmoke--) < 0) {
timeToSmoke = 1;
if ((smoke_count++) < 10) {
_root.placeSmoke(_x, _y);
}
}
}
function testHitEnemies() {
for (i in _root.enemies) {
if (_root.enemies[i].hitTest(_x, _y, 0)) {
_root.enemies[i].takeDamage(dmg);
_root.addSpark("spark", _x, _y, 3);
_root.playHitEnemySound();
this.unloadMovie();
}
}
}
function testHitObstructions() {
for (i in _root.obstructions) {
top = _root.obstructions[i].hitTest(_x, _y - 1, 1);
bottom = _root.obstructions[i].hitTest(_x, _y + 1, 1);
left = _root.obstructions[i].hitTest(_x - 1, _y, 1);
right = _root.obstructions[i].hitTest(_x + 1, _y, 1);
b_right = _root.obstructions[i].hitTest(_x + 0.7071, _y + 0.7071, 1);
b_left = _root.obstructions[i].hitTest(_x - 0.7071, _y + 0.7071, 1);
if (top || (bottom)) {
_x = xprev;
_y = yprev;
vy = vy * -0.5;
vx = vx * 0.5;
rot_rate = rot_rate * 0.5;
} else if (bottom && (b_right || (b_left))) {
_x = xprev;
_y = yprev;
vy = vy * -0.5;
vx = vx * -0.5;
rot_rate = rot_rate * 0.5;
} else if (b_right || (b_left)) {
_x = xprev;
_y = yprev;
vy = vy * -0.5;
vx = vx * -0.5;
rot_rate = rot_rate * 0.5;
} else if (left || (right)) {
_x = xprev;
_y = yprev;
vx = vx * -0.5;
rot_rate = rot_rate * 0.5;
}
}
}
xmax = _root.g_width + 10;
ymax = _root.g_ground + 10;
timer = 50 + random(20);
rot_rate = 6;
timeToSmoke = 0;
Instance of Symbol 117 MovieClip in Symbol 119 MovieClip [debris1] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Symbol 122 MovieClip [blood_splat] Frame 1
function step() {
if ((count++) > 500) {
_alpha = (_alpha-1);
if (_alpha <= 0) {
this.unloadMovie();
}
}
}
Instance of Symbol 121 MovieClip in Symbol 122 MovieClip [blood_splat] Frame 1
onClipEvent (load) {
if (_root.age < 17) {
this.unloadMovie();
}
}
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Symbol 125 MovieClip [blood_drop] Frame 1
function step() {
vy = vy + mygrav;
_x = (_x + vx);
_y = (_y + vy);
if (_root.ground.ground_body.hitTest(_x, _y, 1)) {
lvl = _root.getNextBloodLevel();
temp = _root.addObj("blood_splat", _root.ground.blood_layer, lvl);
temp._x = _x;
temp._y = _y;
temp._rotation = random(360);
temp._xscale = (temp._yscale = _xscale);
this.unloadMovie();
} else if (((_x > xmax) || (_x < -10)) || (_y > ymax)) {
this.unloadMovie();
}
}
xmax = _root.g_width + 10;
ymax = _root.g_ground + 10;
mygrav = _root.gravity * 2;
Instance of Symbol 124 MovieClip in Symbol 125 MovieClip [blood_drop] Frame 1
onClipEvent (load) {
if (_root.age < 17) {
this.unloadMovie();
}
}
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Symbol 150 MovieClip Frame 1
stop();
Symbol 150 MovieClip Frame 70
gotoAndPlay (10);
Symbol 151 MovieClip [blood_stump_fem] Frame 1
function step() {
if (vx > 0) {
_rotation = (_rotation + rot_rate);
} else {
_rotation = (_rotation - rot_rate);
}
vy = vy + _root.gravity;
xprev = _x;
yprev = _y;
_y = (_y + vy);
_x = (_x + vx);
if ((((_y < -10) || (_x < -10)) || (_x > xmax)) || (_y > ymax)) {
this.unloadMovie();
}
if ((timer--) < 0) {
this.unloadMovie();
}
testHitObstructions();
}
function testHitEnemies() {
for (i in _root.enemies) {
if (_root.enemies[i].hitTest(_x, _y, 0)) {
_root.enemies[i].takeDamage(dmg);
_root.addSpark("spark", _x, _y, 3);
_root.playHitEnemySound();
this.unloadMovie();
}
}
}
function testHitObstructions() {
hitstruct = false;
for (ndx in _root.structures) {
if (_root.structures[ndx].hitTest(_x, _y, 0)) {
if (Math.abs(vy) > 4) {
_root.placeBlood(_x, _y);
}
_root.placeDeadBody("enemy_sniper_death", _x, _y, vx);
this.unloadMovie();
}
}
if (_root.ground.ground_body.hitTest(_x, _y + 2, 1)) {
if (Math.abs(vy) > 4) {
_root.placeBlood(_x, _y);
}
_root.placeDeadBody("enemy_sniper_death", _x, _y, vx);
this.unloadMovie();
}
}
xmax = _root.g_width + 10;
ymax = _root.g_ground + 10;
timer = 500 + random(50);
rot_rate = random(3) + 3;
timeToSplat = 10;
blood_count = 0;
if (vx < 0) {
_xscale = -100;
}
testHitObstructions();
Instance of Symbol 150 MovieClip in Symbol 151 MovieClip [blood_stump_fem] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Symbol 152 MovieClip [anim_dead_body] Frame 1
stop();
Symbol 152 MovieClip [anim_dead_body] Frame 75
stop();
Symbol 153 MovieClip [blood_stump] Frame 1
function step() {
if (vx > 0) {
_rotation = (_rotation + rot_rate);
} else {
_rotation = (_rotation - rot_rate);
}
vy = vy + _root.gravity;
xprev = _x;
yprev = _y;
_y = (_y + vy);
_x = (_x + vx);
if ((((_y < -10) || (_x < -10)) || (_x > xmax)) || (_y > ymax)) {
this.unloadMovie();
}
if ((timer--) < 0) {
this.unloadMovie();
}
testHitObstructions();
}
function testHitEnemies() {
for (i in _root.enemies) {
if (_root.enemies[i].hitTest(_x, _y, 0)) {
_root.enemies[i].takeDamage(dmg);
_root.addSpark("spark", _x, _y, 3);
_root.playHitEnemySound();
this.unloadMovie();
}
}
}
function testHitObstructions() {
if (_root.ground.ground_body.hitTest(_x, _y + 2, 1)) {
if (Math.abs(vy) > 4) {
_root.placeBlood(_x, _y);
}
_root.placeDeadBody("body_dieing", _x, _y, vx);
this.unloadMovie();
}
}
xmax = _root.g_width + 10;
ymax = _root.g_ground + 10;
timer = 500 + random(50);
rot_rate = random(3) + 3;
timeToSplat = 10;
blood_count = 0;
if (vx < 0) {
_xscale = -100;
}
testHitObstructions();
Instance of Symbol 152 MovieClip [anim_dead_body] "body" in Symbol 153 MovieClip [blood_stump] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Symbol 156 MovieClip [crater2] Frame 1
function step() {
if ((count++) > 500) {
_alpha = (_alpha-1);
if (_alpha <= 0) {
this.unloadMovie();
}
}
}
Instance of Symbol 155 MovieClip in Symbol 156 MovieClip [crater2] Frame 1
onClipEvent (load) {
if (_root.age < 17) {
this.unloadMovie();
}
}
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Symbol 161 MovieClip Frame 1
stop();
Symbol 161 MovieClip Frame 70
gotoAndPlay (10);
Symbol 162 MovieClip [enemy_drop_sniper] Frame 1
function step() {
xpos = _x;
ypos = _y;
vx = vx + ((random(100) - 50) / 2000);
_y = (_y + (2 + extra_fall));
_x = (_x + vx);
hitstruct = false;
for (ndx in _root.structures) {
if (_root.structures[ndx].hitTest(_x, _y, 1)) {
hitstruct = true;
break;
}
}
bottom = _root.ground.ground_body.hitTest(_x, _y, 1);
if (bottom || (hitstruct)) {
chute = _root.addObj("parachute_fade", _root.debris_layer, _root.getNextDebrisLevel());
chute._x = _x;
chute._y = _y - 32.3;
dx = _root.hero._x - _x;
dir = Math.abs(dx) / dx;
_root.placeEnemy("enemy_sniper", _x, _y, 0, 0);
_root.removeEnemy(this);
}
if (hp <= 0) {
_root.increaseScore(10, _x, _y);
chute = _root.addObj("parachute_fade", _root.debris_layer, _root.getNextDebrisLevel());
chute._x = _x;
chute._y = _y - 32.3;
if (explosion_impact > 12) {
_root.addBloodExplosion(_x, _y - 20);
} else {
_root.addFemBloodyStump(_x, _y, vx, 0);
}
_root.removeEnemy(this);
}
if ((timeToShoot--) <= 0) {
timeToShoot = 200 + random(100);
}
}
function shoot() {
bullet = _root.addObj("enemy_bullet", _root.enemy_bullet_layer, _root.getNextEnemyBulletLevel());
shot_speed = 2;
wild_factor = 4;
dx = _root.hero._x - _x;
dy = _root.hero._y - _y;
variation = (random(Math.floor(wild_factor * 100)) - random(Math.floor(wild_factor * 100))) / 1000;
radians = Math.atan(dy / dx) + variation;
if (dx < 0) {
radians = radians + Math.PI;
}
bullet.vy = Math.sin(radians) * shot_speed;
bullet.vx = Math.cos(radians) * shot_speed;
bullet._x = _x;
bullet._y = _y - half_height;
bullet._rotation = (radians * 180) / Math.PI;
}
function throwNade() {
dx = _root.hero._x - _x;
dy = _root.hero._y - _y;
lvx = dx / 100;
lvy = -2 + (dy / 100);
lvl = _root.getNextEnemyBulletLevel();
proj = _root.addObj("hero_grenade", _root.enemy_bullet_layer, lvl);
proj.vx = lvx;
proj.vy = lvy;
proj._x = _x;
proj._y = _y - half_height;
}
function takeDamage(dmg, x, y, vx, vy) {
_root.playHitEnemySound();
if (weakspot.hitTest(x, y, 0)) {
_root.increaseScore(20, _x, _y);
hp = 0;
c = 0;
while (c < 3) {
blood = _root.addObj("blood_drop", _root.debris_layer, _root.getNextDebrisLevel());
blood._x = x;
blood._y = y;
blood.vx = (vx / 3) + ((random(10) - random(10)) / 10);
blood.vy = (vy / 3) + ((random(10) - random(10)) / 10);
blood._xscale = (blood._yscale = 100 + random(200));
c++;
}
} else {
hp = hp - dmg;
c = 0;
while (c < 1) {
blood = _root.addObj("blood_drop", _root.debris_layer, _root.getNextDebrisLevel());
blood._x = x;
blood._y = y;
blood.vx = (vx / 3) + ((random(10) - random(10)) / 10);
blood.vy = (vy / 3) + ((random(10) - random(10)) / 10);
blood._xscale = (blood._yscale = 100 + random(200));
c++;
}
}
}
hp = 5;
xpos = 0;
ypos = 0;
timeToShoot = 50;
half_height = _height / 2;
extra_fall = _root.level * 0.1;
etype = "troop";
Instance of Symbol 35 MovieClip "hitbox" in Symbol 162 MovieClip [enemy_drop_sniper] Frame 1
onClipEvent (load) {
_alpha = 0;
}
Instance of Symbol 161 MovieClip in Symbol 162 MovieClip [enemy_drop_sniper] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Instance of Symbol 35 MovieClip "weakspot" in Symbol 162 MovieClip [enemy_drop_sniper] Frame 1
onClipEvent (load) {
_alpha = 0;
}
Symbol 163 MovieClip Frame 1
stop();
Symbol 163 MovieClip Frame 70
gotoAndPlay (10);
Symbol 164 MovieClip [enemy_drop] Frame 1
function step() {
xpos = _x;
ypos = _y;
vx = vx + ((random(100) - 50) / 2000);
_y = (_y + (1.5 + extra_fall));
_x = (_x + vx);
bottom = _root.ground.ground_body.hitTest(_x, _y, 1);
if (bottom) {
chute = _root.addObj("parachute_fade", _root.debris_layer, _root.getNextDebrisLevel());
chute._x = _x;
chute._y = _y - 32.3;
dx = _root.hero._x - _x;
dir = Math.abs(dx) / dx;
_root.placeEnemy("enemy1", _x, _y, 0.5 * dir, vy);
_root.removeEnemy(this);
}
if (hp <= 0) {
_root.increaseScore(10, _x, _y);
chute = _root.addObj("parachute_fade", _root.debris_layer, _root.getNextDebrisLevel());
chute._x = _x;
chute._y = _y - 32.3;
if (explosion_impact > 12) {
_root.addBloodExplosion(_x, _y - 20);
} else {
_root.addBloodyStump(_x, _y, vx, 0);
}
_root.removeEnemy(this);
}
if ((timeToShoot--) <= 0) {
shoot();
timeToShoot = 200 + random(100);
}
}
function shoot() {
_root.playSound("tat3.wav");
bullet = _root.addObj("enemy_bullet", _root.enemy_bullet_layer, _root.getNextEnemyBulletLevel());
shot_speed = 2;
wild_factor = 4;
dx = _root.hero._x - _x;
dy = _root.hero._y - _y;
variation = (random(Math.floor(wild_factor * 100)) - random(Math.floor(wild_factor * 100))) / 1000;
radians = Math.atan(dy / dx) + variation;
if (dx < 0) {
radians = radians + Math.PI;
}
bullet.vy = Math.sin(radians) * shot_speed;
bullet.vx = Math.cos(radians) * shot_speed;
bullet._x = _x;
bullet._y = _y - half_height;
bullet._rotation = (radians * 180) / Math.PI;
}
function throwNade() {
dx = _root.hero._x - _x;
dy = _root.hero._y - _y;
lvx = dx / 100;
lvy = -2 + (dy / 100);
lvl = _root.getNextEnemyBulletLevel();
proj = _root.addObj("hero_grenade", _root.enemy_bullet_layer, lvl);
proj.vx = lvx;
proj.vy = lvy;
proj._x = _x;
proj._y = _y - half_height;
}
function takeDamage(dmg, x, y, vx, vy) {
_root.playHitEnemySound();
if (weakspot.hitTest(x, y, 0)) {
_root.increaseScore(20, _x, _y);
hp = 0;
c = 0;
while (c < 3) {
blood = _root.addObj("blood_drop", _root.debris_layer, _root.getNextDebrisLevel());
blood._x = x;
blood._y = y;
blood.vx = (vx / 3) + ((random(10) - random(10)) / 10);
blood.vy = (vy / 3) + ((random(10) - random(10)) / 10);
blood._xscale = (blood._yscale = 100 + random(200));
c++;
}
} else {
hp = hp - dmg;
c = 0;
while (c < 1) {
blood = _root.addObj("blood_drop", _root.debris_layer, _root.getNextDebrisLevel());
blood._x = x;
blood._y = y;
blood.vx = (vx / 3) + ((random(10) - random(10)) / 10);
blood.vy = (vy / 3) + ((random(10) - random(10)) / 10);
blood._xscale = (blood._yscale = 100 + random(200));
c++;
}
}
}
hp = 5;
xpos = 0;
ypos = 0;
timeToShoot = 50;
half_height = _height / 2;
extra_fall = _root.level * 0.1;
etype = "troop";
Instance of Symbol 35 MovieClip "hitbox" in Symbol 164 MovieClip [enemy_drop] Frame 1
onClipEvent (load) {
_alpha = 0;
}
Instance of Symbol 163 MovieClip in Symbol 164 MovieClip [enemy_drop] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Instance of Symbol 35 MovieClip "weakspot" in Symbol 164 MovieClip [enemy_drop] Frame 1
onClipEvent (load) {
_alpha = 0;
}
Symbol 165 MovieClip [parachute_fade] Frame 20
this.unloadMovie();
Symbol 169 MovieClip [gas_can] Frame 1
function step() {
frame = maxhp - hp;
if (frame < 1) {
frame = 1;
}
frame = Math.floor(frame);
can_animation.gotoAndStop(frame);
if (hp <= 0) {
_root.addExplosionType(_x, _y, 100, 50, "debris_flame");
_root.removeObstruction(this);
}
hp = hp - leaking;
}
function takeDamage(amt, x, y, vx, vy) {
hp = hp - amt;
}
hp = 5;
maxhp = 5;
placed = false;
_root.obstructions.push(this);
Instance of Symbol 168 MovieClip "can_animation" in Symbol 169 MovieClip [gas_can] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Symbol 172 MovieClip [enemy_bullet] Frame 1
function step() {
_y = (_y + vy);
_x = (_x + vx);
if ((((_y < -10) || (_x < -10)) || (_x > xmax)) || (_y > ymax)) {
this.unloadMovie();
}
if ((_y > 345) && (!splashed)) {
splashed = true;
_alpha = 0;
_root.addSplash(_x, _y);
}
testHitHero();
testHitObstructions();
}
function testHitHero() {
if (_root.hero.hitbox.hitTest(_x, _y, 0)) {
_root.hero.takeDamage(3);
c = 0;
while (c < 3) {
blood = _root.addObj("blood_drop", _root.debris_layer, _root.getNextDebrisLevel());
blood._x = _x;
blood._y = _y;
blood.vx = (vx / 3) + ((random(10) - random(10)) / 10);
blood.vy = (vy / 3) + ((random(10) - random(10)) / 10);
blood._xscale = (blood._yscale = 100 + random(200));
c++;
}
this.unloadMovie();
}
}
function testHitObstructions() {
if (_root.ground.ground_body.hitTest(_x, _y, 1)) {
if (!splashed) {
_root.playSound("bomb.wav");
temp = _root.addObj("bullet_hole", _root.ground.blood_layer, _root.getNextBloodLevel());
temp._x = _x;
temp._y = _y;
}
this.unloadMovie();
}
for (i in _root.obstructions) {
if (_root.obstructions[i].hitTest(_x, _y, 0)) {
_root.obstructions[i].takeDamage(3);
_root.addSpark("spark_dust", _x, _y, 3);
_root.playSound("bomb.wav");
this.unloadMovie();
}
}
}
xmax = _root.g_width + 10;
ymax = _root.g_ground + 10;
splashed = false;
Instance of Symbol 171 MovieClip in Symbol 172 MovieClip [enemy_bullet] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Symbol 176 MovieClip [enemy_a10] Frame 1
function step() {
xpos = _x;
ypos = _y;
if (hp > 0) {
bomber_anim.gotoAndStop(101 - Math.floor((100 * hp) / maxhp));
_x = (_x + vx);
_y = (_y + vy);
if (((timeToBomb--) <= 0) && (ammo > 0)) {
ammo--;
timeToBomb = 50;
dropBomb();
}
} else {
if (!scored_kill) {
scored_kill = true;
_root.increaseScore(10, _x, _y);
}
if (vx > 0) {
_rotation = (_rotation + 0.1);
} else {
_rotation = (_rotation - 0.1);
}
vy = vy + half_grav;
_x = (_x + vx);
_y = (_y + vy);
hitstruct = false;
for (ndx in _root.structures) {
if (_root.structures[ndx].hitTest(_x, _y, 1)) {
hitstruct = true;
break;
}
}
bottom = _root.ground.ground_body.hitTest(_x, _y + 2, 1) || (hitstruct);
if (bottom) {
_root.addExplosion(_x, _y, 70, 40);
lvl = _root.getNextDebrisLevel();
temp = _root.addObj("a10_dead", _root.debris_layer, lvl);
temp._x = _x;
temp._y = _y;
temp._xscale = _xscale;
_root.removeEnemy(this);
}
}
if ((_x > xmax) || (_x < -60)) {
_root.removeEnemy(this);
}
}
function getNextBulletHoleLevel() {
if ((b_level++) > 8) {
b_level = 1;
}
return(b_level);
}
function takeDamage(dmg, x, y, vx, vy) {
dmg_amt = dmg;
spark_amt = random(2);
if ((!exploded) && (weakspot.hitTest(x, y, 0))) {
_root.addExplosion(x, y, 15, 5);
exploded = true;
dmg_amt = dmg_amt + 1000;
spark_amt = spark_amt + random(2);
}
trace("Taking Damage!!!!!!!!!!!!!!!!!!");
trace("Damage: " + dmg);
_root.playSound("ching1.wav");
hp = hp - dmg_amt;
c = 0;
while (c < spark_amt) {
blood = _root.addObj("debris2", _root.debris_layer, _root.getNextDebrisLevel());
blood._x = x;
blood._y = y;
blood.vx = (vx / 3) + ((random(10) - random(10)) / 10);
blood.vy = (vy / 3) + ((random(10) - random(10)) / 10);
blood._xscale = (blood._yscale = 50 + random(100));
c++;
}
xnew = x - _x;
ynew = y - _y;
if (_xscale < 0) {
xnew = xnew * -1;
}
temp = _root.addObj("bullet_hole2", bullet_hole_layer, getNextBulletHoleLevel());
temp._x = xnew;
temp._y = ynew;
}
function dropBomb() {
_root.playSound("firecat3.wav");
temp = _root.addObj("enemy_bomb_drop_napalm", _root.bomb_layer, _root.getNextBombLevel());
temp._x = _x;
temp._y = _y + 5;
temp.vx = vx / 5;
}
maxhp = 40;
hp = 40;
xmax = _root.g_width + 60;
ymax = _root.g_ground + 60;
xpos = 0;
ypos = 0;
timeToBomb = 75;
half_grav = _root.gravity / 2;
ammo = Math.ceil(_root.level * 0.2);
etype = "plane";
if (vx < 0) {
_xscale = -100;
} else {
_xscale = 100;
}
b_level = 1;
exploded = false;
Instance of Symbol 35 MovieClip "hitbox" in Symbol 176 MovieClip [enemy_a10] Frame 1
onClipEvent (load) {
_alpha = 0;
}
Instance of Symbol 35 MovieClip "weakspot" in Symbol 176 MovieClip [enemy_a10] Frame 1
onClipEvent (load) {
_alpha = 0;
}
Instance of Symbol 174 MovieClip in Symbol 176 MovieClip [enemy_a10] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Symbol 183 MovieClip [enemy_bomber] Frame 1
function step() {
xpos = _x;
ypos = _y;
if (hp > 0) {
bomber_anim.gotoAndStop(101 - Math.floor((100 * hp) / maxhp));
_x = (_x + vx);
_y = (_y + vy);
if (((timeToBomb--) <= 0) && (ammo > 0)) {
timeToBomb = 120;
dropBomb();
}
} else {
if (!scored_kill) {
scored_kill = true;
_root.increaseScore(10, _x, _y);
}
if (vx > 0) {
_rotation = (_rotation + 0.1);
} else {
_rotation = (_rotation - 0.1);
}
vy = vy + half_grav;
_x = (_x + vx);
_y = (_y + vy);
hitstruct = false;
for (ndx in _root.structures) {
if (_root.structures[ndx].hitTest(_x, _y, 1)) {
hitstruct = true;
break;
}
}
bottom = _root.ground.ground_body.hitTest(_x, _y + 2, 1) || (hitstruct);
if (bottom) {
_root.addExplosion(_x, _y, 70, 40);
lvl = _root.getNextDebrisLevel();
temp = _root.addObj("bomber_dead", _root.debris_layer, lvl);
temp._x = _x;
temp._y = _y;
temp._xscale = _xscale;
_root.removeEnemy(this);
}
}
if ((_x > xmax) || (_x < -60)) {
_root.removeEnemy(this);
}
}
function getNextBulletHoleLevel() {
if ((b_level++) > 8) {
b_level = 1;
}
return(b_level);
}
function takeDamage(dmg, x, y, vx, vy) {
dmg_amt = dmg;
spark_amt = random(2);
if (weakspot.hitTest(x, y, 0)) {
dmg_amt = dmg_amt + 10;
spark_amt = spark_amt + random(2);
}
trace("Taking Damage!!!!!!!!!!!!!!!!!!");
trace("Damage: " + dmg);
_root.playSound("ching1.wav");
hp = hp - dmg_amt;
c = 0;
while (c < spark_amt) {
blood = _root.addObj("debris2", _root.debris_layer, _root.getNextDebrisLevel());
blood._x = x;
blood._y = y;
blood.vx = (vx / 3) + ((random(10) - random(10)) / 10);
blood.vy = (vy / 3) + ((random(10) - random(10)) / 10);
blood._xscale = (blood._yscale = 50 + random(100));
c++;
}
xnew = x - _x;
ynew = y - _y;
if (_xscale < 0) {
xnew = xnew * -1;
}
temp = _root.addObj("bullet_hole2", bullet_hole_layer, getNextBulletHoleLevel());
temp._x = xnew;
temp._y = ynew;
}
function dropBomb() {
_root.playSound("firecat3.wav");
temp = _root.addObj("enemy_bomb_drop", _root.bomb_layer, _root.getNextBombLevel());
temp._x = _x;
temp._y = _y + 5;
temp.vx = vx;
_root.enemies.push(temp);
}
maxhp = 100;
hp = 100;
xmax = _root.g_width + 60;
ymax = _root.g_ground + 60;
xpos = 0;
ypos = 0;
timeToBomb = 100;
half_grav = _root.gravity / 2;
ammo = 3;
etype = "plane";
if (vx < 0) {
_xscale = -100;
} else {
_xscale = 100;
}
b_level = 1;
Instance of Symbol 181 MovieClip "bomber_anim" in Symbol 183 MovieClip [enemy_bomber] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Instance of Symbol 35 MovieClip "hitbox" in Symbol 183 MovieClip [enemy_bomber] Frame 1
onClipEvent (load) {
_alpha = 0;
}
Instance of Symbol 35 MovieClip "weakspot" in Symbol 183 MovieClip [enemy_bomber] Frame 1
onClipEvent (load) {
_alpha = 0;
}
Symbol 186 MovieClip [arrow_debris] Frame 1
function step() {
if ((count++) > 200) {
_alpha = (_alpha-1);
if (_alpha <= 0) {
this.unloadMovie();
}
}
}
Instance of Symbol 185 MovieClip in Symbol 186 MovieClip [arrow_debris] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Symbol 191 MovieClip [ammo_prox_mine] Frame 1
function step() {
if ((count++) > 1000) {
_alpha = (_alpha - 5);
}
if (hp <= 0) {
_root.addGrenadeExplosion(_x, _y);
_root.removeObstruction(this);
} else if (_alpha <= 0) {
_root.removeObstruction(this);
} else if (hitTest(_root.hero._x, _root.hero._y, 0)) {
_root.ammo_prox_mines = _root.ammo_prox_mines + 10;
_root.removeObstruction(this);
}
}
function takeDamage(amt, _x, _y, vx, vy) {
hp = hp - amt;
}
_root.obstructions.push(this);
hp = 20;
Instance of Symbol 190 MovieClip in Symbol 191 MovieClip [ammo_prox_mine] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Symbol 194 MovieClip [ammo_grenade] Frame 1
function step() {
if ((count++) > 1000) {
_alpha = (_alpha - 5);
}
if (hp <= 0) {
_root.addGrenadeExplosion(_x, _y);
_root.removeObstruction(this);
} else if (_alpha <= 0) {
_root.removeObstruction(this);
} else if (hitTest(_root.hero._x, _root.hero._y, 0)) {
_root.ammo_grenades = _root.ammo_grenades + 10;
_root.removeObstruction(this);
}
}
function takeDamage(amt, _x, _y, vx, vy) {
hp = hp - amt;
}
_root.obstructions.push(this);
hp = 20;
Instance of Symbol 193 MovieClip in Symbol 194 MovieClip [ammo_grenade] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Symbol 197 MovieClip [ammo_health] Frame 1
function step() {
if ((count++) > 1000) {
_alpha = (_alpha - 5);
}
if (hp <= 0) {
_root.addGrenadeExplosion(_x, _y);
_root.removeObstruction(this);
} else if (_alpha <= 0) {
_root.removeObstruction(this);
} else if (hitTest(_root.hero._x, _root.hero._y, 0)) {
_root.hero.hp = _root.hero.hp + 10;
if (_root.hero.hp > 100) {
_root.hero.hp = 100;
}
_root.removeObstruction(this);
}
}
function takeDamage(amt, _x, _y, vx, vy) {
hp = hp - amt;
}
_root.obstructions.push(this);
hp = 20;
Instance of Symbol 196 MovieClip in Symbol 197 MovieClip [ammo_health] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Symbol 200 MovieClip [ammo_arrow] Frame 1
function step() {
if ((count++) > 1000) {
_alpha = (_alpha - 5);
}
if (hp <= 0) {
_root.addGrenadeExplosion(_x, _y);
_root.removeObstruction(this);
} else if (_alpha <= 0) {
_root.removeObstruction(this);
} else if (hitTest(_root.hero._x, _root.hero._y, 0)) {
_root.ammo_arrows = _root.ammo_arrows + 20;
_root.removeObstruction(this);
}
}
function takeDamage(amt, _x, _y, vx, vy) {
hp = hp - amt;
}
_root.obstructions.push(this);
hp = 20;
Instance of Symbol 199 MovieClip in Symbol 200 MovieClip [ammo_arrow] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Symbol 205 MovieClip [ammo_gun] Frame 1
function step() {
if ((count++) > 1000) {
_alpha = (_alpha - 5);
}
if (hp <= 0) {
_root.addGrenadeExplosion(_x, _y);
_root.removeObstruction(this);
} else if (_alpha <= 0) {
_root.removeObstruction(this);
} else if (hitTest(_root.hero._x, _root.hero._y, 0)) {
_root.ammo_bullets = _root.ammo_bullets + 400;
_root.removeObstruction(this);
}
}
function takeDamage(amt, _x, _y, vx, vy) {
hp = hp - amt;
}
_root.obstructions.push(this);
hp = 20;
Instance of Symbol 204 MovieClip in Symbol 205 MovieClip [ammo_gun] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Symbol 208 MovieClip [ammo_rocket] Frame 1
function step() {
if ((count++) > 1000) {
_alpha = (_alpha - 5);
}
if (hp <= 0) {
_root.addGrenadeExplosion(_x, _y);
_root.removeObstruction(this);
} else if (_alpha <= 0) {
_root.removeObstruction(this);
} else if (hitTest(_root.hero._x, _root.hero._y, 0)) {
_root.ammo_rockets = _root.ammo_rockets + 10;
_root.removeObstruction(this);
}
}
function takeDamage(amt, _x, _y, vx, vy) {
hp = hp - amt;
}
_root.obstructions.push(this);
hp = 20;
Instance of Symbol 207 MovieClip in Symbol 208 MovieClip [ammo_rocket] Frame 1
onClipEvent (enterFrame) {
_parent.step();
}
Symbol 211 MovieClip [bullet_hole2] Frame 1
function step() {
if ((count++) > 200) {
_alpha = (_alpha-1);
if (_alpha <= 0) {
this.unloadMovie();
}
}
}
Instance of Symbol 210 MovieClip in Symbol 211 MovieClip [bullet_hole2] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Instance of Symbol 213 MovieClip in Symbol 214 MovieClip Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Symbol 215 MovieClip [bullet_hole] Frame 1
function step() {
if ((count++) > 200) {
_alpha = (_alpha-1);
if (_alpha <= 0) {
this.unloadMovie();
}
}
}
Instance of Symbol 214 MovieClip in Symbol 215 MovieClip [bullet_hole] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Symbol 219 MovieClip Frame 65
stop();
Symbol 220 MovieClip [body_dieing2] Frame 1
function step() {
if ((count++) > 100) {
_alpha = (_alpha - 2);
if (_alpha < 0) {
this.unloadMovie();
}
}
}
Instance of Symbol 219 MovieClip in Symbol 220 MovieClip [body_dieing2] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Symbol 223 MovieClip [chopper_dead] Frame 1
function step() {
if ((count++) > 100) {
_alpha = (_alpha - 2);
if (_alpha < 0) {
this.unloadMovie();
}
}
}
Instance of Symbol 222 MovieClip in Symbol 223 MovieClip [chopper_dead] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Symbol 227 MovieClip [a10_dead] Frame 1
function step() {
if ((count++) > 100) {
_alpha = (_alpha - 2);
if (_alpha < 0) {
this.unloadMovie();
}
}
}
Instance of Symbol 226 MovieClip in Symbol 227 MovieClip [a10_dead] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Symbol 230 MovieClip [bomber_dead] Frame 1
function step() {
if ((count++) > 100) {
_alpha = (_alpha - 2);
if (_alpha < 0) {
this.unloadMovie();
}
}
}
Instance of Symbol 229 MovieClip in Symbol 230 MovieClip [bomber_dead] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Symbol 231 MovieClip [proximity_mine] Frame 1
function step() {
if (placed) {
vx = 0;
vy = 0;
hp = hp - leaking;
if (hp <= 0) {
_root.playSound("tat1.wav");
shrap_bomb = _root.addObj("shrap_bomb", _root.debris_layer, _root.getNextDebrisLevel());
shrap_bomb._x = _x;
shrap_bomb._y = _y;
shrap_bomb.vy = -3;
hp = 10;
leaking = 0;
timeToScan = -100;
if ((chargeCount++) >= 2) {
_root.removeMine(this);
}
}
if ((timeToScan++) > 50) {
timeToScan = 0;
scan();
}
} else {
if (vx > 0) {
_rotation = (_rotation + 3);
} else {
_rotation = (_rotation - 3);
}
vy = vy + _root.gravity;
xprev = _x;
yprev = _y;
_y = (_y + vy);
_x = (_x + vx);
if ((((_y < -10) || (_x < -10)) || (_x > xmax)) || (_y > ymax)) {
this.unloadMovie();
}
testHitObstructions();
}
}
function scan() {
trace("Scanning");
for (i in _root.enemies) {
ene = _root.enemies[i];
dx = ene._x - _x;
dy = ene._y - _y;
if ((Math.abs(dx) < detection_range) && (Math.abs(dy) < detection_range)) {
leaking = 1;
break;
}
}
}
function testHitObstructions() {
placed = false;
hitstruct = false;
for (ndx in _root.structures) {
if (_root.structures[ndx].hitTest(_x, _y, 0)) {
hitstruct = true;
break;
}
}
if (hitstruct || (_root.ground.ground_body.hitTest(_x, _y, 1))) {
placed = true;
} else {
do {
if ((in _root.obstructions) == null) {
break;
}
i = in _root.obstructions;
placed = _root.obstructions[i].hitTest(_x, _y, 0);
} while (!placed);
do {
} while (() != null);
}
}
xmax = _root.g_width + 10;
ymax = _root.g_ground + 10;
hp = 10;
timeToScan = 0;
leaking = 0;
placed = false;
range = 50;
detection_range = 20;
dmg = 100;
chargeCount = 0;
Instance of Symbol 189 MovieClip in Symbol 231 MovieClip [proximity_mine] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Symbol 237 MovieClip Frame 1
stop();
Symbol 237 MovieClip Frame 70
gotoAndPlay (10);
Instance of Symbol 240 MovieClip "sniper_flame" in Symbol 241 MovieClip Frame 1
onClipEvent (load) {
_alpha = 0;
}
onClipEvent (enterFrame) {
if (_alpha > 0) {
_alpha = (_alpha - 30);
}
}
Symbol 243 MovieClip [enemy_sniper] Frame 1
function step() {
xpos = _x;
ypos = _y;
if (vx < 0) {
_xscale = -100;
} else {
_xscale = 100;
}
if ((timeToAim++) > 15) {
timeToAim = 0;
dx = -((_root.hero._x - _x) - 2.6);
dy = -((_root.hero._y - _y) - 11.8);
radians = Math.atan(dy / dx);
if (dx > 0) {
vx = -speed;
shoot_angle = ((-radians) * 180) / Math.PI;
} else {
vx = speed;
shoot_angle = (radians * 180) / Math.PI;
}
sniper_gun._rotation = shoot_angle;
head._rotation = shoot_angle;
left_arm._rotation = shoot_angle;
}
if (hp <= 0) {
trace(("DEATH CODE: " + deathCode) + " !!!!!!!!!!!!!!!");
if (deathCode == "exploded") {
_root.increaseScore(5, _x, _y);
if (explosion_impact > 12) {
_root.addBloodExplosion(_x, _y - 20);
} else {
lvl = _root.getNextDebrisLevel();
temp = _root.addObj("blood_stump_fem", _root.debris_layer, lvl);
temp._x = _x;
temp._y = _y - 5;
temp.vx = explosion_dx;
temp.vy = explosion_dy;
temp._rotation = random(360);
}
} else if (deathCode == "head_shot") {
_root.increaseScore(15, _x, _y);
_alpha = 0;
lvl = _root.getNextDebrisLevel();
temp = _root.addObj("enemy_sniper_death", _root.debris_layer, lvl);
temp._x = _x;
temp._y = _y;
temp.vx = vx;
temp.vy = vy;
if (vx > 0) {
temp._xscale = -100;
}
} else {
_root.increaseScore(10, _x, _y);
_alpha = 0;
lvl = _root.getNextDebrisLevel();
temp = _root.addObj("blood_stump_fem", _root.debris_layer, lvl);
temp._x = _x;
temp._y = _y;
temp.vx = vx;
temp.vy = vy;
}
_root.removeEnemy(this);
}
if ((timeToShoot--) <= 0) {
shoot();
if ((shot_count++) >= 0) {
shot_count = 1;
timeToShoot = (300 + random(200)) - (_root.level * 5);
if (timeToShoot < 100) {
timeToShoot = 100;
}
} else {
timeToShoot = 10;
}
}
if ((timeToNade--) <= 0) {
dist = Math.abs(_root.hero._x - _x);
if ((dist < 300) && (dist > 100)) {
throwNade();
}
timeToNade = 600 + random(600);
}
}
function shoot() {
sniper_gun.sniper_flame._alpha = 100;
_root.playSound("sniper_rifle.wav");
bullet = _root.addObj("enemy_bullet", _root.enemy_bullet_layer, _root.getNextEnemyBulletLevel());
shot_speed = 3.5 * (1 + (_root.level * 0.02));
if (shot_speed > 8) {
shot_speed = 8;
}
wild_factor = 2;
dx = _root.hero._x - _x;
dy = _root.hero._y - _y;
variation = (random(Math.floor(wild_factor * 100)) - random(Math.floor(wild_factor * 100))) / 2000;
radians = Math.atan(dy / dx) + variation;
if (dx < 0) {
radians = radians + Math.PI;
}
bullet.vy = Math.sin(radians) * shot_speed;
bullet.vx = Math.cos(radians) * shot_speed;
bullet._x = _x + bullet.vx;
bullet._y = (_y - half_height) + bullet.vy;
bullet._rotation = (radians * 180) / Math.PI;
}
function throwNade() {
dx = _root.hero._x - _x;
dy = _root.hero._y - _y;
lvx = dx / 130;
lvy = -3 + (dy / 100);
lvl = _root.getNextEnemyBulletLevel();
proj = _root.addObj("hero_grenade", _root.enemy_bullet_layer, lvl);
proj.vx = lvx;
proj.vy = lvy;
proj._x = _x;
proj._y = _y - half_height;
}
function takeDamage(dmg, x, y, vx, vy) {
_root.playHitEnemySound();
if (weakspot.hitTest(x, y, 0)) {
deathCode = "head_shot";
hp = 0;
c = 0;
while (c < 3) {
blood = _root.addObj("blood_drop", _root.debris_layer, _root.getNextDebrisLevel());
blood._x = x;
blood._y = y;
blood.vx = (vx / 3) + ((random(10) - random(10)) / 10);
blood.vy = (vy / 3) + ((random(10) - random(10)) / 10);
blood._xscale = (blood._yscale = 100 + random(200));
c++;
}
} else {
hp = hp - dmg;
c = 0;
while (c < 1) {
blood = _root.addObj("blood_drop", _root.debris_layer, _root.getNextDebrisLevel());
blood._x = x;
blood._y = y;
blood.vx = (vx / 3) + ((random(10) - random(10)) / 10);
blood.vy = (vy / 3) + ((random(10) - random(10)) / 10);
blood._xscale = (blood._yscale = 100 + random(200));
c++;
}
}
}
hp = 5 + Math.floor(_root.level * 0.25);
half_height = _height / 2;
timeToNade = 600 + random(600);
timeToShoot = 100;
shot_count = 0;
speed = 0.5;
xpos = 0;
ypos = 0;
shootCount = 0;
etype = "troop";
xmax = _root.g_width + 10;
ymax = _root.g_ground + 10;
Instance of Symbol 242 MovieClip "head" in Symbol 243 MovieClip [enemy_sniper] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Instance of Symbol 35 MovieClip "hitbox" in Symbol 243 MovieClip [enemy_sniper] Frame 1
onClipEvent (load) {
_alpha = 0;
}
Instance of Symbol 35 MovieClip "weakspot" in Symbol 243 MovieClip [enemy_sniper] Frame 1
onClipEvent (load) {
_alpha = 0;
}
Symbol 244 MovieClip Frame 54
stop();
Symbol 245 MovieClip [enemy_sniper_death] Frame 1
function step() {
if ((count++) > 100) {
_alpha = (_alpha - 2);
if (_alpha < 0) {
this.unloadMovie();
}
}
}
Instance of Symbol 244 MovieClip in Symbol 245 MovieClip [enemy_sniper_death] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Symbol 248 MovieClip [shrap_bomb] Frame 1
function step() {
vy = vy + _root.gravity;
_x = (_x + vx);
_y = (_y + vy);
if ((timeToExpload--) <= 0) {
_root.shrapnelExplosion(_x, _y, 10);
_root.playSound("ice_shatter.wav");
this.unloadMovie();
}
}
timeToExpload = 30;
Instance of Symbol 247 MovieClip in Symbol 248 MovieClip [shrap_bomb] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Symbol 250 MovieClip [napalm_flame] Frame 1
function scan() {
closeEnemies = new Array();
for (ndx in _root.enemies) {
dx = _root.enemies[ndx]._x - _x;
dy = _root.enemies[ndx]._y - _y;
dist = Math.sqrt((dx * dx) + (dy * dy));
if (dist < 200) {
closeEnemies.push(_root.enemies[ndx]);
}
}
dx = _root.hero._x - _x;
dy = _root.hero._y - _y;
dist = Math.sqrt((dx * dx) + (dy * dy));
checkHero = dist < 200;
}
function step() {
if ((count++) > 600) {
_alpha = (_alpha - 2);
if (_alpha < 0) {
this.unloadMovie();
}
}
if ((timeToCheck++) > 20) {
timeToCheck = 0;
for (ndx in closeEnemies) {
cene = closeEnemies[ndx];
if (hitbox.hitTest(cene._x, cene._y, 0)) {
cene.takeDamage(3, _x, _y, 0, 0);
}
}
if (checkHero && (hitbox.hitTest(_root.hero._x, _root.hero._y, 0))) {
_root.hero.takeDamage(5);
}
}
if ((timeToScan++) > 50) {
timeToScan = 0;
scan();
}
}
closeEnemies = new Array();
scan();
checkHero = false;
timeToCheck = 100;
Instance of Symbol 249 MovieClip in Symbol 250 MovieClip [napalm_flame] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Instance of Symbol 35 MovieClip "hitbox" in Symbol 250 MovieClip [napalm_flame] Frame 1
onClipEvent (load) {
_alpha = 0;
}
Symbol 255 MovieClip [level_display] Frame 1
function step() {
_alpha = (_alpha - 10);
if (_alpha < 0) {
this.unloadMovie();
}
}
_alpha = 1000;
Instance of Symbol 254 MovieClip in Symbol 255 MovieClip [level_display] Frame 1
onClipEvent (enterFrame) {
_parent.step();
}
Symbol 268 Button
on (release) {
_root.closeTopScores();
}
Symbol 273 Button
on (release) {
_root.closeNamer();
_root.paused = false;
}
Symbol 276 Button
on (release) {
_root.closeHelp();
}
Symbol 280 Button
on (release) {
_root.help_text = "Stay alive as long as possible.\nDestroy the enemies to earn points.\nGather the crates to get ammo and health.\nAvoid explosions and enemy bullets.";
}
Symbol 283 Button
on (release) {
_root.help_text = "There are three types of enemies... Soldiers, bombers, and helicopters. Hint: every enemy has a weak spot.";
}
Symbol 285 Button
on (release) {
_root.help_text = "Tap Left CTRL to crouch; while crouched your aiming with the gun is a lot better and you are a smaller target. If you start to move while crouched your guy stands up. You can stand on tower platforms but the platform floors do not block enemy fire. Falling aircraft cause explosions that do hurt you. EVERY explosion hurts you.";
}
Symbol 287 Button
on (release) {
_root.help_text = "Rockets are fired by clicking the left mouse button. Rockets will follow your mouse cursor to the best of their ability. Sharp turns may cause them to collide with other objects.";
}
Symbol 290 Button
on (release) {
_root.help_text = "Single Click will release the cross bow which releases a piercing bolt that can pass through enemy soldiers instantly killing them.";
}
Symbol 292 Button
on (release) {
_root.help_text = "The gun is a fully automatic rifle that does not need to reload via clips (lucky you) but can run out of ammo. The longer you fire the more wild your shots get. If you are crouched you can aim better. Notice your cross-hair icon change shape as you fire. The further the red-lines are from the center-mouse-possition the wilder your gun aiming is.";
}
Symbol 294 Button
on (release) {
_root.help_text = "Controls:\n";
_root.help_text = _root.help_text + "A (hold): Move Left\n";
_root.help_text = _root.help_text + "D (hold): Move Right\n";
_root.help_text = _root.help_text + "W (hold): Climb Up ladder\n";
_root.help_text = _root.help_text + "S (hold): Climb Down ladder\n";
_root.help_text = _root.help_text + "E: Throw Grenade\n";
_root.help_text = _root.help_text + "R: Throw Proximity Mine\n";
_root.help_text = _root.help_text + "SPACE BAR: Jump (Double tap to double jump)\n";
_root.help_text = _root.help_text + "Left CTRL: (Tap once) Crouch (provides better aiming but you cannot move while crouched)\n";
_root.help_text = _root.help_text + "#1-3 Change Firing Modes (Gun, Bow, Rocket)\n";
}
Symbol 299 MovieClip [help_screen] Frame 1
_root.help_text = "Controls:\n";
_root.help_text = _root.help_text + "A (hold): Move Left\n";
_root.help_text = _root.help_text + "D (hold): Move Right\n";
_root.help_text = _root.help_text + "W (hold): Climb Up ladder\n";
_root.help_text = _root.help_text + "S (hold): Climb Down ladder\n";
_root.help_text = _root.help_text + "E: Throw Grenade\n";
_root.help_text = _root.help_text + "R: Throw Shrapnel Proximity Mine\n";
_root.help_text = _root.help_text + "SPACE BAR: Jump (Double tap to double jump)\n";
_root.help_text = _root.help_text + "Left CTRL: (Tap once) Crouch (provides better aiming but you cannot move while crouched)\n";
_root.help_text = _root.help_text + "#1-3 Change Firing Modes (Gun, Bow, Rocket)\n";
Instance of Symbol 298 MovieClip "sponsor_link" in Symbol 299 MovieClip [help_screen] Frame 1
on (release) {
getURL ("http://www.ugotgames.com/", "_blank");
}
Symbol 308 Button
on (release) {
_root.closeGameOver();
_root.restartGame();
}
Symbol 320 MovieClip [crater1] Frame 1
function step() {
if ((count++) > 200) {
_alpha = (_alpha-1);
if (_alpha <= 0) {
this.unloadMovie();
}
}
}
Instance of Symbol 319 MovieClip in Symbol 320 MovieClip [crater1] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Symbol 338 MovieClip Frame 1
function step() {
hitladder = ladder.hitTest(_root.hero._x, _root.hero._y, 0);
if (Key.isDown(_root.KEY_W)) {
if (hitladder) {
_root.hero.vx = 0;
_root.hero.vy = 0;
_root.hero._y = _root.hero._y - 1;
}
} else if (Key.isDown(_root.KEY_S)) {
if (hitladder) {
_root.hero.vx = 0;
_root.hero.vy = 0;
_root.hero._y = _root.hero._y + 1;
}
}
}
Instance of Symbol 335 MovieClip "mark_b" in Symbol 338 MovieClip Frame 1
onClipEvent (enterFrame) {
_parent.step();
}
Instance of Symbol 337 MovieClip in Symbol 338 MovieClip Frame 1
onClipEvent (load) {
_root.structures.push(this);
}
Instance of Symbol 35 MovieClip "ladder" in Symbol 338 MovieClip Frame 1
onClipEvent (load) {
_alpha = 0;
}
Symbol 404 MovieClip Frame 1
stop();
Instance of Symbol 411 MovieClip in Symbol 412 MovieClip Frame 1
onClipEvent (enterFrame) {
if (_root.shooting_mode == "gun") {
_alpha = 100;
} else {
_alpha = 0;
}
}
Instance of Symbol 235 MovieClip in Symbol 412 MovieClip Frame 1
onClipEvent (enterFrame) {
if ((_root.shooting_mode == "gun") || (_root.shooting_mode == "bow")) {
_alpha = 100;
} else {
_alpha = 0;
}
}
Instance of Symbol 414 MovieClip in Symbol 416 MovieClip Frame 1
onClipEvent (load) {
_alpha = 0;
}
onClipEvent (enterFrame) {
if (_root.rocket_smoke > -10) {
_root.rocket_smoke = _root.rocket_smoke - 5;
_alpha = _root.rocket_smoke;
}
}
Instance of Symbol 240 MovieClip in Symbol 416 MovieClip Frame 1
onClipEvent (load) {
_alpha = 0;
}
onClipEvent (enterFrame) {
if (_root.rocket_flame > -10) {
_root.rocket_flame = _root.rocket_flame - 10;
_alpha = _root.rocket_flame;
}
}
Symbol 424 MovieClip Frame 10
stop();
Instance of Symbol 425 MovieClip in Symbol 426 MovieClip Frame 1
onClipEvent (enterFrame) {
if (_root.shooting_mode == "bow") {
_alpha = 100;
} else {
_alpha = 0;
}
}
Instance of Symbol 416 MovieClip "launcher2" in Symbol 427 MovieClip Frame 1
onClipEvent (enterFrame) {
if (_root.shooting_mode == "rocket") {
_alpha = 100;
} else {
_alpha = 0;
}
}
Instance of Symbol 235 MovieClip in Symbol 427 MovieClip Frame 1
onClipEvent (enterFrame) {
if (_root.shooting_mode == "rocket") {
_alpha = 100;
} else {
_alpha = 0;
}
}
Instance of Symbol 411 MovieClip in Symbol 428 MovieClip Frame 1
onClipEvent (enterFrame) {
if (_root.shooting_mode == "gun") {
_alpha = 100;
} else {
_alpha = 0;
}
}
Instance of Symbol 235 MovieClip in Symbol 428 MovieClip Frame 1
onClipEvent (enterFrame) {
if ((_root.shooting_mode == "gun") || (_root.shooting_mode == "bow")) {
_alpha = 100;
} else {
_alpha = 0;
}
}
Instance of Symbol 416 MovieClip "launcher" in Symbol 428 MovieClip Frame 1
onClipEvent (enterFrame) {
if (_root.shooting_mode == "rocket") {
_alpha = 100;
} else {
_alpha = 0;
}
}
Instance of Symbol 235 MovieClip in Symbol 428 MovieClip Frame 1
onClipEvent (enterFrame) {
if (_root.shooting_mode == "rocket") {
_alpha = 100;
} else {
_alpha = 0;
}
}
Instance of Symbol 425 MovieClip in Symbol 429 MovieClip Frame 1
onClipEvent (enterFrame) {
if (_root.shooting_mode == "bow") {
_alpha = 100;
} else {
_alpha = 0;
}
}
Instance of Symbol 240 MovieClip "f2" in Symbol 431 MovieClip Frame 1
onClipEvent (load) {
_alpha = 0;
}
onClipEvent (enterFrame) {
if (_alpha > 0) {
_alpha = (_alpha - 30);
}
}
Instance of Symbol 240 MovieClip "f3" in Symbol 431 MovieClip Frame 1
onClipEvent (load) {
_alpha = 0;
}
onClipEvent (enterFrame) {
if (_alpha > 0) {
_alpha = (_alpha - 30);
}
}
Instance of Symbol 240 MovieClip "f1" in Symbol 431 MovieClip Frame 1
onClipEvent (load) {
_alpha = 0;
}
onClipEvent (enterFrame) {
if (_alpha > 0) {
_alpha = (_alpha - 30);
}
}
Instance of Symbol 427 MovieClip "rifle_invert" in Symbol 431 MovieClip Frame 1
onClipEvent (load) {
orig_x = _x;
_alpha = 0;
}
onClipEvent (enterFrame) {
if (_x < orig_x) {
_x = (_x + ((orig_x - _x) / 2));
}
}
Instance of Symbol 430 MovieClip "rifle" in Symbol 431 MovieClip Frame 1
onClipEvent (load) {
orig_x = _x;
_alpha = 0;
}
onClipEvent (enterFrame) {
if (_x < orig_x) {
_x = (_x + ((orig_x - _x) / 2));
}
}
Symbol 432 MovieClip Frame 1
stop();
Instance of Symbol 359 MovieClip in Symbol 432 MovieClip Frame 1
/* no clip actions */
Instance of Symbol 405 MovieClip in Symbol 432 MovieClip Frame 1
onClipEvent (load) {
count = 1;
stopped = false;
gotoAndStop (75);
}
onClipEvent (enterFrame) {
pvx = Math.abs(_parent._parent.vx);
if (pvx > 0.5) {
stopped = false;
trace("Parent vx: " + _parent._parent.vx);
count = count + pvx;
if (count >= 60) {
count = 1;
}
gotoAndStop(Math.floor(count));
} else if (!stopped) {
if (count < 70) {
count = 75;
}
if (count <= 75) {
count = count + 0.2;
gotoAndStop(Math.floor(count));
} else {
stopped = true;
}
}
}
Instance of Symbol 431 MovieClip in Symbol 432 MovieClip Frame 1
onClipEvent (load) {
yorig = _y;
}
onClipEvent (enterFrame) {
_y = (yorig + _root.hero.crouch_factor);
dx = -((_root._xmouse - _root.hero._x) + 3.5);
dy = -(((_root._ymouse - _root.hero._y) + 15.8) - _root.hero.crouch_factor);
_root.hero.mdx = dx;
_root.hero.mdy = dy;
radians = Math.atan(dy / dx);
if (_root.hero.mdx > 0) {
rifle._alpha = 0;
rifle_invert._alpha = 100;
} else {
rifle._alpha = 100;
rifle_invert._alpha = 0;
}
_rotation = _root.hero.sight._rotation;
}
Instance of Symbol 431 MovieClip in Symbol 432 MovieClip Frame 2
onClipEvent (load) {
yorig = _y;
}
onClipEvent (enterFrame) {
_y = (yorig + _root.hero.crouch_factor);
dx = -((_root._xmouse - _root.hero._x) + 3.5);
dy = -(((_root._ymouse - _root.hero._y) + 15.8) - _root.hero.crouch_factor);
_root.hero.mdx = dx;
_root.hero.mdy = dy;
radians = Math.atan(dy / dx);
if (_root.hero.mdx > 0) {
rifle._alpha = 0;
rifle_invert._alpha = 100;
} else {
rifle._alpha = 100;
rifle_invert._alpha = 0;
}
_rotation = _root.hero.sight._rotation;
}
Instance of Symbol 405 MovieClip in Symbol 432 MovieClip Frame 2
onClipEvent (load) {
count = 1;
stopped = false;
gotoAndStop (75);
}
onClipEvent (enterFrame) {
pvx = Math.abs(_parent._parent.vx);
if (pvx > 0.5) {
stopped = false;
trace("Parent vx: " + _parent._parent.vx);
count = count + pvx;
if (count >= 60) {
count = 1;
}
gotoAndStop(Math.floor(count));
} else if (!stopped) {
if (count < 70) {
count = 75;
}
if (count <= 75) {
count = count + 0.2;
gotoAndStop(Math.floor(count));
} else {
stopped = true;
}
}
}
Instance of Symbol 405 MovieClip in Symbol 432 MovieClip Frame 3
onClipEvent (enterFrame) {
gotoAndStop (23);
}
Instance of Symbol 405 MovieClip in Symbol 432 MovieClip Frame 4
onClipEvent (enterFrame) {
gotoAndStop (23);
}
Instance of Symbol 359 MovieClip in Symbol 432 MovieClip Frame 5
onClipEvent (load) {
yorig = _y;
}
onClipEvent (enterFrame) {
_y = (yorig + _root.hero.crouch_factor);
}
Instance of Symbol 405 MovieClip in Symbol 432 MovieClip Frame 5
onClipEvent (load) {
frame = 76;
gotoAndStop(frame);
}
onClipEvent (enterFrame) {
count = _parent._parent.crouch_count;
trace("Count: " + count);
gotoAndStop(frame + count);
}
Instance of Symbol 431 MovieClip in Symbol 432 MovieClip Frame 6
onClipEvent (load) {
yorig = _y;
}
onClipEvent (enterFrame) {
_y = (yorig + _root.hero.crouch_factor);
dx = -((_root._xmouse - _root.hero._x) + 3.5);
dy = -(((_root._ymouse - _root.hero._y) + 15.8) - _root.hero.crouch_factor);
_root.hero.mdx = dx;
_root.hero.mdy = dy;
radians = Math.atan(dy / dx);
if (_root.hero.mdx > 0) {
rifle._alpha = 0;
rifle_invert._alpha = 100;
} else {
rifle._alpha = 100;
rifle_invert._alpha = 0;
}
_rotation = _root.hero.sight._rotation;
}
Instance of Symbol 405 MovieClip in Symbol 432 MovieClip Frame 6
onClipEvent (load) {
frame = 76;
gotoAndStop(frame);
}
onClipEvent (enterFrame) {
count = _parent._parent.crouch_count;
trace("Count: " + count);
gotoAndStop(frame + count);
}
Symbol 435 MovieClip Frame 1
function step() {
right_foot = _root.ground.ground_body.hitTest(_x + 6, _y, 1);
left_foot = _root.ground.ground_body.hitTest(_x - 6, _y, 1);
right_hand = _root.ground.ground_body.hitTest(_x + 6, _y - 8, 1);
left_hand = _root.ground.ground_body.hitTest(_x - 6, _y - 8, 1);
bottom = _root.ground.ground_body.hitTest(_x, _y, 1);
hitstruct = false;
for (ndx in _root.structures) {
if (_root.structures[ndx].hitTest(_x, _y, 1)) {
struct_on = _root.structures[ndx];
hitstruct = true;
break;
}
}
bottom = bottom || (hitstruct);
if (!grounded) {
grounded = _root.ground.hitTest(_x, _y + 5, 1) || (struct_on.hitTest(_x, _y + 5, 1));
}
if (grounded) {
jump_count = 0;
} else if (jump_count < 1) {
jump_count++;
}
if (right_hand) {
trace("Right hand hitting");
if (vx > 0) {
vx = 0;
}
vx = vx - 0.1;
} else if (left_hand) {
trace("Left hand hitting");
if (vx < 0) {
vx = 0;
}
vx = vx + 0.1;
}
if (bottom) {
if (vy > 3) {
crouch_count = 20;
crouching = true;
}
if (delta > 0) {
delta = 0;
}
delta = delta - 0.04;
vy = delta;
vx = vx * 0.85;
} else if (delta < 0) {
delta = 0;
}
if (_x < half_width) {
_x = half_width;
} else if (_x > (_root.g_width - half_width)) {
_x = (_root.g_width - half_width);
}
if (_y < half_height) {
_y = half_height;
} else if (_y > (_root.g_ground - half_height)) {
_y = (_root.g_ground - half_height);
}
if (!crouching) {
if (Key.isDown(_root.KEY_D) && (!right_hand)) {
body_dir = 1;
if (vx < 1.5) {
vx = vx + 0.2;
}
aim_error = 8;
max_spread = 20;
} else if (Key.isDown(_root.KEY_A) && (!left_hand)) {
body_dir = -1;
if (vx > -1.5) {
vx = vx - 0.2;
}
aim_error = 8;
max_spread = 20;
} else {
if ((vx < 0.01) && (vx > -0.01)) {
vx = 0;
} else {
vx = vx * 0.99;
}
if (grounded) {
aim_error = 5;
max_spread = 15;
} else {
aim_error = 15;
max_spread = 25;
}
}
} else {
max_spread = 5;
aim_error = 0;
}
if ((!wants_to_crouch) && (Key.isDown(_root.KEY_LEFTCONTROL))) {
wants_to_crouch = true;
}
if (wants_to_crouch && (grounded)) {
if ((vx > -0.01) && (vx < 0.01)) {
if (vx < 0) {
body_dir = -1;
} else if (vx > 0) {
body_dir = 1;
}
vx = 0;
crouching = true;
if (crouch_count < 20) {
crouch_count = crouch_count + 2;
}
} else {
vx = vx * 0.85;
}
} else if (crouch_count >= 1) {
crouch_count = crouch_count - 2;
} else {
crouching = false;
}
crouch_factor = crouch_count * 0.3;
if (((Key.isDown(_root.KEY_SPACEBAR) && (jump_count < 2)) && (space_released)) && (!crouching)) {
jump_count++;
space_released = false;
grounded = false;
vy = -2;
}
if (!Key.isDown(_root.KEY_SPACEBAR)) {
space_released = true;
holdcount = 0;
} else {
holdcount++;
wants_to_crouch = false;
}
if ((Key.isDown(_root.KEY_A) || (Key.isDown(_root.KEY_D))) || (Key.isDown(_root.KEY_W))) {
wants_to_crouch = false;
}
xprev = _x;
yprev = _y;
vy = vy + gravity;
animate();
_x = (_x + vx);
_y = (_y + vy);
checkFiring();
}
function checkFiring() {
if (_root.shooting_mode == "gun") {
if (timeToShoot > 0) {
timeToShoot--;
}
}
if (_root.shooting_mode == "rocket") {
if (timeToShootRocket > 0) {
timeToShootRocket--;
}
}
if (_root.shooting_mode == "bow") {
if (timeToShootBow > 0) {
timeToShootBow--;
}
}
if (timeToThrow > 0) {
timeToThrow--;
}
if ((_root.firing && (_root.shooting_mode == "gun")) && (_root.ammo_bullets > 0)) {
if (timeToShoot <= 0) {
_root.shootHeroProjectile();
sight.f1._alpha = 100;
sight.f2._alpha = 100;
sight.f3._alpha = 100;
_root.aim_rate = 0;
if (_root.gun_wild < max_spread) {
_root.gun_wild = _root.gun_wild + 4;
}
timeToShoot = 7;
}
}
if ((_root.firing && (_root.shooting_mode == "rocket")) && (_root.ammo_rockets > 0)) {
if (timeToShootRocket <= 0) {
_root.shootHeroRocket();
timeToShootRocket = 100;
}
}
if ((_root.firing && (_root.shooting_mode == "bow")) && (_root.ammo_arrows > 0)) {
if (timeToShootBow <= 0) {
_root.shootArrow();
timeToShootBow = 20;
}
}
if (_root.gun_wild > aim_error) {
if (_root.aim_rate > 0) {
_root.aim_rate = 0;
}
_root.aim_rate = _root.aim_rate - 0.05;
} else {
if (_root.aim_rate < 0) {
_root.aim_rate = 0;
}
_root.aim_rate = _root.aim_rate + 0.05;
}
_root.gun_wild = _root.gun_wild + _root.aim_rate;
if ((Key.isDown(_root.KEY_E) && (timeToThrow <= 0)) && (_root.ammo_grenades > 0)) {
timeToThrow = 60;
_root.shootGrenade();
}
if ((Key.isDown(_root.KEY_R) && (timeToThrow <= 0)) && (_root.ammo_prox_mines > 0)) {
timeToThrow = 60;
_root.shootProximityMine();
}
}
function takeDamage(dmg) {
_root.playHitEnemySound();
hp = hp - dmg;
}
function animate() {
if ((body_dir > 0) && (crouching)) {
body.gotoAndStop("crouch_right");
} else if ((body_dir < 0) && (crouching)) {
body.gotoAndStop("crouch_left");
} else if ((body_dir > 0) && (grounded)) {
body.gotoAndStop("run_right");
} else if ((body_dir < 0) && (grounded)) {
body.gotoAndStop("run_left");
} else if ((body_dir > 0) && (!grounded)) {
body.gotoAndStop("fly_right");
} else if ((body_dir < 0) && (!grounded)) {
body.gotoAndStop("fly_left");
}
}
delta = 0;
half_width = 5;
half_height = 13;
gravity = 0.08;
grounded = false;
vx = 0;
space_released = true;
holding = false;
xprev = 0;
yprev = 0;
holdcount = 0;
crouch_count = 1;
crouching = false;
body_dir = 1;
crouch_factor = 0;
timeToThrow = 10;
timeToShoot = 10;
timeToShootRocket = 10;
timeToShootBow = 10;
jump_count = 0;
aim_error = 0;
struct_on = null;
wants_to_crouch = false;
Instance of Symbol 432 MovieClip "body" in Symbol 435 MovieClip Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Instance of Symbol 433 MovieClip "sight" in Symbol 435 MovieClip Frame 1
onClipEvent (load) {
_alpha = 0;
yorig = _y;
}
onClipEvent (enterFrame) {
_y = (yorig + _root.hero.crouch_factor);
dx = -((_root._xmouse - _root.hero._x) + 3.5);
dy = -(((_root._ymouse - _root.hero._y) + 15.8) - _root.hero.crouch_factor);
_root.hero.mdx = dx;
_root.hero.mdy = dy;
radians = Math.atan(dy / dx);
if (dx > 0) {
_rotation = (((radians * 180) / Math.PI) + 180);
} else {
_rotation = ((radians * 180) / Math.PI);
}
}
Instance of Symbol 434 MovieClip "hitbox" in Symbol 435 MovieClip Frame 1
onClipEvent (load) {
_alpha = 0;
yorig = _y;
h_orig = _height;
}
onClipEvent (enterFrame) {
_height = (h_orig - _parent.crouch_factor);
}
Symbol 441 Button
on (keyPress "1") {
_root.shooting_mode = "gun";
_root.cross_hair.ch_gun._alpha = 100;
_root.cross_hair.ch_rocket._alpha = 0;
}
on (keyPress "2") {
_root.shooting_mode = "bow";
_root.cross_hair.ch_gun._alpha = 0;
_root.cross_hair.ch_rocket._alpha = 0;
}
on (keyPress "3") {
_root.shooting_mode = "rocket";
_root.cross_hair.ch_gun._alpha = 0;
_root.cross_hair.ch_rocket._alpha = 100;
}
on (keyPress "p") {
if (!_root.game_ended) {
_root.paused = !_root.paused;
}
}
Symbol 446 MovieClip Frame 1
function step() {
if (timeToWait > 0) {
timeToWait--;
} else {
_y = (_y + 1);
hitstruct = false;
for (ndx in _root.structures) {
if (_root.structures[ndx].hitTest(_x, _y, 0)) {
hitstruct = true;
break;
}
}
if (hitstruct || (_root.ground.ground_body.hitTest(_x, _y, 1))) {
_root.addRandomGoodie(_x, _y);
chute = _root.addObj("parachute_fade", _root.debris_layer, _root.getNextDebrisLevel());
chute._x = _x;
chute._y = _y - 23.8;
timeToWait = random(500) + 1000;
_y = -20;
_x = (random(_root.g_width - 30) + 15);
}
}
}
timeToWait = 0;
Instance of Symbol 445 MovieClip in Symbol 446 MovieClip Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Symbol 465 MovieClip Frame 1
function step() {
if (_root.paused) {
pause_text = "unpause";
} else {
pause_text = "pause";
}
}
pause_text = "pause";
Instance of Symbol 463 MovieClip in Symbol 465 MovieClip Frame 1
onClipEvent (enterFrame) {
_parent.step();
}
Symbol 466 Button
on (release) {
if (!_root.game_ended) {
_root.paused = !_root.paused;
}
}
on (keyPress "p") {
if (!_root.game_ended) {
_root.paused = !_root.paused;
}
}
Symbol 467 Button
on (release) {
if (!_root.game_ended) {
_root.openNamer();
}
}
Symbol 468 Button
on (release) {
_root.openHelp();
}
Symbol 469 Button
on (release) {
if (!_root.game_ended) {
_root.showTopScores();
}
}
Instance of Symbol 484 MovieClip in Symbol 485 MovieClip Frame 1
onClipEvent (enterFrame) {
_x = _root.gun_wild;
}
Instance of Symbol 484 MovieClip in Symbol 485 MovieClip Frame 1
onClipEvent (enterFrame) {
_y = (-_root.gun_wild);
}
Instance of Symbol 484 MovieClip in Symbol 485 MovieClip Frame 1
onClipEvent (enterFrame) {
_y = _root.gun_wild;
}
Instance of Symbol 484 MovieClip in Symbol 485 MovieClip Frame 1
onClipEvent (enterFrame) {
_x = (-_root.gun_wild);
}
Instance of Symbol 487 MovieClip "ch_rocket" in Symbol 488 MovieClip Frame 1
onClipEvent (load) {
_alpha = 0;
}
Symbol 493 Button
on (release) {
getURL ("http://www.lostvectors.com", "_self");
}
Instance of Symbol 499 MovieClip in Symbol 500 MovieClip Frame 1
onClipEvent (enterFrame) {
_rotation = _root.bow._rotation;
}
Symbol 501 Button
on (press) {
startDrag (this);
_root.holding_string = true;
}
on (releaseOutside) {
stopDrag();
if (!_root.paused) {
_root.holding_string = false;
if (_root.ammo_arrows > 0) {
_root.shootArrow();
}
}
}
on (release) {
stopDrag();
if (!_root.paused) {
_root.holding_string = false;
if (_root.ammo_arrows > 0) {
_root.shootArrow();
}
}
}
Instance of Symbol 502 MovieClip "string" in Symbol 503 MovieClip Frame 1
onClipEvent (load) {
time = 0;
}
onClipEvent (enterFrame) {
if (!_root.pause) {
if (!_root.holding) {
time = time + _root.elapsed;
}
if ((time > _root.g_bow_cooldown) && (!_root.holding)) {
_x = _root.bow._x;
_y = _root.bow._y;
_root.holding = true;
time = 0;
_alpha = 100;
}
}
}
Symbol 505 Button
on (release) {
_root.age = 18;
if (!_root.first_time_playing) {
_root.paused = false;
}
this.unloadMovie();
}
Symbol 506 Button
on (release) {
_root.age = 1;
if (!_root.first_time_playing) {
_root.paused = false;
}
this.unloadMovie();
}
Symbol 518 Button
on (release) {
getURL ("http://www.ugotgames.com", "_self");
}
Instance of Symbol 503 MovieClip in Symbol 519 MovieClip Frame 1
on (release) {
getURL ("http://www.lostvectors.com", "_self");
}
Instance of Symbol 515 MovieClip in Symbol 519 MovieClip Frame 1
on (release) {
getURL ("http://www.lostvectors.com", "_self");
}
onClipEvent (load) {
_alpha = 0;
}