Frame 1
Stage.scaleMode = "noScale";
if (this._url.indexOf("file://") != 0) {
Stage.showMenu = "false";
}
stop();
Frame 2
location = "http://www.miniclip.com/";
if ((this._url.indexOf(location) != 0) && (this._url.indexOf("file://") != 0)) {
gotoAndPlay(_currentframe - 1);
}
if (getBytesLoaded() >= getBytesTotal()) {
gotoAndStop ("intro");
}
Frame 3
_quality = "low";
if (l == undefined) {
lb._xscale = 0;
}
Frame 4
l = Math.floor((getBytesLoaded() / getBytesTotal()) * 100);
lb._xscale = l;
l = ("Loading " + l) + "%...";
if (getBytesLoaded() < getBytesTotal()) {
gotoAndPlay(_currentframe - 1);
} else {
delete l;
gotoAndStop ("intro");
}
Frame 15
stop();
_quality = "high";
Frame 19
soundBoard = new Object();
soundBoard.soundNum = 0;
soundBoard.soundBoardClip = createEmptyMovieClip("soundBoardClip", 1024);
soundBoard.sounds = new Array();
soundBoard.newSound = function (name) {
var _local1 = this;
var _local2 = _local1.soundBoardClip.createEmptyMovieClip("SoundClip_" + _local1.soundNum, _local1.soundNum);
var _local3;
_local3 = (_local1.soundBoardClip["Sound_" + _local1.soundNum] = new Sound(_local2));
_local3.attachSound(name);
_local1.soundNum++;
_local1.sounds.push({name:name, tsound:_local3});
return(_local3);
};
soundBoard.stopAll = function () {
var _local2 = this;
var _local1 = 0;
while (_local1 < _local2.sounds.length) {
_local2.sounds[_local1].tsound.stop();
_local1++;
}
};
spabomb = SoundBoard.newSound("spabomb");
spfiremines = SoundBoard.newSound("spfiremines");
spflamethrower = SoundBoard.newSound("spflamethrower");
spgrapplecannon = SoundBoard.newSound("spgrapplecannon");
spgrenadelauncher = SoundBoard.newSound("spgrenadelauncher");
sphealth = SoundBoard.newSound("sphealth");
spinvulnerability = SoundBoard.newSound("spinvulnerablilty");
spjetpack = SoundBoard.newSound("spjetpack");
spmac10 = SoundBoard.newSound("spmac10");
sppredatormode = SoundBoard.newSound("sppredatormode");
sprailgun = SoundBoard.newSound("sprailgun");
sprocketlauncher = SoundBoard.newSound("sprocketlauncher");
sprpg = SoundBoard.newSound("sprpg");
spseekerlauncher = SoundBoard.newSound("spseekerlauncher");
spshotgun = SoundBoard.newSound("spshotgun");
spshotgunrockets = SoundBoard.newSound("spshotgunrockets");
sptimerift = SoundBoard.newSound("sptimerift");
sptridamage = SoundBoard.newSound("sptridamage");
sboom = SoundBoard.newSound("sboom");
ssmallboom = SoundBoard.newSound("sboom");
ssmallboom.setVolume(50);
sheliboom = SoundBoard.newSound("sheliboom");
sbigboom = SoundBoard.newSound("sbigboom");
sflame = SoundBoard.newSound("sflame");
sgrapple = SoundBoard.newSound("sgrapple");
sgrenade = SoundBoard.newSound("sgrenade");
shurt = SoundBoard.newSound("shurt");
sgun = SoundBoard.newSound("sgun");
srailgun = SoundBoard.newSound("srailgun");
srocket = SoundBoard.newSound("srocket");
sshotgun = SoundBoard.newSound("sshotgun");
shjump = SoundBoard.newSound("shjump");
smetal0 = SoundBoard.newSound("smetal0");
smetal1 = SoundBoard.newSound("smetal1");
smetal2 = SoundBoard.newSound("smetal2");
smetal3 = SoundBoard.newSound("smetal3");
shit0 = SoundBoard.newSound("smetal0");
shit0.setVolume(75);
shit1 = SoundBoard.newSound("smetal1");
shit1.setVolume(75);
shit2 = SoundBoard.newSound("smetal2");
shit2.setVolume(75);
shit3 = SoundBoard.newSound("smetal3");
shit3.setVolume(75);
sheli = SoundBoard.newSound("sheli");
smusic = SoundBoard.newSound("smusic");
function copyArray(arr, w, h) {
var _local3 = new Array();
var _local2 = 0;
while (_local2 < height) {
_local3[_local2] = new Array();
var _local1 = 0;
while (_local1 < width) {
_local3[_local2][_local1] = new Array();
_local3[_local2][_local1][0] = arr[_local2][_local1][0];
_local3[_local2][_local1][1] = arr[_local2][_local1][1];
_local1++;
}
_local2++;
}
return(_local3);
}
function drawMap(arr, clipname, depth, tileset, realmap) {
if (realmap) {
width = arr[0].length;
height = arr.length;
map = copyArray(arr, width, height);
}
var startx;
var starty;
var holder = createEmptyMovieClip(clipname, depth);
var _local2 = 0;
while (_local2 < (sth + 1)) {
var _local1 = 0;
while (_local1 < (stw + 1)) {
var _local3 = holder.attachMovie(tileset, (("tile_" + _local2) + "_") + _local1, (_local2 * width) + _local1);
_local3._y = (_local2 * tileHeight) - 1;
_local3._x = (_local1 * tileWidth) - 1;
_local3.gotoAndStop(arr[_local2][_local1][1] + 1);
_local1++;
}
_local2++;
}
if (realmap) {
holder.entityDepth = (width * height) * 2;
var _local3 = holder.attachMovie("hero", "hero", holder.entityDepth++);
_local3.action = heroStart;
_local3.setup = heroSetup;
_local3.setup();
player = _local3;
assignents();
}
return(holder);
}
function assignents() {
var _local2 = 0;
while (_local2 < height) {
var _local1 = 0;
while (_local1 < width) {
if (map[_local2][_local1][0] == 32) {
map[_local2][_local1][0] = 0;
player._x = (_local1 * tileWidth) + (tileWidth / 2);
}
_local1++;
}
_local2++;
}
player._y = -50;
}
function getWorldPos(clip, pos, xscroll, yscroll) {
if (xscroll) {
pos[0] = Math.floor((-clip._x) / tileWidth);
}
if (yscroll) {
pos[1] = Math.floor((-clip._y) / tileHeight);
}
}
function scrollMap(clip, arr, pos, bounds, xscroll, yscroll, hold) {
var _local1 = bounds;
var _local3 = clip;
if (hold) {
if (_local3._x < ((-(arr[0].length - stw)) * tileWidth)) {
_local3._x = (-(arr[0].length - stw)) * tileWidth;
}
if (_local3._x > 0) {
_local3._x = 0;
}
if (_local3._y < ((-(arr.length - sth)) * tileHeight)) {
_local3._y = (-(arr.length - sth)) * tileHeight;
}
if (_local3._y > 0) {
_local3._y = 0;
}
}
var _local2 = new Array(pos[0], pos[1]);
getWorldPos(_local3, pos, xscroll, yscroll);
if (xscroll) {
if (_local2[0] != pos[0]) {
if (_local2[0] < pos[0]) {
while (_local2[0] != pos[0]) {
var dy = _local1[1];
var ty = _local2[1];
var ly = 0;
while (ly < (sth + 1)) {
_local3[(("tile_" + dy) + "_") + _local1[0]]._x = _local3[(("tile_" + dy) + "_") + _local1[0]]._x + ((stw + 1) * tileWidth);
_local3[(("tile_" + dy) + "_") + _local1[0]].gotoAndStop(arr[ty][(_local2[0] + stw) + 1][1] + 1);
dy++;
if (dy > sth) {
dy = 0;
}
ty++;
ly++;
}
_local2[0]++;
_local1[0]++;
if (_local1[0] > stw) {
_local1[0] = 0;
}
}
} else {
while (_local2[0] != pos[0]) {
var dl = (_local1[0] - 1);
if (dl < 0) {
dl = stw;
}
var dy = _local1[1];
var ty = _local2[1];
var ly = 0;
while (ly < (sth + 1)) {
_local3[(("tile_" + dy) + "_") + dl]._x = _local3[(("tile_" + dy) + "_") + dl]._x - ((stw + 1) * tileWidth);
_local3[(("tile_" + dy) + "_") + dl].gotoAndStop(arr[ty][_local2[0] - 1][1] + 1);
dy++;
if (dy > sth) {
dy = 0;
}
ty++;
ly++;
}
_local2[0]--;
_local1[0]--;
if (_local1[0] < 0) {
_local1[0] = stw;
}
}
}
}
}
if (yscroll) {
if (_local2[1] != pos[1]) {
if (_local2[1] < pos[1]) {
while (_local2[1] != pos[1]) {
var dx = _local1[0];
var tx = _local2[0];
var lx = 0;
while (lx < (stw + 1)) {
_local3[(("tile_" + _local1[1]) + "_") + dx]._y = _local3[(("tile_" + _local1[1]) + "_") + dx]._y + ((sth + 1) * tileWidth);
_local3[(("tile_" + _local1[1]) + "_") + dx].gotoAndStop(arr[(_local2[1] + sth) + 1][tx][1] + 1);
dx++;
if (dx > stw) {
dx = 0;
}
tx++;
lx++;
}
_local2[1]++;
_local1[1]++;
if (_local1[1] > sth) {
_local1[1] = 0;
}
}
} else {
while (_local2[1] != pos[1]) {
var dl = (_local1[1] - 1);
if (dl < 0) {
dl = sth;
}
var dx = _local1[0];
var tx = _local2[0];
var lx = 0;
while (lx < (stw + 1)) {
_local3[(("tile_" + dl) + "_") + dx]._y = _local3[(("tile_" + dl) + "_") + dx]._y - ((sth + 1) * tileWidth);
_local3[(("tile_" + dl) + "_") + dx].gotoAndStop(arr[_local2[1] - 1][tx][1] + 1);
dx++;
if (dx > stw) {
dx = 0;
}
tx++;
lx++;
}
_local2[1]--;
_local1[1]--;
if (_local1[1] < 0) {
_local1[1] = sth;
}
}
}
}
}
}
function bulletFrame(timeStep) {
var _local1 = this;
_local1._x = _local1._x + (_local1.xspeed * timeStep);
_local1._y = _local1._y + (_local1.yspeed * timeStep);
var y = Math.floor(_local1._y / tileHeight);
var x = Math.floor(_local1._x / tileWidth);
var hit = 0;
var _local2 = 0;
while (_local2 < enemyArray.length) {
if (enemyArray[_local2].hit.hitTest(_local1._x + world._x, _local1._y + world._y, 1)) {
enemyArray[_local2].health = enemyArray[_local2].health - _local1.damage;
score = score + _local1.damage;
hit = 1;
hits++;
if (((shit++) % 2) && (sounds)) {
var _local3 = random(4);
_root["shit" + _local3].start(0, 0);
}
break;
}
_local2++;
}
if (((((hit || (map[y][x][0] != 0)) || (x < (worldpos[0] - 1))) || (x > ((worldpos[0] + stw) + 1))) || (y < (worldpos[1] - 1))) || (y > ((worldpos[1] + sth) + 1))) {
_local2 = 0;
while (_local2 < entityArray.length) {
if (entityArray[_local2] == _local1) {
entityArray.splice(_local2, 1);
break;
}
_local2++;
}
rem = 1;
_local1.removeMovieClip();
}
}
function animationFrame(timeStep) {
var _local2 = this;
_local2.stepc = _local2.stepc + timeStep;
if (_local2.stepc > 1) {
if ((_local2.pause--) <= 0) {
_local2.nextFrame();
if (_local2._currentframe == _local2._totalframes) {
var _local1 = 0;
while (_local1 < entityArray.length) {
if (entityArray[_local1] == _local2) {
entityArray.splice(_local1, 1);
break;
}
_local1++;
}
rem = 1;
_local2.removeMovieClip();
}
_local2.stepc = _local2.stepc - 1;
}
}
}
function distance(x1, y1, x2, y2) {
x = x1 - x2;
y = y1 - y2;
return(Math.sqrt((x * x) + (y * y)));
}
function popupFrame(timeStep) {
var _local2 = this;
_local2.stepc = _local2.stepc + timeStep;
if (_local2.stepc >= 1) {
_local2._y--;
_local2.frame++;
if (_local2.frame > 32) {
_local2._alpha = _local2._alpha - 10;
if (_local2._alpha <= 0) {
var _local1 = 0;
while (_local1 < entityArray.length) {
if (entityArray[_local1] == _local2) {
entityArray.splice(_local1, 1);
break;
}
_local1++;
}
rem = 1;
_local2.removeMovieClip();
}
_local2.stepc--;
}
}
}
function powerupFrame(timeStep) {
var _local1 = this;
_local1.stepc = _local1.stepc + timeStep;
if (_local1.stepc > 1) {
_local1.r++;
if (_local1.fall) {
_local1.yspeed++;
} else {
_local1.yspeed = 2;
}
_local1.stepc = _local1.stepc - 1;
if (_local1.randomed) {
if (_local1.power._currentframe < _local1.power._totalframes) {
_local1.power.nextFrame();
} else {
_local1.power.gotoAndStop(2);
}
}
}
var y = Math.floor((_local1._y + (_local1.power._height / 2)) / tileHeight);
var x = Math.floor(_local1._x / tileWidth);
if (!_local1.stopped) {
_local1._y = _local1._y + (_local1.yspeed * timeStep);
if (_local1.fall) {
_local1.chute._xscale = _local1.chute._xscale - (10 * timeStep);
if (_local1.chute._xscale < 0) {
_local1.chute._xscale = 0;
_local1.chute._visible = 0;
}
if (map[y][x][0] != 0) {
if (_local1.yspeed < 4) {
_local1._y = ((y * tileHeight) - (_local1.power._height / 2)) + 2;
_local1.stopped = 1;
} else {
_local1._y = ((y * tileHeight) - (_local1.power._height / 2)) - 2;
_local1.yspeed = _local1.yspeed * -0.25;
_local1._y = _local1._y + (_local1.yspeed * timeStep);
}
}
} else {
_local1.chute._xscale = _local1.chute._xscale + (10 * timeStep);
if (_local1.chute._xscale > 100) {
_local1.chute._xscale = 100;
}
if (map[Math.floor((_local1._y + 150) / tileWidth)][x][0] != 0) {
_local1.fall = 1;
}
}
} else {
_local1.time++;
}
if ((((x < (worldpos[0] - 1)) || (x > ((worldpos[0] + stw) + 1))) || (y < (worldpos[1] - 1))) || (y > ((worldpos[1] + sth) + 1))) {
_local1._visible = 0;
} else {
_local1._visible = 1;
}
if (player.hitTest(_local1.power)) {
_local1.remove = 1;
var temp = world.attachMovie("popup", "popup_" + world.entityDepth, world.entityDepth++);
temp._x = Math.floor((player._x + (player.width / 2)) - (temp._width / 2));
temp._y = Math.floor(player._y - (temp._height * 2));
temp.action = popupFrame;
entityArray.push(temp);
if (_local1.power._currentframe == 1) {
player.health = Math.min(100, (player.health = player.health + 20));
temp.text = "Health";
if (sounds) {
sphealth.start(0, 0);
}
} else {
var _local3 = _local1.power._currentframe - 1;
var bullets = 0;
if (_local3 == 1) {
if (sounds) {
spmac10.start(0, 0);
}
bullets = 50;
} else if (_local3 == 2) {
if (sounds) {
spshotgun.start(0, 0);
}
bullets = 14;
} else if (_local3 == 3) {
if (sounds) {
spshotgunrockets.start(0, 0);
}
bullets = 8;
} else if (_local3 == 4) {
if (sounds) {
spgrenadelauncher.start(0, 0);
}
bullets = 12;
} else if (_local3 == 5) {
if (sounds) {
sprpg.start(0, 0);
}
bullets = 10;
} else if (_local3 == 6) {
if (sounds) {
sprocketlauncher.start(0, 0);
}
bullets = 8;
} else if (_local3 == 7) {
if (sounds) {
spseekerlauncher.start(0, 0);
}
bullets = 6;
} else if (_local3 == 8) {
if (sounds) {
spflamethrower.start(0, 0);
}
bullets = 150;
} else if (_local3 == 9) {
if (sounds) {
spfiremines.start(0, 0);
}
bullets = 3;
} else if (_local3 == 10) {
if (sounds) {
spabomb.start(0, 0);
}
bullets = 2;
} else if (_local3 == 11) {
if (sounds) {
sprailgun.start(0, 0);
}
bullets = 3;
} else if (_local3 == 12) {
if (sounds) {
spgrapplecannon.start(0, 0);
}
bullets = 2;
} else if (_local3 == 13) {
var p = (1 + random(5));
player.powerupOn = p;
player.powerupTime = powerupTime;
if (p == 1) {
temp.text = "TriDamage";
HUD.powerup.text = "TriDamage";
if (sounds) {
sptridamage.start(0, 0);
}
} else if (p == 2) {
temp.text = "Invulnerability";
HUD.powerup.text = "Invulnerability";
if (sounds) {
spinvulnerability.start(0, 0);
}
} else if (p == 3) {
temp.text = "PredatorMode";
HUD.powerup.text = "PredatorMode";
player.guns[player.guns.length - 1].reloadtime = Number.POSITIVE_INFINITY;
if (sounds) {
sppredatormode.start(0, 0);
}
} else if (p == 4) {
temp.text = "TimeRift";
HUD.powerup.text = "TimeRift";
if (sounds) {
sptimerift.start(0, 0);
}
} else if (p == 5) {
temp.text = "Jetpack";
HUD.powerup.text = "Jetpack";
if (sounds) {
spjetpack.start(0, 0);
}
}
}
if (_local3 < 13) {
temp.text = guns[_local3].name;
player.guns[_local3].bullets = player.guns[_local3].bullets + bullets;
}
}
}
if (_local1.time > 450) {
_local1._alpha = _local1._alpha - 2;
}
if (_local1.remove || (_local1.time >= 500)) {
var _local2 = 0;
while (_local2 < entityArray.length) {
if (entityArray[_local2] == _local1) {
entityArray.splice(_local2, 1);
break;
}
_local2++;
}
rem = 1;
_local1.removeMovieClip();
}
}
function seekerFrame(timeStep) {
var _local1 = this;
_local1.stepc = _local1.stepc + timeStep;
var move = 0;
if (_local1.stepc > 1) {
_local1.r++;
if (!(_local1.r % 2)) {
var temp = world.attachMovie("smoke", "smoke_" + world.entityDepth, world.entityDepth++);
temp._x = _local1._x;
temp._y = _local1._y;
temp.stop();
temp.action = animationFrame;
entityArray.push(temp);
}
_local1.stepc = _local1.stepc - 1;
move = 1;
}
if ((_local1.target = null)) {
_local1._x = _local1._x + (_local1.xspeed * timeStep);
_local1._y = _local1._y + (_local1.yspeed * timeStep);
} else {
var rotd = ((360 - ((Math.atan2(_local1._x - _local1.targets._x, _local1._y - _local1.targets._y) * 180) / Math.PI)) - 90);
var rotn = _local1._rotation;
rotd = (rotd + 360) % 360;
rotn = (rotn + 360) % 360;
var dif = (rotd - rotn);
dif = ((dif > 179) ? (-360 + dif) : (dif));
dif = ((dif < -179) ? (360 + dif) : (dif));
_local1._rotation = _local1._rotation + ((dif / 15) * timeStep);
_local1.xspeed = _local1.sped * Math.cos((_local1._rotation * Math.PI) / 180);
_local1.yspeed = _local1.sped * Math.sin((_local1._rotation * Math.PI) / 180);
_local1._x = _local1._x + (_local1.xspeed * timeStep);
_local1._y = _local1._y + (_local1.yspeed * timeStep);
}
var y = Math.floor(_local1._y / tileHeight);
var x = Math.floor(_local1._x / tileWidth);
var hit = 0;
var closest = Number.POSITIVE_INFINITY;
_local1.targets = null;
var _local2 = 0;
while (_local2 < enemyArray.length) {
if (enemyArray[_local2].hit.hitTest(_local1._x + world._x, _local1._y + world._y, 1)) {
enemyArray[_local2].health = enemyArray[_local2].health - _local1.damage;
score = score + _local1.damage;
hit = 1;
hits++;
break;
}
var _local3 = distance(_local1._x, _local1._y, enemyArray[_local2]._x, enemyArray[_local2]._y);
if (_local3 < closest) {
closest = _local3;
_local1.targets = enemyArray[_local2];
}
_local2++;
}
if (((((hit || (map[y][x][0] != 0)) || (x < (worldpos[0] - 1))) || (x > ((worldpos[0] + stw) + 1))) || (y < (worldpos[1] - 1))) || (y > ((worldpos[1] + sth) + 1))) {
if (hit || (map[y][x][0] != 0)) {
var temp = world.attachMovie("boom", "boom_" + world.entityDepth, world.entityDepth++);
temp._x = _local1._x;
temp._y = _local1._y;
temp.stop();
temp.action = animationFrame;
entityArray.push(temp);
var dist = distance(_local1._x, _local1._y, player._x + (player.width / 2), player._y + player.height);
if (dist < 100) {
var ang = ((360 - ((Math.atan2((player._x + (player.width / 2)) - _local1._x, (player._y + player.height) - _local1._y) * 180) / Math.PI)) + 90);
var mult = (1 - (dist / 100));
player.xspeed = player.xspeed + int((mult * 12) * Math.cos((ang * Math.PI) / 180));
player.yspeed = player.yspeed + ((mult * 32) * Math.sin((ang * Math.PI) / 180));
player.hjump = 1;
}
if (sounds) {
sboom.start(0, 0);
}
}
_local2 = 0;
while (_local2 < entityArray.length) {
if (entityArray[_local2] == _local1) {
entityArray.splice(_local2, 1);
break;
}
_local2++;
}
rem = 1;
_local1.removeMovieClip();
}
}
function aBombFrame(timeStep) {
var _local1 = this;
_local1.stepc = _local1.stepc + timeStep;
if (_local1.stepc > 1) {
_local1.r++;
if (!(_local1.r % 4)) {
var temp = world.attachMovie("flame", "flame_" + world.entityDepth, world.entityDepth++);
temp._x = _local1._x;
temp._y = _local1._y;
temp.stop();
temp.action = animationFrame;
entityArray.push(temp);
}
_local1.stepc = _local1.stepc - 1;
}
_local1._x = _local1._x + (_local1.xspeed * timeStep);
_local1._y = _local1._y + (_local1.yspeed * timeStep);
var y = Math.floor(_local1._y / tileHeight);
var x = Math.floor(_local1._x / tileWidth);
var _local3 = 0;
var _local2 = 0;
while (_local2 < enemyArray.length) {
if (enemyArray[_local2].hit.hitTest(_local1._x + world._x, _local1._y + world._y, 1)) {
enemyArray[_local2].health = enemyArray[_local2].health - _local1.damage;
score = score + _local1.damage;
_local3 = 1;
hits++;
break;
}
_local2++;
}
if (((((_local3 || (map[y][x][0] != 0)) || (x < (worldpos[0] - 1))) || (x > ((worldpos[0] + stw) + 1))) || (y < (worldpos[1] - 1))) || (y > ((worldpos[1] + sth) + 1))) {
if (_local3 || (map[y][x][0] != 0)) {
var temp = world.attachMovie("boom", "boom_" + world.entityDepth, world.entityDepth++);
temp._x = _local1._x;
temp._y = _local1._y;
temp._xscale = (temp._yscale = 800);
temp.stop();
temp.action = animationFrame;
entityArray.push(temp);
var dist = distance(_local1._x, _local1._y, player._x + (player.width / 2), player._y + player.height);
if (dist < 300) {
var ang = ((360 - ((Math.atan2((player._x + (player.width / 2)) - _local1._x, (player._y + player.height) - _local1._y) * 180) / Math.PI)) + 90);
var mult = (1 - (dist / 300));
player.xspeed = player.xspeed + int((mult * 24) * Math.cos((ang * Math.PI) / 180));
player.yspeed = player.yspeed + ((mult * 64) * Math.sin((ang * Math.PI) / 180));
player.hjump = 1;
}
if (sounds) {
sbigboom.start(0, 0);
}
}
_local2 = 0;
while (_local2 < entityArray.length) {
if (entityArray[_local2] == _local1) {
entityArray.splice(_local2, 1);
break;
}
_local2++;
}
rem = 1;
_local1.removeMovieClip();
}
}
function smallrocketFrame(timeStep) {
var _local1 = this;
_local1.stepc = _local1.stepc + timeStep;
if (_local1.stepc > 1) {
_local1.r++;
if (!(_local1.r % 4)) {
var temp = world.attachMovie("smoke", "smoke_" + world.entityDepth, world.entityDepth++);
temp._x = _local1._x;
temp._y = _local1._y;
temp.stop();
temp.action = animationFrame;
entityArray.push(temp);
}
_local1.stepc = _local1.stepc - 1;
}
_local1._x = _local1._x + (_local1.xspeed * timeStep);
_local1._y = _local1._y + (_local1.yspeed * timeStep);
var y = Math.floor(_local1._y / tileHeight);
var x = Math.floor(_local1._x / tileWidth);
var _local3 = 0;
var _local2 = 0;
while (_local2 < enemyArray.length) {
if (enemyArray[_local2].hit.hitTest(_local1._x + world._x, _local1._y + world._y, 1)) {
enemyArray[_local2].health = enemyArray[_local2].health - _local1.damage;
score = score + _local1.damage;
_local3 = 1;
hits++;
break;
}
_local2++;
}
if (((((_local3 || (map[y][x][0] != 0)) || (x < (worldpos[0] - 1))) || (x > ((worldpos[0] + stw) + 1))) || (y < (worldpos[1] - 1))) || (y > ((worldpos[1] + sth) + 1))) {
if (_local3 || (map[y][x][0] != 0)) {
var temp = world.attachMovie("boom", "boom_" + world.entityDepth, world.entityDepth++);
temp._x = _local1._x;
temp._y = _local1._y;
temp._xscale = (temp._yscale = 50);
temp.stop();
temp.action = animationFrame;
entityArray.push(temp);
var dist = distance(_local1._x, _local1._y, player._x + (player.width / 2), player._y + player.height);
if (dist < 50) {
var ang = ((360 - ((Math.atan2((player._x + (player.width / 2)) - _local1._x, (player._y + player.height) - _local1._y) * 180) / Math.PI)) + 90);
var mult = (1 - (dist / 50));
player.xspeed = player.xspeed + int((mult * 6) * Math.cos((ang * Math.PI) / 180));
player.yspeed = player.yspeed + ((mult * 12) * Math.sin((ang * Math.PI) / 180));
player.hjump = 1;
}
if (sounds) {
ssmallboom.start(0, 0);
}
}
_local2 = 0;
while (_local2 < entityArray.length) {
if (entityArray[_local2] == _local1) {
entityArray.splice(_local2, 1);
break;
}
_local2++;
}
rem = 1;
_local1.removeMovieClip();
}
}
function rpgFrame(timeStep) {
var _local1 = this;
_local1.stepc = _local1.stepc + timeStep;
if (_local1.stepc > 1) {
_local1.activate++;
if (_local1.activate == 3) {
if (sounds) {
srocket.start(0, 0);
}
}
if ((_local1.activate > 3) && (_local1.activate < 7)) {
_local1.xspeed = _local1.xspeed * 2;
_local1.yspeed = _local1.yspeed * 2;
}
if (_local1.activate > 2) {
_local1.r++;
if (!(_local1.r % 1)) {
var temp = world.attachMovie("smoke", "smoke_" + world.entityDepth, world.entityDepth++);
temp._x = _local1._x;
temp._y = _local1._y;
temp.stop();
temp.action = animationFrame;
entityArray.push(temp);
}
}
_local1.stepc = _local1.stepc - 1;
}
_local1._rotation = _local1._rotation + ((_local1.xspeed * timeStep) * 4);
_local1._x = _local1._x + (_local1.xspeed * timeStep);
_local1._y = _local1._y + (_local1.yspeed * timeStep);
var y = Math.floor(_local1._y / tileHeight);
var x = Math.floor(_local1._x / tileWidth);
var _local3 = 0;
var _local2 = 0;
while (_local2 < enemyArray.length) {
if (enemyArray[_local2].hit.hitTest(_local1._x + world._x, _local1._y + world._y, 1)) {
enemyArray[_local2].health = enemyArray[_local2].health - _local1.damage;
score = score + _local1.damage;
_local3 = 1;
hits++;
break;
}
_local2++;
}
if (((((_local3 || (map[y][x][0] != 0)) || (x < (worldpos[0] - 1))) || (x > ((worldpos[0] + stw) + 1))) || (y < (worldpos[1] - 1))) || (y > ((worldpos[1] + sth) + 1))) {
if (_local3 || (map[y][x][0] != 0)) {
var temp = world.attachMovie("boom", "boom_" + world.entityDepth, world.entityDepth++);
temp._x = _local1._x;
temp._y = _local1._y;
temp.stop();
temp.action = animationFrame;
entityArray.push(temp);
var dist = distance(_local1._x, _local1._y, player._x + (player.width / 2), player._y + player.height);
if (dist < 100) {
var ang = ((360 - ((Math.atan2((player._x + (player.width / 2)) - _local1._x, (player._y + player.height) - _local1._y) * 180) / Math.PI)) + 90);
var mult = (1 - (dist / 100));
player.xspeed = player.xspeed + int((mult * 9) * Math.cos((ang * Math.PI) / 180));
player.yspeed = player.yspeed + ((mult * 24) * Math.sin((ang * Math.PI) / 180));
player.hjump = 1;
}
if (sounds) {
sboom.start(0, 0);
}
}
_local2 = 0;
while (_local2 < entityArray.length) {
if (entityArray[_local2] == _local1) {
entityArray.splice(_local2, 1);
break;
}
_local2++;
}
rem = 1;
_local1.removeMovieClip();
}
}
function rocketFrame(timeStep) {
var _local1 = this;
_local1.stepc = _local1.stepc + timeStep;
if (_local1.stepc > 1) {
_local1.r++;
if (!(_local1.r % 2)) {
var temp = world.attachMovie("smoke", "smoke_" + world.entityDepth, world.entityDepth++);
temp._x = _local1._x;
temp._y = _local1._y;
temp.stop();
temp.action = animationFrame;
entityArray.push(temp);
}
_local1.stepc = _local1.stepc - 1;
}
_local1._x = _local1._x + (_local1.xspeed * timeStep);
_local1._y = _local1._y + (_local1.yspeed * timeStep);
var y = Math.floor(_local1._y / tileHeight);
var x = Math.floor(_local1._x / tileWidth);
var _local3 = 0;
var _local2 = 0;
while (_local2 < enemyArray.length) {
if (enemyArray[_local2].hit.hitTest(_local1._x + world._x, _local1._y + world._y, 1)) {
enemyArray[_local2].health = enemyArray[_local2].health - _local1.damage;
score = score + _local1.damage;
_local3 = 1;
hits++;
break;
}
_local2++;
}
if (((((_local3 || (map[y][x][0] != 0)) || (x < (worldpos[0] - 1))) || (x > ((worldpos[0] + stw) + 1))) || (y < (worldpos[1] - 1))) || (y > ((worldpos[1] + sth) + 1))) {
if (_local3 || (map[y][x][0] != 0)) {
var temp = world.attachMovie("boom", "boom_" + world.entityDepth, world.entityDepth++);
temp._x = _local1._x;
temp._y = _local1._y;
temp.stop();
temp.action = animationFrame;
entityArray.push(temp);
var dist = distance(_local1._x, _local1._y, player._x + (player.width / 2), player._y + player.height);
if (dist < 100) {
var ang = ((360 - ((Math.atan2((player._x + (player.width / 2)) - _local1._x, (player._y + player.height) - _local1._y) * 180) / Math.PI)) + 90);
var mult = (1 - (dist / 100));
player.xspeed = player.xspeed + int((mult * 12) * Math.cos((ang * Math.PI) / 180));
player.yspeed = player.yspeed + ((mult * 32) * Math.sin((ang * Math.PI) / 180));
player.hjump = 1;
}
if (sounds) {
sboom.start(0, 0);
}
}
_local2 = 0;
while (_local2 < entityArray.length) {
if (entityArray[_local2] == _local1) {
entityArray.splice(_local2, 1);
break;
}
_local2++;
}
rem = 1;
_local1.removeMovieClip();
}
}
function grappleAttached(timeStep) {
var _local2 = this;
if (_local2.attached._x == undefined) {
var _local1 = 0;
while (_local1 < entityArray.length) {
if (entityArray[_local1] == _local2) {
entityArray.splice(_local1, 1);
break;
}
_local1++;
}
rem = 1;
_local2.removeMovieClip();
}
_local2._x = _local2.attached._x + _local2.offsetx;
_local2._y = _local2.attached._y + _local2.offsety;
_local2.clear();
_local2.lineStyle(2, 0, 100);
_local2.lineTo((player._x + (player.width / 2)) - _local2._x, (player._y + (player.height / 2)) - _local2._y);
}
function grappleFrame(timeStep) {
var _local2 = this;
_local2.stepc = _local2.stepc + timeStep;
if (_local2.stepc > 1) {
_local2.r++;
_local2.stepc = _local2.stepc - 1;
}
if (_local2._rotation != 0) {
_local2.gfx._rotation = _local2._rotation;
_local2._rotation = 0;
}
_local2._x = _local2._x + (_local2.xspeed * timeStep);
_local2._y = _local2._y + (_local2.yspeed * timeStep);
var y = Math.floor(_local2._y / tileHeight);
var x = Math.floor(_local2._x / tileWidth);
var hit = 0;
var _local3 = 0;
while (_local3 < enemyArray.length) {
if (enemyArray[_local3].hit.hitTest(_local2._x + world._x, _local2._y + world._y, 1)) {
enemyArray[_local3].action = heliFall;
_local2.attached = enemyArray[_local3];
_local2.offsetx = _local2._x - enemyArray[_local3]._x;
_local2.offsety = _local2._y - enemyArray[_local3]._y;
_local2.action = grappleAttached;
entityArray.push(enemyArray[_local3]);
enemyArray.splice(_local3, 1);
helis++;
rthelis++;
if (helis == 3) {
var _local1 = world.attachMovie("powerup", "powerup_" + world.entityDepth, world.entityDepth++);
_local1._x = _local2._x;
_local1._y = _local2._y;
_local1.chute._xscale = 0;
if (rthelis >= nextHealth) {
nextHealth = nextHealth * 2;
_local1.power.gotoAndStop(1);
} else {
if ((random(100) % 32) == 0) {
_local1.randomed = 1;
}
_local1.power.gotoAndStop(random(_local1.power._totalframes - 1) + 2);
}
_local1.action = powerupFrame;
entityArray.push(_local1);
helis = 0;
}
_local3 = 0;
while (_local3 < 2) {
var _local1 = world.attachMovie("Shard", "Shard_" + world.entityDepth, world.entityDepth++);
_local1._x = _local2._x;
_local1._y = _local2._y;
_local1._rotation = random(360);
_local1.xspeed = -10 + random(20);
_local1.yspeed = -10 + random(20);
_local1.gotoAndStop(random(_local1._totalframes) + 1);
_local1.action = shardFrame;
entityArray.push(_local1);
_local3++;
}
addEnemy(300);
score = score + _local2.damage;
hit = 1;
hits++;
break;
}
_local3++;
}
if (((((map[y][x][0] != 0) || (x < (worldpos[0] - 1))) || (x > ((worldpos[0] + stw) + 1))) || (y < (worldpos[1] - 1))) || (y > ((worldpos[1] + sth) + 1))) {
_local3 = 0;
while (_local3 < entityArray.length) {
if (entityArray[_local3] == _local2) {
entityArray.splice(_local3, 1);
break;
}
_local3++;
}
rem = 1;
_local2.removeMovieClip();
}
_local2.clear();
_local2.lineStyle(2, 0, 100);
_local2.lineTo((player._x + (player.width / 2)) - _local2._x, (player._y + (player.height / 2)) - _local2._y);
}
function grenadeFrame(timeStep) {
var _local1 = this;
_local1.stepc = _local1.stepc + timeStep;
if (_local1.stepc > 1) {
_local1.r++;
_local1.yspeed = _local1.yspeed + 0.75;
_local1.stepc = _local1.stepc - 1;
}
_local1.gfx._rotation = _local1.gfx._rotation + ((_local1.xspeed * timeStep) * 4);
_local1._x = _local1._x + (_local1.xspeed * timeStep);
var y = Math.floor(_local1._y / tileHeight);
var x = Math.floor(_local1._x / tileWidth);
if (map[y][x][0] != 0) {
_local1._x = _local1._x - (_local1.xspeed * timeStep);
_local1.xspeed = _local1.xspeed * -0.5;
var x = Math.floor(_local1._x / tileWidth);
if (sounds) {
var r = random(4);
_root["smetal" + r].start(0, 0);
}
}
_local1._y = _local1._y + (_local1.yspeed * timeStep);
var y = Math.floor(_local1._y / tileHeight);
if (map[y][x][0] != 0) {
_local1._y = _local1._y - (_local1.yspeed * timeStep);
_local1.yspeed = _local1.yspeed * -0.5;
var y = Math.floor(_local1._y / tileHeight);
_local1.bounces++;
if (sounds) {
var r = random(4);
_root["smetal" + r].start(0, 0);
}
}
var _local3 = 0;
var _local2 = 0;
while (_local2 < enemyArray.length) {
if (enemyArray[_local2].hit.hitTest(_local1._x + world._x, _local1._y + world._y, 1)) {
enemyArray[_local2].health = enemyArray[_local2].health - _local1.damage;
score = score + _local1.damage;
_local3 = 1;
hits++;
break;
}
_local2++;
}
if (((((_local3 || (_local1.bounces >= 3)) || (x < (worldpos[0] - 1))) || (x > ((worldpos[0] + stw) + 1))) || (y < (worldpos[1] - 1))) || (y > ((worldpos[1] + sth) + 1))) {
if (_local3 || (_local1.bounces >= 3)) {
var temp = world.attachMovie("boom", "boom_" + world.entityDepth, world.entityDepth++);
temp._x = _local1._x;
temp._y = _local1._y;
temp.stop();
temp.action = animationFrame;
entityArray.push(temp);
var dist = distance(_local1._x, _local1._y, player._x + (player.width / 2), player._y + player.height);
if (dist < 100) {
var ang = ((360 - ((Math.atan2((player._x + (player.width / 2)) - _local1._x, (player._y + player.height) - _local1._y) * 180) / Math.PI)) + 90);
var mult = (1 - (dist / 100));
player.xspeed = player.xspeed + int((mult * 9) * Math.cos((ang * Math.PI) / 180));
player.yspeed = player.yspeed + ((mult * 24) * Math.sin((ang * Math.PI) / 180));
player.hjump = 1;
}
if (sounds) {
sboom.start(0, 0);
}
}
_local2 = 0;
while (_local2 < entityArray.length) {
if (entityArray[_local2] == _local1) {
entityArray.splice(_local2, 1);
break;
}
_local2++;
}
rem = 1;
_local1.removeMovieClip();
}
}
function fireMinesFrame(timeStep) {
var _local1 = this;
var _local3 = timeStep;
_local1.stepc = _local1.stepc + _local3;
var move = 0;
if (_local1.stepc > 1) {
_local1.r++;
if (!_local1.active) {
_local1.yspeed = _local1.yspeed + 1;
}
_local1.stepc = _local1.stepc - 1;
move = 1;
}
_local1._rotation = 0;
_local1._x = _local1._x + (_local1.xspeed * _local3);
var y = Math.floor(_local1._y / tileHeight);
var x = Math.floor(_local1._x / tileWidth);
if (map[y][x][0] != 0) {
_local1._x = _local1._x - (_local1.xspeed * _local3);
_local1.xspeed = _local1.xspeed * -0.5;
var x = Math.floor(_local1._x / tileWidth);
}
_local1._y = _local1._y + (_local1.yspeed * _local3);
var y = Math.floor(_local1._y / tileHeight);
if (map[y][x][0] != 0) {
_local1._y = ((y * tileHeight) - (_local1.power._height / 2)) - 1;
_local1.yspeed = 0;
_local1.xspeed = 0;
_local1.active++;
}
if (_local1.active == 1) {
var temp = _local1.attachMovie("flamePillar", "FlamePillar", 0);
temp._alpha = 0;
temp._xscale = 0;
}
if (_local1.active) {
if (sounds) {
sflame.setVolume(255);
}
if (move) {
_local1.active++;
}
var _local2 = 0;
while (_local2 < enemyArray.length) {
if (enemyArray[_local2].hitTest(_local1)) {
enemyArray[_local2].health = enemyArray[_local2].health - (_local1.damage * _local3);
score = score + (_local1.damage * _local3);
if ((_local1.nohit++) == 1) {
hits++;
}
break;
}
_local2++;
}
}
if (_local1.active <= 20) {
_local1.flamePillar._alpha = _local1.flamePillar._alpha + (25 * _local3);
if (_local1.flamePillar._alpha > 100) {
_local1.flamePillar._alpha = 100;
}
_local1.flamePillar._xscale = _local1.flamePillar._xscale + (25 * _local3);
if (_local1.flamePillar._xscale > 100) {
_local1.flamePillar._xscale = 100;
}
}
if (_local1.active > 30) {
_local1.flamePillar._alpha = _local1.flamePillar._alpha - (7 * _local3);
_local1.flamePillar._xscale = _local1.flamePillar._xscale - (7 * _local3);
if (_local1.flamePillar._alpha <= 0) {
var _local2 = 0;
while (_local2 < entityArray.length) {
if (entityArray[_local2] == _local1) {
entityArray.splice(_local2, 1);
break;
}
_local2++;
}
rem = 1;
_local1.removeMovieClip();
}
}
}
function railFrame(timeStep) {
var _local1 = this;
_local1.stepc = _local1.stepc + timeStep;
if (_local1.anim > 1) {
_local1._alpha = _local1._alpha - (10 * timeStep);
}
if (_local1.stepc >= 1) {
_local1.anim++;
if (_local1.anim == 1) {
var hit = 0;
var x = _local1._x;
var y = _local1._y;
var left = ((worldpos[0] - 1) * tileWidth);
var right = (((worldpos[0] + stw) + 1) * tileWidth);
var up = ((worldpos[1] - 1) * tileHeight);
var down = (((worldpos[1] + sth) + 1) * tileHeight);
var i = 0;
while (i < enemyArray.length) {
var _local3 = x;
var _local2 = y;
while ((((_local3 > left) && (_local3 < right)) && (_local2 > up)) && (_local2 < down)) {
_local3 = _local3 + _local1.xspeed;
_local2 = _local2 + _local1.yspeed;
if (enemyArray[i].hit.hitTest(_local3 + world._x, _local2 + world._y, 1)) {
enemyArray[i].health = enemyArray[i].health - _local1.damage;
score = score + _local1.damage;
if (hit == 0) {
hits++;
hit = 1;
}
break;
}
}
i++;
}
}
if (_local1.anim > 2) {
if (_local1._alpha <= 0) {
var i = 0;
while (i < entityArray.length) {
if (entityArray[i] == _local1) {
entityArray.splice(i, 1);
break;
}
i++;
}
rem = 1;
_local1.removeMovieClip();
}
}
}
}
function shotgunRocket(x, y, rot, speed, damage) {
var _local1 = speed;
var _local2 = damage;
var _local3 = rot;
shots = shots + 3;
addBullet(x, y, _local3 - 10, _local1, smallRocketFrame, 7, _local2);
addBullet(x, y, _local3, _local1, smallRocketFrame, 7, _local2);
addBullet(x, y, _local3 + 10, _local1, smallRocketFrame, 7, _local2);
}
function shotgun(x, y, rot, speed, damage) {
var _local1 = y;
var _local2 = x;
var _local3 = speed;
shots = shots + 5;
if (map[Math.floor(_local1 / TileHeight)][Math.floor(_local2 / TileWidth)][0] == 0) {
addBullet(_local2, _local1, rot - 10, _local3, bulletFrame, 1, damage);
addBullet(_local2, _local1, rot - 5, _local3, bulletFrame, 1, damage);
addBullet(_local2, _local1, rot, _local3, bulletFrame, 1, damage);
addBullet(_local2, _local1, rot + 5, _local3, bulletFrame, 1, damage);
addBullet(_local2, _local1, rot + 10, _local3, bulletFrame, 1, damage);
}
}
function rocketLauncher(x, y, rot, speed, damage) {
shots++;
addBullet(x, y, rot, speed, rocketFrame, 2, damage);
}
function grapple(x, y, rot, speed, damage) {
shots++;
addBullet(x, y, rot, speed, grappleFrame, 12, damage);
}
function shoulderCannon(x, y, rot, speed, damage) {
shots++;
addBullet(x, y, rot, speed, railFrame, 11, damage);
}
function railGun(x, y, rot, speed, damage) {
shots++;
addBullet(x, y, rot, speed, railFrame, 9, damage);
}
function rpg(x, y, rot, speed, damage) {
shots++;
addBullet(x, y, rot, speed, rpgFrame, 8, damage);
}
function aBombLauncher(x, y, rot, speed, damage) {
shots++;
addBullet(x, y, rot, speed, abombFrame, 6, damage);
}
function seekerLauncher(x, y, rot, speed, damage) {
shots++;
addBullet(x, y, rot, speed, seekerFrame, 5, damage);
}
function machineGun(x, y, rot, speed, damage) {
shots++;
if (map[Math.floor(y / TileHeight)][Math.floor(x / TileWidth)][0] == 0) {
addBullet(x, y, (rot - 2) + random(4), speed, bulletFrame, 1, damage);
}
}
function uzi(x, y, rot, speed, damage) {
var _local1 = speed;
var _local2 = rot;
shots = shots + 2;
if (map[Math.floor(y / TileHeight)][Math.floor(x / TileWidth)][0] == 0) {
var xs = (_local1 * Math.cos((_local2 * Math.PI) / 180));
var _local3 = _local1 * Math.sin((_local2 * Math.PI) / 180);
addBullet(x, y, (_local2 - 8) + random(16), _local1, bulletFrame, 1, damage);
addBullet(x + xs, y + _local3, (_local2 - 8) + random(16), _local1, bulletFrame, 1, damage);
}
}
function flameFrame(timeStep) {
var _local1 = this;
var _local3 = timeStep;
_local1.stepc = _local1.stepc + _local3;
_local1._x = _local1._x + (_local1.xspeed * _local3);
_local1._y = _local1._y + (_local1.yspeed * _local3);
var y = Math.floor(_local1._y / tileHeight);
var x = Math.floor(_local1._x / tileWidth);
var _local2 = 0;
while (_local2 < enemyArray.length) {
if (enemyArray[_local2].hitTest(_local1)) {
enemyArray[_local2].health = enemyArray[_local2].health - ((_local1.damage * (1 - (_local1.gfx._currentframe / _local1.gfx._totalframes))) * _local3);
score = score + ((_local1.damage * (1 - (_local1.gfx._currentframe / _local1.gfx._totalframes))) * _local3);
if ((_local1.hitser++) == 1) {
hits++;
}
}
_local2++;
}
if (_local1.stepc >= 1) {
if ((map[y][x][0] != 0) && (_local1.gfx._currentframe < (_local1.gfx._totalframes - 3))) {
_local1.gfx.gotoAndStop(_local1.gfx._totalframes - 3);
}
_local1.gfx.nextFrame();
if (_local1.gfx._currentframe == _local1.gfx._totalframes) {
_local2 = 0;
while (_local2 < entityArray.length) {
if (entityArray[_local2] == _local1) {
entityArray.splice(_local2, 1);
break;
}
_local2++;
}
rem = 1;
_local1.removeMovieClip();
}
_local1.stepc = _local1.stepc - 1;
}
}
function flameThrower(x, y, rot, speed, damage) {
shots++;
addBullet(x, y, (rot - 10) + random(20), speed, flameFrame, 3, damage);
}
function grenadeLauncher(x, y, rot, speed, damage) {
shots++;
addBullet(x, y, rot, speed, grenadeFrame, 4, damage);
}
function fireMines(x, y, rot, speed, damage) {
shots++;
addBullet(x, y, rot, speed, fireMinesFrame, 10, damage);
}
function addBullet(x, y, rot, speed, func, frame, damage) {
var _local2 = speed;
var _local3 = rot;
var _local1 = world.attachMovie("bullet", "bullet_" + world.entityDepth, world.entityDepth++);
_local1._x = x;
_local1._y = y;
_local1.sped = _local2;
_local1.xspeed = _local2 * Math.cos((_local3 * Math.PI) / 180);
_local1.yspeed = _local2 * Math.sin((_local3 * Math.PI) / 180);
_local1.gotoAndStop(frame);
_local1._rotation = _local3;
_local1.action = func;
_local1.damage = damage;
entityArray.push(_local1);
}
function enemyBulletFrame(timeStep) {
var _local3 = this;
_local3._x = _local3._x + (_local3.xspeed * timeStep);
_local3._y = _local3._y + (_local3.yspeed * timeStep);
var y = Math.floor(_local3._y / tileHeight);
var x = Math.floor(_local3._x / tileWidth);
var hit = 0;
if (player.gfx.hit.hitTest(_local3._x + world._x, _local3._y + world._y, 1)) {
hit = 1;
if (player.powerupon != 2) {
player.health = player.health - 10;
var _local2 = 0;
while (_local2 < 3) {
var _local1 = world.attachMovie("blood", "blood_" + world.entityDepth, world.entityDepth++);
_local1._x = player._x + (player.width / 2);
_local1._y = player._y + (player.height / 2);
_local1._rotation = random(360);
_local1.action = animationFrame;
_local1.stop();
_local1.pause = _local2 * 2;
entityArray.push(_local1);
_local2++;
}
}
}
if (((((hit || (map[y][x][0] != 0)) || (x < (worldpos[0] - 1))) || (x > ((worldpos[0] + stw) + 1))) || (y < (worldpos[1] - 1))) || (y > ((worldpos[1] + sth) + 1))) {
var _local2 = 0;
while (_local2 < entityArray.length) {
if (entityArray[_local2] == _local3) {
entityArray.splice(_local2, 1);
break;
}
_local2++;
}
rem = 1;
_local3.removeMovieClip();
}
}
function addEnemyBullet(x, y, rot, speed, parent) {
var _local2 = rot;
var _local1 = world.attachMovie("enemybullet", "ebullet_" + world.entityDepth, world.entityDepth++);
_local1._x = x;
_local1._y = y;
_local1.xspeed = speed * Math.cos((_local2 * Math.PI) / 180);
_local1.yspeed = speed * Math.sin((_local2 * Math.PI) / 180);
_local1.gotoAndStop(frame);
_local1._rotation = _local2;
_local1.action = enemyBulletFrame;
entityArray.push(_local1);
}
function heroSetup() {
var _local2 = this;
_local2.stepc = 0;
_local2.width = 48;
_local2.height = 48;
_local2.defplayerwidth = 10;
_local2.defplayerheight = 42;
_local2.xspeed = 0;
_local2.yspeed = 0;
_local2.xchange = 0;
_local2.ychange = 0;
_local2.jump = 0;
_local2.jump2 = 0;
_local2.duck = 0;
_local2.guns = [];
_local2.guns.push({type:0, reloadtime:Number.POSITIVE_INFINITY, bullets:Number.POSITIVE_INFINITY, shots:0});
var _local1 = 1;
while (_local1 < (guns.length - 1)) {
_local2.guns.push({type:_local1, reloadtime:Number.POSITIVE_INFINITY, bullets:0, shots:0});
_local1++;
}
_local2.guns.push({type:guns.length - 1, reloadtime:Number.POSITIVE_INFINITY, bullets:Number.POSITIVE_INFINITY, shots:0});
_local2.cgun = 0;
_local2.bullettime = maxbullettime;
_local2.hyperjump = 150;
_local2.health = (_local2.lastHealth = 100);
_local2.powerupon = 0;
_local2.cgun = 0;
}
function heroStart(timeStep) {
var _local1 = this;
var _local2 = timeStep;
_local1.gfx.gotoAndStop(6);
_local1.stepc = _local1.stepc + _local2;
if (_local1.stepc > 1) {
_local1.yspeed = 2;
_local1.stepc = _local1.stepc - 1;
}
var _local3 = Math.floor((_local1._y + _local1.height) / tileHeight);
var x = Math.floor((_local1._x + (_local1.width / 2)) / tileWidth);
_local1._y = _local1._y + (_local1.yspeed * _local2);
_local1._y = _local1._y + 5;
if (_local1.fall) {
_local1.gfx.chute._xscale = _local1.gfx.chute._xscale - (10 * _local2);
if (_local1.gfx.chute._xscale < 0) {
_local1.gfx.chute._xscale = 0;
_local1.gfx.chute._visible = 0;
_local1.action = heroAction;
gamestarted = 1;
addEnemy(300);
}
} else {
_local1.gfx.chute._xscale = _local1.gfx.chute._xscale + (10 * _local2);
if (_local1.gfx.chute._xscale > 100) {
_local1.gfx.chute._xscale = 100;
}
if ((_local3 > 0) && (map[_local3 + 5][x][0] != 0)) {
_local1.fall = 1;
}
}
if (((_local1._y + _local1.height) - (-world._y)) > (sh - (sh / 4))) {
world._y = ((-(_local1._y + _local1.height)) + sh) - (sh / 4);
ret++;
}
return(ret);
}
function heroAction(timestep) {
var _local1 = this;
var _local2 = 0;
_local1.stepc = _local1.stepc + timestep;
_local1.gfx._alpha = 100;
if (_local1.stepc >= 1) {
_local2 = 1;
}
var color0 = new Color(world);
var color1 = new Color(bg);
var color2 = new Color(bglayer1);
var color3 = new Color(HUD);
if (_local1.lasthealth > _local1.health) {
color0.setTransform(hitColor);
color1.setTransform(hitColor);
color2.setTransform(hitColor);
color3.setTransform(hitColor);
if (sounds) {
shurt.start(0, 0);
}
} else {
color0.setTransform(normalColor);
color1.setTransform(normalColor);
color2.setTransform(normalColor);
color3.setTransform(normalColor);
}
var thiscolor = new Color(_local1);
var thiscolort = normalColor;
if (_local1.powerupOn != 0) {
HUD.powerup._visible = 1;
if (_local1.powerupOn == 1) {
thiscolort = doubleDamageColor;
}
if (_local1.powerupOn == 2) {
thiscolort = invunerableColor;
}
_local1.gfx._alpha = 100;
if (_local1.powerupOn == 3) {
_local1.cgun = guns.length - 1;
_local1.gfx._alpha = 0;
color0.setTransform(invColor);
color1.setTransform(invColor);
color2.setTransform(invColor);
color3.setTransform(invColor);
if (((_local1.pred++) % 10) == 4) {
_local1.gfx._alpha = 10;
}
if (((_local1.pred++) % 10) == 8) {
_local1.gfx._alpha = 4;
}
} else if (_local1.cgun == (guns.length - 1)) {
_local1.cgun = 0;
_local1.gfx._alpha = 100;
}
if (_local1.powerupOn == 4) {
thiscolort = warpColor;
_local2 = 1;
timeStep = 1;
}
if (_local1.powerUpTime <= 0) {
if (_local1.powerupOn == 3) {
_local1.cgun = 0;
_local1._visible = 1;
}
_local1.powerupOn = 0;
}
HUD.powerup.powerup.mask._yscale = (_local1.powerupTime / powerupTime) * 100;
if (_local2) {
if ((_local1.powerupOn == 5) && (_local1.jump)) {
if (((_local1.smok++) % 5) == 0) {
var temp = world.attachMovie("smoke", "smoke_" + world.entityDepth, world.entityDepth++);
temp._x = _local1._x + (_local1.width / 2);
temp._y = (_local1._y + (_local1.height / 2)) + (_local1.playerheight / 2);
temp.stop();
temp.action = animationFrame;
entityArray.push(temp);
}
}
_local1.powerupTime--;
}
} else {
HUD.powerup._visible = 0;
}
thiscolor.setTransform(thiscolort);
_local1.lasthealth = _local1.health;
_local1.xchange = 0;
if (_local2 && (Key.isDown(duckKey))) {
_local1.playerWidth = (2 * _local1.defPlayerWidth) / 3;
_local1.playerHeight = (2 * _local1.defPlayerHeight) / 3;
_local1.duck = 1;
} else if (_local2) {
if (_local1.duck) {
_local1._y = _local1._y - ((2 * _local1.defPlayerWidth) / 3);
}
_local1.playerWidth = _local1.defPlayerWidth;
_local1.playerHeight = _local1.defPlayerHeight;
_local1.duck = 0;
}
if (_local2 && (!_local1.duck)) {
if (Key.isDown(leftkey)) {
if (_local1.xspeed > -5) {
_local1.xspeed--;
}
}
if (Key.isDown(rightkey)) {
if (_local1.xspeed < 5) {
_local1.xspeed++;
}
}
}
if ((_local1.yspeed > 0) || (_local1.yspeed < 0)) {
if (!_local1.jump) {
_local1.jump = 1;
}
}
if (_local2 && (_local1.hyperjump < 150)) {
_local1.hyperjump++;
}
if (((((_local1.hyperjump >= 150) && (_local2)) && (Key.isDown(boostKey))) && ((!_local1.jump) || (!_local1.jump2))) && (!_local1.hjump)) {
if (!_local1.boostK) {
if (sounds) {
shjump.start(0, 0);
}
_local1.yspeed = -32;
if (_local1.jump) {
_local1.jump2 = 1;
}
_local1.jump = 1;
_local1.hjump = 1;
_local1.hyperjump = 0;
hjumps++;
}
_local1.boostK = 1;
} else {
_local1.boostK = 0;
}
HUD.hyperjump.mask._xscale = (_local1.hyperjump / 150) * 100;
if (_local2 && (Key.isDown(jumpkey))) {
if (_local1.powerupon == 5) {
_local1.jump = (_local1.jump2 = (_local1.hjump = 1));
_local1.yspeed = Math.max(_local1.yspeed - 2, -32);
} else {
if (_local1.up > 0) {
_local1.yspeed = Math.min(_local1.yspeed, -8);
if (!_local1.upk) {
if (!_local1.jump) {
_local1.jump = 1;
} else if (!_local1.jump2) {
_local1.jump2 = 1;
}
}
_local1.up--;
}
_local1.upk = 1;
}
} else if (_local2) {
if ((!_local1.jump) || ((!_local1.jump2) && (!_local1.duck))) {
_local1.up = 6;
} else {
_local1.up = 0;
}
_local1.upk = 0;
}
if (_local1.jump && (!_local1.duck)) {
_local1.gfx.gotoAndStop(3);
}
if (((_local2 && (Key.isDown(leftkey) && (Key.isDown(rightkey)))) || ((!Key.isDown(leftkey)) && (!Key.isDown(rightkey)))) || (_local1.duck && (!_local1.jump))) {
if (_local1.xspeed > 0) {
_local1.xspeed--;
} else if (_local1.xspeed < 0) {
_local1.xspeed++;
}
}
if (_local2 && (_local1.xspeed > 6)) {
_local1.xspeed--;
}
if (_local2 && (_local1.xspeed < -6)) {
_local1.xspeed++;
}
if (_local2 && (_local1.yspeed > tileHeight)) {
_local1.yspeed = tileHeight;
}
if (_local2 && (_local1.yspeed < (-tileHeight))) {
_local1.yspeed = -tileHeight;
}
if (_local2) {
_local1.yspeed++;
}
_local1.xchange = _local1.xspeed;
_local1.ychange = _local1.yspeed;
_local1.tilex = Math.floor((((_local1._x + _local1.xchange) + (_local1.width / 2)) - (_local1.playerwidth / 2)) / tileWidth);
_local1.tile2x = Math.floor((((_local1._x + _local1.xchange) + (_local1.width / 2)) + (_local1.playerwidth / 2)) / tileWidth);
_local1.tiley = Math.floor((((_local1._y + 1) + (_local1.height / 2)) - (_local1.playerheight / 2)) / tileHeight);
_local1.tile2y = Math.floor(((_local1._y + (_local1.height / 2)) + (_local1.playerheight / 2)) / tileHeight);
if (_local1.xchange != 0) {
if (_local1.xchange > 0) {
if (_local1.tile2x >= width) {
_local1.hits = 1;
} else {
_local1.hits = hitCheck(map, _local1.tiley, _local1.tile2x, _local1.tile2y, _local1.tile2x, 1, 1, 1);
}
if (!_local1.hits) {
_local1._x = _local1._x + (_local1.xchange * timeStep);
} else {
_local1._x = (((_local1.tile2x * tileWidth) - _local1.width) + ((_local1.width - _local1.playerWidth) / 2)) - 1;
_local1.xspeed = 0;
}
} else {
if (_local1.tilex < 0) {
_local1.hits = 1;
} else {
_local1.hits = hitCheck(map, _local1.tiley, _local1.tilex, _local1.tile2y, _local1.tilex, 1, 1, 1);
}
if (!_local1.hits) {
_local1._x = _local1._x + (_local1.xchange * timeStep);
} else {
_local1._x = (((_local1.tilex + 1) * tileWidth) - ((_local1.width - _local1.playerWidth) / 2)) - 1;
_local1.xspeed = 0;
}
}
}
_local1.tilex = Math.floor((((_local1._x + 1) + (_local1.width / 2)) - (_local1.playerwidth / 2)) / tileWidth);
_local1.tile2x = Math.floor(((_local1._x + (_local1.width / 2)) + (_local1.playerwidth / 2)) / tileWidth);
_local1.tiley = Math.floor((((_local1._y + _local1.ychange) + (_local1.height / 2)) - (_local1.playerheight / 2)) / tileHeight);
_local1.tile2y = Math.floor((((_local1._y + _local1.ychange) + (_local1.height / 2)) + (_local1.playerheight / 2)) / tileHeight);
if (_local1.ychange != 0) {
if (_local1.ychange > 0) {
if (!hitCheck(map, _local1.tile2y, _local1.tilex, _local1.tile2y, _local1.tile2x, 0)) {
_local1._y = _local1._y + (_local1.ychange * timeStep);
} else {
_local1._y = (((_local1.tile2y * tileHeight) - _local1.height) + ((_local1.height - _local1.playerHeight) / 2)) - 1;
_local1.yspeed = 0;
_local1.jump = 0;
_local1.jump2 = 0;
_local1.hjump = 0;
_local1.grab = 0;
}
} else if (!hitCheck(map, _local1.tiley, _local1.tilex, _local1.tiley, _local1.tile2x, 0)) {
_local1._y = _local1._y + (_local1.ychange * timeStep);
} else {
_local1._y = (((_local1.tiley + 1) * tileHeight) - ((_local1.height - _local1.playerHeight) / 2)) - 1;
_local1.yspeed = 0;
_local1.jump = 1;
_local1.jump2 = 1;
_local1.up = 0;
}
}
if (_local1.duck) {
_local1.gfx.gotoAndStop(2);
} else if (_local1.jump) {
if (_local1.jump2) {
_local1.gfx.gotoAndStop(5);
} else {
_local1.gfx.gotoAndStop(3);
}
} else if (_local1.xchange != 0) {
_local1.gfx.gotoAndStop(4);
if (_local2) {
if (_local1.gfx.gfx._currentframe < _local1.gfx.gfx._totalframes) {
_local1.gfx.gfx.nextFrame();
} else {
_local1.gfx.gfx.gotoAndStop(1);
}
}
} else {
_local1.gfx.gotoAndStop(1);
}
if ((powerupon != 3) && (Key.isDown(switchKey))) {
if (!_local1.switchK) {
do {
_local1.cgun++;
if (_local1.cgun >= (_local1.guns.length - 1)) {
_local1.cgun = 0;
}
} while (_local1.guns[_local1.cgun].bullets <= 0);
}
_local1.switchK = 1;
} else {
_local1.switchK = 0;
}
_local1.gun.gotoAndStop(_local1.guns[_local1.cgun].type + 1);
_local1.gunrotation = (360 - ((Math.atan2(((world._x + _local1._x) + _local1.gun._x) - _root._xmouse, ((world._y + _local1._y) + _local1.gun._y) - _root._ymouse) * 180) / Math.PI)) - 90;
var rotd = _local1.gunrotation;
var rotn = _local1.gun._rotation;
rotd = (rotd + 360) % 360;
rotn = (rotn + 360) % 360;
var _local3 = rotd - rotn;
_local3 = ((_local3 > 179) ? (-360 + _local3) : (_local3));
_local3 = ((_local3 < -179) ? (360 + _local3) : (_local3));
_local1.gun._rotation = _local1.gun._rotation + ((_local3 / 2) * timeStep);
if ((_local1.gun._rotation > 90) || (_local1.gun._rotation < -90)) {
_local1.gun._yscale = -100;
} else {
_local1.gun._yscale = 100;
}
if (_local2) {
_local1.guns[_local1.cgun].reloadtime++;
}
if (_local1.guns[_local1.cgun].reloadtime < guns[_local1.guns[_local1.cgun].type].reloadtime) {
HUD.reload.yellow._visible = 0;
HUD.reload.mask._xscale = (_local1.guns[_local1.cgun].reloadtime / guns[_local1.guns[_local1.cgun].type].reloadtime) * 100;
} else if (_local1.guns[_local1.cgun].bullets > 0) {
HUD.reload.yellow._visible = 1;
}
if (mouseD) {
if (_local2) {
if (_local1.guns[_local1.cgun].bullets > 0) {
if (_local1.guns[_local1.cgun].reloadtime >= guns[_local1.guns[_local1.cgun].type].reloadtime) {
_local1.guns[_local1.cgun].shots++;
_local1.guns[_local1.cgun].reloadtime = 0;
_local1.guns[_local1.cgun].bullets--;
point = {x:0, y:0};
_local1.gun.barrell.localToGlobal(point);
var type = _local1.guns[_local1.cgun].type;
if (_local1.powerupOn == 1) {
guns[type].gun(point.x - world._x, point.y - world._y, _local1.gun._rotation, guns[type].speed, guns[type].damage * 3);
} else {
guns[type].gun(point.x - world._x, point.y - world._y, _local1.gun._rotation, guns[type].speed, guns[type].damage);
}
if (sounds) {
if (guns[type].soundhold) {
guns[type].sound.setVolume(100);
} else {
guns[type].sound.start(0, 0);
}
}
}
if (_local1.guns[_local1.cgun].bullets <= 0) {
_local1.guns[_local1.cgun].reloadtime = Number.POSITIVE_INFINITY;
_local1.cgun = 0;
}
}
}
}
HUD.weapon.gotoAndStop(_local1.cgun + 1);
if (_local1.guns[_local1.cgun].bullets == Number.POSITIVE_INFINITY) {
HUD.ammo = "Infinite x ";
} else {
HUD.ammo = _local1.guns[_local1.cgun].bullets + " x ";
}
if (_local1.stepc > 1) {
_local1.stepc = _local1.stepc - 1;
}
if (_local1.powerupOn == 2) {
_local1.health = _local1.ihealth;
}
_local1.ihealth = _local1.health;
var ret = 0;
if ((_local1.xchange > 0) && (((_local1._x + _local1.width) - (-world._x)) > ((sw / 2) + _local1.width))) {
world._x = ((-(_local1._x + _local1.width)) + (sw / 2)) + _local1.width;
ret++;
}
if ((_local1.xchange < 0) && ((_local1._x - (-world._x)) < ((sw / 2) - _local1.width))) {
world._x = ((-_local1._x) + (sw / 2)) - _local1.width;
ret++;
}
if ((_local1.ychange > 0) && (((_local1._y + _local1.height) - (-world._y)) > (sh - (sh / 4)))) {
world._y = ((-(_local1._y + _local1.height)) + sh) - (sh / 4);
ret++;
}
if ((_local1.ychange < 0) && ((_local1._y - (-world._y)) < (sh / 4))) {
world._y = (-_local1._y) + (sh / 4);
ret++;
}
return(ret);
}
function heroDie(timeStep) {
var _local1 = this;
var _local2 = timeStep;
HUD.ammo = "0 x ";
HUD.reload.mask._xscale = 0;
HUD.reload.yellow._visible = 0;
HUD.bullettime.mask._xscale = 0;
HUD.hyperjump.mask._xscale = 0;
HUD.powerup._visible = 0;
_local1.stepc = _local1.stepc + _local2;
if (_local1.stepc >= 1) {
_local1.yspeed++;
_local1.stepc = _local1.stepc - 1;
}
if (_local1.rot == undefined) {
_local1.rot = 10;
}
_local1._rotation = _local1._rotation + (Math.abs(_local1.xspeed + _local1.yspeed) * _local2);
_local1._x = _local1._x + (_local1.xspeed * _local2);
var _local3 = Math.floor(_local1._y / tileHeight);
var x = Math.floor(_local1._x / tileWidth);
if (map[_local3][x][0] != 0) {
_local1._x = _local1._x - (_local1.xspeed * _local2);
_local1.xspeed = _local1.xspeed * -0.5;
var x = Math.floor(_local1._x / tileWidth);
}
_local1._y = _local1._y + (_local1.yspeed * _local2);
_local3 = Math.floor(_local1._y / tileHeight);
if (map[_local3][x][0] != 0) {
_local1._y = ((_local3 * tileHeight) - (_local1.power._height / 2)) - 2;
_local1._y = _local1._y - (_local1.yspeed * _local2);
if (_local1.yspeed < 4) {
_local1.action = null;
}
_local1.yspeed = _local1.yspeed * -0.5;
_local1.rot = 0;
}
world._x = (-_local1._x) + (sw / 2);
world._y = (-_local1._y) + (sh / 2);
return(1);
}
function guyFall(timeStep) {
var _local2 = this;
var _local3 = timeStep;
_local2.stepc = _local2.stepc + _local3;
if (_local2.stepc >= 1) {
_local2.yspeed++;
_local2.stepc = _local2.stepc - 1;
}
if (_local2.rot == undefined) {
_local2.rot = 10;
}
_local2._rotation = _local2._rotation + (Math.abs(_local2.xspeed + _local2.yspeed) * _local3);
_local2._x = _local2._x + (_local2.xspeed * _local3);
var y = Math.floor(_local2._y / tileHeight);
var x = Math.floor(_local2._x / tileWidth);
if (map[y][x][0] != 0) {
_local2._x = _local2._x - (_local2.xspeed * _local3);
_local2.xspeed = _local2.xspeed * -0.5;
var x = Math.floor(_local2._x / tileWidth);
}
_local2._y = _local2._y + (_local2.yspeed * _local3);
var y = Math.floor(_local2._y / tileHeight);
if (map[y][x][0] != 0) {
if (_local2.yspeed < 4) {
var _local1 = 0;
while (_local1 < entityArray.length) {
if (entityArray[_local1] == _local2) {
entityArray.splice(_local1, 1);
break;
}
_local1++;
}
rem = 1;
_local2.removeMovieClip();
} else {
_local2._y = _local2._y - (_local2.yspeed * _local3);
_local2.yspeed = _local2.yspeed * -0.2;
_local2.rot = 0;
}
}
}
function heliFall(timeStep) {
var _local1 = this;
_local1.stepc = _local1.stepc + timeStep;
if (_local1.stepc >= 1) {
_local1.yspeed++;
_local1.stepc = _local1.stepc - 1;
}
if (_local1.xspeed > 0) {
_local1._rotation = _local1._rotation + ((_local1.yspeed * timeStep) / 4);
} else {
_local1._rotation = _local1._rotation - ((_local1.yspeed * timeStep) / 4);
}
_local1._x = _local1._x + (_local1.xspeed * timeStep);
_local1._y = _local1._y + (_local1.yspeed * timeStep);
if (map[Math.floor(_local1._y / tileHeight)][Math.floor(_local1._x / tileWidth)][0] != 0) {
var _local2 = 0;
while (_local2 < 3) {
var _local3 = world.attachMovie("Shard", "Shard_" + world.entityDepth, world.entityDepth++);
_local3._x = _local1._x;
_local3._y = _local1._y - (tileWidth / 2);
_local3._rotation = random(360);
_local3.gotoAndStop(random(_local3._totalframes) + 1);
_local3.xspeed = -10 + random(20);
_local3.yspeed = -10 + random(20);
_local3.action = shardFrame;
entityArray.push(_local3);
_local2++;
}
if (sounds) {
sboom.start(0, 0);
}
var _local3 = world.attachMovie("boom", "boom_" + world.entityDepth, world.entityDepth++);
_local3._x = _local1._x;
_local3._y = _local1._y;
_local3._xscale = (_local3._yscale = 200);
_local3.action = animationFrame;
entityArray.push(_local3);
_local2 = 0;
while (_local2 < entityArray.length) {
if (entityArray[_local2] == _local1) {
entityArray.splice(_local2, 1);
break;
}
_local2++;
}
rem = 1;
_local1.removeMovieClip();
}
}
function shardFrame(timeStep) {
var _local2 = this;
var _local3 = timeStep;
_local2.stepc = _local2.stepc + _local3;
if (_local2.stepc > 1) {
_local2.r++;
_local2.yspeed = _local2.yspeed + 1;
_local2.stepc = _local2.stepc - 1;
}
_local2._rotation = _local2._rotation + ((_local2.xspeed * _local3) * 4);
_local2._x = _local2._x + (_local2.xspeed * _local3);
var y = Math.floor(_local2._y / tileHeight);
var x = Math.floor(_local2._x / tileWidth);
if (map[y][x][0] != 0) {
_local2._x = _local2._x - (_local2.xspeed * _local3);
_local2.xspeed = _local2.xspeed * -0.5;
var x = Math.floor(_local2._x / tileWidth);
if ((!((sbounce++) % 3)) && (sounds)) {
var r = random(4);
_root["smetal" + r].start(0, 0);
}
}
_local2._y = _local2._y + (_local2.yspeed * _local3);
var y = Math.floor(_local2._y / tileHeight);
if (map[y][x][0] != 0) {
_local2._y = _local2._y - (_local2.yspeed * _local3);
_local2.yspeed = _local2.yspeed * -0.5;
var y = Math.floor(_local2._y / tileHeight);
_local2.bounces++;
if ((!((sbounce++) % 3)) && (sounds)) {
var r = random(4);
_root["smetal" + r].start(0, 0);
}
}
if (((((_local2.bounces >= 3) || (x < (worldpos[0] - 1))) || (x > ((worldpos[0] + stw) + 1))) || (y < (worldpos[1] - 1))) || (y > ((worldpos[1] + sth) + 1))) {
var _local1 = 0;
while (_local1 < entityArray.length) {
if (entityArray[_local1] == _local2) {
entityArray.splice(_local1, 1);
break;
}
_local1++;
}
rem = 1;
_local2.removeMovieClip();
}
}
function heliFrame(timeStep) {
var _local1 = this;
if (sounds) {
var vol = (distance(_local1._x, _local1._y, player._x + (player.width / 2), player._y) / 800);
vol = Math.min(vol, 1);
vol = Math.max(vol, 0);
sheli.setVolume(75 * (1 - vol));
}
if (_local1.health <= 0) {
var _local2 = 0;
while (_local2 < enemyArray.length) {
if (enemyArray[_local2] == _local1) {
enemyArray.splice(_local2, 1);
break;
}
_local2++;
}
rem = 1;
if (!gameover) {
if (player._y < _local1._y) {
var temp = world.attachMovie("popup", "popup_" + world.entityDepth, world.entityDepth++);
temp._x = Math.floor((player._x + (player.width / 2)) - (temp._width / 2));
temp._y = Math.floor(player._y - (temp._height * 2));
temp.action = popupFrame;
entityArray.push(temp);
temp.text = "Random Weapon";
var gun = (random(7) + 1);
var _local3 = 0;
if (gun == 1) {
_local3 = 10;
} else if (gun == 2) {
_local3 = 3;
} else if (gun == 3) {
_local3 = 2;
} else if (gun == 4) {
_local3 = 2;
} else if (gun == 5) {
_local3 = 2;
} else if (gun == 6) {
_local3 = 2;
} else if (gun == 7) {
_local3 = 1;
} else if (gun == 8) {
_local3 = 30;
} else if (gun == 9) {
_local3 = 1;
}
player.guns[gun].bullets = player.guns[gun].bullets + _local3;
}
helis++;
rthelis++;
if (helis == 3) {
var temp = world.attachMovie("powerup", "powerup_" + world.entityDepth, world.entityDepth++);
temp._x = _local1._x;
temp._y = _local1._y;
temp.chute._xscale = 0;
if (rthelis >= nextHealth) {
nextHealth = nextHealth * 2;
temp.power.gotoAndStop(1);
} else {
if ((random(100) % 32) == 0) {
temp.randomed = 1;
}
temp.power.gotoAndStop(random(temp.power._totalframes - 1) + 2);
}
temp.action = powerupFrame;
entityArray.push(temp);
helis = 0;
}
}
_local2 = 0;
while (_local2 < 3) {
var temp = world.attachMovie("Shard", "Shard_" + world.entityDepth, world.entityDepth++);
temp._x = _local1._x;
temp._y = _local1._y;
temp._rotation = random(360);
temp.xspeed = -10 + random(20);
temp.yspeed = -10 + random(20);
temp.gotoAndStop(random(temp._totalframes) + 1);
temp.action = shardFrame;
entityArray.push(temp);
_local2++;
}
var temp = world.attachMovie("GuyBurned", "GuyBurned_" + world.entityDepth, world.entityDepth++);
temp._x = _local1._x;
temp._y = _local1._y;
temp._rotation = _local1._rotation;
temp.action = guyFall;
temp.xspeed = -10 + random(20);
temp.yspeed = -10 + random(15);
entityArray.push(temp);
var temp = world.attachMovie("HeliDestroyed", "HeliDestroyed_" + world.entityDepth, world.entityDepth++);
temp._x = _local1._x;
temp._y = _local1._y;
temp._rotation = _local1._rotation;
temp.xspeed = _local1.xspeed;
temp.yseed = _local1.yspeed;
temp.action = heliFall;
temp.gotoAndStop(_local1._currentframe);
entityArray.push(temp);
var temp = world.attachMovie("boom", "boom_" + world.entityDepth, world.entityDepth++);
temp._x = _local1._x;
temp._y = _local1._y;
temp._xscale = (temp._yscale = 200);
temp.action = animationFrame;
entityArray.push(temp);
player.bullettime = Math.min(maxbullettime, player.bullettime + (maxbullettime / 3));
if (!gameover) {
addEnemy(300);
}
if (sounds) {
sheliboom.start(0, 0);
}
_local1.removeMovieClip();
} else {
if (_local1.lasthealth != _local1.health) {
var color0 = new Color(_local1);
color0.setTransform(whiteColor);
} else {
var color0 = new Color(_local1);
color0.setTransform(normalColor);
}
_local1.lasthealth = _local1.health;
var move = 0;
_local1.stepc = _local1.stepc + timestep;
if (_local1.stepc >= 1) {
move = 1;
_local1.stepc = _local1.stepc - 1;
}
if (_local1.onScreen <= 0) {
if (_local1.goto == undefined) {
_local1.goto = random(10);
}
if (_local1.goto < 4) {
_local1.tx = (worldpos[0] * tileWidth) - (spw * 2);
} else if (_local1.goto < 8) {
_local1.tx = (worldpos[0] * tileWidth) + (spw * 2);
} else {
_local1.ty = (worldpos[1] * tileHeight) - sph;
}
if (((_local1._y < ((worldpos[1] * tileHeight) - _local1._height)) || (_local1._x < ((worldpos[0] * tileWidth) - _local1._width))) || (_local1._x > (((worldpos[0] * tileWidth) + spw) + _local1._width))) {
var _local2 = 0;
while (_local2 < enemyArray.length) {
if (enemyArray[_local2] == _local1) {
enemyArray.splice(_local2, 1);
break;
}
_local2++;
}
addEnemy(_local1.health);
_local1.removeMovieClip("");
}
} else {
if (move) {
if (((_local1.xt++) % 75) == 1) {
_local1.xdif = (((-spw) / 2) + random(spw - (_local1._width / 2))) + (_local1._width / 2);
}
}
_local1.tx = player._x + _local1.xdif;
if (_local1.tx < (_local1._width / 2)) {
_local1.tx = _local1._width / 2;
}
if (_local1.tx > ((width * tileWidth) - (_local1.Width / 2))) {
_local1.tx = (width * tileWidth) - (_local1.Width / 2);
}
if (player.hjump) {
_local1.ty = Math.min(((height * tileHeight) - (sph / 2)) - 100, (player._y + 50) + random(50));
} else if (move) {
if (((_local1.yt++) % 40) == 1) {
_local1.ty = (player._y - (sph / 2)) - ((-2 + random(4)) * 10);
}
}
}
if ((((_local1.onScreen < 0) || (_local1._y < (worldpos[1] * tileHeight))) || (_local1._x < (worldpos[0] * tileWidth))) || (_local1._x > ((worldpos[0] * tileWidth) + spw))) {
var dx = (_local1.tx - _local1._x);
var dy = (_local1.ty - _local1._y);
_local1.xspeed = _local1.xspeed + (dx / 100);
_local1.yspeed = _local1.yspeed + (dy / 20);
} else {
var dx = (_local1.tx - _local1._x);
var dy = (_local1.ty - _local1._y);
_local1.xspeed = _local1.xspeed + (dx / 200);
_local1.yspeed = _local1.yspeed + (dy / 100);
}
if (move) {
var r = Math.floor((_local1.xspeed / 20) * 15);
if (Math.abs(r) > 2) {
_local1._rotation = r;
} else {
_local1._rotation = 0;
}
}
_local1._x = _local1._x + (_local1.xspeed * timeStep);
_local1._y = _local1._y + (_local1.yspeed * timeStep);
if (move) {
_local1.xspeed = _local1.xspeed * (0.9 * timeStep);
_local1.yspeed = _local1.yspeed * (0.9 * timeSetp);
}
_local1.gun.barrell.localToGlobal(point);
if (player.powerupon != 3) {
_local1.gunrotation = ((360 - ((Math.atan2(((_local1._x + _local1.gun._x) - player._x) - (player.width / 2), (_local1._y + _local1.gun._y) - player._y) * 180) / Math.PI)) - 90) - _local1._rotation;
} else {
_local1.gunrotation = ((360 - ((Math.atan2(((((_local1._x + _local1.gun._x) - player._x) - (player.width / 2)) - (spw / 2)) + random(spw), (_local1._y + _local1.gun._y) - player._y) * 180) / Math.PI)) - 90) - _local1._rotation;
}
var rotd = _local1.gunrotation;
var rotn = _local1.gun._rotation;
rotd = (rotd + 360) % 360;
rotn = (rotn + 360) % 360;
var dif = (rotd - rotn);
dif = ((dif > 179) ? (-360 + dif) : (dif));
dif = ((dif < -179) ? (360 + dif) : (dif));
_local1.gun._rotation = _local1.gun._rotation + ((dif / Math.max(1, 10 - level)) * timeStep);
if ((_local1.gun._rotation > 90) || (_local1.gun._rotation < -90)) {
_local1.gun._yscale = -100;
} else {
_local1.gun._yscale = 100;
}
if (move) {
if (((_local1.shoot++) % Math.max(10, 16 - level)) == 1) {
if (player.powerupon == 3) {
_local1.gun._rotation = _local1.gunrotation;
}
point = {x:0, y:0};
_local1.gun.barrell.localToGlobal(point);
addEnemyBullet(point.x - world._x, point.y - world._y, (_local1.gun._rotation - 5) + random(10), 7);
}
}
var y = Math.floor((_local1._y - (_local1._height / 2)) / tileHeight);
var x = Math.floor((_local1._x - (_local1._width / 2)) / tileWidth);
var y2 = Math.floor((_local1._y + (_local1._height / 2)) / tileHeight);
var x2 = Math.floor((_local1._x + (_local1._width / 2)) / tileWidth);
if ((((x2 < (worldpos[0] - 1)) || (x > ((worldpos[0] + stw) + 1))) || (y2 < (worldpos[1] - 1))) || (y > ((worldpos[1] + sth) + 1))) {
_local1._visible = 0;
} else {
if (move) {
_local1.onscreen--;
}
_local1._visible = 1;
}
}
}
function addEnemy(health) {
var _local1 = world.attachMovie("Heli", "Heli_" + world.entityDepth, world.entityDepth++);
if (random(3)) {
if (random(2)) {
_local1._x = (-world._x) - _local1._width;
} else {
_local1._x = ((-world._x) + spw) + _local1._width;
}
_local1._y = maxheight;
} else {
_local1._x = (-world._x) + (spw / 2);
_local1._y = (worldpos[1] * tileHeight) - (this._height / 2);
}
_local1.action = heliFrame;
_local1.health = health;
_local1.gotoAndStop(random(2) + 1);
_local1.onscreen = 150 + random(100);
_local1._visible = 0;
enemyArray.push(_local1);
}
function game(first) {
if (Key.isDown(soundKey)) {
if (soundK) {
sounds = (so.data.sounds = !sounds);
if (!sounds) {
SoundBoard.stopAll();
} else {
smusic.start(0, 9999999);
}
}
soundK = 0;
} else {
soundK = 1;
}
stepc = stepc + sendGameSpeed;
if (stepc > 1) {
stepc--;
sflame.setVolume(0);
}
var scroll = 0;
if ((Key.isDown(suicideKey) || (player.health <= 0)) || (gameover)) {
if (Key.isDown(suicideKey)) {
s = 1;
}
gameover++;
sheli.setVolume(0);
if (gameover == 1) {
mouseD = 0;
onKeyDown = null;
var color0 = new Color(world);
var color1 = new Color(bg);
var color2 = new Color(bglayer1);
var color3 = new Color(HUD);
color0.setTransform(normalColor);
color1.setTransform(normalColor);
color2.setTransform(normalColor);
color3.setTransform(normalColor);
var x = (player._x + (player.width / 2));
var y = (player._y + (player.height / 2));
var d = player.getDepth();
ttweapon = new Array();
var _local1 = 0;
while (_local1 < player.guns.length) {
ttweapon[_local1] = player.guns[_local1].shots;
_local1++;
}
player.removeMovieClip("");
player = world.attachMovie("guyBurned", "player", d);
player._x = x;
player._y = y;
player.action = heroDie;
player.xspeed = -10 + random(20);
player.yspeed = -random(10);
var temp = world.attachMovie("boom", "boom_" + world.entityDepth, world.entityDepth++);
temp._x = x;
temp._y = y;
temp._xscale = (temp._yscale = 800);
temp.stop();
temp.action = animationFrame;
entityArray.push(temp);
var dist = distance(this._x, this._y, player._x + (player.width / 2), player._y + player.height);
if (dist < 300) {
var ang = ((360 - ((Math.atan2((player._x + (player.width / 2)) - this._x, (player._y + player.height) - this._y) * 180) / Math.PI)) + 90);
var mult = (1 - (dist / 300));
player.xspeed = player.xspeed + int((mult * 24) * Math.cos((ang * Math.PI) / 180));
player.yspeed = player.yspeed + ((mult * 64) * Math.sin((ang * Math.PI) / 180));
player.hjump = 1;
}
if (sounds) {
sbigboom.start(0, 0);
}
_local1 = 0;
while (_local1 < enemyArray.length) {
enemyArray[_local1].health = enemyArray[_local1].health - Number.POSITIVE_INFINITY;
_local1++;
}
}
if ((gameover > 200) || ((enemyArray.length == 0) && (entityArray.length == 0))) {
onEnterFrame = null;
var temp = attachMovie("stats", "stats", 32);
temp._x = 81;
temp._y = 80;
temp.score = Math.floor(score) * 100;
temp.time = Math.floor(time / 30) + " seconds";
temp.shots = shots;
temp.hits = hits;
if (shots > 0) {
temp.accuracy = Math.floor((hits / shots) * 100) + "%";
} else {
temp.accuracy = "0%";
}
var _local3 = 0;
var _local2 = Number.NEGATIVE_INFINITY;
var _local1 = 1;
while (_local1 < ttweapon.length) {
if (ttweapon[_local1] > _local2) {
_local2 = ttweapon[_local1];
_local3 = _local1;
}
_local1++;
}
if (_local2 <= 0) {
_local3 = 0;
}
if (tweapon[_local3] != 0) {
temp.weapon = guns[_local3].name;
} else {
temp.weapon = "None";
}
temp.helis = rthelis;
games = (so.data.games = so.data.games + 1);
ts = (so.data.totalscore = so.data.totalscore + score);
tshots = (so.data.totalshots = so.data.totalshots + shots);
thits = (so.data.totalhits = so.data.totalhits + hits);
ttime = (so.data.totaltime = so.data.totaltime + time);
thelis = (so.data.totalhelis = so.data.totalhelis + rthelis);
thjumps = (so.data.totalhjumps = so.data.totalhjumps + hjumps);
tbtime = (so.data.totalbtime = so.data.totalbtime + btime);
so.data.highscore = hs;
if (time > besttime) {
besttime = (so.data.besttime = time);
}
if ((time < worsttime) && (!s)) {
worsttime = (so.data.worsttime = time);
}
if (rthelis > bhelis) {
bhelis = (so.data.besthelis = rthelis);
}
_local1 = 0;
while (_local1 < ttweapon.length) {
so.data.tweapon[_local1] = so.data.tweapon[_local1] + ttweapon[_local1];
_local1++;
}
so.flush();
sendscore = Math.floor(score) * 100;
temp.doRelease = function () {
this.removeMovieClip("");
endGame();
gotoAndStop ("menu");
};
temp.submit.onRelease = function () {
this._parent.removeMovieClip("");
endGame();
gotoAndStop ("highscoresend");
};
temp.submit.hitArea = temp.submit.hitState;
temp.submit.hitState._visible = 0;
onKeyDown = null;
onEnterFrame = null;
return;
}
} else {
if (((((player.bullettime > 0) && (Key.isDown(bulletTimeKey))) && (gamestarted)) || (gameover)) || (player.powerupOn == 4)) {
sendGameSpeed = Math.max(0.2, sendGameSpeed - 0.1);
if (player.powerupOn != 4) {
player.bullettime--;
}
if (!gameover) {
btime++;
}
} else {
sendGameSpeed = Math.min(gameSpeed, sendGameSpeed + 0.1);
}
HUD.bullettime.mask._xscale = (player.bullettime / maxbullettime) * 100;
var _local1 = 0;
while (_local1 < entityArray.length) {
entityArray[_local1].action(sendGameSpeed);
if (rem) {
rem = 0;
_local1--;
}
_local1++;
}
_local1 = 0;
while (_local1 < enemyArray.length) {
enemyArray[_local1].action(sendGameSpeed);
if (rem) {
rem = 0;
_local1--;
}
_local1++;
}
sx = world._x;
sy = world._y;
if (player.action(sendGameSpeed) || (first)) {
scrollMap(world, map, worldpos, worldbounds, 1, 1, 1);
sdx = sx - world._x;
sdy = sy - world._y;
bglayer1._x = bglayer1._x - (sdx / 2);
if (bglayer1._x < ((-bglayer1width) / 2)) {
bglayer1._x = (0 + bglayer1._x) + (bglayer1width / 2);
}
if (bglayer1._x > 0) {
bglayer1._x = ((-bglayer1width) / 2) + bglayer1._x;
}
var yhpos = ((-world._y) / maxheight);
bglayer1._y = (-(bglayer1height - sh)) + Math.max(0, ((1 - yhpos) / 2) * (bglayer1height - sph));
scrollMap(bglayer1, bglayer1map, bglayer1pos, bglayer1bounds, 1, 1, 0);
}
if ((!gameover) && (gamestarted)) {
time = time + (1 * sendGameSpeed);
}
if (Math.floor(score) > hs) {
hs = Math.floor(score);
if (hssent != 0) {
hssent = (so.data.highscoresent = 0);
}
}
HUD.highscore = "High Score: " + (hs * 100);
HUD.score = "Score: " + (Math.floor(score) * 100);
HUD.health.mask._yscale = (player.health / 100) * 100;
HUD.time = (("Time: " + Math.floor(time / 30)) + " seconds Helis: ") + rthelis;
if (score > nextLevel) {
nextLevel = nextLevel * 2;
level++;
var temp = world.attachMovie("popup", "popup_" + world.entityDepth, world.entityDepth++);
temp._x = Math.floor((player._x + (player.width / 2)) - (temp._width / 2));
temp._y = Math.floor(player._y - (temp._height * 2));
temp.action = popupFrame;
temp.text = "Level Up";
entityArray.push(temp);
}
}
}
function startGame() {
s = 0;
level = 0;
world = drawMap(map1, "world", 1, "tiles", 1);
worldpos = new Array(0, 0);
worldbounds = new Array(0, 0);
bglayer1map = bglayer1_1;
bglayer1 = drawMap(bglayer1map, "bglayer1", 0, "bg", 0);
bglayer1pos = new Array(0, 0);
bglayer1bounds = new Array(0, 0);
bglayer1width = bglayer1map[0].length * tileWidth;
bglayer1height = bglayer1map.length * tileHeight;
HUD = attachMovie("HUD", "HUD", 2);
HUD.weapon.gotoAndStop(1);
maxheight = (height * tileHeight) - sh;
entityArray = new Array();
enemyArray = new Array();
gameSpeed = 1;
sendGameSpeed = gameSpeed;
rem = 0;
score = 0;
gameover = 0;
time = 0;
shots = 0;
hits = 0;
hjumps = 0;
btime = 0;
helis = 0;
rthelis = 0;
nextHealth = 15;
nextLevel = 10000;
powerupTime = 500;
gamestarted = 0;
Key.addListener(this);
onKeyDown = function () {
if (Key.isDown(pauseKey)) {
if (onEnterFrame == null) {
onEnterFrame = game;
} else {
onEnterFrame = null;
}
}
};
mouseD = 0;
onMouseDown = function () {
mouseD = 1;
};
onMouseUp = function () {
mouseD = 0;
};
game(1);
onEnterFrame = game;
sflame.start(0, 9999999);
sflame.setVolume(0);
sheli.start(0, 9999999);
sheli.setVolume(0);
smusic.setVolume(50);
if (sounds) {
sbigboom.start(0, 0);
}
}
function endGame() {
SoundBoard.stopAll();
if (sounds) {
smusic.start(0, 9999999);
}
world.removeMovieClip("");
bglayer1.removeMovieClip("");
HUD.removeMovieClip("");
onMouseDown = (onMouseUp = (onEnterFrame = null));
onEnterFrame = null;
onKeyDown = null;
}
hitCheck = function (mapa, cy, cx, cy2, cx2, type, equal, hold) {
var _local3 = mapa;
if (type == undefined) {
var type = 1;
}
if (equal == undefined) {
var equal = 0;
}
if (hold == undefined) {
var hold = 0;
}
var count = 0;
var _local2 = cy;
while (_local2 <= cy2) {
var _local1 = cx;
while (_local1 <= cx2) {
if ((_local3[_local2][_local1][0] >= 0) && (_local3[_local2][_local1][0] < 100)) {
if (equal) {
if (_local3[_local2][_local1][0] == type) {
count++;
if (!hold) {
return(1);
}
}
} else if (_local3[_local2][_local1][0] != type) {
count++;
if (!hold) {
return(1);
}
}
}
_local1++;
}
_local2++;
}
return(count);
};
map1 = [[[0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0]], [[0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0]], [[0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0]], [[0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0]], [[0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0]], [[0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0]], [[0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0]], [[0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0]], [[0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0]], [[0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0]], [[0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0]], [[0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [1, 3]], [[0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [1, 3], [1, 1], [1, 4], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [1, 3], [1, 1], [1, 8], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [1, 3], [1, 5]], [[32, 0], [0, 0], [0, 0], [0, 0], [0, 0], [1, 3], [1, 1], [1, 4], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [1, 3], [1, 5], [1, 2], [1, 6], [1, 4], [0, 0], [0, 0], [0, 0], [1, 3], [1, 5], [1, 10], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [1, 3], [1, 5], [1, 2]], [[1, 1], [1, 1], [1, 1], [1, 1], [1, 1], [1, 5], [1, 2], [1, 6], [1, 1], [1, 1], [1, 1], [1, 1], [1, 1], [1, 1], [1, 1], [1, 5], [1, 2], [1, 2], [1, 2], [1, 6], [1, 1], [1, 1], [1, 1], [1, 5], [1, 2], [1, 6], [1, 1], [1, 1], [1, 1], [1, 1], [1, 1], [1, 1], [1, 5], [1, 2], [1, 2]]];
bglayer1_1 = [[[0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0]], [[0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0]], [[0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0]], [[0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0]], [[0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0]], [[0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0]], [[0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0]], [[0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0]], [[0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0]], [[0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0]], [[0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0]], [[0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0]], [[0, 1], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 1], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0]], [[0, 2], [0, 0], [0, 0], [0, 1], [0, 1], [0, 0], [0, 0], [0, 0], [0, 0], [0, 1], [0, 2], [0, 0], [0, 0], [0, 1], [0, 1], [0, 0], [0, 0], [0, 0], [0, 0], [0, 1]], [[0, 2], [0, 1], [0, 1], [0, 2], [0, 2], [0, 1], [0, 0], [0, 0], [0, 1], [0, 2], [0, 2], [0, 1], [0, 1], [0, 2], [0, 2], [0, 1], [0, 0], [0, 0], [0, 1], [0, 2]]];
sw = 450;
sh = 320;
tileWidth = (tileHeight = 50);
stw = Math.ceil(sw / tileWidth);
sth = Math.ceil(sh / tileHeight);
spw = stw * tileWidth;
sph = sth * tileHeight;
guns = new Array();
guns[0] = {name:"MachineGun", gun:machineGun, reloadtime:5, speed:8, damage:10, sound:sgun};
guns[1] = {name:"AkimboMac10's", gun:uzi, reloadtime:4, speed:8, damage:9, sound:sgun};
guns[2] = {name:"Shotgun", gun:shotgun, reloadtime:25, speed:8, damage:15, sound:sshotgun};
guns[3] = {name:"ShotgunRockets", gun:shotgunRocket, reloadtime:40, speed:7, damage:40, sound:srocket};
guns[4] = {name:"GrenadeLauncher", gun:grenadeLauncher, reloadtime:30, speed:15, damage:75, sound:sgrenade};
guns[5] = {name:"RPG", gun:rpg, reloadtime:40, speed:4, damage:75, sound:sgrenade};
guns[6] = {name:"RocketLauncher", gun:rocketLauncher, reloadtime:50, speed:7, damage:100, sound:srocket};
guns[7] = {name:"SeekerLauncher", gun:seekerLauncher, reloadtime:55, speed:7, damage:100, sound:srocket};
guns[8] = {name:"FlameThrower", gun:flameThrower, reloadtime:1, speed:8, damage:2, sound:sflame, soundhold:1};
guns[9] = {name:"FireMines", gun:fireMines, reloadtime:100, speed:3, damage:5, sound:null};
guns[10] = {name:"A-BombLauncher", gun:aBombLauncher, reloadtime:150, speed:3, damage:300, sound:srocket};
guns[11] = {name:"RailGun", gun:railGun, reloadtime:75, speed:20, damage:150, sound:srailgun};
guns[12] = {name:"GrappleCannon", gun:grapple, reloadtime:250, speed:20, damage:300, sound:sgrapple};
guns[13] = {name:"ShoulderCannon", gun:shoulderCannon, reloadtime:100, speed:20, damage:300, sound:srailgun};
maxbullettime = 250;
whiteColor = {ra:"100", rb:"25", ga:"100", gb:"25", ba:"100", bb:"25", aa:"100", ab:"0"};
normalColor = {ra:"100", rb:"0", ga:"100", gb:"0", ba:"100", bb:"0", aa:"100", ab:"0"};
hitColor = {ra:"100", rb:"150", ga:"100", gb:"0", ba:"100", bb:"0", aa:"100", ab:"0"};
doubleDamageColor = {ra:"50", rb:"0", ga:"50", gb:"0", ba:"255", bb:"0", aa:"100", ab:"0"};
invunerableColor = {ra:"100", rb:"0", ga:"0", gb:"0", ba:"0", bb:"0", aa:"100", ab:"0"};
warpColor = {ra:"0", rb:"0", ga:"100", gb:"0", ba:"0", bb:"0", aa:"100", ab:"0"};
invColor = {ra:"-100", rb:"255", ga:"-100", gb:"255", ba:"-100", bb:"255", aa:"100", ab:"0"};
highscore = "High Score: " + (hs * 100);
_quality = "low";
so = SharedObject.getlocal("heliattack");
if (so.data.highscore != undefined) {
sounds = so.data.sounds;
counter = so.data.counter++;
games = so.data.games;
ts = so.data.totalscore;
hs = so.data.highscore;
hssent = so.data.highscoresent;
name = so.data.name;
tshots = so.data.totalshots;
thits = so.data.totalhits;
ttime = so.data.totaltime;
besttime = so.data.besttime;
worsttime = so.data.worsttime;
thelis = so.data.totalhelis;
bhelis = so.data.besthelis;
thjumps = so.data.totalhjumps;
tbtime = so.data.totalbtime;
jumpkey = so.data.jumpKey;
leftkey = so.data.leftKey;
rightkey = so.data.rightKey;
duckkey = so.data.duckKey;
boostKey = so.data.boostKey;
bulletTimeKey = so.data.bulletTimeKey;
switchKey = so.data.switchKey;
pauseKey = so.data.pauseKey;
suicideKey = so.data.suicideKey;
soundKey = so.data.soundKey;
} else {
sounds = (so.data.sounds = 1);
counter = (so.data.counter = 1);
games = (so.data.games = 0);
hs = (so.data.highscore = 0);
ts = (so.data.totalscore = 0);
hssent = (so.data.highscoresent = 0);
name = (so.data.name = "");
tshots = (so.data.totalshots = 0);
thits = (so.data.totalhits = 0);
ttime = (so.data.totaltime = 0);
thelis = (so.data.totalhelis = 0);
bhelis = (so.data.besthelis = 0);
so.data.tweapon = new Array();
besttime = (so.data.besttime = 0);
worsttime = (so.data.worsttime = Number.POSITIVE_INFINITY);
thjumps = (so.data.totalhjumps = 0);
tbtime = (so.data.totalbtime = 0);
jumpkey = (so.data.jumpKey = 38);
leftkey = (so.data.leftKey = 37);
rightkey = (so.data.rightKey = 39);
duckkey = (so.data.duckKey = 40);
boostKey = (so.data.boostKey = 17);
bulletTimeKey = (so.data.bulletTimeKey = 16);
switchKey = (so.data.switchKey = 35);
pauseKey = (so.data.pauseKey = 80);
suicideKey = (so.data.suicideKey = 75);
soundKey = (so.data.soundKey = 83);
}
if (sounds) {
smusic.start(0, 9999999);
}
Frame 20
_quality = "low";
stop();
smusic.setVolume(100);
Frame 21
jumpkeym.gotoAndStop(jumpKey);
leftkeym.gotoAndStop(leftKey);
rightkeym.gotoAndStop(rightKey);
duckkeym.gotoAndStop(duckKey);
boostkeym.gotoAndStop(boostKey);
bullettimekeym.gotoAndStop(bullettimeKey);
switchkeym.gotoAndStop(switchKey);
pauseKeyM.gotoAndStop(pauseKey);
suicideKeyM.gotoAndStop(suicideKey);
soundKeyM.gotoAndStop(soundKey);
if (sounds) {
sdisplay = "On";
} else {
sdisplay = "Off";
}
Frame 23
_quality = "high";
_quality = "high";
Instance of Symbol 791 MovieClip in Frame 23
//component parameters
onClipEvent (initialize) {
scoreLocation = "_root.sendscore";
gamename = "heli";
saveScore = false;
scoreIsTime = false;
scoreReversed = false;
}
Frame 24
_quality = "high";
Instance of Symbol 791 MovieClip in Frame 24
//component parameters
onClipEvent (initialize) {
scoreLocation = "_root.sendscore";
gamename = "heli";
saveScore = true;
scoreIsTime = false;
scoreReversed = false;
}
Frame 27
gotoAndStop ("gamescreen");
Frame 29
gotoAndStop ("gamescreen");
Symbol 15 MovieClip Frame 99
_parent.play();
stop();
Symbol 34 MovieClip [Boom] Frame 1
stop();
Symbol 44 MovieClip Frame 1
stop();
Symbol 65 MovieClip [Bullet] Frame 1
stop();
Symbol 68 MovieClip [enemyBullet] Frame 1
stop();
Symbol 69 MovieClip [flame] Frame 1
stop();
Symbol 107 MovieClip Frame 1
stop();
Symbol 107 MovieClip Frame 2
stop();
Symbol 111 MovieClip [Heli] Frame 1
stop();
hit._visible = 0;
Symbol 111 MovieClip [Heli] Frame 2
hit._visible = 0;
Symbol 115 MovieClip [HeliDestroyed] Frame 1
hit._visible = 0;
Symbol 136 MovieClip Frame 1
hit._visible = 0;
stop();
Symbol 136 MovieClip Frame 2
hit._visible = 0;
Symbol 136 MovieClip Frame 3
hit._visible = 0;
Symbol 136 MovieClip Frame 4
hit._visible = 0;
Symbol 136 MovieClip Frame 5
hit._visible = 0;
Symbol 136 MovieClip Frame 6
hit._visible = 0;
chute._xscale = 0;
Symbol 215 MovieClip [HUD] Frame 1
stop();
powerup._visible = 0;
Symbol 224 MovieClip [Powerup] Frame 1
hit._visible = 0;
Symbol 241 MovieClip [smoke] Frame 1
stop();
Symbol 260 Button
on (release) {
dorelease();
}
Symbol 303 MovieClip [stats] Frame 1
stop();
Symbol 328 Button
on (release) {
if ((names != "Loading...") && (this.startnum > 0)) {
_parent.listScores(_parent.thisgamename, Math.max(0, startnum - 10));
}
}
Symbol 329 Button
on (release) {
if ((names != "Loading...") && (!end)) {
_parent.listScores(_parent.thisgamename, startnum + 10);
}
}
Symbol 333 MovieClip [highScores] Frame 1
hitState._visible = 0;
Symbol 341 Button
on (release) {
doRelease();
}
Symbol 342 Button
on (release) {
_parent.gotoAndStop("menu");
this.removeMovieClip("");
}
Symbol 383 MovieClip Frame 1
stop();
Symbol 409 MovieClip Frame 54
stop();
_parent.play();
Symbol 413 Button
on (release) {
nextFrame();
}
Symbol 414 Button
on (release) {
var temp = attachMovie("stats", "stats", 32);
temp.gotoAndStop(2);
temp._x = 65;
temp._y = 24;
temp.highscore = Math.floor(hs) * 100;
temp.counter = counter;
temp.games = games;
temp.score = Math.floor(ts) * 100;
temp.time = Math.floor(ttime / 30) + " seconds";
temp.bhelis = bhelis;
if (besttime == 0) {
temp.besttime = "None";
} else {
temp.besttime = Math.floor(besttime / 30) + " seconds";
}
if (worsttime == Number.POSITIVE_INFINITY) {
temp.worsttime = "None";
} else {
temp.worsttime = Math.floor(worsttime / 30) + " seconds";
}
temp.shots = tshots;
temp.hits = thits;
if (tshots > 0) {
temp.accuracy = Math.floor((thits / tshots) * 100) + "%";
} else {
temp.accuracy = "0%";
}
var maxi = 0;
var maxs = Number.NEGATIVE_INFINITY;
var i = 1;
while (i < so.data.tweapon.length) {
if (so.data.tweapon[i] > maxs) {
maxs = so.data.tweapon[i];
maxi = i;
}
i++;
}
if (maxs <= 0) {
maxi = 0;
}
if ((so.data.tweapon[maxi] != 0) && (so.data.tweapon[maxi] != undefined)) {
temp.weapon = guns[maxi].name;
} else {
temp.weapon = "None";
}
temp.helis = thelis;
temp.hjumps = thjumps;
temp.btime = Math.floor(tbtime / 30) + " seconds";
temp.label = "Click for main menu";
temp.onRelease = function () {
this.removeMovieClip("");
gotoAndStop ("menu");
};
gotoAndStop(_currentframe + 2);
}
Symbol 415 Button
on (release) {
gotoAndStop ("highscores");
}
Symbol 416 Button
on (release) {
gotoAndStop ("gamescreen");
startGame();
}
Symbol 418 Button
on (release) {
gotoAndStop ("help");
}
Symbol 421 Button
on (release) {
getURL ("http://www.miniclip.com", "_blank");
}
Symbol 429 Button
on (release) {
getURL ("http://www.squarecircleco.com", "_blank");
}
Symbol 430 Button
on (release) {
sounds = (so.data.sounds = !sounds);
if (sounds) {
sdisplay = "On";
smusic.start(0, 9999999);
} else {
sdisplay = "Off";
SoundBoard.stopAll();
}
}
Symbol 431 Button
on (release) {
rightKeyM.gotoAndStop(200);
Key.addListener(this);
onKeyDown = function () {
rightKey = Key.getCode();
so.data.rightKey = rightKey;
rightKeyM.gotoAndStop(rightKey);
onKeyDown = null;
};
}
Symbol 432 Button
on (release) {
jumpKeyM.gotoAndStop(200);
Key.addListener(this);
onKeyDown = function () {
jumpKey = Key.getCode();
so.data.jumpKey = jumpKey;
jumpKeyM.gotoAndStop(jumpKey);
onKeyDown = null;
};
}
Symbol 433 Button
on (release) {
duckKeyM.gotoAndStop(200);
Key.addListener(this);
onKeyDown = function () {
duckKey = Key.getCode();
so.data.duckKey = duckKey;
duckKeyM.gotoAndStop(duckKey);
onKeyDown = null;
};
}
Symbol 434 Button
on (release) {
switchKeyM.gotoAndStop(200);
Key.addListener(this);
onKeyDown = function () {
switchKey = Key.getCode();
so.data.switchKey = switchKey;
switchKeyM.gotoAndStop(switchKey);
onKeyDown = null;
};
}
Symbol 435 Button
on (release) {
boostKeyM.gotoAndStop(200);
Key.addListener(this);
onKeyDown = function () {
boostKey = Key.getCode();
so.data.boostKey = boostKey;
boostKeyM.gotoAndStop(boostKey);
onKeyDown = null;
};
}
Symbol 436 Button
on (release) {
bullettimeKeyM.gotoAndStop(200);
Key.addListener(this);
onKeyDown = function () {
bullettimeKey = Key.getCode();
so.data.bullettimeKey = bullettimeKey;
bullettimeKeyM.gotoAndStop(bullettimeKey);
onKeyDown = null;
};
}
Symbol 437 Button
on (release) {
pauseKeyM.gotoAndStop(200);
Key.addListener(this);
onKeyDown = function () {
pauseKey = Key.getCode();
so.data.pauseKey = pauseKey;
pauseKeyM.gotoAndStop(pauseKey);
onKeyDown = null;
};
}
Symbol 438 Button
on (release) {
gotoAndStop ("menu");
}
Symbol 445 Button
on (release) {
leftKeyM.gotoAndStop(200);
Key.addListener(this);
onKeyDown = function () {
leftKey = Key.getCode();
so.data.leftKey = leftKey;
leftKeyM.gotoAndStop(leftKey);
onKeyDown = null;
};
}
Symbol 631 Button
on (release) {
suicideKeyM.gotoAndStop(200);
Key.addListener(this);
onKeyDown = function () {
suicideKey = Key.getCode();
so.data.suicideKey = suicideKey;
suicideKeyM.gotoAndStop(suicideKey);
onKeyDown = null;
};
}
Symbol 632 Button
on (release) {
soundKeyM.gotoAndStop(200);
Key.addListener(this);
onKeyDown = function () {
soundKey = Key.getCode();
so.data.soundKey = soundKey;
soundKeyM.gotoAndStop(soundKey);
onKeyDown = null;
};
}
Symbol 635 Button
on (release) {
counter = (so.data.counter = 1);
games = (so.data.games = 0);
hs = (so.data.highscore = 0);
ts = (so.data.totalscore = 0);
hssent = (so.data.highscoresent = 0);
tshots = (so.data.totalshots = 0);
thits = (so.data.totalhits = 0);
ttime = (so.data.totaltime = 0);
thelis = (so.data.totalhelis = 0);
bhelis = (so.data.besthelis = 0);
so.data.tweapon = new Array();
besttime = (so.data.besttime = 0);
worsttime = (so.data.worsttime = Number.POSITIVE_INFINITY);
thjumps = (so.data.totalhjumps = 0);
tbtime = (so.data.totalbtime = 0);
var temp = attachMovie("stats", "stats", 32);
temp.gotoAndStop(2);
temp._x = 65;
temp._y = 24;
temp.highscore = Math.floor(hs) * 100;
temp.counter = counter;
temp.games = games;
temp.score = Math.floor(ts) * 100;
temp.time = Math.floor(ttime / 30) + " seconds";
temp.bhelis = bhelis;
if (besttime == 0) {
temp.besttime = "None";
} else {
temp.besttime = Math.floor(besttime / 30) + " seconds";
}
if (worsttime == Number.POSITIVE_INFINITY) {
temp.worsttime = "None";
} else {
temp.worsttime = Math.floor(worsttime / 30) + " seconds";
}
temp.shots = tshots;
temp.hits = thits;
if (tshots > 0) {
temp.accuracy = Math.floor((thits / tshots) * 100) + "%";
} else {
temp.accuracy = "0%";
}
var maxi = 0;
var maxs = Number.NEGATIVE_INFINITY;
var i = 1;
while (i < so.data.tweapon.length) {
if (so.data.tweapon[i] > maxs) {
maxs = so.data.tweapon[i];
maxi = i;
}
i++;
}
if (maxs <= 0) {
maxi = 0;
}
if ((so.data.tweapon[maxi] != 0) && (so.data.tweapon[maxi] != undefined)) {
temp.weapon = guns[maxi].name;
} else {
temp.weapon = "None";
}
temp.helis = thelis;
temp.hjumps = thjumps;
temp.btime = Math.floor(tbtime / 30) + " seconds";
temp.label = "Click for main menu";
temp.onRelease = function () {
this.removeMovieClip("");
gotoAndStop ("menu");
};
}
Symbol 644 MovieClip Frame 2
stop();
Symbol 658 Button
on (release) {
sendHighScore();
}
Symbol 674 MovieClip Frame 18
txtUsername = _parent.mcHighScoreData.notSentUsername;
myDate = new Date();
stop();
Symbol 681 Button
on (release) {
gotoAndPlay ("weekly");
}
Symbol 684 Button
on (release) {
gotoAndPlay ("monthly");
}
Symbol 720 MovieClip Frame 11
stop();
Instance of Symbol 720 MovieClip in Symbol 721 MovieClip Frame 1
onClipEvent (load) {
stop();
}
Instance of Symbol 720 MovieClip in Symbol 721 MovieClip Frame 1
onClipEvent (load) {
stop();
}
Instance of Symbol 720 MovieClip in Symbol 721 MovieClip Frame 1
onClipEvent (load) {
stop();
}
Instance of Symbol 720 MovieClip in Symbol 721 MovieClip Frame 1
onClipEvent (load) {
stop();
}
Instance of Symbol 720 MovieClip in Symbol 721 MovieClip Frame 1
onClipEvent (load) {
stop();
}
Instance of Symbol 720 MovieClip in Symbol 721 MovieClip Frame 1
onClipEvent (load) {
stop();
}
Instance of Symbol 720 MovieClip in Symbol 721 MovieClip Frame 1
onClipEvent (load) {
stop();
}
Instance of Symbol 720 MovieClip in Symbol 721 MovieClip Frame 1
onClipEvent (load) {
stop();
}
Instance of Symbol 720 MovieClip in Symbol 721 MovieClip Frame 1
onClipEvent (load) {
stop();
}
Symbol 721 MovieClip Frame 10
stop();
Symbol 727 Button
on (release) {
gotoAndStop ("daily");
}
Symbol 791 MovieClip Frame 1
function convertScoreToTime(scoreToBeConverted) {
if (scoreIsTime) {
if (!scoreReversed) {
var _local2 = 1000000 - scoreToBeConverted;
} else {
var _local2 = scoreToBeConverted;
}
var _local1 = new String(_local2);
if (_local2 > 99999) {
var _local3 = (((_local1.substring(0, 2) + ":") + _local1.substring(2, 4)) + ":") + _local1.substring(4, 6);
} else if (_local2 > 9999) {
var _local3 = (((("0" + _local1.substring(0, 1)) + ":") + _local1.substring(1, 3)) + ":") + _local1.substring(3, 5);
} else if (_local2 > 999) {
var _local3 = (("00:" + _local1.substring(0, 2)) + ":") + _local1.substring(2, 5);
} else if (_local2 > 99) {
var _local3 = (("00:0" + _local1.substring(0, 1)) + ":") + _local1.substring(1, 3);
} else if (_local2 > 9) {
var _local3 = "00:00:" + _local1.substring(0, 2);
} else {
var _local3 = "00:00:0" + _local1.substring(0, 1);
}
var _local2 = _local3;
if ((_local2 != "10:00:00") && (_local2 != "00:00:0")) {
return(_local2);
}
} else {
var _local2 = 1000000000 - scoreToBeConverted;
if (_local2 != 1000000000) {
return(_local2);
}
}
return(undefined);
}
function getHighScores(period, target) {
var _local1 = target;
_local1.records = 0;
if (saveScore) {
_local1.score = localScore;
_local1.username = txtUsername;
_local1.notSentScore = localScore;
_local1.notSentUsername = txtUsername;
}
_local1.gamename = gamename;
_local1.low = 0;
_local1.high = 10;
_local1.formaction = "gethighscores";
_local1.dwm = period;
var _local2 = getTimer() + random(100);
_local1.loadVariables("http://www.miniclip.com/Flash/proxy.php?preventCashing=" + _local2, "GET");
play();
}
function sendHighScore() {
if ((txtUsername != "") && (txtUsername != undefined)) {
getHighScores(2, mcHighScoreData);
}
}
this.username = "";
this.score = 0;
gameName = gamename;
position_d = 0;
position_w = 0;
position_m = 0;
mcHighScoreData.records = 0;
dailyLoaded = false;
weeklyLoaded = false;
monthlyLoaded = false;
dailyTabClicked = false;
weeklyTabClicked = false;
monthlyTabClicked = false;
timeOutVal = 15000;
completed = "false";
localScore = int(eval (scoreLocation));
if (localScore > 0) {
if (scoreIsTime) {
if (!scoreReversed) {
localScore = 1000000 - localScore;
}
} else if (scoreReversed) {
localScore = 1000000000 - localScore;
}
} else {
localScore = 0;
}
this._x = int(this._x);
this._y = int(this._y);
if (gameName == undefined) {
trace("MINICLIP.COM HIGHSCORE COMPONENT WARNING");
trace("========================================");
trace("The 'gameName' parameter has not been set. This parameter");
trace("needs to be set for the highscore component to function.");
}
if ((eval (scoreLocation) == undefined) && (saveScore)) {
trace("MINICLIP.COM HIGHSCORE COMPONENT WARNING");
trace("========================================");
trace("The 'scoreLocation' parameter does not contain any data.");
trace("This parameter needs to be pointing to the game score variable");
trace("set for the highscore component to function.");
localScore = 0;
}
if (saveScore && (eval (scoreLocation) > 0)) {
gotoAndPlay ("save");
} else {
getHighScores(2, mcHighScoreData);
gotoAndPlay ("load");
}
Symbol 791 MovieClip Frame 9
Selection.setFocus("txtUsername");
stop();
Instance of Symbol 654 MovieClip in Symbol 791 MovieClip Frame 9
onClipEvent (keyDown) {
if (Key.isDown(13)) {
_parent.sendHighScore();
}
}
Symbol 791 MovieClip Frame 15
mcHighScoreData.username = "";
everyNSeconds = getTimer() + 2000;
timeOut = getTimer() + timeOutVal;
Symbol 791 MovieClip Frame 17
if (getTimer() > timeOut) {
timeOut = getTimer() + timeOutVal;
completed = false;
gotoAndPlay ("failedLoading");
} else if (mcHighScoreData.records > 0) {
mcHighScoreData.positionDaily = mcHighScoreData.position;
if (scoreIsTime) {
mcHighScoreData.notSentScore = convertScoreToTime(localScore);
}
var i = 0;
while (i < mcHighScoreData.high) {
mcHighScoreData["userNameDaily" + i] = mcHighScoreData["user_name" + i];
mcHighScoreData["scoreDaily" + i] = mcHighScoreData["score" + i];
mcHighScoreData["dateDaily" + i] = mcHighScoreData["date" + i];
i++;
}
gotoAndPlay ("completed");
} else {
if (getTimer() > everyNSeconds) {
getHighScores(2, mcHighScoreData);
everyNSeconds = getTimer() + 2000;
trace("try");
}
gotoAndPlay(_currentframe - 1);
}
Symbol 791 MovieClip Frame 28
stop();
Instance of Symbol 674 MovieClip "mcYourScore" in Symbol 791 MovieClip Frame 34
onClipEvent (load) {
trace(_parent.saveScore);
if ((_parent.localScore <= 0) or (!_parent.saveScore)) {
this._visible = false;
}
}
Symbol 791 MovieClip Frame 41
saveScore = false;
if (!dailyTabClicked) {
mcYourScore.position = position;
dailyTabClicked = true;
var i = 0;
while (i < mcHighScoreData.high) {
if (scoreIsTime or scoreReversed) {
mcHighScoreData["scoreDaily" + i] = convertScoreToTime(mcHighScoreData["scoreDaily" + i]);
}
i++;
}
}
var i = 0;
while (i < mcHighScoreData.high) {
this["txtUserName" + i] = mcHighScoreData["userNameDaily" + i];
this["txtScore" + i] = mcHighScoreData["scoreDaily" + i];
this["txtDate" + i] = mcHighScoreData["dateDaily" + i];
i++;
}
mcYourScore.position = mcHighScoreData.positionDaily;
stop();
Symbol 791 MovieClip Frame 48
if ((!weeklyTabClicked) or (!weeklyLoaded)) {
getHighScores(1, mcHighScoreData);
weeklyTabClicked = true;
} else if (weeklyLoaded) {
gotoAndPlay ("weeklyLoaded");
}
Symbol 791 MovieClip Frame 55
if (mcHighScoreData.records > 0) {
mcHighScoreData.positionWeekly = mcHighScoreData.position;
weeklyLoaded = true;
var i = 0;
while (i < mcHighScoreData.high) {
mcHighScoreData["userNameWeekly" + i] = mcHighScoreData["user_name" + i];
mcHighScoreData["scoreWeekly" + i] = mcHighScoreData["score" + i];
mcHighScoreData["dateWeekly" + i] = mcHighScoreData["date" + i];
if (scoreIsTime or scoreReversed) {
mcHighScoreData["scoreWeekly" + i] = convertScoreToTime(mcHighScoreData["scoreWeekly" + i]);
}
i++;
}
gotoAndPlay ("weeklyLoaded");
} else {
gotoAndPlay(_currentframe - 1);
}
Symbol 791 MovieClip Frame 56
var i = 0;
while (i < mcHighScoreData.high) {
this["txtUserName" + i] = mcHighScoreData["userNameWeekly" + i];
this["txtScore" + i] = mcHighScoreData["scoreWeekly" + i];
this["txtDate" + i] = mcHighScoreData["dateWeekly" + i];
i++;
}
mcYourScore.position = mcHighScoreData.positionWeekly;
stop();
Symbol 791 MovieClip Frame 68
if ((!monthlyTabClicked) or (!monthlyLoaded)) {
getHighscores(0, mcHighScoreData);
monthlyTabClicked = true;
} else if (monthlyLoaded) {
gotoAndPlay ("monthlyLoaded");
}
Symbol 791 MovieClip Frame 75
if (mcHighScoreData.records > 0) {
mcHighScoreData.positionMonthly = mcHighScoreData.position;
monthlyLoaded = true;
var i = 0;
while (i < mcHighScoreData.high) {
mcHighScoreData["userNameMonthly" + i] = mcHighScoreData["user_name" + i];
mcHighScoreData["scoreMonthly" + i] = mcHighScoreData["score" + i];
mcHighScoreData["dateMonthly" + i] = mcHighScoreData["date" + i];
if (scoreIsTime or scoreReversed) {
mcHighScoreData["scoreMonthly" + i] = convertScoreToTime(mcHighScoreData["scoreMonthly" + i]);
}
i++;
}
gotoAndPlay ("monthlyLoaded");
} else {
gotoAndPlay(_currentframe - 1);
}
Symbol 791 MovieClip Frame 76
var i = 0;
while (i < mcHighScoreData.high) {
this["txtUserName" + i] = mcHighScoreData["userNameMonthly" + i];
this["txtScore" + i] = mcHighScoreData["scoreMonthly" + i];
this["txtDate" + i] = mcHighScoreData["dateMonthly" + i];
i++;
}
mcYourScore.position = mcHighScoreData.positionMonthly;
stop();
Symbol 792 Button
on (release) {
gotoAndStop ("menu");
}