Frame 1
onEnterFrame = function () {
loaded = _root.getBytesLoaded();
total = _root.getBytesTotal();
framesLoaded = Math.ceil((loaded / total) * 100);
channels.progressBar.gotoAndStop(framesLoaded);
if (framesLoaded >= 100) {
trace("START!");
channels.gotoAndStop(2);
onEnterFrame = null;
}
};
stop();
var myMenu = new ContextMenu();
myMenu.hideBuiltInItems();
_root.menu = myMenu;
Frame 3
function swapQuality() {
if (lowPower) {
lowPower = false;
bar.fuzzLine._visible = false;
bar.scanLines._visible = false;
shellLifeSpan = 150;
i = 0;
while (i < curLevels.length) {
mop = _root["level" + curLevels[i]];
mop.filters = new Array();
i++;
}
} else {
lowPower = true;
bar.fuzzLine._visible = true;
bar.scanLines._visible = true;
shellLifeSpan = 100;
i = 0;
while (i < curLevels.length) {
mop = _root["level" + curLevels[i]];
mop.filters = new Array(overallFilter);
i++;
}
}
}
function containPlayer() {
if (player._x < 0) {
player._x = (tileSize + 1) + player._width;
}
if (player._x > 1100) {
player._x = ((1100 - tileSize) - player._width) - 1;
}
}
function killGame() {
_root._x = 0;
_root._y = 0;
_root.cStatus = 50;
_root.onEnterFrame = null;
stopAllSounds();
bar.swapDepths(_root.k++);
for (var _local2 in _root) {
if (typeof(_root[_local2]) == "movieclip") {
_root[_local2].removeMovieClip();
}
}
_root.gotoAndStop(4);
}
function levelFeatures() {
if (currentLevelNum == 0) {
xGrav = 0;
yGrav = massGrav;
}
if (currentLevelNum == 1) {
xGrav = 0;
yGrav = massGrav;
}
if (currentLevelNum == 2) {
xGrav = 0;
yGrav = massGrav;
}
if (currentLevelNum == 3) {
xGrav = 0;
yGrav = massGrav;
}
if (currentLevelNum == 4) {
xGrav = 0;
yGrav = 0;
}
if (currentLevelNum == 5) {
xGrav = massGrav;
yGrav = 0;
}
if (currentLevelNum == 6) {
xGrav = 0;
yGrav = 0;
}
if (currentLevelNum == 7) {
xGrav = 0;
yGrav = massGrav;
}
if (currentLevelNum == 8) {
xGrav = 0;
yGrav = massGrav;
}
if (currentLevelNum == 9) {
xGrav = 0;
yGrav = massGrav;
}
if (currentLevelNum == 10) {
xGrav = -massGrav;
yGrav = 0;
}
if (currentLevelNum == 11) {
xGrav = 0;
yGrav = massGrav;
}
if (currentLevelNum == 12) {
xGrav = 0;
yGrav = 0;
}
if (currentLevelNum == 13) {
xGrav = 0;
yGrav = massGrav;
}
if (currentLevelNum == 14) {
xGrav = 0;
yGrav = massGrav;
}
if (currentLevelNum == 15) {
xGrav = 0;
yGrav = massGrav;
}
if (gravitySwitch) {
xGrav = xGrav * -1;
yGrav = yGrav * -1;
}
}
function activateSwitch() {
gravitySwitch = true;
level15.pigTalk.gotoAndStop(2);
stopAllSounds();
var _local2 = new Sound(this);
_local2.attachSound("reverseSong");
_local2.start(0, 99999);
level0.pack.gotoAndStop(2);
}
function loadLevel(num) {
trace("load level " + num);
shel = attachMovie("level" + num, "level" + num, k++);
if (lowPower) {
shel.filters = new Array(overallFilter);
}
shel._x = 0;
shel._y = (num * 900) - 900;
shel.spikes = new Array();
shel.spikesCounter = 1;
shel.barrels = new Array();
shel.barrelCounter = 1;
shel.levelNum = num;
curLevels.push(num);
}
function monitorLevels() {
tempNumber = Math.floor(900 * currentLevelNum) - 450;
if (player._y > tempNumber) {
foundOne = false;
i = 0;
while (i < curLevels.length) {
if (curLevels[i] == (currentLevelNum + 1)) {
foundOne = true;
}
i++;
}
if (!foundOne) {
loadLevel(currentLevelNum + 1);
}
}
}
function setCurrentLevel() {
tempLevel = Math.floor(player._y / 900) + 1;
currentLevel = _root["level" + tempLevel];
if (!gravitySwitch) {
if (tempLevel > oldLevelNum) {
shel = attachMovie("levelUpThing", "levelUpThing" + k, k++);
shel._x = 40;
shel.textStuff = "LEVEL " + tempLevel;
shel._y = player._y;
oldLevelNum = tempLevel;
}
currentLevelNum = tempLevel;
} else {
if (tempLevel < oldLevelNum) {
shel = attachMovie("levelUpThing", "levelUpThing" + k, k++);
shel._x = 40;
shel.textStuff = "LEVEL " + tempLevel;
shel._y = player._y;
oldLevelNum = tempLevel;
}
currentLevelNum = tempLevel;
}
}
function depths() {
facade.swapDepths(k++);
bar.swapDepths(k++);
}
function decoration() {
bar._x = -_root._x;
bar._y = -_root._y;
levelDisp = ("LEVEL " + currentLevelNum) + " OF 15";
}
function playerAnimation() {
facade._x = player._x;
facade._y = player._y;
facade.leftArm._rotation = rotPoint(facade._x + facade.leftArm._x, facade._y + facade.leftArm._y, _xmouse, _ymouse) - 90;
facade.rightArm._rotation = rotPoint(facade._x + facade.rightArm._x, facade._y + facade.rightArm._y, _xmouse, _ymouse) - 90;
if (facade.leftArm._rotation > 0) {
facade.leftArm.gotoAndStop(1);
} else {
facade.leftArm.gotoAndStop(2);
}
if (facade.rightArm._rotation > 0) {
facade.rightArm.gotoAndStop(1);
} else {
facade.rightArm.gotoAndStop(2);
}
}
function focus() {
if (cStatus == 1) {
offsetX = (320 - player._x) - _root._x;
offsetY = (240 - player._y) - _root._y;
elasticX(_root, 320 - player._x, 0.2, 0.6);
elasticY(_root, 240 - player._y, 0.2, 0.6);
}
if (Key.isDown(32)) {
trace(shells);
}
if (cStatus == 5) {
deathCounter++;
if (deathCounter < 20) {
if (!gravitySwitch) {
myTemporLevel = _root["level" + currentLevelNum];
} else {
myTemporLevel = _root["level" + (currentLevelNum + 1)];
}
}
if (deathCounter > 20) {
elasticX(_root, 320 - (myTemporLevel.startPoint._x + myTemporLevel._x), 0.2, 0.6);
elasticY(_root, 240 - (myTemporLevel.startPoint._y + myTemporLevel._y), 0.2, 0.6);
}
if (deathCounter == 41) {
respawnSound.start(0, 1);
}
if (deathCounter > 40) {
myTemporLevel.startPoint.gotoAndStop(2);
player._x = myTemporLevel._x + myTemporLevel.startPoint._x;
player._y = myTemporLevel._y + myTemporLevel.startPoint._y;
facade._visible = true;
facade._x = player._x;
facade._y = player._y;
}
if (deathCounter > 50) {
myTemporLevel.startPoint.gotoAndStop(1);
player.xVel = 0;
player.yVel = 0;
cStatus = 1;
deathCounter = 0;
closeDoorSound.start(0, 1);
}
}
}
function addBarrel(mov, mov2) {
mov2.barrelCounter++;
mov2.barrels.push(mov2.barrelCounter);
mov._name = "barrel" + mov2.barrelCounter;
mov.xVel = 2;
mov.yVel = 0;
mov.subType = "barrel";
trace(mov);
}
function barrelsFN() {
i = 0;
while (i < currentLevel.barrels.length) {
curBarrel = currentLevel["barrel" + currentLevel.barrels[i]];
curBarrel._x = curBarrel._x + curBarrel.xVel;
curBarrel._y = curBarrel._y + curBarrel.yVel;
bounding(curBarrel);
if (cStatus == 13) {
if (curBarrel.hitTest(player)) {
killPlayer();
return;
}
}
i++;
}
}
function spikesFN() {
if (cStatus == 1) {
i = 0;
while (i < currentLevel.spikes.length) {
curSpike = currentLevel["spikes" + currentLevel.spikes[i]];
if (curSpike.hitTest(player)) {
killPlayer();
return;
}
i++;
}
}
}
function killPlayer() {
cStatus = 5;
deathSound.start(0, 1);
tombstoneCounter++;
deaths++;
facade._visible = false;
tombstones.push(tombstoneCounter);
shel = attachMovie("tombstone", "tombstone" + tombstoneCounter, k++);
shel._x = player._x;
shel._y = player._y;
shel.life = 300;
shel.deathCount.text = deaths;
shel.xVel = player.xVel / 2;
shel.yVel = player.yVel / 4;
}
function moveTombstones() {
i = 0;
while (i < tombstones.length) {
curTombstone = _root["tombstone" + tombstones[i]];
bounding(curTombstone);
i++;
}
}
function addSpikes(mov, mov2) {
mov2.spikesCounter++;
mov2.spikes.push(mov2.spikesCounter);
mov._name = "spikes" + mov2.spikesCounter;
}
function moveShells() {
i = 0;
while (i < shells.length) {
curShell = _root["shell" + shells[i]];
curShell.inside._rotation = curShell.inside._rotation + curShell.rotSpeed;
bounding(curShell);
if (yGrav >= 1.5) {
curShell._alpha = curShell._alpha - 10;
}
if ((Math.abs(curShell.xVel) < 0.3) && (Math.abs(curShell.yVel) < 0.3)) {
curShell._alpha = curShell._alpha - 3;
}
curShell.life--;
if (((curShell._x >= 1080) || (curShell._x <= 0)) || (curShell.life < 0)) {
curShell._alpha = 0;
}
if (curShell._alpha <= 0) {
shells.splice(i, 1);
curShell.removeMovieClip();
}
i++;
}
}
function trackBullet(num, num2) {
trackerCounter = 0;
tracker._x = player._x;
tracker._y = player._y;
tracker.xVel = -num;
tracker.yVel = -num2;
foundWhat = tracker;
while (trackerCounter < 100) {
trackerCounter++;
curLevel = _root["level" + (Math.floor(tracker._y / 900) + 1)];
if (gravitySwitch) {
if (tracker.hitTest(level15.pigTalk.pig) && (level15.pigTalk._currentframe == 2)) {
level15.pigTalk.gotoAndStop(3);
}
}
if (tracker.yVel < 0) {
if (checkCoords(tracker, tracker._x, tracker._y + tracker.yVel, 0, curLevel)) {
tracker._y = tracker._y + tracker.yVel;
} else {
break;
}
}
if (tracker.yVel > 0) {
if (checkCoords(tracker, tracker._x, tracker._y + tracker.yVel, 1, curLevel)) {
tracker._y = tracker._y + tracker.yVel;
} else {
break;
}
}
if (tracker.xVel < 0) {
if (checkCoords(tracker, tracker._x + tracker.xVel, tracker._y, 3, curLevel)) {
tracker._x = tracker._x + tracker.xVel;
} else {
break;
}
}
if (tracker.xVel > 0) {
if (checkCoords(tracker, tracker._x + tracker.xVel, tracker._y, 2, curLevel)) {
tracker._x = tracker._x + tracker.xVel;
} else {
break;
}
}
}
if (foundWhat.breakable) {
foundWhat.nextFrame();
destroySound.start(0, 1);
}
shel = attachMovie("explosion", "explosion" + k, k++);
shel._x = tracker._x;
shel._y = tracker._y;
shel._rotation = random(360);
shel._yscale = (shel._xscale = random(50) + 4);
trackerCounter = 0;
}
function loadShell(mov) {
shellsCounter++;
shells.push(shellsCounter);
shel = attachMovie("shellCase", "shell" + shellsCounter, k++);
shel._x = (facade._x + mov._x) - (20 * Math.cos(angl));
shel._y = (facade._y + mov._y) - (20 * Math.sin(angl));
shel.xVel = 2 * (tempX / 2);
shel.yVel = (-1 - (random(30) / 10)) * 2;
shel.rotSpeed = shel.xVel * (random(5) + 1);
shel.type = "shell";
shel.life = shellLifeSpan;
}
function loadBulletTrail(mov) {
shel = attachMovie("bulletTrail", "bulletTrail" + k, k++);
shel._x = (facade._x + mov._x) - (5 * Math.cos(angl));
shel._y = (facade._y + mov._y) - (5 * Math.sin(angl));
shel._rotation = mov._rotation + 90;
}
function loadExplosion(mov) {
shel = attachMovie("explosion", "explosion" + k, k++);
shel._x = (facade._x + mov._x) - (20 * Math.cos(angl));
shel._y = (facade._y + mov._y) - (20 * Math.sin(angl));
shel._rotation = random(360);
shel._yscale = (shel._xscale = random(20) + 4);
}
function drawSomething() {
drawArea.clear();
drawArea.lineStyle(3, 65280, 100);
drawArea.moveTo(player._x, player._y);
drawArea.lineTo(_xmouse, _ymouse);
}
function naming(mov, levNum) {
mov._x = Math.round(mov._x);
mov._y = Math.round(mov._y);
mov.posX = Math.floor(mov._x / _root.tileSize);
mov.posY = Math.floor((mov._y + ((levNum - 1) * 900)) / _root.tileSize);
if (!(mov.type === 1)) {
} else {
mov._name = (("tile" + mov.posX) + "x") + mov.posY;
}
}
function bounding(mc) {
if ((mc.xVel * 0) != 0) {
mc.xVel = 0;
}
if ((mc.yVel * 0) != 0) {
mc.yVel = 0;
}
curLevelNum = Math.floor(mc._y / 900) + 1;
tempCurLevel = _root["level" + curLevelNum];
mc.xVel = mc.xVel + xGrav;
mc.yVel = mc.yVel + yGrav;
if (mc.yVel < 0) {
if (checkCoords(mc, mc._x, mc._y + mc.yVel, 0, tempCurLevel)) {
mc._y = mc._y + mc.yVel;
} else {
mc.xVel = mc.xVel * xF;
mc.yVel = mc.yVel * bounce;
mc.rotSpeed = mc.rotSpeed * -1;
mc._y = ((mc.tr._y + tileSize) + mc._height) + ((curLevelNum - 1) * 900);
if (((mc.yVel < thudTresh) && (mc.yVel > (-thudTresh))) && ((xGrav != 0) || (yGrav != 0))) {
mc.yVel = 0;
}
}
} else if (mc.yVel > 0) {
if (checkCoords(mc, mc._x, mc._y + mc.yVel, 1, tempCurLevel)) {
mc._y = mc._y + mc.yVel;
} else {
if ((mc._name == "player") && (mc.yVel > bounceTolerance)) {
bounceSound.start(0, 1);
} else if (mc.yVel > bounceTolerance) {
bulletDropSound.start(0, 1);
}
mc.xVel = mc.xVel * xF;
mc.yVel = mc.yVel * bounce;
mc._y = mc.br._y + ((curLevelNum - 1) * 900);
if (((mc.yVel < thudTresh) && (mc.yVel > (-thudTresh))) && ((xGrav != 0) || (yGrav != 0))) {
mc.yVel = 0;
}
if (Math.abs(mc.yVel) > 6) {
mc.rotSpeed = mc.rotSpeed * (random(8) - 4);
} else {
mc.rotSpeed = mc.rotSpeed * 0.5;
}
}
}
if (mc.xVel < 0) {
if (checkCoords(mc, mc._x + mc.xVel, mc._y, 3, tempCurLevel)) {
mc._x = mc._x + mc.xVel;
} else {
mc.yVel = mc.yVel * yF;
mc.xVel = mc.xVel * bounce;
if ((mc._name == "player") && (mc.xVel < bounceTolerance)) {
bounceSound.start(0, 1);
}
mc._x = (mc.bl._x + (mc._width / 2)) + tileSize;
if (((mc.xVel < thudTresh) && (mc.xVel > (-thudTresh))) && ((xGrav != 0) || (yGrav != 0))) {
mc.xVel = 0;
}
}
} else if (mc.xVel > 0) {
if (checkCoords(mc, mc._x + mc.xVel, mc._y, 2, tempCurLevel)) {
mc._x = mc._x + mc.xVel;
} else {
mc.yVel = mc.yVel * yF;
mc.xVel = mc.xVel * bounce;
if ((mc._name == "player") && (mc.xVel > bounceTolerance)) {
bounceSound.start(0, 1);
}
mc._x = mc.br._x - (mc._width / 2);
if (((mc.xVel < thudTresh) && (mc.xVel > (-thudTresh))) && ((xGrav != 0) || (yGrav != 0))) {
mc.xVel = 0;
}
}
}
if (mc.xVel > mc.xMax) {
mc.xVel = mc.xMax;
}
if (mc.xVel < (-mc.xMax)) {
mc.xVel = -mc.xMax;
}
if (mc.yVel > mc.yMax) {
mc.yVel = mc.yMax;
}
if (mc.yVel < (-mc.yMax)) {
mc.yVel = -mc.yMax;
}
}
function checkCoords(mc, x, y, direction, holder) {
mc.ctlx = (x - (mc._width / 2)) + 1;
mc.ctly = (y - mc._height) + 1;
mc.ctrx = (x + (mc._width / 2)) - 1;
mc.ctry = (y - mc._height) + 1;
mc.cbrx = (x + (mc._width / 2)) - 1;
mc.cbry = (y + (mc._height * 0)) - 1;
mc.cblx = (x - (mc._width / 2)) + 1;
mc.cbly = (y + (mc._height * 0)) - 1;
mc.clmx = (x - (mc._width / 2)) + 1;
mc.clmy = (y - (mc._height / 2)) + 1;
mc.ctmx = x + 1;
mc.ctmy = (y - mc._height) + 1;
mc.crmx = (x + (mc._width / 2)) - 1;
mc.crmy = (y - (mc._height / 2)) + 1;
mc.cbmx = x + 1;
mc.cbmy = (y + (mc._height * 0)) - 1;
mc.cbmx = x + 1;
mc.cmx = x + 1;
mc.cmy = (y - (mc._height / 2)) + 1;
mc.tl = holder[(("tile" + Math.floor(mc.ctlx / tileSize)) + "x") + Math.floor(mc.ctly / tileSize)];
mc.tr = holder[(("tile" + Math.floor(mc.ctrx / tileSize)) + "x") + Math.floor(mc.ctry / tileSize)];
mc.br = holder[(("tile" + Math.floor(mc.cbrx / tileSize)) + "x") + Math.floor(mc.cbry / tileSize)];
mc.bl = holder[(("tile" + Math.floor(mc.cblx / tileSize)) + "x") + Math.floor(mc.cbly / tileSize)];
mc.tm = holder[(("tile" + Math.floor(mc.ctmx / tileSize)) + "x") + Math.floor(mc.ctmy / tileSize)];
mc.lm = holder[(("tile" + Math.floor(mc.clmx / tileSize)) + "x") + Math.floor(mc.clmy / tileSize)];
mc.bm = holder[(("tile" + Math.floor(mc.cbmx / tileSize)) + "x") + Math.floor(mc.cbmy / tileSize)];
mc.rm = holder[(("tile" + Math.floor(mc.crmx / tileSize)) + "x") + Math.floor(mc.crmy / tileSize)];
mc.mb = holder[(("tile" + Math.floor(mc.cbmx / tileSize)) + "x") + Math.floor(mc.cbly / tileSize)];
if (mc.tl.type == 1) {
guyTL = true;
foundWhat = mc.tl;
} else {
guyTL = false;
}
if (mc.tr.type == 1) {
guyTR = true;
foundWhat = mc.tr;
} else {
guyTR = false;
}
if (mc.br.type == 1) {
guyBR = true;
foundWhat = mc.br;
} else if ((mc.br.type == 2) && (mc.yVel > 0)) {
guyBR = true;
foundWhat = mc.br;
} else {
guyBR = false;
}
if (mc.bl.type == 1) {
guyBL = true;
foundWhat = mc.bl;
} else if ((mc.bl.type == 2) && (mc.yVel > 0)) {
guyBL = true;
foundWhat = mc.bl;
} else {
guyBL = false;
}
if (mc.tm.type == 1) {
guyTM = true;
foundWhat = mc.tm;
} else {
guyTM = false;
}
if (mc.bm.type == 1) {
guyBM = true;
foundWhat = mc.bm;
} else {
guyBM = false;
}
if (mc.lm.type == 1) {
guyLM = true;
foundWhat = mc.lm;
} else {
guyLM = false;
}
if (mc.rm.type == 1) {
guyRM = true;
foundWhat = mc.rm;
} else {
guyRM = false;
}
switch (direction) {
case 0 :
if (guyTL || (guyTR)) {
return(false);
}
case 1 :
if (guyBR || (guyBL)) {
return(false);
}
case 2 :
if (guyTR || (guyBR)) {
return(false);
}
case 3 :
if (!(guyTL || (guyBL))) {
break;
}
return(false);
}
return(true);
}
function rotPoint(xPoint1, yPoint1, xPoint2, yPoint2) {
degrees = Math.atan(Math.abs(yPoint1 - yPoint2) / Math.abs(xPoint1 - xPoint2)) * 57.2957795130823;
if (xPoint1 < xPoint2) {
if (yPoint1 < yPoint2) {
return(0 + degrees);
}
if (yPoint1 > yPoint2) {
return(-degrees);
}
} else if (xPoint1 > xPoint2) {
if (yPoint1 < yPoint2) {
return(180 - degrees);
}
if (yPoint1 > yPoint2) {
return(180 + degrees);
}
}
}
function rotMC(mc1, mc2) {
rotPoint(mc1._x, mc1._y, mc2._x, mc2._y);
}
function distPoint(x1, y1, x2, y2) {
return(Math.sqrt(Math.pow(x2 - x1, 2) + Math.pow(y2 - y1, 2)));
}
function distMC(mc1, mc2) {
distPoint(mc1._x, mc1._y, mc2._x, mc2._y);
}
function ease(str, mov, num, drift) {
switch (str) {
case "x" :
mov._x = mov._x - (drift * ((mov._x - num) / 2));
break;
case "y" :
mov._y = mov._y - (drift * ((mov._y - num) / 2));
break;
case "xscale" :
mov._xscale = mov._xscale - (drift * ((mov._xscale - num) / 2));
break;
case "yscale" :
mov._yscale = mov._yscale - (drift * ((mov._yscale - num) / 2));
break;
case "width" :
mov._width = mov._width - (drift * ((mov._width - num) / 2));
break;
case "height" :
mov._height = mov._height - (drift * ((mov._height - num) / 2));
break;
case "alpha" :
mov._alpha = mov._alpha - (drift * ((mov._alpha - num) / 2));
break;
case "rotation" :
mov._rotation = mov._rotation - (drift * ((mov._rotation - num) / 2));
}
}
function elasticRotation(mc, targt, accel, friction) {
if (mc.qrScale == undefined) {
mc.qrScale = 0;
}
mc.qrScale = mc.qrScale + ((targt - mc._rotation) * accel);
mc.qrScale = mc.qrScale * friction;
mc._rotation = mc._rotation + mc.qrScale;
}
function elasticScale(mc, targt, accel, friction) {
if (mc.qxScale == undefined) {
mc.qxScale = 0;
}
mc.qxScale = mc.qxScale + ((targt - mc._xscale) * accel);
mc.qxScale = mc.qxScale * friction;
mc._xscale = (mc._yscale = mc._yscale + mc.qxScale);
}
function elasticX(mc, targt, accel, friction) {
if (mc.qxSpeed == undefined) {
mc.qxSpeed = 0;
}
mc.qxSpeed = mc.qxSpeed + ((targt - mc._x) * accel);
mc.qxSpeed = mc.qxSpeed * friction;
mc._x = mc._x + mc.qxSpeed;
}
function elasticY(mc, targt, accel, friction) {
if (mc.qySpeed == undefined) {
mc.qySpeed = 0;
}
mc.qySpeed = mc.qySpeed + ((targt - mc._y) * accel);
mc.qySpeed = mc.qySpeed * friction;
mc._y = mc._y + mc.qySpeed;
}
function elasticH(mc, targt, accel, friction) {
if (mc.qhSpeed == undefined) {
mc.qhSpeed = 0;
}
mc.qhSpeed = mc.qhSpeed + ((targt - mc._height) * accel);
mc.qhSpeed = mc.qhSpeed * friction;
mc._height = mc._height + mc.qhSpeed;
}
function elasticW(mc, targt, accel, friction) {
if (mc.qwSpeed == undefined) {
mc.qwSpeed = 0;
}
mc.qwSpeed = mc.qwSpeed + ((targt - mc._width) * accel);
mc.qwSpeed = mc.qwSpeed * friction;
mc._width = mc._width + mc.qwSpeed;
}
stop();
_quality = "LOW";
var k = 0;
var lowPower = true;
onEnterFrame = function () {
keystrokes();
if (cStatus == 1) {
bounding(player);
}
playerAnimation();
spikesFN();
barrelsFN();
moveShells();
focus();
decoration();
depths();
moveTombstones();
setCurrentLevel();
monitorLevels();
levelFeatures();
containPlayer();
};
player.xMax = 30;
player.yMax = 20;
_root._x = 320 - player._x;
_root._y = 240 - player._y;
var shellLifeSpan = 150;
var massGrav = 0.4;
var gravitySwitch = false;
var overallFilter = (new flash.filters.GlowFilter(65280, 0.5, 20, 20, 1.5));
facade.filters = new Array(overallFilter);
var curLevels = new Array();
var startingLevel = 0;
var level = startingLevel;
if (startingLevel != 0) {
player._x = 75;
player._y = (90 + (900 * startingLevel)) - 900;
}
loadLevel(startingLevel - 1);
loadLevel(startingLevel);
loadLevel(startingLevel + 1);
var oldLevelNum = 0;
player._visible = false;
var shells = new Array();
var shellsCounter = 1;
var deathCounter = 0;
var respawnSound = new Sound(this);
respawnSound.attachSound("respawn");
var closeDoorSound = new Sound(this);
closeDoorSound.attachSound("closeDoor");
var deathSound = new Sound(this);
deathSound.attachSound("death");
var shootSound = new Sound(this);
shootSound.attachSound("shoot");
var bounceSound = new Sound(this);
bounceSound.attachSound("bounceBullet");
var deaths = 0;
var tombstoneCounter = 0;
var tombstones = new Array();
var gunPower = 5;
onMouseDown = function () {
if (cStatus == 1) {
angl = (180 + rotPoint(player._x, player._y, _xmouse, _ymouse)) * (Math.PI/180);
tempX = gunPower * Math.cos(angl);
tempY = gunPower * Math.sin(angl);
player.xVel = player.xVel + tempX;
player.yVel = player.yVel + tempY;
loadShell(facade.leftArm);
loadShell(facade.rightArm);
loadBulletTrail(facade.leftArm);
loadBulletTrail(facade.rightArm);
loadExplosion(facade.leftArm);
loadExplosion(facade.rightArm);
shootSound.start(0, 1);
trackBullet(tempX, tempY);
}
};
var trackerCounter = 0;
tracker._visible = false;
var destroySound = new Sound(this);
destroySound.attachSound("destroy");
createEmptyMovieClip("drawArea", k++);
var cStatus = 1;
var tileSize = 30;
player.yVel = 0;
player.xVel = 0;
player.yMax = 40;
var yGrav = 0.6;
var xGrav = 0.6;
player.xVel = 0;
var xS = 3;
var xF = 0.7;
var yF = 0.7;
var yS = 2;
var xMax = 5;
var bounceTolerance = 5;
var bulletDropSound = new Sound(this);
bulletDropSound.attachSound("bulletDrop");
var bounce = -0.6;
var thudTresh = 2;
Symbol 2 MovieClip Frame 1
this._visible = false;
Symbol 7 MovieClip [bulletTrail] Frame 3
this.removeMovieClip();
Symbol 10 MovieClip [explosion] Frame 5
this.removeMovieClip();
Symbol 20 MovieClip [levelUpThing] Frame 73
this.removeMovieClip();
Symbol 44 Button
on (release) {
play();
}
Symbol 47 MovieClip Frame 1
function killAd() {
removeMovieClip(adBox);
}
function muteHandler() {
muted = !muted;
if (muted) {
globalSound.setVolume(0);
} else {
globalSound.setVolume(100);
}
}
stop();
var CPMStarPoolID = 1052;
var CPMStarSubPoolID = 5;
System.security.allowDomain("server.cpmstar.com");
adBox.loadMovie((("http://server.cpmstar.com/adviewas2.swf?poolid=" + CPMStarPoolID) + "&subpoolid=") + CPMStarSubPoolID);
var globalSound = new Sound(this);
globalSound.setVolume(100);
muted = false;
Symbol 47 MovieClip Frame 2
stop();
Symbol 47 MovieClip Frame 4
_root.play();
Symbol 59 MovieClip Frame 1
type = 1;
_root.naming(this, this._parent.levelNum);
Symbol 61 MovieClip Frame 1
type = 1;
_root.naming(this, this._parent.levelNum);
Symbol 63 MovieClip Frame 1
type = 1;
_root.naming(this, this._parent.levelNum);
Symbol 73 MovieClip Frame 1
this._visible = false;
Symbol 74 MovieClip Frame 1
stop();
Symbol 74 MovieClip Frame 2
stop();
onEnterFrame = function () {
if (_root.player.hitTest(hitA)) {
_root.killGame();
}
};
Symbol 78 MovieClip Frame 1
type = 1;
_root.naming(this, this._parent.levelNum);
Symbol 80 MovieClip Frame 1
type = 1;
_root.naming(this, this._parent.levelNum);
Symbol 82 MovieClip Frame 1
type = 1;
_root.naming(this, this._parent.levelNum);
Symbol 84 MovieClip Frame 1
type = 1;
_root.naming(this, this._parent.levelNum);
Symbol 91 MovieClip Frame 1
stop();
Symbol 94 MovieClip Frame 1
_root.addSpikes(this, this._parent);
Symbol 99 MovieClip Frame 1
_root.addSpikes(this, this._parent);
Symbol 109 MovieClip Frame 1
type = 1;
breakable = true;
_root.naming(this, this._parent.levelNum);
stop();
Symbol 109 MovieClip Frame 4
this.swapDepths(_root.k++);
this.removeMovieClip();
Symbol 118 MovieClip Frame 1
this._visible = false;
touched = false;
onEnterFrame = function () {
if (touched == false) {
if (this.hitTest(_root.player)) {
_root.activateSwitch();
touched = true;
onEnterFrame = null;
}
}
};
Symbol 128 MovieClip Frame 1
stop();
Symbol 128 MovieClip Frame 2
stop();
Symbol 128 MovieClip Frame 3
stop();
Symbol 130 MovieClip Frame 1
stop();
Symbol 135 MovieClip Frame 1
stop();
Symbol 142 Button
on (release) {
getURL ("http://armorgames.com/", "_blank");
}
Symbol 148 Button
on (release) {
_root.swapQuality();
if (_root.lowPower) {
this.gotoAndStop(2);
} else {
this.gotoAndStop(1);
}
}
Symbol 149 MovieClip Frame 2
stop();
Symbol 165 Button
on (release) {
getURL ("http://armorgames.com/", "_blank");
}
Symbol 167 Button
on (release) {
_root.gotoAndPlay(2);
}
Symbol 171 MovieClip Frame 177
stop();