Frame 1
ver = "1.0.1";
mapn = 9;
stop();
_quality = "BEST";
Stage.showMenu = false;
fscommand ("allowscale", false);
userHitPlay = false;
mainMenu_soundLoop = false;
_root.settings = SharedObject.getLocal("settings");
if (isNaN(_root.settings.data.soundVol)) {
settings.data.soundVol = 50;
settings.data.musicVol = 50;
settings.data.effects = 2;
settings.data.qualitys = 2;
settings.data.sounds = true;
settings.data.crosshair = true;
settings.data.console = false;
settings.data.guidance = true;
settings.data.showfps = false;
settings.data.mm_loop = true;
settings.flush();
}
_root.stats = SharedObject.getLocal("stats");
if (isNaN(stats.data.map)) {
stats.data.timePlayed = 0;
stats.data.map = 1;
stats.data.sup = "Hey. You've just found another easter egg. Congrats - you gained nothing :)!";
stats.flush();
}
Instance of Symbol 57 MovieClip "loader" in Frame 1
onClipEvent (enterFrame) {
if (_root.userHitPlay) {
if (this._alpha > 0) {
this._alpha = this._alpha - 10;
}
if (this._alpha <= 0) {
_root.gotoAndStop("intro");
}
}
}
Frame 3
stop();
Frame 4
function gotoLevel(num) {
mainmenu.menu_loop_playing = false;
mainMenu_soundLoop = false;
mainMenu_sound.stop();
mapn = num;
_root.gotoAndStop("play");
}
stop();
nextMap = "mainmenu";
var allsound = new Sound(this);
var musicVol = new Sound();
_root.settings = SharedObject.getLocal("settings");
if (settings.data.mm_loop == undefined) {
settings.data.mm_loop = mainMenu_soundLoop;
settings.flush();
}
mainmenu.menu_loop_playing = settings.data.mm_loop;
portalver = (((((("Portal " + ver) + newline) + "website - portal.wecreatestuff.com") + newline) + "Dragy2005@hotmail.com") + newline) + "Henmazolski@gmail.com";
credits = portalver;
Frame 5
function removeMC(mc) {
var _local2 = _root.getInstanceAtDepth(0);
mc.swapDepths(0);
mc.removeMovieClip();
if (_local2 != undefined) {
_local2.swapDepths(0);
}
}
function removeTF(tf) {
var _local2 = _root.getInstanceAtDepth(0);
tf.swapDepths(0);
tf.removeTextField();
if (_local2 != undefined) {
_local2.swapDepths(0);
}
}
function stopMovies(mov) {
for (movs in mov) {
if (typeof(mov[movs]) == "movieclip") {
mov[movs].stop();
stopMovies(mov[movs]);
}
}
}
function playMovies(mov) {
for (movs in mov) {
if (typeof(mov[movs]) == "movieclip") {
if (mov[movs]._totalframes == 2) {
} else {
mov[movs].play();
}
playMovies(mov[movs]);
}
}
}
function stopPlayMoviesFunc(playthem) {
if (playthem == true) {
playMovies(bg);
playMovies(p1);
} else {
stopMovies(bg);
stopMovies(p1);
}
}
function startSound(sound) {
if (_root.sounds) {
if (sound == "ballbounce") {
ballBounce = new Sound();
ballBounce.attachSound(["ballbounce" + Math.floor((Math.random() * 2) + 1)]);
ballBounce.start();
} else if (sound == "zomgowned!!") {
}
}
}
function deleteAllMCs(mov) {
for (movs in mov) {
if (typeof(mov[movs]) == "movieclip") {
removeMC(mov[movs]);
}
}
}
function deleteAllTFs(txtf) {
for (txtfs in txtf) {
if (typeof(txtf[txtfs]) == "object") {
removeTF(txtf[txtfs]);
removeMC(txtf[txtfs]);
}
}
}
function deleteAllOs(obj) {
for (objs in obj) {
if (typeof(obj[objs]) == "object") {
removeMC(obj[objs]);
}
}
}
function deleteAllNs(num) {
for (nums in num) {
if (typeof(num[nums]) == "number") {
removeMC(num[nums]);
}
}
}
function deleteAllBs(boo) {
for (boos in boo) {
if (typeof(boo[boos]) == "boolean") {
removeMC(boo[boos]);
}
}
}
function exitToMainMenu() {
clearMap();
deleteAllTFs(this);
deleteAllMCs(_root);
deleteAllOs(_root);
deleteAllNs(_root);
deleteAllBs(_root);
Mouse.show();
stopAllSounds();
_root.gotoAndStop("mainmenu");
}
function spawnObject(spawnx, spawny, dir) {
if (toolSelected == "cam") {
createCam(spawnx, spawny);
} else if (toolSelected == "box") {
createBox(spawnx, spawny);
} else if (toolSelected == "turretr") {
createTurret(spawnx, spawny, "right");
} else if (toolSelected == "turretl") {
createTurret(spawnx, spawny, "left");
} else if (toolSelected == "ball") {
createBall(spawnx, spawny, "up");
}
}
function hpRegen(wasHP, regenNum) {
if (wasHP == playerHP) {
playerHP = 100;
}
clearInterval(_root["hpRegenCheck" + regenNum]);
}
function removeEffect(num) {
removeMC(_root["effect" + num]);
clearInterval(_root[("effect" + num) + "_int"]);
_root.mine++;
}
function createMetalColEffect(xeffect, yeffect) {
if ((isNaN(xeffect) == false) or (isNaN(yeffect) == false)) {
duplicateMovieClip (_root.metal1, ["effect" + _root.maxe], _root.getNextHighestDepth());
_root["effect" + _root.maxe]._x = xeffect;
_root["effect" + _root.maxe]._y = yeffect;
_root[("effect" + maxe) + "_int"] = setInterval(_root, "removeEffect", 500, maxe);
if (sounds) {
metalcol_s = new Sound();
metalcol_s.attachSound("metal_s" + Math.floor((Math.random() * 3) + 1));
metalcol_s.start();
}
_root.maxe++;
depthFix();
}
}
function createBloodColEffect(xeffect, yeffect, rotation) {
if ((isNaN(xeffect) == false) or (isNaN(yeffect) == false)) {
duplicateMovieClip (_root["blood" + Math.floor((Math.random() * 3) + 1)], ["effect" + _root.maxe], _root.getNextHighestDepth());
_root["effect" + _root.maxe]._x = xeffect;
_root["effect" + _root.maxe]._y = yeffect;
_root["effect" + _root.maxe]._rotation = rotation;
_root[("effect" + maxe) + "_int"] = setInterval(_root, "removeEffect", 1000, maxe);
if (sounds) {
blood_s = new Sound();
blood_s.attachSound("blood_s" + Math.floor((Math.random() * 3) + 1));
blood_s.start();
}
_root.maxe++;
depthFix();
}
}
function createBloodBGEffect(xeffect, yeffect) {
if ((isNaN(xeffect) == false) or (isNaN(yeffect) == false)) {
runbge++;
if (runbge > maxebg) {
runbge = 1;
}
if (!isNaN(_root["bgeffect" + _root.runbge]._x)) {
removeMC(_root["bgeffect" + _root.runbge]);
}
duplicateMovieClip (_root.bloodstains, ["bgeffect" + _root.runbge], _root.getNextHighestDepth());
_root["bgeffect" + _root.runbge]._x = xeffect;
_root["bgeffect" + _root.runbge]._y = yeffect - 10;
_root["bgeffect" + _root.runbge]._rotation = Math.floor((Math.random() * 360) + 1);
_root["bgeffect" + _root.runbge].gotoAndStop(Math.floor((Math.random() * 8) + 1));
depthFix();
}
}
function createDustBGEffect(xeffect, yeffect, dir) {
if ((isNaN(xeffect) == false) or (isNaN(yeffect) == false)) {
runbge++;
if (runbge > maxebg) {
runbge = 1;
}
if (!isNaN(_root["bgeffect" + _root.runbge]._x)) {
removeMC(_root["bgeffect" + _root.runbge]);
}
duplicateMovieClip (_root.dust1, ["bgeffect" + _root.runbge], _root.getNextHighestDepth());
_root["bgeffect" + _root.runbge]._x = xeffect;
_root["bgeffect" + _root.runbge]._y = yeffect;
if (sounds) {
concrete_s = new Sound();
concrete_s.attachSound("concrete_s" + Math.floor((Math.random() * 3) + 1));
concrete_s.start();
}
bge_c_n = false;
bge_c_e = false;
bge_c_s = false;
bge_c_w = false;
if (isHitMap(xeffect + 10, yeffect)) {
bge_c_e = true;
}
if (isHitMap(xeffect, yeffect - 10)) {
bge_c_n = true;
}
if (isHitMap(xeffect - 10, yeffect)) {
bge_c_w = true;
}
if (isHitMap(xeffect, yeffect + 10)) {
bge_c_s = true;
}
if ((bge_c_w and bge_c_e) and (!bge_c_s)) {
_root["bgeffect" + _root.runbge]._rotation = 180;
_root["bgeffect" + _root.runbge]._y = _root["bgeffect" + _root.runbge]._y + Math.floor((Math.random() * 10) - 2);
} else if ((bge_c_w and bge_c_e) and (!bge_c_n)) {
_root["bgeffect" + _root.runbge]._rotation = 0;
_root["bgeffect" + _root.runbge]._y = _root["bgeffect" + _root.runbge]._y + Math.floor((Math.random() * -10) + 4);
} else if ((bge_c_n and bge_c_s) and (!bge_c_e)) {
_root["bgeffect" + _root.runbge]._rotation = 90;
_root["bgeffect" + _root.runbge]._x = _root["bgeffect" + _root.runbge]._x + Math.floor((Math.random() * -21) + 11);
} else if ((bge_c_n and bge_c_s) and (!bge_c_w)) {
_root["bgeffect" + _root.runbge]._rotation = -90;
_root["bgeffect" + _root.runbge]._x = _root["bgeffect" + _root.runbge]._x + Math.floor((Math.random() * -21) + 11);
} else {
_root["bgeffect" + _root.runbge]._rotation = dir;
}
depthFix();
}
}
function isHitMap(xpoint, ypoint) {
if (_root.bg.ground.hitTest(xpoint, ypoint, true)) {
return(true);
}
if (_root.bg.wall.hitTest(xpoint, ypoint, true)) {
return(true);
}
phyn = 1;
while (phyn < _root.maxphys) {
if (_root["phybox" + phyn].hitTest(xpoint, ypoint, true)) {
return(true);
}
phyn++;
}
return(false);
}
function createCrusher(xcrusher, ycrusher, xscale, speed) {
if ((isNaN(xcrusher) == false) or (isNaN(ycrusher) == false)) {
duplicateMovieClip (_root.crusher, ["crusher" + _root.maxo_cr], _root.getNextHighestDepth());
_root["crusher" + _root.maxo_cr]._x = xcrusher;
_root["crusher" + _root.maxo_cr]._y = ycrusher;
_root["crusher" + _root.maxo_cr].Active = false;
_root["crusher" + _root.maxo_cr].Done = false;
if (isNaN(speed) == false) {
_root["crusher" + _root.maxo_cr].Speed = speed;
} else {
_root["crusher" + _root.maxo_cr].Speed = 2;
}
if (isNaN(xscale) == false) {
_root["crusher" + _root.maxo_cr]._xscale = xscale;
}
createPhysbox(0, 0, _root["crusher" + _root.maxo_cr]._width - 50, 20, false, _root["crusher" + _root.maxo_cr], "crusher");
_root.maxo_cr++;
depthFix();
trace("crusher created!");
}
}
function removeCrusher() {
_root.maxo_cr--;
trace(("removeCrusher has sent " + _root["crusher" + _root.maxo_cr]) + " to deletion");
removeMC(_root["crusher" + _root.maxo_cr]);
}
function stopZappin(delay, duration, zap_n) {
turnZappin(zap_n, false);
_root[("zapper" + zap_n) + "_int_start"] = setInterval(_root, "startZappin", delay, delay, duration, zap_n);
_root[("zapper" + zap_n) + "_sound_charge"] = setInterval(_root, "chargeZappinSound", delay - 2000, zap_n);
_root[("zapper" + zap_n) + "_sound1"].stop("elec_work");
_root[("zapper" + zap_n) + "_sound2"].stop("elec_start");
if (_root.sounds and _root.running) {
_root[("zapper" + zap_n) + "_sound1"] = new Sound(_root[("zapper" + zap_n) + "up"]);
_root[("zapper" + zap_n) + "_sound1"].attachSound("elec_stop");
_root[("zapper" + zap_n) + "_sound1"].start();
_root[("zapper" + zap_n) + "_sound1"].setVolume(40);
}
clearInterval(_root[("zapper" + zap_n) + "_int_stop"]);
}
function startZappin(delay, duration, zap_n) {
turnZappin(zap_n, true);
_root[("zapper" + zap_n) + "_int_stop"] = setInterval(_root, "stopZappin", duration, delay, duration, zap_n);
_root[("zapper" + zap_n) + "_sound1"].stop("elec_charge");
if (_root.sounds and _root.running) {
_root[("zapper" + zap_n) + "_sound1"] = new Sound(_root[("zapper" + zap_n) + "up"]);
_root[("zapper" + zap_n) + "_sound1"].attachSound("elec_work");
_root[("zapper" + zap_n) + "_sound1"].start(0, 2);
_root[("zapper" + zap_n) + "_sound1"].setVolume(40);
_root[("zapper" + zap_n) + "_sound2"] = new Sound(_root[("zapper" + zap_n) + "up"]);
_root[("zapper" + zap_n) + "_sound2"].attachSound("elec_start");
_root[("zapper" + zap_n) + "_sound2"].start();
_root[("zapper" + zap_n) + "_sound2"].setVolume(40);
}
clearInterval(_root[("zapper" + zap_n) + "_int_start"]);
}
function turnZappin(num, bol) {
_root[("zapper" + num) + "up"].Zappin = bol;
}
function chargeZappinSound(zap_n) {
if (_root.sounds and _root.running) {
_root[("zapper" + zap_n) + "_sound1"] = new Sound(_root[("zapper" + zap_n) + "up"]);
_root[("zapper" + zap_n) + "_sound1"].attachSound("elec_charge");
_root[("zapper" + zap_n) + "_sound1"].start();
_root[("zapper" + zap_n) + "_sound1"].setVolume(40);
}
clearInterval(_root[("zapper" + zap_n) + "_sound_charge"]);
}
function createZapper(zapperUpx, zapperUpy, zapperDownx, zapperDowny, xwidth, delay, duration) {
if (((((isNaN(zapperUpx) == false) and (isNaN(zapperUpy) == false)) and (isNaN(zapperDownx) == false)) and (isNaN(zapperDowny) == false)) and (isNaN(xwidth) == false)) {
duplicateMovieClip (_root.zapperUp, [("zapper" + _root.maxo_cr) + "up"], _root.getNextHighestDepth());
_root[("zapper" + _root.maxo_cr) + "up"]._x = zapperUpx;
_root[("zapper" + _root.maxo_cr) + "up"]._y = zapperUpy;
_root[("zapper" + _root.maxo_cr) + "up"].bar._width = xwidth;
_root[("zapper" + _root.maxo_cr) + "up"].rightc._x = _root[("zapper" + _root.maxo_cr) + "up"].bar._x + _root[("zapper" + _root.maxo_cr) + "up"].bar._width;
duplicateMovieClip (_root.zapperDown, [("zapper" + _root.maxo_cr) + "down"], _root.getNextHighestDepth());
_root[("zapper" + _root.maxo_cr) + "down"]._x = zapperDownx;
_root[("zapper" + _root.maxo_cr) + "down"]._y = zapperDowny;
_root[("zapper" + _root.maxo_cr) + "down"].bar._width = xwidth;
_root[("zapper" + _root.maxo_cr) + "down"].rightc._x = _root[("zapper" + _root.maxo_cr) + "down"].bar._x + _root[("zapper" + _root.maxo_cr) + "down"].bar._width;
_root[("zapper" + _root.maxo_cr) + "_gfilter"] = new flash.filters.GlowFilter(255, 1, 5, 5, 1.7, 3, false, false);
_root[("zapper" + _root.maxo_cr) + "_garray"] = new Array();
_root[("zapper" + _root.maxo_cr) + "_garray"].push(_root[("zapper" + _root.maxo_cr) + "_gfilter"]);
_root[("zapper" + _root.maxo_cr) + "up"].filters = _root[("zapper" + _root.maxo_cr) + "_garray"];
_root[("zapper" + _root.maxo_cr) + "down"].filters = _root[("zapper" + _root.maxo_cr) + "_garray"];
_root[("zapper" + _root.maxo_cr) + "up"].Active = false;
_root[("zapper" + _root.maxo_cr) + "up"].Delay = delay;
_root[("zapper" + _root.maxo_cr) + "up"].Dur = duration;
_root[("zapper" + _root.maxo_cr) + "up"].Zappin = false;
if (isNaN(delay)) {
delay = 3;
}
if (isNaN(duration)) {
duration = 4;
}
_root[("zapper" + maxo_za) + "_int_start"] = setInterval(this, "startZappin", delay * 1000, delay * 1000, duration * 1000, maxo_za);
_root[("zapper" + maxo_za) + "_sound_charge"] = setInterval(this, "chargeZappinSound", (delay * 1000) - 2000, maxo_za);
_root.maxo_za++;
depthFix();
trace("Zapper(s) created!");
}
}
function removeZapper() {
_root.maxo_za--;
_root[("zapper" + maxo_za) + "_sound1"].stop("elec_work");
_root[("zapper" + maxo_za) + "_sound2"].stop("elec_start");
_root[("zapper" + maxo_za) + "_sound1"].stop("elec_charge");
clearInterval(_root[("zapper" + maxo_za) + "_int_stop"]);
clearInterval(_root[("zapper" + maxo_za) + "_int_start"]);
clearInterval(_root[("zapper" + maxo_za) + "_sound_charge"]);
trace(("removeZapper has sent " + _root[("zapper" + _root.maxo_cr) + "down"]) + " to deletion");
trace(("removeZapper has sent " + _root[("zapper" + _root.maxo_cr) + "up"]) + " to deletion");
removeMC(_root[("zapper" + _root.maxo_cr) + "down"]);
removeMC(_root[("zapper" + _root.maxo_cr) + "up"]);
}
function createWallMover(xwm, ywm, dir, distance, speed) {
if ((isNaN(xwm) == false) or (isNaN(ywm) == false)) {
duplicateMovieClip (_root.wallMover, ["wallMover" + _root.maxo_wm], _root.getNextHighestDepth());
_root["wallMover" + _root.maxo_wm]._x = xwm;
_root["wallMover" + _root.maxo_wm]._y = ywm;
_root["wallMover" + _root.maxo_wm].Active = false;
_root["wallMover" + _root.maxo_wm].Done = false;
if (isNaN(speed) == false) {
_root["wallMover" + _root.maxo_wm].Speed = speed;
} else {
_root["wallMover" + _root.maxo_wm].Speed = 2;
}
if (isNaN(distance) == false) {
_root["wallMover" + _root.maxo_wm].Distance = distance;
} else {
_root["wallMover" + _root.maxo_wm].Distance = 50;
}
_root["wallMover" + _root.maxo_wm]._rotation = dir;
if ((dir == 0) or (dir == 180)) {
createPhysbox(0, 0, 20, _root["wallMover" + _root.maxo_wm]._height, true, _root["wallMover" + _root.maxo_wm], "wallMoverT");
createPhysbox(0, 0, 10, _root["wallMover" + _root.maxo_wm]._height, false, _root["wallMover" + _root.maxo_wm], "wallMoverF");
} else if ((dir == 90) or (dir == -90)) {
createPhysbox(0, 0, _root["wallMover" + _root.maxo_wm]._width, 20, true, _root["wallMover" + _root.maxo_wm], "wallMoverT");
createPhysbox(0, 0, _root["wallMover" + _root.maxo_wm]._width, 10, false, _root["wallMover" + _root.maxo_wm], "wallMoverF");
}
_root.maxo_wm++;
depthFix();
trace("wallmover created!");
}
}
function removeWallMover() {
_root.maxo_wm--;
trace(("removeWallMover has sent " + _root["wallMover" + _root.maxo_wm]) + " to deletion");
removeMC(_root["wallMover" + _root.maxo_wm]);
}
function createElevator(startx, starty, endx, endy, verti, speed, active) {
if ((isNaN(startx) == false) and (isNaN(starty) == false)) {
if (!verti) {
duplicateMovieClip (_root.elevator, ["elevator" + _root.maxo_el], _root.getNextHighestDepth());
_root["elevator" + _root.maxo_el]._x = startx;
_root["elevator" + _root.maxo_el]._y = starty;
if (active) {
_root["elevator" + _root.maxo_el].Active = true;
} else {
_root["elevator" + _root.maxo_el].Active = false;
}
_root["elevator" + _root.maxo_el].Verti = false;
_root["elevator" + _root.maxo_el].dirRight = true;
_root["elevator" + _root.maxo_el].startx = startx;
_root["elevator" + _root.maxo_el].starty = starty;
_root["elevator" + _root.maxo_el].endx = endx;
_root["elevator" + _root.maxo_el].endy = endy;
if (isNaN(endx)) {
_root["elevator" + _root.maxo_el].endx = _root["elevator" + _root.maxo_el].startx + 200;
_root["elevator" + _root.maxo_el].endy = _root["elevator" + _root.maxo_el].starty;
}
_root["elevator" + _root.maxo_el].xSpeed = 0;
_root["elevator" + _root.maxo_el].eleAccel = 0.2;
_root["elevator" + _root.maxo_el].eleMax = 4;
createPhysbox(0, 0, 100, 30, false, _root["elevator" + _root.maxo_el], "elevator");
_root.maxo_el++;
depthFix();
trace("elevator created!");
} else {
trace(verti + " verti?!");
}
}
}
function removeElevator() {
_root.maxo_el--;
trace(("removeElevator has sent " + _root["elevator" + _root.maxo_el]) + " to deletion");
removeMC(_root["elevator" + _root.maxo_el]);
}
function createBallIn(placex, placey, dir) {
if ((isNaN(placex) == false) and (isNaN(placey) == false)) {
duplicateMovieClip (_root.ballin, ["ballin" + _root.maxo_bi], _root.getNextHighestDepth());
_root["ballin" + _root.maxo_bi]._x = placex;
_root["ballin" + _root.maxo_bi]._y = placey;
_root["ballin" + _root.maxo_bi].Active = false;
if (dir == 90) {
_root["ballin" + _root.maxo_bi]._rotation = 90;
createPhysbox((placex - _root["ballin" + _root.maxo_bi]._width) + 10, placey, _root["ballin" + _root.maxo_bi]._width - 10, _root["ballin" + _root.maxo_bi]._height, false);
} else if (dir == -90) {
_root["ballin" + _root.maxo_bi]._rotation = -90;
createPhysbox(placex, placey - _root["ballin" + _root.maxo_bi]._height, _root["ballin" + _root.maxo_bi]._width - 10, _root["ballin" + _root.maxo_bi]._height, false);
} else if (dir == 0) {
_root["ballin" + _root.maxo_bi]._rotation = 0;
createPhysbox(placex, placey, _root["ballin" + _root.maxo_bi]._width, _root["ballin" + _root.maxo_bi]._height - 10, false);
} else if (dir == 180) {
_root["ballin" + _root.maxo_bi]._rotation = 180;
createPhysbox(placex, placey - _root["ballin" + _root.maxo_bi]._height, _root["ballin" + _root.maxo_bi]._width - 10, _root["ballin" + _root.maxo_bi]._height, false);
}
_root.maxo_bi++;
depthFix();
trace("ballin created!");
}
}
function removeBallIn() {
_root.maxo_bi--;
trace(("removeBallIn has sent " + _root["ballin" + _root.maxo_bi]) + " to deletion");
removeMC(_root["ballin" + _root.maxo_bi]);
}
function ballOutBall(placex, placey, dir, bo_n) {
trace("ballOutBall called");
if (playerAlive) {
createBall(placex, placey, dir);
}
_root["ballout" + bo_n].Creating = false;
clearInterval(_root[("ballout" + bo_n) + "_delay"]);
}
function createBallOut(placex, placey, dir, active) {
if ((isNaN(placex) == false) and (isNaN(placey) == false)) {
clearInterval(_root[("ballout" + bo_n) + "_delay"]);
duplicateMovieClip (_root.ballout, ["ballout" + _root.maxo_bo], _root.getNextHighestDepth());
_root["ballout" + _root.maxo_bo]._x = placex;
_root["ballout" + _root.maxo_bo]._y = placey;
_root["ballout" + _root.maxo_bo].Active = true;
_root["ballout" + _root.maxo_bo].Creating = false;
if (dir == 90) {
_root["ballout" + _root.maxo_bo]._rotation = 90;
createPhysbox(placex - _root["ballout" + _root.maxo_bo]._width, placey, _root["ballout" + _root.maxo_bo]._width, _root["ballout" + _root.maxo_bo]._height, false);
} else if (dir == -90) {
_root["ballout" + _root.maxo_bo]._rotation = -90;
createPhysbox(placex, placey - _root["ballout" + _root.maxo_bo]._height, _root["ballout" + _root.maxo_bo]._width, _root["ballout" + _root.maxo_bo]._height, false);
} else if (dir == 0) {
_root["ballout" + _root.maxo_bo]._rotation = 0;
createPhysbox(placex, placey, _root["ballout" + _root.maxo_bo]._width, _root["ballout" + _root.maxo_bo]._height, false);
} else if (dir == 180) {
_root["ballout" + _root.maxo_bo]._rotation = 180;
createPhysbox(placex - _root["ballout" + _root.maxo_bo]._width, placey - _root["ballout" + _root.maxo_bo]._height, _root["ballout" + _root.maxo_bo]._width, _root["ballout" + _root.maxo_bo]._height, false);
}
_root.maxo_bo++;
depthFix();
trace("ballout created!");
}
}
function removeBallOut() {
_root.maxo_bo--;
clearInterval(_root[("ballout" + maxo_bo) + "_delay"]);
trace(("removeBallOut has sent " + _root["ballout" + _root.maxo_bo]) + " to deletion");
removeMC(_root["ballout" + _root.maxo_bo]);
}
function createActivator(btnx, btny, type) {
if ((isNaN(btnx) == false) and (isNaN(btny) == false)) {
duplicateMovieClip (_root.activator, ["activator" + _root.maxo_a], _root.getNextHighestDepth());
_root["activator" + _root.maxo_a]._x = btnx;
_root["activator" + _root.maxo_a]._y = btny;
_root["activator" + _root.maxo_a].Active = false;
_root["activator" + _root.maxo_a].Pressing = false;
_root["activator" + _root.maxo_a].Type = 1;
if (type == 2) {
_root["activator" + _root.maxo_a].Type = 2;
}
createPhysbox(0, 0, 45, 15, false, _root["activator" + _root.maxo_a], "button");
_root.maxo_a++;
depthFix();
trace("activator created!");
}
}
function removeActivator() {
_root.maxo_a--;
trace(("removeActivator has sent " + _root["activator" + _root.maxo_a]) + " to deletion");
removeMC(_root["activator" + _root.maxo_a]);
}
function createDoor(doorx, doory, dir, distance) {
if ((isNaN(doorx) == false) or (isNaN(doory) == false)) {
duplicateMovieClip (_root.door, ["door" + _root.maxo_d], _root.getNextHighestDepth());
_root["door" + _root.maxo_d]._x = doorx;
_root["door" + _root.maxo_d]._y = doory;
if (dir == 90) {
_root["door" + _root.maxo_d]._rotation = 90;
} else if (dir == -90) {
_root["door" + _root.maxo_d]._rotation = -90;
} else if (dir == 0) {
_root["door" + _root.maxo_d]._rotation = 0;
} else if (dir == 180) {
_root["door" + _root.maxo_d]._rotation = 180;
}
_root["door" + _root.maxo_d].Distance = distance;
_root["door" + _root.maxo_d].Closed = true;
_root["door" + _root.maxo_d].Active = true;
if ((_root["door" + _root.maxo_d]._rotation == 180) or (_root["door" + _root.maxo_d]._rotation == 0)) {
createPhysbox(0, 0, _root["door" + _root.maxo_d]._width, _root["door" + _root.maxo_d].Distance, false, _root["door" + _root.maxo_d], "doorh");
} else {
createPhysbox(0, 0, _root["door" + _root.maxo_d].Distance, _root["door" + _root.maxo_d]._height, false, _root["door" + _root.maxo_d], "doorw");
}
_root.maxo_d++;
depthFix();
trace("door created!");
}
}
function removeDoor() {
_root.maxo_d--;
trace(("removeDoor has sent " + _root["door" + _root.maxo_d]) + " to deletion");
removeMC(_root["door" + _root.maxo_d]);
}
function createPhysbox(boxx, boxy, boxw, boxh, portalable, attached, type) {
if ((((isNaN(boxx) == false) and (isNaN(boxy) == false)) and (isNaN(boxw) == false)) and (isNaN(boxh) == false)) {
_root.createEmptyMovieClip("phybox" + maxphys, _root.getNextHighestDepth());
if (!portalable) {
_root["phybox" + maxphys].Portalable = false;
_root["phybox" + maxphys].beginFill(16711680, 50);
} else {
_root["phybox" + maxphys].Portalable = true;
_root["phybox" + maxphys].beginFill(8969013, 50);
}
_root["phybox" + maxphys].moveTo(boxx, boxy);
_root["phybox" + maxphys].lineTo(boxx + boxw, boxy);
_root["phybox" + maxphys].lineTo(boxx + boxw, boxy + boxh);
_root["phybox" + maxphys].lineTo(boxx, boxy + boxh);
_root["phybox" + maxphys].lineTo(boxx, boxy);
_root["phybox" + maxphys].endFill();
_root["phybox" + maxphys].xSpeed = 0;
if (attached != undefined) {
_root["phybox" + maxphys].Attached = attached;
_root["phybox" + maxphys].Type = type;
trace(attached);
}
if ((type == "doorw") and (_root["phybox" + maxphys].Attached._rotation == 90)) {
_root["phybox" + maxphys]._rotation = 180;
}
_root["phybox" + maxphys]._visible = false;
maxphys++;
depthFix();
trace("physbox created!");
}
}
function removeLastPhysbox() {
_root.maxphys--;
trace(("removeLastPhysbox has sent " + _root["phybox" + _root.maxphys]) + " to deletion");
removeMC(_root["phybox" + _root.maxphys]);
}
function removePortalFailE(mc, n) {
removeMC(mc);
clearInterval(_root["interval_shotFail" + n]);
}
function removeTurret() {
_root.maxt--;
trace(("removeTurret has sent " + _root["t" + _root.maxt]) + " to deletion");
trace(("removeTurret has sent " + _root[("t" + _root.maxt) + "_ray"]) + " to deletion");
trace(("removeTurret has sent " + _root[("t" + _root.maxt) + "_dline"]) + " to deletion");
trace(("removeTurret has sent " + _root[("t" + _root.maxt) + "_shot"]) + " to deletion");
removeMC(_root["t" + _root.maxt]);
removeMC(_root[("t" + _root.maxt) + "_ray"]);
removeMC(_root[("t" + _root.maxt) + "_dline"]);
removeMC(_root[("t" + _root.maxt) + "_shot"]);
}
function removeBox() {
_root.maxn--;
trace(("removeBox has sent " + _root["pbox" + _root.maxn]) + " to deletion");
trace(("removeBox has sent " + _root["p" + _root.maxn]) + " to deletion");
removeMC(_root["pbox" + _root.maxn]);
removeMC(_root["p" + _root.maxn]);
}
function removeCam() {
_root.maxc--;
trace(("removeBox has sent " + _root["c" + _root.maxc]) + " to deletion");
removeMC(_root["c" + _root.maxc]);
}
function shotDelay() {
_root.canShot = true;
clearInterval(interval_shotDelay);
}
function startLevelRunRight_timer() {
startLevelRunRight = false;
clearInterval(startLevelRunRight_time);
}
function depthFix() {
ebgdf = 1;
while (ebgdf < runbge) {
_root["bgeffect" + ebgdf].swapDepths(_root.getNextHighestDepth());
ebgdf++;
}
portal1l.swapDepths(_root.getNextHighestDepth());
portal2l.swapDepths(_root.getNextHighestDepth());
_root[("mc_s" + p1.portalFailE_n) - 1].swapDepths(_root.getNextHighestDepth());
bdf = 1;
while (bdf < _root.maxb) {
_root["b" + bdf].swapDepths(_root.getNextHighestDepth());
bdf++;
}
ndf = 2;
while (ndf < _root.maxn) {
_root["p" + ndf].swapDepths(_root.getNextHighestDepth());
ndf++;
}
tdf = 1;
while (tdf < _root.maxt) {
_root["t" + tdf].swapDepths(_root.getNextHighestDepth());
_root[("t" + tdf) + "_ray"].swapDepths(_root.getNextHighestDepth());
tdf++;
}
p1.swapDepths(_root.getNextHighestDepth());
edf = mine;
while (edf < _root.maxe) {
if (!isNaN(_root["effect" + edf]._x)) {
_root["effect" + edf].swapDepths(_root.getNextHighestDepth());
}
edf++;
}
bg_g.swapDepths(_root.getNextHighestDepth());
guideText.swapDepths(_root.getNextHighestDepth());
tipText.swapDepths(_root.getNextHighestDepth());
nl_frame.swapDepths(_root.getNextHighestDepth());
playerdead.swapDepths(_root.getNextHighestDepth());
pauseMenu.swapDepths(_root.getNextHighestDepth());
console.swapDepths(_root.getNextHighestDepth());
cursor.swapDepths(_root.getNextHighestDepth());
}
function createBall(ball_x, ball_y, ball_direction) {
if ((isNaN(ball_x) == false) or (isNaN(ball_y) == false)) {
duplicateMovieClip (_root.energyBall, ["b" + _root.maxb], this.getNextHighestDepth());
_root["b" + _root.maxb]._x = ball_x;
_root["b" + _root.maxb]._y = ball_y;
_root["b" + _root.maxb].exploding = false;
if ((ball_direction == "up") or (ball_direction == 180)) {
_root["b" + _root.maxb].xSpeed = 0;
_root["b" + _root.maxb].ySpeed = -_root.ballSpeed;
} else if ((ball_direction == "down") or (ball_direction == 0)) {
_root["b" + _root.maxb].xSpeed = 0;
_root["b" + _root.maxb].ySpeed = _root.ballSpeed;
} else if ((ball_direction == "right") or (ball_direction == 90)) {
_root["b" + _root.maxb].xSpeed = _root.ballSpeed;
_root["b" + _root.maxb].ySpeed = 0;
} else if ((ball_direction == "left") or (ball_direction == -90)) {
_root["b" + _root.maxb].xSpeed = -_root.ballSpeed;
_root["b" + _root.maxb].ySpeed = 0;
}
_root["b" + _root.maxb].fmaxSpeed = 24;
_root["b" + _root.maxb].jump = 1;
clearInterval(_root["interval_b" + _root.maxb]);
_root["b" + _root.maxb].timeAlive = 0;
_root["b" + _root.maxb].countOK = false;
_root["interval_b" + _root.maxb] = setInterval(this, "destroyBall", 1000, [_root.maxb]);
_root.maxb++;
depthFix();
}
}
function removeBallExp(mc, n) {
removeMC(mc);
clearInterval(_root["interval_ballexp" + n]);
}
function destroyBall(ballNumber) {
if (!isNaN(_root["b" + ballNumber]._x)) {
_root["b" + ballNumber].timeAlive++;
trace(_root["b" + ballNumber].timeAlive);
_root["b" + ballNumber].countOK = true;
if (_root["b" + ballNumber].timeAlive > ballLife) {
if (sounds) {
ballexp_sound = new Sound();
ballexp_sound.attachSound("ballExplode");
ballexp_sound.start();
}
duplicateMovieClip (_root.ballExp, ["ballExp" + ballNumber], this.getNextHighestDepth());
_root["ballExp" + ballNumber]._x = _root["b" + ballNumber]._x;
_root["ballExp" + ballNumber]._y = _root["b" + ballNumber]._y;
_root["interval_ballexp" + ballNumber] = setInterval(_root, "removeBallExp", 1400, _root["ballExp" + ballNumber], ballNumber);
removeBall(_root["b" + ballNumber]);
}
}
clearInterval(_root["interval_b" + ballNumber]);
}
function removeLastBall() {
_root.maxb--;
clearInterval(_root["interval_b" + maxb]);
clearInterval(_root[("ballout" + maxb) + "_delay"]);
trace(("removeLastBall has sent " + _root["b" + _root.maxb]) + " to deletion");
removeMC(_root["b" + _root.maxb]);
}
function removeBall(ballMC) {
trace(("removeBall has sent " + ballMC) + " to deletion");
removeMC(ballMC);
if (isNaN(_root["b" + (_root.maxb - 1)]._x)) {
maxb = 1;
trace("trstarted maxb s!");
}
}
function createBox(box_x, box_y) {
if ((isNaN(box_x) == false) or (isNaN(box_y) == false)) {
duplicateMovieClip (_root.box, ["p" + _root.maxn], _root.getNextHighestDepth());
_root["p" + _root.maxn]._x = box_x;
_root["p" + _root.maxn]._y = box_y;
_root["p" + _root.maxn].envSpeed = 0;
_root["p" + _root.maxn].xSpeed = 0;
_root["p" + _root.maxn].ySpeed = 0;
_root["p" + _root.maxn].fmaxSpeed = 24;
_root["p" + _root.maxn].jump = 1;
if (boxcreators) {
duplicateMovieClip (_root.boxcreator, ["pbox" + _root.maxn], _root.getNextHighestDepth());
_root["pbox" + _root.maxn]._x = box_x;
_root["pbox" + _root.maxn]._y = box_y - (_root["pbox" + _root.maxn]._height / 2);
_root["pbox" + _root.maxn].gotoAndStop("drop");
}
_root["p" + _root.maxn].spawnx = box_x;
_root["p" + _root.maxn].spawny = box_y;
_root["p" + _root.maxn]._alpha = 0;
_root.maxn++;
depthFix();
}
}
function createCam(cam_x, cam_y) {
if ((isNaN(cam_x) == false) or (isNaN(cam_y) == false)) {
duplicateMovieClip (_root.cam, ["c" + _root.maxc], _root.getNextHighestDepth());
_root["c" + _root.maxc]._x = cam_x;
_root["c" + _root.maxc]._y = cam_y;
_root.maxc++;
depthFix();
}
}
function createTurret(xturret, yturret, dir) {
if ((isNaN(xturret) == false) or (isNaN(yturret) == false)) {
clearInterval(_root[("t" + maxt) + "_shotDetectDelay"]);
clearInterval(_root[("t" + maxt) + "_shotDelay"]);
clearInterval(_root[("t" + maxt) + "_readyOff"]);
clearInterval(_root[("t" + maxt) + "_delayShot"]);
clearInterval(_root[("t" + maxt) + "_stopShooting"]);
clearInterval(_root[("t" + maxt) + "_turnActive"]);
duplicateMovieClip (_root.turrent, ["t" + _root.maxt], _root.getNextHighestDepth());
duplicateMovieClip (_root.ray, [("t" + _root.maxt) + "_ray"], _root.getNextHighestDepth());
_root["t" + _root.maxt]._x = xturret;
_root["t" + _root.maxt]._y = yturret;
_root["t" + _root.maxt].spawnx = xturret;
_root["t" + _root.maxt].spawny = yturret;
_root["t" + _root.maxt].spawnable = true;
_root["t" + _root.maxt].envSpeed = 0;
_root["t" + _root.maxt].xSpeed = 0;
_root["t" + _root.maxt].ySpeed = 0;
_root["t" + _root.maxt].rSpeed = 0;
_root["t" + _root.maxt].Active = true;
_root["t" + _root.maxt].enInSight = false;
_root["t" + _root.maxt].ready = false;
_root["t" + _root.maxt].shoot = false;
_root["t" + _root.maxt].shooting = false;
_root["t" + _root.maxt].shootingDetect = false;
_root["t" + _root.maxt].goneCrazy = false;
_root["t" + _root.maxt].delayShot = false;
_root["t" + _root.maxt].delayShooting = false;
_root["t" + _root.maxt]._root["t" + _root.maxt].fmaxSpeed = 24;
_root["t" + _root.maxt].jump = 1;
if (dir == "right") {
_root["t" + _root.maxt].dir_right = false;
_root["t" + _root.maxt].dirn = -1;
_root["t" + _root.maxt]._xscale = -_root["t" + _root.maxt]._xscale;
_root[("t" + _root.maxt) + "_ray"]._xscale = -_root[("t" + _root.maxt) + "_ray"]._xscale;
} else {
_root["t" + _root.maxt].dir_right = true;
_root["t" + _root.maxt].dirn = 1;
_root[("t" + _root.maxt) + "_ray"]._xscale = _root[("t" + _root.maxt) + "_ray"]._xscale;
}
_root.maxt++;
depthFix();
}
}
function turrentTurnActive(turTarget, t) {
trace("turrentTurnActive called");
if ((turTarget._rotation <= 45) and (turTarget._rotation >= -45)) {
if (_root.sounds) {
tur_s_die = new Sound();
tur_s_die.attachSound("tur_turnon");
tur_s_die.start();
}
if (((((turTarget._x > 850) or (turTarget._x < -50)) or (turTarget._y > 490)) or ((turTarget._y - (turTarget._height / 2)) < -10)) and turTarget.spawnable) {
} else {
turTarget.Active = true;
}
}
turTarget.activeCheck = false;
clearInterval(_root[("t" + t) + "_turnActive"]);
}
function turrentStopShooting(turTarget, t) {
trace("turrentStopShooting called");
turret_sa.stop("tur_alarm");
if (_root.sounds) {
tur_s_die = new Sound();
tur_s_die.attachSound("tur_die");
tur_s_die.start();
}
turTarget.gotoAndStop("alertOff");
turTarget.shoot = false;
turTarget.ready = false;
clearInterval(_root[("t" + t) + "_stopShooting"]);
}
function turrentStartShooting(turTarget, t) {
trace("turrentStartShooting called");
turret_sa.stop("tur_alarm");
turTarget.delayShooting = true;
clearInterval(_root[("t" + t) + "_delayShot"]);
}
function turrentReadyOff(turTarget, t) {
trace("turrentReadyOff called");
if (!turTarget.enInSight) {
turTarget.gotoAndStop("alertoff");
turTarget.ready = false;
clearInterval(_root[("t" + t) + "_readyOff"]);
}
turTarget.intCalled = false;
if (turTarget.enInSight) {
}
}
function turrentShotDelay(turTarget, t) {
turTarget.shooting = false;
clearInterval(_root[("t" + t) + "_shotDelay"]);
}
function turrentShotDetectDelay(turTarget, t) {
turTarget.shootingDetect = false;
clearInterval(_root[("t" + t) + "_shotDetectDelay"]);
}
function collisionSound() {
if (_root.sounds) {
if (delaySound == false) {
collisions = new Sound();
collisions.attachSound(["boxCollision" + Math.floor((Math.random() * 3) + 1)]);
collisions.start();
delaySound = true;
}
}
}
function countDelaySound() {
delaySound = false;
clearInterval(boxHitSound);
}
function portal(physical_target, physical_target_max, thisPort, otherPort) {
n = 1;
while (n < physical_target_max) {
if ((_root.pickedP == n) and (_root.pickedStr == "p")) {
} else if ((thisPort.hitTest(_root[physical_target + n]._x, _root[physical_target + n]._y, true) and portal_blue_open) and portal_yellow_open) {
_root[physical_target + n].canPortal = false;
if ((thisPort._rotation == -90) and (_root[physical_target + n].xSpeed > 0)) {
_root[physical_target + n].canPortal = true;
} else if ((thisPort._rotation == 90) and (_root[physical_target + n].xSpeed < 0)) {
_root[physical_target + n].canPortal = true;
} else if ((thisPort._rotation == 0) and (_root[physical_target + n].ySpeed > 0)) {
_root[physical_target + n].canPortal = true;
} else if ((thisPort._rotation == 180) and (_root[physical_target + n].ySpeed < 0)) {
_root[physical_target + n].canPortal = true;
}
if (_root[physical_target + n].canPortal) {
if (otherPort == _root.portal1) {
_root[physical_target + n].setMask(_root.mask1);
_root.mask1.gotoAndPlay(2);
} else if (otherPort == _root.portal2) {
_root[physical_target + n].setMask(_root.mask2);
_root.mask2.gotoAndPlay(2);
}
if (_root.sounds) {
portPass = new Sound();
portPass.attachSound("portalEnter");
portPass.start();
}
_root.portal1l.gotoAndPlay("pass");
_root.portal2l.gotoAndPlay("pass");
if ((n == 1) and (_root.p1portaled == false)) {
_root.p1portaled = true;
}
if (otherPort._rotation == -90) {
_root[physical_target + n]._x = (otherPort._x - otherPort._width) - 1;
_root[physical_target + n]._y = (otherPort._y + (otherPort._height / 2)) - portal_p;
if (_root[physical_target + n].rSpeed != undefined) {
_root[physical_target + n]._x = (otherPort._x - otherPort._width) - 1;
_root[physical_target + n]._y = otherPort._y;
}
if (thisPort._rotation == -90) {
_root[physical_target + n].xSpeed = (_root[physical_target + n].ySpeed / portal_d) - portal_p;
_root[physical_target + n].ySpeed = 0;
if (_root[physical_target + n].rSpeed != undefined) {
_root[physical_target + n]._rotation = _root[physical_target + n]._rotation + 90;
}
} else if (thisPort._rotation == 180) {
_root[physical_target + n].xSpeed = (_root[physical_target + n].ySpeed / portal_d) - (portal_p / 2);
_root[physical_target + n].ySpeed = 0;
} else if (thisPort._rotation == 90) {
_root[physical_target + n].xSpeed = (_root[physical_target + n].ySpeed / portal_d) - portal_p;
_root[physical_target + n].ySpeed = 0;
} else if (thisPort._rotation == 0) {
_root[physical_target + n].xSpeed = ((-_root[physical_target + n].ySpeed) / portal_d) - (portal_p / 2);
_root[physical_target + n].ySpeed = 0;
if (_root[physical_target + n].rSpeed != undefined) {
_root[physical_target + n]._rotation = _root[physical_target + n]._rotation + 90;
}
}
}
if (otherPort._rotation == 180) {
_root[physical_target + n]._x = otherPort._x;
_root[physical_target + n]._y = ((otherPort._y + otherPort._height) + 1) + (_root[physical_target + n]._height / 2);
if (_root[physical_target + n].rSpeed != undefined) {
_root[physical_target + n]._x = otherPort._x;
_root[physical_target + n]._y = (otherPort._y + otherPort._height) + 1;
}
if (thisPort._rotation == -90) {
_root[physical_target + n].ySpeed = _root[physical_target + n].xSpeed;
_root[physical_target + n].xSpeed = 0;
if (_root[physical_target + n].rSpeed != undefined) {
_root[physical_target + n]._rotation = _root[physical_target + n]._rotation + 90;
}
} else if (thisPort._rotation == 180) {
_root[physical_target + n].ySpeed = (-_root[physical_target + n].ySpeed) / portal_d;
if (_root[physical_target + n].rSpeed != undefined) {
_root[physical_target + n]._rotation = _root[physical_target + n]._rotation - 180;
}
} else if (thisPort._rotation == 90) {
_root[physical_target + n].ySpeed = -_root[physical_target + n].xSpeed;
_root[physical_target + n].xSpeed = 0;
if (_root[physical_target + n].rSpeed != undefined) {
_root[physical_target + n]._rotation = _root[physical_target + n]._rotation - 90;
}
} else if (thisPort._rotation == 0) {
_root[physical_target + n].ySpeed = _root[physical_target + n].ySpeed;
if (_root[physical_target + n].rSpeed != undefined) {
_root[physical_target + n]._rotation = _root[physical_target + n]._rotation - 180;
}
}
}
if (otherPort._rotation == 90) {
_root[physical_target + n]._x = (otherPort._x + otherPort._width) + 1;
_root[physical_target + n]._y = (otherPort._y + (otherPort._height / 2)) - portal_p;
if (_root[physical_target + n].rSpeed != undefined) {
_root[physical_target + n]._x = (otherPort._x + otherPort._width) + 1;
_root[physical_target + n]._y = otherPort._y;
}
if (thisPort._rotation == -90) {
_root[physical_target + n].xSpeed = (_root[physical_target + n].ySpeed / portal_d) + portal_p;
_root[physical_target + n].ySpeed = 0;
} else if (thisPort._rotation == 180) {
_root[physical_target + n].xSpeed = ((-_root[physical_target + n].ySpeed) / portal_d) + (portal_p / 2);
_root[physical_target + n].ySpeed = 0;
if (_root[physical_target + n].rSpeed != undefined) {
_root[physical_target + n]._rotation = _root[physical_target + n]._rotation + 90;
}
} else if (thisPort._rotation == 90) {
_root[physical_target + n].xSpeed = (_root[physical_target + n].ySpeed / portal_d) + portal_p;
_root[physical_target + n].ySpeed = 0;
if (_root[physical_target + n].rSpeed != undefined) {
}
} else if (thisPort._rotation == 0) {
_root[physical_target + n].xSpeed = (_root[physical_target + n].ySpeed / portal_d) + (portal_p / 2);
_root[physical_target + n].ySpeed = 0;
if (_root[physical_target + n].rSpeed != undefined) {
_root[physical_target + n]._rotation = _root[physical_target + n]._rotation + 90;
}
}
}
if (otherPort._rotation == 0) {
_root[physical_target + n]._x = otherPort._x;
_root[physical_target + n]._y = (otherPort._y - otherPort._height) - 1;
if (_root[physical_target + n].rSpeed != undefined) {
_root[physical_target + n]._x = otherPort._x;
_root[physical_target + n]._y = (otherPort._y - otherPort._height) - 1;
}
if (thisPort._rotation == -90) {
_root[physical_target + n].ySpeed = ((-_root[physical_target + n].xSpeed) / portal_d) - (portal_p / 2);
_root[physical_target + n].xSpeed = 0;
if (_root[physical_target + n].rSpeed != undefined) {
_root[physical_target + n]._rotation = _root[physical_target + n]._rotation + 90;
}
} else if (thisPort._rotation == 180) {
_root[physical_target + n].ySpeed = _root[physical_target + n].ySpeed / portal_d;
if (_root[physical_target + n].rSpeed != undefined) {
_root[physical_target + n]._rotation = _root[physical_target + n]._rotation - 180;
}
} else if (thisPort._rotation == 90) {
_root[physical_target + n].ySpeed = (_root[physical_target + n].xSpeed / portal_d) - (portal_p / 2);
_root[physical_target + n].xSpeed = 0;
if (_root[physical_target + n].rSpeed != undefined) {
_root[physical_target + n]._rotation = _root[physical_target + n]._rotation + 90;
}
} else if (thisPort._rotation == 0) {
_root[physical_target + n].ySpeed = -Math.floor(_root[physical_target + n].ySpeed);
if (_root[physical_target + n].rSpeed != undefined) {
_root[physical_target + n]._rotation = _root[physical_target + n]._rotation + 180;
}
}
}
}
}
n++;
}
}
function portalSteps(physical_target, physical_target_max, thisStep) {
n = 1;
while (n < physical_target_max) {
if (((physical_target == "p") and (n == 1)) and (_root.noclip == true)) {
} else {
if (thisStep._rotation == 90) {
step_addtionY = thisStep._height / 2;
step_ddtionX = thisStep._width / 2;
stepPossible = true;
} else if (thisStep._rotation == -90) {
step_addtionY = thisStep._height / 2;
step_addtionX = (-thisStep._width) / 2;
stepPossible = true;
} else {
step_addtionY = 0;
stepPossible = false;
}
if ((_root.bg.ground.hitTest(thisStep._x + step_addtionX, thisStep._y + step_addtionY, true) or _root.bg.wall.hitTest(thisStep._x + step_addtionX, thisStep._y + step_addtionY, true)) and (((stepPossible == true) and (portal_blue_open == true)) and (portal_yellow_open == true))) {
if (_root[physical_target + n].ySpeed >= 0) {
while (thisStep.hitTest(_root[physical_target + n]._x, _root[physical_target + n]._y, true)) {
trace("up");
_root[physical_target + n]._y = _root[physical_target + n]._y - _root.gravity;
_root[physical_target + n].ySpeed = 0;
_root[physical_target + n].jump = 0;
_root[physical_target + n].standingOn = "ground";
}
}
}
}
n++;
}
}
function physicObject(mapx, mapy, physical_target) {
if ((physical_target.xSpeed > 0) or (physical_target.envSpeed > 0)) {
while ((mapx.hitTest(physical_target._x + (physical_target._width / 2), physical_target._y - (physical_target._height / 3), true) or bg.wall.hitTest(physical_target._x + (physical_target._width / 2), physical_target._y - (physical_target._height / 2), true)) or bg.wall.hitTest(physical_target._x + (physical_target._width / 2), physical_target._y - physical_target._height, true)) {
physical_target._x = physical_target._x - 1.5;
physical_target.xSpeed = -(physical_target.xSpeed / 2);
physical_target.envSpeed = 0;
}
}
if ((physical_target.xSpeed < 0) or (physical_target.envSpeed < 0)) {
while ((mapx.hitTest(physical_target._x - (physical_target._width / 2), physical_target._y - (physical_target._height / 3), true) or bg.wall.hitTest(physical_target._x - (physical_target._width / 2), physical_target._y - (physical_target._height / 2), true)) or bg.wall.hitTest(physical_target._x - (physical_target._width / 2), physical_target._y - physical_target._height, true)) {
physical_target._x = physical_target._x + 1.5;
physical_target.xSpeed = -(physical_target.xSpeed / 2);
physical_target.envSpeed = 0;
}
}
if (physical_target.ySpeed >= 0) {
while (mapy.hitTest(physical_target._x, physical_target._y, true) or (mapy.hitTest(physical_target._x, physical_target._y + (physical_target._height / 2), true) and (physical_target.rSpeed != undefined))) {
physical_target._y = physical_target._y - _root.gravity;
physical_target.ySpeed = 0;
physical_target.jump = 0;
if (mapy == bg.ground) {
physical_target.standingOn = "ground";
} else if ((mapy != bg.ground) and (mapy != bg.antiobject)) {
physical_target.standingOn = "object";
physical_target.envSpeed = mapy.xSpeed;
}
}
} else if (physical_target.ySpeed < 0) {
if (physical_target.jump == 1) {
while (mapy.hitTest(physical_target._x, physical_target._y - physical_target._height, true)) {
physical_target._y = physical_target._y + _root.gravity;
physical_target.ySpeed = 1;
physical_target.jump = 1;
}
}
}
}
function unphysicDoor(physical_target) {
if (_root.doorEnterM.hitTest(physical_target._x, physical_target._y, true)) {
while ((_root.doorEnterM._y + ((_root.doorEnterM._height / 2) - 8)) < physical_target._y) {
physical_target._y = physical_target._y - _root.gravity;
physical_target.ySpeed = 0;
physical_target.jump = 0;
}
} else if (_root.doorExitM.hitTest(physical_target._x, physical_target._y, true)) {
while ((_root.doorExitM._y + ((_root.doorExitM._height / 2) - 8)) < physical_target._y) {
physical_target._y = physical_target._y - _root.gravity;
physical_target.ySpeed = 0;
physical_target.jump = 0;
}
}
}
function unphysicPortal(physical_target) {
if (_root.wt1.hitTest(physical_target._x, physical_target._y, true)) {
if ((_root.wt1._rotation == 90) or (_root.wt1._rotation == -90)) {
while ((_root.wt1._y + ((_root.wt1._height / 2) - 5)) < physical_target._y) {
physical_target._y = physical_target._y - _root.gravity;
physical_target.ySpeed = 0;
physical_target.jump = 0;
physical_target.standingOn = "ground";
}
} else if (_root.wt1._rotation == 0) {
}
} else if (_root.wt2.hitTest(physical_target._x, physical_target._y, true)) {
if ((_root.wt2._rotation == 90) or (_root.wt2._rotation == -90)) {
while ((_root.wt2._y + ((_root.wt2._height / 2) - 5)) < physical_target._y) {
physical_target._y = physical_target._y - _root.gravity;
physical_target.ySpeed = 0;
physical_target.jump = 0;
physical_target.standingOn = "ground";
}
} else if (_root.wt2._rotation == 0) {
}
}
}
function physicalMap(physical_target, physical_target_max) {
n = 1;
while (n < physical_target_max) {
if ((((physical_target == "p") and (n == 1)) and (_root.noclip == true)) and playerAlive) {
} else if ((physical_target == "p") and (n == 1)) {
if ((((!_root.wt1.hitTest(_root[physical_target + n]._x, _root[physical_target + n]._y, true)) and (!_root.wt2.hitTest(_root[physical_target + n]._x, _root[physical_target + n]._y, true))) or ((portal_blue_open == false) or (portal_yellow_open == false))) and ((!_root.doorEnterM.hitTest(_root[physical_target + n]._x, _root[physical_target + n]._y, true)) and (!_root.doorExitM.hitTest(_root[physical_target + n]._x, _root[physical_target + n]._y, true)))) {
mapon = 1;
while (mapon < 4) {
if (mapon == 1) {
maplx = bg.wall;
maply = bg.ground;
physicObject(maplx, maply, _root[physical_target + n]);
} else if (mapon == 2) {
phynum = 1;
while (phynum < maxphys) {
maplx = _root["phybox" + phynum];
maply = _root["phybox" + phynum];
physicObject(maplx, maply, _root[physical_target + n]);
phynum++;
}
} else if (mapon == 3) {
maplx = bg.antiobject;
maply = bg.antiobject;
physicObject(maplx, maply, _root[physical_target + n]);
}
mapon++;
}
} else {
unphysicDoor(_root[physical_target + n]);
unphysicPortal(_root[physical_target + n]);
}
} else if (_root[physical_target + n].rSpeed != undefined) {
if (((!_root.wt1.hitTest(_root[physical_target + n]._x, _root[physical_target + n]._y, true)) and (!_root.wt2.hitTest(_root[physical_target + n]._x, _root[physical_target + n]._y, true))) or ((portal_blue_open == false) or (portal_yellow_open == false))) {
mapon = 1;
while (mapon < 4) {
if (mapon == 1) {
maplx = bg.wall;
maply = bg.ground;
physicObject(maplx, maply, _root[physical_target + n]);
} else if (mapon == 2) {
phynum = 1;
while (phynum < maxphys) {
maplx = _root["phybox" + phynum];
maply = _root["phybox" + phynum];
physicObject(maplx, maply, _root[physical_target + n]);
phynum++;
}
} else if (mapon == 3) {
maplx = bg.antiobject;
maply = bg.antiobject;
physicObject(maplx, maply, _root[physical_target + n]);
}
mapon++;
}
} else {
unphysicPortal(_root[physical_target + n]);
}
} else if (((!_root.wt1.hitTest(_root[physical_target + n]._x, _root[physical_target + n]._y, true)) and (!_root.wt2.hitTest(_root[physical_target + n]._x, _root[physical_target + n]._y, true))) or ((portal_blue_open == false) or (portal_yellow_open == false))) {
mapon = 1;
while (mapon < 4) {
if (mapon == 1) {
maplx = bg.wall;
maply = bg.ground;
physicObject(maplx, maply, _root[physical_target + n]);
} else if (mapon == 2) {
phynum = 1;
while (phynum < maxphys) {
maplx = _root["phybox" + phynum];
maply = _root["phybox" + phynum];
physicObject(maplx, maply, _root[physical_target + n]);
phynum++;
}
} else if (mapon == 3) {
maplx = bg.antiobject;
maply = bg.antiobject;
physicObject(maplx, maply, _root[physical_target + n]);
}
mapon++;
}
} else {
unphysicPortal(_root[physical_target + n]);
}
n++;
}
}
function ballLoopFunc() {
trace("completed");
if (ballLoopingSound) {
ballLoop.start();
} else {
ballLoop.stop("ballLoop");
}
}
function randomSong() {
musicVol.attachSound("music_" + (Math.floor(Math.random() * 3) + 1));
musicVol.start();
musicPlaying = true;
}
function startPointMove() {
if (!flatLevel) {
while ((bg.player_enter.hitTest(p1._x - (p1._width / 2), p1._y, true) or bg.player_enter.hitTest(p1._x - (p1._width / 2), p1._y - (p1._height / 2), true)) or bg.wall.hitTest(physical_target._x - (physical_target._width / 2), physical_target._y - physical_target._height, true)) {
p1._x = p1._x + 1.5;
p1.xSpeed = 0;
p1.envSpeed = 0;
}
}
}
function death_restart_available() {
trace("called");
death_restart = true;
clearInterval(restartLevelDelay);
}
function restartLevel() {
death_restart = true;
clearInterval(restartLevelDelay);
nextMap = ["level" + mapn];
nextLevel2 = true;
}
function turrentFunc(turTarget, t) {
if (((((turTarget._x > 850) or (turTarget._x < -50)) or (turTarget._y > 490)) or ((turTarget._y - (turTarget._height / 2)) < -10)) and turTarget.spawnable) {
trace("respawnd turret");
turTarget._x = turTarget.spawnx;
turTarget._y = turTarget.spawny;
turTarget.xSpeed = 0;
turTarget.ySpeed = 0;
turTarget._alpha = 0;
}
if (turTarget._alpha < 100) {
turTarget._alpha = turTarget._alpha + 10;
}
if (_root.ht1.hitTest(turTarget._x, turTarget._y, true)) {
turTarget.setMask(_root.mask1);
} else if (_root.ht2.hitTest(turTarget._x, turTarget._y, true)) {
turTarget.setMask(_root.mask2);
}
tb = 1;
while (tb < _root.maxt) {
if (t != tb) {
if (_root["t" + tb].hitTest(turTarget)) {
if (turTarget._x >= _root["t" + tb]._x) {
turTarget.xSpeed = turTarget.xSpeed + 1;
if (turTarget.xSpeed <= 0) {
if (_root["t" + tb].hitTest(turTarget._x - (turTarget._width / 2), turTarget._y, true) or _root["t" + tb].hitTest(turTarget._x + (turTarget._width / 2), turTarget._y, true)) {
_root["t" + tb].xSpeed = turTarget.xSpeed;
turTarget.xSpeed = (-_root["t" + tb].xSpeed) / 2;
}
while (_root["t" + tb].hitTest(turTarget._x - (turTarget._width / 2), turTarget._y, true) or _root["t" + tb].hitTest(turTarget._x + (turTarget._width / 2), turTarget._y, true)) {
_root["t" + tb]._x = _root["t" + tb]._x - 1;
_root["t" + tb].xSpeed = _root["t" + tb].xSpeed - 0.1;
turTarget._x = turTarget._x + 1;
turTarget.xSpeed = turTarget.xSpeed + 0.05;
}
}
} else if (turTarget._x < _root["t" + tb]._x) {
turTarget.xSpeed = turTarget.xSpeed - 1;
if (turTarget.xSpeed >= 0) {
if (_root["t" + tb].hitTest(turTarget._x - (turTarget._width / 2), turTarget._y, true) or _root["t" + tb].hitTest(turTarget._x + (turTarget._width / 2), turTarget._y, true)) {
_root["t" + tb].xSpeed = turTarget.xSpeed;
turTarget.xSpeed = (-_root["t" + tb].xSpeed) / 2;
}
while (_root["t" + tb].hitTest(turTarget._x - (turTarget._width / 2), turTarget._y, true) or _root["t" + tb].hitTest(turTarget._x + (turTarget._width / 2), turTarget._y, true)) {
_root["t" + tb]._x = _root["t" + tb]._x + 1;
_root["t" + tb].xSpeed = _root["t" + tb].xSpeed + 0.1;
turTarget._x = turTarget._x - 1;
turTarget.xSpeed = turTarget.xSpeed - 0.05;
}
}
}
}
}
tb++;
}
if ((_root.pickedP == t) and (_root.pickedStr == "t")) {
} else {
if (_root.p1.hitTest(turTarget) and (_root.noclip == false)) {
if ((_root.p1._x <= turTarget._x) and (_root.p1._y > ((turTarget._y - turTarget._height) + 10))) {
if (_root.p1.xSpeed >= 0) {
if (turTarget.hitTest(_root.p1._x + (_root.p1._width / 3), _root.p1._y - (turTarget._height / 2), true) or turTarget.hitTest(_root.p1._x + (_root.p1._width / 3), _root.p1._y - (turTarget._height * 1.5), true)) {
turTarget.xSpeed = turTarget.xSpeed + 1;
_root.p1.xSpeed = _root.p1.xSpeed - 0.5;
}
while (turTarget.hitTest(_root.p1._x + (_root.p1._width / 3), _root.p1._y - (turTarget._height / 2), true) or turTarget.hitTest(_root.p1._x + (_root.p1._width / 3), _root.p1._y - (turTarget._height * 1.5), true)) {
_root.p1._x = _root.p1._x - 1;
turTarget._x = turTarget._x + 1;
_root.p1.xSpeed = _root.p1.xSpeed - 0.1;
turTarget.xSpeed = turTarget.xSpeed + 0.05;
}
}
} else if ((_root.p1._x > turTarget._x) and (_root.p1._y > ((turTarget._y - turTarget._height) + 10))) {
if (_root.p1.xSpeed < 0) {
if (turTarget.hitTest(_root.p1._x - (_root.p1._width / 3), _root.p1._y - (turTarget._height / 2), true) or turTarget.hitTest(_root.p1._x - (_root.p1._width / 3), _root.p1._y - (turTarget._height * 1.5), true)) {
turTarget.xSpeed = turTarget.xSpeed - 1;
_root.p1.xSpeed = _root.p1.xSpeed + 0.5;
}
while (turTarget.hitTest(_root.p1._x - (_root.p1._width / 3), _root.p1._y - (turTarget._height / 2), true) or turTarget.hitTest(_root.p1._x - (_root.p1._width / 3), _root.p1._y - (turTarget._height * 1.5), true)) {
_root.p1._x = _root.p1._x + 1;
turTarget._x = turTarget._x - 1;
_root.p1.xSpeed = _root.p1.xSpeed + 0.1;
turTarget.xSpeed = turTarget.xSpeed - 0.05;
}
}
}
}
if (turTarget.ySpeed > 1) {
turTarget.jump = 1;
} else if (turTarget.ySpeed < -1) {
turTarget.jump = 1;
}
if (turTarget.standingOn == "ground") {
if ((turTarget.envSpeed < 0.1) && (turTarget.envSpeed > -0.1)) {
turTarget.envSpeed = 0;
} else {
turTarget.envSpeed = turTarget.envSpeed / 1.05;
}
} else if (turTarget.standingOn == "object") {
}
if (turTarget.jump == 0) {
if ((turTarget._rotation > 8) and (turTarget._rotation < 85)) {
turTarget.rSpeed = turTarget.rSpeed + 1;
} else if ((turTarget._rotation < -8) and (turTarget._rotation > -85)) {
turTarget.rSpeed = turTarget.rSpeed - 1;
} else if ((turTarget._rotation > 95) and (turTarget._rotation <= 180)) {
turTarget.rSpeed = turTarget.rSpeed - 0.5;
} else if ((turTarget._rotation < -95) and (turTarget._rotation > -180)) {
turTarget.rSpeed = turTarget.rSpeed + 0.5;
} else {
turTarget.rSpeed = turTarget.rSpeed / 2;
}
if ((turTarget._rotation <= 8) and (turTarget._rotation >= -8)) {
if (turTarget.rSpeed == 0) {
turTarget._rotation = (turTarget._rotation - 0) / 2;
}
}
if ((turTarget.xSpeed < 0.1) && (turTarget.xSpeed > -0.1)) {
turTarget.xSpeed = 0;
} else {
turTarget.xSpeed = turTarget.xSpeed / 1.5;
}
if ((turTarget.rSpeed < 0.1) && (turTarget.rSpeed > -0.1)) {
turTarget.rSpeed = 0;
} else {
turTarget.rSpeed = turTarget.rSpeed / 1.15;
}
} else if (turTarget.jump == 1) {
if (turTarget.xSpeed > 1) {
turTarget.rSpeed = turTarget.rSpeed + 0.7;
} else if (turTarget.xSpeed < -1) {
turTarget.rSpeed = turTarget.rSpeed - 0.7;
}
if (turTarget._rotation > 90) {
turTarget.rSpeed = turTarget.rSpeed + 0.7;
} else if (turTarget._rotation < -90) {
turTarget.rSpeed = turTarget.rSpeed - 0.7;
}
if ((turTarget.rSpeed < 0.1) && (turTarget.rSpeed > -0.1)) {
turTarget.rSpeed = 0;
} else {
turTarget.rSpeed = turTarget.rSpeed / 1.05;
}
turTarget.xSpeed = turTarget.xSpeed / 1.05;
turTarget.envSpeed = 0;
turTarget.standingOn = "nothing";
}
if (turTarget.ySpeed > turTarget.fmaxSpeed) {
turTarget.ySpeed = turTarget.fmaxSpeed;
} else if (turTarget.ySpeed < (-turTarget.fmaxSpeed)) {
turTarget.ySpeed = -turTarget.fmaxSpeed;
}
turTarget.ySpeed = turTarget.ySpeed + _root.gravity;
}
if ((turTarget._rotation <= 45) and (turTarget._rotation >= -45)) {
if ((!turTarget.activeCheck) and (!turTarget.Active)) {
_root[("t" + t) + "_turnActive"] = setInterval(_root, "turrentTurnActive", 2000, turTarget, t);
turTarget.activeCheck = true;
}
} else {
turTarget.Active = false;
}
turTarget.aim_angle = turTarget._rotation + 0.01;
if (turTarget.dir_right) {
turTarget.aim_rady = Math.sin((turTarget.aim_angle * Math.PI) / 180) * -1;
turTarget.xn = turTarget._x + (Math.cos(((turTarget.aim_angle - 90) * Math.PI) / 180) * 5);
turTarget.yn = turTarget._y + (Math.sin(((turTarget.aim_angle - 90) * Math.PI) / 180) * 5);
_root[("t" + t) + "_ray"]._x = turTarget.xn;
_root[("t" + t) + "_ray"]._y = turTarget.yn;
_root[("t" + t) + "_ray"]._rotation = turTarget.aim_angle;
} else {
turTarget.aim_rady = Math.sin((turTarget.aim_angle * Math.PI) / 180);
turTarget.xn = turTarget._x + (Math.cos(((turTarget.aim_angle - 90) * Math.PI) / 180) * 5);
turTarget.yn = turTarget._y + (Math.sin(((turTarget.aim_angle - 90) * Math.PI) / 180) * 5);
_root[("t" + t) + "_ray"]._x = turTarget.xn;
_root[("t" + t) + "_ray"]._y = turTarget.yn;
_root[("t" + t) + "_ray"]._rotation = turTarget.aim_angle;
}
if (turTarget.Active) {
if (!turTarget.shootingDetect) {
if (((turTarget._rotation > 90) and (turTarget._rotation < 180)) or ((turTarget._rotation < -90) and (turTarget._rotation > -180))) {
turTarget.aim_radx = Math.cos((turTarget.aim_angle * Math.PI) / 180) * -1;
} else {
turTarget.aim_radx = Math.cos((turTarget.aim_angle * Math.PI) / 180);
}
turTarget.aim_raddividey = turTarget.aim_rady / turTarget.aim_radx;
turTarget.aim_raddividex = turTarget.aim_radx / turTarget.aim_rady;
if (turTarget.aim_angle < 0) {
turTarget.aim_raddividex = turTarget.aim_raddividex * -1;
}
if (turTarget.aim_raddividey > 1) {
turTarget.aim_raddividey = 1;
} else if (turTarget.aim_raddividey < -1) {
turTarget.aim_raddividey = -1;
}
if (turTarget.aim_raddividex > 1) {
turTarget.aim_raddividex = 1;
} else if (turTarget.aim_raddividex < -1) {
turTarget.aim_raddividex = -1;
}
removeMC(_root[("t" + t) + "_dline"]);
if (turTarget.Active) {
_root[("t" + t) + "_ray"]._visible = true;
}
turTarget.breakWhile = false;
turTarget.enInSight = false;
do {
if (turTarget.xn >= (_xmouse + 800)) {
break;
}
if (((turTarget._rotation > 90) and (turTarget._rotation < 180)) or ((turTarget._rotation < -90) and (turTarget._rotation > -180))) {
turTarget.xn = turTarget.xn - (turTarget.aim_raddividex * 8);
turTarget.yn = turTarget.yn + (turTarget.aim_raddividey * 8);
} else {
turTarget.xn = turTarget.xn + (turTarget.aim_raddividex * 8);
turTarget.yn = turTarget.yn + (turTarget.aim_raddividey * 8);
}
phynum = 1;
while (phynum < _root.maxphys) {
if (_root["phybox" + phynum].hitTest(turTarget.xn, turTarget.yn, true)) {
turTarget.breakWhile = true;
}
phynum++;
}
nht = 2;
while (nht < _root.maxn) {
if (_root["p" + nht].hitTest(turTarget.xn, turTarget.yn, true)) {
turTarget.breakWhile = true;
}
nht++;
}
if (_root.p1.hitTest(turTarget.xn, turTarget.yn, true)) {
turTarget.enInSight = true;
break;
}
tht = 1;
while (tht < _root.maxt) {
if (t != tht) {
if (_root["t" + tht].hitTest(turTarget.xn, turTarget.yn, true)) {
turTarget.breakWhile = true;
}
}
tht++;
}
if (turTarget.breakWhile) {
break;
}
if (_root.bg.ground.hitTest(turTarget.xn, turTarget.yn, true)) {
break;
}
if (_root.bg.wall.hitTest(turTarget.xn, turTarget.yn, true)) {
break;
}
} while (!((((turTarget.xn > 800) || (turTarget.yn < 0)) || (turTarget.xn < 0)) || (turTarget.yn > 450)));
_root[("t" + t) + "_shotDetectDelay"] = setInterval(_root, "turrentShotDetectDelay", 200, turTarget, t);
turTarget.shootingDetect = true;
}
}
removeMC(_root[("t" + t) + "_shot"]);
if ((turTarget.enInSight and (!turTarget.ready)) and turTarget.Active) {
turTarget.gotoAndStop("alert");
if (!turTarget.intCalled) {
_root[("t" + t) + "_readyOff"] = setInterval(_root, "turrentReadyOff", 2500, turTarget, t);
turTarget.intCalled = true;
}
}
if ((!turTarget.Active) and (!turTarget.goneCrazy)) {
trace("!turTarget.Active and !turTarget.goneCrazy");
_root[("t" + t) + "_stopShooting"] = setInterval(_root, "turrentStopShooting", 1500, turTarget, t);
turTarget.shoot = true;
turTarget.goneCrazy = true;
if (sounds) {
turret_sa = new Sound();
turret_sa.attachSound("tur_alarm");
turret_sa.start(0, 10);
}
}
if (turTarget.Active) {
turTarget.goneCrazy = false;
}
if (turTarget.ready or turTarget.shoot) {
if (!turTarget.shoot) {
if (!turTarget.delayShot) {
_root[("t" + t) + "_delayShot"] = setInterval(_root, "turrentStartShooting", 500, turTarget, t);
if (sounds) {
turret_sa = new Sound();
turret_sa.attachSound("tur_alarm");
turret_sa.start(0, 10);
}
if (sounds) {
turret_sa = new Sound();
turret_sa.attachSound("tur_active");
turret_sa.start();
}
turTarget.delayShot = true;
turTarget.delayShooting = false;
}
}
if ((turTarget.delayShooting and (!turTarget.goneCrazy)) or turTarget.goneCrazy) {
_root[("t" + t) + "_ray"]._visible = false;
if (!turTarget.shooting) {
turTarget.gotoAndStop("shoot");
if (sounds) {
turret_ss = new Sound();
turret_ss.attachSound("tur_s" + Math.floor((Math.random() * 3) + 1));
turret_ss.start();
}
turTarget.aim_angle = turTarget._rotation + ((Math.random() * 20) - 9);
if (turTarget.dir_right) {
turTarget.aim_rady = Math.sin((turTarget.aim_angle * Math.PI) / 180) * -1;
turTarget.xn = turTarget._x + (Math.cos(((turTarget.aim_angle - 90) * Math.PI) / 180) * 5);
turTarget.yn = turTarget._y + (Math.sin(((turTarget.aim_angle - 90) * Math.PI) / 180) * 5);
} else {
turTarget.aim_rady = Math.sin((turTarget.aim_angle * Math.PI) / 180);
turTarget.xn = turTarget._x + (Math.cos(((turTarget.aim_angle - 90) * Math.PI) / 180) * 5);
turTarget.yn = turTarget._y + (Math.sin(((turTarget.aim_angle - 90) * Math.PI) / 180) * 5);
}
if (((turTarget._rotation > 90) and (turTarget._rotation < 180)) or ((turTarget._rotation < -90) and (turTarget._rotation > -180))) {
turTarget.aim_radx = Math.cos((turTarget.aim_angle * Math.PI) / 180) * -1;
} else {
turTarget.aim_radx = Math.cos((turTarget.aim_angle * Math.PI) / 180);
}
turTarget.aim_raddividey = turTarget.aim_rady / turTarget.aim_radx;
turTarget.aim_raddividex = turTarget.aim_radx / turTarget.aim_rady;
if (turTarget.aim_angle < 0) {
turTarget.aim_raddividex = turTarget.aim_raddividex * -1;
}
if (turTarget.dir_right) {
if (((turTarget.aim_angle < 135) and (turTarget.aim_angle > 45)) and (turTarget.aim_raddividey > 0)) {
turTarget.aim_raddividey = turTarget.aim_raddividey * -1;
} else if (((turTarget.aim_angle > -135) and (turTarget.aim_angle < -45)) and (turTarget.aim_raddividey < 0)) {
turTarget.aim_raddividey = turTarget.aim_raddividey * -1;
}
} else if (((turTarget.aim_angle < 135) and (turTarget.aim_angle > 45)) and (turTarget.aim_raddividey < 0)) {
turTarget.aim_raddividey = turTarget.aim_raddividey * -1;
} else if (((turTarget.aim_angle > -135) and (turTarget.aim_angle < -45)) and (turTarget.aim_raddividey > 0)) {
turTarget.aim_raddividey = turTarget.aim_raddividey * -1;
}
if (turTarget.aim_raddividey > 1) {
turTarget.aim_raddividey = 1;
} else if (turTarget.aim_raddividey < -1) {
turTarget.aim_raddividey = -1;
}
if (turTarget.aim_raddividex > 1) {
turTarget.aim_raddividex = 1;
} else if (turTarget.aim_raddividex < -1) {
turTarget.aim_raddividex = -1;
}
removeMC(_root[("t" + t) + "_shot"]);
_root.createEmptyMovieClip(("t" + t) + "_shot", _root.getNextHighestDepth());
_root[("t" + t) + "_shot"].lineStyle(2, 914161, 75);
_root[("t" + t) + "_shot"].moveTo(turTarget.xn, turTarget.yn);
turTarget.breakWhile = false;
do {
if (turTarget.xn >= (_xmouse + 800)) {
break;
}
if (((turTarget._rotation > 90) and (turTarget._rotation < 180)) or ((turTarget._rotation < -90) and (turTarget._rotation > -180))) {
turTarget.xn = turTarget.xn - (turTarget.aim_raddividex * 8);
turTarget.yn = turTarget.yn + (turTarget.aim_raddividey * 8);
} else {
turTarget.xn = turTarget.xn + (turTarget.aim_raddividex * 8);
turTarget.yn = turTarget.yn + (turTarget.aim_raddividey * 8);
}
phynum = 1;
while (phynum < _root.maxphys) {
if (_root["phybox" + phynum].hitTest(turTarget.xn, turTarget.yn, true)) {
createMetalColEffect(turTarget.xn, turTarget.yn);
turTarget.breakWhile = true;
}
phynum++;
}
if (turTarget.breakWhile) {
break;
}
nht = 2;
while (nht < _root.maxn) {
if (_root["p" + nht].hitTest(turTarget.xn, turTarget.yn, true)) {
createMetalColEffect(turTarget.xn, turTarget.yn);
if (_root["p" + nht]._x > turTarget._x) {
_root["p" + nht].xSpeed = _root["p" + nht].xSpeed + 4;
} else {
_root["p" + nht].xSpeed = _root["p" + nht].xSpeed - 4;
}
if ((_root["p" + nht]._y - (_root["p" + nht]._height / 2)) > turTarget._y) {
_root["p" + nht].ySpeed = _root["p" + nht].ySpeed + 2;
} else {
_root["p" + nht].ySpeed = _root["p" + nht].ySpeed - 2;
}
turTarget.breakWhile = true;
}
nht++;
}
if (turTarget.breakWhile) {
break;
}
if (_root.p1.hitTest(turTarget.xn, turTarget.yn, true)) {
createBloodColEffect(turTarget.xn, turTarget.yn, turTarget.aim_angle);
if (_root.effects >= 1) {
createBloodBGEffect(turTarget.xn, turTarget.yn);
}
if ((!noclip) and (!god)) {
playerHP = playerHP - shotDmg;
if (playerHP > 0) {
_root["hpRegenCheck" + regenInt] = setInterval(_root, "hpRegen", 4000, playerHP, regenInt);
regenInt++;
}
if (playerHP <= 0) {
killPlayer("shot");
}
if (p1._x > turTarget._x) {
p1.xSpeed = p1.xSpeed + 4;
} else {
p1.xSpeed = p1.xSpeed - 4;
}
if ((p1._y - (p1._height / 2)) > turTarget._y) {
p1.ySpeed = p1.ySpeed + 2;
} else {
p1.ySpeed = p1.ySpeed - 2;
}
}
break;
}
tht = 1;
while (tht < _root.maxt) {
if (t != tht) {
if (_root["t" + tht].hitTest(turTarget.xn, turTarget.yn, true)) {
createMetalColEffect(turTarget.xn, turTarget.yn);
if (_root["t" + tht]._x > turTarget._x) {
_root["t" + tht].xSpeed = _root["t" + tht].xSpeed + 3;
_root["t" + tht].rSpeed = _root["t" + tht].rSpeed + 4;
} else {
_root["t" + tht].xSpeed = _root["t" + tht].xSpeed - 3;
_root["t" + tht].rSpeed = _root["t" + tht].rSpeed - 4;
}
turTarget.breakWhile = true;
}
}
tht++;
}
if (turTarget.breakWhile) {
break;
}
if (_root.bg.ground.hitTest(turTarget.xn, turTarget.yn, true)) {
createDustBGEffect(turTarget.xn, turTarget.yn, turTarget.aim_angle + 90);
break;
}
if (_root.bg.wall.hitTest(turTarget.xn, turTarget.yn, true)) {
createDustBGEffect(turTarget.xn, turTarget.yn, turTarget.aim_angle + 90);
break;
}
} while (!((((turTarget.xn > 800) || (turTarget.yn < 0)) || (turTarget.xn < 0)) || (turTarget.yn > 450)));
_root[("t" + t) + "_shot"].lineTo(turTarget.xn, turTarget.yn);
_root[("t" + t) + "_shotDelay"] = setInterval(_root, "turrentShotDelay", 100, turTarget, t);
turTarget.shooting = true;
}
}
} else {
turTarget.delayShot = false;
}
turTarget._x = (turTarget._x + turTarget.xSpeed) + turTarget.envSpeed;
turTarget._y = turTarget._y + turTarget.ySpeed;
turTarget._rotation = turTarget._rotation + turTarget.rSpeed;
if ((((turTarget._x > 850) or (turTarget._x < -50)) or (turTarget._y > 490)) or ((turTarget._y - (turTarget._height / 2)) < -10)) {
turTarget.Active = false;
}
if (_root.effects >= 2) {
if (turTarget.xSpeed > 5) {
be.quality = 1;
be.blurX = turTarget.xSpeed;
turTarget.filters = [be];
} else if (turTarget.xSpeed < -5) {
be.quality = 1;
be.blurX = -turTarget.xSpeed;
turTarget.filters = [be];
} else {
be.quality = 1;
be.blurX = 0;
turTarget.filters = [be];
}
if (turTarget.ySpeed > 5) {
be.quality = 1;
be.blurY = turTarget.ySpeed;
turTarget.filters = [be];
} else if (turTarget.ySpeed < -5) {
be.quality = 1;
be.blurY = -turTarget.ySpeed;
turTarget.filters = [be];
} else {
be.quality = 1;
be.blurY = 0;
turTarget.filters = [be];
}
} else {
turTarget.filters = [];
be.filters = [];
}
}
function launchTip() {
trace("launchTip");
if (quicktip == "") {
trace("no string");
} else {
if (sounds) {
tipS = new Sound();
tipS.attachSound("tipPop");
tipS.start();
}
_root.createTextField("tipText", _root.getNextHighestDepth(), 0, 100, 250, 20);
tipText.text = quicktip;
tipText.autoSize = true;
tipText.setTextFormat(tipFormat);
tipText._x = -tipText._width;
_root.createEmptyMovieClip("tipTextBG", _root.getNextHighestDepth());
tipTextBG.beginFill(0, 50);
tipTextBG.moveTo(tipText._x, tipText._y);
tipTextBG.lineTo(tipText._x + tipText._width, tipText._y);
tipTextBG.lineTo(tipText._x + tipText._width, tipText._y + tipText._height);
tipTextBG.lineTo(tipText._x, tipText._y + tipText._height);
tipTextBG.lineTo(tipText._x, tipText._y);
tipTextBG.endFill();
tipExist = true;
depthFix();
}
clearInterval(tipShowUp);
}
function downTip() {
trace("down tip");
clearInterval(tipShowDown);
tipExist = false;
}
function killTip() {
trace("kill tip");
removeMC(tipTextBG);
removeTF(tipText);
clearInterval(tipKill);
}
function tipTexts() {
if (mapn == 1) {
quicktip = "Use the [A] [W] [D] keys to move. Use the [LEFT MOUSE] button to launch a Portal.";
} else if (mapn == 2) {
quicktip = "To change your settings, restart the game, pause the game or quit the game, use [ ESC] or [ P].";
} else if (mapn == 3) {
quicktip = "Use [Q] to open a Blue Portal, and [E] to open a Yellow Portal.";
} else if (mapn == 6) {
quicktip = "To shut both Portals use [R].";
} else if (mapn == 13) {
quicktip = "To quickly adjust the image quality, use [O], or pause the game with [P] or [ESC] then visit the options.";
} else if (mapn == 25) {
quicktip = "To pick up an object use [F], and press [F] again to drop it.";
} else {
quicktip = "";
}
}
function launchGuide() {
trace("launchGuide");
if (guiderootext == "") {
trace("no string");
} else {
if (sounds) {
tipS = new Sound();
tipS.attachSound("tipPop");
tipS.start();
}
_root.createTextField("guideText", _root.getNextHighestDepth(), 0, 0, 800, 20);
guideText.text = guiderootext + " (Press [ENTER] to close)";
guideText.autoSize = true;
guideText.wordWrap = true;
guideText.setTextFormat(tipFormat);
guideText._y = -guideText._height;
_root.createEmptyMovieClip("guideTextBG", _root.getNextHighestDepth());
guideTextBG.beginFill(0, 50);
guideTextBG.moveTo(guideText._x, guideText._y);
guideTextBG.lineTo(guideText._x + guideText._width, guideText._y);
guideTextBG.lineTo(guideText._x + guideText._width, guideText._y + guideText._height);
guideTextBG.lineTo(guideText._x, guideText._y + guideText._height);
guideTextBG.lineTo(guideText._x, guideText._y);
guideTextBG.endFill();
guideExist = true;
depthFix();
}
clearInterval(guideShowUp);
}
function downGuide() {
trace("downGuide");
clearInterval(guideShowDown);
guideExist = false;
}
function killGuide() {
trace("killGuide");
removeMC(guideTextBG);
removeTF(guideText);
clearInterval(guideKill);
}
function guideTexts() {
if (mapn == 1) {
guiderootext = "You may have noticed that this morning, you woke up in a very strange location. Your task today is to find your way to the exit door, and go through it, alive. You may not be able to complete this task using your body only, but thanks to the Aperture Science Handheld Portal Device (ASHPD) - the impossible is easy. Try shooting two holes, one reachable through your cell and one out of it. See what happens.";
} else if (mapn == 2) {
guiderootext = "As you may have learnt in the previous task, your portal device can shoot two different portal holes - yellow and blue. Each will lead you to the other's location.";
} else if (mapn == 4) {
guiderootext = "The darker walls you may see in this task are different than the walls you met in the previous tasks. Those are the the portal-proof walls - you may walk on them, but you cannot open portals on them.";
} else if (mapn == 6) {
guiderootext = "At some tasks, such as this one, you may thank us for taking this task at planet Earth. You need to use height and gravity to catch momentum, then use it to fly high and fast as you can, making unreachable spots - reachable.";
} else if (mapn == 7) {
guiderootext = "Those are the moving platforms. You can open portals on them only when they become active.";
} else if (mapn == 10) {
guiderootext = "As we explained before the exam, some tasks may risk your performance as a human being. ";
} else if (mapn == 11) {
guiderootext = "At some points, it\u2019s all about agility.";
} else if (mapn == 12) {
guiderootext = "And at some other points, it\u2019s all about timing.";
} else if (mapn == 13) {
guiderootext = "By the IQ exams you have taken before the test, you may already know what happens to those who stay between these two fields when they are active.";
} else if (mapn == 14) {
guiderootext = "Remember - portals can get you where your body can\u2019t.";
} else if (mapn == 16) {
guiderootext = "Blue plasma walls - you cannot go through them, but the density of your portal shots can.";
} else if (mapn == 18) {
guiderootext = "Red plasma walls - you can go through them, but it may not be a healthy thing for you to do. Every living creature goes through them would be vaporised.";
} else if (mapn == 19) {
guiderootext = "One of the keys for your success are the red buttons. Stand still on them in order to make certain applications work.";
} else if (mapn == 20) {
guiderootext = "Here, unlike the previous task, the button must be held down to keep the door open. Alas. When you get off the button to go through the passage, the door closes. I will leave the thinking to you.";
} else if (mapn == 21) {
guiderootext = "Another inseparable part of your success are the energy balls. Your goal is to get the ball into its receiver, activating a certain application. After a number of seconds the ball will explode, and a new ball will be launched. It's highly recommended to avoid any contact with the energy balls. It might vaporise you.";
} else if (mapn == 25) {
guiderootext = "Cubes. These metal chunks are very important for your success. They weigh more than you when you were 32, meaning they can hold the red buttons for you. They can also protect you, from some new challenges to come. You can portal the cubes and also pick them up using your ASHPD.";
} else if (mapn == 29) {
guiderootext = "Subject 15837, meet your first interactive friend - the turret. The turret will shoot you to death as long as you are in their sight. You cannot destroy turrets, but you can disable them by making them fall down to earth - making sure they are no longer stable. But be careful, after the turret gone unstable, it will shoot some warning shots. You can also pick up the turrets using your ASHPD, but you may want to be careful doing that.";
} else if (mapn == 30) {
guiderootext = "Energy balls and cubes may not destroy the turrets, but they sure can help disabling them.";
} else if (mapn == 31) {
guiderootext = "If the cube falls into the darkness, we will send you another box through the machine above your head. ";
} else if (mapn == 36) {
guiderootext = "You are doing well, subject 15837. You are a good person. ";
} else if (mapn == 41) {
guiderootext = "Congratulations, subject 15837. You have finished all of your tasks as a test participant. Your reward is waiting in the middle of this room, and you will be taken away through the exit door as soon as you are ready.";
} else {
guiderootext = "";
}
}
function mapPreLoadScript() {
if (mapn == 31) {
boxcreators = true;
}
}
function mapLoadScript() {
if (mapn == 0) {
flatLevel = true;
} else if (mapn == 1) {
flatLevel = true;
} else if (mapn == 7) {
wallMover1.Active = true;
} else if (mapn == 8) {
wallMover2.Distance = 100;
wallMover3.Distance = 150;
} else if (mapn == 11) {
bg.crusher1.gotoAndStop("crush");
} else if (mapn == 12) {
elevator1.endx = 550;
elevator1.Active = true;
} else if (mapn == 19) {
elevator1.endx = 560;
elevator1.Active = false;
activator1.Type = 2;
} else if (mapn == 20) {
} else if (mapn == 21) {
} else if (mapn == 30) {
ballout1.Active = false;
activator1.Type = 2;
} else if (mapn == 31) {
t1.spawnable = false;
t2.spawnable = false;
t3.spawnable = false;
t4.spawnable = false;
t5.spawnable = false;
} else if (mapn == 33) {
elevator1.endx = 400;
wallMover1.Distance = 5;
} else if (mapn == 34) {
wallMover1.Distance = 80;
} else if (mapn == 35) {
ball_time = 25000;
ballLife = 25;
} else if (mapn == 36) {
elevator1.Active = true;
elevator1.eleMax = 1.5;
elevator1.endx = 640;
elevator1.startx = 190;
activator2.Type = 2;
} else if (mapn == 38) {
activator5.Type = 2;
activator6.Type = 2;
door3.door._xscale = door3.door._xscale - 200;
door3.door._x = door3.door._x + door3.door._width;
door2.door._xscale = door2.door._xscale - 200;
door2.door._x = door2.door._x + door2.door._width;
} else if (mapn == 39) {
activator2.Type = 2;
door1.door._xscale = door1.door._xscale - 200;
door1.door._x = door1.door._x + door1.door._width;
} else if (mapn == 40) {
door4.door._xscale = door4.door._xscale - 200;
door4.door._x = door4.door._x + door4.door._width;
}
}
function mapScript() {
if (mapn == 0) {
} else if (mapn == 8) {
if (p1._x > 275) {
wallMover1.Active = true;
}
if (p1._x > 390) {
wallMover2.Active = true;
}
if (p1._x > 460) {
wallMover3.Active = true;
}
} else if (mapn == 11) {
_root.crusher1.Active = true;
} else if (mapn == 14) {
_root.crusher1.Active = true;
if (p1._x > 300) {
_root.crusher2.Active = true;
_root.crusher2.Speed = 1.5;
}
if ((p1._x > 600) and (p1._y < 300)) {
_root.crusher3.Active = true;
}
} else if (mapn == 17) {
if (p1._x > 470) {
_root.crusher1.Active = true;
}
} else if (mapn == 19) {
if (activator1.Active) {
elevator1.Active = true;
}
} else if ((mapn == 20) or (mapn == 25)) {
if (activator1.Active) {
door1.Closed = false;
} else {
door1.Closed = true;
}
} else if (((mapn == 21) or (mapn == 22)) or (mapn == 24)) {
if (ballin1.Active) {
door1.Closed = false;
}
} else if (mapn == 23) {
if (activator1.Active) {
door1.Closed = false;
} else {
door1.Closed = true;
}
if (ballin1.Active) {
door2.Closed = false;
}
} else if (mapn == 26) {
if (activator1.Active and activator2.Active) {
door1.Closed = false;
} else {
door1.Closed = true;
}
if (activator3.Active) {
door2.Closed = false;
} else {
door2.Closed = true;
}
} else if (mapn == 27) {
if (activator1.Active) {
door1.Closed = false;
} else {
door1.Closed = true;
}
if (activator2.Active) {
door2.Closed = false;
} else {
door2.Closed = true;
}
if (ballin1.Active) {
door3.Closed = false;
}
} else if (mapn == 28) {
if (activator1.Active or ((((p1._x > 310) and (p1._x < 455)) and (p1._y > 190)) and (p1._y < 260))) {
door2.Closed = false;
} else {
door2.Closed = true;
}
if (activator1.Active and activator2.Active) {
door1.Closed = false;
} else {
door1.Closed = true;
}
} else if (mapn == 29) {
if (activator1.Active) {
door1.Closed = false;
} else {
door1.Closed = true;
}
} else if (mapn == 30) {
if (activator1.Active) {
ballout1.Active = true;
}
if (activator2.Active) {
door1.Closed = false;
} else {
door1.Closed = true;
}
} else if (mapn == 31) {
if (((((!t1.Active) and (!t2.Active)) and (!t3.Active)) and (!t4.Active)) and (!t5.Active)) {
door1.Closed = false;
}
} else if (mapn == 32) {
if (activator1.Active and activator2.Active) {
door1.Closed = false;
} else {
door1.Closed = true;
}
if (ballin1.Active) {
door2.Closed = false;
}
} else if (mapn == 33) {
if (activator1.Active and activator2.Active) {
door1.Closed = false;
} else {
door1.Closed = true;
}
elevator1.Active = true;
wallMover1.Active = true;
} else if (mapn == 34) {
if (activator1.Active) {
door1.Closed = false;
} else {
door1.Closed = true;
}
if (activator2.Active) {
wallMover1.Active = true;
door2.Closed = false;
} else {
door2.Closed = true;
}
} else if (mapn == 35) {
if (activator1.Active) {
door1.Closed = false;
} else {
door1.Closed = true;
}
if (activator2.Active) {
door2.Closed = false;
} else {
door2.Closed = true;
}
if (activator3.Active) {
door3.Closed = false;
} else {
door3.Closed = true;
}
if (activator5.Active) {
door4.Closed = false;
} else {
door4.Closed = true;
}
if (activator4.Active) {
door5.Closed = false;
} else {
door5.Closed = true;
}
if (ballin1.Active) {
door6.Closed = false;
}
} else if (mapn == 36) {
if (activator1.Active) {
door1.Closed = false;
} else {
door1.Closed = true;
}
if (activator2.Active) {
door2.Closed = false;
}
} else if (mapn == 37) {
if (ballin1.Active) {
door1.Closed = false;
} else {
door1.Closed = true;
}
if (activator2.Active) {
door2.Closed = false;
}
if ((((activator1.Active and activator2.Active) and activator3.Active) and activator4.Active) and activator5.Active) {
door3.Closed = false;
}
} else if (mapn == 38) {
if ((activator1.Active and activator2.Active) and activator3.Active) {
door1.Closed = false;
} else {
door1.Closed = true;
}
if (activator4.Active and activator7.Active) {
door4.Closed = false;
} else {
door4.Closed = true;
}
if (activator5.Active) {
door2.Closed = false;
}
if (activator6.Active) {
door3.Closed = false;
}
} else if (mapn == 39) {
if (activator1.Active) {
door1.Closed = false;
} else {
door1.Closed = true;
}
if (activator2.Active) {
door2.Closed = false;
door3.Closed = false;
}
} else if (mapn == 40) {
if (activator1.Active) {
door1.Closed = false;
} else {
door1.Closed = true;
}
if (activator2.Active) {
door2.Closed = false;
} else {
door2.Closed = true;
}
if (activator3.Active or ((((p1._x > 223) and (p1._x < 435)) and (p1._y > 23)) and (p1._y < 168))) {
door3.Closed = false;
} else {
door3.Closed = true;
}
if ((((p1._x > 227) and (p1._x < 609)) and (p1._y > 320)) and (p1._y < 430)) {
door4.Closed = true;
} else {
door4.Closed = false;
}
} else if (mapn == 41) {
if (p1._x > 395) {
bg.cake.gotoAndStop(2);
}
}
}
function killPlayer(animation) {
if (pickedBox) {
p1.dropBox();
}
pickedBox = false;
pickedP = 0;
pickedStr = "p";
god = false;
noclip = false;
playerAlive = false;
playerHP = 0;
trace(animation);
if ((animation == "electric") or (animation == "electronic")) {
death_reason = "electric";
} else if (animation == "crash") {
death_reason = "crash";
} else if (animation == "shot") {
death_reason = "shot";
} else if (animation == "ar2") {
death_reason = "ar2";
noclip = true;
} else {
trace("death reson - wrong?");
}
}
function clearMap() {
ebg = 1;
while (ebg < (maxebg + 1)) {
removeMC(_root["bgeffect" + ebg]);
ebg++;
}
if (maxn > 2) {
maxn_tmp = _root.maxn;
n = 2;
while (n < maxn_tmp) {
removeBox();
n++;
}
}
if (maxt > 1) {
maxt_tmp = _root.maxt;
t = 1;
while (t < maxt_tmp) {
removeTurret();
t++;
}
}
if (maxb > 1) {
maxb_tmp = _root.maxb;
b = 1;
while (b < _root.maxb_tmp) {
removeLastBall();
b++;
}
}
if (maxc > 1) {
maxc_tmp = _root.maxc;
c = 1;
while (c < _root.maxc_tmp) {
removeCam();
c++;
}
}
if (maxo_cr > 1) {
maxo_cr_tmp = _root.maxo_cr;
cr = 1;
while (cr < _root.maxo_cr_tmp) {
removeCrusher();
cr++;
}
}
if (maxo_za > 1) {
maxo_za_tmp = _root.maxo_za;
za = 1;
while (za < _root.maxo_za_tmp) {
removeZapper();
za++;
}
}
if (maxo_wm > 1) {
maxo_wm_tmp = _root.maxo_wm;
wm = 1;
while (wm < _root.maxo_wm_tmp) {
removeWallMover();
wm++;
}
}
if (maxo_el > 1) {
maxo_el_tmp = _root.maxo_el;
el = 1;
while (el < _root.maxo_el_tmp) {
removeElevator();
el++;
}
}
if (maxo_bi > 1) {
maxo_bi_tmp = _root.maxo_bi;
bi = 1;
while (bi < _root.maxo_bi_tmp) {
removeBallIn();
bi++;
}
}
if (maxo_bo > 1) {
maxo_bo_tmp = _root.maxo_bo;
bo = 1;
while (bo < _root.maxo_bo_tmp) {
removeBallOut();
bo++;
}
}
if (maxo_a > 1) {
maxo_a_tmp = _root.maxo_a;
a = 1;
while (a < _root.maxo_a_tmp) {
removeActivator();
a++;
}
}
if (maxo_d > 1) {
maxo_d_tmp = _root.maxo_d;
d = 1;
while (d < _root.maxo_d_tmp) {
removeDoor();
d++;
}
}
if (maxphys > 1) {
maxphys_tmp = _root.maxphys;
ph = 1;
while (ph < _root.maxphys_tmp) {
removeLastPhysbox();
ph++;
}
}
}
function consoleCommandCheck(command) {
if (!command) {
} else {
command = command.toLowerCase();
commandExists = true;
var _local3 = command.split(" ");
consoleCommand = _local3[0];
consoleParam = _local3[1];
if ((consoleParam == undefined) or (consoleParam == "")) {
consoleParam_isNum = false;
} else if (isNaN(consoleParam)) {
consoleParam_isNum = false;
} else {
consoleParam_isNum = true;
consoleParam = new Number(consoleParam);
}
if (consoleCommand == "zing") {
extraTxt = "zzzing!";
} else if (consoleCommand == "cake") {
extraTxt = "ZEH CAKE IZ A LIE";
} else if (consoleCommand == "tralala") {
extraTxt = "have you touched my tralala?";
} else if (consoleCommand == "lolcopter") {
extraTxt = "that's my ride home.";
} else if (consoleCommand == "roflcopter") {
extraTxt = "that's the father of lolcopter.";
} else if (consoleCommand == "zingcraft") {
extraTxt = "zzzzzzzzwish!~";
} else if (consoleCommand == "hello") {
extraTxt = "why hello.";
} else if (consoleCommand == "shoopdawoop") {
extraTxt = "IMAH CARCHING MAH LAZAR";
} else if (consoleCommand == "awesome") {
extraTxt = "awesome indeed.";
} else if (consoleCommand == "thanks") {
extraTxt = "anytime.";
} else if (consoleCommand == "zomgowned") {
extraTxt = "lol.";
} else if (consoleCommand == "zomg") {
extraTxt = "ZEUS OWNED MY GEODUDE.";
} else if (consoleCommand == "lol") {
extraTxt = "lots of laughs?";
} else if (consoleCommand == "nonsense") {
extraTxt = "exactly, it doesn't make any sense.";
} else if (consoleCommand == "wassup") {
extraTxt = "wassuuuuuuuuuuuppp?";
} else if (consoleCommand == "console") {
extraTxt = "that's me!";
} else if (consoleCommand == "brain") {
extraTxt = "that'd be Ido's.";
} else if (consoleCommand == "bla") {
extraTxt = "try harder.";
} else if (consoleCommand == "bye") {
extraTxt = "oh please, don't leave.";
} else if (consoleCommand == "ok") {
extraTxt = "okie dokie!";
} else if (consoleCommand == "flash") {
extraTxt = "it crashes a lot. And does problems with Vista x64 ):";
} else if (consoleCommand == "zund") {
extraTxt = "\u05D6\u05D5\u05DE\u05D2!";
} else if (consoleCommand == "iphone") {
extraTxt = "don't even start.";
} else if (consoleCommand == "wecreatestuff") {
extraTxt = "oh, we totally do.";
} else if (consoleCommand == "aloligotcomplexcockitandpullit") {
extraTxt = "It's 'A loaded god complex, cock it and pull it' goddammit!.";
} else if (consoleCommand == "orly") {
extraTxt = "ya rly.";
} else if (consoleCommand == "gosh") {
extraTxt = "GOSH!!";
} else if (consoleCommand == "hitler") {
extraTxt = "HITL0R!?";
} else if (consoleCommand == "easteregg") {
extraTxt = "you found it.";
} else if (consoleCommand == "gman") {
extraTxt = "yes, you can find him, visualy, in this game...";
} else if (consoleCommand == "xbox") {
extraTxt = "X BAWX!";
} else if (consoleCommand == "portal") {
extraTxt = "now you're thinking with portals. no, nothing was activated.";
} else if (consoleCommand == "retarded") {
extraTxt = "movie!";
} else if (consoleCommand == "4815162342") {
extraTxt = "system failure system failure system failure system failure system failure system failure system failure";
} else if (consoleCommand == "crash") {
extraTxt = "we're trying, but we'll never be good as Source";
} else if (consoleCommand == "messenger") {
extraTxt = "Ido - dragy2005@hotmail.com Hen - henmazolski@gmail.com ):";
} else if (consoleCommand == "website") {
extraTxt = "wecreatestuff.com";
} else if (consoleCommand == "lost") {
extraTxt = "charlie's dead ):";
} else if (consoleCommand == "sneeze") {
extraTxt = "bless you.";
} else if (consoleCommand == "eon8") {
extraTxt = "oh you're fucked now.";
} else if (consoleCommand == "gmod") {
extraTxt = "GMAN APPROVES.";
} else if (consoleCommand == "iwanttoplayagame") {
extraTxt = "you are already.";
} else if (consoleCommand == "time") {
extraTxt = "what's the point? you know the time, you're just teasing me.";
} else if (consoleCommand == "thisismadness") {
killPlayer("crash");
extraTxt = "madness?..\n This\n IS\n SPARTAAA!!!\n subject was kicked to his death.";
} else if (consoleCommand == "hl2") {
extraTxt = "is awesome.";
} else if (consoleCommand == "hl2ep1") {
extraTxt = "is truly awesome.";
} else if (consoleCommand == "hl2ep2") {
extraTxt = "is a great looking game which I have not yet played. but by the time you read this I probably already have.";
} else if (consoleCommand == "tf2") {
extraTxt = "well I liked the first...";
} else if (consoleCommand == "overlord") {
extraTxt = "I like controling these goblins.";
} else if (consoleCommand == "pie") {
extraTxt = "Not just a pie, me friends, an APPLE pie.";
} else if (consoleCommand == "speak") {
extraTxt = "I don't speak.";
} else if (consoleCommand == "eat") {
extraTxt = "Die.";
} else if (consoleCommand == "stop") {
extraTxt = "();";
} else if (consoleCommand == "nightmarehouse") {
extraTxt = "is an hl2 mod by us D:";
} else if (((((consoleCommand == "help") or (consoleCommand == "commandlist")) or (consoleCommand == "showlist")) or (consoleCommand == "showcommands")) or (consoleCommand == "showcommand")) {
extraTxt = "Partial command database below.";
extraTxt = extraTxt + "\ninfo - Information.";
extraTxt = extraTxt + "\nkill - suicide.";
extraTxt = extraTxt + "\nhelp/commandlist/showlist/showcommand - partial command database.";
extraTxt = extraTxt + "\nsound - enable/disable sounds.";
extraTxt = extraTxt + "\naim/space - allow [SPACE] dummy portal.";
extraTxt = extraTxt + "\nquality 0-3 - set quality level.";
extraTxt = extraTxt + "\neffects 0-2 - set effect level.";
extraTxt = extraTxt + "\ngravity [0>#] - set map gravity level.";
extraTxt = extraTxt + "\nprevlevel - go to next level.";
extraTxt = extraTxt + "\nnextlevel - go to previous level.";
extraTxt = extraTxt + "\nshowfps - visible/invisible fps and level name.";
extraTxt = extraTxt + "\nOther commands (show<command>, create<command>, remove<command>, <command>) are hidden.";
} else if ((consoleCommand == "kill") or (consoleCommand == "die")) {
killPlayer("crash");
extraTxt = "subject commited suicide with an invisible crowbar.";
} else if (consoleCommand == "noclip") {
if (_root.noclip == false) {
_root.noclip = true;
extraTxt = "noclip enabled.";
} else {
_root.noclip = false;
extraTxt = "noclip disabled.";
}
} else if (consoleCommand == "god") {
if (_root.god == false) {
_root.god = true;
extraTxt = "god enabled.";
} else {
_root.god = false;
extraTxt = "god disabled.";
}
} else if ((consoleCommand == "dance") or (consoleCommand == "/dance")) {
if (_root.dance_enabled == false) {
_root.dance_enabled = true;
extraTxt = "dance enabled.";
} else {
_root.dance_enabled = false;
extraTxt = "dance disabled.";
}
} else if ((consoleCommand == "sounds") or (consoleCommand == "sound")) {
if (sounds) {
allsound.setVolume(0);
sounds = false;
extraTxt = "sounds disabled.";
} else {
allsound.setVolume(100);
sounds = true;
extraTxt = "sounds enabled.";
}
} else if (consoleCommand == "crosshair") {
if (crosshair) {
crosshair = false;
extraTxt = "crosshair disabled.";
} else {
crosshair = true;
extraTxt = "crosshair enabled.";
}
} else if (((consoleCommand == "space") or (consoleCommand == "aim")) or (consoleCommand == "detectshot")) {
if (spaceDummy) {
spaceDummy = false;
extraTxt = "Aim (space) disabled.";
} else {
spaceDummy = true;
extraTxt = "Aim (space) enabled.";
}
} else if (consoleCommand == "autoquality") {
if (quality_auto) {
quality_auto = false;
extraTxt = "sounds disabled.";
} else {
quality_auto = true;
extraTxt = "sounds enabled.";
}
} else if ((consoleCommand == "dynamiccam") or (consoleCommand == "dynamicam")) {
if (playerCam) {
playerCam = false;
extraTxt = "playerCam disabled.";
} else {
playerCam = true;
extraTxt = "playerCam enabled.";
}
} else if ((consoleCommand == "stopallsounds") or (consoleCommand == "stopsounds")) {
stopAllSounds();
extraTxt = "all sounds currently running were stopped";
} else if (consoleCommand == "info") {
extraTxt = portalver;
} else if (consoleCommand == "showfps") {
if (showfps == true) {
showfps = false;
extraTxt = "fps invisible.";
} else {
showfps = true;
extraTxt = "fps visible.";
}
} else if (consoleCommand == "showmapbox") {
if (bg.ground._visible == true) {
bg.ground._visible = false;
bg.wall._visible = false;
bg.antiportal._visible = false;
bg.antiobject._visible = false;
bg.kill._visible = false;
bg.kill_ar2._visible = false;
extraTxt = "mapbox invisible.";
} else {
bg.ground._visible = true;
bg.wall._visible = true;
bg.antiportal._visible = true;
bg.antiobject._visible = true;
bg.kill._visible = true;
bg.kill_ar2._visible = true;
extraTxt = "mapbox visible.";
}
} else if ((consoleCommand == "showdynamicbox") or (consoleCommand == "showdynamicboxes")) {
if (maxphys > 1) {
if (phybox1._visible == true) {
phy = 1;
while (phy < _root.maxphys) {
_root["phybox" + phy]._visible = false;
phy++;
}
extraTxt = "dynamic physicboxes invisible.";
} else {
phy = 1;
while (phy < _root.maxphys) {
_root["phybox" + phy]._visible = true;
phy++;
}
extraTxt = "dynamic physicboxes visible.";
}
} else {
extraTxt = "cannot show dynamic physicboxes.";
}
} else if (consoleCommand == "showportalbox") {
if (portal1._visible == true) {
portal1._visible = false;
portal2._visible = false;
extraTxt = "portalbox invisible.";
} else {
portal1._visible = true;
portal2._visible = true;
extraTxt = "portalbox visible.";
}
} else if (consoleCommand == "showportalhitbox") {
if (wt1._visible == true) {
wt1._visible = false;
wt2._visible = false;
extraTxt = "portalhitbox invisible.";
} else {
wt1._visible = true;
wt2._visible = true;
extraTxt = "portalhitbox visible.";
}
} else if (consoleCommand == "showportalmask") {
if (ht1._visible == true) {
ht1._visible = false;
ht2._visible = false;
extraTxt = "portalmask invisible.";
} else {
ht1._visible = true;
ht2._visible = true;
extraTxt = "portalmask visible.";
}
} else if ((consoleCommand == "showsteps") or (consoleCommand == "showstep")) {
if (step1._visible == true) {
step1._visible = false;
step2._visible = false;
extraTxt = "steps invisible.";
} else {
step1._visible = true;
step2._visible = true;
extraTxt = "steps visible.";
}
} else if ((consoleCommand == "showshot") or (consoleCommand == "showshots")) {
if (Target._visible == true) {
Target._visible = false;
extraTxt = "shots invisible.";
} else {
Target._visible = true;
extraTxt = "shots visible.";
}
} else if (consoleCommand == "gravity") {
if (!consoleParam_isNum) {
extraTxt = consoleError_notParam;
} else {
if (consoleParam <= 0) {
gravity = 0.05;
} else {
gravity = consoleParam / 600;
}
extraTxt = "gravity is set to " + (gravity * 600);
}
} else if ((consoleCommand == "quality") or (consoleCommand == "_quality")) {
if (!consoleParam_isNum) {
extraTxt = consoleError_notParam;
} else {
if (consoleParam == 0) {
_quality = "LOW";
} else if (consoleParam == 1) {
_quality = "MEDIUM";
} else if (consoleParam == 2) {
_quality = "HIGH";
} else if (consoleParam == 3) {
_quality = "BEST";
}
extraTxt = "quality is set to " + _quality;
}
} else if (consoleCommand == "effects") {
if (!consoleParam_isNum) {
extraTxt = consoleError_notParam;
} else {
if (consoleParam == 0) {
effects = 0;
} else if (consoleParam == 1) {
effects = 1;
} else if (consoleParam == 2) {
effects = 2;
}
extraTxt = "effects is set to " + effects;
}
} else if (consoleCommand == "createbox") {
createBox(p1._x, p1._y - p1._height);
extraTxt = "object BOX has been spawned.";
} else if (consoleCommand == "removebox") {
if (maxn > 2) {
removeBox();
extraTxt = "object BOX has been deleted.";
} else {
extraTxt = "object BOX could not be deleted.";
}
} else if (consoleCommand == "createcam") {
createCam(p1._x, p1._y);
extraTxt = "object CAM has been spawned.";
} else if (consoleCommand == "removecam") {
if (maxc > 1) {
removeCam();
extraTxt = "object CAM has been deleted.";
} else {
extraTxt = "object CAM could not be deleted.";
}
} else if (consoleCommand == "createball") {
createBall(p1._x, p1._y - (p1._height * 2), "up");
extraTxt = "object BALL has been spawned.";
} else if (consoleCommand == "removeBall") {
if (maxb > 1) {
removeLastBall();
extraTxt = "object BALL has been deleted.";
} else {
extraTxt = "object BALL could not be deleted.";
}
} else if ((((consoleCommand == "createturret") or (consoleCommand == "createturrent")) or (consoleCommand == "createturretr")) or (consoleCommand == "createturrentr")) {
createTurret(p1._x, p1._y, "right");
extraTxt = "object TURRENT has been spawned.";
} else if ((consoleCommand == "createturretl") or (consoleCommand == "createturrenl")) {
createTurret(p1._x, p1._y, "left");
extraTxt = "object TURRENT has been spawned.";
} else if (consoleCommand == "removeturret") {
if (maxt > 1) {
removeTurret();
extraTxt = "object TURRET has been deleted.";
} else {
extraTxt = "object TURRET could not be deleted.";
}
} else if ((consoleCommand == "restartlevel") or (consoleCommand == "restartmap")) {
restartLevel();
extraTxt = ("Level (" + nextMap) + ") restarted.";
} else if ((consoleCommand == "gotolevel") or (consoleCommand == "gotoandplay")) {
if (!consoleParam_isNum) {
extraTxt = consoleError_notParam;
} else if (consoleParam < 0) {
restartLevel();
extraTxt = ("Level (" + nextMap) + ") restarted.";
} else {
mapn = consoleParam;
nextMap = ["level" + mapn];
nextLevel = true;
extraTxt = ("level " + nextMap) + " launched";
}
} else if ((consoleCommand == "nextlevel") or (consoleCommand == "followinglevel")) {
mapn++;
nextMap = ["level" + mapn];
nextLevel = true;
extraTxt = ("Next level (" + nextMap) + ") launched.";
} else if ((consoleCommand == "prevlevel") or (consoleCommand == "previouslevel")) {
if (mapn >= 0) {
mapn--;
nextMap = ["level" + mapn];
nextLevel = true;
extraTxt = ("Previous level (" + nextMap) + ") launched.";
} else {
extraTxt = "Cannot play previous level.";
}
} else {
extraTxt = "";
commandExists = false;
}
console.consoleTxt = console.consoleTxt + (("] " + command) + newline);
if (commandExists) {
console.consoleTxt = console.consoleTxt + (extraTxt + newline);
} else {
console.consoleTxt = console.consoleTxt + ((("command '" + command) + "' does not exist.") + newline);
}
console.consoleTxt.scroll = console.consoleTxt.scroll + 50;
tempInsertTxt = command;
console.insertTxt = "";
}
}
function fpsCheck() {
time = getTimer() / 1000;
thistime = time - oldtime;
if (thistime >= 1) {
actualFPS = toframes;
toframes = 0;
oldtime++;
} else {
toframes++;
}
}
stop();
TextField.prototype.swapDepths = MovieClip.prototype.swapDepths;
var allsound = new Sound(this);
var musicVol = new Sound(p1);
musicPlaying = false;
fscommand ("allowscale", false);
showfps_txt_exist = false;
time = 0;
oldtime = 0;
thistime = 0;
toframes = 0;
actualFPS = 0;
portal_d = 1.5;
portal_p = 10;
pauseMenu._visible = false;
nl_frame._visible = false;
console._visible = false;
enterMask._visible = false;
doorEnterM._visible = false;
exitMask._visible = false;
doorExitM._visible = false;
cursor.bloodGlow._alpha = 0;
stopPlayMovies = true;
consoleEnabled = true;
consoleError_notParam = "the command you've entered requires an extra number to be set";
justloaded = true;
running = false;
noclip = false;
god = false;
spaceDummy = false;
playerAlive = true;
playerHP = 100;
shotDmg = 15;
death_restart = false;
dance_enabled = false;
var zapperIdleC = this.transform.colorTransform;
var zapperZappinC = this.transform.colorTransform;
zapperIdleC.rgb = 6710886 /* 0x666666 */;
zapperZappinC.rgb = 630780 /* 0x099FFC */;
playerCam = false;
pickedBox = false;
pickedP = 0;
pickedStr = "p";
tempInsertTxt = "createturret";
gravity = 1;
maxn = 2;
maxb = 1;
maxt = 1;
maxc = 1;
maxo_cr = 1;
maxo_za = 1;
maxo_wm = 1;
maxo_el = 1;
maxo_bi = 1;
maxo_bo = 1;
maxo_a = 1;
maxo_d = 1;
maxphys = 1;
maxe = 1;
mine = 1;
runbge = 1;
maxebg = 60;
regenInt = 0;
p1portaled = false;
ME_direction = true;
ballLoopingSound = false;
ballSpeed = 5;
ballLife = 20;
ball_time = ballLife * 1000;
restartLevelDelay_bol = true;
portal_blue_open = false;
portal_yellow_open = false;
startLevelRunRight = false;
nextLevel = true;
nextLevel2 = false;
nextlevel_mc = false;
flatLevel = false;
if (mapn == undefined) {
mapn = 1;
}
nextMap = ["level" + mapn];
bg._visible = false;
stats_portaled = 0;
stats_portalshot = 0;
stats_died = 0;
var cl_hudnformat = new TextFormat();
cl_hudnformat.font = "Arial";
cl_hudnformat.size = 10;
var tipFormat = new TextFormat();
tipFormat.font = "Arial";
tipFormat.size = 11;
tipFormat.bold = true;
tipFormat.color = 16777215 /* 0xFFFFFF */;
var be = (new flash.filters.BlurFilter());
be.quality = 0;
be.blurX = 0;
be.blurY = 0;
delaySound = false;
_root.boxstiming = false;
canShot = true;
currentShot = 1;
var buttonlistener = new Object();
buttonlistener.onKeyDown = function () {
btnDown = true;
};
buttonlistener.onKeyUp = function () {
btnDown = false;
};
Key.addListener(buttonlistener);
var mouseListenerDown = new Object();
mouseListenerDown.onMouseDown = function () {
mouseCl = true;
};
Mouse.addListener(mouseListenerDown);
var mouseListenerUp = new Object();
mouseListenerUp.onMouseUp = function () {
mouseCl = false;
};
mouseListener = new Object();
mouseListener.onMouseWheel = function () {
_root.currentShot++;
};
Mouse.addListener(mouseListener);
Mouse.addListener(mouseListenerUp);
console.movable.onPress = function () {
startDrag (console);
};
console.movable.onRelease = function () {
stopDrag();
};
console.closeWin.onRelease = function () {
console._visible = false;
};
_root.onEnterFrame = function () {
Right = Key.isDown(68) or Key.isDown(39);
Left = Key.isDown(65) or Key.isDown(37);
Down = Key.isDown(83) or Key.isDown(40);
Up = Key.isDown(87) or Key.isDown(38);
Aim = Key.isDown(32);
BuildKey = Key.isDown(66);
fPickUp = Key.isDown(70);
Reload = Key.isDown(82);
portalQ = Key.isDown(81) or Key.isDown(46);
portalE = Key.isDown(69) or Key.isDown(34);
qualityChange = Key.isDown(79);
p_esc_isdown = Key.isDown(80) or Key.isDown(27);
console_isdown = Key.isDown(192);
enter_isdown = Key.isDown(13);
if (qualityChange) {
if ((!opressed) and (console._visible == false)) {
if (_quality == "LOW") {
pauseMenu.window_options.changeQuality(1);
} else if (_quality == "MEDIUM") {
pauseMenu.window_options.changeQuality(2);
} else if ((_quality == "HIGH") or (_quality == "BEST")) {
pauseMenu.window_options.changeQuality(0);
}
pauseMenu.window_options.slider1._x = pauseMenu.window_options.track1._x + ((pauseMenu.window_options.track1._width / 3) * _root.settings.data.qualitys);
opressed = true;
}
} else {
opressed = false;
}
if (((p_esc_isdown and (console._visible == false)) and (!playingScene)) and (!_root.nextlevel_mc)) {
if (!ppressed) {
if (running) {
running = false;
pauseMenu._visible = true;
} else {
running = true;
pauseMenu._visible = false;
}
ppressed = true;
}
} else {
ppressed = false;
}
if (((console_isdown and consoleEnabled) and (!playingScene)) and (!_root.nextlevel_mc)) {
if (!console_isdown_pressed) {
if (console._visible == true) {
running = true;
pauseMenu._visible = false;
console._visible = false;
} else {
running = false;
pauseMenu._visible = true;
Selection.setFocus("_root.console.insertTxt");
console._visible = true;
}
console_isdown_pressed = true;
}
} else {
console_isdown_pressed = false;
}
if (console._visible == true) {
if (Key.isDown(38)) {
console.insertTxt = tempInsertTxt;
} else if (Key.isDown(40)) {
console.insertTxt = "";
}
if (enter_isdown and (!Key.isDown(38))) {
consoleCommandCheck(console.insertTxt);
}
}
if (nextLevel) {
trace(playingScene);
playingScene = false;
trace(playingScene);
nl_frame._visible = true;
if ((mapn >= 0) and (!justloaded)) {
nl_frame.gotoAndPlay(2);
} else if ((mapn >= 0) and justloaded) {
nl_frame.gotoAndPlay(10);
bg._visible = true;
}
running = false;
_root.nextLevel = false;
}
if (nextLevel2) {
_root.stats = SharedObject.getLocal("stats");
if (stats.data.map < mapn) {
stats.data.map = mapn;
stats.flush();
}
_root.portal2._x = _root.trash._x;
_root.portal2._y = _root.trash._y;
_root.portal1._x = _root.trash._x;
_root.portal1._y = _root.trash._y;
_root.portal1l._x = _root.trash._x;
_root.portal1l._y = _root.trash._y;
_root.portal2l._x = _root.trash._x;
_root.portal2l._y = _root.trash._y;
_root.wt1._x = _root.trash._x;
_root.wt1._y = _root.trash._y;
_root.wt2._x = _root.trash._x;
_root.wt2._y = _root.trash._y;
_root.ht1._x = _root.trash._x;
_root.ht1._y = _root.trash._y;
_root.ht2._x = _root.trash._x;
_root.ht2._y = _root.trash._y;
_root.step1._x = _root.trash._x;
_root.step1._y = _root.trash._y;
_root.step2._x = _root.trash._x;
_root.step2._y = _root.trash._y;
portal_blue_open = false;
portal_yellow_open = false;
clearMap();
killTip();
clearInterval(tipShowUp);
clearInterval(tipKill);
clearInterval(tipShowDown);
killGuide();
clearInterval(guideShowUp);
clearInterval(guideKill);
clearInterval(guideShowDown);
boxcreators = false;
mapPreLoadScript();
p1.envSpeed = 0;
p1.xSpeed = 0;
p1.ySpeed = 0;
playerAlive = true;
death_restart = false;
playerHP = 100;
death_reason = "";
playerdead.gotoAndStop(1);
p1.gotoAndStop("idle");
ball_time = ballLife * 1000;
pickedBox = false;
pickedP = 0;
pickedStr = "p";
bn = 1;
while (bn <= 7) {
roomLoop.stop(["roomLoop" + bn]);
bn++;
}
roomLoop = new Sound(bg);
roomLoop.attachSound(["roomLoop" + (Math.floor(Math.random() * 4) + 3)]);
roomLoop.setVolume(10);
roomLoop.start(0, 999);
if (!musicPlaying) {
if (mapn == 1) {
musicVol.attachSound("music_1");
} else {
musicVol.attachSound("music_" + (Math.floor(Math.random() * 3) + 1));
}
musicVol.onSoundComplete = randomSong;
musicVol.start();
musicPlaying = true;
}
bg.gotoAndStop(nextMap);
bg_g.gotoAndStop(nextMap);
enterMask._x = bg.door_enter._x + bg._x;
enterMask._y = bg.door_enter._y + bg._y;
doorEnterM._x = bg.door_enter._x + bg._x;
doorEnterM._y = bg.door_enter._y + bg._y;
exitMask._x = bg.door_exit._x + bg._x;
exitMask._y = bg.door_exit._y + bg._y;
doorExitM._x = bg.door_exit._x + bg._x;
doorExitM._y = bg.door_exit._y + bg._y;
bn = 1;
while (bn <= 10) {
createCrusher(bg["createcrusher" + bn]._x + bg._x, bg["createcrusher" + bn]._y + bg._y, bg["createcrusher" + bn]._xscale);
bg["createcrusher" + bn]._visible = false;
bn++;
}
bn = 1;
while (bn <= 10) {
if ((bg[("createzapper" + bn) + "_up"]._x < 1000) and (bg[("createzapper" + bn) + "_down"]._x < 1000)) {
createZapper(bg[("createzapper" + bn) + "_up"]._x + bg._x, bg[("createzapper" + bn) + "_up"]._y + bg._y, bg[("createzapper" + bn) + "_down"]._x + bg._x, bg[("createzapper" + bn) + "_down"]._y + bg._y, bg[("createzapper" + bn) + "_up"]._width);
}
bg[("createzapper" + bn) + "_up"]._visible = false;
bg[("createzapper" + bn) + "_down"]._visible = false;
bn++;
}
bn = 1;
while (bn <= 10) {
createWallMover(bg["createwallmover" + bn]._x + bg._x, bg["createwallmover" + bn]._y + bg._y, bg["createwallmover" + bn]._rotation);
bg["createwallmover" + bn]._visible = false;
bn++;
}
bn = 1;
while (bn <= 10) {
createElevator(bg["createelevator" + bn]._x + bg._x, bg["createelevator" + bn]._y + bg._y);
bg["createelevator" + bn]._visible = false;
bn++;
}
bn = 1;
while (bn <= 10) {
createBallIn(bg["createballin" + bn]._x + bg._x, bg["createballin" + bn]._y + bg._y, bg["createballin" + bn]._rotation);
bg["createballin" + bn]._visible = false;
bn++;
}
bn = 1;
while (bn <= 10) {
createBallOut(bg["createballout" + bn]._x + bg._x, bg["createballout" + bn]._y + bg._y, bg["createballout" + bn]._rotation);
bg["createballout" + bn]._visible = false;
bn++;
}
bn = 1;
while (bn <= 10) {
createActivator(bg["createactivator" + bn]._x + bg._x, bg["createactivator" + bn]._y + bg._y);
bg["createactivator" + bn]._visible = false;
bn++;
}
bn = 1;
while (bn <= 10) {
if ((bg["createdoor" + bn]._rotation == 0) or (bg["createdoor" + bn]._rotation == 180)) {
createDoor(bg["createdoor" + bn]._x + bg._x, bg["createdoor" + bn]._y + bg._y, bg["createdoor" + bn]._rotation, bg["createdoor" + bn]._height);
} else {
createDoor(bg["createdoor" + bn]._x + bg._x, bg["createdoor" + bn]._y + bg._y, bg["createdoor" + bn]._rotation, bg["createdoor" + bn]._width);
}
bg["createdoor" + bn]._visible = false;
bn++;
}
bn = 1;
while (bn <= 10) {
createTurret(bg[("createturret" + bn) + "_left"]._x + bg._x, bg[("createturret" + bn) + "_left"]._y + bg._y, "left");
createTurret(bg[("createturret" + bn) + "_right"]._x + bg._x, bg[("createturret" + bn) + "_right"]._y + bg._y, "right");
bg[("createturret" + bn) + "_right"]._visible = false;
bg[("createturret" + bn) + "_left"]._visible = false;
bn++;
}
bn = 1;
while (bn <= 10) {
createBox(bg["createbox" + bn]._x + bg._x, bg["createbox" + bn]._y + bg._y);
bg["createbox" + bn]._visible = false;
bn++;
}
bn = 1;
while (bn <= 10) {
createCam(bg["createcam" + bn]._x + bg._x, bg["createcam" + bn]._y + bg._y);
bg["createcam" + bn]._visible = false;
bn++;
}
bn = 1;
while (bn <= 10) {
if (bg["createball" + bn]._rotation == 180) {
createballrotation = "down";
} else if (bg["createball" + bn]._rotation == 0) {
createballrotation = "up";
} else if (bg["createball" + bn]._rotation == -90) {
createballrotation = "left";
} else if (bg["createball" + bn]._rotation == 90) {
createballrotation = "right";
}
createBall(bg["createball" + bn]._x + bg._x, bg["createball" + bn]._y + bg._y, createballrotation);
bg["createball" + bn]._visible = false;
bn++;
}
bg.ground._alpha = 50;
bg.wall._alpha = 50;
bg.antiportal._alpha = 50;
bg.antiobject._alpha = 50;
bg.kill._alpha = 50;
bg.kill_ar2._alpha = 50;
bg.ground._visible = false;
bg.wall._visible = false;
bg.antiportal._visible = false;
bg.antiobject._visible = false;
bg.kill._visible = false;
bg.kill_ar2._visible = false;
bg.door_enter._visible = false;
bg.door_exit._visible = false;
bg.player_enter._visible = false;
bg.player_exit._visible = false;
p1._x = bg.player_enter._x + bg._x;
p1._y = bg.player_enter._y + bg._y;
flatLevel = false;
mapLoadScript();
tipTexts();
guideTexts();
if (guidance) {
if (quicktip == "") {
trace("tipTexts falsed");
} else {
tipShowUp = setInterval(_root, "launchTip", 500);
}
if (guiderootext == "") {
trace("guidetext falsed");
} else {
guideShowUp = setInterval(_root, "launchGuide", 500);
}
}
if (!flatLevel) {
startLevelRunRight = true;
} else {
startLevelRunRight = false;
}
god = false;
noclip = false;
justloaded = false;
_root.nextLevel2 = false;
}
if (playingScene) {
running = false;
musicVol.stop();
musicPlaying = false;
}
if (_root.nextlevel_mc == true) {
if (((((mouseCl or btnDown) and canGoNextLevel) and (!pauseMenu._visible)) and (!playingScene)) and (!p_esc_isdown)) {
if (mapn == 1) {
trace("scene1");
if (!playingScene) {
_root.nl_frame.scenes.gotoAndStop(2);
playingScene = true;
}
} else if (mapn == 42) {
trace("scene credits");
if (!playingScene) {
_root.nl_frame.scenes.gotoAndStop(3);
playingScene = true;
}
} else {
_root.nl_frame.play();
}
}
if (mouseCl or btnDown) {
canGoNextLevel = false;
} else {
canGoNextLevel = true;
}
}
if (showfps == true) {
if (showfps_txt_exist == false) {
this.createTextField("cl_hudn", 1048574, 700, 0, 100, 20);
showfps_txt_exist = true;
}
cl_hudn.text = (("fps: " + actualFPS) + " ") + nextMap;
if (actualFPS > 29) {
cl_hudnformat.color = 65280;
} else if ((actualFPS > 20) and (actualFPS <= 29)) {
cl_hudnformat.color = 255;
} else {
cl_hudnformat.color = 16711680 /* 0xFF0000 */;
}
cl_hudn.setTextFormat(cl_hudnformat);
} else if (showfps_txt_exist == true) {
removeTF(cl_hudn);
showfps_txt_exist = false;
}
if (crosshair and running) {
Mouse.hide();
cursor._visible = true;
cursor._x = _xmouse;
cursor._y = _ymouse;
} else {
Mouse.show();
cursor._visible = false;
}
if (running) {
if (tipExist) {
tipText._x = tipText._x + ((-tipText._x) / 6);
tipTextBG._x = tipText._x + tipText._width;
} else if ((!tipExist) and (!isNaN(tipText._x))) {
tipText._x = tipText._x + (((-tipText._width) - tipText._x) / 6);
tipTextBG._x = tipText._x + tipText._width;
}
if (enter_isdown and guideExist) {
guideExist = false;
guideKill = setInterval(_root, "killGuide", 2000);
tipShowDown = setInterval(_root, "downTip", 1000);
tipKill = setInterval(_root, "killTip", 2000);
}
if (guideExist) {
guideText._y = guideText._y + ((-guideText._y) / 6);
guideTextBG._y = guideText._y + guideText._height;
} else if ((!guideExist) and (!isNaN(guideText._y))) {
guideText._y = guideText._y + (((-guideText._height) - guideText._y) / 6);
guideTextBG._y = guideText._y + guideText._height;
}
if (playerHP > 0) {
if (cursor.bloodGlow._alpha > (100 - playerHP)) {
cursor.bloodGlow._alpha = cursor.bloodGlow._alpha - 1;
} else if (cursor.bloodGlow._alpha < (100 - playerHP)) {
cursor.bloodGlow._alpha = cursor.bloodGlow._alpha + 5;
}
} else {
cursor.bloodGlow._alpha = 0;
}
if (portal_blue_open) {
cursor.blue.gotoAndStop(2);
} else {
cursor.blue.gotoAndStop(1);
}
if (portal_yellow_open) {
cursor.yellow.gotoAndStop(2);
} else {
cursor.yellow.gotoAndStop(1);
}
if (_root.effects >= 1) {
if (_root.portal1l.hitTest(p1)) {
if (_root.portal1l._rotation == 90) {
_root.portal2l.manref._alpha = 100 - (((p1._x - _root.portal1l._x) * 80) / 55);
_root.portal2l.manref._xscale = 100 - (((p1._x - _root.portal1l._x) * 100) / 55);
_root.portal2l.manref._yscale = 100 - (((p1._x - _root.portal1l._x) * 100) / 55);
_root.portal2l.manref._x = Math.floor(-((p1._y - (p1._height / 2)) - _root.portal1l._y));
} else if (_root.portal1l._rotation == -90) {
_root.portal2l.manref._alpha = 100 + (((p1._x - _root.portal1l._x) * 80) / 55);
_root.portal2l.manref._xscale = 100 + (((p1._x - _root.portal1l._x) * 100) / 55);
_root.portal2l.manref._yscale = 100 + (((p1._x - _root.portal1l._x) * 100) / 55);
_root.portal2l.manref._x = Math.floor((p1._y - (p1._height / 2)) - _root.portal1l._y);
} else if (_root.portal1l._rotation == 0) {
_root.portal2l.manref._alpha = 100 + ((((p1._y - _root.portal1l._y) / 2) * 80) / 55);
_root.portal2l.manref._xscale = 100 + (((p1._y - _root.portal1l._y) * 100) / 55);
_root.portal2l.manref._yscale = 100 + (((p1._y - _root.portal1l._y) * 100) / 55);
_root.portal2l.manref._x = Math.floor((p1._x - (p1._width / 2)) - _root.portal1l._x);
} else if (_root.portal1l._rotation == 180) {
_root.portal2l.manref._alpha = 100 - (((p1._y - _root.portal1l._y) * 80) / 55);
_root.portal2l.manref._xscale = 100 - (((p1._y - _root.portal1l._y) * 100) / 55);
_root.portal2l.manref._yscale = 100 - (((p1._y - _root.portal1l._y) * 100) / 55);
_root.portal2l.manref._x = Math.floor((p1._x - (p1._width / 2)) - _root.portal1l._x);
}
} else {
if (_root.portal2l.manref._alpha > 0) {
_root.portal2l.manref._alpha = _root.portal2l.manref._alpha - 10;
}
if (_root.portal2l.manref._xscale > 10) {
_root.portal2l.manref._xscale = _root.portal2l.manref._xscale - 10;
}
if (_root.portal2l.manref._yscale > 10) {
_root.portal2l.manref._yscale = _root.portal2l.manref._yscale - 10;
}
}
if (_root.portal2l.hitTest(p1)) {
if (_root.portal2l._rotation == 90) {
_root.portal1l.manref._alpha = 100 - (((p1._x - _root.portal2l._x) * 80) / 55);
_root.portal1l.manref._xscale = 100 - (((p1._x - _root.portal2l._x) * 100) / 55);
_root.portal1l.manref._yscale = 100 - (((p1._x - _root.portal2l._x) * 100) / 55);
_root.portal1l.manref._x = Math.floor(-((p1._y - (p1._height / 2)) - _root.portal2l._y));
} else if (_root.portal2l._rotation == -90) {
_root.portal1l.manref._alpha = 100 + (((p1._x - _root.portal2l._x) * 80) / 55);
_root.portal1l.manref._xscale = 100 + (((p1._x - _root.portal2l._x) * 100) / 55);
_root.portal1l.manref._yscale = 100 + (((p1._x - _root.portal2l._x) * 100) / 55);
_root.portal1l.manref._x = Math.floor((p1._y - (p1._height / 2)) - _root.portal2l._y);
} else if (_root.portal2l._rotation == 0) {
_root.portal1l.manref._alpha = 100 + (((p1._y - _root.portal2l._y) * 80) / 55);
_root.portal1l.manref._xscale = 100 + (((p1._y - _root.portal2l._y) * 100) / 55);
_root.portal1l.manref._yscale = 100 + (((p1._y - _root.portal2l._y) * 100) / 55);
_root.portal1l.manref._x = Math.floor((p1._x - (p1._width / 2)) - _root.portal2l._x);
} else if (_root.portal2l._rotation == 180) {
_root.portal1l.manref._alpha = 100 - (((p1._y - _root.portal2l._y) * 80) / 55);
_root.portal1l.manref._xscale = 100 - (((p1._y - _root.portal2l._y) * 100) / 55);
_root.portal1l.manref._yscale = 100 - (((p1._y - _root.portal2l._y) * 100) / 55);
_root.portal1l.manref._x = Math.floor((p1._x - (p1._width / 2)) - _root.portal2l._x);
}
} else {
if (_root.portal1l.manref._alpha > 0) {
_root.portal1l.manref._alpha = _root.portal1l.manref._alpha - 10;
}
if (_root.portal1l.manref._xscale > 10) {
_root.portal1l.manref._xscale = _root.portal1l.manref._xscale - 10;
}
if (_root.portal1l.manref._yscale > 10) {
_root.portal1l.manref._yscale = _root.portal1l.manref._yscale - 10;
}
}
} else {
_root.portal1l.manref._visible = false;
_root.portal2l.manref._visible = false;
}
if ((!isNaN(_root["b" + (_root.maxb - 1)]._x)) and (!ballLoopingSound)) {
trace("THERES A BALL!!!!");
if (sounds) {
ballLoop = new Sound(_root["b" + (_root.maxb - 1)]);
ballLoop.attachSound("ballLoop");
ballLoop.setVolume(50);
ballLoop.onSoundComplete = ballLoopFunc;
ballLoop.start();
}
ballLoopingSound = true;
} else if (isNaN(_root["b" + (_root.maxb - 1)]._x)) {
ballLoopingSound = false;
ballLoop.stop("ballLoop");
}
if ((portal_blue_open == false) or (portal_yellow_open == false)) {
portal_wave_alpha = 100;
} else if ((portal_blue_open == true) and (portal_yellow_open == true)) {
if (portal_wave_alpha > 0) {
portal_wave_alpha = portal_wave_alpha - 10;
}
}
portal1l.closedMC._alpha = portal_wave_alpha;
portal1l.closedMC_blank._alpha = portal_wave_alpha;
portal2l.closedMC._alpha = portal_wave_alpha;
portal2l.closedMC_blank._alpha = portal_wave_alpha;
ac = 1;
while (ac < _root.maxo_a) {
prsrnum = 1;
while (prsrnum < _root.maxn) {
if (_root["activator" + ac].pressBtn.hitTest(_root["p" + prsrnum]._x, _root["p" + prsrnum]._y, true)) {
_root["activator" + ac].Pressing = true;
break;
}
if (_root["activator" + ac].Type != 2) {
_root["activator" + ac].Pressing = false;
}
prsrnum++;
}
if (_root["activator" + ac].red._y <= -0.5) {
_root["activator" + ac].Active = false;
} else {
_root["activator" + ac].Active = true;
}
ac++;
}
cr = 1;
while (cr < _root.maxo_d) {
if (_root["door" + cr].Active) {
if (_root["door" + cr].Closed) {
_root["door" + cr].door._y = _root["door" + cr].door._y + (((_root["door" + cr].Distance - 15) - _root["door" + cr].door._y) / 2.5);
if (!_root["door" + cr].soundflag) {
if (_root.sounds) {
doorSound = new Sound();
doorSound.attachSound("door_close");
doorSound.start();
}
_root["door" + cr].soundflag = true;
}
if ((_root["door" + cr].door._y > ((_root["door" + cr].Distance - 15) - 5)) and _root["door" + cr].soundflag2) {
if (_root.sounds) {
doorSound = new Sound();
doorSound.attachSound("door_stop");
doorSound.start();
}
_root["door" + cr].soundflag2 = false;
}
} else {
_root["door" + cr].door._y = _root["door" + cr].door._y + ((-_root["door" + cr].door._y) / 5);
if (_root["door" + cr].soundflag) {
if (_root.sounds) {
doorSound = new Sound();
doorSound.attachSound("door_open");
doorSound.start();
}
_root["door" + cr].soundflag = false;
}
_root["door" + cr].soundflag2 = true;
}
}
cr++;
}
if (maxo_cr > 1) {
cr = 1;
while (cr < _root.maxo_cr) {
if (_root.bg.ground.hitTest(_root["crusher" + cr]._x + (_root["crusher" + cr]._width / 2), (_root["crusher" + cr]._y + _root["crusher" + cr].crusher._y) + _root["crusher" + cr].crusher.blades._y, true)) {
_root["crusher" + cr].Done = true;
}
cr++;
}
}
if (maxo_za > 1) {
cr = 1;
while (cr < _root.maxo_za) {
if (_root[("zapper" + _root.cr) + "up"].Zappin) {
if ((((((p1._x > _root[("zapper" + _root.cr) + "up"]._x) and (p1._x < (_root[("zapper" + _root.cr) + "up"]._x + _root[("zapper" + _root.cr) + "up"]._width))) and ((p1._y > _root[("zapper" + _root.cr) + "up"]._y) and (p1._y < (_root[("zapper" + _root.cr) + "down"]._y + _root[("zapper" + _root.cr) + "down"]._height)))) and playerAlive) and (!noclip)) and (!god)) {
killPlayer("electric");
}
_root[("zapper" + cr) + "up"].transform.colorTransform = zapperZappinC;
_root[("zapper" + cr) + "down"].transform.colorTransform = zapperZappinC;
} else {
_root[("zapper" + cr) + "up"].transform.colorTransform = zapperIdleC;
_root[("zapper" + cr) + "down"].transform.colorTransform = zapperIdleC;
}
cr++;
}
}
n = 1;
while (n < _root.maxo_bo) {
if (_root["ballout" + n].Active) {
if (!isNaN(_root["b" + ((_root.maxb - _root.maxo_bo) + 1)]._x)) {
} else {
bin = 1;
while (bin < _root.maxo_bi) {
if (!_root["ballin" + bin].Active) {
if ((!_root["ballout" + n].Creating) and playerAlive) {
if (_root["ballout" + n]._rotation == 0) {
_root["ballout" + n].createbx = _root["ballout" + n]._x + (_root["ballout" + n]._width / 2);
_root["ballout" + n].createby = (_root["ballout" + n]._y + _root["ballout" + n]._height) + 10;
} else if (_root["ballout" + n]._rotation == 180) {
_root["ballout" + n].createbx = _root["ballout" + n]._x - (_root["ballout" + n]._width / 2);
_root["ballout" + n].createby = _root["ballout" + n]._y - _root["ballout" + n]._height;
} else if (_root["ballout" + n]._rotation == 90) {
_root["ballout" + n].createbx = _root["ballout" + n]._x - _root["ballout" + n]._width;
_root["ballout" + n].createby = _root["ballout" + n]._y + (_root["ballout" + n]._height / 2);
} else if (_root["ballout" + n]._rotation == -90) {
_root["ballout" + n].createbx = _root["ballout" + n]._x + _root["ballout" + n]._width;
_root["ballout" + n].createby = _root["ballout" + n]._y - (_root["ballout" + n]._height / 2);
}
_root[("ballout" + n) + "_delay"] = setInterval(_root, "ballOutBall", 500, _root["ballout" + n].createbx, _root["ballout" + n].createby, _root["ballout" + n]._rotation, n);
_root["ballout" + n].Creating = true;
_root["ballout" + n].gotoAndStop("play");
}
}
bin++;
}
}
}
n++;
}
n = 1;
while (n < _root.maxo_bi) {
b = 1;
while (b < _root.maxb) {
if (_root["ballin" + n].hitTest(_root["b" + b]._x, _root["b" + b]._y, true) and (!_root["ballin" + n].Active)) {
if ((_root["ballin" + n]._rotation == 0) and (_root["b" + b].ySpeed < 0)) {
_root["ballin" + n].Active = true;
removeBall(_root["b" + b]);
} else if ((_root["ballin" + n]._rotation == 180) and (_root["b" + b].ySpeed > 0)) {
_root["ballin" + n].Active = true;
removeBall(_root["b" + b]);
} else if ((_root["ballin" + n]._rotation == 90) and (_root["b" + b].xSpeed > 0)) {
_root["ballin" + n].Active = true;
removeBall(_root["b" + b]);
} else if ((_root["ballin" + n]._rotation == -90) and (_root["b" + b].xSpeed < 0)) {
_root["ballin" + n].Active = true;
removeBall(_root["b" + b]);
}
}
b++;
}
n++;
}
n = 1;
while (n < _root.maxo_el) {
if (_root["elevator" + n].Active) {
if (!_root["elevator" + n].Verti) {
if (dirRight) {
if (_root["elevator" + n]._x < _root["elevator" + n].endx) {
if (_root["elevator" + n].xSpeed < _root["elevator" + n].eleMax) {
_root["elevator" + n].xSpeed = _root["elevator" + n].xSpeed + _root["elevator" + n].eleAccel;
}
} else {
dirRight = false;
}
} else if (_root["elevator" + n]._x > _root["elevator" + n].startx) {
if (_root["elevator" + n].xSpeed > (-_root["elevator" + n].eleMax)) {
_root["elevator" + n].xSpeed = _root["elevator" + n].xSpeed - _root["elevator" + n].eleAccel;
}
} else {
dirRight = true;
}
_root["elevator" + n]._x = _root["elevator" + n]._x + _root["elevator" + n].xSpeed;
}
}
n++;
}
n = 1;
while (n < _root.maxo_cr) {
if ((((_root["crusher" + n].crusher.blades.hitTest(_root.p1._x, _root.p1._y - _root.p1._height, true) or _root["crusher" + n].crusher.blades.hitTest(_root.p1._x, _root.p1._y - (_root.p1._height / 2), true)) and ((_root["crusher" + n].Active and (!_root["crusher" + n].Done)) or (_root.p1.ySpeed < 0))) and (!noclip)) and (!god)) {
killPlayer("crash");
}
n++;
}
if ((bg.kill.hitTest(p1._x, p1._y, true) and (!noclip)) and (!god)) {
killPlayer("crash");
}
if ((bg.kill_ar2.hitTest(p1._x, p1._y, true) and (!noclip)) and (!god)) {
killPlayer("ar2");
}
if ((playerAlive == false) and (screen_blood == false)) {
playerdead.gotoAndPlay(2);
screen_blood = true;
} else if (playerAlive == true) {
screen_blood = false;
}
if (playerAlive == false) {
if (restartLevelDelay_bol == true) {
restartLevelDelay = setInterval(_root, "death_restart_available", 2000);
restartLevelDelay_bol = false;
}
if (death_restart == true) {
if ((keyis_down == true) or ((_root.mouseCl == true) and (!pauseMenu._visible))) {
restartLevel();
restartLevelDelay_bol = true;
}
}
}
if ((startLevelRunRight and (p1._x < ((bg.player_enter._x + bg._x) + 100))) or _root.doorEnterM.hitTest(p1._x, p1._y, true)) {
Right = true;
} else {
startLevelRunRight = false;
}
if (_root.boxstiming) {
_root.delapsedTime = getTimer() - _root.dstartTime;
_root.delapsedHours = Math.floor(_root.delapsedTime / 3600000);
_root.dremaining = _root.delapsedTime - (_root.delapsedHours * 3600000);
_root.delapsedS = Math.floor(_root.dremaining / 100);
_root.dremaining = _root.dremaining - (_root.delapsedS * 100);
if (_root.delapsedS > 3) {
_root.boxstiming = false;
_root.dpausedt = false;
}
}
if ((p1.hitTest(_root.bg.door_exit) and (p1._x > 800)) and (playerAlive == true)) {
mapn++;
nextMap = ["level" + mapn];
nextLevel = true;
}
p1._y = p1._y + p1.ySpeed;
p1._x = (p1._x + p1.xSpeed) + p1.envSpeed;
b = 1;
while (b < _root.maxb) {
if (_root["b" + b]._x != undefined) {
if (_root["b" + b].countOK) {
_root["interval_b" + b] = setInterval(this, "destroyBall", 1000, [b]);
_root["b" + b].countOK = false;
}
if (_root.portal1.hitTest(_root["b" + b]._x, _root["b" + b]._y, true) or _root.portal2.hitTest(_root["b" + b]._x, _root["b" + b]._y, true)) {
if (_root.portal1.hitTest(_root["b" + b]._x, _root["b" + b]._y, true)) {
otherPort = _root.portal2;
thisPort = _root.portal1;
_root["b" + b].setMask(_root.mask2);
_root.mask1.gotoAndPlay(2);
} else if (_root.portal2.hitTest(_root["b" + b]._x, _root["b" + b]._y, true)) {
otherPort = _root.portal1;
thisPort = _root.portal2;
_root["b" + b].setMask(_root.mask1);
_root.mask2.gotoAndPlay(2);
}
_root["b" + b].canPortal = false;
if ((thisPort._rotation == -90) and (_root["b" + b].xSpeed > 0)) {
_root["b" + b].canPortal = true;
} else if ((thisPort._rotation == 90) and (_root["b" + b].xSpeed < 0)) {
_root["b" + b].canPortal = true;
} else if ((thisPort._rotation == 0) and (_root["b" + b].ySpeed > 0)) {
_root["b" + b].canPortal = true;
} else if ((thisPort._rotation == 180) and (_root["b" + b].ySpeed < 0)) {
_root["b" + b].canPortal = true;
}
if (_root["b" + b].canPortal) {
_root.portal1l.gotoAndPlay("pass");
_root.portal2l.gotoAndPlay("pass");
if (_root.sounds) {
portPass = new Sound();
portPass.attachSound("portalEnter");
portPass.start();
}
if (otherPort._rotation == -90) {
_root["b" + b]._x = (otherPort._x - otherPort._width) - 1;
_root["b" + b]._y = otherPort._y;
_root["b" + b].xSpeed = -ballSpeed;
_root["b" + b].ySpeed = 0;
}
if (otherPort._rotation == 180) {
_root["b" + b]._x = otherPort._x;
_root["b" + b]._y = (otherPort._y + otherPort._height) + 1;
_root["b" + b].xSpeed = 0;
_root["b" + b].ySpeed = ballSpeed;
}
if (otherPort._rotation == 90) {
_root["b" + b]._x = (otherPort._x + otherPort._width) + 1;
_root["b" + b]._y = otherPort._y;
_root["b" + b].xSpeed = ballSpeed;
_root["b" + b].ySpeed = 0;
}
if (otherPort._rotation == 0) {
_root["b" + b]._x = otherPort._x;
_root["b" + b]._y = (otherPort._y - otherPort._height) - 1;
_root["b" + b].xSpeed = 0;
_root["b" + b].ySpeed = -ballSpeed;
}
}
}
if (((!_root.wt1.hitTest(_root["b" + b]._x, _root["b" + b]._y, true)) and (!_root.wt2.hitTest(_root["b" + b]._x, _root["b" + b]._y, true))) or ((portal_blue_open == false) or (portal_yellow_open == false))) {
phyn = 1;
while (phyn < (_root.maxphys + 1)) {
if (_root["b" + b].ySpeed >= 0) {
if (_root.bg.ground.hitTest(_root["b" + b]._x, _root["b" + b]._y, true) or _root["phybox" + phyn].hitTest(_root["b" + b]._x, _root["b" + b]._y, true)) {
if (_root["b" + b].xSpeed == 0) {
_root["b" + b].ySpeed = -_root.ballSpeed;
_root["b" + b]._y = _root["b" + b]._y - (_root.ballSpeed + 1);
startSound("ballbounce");
_root.ballE._x = _root["b" + b]._x;
_root.ballE._y = _root["b" + b]._y + 10;
_root.ballE._rotation = -90;
_root.ballE.gotoAndPlay(1);
}
}
} else if (_root["b" + b].ySpeed < 0) {
if (_root.bg.ground.hitTest(_root["b" + b]._x, _root["b" + b]._y, true) or _root["phybox" + phyn].hitTest(_root["b" + b]._x, _root["b" + b]._y, true)) {
if (_root["b" + b].xSpeed == 0) {
_root["b" + b].ySpeed = _root.ballSpeed;
_root["b" + b]._y = _root["b" + b]._y + (_root.ballSpeed + 1);
startSound("ballbounce");
_root.ballE._x = _root["b" + b]._x;
_root.ballE._y = _root["b" + b]._y - 10;
_root.ballE._rotation = 90;
_root.ballE.gotoAndPlay(1);
}
}
}
if (_root["b" + b].xSpeed > 0) {
if (_root.bg.wall.hitTest(_root["b" + b]._x, _root["b" + b]._y, true) or _root["phybox" + phyn].hitTest(_root["b" + b]._x, _root["b" + b]._y, true)) {
_root["b" + b].ySpeed = 0;
_root["b" + b].xSpeed = -_root.ballSpeed;
_root["b" + b]._x = _root["b" + b]._x - (_root.ballSpeed + 1);
startSound("ballbounce");
_root.ballE._x = _root["b" + b]._x + 10;
_root.ballE._y = _root["b" + b]._y;
_root.ballE._rotation = 180;
_root.ballE.gotoAndPlay(1);
}
}
if (_root["b" + b].xSpeed < 0) {
if (_root.bg.wall.hitTest(_root["b" + b]._x, _root["b" + b]._y, true) or _root["phybox" + phyn].hitTest(_root["b" + b]._x, _root["b" + b]._y, true)) {
_root["b" + b].ySpeed = 0;
_root["b" + b].xSpeed = _root.ballSpeed;
_root["b" + b]._x = _root["b" + b]._x + (_root.ballSpeed + 1);
startSound("ballbounce");
_root.ballE._x = _root["b" + b]._x - 10;
_root.ballE._y = _root["b" + b]._y;
_root.ballE._rotation = 0;
_root.ballE.gotoAndPlay(1);
}
}
phyn++;
}
}
if (((_root["b" + b].hitTest(_root.p1) and playerAlive) and (!noclip)) and (!god)) {
killPlayer("ar2");
}
nct = 1;
while (nct < 3) {
if (nct == 1) {
maxbnum = _root.maxn;
maxbstr = "p";
} else {
maxbnum = _root.maxt;
maxbstr = "t";
}
n = 1;
while (n < _root.maxbnum) {
if (_root["b" + b].ySpeed >= 0) {
if (_root["b" + b].hitTest(_root[maxbstr + n])) {
_root[maxbstr + n].ySpeed = _root[maxbstr + n].ySpeed + 5;
if (_root["b" + b].xSpeed == 0) {
_root["b" + b].ySpeed = -_root.ballSpeed;
_root["b" + b]._y = _root["b" + b]._y - (_root.ballSpeed + 1);
}
if (_root[maxbstr + n].rSpeed != undefined) {
_root[maxbstr + n].rSpeed = _root[maxbstr + n].rSpeed - 20;
}
}
} else if (_root["b" + b].ySpeed < 0) {
if (_root["b" + b].hitTest(_root[maxbstr + n])) {
_root[maxbstr + n].ySpeed = _root[maxbstr + n].ySpeed - 5;
if (_root["b" + b].xSpeed == 0) {
_root["b" + b].ySpeed = _root.ballSpeed;
_root["b" + b]._y = _root["b" + b]._y + (_root.ballSpeed + 1);
}
if (_root[maxbstr + n].rSpeed != undefined) {
_root[maxbstr + n].rSpeed = _root[maxbstr + n].rSpeed + 20;
}
}
}
if (_root["b" + b].xSpeed > 0) {
if (_root["b" + b].hitTest(_root[maxbstr + n])) {
_root[maxbstr + n].xSpeed = _root[maxbstr + n].xSpeed + 5;
_root["b" + b].ySpeed = 0;
_root["b" + b].xSpeed = -_root.ballSpeed;
_root["b" + b]._x = _root["b" + b]._x - (_root.ballSpeed + 1);
if (_root[maxbstr + n].rSpeed != undefined) {
_root[maxbstr + n].rSpeed = _root[maxbstr + n].rSpeed + (_root.ballSpeed * 2);
_root[maxbstr + n].xSpeed = _root[maxbstr + n].xSpeed + 10;
}
}
}
if (_root["b" + b].xSpeed < 0) {
if (_root["b" + b].hitTest(_root[maxbstr + n])) {
_root[maxbstr + n].xSpeed = _root[maxbstr + n].xSpeed - 5;
_root["b" + b].ySpeed = 0;
_root["b" + b].xSpeed = _root.ballSpeed;
_root["b" + b]._x = _root["b" + b]._x + (_root.ballSpeed + 1);
if (_root[maxbstr + n].rSpeed != undefined) {
_root[maxbstr + n].rSpeed = _root[maxbstr + n].rSpeed - (_root.ballSpeed * 2);
_root[maxbstr + n].xSpeed = _root[maxbstr + n].xSpeed - 10;
}
}
}
n++;
}
nct++;
}
if (_root.ht1.hitTest(_root["b" + b]._x, _root["b" + b]._y, true)) {
_root["b" + b].setMask(_root.mask1);
} else if (_root.ht2.hitTest(_root["b" + b]._x, _root["b" + b]._y, true)) {
_root["b" + b].setMask(_root.mask2);
}
_root["b" + b]._x = Math.floor(_root["b" + b]._x + _root["b" + b].xSpeed);
_root["b" + b]._y = Math.floor(_root["b" + b]._y + _root["b" + b].ySpeed);
}
b++;
}
n = 2;
while (n < _root.maxn) {
if ((n == pickedP) and (pickedStr == "p")) {
} else if ((((_root["p" + n]._x > 820) or (_root["p" + n]._x < -20)) or (_root["p" + n]._y > 470)) or ((_root["p" + n]._y - _root["p" + n]._height) < -15)) {
_root["p" + n]._x = _root["p" + n].spawnx;
_root["p" + n]._y = _root["p" + n].spawny;
if (boxcreators) {
_root["pbox" + n].gotoAndStop("drop");
}
_root["p" + n].xSpeed = 0;
_root["p" + n].ySpeed = 0;
_root["p" + n]._alpha = 0;
}
if (_root["p" + n]._alpha < 100) {
_root["p" + n]._alpha = _root["p" + n]._alpha + 10;
}
if (_root["p" + n].canPortal) {
if (_root.ht1.hitTest(_root["p" + n]._x, _root["p" + n]._y, true)) {
_root["p" + n].setMask(_root.mask1);
} else if (_root.ht2.hitTest(_root["p" + n]._x, _root["p" + n]._y, true)) {
_root["p" + n].setMask(_root.mask2);
}
}
nb = 2;
while (nb < _root.maxn) {
if (_root["p" + nb].hitTest(_root["p" + n])) {
if (n == nb) {
} else {
if ((((_root["p" + n].xSpeed > 2) or (_root["p" + n].xSpeed < -2)) or (_root["p" + n].ySpeed > 3)) or (_root["p" + n].ySpeed < -3)) {
if (!delaySound) {
boxHitSound = setInterval(_root, "countDelaySound", 300);
}
collisionSound();
}
if ((_root["p" + n]._x >= _root["p" + nb]._x) and (_root["p" + n]._y > ((_root["p" + nb]._y - _root["p" + nb]._height) + 10))) {
if (_root["p" + n].xSpeed < 0) {
if (_root["p" + nb].hitTest(_root["p" + n]._x - (_root["p" + n]._width / 2), _root["p" + n]._y - (_root["p" + n]._height / 2), true) or _root["p" + nb].hitTest(_root["p" + n]._x + (_root["p" + n]._width / 2), _root["p" + n]._y - (_root["p" + n]._height / 2), true)) {
_root["p" + nb].xSpeed = _root["p" + n].xSpeed;
_root["p" + n].xSpeed = (-_root["p" + nb].xSpeed) / 2;
}
while (_root["p" + nb].hitTest(_root["p" + n]._x - (_root["p" + n]._width / 2), _root["p" + n]._y - (_root["p" + n]._height / 2), true) or _root["p" + nb].hitTest(_root["p" + n]._x + (_root["p" + n]._width / 2), _root["p" + n]._y - (_root["p" + n]._height / 2), true)) {
_root["p" + nb]._x = _root["p" + nb]._x - 1;
_root["p" + nb].xSpeed = _root["p" + nb].xSpeed - 0.1;
_root["p" + n]._x = _root["p" + n]._x + 1;
_root["p" + n].xSpeed = _root["p" + n].xSpeed + 0.05;
}
} else if ((_root["p" + nb]._x == _root["p" + n]._x) and (_root["p" + nb]._y == _root["p" + n]._y)) {
while (_root["p" + nb].hitTest(_root["p" + n]._x, _root["p" + n]._y - 10, true)) {
_root["p" + nb]._y = _root["p" + nb]._y - _root.gravity;
_root["p" + nb].ySpeed = 0;
_root["p" + nb].jump = 0;
_root["p" + nb].standingOn = "object";
}
}
} else if ((_root["p" + n]._x < _root["p" + nb]._x) and (_root["p" + n]._y > ((_root["p" + nb]._y - _root["p" + nb]._height) + 10))) {
if (_root["p" + n].xSpeed > 0) {
if (_root["p" + nb].hitTest(_root["p" + n]._x - (_root["p" + n]._width / 2), _root["p" + n]._y - (_root["p" + n]._height / 2), true) or _root["p" + nb].hitTest(_root["p" + n]._x + (_root["p" + n]._width / 2), _root["p" + n]._y - (_root["p" + n]._height / 2), true)) {
_root["p" + nb].xSpeed = _root["p" + n].xSpeed;
_root["p" + n].xSpeed = (-_root["p" + nb].xSpeed) / 2;
}
while (_root["p" + nb].hitTest(_root["p" + n]._x - (_root["p" + n]._width / 2), _root["p" + n]._y - (_root["p" + n]._height / 2), true) or _root["p" + nb].hitTest(_root["p" + n]._x + (_root["p" + n]._width / 2), _root["p" + n]._y - (_root["p" + n]._height / 2), true)) {
_root["p" + nb]._x = _root["p" + nb]._x + 1;
_root["p" + nb].xSpeed = _root["p" + nb].xSpeed + 0.1;
_root["p" + n]._x = _root["p" + n]._x - 1;
_root["p" + n].xSpeed = _root["p" + n].xSpeed - 0.05;
}
} else if ((_root["p" + nb]._x == _root["p" + n]._x) and (_root["p" + nb]._y == _root["p" + n]._y)) {
while (_root["p" + nb].hitTest(_root["p" + n]._x, _root["p" + n]._y - 10, true)) {
_root["p" + nb]._y = _root["p" + nb]._y - _root.gravity;
_root["p" + nb].ySpeed = 0;
_root["p" + nb].jump = 0;
_root["p" + nb].standingOn = "object";
}
}
}
if ((_root["p" + n]._y - (_root["p" + n]._height / 2)) > (_root["p" + nb]._y - (_root["p" + nb]._height / 2))) {
if (_root["p" + n].ySpeed >= 0) {
while (_root["p" + n].hitTest(_root["p" + nb]._x, _root["p" + nb]._y, true)) {
_root["p" + nb]._y = _root["p" + nb]._y - _root.gravity;
_root["p" + nb].ySpeed = 0;
_root["p" + nb].envSpeed = _root["p" + n].xSpeed + _root["p" + n].envSpeed;
_root["p" + nb].jump = 0;
_root["p" + nb].standingOn = "object";
}
}
} else if ((_root["p" + n]._y - (_root["p" + n]._height / 2)) < (_root["p" + nb]._y - (_root["p" + nb]._height / 2))) {
if (_root["p" + n].ySpeed < 0) {
if (_root["p" + n].jump == 1) {
while (_root["p" + nb].hitTest(_root["p" + n]._x, _root["p" + n]._y, true)) {
_root["p" + n]._y = _root["p" + n]._y + _root.gravity;
_root["p" + n].ySpeed = _root["p" + n].ySpeed + 0.5;
_root["p" + n].jump = 1;
}
}
}
}
}
}
nb++;
}
nb = 1;
while (nb < _root.maxt) {
if (_root["p" + n].hitTest(_root["t" + nb])) {
if ((((_root["p" + n].xSpeed > 2) or (_root["p" + n].xSpeed < -2)) or (_root["p" + n].ySpeed > 3)) or (_root["p" + n].ySpeed < -3)) {
if (!delaySound) {
boxHitSound = setInterval(_root, "countDelaySound", 300);
}
collisionSound();
}
if (_root["p" + n].xSpeed <= 0) {
while (_root["t" + nb].hitTest(_root["p" + n]._x - (_root["p" + n]._width / 2), _root["p" + n]._y - _root["p" + n]._height, true) or _root["t" + nb].hitTest(_root["p" + n]._x - (_root["p" + n]._width / 2), _root["p" + n]._y, true)) {
_root["t" + nb]._x = _root["t" + nb]._x - 2;
_root["t" + nb].xSpeed = _root["t" + nb].xSpeed - 0.5;
_root["p" + n]._x = _root["p" + n]._x + 2;
_root["p" + n].xSpeed = _root["p" + n].xSpeed + 0.05;
if ((_root["p" + n]._y - (_root["p" + n]._height / 2)) < _root["t" + nb]._y) {
if ((n == pickedP) and (pickedStr == "p")) {
_root["t" + nb].rSpeed = _root["t" + nb].rSpeed - 1;
} else {
_root["t" + nb].rSpeed = _root["t" + nb].rSpeed - 4;
}
}
}
}
if (_root["p" + n].xSpeed > 0) {
while (_root["t" + nb].hitTest(_root["p" + n]._x + (_root["p" + n]._width / 2), _root["p" + n]._y - _root["p" + n]._height, true) or _root["t" + nb].hitTest(_root["p" + n]._x + (_root["p" + n]._width / 2), _root["p" + n]._y, true)) {
_root["t" + nb]._x = _root["t" + nb]._x + 2;
_root["t" + nb].xSpeed = _root["t" + nb].xSpeed + 0.5;
_root["p" + n]._x = _root["p" + n]._x - 2;
_root["p" + n].xSpeed = _root["p" + n].xSpeed - 0.05;
if ((_root["p" + n]._y - (_root["p" + n]._height / 2)) < _root["t" + nb]._y) {
if ((n == pickedP) and (pickedStr == "p")) {
_root["t" + nb].rSpeed = _root["t" + nb].rSpeed + 1;
} else {
_root["t" + nb].rSpeed = _root["t" + nb].rSpeed + 4;
}
}
}
}
if (_root["p" + n].ySpeed > 0) {
if (_root["p" + n]._x >= _root["t" + nb]._x) {
while ((_root["t" + nb].hitTest(_root["p" + n]._x - (_root["p" + n]._width / 2), _root["p" + n]._y, true) or _root["t" + nb].hitTest(_root["p" + n]._x + (_root["p" + n]._width / 2), _root["p" + n]._y, true)) or _root["t" + nb].hitTest(_root["p" + n]._x, _root["p" + n]._y, true)) {
_root["t" + nb]._x = _root["t" + nb]._x - 2;
_root["t" + nb].xSpeed = _root["t" + nb].xSpeed - 0.1;
_root["p" + n]._x = _root["p" + n]._x + 2;
_root["p" + n].xSpeed = _root["p" + n].xSpeed + 0.05;
if ((_root["p" + n]._y - (_root["p" + n]._height / 2)) < _root["t" + nb]._y) {
if ((n == pickedP) and (pickedStr == "p")) {
_root["t" + nb].rSpeed = _root["t" + nb].rSpeed - 1;
} else {
_root["t" + nb].rSpeed = _root["t" + nb].rSpeed - 4;
}
}
}
} else {
while ((_root["t" + nb].hitTest(_root["p" + n]._x - (_root["p" + n]._width / 2), _root["p" + n]._y, true) or _root["t" + nb].hitTest(_root["p" + n]._x + (_root["p" + n]._width / 2), _root["p" + n]._y, true)) or _root["t" + nb].hitTest(_root["p" + n]._x, _root["p" + n]._y, true)) {
_root["t" + nb]._x = _root["t" + nb]._x + 2;
_root["t" + nb].xSpeed = _root["t" + nb].xSpeed + 0.1;
_root["p" + n]._x = _root["p" + n]._x - 2;
_root["p" + n].xSpeed = _root["p" + n].xSpeed - 0.05;
if ((_root["p" + n]._y - (_root["p" + n]._height / 2)) < _root["t" + nb]._y) {
if ((n == pickedP) and (pickedStr == "p")) {
_root["t" + nb].rSpeed = _root["t" + nb].rSpeed + 1;
} else {
_root["t" + nb].rSpeed = _root["t" + nb].rSpeed + 4;
}
}
}
}
}
}
nb++;
}
if ((_root.pickedP == n) and (_root.pickedStr == "p")) {
} else {
if (_root.p1.hitTest(_root["p" + n]) and (_root.noclip == false)) {
if ((_root.p1._x <= _root["p" + n]._x) and (_root.p1._y > ((_root["p" + n]._y - _root["p" + n]._height) + 10))) {
if (_root.p1.xSpeed >= 0) {
if (_root["p" + n].hitTest(_root.p1._x + (_root.p1._width / 3), _root.p1._y - (_root["p" + n]._height / 2), true) or _root["p" + n].hitTest(_root.p1._x + (_root.p1._width / 3), _root.p1._y - (_root["p" + n]._height * 1.5), true)) {
_root["p" + n].xSpeed = _root["p" + n].xSpeed + 1;
_root.p1.xSpeed = _root.p1.xSpeed - 0.5;
}
while (_root["p" + n].hitTest(_root.p1._x + (_root.p1._width / 3), _root.p1._y - (_root["p" + n]._height / 2), true) or _root["p" + n].hitTest(_root.p1._x + (_root.p1._width / 3), _root.p1._y - (_root["p" + n]._height * 1.5), true)) {
_root.p1._x = _root.p1._x - 1;
_root["p" + n]._x = _root["p" + n]._x + 1;
_root.p1.xSpeed = _root.p1.xSpeed - 0.1;
_root["p" + n].xSpeed = _root["p" + n].xSpeed + 0.05;
}
}
} else if ((_root.p1._x > _root["p" + n]._x) and (_root.p1._y > ((_root["p" + n]._y - _root["p" + n]._height) + 10))) {
if (_root.p1.xSpeed < 0) {
if (_root["p" + n].hitTest(_root.p1._x - (_root.p1._width / 3), _root.p1._y - (_root["p" + n]._height / 2), true) or _root["p" + n].hitTest(_root.p1._x - (_root.p1._width / 3), _root.p1._y - (_root["p" + n]._height * 1.5), true)) {
_root["p" + n].xSpeed = _root["p" + n].xSpeed - 1;
_root.p1.xSpeed = _root.p1.xSpeed + 0.5;
}
while (_root["p" + n].hitTest(_root.p1._x - (_root.p1._width / 3), _root.p1._y - (_root["p" + n]._height / 2), true) or _root["p" + n].hitTest(_root.p1._x - (_root.p1._width / 3), _root.p1._y - (_root["p" + n]._height * 1.5), true)) {
_root.p1._x = _root.p1._x + 1;
_root["p" + n]._x = _root["p" + n]._x - 1;
_root.p1.xSpeed = _root.p1.xSpeed + 0.1;
_root["p" + n].xSpeed = _root["p" + n].xSpeed - 0.05;
}
}
}
if (_root.p1._y < _root["p" + n]._y) {
if (_root["p" + n].hitTest(_root.p1._x, _root.p1._y, true)) {
if (_root.p1.ySpeed >= 0) {
while (_root["p" + n].hitTest(_root.p1._x, _root.p1._y, true)) {
_root.p1._y = _root.p1._y - _root.gravity;
_root.p1.envSpeed = _root["p" + n].xSpeed + _root["p" + n].envSpeed;
_root.p1.ySpeed = 0;
_root.p1.jump = 0;
_root.p1.standingOn = "object";
}
}
}
} else if (_root.p1._y > _root["p" + n]._y) {
}
}
if (_root["p" + n].ySpeed > 1) {
_root["p" + n].jump = 1;
} else if (_root["p" + n].ySpeed < -1) {
_root["p" + n].jump = 1;
}
if (_root["p" + n].standingOn == "ground") {
if ((_root["p" + n].envSpeed < 0.1) && (_root["p" + n].envSpeed > -0.1)) {
_root["p" + n].envSpeed = 0;
} else {
_root["p" + n].envSpeed = _root["p" + n].envSpeed / 1.05;
}
} else if (_root["p" + n].standingOn == "object") {
}
if (_root["p" + n].jump == 0) {
if ((_root["p" + n].box1._rotation > 10) and (_root["p" + n].box1._rotation < 90)) {
_root["p" + n].box1._rotation = _root["p" + n].box1._rotation - 10;
} else if ((_root["p" + n].box1._rotation >= 90) and (_root["p" + n].box1._rotation < 170)) {
_root["p" + n].box1._rotation = _root["p" + n].box1._rotation + 10;
} else if ((_root["p" + n].box1._rotation < -10) and (_root["p" + n].box1._rotation > -90)) {
_root["p" + n].box1._rotation = _root["p" + n].box1._rotation + 10;
} else if ((_root["p" + n].box1._rotation <= -90) and (_root["p" + n].box1._rotation > -170)) {
_root["p" + n].box1._rotation = _root["p" + n].box1._rotation - 10;
} else if ((((_root["p" + n].box1._rotation <= 10) and (_root["p" + n].box1._rotation >= -10)) or ((_root["p" + n].box1._rotation >= 170) and (_root["p" + n].box1._rotation < 180))) or ((_root["p" + n].box1._rotation <= -170) and (_root["p" + n].box1._rotation > -180))) {
_root["p" + n].box1._rotation = 0;
}
if ((_root["p" + n].xSpeed < 0.1) && (_root["p" + n].xSpeed > -0.1)) {
_root["p" + n].xSpeed = 0;
} else {
_root["p" + n].xSpeed = _root["p" + n].xSpeed / 1.25;
}
} else if (_root["p" + n].jump == 1) {
_root["p" + n].xSpeed = _root["p" + n].xSpeed / 1.05;
_root["p" + n].envSpeed = 0;
_root["p" + n].standingOn = "nothing";
if (_root["p" + n].xSpeed > 0.1) {
_root["p" + n].box1._rotation = _root["p" + n].box1._rotation + ((_root["p" + n].xSpeed * 100) / 25);
} else if (_root["p" + n].xSpeed < -0.1) {
_root["p" + n].box1._rotation = _root["p" + n].box1._rotation - (((-_root["p" + n].xSpeed) * 100) / 25);
} else if (_root["p" + n].ySpeed > 0) {
_root["p" + n].box1._rotation = _root["p" + n].box1._rotation + 5;
} else if (_root["p" + n].ySpeed < 0) {
_root["p" + n].box1._rotation = _root["p" + n].box1._rotation - -5;
}
}
if (_root["p" + n].ySpeed > _root["p" + n].fmaxSpeed) {
_root["p" + n].ySpeed = _root["p" + n].fmaxSpeed;
} else if (_root["p" + n].ySpeed < (-_root["p" + n].fmaxSpeed)) {
_root["p" + n].ySpeed = -_root["p" + n].fmaxSpeed;
}
_root["p" + n].ySpeed = _root["p" + n].ySpeed + _root.gravity;
}
_root["p" + n]._x = (_root["p" + n]._x + _root["p" + n].xSpeed) + _root["p" + n].envSpeed;
_root["p" + n]._y = _root["p" + n]._y + _root["p" + n].ySpeed;
if (_root.effects >= 2) {
if (_root["p" + n].xSpeed > 5) {
be.quality = 1;
be.blurX = _root["p" + n].xSpeed;
_root["p" + n].filters = [be];
} else if (_root["p" + n].xSpeed < -5) {
be.quality = 1;
be.blurX = -_root["p" + n].xSpeed;
_root["p" + n].filters = [be];
} else {
be.quality = 1;
be.blurX = 0;
_root["p" + n].filters = [be];
}
if (_root["p" + n].ySpeed > 5) {
be.quality = 1;
be.blurY = _root["p" + n].ySpeed;
_root["p" + n].filters = [be];
} else if (_root["p" + n].ySpeed < -5) {
be.quality = 1;
be.blurY = -_root["p" + n].ySpeed;
_root["p" + n].filters = [be];
} else {
be.quality = 1;
be.blurY = 0;
_root["p" + n].filters = [be];
}
} else {
_root["p" + n].filters = [];
be.filters = [];
}
n++;
}
t = 1;
while (t < _root.maxt) {
turrentFunc(_root["t" + t], t);
t++;
}
objectn = 1;
while (objectn < 3) {
if (objectn == 1) {
physicOb = "p";
maxPhysicOb = maxn;
} else if (objectn == 2) {
physicOb = "t";
maxPhysicOb = maxt;
}
portal_n = 1;
while (portal_n <= 2) {
if (portal_n == 1) {
portal(physicOb, maxPhysicOb, _root.portal1, _root.portal2);
portalSteps(physicOb, maxPhysicOb, _root.step1);
} else if (portal_n == 2) {
portal(physicOb, maxPhysicOb, _root.portal2, _root.portal1);
portalSteps(physicOb, maxPhysicOb, _root.step2);
}
portal_n++;
}
physicalMap(physicOb, maxPhysicOb);
mapScript();
objectn++;
}
n = 1;
while (n < _root.maxphys) {
if (_root["phybox" + n].Attached != undefined) {
if (_root["phybox" + n].Type == "crusher") {
_root["phybox" + n]._x = _root["phybox" + n].Attached._x;
_root["phybox" + n]._y = ((_root["phybox" + n].Attached._y + _root["phybox" + n].Attached.crusher._y) + _root["phybox" + n].Attached.crusher.blades._y) - 40;
} else if (_root["phybox" + n].Type == "elevator") {
_root["phybox" + n]._x = (_root["phybox" + n].Attached._x + _root["phybox" + n].Attached._width) - _root["phybox" + n]._width;
_root["phybox" + n]._y = (_root["phybox" + n].Attached._y + _root["phybox" + n].Attached._height) - _root["phybox" + n]._height;
_root["phybox" + n].xSpeed = _root["phybox" + n].Attached.xSpeed;
} else if (_root["phybox" + n].Type == "wallMoverT") {
if (_root["phybox" + n].Attached._rotation == 0) {
_root["phybox" + n]._x = (_root["phybox" + n].Attached._x + _root["phybox" + n].Attached.mover._x) - 25;
_root["phybox" + n]._y = _root["phybox" + n].Attached._y;
} else if (_root["phybox" + n].Attached._rotation == 180) {
_root["phybox" + n]._x = (_root["phybox" + n].Attached._x - _root["phybox" + n].Attached.mover._x) + 10;
_root["phybox" + n]._y = _root["phybox" + n].Attached._y - _root["phybox" + n].Attached._height;
} else if (_root["phybox" + n].Attached._rotation == 90) {
_root["phybox" + n]._x = _root["phybox" + n].Attached._x - _root["phybox" + n].Attached._width;
_root["phybox" + n]._y = ((_root["phybox" + n].Attached._y + _root["phybox" + n].Attached.mover._x) - _root["phybox" + n]._height) - 10;
} else if (_root["phybox" + n].Attached._rotation == -90) {
_root["phybox" + n]._x = _root["phybox" + n].Attached._x;
_root["phybox" + n]._y = (_root["phybox" + n].Attached._y - _root["phybox" + n].Attached.mover._x) + 10;
}
if ((_root["phybox" + n]._width == 20) or (_root["phybox" + n]._height == 20)) {
_root["phybox" + n].Portalable = false;
if (_root["phybox" + n].Attached.Done) {
_root["phybox" + n].Portalable = true;
}
}
} else if (_root["phybox" + n].Type == "wallMoverF") {
if (_root["phybox" + n].Attached._rotation == 0) {
_root["phybox" + n]._x = ((_root["phybox" + n].Attached._x + _root["phybox" + n].Attached.mover._x) - 25) - _root["phybox" + n]._width;
_root["phybox" + n]._y = _root["phybox" + n].Attached._y;
} else if (_root["phybox" + n].Attached._rotation == 180) {
_root["phybox" + n]._x = ((_root["phybox" + n].Attached._x - _root["phybox" + n].Attached.mover._x) + _root["phybox" + n]._width) + 20;
_root["phybox" + n]._y = _root["phybox" + n].Attached._y - _root["phybox" + n].Attached._height;
} else if (_root["phybox" + n].Attached._rotation == 90) {
_root["phybox" + n]._x = _root["phybox" + n].Attached._x - _root["phybox" + n].Attached._width;
_root["phybox" + n]._y = ((_root["phybox" + n].Attached._y + _root["phybox" + n].Attached.mover._x) - _root["phybox" + n]._height) - 30;
} else if (_root["phybox" + n].Attached._rotation == -90) {
_root["phybox" + n]._x = _root["phybox" + n].Attached._x;
_root["phybox" + n]._y = (_root["phybox" + n].Attached._y - _root["phybox" + n].Attached.mover._x) + 30;
}
if ((_root["phybox" + n]._width == 20) or (_root["phybox" + n]._height == 20)) {
_root["phybox" + n].Portalable = false;
if (_root["phybox" + n].Attached.Done) {
_root["phybox" + n].Portalable = true;
}
}
} else if (_root["phybox" + n].Type == "button") {
_root["phybox" + n]._x = _root["phybox" + n].Attached._x + _root["phybox" + n].Attached.red._x;
_root["phybox" + n]._y = (_root["phybox" + n].Attached._y + _root["phybox" + n].Attached.red._y) + 2;
} else if (_root["phybox" + n].Type == "doorh") {
_root["phybox" + n]._x = _root["phybox" + n].Attached._x;
_root["phybox" + n]._y = _root["phybox" + n].Attached._y;
if (_root["phybox" + n].Attached._y < (_root["phybox" + n].Attached._y + _root["phybox" + n].Attached._height)) {
_root["phybox" + n]._height = _root["phybox" + n].Attached.door._y + 15;
} else {
_root["phybox" + n]._height = (-_root["phybox" + n].Attached.door._y) - 15;
}
} else if (_root["phybox" + n].Type == "doorw") {
if (_root["phybox" + n].Attached._rotation == 90) {
_root["phybox" + n]._x = _root["phybox" + n].Attached._x;
_root["phybox" + n]._y = _root["phybox" + n].Attached._y + _root["phybox" + n].Attached._height;
if (_root["phybox" + n].Attached._y < (_root["phybox" + n].Attached._y + _root["phybox" + n].Attached._height)) {
_root["phybox" + n]._width = _root["phybox" + n].Attached.door._y + 15;
} else {
_root["phybox" + n]._width = _root["phybox" + n].Attached.door._y - 15;
}
} else if (_root["phybox" + n].Attached._rotation == -90) {
_root["phybox" + n]._x = _root["phybox" + n].Attached._x;
_root["phybox" + n]._y = _root["phybox" + n].Attached._y - _root["phybox" + n].Attached._height;
if (_root["phybox" + n].Attached._y < (_root["phybox" + n].Attached._y - _root["phybox" + n].Attached._height)) {
_root["phybox" + n]._width = _root["phybox" + n].Attached.door._y - 15;
} else {
_root["phybox" + n]._width = _root["phybox" + n].Attached.door._y + 15;
}
}
}
} else {
_root["phybox" + n]._x = _root["phybox" + n].Attached._x;
_root["phybox" + n]._y = _root["phybox" + n].Attached._y;
}
n++;
}
startPointMove();
} else {
Mouse.show();
cursor._visible = false;
}
if (running) {
if (!stopPlayMovies) {
stopPlayMoviesFunc(true);
stopPlayMovies = true;
}
} else if (stopPlayMovies) {
stopPlayMoviesFunc(false);
stopPlayMovies = false;
}
if (playerCam) {
player_cam._x = p1._x;
player_cam._y = p1._y - p1._height;
if ((player_cam._x + (player_cam._width / 2)) > Stage.width) {
player_cam._x = Stage.width - (player_cam._width / 2);
} else if ((player_cam._x - (player_cam._width / 2)) < 0) {
player_cam._x = player_cam._width / 2;
}
if ((player_cam._y + (player_cam._height / 2)) > Stage.height) {
player_cam._y = Stage.height - (player_cam._height / 2);
} else if ((player_cam._y - (player_cam._height / 2)) < 0) {
player_cam._y = player_cam._height / 2;
}
}
fpsCheck();
};
Instance of Symbol 963 MovieClip "p1" in Frame 5
onClipEvent (load) {
function isHitMap(xpoint, ypoint) {
if (_root.bg.ground.hitTest(xpoint, ypoint, true)) {
return(true);
}
if (_root.bg.wall.hitTest(xpoint, ypoint, true)) {
return(true);
}
if (_root.bg.antiportal.hitTest(xpoint, ypoint, true)) {
return(true);
}
phyn = 1;
while (phyn < _root.maxphys) {
if (_root["phybox" + phyn].hitTest(xpoint, ypoint, true)) {
return(true);
}
phyn++;
}
return(false);
}
xSpeed = 0;
ySpeed = 0;
envSpeed = 0;
jump = 1;
maxSpeed = 7;
fmaxSpeed = 24;
accel = 1;
jumpHeight = 8;
dsa = 1;
dsa2 = 1;
sa = 1;
rad = 10;
holeSize = 45;
shotReload = 400;
portalFailE_n = 1;
pickPressed = false;
gotShot = false;
_root.portal1._visible = false;
_root.portal2._visible = false;
_root.wt1._visible = false;
_root.wt2._visible = false;
_root.ht1._visible = false;
_root.ht2._visible = false;
_root.mask1._visible = false;
_root.mask2._visible = false;
_root.step1._visible = false;
_root.step2._visible = false;
_root.Target._visible = false;
_root.fTarget._visible = false;
_root.tCheck._visible = false;
var be = (new flash.filters.BlurFilter());
be.quality = 0;
be.blurX = 0;
be.blurY = 0;
jumpActions = function () {
if (_root.sounds) {
steps = new Sound();
steps.attachSound(["concrete" + Math.floor((Math.random() * 3) + 1)]);
steps.start();
}
if (Right or (Left and _root.playerAlive)) {
this.gotoAndStop("jump");
}
ySpeed = -jumpHeight;
jump = 1;
};
dropBox = function () {
if (_root.pickedStr == "p") {
_root[_root.pickedStr + _root.pickedP]._rotation = 0;
_root[_root.pickedStr + _root.pickedP].box1._rotation = aim_angle + 90;
}
if (playerleft == true) {
_root[_root.pickedStr + _root.pickedP].ySpeed = ((aim_angle * 100) / 90) / 32;
} else if (playerleft == false) {
if ((aim_angle < -90) and (aim_angle > -180)) {
_root[_root.pickedStr + _root.pickedP].ySpeed = (-(((aim_angle * 100) / 90) + 200)) / 32;
} else if ((aim_angle > 90) and (aim_angle < 180)) {
_root[_root.pickedStr + _root.pickedP].ySpeed = (-(((aim_angle * 100) / 90) - 200)) / 32;
}
}
if ((aim_angle < 0) and (aim_angle > -180)) {
_root[_root.pickedStr + _root.pickedP].xSpeed = (((aim_angle * 100) / 90) + 100) / 32;
} else if ((aim_angle > 0) and (aim_angle < 180)) {
_root[_root.pickedStr + _root.pickedP].xSpeed = (-(((aim_angle * 100) / 90) - 100)) / 32;
}
_root.pickedP = 0;
_root.pickedBox = false;
_root[_root.pickedStr + _root.pickedP].jump = 1;
if (_root.sounds) {
physG = new Sound();
physG.attachSound("physDrop");
physG.start();
}
};
}
onClipEvent (enterFrame) {
_root.callMe();
Right = _root.Right;
Left = _root.Left;
Down = _root.Down;
Up = _root.Up;
Aim = _root.Aim;
fPickUp = _root.fPickUp;
Reload = _root.Reload;
portalQ = _root.portalQ;
portalE = _root.portalE;
if (_root.running) {
if (_root.playerAlive) {
if (_root.noclip == false) {
if ((((this._x > (Stage.width + 100)) or (this._x < ((Stage.width - Stage.width) - 100))) or (this._y > (Stage.height + 100))) or (this._y < ((Stage.height - Stage.height) - 100))) {
_root.playerAlive = false;
}
if (this._y < (Stage.height - Stage.height)) {
trace("abovemap...");
this._x = _root.bg.player_enter._x + _root.bg._x;
this._y = _root.bg.player_enter._y + _root.bg._y;
}
} else {
if (this._x > Stage.width) {
this._x = 0;
} else if (this._x < (Stage.width - Stage.width)) {
this._x = Stage.width;
}
if (this._y > Stage.height) {
this._y = 0;
} else if (this._y < (Stage.height - Stage.height)) {
this._y = Stage.height;
}
}
if (_root._xmouse > this._x) {
playerleft = true;
} else if (_root._xmouse < this._x) {
playerleft = false;
}
if (playerleft == true) {
this._xscale = 100;
} else if (playerleft == false) {
this._xscale = -100;
}
}
if ((this.standingOn == "ground") or (this.standingOn == "nothing")) {
if ((this.envSpeed < 0.1) && (this.envSpeed > -0.1)) {
this.envSpeed = 0;
} else {
this.envSpeed = this.envSpeed / 1.1;
}
} else if (this.standingOn == "object") {
}
if ((((Left && (!Right)) && (_root.playerAlive)) && (!startLevelRunRight)) and (!_root.buildmode)) {
if (jump == 0) {
if (_root._xmouse > this._x) {
this.gotoAndStop("backwards");
} else if (_root._xmouse < this._x) {
this.gotoAndStop("run");
}
}
if (maxspeedreached == false) {
if (jump == 0) {
if (xSpeed < maxSpeed) {
xSpeed = xSpeed - accel;
}
} else if (xSpeed < maxSpeed) {
xSpeed = xSpeed - (accel / 2);
}
}
} else if (((Right && (!Left)) && (_root.playerAlive)) and (!_root.buildmode)) {
if (jump == 0) {
if (_root._xmouse > this._x) {
this.gotoAndStop("run");
} else if (_root._xmouse < this._x) {
this.gotoAndStop("backwards");
}
}
if (maxspeedreached == false) {
if (jump == 0) {
if (xSpeed > (-maxSpeed)) {
xSpeed = xSpeed + accel;
}
} else if (xSpeed > (-maxSpeed)) {
xSpeed = xSpeed + (accel / 2);
}
}
} else if (jump == 0) {
if ((_root.playerAlive and ((!_root.dance_enabled) and ((!Right) or (!left)))) or (_root.playerAlive and (!_root.keyis_down))) {
this.gotoAndStop("idle");
}
if ((xSpeed < 0.1) && (xSpeed > -0.1)) {
xSpeed = 0;
} else {
xSpeed = xSpeed / 2;
}
} else if (jump == 1) {
this.standingOn = "nothing";
if (_root.playerAlive) {
if (ySpeed > 0) {
this.gotoAndStop("fall");
} else {
this.gotoAndStop("jump");
}
}
if (_root.noclip == false) {
xSpeed = xSpeed / 1.05;
} else {
if ((xSpeed < 0.1) && (xSpeed > -0.1)) {
xSpeed = 0;
}
if ((ySpeed < 0.1) && (ySpeed > -0.1)) {
ySpeed = 0;
}
xSpeed = xSpeed / 1.05;
ySpeed = ySpeed / 1.05;
}
}
if (((Right and Left) and _root.dance_enabled) and (!_root.buildmode)) {
_root.p1.scndhnd._visible = false;
_root.p1.wpn._visible = false;
this.gotoAndStop("dance");
} else {
_root.p1.scndhnd._visible = true;
_root.p1.wpn._visible = true;
}
if (xSpeed > 0) {
if (Right and (!_root.buildmode)) {
} else if (Left) {
xSpeed = xSpeed / 1.05;
}
} else if (xSpeed < 0) {
if (Left and (!_root.buildmode)) {
} else if (Right) {
xSpeed = xSpeed / 1.05;
}
}
if (_root.noclip == false) {
ySpeed = ySpeed + _root.gravity;
}
if (_root.noclip == false) {
if ((((jump == 0) && (Up)) && (_root.playerAlive)) and (!_root.buildmode)) {
if (((_root.ht2.hitTest(_root.p1._x, _root.p1._y, true) or _root.ht1.hitTest(_root.p1._x, _root.p1._y, true)) or _root.doorEnterM.hitTest(_root.p1._x, _root.p1._y, true)) or _root.doorExitM.hitTest(_root.p1._x, _root.p1._y, true)) {
if (_root.ht2.hitTest(_root.p1._x, _root.p1._y, true) and ((_root.ht2._rotation == 180) or (_root.ht2._rotation == 0))) {
jumpActions();
}
if (_root.ht1.hitTest(_root.p1._x, _root.p1._y, true) and ((_root.ht1._rotation == 180) or (_root.ht1._rotation == 0))) {
jumpActions();
}
} else {
jumpActions();
}
}
} else if ((Up && (_root.playerAlive)) and (!_root.buildmode)) {
if (ySpeed > -6) {
jump = 1;
ySpeed = ySpeed - accel;
}
}
if (((Down and (_root.noclip == true)) && (_root.playerAlive)) and (!_root.buildmode)) {
if (ySpeed < 6) {
jump = 1;
ySpeed = ySpeed + accel;
}
}
if (ySpeed > 1) {
jump = 1;
}
if (xSpeed > maxSpeed) {
maxspeedreached = true;
if (jump == 0) {
if (_root.noclip == false) {
xSpeed = xSpeed / 1.1;
}
}
} else if (xSpeed < (-maxSpeed)) {
maxspeedreached = true;
if (jump == 0) {
if (_root.noclip == false) {
xSpeed = xSpeed / 1.1;
}
}
} else {
maxspeedreached = false;
}
if (ySpeed > fmaxSpeed) {
ySpeed = fmaxSpeed;
} else if (ySpeed < (-fmaxSpeed)) {
ySpeed = -fmaxSpeed;
}
if (xSpeed > fmaxSpeed) {
xSpeed = fmaxSpeed;
} else if (xSpeed < (-fmaxSpeed)) {
xSpeed = -fmaxSpeed;
}
if (_root.doorEnterM.hitTest(this)) {
this.setMask(_root.enterMask);
} else if (_root.doorExitM.hitTest(this._x, this._y, true)) {
this.setMask(_root.exitMask);
} else if (_root.ht1.hitTest(this._x, this._y, true) or _root.ht1.hitTest(this._x, this._y - this._height, true)) {
this.setMask(_root.mask1);
} else if (_root.ht2.hitTest(this._x, this._y, true) or _root.ht2.hitTest(this._x, this._y - this._height, true)) {
this.setMask(_root.mask2);
}
if (!_root.playerAlive) {
if ((_root.death_reason == "electronic") or (_root.death_reason == "electric")) {
this.gotoAndStop("death_electric");
} else if (_root.death_reason == "shot") {
this.gotoAndStop("death_shot");
} else if (_root.death_reason == "crash") {
this.gotoAndStop("death_crash");
} else if (_root.death_reason == "ar2") {
this.gotoAndStop("death_ar2");
} else {
this.gotoAndStop("death_crash");
}
}
if (_root.effects >= 2) {
if (xSpeed > 8) {
be.quality = 1;
be.blurX = xSpeed / 2;
this.filters = [be];
} else if (xSpeed < -8) {
be.quality = 1;
be.blurX = (-xSpeed) / 2;
this.filters = [be];
} else {
be.quality = 0;
be.blurX = 0;
this.filters = [be];
}
if (ySpeed > 8) {
be.quality = 1;
be.blurY = ySpeed / 2;
this.filters = [be];
} else if (ySpeed < -8) {
be.quality = 1;
be.blurY = (-ySpeed) / 2;
this.filters = [be];
} else {
be.quality = 0;
be.blurY = 0;
this.filters = [be];
}
} else {
this.filters = [];
be.filters = [];
}
player_gunx = _root.p1._x;
player_guny = _root.p1._y - (_root.p1._height / 2);
xmouse = _root._xmouse;
ymouse = _root._ymouse;
aim_directionx = xmouse - player_gunx;
aim_directiony = ymouse - player_guny;
aim_angle = Math.atan2(aim_directiony, aim_directionx) / (Math.PI/180);
aim_radx = Math.cos((aim_angle * Math.PI) / 180);
if (playerleft == true) {
aim_rady = Math.sin((aim_angle * Math.PI) / 180);
} else {
aim_rady = Math.sin((aim_angle * Math.PI) / 180) * -1;
}
aim_raddividey = aim_rady / aim_radx;
aim_raddividex = aim_radx / aim_rady;
if (aim_angle < 0) {
aim_raddividex = aim_raddividex * -1;
}
if (aim_raddividey > 1) {
aim_raddividey = 1;
} else if (aim_raddividey < -1) {
aim_raddividey = -1;
}
if (aim_raddividex > 1) {
aim_raddividex = 1;
} else if (aim_raddividex < -1) {
aim_raddividex = -1;
}
if (_root.pickedBox == true) {
if (this.wpn.light._alpha < 100) {
this.wpn.light._alpha = this.wpn.light._alpha + 20;
}
if (_root.sounds) {
if (!phyLoopS) {
physGl = new Sound();
physGl.attachSound("physLoop");
physGl.start(0, 999);
phyLoopS = true;
}
}
pbdx1 = _root[_root.pickedStr + _root.pickedP]._x;
pbdy1 = _root[_root.pickedStr + _root.pickedP]._y;
pbd_dx = pbdx1 - player_gunx;
pbd_dy = pbdy1 - player_guny;
pickedBox_angle = Math.atan2(pbd_dy, pbd_dx) / (Math.PI/180);
if (_root.p1portaled == true) {
trace("portl'd");
_root[_root.pickedStr + _root.pickedP]._x = player_gunx + (Math.cos((aim_angle * Math.PI) / 180) * 10);
_root[_root.pickedStr + _root.pickedP]._y = player_guny + (Math.sin((aim_angle * Math.PI) / 180) * 10);
_root[_root.pickedStr + _root.pickedP].xSpeed = 0;
_root[_root.pickedStr + _root.pickedP].ySpeed = 0;
_root.p1portaled = false;
} else if (((player_gunx > (_root[_root.pickedStr + _root.pickedP]._x + 100)) or (player_gunx < (_root[_root.pickedStr + _root.pickedP]._x - 100))) or ((player_guny > (_root[_root.pickedStr + _root.pickedP]._y + 100)) or (player_guny < (_root[_root.pickedStr + _root.pickedP]._y - 100)))) {
trace("DO ZOMTHING");
_root[_root.pickedStr + _root.pickedP]._x = player_gunx + (Math.cos((aim_angle * Math.PI) / 180) * 30);
_root[_root.pickedStr + _root.pickedP]._y = player_guny + (Math.sin((aim_angle * Math.PI) / 180) * 30);
}
if ((((_root[_root.pickedStr + _root.pickedP]._x > 820) or (_root[_root.pickedStr + _root.pickedP]._x < -20)) or (_root[_root.pickedStr + _root.pickedP]._y > 470)) or ((_root[_root.pickedStr + _root.pickedP]._y - _root[_root.pickedStr + _root.pickedP]._height) < -15)) {
trace("REZTARTED");
_root[_root.pickedStr + _root.pickedP]._x = player_gunx + (Math.cos((aim_angle * Math.PI) / 180) * 30);
_root[_root.pickedStr + _root.pickedP]._y = player_guny + (Math.sin((aim_angle * Math.PI) / 180) * 30);
}
if (_root.pickedStr == "p") {
_root[_root.pickedStr + _root.pickedP]._rotation = pickedBox_angle + 90;
if (((!_root.wt1.hitTest(_root[_root.pickedStr + _root.pickedP]._x, _root[_root.pickedStr + _root.pickedP]._y, true)) and (!_root.wt2.hitTest(_root[_root.pickedStr + _root.pickedP]._x, _root[_root.pickedStr + _root.pickedP]._y, true))) or ((portal_blue_open == false) or (portal_yellow_open == false))) {
_root[_root.pickedStr + _root.pickedP].xSpeed = _root[_root.pickedStr + _root.pickedP].xSpeed + (((player_gunx + (Math.cos((aim_angle * Math.PI) / 180) * 30)) - _root[_root.pickedStr + _root.pickedP]._x) / 15);
_root[_root.pickedStr + _root.pickedP].ySpeed = _root[_root.pickedStr + _root.pickedP].ySpeed + ((((player_guny - 3.5) + (Math.sin((aim_angle * Math.PI) / 180) * 30)) - _root[_root.pickedStr + _root.pickedP]._y) / 15);
} else {
_root[_root.pickedStr + _root.pickedP].xSpeed = _root[_root.pickedStr + _root.pickedP].xSpeed + (((player_gunx + (Math.cos((aim_angle * Math.PI) / 180) * 15)) - _root[_root.pickedStr + _root.pickedP]._x) / 15);
_root[_root.pickedStr + _root.pickedP].ySpeed = _root[_root.pickedStr + _root.pickedP].ySpeed + ((((player_guny - 3.5) + (Math.sin((aim_angle * Math.PI) / 180) * 15)) - _root[_root.pickedStr + _root.pickedP]._y) / 15);
}
} else {
_root[_root.pickedStr + _root.pickedP].xSpeed = _root[_root.pickedStr + _root.pickedP].xSpeed + (((player_gunx + (Math.cos((aim_angle * Math.PI) / 180) * 40)) - _root[_root.pickedStr + _root.pickedP]._x) / 15);
_root[_root.pickedStr + _root.pickedP].ySpeed = _root[_root.pickedStr + _root.pickedP].ySpeed + ((((player_guny - 3.5) + (Math.sin((aim_angle * Math.PI) / 180) * 40)) - _root[_root.pickedStr + _root.pickedP]._y) / 15);
_root[_root.pickedStr + _root.pickedP]._rotation = pickedBox_angle + _root.pickedPR;
}
_root[_root.pickedStr + _root.pickedP].xSpeed = _root[_root.pickedStr + _root.pickedP].xSpeed / 1.1;
_root[_root.pickedStr + _root.pickedP].ySpeed = _root[_root.pickedStr + _root.pickedP].ySpeed / 1.1;
_root[_root.pickedStr + _root.pickedP].jump = 1;
} else {
if (this.wpn.light._alpha > 0) {
this.wpn.light._alpha = this.wpn.light._alpha - 10;
}
if (_root.sounds) {
physGl.attachSound("physLoop");
physGl.stop("physLoop");
phyLoopS = false;
}
}
if (((Aim and _root.playerAlive) and _root.spaceDummy) and (!_root.buildmode)) {
_root.portalDummy._visible = true;
xn = player_gunx;
yn = player_guny;
breakWhile = false;
while (xn < (_xmouse + 800)) {
if (playerleft == true) {
xn = xn + aim_raddividex;
yn = yn + (aim_raddividey * sa);
} else {
xn = xn - aim_raddividex;
yn = yn + (aim_raddividey * sa);
}
phynum = 1;
while (phynum < _root.maxphys) {
if (_root["phybox" + phynum].hitTest(xn, yn, true)) {
_root.Target._x = xn;
_root.Target._y = yn;
breakWhile = true;
}
phynum++;
}
if (breakWhile) {
break;
}
if (_root.bg.ground.hitTest(xn, yn, true)) {
_root.Target._x = xn;
_root.Target._y = yn;
break;
}
if (_root.bg.wall.hitTest(xn, yn, true)) {
_root.Target._x = xn;
_root.Target._y = yn;
break;
}
if ((((xn > 800) || (yn < 0)) || (xn < 0)) || (yn > 450)) {
_root.Target._x = xn;
_root.Target._y = yn;
break;
}
}
poi_n = false;
poi_e = false;
poi_s = false;
poi_w = false;
poi_x = _root.Target._x;
poi_y = _root.Target._y - 15;
if (isHitMap(poi_x, poi_y)) {
poi_n = true;
}
poi_x = _root.Target._x + 15;
poi_y = _root.Target._y;
if (isHitMap(poi_x, poi_y)) {
poi_e = true;
}
poi_x = _root.Target._x;
poi_y = _root.Target._y + 15;
if (isHitMap(poi_x, poi_y)) {
poi_s = true;
}
poi_x = _root.Target._x - 15;
poi_y = _root.Target._y;
if (isHitMap(poi_x, poi_y)) {
poi_w = true;
}
portal_isgrounded = false;
_root.createShot = true;
if ((poi_w and poi_e) and (!poi_s)) {
hangle = 180;
portal_isgrounded = true;
} else if ((poi_w and poi_e) and (!poi_n)) {
hangle = 0;
portal_isgrounded = true;
} else if ((poi_n and poi_s) and (!poi_e)) {
hangle = 90;
} else if ((poi_n and poi_s) and (!poi_w)) {
hangle = -90;
} else {
_root.createShot = false;
}
phynum = 1;
while (phynum < _root.maxphys) {
if (_root["phybox" + phynum].hitTest(_root.Target._x, _root.Target._y, true) and (_root["phybox" + phynum].Portalable == false)) {
_root.createShot = false;
}
phynum++;
}
if (_root.bg.antiportal.hitTest(_root.Target._x, _root.Target._y, true)) {
_root.createShot = false;
}
if ((this._y - (this._height / 2)) < _root.Target._y) {
if (hangle == 180) {
hangle = 0;
}
} else if ((this._y - (this._height / 2)) > _root.Target._y) {
if (hangle == 0) {
hangle = 180;
}
}
if ((this._x - (this._width / 2)) < _root.Target._x) {
if (hangle == 90) {
hangle = -90;
}
} else if ((this._x - (this._width / 2)) > _root.Target._x) {
if (hangle == -90) {
hangle = 90;
}
}
if (hangle == 180) {
if (isHitMap(_root.Target._x - 20, _root.Target._y + 40) or isHitMap(_root.Target._x + 20, _root.Target._y + 40)) {
_root.createShot = false;
}
} else if (hangle == 0) {
if (isHitMap(_root.Target._x - 20, _root.Target._y - 40) or isHitMap(_root.Target._x + 20, _root.Target._y - 40)) {
_root.createShot = false;
}
} else if (hangle == 90) {
if (isHitMap(_root.Target._x + 40, _root.Target._y - 20) or isHitMap(_root.Target._x + 40, _root.Target._y + 20)) {
_root.createShot = false;
}
} else if (hangle == -90) {
if (isHitMap(_root.Target._x - 40, _root.Target._y - 20) or isHitMap(_root.Target._x - 40, _root.Target._y + 20)) {
_root.createShot = false;
}
}
if (_root.createShot == true) {
_root.portalDummy.gotoAndStop(1);
} else {
_root.portalDummy.gotoAndStop(2);
}
_root.portalDummy._x = _root.Target._x;
_root.portalDummy._y = _root.Target._y;
_root.portalDummy._rotation = hangle;
} else {
_root.portalDummy._visible = false;
}
if ((((_root.mouseCl == true) or portalQ) or portalE) and _root.playerAlive) {
if ((_root.pickedBox == false) and (!_root.buildmode)) {
if (((((_root.canShot == true) and (!_root.ht1.hitTest(_root.p1._x, _root.p1._y, true))) and (!_root.ht2.hitTest(_root.p1._x, _root.p1._y, true))) and (!_root.doorExitM.hitTest(_root.p1._x, _root.p1._y, true))) and (!_root.doorEnterM.hitTest(_root.p1._x, _root.p1._y, true))) {
if (_root.mouseCl == true) {
if (_root.currentShot == 1) {
portal_colorNum = "blue";
} else if (_root.currentShot == 2) {
portal_colorNum = "yellow";
}
}
if (portalQ) {
portal_colorNum = "blue";
} else if (portalE) {
portal_colorNum = "yellow";
}
xn = player_gunx;
yn = player_guny;
breakWhile = false;
while (xn < (_xmouse + 800)) {
if (playerleft == true) {
xn = xn + aim_raddividex;
yn = yn + (aim_raddividey * sa);
} else {
xn = xn - aim_raddividex;
yn = yn + (aim_raddividey * sa);
}
phynum = 1;
while (phynum < _root.maxphys) {
if (_root["phybox" + phynum].hitTest(xn, yn, true)) {
_root.Target._x = xn;
_root.Target._y = yn;
breakWhile = true;
}
phynum++;
}
if (breakWhile) {
break;
}
if (_root.bg.ground.hitTest(xn, yn, true)) {
_root.Target._x = xn;
_root.Target._y = yn;
break;
}
if (_root.bg.wall.hitTest(xn, yn, true)) {
_root.Target._x = xn;
_root.Target._y = yn;
break;
}
if ((((xn > 800) || (yn < 0)) || (xn < 0)) || (yn > 450)) {
_root.Target._x = xn;
_root.Target._y = yn;
break;
}
}
poi_n = false;
poi_e = false;
poi_s = false;
poi_w = false;
poi_x = _root.Target._x;
poi_y = _root.Target._y - 15;
if (isHitMap(poi_x, poi_y)) {
poi_n = true;
}
poi_x = _root.Target._x + 15;
poi_y = _root.Target._y;
if (isHitMap(poi_x, poi_y)) {
poi_e = true;
}
poi_x = _root.Target._x;
poi_y = _root.Target._y + 15;
if (isHitMap(poi_x, poi_y)) {
poi_s = true;
}
poi_x = _root.Target._x - 15;
poi_y = _root.Target._y;
if (isHitMap(poi_x, poi_y)) {
poi_w = true;
}
portal_isgrounded = false;
_root.createShot = true;
if ((poi_w and poi_e) and (!poi_s)) {
hangle = 180;
portal_isgrounded = true;
} else if ((poi_w and poi_e) and (!poi_n)) {
hangle = 0;
portal_isgrounded = true;
} else if ((poi_n and poi_s) and (!poi_e)) {
hangle = 90;
} else if ((poi_n and poi_s) and (!poi_w)) {
hangle = -90;
} else {
_root.createShot = false;
}
phynum = 1;
while (phynum < _root.maxphys) {
if (_root["phybox" + phynum].hitTest(_root.Target._x, _root.Target._y, true) and (_root["phybox" + phynum].Portalable == false)) {
trace("failed2a");
_root.createShot = false;
}
phynum++;
}
if (_root.bg.antiportal.hitTest(_root.Target._x, _root.Target._y, true)) {
_root.createShot = false;
}
if (portal_colorNum == "yellow") {
if (_root.Target.hitTest(_root.wt1)) {
_root.createShot = false;
}
} else if (portal_colorNum == "blue") {
if (_root.Target.hitTest(_root.wt2)) {
_root.createShot = false;
}
}
if ((this._y - (this._height / 2)) < _root.Target._y) {
if (hangle == 180) {
hangle = 0;
}
} else if ((this._y - (this._height / 2)) > _root.Target._y) {
if (hangle == 0) {
hangle = 180;
}
}
if ((this._x - (this._width / 2)) < _root.Target._x) {
if (hangle == 90) {
hangle = -90;
}
} else if ((this._x - (this._width / 2)) > _root.Target._x) {
if (hangle == -90) {
hangle = 90;
}
}
if (hangle == 180) {
if (isHitMap(_root.Target._x - 20, _root.Target._y + 40) or isHitMap(_root.Target._x + 20, _root.Target._y + 40)) {
_root.createShot = false;
}
} else if (hangle == 0) {
if (isHitMap(_root.Target._x - 20, _root.Target._y - 40) or isHitMap(_root.Target._x + 20, _root.Target._y - 40)) {
_root.createShot = false;
}
} else if (hangle == 90) {
if (isHitMap(_root.Target._x + 40, _root.Target._y - 20) or isHitMap(_root.Target._x + 40, _root.Target._y + 20)) {
_root.createShot = false;
}
} else if (hangle == -90) {
if (isHitMap(_root.Target._x - 40, _root.Target._y - 20) or isHitMap(_root.Target._x - 40, _root.Target._y + 20)) {
_root.createShot = false;
}
}
if ((portal_colorNum == "yellow") and (_root.createShot == true)) {
_root.portal2l._x = _root.Target._x;
_root.portal2l._y = _root.Target._y;
_root.portal2l._rotation = hangle;
} else if ((portal_colorNum == "blue") and (_root.createShot == true)) {
_root.portal1l._x = _root.Target._x;
_root.portal1l._y = _root.Target._y;
_root.portal1l._rotation = hangle;
} else {
_root.portalFail.duplicateMovieClip(["mc_s" + portalFailE_n], 200000);
_root["mc_s" + portalFailE_n]._x = _root.Target._x;
_root["mc_s" + portalFailE_n]._y = _root.Target._y;
_root["mc_s" + portalFailE_n]._rotation = hangle;
_root["interval_shotFail" + portalFailE_n] = setInterval(_root, "removePortalFailE", 2000, _root["mc_s" + portalFailE_n], portalFailE_n);
portalFailE_n++;
}
if ((portal_colorNum == "yellow") and (_root.createShot == true)) {
_root.step2._x = _root.Target._x;
_root.step2._y = _root.Target._y + 29.5;
_root.step2._rotation = hangle;
} else if ((portal_colorNum == "blue") and (_root.createShot == true)) {
_root.step1._x = _root.Target._x;
_root.step1._y = _root.Target._y + 29.5;
_root.step1._rotation = hangle;
}
if (hangle == 180) {
_root.Target._y = _root.Target._y - holeSize;
} else if (hangle == 0) {
_root.Target._y = _root.Target._y + holeSize;
} else if (hangle == 90) {
_root.Target._x = _root.Target._x - holeSize;
} else if (hangle == -90) {
_root.Target._x = _root.Target._x + holeSize;
}
if ((portal_colorNum == "yellow") and (_root.createShot == true)) {
_root.portal_yellow_open = true;
_root.portal2._rotation = hangle;
if (portal_isgrounded == false) {
_root.portal2._xscale = 100;
if (hangle == 90) {
_root.portal2._x = _root.Target._x + (_root.portal2._width / 2);
} else if (hangle == -90) {
_root.portal2._x = _root.Target._x - (_root.portal2._width / 2);
}
} else {
_root.portal2._x = _root.Target._x;
_root.portal2._xscale = 125;
}
_root.portal2._y = _root.Target._y;
_root.cursor.yellow.yellow.gotoAndPlay(1);
_root.portal2l.gotoAndPlay("open");
_root.wt2._rotation = _root.portal2._rotation;
_root.wt2.gotoAndStop(1);
if ((_root.wt2._rotation == 90) or (_root.wt2._rotation == -90)) {
_root.wt2.gotoAndStop(2);
}
if (hangle == 90) {
_root.wt2._x = _root.Target._x + 5;
} else if (hangle == -90) {
_root.wt2._x = _root.Target._x - 5;
} else {
_root.wt2._x = _root.Target._x;
}
_root.wt2._y = _root.Target._y;
_root.mask2._x = _root.Target._x;
_root.mask2._y = _root.Target._y;
_root.mask2._rotation = _root.portal2._rotation;
_root.ht2._x = _root.Target._x;
_root.ht2._y = _root.Target._y;
_root.ht2._rotation = _root.portal2._rotation;
} else if ((portal_colorNum == "blue") and (_root.createShot == true)) {
_root.portal_blue_open = true;
_root.portal1._rotation = hangle;
if (portal_isgrounded == false) {
_root.portal1._xscale = 100;
if (hangle == 90) {
_root.portal1._x = _root.Target._x + (_root.portal1._width / 2);
} else if (hangle == -90) {
_root.portal1._x = _root.Target._x - (_root.portal1._width / 2);
}
} else {
_root.portal1._x = _root.Target._x;
_root.portal1._xscale = 125;
}
_root.portal1._y = _root.Target._y;
_root.cursor.blue.blue.gotoAndPlay(1);
_root.portal1l.gotoAndPlay("open");
_root.wt1._rotation = _root.portal1._rotation;
_root.wt1.gotoAndStop(1);
if ((_root.wt1._rotation == 90) or (_root.wt1._rotation == -90)) {
_root.wt1.gotoAndStop(2);
}
if (hangle == 90) {
_root.wt1._x = _root.Target._x + 5;
} else if (hangle == -90) {
_root.wt1._x = _root.Target._x - 5;
} else {
_root.wt1._x = _root.Target._x;
}
_root.wt1._y = _root.Target._y;
_root.mask1._x = _root.Target._x;
_root.mask1._y = _root.Target._y;
_root.mask1._rotation = _root.portal1._rotation;
_root.ht1._x = _root.Target._x;
_root.ht1._y = _root.Target._y;
_root.ht1._rotation = _root.portal1._rotation;
}
this.wpn.gotoAndPlay("shot");
_root.canShot = false;
if (_root.canShot == false) {
_root.interval_shotDelay = setInterval(_root, "shotDelay", shotReload);
}
if (_root.sounds) {
if (_root.createShot) {
portshots = new Sound();
portshots.attachSound(["portshot" + Math.floor((Math.random() * 2) + 1)]);
portshots.start();
} else {
physGl = new Sound();
physGl.attachSound("physDry");
physGl.start(0, 1);
}
}
if (_root.mouseCl == true) {
_root.currentShot++;
if (_root.createShot == true) {
if (_root.currentShot > 2) {
_root.currentShot = 1;
}
} else if (_root.currentShot > 2) {
_root.currentShot = 2;
} else {
_root.currentShot = 1;
}
}
}
} else {
this.wpn.gotoAndPlay("shot");
_root.canShot = false;
if (_root.canShot == false) {
_root.interval_shotDelay = setInterval(_root, "shotDelay", shotReload);
}
dropBox();
}
}
if (fPickUp and (_root.pickedBox == false)) {
if (!pickPressed) {
gotShot = false;
n = 2;
while (n < _root.maxn) {
if (gotShot == false) {
fxn = player_gunx;
fyn = player_guny;
do {
if (fxn >= (_xmouse + 800)) {
break;
}
if (playerleft == true) {
fxn = fxn + sa;
fyn = fyn + (aim_raddividey * sa);
} else {
fxn = fxn - sa;
fyn = fyn + (aim_raddividey * sa);
}
_root.fTarget._x = fxn;
_root.fTarget._y = fyn;
if (((((_root.p1._x + 50) < _root.fTarget._x) or ((_root.p1._x - 50) > _root.fTarget._x)) or ((_root.p1._y + 50) < _root.fTarget._y)) or ((_root.p1._y - 100) > _root.fTarget._y)) {
break;
}
if (_root["p" + n].hitTest(fxn, fyn, true)) {
gotShot = true;
_root.pickedBox = true;
_root.pickedP = n;
_root.pickedStr = "p";
if (_root.sounds) {
physG = new Sound();
physG.attachSound("physPick");
physG.start();
}
break;
}
if (_root.bg.ground.hitTest(fxn, fyn, true)) {
break;
}
if (_root.bg.wall.hitTest(fxn, fyn, true)) {
break;
}
} while (!(((xn > 800) || (yn < 0)) || (xn < 0)));
}
n++;
}
t = 1;
while (t < _root.maxt) {
if (gotShot == false) {
fxn = player_gunx;
fyn = player_guny;
do {
if (fxn >= (_xmouse + 800)) {
break;
}
if (playerleft == true) {
fxn = fxn + sa;
fyn = fyn + (aim_raddividey * sa);
} else {
fxn = fxn - sa;
fyn = fyn + (aim_raddividey * sa);
}
_root.fTarget._x = fxn;
_root.fTarget._y = fyn;
if (((((_root.p1._x + 50) < _root.fTarget._x) or ((_root.p1._x - 50) > _root.fTarget._x)) or ((_root.p1._y + 50) < _root.fTarget._y)) or ((_root.p1._y - 100) > _root.fTarget._y)) {
break;
}
if (_root["t" + t].hitTest(fxn, fyn, true)) {
gotShot = true;
_root.pickedBox = true;
_root.pickedP = t;
if (this._x > _root["t" + t]._x) {
_root.pickedPR = _root["t" + t]._rotation + 180;
} else {
_root.pickedPR = _root["t" + t]._rotation;
}
_root.pickedStr = "t";
if (_root.sounds) {
physG = new Sound();
physG.attachSound("physPick");
physG.start();
}
break;
}
if (_root.bg.ground.hitTest(fxn, fyn, true)) {
break;
}
if (_root.bg.wall.hitTest(fxn, fyn, true)) {
break;
}
} while (!(((xn > 800) || (yn < 0)) || (xn < 0)));
}
t++;
}
pickPressed = true;
}
} else if (fPickUp and (_root.pickedBox == true)) {
if (!pickPressed) {
dropBox();
pickPressed = true;
}
} else {
pickPressed = false;
}
if ((Reload and _root.canShot) and _root.playerAlive) {
if ((!_root.ht2.hitTest(_root.p1)) and (!_root.ht1.hitTest(_root.p1))) {
if (!reloadPressed) {
if (_root.sounds) {
physGl = new Sound();
physGl.attachSound("physDry");
physGl.start(0, 1);
}
this.wpn.gotoAndPlay("dry");
_root.canShot = false;
if (_root.canShot == false) {
_root.interval_shotDelay = setInterval(_root, "shotDelay", shotReload);
}
_root.portal2._x = _root.trash._x;
_root.portal2._y = _root.trash._y;
_root.portal1._x = _root.trash._x;
_root.portal1._y = _root.trash._y;
_root.portal1l._x = _root.trash._x;
_root.portal1l._y = _root.trash._y;
_root.portal2l._x = _root.trash._x;
_root.portal2l._y = _root.trash._y;
_root.wt1._x = _root.trash._x;
_root.wt1._y = _root.trash._y;
_root.wt2._x = _root.trash._x;
_root.wt2._y = _root.trash._y;
_root.ht1._x = _root.trash._x;
_root.ht1._y = _root.trash._y;
_root.ht2._x = _root.trash._x;
_root.ht2._y = _root.trash._y;
_root.step1._x = _root.trash._x;
_root.step1._y = _root.trash._y;
_root.step2._x = _root.trash._x;
_root.step2._y = _root.trash._y;
_root.portal_blue_open = false;
_root.portal_yellow_open = false;
reloadPressed = true;
}
}
} else {
reloadPressed = false;
}
}
}
onClipEvent (keyDown) {
_root.keyis_down = true;
}
onClipEvent (keyUp) {
_root.keyis_down = false;
}
Instance of Symbol 1216 MovieClip "player_cam" in Frame 5
onClipEvent (load) {
function camControl() {
parentColor.setTransform(camColor.getTransform());
var _local4 = sX / this._width;
var _local3 = sY / this._height;
_parent._x = cX - (this._x * _local4);
_parent._y = cY - (this._y * _local3);
_parent._xscale = 100 * _local4;
_parent._yscale = 100 * _local3;
}
function resetStage() {
var _local2 = {ra:100, rb:0, ga:100, gb:0, ba:100, bb:0, aa:100, ab:0};
parentColor.setTransform(_local2);
_parent._xscale = 100;
_parent._yscale = 100;
_parent._x = 0;
_parent._y = 0;
}
this._visible = false;
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;
var camColor = new Color(this);
var parentColor = new Color(_parent);
}
onClipEvent (enterFrame) {
if (_root.playerCam) {
camControl();
} else {
resetStage();
this.onUnload = resetStage;
}
}
Symbol 28 MovieClip [TextScroller] Frame 1
#initclip 6
Object.registerClass("TextScroller", gr.ground.choma.TextScroller);
#endinitclip
stop();
Symbol 50 Button
on (release) {
getURL ("http://wecreatestuff.com", "blank");
}
Symbol 56 Button
on (release) {
_root.userHitPlay = true;
}
Symbol 57 MovieClip Frame 1
loadedbytes = _root.getBytesLoaded();
totalbytes = _root.getBytesTotal();
percent = Math.ceil((loadedbytes * 100) / totalbytes);
percentTxt = percent + "";
frame = int(loadedbytes / (totalbytes / 100));
frame = int(loadedbytes / (totalbytes / 100));
if (loadedbytes == totalbytes) {
gotoAndPlay (3);
}
ttbyeys = ((loadedbytes + " out of ") + totalbytes) + " bytes";
var loadingBoxEffect = (new flash.filters.BlurFilter());
loadingBoxEffect.quality = 3;
loadingBoxEffect.blurX = 0;
loadingBoxEffect.blurY = percent / 4;
_root.loader.graphic_loader.filters = [loadingBoxEffect];
Instance of Symbol 41 MovieClip "graphic_loader" in Symbol 57 MovieClip Frame 1
onClipEvent (enterFrame) {
plusSpeed = Math.round((_parent.percent * 6) / 100);
if (this._currentframe == this._totalframes) {
this.play();
} else {
this.gotoAndStop(this._currentframe + plusSpeed);
}
}
Instance of Symbol 53 MovieClip in Symbol 57 MovieClip Frame 1
onClipEvent (enterFrame) {
this.onPress = function () {
getURL ("http://www.armorgames.com", "_blank");
};
}
Symbol 57 MovieClip Frame 2
gotoAndPlay (1);
Symbol 57 MovieClip Frame 3
stop();
Symbol 15 MovieClip [__Packages.gr.ground.choma.Core] Frame 0
class gr.ground.choma.Core extends MovieClip
{
var fphost, fpexport, _skin;
function Core () {
super();
fphost = parseInt(getVersion().substr(4, 1));
var _local1 = new TextField();
fpexport = (_local1.replaceText ? ((_local1.thickness ? 8 : 7)) : 6);
}
function get skin() {
return(_skin);
}
function init() {
var _local1 = this;
_local1.bbox._visible = false;
_local1.bbox._width = (_local1.bbox._height = 0);
}
function doLater(o, f, p, d) {
var _local3 = this;
var _local2 = [o, f, p];
var _local1 = 1;
while (_local1 < d) {
_local2 = [_local3, "doLater", _local2];
_local1++;
}
if (!_local3.laterQueue) {
_local3.laterQueue = [];
}
_local3.laterQueue.push(_local2);
_local3.onEnterFrame = _local3.doLaterDispatcher;
}
function doLaterDispatcher(Void) {
var _local3 = this;
delete _local3.onEnterFrame;
var _local2 = _local3.laterQueue;
_local3.laterQueue = [];
while (_local2.length != 0) {
var _local1 = _local2.shift();
_local1[0][_local1[1]].apply(_local1[0], _local1[2]);
}
}
}
Symbol 16 MovieClip [__Packages.gr.ground.choma.TextScroller] Frame 0
class gr.ground.choma.TextScroller extends gr.ground.choma.Core
{
var __target, _scroll, doLater;
function TextScroller () {
super();
init();
}
function set skin(id) {
var _local1 = this;
var _local2 = id;
if (_local2 == "") {
_local2 = "ChomaSkinScrollerDefault";
}
_local1.attachMovie(_local2, "_skin", 1);
gr.ground.choma.ScrollerSkin.create(_local1._skin, _local1);
_local1.setSize();
_local1.onScroller();
//return(_local1.__get__skin());
}
function set orientation(b) {
var _local1 = this;
_local1.doLater(_local1._skin, "setHorizontal", [b]);
_local1.horizontal = b;
//return(_local1.__get__orientation());
}
function get orientation() {
return(horizontal);
}
function set targetTextField(tf) {
var _local1 = this;
var _local2 = tf;
if (typeof(_local2) == "string") {
_local2 = _local1._parent[_local2];
}
if (_local1.__target != _local2) {
_local1.__target.removeListener(_local1);
_local1.__target = _local2;
_local1.__target.addListener(_local1);
_local1.onScroller();
}
//return(_local1.__get__targetTextField());
}
function get targetTextField() {
return(__target);
}
function get scroll() {
return(__target[_scroll]);
}
function init(initBefore) {
var _local1 = this;
super.init();
_local1.__set__targetTextField(_local1._targetInstanceName);
if (_local1.fpexport == 6) {
_local1.__set__skin("");
_local1.doLater(_local1, "onScroller", [], 2);
}
_local1._xscale = 100;
_local1._yscale = 100;
_local1._width = Math.round(_local1._width);
_local1._height = Math.round(_local1._height);
_local1.doLater(_local1._skin, "setHorizontal", [_local1.horizontal]);
_local1.setSize();
}
function setSize(w, h) {
var _local1 = this;
if (_local1._targetInstanceName == "") {
} else {
var _local3;
var _local2;
if (_local1.horizontal) {
_local1._scroll = "hscroll";
_local1._maxscroll = "maxhscroll";
if (!w) {
_local3 = 16;
} else {
_local3 = h;
}
if (!h) {
_local2 = _local1.__get__targetTextField()._width;
} else {
_local2 = w;
}
} else {
_local1._scroll = "scroll";
_local1._maxscroll = "maxscroll";
if (!w) {
_local3 = _local1._skin._width;
}
if (!h) {
_local2 = _local1.__get__targetTextField()._height;
}
}
_local1._skin.setSize(_local3, _local2);
}
}
function setScroll(n, page) {
var _local1 = this;
var _local2 = n;
if (_local1.horizontal) {
if (page) {
_local2 = _local2 * _local1.__target._width;
} else {
_local2 = _local2 * 8;
}
} else if (page) {
_local2 = _local2 * ((_local1.__target.bottomScroll - _local1.__target[_local1._scroll]) + 1);
}
_local2 = _local2 + _local1.__target[_local1._scroll];
if (_local2 > (_local1.__target[_local1._maxscroll] - 1)) {
_local2 = _local1.__target[_local1._maxscroll] - 1;
}
_local1.__target[_local1._scroll] = _local2;
}
function onScroller() {
doLater(this, "refresh");
}
function refresh() {
var _local1 = this;
if (_local1.horizontal) {
var _local2 = _local1.__target._width / _local1.__target.textWidth;
} else {
var _local3 = (_local1.__target[_local1._maxscroll] + (_local1.__target.bottomScroll - _local1.__target[_local1._scroll])) - 1;
var avail = ((_local1.__target.bottomScroll - _local1.__target[_local1._scroll]) + 1);
var _local2 = avail / _local3;
}
_local1._skin.sizeProportion = _local2;
_local1._visible = !((_local2 >= 1) && (_local1.autoHide));
if (_local1.isAtBottom && (_local1.__target.maxscroll > _local1.prevMaxScroll)) {
_local1.setPosition(1);
_local1.prevMaxScroll = _local1.__target.maxscroll;
}
if (!_local1._skin.onMouseMove) {
_local1._skin.positionProportion = (_local1.__target[_local1._scroll] - 1) / (_local1.__target[_local1._maxscroll] - 2);
}
}
function setPosition(p) {
var _local1 = this;
if (_local1.fixThumbAtEnd) {
_local1.isAtBottom = p >= 1;
}
_local1.__target[_local1._scroll] = (p * _local1.__target[_local1._maxscroll]) + 1;
}
var isAtBottom = false;
var prevMaxScroll = 0;
var fixThumbAtEnd = false;
var _targetInstanceName = "";
var horizontal = false;
}
Symbol 29 MovieClip [__Packages.mx.utils.Delegate] Frame 0
class mx.utils.Delegate extends Object
{
var func;
function Delegate (f) {
super();
func = f;
}
static function create(obj, func) {
var _local2 = func;
var _local3 = arguments;
var _local1 = function () {
var _local1 = arguments;
var _local2 = _local1.callee.target;
var _local3 = _local1.callee.func;
return(_local3.apply(_local2, _local1));
};
_local1.target = obj;
_local1.func = _local2;
return(_local1);
}
function createDelegate(obj) {
return(create(obj, func));
}
}
Symbol 30 MovieClip [__Packages.gr.ground.choma.SliderSkin] Frame 0
class gr.ground.choma.SliderSkin extends MovieClip
{
var thumb, track, onMouseMove, intID;
function SliderSkin (ref, tl) {
var _local1 = this;
var _local2 = ref;
super();
if (!arguments.length) {
} else {
_local2.__proto__ = _local1.__proto__;
_local2.__constructor__ = gr.ground.choma.SliderSkin;
_local1 = _local2;
_local1.master = tl;
_local1.init();
}
}
function get trackSize() {
return(track._height - thumb._height);
}
function set positionProportion(p) {
var _local1 = p;
var _local2 = this;
if (_local1 > 1) {
_local1 = 1;
}
if (_local1 < 0) {
_local1 = 0;
}
_local2.thumb._y = _local2.thumbIniPos + Math.round(_local1 * _local2.__get__trackSize());
//return(_local2.__get__positionProportion());
}
static function create(ref, tl) {
var app = (new gr.ground.choma.SliderSkin(ref, tl));
}
function init() {
var _local1 = this;
_local1.track.useHandCursor = (_local1.thumb.useHandCursor = false);
_local1.track.onPress = mx.utils.Delegate.create(_local1, _local1.onTrack);
_local1.track.onRelease = (_local1.track.onReleaseOutside = mx.utils.Delegate.create(_local1, _local1.killInterval));
_local1.thumb.onPress = mx.utils.Delegate.create(_local1, _local1.onThumbDown);
_local1.thumb.onRelease = (_local1.thumb.onReleaseOutside = mx.utils.Delegate.create(_local1, _local1.onThumbUp));
}
function setHorizontal(b, isSlider) {
var _local1 = this;
if (b) {
_local1._rotation = -90;
_local1.master._rotation = 0;
_local1.master._yscale = -100;
if (!isSlider) {
_local1._y = _local1._height;
}
} else {
_local1._rotation = 0;
if (!isSlider) {
_local1.master._yscale = 100;
} else {
_local1.master._yscale = -100;
_local1._y = -_local1._height;
}
}
}
function setSize(w, h) {
var _local1 = this;
_local1.track._height = h - _local1.track._y;
_local1.track._width = (_local1.thumb._width = w);
}
function onTrack() {
var _local1 = this;
var _local2 = ((_local1._ymouse < _local1.thumb._y) ? -1 : 1);
if (_local1.master.snap) {
var _local3 = (_local2 * _local1.track._height) / (_local1.master.range / _local1.master.step);
_local1.changePosition((_local1.thumb._y + _local3) / _local1.__get__trackSize());
_local1.trackInterval();
} else {
if (_local2 == -1) {
_local1.thumb._y = _local1._ymouse;
} else {
_local1.thumb._y = _local1._ymouse - _local1.thumb._height;
}
_local1.changePosition();
}
}
function onThumbDown() {
var _local1 = this;
if (!_local1.master.snap) {
_local1.thumb.startDrag(false, 0, _local1.track._y, 0, ((_local1.track._y + _local1.track._height) - _local1.thumb._height) + 1);
}
_local1.onMouseMove = mx.utils.Delegate.create(_local1, _local1.changePosition);
}
function onThumbUp() {
thumb.stopDrag();
delete onMouseMove;
}
function changePosition(p) {
var _local1 = p;
var _local2 = this;
updateAfterEvent();
if (_local1 == undefined) {
_local1 = _local2._ymouse / _local2.track._height;
}
_local2.master.setPosition(_local1);
}
function killInterval() {
clearInterval(intID);
intID = null;
}
function trackInterval() {
var _local1 = this;
if (_local1.intID == null) {
_local1.intID = setInterval(_local1, "onTrack", 400);
} else {
_local1.killInterval();
_local1.intID = setInterval(_local1, "onTrack", 60);
}
}
var thumbIniPos = 0;
}
Symbol 31 MovieClip [__Packages.gr.ground.choma.ScrollerSkin] Frame 0
class gr.ground.choma.ScrollerSkin extends gr.ground.choma.SliderSkin
{
function ScrollerSkin (ref, tl) {
var _local1 = this;
var _local2 = ref;
super();
_local2.__proto__ = _local1.__proto__;
_local2.__constructor__ = gr.ground.choma.ScrollerSkin;
_local1 = _local2;
_local1.master = tl;
_local1.init();
}
function set sizeProportion(p) {
var _local1 = this;
var _local3 = p;
if (_local3 >= 1) {
_local1.thumb._visible = false;
} else {
_local1.thumb._visible = true;
if (_local1.prevThumbProp != _local3) {
var _local2 = _local1.thumb.centered;
if ((_local1.track._height * _local3) < (_local2._height + 2)) {
return(undefined);
}
_local1.thumb._height = _local1.track._height * _local3;
_local2._yscale = 10000 / _local1.thumb._yscale;
_local2._y = (((_local1.thumb._height * 100) / _local1.thumb._yscale) - _local2._height) / 2;
_local1.prevThumbProp = _local3;
}
}
//return(_local1.__get__sizeProportion());
return;
}
static function create(ref, tl) {
var app = (new gr.ground.choma.ScrollerSkin(ref, tl));
}
function init() {
var _local1 = this;
_local1.minus.useHandCursor = (_local1.plus.useHandCursor = false);
_local1.minus.onPress = mx.utils.Delegate.create(_local1, _local1.onMinus);
_local1.plus.onPress = mx.utils.Delegate.create(_local1, _local1.onPlus);
_local1.minus.onRelease = (_local1.minus.onReleaseOutside = mx.utils.Delegate.create(_local1, _local1.killInterval));
_local1.plus.onRelease = (_local1.plus.onReleaseOutside = mx.utils.Delegate.create(_local1, _local1.killInterval));
_local1.thumbIniPos = _local1.track._y;
super.init();
}
function setSize(w, h) {
var _local1 = this;
super.setSize(w, h);
_local1.track._height = _local1.track._height - _local1.plus._height;
_local1.plus._y = h - _local1.plus._height;
_local1.minus._width = (_local1.plus._width = w);
}
function onMinus() {
var _local1 = this;
_local1.master.setScroll(-1);
if (_local1.intID == null) {
_local1.intID = setInterval(_local1, "onMinus", 400);
} else {
_local1.killInterval();
_local1.intID = setInterval(_local1, "onMinus", 60);
}
}
function onPlus() {
var _local1 = this;
_local1.master.setScroll(1);
if (_local1.intID == null) {
_local1.intID = setInterval(_local1, "onPlus", 400);
} else {
_local1.killInterval();
_local1.intID = setInterval(_local1, "onPlus", 60);
}
}
function changePosition() {
var _local1 = this;
super.changePosition((_local1.thumb._y - _local1.thumbIniPos) / _local1.__get__trackSize());
}
function onTrack() {
var _local1 = this;
if (_local1._ymouse < _local1.thumb._y) {
_local1.master.setScroll(-1, true);
} else if (_local1._ymouse > (_local1.thumb._y + _local1.thumb._height)) {
_local1.master.setScroll(1, true);
}
_local1.trackInterval();
}
}
Symbol 148 MovieClip Frame 1
stop();
Symbol 156 MovieClip Frame 126
_parent.play();
Symbol 158 Button
on (release) {
_root.gotoAndStop("mainmenu");
}
Symbol 201 MovieClip Frame 1
stop();
Symbol 202 MovieClip Frame 1
stop();
Instance of Symbol 156 MovieClip in Symbol 202 MovieClip Frame 1
onClipEvent (enterFrame) {
this.onPress = function () {
getURL ("http://www.armorgames.com", "_blank");
};
}
Symbol 202 MovieClip Frame 854
_root.mainMenu_sound = new Sound(_root);
_root.mainMenu_sound.attachSound("intro_looping");
_root.mainMenu_sound.start(0, 9999);
_root.mainMenu_soundLoop = true;
Symbol 202 MovieClip Frame 907
_root.gotoAndStop("mainmenu");
Symbol 225 MovieClip Frame 1
stop();
Symbol 247 MovieClip Frame 1
function loadSettings() {
_root.settings = SharedObject.getLocal("settings");
changeQuality(_root.settings.data.qualitys);
_root.effects = _root.settings.data.effects;
_root.musicVol.setVolume(_root.settings.data.musicVol);
_root.allsound.setVolume(_root.settings.data.soundVol);
_root.sounds = _root.settings.data.sounds;
_root.crosshair = _root.settings.data.crosshair;
_root.consoleEnabled = _root.settings.data.console;
slider1._x = track1._x + ((track1._width / 3) * _root.settings.data.qualitys);
slider2._x = track2._x + ((track2._width / 2) * _root.settings.data.effects);
slider3._x = track3._x + ((track3._width / 100) * _root.allsound.getVolume());
slider4._x = track4._x + ((track4._width / 100) * _root.musicVol.getVolume());
crosshairSwitch(_root.settings.data.crosshair);
soundSwitch(_root.settings.data.sounds);
consoleSwitch(_root.settings.data.console);
guidanceSwitch(_root.settings.data.guidance);
fpsmSwitch(_root.settings.data.showfps);
}
function defaultSettings() {
consoleSwitch(false);
soundSwitch(true);
crosshairSwitch(true);
guidanceSwitch(true);
fpsmSwitch(false);
changeQuality(1);
_root.effects = _root.settings.data.effects;
setVolumeN(80);
slider1._x = track1._x + ((track1._width / 3) * _root.settings.data.qualitys);
slider2._x = track2._x + ((track2._width / 2) * _root.settings.data.effects);
slider4._x = track4._x + ((track4._width / 100) * 80);
_root.musicVol.setVolume(80);
_root.settings.data.musicVol = 80;
_root.settings.flush();
}
function changeQuality(num) {
if (num == 0) {
_quality = "low";
_root.settings.data.qualitys = 0;
} else if (num == 1) {
_quality = "medium";
_root.settings.data.qualitys = 1;
} else if (num == 2) {
_quality = "high";
_root.settings.data.qualitys = 2;
} else if (num == 3) {
_quality = "best";
_root.settings.data.qualitys = 3;
}
_root.settings.flush();
}
function crosshairSwitch(to) {
if (!to) {
_root.crosshair = false;
_root.settings.data.crosshair = false;
switch_crosshair.gotoAndStop(2);
} else {
_root.crosshair = true;
_root.settings.data.crosshair = true;
switch_crosshair.gotoAndStop(1);
}
_root.settings.flush();
}
function soundSwitch(to) {
if (!to) {
_root.sounds = false;
_root.settings.data.sounds = false;
switch_sound.gotoAndStop(2);
setVolumeN(0);
} else if (to) {
_root.sounds = true;
_root.settings.data.sounds = true;
switch_sound.gotoAndStop(1);
if (_root.allsound.getVolume() == 0) {
setVolumeN(50);
_root.soundCheck = new Sound();
_root.soundCheck.attachSound("btn_down");
_root.soundCheck.start(0, 1);
}
}
_root.settings.flush();
}
function consoleSwitch(to) {
if (!to) {
_root.consoleEnabled = false;
_root.settings.data.console = false;
switch_console.gotoAndStop(2);
} else if (to) {
_root.consoleEnabled = true;
_root.settings.data.console = true;
switch_console.gotoAndStop(1);
}
_root.settings.flush();
}
function guidanceSwitch(to) {
if (!to) {
_root.guidance = false;
_root.settings.data.guidance = false;
switch_guidance.gotoAndStop(2);
} else if (to) {
_root.guidance = true;
_root.settings.data.guidance = true;
switch_guidance.gotoAndStop(1);
}
_root.settings.flush();
}
function fpsmSwitch(to) {
if (!to) {
_root.showfps = false;
_root.settings.data.showfps = false;
switch_showfps.gotoAndStop(2);
} else if (to) {
_root.showfps = true;
_root.settings.data.showfps = true;
switch_showfps.gotoAndStop(1);
}
_root.settings.flush();
}
function positionSlider(no, which) {
n = -1;
while (n < (no + 2)) {
this["option" + n] = this["track" + which]._x + ((this["track" + which]._width / no) * n);
n++;
}
n = 0;
while (n < (no + 1)) {
if ((this["slider" + which]._x > ((this["option" + n] + this["option" + (n - 1)]) / 2)) and (this["slider" + which]._x < ((this["option" + n] + this["option" + (n + 1)]) / 2))) {
this["slider" + which]._x = this["option" + n];
if (which == 1) {
changeQuality(n);
_root.qualityNum = n;
if (n == 0) {
_quality = "low";
} else if (n == 1) {
_quality = "medium";
} else if (n == 2) {
_quality = "high";
} else if (n == 3) {
_quality = "best";
}
} else {
_root.effects = n;
_root.settings.data.effects = n;
_root.settings.flush();
}
}
n++;
}
}
function changeVolume() {
_root.allsound.setVolume(-Math.round(((this.track3._x - this.slider3._x) * 100) / this.track3._width));
_root.soundCheck = new Sound();
_root.soundCheck.attachSound("btn_down");
_root.soundCheck.start(0, 1);
if (_root.allsound.getVolume() == 0) {
soundSwitch(false);
} else {
soundSwitch(true);
}
_root.settings.data.soundVol = -Math.round(((this.track3._x - this.slider3._x) * 100) / this.track3._width);
_root.settings.flush();
}
function setVolumeN(vomNum) {
_root.allsound.setVolume(vomNum);
slider3._x = this.track3._x + ((vomNum * this.track3._width) / 100);
_root.settings.data.soundVol = vomNum;
_root.settings.flush();
}
function setMusicVolume(vomNum) {
_root.musicVol.setVolume(-Math.round(((this.track4._x - this.slider4._x) * 100) / this.track4._width));
_root.settings.data.musicVol = -Math.round(((this.track4._x - this.slider4._x) * 100) / this.track4._width);
_root.settings.flush();
trace(_root.settings.data.musicVol);
}
slider1.onPress = function () {
startDrag (this, false, track1._x, track1._y, track1._x + track1._width, track1._y);
};
slider1.onRelease = function () {
positionSlider(3, 1);
stopDrag();
};
slider2.onPress = function () {
startDrag (this, false, track2._x, track2._y, track2._x + track2._width, track2._y);
};
slider2.onRelease = function () {
positionSlider(2, 2);
stopDrag();
};
slider3.onPress = function () {
startDrag (this, false, track3._x, track3._y, track3._x + track3._width, track3._y);
};
slider3.onRelease = function () {
stopDrag();
changeVolume();
};
slider4.onPress = function () {
startDrag (this, false, track4._x, track4._y, track4._x + track4._width, track4._y);
};
slider4.onRelease = function () {
stopDrag();
setMusicVolume();
};
switch_crosshair.onRelease = function () {
if (switch_crosshair._currentframe == 2) {
crosshairSwitch(true);
} else {
crosshairSwitch(false);
}
};
switch_sound.onRelease = function () {
if (switch_sound._currentframe == 2) {
soundSwitch(true);
} else {
soundSwitch(false);
}
};
switch_console.onRelease = function () {
if (switch_console._currentframe == 2) {
consoleSwitch(true);
} else {
consoleSwitch(false);
}
};
switch_guidance.onRelease = function () {
if (switch_guidance._currentframe == 2) {
guidanceSwitch(true);
} else {
guidanceSwitch(false);
}
};
switch_showfps.onRelease = function () {
if (switch_showfps._currentframe == 2) {
fpsmSwitch(true);
} else {
fpsmSwitch(false);
}
};
restoredefault.onRelease = function () {
defaultSettings();
};
loadSettings();
Symbol 254 MovieClip Frame 1
function levelType(num) {
switch (num) {
case 1 :
return("- Meet the ASHPD.");
case 4 :
return("- Portal-Proof walls.");
case 6 :
return("- ASHPD+Momentum.");
case 10 :
return("- You are not invincible.");
case 16 :
return("- Anti-Object.");
case 19 :
return("- Red Buttons.");
case 21 :
return("- Energy Balls.");
case 25 :
return("- Cubes.");
case 29 :
return("- They can shoot you.");
case 33 :
return("- Think with portals.");
}
return("");
}
function createLvlBtn(num) {
this.mask.createEmptyMovieClip("lvlbg" + num, this.mask.getNextHighestDepth());
if (num == levels) {
colorlvlbg = 13499659 /* 0xCDFD0B */;
} else {
colorlvlbg = 16777215 /* 0xFFFFFF */;
}
this.mask["lvlbg" + num].beginFill(colorlvlbg, 100);
this.mask["lvlbg" + num].moveTo(0, (0 + ((num - 1) * lineHeight)) + spacing);
this.mask["lvlbg" + num].lineTo(lineWidth, (0 + ((num - 1) * lineHeight)) + spacing);
this.mask["lvlbg" + num].lineTo(lineWidth, lineHeight + ((num - 1) * lineHeight));
this.mask["lvlbg" + num].lineTo(0, lineHeight + ((num - 1) * lineHeight));
this.mask["lvlbg" + num].lineTo(0, (0 + ((num - 1) * lineHeight)) + spacing);
this.mask["lvlbg" + num].endFill();
this.mask["lvlbg" + num]._alpha = 25;
this.mask["lvlbg" + num].n = num;
this.mask["lvlbg" + num].Active = false;
if (num <= levels) {
this.mask["lvlbg" + num]._alpha = 50;
this.mask["lvlbg" + num].Active = true;
}
this.mask.createTextField("lvlnum" + num, this.mask.getNextHighestDepth(), 0, 0, lineWidth, lineHeight);
this.mask["lvlnum" + num].text = (("Task no." + num) + " ") + levelType(num);
this.mask["lvlnum" + num].selectable = false;
this.mask["lvlnum" + num].setTextFormat(lvlOpFrmt);
this.mask["lvlnum" + num]._x = this.mask["lvlbg" + num]._x;
this.mask["lvlnum" + num]._y = (num - 1) * lineHeight;
}
_root.stats = SharedObject.getLocal("stats");
levels = _root.stats.data.map;
lineHeight = 18;
lineWidth = 314;
spacing = 1;
ySpeed = 0;
rechedTop = true;
var lvlOpFrmt = new TextFormat();
lvlOpFrmt.bold = true;
lvlOpFrmt.font = "Arial";
lvlOpFrmt.size = 11;
lvlOpFrmt.color = 16777215 /* 0xFFFFFF */;
mask.setMask(masker);
n = 1;
while (n < 41) {
createLvlBtn(n);
n++;
}
this.onEnterFrame = function () {
if (this.mask.lvlbg1._y > 0) {
rechedTop = true;
n = 1;
while (n < 41) {
this.mask["lvlbg" + n]._y = ((((n - 1) * lineHeight) - ((n - 1) * lineHeight)) - 0) / 2;
this.mask["lvlnum" + n]._y = (n - 1) * lineHeight;
n++;
}
} else {
rechedTop = false;
}
if (this.mask.lvlbg40._y < -380) {
rechedBottom = true;
n = 1;
while (n < 41) {
this.mask["lvlbg" + n]._y = (((n - 1) * lineHeight) - ((n - 1) * lineHeight)) - 380;
this.mask["lvlnum" + n]._y = ((n - 1) * lineHeight) - 380;
n++;
}
} else {
rechedBottom = false;
}
up.onPress = function () {
if (!rechedTop) {
ySpeed = ySpeed + 5;
}
};
down.onPress = function () {
if (!rechedBottom) {
ySpeed = ySpeed - 5;
}
};
ySpeed = ySpeed / 1.1;
if ((ySpeed > -1) and (ySpeed < 1)) {
ySpeed = 0;
}
n = 1;
while (n < 41) {
this.mask["lvlbg" + n]._y = this.mask["lvlbg" + n]._y + Math.floor(ySpeed);
this.mask["lvlnum" + n]._y = this.mask["lvlnum" + n]._y + Math.floor(ySpeed);
n++;
}
num = 1;
while (num <= levels) {
this.mask["lvlbg" + num].onRollOver = function () {
this._alpha = 75;
};
this.mask["lvlbg" + num].onRollOut = function () {
this._alpha = 50;
};
this.mask["lvlbg" + num].onRelease = function () {
_root.gotoLevel(this.n);
};
num++;
}
};
Symbol 255 MovieClip Frame 1
stop();
window_newgame._visible = false;
window_loadgame._visible = false;
window_challenges._visible = false;
window_options._visible = false;
if (!menu_loop_playing) {
muteBtn.gotoAndStop(2);
}
loopVol = 100;
this.onEnterFrame = function () {
if ((!_root.mainMenu_soundLoop) and menu_loop_playing) {
_root.mainMenu_sound = new Sound(this);
_root.mainMenu_sound.attachSound("intro_looping");
_root.mainMenu_sound.start(0, 9999);
_root.mainMenu_soundLoop = true;
}
if (menu_loop_playing == true) {
if (loopVol < 100) {
loopVol = loopVol + 10;
}
} else if (loopVol > 0) {
loopVol = loopVol - 10;
}
_root.mainMenu_sound.setVolume(_root.mainmenu.loopVol);
};
menubtns.newgame.onRelease = function () {
if (window_newgame._visible == true) {
window_newgame._visible = false;
} else {
window_newgame._visible = true;
window_newgame._x = 20;
window_newgame._y = 40;
window_loadgame._visible = false;
window_challenges._visible = false;
window_options._visible = false;
}
};
window_newgame.movable.onPress = function () {
startDrag (window_newgame);
};
window_newgame.movable.onRelease = function () {
stopDrag();
};
window_newgame.startgame.onRelease = function () {
_root.gotoLevel(1);
};
window_newgame.closeWin.onRelease = function () {
window_newgame._visible = false;
};
menubtns.loadgame.onRelease = function () {
if (window_loadgame._visible == true) {
window_loadgame._visible = false;
} else {
window_loadgame._visible = true;
window_loadgame._x = -132;
window_loadgame._y = -160;
window_newgame._visible = false;
window_challenges._visible = false;
window_options._visible = false;
}
};
window_loadgame.movable.onPress = function () {
startDrag (window_loadgame);
};
window_loadgame.movable.onRelease = function () {
stopDrag();
};
window_loadgame.closeWin.onRelease = function () {
window_loadgame._visible = false;
};
menubtns.freeroom.onRelease = function () {
if (window_challenges._visible == true) {
window_challenges._visible = false;
} else {
window_challenges._visible = true;
window_challenges._x = 20;
window_challenges._y = 0;
window_newgame._visible = false;
window_loadgame._visible = false;
window_options._visible = false;
}
};
window_challenges.movable.onPress = function () {
startDrag (window_challenges);
};
window_challenges.movable.onRelease = function () {
stopDrag();
};
window_challenges.closeWin.onRelease = function () {
window_challenges._visible = false;
};
window_challenges.startgame.onRelease = function () {
_root.gotoLevel(0);
window_challenges._visible = false;
};
menubtns.options.onRelease = function () {
if (window_options._visible == true) {
window_options._visible = false;
} else {
window_options._visible = true;
window_options._x = 20;
window_options._y = 0;
window_newgame._visible = false;
window_loadgame._visible = false;
window_challenges._visible = false;
}
};
window_options.movable.onPress = function () {
startDrag (window_options);
};
window_options.movable.onRelease = function () {
stopDrag();
};
window_options.closeWin.onRelease = function () {
window_options._visible = false;
};
window_options.okBtn.onRelease = function () {
window_options._visible = false;
};
menubtns.credits.onRelease = function () {
_root.gotoLevel(42);
};
menubtns.playmoregames.onRelease = function () {
getURL ("http://www.armorgames.com", "_blank");
};
menubtns.valvelink.onRelease = function () {
getURL ("http://orange.half-life2.com/", "_blank");
};
muteBtn.onRelease = function () {
if (menu_loop_playing == true) {
muteBtn.gotoAndStop(2);
menu_loop_playing = false;
_root.settings.data.mm_loop = menu_loop_playing;
_root.settings.flush();
} else {
muteBtn.gotoAndStop(1);
menu_loop_playing = true;
_root.settings.data.mm_loop = menu_loop_playing;
_root.settings.flush();
}
};
Symbol 259 Button
on (release) {
getURL ("http://wecreatestuff.com", "blank");
}
Symbol 357 MovieClip Frame 1
stop();
Symbol 357 MovieClip Frame 2
stop();
Symbol 360 MovieClip Frame 1
stop();
Symbol 360 MovieClip Frame 2
stop();
Symbol 363 MovieClip Frame 1
stop();
Symbol 363 MovieClip Frame 2
stop();
Symbol 725 MovieClip Frame 35
stop();
Symbol 726 MovieClip Frame 1
stop();
Symbol 731 MovieClip Frame 2
stop();
Symbol 735 MovieClip Frame 1
stop();
Symbol 743 MovieClip Frame 1
stop();
Symbol 752 MovieClip Frame 1
stop();
Instance of Symbol 754 MovieClip "cam" in Symbol 756 MovieClip Frame 1
onClipEvent (load) {
rSpeed = 0;
accel = 2;
activ = 5;
Sa = 1000000 /* 0x0F4240 */;
Sb = 1000000 /* 0x0F4240 */;
}
onClipEvent (enterFrame) {
if (_root.running) {
if (_root.effects >= 1) {
dx0 = _parent._x;
dy0 = _parent._y;
if ((((_root.p1.xSpeed > activ) or (_root.p1.xSpeed < (-activ))) or (_root.p1.ySpeed > activ)) or (_root.p1.ySpeed < (-activ))) {
bfollow = 1;
dx1 = _root.p1._x;
dy1 = _root.p1._y - (_root.p1._height / 2);
}
if ((_root.maxb > 1) or (_root.maxn > 2)) {
if (_root.maxb > 1) {
b = 1;
while (b < _root.maxb) {
if (_root["b" + b]._x < (0 + _parent._x)) {
xscorea = Math.floor((-_root["b" + b]._x) + _parent._x);
} else {
xscorea = Math.floor(_root["b" + b]._x - _parent._x);
}
if (_root["b" + b]._y < (0 + _parent._y)) {
yscorea = Math.floor((-_root["b" + b]._y) + _parent._y);
} else {
yscorea = Math.floor(_root["b" + b]._y - _parent._y);
}
fscorea = yscorea + xscorea;
if (fscorea < (Sa + 1)) {
Sa = fscorea;
bfollow = b;
}
if (b == bfollow) {
Sa = fscorea;
}
b++;
}
}
if (_root.maxn > 2) {
n = 1;
while (n < _root.maxn) {
if ((((_root["p" + n].xSpeed > activ) or (_root["p" + n].xSpeed < (-activ))) or (_root["p" + n].ySpeed > activ)) or (_root["p" + n].ySpeed < (-activ))) {
if (_root["p" + n]._x < _parent._x) {
xscore = Math.floor((-_root["p" + n]._x) + _parent._x);
} else {
xscore = Math.floor(_root["p" + n]._x - _parent._x);
}
if (_root["p" + n]._y < _parent._y) {
yscore = Math.floor((-_root["p" + n]._y) + _parent._y);
} else {
yscore = Math.floor(_root["p" + n]._y - _parent._y);
}
fscoreb = yscore + xscore;
if (fscoreb < (Sb + 1)) {
Sb = fscoreb;
bfollow = n;
}
if (n == bfollow) {
Sb = fscoreb;
}
}
n++;
}
}
if ((_root.maxn > 2) and (_root.maxb > 1)) {
if (fscorea < fscoreb) {
dx1 = _root["b" + bfollow]._x;
dy1 = _root["b" + bfollow]._y;
} else {
dx1 = _root["p" + bfollow]._x;
dy1 = _root["p" + bfollow]._y;
}
} else if ((_root.maxn > 2) and (_root.maxb > false)) {
dx1 = _root["p" + bfollow]._x;
dy1 = _root["p" + bfollow]._y;
} else if ((_root.maxn > false) and (_root.maxb > 1)) {
dx1 = _root["b" + bfollow]._x;
dy1 = _root["b" + bfollow]._y;
}
}
d_dx = dx1 - dx0;
d_dy = dy1 - dy0;
angle = Math.floor(Math.atan2(d_dy, d_dx) / (Math.PI/180));
if (!(_rotation === angle)) {
if (angle < 0) {
if ((angle - _rotation) < -185) {
rSpeed = rSpeed + ((angle - _rotation) / 64);
} else if ((angle - _rotation) > -175) {
rSpeed = rSpeed - ((angle - _rotation) / 64);
}
} else if ((angle - _rotation) > 185) {
rSpeed = rSpeed + ((angle - _rotation) / 64);
} else if ((angle - _rotation) < 175) {
rSpeed = rSpeed - ((angle - _rotation) / 64);
}
if (rSpeed > 8) {
rSpeed = 8;
} else if (rSpeed < -8) {
rSpeed = -8;
}
rSpeed = rSpeed / 1.25;
_rotation = (_rotation + rSpeed);
}
} else {
dx0 = _parent._x;
dy0 = _parent._y;
dx1 = _root.p1._x;
dy1 = _root.p1._y;
d_dx = dx1 - dx0;
d_dy = dy1 - dy0;
angle = Math.floor(Math.atan2(d_dy, d_dx) / (Math.PI/180));
_rotation = (angle - 180);
}
}
}
Symbol 759 MovieClip Frame 26
stop();
Symbol 790 MovieClip Frame 10
stop();
Symbol 794 MovieClip Frame 10
stop();
Symbol 802 MovieClip Frame 1
stop();
Symbol 802 MovieClip Frame 20
gotoAndPlay (1);
Symbol 802 MovieClip Frame 39
gotoAndPlay (1);
Instance of Symbol 776 MovieClip "scndhnd" in Symbol 803 MovieClip Frame 1
/* no clip actions */
Instance of Symbol 802 MovieClip "wpn" in Symbol 803 MovieClip Frame 1
/* no clip actions */
Symbol 806 MovieClip Frame 11
stop();
Symbol 806 MovieClip Frame 32
gotoAndStop ("idle");
Symbol 809 MovieClip Frame 11
stop();
Symbol 809 MovieClip Frame 32
gotoAndStop ("idle");
Symbol 814 MovieClip Frame 1
stop();
Symbol 814 MovieClip Frame 2
stop();
Symbol 835 MovieClip Frame 2
if (_root.sounds) {
steps = new Sound();
steps.attachSound(["concrete" + Math.floor((Math.random() * 3) + 1)]);
steps.start();
}
Symbol 835 MovieClip Frame 11
if (_root.sounds) {
steps = new Sound();
steps.attachSound(["concrete" + Math.floor((Math.random() * 3) + 1)]);
steps.start();
}
Symbol 846 MovieClip Frame 8
if (_root.sounds) {
steps = new Sound();
steps.attachSound(["concrete" + Math.floor((Math.random() * 3) + 1)]);
steps.start();
}
Symbol 846 MovieClip Frame 18
if (_root.sounds) {
steps = new Sound();
steps.attachSound(["concrete" + Math.floor((Math.random() * 3) + 1)]);
steps.start();
}
Symbol 849 MovieClip Frame 2
stop();
Symbol 851 MovieClip Frame 2
stop();
Symbol 899 MovieClip Frame 1
if (_root.sounds) {
deathsound = new Sound();
deathsound.attachSound("zap");
deathsound.start();
}
Symbol 899 MovieClip Frame 9
if (_root.sounds) {
deathsound = new Sound();
deathsound.attachSound("ignite");
deathsound.start();
}
Symbol 899 MovieClip Frame 25
stop();
Symbol 929 MovieClip Frame 1
if (_root.sounds) {
deathsound = new Sound();
deathsound.attachSound("headshot");
deathsound.start();
}
Symbol 929 MovieClip Frame 7
Symbol 929 MovieClip Frame 20
if (_root.sounds) {
deathsound = new Sound();
deathsound.attachSound("flesh1");
deathsound.start();
}
Symbol 929 MovieClip Frame 77
if (_root.sounds) {
deathsound = new Sound();
deathsound.attachSound("flesh1");
deathsound.start();
}
Symbol 929 MovieClip Frame 81
stop();
Symbol 949 MovieClip Frame 1
if (_root.sounds) {
deathsound = new Sound();
deathsound.attachSound("bodyBreak");
deathsound.start();
}
Symbol 949 MovieClip Frame 40
stop();
Symbol 961 MovieClip Frame 13
stop();
Symbol 962 MovieClip Frame 1
if (_root.sounds) {
deathsound = new Sound();
deathsound.attachSound("disintegrate");
deathsound.start();
}
Symbol 962 MovieClip Frame 66
stop();
Symbol 963 MovieClip Frame 1
stop();
Instance of Symbol 776 MovieClip "scndhnd" in Symbol 963 MovieClip Frame 1
onClipEvent (enterFrame) {
if (_root.running) {
_rotation = (_rotation + (Math.floor((70 * Math.atan2(_ymouse, _xmouse)) / Math.PI) + 360));
if (_rotation > 89) {
_rotation = 89;
}
if (_rotation < -89) {
_rotation = -89;
}
}
}
Instance of Symbol 802 MovieClip "wpn" in Symbol 963 MovieClip Frame 1
onClipEvent (enterFrame) {
if (_root.running) {
_rotation = (_rotation + (Math.floor((70 * Math.atan2(_ymouse, _xmouse)) / Math.PI) + 360));
if (_rotation > 85) {
_rotation = 85;
}
if (_rotation < -85) {
_rotation = -85;
}
}
}
Symbol 974 MovieClip Frame 16
_parent.ready = true;
stop();
Symbol 979 MovieClip Frame 11
_parent.gotoAndStop("idle");
Symbol 983 MovieClip Frame 1
stop();
Symbol 1003 MovieClip Frame 31
stop();
Symbol 1007 MovieClip Frame 17
stop();
Symbol 1019 MovieClip Frame 1
stop();
this.onEnterFrame = function () {
if (Active and (_currentframe == 1)) {
this.play();
trace("active.");
}
};
Symbol 1019 MovieClip Frame 2
if (_root.sounds) {
ballout_s = new Sound();
ballout_s.attachSound("ballout_create");
ballout_s.start();
}
Symbol 1019 MovieClip Frame 34
stop();
Symbol 1037 MovieClip Frame 1
if (_root.sounds) {
createball_s = new Sound();
createball_s.attachSound(["createball" + Math.floor((Math.random() * 2) + 1)]);
createball_s.start();
}
Symbol 1037 MovieClip Frame 25
_parent.gotoAndStop("idle");
Symbol 1038 MovieClip Frame 1
stop();
Symbol 1045 MovieClip Frame 1
stop();
Symbol 1045 MovieClip Frame 49
stop();
Symbol 1048 MovieClip Frame 1
stop();
Instance of Symbol 1046 MovieClip "crusher" in Symbol 1048 MovieClip Frame 1
onClipEvent (load) {
maxSpeed = _parent.Speed;
Speed = 0;
Accel = 0.1;
startflag = false;
endflag = false;
}
onClipEvent (enterFrame) {
if (_root.running) {
if (Speed < maxSpeed) {
Speed = Speed + Accel;
}
if (_parent.Active) {
if (!startflag) {
if (_root.sounds) {
crusher1 = new Sound();
crusher1.attachSound("crusher_move1");
crusher1.start();
crusher2 = new Sound();
crusher2.attachSound("crusher_move2");
crusher2.start();
}
startflag = true;
}
if (!_parent.Done) {
this._y = this._y + Speed;
} else if (!endflag) {
_parent.Active = false;
this.smoke.play();
crusher1.stop("crusher_move1");
crusher2.stop("crusher_move2");
if (_root.sounds) {
crusher1 = new Sound();
crusher1.attachSound("crusher_stop1");
crusher1.start();
crusher2 = new Sound();
crusher2.attachSound("crusher_stop2");
crusher2.start();
}
endflag = true;
}
}
}
}
Symbol 1068 MovieClip Frame 1
stop();
Instance of Symbol 1064 MovieClip "lighton" in Symbol 1068 MovieClip Frame 1
onClipEvent (load) {
}
onClipEvent (enterFrame) {
if (_parent.Done) {
if (this._alpha < 100) {
this._alpha = this._alpha + 10;
}
} else if (this._alpha > 0) {
this._alpha = this._alpha - 10;
}
}
Instance of Symbol 1067 MovieClip "mover" in Symbol 1068 MovieClip Frame 1
onClipEvent (load) {
maxSpeed = _parent.Speed;
distance = _parent.Distance;
path = 0;
Speed = 0;
Accel = 0.05;
startflag = false;
endflag = false;
}
onClipEvent (enterFrame) {
if (_root.running) {
if (Speed < maxSpeed) {
Speed = Speed + Accel;
}
if (_parent.Active) {
if (!startflag) {
if (_root.sounds) {
wallmover = new Sound();
wallmover.attachSound("wallmover_start");
wallmover.start();
}
startflag = true;
}
if (!_parent.Done) {
this._x = this._x + Speed;
path = path + Speed;
if (path >= distance) {
_parent.Done = true;
}
} else if (!endflag) {
_parent.Active = false;
wallmover.stop("wallmover_start");
if (_root.sounds) {
wallmover = new Sound();
wallmover.attachSound("wallmover_stop");
wallmover.start();
}
endflag = true;
}
}
}
}
Instance of Symbol 1071 MovieClip "lighton" in Symbol 1072 MovieClip Frame 1
onClipEvent (enterFrame) {
if (_parent.Active) {
if (this._alpha < 100) {
this._alpha = this._alpha + 10;
}
} else if (this._alpha > 0) {
this._alpha = this._alpha - 10;
}
}
Symbol 1076 MovieClip Frame 1
stop();
Instance of Symbol 1074 MovieClip "red" in Symbol 1076 MovieClip Frame 1
onClipEvent (enterFrame) {
if (_parent.Pressing) {
this._y = this._y + ((-0.3 - this._y) / 5);
} else {
this._y = this._y + ((-6.3 - this._y) / 5);
}
}
Instance of Symbol 1064 MovieClip "lighton" in Symbol 1076 MovieClip Frame 1
onClipEvent (load) {
soundflag = false;
}
onClipEvent (enterFrame) {
if (_parent.Active) {
if (this._alpha < 100) {
this._alpha = this._alpha + 10;
}
if (!soundflag) {
if (_root.sounds) {
activator = new Sound();
activator.attachSound("btn_down");
activator.start();
}
soundflag = true;
}
} else {
if (this._alpha > 0) {
this._alpha = this._alpha - 10;
}
if (soundflag) {
if (_root.sounds) {
activator = new Sound();
activator.attachSound("btn_up");
activator.start();
}
soundflag = false;
}
}
}
Symbol 1079 MovieClip Frame 1
stop();
Symbol 1088 MovieClip Frame 1
if (_root.sounds) {
crusher1 = new Sound();
crusher1.attachSound("pod_open");
crusher1.start();
}
Symbol 1088 MovieClip Frame 24
if (_root.sounds) {
crusher1 = new Sound();
crusher1.attachSound("pod_open");
crusher1.start();
}
Symbol 1088 MovieClip Frame 35
_parent.gotoAndStop("idle");
Symbol 1089 MovieClip Frame 1
stop();
Symbol 1092 MovieClip Frame 1
if (_root.sounds) {
heartbeatsound = new Sound(this);
heartbeatsound.attachSound("heartbeat");
heartbeatsound.start();
heartbeatsound.setVolume(_root.cursor.bloodGlow._alpha);
}
Symbol 1100 MovieClip Frame 20
stop();
Symbol 1101 MovieClip Frame 1
stop();
Symbol 1108 MovieClip Frame 20
stop();
Symbol 1109 MovieClip Frame 1
stop();
Symbol 1110 MovieClip Frame 1
stop();
Symbol 1121 MovieClip Frame 26
stop();
Symbol 1132 MovieClip Frame 22
stop();
Symbol 1144 MovieClip Frame 25
stop();
Symbol 1160 MovieClip Frame 16
stop();
Symbol 1169 MovieClip Frame 1
stop();
Symbol 1187 MovieClip Frame 60
stop();
Symbol 1190 MovieClip Frame 1
stop();
Symbol 1200 MovieClip Frame 210
stop();
Symbol 1207 MovieClip Frame 2
stop();
Symbol 1210 MovieClip Frame 1
stop();
Symbol 1225 MovieClip Frame 440
_root.playingScene = false;
_root.nl_frame.play();
Symbol 1263 MovieClip Frame 2900
_root.exitToMainMenu();
Symbol 1264 MovieClip Frame 1
stop();
Symbol 1264 MovieClip Frame 3
credits.gotoAndPlay(660);
Symbol 1268 MovieClip Frame 1
stop();
_root.nextlevel_mc = false;
Symbol 1268 MovieClip Frame 10
stop();
_root.nextlevel_mc = true;
if ((_root.mapn - 1) == 0) {
levelText = "Launching project...";
} else if ((_root.mapn - 1) == 41) {
levelText = "Project is done.";
} else {
levelText = ("level " + (_root.mapn - 1)) + " completed.";
}
levelNumber = levelText;
Symbol 1268 MovieClip Frame 11
_root.nextlevel_mc = false;
_root.nextLevel2 = true;
Symbol 1268 MovieClip Frame 19
nl_frame._visible = false;
_root.running = true;
Symbol 1269 MovieClip Frame 1
stop();
Symbol 1269 MovieClip Frame 19
stop();
Symbol 1293 MovieClip Frame 1
stop();
window_exit._visible = false;
window_restart._visible = false;
window_options._visible = false;
menubtns.options.onRelease = function () {
if (window_options._visible == true) {
window_options._visible = false;
} else {
window_options._visible = true;
window_options._x = 20;
window_options._y = 0;
window_exit._visible = false;
window_restart._visible = false;
}
};
window_options.movable.onPress = function () {
startDrag (window_options);
};
window_options.movable.onRelease = function () {
stopDrag();
};
window_options.closeWin.onRelease = function () {
window_options._visible = false;
};
window_options.okBtn.onRelease = function () {
window_options._visible = false;
};
menubtns.restartLevel.onRelease = function () {
if (window_restart._visible == true) {
window_restart._visible = false;
} else {
window_restart._visible = true;
window_restart._x = 20;
window_restart._y = 0;
window_exit._visible = false;
window_options._visible = false;
}
};
window_restart.movable.onPress = function () {
startDrag (window_restart);
};
window_restart.movable.onRelease = function () {
stopDrag();
};
window_restart.closeWin.onRelease = function () {
window_restart._visible = false;
};
menubtns.exittomainmenu.onRelease = function () {
if (window_exit._visible == true) {
window_exit._visible = false;
} else {
window_exit._visible = true;
window_exit._x = 20;
window_exit._y = 40;
window_restart._visible = false;
window_options._visible = false;
}
};
window_exit.movable.onPress = function () {
startDrag (window_exit);
};
window_exit.movable.onRelease = function () {
stopDrag();
};
window_exit.closeWin.onRelease = function () {
window_exit._visible = false;
};
window_exit.no.onRelease = function () {
window_exit._visible = false;
};
window_exit.yes.onRelease = function () {
_root.console._visible = false;
_root.exitToMainMenu();
};
window_restart.no.onRelease = function () {
window_restart._visible = false;
};
window_restart.yes.onRelease = function () {
window_restart._visible = false;
_root.console._visible = false;
_root.pauseMenu._visible = false;
_root.running = true;
_root.restartLevel();
};
menubtns.resumegame.onRelease = function () {
window_exit._visible = false;
window_options._visible = false;
window_restart._visible = false;
_root.console._visible = false;
_root.pauseMenu._visible = false;
_root.running = true;
};
menubtns.playmoregames.onRelease = function () {
getURL ("http://www.armorgames.com", "_blank");
};
Symbol 1301 MovieClip Frame 1
submitbtn.onRelease = function () {
_root.consoleCommandCheck(insertTxt);
Selection.setFocus("_root.console.insertTxt");
};
Instance of Symbol 28 MovieClip [TextScroller] in Symbol 1301 MovieClip Frame 1
//component parameters
onClipEvent (construct) {
autoHide = false;
fixThumbAtEnd = false;
horizontal = false;
skin = "pele";
_targetInstanceName = "consoleTxt1";
}