Frame 1
var myMenu = new ContextMenu();
myMenu.hideBuiltInItems();
copyrightNotice.separatorBefore = true;
myMenu.customItems.push(mySiteLink, copyrightNotice);
_root.menu = myMenu;
bytes_loaded = Math.round(_root.getBytesLoaded());
bytes_total = Math.round(_root.getBytesTotal());
getPercent = bytes_loaded / bytes_total;
_root.loadBar._width = getPercent * 100;
_root.loadText = Math.round(getPercent * 100) + "%";
if (bytes_loaded == bytes_total) {
_root.gotoAndPlay(4);
}
Instance of Symbol 43 MovieClip in Frame 1
on (release) {
getURL ("http://www.deadfrontier.com/index.php?cp=neilNightcrawlers&sid=1", "_blank");
}
Frame 2
gotoAndPlay (1);
Frame 3
logo.onPress = function () {
getURL ("http://www.xdgames.co.uk", "_blank");
};
Frame 4
cam._x = csTest._x;
cam._y = csTest._y;
stop();
stopAllSounds();
Instance of Symbol 43 MovieClip in Frame 4
on (release) {
getURL ("http://www.deadfrontier.com/index.php?cp=neilNightcrawlers&sid=2", "_blank");
}
Instance of Symbol 98 MovieClip in Frame 4
on (release) {
_root.nextFrame();
}
Frame 5
cam._x = csTest._x;
cam._y = csTest._y;
Instance of Symbol 190 MovieClip in Frame 5
on (release) {
getURL ("http://www.deadfrontier.com/index.php?cp=neilNightcrawlers&sid=3", "_blank");
}
Frame 6
function removeStuff() {
i = light.length - 1;
while (i >= 0) {
light[i].removeMovieClip();
light.splice(i, 1);
i--;
}
i = human.length - 1;
while (i >= 0) {
human[i].removeMovieClip();
human.splice(i, 1);
i--;
}
i = walking.length - 1;
while (i >= 0) {
walking.splice(i, 1);
i--;
}
i = walkingDistance.length - 1;
while (i >= 0) {
walkingDistance.splice(i, 1);
i--;
}
i = heardSomething.length - 1;
while (i >= 0) {
heardSomething.splice(i, 1);
i--;
}
i = heardSomethingTimer.length - 1;
while (i >= 0) {
heardSomethingTimer.splice(i, 1);
i--;
}
i = torch.length - 1;
while (i >= 0) {
torch.splice(i, 1);
i--;
}
i = torchTimer.length - 1;
while (i >= 0) {
torchTimer.splice(i, 1);
i--;
}
i = alive.length - 1;
while (i >= 0) {
alive.splice(i, 1);
i--;
}
}
stop();
hud.ac.gotoAndStop("blah");
_global.goToTitle = false;
_global.levelDone = false;
ingame = true;
gasp_sound = new Sound();
gasp_sound.attachSound("gasp");
die_sound = new Sound();
die_sound.attachSound("dieSound");
player._x = startPoint._x;
player._y = startPoint._y;
cam._xscale = 100;
cam._yscale = 100;
hitPlayer = 0;
hitTimer = 0;
health = 100;
running = false;
gravity = 0;
gravityaccel = 0.3;
xaccel = 0;
runaccelamt = 0.3;
friction = 0.5;
airrisist = 0.05;
maxaccel = 5;
maxjump = 3;
eating = false;
eatingTimer = 0;
inControl = true;
doubleJump = false;
doubleJumping = false;
jump = true;
sneaking = false;
pressOnce = 0;
walkingThroughDoor = false;
walkingThroughDoorTimer = 0;
dying = false;
dyingTimer = 0;
crouch = false;
invisible = false;
power = 100;
cam.lens._xscale = 70;
cam.lens._yscale = 70;
timeSpentWalkingThroughDoor = 25;
timeSpentTurningToDust = 40;
timeSpentEating = 40;
timeItTakesToGetOutTorch = 32;
timeSpentShiningTorch = 80;
walkingSpeed = 2;
var human = new Array();
var heardSomething = new Array();
var heardSomethingTimer = new Array();
var torch = new Array();
var torchTimer = new Array();
var alive = new Array();
var walking = new Array();
var walkingDistance = new Array();
human.push(human_mc, human_mc1, human_mc2);
heardSomething.push(false, false, false);
heardSomethingTimer.push(0, 0, 0);
torch.push(false, false, false);
torchTimer.push(0, 0, 0);
alive.push(true, true, true);
walking.push(false, false, true);
walkingDistance.push(0, 0, 0);
var light = new Array();
light.push(light1, light2, light3, light4, light5, light6, light7, light8, light9, light10, light11);
player.onEnterFrame = function () {
if (power < 1) {
invisible = false;
player._alpha = 100;
power = 0;
}
if ((!dying) && (!eating)) {
if (power > 0) {
if (Key.isDown(83)) {
power = power - 1;
invisible = true;
player._alpha = 30;
} else {
invisible = false;
player._alpha = 100;
}
}
}
if (hitPlayer == 0) {
myColor = new Color(player);
myColorTransform = new Object();
myColorTransform = {rb:0, gb:0, bb:0};
myColor.setTransform(myColorTransform);
}
if (hitPlayer == 1) {
myColor = new Color(player);
myColorTransform = new Object();
myColorTransform = {rb:100, gb:-50, bb:-50};
myColor.setTransform(myColorTransform);
hitTimer++;
if (hitTimer == 1) {
hitPlayer = 0;
hitTimer = 0;
}
}
i = light.length - 1;
while (i >= 0) {
if (player.hitMarker.hitTest(light[i])) {
if ((!dying) && (!invisible)) {
health = health - 0.25;
hitPlayer = 1;
}
}
i--;
}
if (health < 0) {
inControl = false;
dying = true;
power = 100;
health = 0;
}
if (dying) {
invisible = false;
player._alpha = 100;
xaccel = 0;
player.gotoAndStop("dead");
if (dyingTimer == 0) {
die_sound.start();
}
dyingTimer++;
if (dyingTimer == timeSpentTurningToDust) {
dyingTimer = 0;
dying = false;
inControl = true;
player._x = startPoint._x;
player._y = startPoint._y;
health = 100;
}
}
i = human.length - 1;
while (i >= 0) {
if (!alive[i]) {
if (walking[i]) {
human[i]._xscale = 100;
}
human[i].gotoAndStop("dead");
}
if (alive[i]) {
if (walking[i]) {
walkingDistance[i]++;
human[i].gotoAndStop("walk");
if (walkingDistance[i] == 80) {
walkingDistance[i] = 0;
}
if ((walkingDistance[i] > 0) && (walkingDistance[i] < 40)) {
human[i]._xscale = -100;
human[i]._x = human[i]._x - walkingSpeed;
}
if (walkingDistance[i] > 40) {
human[i]._xscale = 100;
human[i]._x = human[i]._x + walkingSpeed;
}
}
if (!walking[i]) {
if (torch[i]) {
torchTimer[i]++;
human[i].gotoAndStop("light");
if (torchTimer[i] == timeSpentShiningTorch) {
torch[i] = false;
torchTimer[i] = 0;
human[i].gotoAndStop("idle");
}
}
if (heardSomething[i]) {
if (heardSomethingTimer[i] == 0) {
gasp_sound.start();
}
heardSomethingTimer[i]++;
human[i].gotoAndStop("wtf");
if (heardSomethingTimer[i] == timeItTakesToGetOutTorch) {
heardSomethingTimer[i] = 0;
heardSomething[i] = false;
torch[i] = true;
}
}
}
if ((!dying) && (player.hitTest(human[i].hit))) {
alive[i] = false;
eating = true;
inControl = false;
}
if (player.hitMarker.hitTest(human[i].beam)) {
if ((!dying) && (!invisible)) {
health = health - 10;
hitPlayer = 1;
}
}
if (player.hitTest(human[i].zone)) {
if (!sneaking) {
if (!torch[i]) {
heardSomething[i] = true;
}
}
}
}
i--;
}
if (!jump) {
crouch = false;
}
if (inControl) {
if ((!running) && (jump)) {
if (Key.isDown(40)) {
maxaccel = 2;
crouch = true;
} else {
maxaccel = 5;
crouch = false;
}
}
}
if ((!jump) && (!crouch)) {
maxaccel = 5;
sneaking = false;
}
if (inControl) {
if (jump && (!crouch)) {
if (Key.isDown(65)) {
maxaccel = 1.6;
sneaking = true;
} else {
maxaccel = 5;
sneaking = false;
}
}
}
if (player.hitTest(door)) {
walkingThroughDoor = true;
xaccel = 0;
inControl = false;
player.gotoAndStop("throughDoor");
}
if (walkingThroughDoor) {
walkingThroughDoorTimer++;
if (walkingThroughDoorTimer == timeSpentWalkingThroughDoor) {
removeStuff();
hud.ac.gotoAndStop("areaComplete");
}
}
if (eating) {
invisible = false;
player._alpha = 100;
xaccel = 0;
player.gotoAndStop("feeding");
eatingTimer++;
if (eatingTimer == timeSpentEating) {
eating = false;
eatingTimer = 0;
inControl = true;
}
}
if (inControl) {
if (doubleJumping) {
player.gotoAndStop("double");
}
if (crouch && (!running)) {
player.gotoAndStop("crouch");
}
if (crouch && (running)) {
player.gotoAndStop("crouchWalk");
}
if (!crouch) {
if (!sneaking) {
if (jump && (!doubleJumping)) {
if (running) {
player.gotoAndStop("run");
} else {
player.gotoAndStop("idle");
}
} else if (!doubleJumping) {
player.gotoAndStop("jump");
}
}
if (sneaking) {
if (jump && (!doubleJumping)) {
if (running) {
player.gotoAndStop("sneak");
} else {
player.gotoAndStop("idle");
}
} else if (!doubleJumping) {
player.gotoAndStop("jump");
}
}
}
if (Key.isDown(39) or Key.isDown(37)) {
running = true;
} else {
running = false;
}
}
if (!ground.hitTest(player._x, player._y + 10, true)) {
falling = true;
grounded = false;
}
if (ground.hitTest(player._x, player._y + 11, true)) {
doubleJumping = false;
doubleJump = false;
jump = true;
grounded = true;
falling = false;
while (ground.hitTest(player._x, player._y + 9, true)) {
player._y--;
}
}
if (falling == true) {
gravity = gravity + gravityaccel;
} else {
gravity = 0;
}
if (inControl) {
if ((Key.isDown(39) && (xaccel < maxaccel)) && (falling == true)) {
xaccel = xaccel + (runaccelamt - airrisist);
} else if ((Key.isDown(37) && (xaccel > (-maxaccel))) && (falling == true)) {
xaccel = xaccel - (runaccelamt - airrisist);
} else if ((Key.isDown(37) && (xaccel > (-maxaccel))) && (falling == false)) {
xaccel = xaccel - runaccelamt;
} else if ((Key.isDown(39) && (xaccel < maxaccel)) && (falling == false)) {
xaccel = xaccel + runaccelamt;
} else if (grounded == true) {
if (xaccel > 0) {
xaccel = xaccel - friction;
}
if (xaccel < 0) {
xaccel = xaccel + friction;
}
if ((xaccel < 0) && (xaccel > friction)) {
xaccel = 0;
}
if ((xaccel > 0) && (xaccel < friction)) {
xaccel = 0;
}
} else {
if (xaccel > 0) {
xaccel = xaccel - airrisist;
}
if (xaccel < 0) {
xaccel = xaccel + airrisist;
}
if ((xaccel < 0) && (xaccel > airrisist)) {
xaccel = 0;
}
if ((xaccel > 0) && (xaccel < airrisist)) {
xaccel = 0;
}
}
}
if (_root.ground.hitTest(this._x, this._y - 11, true)) {
gravity = 1;
while (_root.ground.hitTest(this._x, this._y - 10, true)) {
this._y++;
}
}
if (xaccel > 0) {
player._xscale = 100;
}
if (xaccel < 0) {
player._xscale = -100;
}
if (!Key.isDown(38)) {
pressOnce = 0;
}
if (inControl) {
if (Key.isDown(38) && (jump == true)) {
gravity = gravity - (Math.cos(3.141593 * ((player._rotation * -1) / 180)) * maxjump);
jump = false;
doubleJump = true;
pressOnce = 1;
}
}
leftx = player._x + (Math.cos(3.141593 * (((player._rotation * -1) + 180) / 180)) * 7);
lefty = player._y - (Math.sin(3.141593 * (((player._rotation * -1) + 180) / 180)) * 500);
rightx = player._x + (Math.cos(3.141593 * ((player._rotation * -1) / 180)) * 7);
righty = player._y - (Math.sin(3.141593 * ((player._rotation * -1) / 180)) * 500);
if (ground.hitTest(leftx, lefty, true)) {
xaccel = 0;
player._x++;
}
if (ground.hitTest(rightx, righty, true)) {
xaccel = 0;
player._x--;
}
hud.whateverTheInvisibilityBarIsCalled._xscale = power;
hud.whateverTheHealthBarIsCalled._xscale = health;
if (ingame) {
cam._x = _root.player._x;
cam._y = _root.player._y - 30;
cam.camControl();
}
player._y = player._y + gravity;
player._x = player._x + xaccel;
hud._x = cam._x;
hud._y = cam._y;
hud._xscale = cam.lens._xscale;
hud._yscale = cam.lens._yscale;
if (_global.goToTitle) {
stopAllSounds();
removeStuff();
gotoAndStop ("title");
}
if (_global.levelDone) {
removeStuff();
nextFrame();
}
};
Frame 7
function removeStuff() {
i = light.length - 1;
while (i >= 0) {
light[i].removeMovieClip();
light.splice(i, 1);
i--;
}
i = human.length - 1;
while (i >= 0) {
human[i].removeMovieClip();
human.splice(i, 1);
i--;
}
i = walking.length - 1;
while (i >= 0) {
walking.splice(i, 1);
i--;
}
i = walkingDistance.length - 1;
while (i >= 0) {
walkingDistance.splice(i, 1);
i--;
}
i = heardSomething.length - 1;
while (i >= 0) {
heardSomething.splice(i, 1);
i--;
}
i = heardSomethingTimer.length - 1;
while (i >= 0) {
heardSomethingTimer.splice(i, 1);
i--;
}
i = torch.length - 1;
while (i >= 0) {
torch.splice(i, 1);
i--;
}
i = torchTimer.length - 1;
while (i >= 0) {
torchTimer.splice(i, 1);
i--;
}
i = alive.length - 1;
while (i >= 0) {
alive.splice(i, 1);
i--;
}
}
stop();
hud.ac.gotoAndStop("blah");
_global.goToTitle = false;
_global.levelDone = false;
ingame = true;
gasp_sound = new Sound();
gasp_sound.attachSound("gasp");
die_sound = new Sound();
die_sound.attachSound("dieSound");
player._x = startPoint._x;
player._y = startPoint._y;
cam._xscale = 100;
cam._yscale = 100;
hitPlayer = 0;
hitTimer = 0;
health = 100;
running = false;
gravity = 0;
gravityaccel = 0.3;
xaccel = 0;
runaccelamt = 0.3;
friction = 0.5;
airrisist = 0.05;
maxaccel = 5;
maxjump = 3;
eating = false;
eatingTimer = 0;
inControl = true;
doubleJump = false;
doubleJumping = false;
jump = true;
sneaking = false;
pressOnce = 0;
walkingThroughDoor = false;
walkingThroughDoorTimer = 0;
dying = false;
dyingTimer = 0;
crouch = false;
invisible = false;
power = 100;
cam.lens._xscale = 100;
cam.lens._yscale = 100;
timeSpentWalkingThroughDoor = 25;
timeSpentTurningToDust = 40;
timeSpentEating = 40;
timeItTakesToGetOutTorch = 15;
timeSpentShiningTorch = 80;
walkingSpeed = 1;
var human = new Array();
var heardSomething = new Array();
var heardSomethingTimer = new Array();
var torch = new Array();
var torchTimer = new Array();
var alive = new Array();
var walking = new Array();
var walkingDistance = new Array();
human.push(human_mc, human_mc11, human_mc2, human_mc6);
heardSomething.push(false, false, false, false);
heardSomethingTimer.push(0, 0, 0, 0);
torch.push(false, false, false, false);
torchTimer.push(0, 0, 0, 0);
alive.push(true, true, true, true);
walking.push(false, false, true, false);
walkingDistance.push(0, 0, 0, 0);
var light = new Array();
light.push(light1, light2, light3, light4, light5, light6, light7, light8, light9, light10, light11);
player.onEnterFrame = function () {
if (power < 1) {
invisible = false;
player._alpha = 100;
power = 0;
}
if ((!dying) && (!eating)) {
if (power > 0) {
if (Key.isDown(83)) {
power = power - 1;
invisible = true;
player._alpha = 30;
} else {
invisible = false;
player._alpha = 100;
}
}
}
if (hitPlayer == 0) {
myColor = new Color(player);
myColorTransform = new Object();
myColorTransform = {rb:0, gb:0, bb:0};
myColor.setTransform(myColorTransform);
}
if (hitPlayer == 1) {
myColor = new Color(player);
myColorTransform = new Object();
myColorTransform = {rb:100, gb:-50, bb:-50};
myColor.setTransform(myColorTransform);
hitTimer++;
if (hitTimer == 1) {
hitPlayer = 0;
hitTimer = 0;
}
}
i = light.length - 1;
while (i >= 0) {
if (player.hitMarker.hitTest(light[i])) {
if ((!dying) && (!invisible)) {
health = health - 3;
hitPlayer = 1;
}
}
i--;
}
if (health < 0) {
inControl = false;
dying = true;
power = 100;
health = 0;
}
if (dying) {
invisible = false;
player._alpha = 100;
xaccel = 0;
player.gotoAndStop("dead");
if (dyingTimer == 0) {
die_sound.start();
}
dyingTimer++;
if (dyingTimer == timeSpentTurningToDust) {
dyingTimer = 0;
dying = false;
inControl = true;
player._x = startPoint._x;
player._y = startPoint._y;
health = 100;
}
}
i = human.length - 1;
while (i >= 0) {
if (!alive[i]) {
if (walking[i]) {
human[i]._xscale = 100;
}
human[i].gotoAndStop("dead");
}
if (alive[i]) {
if (walking[i]) {
walkingDistance[i]++;
human[i].gotoAndStop("walk");
if (walkingDistance[i] == 180) {
walkingDistance[i] = 0;
}
if ((walkingDistance[i] > 0) && (walkingDistance[i] < 90)) {
human[i]._xscale = 100;
human[i]._x = human[i]._x - walkingSpeed;
}
if (walkingDistance[i] > 90) {
human[i]._xscale = -100;
human[i]._x = human[i]._x + walkingSpeed;
}
}
if (!walking[i]) {
if (torch[i]) {
torchTimer[i]++;
human[i].gotoAndStop("light");
if (torchTimer[i] == timeSpentShiningTorch) {
torch[i] = false;
torchTimer[i] = 0;
human[i].gotoAndStop("idle");
}
}
if (heardSomething[i]) {
if (heardSomethingTimer[i] == 0) {
gasp_sound.start();
}
heardSomethingTimer[i]++;
human[i].gotoAndStop("wtf");
if (heardSomethingTimer[i] == timeItTakesToGetOutTorch) {
heardSomethingTimer[i] = 0;
heardSomething[i] = false;
torch[i] = true;
}
}
}
if ((!dying) && (player.hitTest(human[i].hit))) {
alive[i] = false;
eating = true;
inControl = false;
}
if (player.hitMarker.hitTest(human[i].beam)) {
if ((!dying) && (!invisible)) {
health = health - 10;
hitPlayer = 1;
}
}
if (player.hitTest(human[i].zone)) {
if (!sneaking) {
if (!torch[i]) {
heardSomething[i] = true;
}
}
}
}
i--;
}
if (!jump) {
crouch = false;
}
if (inControl) {
if ((!running) && (jump)) {
if (Key.isDown(40)) {
maxaccel = 2;
crouch = true;
} else {
maxaccel = 5;
crouch = false;
}
}
}
if ((!jump) && (!crouch)) {
maxaccel = 5;
sneaking = false;
}
if (inControl) {
if (jump && (!crouch)) {
if (Key.isDown(65)) {
maxaccel = 1.6;
sneaking = true;
} else {
maxaccel = 5;
sneaking = false;
}
}
}
if (player.hitTest(door)) {
walkingThroughDoor = true;
xaccel = 0;
inControl = false;
player.gotoAndStop("throughDoor");
}
if (walkingThroughDoor) {
walkingThroughDoorTimer++;
if (walkingThroughDoorTimer == timeSpentWalkingThroughDoor) {
removeStuff();
hud.ac.gotoAndStop("areaComplete");
}
}
if (eating) {
invisible = false;
player._alpha = 100;
xaccel = 0;
player.gotoAndStop("feeding");
eatingTimer++;
if (eatingTimer == timeSpentEating) {
eating = false;
eatingTimer = 0;
inControl = true;
}
}
if (inControl) {
if (doubleJumping) {
player.gotoAndStop("double");
}
if (crouch && (!running)) {
player.gotoAndStop("crouch");
}
if (crouch && (running)) {
player.gotoAndStop("crouchWalk");
}
if (!crouch) {
if (!sneaking) {
if (jump && (!doubleJumping)) {
if (running) {
player.gotoAndStop("run");
} else {
player.gotoAndStop("idle");
}
} else if (!doubleJumping) {
player.gotoAndStop("jump");
}
}
if (sneaking) {
if (jump && (!doubleJumping)) {
if (running) {
player.gotoAndStop("sneak");
} else {
player.gotoAndStop("idle");
}
} else if (!doubleJumping) {
player.gotoAndStop("jump");
}
}
}
if (Key.isDown(39) or Key.isDown(37)) {
running = true;
} else {
running = false;
}
}
if (!ground.hitTest(player._x, player._y + 10, true)) {
falling = true;
grounded = false;
}
if (ground.hitTest(player._x, player._y + 11, true)) {
doubleJumping = false;
doubleJump = false;
jump = true;
grounded = true;
falling = false;
while (ground.hitTest(player._x, player._y + 9, true)) {
player._y--;
}
}
if (falling == true) {
gravity = gravity + gravityaccel;
} else {
gravity = 0;
}
if (inControl) {
if ((Key.isDown(39) && (xaccel < maxaccel)) && (falling == true)) {
xaccel = xaccel + (runaccelamt - airrisist);
} else if ((Key.isDown(37) && (xaccel > (-maxaccel))) && (falling == true)) {
xaccel = xaccel - (runaccelamt - airrisist);
} else if ((Key.isDown(37) && (xaccel > (-maxaccel))) && (falling == false)) {
xaccel = xaccel - runaccelamt;
} else if ((Key.isDown(39) && (xaccel < maxaccel)) && (falling == false)) {
xaccel = xaccel + runaccelamt;
} else if (grounded == true) {
if (xaccel > 0) {
xaccel = xaccel - friction;
}
if (xaccel < 0) {
xaccel = xaccel + friction;
}
if ((xaccel < 0) && (xaccel > friction)) {
xaccel = 0;
}
if ((xaccel > 0) && (xaccel < friction)) {
xaccel = 0;
}
} else {
if (xaccel > 0) {
xaccel = xaccel - airrisist;
}
if (xaccel < 0) {
xaccel = xaccel + airrisist;
}
if ((xaccel < 0) && (xaccel > airrisist)) {
xaccel = 0;
}
if ((xaccel > 0) && (xaccel < airrisist)) {
xaccel = 0;
}
}
}
if (_root.ground.hitTest(this._x, this._y - 11, true)) {
gravity = 1;
while (_root.ground.hitTest(this._x, this._y - 10, true)) {
this._y++;
}
}
if (xaccel > 0) {
player._xscale = 100;
}
if (xaccel < 0) {
player._xscale = -100;
}
if (!Key.isDown(38)) {
pressOnce = 0;
}
if (inControl) {
if (Key.isDown(38) && (jump == true)) {
gravity = gravity - (Math.cos(3.141593 * ((player._rotation * -1) / 180)) * maxjump);
jump = false;
doubleJump = true;
pressOnce = 1;
}
}
leftx = player._x + (Math.cos(3.141593 * (((player._rotation * -1) + 180) / 180)) * 7);
lefty = player._y - (Math.sin(3.141593 * (((player._rotation * -1) + 180) / 180)) * 500);
rightx = player._x + (Math.cos(3.141593 * ((player._rotation * -1) / 180)) * 7);
righty = player._y - (Math.sin(3.141593 * ((player._rotation * -1) / 180)) * 500);
if (ground.hitTest(leftx, lefty, true)) {
xaccel = 0;
player._x++;
}
if (ground.hitTest(rightx, righty, true)) {
xaccel = 0;
player._x--;
}
hud.whateverTheInvisibilityBarIsCalled._xscale = power;
hud.whateverTheHealthBarIsCalled._xscale = health;
if (ingame) {
cam._x = _root.player._x;
cam._y = _root.player._y - 30;
cam.camControl();
}
player._y = player._y + gravity;
player._x = player._x + xaccel;
hud._x = cam._x;
hud._y = cam._y;
hud._xscale = cam.lens._xscale;
hud._yscale = cam.lens._yscale;
if (_global.goToTitle) {
stopAllSounds();
removeStuff();
gotoAndStop ("title");
}
if (_global.levelDone) {
removeStuff();
nextFrame();
}
};
Frame 8
function removeStuff() {
i = light.length - 1;
while (i >= 0) {
light[i].removeMovieClip();
light.splice(i, 1);
i--;
}
i = human.length - 1;
while (i >= 0) {
human[i].removeMovieClip();
human.splice(i, 1);
i--;
}
i = walking.length - 1;
while (i >= 0) {
walking.splice(i, 1);
i--;
}
i = walkingDistance.length - 1;
while (i >= 0) {
walkingDistance.splice(i, 1);
i--;
}
i = heardSomething.length - 1;
while (i >= 0) {
heardSomething.splice(i, 1);
i--;
}
i = heardSomethingTimer.length - 1;
while (i >= 0) {
heardSomethingTimer.splice(i, 1);
i--;
}
i = torch.length - 1;
while (i >= 0) {
torch.splice(i, 1);
i--;
}
i = torchTimer.length - 1;
while (i >= 0) {
torchTimer.splice(i, 1);
i--;
}
i = alive.length - 1;
while (i >= 0) {
alive.splice(i, 1);
i--;
}
}
stop();
hud.ac.gotoAndStop("blah");
_global.goToTitle = false;
_global.levelDone = false;
ingame = true;
gasp_sound = new Sound();
gasp_sound.attachSound("gasp");
die_sound = new Sound();
die_sound.attachSound("dieSound");
player._x = startPoint._x;
player._y = startPoint._y;
cam._xscale = 100;
cam._yscale = 100;
hitPlayer = 0;
hitTimer = 0;
health = 100;
running = false;
gravity = 0;
gravityaccel = 0.3;
xaccel = 0;
runaccelamt = 0.3;
friction = 0.5;
airrisist = 0.05;
maxaccel = 5;
maxjump = 3;
eating = false;
eatingTimer = 0;
inControl = true;
doubleJump = false;
doubleJumping = false;
jump = true;
sneaking = false;
pressOnce = 0;
walkingThroughDoor = false;
walkingThroughDoorTimer = 0;
dying = false;
dyingTimer = 0;
crouch = false;
invisible = false;
power = 100;
cam.lens._xscale = 100;
cam.lens._yscale = 100;
timeSpentWalkingThroughDoor = 25;
timeSpentTurningToDust = 40;
timeSpentEating = 40;
timeItTakesToGetOutTorch = 15;
timeSpentShiningTorch = 80;
walkingSpeed = 1;
var human = new Array();
var heardSomething = new Array();
var heardSomethingTimer = new Array();
var torch = new Array();
var torchTimer = new Array();
var alive = new Array();
var walking = new Array();
var walkingDistance = new Array();
human.push(human_mc, human_mc1, human_mc2, human_mc3);
heardSomething.push(false, false, false, false);
heardSomethingTimer.push(0, 0, 0, 0);
torch.push(false, false, false, false);
torchTimer.push(0, 0, 0, 0);
alive.push(true, true, true, true);
walking.push(false, false, true, false);
walkingDistance.push(0, 0, 0, 0);
var light = new Array();
light.push(light1, light2, light3, light4, light5, light6, light7, light8, light9, light10, light11);
player.onEnterFrame = function () {
if (power < 1) {
invisible = false;
player._alpha = 100;
power = 0;
}
if ((!dying) && (!eating)) {
if (power > 0) {
if (Key.isDown(83)) {
power = power - 1;
invisible = true;
player._alpha = 30;
} else {
invisible = false;
player._alpha = 100;
}
}
}
if (hitPlayer == 0) {
myColor = new Color(player);
myColorTransform = new Object();
myColorTransform = {rb:0, gb:0, bb:0};
myColor.setTransform(myColorTransform);
}
if (hitPlayer == 1) {
myColor = new Color(player);
myColorTransform = new Object();
myColorTransform = {rb:100, gb:-50, bb:-50};
myColor.setTransform(myColorTransform);
hitTimer++;
if (hitTimer == 1) {
hitPlayer = 0;
hitTimer = 0;
}
}
i = light.length - 1;
while (i >= 0) {
if (player.hitMarker.hitTest(light[i])) {
if ((!dying) && (!invisible)) {
health = health - 3;
hitPlayer = 1;
}
}
i--;
}
if (health < 0) {
inControl = false;
dying = true;
power = 100;
health = 0;
}
if (dying) {
invisible = false;
player._alpha = 100;
xaccel = 0;
player.gotoAndStop("dead");
if (dyingTimer == 0) {
die_sound.start();
}
dyingTimer++;
if (dyingTimer == timeSpentTurningToDust) {
dyingTimer = 0;
dying = false;
inControl = true;
player._x = startPoint._x;
player._y = startPoint._y;
health = 100;
}
}
i = human.length - 1;
while (i >= 0) {
if (!alive[i]) {
if (walking[i]) {
human[i]._xscale = 100;
}
human[i].gotoAndStop("dead");
}
if (alive[i]) {
if (walking[i]) {
walkingDistance[i]++;
human[i].gotoAndStop("walk");
if (walkingDistance[i] == 180) {
walkingDistance[i] = 0;
}
if ((walkingDistance[i] > 0) && (walkingDistance[i] < 90)) {
human[i]._xscale = 100;
human[i]._x = human[i]._x - walkingSpeed;
}
if (walkingDistance[i] > 90) {
human[i]._xscale = -100;
human[i]._x = human[i]._x + walkingSpeed;
}
}
if (!walking[i]) {
if (torch[i]) {
torchTimer[i]++;
human[i].gotoAndStop("light");
if (torchTimer[i] == timeSpentShiningTorch) {
torch[i] = false;
torchTimer[i] = 0;
human[i].gotoAndStop("idle");
}
}
if (heardSomething[i]) {
if (heardSomethingTimer[i] == 0) {
gasp_sound.start();
}
heardSomethingTimer[i]++;
human[i].gotoAndStop("wtf");
if (heardSomethingTimer[i] == timeItTakesToGetOutTorch) {
heardSomethingTimer[i] = 0;
heardSomething[i] = false;
torch[i] = true;
}
}
}
if ((!dying) && (player.hitTest(human[i].hit))) {
alive[i] = false;
eating = true;
inControl = false;
}
if (player.hitMarker.hitTest(human[i].beam)) {
if ((!dying) && (!invisible)) {
health = health - 10;
hitPlayer = 1;
}
}
if (player.hitTest(human[i].zone)) {
if (!sneaking) {
if (!torch[i]) {
heardSomething[i] = true;
}
}
}
}
i--;
}
if (!jump) {
crouch = false;
}
if (inControl) {
if ((!running) && (jump)) {
if (Key.isDown(40)) {
maxaccel = 2;
crouch = true;
} else {
maxaccel = 5;
crouch = false;
}
}
}
if ((!jump) && (!crouch)) {
maxaccel = 5;
sneaking = false;
}
if (inControl) {
if (jump && (!crouch)) {
if (Key.isDown(65)) {
maxaccel = 1.6;
sneaking = true;
} else {
maxaccel = 5;
sneaking = false;
}
}
}
if (player.hitTest(door)) {
walkingThroughDoor = true;
xaccel = 0;
inControl = false;
player.gotoAndStop("throughDoor");
}
if (walkingThroughDoor) {
walkingThroughDoorTimer++;
if (walkingThroughDoorTimer == timeSpentWalkingThroughDoor) {
removeStuff();
hud.ac.gotoAndStop("areaComplete");
ingame = false;
}
}
if (eating) {
invisible = false;
player._alpha = 100;
xaccel = 0;
player.gotoAndStop("feeding");
eatingTimer++;
if (eatingTimer == timeSpentEating) {
eating = false;
eatingTimer = 0;
inControl = true;
}
}
if (inControl) {
if (doubleJumping) {
player.gotoAndStop("double");
}
if (crouch && (!running)) {
player.gotoAndStop("crouch");
}
if (crouch && (running)) {
player.gotoAndStop("crouchWalk");
}
if (!crouch) {
if (!sneaking) {
if (jump && (!doubleJumping)) {
if (running) {
player.gotoAndStop("run");
} else {
player.gotoAndStop("idle");
}
} else if (!doubleJumping) {
player.gotoAndStop("jump");
}
}
if (sneaking) {
if (jump && (!doubleJumping)) {
if (running) {
player.gotoAndStop("sneak");
} else {
player.gotoAndStop("idle");
}
} else if (!doubleJumping) {
player.gotoAndStop("jump");
}
}
}
if (Key.isDown(39) or Key.isDown(37)) {
running = true;
} else {
running = false;
}
}
if (!ground.hitTest(player._x, player._y + 10, true)) {
falling = true;
grounded = false;
}
if (ground.hitTest(player._x, player._y + 11, true)) {
doubleJumping = false;
doubleJump = false;
jump = true;
grounded = true;
falling = false;
while (ground.hitTest(player._x, player._y + 9, true)) {
player._y--;
}
}
if (falling == true) {
gravity = gravity + gravityaccel;
} else {
gravity = 0;
}
if (inControl) {
if ((Key.isDown(39) && (xaccel < maxaccel)) && (falling == true)) {
xaccel = xaccel + (runaccelamt - airrisist);
} else if ((Key.isDown(37) && (xaccel > (-maxaccel))) && (falling == true)) {
xaccel = xaccel - (runaccelamt - airrisist);
} else if ((Key.isDown(37) && (xaccel > (-maxaccel))) && (falling == false)) {
xaccel = xaccel - runaccelamt;
} else if ((Key.isDown(39) && (xaccel < maxaccel)) && (falling == false)) {
xaccel = xaccel + runaccelamt;
} else if (grounded == true) {
if (xaccel > 0) {
xaccel = xaccel - friction;
}
if (xaccel < 0) {
xaccel = xaccel + friction;
}
if ((xaccel < 0) && (xaccel > friction)) {
xaccel = 0;
}
if ((xaccel > 0) && (xaccel < friction)) {
xaccel = 0;
}
} else {
if (xaccel > 0) {
xaccel = xaccel - airrisist;
}
if (xaccel < 0) {
xaccel = xaccel + airrisist;
}
if ((xaccel < 0) && (xaccel > airrisist)) {
xaccel = 0;
}
if ((xaccel > 0) && (xaccel < airrisist)) {
xaccel = 0;
}
}
}
if (_root.ground.hitTest(this._x, this._y - 11, true)) {
gravity = 1;
while (_root.ground.hitTest(this._x, this._y - 10, true)) {
this._y++;
}
}
if (xaccel > 0) {
player._xscale = 100;
}
if (xaccel < 0) {
player._xscale = -100;
}
if (!Key.isDown(38)) {
pressOnce = 0;
}
if (inControl) {
if (Key.isDown(38) && (jump == true)) {
gravity = gravity - (Math.cos(3.141593 * ((player._rotation * -1) / 180)) * maxjump);
jump = false;
doubleJump = true;
pressOnce = 1;
}
}
leftx = player._x + (Math.cos(3.141593 * (((player._rotation * -1) + 180) / 180)) * 7);
lefty = player._y - (Math.sin(3.141593 * (((player._rotation * -1) + 180) / 180)) * 500);
rightx = player._x + (Math.cos(3.141593 * ((player._rotation * -1) / 180)) * 7);
righty = player._y - (Math.sin(3.141593 * ((player._rotation * -1) / 180)) * 500);
if (ground.hitTest(leftx, lefty, true)) {
xaccel = 0;
player._x++;
}
if (ground.hitTest(rightx, righty, true)) {
xaccel = 0;
player._x--;
}
hud.whateverTheInvisibilityBarIsCalled._xscale = power;
hud.whateverTheHealthBarIsCalled._xscale = health;
if (ingame) {
cam._x = _root.player._x;
cam._y = _root.player._y - 30;
cam.camControl();
}
player._y = player._y + gravity;
player._x = player._x + xaccel;
hud._x = cam._x;
hud._y = cam._y;
hud._xscale = cam.lens._xscale;
hud._yscale = cam.lens._yscale;
if (_global.goToTitle) {
stopAllSounds();
removeStuff();
gotoAndStop ("title");
}
if (_global.levelDone) {
removeStuff();
nextFrame();
}
};
Frame 9
cam._x = csTest._x;
cam._y = csTest._y;
Frame 10
function removeStuff() {
i = light.length - 1;
while (i >= 0) {
light[i].removeMovieClip();
light.splice(i, 1);
i--;
}
i = human.length - 1;
while (i >= 0) {
human[i].removeMovieClip();
human.splice(i, 1);
i--;
}
i = walking.length - 1;
while (i >= 0) {
walking.splice(i, 1);
i--;
}
i = walkingDistance.length - 1;
while (i >= 0) {
walkingDistance.splice(i, 1);
i--;
}
i = heardSomething.length - 1;
while (i >= 0) {
heardSomething.splice(i, 1);
i--;
}
i = heardSomethingTimer.length - 1;
while (i >= 0) {
heardSomethingTimer.splice(i, 1);
i--;
}
i = torch.length - 1;
while (i >= 0) {
torch.splice(i, 1);
i--;
}
i = torchTimer.length - 1;
while (i >= 0) {
torchTimer.splice(i, 1);
i--;
}
i = alive.length - 1;
while (i >= 0) {
alive.splice(i, 1);
i--;
}
}
stop();
hud.ac.gotoAndStop("blah");
_global.goToTitle = false;
_global.levelDone = false;
ingame = true;
gasp_sound = new Sound();
gasp_sound.attachSound("gasp");
die_sound = new Sound();
die_sound.attachSound("dieSound");
player._x = startPoint._x;
player._y = startPoint._y;
cam._xscale = 100;
cam._yscale = 100;
hitPlayer = 0;
hitTimer = 0;
health = 100;
running = false;
gravity = 0;
gravityaccel = 0.3;
xaccel = 0;
runaccelamt = 0.3;
friction = 0.5;
airrisist = 0.05;
maxaccel = 5;
maxjump = 3;
eating = false;
eatingTimer = 0;
inControl = true;
doubleJump = false;
doubleJumping = false;
jump = true;
sneaking = false;
pressOnce = 0;
walkingThroughDoor = false;
walkingThroughDoorTimer = 0;
dying = false;
dyingTimer = 0;
crouch = false;
invisible = false;
power = 100;
cam.lens._xscale = 100;
cam.lens._yscale = 100;
timeSpentWalkingThroughDoor = 25;
timeSpentTurningToDust = 40;
timeSpentEating = 40;
timeItTakesToGetOutTorch = 15;
timeSpentShiningTorch = 80;
walkingSpeed = 1;
var human = new Array();
var heardSomething = new Array();
var heardSomethingTimer = new Array();
var torch = new Array();
var torchTimer = new Array();
var alive = new Array();
var walking = new Array();
var walkingDistance = new Array();
human.push(human_mc, human_mc7, human_mc2, human_mc6);
heardSomething.push(false, false, false, false);
heardSomethingTimer.push(0, 0, 0, 0);
torch.push(false, false, false, false);
torchTimer.push(0, 0, 0, 0);
alive.push(true, true, true, true);
walking.push(false, false, true, false);
walkingDistance.push(0, 0, 0, 0);
var light = new Array();
light.push(light1, light2, light3, light4, light5, light6, light7, light8, light9, light10, light11);
player.onEnterFrame = function () {
if (power < 1) {
invisible = false;
player._alpha = 100;
power = 0;
}
if ((!dying) && (!eating)) {
if (power > 0) {
if (Key.isDown(83)) {
power = power - 1;
invisible = true;
player._alpha = 30;
} else {
invisible = false;
player._alpha = 100;
}
}
}
if (hitPlayer == 0) {
myColor = new Color(player);
myColorTransform = new Object();
myColorTransform = {rb:0, gb:0, bb:0};
myColor.setTransform(myColorTransform);
}
if (hitPlayer == 1) {
myColor = new Color(player);
myColorTransform = new Object();
myColorTransform = {rb:100, gb:-50, bb:-50};
myColor.setTransform(myColorTransform);
hitTimer++;
if (hitTimer == 1) {
hitPlayer = 0;
hitTimer = 0;
}
}
i = light.length - 1;
while (i >= 0) {
if (player.hitMarker.hitTest(light[i])) {
if ((!dying) && (!invisible)) {
health = health - 3;
hitPlayer = 1;
}
}
i--;
}
if (health < 0) {
inControl = false;
dying = true;
power = 100;
health = 0;
}
if (dying) {
invisible = false;
player._alpha = 100;
xaccel = 0;
player.gotoAndStop("dead");
if (dyingTimer == 0) {
die_sound.start();
}
dyingTimer++;
if (dyingTimer == timeSpentTurningToDust) {
dyingTimer = 0;
dying = false;
inControl = true;
player._x = startPoint._x;
player._y = startPoint._y;
health = 100;
}
}
i = human.length - 1;
while (i >= 0) {
if (!alive[i]) {
if (walking[i]) {
human[i]._xscale = 100;
}
human[i].gotoAndStop("dead");
}
if (alive[i]) {
if (walking[i]) {
walkingDistance[i]++;
human[i].gotoAndStop("walk");
if (walkingDistance[i] == 180) {
walkingDistance[i] = 0;
}
if ((walkingDistance[i] > 0) && (walkingDistance[i] < 90)) {
human[i]._xscale = 100;
human[i]._x = human[i]._x - walkingSpeed;
}
if (walkingDistance[i] > 90) {
human[i]._xscale = -100;
human[i]._x = human[i]._x + walkingSpeed;
}
}
if (!walking[i]) {
if (torch[i]) {
torchTimer[i]++;
human[i].gotoAndStop("light");
if (torchTimer[i] == timeSpentShiningTorch) {
torch[i] = false;
torchTimer[i] = 0;
human[i].gotoAndStop("idle");
}
}
if (heardSomething[i]) {
if (heardSomethingTimer[i] == 0) {
gasp_sound.start();
}
heardSomethingTimer[i]++;
human[i].gotoAndStop("wtf");
if (heardSomethingTimer[i] == timeItTakesToGetOutTorch) {
heardSomethingTimer[i] = 0;
heardSomething[i] = false;
torch[i] = true;
}
}
}
if ((!dying) && (player.hitTest(human[i].hit))) {
alive[i] = false;
eating = true;
inControl = false;
}
if (player.hitMarker.hitTest(human[i].beam)) {
if ((!dying) && (!invisible)) {
health = health - 10;
hitPlayer = 1;
}
}
if (player.hitTest(human[i].zone)) {
if (!sneaking) {
if (!torch[i]) {
heardSomething[i] = true;
}
}
}
}
i--;
}
if (!jump) {
crouch = false;
}
if (inControl) {
if ((!running) && (jump)) {
if (Key.isDown(40)) {
maxaccel = 2;
crouch = true;
} else {
maxaccel = 5;
crouch = false;
}
}
}
if ((!jump) && (!crouch)) {
maxaccel = 5;
sneaking = false;
}
if (inControl) {
if (jump && (!crouch)) {
if (Key.isDown(65)) {
maxaccel = 1.6;
sneaking = true;
} else {
maxaccel = 5;
sneaking = false;
}
}
}
if (player.hitTest(door)) {
walkingThroughDoor = true;
xaccel = 0;
inControl = false;
player.gotoAndStop("throughDoor");
}
if (walkingThroughDoor) {
walkingThroughDoorTimer++;
if (walkingThroughDoorTimer == timeSpentWalkingThroughDoor) {
removeStuff();
hud.ac.gotoAndStop("areaComplete");
}
}
if (eating) {
invisible = false;
player._alpha = 100;
xaccel = 0;
player.gotoAndStop("feeding");
eatingTimer++;
if (eatingTimer == timeSpentEating) {
eating = false;
eatingTimer = 0;
inControl = true;
}
}
if (inControl) {
if (doubleJumping) {
player.gotoAndStop("double");
}
if (crouch && (!running)) {
player.gotoAndStop("crouch");
}
if (crouch && (running)) {
player.gotoAndStop("crouchWalk");
}
if (!crouch) {
if (!sneaking) {
if (jump && (!doubleJumping)) {
if (running) {
player.gotoAndStop("run");
} else {
player.gotoAndStop("idle");
}
} else if (!doubleJumping) {
player.gotoAndStop("jump");
}
}
if (sneaking) {
if (jump && (!doubleJumping)) {
if (running) {
player.gotoAndStop("sneak");
} else {
player.gotoAndStop("idle");
}
} else if (!doubleJumping) {
player.gotoAndStop("jump");
}
}
}
if (Key.isDown(39) or Key.isDown(37)) {
running = true;
} else {
running = false;
}
}
if (!ground.hitTest(player._x, player._y + 10, true)) {
falling = true;
grounded = false;
}
if (ground.hitTest(player._x, player._y + 11, true)) {
doubleJumping = false;
doubleJump = false;
jump = true;
grounded = true;
falling = false;
while (ground.hitTest(player._x, player._y + 9, true)) {
player._y--;
}
}
if (falling == true) {
gravity = gravity + gravityaccel;
} else {
gravity = 0;
}
if (inControl) {
if ((Key.isDown(39) && (xaccel < maxaccel)) && (falling == true)) {
xaccel = xaccel + (runaccelamt - airrisist);
} else if ((Key.isDown(37) && (xaccel > (-maxaccel))) && (falling == true)) {
xaccel = xaccel - (runaccelamt - airrisist);
} else if ((Key.isDown(37) && (xaccel > (-maxaccel))) && (falling == false)) {
xaccel = xaccel - runaccelamt;
} else if ((Key.isDown(39) && (xaccel < maxaccel)) && (falling == false)) {
xaccel = xaccel + runaccelamt;
} else if (grounded == true) {
if (xaccel > 0) {
xaccel = xaccel - friction;
}
if (xaccel < 0) {
xaccel = xaccel + friction;
}
if ((xaccel < 0) && (xaccel > friction)) {
xaccel = 0;
}
if ((xaccel > 0) && (xaccel < friction)) {
xaccel = 0;
}
} else {
if (xaccel > 0) {
xaccel = xaccel - airrisist;
}
if (xaccel < 0) {
xaccel = xaccel + airrisist;
}
if ((xaccel < 0) && (xaccel > airrisist)) {
xaccel = 0;
}
if ((xaccel > 0) && (xaccel < airrisist)) {
xaccel = 0;
}
}
}
if (_root.ground.hitTest(this._x, this._y - 11, true)) {
gravity = 1;
while (_root.ground.hitTest(this._x, this._y - 10, true)) {
this._y++;
}
}
if (xaccel > 0) {
player._xscale = 100;
}
if (xaccel < 0) {
player._xscale = -100;
}
if (!Key.isDown(38)) {
pressOnce = 0;
}
if (inControl) {
if (Key.isDown(38) && (jump == true)) {
gravity = gravity - (Math.cos(3.141593 * ((player._rotation * -1) / 180)) * maxjump);
jump = false;
doubleJump = true;
pressOnce = 1;
}
}
leftx = player._x + (Math.cos(3.141593 * (((player._rotation * -1) + 180) / 180)) * 7);
lefty = player._y - (Math.sin(3.141593 * (((player._rotation * -1) + 180) / 180)) * 500);
rightx = player._x + (Math.cos(3.141593 * ((player._rotation * -1) / 180)) * 7);
righty = player._y - (Math.sin(3.141593 * ((player._rotation * -1) / 180)) * 500);
if (ground.hitTest(leftx, lefty, true)) {
xaccel = 0;
player._x++;
}
if (ground.hitTest(rightx, righty, true)) {
xaccel = 0;
player._x--;
}
hud.whateverTheInvisibilityBarIsCalled._xscale = power;
hud.whateverTheHealthBarIsCalled._xscale = health;
if (ingame) {
cam._x = _root.player._x;
cam._y = _root.player._y - 30;
cam.camControl();
}
player._y = player._y + gravity;
player._x = player._x + xaccel;
hud._x = cam._x;
hud._y = cam._y;
hud._xscale = cam.lens._xscale;
hud._yscale = cam.lens._yscale;
if (_global.goToTitle) {
stopAllSounds();
removeStuff();
gotoAndStop ("title");
}
if (_global.levelDone) {
removeStuff();
nextFrame();
}
};
Frame 11
function removeStuff() {
i = light.length - 1;
while (i >= 0) {
light[i].removeMovieClip();
light.splice(i, 1);
i--;
}
i = human.length - 1;
while (i >= 0) {
human[i].removeMovieClip();
human.splice(i, 1);
i--;
}
i = walking.length - 1;
while (i >= 0) {
walking.splice(i, 1);
i--;
}
i = walkingDistance.length - 1;
while (i >= 0) {
walkingDistance.splice(i, 1);
i--;
}
i = heardSomething.length - 1;
while (i >= 0) {
heardSomething.splice(i, 1);
i--;
}
i = heardSomethingTimer.length - 1;
while (i >= 0) {
heardSomethingTimer.splice(i, 1);
i--;
}
i = torch.length - 1;
while (i >= 0) {
torch.splice(i, 1);
i--;
}
i = torchTimer.length - 1;
while (i >= 0) {
torchTimer.splice(i, 1);
i--;
}
i = alive.length - 1;
while (i >= 0) {
alive.splice(i, 1);
i--;
}
}
stop();
hud.ac.gotoAndStop("blah");
_global.goToTitle = false;
_global.levelDone = false;
ingame = true;
gasp_sound = new Sound();
gasp_sound.attachSound("gasp");
die_sound = new Sound();
die_sound.attachSound("dieSound");
player._x = startPoint._x;
player._y = startPoint._y;
cam._xscale = 100;
cam._yscale = 100;
hitPlayer = 0;
hitTimer = 0;
health = 100;
running = false;
gravity = 0;
gravityaccel = 0.3;
xaccel = 0;
runaccelamt = 0.3;
friction = 0.5;
airrisist = 0.05;
maxaccel = 5;
maxjump = 3;
eating = false;
eatingTimer = 0;
inControl = true;
doubleJump = false;
doubleJumping = false;
jump = true;
sneaking = false;
pressOnce = 0;
walkingThroughDoor = false;
walkingThroughDoorTimer = 0;
dying = false;
dyingTimer = 0;
crouch = false;
invisible = false;
power = 100;
cam.lens._xscale = 100;
cam.lens._yscale = 100;
timeSpentWalkingThroughDoor = 25;
timeSpentTurningToDust = 40;
timeSpentEating = 40;
timeItTakesToGetOutTorch = 15;
timeSpentShiningTorch = 80;
walkingSpeed = 1;
var human = new Array();
var heardSomething = new Array();
var heardSomethingTimer = new Array();
var torch = new Array();
var torchTimer = new Array();
var alive = new Array();
var walking = new Array();
var walkingDistance = new Array();
human.push(human_mc, human_mc1, human_mc2, human_mc4, human_mc5);
heardSomething.push(false, false, false, false, false);
heardSomethingTimer.push(0, 0, 0, 0, 0);
torch.push(false, false, false, false, false);
torchTimer.push(0, 0, 0, 0, 0);
alive.push(true, true, true, true, true);
walking.push(false, false, true, false, false);
walkingDistance.push(0, 0, 0, 0, 0);
var light = new Array();
light.push(light1, light2, light3, light4, light5, light6, light7, light8, light9, light10, light11);
player.onEnterFrame = function () {
if (power < 1) {
invisible = false;
player._alpha = 100;
power = 0;
}
if ((!dying) && (!eating)) {
if (power > 0) {
if (Key.isDown(83)) {
power = power - 1;
invisible = true;
player._alpha = 30;
} else {
invisible = false;
player._alpha = 100;
}
}
}
if (hitPlayer == 0) {
myColor = new Color(player);
myColorTransform = new Object();
myColorTransform = {rb:0, gb:0, bb:0};
myColor.setTransform(myColorTransform);
}
if (hitPlayer == 1) {
myColor = new Color(player);
myColorTransform = new Object();
myColorTransform = {rb:100, gb:-50, bb:-50};
myColor.setTransform(myColorTransform);
hitTimer++;
if (hitTimer == 1) {
hitPlayer = 0;
hitTimer = 0;
}
}
i = light.length - 1;
while (i >= 0) {
if (player.hitMarker.hitTest(light[i])) {
if ((!dying) && (!invisible)) {
health = health - 3;
hitPlayer = 1;
}
}
i--;
}
if (health < 0) {
inControl = false;
dying = true;
power = 100;
health = 0;
}
if (dying) {
invisible = false;
player._alpha = 100;
xaccel = 0;
player.gotoAndStop("dead");
if (dyingTimer == 0) {
die_sound.start();
}
dyingTimer++;
if (dyingTimer == timeSpentTurningToDust) {
dyingTimer = 0;
dying = false;
inControl = true;
player._x = startPoint._x;
player._y = startPoint._y;
health = 100;
}
}
i = human.length - 1;
while (i >= 0) {
if (!alive[i]) {
if (walking[i]) {
human[i]._xscale = 100;
}
human[i].gotoAndStop("dead");
}
if (alive[i]) {
if (walking[i]) {
walkingDistance[i]++;
human[i].gotoAndStop("walk");
if (walkingDistance[i] == 180) {
walkingDistance[i] = 0;
}
if ((walkingDistance[i] > 0) && (walkingDistance[i] < 90)) {
human[i]._xscale = 100;
human[i]._x = human[i]._x - walkingSpeed;
}
if (walkingDistance[i] > 90) {
human[i]._xscale = -100;
human[i]._x = human[i]._x + walkingSpeed;
}
}
if (!walking[i]) {
if (torch[i]) {
torchTimer[i]++;
human[i].gotoAndStop("light");
if (torchTimer[i] == timeSpentShiningTorch) {
torch[i] = false;
torchTimer[i] = 0;
human[i].gotoAndStop("idle");
}
}
if (heardSomething[i]) {
if (heardSomethingTimer[i] == 0) {
gasp_sound.start();
}
heardSomethingTimer[i]++;
human[i].gotoAndStop("wtf");
if (heardSomethingTimer[i] == timeItTakesToGetOutTorch) {
heardSomethingTimer[i] = 0;
heardSomething[i] = false;
torch[i] = true;
}
}
}
if ((!dying) && (player.hitTest(human[i].hit))) {
alive[i] = false;
eating = true;
inControl = false;
}
if (player.hitMarker.hitTest(human[i].beam)) {
if ((!dying) && (!invisible)) {
health = health - 10;
hitPlayer = 1;
}
}
if (player.hitTest(human[i].zone)) {
if (!sneaking) {
if (!torch[i]) {
heardSomething[i] = true;
}
}
}
}
i--;
}
if (!jump) {
crouch = false;
}
if (inControl) {
if ((!running) && (jump)) {
if (Key.isDown(40)) {
maxaccel = 2;
crouch = true;
} else {
maxaccel = 5;
crouch = false;
}
}
}
if ((!jump) && (!crouch)) {
maxaccel = 5;
sneaking = false;
}
if (inControl) {
if (jump && (!crouch)) {
if (Key.isDown(65)) {
maxaccel = 1.6;
sneaking = true;
} else {
maxaccel = 5;
sneaking = false;
}
}
}
if (player.hitTest(door)) {
walkingThroughDoor = true;
xaccel = 0;
inControl = false;
player.gotoAndStop("throughDoor");
}
if (walkingThroughDoor) {
walkingThroughDoorTimer++;
if (walkingThroughDoorTimer == timeSpentWalkingThroughDoor) {
removeStuff();
hud.ac.gotoAndStop("areaComplete");
}
}
if (eating) {
invisible = false;
player._alpha = 100;
xaccel = 0;
player.gotoAndStop("feeding");
eatingTimer++;
if (eatingTimer == timeSpentEating) {
eating = false;
eatingTimer = 0;
inControl = true;
}
}
if (inControl) {
if (doubleJumping) {
player.gotoAndStop("double");
}
if (crouch && (!running)) {
player.gotoAndStop("crouch");
}
if (crouch && (running)) {
player.gotoAndStop("crouchWalk");
}
if (!crouch) {
if (!sneaking) {
if (jump && (!doubleJumping)) {
if (running) {
player.gotoAndStop("run");
} else {
player.gotoAndStop("idle");
}
} else if (!doubleJumping) {
player.gotoAndStop("jump");
}
}
if (sneaking) {
if (jump && (!doubleJumping)) {
if (running) {
player.gotoAndStop("sneak");
} else {
player.gotoAndStop("idle");
}
} else if (!doubleJumping) {
player.gotoAndStop("jump");
}
}
}
if (Key.isDown(39) or Key.isDown(37)) {
running = true;
} else {
running = false;
}
}
if (!ground.hitTest(player._x, player._y + 10, true)) {
falling = true;
grounded = false;
}
if (ground.hitTest(player._x, player._y + 11, true)) {
doubleJumping = false;
doubleJump = false;
jump = true;
grounded = true;
falling = false;
while (ground.hitTest(player._x, player._y + 9, true)) {
player._y--;
}
}
if (falling == true) {
gravity = gravity + gravityaccel;
} else {
gravity = 0;
}
if (inControl) {
if ((Key.isDown(39) && (xaccel < maxaccel)) && (falling == true)) {
xaccel = xaccel + (runaccelamt - airrisist);
} else if ((Key.isDown(37) && (xaccel > (-maxaccel))) && (falling == true)) {
xaccel = xaccel - (runaccelamt - airrisist);
} else if ((Key.isDown(37) && (xaccel > (-maxaccel))) && (falling == false)) {
xaccel = xaccel - runaccelamt;
} else if ((Key.isDown(39) && (xaccel < maxaccel)) && (falling == false)) {
xaccel = xaccel + runaccelamt;
} else if (grounded == true) {
if (xaccel > 0) {
xaccel = xaccel - friction;
}
if (xaccel < 0) {
xaccel = xaccel + friction;
}
if ((xaccel < 0) && (xaccel > friction)) {
xaccel = 0;
}
if ((xaccel > 0) && (xaccel < friction)) {
xaccel = 0;
}
} else {
if (xaccel > 0) {
xaccel = xaccel - airrisist;
}
if (xaccel < 0) {
xaccel = xaccel + airrisist;
}
if ((xaccel < 0) && (xaccel > airrisist)) {
xaccel = 0;
}
if ((xaccel > 0) && (xaccel < airrisist)) {
xaccel = 0;
}
}
}
if (_root.ground.hitTest(this._x, this._y - 11, true)) {
gravity = 1;
while (_root.ground.hitTest(this._x, this._y - 10, true)) {
this._y++;
}
}
if (xaccel > 0) {
player._xscale = 100;
}
if (xaccel < 0) {
player._xscale = -100;
}
if (!Key.isDown(38)) {
pressOnce = 0;
}
if (inControl) {
if (Key.isDown(38) && (jump == true)) {
gravity = gravity - (Math.cos(3.141593 * ((player._rotation * -1) / 180)) * maxjump);
jump = false;
doubleJump = true;
pressOnce = 1;
}
}
leftx = player._x + (Math.cos(3.141593 * (((player._rotation * -1) + 180) / 180)) * 7);
lefty = player._y - (Math.sin(3.141593 * (((player._rotation * -1) + 180) / 180)) * 500);
rightx = player._x + (Math.cos(3.141593 * ((player._rotation * -1) / 180)) * 7);
righty = player._y - (Math.sin(3.141593 * ((player._rotation * -1) / 180)) * 500);
if (ground.hitTest(leftx, lefty, true)) {
xaccel = 0;
player._x++;
}
if (ground.hitTest(rightx, righty, true)) {
xaccel = 0;
player._x--;
}
hud.whateverTheInvisibilityBarIsCalled._xscale = power;
hud.whateverTheHealthBarIsCalled._xscale = health;
if (ingame) {
cam._x = _root.player._x;
cam._y = _root.player._y - 30;
cam.camControl();
}
player._y = player._y + gravity;
player._x = player._x + xaccel;
hud._x = cam._x;
hud._y = cam._y;
hud._xscale = cam.lens._xscale;
hud._yscale = cam.lens._yscale;
if (_global.goToTitle) {
stopAllSounds();
removeStuff();
gotoAndStop ("title");
}
if (_global.levelDone) {
removeStuff();
nextFrame();
}
};
Frame 12
function removeStuff() {
i = light.length - 1;
while (i >= 0) {
light[i].removeMovieClip();
light.splice(i, 1);
i--;
}
i = human.length - 1;
while (i >= 0) {
human[i].removeMovieClip();
human.splice(i, 1);
i--;
}
i = walking.length - 1;
while (i >= 0) {
walking.splice(i, 1);
i--;
}
i = walkingDistance.length - 1;
while (i >= 0) {
walkingDistance.splice(i, 1);
i--;
}
i = heardSomething.length - 1;
while (i >= 0) {
heardSomething.splice(i, 1);
i--;
}
i = heardSomethingTimer.length - 1;
while (i >= 0) {
heardSomethingTimer.splice(i, 1);
i--;
}
i = torch.length - 1;
while (i >= 0) {
torch.splice(i, 1);
i--;
}
i = torchTimer.length - 1;
while (i >= 0) {
torchTimer.splice(i, 1);
i--;
}
i = alive.length - 1;
while (i >= 0) {
alive.splice(i, 1);
i--;
}
}
stop();
hud.ac.gotoAndStop("blah");
_global.goToTitle = false;
_global.levelDone = false;
ingame = true;
gasp_sound = new Sound();
gasp_sound.attachSound("gasp");
die_sound = new Sound();
die_sound.attachSound("dieSound");
player._x = startPoint._x;
player._y = startPoint._y;
cam._xscale = 100;
cam._yscale = 100;
hitPlayer = 0;
hitTimer = 0;
health = 100;
running = false;
gravity = 0;
gravityaccel = 0.3;
xaccel = 0;
runaccelamt = 0.3;
friction = 0.5;
airrisist = 0.05;
maxaccel = 5;
maxjump = 3;
eating = false;
eatingTimer = 0;
inControl = true;
doubleJump = false;
doubleJumping = false;
jump = true;
sneaking = false;
pressOnce = 0;
walkingThroughDoor = false;
walkingThroughDoorTimer = 0;
dying = false;
dyingTimer = 0;
crouch = false;
invisible = false;
power = 100;
cam.lens._xscale = 100;
cam.lens._yscale = 100;
timeSpentWalkingThroughDoor = 25;
timeSpentTurningToDust = 40;
timeSpentEating = 40;
timeItTakesToGetOutTorch = 15;
timeSpentShiningTorch = 80;
walkingSpeed = 1;
var human = new Array();
var heardSomething = new Array();
var heardSomethingTimer = new Array();
var torch = new Array();
var torchTimer = new Array();
var alive = new Array();
var walking = new Array();
var walkingDistance = new Array();
human.push(human_mc, human_mc1, human_mc10, human_mc4, human_mc5);
heardSomething.push(false, false, false, false, false);
heardSomethingTimer.push(0, 0, 0, 0, 0);
torch.push(false, false, false, false, false);
torchTimer.push(0, 0, 0, 0, 0);
alive.push(true, true, true, true, true);
walking.push(false, false, true, false, false);
walkingDistance.push(0, 0, 0, 0, 0);
var light = new Array();
light.push(light1, light2, light3, light4, light5, light6, light7, light8, light9, light10, light11);
player.onEnterFrame = function () {
if (power < 1) {
invisible = false;
player._alpha = 100;
power = 0;
}
if ((!dying) && (!eating)) {
if (power > 0) {
if (Key.isDown(83)) {
power = power - 1;
invisible = true;
player._alpha = 30;
} else {
invisible = false;
player._alpha = 100;
}
}
}
if (hitPlayer == 0) {
myColor = new Color(player);
myColorTransform = new Object();
myColorTransform = {rb:0, gb:0, bb:0};
myColor.setTransform(myColorTransform);
}
if (hitPlayer == 1) {
myColor = new Color(player);
myColorTransform = new Object();
myColorTransform = {rb:100, gb:-50, bb:-50};
myColor.setTransform(myColorTransform);
hitTimer++;
if (hitTimer == 1) {
hitPlayer = 0;
hitTimer = 0;
}
}
i = light.length - 1;
while (i >= 0) {
if (player.hitMarker.hitTest(light[i])) {
if ((!dying) && (!invisible)) {
health = health - 3;
hitPlayer = 1;
}
}
i--;
}
if (health < 0) {
inControl = false;
dying = true;
power = 100;
health = 0;
}
if (dying) {
invisible = false;
player._alpha = 100;
xaccel = 0;
player.gotoAndStop("dead");
if (dyingTimer == 0) {
die_sound.start();
}
dyingTimer++;
if (dyingTimer == timeSpentTurningToDust) {
dyingTimer = 0;
dying = false;
inControl = true;
player._x = startPoint._x;
player._y = startPoint._y;
health = 100;
}
}
i = human.length - 1;
while (i >= 0) {
if (!alive[i]) {
if (walking[i]) {
human[i]._xscale = 100;
}
human[i].gotoAndStop("dead");
}
if (alive[i]) {
if (walking[i]) {
walkingDistance[i]++;
human[i].gotoAndStop("walk");
if (walkingDistance[i] == 180) {
walkingDistance[i] = 0;
}
if ((walkingDistance[i] > 0) && (walkingDistance[i] < 90)) {
human[i]._xscale = 100;
human[i]._x = human[i]._x - walkingSpeed;
}
if (walkingDistance[i] > 90) {
human[i]._xscale = -100;
human[i]._x = human[i]._x + walkingSpeed;
}
}
if (!walking[i]) {
if (torch[i]) {
torchTimer[i]++;
human[i].gotoAndStop("light");
if (torchTimer[i] == timeSpentShiningTorch) {
torch[i] = false;
torchTimer[i] = 0;
human[i].gotoAndStop("idle");
}
}
if (heardSomething[i]) {
if (heardSomethingTimer[i] == 0) {
gasp_sound.start();
}
heardSomethingTimer[i]++;
human[i].gotoAndStop("wtf");
if (heardSomethingTimer[i] == timeItTakesToGetOutTorch) {
heardSomethingTimer[i] = 0;
heardSomething[i] = false;
torch[i] = true;
}
}
}
if ((!dying) && (player.hitTest(human[i].hit))) {
alive[i] = false;
eating = true;
inControl = false;
}
if (player.hitMarker.hitTest(human[i].beam)) {
if ((!dying) && (!invisible)) {
health = health - 10;
hitPlayer = 1;
}
}
if (player.hitTest(human[i].zone)) {
if (!sneaking) {
if (!torch[i]) {
heardSomething[i] = true;
}
}
}
}
i--;
}
if (!jump) {
crouch = false;
}
if (inControl) {
if ((!running) && (jump)) {
if (Key.isDown(40)) {
maxaccel = 2;
crouch = true;
} else {
maxaccel = 5;
crouch = false;
}
}
}
if ((!jump) && (!crouch)) {
maxaccel = 5;
sneaking = false;
}
if (inControl) {
if (jump && (!crouch)) {
if (Key.isDown(65)) {
maxaccel = 1.6;
sneaking = true;
} else {
maxaccel = 5;
sneaking = false;
}
}
}
if (player.hitTest(door)) {
walkingThroughDoor = true;
xaccel = 0;
inControl = false;
player.gotoAndStop("throughDoor");
}
if (walkingThroughDoor) {
walkingThroughDoorTimer++;
if (walkingThroughDoorTimer == timeSpentWalkingThroughDoor) {
removeStuff();
hud.ac.gotoAndStop("areaComplete");
}
}
if (eating) {
invisible = false;
player._alpha = 100;
xaccel = 0;
player.gotoAndStop("feeding");
eatingTimer++;
if (eatingTimer == timeSpentEating) {
eating = false;
eatingTimer = 0;
inControl = true;
}
}
if (inControl) {
if (doubleJumping) {
player.gotoAndStop("double");
}
if (crouch && (!running)) {
player.gotoAndStop("crouch");
}
if (crouch && (running)) {
player.gotoAndStop("crouchWalk");
}
if (!crouch) {
if (!sneaking) {
if (jump && (!doubleJumping)) {
if (running) {
player.gotoAndStop("run");
} else {
player.gotoAndStop("idle");
}
} else if (!doubleJumping) {
player.gotoAndStop("jump");
}
}
if (sneaking) {
if (jump && (!doubleJumping)) {
if (running) {
player.gotoAndStop("sneak");
} else {
player.gotoAndStop("idle");
}
} else if (!doubleJumping) {
player.gotoAndStop("jump");
}
}
}
if (Key.isDown(39) or Key.isDown(37)) {
running = true;
} else {
running = false;
}
}
if (!ground.hitTest(player._x, player._y + 10, true)) {
falling = true;
grounded = false;
}
if (ground.hitTest(player._x, player._y + 11, true)) {
doubleJumping = false;
doubleJump = false;
jump = true;
grounded = true;
falling = false;
while (ground.hitTest(player._x, player._y + 9, true)) {
player._y--;
}
}
if (falling == true) {
gravity = gravity + gravityaccel;
} else {
gravity = 0;
}
if (inControl) {
if ((Key.isDown(39) && (xaccel < maxaccel)) && (falling == true)) {
xaccel = xaccel + (runaccelamt - airrisist);
} else if ((Key.isDown(37) && (xaccel > (-maxaccel))) && (falling == true)) {
xaccel = xaccel - (runaccelamt - airrisist);
} else if ((Key.isDown(37) && (xaccel > (-maxaccel))) && (falling == false)) {
xaccel = xaccel - runaccelamt;
} else if ((Key.isDown(39) && (xaccel < maxaccel)) && (falling == false)) {
xaccel = xaccel + runaccelamt;
} else if (grounded == true) {
if (xaccel > 0) {
xaccel = xaccel - friction;
}
if (xaccel < 0) {
xaccel = xaccel + friction;
}
if ((xaccel < 0) && (xaccel > friction)) {
xaccel = 0;
}
if ((xaccel > 0) && (xaccel < friction)) {
xaccel = 0;
}
} else {
if (xaccel > 0) {
xaccel = xaccel - airrisist;
}
if (xaccel < 0) {
xaccel = xaccel + airrisist;
}
if ((xaccel < 0) && (xaccel > airrisist)) {
xaccel = 0;
}
if ((xaccel > 0) && (xaccel < airrisist)) {
xaccel = 0;
}
}
}
if (_root.ground.hitTest(this._x, this._y - 11, true)) {
gravity = 1;
while (_root.ground.hitTest(this._x, this._y - 10, true)) {
this._y++;
}
}
if (xaccel > 0) {
player._xscale = 100;
}
if (xaccel < 0) {
player._xscale = -100;
}
if (!Key.isDown(38)) {
pressOnce = 0;
}
if (inControl) {
if (Key.isDown(38) && (jump == true)) {
gravity = gravity - (Math.cos(3.141593 * ((player._rotation * -1) / 180)) * maxjump);
jump = false;
doubleJump = true;
pressOnce = 1;
}
}
leftx = player._x + (Math.cos(3.141593 * (((player._rotation * -1) + 180) / 180)) * 7);
lefty = player._y - (Math.sin(3.141593 * (((player._rotation * -1) + 180) / 180)) * 500);
rightx = player._x + (Math.cos(3.141593 * ((player._rotation * -1) / 180)) * 7);
righty = player._y - (Math.sin(3.141593 * ((player._rotation * -1) / 180)) * 500);
if (ground.hitTest(leftx, lefty, true)) {
xaccel = 0;
player._x++;
}
if (ground.hitTest(rightx, righty, true)) {
xaccel = 0;
player._x--;
}
hud.whateverTheInvisibilityBarIsCalled._xscale = power;
hud.whateverTheHealthBarIsCalled._xscale = health;
if (ingame) {
cam._x = _root.player._x;
cam._y = _root.player._y - 30;
cam.camControl();
}
player._y = player._y + gravity;
player._x = player._x + xaccel;
hud._x = cam._x;
hud._y = cam._y;
hud._xscale = cam.lens._xscale;
hud._yscale = cam.lens._yscale;
if (_global.goToTitle) {
stopAllSounds();
removeStuff();
gotoAndStop ("title");
}
if (_global.levelDone) {
removeStuff();
nextFrame();
}
};
Frame 13
cam._x = csTest._x;
cam._y = csTest._y;
Frame 14
function removeStuff() {
i = light.length - 1;
while (i >= 0) {
light[i].removeMovieClip();
light.splice(i, 1);
i--;
}
i = human.length - 1;
while (i >= 0) {
human[i].removeMovieClip();
human.splice(i, 1);
i--;
}
i = walking.length - 1;
while (i >= 0) {
walking.splice(i, 1);
i--;
}
i = walkingDistance.length - 1;
while (i >= 0) {
walkingDistance.splice(i, 1);
i--;
}
i = heardSomething.length - 1;
while (i >= 0) {
heardSomething.splice(i, 1);
i--;
}
i = heardSomethingTimer.length - 1;
while (i >= 0) {
heardSomethingTimer.splice(i, 1);
i--;
}
i = torch.length - 1;
while (i >= 0) {
torch.splice(i, 1);
i--;
}
i = torchTimer.length - 1;
while (i >= 0) {
torchTimer.splice(i, 1);
i--;
}
i = alive.length - 1;
while (i >= 0) {
alive.splice(i, 1);
i--;
}
}
stop();
hud.ac.gotoAndStop("blah");
_global.goToTitle = false;
_global.levelDone = false;
ingame = true;
gasp_sound = new Sound();
gasp_sound.attachSound("gasp");
die_sound = new Sound();
die_sound.attachSound("dieSound");
player._x = startPoint._x;
player._y = startPoint._y;
cam._xscale = 100;
cam._yscale = 100;
hitPlayer = 0;
hitTimer = 0;
health = 100;
running = false;
gravity = 0;
gravityaccel = 0.3;
xaccel = 0;
runaccelamt = 0.3;
friction = 0.5;
airrisist = 0.05;
maxaccel = 5;
maxjump = 3;
eating = false;
eatingTimer = 0;
inControl = true;
doubleJump = false;
doubleJumping = false;
jump = true;
sneaking = false;
pressOnce = 0;
walkingThroughDoor = false;
walkingThroughDoorTimer = 0;
dying = false;
dyingTimer = 0;
crouch = false;
invisible = false;
power = 100;
cam.lens._xscale = 100;
cam.lens._yscale = 100;
timeSpentWalkingThroughDoor = 25;
timeSpentTurningToDust = 40;
timeSpentEating = 40;
timeItTakesToGetOutTorch = 15;
timeSpentShiningTorch = 80;
walkingSpeed = 1;
var human = new Array();
var heardSomething = new Array();
var heardSomethingTimer = new Array();
var torch = new Array();
var torchTimer = new Array();
var alive = new Array();
var walking = new Array();
var walkingDistance = new Array();
human.push(human_mc, human_mc1, human_mc11, human_mc4, human_mc5);
heardSomething.push(false, false, false, false, false);
heardSomethingTimer.push(0, 0, 0, 0, 0);
torch.push(false, false, false, false, false);
torchTimer.push(0, 0, 0, 0, 0);
alive.push(true, true, true, true, true);
walking.push(false, false, true, false, false);
walkingDistance.push(0, 0, 0, 0, 0);
var light = new Array();
light.push(light1, light2, light3, light4, light5, light6, light7, light8, light9, light10, light11);
player.onEnterFrame = function () {
if (power < 1) {
invisible = false;
player._alpha = 100;
power = 0;
}
if ((!dying) && (!eating)) {
if (power > 0) {
if (Key.isDown(83)) {
power = power - 1;
invisible = true;
player._alpha = 30;
} else {
invisible = false;
player._alpha = 100;
}
}
}
if (hitPlayer == 0) {
myColor = new Color(player);
myColorTransform = new Object();
myColorTransform = {rb:0, gb:0, bb:0};
myColor.setTransform(myColorTransform);
}
if (hitPlayer == 1) {
myColor = new Color(player);
myColorTransform = new Object();
myColorTransform = {rb:100, gb:-50, bb:-50};
myColor.setTransform(myColorTransform);
hitTimer++;
if (hitTimer == 1) {
hitPlayer = 0;
hitTimer = 0;
}
}
i = light.length - 1;
while (i >= 0) {
if (player.hitMarker.hitTest(light[i])) {
if ((!dying) && (!invisible)) {
health = health - 3;
hitPlayer = 1;
}
}
i--;
}
if (health < 0) {
inControl = false;
dying = true;
power = 100;
health = 0;
}
if (dying) {
invisible = false;
player._alpha = 100;
xaccel = 0;
player.gotoAndStop("dead");
if (dyingTimer == 0) {
die_sound.start();
}
dyingTimer++;
if (dyingTimer == timeSpentTurningToDust) {
dyingTimer = 0;
dying = false;
inControl = true;
player._x = startPoint._x;
player._y = startPoint._y;
health = 100;
}
}
i = human.length - 1;
while (i >= 0) {
if (!alive[i]) {
if (walking[i]) {
human[i]._xscale = 100;
}
human[i].gotoAndStop("dead");
}
if (alive[i]) {
if (walking[i]) {
walkingDistance[i]++;
human[i].gotoAndStop("walk");
if (walkingDistance[i] == 180) {
walkingDistance[i] = 0;
}
if ((walkingDistance[i] > 0) && (walkingDistance[i] < 90)) {
human[i]._xscale = 100;
human[i]._x = human[i]._x - walkingSpeed;
}
if (walkingDistance[i] > 90) {
human[i]._xscale = -100;
human[i]._x = human[i]._x + walkingSpeed;
}
}
if (!walking[i]) {
if (torch[i]) {
torchTimer[i]++;
human[i].gotoAndStop("light");
if (torchTimer[i] == timeSpentShiningTorch) {
torch[i] = false;
torchTimer[i] = 0;
human[i].gotoAndStop("idle");
}
}
if (heardSomething[i]) {
if (heardSomethingTimer[i] == 0) {
gasp_sound.start();
}
heardSomethingTimer[i]++;
human[i].gotoAndStop("wtf");
if (heardSomethingTimer[i] == timeItTakesToGetOutTorch) {
heardSomethingTimer[i] = 0;
heardSomething[i] = false;
torch[i] = true;
}
}
}
if ((!dying) && (player.hitTest(human[i].hit))) {
alive[i] = false;
eating = true;
inControl = false;
}
if (player.hitMarker.hitTest(human[i].beam)) {
if ((!dying) && (!invisible)) {
health = health - 10;
hitPlayer = 1;
}
}
if (player.hitTest(human[i].zone)) {
if (!sneaking) {
if (!torch[i]) {
heardSomething[i] = true;
}
}
}
}
i--;
}
if (!jump) {
crouch = false;
}
if (inControl) {
if ((!running) && (jump)) {
if (Key.isDown(40)) {
maxaccel = 2;
crouch = true;
} else {
maxaccel = 5;
crouch = false;
}
}
}
if ((!jump) && (!crouch)) {
maxaccel = 5;
sneaking = false;
}
if (inControl) {
if (jump && (!crouch)) {
if (Key.isDown(65)) {
maxaccel = 1.6;
sneaking = true;
} else {
maxaccel = 5;
sneaking = false;
}
}
}
if (player.hitTest(door)) {
walkingThroughDoor = true;
xaccel = 0;
inControl = false;
player.gotoAndStop("throughDoor");
}
if (walkingThroughDoor) {
walkingThroughDoorTimer++;
if (walkingThroughDoorTimer == timeSpentWalkingThroughDoor) {
removeStuff();
hud.ac.gotoAndStop("areaComplete");
}
}
if (eating) {
invisible = false;
player._alpha = 100;
xaccel = 0;
player.gotoAndStop("feeding");
eatingTimer++;
if (eatingTimer == timeSpentEating) {
eating = false;
eatingTimer = 0;
inControl = true;
}
}
if (inControl) {
if (doubleJumping) {
player.gotoAndStop("double");
}
if (crouch && (!running)) {
player.gotoAndStop("crouch");
}
if (crouch && (running)) {
player.gotoAndStop("crouchWalk");
}
if (!crouch) {
if (!sneaking) {
if (jump && (!doubleJumping)) {
if (running) {
player.gotoAndStop("run");
} else {
player.gotoAndStop("idle");
}
} else if (!doubleJumping) {
player.gotoAndStop("jump");
}
}
if (sneaking) {
if (jump && (!doubleJumping)) {
if (running) {
player.gotoAndStop("sneak");
} else {
player.gotoAndStop("idle");
}
} else if (!doubleJumping) {
player.gotoAndStop("jump");
}
}
}
if (Key.isDown(39) or Key.isDown(37)) {
running = true;
} else {
running = false;
}
}
if (!ground.hitTest(player._x, player._y + 10, true)) {
falling = true;
grounded = false;
}
if (ground.hitTest(player._x, player._y + 11, true)) {
doubleJumping = false;
doubleJump = false;
jump = true;
grounded = true;
falling = false;
while (ground.hitTest(player._x, player._y + 9, true)) {
player._y--;
}
}
if (falling == true) {
gravity = gravity + gravityaccel;
} else {
gravity = 0;
}
if (inControl) {
if ((Key.isDown(39) && (xaccel < maxaccel)) && (falling == true)) {
xaccel = xaccel + (runaccelamt - airrisist);
} else if ((Key.isDown(37) && (xaccel > (-maxaccel))) && (falling == true)) {
xaccel = xaccel - (runaccelamt - airrisist);
} else if ((Key.isDown(37) && (xaccel > (-maxaccel))) && (falling == false)) {
xaccel = xaccel - runaccelamt;
} else if ((Key.isDown(39) && (xaccel < maxaccel)) && (falling == false)) {
xaccel = xaccel + runaccelamt;
} else if (grounded == true) {
if (xaccel > 0) {
xaccel = xaccel - friction;
}
if (xaccel < 0) {
xaccel = xaccel + friction;
}
if ((xaccel < 0) && (xaccel > friction)) {
xaccel = 0;
}
if ((xaccel > 0) && (xaccel < friction)) {
xaccel = 0;
}
} else {
if (xaccel > 0) {
xaccel = xaccel - airrisist;
}
if (xaccel < 0) {
xaccel = xaccel + airrisist;
}
if ((xaccel < 0) && (xaccel > airrisist)) {
xaccel = 0;
}
if ((xaccel > 0) && (xaccel < airrisist)) {
xaccel = 0;
}
}
}
if (_root.ground.hitTest(this._x, this._y - 11, true)) {
gravity = 1;
while (_root.ground.hitTest(this._x, this._y - 10, true)) {
this._y++;
}
}
if (xaccel > 0) {
player._xscale = 100;
}
if (xaccel < 0) {
player._xscale = -100;
}
if (!Key.isDown(38)) {
pressOnce = 0;
}
if (inControl) {
if (Key.isDown(38) && (jump == true)) {
gravity = gravity - (Math.cos(3.141593 * ((player._rotation * -1) / 180)) * maxjump);
jump = false;
doubleJump = true;
pressOnce = 1;
}
}
leftx = player._x + (Math.cos(3.141593 * (((player._rotation * -1) + 180) / 180)) * 7);
lefty = player._y - (Math.sin(3.141593 * (((player._rotation * -1) + 180) / 180)) * 500);
rightx = player._x + (Math.cos(3.141593 * ((player._rotation * -1) / 180)) * 7);
righty = player._y - (Math.sin(3.141593 * ((player._rotation * -1) / 180)) * 500);
if (ground.hitTest(leftx, lefty, true)) {
xaccel = 0;
player._x++;
}
if (ground.hitTest(rightx, righty, true)) {
xaccel = 0;
player._x--;
}
hud.whateverTheInvisibilityBarIsCalled._xscale = power;
hud.whateverTheHealthBarIsCalled._xscale = health;
if (ingame) {
cam._x = _root.player._x;
cam._y = _root.player._y - 30;
cam.camControl();
}
player._y = player._y + gravity;
player._x = player._x + xaccel;
hud._x = cam._x;
hud._y = cam._y;
hud._xscale = cam.lens._xscale;
hud._yscale = cam.lens._yscale;
if (_global.goToTitle) {
stopAllSounds();
removeStuff();
gotoAndStop ("title");
}
if (_global.levelDone) {
removeStuff();
nextFrame();
}
};
Frame 15
function removeStuff() {
i = light.length - 1;
while (i >= 0) {
light[i].removeMovieClip();
light.splice(i, 1);
i--;
}
i = human.length - 1;
while (i >= 0) {
human[i].removeMovieClip();
human.splice(i, 1);
i--;
}
i = walking.length - 1;
while (i >= 0) {
walking.splice(i, 1);
i--;
}
i = walkingDistance.length - 1;
while (i >= 0) {
walkingDistance.splice(i, 1);
i--;
}
i = heardSomething.length - 1;
while (i >= 0) {
heardSomething.splice(i, 1);
i--;
}
i = heardSomethingTimer.length - 1;
while (i >= 0) {
heardSomethingTimer.splice(i, 1);
i--;
}
i = torch.length - 1;
while (i >= 0) {
torch.splice(i, 1);
i--;
}
i = torchTimer.length - 1;
while (i >= 0) {
torchTimer.splice(i, 1);
i--;
}
i = alive.length - 1;
while (i >= 0) {
alive.splice(i, 1);
i--;
}
}
stop();
hud.ac.gotoAndStop("blah");
_global.goToTitle = false;
_global.levelDone = false;
ingame = true;
gasp_sound = new Sound();
gasp_sound.attachSound("gasp");
die_sound = new Sound();
die_sound.attachSound("dieSound");
player._x = startPoint._x;
player._y = startPoint._y;
cam._xscale = 100;
cam._yscale = 100;
hitPlayer = 0;
hitTimer = 0;
health = 100;
running = false;
gravity = 0;
gravityaccel = 0.3;
xaccel = 0;
runaccelamt = 0.3;
friction = 0.5;
airrisist = 0.05;
maxaccel = 5;
maxjump = 3;
eating = false;
eatingTimer = 0;
inControl = true;
doubleJump = false;
doubleJumping = false;
jump = true;
sneaking = false;
pressOnce = 0;
walkingThroughDoor = false;
walkingThroughDoorTimer = 0;
dying = false;
dyingTimer = 0;
crouch = false;
invisible = false;
power = 100;
cam.lens._xscale = 100;
cam.lens._yscale = 100;
timeSpentWalkingThroughDoor = 25;
timeSpentTurningToDust = 40;
timeSpentEating = 40;
timeItTakesToGetOutTorch = 15;
timeSpentShiningTorch = 80;
walkingSpeed = 1;
var human = new Array();
var heardSomething = new Array();
var heardSomethingTimer = new Array();
var torch = new Array();
var torchTimer = new Array();
var alive = new Array();
var walking = new Array();
var walkingDistance = new Array();
human.push(human_mc, human_mc13, human_mc12, human_mc4, human_mc5);
heardSomething.push(false, false, false, false, false);
heardSomethingTimer.push(0, 0, 0, 0, 0);
torch.push(false, false, false, false, false);
torchTimer.push(0, 0, 0, 0, 0);
alive.push(true, true, true, true, true);
walking.push(false, false, true, false, false);
walkingDistance.push(0, 0, 0, 0, 0);
var light = new Array();
light.push(light1, light2, light3, light4, light5, light6, light7, light8, light9, light10, light11);
player.onEnterFrame = function () {
if (power < 1) {
invisible = false;
player._alpha = 100;
power = 0;
}
if ((!dying) && (!eating)) {
if (power > 0) {
if (Key.isDown(83)) {
power = power - 1;
invisible = true;
player._alpha = 30;
} else {
invisible = false;
player._alpha = 100;
}
}
}
if (hitPlayer == 0) {
myColor = new Color(player);
myColorTransform = new Object();
myColorTransform = {rb:0, gb:0, bb:0};
myColor.setTransform(myColorTransform);
}
if (hitPlayer == 1) {
myColor = new Color(player);
myColorTransform = new Object();
myColorTransform = {rb:100, gb:-50, bb:-50};
myColor.setTransform(myColorTransform);
hitTimer++;
if (hitTimer == 1) {
hitPlayer = 0;
hitTimer = 0;
}
}
i = light.length - 1;
while (i >= 0) {
if (player.hitMarker.hitTest(light[i])) {
if ((!dying) && (!invisible)) {
health = health - 3;
hitPlayer = 1;
}
}
i--;
}
if (health < 0) {
inControl = false;
dying = true;
power = 100;
health = 0;
}
if (dying) {
invisible = false;
player._alpha = 100;
xaccel = 0;
player.gotoAndStop("dead");
if (dyingTimer == 0) {
die_sound.start();
}
dyingTimer++;
if (dyingTimer == timeSpentTurningToDust) {
dyingTimer = 0;
dying = false;
inControl = true;
player._x = startPoint._x;
player._y = startPoint._y;
health = 100;
}
}
i = human.length - 1;
while (i >= 0) {
if (!alive[i]) {
if (walking[i]) {
human[i]._xscale = 100;
}
human[i].gotoAndStop("dead");
}
if (alive[i]) {
if (walking[i]) {
walkingDistance[i]++;
human[i].gotoAndStop("walk");
if (walkingDistance[i] == 180) {
walkingDistance[i] = 0;
}
if ((walkingDistance[i] > 0) && (walkingDistance[i] < 90)) {
human[i]._xscale = 100;
human[i]._x = human[i]._x - walkingSpeed;
}
if (walkingDistance[i] > 90) {
human[i]._xscale = -100;
human[i]._x = human[i]._x + walkingSpeed;
}
}
if (!walking[i]) {
if (torch[i]) {
torchTimer[i]++;
human[i].gotoAndStop("light");
if (torchTimer[i] == timeSpentShiningTorch) {
torch[i] = false;
torchTimer[i] = 0;
human[i].gotoAndStop("idle");
}
}
if (heardSomething[i]) {
if (heardSomethingTimer[i] == 0) {
gasp_sound.start();
}
heardSomethingTimer[i]++;
human[i].gotoAndStop("wtf");
if (heardSomethingTimer[i] == timeItTakesToGetOutTorch) {
heardSomethingTimer[i] = 0;
heardSomething[i] = false;
torch[i] = true;
}
}
}
if ((!dying) && (player.hitTest(human[i].hit))) {
alive[i] = false;
eating = true;
inControl = false;
}
if (player.hitMarker.hitTest(human[i].beam)) {
if ((!dying) && (!invisible)) {
health = health - 10;
hitPlayer = 1;
}
}
if (player.hitTest(human[i].zone)) {
if (!sneaking) {
if (!torch[i]) {
heardSomething[i] = true;
}
}
}
}
i--;
}
if (!jump) {
crouch = false;
}
if (inControl) {
if ((!running) && (jump)) {
if (Key.isDown(40)) {
maxaccel = 2;
crouch = true;
} else {
maxaccel = 5;
crouch = false;
}
}
}
if ((!jump) && (!crouch)) {
maxaccel = 5;
sneaking = false;
}
if (inControl) {
if (jump && (!crouch)) {
if (Key.isDown(65)) {
maxaccel = 1.6;
sneaking = true;
} else {
maxaccel = 5;
sneaking = false;
}
}
}
if (player.hitTest(door)) {
walkingThroughDoor = true;
xaccel = 0;
inControl = false;
player.gotoAndStop("throughDoor");
}
if (walkingThroughDoor) {
walkingThroughDoorTimer++;
if (walkingThroughDoorTimer == timeSpentWalkingThroughDoor) {
removeStuff();
hud.ac.gotoAndStop("areaComplete");
}
}
if (eating) {
invisible = false;
player._alpha = 100;
xaccel = 0;
player.gotoAndStop("feeding");
eatingTimer++;
if (eatingTimer == timeSpentEating) {
eating = false;
eatingTimer = 0;
inControl = true;
}
}
if (inControl) {
if (doubleJumping) {
player.gotoAndStop("double");
}
if (crouch && (!running)) {
player.gotoAndStop("crouch");
}
if (crouch && (running)) {
player.gotoAndStop("crouchWalk");
}
if (!crouch) {
if (!sneaking) {
if (jump && (!doubleJumping)) {
if (running) {
player.gotoAndStop("run");
} else {
player.gotoAndStop("idle");
}
} else if (!doubleJumping) {
player.gotoAndStop("jump");
}
}
if (sneaking) {
if (jump && (!doubleJumping)) {
if (running) {
player.gotoAndStop("sneak");
} else {
player.gotoAndStop("idle");
}
} else if (!doubleJumping) {
player.gotoAndStop("jump");
}
}
}
if (Key.isDown(39) or Key.isDown(37)) {
running = true;
} else {
running = false;
}
}
if (!ground.hitTest(player._x, player._y + 10, true)) {
falling = true;
grounded = false;
}
if (ground.hitTest(player._x, player._y + 11, true)) {
doubleJumping = false;
doubleJump = false;
jump = true;
grounded = true;
falling = false;
while (ground.hitTest(player._x, player._y + 9, true)) {
player._y--;
}
}
if (falling == true) {
gravity = gravity + gravityaccel;
} else {
gravity = 0;
}
if (inControl) {
if ((Key.isDown(39) && (xaccel < maxaccel)) && (falling == true)) {
xaccel = xaccel + (runaccelamt - airrisist);
} else if ((Key.isDown(37) && (xaccel > (-maxaccel))) && (falling == true)) {
xaccel = xaccel - (runaccelamt - airrisist);
} else if ((Key.isDown(37) && (xaccel > (-maxaccel))) && (falling == false)) {
xaccel = xaccel - runaccelamt;
} else if ((Key.isDown(39) && (xaccel < maxaccel)) && (falling == false)) {
xaccel = xaccel + runaccelamt;
} else if (grounded == true) {
if (xaccel > 0) {
xaccel = xaccel - friction;
}
if (xaccel < 0) {
xaccel = xaccel + friction;
}
if ((xaccel < 0) && (xaccel > friction)) {
xaccel = 0;
}
if ((xaccel > 0) && (xaccel < friction)) {
xaccel = 0;
}
} else {
if (xaccel > 0) {
xaccel = xaccel - airrisist;
}
if (xaccel < 0) {
xaccel = xaccel + airrisist;
}
if ((xaccel < 0) && (xaccel > airrisist)) {
xaccel = 0;
}
if ((xaccel > 0) && (xaccel < airrisist)) {
xaccel = 0;
}
}
}
if (_root.ground.hitTest(this._x, this._y - 11, true)) {
gravity = 1;
while (_root.ground.hitTest(this._x, this._y - 10, true)) {
this._y++;
}
}
if (xaccel > 0) {
player._xscale = 100;
}
if (xaccel < 0) {
player._xscale = -100;
}
if (!Key.isDown(38)) {
pressOnce = 0;
}
if (inControl) {
if (Key.isDown(38) && (jump == true)) {
gravity = gravity - (Math.cos(3.141593 * ((player._rotation * -1) / 180)) * maxjump);
jump = false;
doubleJump = true;
pressOnce = 1;
}
}
leftx = player._x + (Math.cos(3.141593 * (((player._rotation * -1) + 180) / 180)) * 7);
lefty = player._y - (Math.sin(3.141593 * (((player._rotation * -1) + 180) / 180)) * 500);
rightx = player._x + (Math.cos(3.141593 * ((player._rotation * -1) / 180)) * 7);
righty = player._y - (Math.sin(3.141593 * ((player._rotation * -1) / 180)) * 500);
if (ground.hitTest(leftx, lefty, true)) {
xaccel = 0;
player._x++;
}
if (ground.hitTest(rightx, righty, true)) {
xaccel = 0;
player._x--;
}
hud.whateverTheInvisibilityBarIsCalled._xscale = power;
hud.whateverTheHealthBarIsCalled._xscale = health;
if (ingame) {
cam._x = _root.player._x;
cam._y = _root.player._y - 30;
cam.camControl();
}
player._y = player._y + gravity;
player._x = player._x + xaccel;
hud._x = cam._x;
hud._y = cam._y;
hud._xscale = cam.lens._xscale;
hud._yscale = cam.lens._yscale;
if (_global.goToTitle) {
stopAllSounds();
removeStuff();
gotoAndStop ("title");
}
if (_global.levelDone) {
removeStuff();
nextFrame();
}
};
Frame 16
function removeStuff() {
i = light.length - 1;
while (i >= 0) {
light[i].removeMovieClip();
light.splice(i, 1);
i--;
}
i = human.length - 1;
while (i >= 0) {
human[i].removeMovieClip();
human.splice(i, 1);
i--;
}
i = walking.length - 1;
while (i >= 0) {
walking.splice(i, 1);
i--;
}
i = walkingDistance.length - 1;
while (i >= 0) {
walkingDistance.splice(i, 1);
i--;
}
i = heardSomething.length - 1;
while (i >= 0) {
heardSomething.splice(i, 1);
i--;
}
i = heardSomethingTimer.length - 1;
while (i >= 0) {
heardSomethingTimer.splice(i, 1);
i--;
}
i = torch.length - 1;
while (i >= 0) {
torch.splice(i, 1);
i--;
}
i = torchTimer.length - 1;
while (i >= 0) {
torchTimer.splice(i, 1);
i--;
}
i = alive.length - 1;
while (i >= 0) {
alive.splice(i, 1);
i--;
}
}
stop();
hud.ac.gotoAndStop("blah");
_global.goToTitle = false;
_global.levelDone = false;
ingame = true;
gasp_sound = new Sound();
gasp_sound.attachSound("gasp");
die_sound = new Sound();
die_sound.attachSound("dieSound");
player._x = startPoint._x;
player._y = startPoint._y;
cam._xscale = 100;
cam._yscale = 100;
hitPlayer = 0;
hitTimer = 0;
health = 100;
running = false;
gravity = 0;
gravityaccel = 0.3;
xaccel = 0;
runaccelamt = 0.3;
friction = 0.5;
airrisist = 0.05;
maxaccel = 5;
maxjump = 3;
eating = false;
eatingTimer = 0;
inControl = true;
doubleJump = false;
doubleJumping = false;
jump = true;
sneaking = false;
pressOnce = 0;
walkingThroughDoor = false;
walkingThroughDoorTimer = 0;
dying = false;
dyingTimer = 0;
crouch = false;
invisible = false;
power = 100;
cam.lens._xscale = 100;
cam.lens._yscale = 100;
timeSpentWalkingThroughDoor = 25;
timeSpentTurningToDust = 40;
timeSpentEating = 40;
timeItTakesToGetOutTorch = 15;
timeSpentShiningTorch = 80;
walkingSpeed = 1;
var human = new Array();
var heardSomething = new Array();
var heardSomethingTimer = new Array();
var torch = new Array();
var torchTimer = new Array();
var alive = new Array();
var walking = new Array();
var walkingDistance = new Array();
human.push(human_mc14, human_mc15, human_mc11, human_mc4, human_mc5);
heardSomething.push(false, false, false, false, false);
heardSomethingTimer.push(0, 0, 0, 0, 0);
torch.push(false, false, false, false, false);
torchTimer.push(0, 0, 0, 0, 0);
alive.push(true, true, true, true, true);
walking.push(false, false, true, false, false);
walkingDistance.push(0, 0, 0, 0, 0);
var light = new Array();
light.push(light1, light2, light3, light4, light5, light6, light7, light8, light9, light10, light11);
player.onEnterFrame = function () {
if (power < 1) {
invisible = false;
player._alpha = 100;
power = 0;
}
if ((!dying) && (!eating)) {
if (power > 0) {
if (Key.isDown(83)) {
power = power - 1;
invisible = true;
player._alpha = 30;
} else {
invisible = false;
player._alpha = 100;
}
}
}
if (hitPlayer == 0) {
myColor = new Color(player);
myColorTransform = new Object();
myColorTransform = {rb:0, gb:0, bb:0};
myColor.setTransform(myColorTransform);
}
if (hitPlayer == 1) {
myColor = new Color(player);
myColorTransform = new Object();
myColorTransform = {rb:100, gb:-50, bb:-50};
myColor.setTransform(myColorTransform);
hitTimer++;
if (hitTimer == 1) {
hitPlayer = 0;
hitTimer = 0;
}
}
i = light.length - 1;
while (i >= 0) {
if (player.hitMarker.hitTest(light[i])) {
if ((!dying) && (!invisible)) {
health = health - 3;
hitPlayer = 1;
}
}
i--;
}
if (health < 0) {
inControl = false;
dying = true;
power = 100;
health = 0;
}
if (dying) {
invisible = false;
player._alpha = 100;
xaccel = 0;
player.gotoAndStop("dead");
if (dyingTimer == 0) {
die_sound.start();
}
dyingTimer++;
if (dyingTimer == timeSpentTurningToDust) {
dyingTimer = 0;
dying = false;
inControl = true;
player._x = startPoint._x;
player._y = startPoint._y;
health = 100;
}
}
i = human.length - 1;
while (i >= 0) {
if (!alive[i]) {
if (walking[i]) {
human[i]._xscale = 100;
}
human[i].gotoAndStop("dead");
}
if (alive[i]) {
if (walking[i]) {
walkingDistance[i]++;
human[i].gotoAndStop("walk");
if (walkingDistance[i] == 180) {
walkingDistance[i] = 0;
}
if ((walkingDistance[i] > 0) && (walkingDistance[i] < 90)) {
human[i]._xscale = 100;
human[i]._x = human[i]._x - walkingSpeed;
}
if (walkingDistance[i] > 90) {
human[i]._xscale = -100;
human[i]._x = human[i]._x + walkingSpeed;
}
}
if (!walking[i]) {
if (torch[i]) {
torchTimer[i]++;
human[i].gotoAndStop("light");
if (torchTimer[i] == timeSpentShiningTorch) {
torch[i] = false;
torchTimer[i] = 0;
human[i].gotoAndStop("idle");
}
}
if (heardSomething[i]) {
if (heardSomethingTimer[i] == 0) {
gasp_sound.start();
}
heardSomethingTimer[i]++;
human[i].gotoAndStop("wtf");
if (heardSomethingTimer[i] == timeItTakesToGetOutTorch) {
heardSomethingTimer[i] = 0;
heardSomething[i] = false;
torch[i] = true;
}
}
}
if ((!dying) && (player.hitTest(human[i].hit))) {
alive[i] = false;
eating = true;
inControl = false;
}
if (player.hitMarker.hitTest(human[i].beam)) {
if ((!dying) && (!invisible)) {
health = health - 10;
hitPlayer = 1;
}
}
if (player.hitTest(human[i].zone)) {
if (!sneaking) {
if (!torch[i]) {
heardSomething[i] = true;
}
}
}
}
i--;
}
if (!jump) {
crouch = false;
}
if (inControl) {
if ((!running) && (jump)) {
if (Key.isDown(40)) {
maxaccel = 2;
crouch = true;
} else {
maxaccel = 5;
crouch = false;
}
}
}
if ((!jump) && (!crouch)) {
maxaccel = 5;
sneaking = false;
}
if (inControl) {
if (jump && (!crouch)) {
if (Key.isDown(65)) {
maxaccel = 1.6;
sneaking = true;
} else {
maxaccel = 5;
sneaking = false;
}
}
}
if (player.hitTest(door)) {
walkingThroughDoor = true;
xaccel = 0;
inControl = false;
player.gotoAndStop("throughDoor");
}
if (walkingThroughDoor) {
walkingThroughDoorTimer++;
if (walkingThroughDoorTimer == timeSpentWalkingThroughDoor) {
removeStuff();
hud.ac.gotoAndStop("areaComplete");
}
}
if (eating) {
invisible = false;
player._alpha = 100;
xaccel = 0;
player.gotoAndStop("feeding");
eatingTimer++;
if (eatingTimer == timeSpentEating) {
eating = false;
eatingTimer = 0;
inControl = true;
}
}
if (inControl) {
if (doubleJumping) {
player.gotoAndStop("double");
}
if (crouch && (!running)) {
player.gotoAndStop("crouch");
}
if (crouch && (running)) {
player.gotoAndStop("crouchWalk");
}
if (!crouch) {
if (!sneaking) {
if (jump && (!doubleJumping)) {
if (running) {
player.gotoAndStop("run");
} else {
player.gotoAndStop("idle");
}
} else if (!doubleJumping) {
player.gotoAndStop("jump");
}
}
if (sneaking) {
if (jump && (!doubleJumping)) {
if (running) {
player.gotoAndStop("sneak");
} else {
player.gotoAndStop("idle");
}
} else if (!doubleJumping) {
player.gotoAndStop("jump");
}
}
}
if (Key.isDown(39) or Key.isDown(37)) {
running = true;
} else {
running = false;
}
}
if (!ground.hitTest(player._x, player._y + 10, true)) {
falling = true;
grounded = false;
}
if (ground.hitTest(player._x, player._y + 11, true)) {
doubleJumping = false;
doubleJump = false;
jump = true;
grounded = true;
falling = false;
while (ground.hitTest(player._x, player._y + 9, true)) {
player._y--;
}
}
if (falling == true) {
gravity = gravity + gravityaccel;
} else {
gravity = 0;
}
if (inControl) {
if ((Key.isDown(39) && (xaccel < maxaccel)) && (falling == true)) {
xaccel = xaccel + (runaccelamt - airrisist);
} else if ((Key.isDown(37) && (xaccel > (-maxaccel))) && (falling == true)) {
xaccel = xaccel - (runaccelamt - airrisist);
} else if ((Key.isDown(37) && (xaccel > (-maxaccel))) && (falling == false)) {
xaccel = xaccel - runaccelamt;
} else if ((Key.isDown(39) && (xaccel < maxaccel)) && (falling == false)) {
xaccel = xaccel + runaccelamt;
} else if (grounded == true) {
if (xaccel > 0) {
xaccel = xaccel - friction;
}
if (xaccel < 0) {
xaccel = xaccel + friction;
}
if ((xaccel < 0) && (xaccel > friction)) {
xaccel = 0;
}
if ((xaccel > 0) && (xaccel < friction)) {
xaccel = 0;
}
} else {
if (xaccel > 0) {
xaccel = xaccel - airrisist;
}
if (xaccel < 0) {
xaccel = xaccel + airrisist;
}
if ((xaccel < 0) && (xaccel > airrisist)) {
xaccel = 0;
}
if ((xaccel > 0) && (xaccel < airrisist)) {
xaccel = 0;
}
}
}
if (_root.ground.hitTest(this._x, this._y - 11, true)) {
gravity = 1;
while (_root.ground.hitTest(this._x, this._y - 10, true)) {
this._y++;
}
}
if (xaccel > 0) {
player._xscale = 100;
}
if (xaccel < 0) {
player._xscale = -100;
}
if (!Key.isDown(38)) {
pressOnce = 0;
}
if (inControl) {
if (Key.isDown(38) && (jump == true)) {
gravity = gravity - (Math.cos(3.141593 * ((player._rotation * -1) / 180)) * maxjump);
jump = false;
doubleJump = true;
pressOnce = 1;
}
}
leftx = player._x + (Math.cos(3.141593 * (((player._rotation * -1) + 180) / 180)) * 7);
lefty = player._y - (Math.sin(3.141593 * (((player._rotation * -1) + 180) / 180)) * 500);
rightx = player._x + (Math.cos(3.141593 * ((player._rotation * -1) / 180)) * 7);
righty = player._y - (Math.sin(3.141593 * ((player._rotation * -1) / 180)) * 500);
if (ground.hitTest(leftx, lefty, true)) {
xaccel = 0;
player._x++;
}
if (ground.hitTest(rightx, righty, true)) {
xaccel = 0;
player._x--;
}
hud.whateverTheInvisibilityBarIsCalled._xscale = power;
hud.whateverTheHealthBarIsCalled._xscale = health;
if (ingame) {
cam._x = _root.player._x;
cam._y = _root.player._y - 30;
cam.camControl();
}
player._y = player._y + gravity;
player._x = player._x + xaccel;
hud._x = cam._x;
hud._y = cam._y;
hud._xscale = cam.lens._xscale;
hud._yscale = cam.lens._yscale;
if (_global.goToTitle) {
stopAllSounds();
removeStuff();
gotoAndStop ("title");
}
if (_global.levelDone) {
removeStuff();
nextFrame();
}
};
Frame 17
cam._x = csTest._x;
cam._y = csTest._y;
Frame 18
function removeStuff() {
i = light.length - 1;
while (i >= 0) {
light[i].removeMovieClip();
light.splice(i, 1);
i--;
}
i = human.length - 1;
while (i >= 0) {
human[i].removeMovieClip();
human.splice(i, 1);
i--;
}
i = walking.length - 1;
while (i >= 0) {
walking.splice(i, 1);
i--;
}
i = walkingDistance.length - 1;
while (i >= 0) {
walkingDistance.splice(i, 1);
i--;
}
i = heardSomething.length - 1;
while (i >= 0) {
heardSomething.splice(i, 1);
i--;
}
i = heardSomethingTimer.length - 1;
while (i >= 0) {
heardSomethingTimer.splice(i, 1);
i--;
}
i = torch.length - 1;
while (i >= 0) {
torch.splice(i, 1);
i--;
}
i = torchTimer.length - 1;
while (i >= 0) {
torchTimer.splice(i, 1);
i--;
}
i = alive.length - 1;
while (i >= 0) {
alive.splice(i, 1);
i--;
}
}
stop();
hud.ac.gotoAndStop("blah");
_global.goToTitle = false;
_global.levelDone = false;
ingame = true;
gasp_sound = new Sound();
gasp_sound.attachSound("gasp");
die_sound = new Sound();
die_sound.attachSound("dieSound");
player._x = startPoint._x;
player._y = startPoint._y;
cam._xscale = 100;
cam._yscale = 100;
hitPlayer = 0;
hitTimer = 0;
health = 100;
running = false;
gravity = 0;
gravityaccel = 0.3;
xaccel = 0;
runaccelamt = 0.3;
friction = 0.5;
airrisist = 0.05;
maxaccel = 5;
maxjump = 3;
eating = false;
eatingTimer = 0;
inControl = true;
doubleJump = false;
doubleJumping = false;
jump = true;
sneaking = false;
pressOnce = 0;
walkingThroughDoor = false;
walkingThroughDoorTimer = 0;
dying = false;
dyingTimer = 0;
crouch = false;
invisible = false;
power = 100;
cam.lens._xscale = 100;
cam.lens._yscale = 100;
timeSpentWalkingThroughDoor = 25;
timeSpentTurningToDust = 40;
timeSpentEating = 40;
timeItTakesToGetOutTorch = 32;
timeSpentShiningTorch = 80;
walkingSpeed = 2;
var human = new Array();
var heardSomething = new Array();
var heardSomethingTimer = new Array();
var torch = new Array();
var torchTimer = new Array();
var alive = new Array();
var walking = new Array();
var walkingDistance = new Array();
human.push(human_mc20, human_mc21, human_mc2);
heardSomething.push(false, false, false);
heardSomethingTimer.push(0, 0, 0);
torch.push(false, false, false);
torchTimer.push(0, 0, 0);
alive.push(true, true, true);
walking.push(false, false, true);
walkingDistance.push(0, 0, 0);
var light = new Array();
light.push(light1, light2, light3, light4, light5, light6, light7, light8, light9, light10, light11);
player.onEnterFrame = function () {
if (power < 1) {
invisible = false;
player._alpha = 100;
power = 0;
}
if ((!dying) && (!eating)) {
if (power > 0) {
if (Key.isDown(83)) {
power = power - 1;
invisible = true;
player._alpha = 30;
} else {
invisible = false;
player._alpha = 100;
}
}
}
if (hitPlayer == 0) {
myColor = new Color(player);
myColorTransform = new Object();
myColorTransform = {rb:0, gb:0, bb:0};
myColor.setTransform(myColorTransform);
}
if (hitPlayer == 1) {
myColor = new Color(player);
myColorTransform = new Object();
myColorTransform = {rb:100, gb:-50, bb:-50};
myColor.setTransform(myColorTransform);
hitTimer++;
if (hitTimer == 1) {
hitPlayer = 0;
hitTimer = 0;
}
}
i = light.length - 1;
while (i >= 0) {
if (player.hitMarker.hitTest(light[i])) {
if ((!dying) && (!invisible)) {
health = health - 5;
hitPlayer = 1;
}
}
i--;
}
if (health < 0) {
inControl = false;
dying = true;
power = 100;
health = 0;
}
if (dying) {
invisible = false;
player._alpha = 100;
xaccel = 0;
player.gotoAndStop("dead");
if (dyingTimer == 0) {
die_sound.start();
}
dyingTimer++;
if (dyingTimer == timeSpentTurningToDust) {
dyingTimer = 0;
dying = false;
inControl = true;
player._x = startPoint._x;
player._y = startPoint._y;
health = 100;
}
}
i = human.length - 1;
while (i >= 0) {
if (!alive[i]) {
if (walking[i]) {
human[i]._xscale = 100;
}
human[i].gotoAndStop("dead");
}
if (alive[i]) {
if (walking[i]) {
walkingDistance[i]++;
human[i].gotoAndStop("walk");
if (walkingDistance[i] == 80) {
walkingDistance[i] = 0;
}
if ((walkingDistance[i] > 0) && (walkingDistance[i] < 40)) {
human[i]._xscale = -100;
human[i]._x = human[i]._x - walkingSpeed;
}
if (walkingDistance[i] > 40) {
human[i]._xscale = 100;
human[i]._x = human[i]._x + walkingSpeed;
}
}
if (!walking[i]) {
if (torch[i]) {
torchTimer[i]++;
human[i].gotoAndStop("light");
if (torchTimer[i] == timeSpentShiningTorch) {
torch[i] = false;
torchTimer[i] = 0;
human[i].gotoAndStop("idle");
}
}
if (heardSomething[i]) {
if (heardSomethingTimer[i] == 0) {
gasp_sound.start();
}
heardSomethingTimer[i]++;
human[i].gotoAndStop("wtf");
if (heardSomethingTimer[i] == timeItTakesToGetOutTorch) {
heardSomethingTimer[i] = 0;
heardSomething[i] = false;
torch[i] = true;
}
}
}
if ((!dying) && (player.hitTest(human[i].hit))) {
alive[i] = false;
eating = true;
inControl = false;
}
if (player.hitMarker.hitTest(human[i].beam)) {
if ((!dying) && (!invisible)) {
health = health - 20;
hitPlayer = 1;
}
}
if (player.hitTest(human[i].zone)) {
if (!sneaking) {
if (!torch[i]) {
heardSomething[i] = true;
}
}
}
}
i--;
}
if (!jump) {
crouch = false;
}
if (inControl) {
if ((!running) && (jump)) {
if (Key.isDown(40)) {
maxaccel = 2;
crouch = true;
} else {
maxaccel = 5;
crouch = false;
}
}
}
if ((!jump) && (!crouch)) {
maxaccel = 5;
sneaking = false;
}
if (inControl) {
if (jump && (!crouch)) {
if (Key.isDown(65)) {
maxaccel = 1.6;
sneaking = true;
} else {
maxaccel = 5;
sneaking = false;
}
}
}
if (player.hitTest(door)) {
walkingThroughDoor = true;
xaccel = 0;
inControl = false;
player.gotoAndStop("throughDoor");
}
if (walkingThroughDoor) {
walkingThroughDoorTimer++;
if (walkingThroughDoorTimer == timeSpentWalkingThroughDoor) {
removeStuff();
hud.ac.gotoAndStop("areaComplete");
}
}
if (eating) {
invisible = false;
player._alpha = 100;
xaccel = 0;
player.gotoAndStop("feeding");
eatingTimer++;
if (eatingTimer == timeSpentEating) {
eating = false;
eatingTimer = 0;
inControl = true;
}
}
if (inControl) {
if (doubleJumping) {
player.gotoAndStop("double");
}
if (crouch && (!running)) {
player.gotoAndStop("crouch");
}
if (crouch && (running)) {
player.gotoAndStop("crouchWalk");
}
if (!crouch) {
if (!sneaking) {
if (jump && (!doubleJumping)) {
if (running) {
player.gotoAndStop("run");
} else {
player.gotoAndStop("idle");
}
} else if (!doubleJumping) {
player.gotoAndStop("jump");
}
}
if (sneaking) {
if (jump && (!doubleJumping)) {
if (running) {
player.gotoAndStop("sneak");
} else {
player.gotoAndStop("idle");
}
} else if (!doubleJumping) {
player.gotoAndStop("jump");
}
}
}
if (Key.isDown(39) or Key.isDown(37)) {
running = true;
} else {
running = false;
}
}
if (!ground.hitTest(player._x, player._y + 10, true)) {
falling = true;
grounded = false;
}
if (ground.hitTest(player._x, player._y + 11, true)) {
doubleJumping = false;
doubleJump = false;
jump = true;
grounded = true;
falling = false;
while (ground.hitTest(player._x, player._y + 9, true)) {
player._y--;
}
}
if (falling == true) {
gravity = gravity + gravityaccel;
} else {
gravity = 0;
}
if (inControl) {
if ((Key.isDown(39) && (xaccel < maxaccel)) && (falling == true)) {
xaccel = xaccel + (runaccelamt - airrisist);
} else if ((Key.isDown(37) && (xaccel > (-maxaccel))) && (falling == true)) {
xaccel = xaccel - (runaccelamt - airrisist);
} else if ((Key.isDown(37) && (xaccel > (-maxaccel))) && (falling == false)) {
xaccel = xaccel - runaccelamt;
} else if ((Key.isDown(39) && (xaccel < maxaccel)) && (falling == false)) {
xaccel = xaccel + runaccelamt;
} else if (grounded == true) {
if (xaccel > 0) {
xaccel = xaccel - friction;
}
if (xaccel < 0) {
xaccel = xaccel + friction;
}
if ((xaccel < 0) && (xaccel > friction)) {
xaccel = 0;
}
if ((xaccel > 0) && (xaccel < friction)) {
xaccel = 0;
}
} else {
if (xaccel > 0) {
xaccel = xaccel - airrisist;
}
if (xaccel < 0) {
xaccel = xaccel + airrisist;
}
if ((xaccel < 0) && (xaccel > airrisist)) {
xaccel = 0;
}
if ((xaccel > 0) && (xaccel < airrisist)) {
xaccel = 0;
}
}
}
if (_root.ground.hitTest(this._x, this._y - 11, true)) {
gravity = 1;
while (_root.ground.hitTest(this._x, this._y - 10, true)) {
this._y++;
}
}
if (xaccel > 0) {
player._xscale = 100;
}
if (xaccel < 0) {
player._xscale = -100;
}
if (!Key.isDown(38)) {
pressOnce = 0;
}
if (inControl) {
if (Key.isDown(38) && (jump == true)) {
gravity = gravity - (Math.cos(3.141593 * ((player._rotation * -1) / 180)) * maxjump);
jump = false;
doubleJump = true;
pressOnce = 1;
}
}
leftx = player._x + (Math.cos(3.141593 * (((player._rotation * -1) + 180) / 180)) * 7);
lefty = player._y - (Math.sin(3.141593 * (((player._rotation * -1) + 180) / 180)) * 500);
rightx = player._x + (Math.cos(3.141593 * ((player._rotation * -1) / 180)) * 7);
righty = player._y - (Math.sin(3.141593 * ((player._rotation * -1) / 180)) * 500);
if (ground.hitTest(leftx, lefty, true)) {
xaccel = 0;
player._x++;
}
if (ground.hitTest(rightx, righty, true)) {
xaccel = 0;
player._x--;
}
hud.whateverTheInvisibilityBarIsCalled._xscale = power;
hud.whateverTheHealthBarIsCalled._xscale = health;
if (ingame) {
cam._x = _root.player._x;
cam._y = _root.player._y - 30;
cam.camControl();
}
player._y = player._y + gravity;
player._x = player._x + xaccel;
hud._x = cam._x;
hud._y = cam._y;
hud._xscale = cam.lens._xscale;
hud._yscale = cam.lens._yscale;
if (_global.goToTitle) {
stopAllSounds();
removeStuff();
gotoAndStop ("title");
}
if (_global.levelDone) {
removeStuff();
nextFrame();
}
};
Frame 19
function removeStuff() {
i = light.length - 1;
while (i >= 0) {
light[i].removeMovieClip();
light.splice(i, 1);
i--;
}
i = human.length - 1;
while (i >= 0) {
human[i].removeMovieClip();
human.splice(i, 1);
i--;
}
i = walking.length - 1;
while (i >= 0) {
walking.splice(i, 1);
i--;
}
i = walkingDistance.length - 1;
while (i >= 0) {
walkingDistance.splice(i, 1);
i--;
}
i = heardSomething.length - 1;
while (i >= 0) {
heardSomething.splice(i, 1);
i--;
}
i = heardSomethingTimer.length - 1;
while (i >= 0) {
heardSomethingTimer.splice(i, 1);
i--;
}
i = torch.length - 1;
while (i >= 0) {
torch.splice(i, 1);
i--;
}
i = torchTimer.length - 1;
while (i >= 0) {
torchTimer.splice(i, 1);
i--;
}
i = alive.length - 1;
while (i >= 0) {
alive.splice(i, 1);
i--;
}
}
stop();
hud.ac.gotoAndStop("blah");
_global.goToTitle = false;
_global.levelDone = false;
ingame = true;
gasp_sound = new Sound();
gasp_sound.attachSound("gasp");
die_sound = new Sound();
die_sound.attachSound("dieSound");
player._x = startPoint._x;
player._y = startPoint._y;
cam._xscale = 100;
cam._yscale = 100;
hitPlayer = 0;
hitTimer = 0;
health = 100;
running = false;
gravity = 0;
gravityaccel = 0.3;
xaccel = 0;
runaccelamt = 0.3;
friction = 0.5;
airrisist = 0.05;
maxaccel = 5;
maxjump = 3;
eating = false;
eatingTimer = 0;
inControl = true;
doubleJump = false;
doubleJumping = false;
jump = true;
sneaking = false;
pressOnce = 0;
walkingThroughDoor = false;
walkingThroughDoorTimer = 0;
dying = false;
dyingTimer = 0;
crouch = false;
invisible = false;
power = 100;
cam.lens._xscale = 100;
cam.lens._yscale = 100;
timeSpentWalkingThroughDoor = 25;
timeSpentTurningToDust = 40;
timeSpentEating = 40;
timeItTakesToGetOutTorch = 15;
timeSpentShiningTorch = 80;
walkingSpeed = 1;
var human = new Array();
var heardSomething = new Array();
var heardSomethingTimer = new Array();
var torch = new Array();
var torchTimer = new Array();
var alive = new Array();
var walking = new Array();
var walkingDistance = new Array();
human.push(human_mc, human_mc221, human_mc2, human_mc26);
heardSomething.push(false, false, false, false);
heardSomethingTimer.push(0, 0, 0, 0);
torch.push(false, false, false, false);
torchTimer.push(0, 0, 0, 0);
alive.push(true, true, true, true);
walking.push(false, false, true, false);
walkingDistance.push(0, 0, 0, 0);
var light = new Array();
light.push(light1, light2, light3, light4, light5, light6, light7, light8, light9, light10, light11);
player.onEnterFrame = function () {
if (power < 1) {
invisible = false;
player._alpha = 100;
power = 0;
}
if ((!dying) && (!eating)) {
if (power > 0) {
if (Key.isDown(83)) {
power = power - 1;
invisible = true;
player._alpha = 30;
} else {
invisible = false;
player._alpha = 100;
}
}
}
if (hitPlayer == 0) {
myColor = new Color(player);
myColorTransform = new Object();
myColorTransform = {rb:0, gb:0, bb:0};
myColor.setTransform(myColorTransform);
}
if (hitPlayer == 1) {
myColor = new Color(player);
myColorTransform = new Object();
myColorTransform = {rb:100, gb:-50, bb:-50};
myColor.setTransform(myColorTransform);
hitTimer++;
if (hitTimer == 1) {
hitPlayer = 0;
hitTimer = 0;
}
}
i = light.length - 1;
while (i >= 0) {
if (player.hitMarker.hitTest(light[i])) {
if ((!dying) && (!invisible)) {
health = health - 5;
hitPlayer = 1;
}
}
i--;
}
if (health < 0) {
inControl = false;
dying = true;
power = 100;
health = 0;
}
if (dying) {
invisible = false;
player._alpha = 100;
xaccel = 0;
player.gotoAndStop("dead");
if (dyingTimer == 0) {
die_sound.start();
}
dyingTimer++;
if (dyingTimer == timeSpentTurningToDust) {
dyingTimer = 0;
dying = false;
inControl = true;
player._x = startPoint._x;
player._y = startPoint._y;
health = 100;
}
}
i = human.length - 1;
while (i >= 0) {
if (!alive[i]) {
if (walking[i]) {
human[i]._xscale = 100;
}
human[i].gotoAndStop("dead");
}
if (alive[i]) {
if (walking[i]) {
walkingDistance[i]++;
human[i].gotoAndStop("walk");
if (walkingDistance[i] == 180) {
walkingDistance[i] = 0;
}
if ((walkingDistance[i] > 0) && (walkingDistance[i] < 90)) {
human[i]._xscale = 100;
human[i]._x = human[i]._x - walkingSpeed;
}
if (walkingDistance[i] > 90) {
human[i]._xscale = -100;
human[i]._x = human[i]._x + walkingSpeed;
}
}
if (!walking[i]) {
if (torch[i]) {
torchTimer[i]++;
human[i].gotoAndStop("light");
if (torchTimer[i] == timeSpentShiningTorch) {
torch[i] = false;
torchTimer[i] = 0;
human[i].gotoAndStop("idle");
}
}
if (heardSomething[i]) {
if (heardSomethingTimer[i] == 0) {
gasp_sound.start();
}
heardSomethingTimer[i]++;
human[i].gotoAndStop("wtf");
if (heardSomethingTimer[i] == timeItTakesToGetOutTorch) {
heardSomethingTimer[i] = 0;
heardSomething[i] = false;
torch[i] = true;
}
}
}
if ((!dying) && (player.hitTest(human[i].hit))) {
alive[i] = false;
eating = true;
inControl = false;
}
if (player.hitMarker.hitTest(human[i].beam)) {
if ((!dying) && (!invisible)) {
health = health - 20;
hitPlayer = 1;
}
}
if (player.hitTest(human[i].zone)) {
if (!sneaking) {
if (!torch[i]) {
heardSomething[i] = true;
}
}
}
}
i--;
}
if (!jump) {
crouch = false;
}
if (inControl) {
if ((!running) && (jump)) {
if (Key.isDown(40)) {
maxaccel = 2;
crouch = true;
} else {
maxaccel = 5;
crouch = false;
}
}
}
if ((!jump) && (!crouch)) {
maxaccel = 5;
sneaking = false;
}
if (inControl) {
if (jump && (!crouch)) {
if (Key.isDown(65)) {
maxaccel = 1.6;
sneaking = true;
} else {
maxaccel = 5;
sneaking = false;
}
}
}
if (player.hitTest(door)) {
walkingThroughDoor = true;
xaccel = 0;
inControl = false;
player.gotoAndStop("throughDoor");
}
if (walkingThroughDoor) {
walkingThroughDoorTimer++;
if (walkingThroughDoorTimer == timeSpentWalkingThroughDoor) {
removeStuff();
hud.ac.gotoAndStop("areaComplete");
}
}
if (eating) {
invisible = false;
player._alpha = 100;
xaccel = 0;
player.gotoAndStop("feeding");
eatingTimer++;
if (eatingTimer == timeSpentEating) {
eating = false;
eatingTimer = 0;
inControl = true;
}
}
if (inControl) {
if (doubleJumping) {
player.gotoAndStop("double");
}
if (crouch && (!running)) {
player.gotoAndStop("crouch");
}
if (crouch && (running)) {
player.gotoAndStop("crouchWalk");
}
if (!crouch) {
if (!sneaking) {
if (jump && (!doubleJumping)) {
if (running) {
player.gotoAndStop("run");
} else {
player.gotoAndStop("idle");
}
} else if (!doubleJumping) {
player.gotoAndStop("jump");
}
}
if (sneaking) {
if (jump && (!doubleJumping)) {
if (running) {
player.gotoAndStop("sneak");
} else {
player.gotoAndStop("idle");
}
} else if (!doubleJumping) {
player.gotoAndStop("jump");
}
}
}
if (Key.isDown(39) or Key.isDown(37)) {
running = true;
} else {
running = false;
}
}
if (!ground.hitTest(player._x, player._y + 10, true)) {
falling = true;
grounded = false;
}
if (ground.hitTest(player._x, player._y + 11, true)) {
doubleJumping = false;
doubleJump = false;
jump = true;
grounded = true;
falling = false;
while (ground.hitTest(player._x, player._y + 9, true)) {
player._y--;
}
}
if (falling == true) {
gravity = gravity + gravityaccel;
} else {
gravity = 0;
}
if (inControl) {
if ((Key.isDown(39) && (xaccel < maxaccel)) && (falling == true)) {
xaccel = xaccel + (runaccelamt - airrisist);
} else if ((Key.isDown(37) && (xaccel > (-maxaccel))) && (falling == true)) {
xaccel = xaccel - (runaccelamt - airrisist);
} else if ((Key.isDown(37) && (xaccel > (-maxaccel))) && (falling == false)) {
xaccel = xaccel - runaccelamt;
} else if ((Key.isDown(39) && (xaccel < maxaccel)) && (falling == false)) {
xaccel = xaccel + runaccelamt;
} else if (grounded == true) {
if (xaccel > 0) {
xaccel = xaccel - friction;
}
if (xaccel < 0) {
xaccel = xaccel + friction;
}
if ((xaccel < 0) && (xaccel > friction)) {
xaccel = 0;
}
if ((xaccel > 0) && (xaccel < friction)) {
xaccel = 0;
}
} else {
if (xaccel > 0) {
xaccel = xaccel - airrisist;
}
if (xaccel < 0) {
xaccel = xaccel + airrisist;
}
if ((xaccel < 0) && (xaccel > airrisist)) {
xaccel = 0;
}
if ((xaccel > 0) && (xaccel < airrisist)) {
xaccel = 0;
}
}
}
if (_root.ground.hitTest(this._x, this._y - 11, true)) {
gravity = 1;
while (_root.ground.hitTest(this._x, this._y - 10, true)) {
this._y++;
}
}
if (xaccel > 0) {
player._xscale = 100;
}
if (xaccel < 0) {
player._xscale = -100;
}
if (!Key.isDown(38)) {
pressOnce = 0;
}
if (inControl) {
if (Key.isDown(38) && (jump == true)) {
gravity = gravity - (Math.cos(3.141593 * ((player._rotation * -1) / 180)) * maxjump);
jump = false;
doubleJump = true;
pressOnce = 1;
}
}
leftx = player._x + (Math.cos(3.141593 * (((player._rotation * -1) + 180) / 180)) * 7);
lefty = player._y - (Math.sin(3.141593 * (((player._rotation * -1) + 180) / 180)) * 500);
rightx = player._x + (Math.cos(3.141593 * ((player._rotation * -1) / 180)) * 7);
righty = player._y - (Math.sin(3.141593 * ((player._rotation * -1) / 180)) * 500);
if (ground.hitTest(leftx, lefty, true)) {
xaccel = 0;
player._x++;
}
if (ground.hitTest(rightx, righty, true)) {
xaccel = 0;
player._x--;
}
hud.whateverTheInvisibilityBarIsCalled._xscale = power;
hud.whateverTheHealthBarIsCalled._xscale = health;
if (ingame) {
cam._x = _root.player._x;
cam._y = _root.player._y - 30;
cam.camControl();
}
player._y = player._y + gravity;
player._x = player._x + xaccel;
hud._x = cam._x;
hud._y = cam._y;
hud._xscale = cam.lens._xscale;
hud._yscale = cam.lens._yscale;
if (_global.goToTitle) {
stopAllSounds();
removeStuff();
gotoAndStop ("title");
}
if (_global.levelDone) {
removeStuff();
nextFrame();
}
};
Frame 20
function removeStuff() {
i = light.length - 1;
while (i >= 0) {
light[i].removeMovieClip();
light.splice(i, 1);
i--;
}
i = human.length - 1;
while (i >= 0) {
human[i].removeMovieClip();
human.splice(i, 1);
i--;
}
i = walking.length - 1;
while (i >= 0) {
walking.splice(i, 1);
i--;
}
i = walkingDistance.length - 1;
while (i >= 0) {
walkingDistance.splice(i, 1);
i--;
}
i = heardSomething.length - 1;
while (i >= 0) {
heardSomething.splice(i, 1);
i--;
}
i = heardSomethingTimer.length - 1;
while (i >= 0) {
heardSomethingTimer.splice(i, 1);
i--;
}
i = torch.length - 1;
while (i >= 0) {
torch.splice(i, 1);
i--;
}
i = torchTimer.length - 1;
while (i >= 0) {
torchTimer.splice(i, 1);
i--;
}
i = alive.length - 1;
while (i >= 0) {
alive.splice(i, 1);
i--;
}
}
stop();
hud.ac.gotoAndStop("blah");
_global.goToTitle = false;
_global.levelDone = false;
ingame = true;
gasp_sound = new Sound();
gasp_sound.attachSound("gasp");
die_sound = new Sound();
die_sound.attachSound("dieSound");
player._x = startPoint._x;
player._y = startPoint._y;
cam._xscale = 100;
cam._yscale = 100;
hitPlayer = 0;
hitTimer = 0;
health = 100;
running = false;
gravity = 0;
gravityaccel = 0.3;
xaccel = 0;
runaccelamt = 0.3;
friction = 0.5;
airrisist = 0.05;
maxaccel = 5;
maxjump = 3;
eating = false;
eatingTimer = 0;
inControl = true;
doubleJump = false;
doubleJumping = false;
jump = true;
sneaking = false;
pressOnce = 0;
walkingThroughDoor = false;
walkingThroughDoorTimer = 0;
dying = false;
dyingTimer = 0;
crouch = false;
invisible = false;
power = 100;
cam.lens._xscale = 100;
cam.lens._yscale = 100;
timeSpentWalkingThroughDoor = 25;
timeSpentTurningToDust = 40;
timeSpentEating = 40;
timeItTakesToGetOutTorch = 15;
timeSpentShiningTorch = 80;
walkingSpeed = 1;
var human = new Array();
var heardSomething = new Array();
var heardSomethingTimer = new Array();
var torch = new Array();
var torchTimer = new Array();
var alive = new Array();
var walking = new Array();
var walkingDistance = new Array();
human.push(human_mc, human_mc1, human_mc32, human_mc33);
heardSomething.push(false, false, false, false);
heardSomethingTimer.push(0, 0, 0, 0);
torch.push(false, false, false, false);
torchTimer.push(0, 0, 0, 0);
alive.push(true, true, true, true);
walking.push(false, false, true, false);
walkingDistance.push(0, 0, 0, 0);
var light = new Array();
light.push(light1, light2, light3, light4, light5, light6, light7, light8, light9, light10, light11);
player.onEnterFrame = function () {
if (power < 1) {
invisible = false;
player._alpha = 100;
power = 0;
}
if ((!dying) && (!eating)) {
if (power > 0) {
if (Key.isDown(83)) {
power = power - 1;
invisible = true;
player._alpha = 30;
} else {
invisible = false;
player._alpha = 100;
}
}
}
if (hitPlayer == 0) {
myColor = new Color(player);
myColorTransform = new Object();
myColorTransform = {rb:0, gb:0, bb:0};
myColor.setTransform(myColorTransform);
}
if (hitPlayer == 1) {
myColor = new Color(player);
myColorTransform = new Object();
myColorTransform = {rb:100, gb:-50, bb:-50};
myColor.setTransform(myColorTransform);
hitTimer++;
if (hitTimer == 1) {
hitPlayer = 0;
hitTimer = 0;
}
}
i = light.length - 1;
while (i >= 0) {
if (player.hitMarker.hitTest(light[i])) {
if ((!dying) && (!invisible)) {
health = health - 5;
hitPlayer = 1;
}
}
i--;
}
if (health < 0) {
inControl = false;
dying = true;
power = 100;
health = 0;
}
if (dying) {
invisible = false;
player._alpha = 100;
xaccel = 0;
player.gotoAndStop("dead");
if (dyingTimer == 0) {
die_sound.start();
}
dyingTimer++;
if (dyingTimer == timeSpentTurningToDust) {
dyingTimer = 0;
dying = false;
inControl = true;
player._x = startPoint._x;
player._y = startPoint._y;
health = 100;
}
}
i = human.length - 1;
while (i >= 0) {
if (!alive[i]) {
if (walking[i]) {
human[i]._xscale = 100;
}
human[i].gotoAndStop("dead");
}
if (alive[i]) {
if (walking[i]) {
walkingDistance[i]++;
human[i].gotoAndStop("walk");
if (walkingDistance[i] == 180) {
walkingDistance[i] = 0;
}
if ((walkingDistance[i] > 0) && (walkingDistance[i] < 90)) {
human[i]._xscale = 100;
human[i]._x = human[i]._x - walkingSpeed;
}
if (walkingDistance[i] > 90) {
human[i]._xscale = -100;
human[i]._x = human[i]._x + walkingSpeed;
}
}
if (!walking[i]) {
if (torch[i]) {
torchTimer[i]++;
human[i].gotoAndStop("light");
if (torchTimer[i] == timeSpentShiningTorch) {
torch[i] = false;
torchTimer[i] = 0;
human[i].gotoAndStop("idle");
}
}
if (heardSomething[i]) {
if (heardSomethingTimer[i] == 0) {
gasp_sound.start();
}
heardSomethingTimer[i]++;
human[i].gotoAndStop("wtf");
if (heardSomethingTimer[i] == timeItTakesToGetOutTorch) {
heardSomethingTimer[i] = 0;
heardSomething[i] = false;
torch[i] = true;
}
}
}
if ((!dying) && (player.hitTest(human[i].hit))) {
alive[i] = false;
eating = true;
inControl = false;
}
if (player.hitMarker.hitTest(human[i].beam)) {
if ((!dying) && (!invisible)) {
health = health - 20;
hitPlayer = 1;
}
}
if (player.hitTest(human[i].zone)) {
if (!sneaking) {
if (!torch[i]) {
heardSomething[i] = true;
}
}
}
}
i--;
}
if (!jump) {
crouch = false;
}
if (inControl) {
if ((!running) && (jump)) {
if (Key.isDown(40)) {
maxaccel = 2;
crouch = true;
} else {
maxaccel = 5;
crouch = false;
}
}
}
if ((!jump) && (!crouch)) {
maxaccel = 5;
sneaking = false;
}
if (inControl) {
if (jump && (!crouch)) {
if (Key.isDown(65)) {
maxaccel = 1.6;
sneaking = true;
} else {
maxaccel = 5;
sneaking = false;
}
}
}
if (player.hitTest(door)) {
walkingThroughDoor = true;
xaccel = 0;
inControl = false;
player.gotoAndStop("throughDoor");
}
if (walkingThroughDoor) {
walkingThroughDoorTimer++;
if (walkingThroughDoorTimer == timeSpentWalkingThroughDoor) {
removeStuff();
hud.ac.gotoAndStop("areaComplete");
ingame = false;
}
}
if (eating) {
invisible = false;
player._alpha = 100;
xaccel = 0;
player.gotoAndStop("feeding");
eatingTimer++;
if (eatingTimer == timeSpentEating) {
eating = false;
eatingTimer = 0;
inControl = true;
}
}
if (inControl) {
if (doubleJumping) {
player.gotoAndStop("double");
}
if (crouch && (!running)) {
player.gotoAndStop("crouch");
}
if (crouch && (running)) {
player.gotoAndStop("crouchWalk");
}
if (!crouch) {
if (!sneaking) {
if (jump && (!doubleJumping)) {
if (running) {
player.gotoAndStop("run");
} else {
player.gotoAndStop("idle");
}
} else if (!doubleJumping) {
player.gotoAndStop("jump");
}
}
if (sneaking) {
if (jump && (!doubleJumping)) {
if (running) {
player.gotoAndStop("sneak");
} else {
player.gotoAndStop("idle");
}
} else if (!doubleJumping) {
player.gotoAndStop("jump");
}
}
}
if (Key.isDown(39) or Key.isDown(37)) {
running = true;
} else {
running = false;
}
}
if (!ground.hitTest(player._x, player._y + 10, true)) {
falling = true;
grounded = false;
}
if (ground.hitTest(player._x, player._y + 11, true)) {
doubleJumping = false;
doubleJump = false;
jump = true;
grounded = true;
falling = false;
while (ground.hitTest(player._x, player._y + 9, true)) {
player._y--;
}
}
if (falling == true) {
gravity = gravity + gravityaccel;
} else {
gravity = 0;
}
if (inControl) {
if ((Key.isDown(39) && (xaccel < maxaccel)) && (falling == true)) {
xaccel = xaccel + (runaccelamt - airrisist);
} else if ((Key.isDown(37) && (xaccel > (-maxaccel))) && (falling == true)) {
xaccel = xaccel - (runaccelamt - airrisist);
} else if ((Key.isDown(37) && (xaccel > (-maxaccel))) && (falling == false)) {
xaccel = xaccel - runaccelamt;
} else if ((Key.isDown(39) && (xaccel < maxaccel)) && (falling == false)) {
xaccel = xaccel + runaccelamt;
} else if (grounded == true) {
if (xaccel > 0) {
xaccel = xaccel - friction;
}
if (xaccel < 0) {
xaccel = xaccel + friction;
}
if ((xaccel < 0) && (xaccel > friction)) {
xaccel = 0;
}
if ((xaccel > 0) && (xaccel < friction)) {
xaccel = 0;
}
} else {
if (xaccel > 0) {
xaccel = xaccel - airrisist;
}
if (xaccel < 0) {
xaccel = xaccel + airrisist;
}
if ((xaccel < 0) && (xaccel > airrisist)) {
xaccel = 0;
}
if ((xaccel > 0) && (xaccel < airrisist)) {
xaccel = 0;
}
}
}
if (_root.ground.hitTest(this._x, this._y - 11, true)) {
gravity = 1;
while (_root.ground.hitTest(this._x, this._y - 10, true)) {
this._y++;
}
}
if (xaccel > 0) {
player._xscale = 100;
}
if (xaccel < 0) {
player._xscale = -100;
}
if (!Key.isDown(38)) {
pressOnce = 0;
}
if (inControl) {
if (Key.isDown(38) && (jump == true)) {
gravity = gravity - (Math.cos(3.141593 * ((player._rotation * -1) / 180)) * maxjump);
jump = false;
doubleJump = true;
pressOnce = 1;
}
}
leftx = player._x + (Math.cos(3.141593 * (((player._rotation * -1) + 180) / 180)) * 7);
lefty = player._y - (Math.sin(3.141593 * (((player._rotation * -1) + 180) / 180)) * 500);
rightx = player._x + (Math.cos(3.141593 * ((player._rotation * -1) / 180)) * 7);
righty = player._y - (Math.sin(3.141593 * ((player._rotation * -1) / 180)) * 500);
if (ground.hitTest(leftx, lefty, true)) {
xaccel = 0;
player._x++;
}
if (ground.hitTest(rightx, righty, true)) {
xaccel = 0;
player._x--;
}
hud.whateverTheInvisibilityBarIsCalled._xscale = power;
hud.whateverTheHealthBarIsCalled._xscale = health;
if (ingame) {
cam._x = _root.player._x;
cam._y = _root.player._y - 30;
cam.camControl();
}
player._y = player._y + gravity;
player._x = player._x + xaccel;
hud._x = cam._x;
hud._y = cam._y;
hud._xscale = cam.lens._xscale;
hud._yscale = cam.lens._yscale;
if (_global.goToTitle) {
stopAllSounds();
removeStuff();
gotoAndStop ("title");
}
if (_global.levelDone) {
removeStuff();
nextFrame();
}
};
Frame 21
cam._x = csTest._x;
cam._y = csTest._y;
Frame 22
function removeStuff() {
i = light.length - 1;
while (i >= 0) {
light[i].removeMovieClip();
light.splice(i, 1);
i--;
}
i = human.length - 1;
while (i >= 0) {
human[i].removeMovieClip();
human.splice(i, 1);
i--;
}
i = walking.length - 1;
while (i >= 0) {
walking.splice(i, 1);
i--;
}
i = walkingDistance.length - 1;
while (i >= 0) {
walkingDistance.splice(i, 1);
i--;
}
i = heardSomething.length - 1;
while (i >= 0) {
heardSomething.splice(i, 1);
i--;
}
i = heardSomethingTimer.length - 1;
while (i >= 0) {
heardSomethingTimer.splice(i, 1);
i--;
}
i = torch.length - 1;
while (i >= 0) {
torch.splice(i, 1);
i--;
}
i = torchTimer.length - 1;
while (i >= 0) {
torchTimer.splice(i, 1);
i--;
}
i = alive.length - 1;
while (i >= 0) {
alive.splice(i, 1);
i--;
}
}
stop();
hud.ac.gotoAndStop("blah");
_global.goToTitle = false;
_global.levelDone = false;
ingame = true;
gasp_sound = new Sound();
gasp_sound.attachSound("gasp");
die_sound = new Sound();
die_sound.attachSound("dieSound");
player._x = startPoint._x;
player._y = startPoint._y;
cam._xscale = 100;
cam._yscale = 100;
hitPlayer = 0;
hitTimer = 0;
health = 100;
running = false;
gravity = 0;
gravityaccel = 0.3;
xaccel = 0;
runaccelamt = 0.3;
friction = 0.5;
airrisist = 0.05;
maxaccel = 5;
maxjump = 3;
eating = false;
eatingTimer = 0;
inControl = true;
doubleJump = false;
doubleJumping = false;
jump = true;
sneaking = false;
pressOnce = 0;
walkingThroughDoor = false;
walkingThroughDoorTimer = 0;
dying = false;
dyingTimer = 0;
crouch = false;
invisible = false;
power = 100;
cam.lens._xscale = 100;
cam.lens._yscale = 100;
timeSpentWalkingThroughDoor = 25;
timeSpentTurningToDust = 40;
timeSpentEating = 40;
timeItTakesToGetOutTorch = 15;
timeSpentShiningTorch = 80;
walkingSpeed = 1;
var human = new Array();
var heardSomething = new Array();
var heardSomethingTimer = new Array();
var torch = new Array();
var torchTimer = new Array();
var alive = new Array();
var walking = new Array();
var walkingDistance = new Array();
human.push(human_mc, human_mc27, human_mc222, human_mc2226);
heardSomething.push(false, false, false, false);
heardSomethingTimer.push(0, 0, 0, 0);
torch.push(false, false, false, false);
torchTimer.push(0, 0, 0, 0);
alive.push(true, true, true, true);
walking.push(false, false, true, true);
walkingDistance.push(0, 0, 0, 0);
var light = new Array();
light.push(light1, light2, light3, light4, light5, light6, light7, light8, light9, light10, light11);
player.onEnterFrame = function () {
if (power < 1) {
invisible = false;
player._alpha = 100;
power = 0;
}
if ((!dying) && (!eating)) {
if (power > 0) {
if (Key.isDown(83)) {
power = power - 1;
invisible = true;
player._alpha = 30;
} else {
invisible = false;
player._alpha = 100;
}
}
}
if (hitPlayer == 0) {
myColor = new Color(player);
myColorTransform = new Object();
myColorTransform = {rb:0, gb:0, bb:0};
myColor.setTransform(myColorTransform);
}
if (hitPlayer == 1) {
myColor = new Color(player);
myColorTransform = new Object();
myColorTransform = {rb:100, gb:-50, bb:-50};
myColor.setTransform(myColorTransform);
hitTimer++;
if (hitTimer == 1) {
hitPlayer = 0;
hitTimer = 0;
}
}
i = light.length - 1;
while (i >= 0) {
if (player.hitMarker.hitTest(light[i])) {
if ((!dying) && (!invisible)) {
health = health - 3;
hitPlayer = 1;
}
}
i--;
}
if (health < 0) {
inControl = false;
dying = true;
power = 100;
health = 0;
}
if (dying) {
invisible = false;
player._alpha = 100;
xaccel = 0;
player.gotoAndStop("dead");
if (dyingTimer == 0) {
die_sound.start();
}
dyingTimer++;
if (dyingTimer == timeSpentTurningToDust) {
dyingTimer = 0;
dying = false;
inControl = true;
player._x = startPoint._x;
player._y = startPoint._y;
health = 100;
}
}
i = human.length - 1;
while (i >= 0) {
if (!alive[i]) {
if (walking[i]) {
human[i]._xscale = 100;
}
human[i].gotoAndStop("dead");
}
if (alive[i]) {
if (walking[i]) {
walkingDistance[i]++;
human[i].gotoAndStop("walk");
if (walkingDistance[i] == 180) {
walkingDistance[i] = 0;
}
if ((walkingDistance[i] > 0) && (walkingDistance[i] < 90)) {
human[i]._xscale = 100;
human[i]._x = human[i]._x - walkingSpeed;
}
if (walkingDistance[i] > 90) {
human[i]._xscale = -100;
human[i]._x = human[i]._x + walkingSpeed;
}
}
if (!walking[i]) {
if (torch[i]) {
torchTimer[i]++;
human[i].gotoAndStop("light");
if (torchTimer[i] == timeSpentShiningTorch) {
torch[i] = false;
torchTimer[i] = 0;
human[i].gotoAndStop("idle");
}
}
if (heardSomething[i]) {
if (heardSomethingTimer[i] == 0) {
gasp_sound.start();
}
heardSomethingTimer[i]++;
human[i].gotoAndStop("wtf");
if (heardSomethingTimer[i] == timeItTakesToGetOutTorch) {
heardSomethingTimer[i] = 0;
heardSomething[i] = false;
torch[i] = true;
}
}
}
if ((!dying) && (player.hitTest(human[i].hit))) {
alive[i] = false;
eating = true;
inControl = false;
}
if (player.hitMarker.hitTest(human[i].beam)) {
if ((!dying) && (!invisible)) {
health = health - 10;
hitPlayer = 1;
}
}
if (player.hitTest(human[i].zone)) {
if (!sneaking) {
if (!torch[i]) {
heardSomething[i] = true;
}
}
}
}
i--;
}
if (!jump) {
crouch = false;
}
if (inControl) {
if ((!running) && (jump)) {
if (Key.isDown(40)) {
maxaccel = 2;
crouch = true;
} else {
maxaccel = 5;
crouch = false;
}
}
}
if ((!jump) && (!crouch)) {
maxaccel = 5;
sneaking = false;
}
if (inControl) {
if (jump && (!crouch)) {
if (Key.isDown(65)) {
maxaccel = 1.6;
sneaking = true;
} else {
maxaccel = 5;
sneaking = false;
}
}
}
if (player.hitTest(door)) {
walkingThroughDoor = true;
xaccel = 0;
inControl = false;
player.gotoAndStop("throughDoor");
}
if (walkingThroughDoor) {
walkingThroughDoorTimer++;
if (walkingThroughDoorTimer == timeSpentWalkingThroughDoor) {
removeStuff();
hud.ac.gotoAndStop("areaComplete");
}
}
if (eating) {
invisible = false;
player._alpha = 100;
xaccel = 0;
player.gotoAndStop("feeding");
eatingTimer++;
if (eatingTimer == timeSpentEating) {
eating = false;
eatingTimer = 0;
inControl = true;
}
}
if (inControl) {
if (doubleJumping) {
player.gotoAndStop("double");
}
if (crouch && (!running)) {
player.gotoAndStop("crouch");
}
if (crouch && (running)) {
player.gotoAndStop("crouchWalk");
}
if (!crouch) {
if (!sneaking) {
if (jump && (!doubleJumping)) {
if (running) {
player.gotoAndStop("run");
} else {
player.gotoAndStop("idle");
}
} else if (!doubleJumping) {
player.gotoAndStop("jump");
}
}
if (sneaking) {
if (jump && (!doubleJumping)) {
if (running) {
player.gotoAndStop("sneak");
} else {
player.gotoAndStop("idle");
}
} else if (!doubleJumping) {
player.gotoAndStop("jump");
}
}
}
if (Key.isDown(39) or Key.isDown(37)) {
running = true;
} else {
running = false;
}
}
if (!ground.hitTest(player._x, player._y + 10, true)) {
falling = true;
grounded = false;
}
if (ground.hitTest(player._x, player._y + 11, true)) {
doubleJumping = false;
doubleJump = false;
jump = true;
grounded = true;
falling = false;
while (ground.hitTest(player._x, player._y + 9, true)) {
player._y--;
}
}
if (falling == true) {
gravity = gravity + gravityaccel;
} else {
gravity = 0;
}
if (inControl) {
if ((Key.isDown(39) && (xaccel < maxaccel)) && (falling == true)) {
xaccel = xaccel + (runaccelamt - airrisist);
} else if ((Key.isDown(37) && (xaccel > (-maxaccel))) && (falling == true)) {
xaccel = xaccel - (runaccelamt - airrisist);
} else if ((Key.isDown(37) && (xaccel > (-maxaccel))) && (falling == false)) {
xaccel = xaccel - runaccelamt;
} else if ((Key.isDown(39) && (xaccel < maxaccel)) && (falling == false)) {
xaccel = xaccel + runaccelamt;
} else if (grounded == true) {
if (xaccel > 0) {
xaccel = xaccel - friction;
}
if (xaccel < 0) {
xaccel = xaccel + friction;
}
if ((xaccel < 0) && (xaccel > friction)) {
xaccel = 0;
}
if ((xaccel > 0) && (xaccel < friction)) {
xaccel = 0;
}
} else {
if (xaccel > 0) {
xaccel = xaccel - airrisist;
}
if (xaccel < 0) {
xaccel = xaccel + airrisist;
}
if ((xaccel < 0) && (xaccel > airrisist)) {
xaccel = 0;
}
if ((xaccel > 0) && (xaccel < airrisist)) {
xaccel = 0;
}
}
}
if (_root.ground.hitTest(this._x, this._y - 11, true)) {
gravity = 1;
while (_root.ground.hitTest(this._x, this._y - 10, true)) {
this._y++;
}
}
if (xaccel > 0) {
player._xscale = 100;
}
if (xaccel < 0) {
player._xscale = -100;
}
if (!Key.isDown(38)) {
pressOnce = 0;
}
if (inControl) {
if (Key.isDown(38) && (jump == true)) {
gravity = gravity - (Math.cos(3.141593 * ((player._rotation * -1) / 180)) * maxjump);
jump = false;
doubleJump = true;
pressOnce = 1;
}
}
leftx = player._x + (Math.cos(3.141593 * (((player._rotation * -1) + 180) / 180)) * 7);
lefty = player._y - (Math.sin(3.141593 * (((player._rotation * -1) + 180) / 180)) * 500);
rightx = player._x + (Math.cos(3.141593 * ((player._rotation * -1) / 180)) * 7);
righty = player._y - (Math.sin(3.141593 * ((player._rotation * -1) / 180)) * 500);
if (ground.hitTest(leftx, lefty, true)) {
xaccel = 0;
player._x++;
}
if (ground.hitTest(rightx, righty, true)) {
xaccel = 0;
player._x--;
}
hud.whateverTheInvisibilityBarIsCalled._xscale = power;
hud.whateverTheHealthBarIsCalled._xscale = health;
if (ingame) {
cam._x = _root.player._x;
cam._y = _root.player._y - 30;
cam.camControl();
}
player._y = player._y + gravity;
player._x = player._x + xaccel;
hud._x = cam._x;
hud._y = cam._y;
hud._xscale = cam.lens._xscale;
hud._yscale = cam.lens._yscale;
if (_global.goToTitle) {
stopAllSounds();
removeStuff();
gotoAndStop ("title");
}
if (_global.levelDone) {
removeStuff();
nextFrame();
}
};
Frame 23
function removeStuff() {
i = light.length - 1;
while (i >= 0) {
light[i].removeMovieClip();
light.splice(i, 1);
i--;
}
i = human.length - 1;
while (i >= 0) {
human[i].removeMovieClip();
human.splice(i, 1);
i--;
}
i = walking.length - 1;
while (i >= 0) {
walking.splice(i, 1);
i--;
}
i = walkingDistance.length - 1;
while (i >= 0) {
walkingDistance.splice(i, 1);
i--;
}
i = heardSomething.length - 1;
while (i >= 0) {
heardSomething.splice(i, 1);
i--;
}
i = heardSomethingTimer.length - 1;
while (i >= 0) {
heardSomethingTimer.splice(i, 1);
i--;
}
i = torch.length - 1;
while (i >= 0) {
torch.splice(i, 1);
i--;
}
i = torchTimer.length - 1;
while (i >= 0) {
torchTimer.splice(i, 1);
i--;
}
i = alive.length - 1;
while (i >= 0) {
alive.splice(i, 1);
i--;
}
}
stop();
hud.ac.gotoAndStop("blah");
_global.goToTitle = false;
_global.levelDone = false;
ingame = true;
gasp_sound = new Sound();
gasp_sound.attachSound("gasp");
die_sound = new Sound();
die_sound.attachSound("dieSound");
player._x = startPoint._x;
player._y = startPoint._y;
cam._xscale = 100;
cam._yscale = 100;
hitPlayer = 0;
hitTimer = 0;
health = 100;
running = false;
gravity = 0;
gravityaccel = 0.3;
xaccel = 0;
runaccelamt = 0.3;
friction = 0.5;
airrisist = 0.05;
maxaccel = 5;
maxjump = 3;
eating = false;
eatingTimer = 0;
inControl = true;
doubleJump = false;
doubleJumping = false;
jump = true;
sneaking = false;
pressOnce = 0;
walkingThroughDoor = false;
walkingThroughDoorTimer = 0;
dying = false;
dyingTimer = 0;
crouch = false;
invisible = false;
power = 100;
cam.lens._xscale = 100;
cam.lens._yscale = 100;
timeSpentWalkingThroughDoor = 25;
timeSpentTurningToDust = 40;
timeSpentEating = 40;
timeItTakesToGetOutTorch = 15;
timeSpentShiningTorch = 80;
walkingSpeed = 1;
var human = new Array();
var heardSomething = new Array();
var heardSomethingTimer = new Array();
var torch = new Array();
var torchTimer = new Array();
var alive = new Array();
var walking = new Array();
var walkingDistance = new Array();
human.push(human_mc, human_mc1, human_mc42, human_mc44, human_mc45);
heardSomething.push(false, false, false, false, false);
heardSomethingTimer.push(0, 0, 0, 0, 0);
torch.push(false, false, false, false, false);
torchTimer.push(0, 0, 0, 0, 0);
alive.push(true, true, true, true, true);
walking.push(false, false, true, false, false);
walkingDistance.push(0, 0, 0, 0, 0);
var light = new Array();
light.push(light1, light2, light3, light4, light5, light6, light7, light8, light9, light10, light11, light12);
player.onEnterFrame = function () {
if (power < 1) {
invisible = false;
player._alpha = 100;
power = 0;
}
if ((!dying) && (!eating)) {
if (power > 0) {
if (Key.isDown(83)) {
power = power - 1;
invisible = true;
player._alpha = 30;
} else {
invisible = false;
player._alpha = 100;
}
}
}
if (hitPlayer == 0) {
myColor = new Color(player);
myColorTransform = new Object();
myColorTransform = {rb:0, gb:0, bb:0};
myColor.setTransform(myColorTransform);
}
if (hitPlayer == 1) {
myColor = new Color(player);
myColorTransform = new Object();
myColorTransform = {rb:100, gb:-50, bb:-50};
myColor.setTransform(myColorTransform);
hitTimer++;
if (hitTimer == 1) {
hitPlayer = 0;
hitTimer = 0;
}
}
i = light.length - 1;
while (i >= 0) {
if (player.hitMarker.hitTest(light[i])) {
if ((!dying) && (!invisible)) {
health = health - 3;
hitPlayer = 1;
}
}
i--;
}
if (health < 0) {
inControl = false;
dying = true;
power = 100;
health = 0;
}
if (dying) {
invisible = false;
player._alpha = 100;
xaccel = 0;
player.gotoAndStop("dead");
if (dyingTimer == 0) {
die_sound.start();
}
dyingTimer++;
if (dyingTimer == timeSpentTurningToDust) {
dyingTimer = 0;
dying = false;
inControl = true;
player._x = startPoint._x;
player._y = startPoint._y;
health = 100;
}
}
i = human.length - 1;
while (i >= 0) {
if (!alive[i]) {
if (walking[i]) {
human[i]._xscale = 100;
}
human[i].gotoAndStop("dead");
}
if (alive[i]) {
if (walking[i]) {
walkingDistance[i]++;
human[i].gotoAndStop("walk");
if (walkingDistance[i] == 180) {
walkingDistance[i] = 0;
}
if ((walkingDistance[i] > 0) && (walkingDistance[i] < 90)) {
human[i]._xscale = 100;
human[i]._x = human[i]._x - walkingSpeed;
}
if (walkingDistance[i] > 90) {
human[i]._xscale = -100;
human[i]._x = human[i]._x + walkingSpeed;
}
}
if (!walking[i]) {
if (torch[i]) {
torchTimer[i]++;
human[i].gotoAndStop("light");
if (torchTimer[i] == timeSpentShiningTorch) {
torch[i] = false;
torchTimer[i] = 0;
human[i].gotoAndStop("idle");
}
}
if (heardSomething[i]) {
if (heardSomethingTimer[i] == 0) {
gasp_sound.start();
}
heardSomethingTimer[i]++;
human[i].gotoAndStop("wtf");
if (heardSomethingTimer[i] == timeItTakesToGetOutTorch) {
heardSomethingTimer[i] = 0;
heardSomething[i] = false;
torch[i] = true;
}
}
}
if ((!dying) && (player.hitTest(human[i].hit))) {
alive[i] = false;
eating = true;
inControl = false;
}
if (player.hitMarker.hitTest(human[i].beam)) {
if ((!dying) && (!invisible)) {
health = health - 10;
hitPlayer = 1;
}
}
if (player.hitTest(human[i].zone)) {
if (!sneaking) {
if (!torch[i]) {
heardSomething[i] = true;
}
}
}
}
i--;
}
if (!jump) {
crouch = false;
}
if (inControl) {
if ((!running) && (jump)) {
if (Key.isDown(40)) {
maxaccel = 2;
crouch = true;
} else {
maxaccel = 5;
crouch = false;
}
}
}
if ((!jump) && (!crouch)) {
maxaccel = 5;
sneaking = false;
}
if (inControl) {
if (jump && (!crouch)) {
if (Key.isDown(65)) {
maxaccel = 1.6;
sneaking = true;
} else {
maxaccel = 5;
sneaking = false;
}
}
}
if (player.hitTest(door)) {
walkingThroughDoor = true;
xaccel = 0;
inControl = false;
player.gotoAndStop("throughDoor");
}
if (walkingThroughDoor) {
walkingThroughDoorTimer++;
if (walkingThroughDoorTimer == timeSpentWalkingThroughDoor) {
removeStuff();
hud.ac.gotoAndStop("areaComplete");
}
}
if (eating) {
invisible = false;
player._alpha = 100;
xaccel = 0;
player.gotoAndStop("feeding");
eatingTimer++;
if (eatingTimer == timeSpentEating) {
eating = false;
eatingTimer = 0;
inControl = true;
}
}
if (inControl) {
if (doubleJumping) {
player.gotoAndStop("double");
}
if (crouch && (!running)) {
player.gotoAndStop("crouch");
}
if (crouch && (running)) {
player.gotoAndStop("crouchWalk");
}
if (!crouch) {
if (!sneaking) {
if (jump && (!doubleJumping)) {
if (running) {
player.gotoAndStop("run");
} else {
player.gotoAndStop("idle");
}
} else if (!doubleJumping) {
player.gotoAndStop("jump");
}
}
if (sneaking) {
if (jump && (!doubleJumping)) {
if (running) {
player.gotoAndStop("sneak");
} else {
player.gotoAndStop("idle");
}
} else if (!doubleJumping) {
player.gotoAndStop("jump");
}
}
}
if (Key.isDown(39) or Key.isDown(37)) {
running = true;
} else {
running = false;
}
}
if (!ground.hitTest(player._x, player._y + 10, true)) {
falling = true;
grounded = false;
}
if (ground.hitTest(player._x, player._y + 11, true)) {
doubleJumping = false;
doubleJump = false;
jump = true;
grounded = true;
falling = false;
while (ground.hitTest(player._x, player._y + 9, true)) {
player._y--;
}
}
if (falling == true) {
gravity = gravity + gravityaccel;
} else {
gravity = 0;
}
if (inControl) {
if ((Key.isDown(39) && (xaccel < maxaccel)) && (falling == true)) {
xaccel = xaccel + (runaccelamt - airrisist);
} else if ((Key.isDown(37) && (xaccel > (-maxaccel))) && (falling == true)) {
xaccel = xaccel - (runaccelamt - airrisist);
} else if ((Key.isDown(37) && (xaccel > (-maxaccel))) && (falling == false)) {
xaccel = xaccel - runaccelamt;
} else if ((Key.isDown(39) && (xaccel < maxaccel)) && (falling == false)) {
xaccel = xaccel + runaccelamt;
} else if (grounded == true) {
if (xaccel > 0) {
xaccel = xaccel - friction;
}
if (xaccel < 0) {
xaccel = xaccel + friction;
}
if ((xaccel < 0) && (xaccel > friction)) {
xaccel = 0;
}
if ((xaccel > 0) && (xaccel < friction)) {
xaccel = 0;
}
} else {
if (xaccel > 0) {
xaccel = xaccel - airrisist;
}
if (xaccel < 0) {
xaccel = xaccel + airrisist;
}
if ((xaccel < 0) && (xaccel > airrisist)) {
xaccel = 0;
}
if ((xaccel > 0) && (xaccel < airrisist)) {
xaccel = 0;
}
}
}
if (_root.ground.hitTest(this._x, this._y - 11, true)) {
gravity = 1;
while (_root.ground.hitTest(this._x, this._y - 10, true)) {
this._y++;
}
}
if (xaccel > 0) {
player._xscale = 100;
}
if (xaccel < 0) {
player._xscale = -100;
}
if (!Key.isDown(38)) {
pressOnce = 0;
}
if (inControl) {
if (Key.isDown(38) && (jump == true)) {
gravity = gravity - (Math.cos(3.141593 * ((player._rotation * -1) / 180)) * maxjump);
jump = false;
doubleJump = true;
pressOnce = 1;
}
}
leftx = player._x + (Math.cos(3.141593 * (((player._rotation * -1) + 180) / 180)) * 7);
lefty = player._y - (Math.sin(3.141593 * (((player._rotation * -1) + 180) / 180)) * 500);
rightx = player._x + (Math.cos(3.141593 * ((player._rotation * -1) / 180)) * 7);
righty = player._y - (Math.sin(3.141593 * ((player._rotation * -1) / 180)) * 500);
if (ground.hitTest(leftx, lefty, true)) {
xaccel = 0;
player._x++;
}
if (ground.hitTest(rightx, righty, true)) {
xaccel = 0;
player._x--;
}
hud.whateverTheInvisibilityBarIsCalled._xscale = power;
hud.whateverTheHealthBarIsCalled._xscale = health;
if (ingame) {
cam._x = _root.player._x;
cam._y = _root.player._y - 30;
cam.camControl();
}
player._y = player._y + gravity;
player._x = player._x + xaccel;
hud._x = cam._x;
hud._y = cam._y;
hud._xscale = cam.lens._xscale;
hud._yscale = cam.lens._yscale;
if (_global.goToTitle) {
stopAllSounds();
removeStuff();
gotoAndStop ("title");
}
if (_global.levelDone) {
removeStuff();
nextFrame();
}
};
Frame 24
function removeStuff() {
i = light.length - 1;
while (i >= 0) {
light[i].removeMovieClip();
light.splice(i, 1);
i--;
}
i = human.length - 1;
while (i >= 0) {
human[i].removeMovieClip();
human.splice(i, 1);
i--;
}
i = walking.length - 1;
while (i >= 0) {
walking.splice(i, 1);
i--;
}
i = walkingDistance.length - 1;
while (i >= 0) {
walkingDistance.splice(i, 1);
i--;
}
i = heardSomething.length - 1;
while (i >= 0) {
heardSomething.splice(i, 1);
i--;
}
i = heardSomethingTimer.length - 1;
while (i >= 0) {
heardSomethingTimer.splice(i, 1);
i--;
}
i = torch.length - 1;
while (i >= 0) {
torch.splice(i, 1);
i--;
}
i = torchTimer.length - 1;
while (i >= 0) {
torchTimer.splice(i, 1);
i--;
}
i = alive.length - 1;
while (i >= 0) {
alive.splice(i, 1);
i--;
}
}
stop();
hud.ac.gotoAndStop("blah");
_global.goToTitle = false;
_global.levelDone = false;
ingame = true;
gasp_sound = new Sound();
gasp_sound.attachSound("gasp");
die_sound = new Sound();
die_sound.attachSound("dieSound");
player._x = startPoint._x;
player._y = startPoint._y;
cam._xscale = 100;
cam._yscale = 100;
hitPlayer = 0;
hitTimer = 0;
health = 100;
running = false;
gravity = 0;
gravityaccel = 0.3;
xaccel = 0;
runaccelamt = 0.3;
friction = 0.5;
airrisist = 0.05;
maxaccel = 5;
maxjump = 3;
eating = false;
eatingTimer = 0;
inControl = true;
doubleJump = false;
doubleJumping = false;
jump = true;
sneaking = false;
pressOnce = 0;
walkingThroughDoor = false;
walkingThroughDoorTimer = 0;
dying = false;
dyingTimer = 0;
crouch = false;
invisible = false;
power = 100;
cam.lens._xscale = 100;
cam.lens._yscale = 100;
timeSpentWalkingThroughDoor = 25;
timeSpentTurningToDust = 40;
timeSpentEating = 40;
timeItTakesToGetOutTorch = 15;
timeSpentShiningTorch = 80;
walkingSpeed = 1;
var human = new Array();
var heardSomething = new Array();
var heardSomethingTimer = new Array();
var torch = new Array();
var torchTimer = new Array();
var alive = new Array();
var walking = new Array();
var walkingDistance = new Array();
human.push(human_mc1000, human_mc1001, human_mc1002, human_mc1003, human_mc1004);
heardSomething.push(false, false, false, false, false);
heardSomethingTimer.push(0, 0, 0, 0, 0);
torch.push(false, false, false, false, false);
torchTimer.push(0, 0, 0, 0, 0);
alive.push(true, true, true, true, true);
walking.push(false, false, true, false, true);
walkingDistance.push(0, 0, 0, 0, 0);
var light = new Array();
light.push(light1, light2, light3, light4, light5, light6, light7, light8, light9, light10, light11, light12);
player.onEnterFrame = function () {
if (power < 1) {
invisible = false;
player._alpha = 100;
power = 0;
}
if ((!dying) && (!eating)) {
if (power > 0) {
if (Key.isDown(83)) {
power = power - 1;
invisible = true;
player._alpha = 30;
} else {
invisible = false;
player._alpha = 100;
}
}
}
if (hitPlayer == 0) {
myColor = new Color(player);
myColorTransform = new Object();
myColorTransform = {rb:0, gb:0, bb:0};
myColor.setTransform(myColorTransform);
}
if (hitPlayer == 1) {
myColor = new Color(player);
myColorTransform = new Object();
myColorTransform = {rb:100, gb:-50, bb:-50};
myColor.setTransform(myColorTransform);
hitTimer++;
if (hitTimer == 1) {
hitPlayer = 0;
hitTimer = 0;
}
}
i = light.length - 1;
while (i >= 0) {
if (player.hitMarker.hitTest(light[i])) {
if ((!dying) && (!invisible)) {
health = health - 3;
hitPlayer = 1;
}
}
i--;
}
if (health < 0) {
inControl = false;
dying = true;
power = 100;
health = 0;
}
if (dying) {
invisible = false;
player._alpha = 100;
xaccel = 0;
player.gotoAndStop("dead");
if (dyingTimer == 0) {
die_sound.start();
}
dyingTimer++;
if (dyingTimer == timeSpentTurningToDust) {
dyingTimer = 0;
dying = false;
inControl = true;
player._x = startPoint._x;
player._y = startPoint._y;
health = 100;
}
}
i = human.length - 1;
while (i >= 0) {
if (!alive[i]) {
if (walking[i]) {
human[i]._xscale = 100;
}
human[i].gotoAndStop("dead");
}
if (alive[i]) {
if (walking[i]) {
walkingDistance[i]++;
human[i].gotoAndStop("walk");
if (walkingDistance[i] == 180) {
walkingDistance[i] = 0;
}
if ((walkingDistance[i] > 0) && (walkingDistance[i] < 90)) {
human[i]._xscale = 100;
human[i]._x = human[i]._x - walkingSpeed;
}
if (walkingDistance[i] > 90) {
human[i]._xscale = -100;
human[i]._x = human[i]._x + walkingSpeed;
}
}
if (!walking[i]) {
if (torch[i]) {
torchTimer[i]++;
human[i].gotoAndStop("light");
if (torchTimer[i] == timeSpentShiningTorch) {
torch[i] = false;
torchTimer[i] = 0;
human[i].gotoAndStop("idle");
}
}
if (heardSomething[i]) {
if (heardSomethingTimer[i] == 0) {
gasp_sound.start();
}
heardSomethingTimer[i]++;
human[i].gotoAndStop("wtf");
if (heardSomethingTimer[i] == timeItTakesToGetOutTorch) {
heardSomethingTimer[i] = 0;
heardSomething[i] = false;
torch[i] = true;
}
}
}
if ((!dying) && (player.hitTest(human[i].hit))) {
alive[i] = false;
eating = true;
inControl = false;
}
if (player.hitMarker.hitTest(human[i].beam)) {
if ((!dying) && (!invisible)) {
health = health - 10;
hitPlayer = 1;
}
}
if (player.hitTest(human[i].zone)) {
if (!sneaking) {
if (!torch[i]) {
heardSomething[i] = true;
}
}
}
}
i--;
}
if (!jump) {
crouch = false;
}
if (inControl) {
if ((!running) && (jump)) {
if (Key.isDown(40)) {
maxaccel = 2;
crouch = true;
} else {
maxaccel = 5;
crouch = false;
}
}
}
if ((!jump) && (!crouch)) {
maxaccel = 5;
sneaking = false;
}
if (inControl) {
if (jump && (!crouch)) {
if (Key.isDown(65)) {
maxaccel = 1.6;
sneaking = true;
} else {
maxaccel = 5;
sneaking = false;
}
}
}
if (player.hitTest(door)) {
walkingThroughDoor = true;
xaccel = 0;
inControl = false;
player.gotoAndStop("throughDoor");
}
if (walkingThroughDoor) {
walkingThroughDoorTimer++;
if (walkingThroughDoorTimer == timeSpentWalkingThroughDoor) {
removeStuff();
hud.ac.gotoAndStop("areaComplete");
}
}
if (eating) {
invisible = false;
player._alpha = 100;
xaccel = 0;
player.gotoAndStop("feeding");
eatingTimer++;
if (eatingTimer == timeSpentEating) {
eating = false;
eatingTimer = 0;
inControl = true;
}
}
if (inControl) {
if (doubleJumping) {
player.gotoAndStop("double");
}
if (crouch && (!running)) {
player.gotoAndStop("crouch");
}
if (crouch && (running)) {
player.gotoAndStop("crouchWalk");
}
if (!crouch) {
if (!sneaking) {
if (jump && (!doubleJumping)) {
if (running) {
player.gotoAndStop("run");
} else {
player.gotoAndStop("idle");
}
} else if (!doubleJumping) {
player.gotoAndStop("jump");
}
}
if (sneaking) {
if (jump && (!doubleJumping)) {
if (running) {
player.gotoAndStop("sneak");
} else {
player.gotoAndStop("idle");
}
} else if (!doubleJumping) {
player.gotoAndStop("jump");
}
}
}
if (Key.isDown(39) or Key.isDown(37)) {
running = true;
} else {
running = false;
}
}
if (!ground.hitTest(player._x, player._y + 10, true)) {
falling = true;
grounded = false;
}
if (ground.hitTest(player._x, player._y + 11, true)) {
doubleJumping = false;
doubleJump = false;
jump = true;
grounded = true;
falling = false;
while (ground.hitTest(player._x, player._y + 9, true)) {
player._y--;
}
}
if (falling == true) {
gravity = gravity + gravityaccel;
} else {
gravity = 0;
}
if (inControl) {
if ((Key.isDown(39) && (xaccel < maxaccel)) && (falling == true)) {
xaccel = xaccel + (runaccelamt - airrisist);
} else if ((Key.isDown(37) && (xaccel > (-maxaccel))) && (falling == true)) {
xaccel = xaccel - (runaccelamt - airrisist);
} else if ((Key.isDown(37) && (xaccel > (-maxaccel))) && (falling == false)) {
xaccel = xaccel - runaccelamt;
} else if ((Key.isDown(39) && (xaccel < maxaccel)) && (falling == false)) {
xaccel = xaccel + runaccelamt;
} else if (grounded == true) {
if (xaccel > 0) {
xaccel = xaccel - friction;
}
if (xaccel < 0) {
xaccel = xaccel + friction;
}
if ((xaccel < 0) && (xaccel > friction)) {
xaccel = 0;
}
if ((xaccel > 0) && (xaccel < friction)) {
xaccel = 0;
}
} else {
if (xaccel > 0) {
xaccel = xaccel - airrisist;
}
if (xaccel < 0) {
xaccel = xaccel + airrisist;
}
if ((xaccel < 0) && (xaccel > airrisist)) {
xaccel = 0;
}
if ((xaccel > 0) && (xaccel < airrisist)) {
xaccel = 0;
}
}
}
if (_root.ground.hitTest(this._x, this._y - 11, true)) {
gravity = 1;
while (_root.ground.hitTest(this._x, this._y - 10, true)) {
this._y++;
}
}
if (xaccel > 0) {
player._xscale = 100;
}
if (xaccel < 0) {
player._xscale = -100;
}
if (!Key.isDown(38)) {
pressOnce = 0;
}
if (inControl) {
if (Key.isDown(38) && (jump == true)) {
gravity = gravity - (Math.cos(3.141593 * ((player._rotation * -1) / 180)) * maxjump);
jump = false;
doubleJump = true;
pressOnce = 1;
}
}
leftx = player._x + (Math.cos(3.141593 * (((player._rotation * -1) + 180) / 180)) * 7);
lefty = player._y - (Math.sin(3.141593 * (((player._rotation * -1) + 180) / 180)) * 500);
rightx = player._x + (Math.cos(3.141593 * ((player._rotation * -1) / 180)) * 7);
righty = player._y - (Math.sin(3.141593 * ((player._rotation * -1) / 180)) * 500);
if (ground.hitTest(leftx, lefty, true)) {
xaccel = 0;
player._x++;
}
if (ground.hitTest(rightx, righty, true)) {
xaccel = 0;
player._x--;
}
hud.whateverTheInvisibilityBarIsCalled._xscale = power;
hud.whateverTheHealthBarIsCalled._xscale = health;
if (ingame) {
cam._x = _root.player._x;
cam._y = _root.player._y - 30;
cam.camControl();
}
player._y = player._y + gravity;
player._x = player._x + xaccel;
hud._x = cam._x;
hud._y = cam._y;
hud._xscale = cam.lens._xscale;
hud._yscale = cam.lens._yscale;
if (_global.goToTitle) {
stopAllSounds();
removeStuff();
gotoAndStop ("title");
}
if (_global.levelDone) {
removeStuff();
nextFrame();
}
};
Frame 25
stop();
cam._x = csTest._x;
cam._y = csTest._y;
Instance of Symbol 190 MovieClip in Frame 25
on (release) {
getURL ("http://www.deadfrontier.com/index.php?cp=neilNightcrawlers&sid=4", "_blank");
}
Symbol 2 MovieClip [sniper] Frame 1
type = "sniper";
if (!Key.isDown(70)) {
pressed = false;
}
onEnterFrame = function () {
if (!(_parent._name === "gun")) {
if (_root.guy.hitTest(this) && (_root.intank == false)) {
_root.cam["hitgun" + type] = true;
if (Key.isDown(70) && (pressed == false)) {
_root.cam["hitgun" + type] = false;
_root.arm.gun.attachMovie(type, "dwa", 1);
dgun = _root.arm.cgun;
_root.arm.cgun = type;
_root.attachMovie(dgun, dgun + this.getDepth(), this.getDepth(), {_x:_x, _y:_y});
pressed = true;
}
if (!Key.isDown(70)) {
pressed = false;
}
} else {
_root.cam["hitgun" + type] = false;
}
}
};
Symbol 4 MovieClip [pistol] Frame 1
type = "pistol";
if (!Key.isDown(70)) {
pressed = false;
}
onEnterFrame = function () {
if (!(_parent._name === "gun")) {
if (_root.guy.hitTest(this) && (_root.intank == false)) {
_root.cam["hitgun" + type] = true;
if (Key.isDown(70) && (pressed == false)) {
_root.cam["hitgun" + type] = false;
_root.arm.gun.attachMovie(type, "dwa", 1);
dgun = _root.arm.cgun;
_root.arm.cgun = type;
_root.attachMovie(dgun, dgun + this.getDepth(), this.getDepth(), {_x:_x, _y:_y});
pressed = true;
}
if (!Key.isDown(70)) {
pressed = false;
}
} else {
_root.cam["hitgun" + type] = false;
}
}
};
Symbol 6 MovieClip [assault] Frame 1
type = "assault";
if (!Key.isDown(70)) {
pressed = false;
}
onEnterFrame = function () {
if (!(_parent._name === "gun")) {
if (_root.guy.hitTest(this) && (_root.intank == false)) {
_root.cam["hitgun" + type] = true;
if (Key.isDown(70) && (pressed == false)) {
_root.cam["hitgun" + type] = false;
_root.arm.gun.attachMovie(type, "dwa", 1);
dgun = _root.arm.cgun;
_root.arm.cgun = type;
pressed = true;
_root.attachMovie(dgun, dgun + this.getDepth(), this.getDepth(), {_x:_x, _y:_y});
}
if (!Key.isDown(70)) {
pressed = false;
}
} else {
_root.cam["hitgun" + type] = false;
}
}
};
Symbol 8 MovieClip Frame 2
this._parent.spd = 130;
Symbol 8 MovieClip Frame 3
this._parent.spd = _root.bulletspd;
stop();
Symbol 9 MovieClip [tankshell] Frame 1
if (_root.water.hitTest(_x, _y, true)) {
water = true;
} else {
water = false;
}
if (_root.tank._xscale == 100) {
left = true;
}
onEnterFrame = function () {
if (left == true) {
this._x = this._x + (Math.cos((_rotation * 3.141593) / 180) * spd);
this._y = this._y + (Math.sin((_rotation * 3.141593) / 180) * spd);
} else {
this._x = this._x + (Math.cos(((_rotation - 180) * 3.141593) / 180) * spd);
this._y = this._y + (Math.sin(((_rotation - 180) * 3.141593) / 180) * spd);
}
if (_root.ground.hitTest(_x, _y, true)) {
removeMovieClip(this);
}
if (_root.water.hitTest(_x, _y, true)) {
spd = spd / 1.2;
if (water == false) {
_root.water.attachMovie("splash", _name + "splash", _root.water.getNextHighestDepth(), {_x:_x - _root.water._x, _y:_y - _root.water._y, _xscale:50});
water = true;
}
} else if (water == true) {
_root.water.attachMovie("splash", _name + "splash", _root.water.getNextHighestDepth(), {_x:_x - _root.water._x, _y:(_y - _root.water._y) + 2, _xscale:50});
water = false;
}
if (spd < 0.1) {
removeMovieClip(this);
}
if ((spd < 3) && (!_root.water.hitTest(_x, _y, true))) {
removeMovieClip(this);
}
};
Symbol 11 MovieClip [shotgun] Frame 1
type = "shotgun";
if (!Key.isDown(70)) {
pressed = false;
}
onEnterFrame = function () {
if (!(_parent._name === "gun")) {
if (_root.guy.hitTest(this) && (_root.intank == false)) {
_root.cam["hitgun" + type] = true;
if (Key.isDown(70) && (pressed == false)) {
_root.cam["hitgun" + type] = false;
_root.arm.gun.attachMovie(type, "dwa", 1);
dgun = _root.arm.cgun;
_root.arm.cgun = type;
pressed = true;
_root.attachMovie(dgun, dgun + this.getDepth(), this.getDepth(), {_x:_x, _y:_y});
}
if (!Key.isDown(70)) {
pressed = false;
}
} else {
_root.cam["hitgun" + type] = false;
}
}
};
Symbol 13 MovieClip [blood] Frame 1
gravity = 0;
onEnterFrame = function () {
_y = (_y + yspd);
_x = (_x + xspd);
if (_root.ground.hitTest(_x, _y + 1, true)) {
_alpha = (_alpha - 5);
xspd = 0;
yspd = 0;
while (_root.ground.hitTest(_x, _y, true)) {
_y = (_y-1);
_y = (_y-1);
}
} else {
gravity = gravity + 0.2;
_y = (_y + gravity);
}
if (_alpha <= 0) {
removeMovieClip(this);
}
};
Symbol 15 MovieClip Frame 2
stop();
Symbol 16 MovieClip [bullet] Frame 1
function hitsomeone(person) {
if (_root[person].died != true) {
hydif = Math.abs(_root[person + "head"]._y - looky);
bydif = Math.abs(_root[person + "body"]._y - looky);
nydif = Math.abs(_root[person + "neck"]._y - looky);
xdif = _root[person]._x - _x;
if (hydif < nydif) {
hitarea = "head";
} else if (nydif < bydif) {
hitarea = "neck";
} else {
hitarea = "body";
}
if (hitarea == "head") {
_root[person].dead = hitarea;
_root[person].deathway = xdif;
_root[person].hitx = lookx;
_root[person].hity = looky;
_root[person].hp = _root[person].hp - damage;
removeMovieClip(this);
}
if (hitarea == "neck") {
_root[person].dead = hitarea;
_root[person].deathway = xdif;
_root[person].hitx = lookx;
_root[person].hity = looky;
removeMovieClip(this);
}
if (hitarea == "body") {
_root[person].dead = hitarea;
_root[person].deathway = xdif;
_root[person].hitx = lookx;
_root[person].hity = looky;
_root[person].hp = _root[person].hp - (damage / 4);
removeMovieClip(this);
}
}
}
spd = _root.bulletspd;
left = false;
if (typelol == "shot") {
damage = 50;
} else {
damage = 100;
}
if (_root.water.hitTest(_x, _y, true)) {
water = true;
} else {
water = false;
}
if (_root[shooter]._xscale == 100) {
left = true;
}
bcount = 0;
onEnterFrame = function () {
if (spd < 0.1) {
removeMovieClip(this);
}
if ((spd < 3) && (!_root.water.hitTest(_x, _y, true))) {
removeMovieClip(this);
}
if (left == true) {
this._x = this._x + (Math.cos((_rotation * 3.141593) / 180) * spd);
this._y = this._y + (Math.sin((_rotation * 3.141593) / 180) * spd);
} else {
this._x = this._x + (Math.cos(((_rotation - 180) * 3.141593) / 180) * spd);
this._y = this._y + (Math.sin(((_rotation - 180) * 3.141593) / 180) * spd);
}
j = 0;
while (j < spd) {
if (left == true) {
lookx = _x + (Math.cos((_rotation * 3.141593) / 180) * j);
looky = _y + (Math.sin((_rotation * 3.141593) / 180) * j);
} else {
lookx = _x + (Math.cos(((_rotation - 180) * 3.141593) / 180) * j);
looky = _y + (Math.sin(((_rotation - 180) * 3.141593) / 180) * j);
}
if (shooter == "guy") {
if (_root.enemy.hitTest(lookx, looky, true)) {
_root.crosshair.n.gotoAndPlay(2);
hitsomeone("enemy");
}
} else if (_root.guy.hitTest(lookx, looky, true)) {
hitsomeone("guy");
}
if (_root.ground.hitTest(lookx, looky, true)) {
_x = lookx;
_y = looky;
spd = 0;
}
j = j + (spd / 5);
}
if (_root.water.hitTest(_x, _y, true)) {
spd = spd / 1.3;
if (water == false) {
_root.water.attachMovie("splash", _name + "splash", _root.water.getNextHighestDepth(), {_x:_x - _root.water._x, _y:_y - _root.water._y, _xscale:50});
water = true;
}
} else if (water == true) {
_root.water.attachMovie("splash", _name + "splash", _root.water.getNextHighestDepth(), {_x:_x - _root.water._x, _y:(_y - _root.water._y) + 2, _xscale:50});
water = false;
}
};
Symbol 18 MovieClip [bubble] Frame 1
onEnterFrame = function () {
if (!_root.water.hitTest(_x, _y, true)) {
removeMovieClip(this);
}
if (_root.ground.hitTest(_x + (_width / 2), _y + (_width / 2), true)) {
_x = (_x-1);
_x = (_x-1);
}
if (_root.ground.hitTest(_x - (_width / 2), _y + (_width / 2), true)) {
_x = (_x+1);
_x = (_x+1);
}
_y = (_y - 0.5);
_x = (_x + (Math.round(Math.random()) - Math.round(Math.random())));
};
Symbol 29 MovieClip [splash] Frame 29
removeMovieClip(this);
Symbol 43 MovieClip Frame 1
myButton.onRelease = function () {
if (clickTAG.substr(0, 5) == "http:") {
getURL (clickTAG, "_blank");
}
};
Symbol 43 MovieClip Frame 240
gotoAndPlay ("start");
Symbol 77 MovieClip Frame 5
stop();
Symbol 82 MovieClip Frame 10
stop();
Symbol 85 MovieClip Frame 5
stop();
Symbol 94 MovieClip Frame 30
stop();
Symbol 95 MovieClip Frame 1
_root.stop();
Symbol 95 MovieClip Frame 175
_root.play();
stopAllSounds();
Symbol 101 MovieClip Frame 1
function camControl() {
parentColor.setTransform(camColor.getTransform());
var _local3 = sX / this._width;
var _local4 = sY / this._height;
_parent._x = cX - (this._x * _local3);
_parent._y = cY - (this._y * _local4);
_parent._xscale = 100 * _local3;
_parent._yscale = 100 * _local4;
}
stop();
this._visible = true;
var oldMode = Stage.scaleMode;
Stage.scaleMode = "exactFit";
var cX = (Stage.width / 2);
var cY = (Stage.height / 2);
var sX = Stage.width;
var sY = Stage.height;
Stage.scaleMode = oldMode;
camControl();
Symbol 110 MovieClip Frame 12
stop();
Symbol 113 Button
on (release) {
gotoAndPlay (2);
_root.soundstatus = "off";
}
Symbol 114 MovieClip Frame 11
stop();
Symbol 116 Button
on (release) {
gotoAndPlay (1);
_root.soundstatus = "on";
}
Symbol 117 MovieClip Frame 1
stop();
Symbol 117 MovieClip Frame 2
stop();
Instance of Symbol 121 MovieClip in Symbol 122 MovieClip [sound_contr] Frame 1
onClipEvent (load) {
_root.soundstatus = "on";
_root.mySound = new Sound(_level0);
_root.mySound2 = new Sound(_level1);
_root.mySound3 = new Sound(_level2);
_root.mySound4 = new Sound(_level3);
_root.mySound5 = new Sound(_level4);
maxvolume = 100;
minvolume = 0;
}
onClipEvent (enterFrame) {
if (_root.soundstatus == "on") {
step = 5;
}
if (_root.soundstatus == "off") {
step = -5;
}
maxvolume = maxvolume + step;
if (maxvolume > 100) {
maxvolume = 100;
}
if (maxvolume < 0) {
maxvolume = 0;
}
_root.mySound.setVolume(maxvolume);
_root.mySound2.setVolume(maxvolume);
_root.mySound3.setVolume(maxvolume);
_root.mySound4.setVolume(maxvolume);
_root.mySound5.setVolume(maxvolume);
}
Instance of Symbol 148 MovieClip in Symbol 151 MovieClip Frame 1
/* no clip actions */
Symbol 186 MovieClip Frame 660
stopAllSounds();
Symbol 187 MovieClip Frame 1
_root.stop();
Symbol 187 MovieClip Frame 1045
_root.play();
Symbol 223 MovieClip Frame 1
stop();
Symbol 226 MovieClip Frame 1
stop();
Symbol 226 MovieClip Frame 2
stop();
Symbol 234 MovieClip Frame 15
gotoAndPlay (9);
Symbol 242 MovieClip Frame 26
stop();
Symbol 243 MovieClip Frame 1
stop();
Symbol 243 MovieClip Frame 2
stop();
Symbol 243 MovieClip Frame 3
stop();
Symbol 243 MovieClip Frame 4
stop();
Symbol 243 MovieClip Frame 5
stop();
Symbol 243 MovieClip Frame 6
stop();
Symbol 243 MovieClip Frame 7
stop();
Symbol 243 MovieClip Frame 8
stop();
Symbol 243 MovieClip Frame 9
stop();
Symbol 243 MovieClip Frame 10
stop();
Symbol 243 MovieClip Frame 11
stop();
Symbol 257 MovieClip Frame 39
stop();
Symbol 258 MovieClip Frame 1
stop();
Symbol 268 MovieClip Frame 1
function camControl() {
parentColor.setTransform(camColor.getTransform());
var _local3 = sX / this._width;
var _local4 = sY / this._height;
_parent._x = cX - (this._x * _local3);
_parent._y = cY - (this._y * _local4);
_parent._xscale = 100 * _local3;
_parent._yscale = 100 * _local4;
}
stop();
this._visible = true;
var oldMode = Stage.scaleMode;
Stage.scaleMode = "exactFit";
var cX = (Stage.width / 2);
var cY = (Stage.height / 2);
var sX = Stage.width;
var sY = Stage.height;
Stage.scaleMode = oldMode;
camControl();
Symbol 277 MovieClip Frame 1
stop();
Symbol 277 MovieClip Frame 2
stop();
Symbol 281 MovieClip Frame 1
stop();
Symbol 281 MovieClip Frame 2
stop();
Symbol 282 MovieClip Frame 1
stop();
Symbol 282 MovieClip Frame 2
stop();
Instance of Symbol 281 MovieClip in Symbol 282 MovieClip Frame 2
on (release) {
_global.levelDone = true;
}
on (rollOver) {
this.gotoAndStop("over");
}
on (rollOut) {
this.gotoAndStop("up");
}
Instance of Symbol 277 MovieClip in Symbol 283 MovieClip Frame 1
on (release) {
_global.goToTitle = true;
}
on (rollOver) {
this.gotoAndStop("over");
}
on (rollOut) {
this.gotoAndStop("up");
}
Instance of Symbol 190 MovieClip in Symbol 283 MovieClip Frame 1
on (release) {
getURL ("http://www.deadfrontier.com/index.php?cp=neilNightcrawlers&sid=3", "_blank");
}
Symbol 321 MovieClip Frame 1
_root.stop();
Symbol 321 MovieClip Frame 95
_root.play();
Symbol 339 MovieClip Frame 1
_root.stop();
Symbol 339 MovieClip Frame 95
_root.play();
Symbol 354 MovieClip Frame 1
_root.stop();
Symbol 354 MovieClip Frame 95
_root.play();
Instance of Symbol 277 MovieClip in Symbol 357 MovieClip Frame 1
on (release) {
_root.gotoAndStop("title");
}
on (rollOver) {
this.gotoAndStop("over");
}
on (rollOut) {
this.gotoAndStop("up");
}