Frame 1
loadingPercent = getBytesLoaded() / getBytesTotal();
loadingBar._width = loadingPercent * 630.1;
loadingText.text = Math.round(loadingPercent * 100) + "%";
Frame 2
if (loadingPercent >= 1) {
gotoAndStop ("intro");
} else {
gotoAndPlay (1);
}
Frame 3
stopAllSounds();
Frame 6
function displayText() {
seeVars.blendMode = "invert";
seeVars.txt1.text = "";
seeVars.txt2.text = "";
}
function lastLevel() {
}
function noFun() {
}
function onEnterFrame() {
customCursor();
}
function customCursor() {
cursor.gotoAndStop(1);
cursor._x = _xmouse;
cursor._y = _ymouse;
cursor._rotation = cursor._rotation + 3;
}
stop();
Mouse.hide();
gamePaused = false;
gray_so = SharedObject.getLocal("gray");
if (gray_so.data.lvlsavailable == undefined) {
gray_so.data.lvlsavailable = 1;
gray_so.data.totalJumps = 0;
gray_so.data.totalLines = 0;
gray_so.data.totalDeaths = 0;
gray_so.data.bestTime = Infinity;
gray_so.data.totalTimer = 0;
gray_so.data.musicOff = false;
gray_so.data.springlessunlocked = false;
gray_so.data.artistachunlocked = false;
gray_so.data.allcheatsunlocked = false;
gray_so.data.soiherdunlocked = false;
gray_so.data.ravemeisterunlocked = false;
gray_so.data.stillaliveunlocked = false;
gray_so.data.overachieverunlocked = false;
achpopup.startthegame._visible = true;
achpopup.gotoAndPlay("start");
gray_so.data.lvl3noJump = false;
gray_so.data.lvl4noJump = false;
gray_so.data.lvl5noJump = false;
gray_so.data.lvl6noJump = false;
gray_so.data.lvl7noJump = false;
gray_so.data.lvl8noJump = false;
gray_so.data.lvl9noJump = false;
gray_so.data.lvl10noJump = false;
gray_so.data.lvl11noJump = false;
gray_so.data.lvl13noJump = false;
gray_so.data.lvl6leastLines = false;
gray_so.data.lvl7leastLines = false;
gray_so.data.lvl8leastLines = false;
gray_so.data.lvl9leastLines = false;
gray_so.data.lvl10leastLines = false;
gray_so.data.lvl11leastLines = false;
gray_so.data.lvl12leastLines = false;
gray_so.data.lvl13leastLines = false;
gray_so.data.lvl14leastLines = false;
gray_so.data.lvl6leastLinesPlayer = 100;
gray_so.data.lvl7leastLinesPlayer = 100;
gray_so.data.lvl8leastLinesPlayer = 100;
gray_so.data.lvl9leastLinesPlayer = 100;
gray_so.data.lvl10leastLinesPlayer = 100;
gray_so.data.lvl11leastLinesPlayer = 100;
gray_so.data.lvl12leastLinesPlayer = 100;
gray_so.data.lvl13leastLinesPlayer = 100;
gray_so.data.lvl14leastLinesPlayer = 100;
}
mudkipcheat = false;
outlineCheat = false;
magecheat = false;
noJumpMode = false;
leastLinesMode = false;
deathsThisTime = Infinity;
timer = Infinity;
timerPart = Infinity;
var myMenu_cm = new ContextMenu();
myMenu_cm.hideBuiltInItems();
var newItem1_cmi = new ContextMenuItem("No Right Click Exploits!", lastLevel);
var newItem2_cmi = new ContextMenuItem("Eric Kasper - All Rights Reserved", noFun);
newItem1_cmi.enabled = false;
newItem2_cmi.enabled = false;
newItem2_cmi.separatorBefore = true;
myMenu_cm.customItems.push(newItem1_cmi, newItem2_cmi);
_root.menu = myMenu_cm;
function changeSong() {
chooseMusic++;
if (chooseMusic > 2) {
chooseMusic = 0;
}
levelsound.stop();
if (_root.raveLights._visible == false) {
if (chooseMusic == 0) {
levelsound.attachSound("levelMusic");
} else if (chooseMusic == 1) {
levelsound.attachSound("levelMusic2");
} else if (chooseMusic == 2) {
levelsound.attachSound("levelMusic3");
}
} else {
levelsound.attachSound("raveMusic");
}
levelsound.start();
levelMusicOn = true;
}
function music() {
if (levelsound.position >= (levelsound.duration - 1)) {
changeSong();
}
}
musicOff = false;
levelMusicOn = false;
levelsound.stop();
levelsound = new Sound(this);
menusound = new Sound(this);
menusound.attachSound("menuMusic");
menusound.start(0, 9999);
chooseMusic = -1;
if (gray_so.data.musicOff == true) {
_root.levelsound.setVolume(0);
_root.menusound.setVolume(0);
} else if (gray_so.data.musicOff == false) {
_root.levelsound.setVolume(100);
_root.menusound.setVolume(100);
}
Instance of Symbol 38 MovieClip "bwhite" in Frame 6
onClipEvent (enterFrame) {
if (_root.gamePaused == false) {
play();
} else {
stop();
}
}
Instance of Symbol 110 MovieClip "achpopup" in Frame 6
onClipEvent (enterFrame) {
if (((((((((_root.gray_so.data.springlessunlocked == true) && (_root.gray_so.data.artistachunlocked == true)) && (_root.gray_so.data.allcheatsunlocked == true)) && (_root.gray_so.data.soiherdunlocked == true)) && (_root.gray_so.data.ravemeisterunlocked == true)) && (_root.gray_so.data.stillaliveunlocked == true)) && (_root.gray_so.data.totalLines >= 900)) && (_root.gray_so.data.totalDeaths >= 100)) && (_root.gray_so.data.overachieverunlocked == false)) {
_root.gray_so.data.overachieverunlocked = true;
_root.achpopup.overachiever._visible = true;
_root.achpopup.gotoAndPlay("start");
}
}
Frame 7
function onEnterFrame() {
customCursor();
if (gray_so.data.lvlsavailable >= 1) {
lvl1button._visible = true;
}
}
function customCursor() {
cursor.gotoAndStop(terrainVar);
cursor._x = _xmouse;
cursor._y = _ymouse;
cursor._rotation = cursor._rotation + 3;
}
stop();
Mouse.hide();
lvlbetabutton._visible = false;
lvl1button._visible = false;
lvl2button._visible = false;
lvl3button._visible = false;
lvl4button._visible = false;
lvl5button._visible = false;
lvl6button._visible = false;
lvl7button._visible = false;
lvl8button._visible = false;
lvl9button._visible = false;
lvl10button._visible = false;
lvl11button._visible = false;
lvl12button._visible = false;
lvl13button._visible = false;
lvl14button._visible = false;
if (gray_so.data.lvlsavailable >= 1) {
lvl1button._visible = true;
}
if (gray_so.data.lvlsavailable >= 2) {
lvl2button._visible = true;
}
if (gray_so.data.lvlsavailable >= 3) {
lvl3button._visible = true;
}
if (gray_so.data.lvlsavailable >= 4) {
lvl4button._visible = true;
}
if (gray_so.data.lvlsavailable >= 5) {
lvl5button._visible = true;
}
if (gray_so.data.lvlsavailable >= 6) {
lvl6button._visible = true;
}
if (gray_so.data.lvlsavailable >= 7) {
lvl7button._visible = true;
}
if (gray_so.data.lvlsavailable >= 8) {
lvl8button._visible = true;
}
if (gray_so.data.lvlsavailable >= 9) {
lvl9button._visible = true;
}
if (gray_so.data.lvlsavailable >= 10) {
lvl10button._visible = true;
}
if (gray_so.data.lvlsavailable >= 11) {
lvl11button._visible = true;
}
if (gray_so.data.lvlsavailable >= 12) {
lvl12button._visible = true;
}
if (gray_so.data.lvlsavailable >= 13) {
lvl13button._visible = true;
}
if (gray_so.data.lvlsavailable >= 14) {
lvl14button._visible = true;
}
if (gray_so.data.lvlsavailable >= 100) {
lvlbetabutton._visible = true;
}
Frame 8
function onEnterFrame() {
customCursor();
}
function customCursor() {
cursor.gotoAndStop(1);
cursor._x = _xmouse;
cursor._y = _ymouse;
cursor._rotation = cursor._rotation + 3;
}
if (gray_so.data.totalDeaths <= 99) {
regachievements.dontfearthereaper._alpha = 70;
}
if (gray_so.data.totalLines <= 900) {
regachievements.over9000._alpha = 70;
}
if (gray_so.data.allcheatsunlocked == false) {
regachievements.tehh4xcheatz._alpha = 70;
}
if (gray_so.data.springlessunlocked == false) {
regachievements.springless._alpha = 70;
}
if (gray_so.data.artistachunlocked == false) {
regachievements.artistach._alpha = 70;
}
if (gray_so.data.soiherdunlocked == false) {
regachievements.soiherd._alpha = 70;
}
if (gray_so.data.ravemeisterunlocked == false) {
regachievements.ravemeister._alpha = 70;
}
if (gray_so.data.stillaliveunlocked == false) {
regachievements.stillalive._alpha = 70;
}
if (gray_so.data.overachieverunlocked == false) {
regachievements.overachiever._alpha = 70;
}
Frame 9
if (gray_so.data.springlessunlocked == false) {
if (gray_so.data.lvl3noJump == true) {
if (gray_so.data.lvl4noJump == true) {
if (gray_so.data.lvl5noJump == true) {
if (gray_so.data.lvl6noJump == true) {
if (gray_so.data.lvl7noJump == true) {
if (gray_so.data.lvl8noJump == true) {
if (gray_so.data.lvl9noJump == true) {
if (gray_so.data.lvl10noJump == true) {
if (gray_so.data.lvl11noJump == true) {
if (gray_so.data.lvl13noJump == true) {
achpopup.springless._visible = true;
achpopup.gotoAndPlay("start");
gray_so.data.springlessunlocked = true;
}
}
}
}
}
}
}
}
}
}
}
if (gray_so.data.lvl3noJump == true) {
lvl3box.gotoAndStop(2);
}
if (gray_so.data.lvl4noJump == true) {
lvl4box.gotoAndStop(2);
}
if (gray_so.data.lvl5noJump == true) {
lvl5box.gotoAndStop(2);
}
if (gray_so.data.lvl6noJump == true) {
lvl6box.gotoAndStop(2);
}
if (gray_so.data.lvl7noJump == true) {
lvl7box.gotoAndStop(2);
}
if (gray_so.data.lvl8noJump == true) {
lvl8box.gotoAndStop(2);
}
if (gray_so.data.lvl9noJump == true) {
lvl9box.gotoAndStop(2);
}
if (gray_so.data.lvl10noJump == true) {
lvl10box.gotoAndStop(2);
}
if (gray_so.data.lvl11noJump == true) {
lvl11box.gotoAndStop(2);
}
if (gray_so.data.lvl13noJump == true) {
lvl13box.gotoAndStop(2);
}
lvlbetabutton._visible = false;
lvl1button._visible = false;
lvl2button._visible = false;
lvl3button._visible = false;
lvl4button._visible = false;
lvl5button._visible = false;
lvl6button._visible = false;
lvl7button._visible = false;
lvl8button._visible = false;
lvl9button._visible = false;
lvl10button._visible = false;
lvl11button._visible = false;
lvl12button._visible = false;
lvl13button._visible = false;
lvl14button._visible = false;
if (gray_so.data.lvlsavailable >= 1) {
lvl1button._visible = true;
}
if (gray_so.data.lvlsavailable >= 2) {
lvl2button._visible = true;
}
if (gray_so.data.lvlsavailable >= 3) {
lvl3button._visible = true;
}
if (gray_so.data.lvlsavailable >= 4) {
lvl4button._visible = true;
}
if (gray_so.data.lvlsavailable >= 5) {
lvl5button._visible = true;
}
if (gray_so.data.lvlsavailable >= 6) {
lvl6button._visible = true;
}
if (gray_so.data.lvlsavailable >= 7) {
lvl7button._visible = true;
}
if (gray_so.data.lvlsavailable >= 8) {
lvl8button._visible = true;
}
if (gray_so.data.lvlsavailable >= 9) {
lvl9button._visible = true;
}
if (gray_so.data.lvlsavailable >= 10) {
lvl10button._visible = true;
}
if (gray_so.data.lvlsavailable >= 11) {
lvl11button._visible = true;
}
if (gray_so.data.lvlsavailable >= 12) {
lvl12button._visible = true;
}
if (gray_so.data.lvlsavailable >= 13) {
lvl13button._visible = true;
}
if (gray_so.data.lvlsavailable >= 14) {
lvl14button._visible = true;
}
if (gray_so.data.lvlsavailable >= 100) {
lvlbetabutton._visible = true;
}
Frame 10
function displayText() {
seeVars.blendMode = "invert";
seeVars.txt1.text = "";
seeVars.txt2.text = levelLinesPlayer + " lines";
}
function onEnterFrame() {
customCursor();
linesToBeatbox.text = currentOverLinesToBeatVar;
bestTrybox.text = currentOverBestTryVar;
}
if (gray_so.data.lvl6leastLinesPlayer <= 1) {
gray_so.data.lvl6leastLines = true;
}
if (gray_so.data.lvl7leastLinesPlayer <= 2) {
gray_so.data.lvl7leastLines = true;
}
if (gray_so.data.lvl8leastLinesPlayer <= 1) {
gray_so.data.lvl8leastLines = true;
}
if (gray_so.data.lvl9leastLinesPlayer <= 3) {
gray_so.data.lvl9leastLines = true;
}
if (gray_so.data.lvl10leastLinesPlayer <= 4) {
gray_so.data.lvl10leastLines = true;
}
if (gray_so.data.lvl11leastLinesPlayer <= 7) {
gray_so.data.lvl11leastLines = true;
}
if (gray_so.data.lvl12leastLinesPlayer <= 4) {
gray_so.data.lvl12leastLines = true;
}
if (gray_so.data.lvl13leastLinesPlayer <= 6) {
gray_so.data.lvl13leastLines = true;
}
if (gray_so.data.lvl14leastLinesPlayer <= 5) {
gray_so.data.lvl14leastLines = true;
}
levelLinesPlayer = 0;
if (gray_so.data.lvl6leastLines == true) {
lvl6box.gotoAndStop(2);
}
if (gray_so.data.lvl7leastLines == true) {
lvl7box.gotoAndStop(2);
}
if (gray_so.data.lvl8leastLines == true) {
lvl8box.gotoAndStop(2);
}
if (gray_so.data.lvl9leastLines == true) {
lvl9box.gotoAndStop(2);
}
if (gray_so.data.lvl10leastLines == true) {
lvl10box.gotoAndStop(2);
}
if (gray_so.data.lvl11leastLines == true) {
lvl11box.gotoAndStop(2);
}
if (gray_so.data.lvl12leastLines == true) {
lvl12box.gotoAndStop(2);
}
if (gray_so.data.lvl13leastLines == true) {
lvl13box.gotoAndStop(2);
}
if (gray_so.data.lvl14leastLines == true) {
lvl14box.gotoAndStop(2);
}
if (gray_so.data.artistachunlocked == false) {
if (gray_so.data.lvl6leastLines == true) {
if (gray_so.data.lvl7leastLines == true) {
if (gray_so.data.lvl8leastLines == true) {
if (gray_so.data.lvl9leastLines == true) {
if (gray_so.data.lvl10leastLines == true) {
if (gray_so.data.lvl11leastLines == true) {
if (gray_so.data.lvl12leastLines == true) {
if (gray_so.data.lvl13leastLines == true) {
if (gray_so.data.lvl14leastLines == true) {
achpopup.artistach._visible = true;
achpopup.gotoAndPlay("start");
gray_so.data.artistachunlocked = true;
}
}
}
}
}
}
}
}
}
}
lvl6playerBox.text = gray_so.data.lvl6leastLinesPlayer;
lvl7playerBox.text = gray_so.data.lvl7leastLinesPlayer;
lvl8playerBox.text = gray_so.data.lvl8leastLinesPlayer;
lvl9playerBox.text = gray_so.data.lvl9leastLinesPlayer;
lvl10playerBox.text = gray_so.data.lvl10leastLinesPlayer;
lvl11playerBox.text = gray_so.data.lvl11leastLinesPlayer;
lvl12playerBox.text = gray_so.data.lvl12leastLinesPlayer;
lvl13playerBox.text = gray_so.data.lvl13leastLinesPlayer;
lvl14playerBox.text = gray_so.data.lvl14leastLinesPlayer;
seeVars._visible = true;
currentOverLinesToBeatVar = "";
currentOverBestTryVar = "";
lvlbetabutton._visible = false;
lvl1button._visible = false;
lvl2button._visible = false;
lvl3button._visible = false;
lvl4button._visible = false;
lvl5button._visible = false;
lvl6button._visible = false;
lvl7button._visible = false;
lvl8button._visible = false;
lvl9button._visible = false;
lvl10button._visible = false;
lvl11button._visible = false;
lvl12button._visible = false;
lvl13button._visible = false;
lvl14button._visible = false;
if (gray_so.data.lvlsavailable >= 1) {
lvl1button._visible = true;
}
if (gray_so.data.lvlsavailable >= 2) {
lvl2button._visible = true;
}
if (gray_so.data.lvlsavailable >= 3) {
lvl3button._visible = true;
}
if (gray_so.data.lvlsavailable >= 4) {
lvl4button._visible = true;
}
if (gray_so.data.lvlsavailable >= 5) {
lvl5button._visible = true;
}
if (gray_so.data.lvlsavailable >= 6) {
lvl6button._visible = true;
}
if (gray_so.data.lvlsavailable >= 7) {
lvl7button._visible = true;
}
if (gray_so.data.lvlsavailable >= 8) {
lvl8button._visible = true;
}
if (gray_so.data.lvlsavailable >= 9) {
lvl9button._visible = true;
}
if (gray_so.data.lvlsavailable >= 10) {
lvl10button._visible = true;
}
if (gray_so.data.lvlsavailable >= 11) {
lvl11button._visible = true;
}
if (gray_so.data.lvlsavailable >= 12) {
lvl12button._visible = true;
}
if (gray_so.data.lvlsavailable >= 13) {
lvl13button._visible = true;
}
if (gray_so.data.lvlsavailable >= 14) {
lvl14button._visible = true;
}
if (gray_so.data.lvlsavailable >= 100) {
lvlbetabutton._visible = true;
}
Frame 12
statsArrow._rotation = -(random(41) + 20);
Frame 14
function onMouseDown() {
if (terrainVar == 1) {
createEmptyMovieClip("terrain1", platforms.getDepth() - 2);
terrain1.lineStyle(25, 3355443, 100);
if (imdrawing == false) {
terrain1.moveTo(_xmouse, _ymouse);
imdrawing = true;
}
} else if (terrainVar == 2) {
createEmptyMovieClip("terrain2", platforms.getDepth() - 1);
terrain2.lineStyle(25, 6710886, 100);
if (imdrawing == false) {
terrain2.moveTo(_xmouse, _ymouse);
imdrawing = true;
}
}
}
function onMouseUp() {
imdrawing = false;
}
function onEnterFrame() {
wallClinging = false;
xVar = man._x;
yVar = man._y;
testVar = ySpeed + yUp;
pauseGame();
customCursor();
if (gamePaused == false) {
Drawing();
man._x = man._x + xSpeed;
man._y = man._y + ySpeed;
manCollision();
moveScreen();
if (dead == false) {
if (fader._alpha > 0) {
fader._alpha = fader._alpha - 2;
}
kick();
manJump(-20);
managemanSprite();
onGround();
manageColor();
suicide();
if ((Key.isDown(68) && (dodging == false)) && (wallClinging == false)) {
xSpeed = runSpeed;
} else if ((Key.isDown(65) && (dodging == false)) && (wallClinging == false)) {
xSpeed = -runSpeed;
} else if (((!Key.isDown(65)) && (!Key.isDown(68))) && (dodging == false)) {
xSpeed = 0;
}
} else {
man.sprite.gotoAndStop(4);
xSpeed = 0;
}
if (((man._x + xSpeed) > Stage.width) or ((man._x + xSpeed) < 0)) {
xSpeed = xSpeed - xSpeed;
} else if (dead == true) {
if (fader._alpha < 100) {
fader._alpha = fader._alpha + 5;
}
if (fader._alpha >= 100) {
dead = false;
man.sprite.gotoAndStop(1);
platforms._x = platx;
platforms._y = platy;
man._x = manx;
man._y = many;
}
}
}
}
function managemanSprite() {
if ((man.sprite._currentframe != 4) && (attack == false)) {
if ((air == false) && (wallClinging == false)) {
if (((Key.isDown(68) == false) && (Key.isDown(65) == false)) && (dodging == false)) {
man.sprite.gotoAndStop(1);
} else if (((Key.isDown(68) == true) && (dodging == false)) or ((Key.isDown(65) == true) && (dodging == false))) {
if (Key.isDown(68) && (dodging == false)) {
man.sprite._xscale = manXScale;
} else if (Key.isDown(65) && (dodging == false)) {
man.sprite._xscale = -manXScale;
}
man.sprite.gotoAndStop(2);
}
} else if (((air == true) && (dodging == false)) && (wallClinging == false)) {
man.sprite.gotoAndStop(3);
} else if (wallClinging == true) {
man.sprite.gotoAndStop(6);
}
} else if ((man.sprite._currentframe != 4) && (attack == true)) {
if (kicking == true) {
man.sprite.gotoAndStop(7);
}
}
}
function manageColor() {
if (man.sprite._xscale == (-manXScale)) {
man.sprite.bwhite.blendMode = "invert";
} else if (man.sprite._xscale == manXScale) {
man.sprite.bwhite.blendMode = "alpha";
}
}
function manJump(jumpHeight) {
if (((((Key.isDown(87) && (jumpKeySwitch == false)) && (doubleJump < 2)) && (noJump == false)) or (((wallClinging == true) && (man.sprite._xscale == manXScale)) && (Key.isDown(39)))) or (((wallClinging == true) && (man.sprite._xscale == (-manXScale))) && (Key.isDown(37)))) {
jumpKeySwitch = true;
jumping = true;
doubleJump++;
air = true;
yUp = 0;
wallClinging = false;
gravity = 2;
man.sprite.stickJump.play();
man.sprite.bwhite.play();
man.sprite.outline.play();
if (ySpeed > -5) {
ySpeed = jumpHeight;
}
} else if (Key.isDown(87) == false) {
jumpKeySwitch = false;
}
}
function onGround() {
if (((platforms.hitTest(man._x + _x, ((man._y + 38) - yUp) + _y, true) or terrain1.hitTest(man._x + _x, ((man._y + 38) - yUp) + _y, true)) or terrain2.hitTest(man._x + _x, ((man._y + 38) - yUp) + _y, true)) or (wallClinging == true)) {
gravity = 2;
jumping = false;
air = false;
doubleJump = -Infinity;
} else {
air = true;
man._rotation = 0;
if (Key.isDown(40)) {
gravity = 20;
}
if ((ySpeed < 15) or (Key.isDown(40) && (ySpeed < 20))) {
ySpeed = ySpeed + gravity;
}
}
}
function manCollision() {
yUp = 0;
while ((platforms.hitTest(man._x + _x, (((man._y + 35) + yUp) + _y) - 4, true) or terrain1.hitTest(man._x + _x, (((man._y + 35) + yUp) + _y) - 4, true)) or terrain2.hitTest(man._x + _x, (((man._y + 35) + yUp) + _y) - 4, true)) {
yUp--;
if (manstate == 4) {
if ((yUp < rotVar) && (man.sprite._xscale == (-manXScale))) {
man._rotation = (-(yUp - rotVar)) * 3;
} else if ((yUp > rotVar) && (man.sprite._xscale == manXScale)) {
man._rotation = (yUp - rotVar) * 3;
} else if ((yUp > rotVar) && (man.sprite._xscale == (-manXScale))) {
man._rotation = (-(yUp - rotVar)) * 3;
} else if ((yUp < rotVar) && (man.sprite._xscale == manXScale)) {
man._rotation = (yUp - rotVar) * 3;
}
} else if ((((!Key.isDown(39)) && (!Key.isDown(37))) && (air == false)) or (jumping == true)) {
rotVar = yUp;
}
}
man._y = man._y + yUp;
collideVar = yUp - rotVar;
while (((((platforms.hitTest((man._x + xSpeed) + _x, man._y + _y, true) or platforms.hitTest((man._x + xSpeed) + _x, man._y + _y, true)) or terrain1.hitTest((man._x + xSpeed) + _x, man._y + _y, true)) or terrain1.hitTest((man._x + xSpeed) + _x, man._y + _y, true)) or terrain2.hitTest((man._x + xSpeed) + _x, man._y + _y, true)) or terrain2.hitTest((man._x + xSpeed) + _x, man._y + _y, true)) {
man._x = man._x - xSpeed;
noJump = true;
}
while ((platforms.hitTest((man._x + runSpeed) + _x, man._y + _y, true) or terrain1.hitTest((man._x + runSpeed) + _x, man._y + _y, true)) or terrain2.hitTest((man._x + runSpeed) + _x, man._y + _y, true)) {
man._x = man._x - runSpeed;
noJump = true;
}
while ((platforms.hitTest((man._x - runSpeed) + _x, man._y + _y, true) or terrain1.hitTest((man._x - runSpeed) + _x, man._y + _y, true)) or terrain2.hitTest((man._x - runSpeed) + _x, man._y + _y, true)) {
man._x = man._x + runSpeed;
noJump = true;
}
if ((platforms.hitTest(man._x + _x, (man._y - 40) + _y, true) or terrain1.hitTest(man._x + _x, (man._y - 40) + _y, true)) or terrain2.hitTest(man._x + _x, (man._y - 40) + _y, true)) {
noJump = true;
if (ySpeed < 0) {
ySpeed = ySpeed - ySpeed;
}
} else {
noJump = false;
}
}
function moveScreen() {
if (man._x > (Stage.width - 250)) {
platforms._x = platforms._x - runSpeed;
terrain1._x = terrain1._x - runSpeed;
terrain2._x = terrain2._x - runSpeed;
man._x = man._x - runSpeed;
}
if (man._x < 250) {
platforms._x = platforms._x + runSpeed;
terrain1._x = terrain1._x + runSpeed;
terrain2._x = terrain2._x + runSpeed;
man._x = man._x + runSpeed;
}
if (((man._y + ySpeed) + yUp) > (Stage.height - 150)) {
platforms._y = platforms._y - (ySpeed + yUp);
terrain1._y = terrain1._y - (ySpeed + yUp);
terrain2._y = terrain2._y - (ySpeed + yUp);
man._y = man._y - (ySpeed + yUp);
}
if (((man._y + ySpeed) + yUp) < 200) {
platforms._y = platforms._y - (ySpeed + yUp);
terrain1._y = terrain1._y - (ySpeed + yUp);
terrain2._y = terrain2._y - (ySpeed + yUp);
man._y = man._y - (ySpeed + yUp);
}
}
function customCursor() {
cursor.gotoAndStop(terrainVar);
cursor._x = _xmouse;
cursor._y = _ymouse;
cursor._rotation = cursor._rotation + 3;
}
function wallCling() {
if ((platforms.hitTest(((man._x + xSpeed) + 16) + _x, (man._y - 60) + _y, true) && (air == true)) && (Key.isDown(39))) {
man.sprite._xscale = -manXScale;
wallClinging = true;
air = false;
ySpeed = 0;
doubleJump = 0;
} else if ((platforms.hitTest(((man._x + xSpeed) - 16) + _x, man._y + _y, true) && (air == true)) && (Key.isDown(37))) {
man.sprite._xscale = manXScale;
wallClinging = true;
air = false;
ySpeed = 0;
doubleJump = 0;
}
if ((air == true) or Key.isDown(40)) {
wallClinging = false;
}
}
function Drawing() {
if (((terrainVar == 1) && (imdrawing == true)) && (!man.nodrawhitbox.hitTest(_xmouse, _ymouse, true))) {
if (((air == false) && (!Key.isDown(65))) && (!Key.isDown(68))) {
terrain1.lineTo(_xmouse, _ymouse);
}
} else if (((terrainVar == 2) && (imdrawing == true)) && (!man.nodrawhitbox.hitTest(_xmouse, _ymouse, true))) {
if (((air == false) && (!Key.isDown(65))) && (!Key.isDown(68))) {
terrain2.lineTo(_xmouse, _ymouse);
}
}
if (imdrawing == true) {
if (((air == true) or Key.isDown(65)) or Key.isDown(68)) {
imdrawing = false;
}
if (man.nodrawhitbox.hitTest(_xmouse, _ymouse, true)) {
imdrawing = false;
}
}
if (Key.isDown(69) && (terrainKeySwitch == false)) {
terrainVar = terrainVar + 1;
terrainKeySwitch = true;
} else if (!Key.isDown(69)) {
terrainKeySwitch = false;
}
if (terrainVar > 2) {
terrainVar = 1;
}
}
function manDodge() {
if (((Key.isDown(40) && (Key.isDown(68))) && (dodgeSwitch == false)) && (wallClinging == false)) {
dodging = "right";
dodgeSwitch = true;
} else if (((Key.isDown(40) && (Key.isDown(65))) && (dodgeSwitch == false)) && (wallClinging == false)) {
dodging = "left";
dodgeSwitch = true;
}
if (dodging == "right") {
man.sprite._xscale = manXScale;
man.sprite.gotoAndStop(5);
xSpeed = 25;
dodgeSwitch == true;
} else if (dodging == "left") {
man.sprite._xscale = -manXScale;
man.sprite.gotoAndStop(5);
xSpeed = -25;
dodgeSwitch == true;
}
if (!Key.isDown(40)) {
dodgeSwitch = false;
}
}
function kick() {
if (Key.isDown(32) && (kickKeySwitch == false)) {
attack = true;
kicking = true;
kickKeySwitch = true;
} else if (!Key.isDown(32)) {
kickKeySwitch = false;
}
}
function suicide() {
if (Key.isDown(13) && (suicideSwitch == false)) {
dead = true;
suicideSwitch = true;
}
if (!Key.isDown(13)) {
suicideSwitch = false;
}
}
function pauseGame() {
if (((Key.isDown(80) && (pauseSwitch == false)) && (gamePaused == false)) && (dead == false)) {
gamePaused = true;
pauseScreen._visible = true;
inverter._visible = true;
pauseSwitch = true;
} else if ((Key.isDown(80) && (pauseSwitch == false)) && (gamePaused == true)) {
gamePaused = false;
pauseScreen._visible = false;
inverter._visible = false;
pauseSwitch = true;
} else if (!Key.isDown(80)) {
pauseSwitch = false;
}
}
stop();
pauseScreen._visible = false;
inverter._visible = false;
Mouse.hide();
platx = platforms._x;
platy = platforms._y;
manx = man._x;
many = man._y;
dead = false;
gamePaused = false;
dodging = false;
var attack = false;
var kicking = false;
var manstate = 1;
var runSpeed = 15;
var xSpeed = 0;
var ySpeed = 0;
var jumping = false;
var jumpKeySwitch = false;
var manXScale = man.sprite._xscale;
var gravity = 2;
var color = new Color("_root.man");
var imdrawing = false;
var terrainVar = 1;
Frame 15
function onMouseDown() {
if ((terrainVar == 1) && (gamePaused == false)) {
createEmptyMovieClip("terrain1", man.getDepth() - 1);
terrain1.lineStyle(40, 3355443, 100);
if (imdrawing == false) {
terrain1.moveTo(_xmouse, _ymouse);
imdrawing = true;
xMouseStart = _xmouse;
yMouseStart = _ymouse;
}
} else if ((terrainVar == 2) && (gamePaused == false)) {
createEmptyMovieClip("terrain2", man.getDepth() - 2);
terrain2.lineStyle(40, 6710886, 100);
if (imdrawing == false) {
terrain2.moveTo(_xmouse, _ymouse);
imdrawing = true;
xMouseStart = _xmouse;
yMouseStart = _ymouse;
}
}
}
function Drawing() {
if (((terrainVar == 1) && (imdrawing == true)) && (!man.nodrawhitbox.hitTest(_xmouse, _ymouse, true))) {
if (((air == false) && (!Key.isDown(65))) && (!Key.isDown(68))) {
terrain1.lineTo(_xmouse, _ymouse);
}
} else if (((terrainVar == 2) && (imdrawing == true)) && (!man.nodrawhitbox.hitTest(_xmouse, _ymouse, true))) {
if (((air == false) && (!Key.isDown(65))) && (!Key.isDown(68))) {
terrain2.lineTo(_xmouse, _ymouse);
}
}
if (imdrawing == false) {
lineDrawed = false;
}
if (imdrawing == true) {
if ((((_xmouse != xMouseStart) && (lineDrawed == false)) && (terrainVar == 1)) or (((_ymouse != yMouseStart) && (lineDrawed == false)) && (terrainVar == 1))) {
line1Drawn = true;
lineDrawed = true;
gray_so.data.totalLines++;
levelLinesPlayer++;
} else if (((_xmouse == xMouseStart) && (_ymouse == yMouseStart)) && (terrainVar == 1)) {
line1Drawn = false;
lineDrawed = false;
}
if ((((_xmouse != xMouseStart) && (lineDrawed == false)) && (terrainVar == 2)) or (((_ymouse != yMouseStart) && (lineDrawed == false)) && (terrainVar == 2))) {
line2Drawn = true;
lineDrawed = true;
gray_so.data.totalLines++;
levelLinesPlayer++;
} else if (((_xmouse == xMouseStart) && (_ymouse == yMouseStart)) && (terrainVar == 2)) {
line2Drawn = false;
lineDrawed = false;
}
if ((((air == true) or Key.isDown(65)) or Key.isDown(68)) or (gamePaused == true)) {
imdrawing = false;
}
if (man.nodrawhitbox.hitTest(_xmouse, _ymouse, true)) {
imdrawing = false;
}
if ((((_xmouse > 750) or (_xmouse < 0)) or (_ymouse > 500)) or (_ymouse < 0)) {
imdrawing = false;
}
}
if (Key.isDown(69) && (terrainKeySwitch == false)) {
terrainVar = terrainVar + 1;
terrainKeySwitch = true;
} else if (!Key.isDown(69)) {
terrainKeySwitch = false;
}
if (terrainVar > 2) {
terrainVar = 1;
}
}
function switches() {
if ((platforms.switch1.hitTest(man._x + _x, man._y + _y, true) or ((platforms.switch1.hitTest(terrain1) == true) && (line1Drawn == true))) or ((platforms.switch1.hitTest(terrain2) == true) && (line2Drawn == true))) {
switchdoor1open = true;
} else if (!platforms.switch1.hitTest(man._x + _x, man._y + _y, true)) {
switchdoor1open = false;
}
if (switchdoor1open == true) {
platforms.switch1.gotoAndStop(2);
if (platforms.plats.switchdoor1._rotation > -90) {
platforms.plats.switchdoor1._rotation = platforms.plats.switchdoor1._rotation - 3;
}
} else if (switchdoor1open == false) {
platforms.switch1.gotoAndStop(1);
if (platforms.plats.switchdoor1._rotation < 0) {
platforms.plats.switchdoor1._rotation = platforms.plats.switchdoor1._rotation + 3;
}
}
if ((platforms.switch2.hitTest(man._x + _x, man._y + _y, true) or ((platforms.switch2.hitTest(terrain1) == true) && (line1Drawn == true))) or ((platforms.switch2.hitTest(terrain2) == true) && (line2Drawn == true))) {
switchdoor2open = true;
} else if (!platforms.switch2.hitTest(man._x + _x, man._y + _y, true)) {
switchdoor2open = false;
}
if (switchdoor2open == true) {
platforms.switch2.gotoAndStop(2);
if (platforms.plats.switchdoor2._rotation > -90) {
platforms.plats.switchdoor2._rotation = platforms.plats.switchdoor2._rotation - 3;
}
} else if (switchdoor2open == false) {
platforms.switch2.gotoAndStop(1);
if (platforms.plats.switchdoor2._rotation < 0) {
platforms.plats.switchdoor2._rotation = platforms.plats.switchdoor2._rotation + 3;
}
}
if ((platforms.switch3.hitTest(man._x + _x, man._y + _y, true) or ((platforms.switch3.hitTest(terrain1) == true) && (line1Drawn == true))) or ((platforms.switch3.hitTest(terrain2) == true) && (line2Drawn == true))) {
switchdoor3open = true;
} else if (!platforms.switch3.hitTest(man._x + _x, man._y + _y, true)) {
switchdoor3open = false;
}
if (switchdoor3open == true) {
platforms.switch3.gotoAndStop(2);
if (platforms.plats.switchdoor3._rotation > -90) {
platforms.plats.switchdoor3._rotation = platforms.plats.switchdoor3._rotation - 3;
}
} else if (switchdoor3open == false) {
platforms.switch3.gotoAndStop(1);
if (platforms.plats.switchdoor3._rotation < 0) {
platforms.plats.switchdoor3._rotation = platforms.plats.switchdoor3._rotation + 3;
}
}
}
function doorHit() {
if (platforms.door.hitTest(man._x + _x, man._y + _y, true)) {
gamePaused = true;
if (fader._alpha < 100) {
fader._alpha = fader._alpha + 5;
} else if (fader._alpha >= 100) {
man.sprite._xscale = manXScale;
man.mudkip._xscale = mudkipXScale;
man.mage._xscale = mageXScale;
createEmptyMovieClip("terrain1", man.getDepth() - 1);
createEmptyMovieClip("terrain2", man.getDepth() - 2);
man._x = 375;
man._y = 250;
if (gray_so.data.lvlsavailable == 1) {
gray_so.data.lvlsavailable++;
}
gotoAndStop ("beta");
}
}
}
function onMouseUp() {
imdrawing = false;
}
function onEnterFrame() {
displayText();
wallClinging = false;
xVar = man._x;
yVar = man._y;
testVar = ySpeed + yUp;
music();
cheats();
achievementsFunc();
pauseGame();
customCursor();
doorHit();
if (gamePaused == false) {
Drawing();
timerCounter();
man._x = man._x + xSpeed;
man._y = man._y + ySpeed;
manCollision();
moveScreen();
lookAround();
if (dead == false) {
if (fader._alpha > 0) {
fader._alpha = fader._alpha - 2;
}
kick();
manJump(-20);
managemanSprite();
onGround();
manageColor();
suicide();
spikesHit();
switches();
if ((Key.isDown(68) && (dodging == false)) && (wallClinging == false)) {
xSpeed = runSpeed;
} else if ((Key.isDown(65) && (dodging == false)) && (wallClinging == false)) {
xSpeed = -runSpeed;
} else if (((!Key.isDown(65)) && (!Key.isDown(68))) && (dodging == false)) {
xSpeed = 0;
}
} else {
man.sprite.gotoAndStop(4);
man.mudkip.gotoAndStop(4);
man.mage.gotoAndStop(4);
xSpeed = 0;
}
if (((man._x + xSpeed) > Stage.width) or ((man._x + xSpeed) < 0)) {
xSpeed = xSpeed - xSpeed;
} else if (dead == true) {
levelLinesPlayer = 0;
if (fader._alpha < 100) {
fader._alpha = fader._alpha + 5;
}
if (fader._alpha >= 100) {
dead = false;
deathsThisTime++;
man.sprite.gotoAndStop(1);
man.mudkip.gotoAndStop(1);
man.mage.gotoAndStop(1);
platforms._x = platx;
platforms._y = platy;
theBackground._x = backx;
theBackground._y = backy;
man._x = manx;
man._y = many;
createEmptyMovieClip("terrain1", man.getDepth() - 1);
createEmptyMovieClip("terrain2", man.getDepth() - 2);
}
}
}
}
function managemanSprite() {
if ((man.sprite._currentframe != 4) && (attack == false)) {
if ((air == false) && (wallClinging == false)) {
if (((Key.isDown(68) == false) && (Key.isDown(65) == false)) && (dodging == false)) {
man.sprite.gotoAndStop(1);
} else if (((Key.isDown(68) == true) && (dodging == false)) or ((Key.isDown(65) == true) && (dodging == false))) {
if (Key.isDown(68) && (dodging == false)) {
man.sprite._xscale = manXScale;
} else if (Key.isDown(65) && (dodging == false)) {
man.sprite._xscale = -manXScale;
}
man.sprite.gotoAndStop(2);
}
} else if (((air == true) && (dodging == false)) && (wallClinging == false)) {
man.sprite.gotoAndStop(3);
} else if (wallClinging == true) {
man.sprite.gotoAndStop(6);
}
} else if ((man.sprite._currentframe != 4) && (attack == true)) {
if (kicking == true) {
man.sprite.gotoAndStop(7);
}
}
}
function manageColor() {
if (man.sprite._xscale == (-manXScale)) {
man.sprite.bwhite.blendMode = "invert";
} else if (man.sprite._xscale == manXScale) {
man.sprite.bwhite.blendMode = "alpha";
}
}
function manJump(jumpHeight) {
if ((((((Key.isDown(87) && (noJumpMode == false)) && (!Key.isDown(70))) && (jumpKeySwitch == false)) && (doubleJump < 2)) && (noJump == false)) && (ySpeed > -1)) {
gray_so.data.totalJumps++;
jumpKeySwitch = true;
jumping = true;
doubleJump++;
air = true;
yUp = 0;
wallClinging = false;
gravity = 2;
man.sprite.inSprite.play();
man.sprite.bwhite.play();
man.sprite.outline.play();
if (ySpeed > -5) {
ySpeed = jumpHeight;
}
if ((doubleJump >= 2) && (ySpeed < -5)) {
ySpeed = jumpHeight;
}
} else if (Key.isDown(87) == false) {
jumpKeySwitch = false;
}
if ((jumping == true) && (ySpeed > 0)) {
jumping = false;
}
}
function onGround() {
if (((platforms.plats.hitTest(man._x + _x, ((man._y + 38) - yUp) + _y, true) or terrain1.hitTest(man._x + _x, ((man._y + 38) - yUp) + _y, true)) or terrain2.hitTest(man._x + _x, ((man._y + 38) - yUp) + _y, true)) or (wallClinging == true)) {
gravity = 2;
air = false;
doubleJump = 1;
} else {
air = true;
man._rotation = 0;
if (ySpeed < 15) {
ySpeed = ySpeed + gravity;
}
}
}
function manCollision() {
yUp = 0;
while ((platforms.plats.hitTest(man._x + _x, (((man._y + 35) + yUp) + _y) - 4, true) or terrain1.hitTest(man._x + _x, (((man._y + 35) + yUp) + _y) - 4, true)) or terrain2.hitTest(man._x + _x, (((man._y + 35) + yUp) + _y) - 4, true)) {
yUp--;
if (((Key.isDown(65) && (air == false)) && (jumping == false)) or ((Key.isDown(68) && (air == false)) && (jumping == false))) {
if ((yUp < ySpeed) && (man.sprite._xscale == (-manXScale))) {
man._rotation = ((-(yUp - ySpeed)) * 3) - (ySpeed * 6.15);
} else if ((yUp > ySpeed) && (man.sprite._xscale == manXScale)) {
man._rotation = ((yUp - ySpeed) * 3) + (ySpeed * 6.15);
} else if ((yUp > ySpeed) && (man.sprite._xscale == (-manXScale))) {
man._rotation = ((-(yUp - ySpeed)) * 3) - (ySpeed * 6.15);
} else if ((yUp < ySpeed) && (man.sprite._xscale == manXScale)) {
man._rotation = ((yUp - ySpeed) * 3) + (ySpeed * 6.15);
}
}
}
if ((platforms.plats.hitTest(man._x + _x, ((man._y - 35) + yUp) + _y, true) or terrain1.hitTest(man._x + _x, ((man._y - 35) + yUp) + _y, true)) or terrain2.hitTest(man._x + _x, ((man._y - 35) + yUp) + _y, true)) {
yUp = -ySpeed;
}
while ((((xSpeed != 0) && (platforms.plats.hitTest((man._x + xSpeed) + _x, ((man._y - 35) + yUp) + _y, true))) or ((xSpeed != 0) && (terrain1.hitTest((man._x + xSpeed) + _x, ((man._y - 35) + yUp) + _y, true)))) or ((xSpeed != 0) && (terrain2.hitTest((man._x + xSpeed) + _x, ((man._y - 35) + yUp) + _y, true)))) {
man._x = man._x - xSpeed;
}
if (((yUp == 0) && (ySpeed == 0)) && (air == false)) {
yUp = -16;
ySpeed = 16;
}
if ((yUp < -50) && (ySpeed > 0)) {
xSpeed = 0;
yUp = -ySpeed;
} else if ((yUp < -50) && (ySpeed < 0)) {
yUp = -15;
}
noJump = false;
man._y = man._y + yUp;
collideVar = yUp - ySpeed;
while ((((((platforms.plats.hitTest((man._x + xSpeed) + _x, man._y + _y, true) && (xSpeed != 0)) or (platforms.plats.hitTest((man._x + xSpeed) + _x, man._y + _y, true) && (xSpeed != 0))) or (terrain1.hitTest((man._x + xSpeed) + _x, man._y + _y, true) && (xSpeed != 0))) or (terrain1.hitTest((man._x + xSpeed) + _x, man._y + _y, true) && (xSpeed != 0))) or (terrain2.hitTest((man._x + xSpeed) + _x, man._y + _y, true) && (xSpeed != 0))) or (terrain2.hitTest((man._x + xSpeed) + _x, man._y + _y, true) && (xSpeed != 0))) {
man._x = man._x - xSpeed;
}
while ((xSpeed == 0) && (platforms.plats.hitTest((man._x - 20) + _x, man._y + _y, true))) {
man._x = man._x + 21;
}
while ((xSpeed == 0) && (platforms.plats.hitTest((man._x + 20) + _x, man._y + _y, true))) {
man._x = man._x - 21;
}
}
function moveScreen() {
if (man._x > (Stage.width - 250)) {
platforms._x = platforms._x - runSpeed;
terrain1._x = terrain1._x - runSpeed;
terrain2._x = terrain2._x - runSpeed;
man._x = man._x - runSpeed;
theBackground._x = theBackground._x - (runSpeed / 8);
}
if (man._x < 250) {
platforms._x = platforms._x + runSpeed;
terrain1._x = terrain1._x + runSpeed;
terrain2._x = terrain2._x + runSpeed;
man._x = man._x + runSpeed;
theBackground._x = theBackground._x + (runSpeed / 8);
}
if (((man._y + ySpeed) + yUp) > (Stage.height - 150)) {
platforms._y = platforms._y - (ySpeed + yUp);
terrain1._y = terrain1._y - (ySpeed + yUp);
terrain2._y = terrain2._y - (ySpeed + yUp);
man._y = man._y - (ySpeed + yUp);
theBackground._y = theBackground._y - ((ySpeed + yUp) / 8);
}
if (((man._y + ySpeed) + yUp) < 150) {
platforms._y = platforms._y - (ySpeed + yUp);
terrain1._y = terrain1._y - (ySpeed + yUp);
terrain2._y = terrain2._y - (ySpeed + yUp);
man._y = man._y - (ySpeed + yUp);
theBackground._y = theBackground._y - ((ySpeed + yUp) / 8);
}
if (((man._y + ySpeed) + yUp) < 125) {
platforms._y = platforms._y - ((ySpeed + yUp) - 26);
terrain1._y = terrain1._y - ((ySpeed + yUp) - 26);
terrain2._y = terrain2._y - ((ySpeed + yUp) - 26);
man._y = man._y - ((ySpeed + yUp) - 26);
theBackground._y = theBackground._y - (((ySpeed + yUp) - 26) / 8);
}
if (((man._y + ySpeed) + yUp) > (Stage.height - 125)) {
platforms._y = platforms._y - ((ySpeed + yUp) + 26);
terrain1._y = terrain1._y - ((ySpeed + yUp) + 26);
terrain2._y = terrain2._y - ((ySpeed + yUp) + 26);
man._y = man._y - ((ySpeed + yUp) + 26);
theBackground._y = theBackground._y - (((ySpeed + yUp) + 26) / 8);
}
if ((((man._y + ySpeed) + yUp) < 139) && (Key.isDown(70))) {
platforms._y = platforms._y - ((ySpeed + yUp) - 15);
terrain1._y = terrain1._y - ((ySpeed + yUp) - 15);
terrain2._y = terrain2._y - ((ySpeed + yUp) - 15);
man._y = man._y - ((ySpeed + yUp) - 15);
theBackground._y = theBackground._y - (((ySpeed + yUp) - 15) / 8);
}
if ((((man._y + ySpeed) + yUp) > (Stage.height - 139)) && (Key.isDown(70))) {
platforms._y = platforms._y - ((ySpeed + yUp) + 15);
terrain1._y = terrain1._y - ((ySpeed + yUp) + 15);
terrain2._y = terrain2._y - ((ySpeed + yUp) + 15);
man._y = man._y - ((ySpeed + yUp) + 15);
theBackground._y = theBackground._y - (((ySpeed + yUp) + 15) / 8);
}
}
function lookAround() {
if (((Key.isDown(70) && (air == false)) && (!Key.isDown(65))) && (!Key.isDown(68))) {
imdrawing = false;
if (_xmouse > (Stage.width - 250)) {
platforms._x = platforms._x - runSpeed;
terrain1._x = terrain1._x - runSpeed;
terrain2._x = terrain2._x - runSpeed;
man._x = man._x - runSpeed;
theBackground._x = theBackground._x - (runSpeed / 8);
}
if (_xmouse < 250) {
platforms._x = platforms._x + runSpeed;
terrain1._x = terrain1._x + runSpeed;
terrain2._x = terrain2._x + runSpeed;
man._x = man._x + runSpeed;
theBackground._x = theBackground._x + (runSpeed / 8);
}
if (_ymouse < 139) {
platforms._y = platforms._y - ((ySpeed + yUp) - 15);
terrain1._y = terrain1._y - ((ySpeed + yUp) - 15);
terrain2._y = terrain2._y - ((ySpeed + yUp) - 15);
man._y = man._y - ((ySpeed + yUp) - 15);
theBackground._y = theBackground._y - (((ySpeed + yUp) - 15) / 8);
}
if (_ymouse > (Stage.height - 139)) {
platforms._y = platforms._y - ((ySpeed + yUp) + 15);
terrain1._y = terrain1._y - ((ySpeed + yUp) + 15);
terrain2._y = terrain2._y - ((ySpeed + yUp) + 15);
man._y = man._y - ((ySpeed + yUp) + 15);
theBackground._y = theBackground._y - (((ySpeed + yUp) + 15) / 8);
}
}
}
function customCursor() {
cursor.gotoAndStop(terrainVar);
linecolor.gotoAndStop(terrainVar);
cursor._x = _xmouse;
cursor._y = _ymouse;
cursor._rotation = cursor._rotation + 3;
}
function wallCling() {
if ((platforms.plats.hitTest(((man._x + xSpeed) + 16) + _x, (man._y - 60) + _y, true) && (air == true)) && (Key.isDown(39))) {
man.sprite._xscale = -manXScale;
wallClinging = true;
air = false;
ySpeed = 0;
doubleJump = 0;
} else if ((platforms.plats.hitTest(((man._x + xSpeed) - 16) + _x, man._y + _y, true) && (air == true)) && (Key.isDown(37))) {
man.sprite._xscale = manXScale;
wallClinging = true;
air = false;
ySpeed = 0;
doubleJump = 0;
}
if ((air == true) or Key.isDown(40)) {
wallClinging = false;
}
}
function manDodge() {
if (((Key.isDown(40) && (Key.isDown(68))) && (dodgeSwitch == false)) && (wallClinging == false)) {
dodging = "right";
dodgeSwitch = true;
} else if (((Key.isDown(40) && (Key.isDown(65))) && (dodgeSwitch == false)) && (wallClinging == false)) {
dodging = "left";
dodgeSwitch = true;
}
if (dodging == "right") {
man.sprite._xscale = manXScale;
man.sprite.gotoAndStop(5);
xSpeed = 25;
dodgeSwitch == true;
} else if (dodging == "left") {
man.sprite._xscale = -manXScale;
man.sprite.gotoAndStop(5);
xSpeed = -25;
dodgeSwitch == true;
}
if (!Key.isDown(40)) {
dodgeSwitch = false;
}
}
function spikesHit() {
if (((platforms.spikes.hitTest(man._x + _x, man._y + _y, true) or platforms.spikes2.hitTest(man._x + _x, man._y + _y, true)) or platforms.spikes3.hitTest(man._x + _x, man._y + _y, true)) or platforms.spikes4.hitTest(man._x + _x, man._y + _y, true)) {
gray_so.data.totalDeaths++;
currentDeaths++;
dead = true;
}
}
function kick() {
if (Key.isDown(32) && (kickKeySwitch == false)) {
attack = true;
kicking = true;
kickKeySwitch = true;
} else if (!Key.isDown(32)) {
kickKeySwitch = false;
}
}
function suicide() {
if (Key.isDown(13) && (suicideSwitch == false)) {
dead = true;
suicideSwitch = true;
}
if (!Key.isDown(13)) {
suicideSwitch = false;
}
}
function pauseGame() {
if (((Key.isDown(27) && (pauseSwitch == false)) && (gamePaused == false)) && (dead == false)) {
gamePaused = true;
imdrawing = false;
pauseScreen._visible = true;
inverter._visible = true;
pauseSwitch = true;
} else if ((Key.isDown(27) && (pauseSwitch == false)) && (gamePaused == true)) {
gamePaused = false;
pauseScreen._visible = false;
inverter._visible = false;
pauseSwitch = true;
} else if (!Key.isDown(27)) {
pauseSwitch = false;
}
}
function cheats() {
if (mudkipcheat == true) {
man.sprite._visible = false;
man.mudkip._visible = true;
man.mage._visible = false;
if ((man.mudkip._currentframe != 4) && (attack == false)) {
if (air == false) {
if ((Key.isDown(68) == false) && (Key.isDown(65) == false)) {
man.mudkip.gotoAndStop(1);
} else if ((Key.isDown(68) == true) or (Key.isDown(65) == true)) {
if (Key.isDown(68)) {
man.mudkip._xscale = mudkipXScale;
} else if (Key.isDown(65)) {
man.mudkip._xscale = -mudkipXScale;
}
man.mudkip.gotoAndStop(2);
}
} else if (air == true) {
man.mudkip.gotoAndStop(3);
}
if (Key.isDown(32) && (kickKeySwitch == false)) {
if (man.mudkip.inSprite.head._currentframe == 1) {
mudkipMouthOpen = true;
} else if (man.mudkip.inSprite.head._currentframe == 2) {
mudkipMouthOpen = false;
}
}
if (mudkipMouthOpen == true) {
man.mudkip.inSprite.head.gotoAndStop(2);
} else {
man.mudkip.inSprite.head.gotoAndStop(1);
}
}
} else if (magecheat == true) {
man.sprite._visible = false;
man.mudkip._visible = false;
man.mage._visible = true;
if ((man.mage._currentframe != 4) && (attack == false)) {
if (air == false) {
if ((Key.isDown(68) == false) && (Key.isDown(65) == false)) {
man.mage.gotoAndStop(1);
} else if ((Key.isDown(68) == true) or (Key.isDown(65) == true)) {
if (Key.isDown(68)) {
man.mage._xscale = mageXScale;
} else if (Key.isDown(65)) {
man.mage._xscale = -mageXScale;
}
man.mage.gotoAndStop(2);
}
} else if (air == true) {
man.mage.gotoAndStop(3);
}
}
} else if ((mudkipcheat == false) && (magecheat == false)) {
man.sprite._visible = true;
man.mudkip._visible = false;
man.mage._visible = false;
}
}
function achievementsFunc() {
if ((gray_so.data.totalDeaths >= 100) && (gray_so.data.deathachievementplayed != true)) {
achpopup.dontfearthereaper._visible = true;
gray_so.data.deathachievementplayed = true;
achpopup.gotoAndPlay("start");
}
if ((gray_so.data.totalLines > 900) && (gray_so.data.over9000achievementplayed != true)) {
achpopup.over9000._visible = true;
gray_so.data.over9000achievementplayed = true;
achpopup.gotoAndPlay("start");
}
}
function timerCounter() {
timerPart++;
if (timerPart == 40) {
timer++;
gray_so.data.totalTimer++;
timerPart = 0;
}
}
stop();
pauseScreen._visible = false;
inverter._visible = false;
Mouse.hide();
platx = platforms._x;
platy = platforms._y;
backx = theBackground._x;
backy = theBackground._y;
manx = man._x;
many = man._y;
dead = false;
gamePaused = false;
dodging = false;
var attack = false;
var kicking = false;
var manstate = 1;
var runSpeed = 15;
var xSpeed = 0;
var ySpeed = 0;
var jumping = false;
var jumpKeySwitch = false;
var mudkipXScale = man.mudkip._xscale;
var mageXScale = man.mage._xscale;
var manXScale = man.sprite._xscale;
var gravity = 2;
var color = new Color("_root.man");
var imdrawing = false;
var terrainVar = 1;
menusound.stop();
Instance of Symbol 454 MovieClip "raveLights" in Frame 15
onClipEvent (load) {
_visible = false;
}
Frame 16
function onMouseDown() {
if ((terrainVar == 10) && (gamePaused == false)) {
createEmptyMovieClip("terrain1", man.getDepth() - 1);
terrain1.lineStyle(40, 3355443, 100);
if (imdrawing == false) {
terrain1.moveTo(_xmouse, _ymouse);
imdrawing = true;
xMouseStart = _xmouse;
yMouseStart = _ymouse;
}
} else if ((terrainVar == 20) && (gamePaused == false)) {
createEmptyMovieClip("terrain2", man.getDepth() - 2);
terrain2.lineStyle(40, 6710886, 100);
if (imdrawing == false) {
terrain2.moveTo(_xmouse, _ymouse);
imdrawing = true;
xMouseStart = _xmouse;
yMouseStart = _ymouse;
}
}
}
function Drawing() {
if (((terrainVar == 1) && (imdrawing == true)) && (!man.nodrawhitbox.hitTest(_xmouse, _ymouse, true))) {
if (((air == false) && (!Key.isDown(65))) && (!Key.isDown(68))) {
terrain1.lineTo(_xmouse, _ymouse);
}
} else if (((terrainVar == 2) && (imdrawing == true)) && (!man.nodrawhitbox.hitTest(_xmouse, _ymouse, true))) {
if (((air == false) && (!Key.isDown(65))) && (!Key.isDown(68))) {
terrain2.lineTo(_xmouse, _ymouse);
}
}
if (imdrawing == false) {
lineDrawed = false;
}
if (imdrawing == true) {
if ((((_xmouse != xMouseStart) && (lineDrawed == false)) && (terrainVar == 1)) or (((_ymouse != yMouseStart) && (lineDrawed == false)) && (terrainVar == 1))) {
line1Drawn = true;
lineDrawed = true;
gray_so.data.totalLines++;
levelLinesPlayer++;
} else if (((_xmouse == xMouseStart) && (_ymouse == yMouseStart)) && (terrainVar == 1)) {
line1Drawn = false;
lineDrawed = false;
}
if ((((_xmouse != xMouseStart) && (lineDrawed == false)) && (terrainVar == 2)) or (((_ymouse != yMouseStart) && (lineDrawed == false)) && (terrainVar == 2))) {
line2Drawn = true;
lineDrawed = true;
gray_so.data.totalLines++;
levelLinesPlayer++;
} else if (((_xmouse == xMouseStart) && (_ymouse == yMouseStart)) && (terrainVar == 2)) {
line2Drawn = false;
lineDrawed = false;
}
if ((((air == true) or Key.isDown(65)) or Key.isDown(68)) or (gamePaused == true)) {
imdrawing = false;
}
if (man.nodrawhitbox.hitTest(_xmouse, _ymouse, true)) {
imdrawing = false;
}
if ((((_xmouse > 750) or (_xmouse < 0)) or (_ymouse > 500)) or (_ymouse < 0)) {
imdrawing = false;
}
}
if (Key.isDown(69) && (terrainKeySwitch == false)) {
terrainVar = terrainVar + 0;
terrainKeySwitch = true;
} else if (!Key.isDown(69)) {
terrainKeySwitch = false;
}
if (terrainVar > 2) {
terrainVar = 1;
}
}
function switches() {
if ((platforms.switch1.hitTest(man._x + _x, man._y + _y, true) or ((platforms.switch1.hitTest(terrain1) == true) && (line1Drawn == true))) or ((platforms.switch1.hitTest(terrain2) == true) && (line2Drawn == true))) {
switchdoor1open = true;
} else if (!platforms.switch1.hitTest(man._x + _x, man._y + _y, true)) {
switchdoor1open = false;
}
if (switchdoor1open == true) {
platforms.switch1.gotoAndStop(2);
if (platforms.plats.switchdoor1._rotation > -90) {
platforms.plats.switchdoor1._rotation = platforms.plats.switchdoor1._rotation - 3;
}
} else if (switchdoor1open == false) {
platforms.switch1.gotoAndStop(1);
if (platforms.plats.switchdoor1._rotation < 0) {
platforms.plats.switchdoor1._rotation = platforms.plats.switchdoor1._rotation + 3;
}
}
if ((platforms.switch2.hitTest(man._x + _x, man._y + _y, true) or ((platforms.switch2.hitTest(terrain1) == true) && (line1Drawn == true))) or ((platforms.switch2.hitTest(terrain2) == true) && (line2Drawn == true))) {
switchdoor2open = true;
} else if (!platforms.switch2.hitTest(man._x + _x, man._y + _y, true)) {
switchdoor2open = false;
}
if (switchdoor2open == true) {
platforms.switch2.gotoAndStop(2);
if (platforms.plats.switchdoor2._rotation > -90) {
platforms.plats.switchdoor2._rotation = platforms.plats.switchdoor2._rotation - 3;
}
} else if (switchdoor2open == false) {
platforms.switch2.gotoAndStop(1);
if (platforms.plats.switchdoor2._rotation < 0) {
platforms.plats.switchdoor2._rotation = platforms.plats.switchdoor2._rotation + 3;
}
}
if ((platforms.switch3.hitTest(man._x + _x, man._y + _y, true) or ((platforms.switch3.hitTest(terrain1) == true) && (line1Drawn == true))) or ((platforms.switch3.hitTest(terrain2) == true) && (line2Drawn == true))) {
switchdoor3open = true;
} else if (!platforms.switch3.hitTest(man._x + _x, man._y + _y, true)) {
switchdoor3open = false;
}
if (switchdoor3open == true) {
platforms.switch3.gotoAndStop(2);
if (platforms.plats.switchdoor3._rotation > -90) {
platforms.plats.switchdoor3._rotation = platforms.plats.switchdoor3._rotation - 3;
}
} else if (switchdoor3open == false) {
platforms.switch3.gotoAndStop(1);
if (platforms.plats.switchdoor3._rotation < 0) {
platforms.plats.switchdoor3._rotation = platforms.plats.switchdoor3._rotation + 3;
}
}
}
function doorHit() {
if (platforms.door.hitTest(man._x + _x, man._y + _y, true)) {
gamePaused = true;
if (fader._alpha < 100) {
fader._alpha = fader._alpha + 5;
} else if (fader._alpha >= 100) {
man.sprite._xscale = manXScale;
man.mudkip._xscale = mudkipXScale;
man.mage._xscale = mageXScale;
createEmptyMovieClip("terrain1", man.getDepth() - 1);
createEmptyMovieClip("terrain2", man.getDepth() - 2);
man._x = 375;
man._y = 250;
if (gray_so.data.lvlsavailable == 1) {
gray_so.data.lvlsavailable++;
}
gotoAndStop ("lvl2");
}
}
}
currentDeaths = 0;
function onMouseUp() {
imdrawing = false;
}
function onEnterFrame() {
displayText();
wallClinging = false;
xVar = man._x;
yVar = man._y;
testVar = ySpeed + yUp;
music();
cheats();
achievementsFunc();
pauseGame();
customCursor();
doorHit();
if (gamePaused == false) {
Drawing();
timerCounter();
man._x = man._x + xSpeed;
man._y = man._y + ySpeed;
manCollision();
moveScreen();
lookAround();
if (dead == false) {
if (fader._alpha > 0) {
fader._alpha = fader._alpha - 2;
}
kick();
manJump(-20);
managemanSprite();
onGround();
manageColor();
suicide();
spikesHit();
switches();
if ((Key.isDown(68) && (dodging == false)) && (wallClinging == false)) {
xSpeed = runSpeed;
} else if ((Key.isDown(65) && (dodging == false)) && (wallClinging == false)) {
xSpeed = -runSpeed;
} else if (((!Key.isDown(65)) && (!Key.isDown(68))) && (dodging == false)) {
xSpeed = 0;
}
} else {
man.sprite.gotoAndStop(4);
man.mudkip.gotoAndStop(4);
man.mage.gotoAndStop(4);
xSpeed = 0;
}
if (((man._x + xSpeed) > Stage.width) or ((man._x + xSpeed) < 0)) {
xSpeed = xSpeed - xSpeed;
} else if (dead == true) {
levelLinesPlayer = 0;
if (fader._alpha < 100) {
fader._alpha = fader._alpha + 5;
}
if (fader._alpha >= 100) {
dead = false;
deathsThisTime++;
man.sprite.gotoAndStop(1);
man.mudkip.gotoAndStop(1);
man.mage.gotoAndStop(1);
platforms._x = platx;
platforms._y = platy;
theBackground._x = backx;
theBackground._y = backy;
man._x = manx;
man._y = many;
createEmptyMovieClip("terrain1", man.getDepth() - 1);
createEmptyMovieClip("terrain2", man.getDepth() - 2);
}
}
}
}
function managemanSprite() {
if ((man.sprite._currentframe != 4) && (attack == false)) {
if ((air == false) && (wallClinging == false)) {
if (((Key.isDown(68) == false) && (Key.isDown(65) == false)) && (dodging == false)) {
man.sprite.gotoAndStop(1);
} else if (((Key.isDown(68) == true) && (dodging == false)) or ((Key.isDown(65) == true) && (dodging == false))) {
if (Key.isDown(68) && (dodging == false)) {
man.sprite._xscale = manXScale;
} else if (Key.isDown(65) && (dodging == false)) {
man.sprite._xscale = -manXScale;
}
man.sprite.gotoAndStop(2);
}
} else if (((air == true) && (dodging == false)) && (wallClinging == false)) {
man.sprite.gotoAndStop(3);
} else if (wallClinging == true) {
man.sprite.gotoAndStop(6);
}
} else if ((man.sprite._currentframe != 4) && (attack == true)) {
if (kicking == true) {
man.sprite.gotoAndStop(7);
}
}
}
function manageColor() {
if (man.sprite._xscale == (-manXScale)) {
man.sprite.bwhite.blendMode = "invert";
} else if (man.sprite._xscale == manXScale) {
man.sprite.bwhite.blendMode = "alpha";
}
}
function manJump(jumpHeight) {
if ((((((Key.isDown(87) && (noJumpMode == false)) && (!Key.isDown(70))) && (jumpKeySwitch == false)) && (doubleJump < 2)) && (noJump == false)) && (ySpeed > -1)) {
gray_so.data.totalJumps++;
jumpKeySwitch = true;
jumping = true;
doubleJump++;
air = true;
yUp = 0;
wallClinging = false;
gravity = 2;
man.sprite.inSprite.play();
man.sprite.bwhite.play();
man.sprite.outline.play();
if (ySpeed > -5) {
ySpeed = jumpHeight;
}
if ((doubleJump >= 2) && (ySpeed < -5)) {
ySpeed = jumpHeight;
}
} else if (Key.isDown(87) == false) {
jumpKeySwitch = false;
}
if ((jumping == true) && (ySpeed > 0)) {
jumping = false;
}
}
function onGround() {
if (((platforms.plats.hitTest(man._x + _x, ((man._y + 38) - yUp) + _y, true) or terrain1.hitTest(man._x + _x, ((man._y + 38) - yUp) + _y, true)) or terrain2.hitTest(man._x + _x, ((man._y + 38) - yUp) + _y, true)) or (wallClinging == true)) {
gravity = 2;
air = false;
doubleJump = 1;
} else {
air = true;
man._rotation = 0;
if (ySpeed < 15) {
ySpeed = ySpeed + gravity;
}
}
}
function manCollision() {
yUp = 0;
while ((platforms.plats.hitTest(man._x + _x, (((man._y + 35) + yUp) + _y) - 4, true) or terrain1.hitTest(man._x + _x, (((man._y + 35) + yUp) + _y) - 4, true)) or terrain2.hitTest(man._x + _x, (((man._y + 35) + yUp) + _y) - 4, true)) {
yUp--;
if (((Key.isDown(65) && (air == false)) && (jumping == false)) or ((Key.isDown(68) && (air == false)) && (jumping == false))) {
if ((yUp < ySpeed) && (man.sprite._xscale == (-manXScale))) {
man._rotation = ((-(yUp - ySpeed)) * 3) - (ySpeed * 6.15);
} else if ((yUp > ySpeed) && (man.sprite._xscale == manXScale)) {
man._rotation = ((yUp - ySpeed) * 3) + (ySpeed * 6.15);
} else if ((yUp > ySpeed) && (man.sprite._xscale == (-manXScale))) {
man._rotation = ((-(yUp - ySpeed)) * 3) - (ySpeed * 6.15);
} else if ((yUp < ySpeed) && (man.sprite._xscale == manXScale)) {
man._rotation = ((yUp - ySpeed) * 3) + (ySpeed * 6.15);
}
}
}
if ((platforms.plats.hitTest(man._x + _x, ((man._y - 35) + yUp) + _y, true) or terrain1.hitTest(man._x + _x, ((man._y - 35) + yUp) + _y, true)) or terrain2.hitTest(man._x + _x, ((man._y - 35) + yUp) + _y, true)) {
yUp = -ySpeed;
}
while ((((xSpeed != 0) && (platforms.plats.hitTest((man._x + xSpeed) + _x, ((man._y - 35) + yUp) + _y, true))) or ((xSpeed != 0) && (terrain1.hitTest((man._x + xSpeed) + _x, ((man._y - 35) + yUp) + _y, true)))) or ((xSpeed != 0) && (terrain2.hitTest((man._x + xSpeed) + _x, ((man._y - 35) + yUp) + _y, true)))) {
man._x = man._x - xSpeed;
}
if (((yUp == 0) && (ySpeed == 0)) && (air == false)) {
yUp = -16;
ySpeed = 16;
}
if ((yUp < -50) && (ySpeed > 0)) {
xSpeed = 0;
yUp = -ySpeed;
} else if ((yUp < -50) && (ySpeed < 0)) {
yUp = -15;
}
noJump = false;
man._y = man._y + yUp;
collideVar = yUp - ySpeed;
while ((((((platforms.plats.hitTest((man._x + xSpeed) + _x, man._y + _y, true) && (xSpeed != 0)) or (platforms.plats.hitTest((man._x + xSpeed) + _x, man._y + _y, true) && (xSpeed != 0))) or (terrain1.hitTest((man._x + xSpeed) + _x, man._y + _y, true) && (xSpeed != 0))) or (terrain1.hitTest((man._x + xSpeed) + _x, man._y + _y, true) && (xSpeed != 0))) or (terrain2.hitTest((man._x + xSpeed) + _x, man._y + _y, true) && (xSpeed != 0))) or (terrain2.hitTest((man._x + xSpeed) + _x, man._y + _y, true) && (xSpeed != 0))) {
man._x = man._x - xSpeed;
}
while ((xSpeed == 0) && (platforms.plats.hitTest((man._x - 20) + _x, man._y + _y, true))) {
man._x = man._x + 21;
}
while ((xSpeed == 0) && (platforms.plats.hitTest((man._x + 20) + _x, man._y + _y, true))) {
man._x = man._x - 21;
}
}
function moveScreen() {
if (man._x > (Stage.width - 250)) {
platforms._x = platforms._x - runSpeed;
terrain1._x = terrain1._x - runSpeed;
terrain2._x = terrain2._x - runSpeed;
man._x = man._x - runSpeed;
theBackground._x = theBackground._x - (runSpeed / 8);
}
if (man._x < 250) {
platforms._x = platforms._x + runSpeed;
terrain1._x = terrain1._x + runSpeed;
terrain2._x = terrain2._x + runSpeed;
man._x = man._x + runSpeed;
theBackground._x = theBackground._x + (runSpeed / 8);
}
if (((man._y + ySpeed) + yUp) > (Stage.height - 150)) {
platforms._y = platforms._y - (ySpeed + yUp);
terrain1._y = terrain1._y - (ySpeed + yUp);
terrain2._y = terrain2._y - (ySpeed + yUp);
man._y = man._y - (ySpeed + yUp);
theBackground._y = theBackground._y - ((ySpeed + yUp) / 8);
}
if (((man._y + ySpeed) + yUp) < 150) {
platforms._y = platforms._y - (ySpeed + yUp);
terrain1._y = terrain1._y - (ySpeed + yUp);
terrain2._y = terrain2._y - (ySpeed + yUp);
man._y = man._y - (ySpeed + yUp);
theBackground._y = theBackground._y - ((ySpeed + yUp) / 8);
}
if (((man._y + ySpeed) + yUp) < 125) {
platforms._y = platforms._y - ((ySpeed + yUp) - 26);
terrain1._y = terrain1._y - ((ySpeed + yUp) - 26);
terrain2._y = terrain2._y - ((ySpeed + yUp) - 26);
man._y = man._y - ((ySpeed + yUp) - 26);
theBackground._y = theBackground._y - (((ySpeed + yUp) - 26) / 8);
}
if (((man._y + ySpeed) + yUp) > (Stage.height - 125)) {
platforms._y = platforms._y - ((ySpeed + yUp) + 26);
terrain1._y = terrain1._y - ((ySpeed + yUp) + 26);
terrain2._y = terrain2._y - ((ySpeed + yUp) + 26);
man._y = man._y - ((ySpeed + yUp) + 26);
theBackground._y = theBackground._y - (((ySpeed + yUp) + 26) / 8);
}
if ((((man._y + ySpeed) + yUp) < 139) && (Key.isDown(70))) {
platforms._y = platforms._y - ((ySpeed + yUp) - 15);
terrain1._y = terrain1._y - ((ySpeed + yUp) - 15);
terrain2._y = terrain2._y - ((ySpeed + yUp) - 15);
man._y = man._y - ((ySpeed + yUp) - 15);
theBackground._y = theBackground._y - (((ySpeed + yUp) - 15) / 8);
}
if ((((man._y + ySpeed) + yUp) > (Stage.height - 139)) && (Key.isDown(70))) {
platforms._y = platforms._y - ((ySpeed + yUp) + 15);
terrain1._y = terrain1._y - ((ySpeed + yUp) + 15);
terrain2._y = terrain2._y - ((ySpeed + yUp) + 15);
man._y = man._y - ((ySpeed + yUp) + 15);
theBackground._y = theBackground._y - (((ySpeed + yUp) + 15) / 8);
}
}
function lookAround() {
if (((Key.isDown(70) && (air == false)) && (!Key.isDown(65))) && (!Key.isDown(68))) {
imdrawing = false;
if (_xmouse > (Stage.width - 250)) {
platforms._x = platforms._x - runSpeed;
terrain1._x = terrain1._x - runSpeed;
terrain2._x = terrain2._x - runSpeed;
man._x = man._x - runSpeed;
theBackground._x = theBackground._x - (runSpeed / 8);
}
if (_xmouse < 250) {
platforms._x = platforms._x + runSpeed;
terrain1._x = terrain1._x + runSpeed;
terrain2._x = terrain2._x + runSpeed;
man._x = man._x + runSpeed;
theBackground._x = theBackground._x + (runSpeed / 8);
}
if (_ymouse < 139) {
platforms._y = platforms._y - ((ySpeed + yUp) - 15);
terrain1._y = terrain1._y - ((ySpeed + yUp) - 15);
terrain2._y = terrain2._y - ((ySpeed + yUp) - 15);
man._y = man._y - ((ySpeed + yUp) - 15);
theBackground._y = theBackground._y - (((ySpeed + yUp) - 15) / 8);
}
if (_ymouse > (Stage.height - 139)) {
platforms._y = platforms._y - ((ySpeed + yUp) + 15);
terrain1._y = terrain1._y - ((ySpeed + yUp) + 15);
terrain2._y = terrain2._y - ((ySpeed + yUp) + 15);
man._y = man._y - ((ySpeed + yUp) + 15);
theBackground._y = theBackground._y - (((ySpeed + yUp) + 15) / 8);
}
}
}
function customCursor() {
cursor.gotoAndStop(terrainVar);
linecolor.gotoAndStop(terrainVar);
cursor._x = _xmouse;
cursor._y = _ymouse;
cursor._rotation = cursor._rotation + 3;
}
function wallCling() {
if ((platforms.plats.hitTest(((man._x + xSpeed) + 16) + _x, (man._y - 60) + _y, true) && (air == true)) && (Key.isDown(39))) {
man.sprite._xscale = -manXScale;
wallClinging = true;
air = false;
ySpeed = 0;
doubleJump = 0;
} else if ((platforms.plats.hitTest(((man._x + xSpeed) - 16) + _x, man._y + _y, true) && (air == true)) && (Key.isDown(37))) {
man.sprite._xscale = manXScale;
wallClinging = true;
air = false;
ySpeed = 0;
doubleJump = 0;
}
if ((air == true) or Key.isDown(40)) {
wallClinging = false;
}
}
function manDodge() {
if (((Key.isDown(40) && (Key.isDown(68))) && (dodgeSwitch == false)) && (wallClinging == false)) {
dodging = "right";
dodgeSwitch = true;
} else if (((Key.isDown(40) && (Key.isDown(65))) && (dodgeSwitch == false)) && (wallClinging == false)) {
dodging = "left";
dodgeSwitch = true;
}
if (dodging == "right") {
man.sprite._xscale = manXScale;
man.sprite.gotoAndStop(5);
xSpeed = 25;
dodgeSwitch == true;
} else if (dodging == "left") {
man.sprite._xscale = -manXScale;
man.sprite.gotoAndStop(5);
xSpeed = -25;
dodgeSwitch == true;
}
if (!Key.isDown(40)) {
dodgeSwitch = false;
}
}
function spikesHit() {
if (((platforms.spikes.hitTest(man._x + _x, man._y + _y, true) or platforms.spikes2.hitTest(man._x + _x, man._y + _y, true)) or platforms.spikes3.hitTest(man._x + _x, man._y + _y, true)) or platforms.spikes4.hitTest(man._x + _x, man._y + _y, true)) {
gray_so.data.totalDeaths++;
currentDeaths++;
dead = true;
}
}
function kick() {
if (Key.isDown(32) && (kickKeySwitch == false)) {
attack = true;
kicking = true;
kickKeySwitch = true;
} else if (!Key.isDown(32)) {
kickKeySwitch = false;
}
}
function suicide() {
if (Key.isDown(13) && (suicideSwitch == false)) {
dead = true;
suicideSwitch = true;
}
if (!Key.isDown(13)) {
suicideSwitch = false;
}
}
function pauseGame() {
if (((Key.isDown(27) && (pauseSwitch == false)) && (gamePaused == false)) && (dead == false)) {
gamePaused = true;
imdrawing = false;
pauseScreen._visible = true;
inverter._visible = true;
pauseSwitch = true;
} else if ((Key.isDown(27) && (pauseSwitch == false)) && (gamePaused == true)) {
gamePaused = false;
pauseScreen._visible = false;
inverter._visible = false;
pauseSwitch = true;
} else if (!Key.isDown(27)) {
pauseSwitch = false;
}
}
function cheats() {
if (mudkipcheat == true) {
man.sprite._visible = false;
man.mudkip._visible = true;
man.mage._visible = false;
if ((man.mudkip._currentframe != 4) && (attack == false)) {
if (air == false) {
if ((Key.isDown(68) == false) && (Key.isDown(65) == false)) {
man.mudkip.gotoAndStop(1);
} else if ((Key.isDown(68) == true) or (Key.isDown(65) == true)) {
if (Key.isDown(68)) {
man.mudkip._xscale = mudkipXScale;
} else if (Key.isDown(65)) {
man.mudkip._xscale = -mudkipXScale;
}
man.mudkip.gotoAndStop(2);
}
} else if (air == true) {
man.mudkip.gotoAndStop(3);
}
if (Key.isDown(32) && (kickKeySwitch == false)) {
if (man.mudkip.inSprite.head._currentframe == 1) {
mudkipMouthOpen = true;
} else if (man.mudkip.inSprite.head._currentframe == 2) {
mudkipMouthOpen = false;
}
}
if (mudkipMouthOpen == true) {
man.mudkip.inSprite.head.gotoAndStop(2);
} else {
man.mudkip.inSprite.head.gotoAndStop(1);
}
}
} else if (magecheat == true) {
man.sprite._visible = false;
man.mudkip._visible = false;
man.mage._visible = true;
if ((man.mage._currentframe != 4) && (attack == false)) {
if (air == false) {
if ((Key.isDown(68) == false) && (Key.isDown(65) == false)) {
man.mage.gotoAndStop(1);
} else if ((Key.isDown(68) == true) or (Key.isDown(65) == true)) {
if (Key.isDown(68)) {
man.mage._xscale = mageXScale;
} else if (Key.isDown(65)) {
man.mage._xscale = -mageXScale;
}
man.mage.gotoAndStop(2);
}
} else if (air == true) {
man.mage.gotoAndStop(3);
}
}
} else if ((mudkipcheat == false) && (magecheat == false)) {
man.sprite._visible = true;
man.mudkip._visible = false;
man.mage._visible = false;
}
}
function achievementsFunc() {
if ((gray_so.data.totalDeaths == 100) && (gray_so.data.deathachievementplayed != true)) {
achpopup.dontfearthereaper._visible = true;
gray_so.data.deathachievementplayed = true;
achpopup.gotoAndPlay("start");
}
if ((gray_so.data.totalLines > 900) && (gray_so.data.over9000achievementplayed != true)) {
achpopup.over9000._visible = true;
gray_so.data.over9000achievementplayed = true;
achpopup.gotoAndPlay("start");
}
}
function timerCounter() {
timerPart++;
if (timerPart == 40) {
timer++;
gray_so.data.totalTimer++;
timerPart = 0;
}
}
stop();
pauseScreen._visible = false;
inverter._visible = false;
Mouse.hide();
platx = platforms._x;
platy = platforms._y;
backx = theBackground._x;
backy = theBackground._y;
manx = man._x;
many = man._y;
dead = false;
gamePaused = false;
dodging = false;
var attack = false;
var kicking = false;
var manstate = 1;
var runSpeed = 15;
var xSpeed = 0;
var ySpeed = 0;
var jumping = false;
var jumpKeySwitch = false;
var mudkipXScale = man.mudkip._xscale;
var mageXScale = man.mage._xscale;
var manXScale = man.sprite._xscale;
var gravity = 2;
var color = new Color("_root.man");
var imdrawing = false;
var terrainVar = 1;
Frame 17
function onMouseDown() {
if ((terrainVar == 10) && (gamePaused == false)) {
createEmptyMovieClip("terrain1", man.getDepth() - 1);
terrain1.lineStyle(40, 3355443, 100);
if (imdrawing == false) {
terrain1.moveTo(_xmouse, _ymouse);
imdrawing = true;
xMouseStart = _xmouse;
yMouseStart = _ymouse;
}
} else if ((terrainVar == 20) && (gamePaused == false)) {
createEmptyMovieClip("terrain2", man.getDepth() - 2);
terrain2.lineStyle(40, 6710886, 100);
if (imdrawing == false) {
terrain2.moveTo(_xmouse, _ymouse);
imdrawing = true;
xMouseStart = _xmouse;
yMouseStart = _ymouse;
}
}
}
function Drawing() {
if (((terrainVar == 1) && (imdrawing == true)) && (!man.nodrawhitbox.hitTest(_xmouse, _ymouse, true))) {
if (((air == false) && (!Key.isDown(65))) && (!Key.isDown(68))) {
terrain1.lineTo(_xmouse, _ymouse);
}
} else if (((terrainVar == 2) && (imdrawing == true)) && (!man.nodrawhitbox.hitTest(_xmouse, _ymouse, true))) {
if (((air == false) && (!Key.isDown(65))) && (!Key.isDown(68))) {
terrain2.lineTo(_xmouse, _ymouse);
}
}
if (imdrawing == false) {
lineDrawed = false;
}
if (imdrawing == true) {
if ((((_xmouse != xMouseStart) && (lineDrawed == false)) && (terrainVar == 1)) or (((_ymouse != yMouseStart) && (lineDrawed == false)) && (terrainVar == 1))) {
line1Drawn = true;
lineDrawed = true;
gray_so.data.totalLines++;
levelLinesPlayer++;
} else if (((_xmouse == xMouseStart) && (_ymouse == yMouseStart)) && (terrainVar == 1)) {
line1Drawn = false;
lineDrawed = false;
}
if ((((_xmouse != xMouseStart) && (lineDrawed == false)) && (terrainVar == 2)) or (((_ymouse != yMouseStart) && (lineDrawed == false)) && (terrainVar == 2))) {
line2Drawn = true;
lineDrawed = true;
gray_so.data.totalLines++;
levelLinesPlayer++;
} else if (((_xmouse == xMouseStart) && (_ymouse == yMouseStart)) && (terrainVar == 2)) {
line2Drawn = false;
lineDrawed = false;
}
if ((((air == true) or Key.isDown(65)) or Key.isDown(68)) or (gamePaused == true)) {
imdrawing = false;
}
if (man.nodrawhitbox.hitTest(_xmouse, _ymouse, true)) {
imdrawing = false;
}
if ((((_xmouse > 750) or (_xmouse < 0)) or (_ymouse > 500)) or (_ymouse < 0)) {
imdrawing = false;
}
}
if (Key.isDown(69) && (terrainKeySwitch == false)) {
terrainVar = terrainVar + 0;
terrainKeySwitch = true;
} else if (!Key.isDown(69)) {
terrainKeySwitch = false;
}
if (terrainVar > 2) {
terrainVar = 1;
}
}
function switches() {
if ((platforms.switch1.hitTest(man._x + _x, man._y + _y, true) or ((platforms.switch1.hitTest(terrain1) == true) && (line1Drawn == true))) or ((platforms.switch1.hitTest(terrain2) == true) && (line2Drawn == true))) {
switchdoor1open = true;
} else if (!platforms.switch1.hitTest(man._x + _x, man._y + _y, true)) {
switchdoor1open = false;
}
if (switchdoor1open == true) {
platforms.switch1.gotoAndStop(2);
if (platforms.plats.switchdoor1._rotation > -90) {
platforms.plats.switchdoor1._rotation = platforms.plats.switchdoor1._rotation - 3;
}
} else if (switchdoor1open == false) {
platforms.switch1.gotoAndStop(1);
if (platforms.plats.switchdoor1._rotation < 0) {
platforms.plats.switchdoor1._rotation = platforms.plats.switchdoor1._rotation + 3;
}
}
if ((platforms.switch2.hitTest(man._x + _x, man._y + _y, true) or ((platforms.switch2.hitTest(terrain1) == true) && (line1Drawn == true))) or ((platforms.switch2.hitTest(terrain2) == true) && (line2Drawn == true))) {
switchdoor2open = true;
} else if (!platforms.switch2.hitTest(man._x + _x, man._y + _y, true)) {
switchdoor2open = false;
}
if (switchdoor2open == true) {
platforms.switch2.gotoAndStop(2);
if (platforms.plats.switchdoor2._rotation > -90) {
platforms.plats.switchdoor2._rotation = platforms.plats.switchdoor2._rotation - 3;
}
} else if (switchdoor2open == false) {
platforms.switch2.gotoAndStop(1);
if (platforms.plats.switchdoor2._rotation < 0) {
platforms.plats.switchdoor2._rotation = platforms.plats.switchdoor2._rotation + 3;
}
}
if ((platforms.switch3.hitTest(man._x + _x, man._y + _y, true) or ((platforms.switch3.hitTest(terrain1) == true) && (line1Drawn == true))) or ((platforms.switch3.hitTest(terrain2) == true) && (line2Drawn == true))) {
switchdoor3open = true;
} else if (!platforms.switch3.hitTest(man._x + _x, man._y + _y, true)) {
switchdoor3open = false;
}
if (switchdoor3open == true) {
platforms.switch3.gotoAndStop(2);
if (platforms.plats.switchdoor3._rotation > -90) {
platforms.plats.switchdoor3._rotation = platforms.plats.switchdoor3._rotation - 3;
}
} else if (switchdoor3open == false) {
platforms.switch3.gotoAndStop(1);
if (platforms.plats.switchdoor3._rotation < 0) {
platforms.plats.switchdoor3._rotation = platforms.plats.switchdoor3._rotation + 3;
}
}
}
function doorHit() {
if (platforms.door.hitTest(man._x + _x, man._y + _y, true)) {
gamePaused = true;
if (fader._alpha < 100) {
fader._alpha = fader._alpha + 5;
} else if (fader._alpha >= 100) {
man.sprite._xscale = manXScale;
man.mudkip._xscale = mudkipXScale;
man.mage._xscale = mageXScale;
createEmptyMovieClip("terrain1", man.getDepth() - 1);
createEmptyMovieClip("terrain2", man.getDepth() - 2);
man._x = 375;
man._y = 250;
if (gray_so.data.lvlsavailable == 2) {
gray_so.data.lvlsavailable++;
}
gotoAndStop ("lvl3");
}
}
}
function onMouseUp() {
imdrawing = false;
}
function onEnterFrame() {
displayText();
wallClinging = false;
xVar = man._x;
yVar = man._y;
testVar = ySpeed + yUp;
music();
cheats();
achievementsFunc();
pauseGame();
customCursor();
doorHit();
if (gamePaused == false) {
Drawing();
timerCounter();
man._x = man._x + xSpeed;
man._y = man._y + ySpeed;
manCollision();
moveScreen();
lookAround();
if (dead == false) {
if (fader._alpha > 0) {
fader._alpha = fader._alpha - 2;
}
kick();
manJump(-20);
managemanSprite();
onGround();
manageColor();
suicide();
spikesHit();
switches();
if ((Key.isDown(68) && (dodging == false)) && (wallClinging == false)) {
xSpeed = runSpeed;
} else if ((Key.isDown(65) && (dodging == false)) && (wallClinging == false)) {
xSpeed = -runSpeed;
} else if (((!Key.isDown(65)) && (!Key.isDown(68))) && (dodging == false)) {
xSpeed = 0;
}
} else {
man.sprite.gotoAndStop(4);
man.mudkip.gotoAndStop(4);
man.mage.gotoAndStop(4);
xSpeed = 0;
}
if (((man._x + xSpeed) > Stage.width) or ((man._x + xSpeed) < 0)) {
xSpeed = xSpeed - xSpeed;
} else if (dead == true) {
levelLinesPlayer = 0;
if (fader._alpha < 100) {
fader._alpha = fader._alpha + 5;
}
if (fader._alpha >= 100) {
dead = false;
deathsThisTime++;
man.sprite.gotoAndStop(1);
man.mudkip.gotoAndStop(1);
man.mage.gotoAndStop(1);
platforms._x = platx;
platforms._y = platy;
theBackground._x = backx;
theBackground._y = backy;
man._x = manx;
man._y = many;
createEmptyMovieClip("terrain1", man.getDepth() - 1);
createEmptyMovieClip("terrain2", man.getDepth() - 2);
}
}
}
}
function managemanSprite() {
if ((man.sprite._currentframe != 4) && (attack == false)) {
if ((air == false) && (wallClinging == false)) {
if (((Key.isDown(68) == false) && (Key.isDown(65) == false)) && (dodging == false)) {
man.sprite.gotoAndStop(1);
} else if (((Key.isDown(68) == true) && (dodging == false)) or ((Key.isDown(65) == true) && (dodging == false))) {
if (Key.isDown(68) && (dodging == false)) {
man.sprite._xscale = manXScale;
} else if (Key.isDown(65) && (dodging == false)) {
man.sprite._xscale = -manXScale;
}
man.sprite.gotoAndStop(2);
}
} else if (((air == true) && (dodging == false)) && (wallClinging == false)) {
man.sprite.gotoAndStop(3);
} else if (wallClinging == true) {
man.sprite.gotoAndStop(6);
}
} else if ((man.sprite._currentframe != 4) && (attack == true)) {
if (kicking == true) {
man.sprite.gotoAndStop(7);
}
}
}
function manageColor() {
if (man.sprite._xscale == (-manXScale)) {
man.sprite.bwhite.blendMode = "invert";
} else if (man.sprite._xscale == manXScale) {
man.sprite.bwhite.blendMode = "alpha";
}
}
function manJump(jumpHeight) {
if ((((((Key.isDown(87) && (noJumpMode == false)) && (!Key.isDown(70))) && (jumpKeySwitch == false)) && (doubleJump < 2)) && (noJump == false)) && (ySpeed > -1)) {
gray_so.data.totalJumps++;
jumpKeySwitch = true;
jumping = true;
doubleJump++;
air = true;
yUp = 0;
wallClinging = false;
gravity = 2;
man.sprite.inSprite.play();
man.sprite.bwhite.play();
man.sprite.outline.play();
if (ySpeed > -5) {
ySpeed = jumpHeight;
}
if ((doubleJump >= 2) && (ySpeed < -5)) {
ySpeed = jumpHeight;
}
} else if (Key.isDown(87) == false) {
jumpKeySwitch = false;
}
if ((jumping == true) && (ySpeed > 0)) {
jumping = false;
}
}
function onGround() {
if (((platforms.plats.hitTest(man._x + _x, ((man._y + 38) - yUp) + _y, true) or terrain1.hitTest(man._x + _x, ((man._y + 38) - yUp) + _y, true)) or terrain2.hitTest(man._x + _x, ((man._y + 38) - yUp) + _y, true)) or (wallClinging == true)) {
gravity = 2;
air = false;
doubleJump = 1;
} else {
air = true;
man._rotation = 0;
if (ySpeed < 15) {
ySpeed = ySpeed + gravity;
}
}
}
function manCollision() {
yUp = 0;
while ((platforms.plats.hitTest(man._x + _x, (((man._y + 35) + yUp) + _y) - 4, true) or terrain1.hitTest(man._x + _x, (((man._y + 35) + yUp) + _y) - 4, true)) or terrain2.hitTest(man._x + _x, (((man._y + 35) + yUp) + _y) - 4, true)) {
yUp--;
if (((Key.isDown(65) && (air == false)) && (jumping == false)) or ((Key.isDown(68) && (air == false)) && (jumping == false))) {
if ((yUp < ySpeed) && (man.sprite._xscale == (-manXScale))) {
man._rotation = ((-(yUp - ySpeed)) * 3) - (ySpeed * 6.15);
} else if ((yUp > ySpeed) && (man.sprite._xscale == manXScale)) {
man._rotation = ((yUp - ySpeed) * 3) + (ySpeed * 6.15);
} else if ((yUp > ySpeed) && (man.sprite._xscale == (-manXScale))) {
man._rotation = ((-(yUp - ySpeed)) * 3) - (ySpeed * 6.15);
} else if ((yUp < ySpeed) && (man.sprite._xscale == manXScale)) {
man._rotation = ((yUp - ySpeed) * 3) + (ySpeed * 6.15);
}
}
}
if ((platforms.plats.hitTest(man._x + _x, ((man._y - 35) + yUp) + _y, true) or terrain1.hitTest(man._x + _x, ((man._y - 35) + yUp) + _y, true)) or terrain2.hitTest(man._x + _x, ((man._y - 35) + yUp) + _y, true)) {
yUp = -ySpeed;
}
while ((((xSpeed != 0) && (platforms.plats.hitTest((man._x + xSpeed) + _x, ((man._y - 35) + yUp) + _y, true))) or ((xSpeed != 0) && (terrain1.hitTest((man._x + xSpeed) + _x, ((man._y - 35) + yUp) + _y, true)))) or ((xSpeed != 0) && (terrain2.hitTest((man._x + xSpeed) + _x, ((man._y - 35) + yUp) + _y, true)))) {
man._x = man._x - xSpeed;
}
if (((yUp == 0) && (ySpeed == 0)) && (air == false)) {
yUp = -16;
ySpeed = 16;
}
if ((yUp < -50) && (ySpeed > 0)) {
xSpeed = 0;
yUp = -ySpeed;
} else if ((yUp < -50) && (ySpeed < 0)) {
yUp = -15;
}
noJump = false;
man._y = man._y + yUp;
collideVar = yUp - ySpeed;
while ((((((platforms.plats.hitTest((man._x + xSpeed) + _x, man._y + _y, true) && (xSpeed != 0)) or (platforms.plats.hitTest((man._x + xSpeed) + _x, man._y + _y, true) && (xSpeed != 0))) or (terrain1.hitTest((man._x + xSpeed) + _x, man._y + _y, true) && (xSpeed != 0))) or (terrain1.hitTest((man._x + xSpeed) + _x, man._y + _y, true) && (xSpeed != 0))) or (terrain2.hitTest((man._x + xSpeed) + _x, man._y + _y, true) && (xSpeed != 0))) or (terrain2.hitTest((man._x + xSpeed) + _x, man._y + _y, true) && (xSpeed != 0))) {
man._x = man._x - xSpeed;
}
while ((xSpeed == 0) && (platforms.plats.hitTest((man._x - 20) + _x, man._y + _y, true))) {
man._x = man._x + 21;
}
while ((xSpeed == 0) && (platforms.plats.hitTest((man._x + 20) + _x, man._y + _y, true))) {
man._x = man._x - 21;
}
}
function moveScreen() {
if (man._x > (Stage.width - 250)) {
platforms._x = platforms._x - runSpeed;
terrain1._x = terrain1._x - runSpeed;
terrain2._x = terrain2._x - runSpeed;
man._x = man._x - runSpeed;
theBackground._x = theBackground._x - (runSpeed / 8);
}
if (man._x < 250) {
platforms._x = platforms._x + runSpeed;
terrain1._x = terrain1._x + runSpeed;
terrain2._x = terrain2._x + runSpeed;
man._x = man._x + runSpeed;
theBackground._x = theBackground._x + (runSpeed / 8);
}
if (((man._y + ySpeed) + yUp) > (Stage.height - 150)) {
platforms._y = platforms._y - (ySpeed + yUp);
terrain1._y = terrain1._y - (ySpeed + yUp);
terrain2._y = terrain2._y - (ySpeed + yUp);
man._y = man._y - (ySpeed + yUp);
theBackground._y = theBackground._y - ((ySpeed + yUp) / 8);
}
if (((man._y + ySpeed) + yUp) < 150) {
platforms._y = platforms._y - (ySpeed + yUp);
terrain1._y = terrain1._y - (ySpeed + yUp);
terrain2._y = terrain2._y - (ySpeed + yUp);
man._y = man._y - (ySpeed + yUp);
theBackground._y = theBackground._y - ((ySpeed + yUp) / 8);
}
if (((man._y + ySpeed) + yUp) < 125) {
platforms._y = platforms._y - ((ySpeed + yUp) - 26);
terrain1._y = terrain1._y - ((ySpeed + yUp) - 26);
terrain2._y = terrain2._y - ((ySpeed + yUp) - 26);
man._y = man._y - ((ySpeed + yUp) - 26);
theBackground._y = theBackground._y - (((ySpeed + yUp) - 26) / 8);
}
if (((man._y + ySpeed) + yUp) > (Stage.height - 125)) {
platforms._y = platforms._y - ((ySpeed + yUp) + 26);
terrain1._y = terrain1._y - ((ySpeed + yUp) + 26);
terrain2._y = terrain2._y - ((ySpeed + yUp) + 26);
man._y = man._y - ((ySpeed + yUp) + 26);
theBackground._y = theBackground._y - (((ySpeed + yUp) + 26) / 8);
}
if ((((man._y + ySpeed) + yUp) < 139) && (Key.isDown(70))) {
platforms._y = platforms._y - ((ySpeed + yUp) - 15);
terrain1._y = terrain1._y - ((ySpeed + yUp) - 15);
terrain2._y = terrain2._y - ((ySpeed + yUp) - 15);
man._y = man._y - ((ySpeed + yUp) - 15);
theBackground._y = theBackground._y - (((ySpeed + yUp) - 15) / 8);
}
if ((((man._y + ySpeed) + yUp) > (Stage.height - 139)) && (Key.isDown(70))) {
platforms._y = platforms._y - ((ySpeed + yUp) + 15);
terrain1._y = terrain1._y - ((ySpeed + yUp) + 15);
terrain2._y = terrain2._y - ((ySpeed + yUp) + 15);
man._y = man._y - ((ySpeed + yUp) + 15);
theBackground._y = theBackground._y - (((ySpeed + yUp) + 15) / 8);
}
}
function lookAround() {
if (((Key.isDown(70) && (air == false)) && (!Key.isDown(65))) && (!Key.isDown(68))) {
imdrawing = false;
if (_xmouse > (Stage.width - 250)) {
platforms._x = platforms._x - runSpeed;
terrain1._x = terrain1._x - runSpeed;
terrain2._x = terrain2._x - runSpeed;
man._x = man._x - runSpeed;
theBackground._x = theBackground._x - (runSpeed / 8);
}
if (_xmouse < 250) {
platforms._x = platforms._x + runSpeed;
terrain1._x = terrain1._x + runSpeed;
terrain2._x = terrain2._x + runSpeed;
man._x = man._x + runSpeed;
theBackground._x = theBackground._x + (runSpeed / 8);
}
if (_ymouse < 139) {
platforms._y = platforms._y - ((ySpeed + yUp) - 15);
terrain1._y = terrain1._y - ((ySpeed + yUp) - 15);
terrain2._y = terrain2._y - ((ySpeed + yUp) - 15);
man._y = man._y - ((ySpeed + yUp) - 15);
theBackground._y = theBackground._y - (((ySpeed + yUp) - 15) / 8);
}
if (_ymouse > (Stage.height - 139)) {
platforms._y = platforms._y - ((ySpeed + yUp) + 15);
terrain1._y = terrain1._y - ((ySpeed + yUp) + 15);
terrain2._y = terrain2._y - ((ySpeed + yUp) + 15);
man._y = man._y - ((ySpeed + yUp) + 15);
theBackground._y = theBackground._y - (((ySpeed + yUp) + 15) / 8);
}
}
}
function customCursor() {
cursor.gotoAndStop(terrainVar);
linecolor.gotoAndStop(terrainVar);
cursor._x = _xmouse;
cursor._y = _ymouse;
cursor._rotation = cursor._rotation + 3;
}
function wallCling() {
if ((platforms.plats.hitTest(((man._x + xSpeed) + 16) + _x, (man._y - 60) + _y, true) && (air == true)) && (Key.isDown(39))) {
man.sprite._xscale = -manXScale;
wallClinging = true;
air = false;
ySpeed = 0;
doubleJump = 0;
} else if ((platforms.plats.hitTest(((man._x + xSpeed) - 16) + _x, man._y + _y, true) && (air == true)) && (Key.isDown(37))) {
man.sprite._xscale = manXScale;
wallClinging = true;
air = false;
ySpeed = 0;
doubleJump = 0;
}
if ((air == true) or Key.isDown(40)) {
wallClinging = false;
}
}
function manDodge() {
if (((Key.isDown(40) && (Key.isDown(68))) && (dodgeSwitch == false)) && (wallClinging == false)) {
dodging = "right";
dodgeSwitch = true;
} else if (((Key.isDown(40) && (Key.isDown(65))) && (dodgeSwitch == false)) && (wallClinging == false)) {
dodging = "left";
dodgeSwitch = true;
}
if (dodging == "right") {
man.sprite._xscale = manXScale;
man.sprite.gotoAndStop(5);
xSpeed = 25;
dodgeSwitch == true;
} else if (dodging == "left") {
man.sprite._xscale = -manXScale;
man.sprite.gotoAndStop(5);
xSpeed = -25;
dodgeSwitch == true;
}
if (!Key.isDown(40)) {
dodgeSwitch = false;
}
}
function spikesHit() {
if (((platforms.spikes.hitTest(man._x + _x, man._y + _y, true) or platforms.spikes2.hitTest(man._x + _x, man._y + _y, true)) or platforms.spikes3.hitTest(man._x + _x, man._y + _y, true)) or platforms.spikes4.hitTest(man._x + _x, man._y + _y, true)) {
gray_so.data.totalDeaths++;
currentDeaths++;
dead = true;
}
}
function kick() {
if (Key.isDown(32) && (kickKeySwitch == false)) {
attack = true;
kicking = true;
kickKeySwitch = true;
} else if (!Key.isDown(32)) {
kickKeySwitch = false;
}
}
function suicide() {
if (Key.isDown(13) && (suicideSwitch == false)) {
dead = true;
suicideSwitch = true;
}
if (!Key.isDown(13)) {
suicideSwitch = false;
}
}
function pauseGame() {
if (((Key.isDown(27) && (pauseSwitch == false)) && (gamePaused == false)) && (dead == false)) {
gamePaused = true;
imdrawing = false;
pauseScreen._visible = true;
inverter._visible = true;
pauseSwitch = true;
} else if ((Key.isDown(27) && (pauseSwitch == false)) && (gamePaused == true)) {
gamePaused = false;
pauseScreen._visible = false;
inverter._visible = false;
pauseSwitch = true;
} else if (!Key.isDown(27)) {
pauseSwitch = false;
}
}
function cheats() {
if (mudkipcheat == true) {
man.sprite._visible = false;
man.mudkip._visible = true;
man.mage._visible = false;
if ((man.mudkip._currentframe != 4) && (attack == false)) {
if (air == false) {
if ((Key.isDown(68) == false) && (Key.isDown(65) == false)) {
man.mudkip.gotoAndStop(1);
} else if ((Key.isDown(68) == true) or (Key.isDown(65) == true)) {
if (Key.isDown(68)) {
man.mudkip._xscale = mudkipXScale;
} else if (Key.isDown(65)) {
man.mudkip._xscale = -mudkipXScale;
}
man.mudkip.gotoAndStop(2);
}
} else if (air == true) {
man.mudkip.gotoAndStop(3);
}
if (Key.isDown(32) && (kickKeySwitch == false)) {
if (man.mudkip.inSprite.head._currentframe == 1) {
mudkipMouthOpen = true;
} else if (man.mudkip.inSprite.head._currentframe == 2) {
mudkipMouthOpen = false;
}
}
if (mudkipMouthOpen == true) {
man.mudkip.inSprite.head.gotoAndStop(2);
} else {
man.mudkip.inSprite.head.gotoAndStop(1);
}
}
} else if (magecheat == true) {
man.sprite._visible = false;
man.mudkip._visible = false;
man.mage._visible = true;
if ((man.mage._currentframe != 4) && (attack == false)) {
if (air == false) {
if ((Key.isDown(68) == false) && (Key.isDown(65) == false)) {
man.mage.gotoAndStop(1);
} else if ((Key.isDown(68) == true) or (Key.isDown(65) == true)) {
if (Key.isDown(68)) {
man.mage._xscale = mageXScale;
} else if (Key.isDown(65)) {
man.mage._xscale = -mageXScale;
}
man.mage.gotoAndStop(2);
}
} else if (air == true) {
man.mage.gotoAndStop(3);
}
}
} else if ((mudkipcheat == false) && (magecheat == false)) {
man.sprite._visible = true;
man.mudkip._visible = false;
man.mage._visible = false;
}
}
function achievementsFunc() {
if ((gray_so.data.totalDeaths == 100) && (gray_so.data.deathachievementplayed != true)) {
achpopup.dontfearthereaper._visible = true;
gray_so.data.deathachievementplayed = true;
achpopup.gotoAndPlay("start");
}
if ((gray_so.data.totalLines > 900) && (gray_so.data.over9000achievementplayed != true)) {
achpopup.over9000._visible = true;
gray_so.data.over9000achievementplayed = true;
achpopup.gotoAndPlay("start");
}
}
function timerCounter() {
timerPart++;
if (timerPart == 40) {
timer++;
gray_so.data.totalTimer++;
timerPart = 0;
}
}
stop();
pauseScreen._visible = false;
inverter._visible = false;
Mouse.hide();
platx = platforms._x;
platy = platforms._y;
backx = theBackground._x;
backy = theBackground._y;
manx = man._x;
many = man._y;
dead = false;
gamePaused = false;
dodging = false;
var attack = false;
var kicking = false;
var manstate = 1;
var runSpeed = 15;
var xSpeed = 0;
var ySpeed = 0;
var jumping = false;
var jumpKeySwitch = false;
var mudkipXScale = man.mudkip._xscale;
var mageXScale = man.mage._xscale;
var manXScale = man.sprite._xscale;
var gravity = 2;
var color = new Color("_root.man");
var imdrawing = false;
var terrainVar = 1;
Frame 18
function onMouseDown() {
if ((terrainVar == 1) && (gamePaused == false)) {
createEmptyMovieClip("terrain1", man.getDepth() - 1);
terrain1.lineStyle(40, 3355443, 100);
if (imdrawing == false) {
terrain1.moveTo(_xmouse, _ymouse);
imdrawing = true;
xMouseStart = _xmouse;
yMouseStart = _ymouse;
}
} else if ((terrainVar == 20) && (gamePaused == false)) {
createEmptyMovieClip("terrain2", man.getDepth() - 2);
terrain2.lineStyle(40, 6710886, 100);
if (imdrawing == false) {
terrain2.moveTo(_xmouse, _ymouse);
imdrawing = true;
xMouseStart = _xmouse;
yMouseStart = _ymouse;
}
}
}
function Drawing() {
if (((terrainVar == 1) && (imdrawing == true)) && (!man.nodrawhitbox.hitTest(_xmouse, _ymouse, true))) {
if (((air == false) && (!Key.isDown(65))) && (!Key.isDown(68))) {
terrain1.lineTo(_xmouse, _ymouse);
}
} else if (((terrainVar == 2) && (imdrawing == true)) && (!man.nodrawhitbox.hitTest(_xmouse, _ymouse, true))) {
if (((air == false) && (!Key.isDown(65))) && (!Key.isDown(68))) {
terrain2.lineTo(_xmouse, _ymouse);
}
}
if (imdrawing == false) {
lineDrawed = false;
}
if (imdrawing == true) {
if ((((_xmouse != xMouseStart) && (lineDrawed == false)) && (terrainVar == 1)) or (((_ymouse != yMouseStart) && (lineDrawed == false)) && (terrainVar == 1))) {
line1Drawn = true;
lineDrawed = true;
gray_so.data.totalLines++;
levelLinesPlayer++;
} else if (((_xmouse == xMouseStart) && (_ymouse == yMouseStart)) && (terrainVar == 1)) {
line1Drawn = false;
lineDrawed = false;
}
if ((((_xmouse != xMouseStart) && (lineDrawed == false)) && (terrainVar == 2)) or (((_ymouse != yMouseStart) && (lineDrawed == false)) && (terrainVar == 2))) {
line2Drawn = true;
lineDrawed = true;
gray_so.data.totalLines++;
levelLinesPlayer++;
} else if (((_xmouse == xMouseStart) && (_ymouse == yMouseStart)) && (terrainVar == 2)) {
line2Drawn = false;
lineDrawed = false;
}
if ((((air == true) or Key.isDown(65)) or Key.isDown(68)) or (gamePaused == true)) {
imdrawing = false;
}
if (man.nodrawhitbox.hitTest(_xmouse, _ymouse, true)) {
imdrawing = false;
}
if ((((_xmouse > 750) or (_xmouse < 0)) or (_ymouse > 500)) or (_ymouse < 0)) {
imdrawing = false;
}
}
if (Key.isDown(69) && (terrainKeySwitch == false)) {
terrainVar = terrainVar + 0;
terrainKeySwitch = true;
} else if (!Key.isDown(69)) {
terrainKeySwitch = false;
}
if (terrainVar > 2) {
terrainVar = 1;
}
}
function switches() {
if ((platforms.switch1.hitTest(man._x + _x, man._y + _y, true) or ((platforms.switch1.hitTest(terrain1) == true) && (line1Drawn == true))) or ((platforms.switch1.hitTest(terrain2) == true) && (line2Drawn == true))) {
switchdoor1open = true;
} else if (!platforms.switch1.hitTest(man._x + _x, man._y + _y, true)) {
switchdoor1open = false;
}
if (switchdoor1open == true) {
platforms.switch1.gotoAndStop(2);
if (platforms.plats.switchdoor1._rotation > -90) {
platforms.plats.switchdoor1._rotation = platforms.plats.switchdoor1._rotation - 3;
}
} else if (switchdoor1open == false) {
platforms.switch1.gotoAndStop(1);
if (platforms.plats.switchdoor1._rotation < 0) {
platforms.plats.switchdoor1._rotation = platforms.plats.switchdoor1._rotation + 3;
}
}
if ((platforms.switch2.hitTest(man._x + _x, man._y + _y, true) or ((platforms.switch2.hitTest(terrain1) == true) && (line1Drawn == true))) or ((platforms.switch2.hitTest(terrain2) == true) && (line2Drawn == true))) {
switchdoor2open = true;
} else if (!platforms.switch2.hitTest(man._x + _x, man._y + _y, true)) {
switchdoor2open = false;
}
if (switchdoor2open == true) {
platforms.switch2.gotoAndStop(2);
if (platforms.plats.switchdoor2._rotation > -90) {
platforms.plats.switchdoor2._rotation = platforms.plats.switchdoor2._rotation - 3;
}
} else if (switchdoor2open == false) {
platforms.switch2.gotoAndStop(1);
if (platforms.plats.switchdoor2._rotation < 0) {
platforms.plats.switchdoor2._rotation = platforms.plats.switchdoor2._rotation + 3;
}
}
if ((platforms.switch3.hitTest(man._x + _x, man._y + _y, true) or ((platforms.switch3.hitTest(terrain1) == true) && (line1Drawn == true))) or ((platforms.switch3.hitTest(terrain2) == true) && (line2Drawn == true))) {
switchdoor3open = true;
} else if (!platforms.switch3.hitTest(man._x + _x, man._y + _y, true)) {
switchdoor3open = false;
}
if (switchdoor3open == true) {
platforms.switch3.gotoAndStop(2);
if (platforms.plats.switchdoor3._rotation > -90) {
platforms.plats.switchdoor3._rotation = platforms.plats.switchdoor3._rotation - 3;
}
} else if (switchdoor3open == false) {
platforms.switch3.gotoAndStop(1);
if (platforms.plats.switchdoor3._rotation < 0) {
platforms.plats.switchdoor3._rotation = platforms.plats.switchdoor3._rotation + 3;
}
}
}
function doorHit() {
if (platforms.door.hitTest(man._x + _x, man._y + _y, true)) {
gamePaused = true;
if (fader._alpha < 100) {
fader._alpha = fader._alpha + 5;
} else if (((fader._alpha >= 100) && (noJumpMode == false)) && (leastLinesMode == false)) {
man.sprite._xscale = manXScale;
man.mudkip._xscale = mudkipXScale;
man.mage._xscale = mageXScale;
createEmptyMovieClip("terrain1", man.getDepth() - 1);
createEmptyMovieClip("terrain2", man.getDepth() - 2);
man._x = 375;
man._y = 250;
if (gray_so.data.lvlsavailable == 3) {
gray_so.data.lvlsavailable++;
}
gotoAndStop ("lvl4");
} else if (((fader._alpha >= 100) && (noJumpMode == true)) && (leastLinesMode == false)) {
gray_so.data.lvl3noJump = true;
gotoAndStop ("noJumps");
} else if (((fader._alpha >= 100) && (leastLinesMode == true)) && (noJumpMode == false)) {
if (levelLinesPlayer < gray_so.data.lvl3leastLinesPlayer) {
gray_so.data.lvl3leastLinesPlayer = levelLinesPlayer;
}
gotoAndStop ("leastLines");
}
}
}
function onMouseUp() {
imdrawing = false;
}
function onEnterFrame() {
displayText();
wallClinging = false;
xVar = man._x;
yVar = man._y;
testVar = ySpeed + yUp;
music();
cheats();
achievementsFunc();
pauseGame();
customCursor();
doorHit();
if (gamePaused == false) {
Drawing();
timerCounter();
man._x = man._x + xSpeed;
man._y = man._y + ySpeed;
manCollision();
moveScreen();
lookAround();
if (dead == false) {
if (fader._alpha > 0) {
fader._alpha = fader._alpha - 2;
}
kick();
manJump(-20);
managemanSprite();
onGround();
manageColor();
suicide();
spikesHit();
switches();
if ((Key.isDown(68) && (dodging == false)) && (wallClinging == false)) {
xSpeed = runSpeed;
} else if ((Key.isDown(65) && (dodging == false)) && (wallClinging == false)) {
xSpeed = -runSpeed;
} else if (((!Key.isDown(65)) && (!Key.isDown(68))) && (dodging == false)) {
xSpeed = 0;
}
} else {
man.sprite.gotoAndStop(4);
man.mudkip.gotoAndStop(4);
man.mage.gotoAndStop(4);
xSpeed = 0;
}
if (((man._x + xSpeed) > Stage.width) or ((man._x + xSpeed) < 0)) {
xSpeed = xSpeed - xSpeed;
} else if (dead == true) {
levelLinesPlayer = 0;
if (fader._alpha < 100) {
fader._alpha = fader._alpha + 5;
}
if (fader._alpha >= 100) {
dead = false;
deathsThisTime++;
man.sprite.gotoAndStop(1);
man.mudkip.gotoAndStop(1);
man.mage.gotoAndStop(1);
platforms._x = platx;
platforms._y = platy;
theBackground._x = backx;
theBackground._y = backy;
man._x = manx;
man._y = many;
createEmptyMovieClip("terrain1", man.getDepth() - 1);
createEmptyMovieClip("terrain2", man.getDepth() - 2);
}
}
}
}
function managemanSprite() {
if ((man.sprite._currentframe != 4) && (attack == false)) {
if ((air == false) && (wallClinging == false)) {
if (((Key.isDown(68) == false) && (Key.isDown(65) == false)) && (dodging == false)) {
man.sprite.gotoAndStop(1);
} else if (((Key.isDown(68) == true) && (dodging == false)) or ((Key.isDown(65) == true) && (dodging == false))) {
if (Key.isDown(68) && (dodging == false)) {
man.sprite._xscale = manXScale;
} else if (Key.isDown(65) && (dodging == false)) {
man.sprite._xscale = -manXScale;
}
man.sprite.gotoAndStop(2);
}
} else if (((air == true) && (dodging == false)) && (wallClinging == false)) {
man.sprite.gotoAndStop(3);
} else if (wallClinging == true) {
man.sprite.gotoAndStop(6);
}
} else if ((man.sprite._currentframe != 4) && (attack == true)) {
if (kicking == true) {
man.sprite.gotoAndStop(7);
}
}
}
function manageColor() {
if (man.sprite._xscale == (-manXScale)) {
man.sprite.bwhite.blendMode = "invert";
} else if (man.sprite._xscale == manXScale) {
man.sprite.bwhite.blendMode = "alpha";
}
}
function manJump(jumpHeight) {
if ((((((Key.isDown(87) && (noJumpMode == false)) && (!Key.isDown(70))) && (jumpKeySwitch == false)) && (doubleJump < 2)) && (noJump == false)) && (ySpeed > -1)) {
gray_so.data.totalJumps++;
jumpKeySwitch = true;
jumping = true;
doubleJump++;
air = true;
yUp = 0;
wallClinging = false;
gravity = 2;
man.sprite.inSprite.play();
man.sprite.bwhite.play();
man.sprite.outline.play();
if (ySpeed > -5) {
ySpeed = jumpHeight;
}
if ((doubleJump >= 2) && (ySpeed < -5)) {
ySpeed = jumpHeight;
}
} else if (Key.isDown(87) == false) {
jumpKeySwitch = false;
}
if ((jumping == true) && (ySpeed > 0)) {
jumping = false;
}
}
function onGround() {
if (((platforms.plats.hitTest(man._x + _x, ((man._y + 38) - yUp) + _y, true) or terrain1.hitTest(man._x + _x, ((man._y + 38) - yUp) + _y, true)) or terrain2.hitTest(man._x + _x, ((man._y + 38) - yUp) + _y, true)) or (wallClinging == true)) {
gravity = 2;
air = false;
doubleJump = 1;
} else {
air = true;
man._rotation = 0;
if (ySpeed < 15) {
ySpeed = ySpeed + gravity;
}
}
}
function manCollision() {
yUp = 0;
while ((platforms.plats.hitTest(man._x + _x, (((man._y + 35) + yUp) + _y) - 4, true) or terrain1.hitTest(man._x + _x, (((man._y + 35) + yUp) + _y) - 4, true)) or terrain2.hitTest(man._x + _x, (((man._y + 35) + yUp) + _y) - 4, true)) {
yUp--;
if (((Key.isDown(65) && (air == false)) && (jumping == false)) or ((Key.isDown(68) && (air == false)) && (jumping == false))) {
if ((yUp < ySpeed) && (man.sprite._xscale == (-manXScale))) {
man._rotation = ((-(yUp - ySpeed)) * 3) - (ySpeed * 6.15);
} else if ((yUp > ySpeed) && (man.sprite._xscale == manXScale)) {
man._rotation = ((yUp - ySpeed) * 3) + (ySpeed * 6.15);
} else if ((yUp > ySpeed) && (man.sprite._xscale == (-manXScale))) {
man._rotation = ((-(yUp - ySpeed)) * 3) - (ySpeed * 6.15);
} else if ((yUp < ySpeed) && (man.sprite._xscale == manXScale)) {
man._rotation = ((yUp - ySpeed) * 3) + (ySpeed * 6.15);
}
}
}
if ((platforms.plats.hitTest(man._x + _x, ((man._y - 35) + yUp) + _y, true) or terrain1.hitTest(man._x + _x, ((man._y - 35) + yUp) + _y, true)) or terrain2.hitTest(man._x + _x, ((man._y - 35) + yUp) + _y, true)) {
yUp = -ySpeed;
}
while ((((xSpeed != 0) && (platforms.plats.hitTest((man._x + xSpeed) + _x, ((man._y - 35) + yUp) + _y, true))) or ((xSpeed != 0) && (terrain1.hitTest((man._x + xSpeed) + _x, ((man._y - 35) + yUp) + _y, true)))) or ((xSpeed != 0) && (terrain2.hitTest((man._x + xSpeed) + _x, ((man._y - 35) + yUp) + _y, true)))) {
man._x = man._x - xSpeed;
}
if (((yUp == 0) && (ySpeed == 0)) && (air == false)) {
yUp = -16;
ySpeed = 16;
}
if ((yUp < -50) && (ySpeed > 0)) {
xSpeed = 0;
yUp = -ySpeed;
} else if ((yUp < -50) && (ySpeed < 0)) {
yUp = -15;
}
noJump = false;
man._y = man._y + yUp;
collideVar = yUp - ySpeed;
while ((((((platforms.plats.hitTest((man._x + xSpeed) + _x, man._y + _y, true) && (xSpeed != 0)) or (platforms.plats.hitTest((man._x + xSpeed) + _x, man._y + _y, true) && (xSpeed != 0))) or (terrain1.hitTest((man._x + xSpeed) + _x, man._y + _y, true) && (xSpeed != 0))) or (terrain1.hitTest((man._x + xSpeed) + _x, man._y + _y, true) && (xSpeed != 0))) or (terrain2.hitTest((man._x + xSpeed) + _x, man._y + _y, true) && (xSpeed != 0))) or (terrain2.hitTest((man._x + xSpeed) + _x, man._y + _y, true) && (xSpeed != 0))) {
man._x = man._x - xSpeed;
}
while ((xSpeed == 0) && (platforms.plats.hitTest((man._x - 20) + _x, man._y + _y, true))) {
man._x = man._x + 21;
}
while ((xSpeed == 0) && (platforms.plats.hitTest((man._x + 20) + _x, man._y + _y, true))) {
man._x = man._x - 21;
}
}
function moveScreen() {
if (man._x > (Stage.width - 250)) {
platforms._x = platforms._x - runSpeed;
terrain1._x = terrain1._x - runSpeed;
terrain2._x = terrain2._x - runSpeed;
man._x = man._x - runSpeed;
theBackground._x = theBackground._x - (runSpeed / 8);
}
if (man._x < 250) {
platforms._x = platforms._x + runSpeed;
terrain1._x = terrain1._x + runSpeed;
terrain2._x = terrain2._x + runSpeed;
man._x = man._x + runSpeed;
theBackground._x = theBackground._x + (runSpeed / 8);
}
if (((man._y + ySpeed) + yUp) > (Stage.height - 150)) {
platforms._y = platforms._y - (ySpeed + yUp);
terrain1._y = terrain1._y - (ySpeed + yUp);
terrain2._y = terrain2._y - (ySpeed + yUp);
man._y = man._y - (ySpeed + yUp);
theBackground._y = theBackground._y - ((ySpeed + yUp) / 8);
}
if (((man._y + ySpeed) + yUp) < 150) {
platforms._y = platforms._y - (ySpeed + yUp);
terrain1._y = terrain1._y - (ySpeed + yUp);
terrain2._y = terrain2._y - (ySpeed + yUp);
man._y = man._y - (ySpeed + yUp);
theBackground._y = theBackground._y - ((ySpeed + yUp) / 8);
}
if (((man._y + ySpeed) + yUp) < 125) {
platforms._y = platforms._y - ((ySpeed + yUp) - 26);
terrain1._y = terrain1._y - ((ySpeed + yUp) - 26);
terrain2._y = terrain2._y - ((ySpeed + yUp) - 26);
man._y = man._y - ((ySpeed + yUp) - 26);
theBackground._y = theBackground._y - (((ySpeed + yUp) - 26) / 8);
}
if (((man._y + ySpeed) + yUp) > (Stage.height - 125)) {
platforms._y = platforms._y - ((ySpeed + yUp) + 26);
terrain1._y = terrain1._y - ((ySpeed + yUp) + 26);
terrain2._y = terrain2._y - ((ySpeed + yUp) + 26);
man._y = man._y - ((ySpeed + yUp) + 26);
theBackground._y = theBackground._y - (((ySpeed + yUp) + 26) / 8);
}
if ((((man._y + ySpeed) + yUp) < 139) && (Key.isDown(70))) {
platforms._y = platforms._y - ((ySpeed + yUp) - 15);
terrain1._y = terrain1._y - ((ySpeed + yUp) - 15);
terrain2._y = terrain2._y - ((ySpeed + yUp) - 15);
man._y = man._y - ((ySpeed + yUp) - 15);
theBackground._y = theBackground._y - (((ySpeed + yUp) - 15) / 8);
}
if ((((man._y + ySpeed) + yUp) > (Stage.height - 139)) && (Key.isDown(70))) {
platforms._y = platforms._y - ((ySpeed + yUp) + 15);
terrain1._y = terrain1._y - ((ySpeed + yUp) + 15);
terrain2._y = terrain2._y - ((ySpeed + yUp) + 15);
man._y = man._y - ((ySpeed + yUp) + 15);
theBackground._y = theBackground._y - (((ySpeed + yUp) + 15) / 8);
}
}
function lookAround() {
if (((Key.isDown(70) && (air == false)) && (!Key.isDown(65))) && (!Key.isDown(68))) {
imdrawing = false;
if (_xmouse > (Stage.width - 250)) {
platforms._x = platforms._x - runSpeed;
terrain1._x = terrain1._x - runSpeed;
terrain2._x = terrain2._x - runSpeed;
man._x = man._x - runSpeed;
theBackground._x = theBackground._x - (runSpeed / 8);
}
if (_xmouse < 250) {
platforms._x = platforms._x + runSpeed;
terrain1._x = terrain1._x + runSpeed;
terrain2._x = terrain2._x + runSpeed;
man._x = man._x + runSpeed;
theBackground._x = theBackground._x + (runSpeed / 8);
}
if (_ymouse < 139) {
platforms._y = platforms._y - ((ySpeed + yUp) - 15);
terrain1._y = terrain1._y - ((ySpeed + yUp) - 15);
terrain2._y = terrain2._y - ((ySpeed + yUp) - 15);
man._y = man._y - ((ySpeed + yUp) - 15);
theBackground._y = theBackground._y - (((ySpeed + yUp) - 15) / 8);
}
if (_ymouse > (Stage.height - 139)) {
platforms._y = platforms._y - ((ySpeed + yUp) + 15);
terrain1._y = terrain1._y - ((ySpeed + yUp) + 15);
terrain2._y = terrain2._y - ((ySpeed + yUp) + 15);
man._y = man._y - ((ySpeed + yUp) + 15);
theBackground._y = theBackground._y - (((ySpeed + yUp) + 15) / 8);
}
}
}
function customCursor() {
cursor.gotoAndStop(terrainVar);
linecolor.gotoAndStop(terrainVar);
cursor._x = _xmouse;
cursor._y = _ymouse;
cursor._rotation = cursor._rotation + 3;
}
function wallCling() {
if ((platforms.plats.hitTest(((man._x + xSpeed) + 16) + _x, (man._y - 60) + _y, true) && (air == true)) && (Key.isDown(39))) {
man.sprite._xscale = -manXScale;
wallClinging = true;
air = false;
ySpeed = 0;
doubleJump = 0;
} else if ((platforms.plats.hitTest(((man._x + xSpeed) - 16) + _x, man._y + _y, true) && (air == true)) && (Key.isDown(37))) {
man.sprite._xscale = manXScale;
wallClinging = true;
air = false;
ySpeed = 0;
doubleJump = 0;
}
if ((air == true) or Key.isDown(40)) {
wallClinging = false;
}
}
function manDodge() {
if (((Key.isDown(40) && (Key.isDown(68))) && (dodgeSwitch == false)) && (wallClinging == false)) {
dodging = "right";
dodgeSwitch = true;
} else if (((Key.isDown(40) && (Key.isDown(65))) && (dodgeSwitch == false)) && (wallClinging == false)) {
dodging = "left";
dodgeSwitch = true;
}
if (dodging == "right") {
man.sprite._xscale = manXScale;
man.sprite.gotoAndStop(5);
xSpeed = 25;
dodgeSwitch == true;
} else if (dodging == "left") {
man.sprite._xscale = -manXScale;
man.sprite.gotoAndStop(5);
xSpeed = -25;
dodgeSwitch == true;
}
if (!Key.isDown(40)) {
dodgeSwitch = false;
}
}
function spikesHit() {
if (((platforms.spikes.hitTest(man._x + _x, man._y + _y, true) or platforms.spikes2.hitTest(man._x + _x, man._y + _y, true)) or platforms.spikes3.hitTest(man._x + _x, man._y + _y, true)) or platforms.spikes4.hitTest(man._x + _x, man._y + _y, true)) {
gray_so.data.totalDeaths++;
currentDeaths++;
dead = true;
}
}
function kick() {
if (Key.isDown(32) && (kickKeySwitch == false)) {
attack = true;
kicking = true;
kickKeySwitch = true;
} else if (!Key.isDown(32)) {
kickKeySwitch = false;
}
}
function suicide() {
if (Key.isDown(13) && (suicideSwitch == false)) {
dead = true;
suicideSwitch = true;
}
if (!Key.isDown(13)) {
suicideSwitch = false;
}
}
function pauseGame() {
if (((Key.isDown(27) && (pauseSwitch == false)) && (gamePaused == false)) && (dead == false)) {
gamePaused = true;
imdrawing = false;
pauseScreen._visible = true;
inverter._visible = true;
pauseSwitch = true;
} else if ((Key.isDown(27) && (pauseSwitch == false)) && (gamePaused == true)) {
gamePaused = false;
pauseScreen._visible = false;
inverter._visible = false;
pauseSwitch = true;
} else if (!Key.isDown(27)) {
pauseSwitch = false;
}
}
function cheats() {
if (mudkipcheat == true) {
man.sprite._visible = false;
man.mudkip._visible = true;
man.mage._visible = false;
if ((man.mudkip._currentframe != 4) && (attack == false)) {
if (air == false) {
if ((Key.isDown(68) == false) && (Key.isDown(65) == false)) {
man.mudkip.gotoAndStop(1);
} else if ((Key.isDown(68) == true) or (Key.isDown(65) == true)) {
if (Key.isDown(68)) {
man.mudkip._xscale = mudkipXScale;
} else if (Key.isDown(65)) {
man.mudkip._xscale = -mudkipXScale;
}
man.mudkip.gotoAndStop(2);
}
} else if (air == true) {
man.mudkip.gotoAndStop(3);
}
if (Key.isDown(32) && (kickKeySwitch == false)) {
if (man.mudkip.inSprite.head._currentframe == 1) {
mudkipMouthOpen = true;
} else if (man.mudkip.inSprite.head._currentframe == 2) {
mudkipMouthOpen = false;
}
}
if (mudkipMouthOpen == true) {
man.mudkip.inSprite.head.gotoAndStop(2);
} else {
man.mudkip.inSprite.head.gotoAndStop(1);
}
}
} else if (magecheat == true) {
man.sprite._visible = false;
man.mudkip._visible = false;
man.mage._visible = true;
if ((man.mage._currentframe != 4) && (attack == false)) {
if (air == false) {
if ((Key.isDown(68) == false) && (Key.isDown(65) == false)) {
man.mage.gotoAndStop(1);
} else if ((Key.isDown(68) == true) or (Key.isDown(65) == true)) {
if (Key.isDown(68)) {
man.mage._xscale = mageXScale;
} else if (Key.isDown(65)) {
man.mage._xscale = -mageXScale;
}
man.mage.gotoAndStop(2);
}
} else if (air == true) {
man.mage.gotoAndStop(3);
}
}
} else if ((mudkipcheat == false) && (magecheat == false)) {
man.sprite._visible = true;
man.mudkip._visible = false;
man.mage._visible = false;
}
}
function achievementsFunc() {
if ((gray_so.data.totalDeaths == 100) && (gray_so.data.deathachievementplayed != true)) {
achpopup.dontfearthereaper._visible = true;
gray_so.data.deathachievementplayed = true;
achpopup.gotoAndPlay("start");
}
if ((gray_so.data.totalLines > 900) && (gray_so.data.over9000achievementplayed != true)) {
achpopup.over9000._visible = true;
gray_so.data.over9000achievementplayed = true;
achpopup.gotoAndPlay("start");
}
}
function timerCounter() {
timerPart++;
if (timerPart == 40) {
timer++;
gray_so.data.totalTimer++;
timerPart = 0;
}
}
stop();
pauseScreen._visible = false;
inverter._visible = false;
Mouse.hide();
platx = platforms._x;
platy = platforms._y;
backx = theBackground._x;
backy = theBackground._y;
manx = man._x;
many = man._y;
dead = false;
gamePaused = false;
dodging = false;
var attack = false;
var kicking = false;
var manstate = 1;
var runSpeed = 15;
var xSpeed = 0;
var ySpeed = 0;
var jumping = false;
var jumpKeySwitch = false;
var mudkipXScale = man.mudkip._xscale;
var mageXScale = man.mage._xscale;
var manXScale = man.sprite._xscale;
var gravity = 2;
var color = new Color("_root.man");
var imdrawing = false;
var terrainVar = 1;
Frame 19
function onMouseDown() {
if ((terrainVar == 1) && (gamePaused == false)) {
createEmptyMovieClip("terrain1", man.getDepth() - 1);
terrain1.lineStyle(40, 3355443, 100);
if (imdrawing == false) {
terrain1.moveTo(_xmouse, _ymouse);
imdrawing = true;
xMouseStart = _xmouse;
yMouseStart = _ymouse;
}
} else if ((terrainVar == 20) && (gamePaused == false)) {
createEmptyMovieClip("terrain2", man.getDepth() - 2);
terrain2.lineStyle(40, 6710886, 100);
if (imdrawing == false) {
terrain2.moveTo(_xmouse, _ymouse);
imdrawing = true;
xMouseStart = _xmouse;
yMouseStart = _ymouse;
}
}
}
function Drawing() {
if (((terrainVar == 1) && (imdrawing == true)) && (!man.nodrawhitbox.hitTest(_xmouse, _ymouse, true))) {
if (((air == false) && (!Key.isDown(65))) && (!Key.isDown(68))) {
terrain1.lineTo(_xmouse, _ymouse);
}
} else if (((terrainVar == 2) && (imdrawing == true)) && (!man.nodrawhitbox.hitTest(_xmouse, _ymouse, true))) {
if (((air == false) && (!Key.isDown(65))) && (!Key.isDown(68))) {
terrain2.lineTo(_xmouse, _ymouse);
}
}
if (imdrawing == false) {
lineDrawed = false;
}
if (imdrawing == true) {
if ((((_xmouse != xMouseStart) && (lineDrawed == false)) && (terrainVar == 1)) or (((_ymouse != yMouseStart) && (lineDrawed == false)) && (terrainVar == 1))) {
line1Drawn = true;
lineDrawed = true;
gray_so.data.totalLines++;
levelLinesPlayer++;
} else if (((_xmouse == xMouseStart) && (_ymouse == yMouseStart)) && (terrainVar == 1)) {
line1Drawn = false;
lineDrawed = false;
}
if ((((_xmouse != xMouseStart) && (lineDrawed == false)) && (terrainVar == 2)) or (((_ymouse != yMouseStart) && (lineDrawed == false)) && (terrainVar == 2))) {
line2Drawn = true;
lineDrawed = true;
gray_so.data.totalLines++;
levelLinesPlayer++;
} else if (((_xmouse == xMouseStart) && (_ymouse == yMouseStart)) && (terrainVar == 2)) {
line2Drawn = false;
lineDrawed = false;
}
if ((((air == true) or Key.isDown(65)) or Key.isDown(68)) or (gamePaused == true)) {
imdrawing = false;
}
if (man.nodrawhitbox.hitTest(_xmouse, _ymouse, true)) {
imdrawing = false;
}
if ((((_xmouse > 750) or (_xmouse < 0)) or (_ymouse > 500)) or (_ymouse < 0)) {
imdrawing = false;
}
}
if (Key.isDown(69) && (terrainKeySwitch == false)) {
terrainVar = terrainVar + 0;
terrainKeySwitch = true;
} else if (!Key.isDown(69)) {
terrainKeySwitch = false;
}
if (terrainVar > 2) {
terrainVar = 1;
}
}
function switches() {
if ((platforms.switch1.hitTest(man._x + _x, man._y + _y, true) or ((platforms.switch1.hitTest(terrain1) == true) && (line1Drawn == true))) or ((platforms.switch1.hitTest(terrain2) == true) && (line2Drawn == true))) {
switchdoor1open = true;
} else if (!platforms.switch1.hitTest(man._x + _x, man._y + _y, true)) {
switchdoor1open = false;
}
if (switchdoor1open == true) {
platforms.switch1.gotoAndStop(2);
if (platforms.plats.switchdoor1._rotation > -90) {
platforms.plats.switchdoor1._rotation = platforms.plats.switchdoor1._rotation - 3;
}
} else if (switchdoor1open == false) {
platforms.switch1.gotoAndStop(1);
if (platforms.plats.switchdoor1._rotation < 0) {
platforms.plats.switchdoor1._rotation = platforms.plats.switchdoor1._rotation + 3;
}
}
if ((platforms.switch2.hitTest(man._x + _x, man._y + _y, true) or ((platforms.switch2.hitTest(terrain1) == true) && (line1Drawn == true))) or ((platforms.switch2.hitTest(terrain2) == true) && (line2Drawn == true))) {
switchdoor2open = true;
} else if (!platforms.switch2.hitTest(man._x + _x, man._y + _y, true)) {
switchdoor2open = false;
}
if (switchdoor2open == true) {
platforms.switch2.gotoAndStop(2);
if (platforms.plats.switchdoor2._rotation > -90) {
platforms.plats.switchdoor2._rotation = platforms.plats.switchdoor2._rotation - 3;
}
} else if (switchdoor2open == false) {
platforms.switch2.gotoAndStop(1);
if (platforms.plats.switchdoor2._rotation < 0) {
platforms.plats.switchdoor2._rotation = platforms.plats.switchdoor2._rotation + 3;
}
}
if ((platforms.switch3.hitTest(man._x + _x, man._y + _y, true) or ((platforms.switch3.hitTest(terrain1) == true) && (line1Drawn == true))) or ((platforms.switch3.hitTest(terrain2) == true) && (line2Drawn == true))) {
switchdoor3open = true;
} else if (!platforms.switch3.hitTest(man._x + _x, man._y + _y, true)) {
switchdoor3open = false;
}
if (switchdoor3open == true) {
platforms.switch3.gotoAndStop(2);
if (platforms.plats.switchdoor3._rotation > -90) {
platforms.plats.switchdoor3._rotation = platforms.plats.switchdoor3._rotation - 3;
}
} else if (switchdoor3open == false) {
platforms.switch3.gotoAndStop(1);
if (platforms.plats.switchdoor3._rotation < 0) {
platforms.plats.switchdoor3._rotation = platforms.plats.switchdoor3._rotation + 3;
}
}
}
function doorHit() {
if (platforms.door.hitTest(man._x + _x, man._y + _y, true)) {
gamePaused = true;
if (fader._alpha < 100) {
fader._alpha = fader._alpha + 5;
} else if (((fader._alpha >= 100) && (noJumpMode == false)) && (leastLinesMode == false)) {
man.sprite._xscale = manXScale;
man.mudkip._xscale = mudkipXScale;
man.mage._xscale = mageXScale;
createEmptyMovieClip("terrain1", man.getDepth() - 1);
createEmptyMovieClip("terrain2", man.getDepth() - 2);
man._x = 375;
man._y = 250;
if (gray_so.data.lvlsavailable == 4) {
gray_so.data.lvlsavailable++;
}
gotoAndStop ("lvl5");
} else if (((fader._alpha >= 100) && (noJumpMode == true)) && (leastLinesMode == false)) {
gray_so.data.lvl4noJump = true;
gotoAndStop ("noJumps");
} else if (((fader._alpha >= 100) && (leastLinesMode == true)) && (noJumpMode == false)) {
if (levelLinesPlayer < gray_so.data.lvl4leastLinesPlayer) {
gray_so.data.lvl4leastLinesPlayer = levelLinesPlayer;
}
gotoAndStop ("leastLines");
}
}
}
function onMouseUp() {
imdrawing = false;
}
function onEnterFrame() {
displayText();
wallClinging = false;
xVar = man._x;
yVar = man._y;
testVar = ySpeed + yUp;
music();
cheats();
achievementsFunc();
pauseGame();
customCursor();
doorHit();
if (gamePaused == false) {
Drawing();
timerCounter();
man._x = man._x + xSpeed;
man._y = man._y + ySpeed;
manCollision();
moveScreen();
lookAround();
if (dead == false) {
if (fader._alpha > 0) {
fader._alpha = fader._alpha - 2;
}
kick();
manJump(-20);
managemanSprite();
onGround();
manageColor();
suicide();
spikesHit();
switches();
if ((Key.isDown(68) && (dodging == false)) && (wallClinging == false)) {
xSpeed = runSpeed;
} else if ((Key.isDown(65) && (dodging == false)) && (wallClinging == false)) {
xSpeed = -runSpeed;
} else if (((!Key.isDown(65)) && (!Key.isDown(68))) && (dodging == false)) {
xSpeed = 0;
}
} else {
man.sprite.gotoAndStop(4);
man.mudkip.gotoAndStop(4);
man.mage.gotoAndStop(4);
xSpeed = 0;
}
if (((man._x + xSpeed) > Stage.width) or ((man._x + xSpeed) < 0)) {
xSpeed = xSpeed - xSpeed;
} else if (dead == true) {
levelLinesPlayer = 0;
if (fader._alpha < 100) {
fader._alpha = fader._alpha + 5;
}
if (fader._alpha >= 100) {
dead = false;
deathsThisTime++;
man.sprite.gotoAndStop(1);
man.mudkip.gotoAndStop(1);
man.mage.gotoAndStop(1);
platforms._x = platx;
platforms._y = platy;
theBackground._x = backx;
theBackground._y = backy;
man._x = manx;
man._y = many;
createEmptyMovieClip("terrain1", man.getDepth() - 1);
createEmptyMovieClip("terrain2", man.getDepth() - 2);
}
}
}
}
function managemanSprite() {
if ((man.sprite._currentframe != 4) && (attack == false)) {
if ((air == false) && (wallClinging == false)) {
if (((Key.isDown(68) == false) && (Key.isDown(65) == false)) && (dodging == false)) {
man.sprite.gotoAndStop(1);
} else if (((Key.isDown(68) == true) && (dodging == false)) or ((Key.isDown(65) == true) && (dodging == false))) {
if (Key.isDown(68) && (dodging == false)) {
man.sprite._xscale = manXScale;
} else if (Key.isDown(65) && (dodging == false)) {
man.sprite._xscale = -manXScale;
}
man.sprite.gotoAndStop(2);
}
} else if (((air == true) && (dodging == false)) && (wallClinging == false)) {
man.sprite.gotoAndStop(3);
} else if (wallClinging == true) {
man.sprite.gotoAndStop(6);
}
} else if ((man.sprite._currentframe != 4) && (attack == true)) {
if (kicking == true) {
man.sprite.gotoAndStop(7);
}
}
}
function manageColor() {
if (man.sprite._xscale == (-manXScale)) {
man.sprite.bwhite.blendMode = "invert";
} else if (man.sprite._xscale == manXScale) {
man.sprite.bwhite.blendMode = "alpha";
}
}
function manJump(jumpHeight) {
if ((((((Key.isDown(87) && (noJumpMode == false)) && (!Key.isDown(70))) && (jumpKeySwitch == false)) && (doubleJump < 2)) && (noJump == false)) && (ySpeed > -1)) {
gray_so.data.totalJumps++;
jumpKeySwitch = true;
jumping = true;
doubleJump++;
air = true;
yUp = 0;
wallClinging = false;
gravity = 2;
man.sprite.inSprite.play();
man.sprite.bwhite.play();
man.sprite.outline.play();
if (ySpeed > -5) {
ySpeed = jumpHeight;
}
if ((doubleJump >= 2) && (ySpeed < -5)) {
ySpeed = jumpHeight;
}
} else if (Key.isDown(87) == false) {
jumpKeySwitch = false;
}
if ((jumping == true) && (ySpeed > 0)) {
jumping = false;
}
}
function onGround() {
if (((platforms.plats.hitTest(man._x + _x, ((man._y + 38) - yUp) + _y, true) or terrain1.hitTest(man._x + _x, ((man._y + 38) - yUp) + _y, true)) or terrain2.hitTest(man._x + _x, ((man._y + 38) - yUp) + _y, true)) or (wallClinging == true)) {
gravity = 2;
air = false;
doubleJump = 1;
} else {
air = true;
man._rotation = 0;
if (ySpeed < 15) {
ySpeed = ySpeed + gravity;
}
}
}
function manCollision() {
yUp = 0;
while ((platforms.plats.hitTest(man._x + _x, (((man._y + 35) + yUp) + _y) - 4, true) or terrain1.hitTest(man._x + _x, (((man._y + 35) + yUp) + _y) - 4, true)) or terrain2.hitTest(man._x + _x, (((man._y + 35) + yUp) + _y) - 4, true)) {
yUp--;
if (((Key.isDown(65) && (air == false)) && (jumping == false)) or ((Key.isDown(68) && (air == false)) && (jumping == false))) {
if ((yUp < ySpeed) && (man.sprite._xscale == (-manXScale))) {
man._rotation = ((-(yUp - ySpeed)) * 3) - (ySpeed * 6.15);
} else if ((yUp > ySpeed) && (man.sprite._xscale == manXScale)) {
man._rotation = ((yUp - ySpeed) * 3) + (ySpeed * 6.15);
} else if ((yUp > ySpeed) && (man.sprite._xscale == (-manXScale))) {
man._rotation = ((-(yUp - ySpeed)) * 3) - (ySpeed * 6.15);
} else if ((yUp < ySpeed) && (man.sprite._xscale == manXScale)) {
man._rotation = ((yUp - ySpeed) * 3) + (ySpeed * 6.15);
}
}
}
if ((platforms.plats.hitTest(man._x + _x, ((man._y - 35) + yUp) + _y, true) or terrain1.hitTest(man._x + _x, ((man._y - 35) + yUp) + _y, true)) or terrain2.hitTest(man._x + _x, ((man._y - 35) + yUp) + _y, true)) {
yUp = -ySpeed;
}
while ((((xSpeed != 0) && (platforms.plats.hitTest((man._x + xSpeed) + _x, ((man._y - 35) + yUp) + _y, true))) or ((xSpeed != 0) && (terrain1.hitTest((man._x + xSpeed) + _x, ((man._y - 35) + yUp) + _y, true)))) or ((xSpeed != 0) && (terrain2.hitTest((man._x + xSpeed) + _x, ((man._y - 35) + yUp) + _y, true)))) {
man._x = man._x - xSpeed;
}
if (((yUp == 0) && (ySpeed == 0)) && (air == false)) {
yUp = -16;
ySpeed = 16;
}
if ((yUp < -50) && (ySpeed > 0)) {
xSpeed = 0;
yUp = -ySpeed;
} else if ((yUp < -50) && (ySpeed < 0)) {
yUp = -15;
}
noJump = false;
man._y = man._y + yUp;
collideVar = yUp - ySpeed;
while ((((((platforms.plats.hitTest((man._x + xSpeed) + _x, man._y + _y, true) && (xSpeed != 0)) or (platforms.plats.hitTest((man._x + xSpeed) + _x, man._y + _y, true) && (xSpeed != 0))) or (terrain1.hitTest((man._x + xSpeed) + _x, man._y + _y, true) && (xSpeed != 0))) or (terrain1.hitTest((man._x + xSpeed) + _x, man._y + _y, true) && (xSpeed != 0))) or (terrain2.hitTest((man._x + xSpeed) + _x, man._y + _y, true) && (xSpeed != 0))) or (terrain2.hitTest((man._x + xSpeed) + _x, man._y + _y, true) && (xSpeed != 0))) {
man._x = man._x - xSpeed;
}
while ((xSpeed == 0) && (platforms.plats.hitTest((man._x - 20) + _x, man._y + _y, true))) {
man._x = man._x + 21;
}
while ((xSpeed == 0) && (platforms.plats.hitTest((man._x + 20) + _x, man._y + _y, true))) {
man._x = man._x - 21;
}
}
function moveScreen() {
if (man._x > (Stage.width - 250)) {
platforms._x = platforms._x - runSpeed;
terrain1._x = terrain1._x - runSpeed;
terrain2._x = terrain2._x - runSpeed;
man._x = man._x - runSpeed;
theBackground._x = theBackground._x - (runSpeed / 8);
}
if (man._x < 250) {
platforms._x = platforms._x + runSpeed;
terrain1._x = terrain1._x + runSpeed;
terrain2._x = terrain2._x + runSpeed;
man._x = man._x + runSpeed;
theBackground._x = theBackground._x + (runSpeed / 8);
}
if (((man._y + ySpeed) + yUp) > (Stage.height - 150)) {
platforms._y = platforms._y - (ySpeed + yUp);
terrain1._y = terrain1._y - (ySpeed + yUp);
terrain2._y = terrain2._y - (ySpeed + yUp);
man._y = man._y - (ySpeed + yUp);
theBackground._y = theBackground._y - ((ySpeed + yUp) / 8);
}
if (((man._y + ySpeed) + yUp) < 150) {
platforms._y = platforms._y - (ySpeed + yUp);
terrain1._y = terrain1._y - (ySpeed + yUp);
terrain2._y = terrain2._y - (ySpeed + yUp);
man._y = man._y - (ySpeed + yUp);
theBackground._y = theBackground._y - ((ySpeed + yUp) / 8);
}
if (((man._y + ySpeed) + yUp) < 125) {
platforms._y = platforms._y - ((ySpeed + yUp) - 26);
terrain1._y = terrain1._y - ((ySpeed + yUp) - 26);
terrain2._y = terrain2._y - ((ySpeed + yUp) - 26);
man._y = man._y - ((ySpeed + yUp) - 26);
theBackground._y = theBackground._y - (((ySpeed + yUp) - 26) / 8);
}
if (((man._y + ySpeed) + yUp) > (Stage.height - 125)) {
platforms._y = platforms._y - ((ySpeed + yUp) + 26);
terrain1._y = terrain1._y - ((ySpeed + yUp) + 26);
terrain2._y = terrain2._y - ((ySpeed + yUp) + 26);
man._y = man._y - ((ySpeed + yUp) + 26);
theBackground._y = theBackground._y - (((ySpeed + yUp) + 26) / 8);
}
if ((((man._y + ySpeed) + yUp) < 139) && (Key.isDown(70))) {
platforms._y = platforms._y - ((ySpeed + yUp) - 15);
terrain1._y = terrain1._y - ((ySpeed + yUp) - 15);
terrain2._y = terrain2._y - ((ySpeed + yUp) - 15);
man._y = man._y - ((ySpeed + yUp) - 15);
theBackground._y = theBackground._y - (((ySpeed + yUp) - 15) / 8);
}
if ((((man._y + ySpeed) + yUp) > (Stage.height - 139)) && (Key.isDown(70))) {
platforms._y = platforms._y - ((ySpeed + yUp) + 15);
terrain1._y = terrain1._y - ((ySpeed + yUp) + 15);
terrain2._y = terrain2._y - ((ySpeed + yUp) + 15);
man._y = man._y - ((ySpeed + yUp) + 15);
theBackground._y = theBackground._y - (((ySpeed + yUp) + 15) / 8);
}
}
function lookAround() {
if (((Key.isDown(70) && (air == false)) && (!Key.isDown(65))) && (!Key.isDown(68))) {
imdrawing = false;
if (_xmouse > (Stage.width - 250)) {
platforms._x = platforms._x - runSpeed;
terrain1._x = terrain1._x - runSpeed;
terrain2._x = terrain2._x - runSpeed;
man._x = man._x - runSpeed;
theBackground._x = theBackground._x - (runSpeed / 8);
}
if (_xmouse < 250) {
platforms._x = platforms._x + runSpeed;
terrain1._x = terrain1._x + runSpeed;
terrain2._x = terrain2._x + runSpeed;
man._x = man._x + runSpeed;
theBackground._x = theBackground._x + (runSpeed / 8);
}
if (_ymouse < 139) {
platforms._y = platforms._y - ((ySpeed + yUp) - 15);
terrain1._y = terrain1._y - ((ySpeed + yUp) - 15);
terrain2._y = terrain2._y - ((ySpeed + yUp) - 15);
man._y = man._y - ((ySpeed + yUp) - 15);
theBackground._y = theBackground._y - (((ySpeed + yUp) - 15) / 8);
}
if (_ymouse > (Stage.height - 139)) {
platforms._y = platforms._y - ((ySpeed + yUp) + 15);
terrain1._y = terrain1._y - ((ySpeed + yUp) + 15);
terrain2._y = terrain2._y - ((ySpeed + yUp) + 15);
man._y = man._y - ((ySpeed + yUp) + 15);
theBackground._y = theBackground._y - (((ySpeed + yUp) + 15) / 8);
}
}
}
function customCursor() {
cursor.gotoAndStop(terrainVar);
linecolor.gotoAndStop(terrainVar);
cursor._x = _xmouse;
cursor._y = _ymouse;
cursor._rotation = cursor._rotation + 3;
}
function wallCling() {
if ((platforms.plats.hitTest(((man._x + xSpeed) + 16) + _x, (man._y - 60) + _y, true) && (air == true)) && (Key.isDown(39))) {
man.sprite._xscale = -manXScale;
wallClinging = true;
air = false;
ySpeed = 0;
doubleJump = 0;
} else if ((platforms.plats.hitTest(((man._x + xSpeed) - 16) + _x, man._y + _y, true) && (air == true)) && (Key.isDown(37))) {
man.sprite._xscale = manXScale;
wallClinging = true;
air = false;
ySpeed = 0;
doubleJump = 0;
}
if ((air == true) or Key.isDown(40)) {
wallClinging = false;
}
}
function manDodge() {
if (((Key.isDown(40) && (Key.isDown(68))) && (dodgeSwitch == false)) && (wallClinging == false)) {
dodging = "right";
dodgeSwitch = true;
} else if (((Key.isDown(40) && (Key.isDown(65))) && (dodgeSwitch == false)) && (wallClinging == false)) {
dodging = "left";
dodgeSwitch = true;
}
if (dodging == "right") {
man.sprite._xscale = manXScale;
man.sprite.gotoAndStop(5);
xSpeed = 25;
dodgeSwitch == true;
} else if (dodging == "left") {
man.sprite._xscale = -manXScale;
man.sprite.gotoAndStop(5);
xSpeed = -25;
dodgeSwitch == true;
}
if (!Key.isDown(40)) {
dodgeSwitch = false;
}
}
function spikesHit() {
if (((platforms.spikes.hitTest(man._x + _x, man._y + _y, true) or platforms.spikes2.hitTest(man._x + _x, man._y + _y, true)) or platforms.spikes3.hitTest(man._x + _x, man._y + _y, true)) or platforms.spikes4.hitTest(man._x + _x, man._y + _y, true)) {
gray_so.data.totalDeaths++;
currentDeaths++;
dead = true;
}
}
function kick() {
if (Key.isDown(32) && (kickKeySwitch == false)) {
attack = true;
kicking = true;
kickKeySwitch = true;
} else if (!Key.isDown(32)) {
kickKeySwitch = false;
}
}
function suicide() {
if (Key.isDown(13) && (suicideSwitch == false)) {
dead = true;
suicideSwitch = true;
}
if (!Key.isDown(13)) {
suicideSwitch = false;
}
}
function pauseGame() {
if (((Key.isDown(27) && (pauseSwitch == false)) && (gamePaused == false)) && (dead == false)) {
gamePaused = true;
imdrawing = false;
pauseScreen._visible = true;
inverter._visible = true;
pauseSwitch = true;
} else if ((Key.isDown(27) && (pauseSwitch == false)) && (gamePaused == true)) {
gamePaused = false;
pauseScreen._visible = false;
inverter._visible = false;
pauseSwitch = true;
} else if (!Key.isDown(27)) {
pauseSwitch = false;
}
}
function cheats() {
if (mudkipcheat == true) {
man.sprite._visible = false;
man.mudkip._visible = true;
man.mage._visible = false;
if ((man.mudkip._currentframe != 4) && (attack == false)) {
if (air == false) {
if ((Key.isDown(68) == false) && (Key.isDown(65) == false)) {
man.mudkip.gotoAndStop(1);
} else if ((Key.isDown(68) == true) or (Key.isDown(65) == true)) {
if (Key.isDown(68)) {
man.mudkip._xscale = mudkipXScale;
} else if (Key.isDown(65)) {
man.mudkip._xscale = -mudkipXScale;
}
man.mudkip.gotoAndStop(2);
}
} else if (air == true) {
man.mudkip.gotoAndStop(3);
}
if (Key.isDown(32) && (kickKeySwitch == false)) {
if (man.mudkip.inSprite.head._currentframe == 1) {
mudkipMouthOpen = true;
} else if (man.mudkip.inSprite.head._currentframe == 2) {
mudkipMouthOpen = false;
}
}
if (mudkipMouthOpen == true) {
man.mudkip.inSprite.head.gotoAndStop(2);
} else {
man.mudkip.inSprite.head.gotoAndStop(1);
}
}
} else if (magecheat == true) {
man.sprite._visible = false;
man.mudkip._visible = false;
man.mage._visible = true;
if ((man.mage._currentframe != 4) && (attack == false)) {
if (air == false) {
if ((Key.isDown(68) == false) && (Key.isDown(65) == false)) {
man.mage.gotoAndStop(1);
} else if ((Key.isDown(68) == true) or (Key.isDown(65) == true)) {
if (Key.isDown(68)) {
man.mage._xscale = mageXScale;
} else if (Key.isDown(65)) {
man.mage._xscale = -mageXScale;
}
man.mage.gotoAndStop(2);
}
} else if (air == true) {
man.mage.gotoAndStop(3);
}
}
} else if ((mudkipcheat == false) && (magecheat == false)) {
man.sprite._visible = true;
man.mudkip._visible = false;
man.mage._visible = false;
}
}
function achievementsFunc() {
if ((gray_so.data.totalDeaths == 100) && (gray_so.data.deathachievementplayed != true)) {
achpopup.dontfearthereaper._visible = true;
gray_so.data.deathachievementplayed = true;
achpopup.gotoAndPlay("start");
}
if ((gray_so.data.totalLines > 900) && (gray_so.data.over9000achievementplayed != true)) {
achpopup.over9000._visible = true;
gray_so.data.over9000achievementplayed = true;
achpopup.gotoAndPlay("start");
}
}
function timerCounter() {
timerPart++;
if (timerPart == 40) {
timer++;
gray_so.data.totalTimer++;
timerPart = 0;
}
}
stop();
pauseScreen._visible = false;
inverter._visible = false;
Mouse.hide();
platx = platforms._x;
platy = platforms._y;
backx = theBackground._x;
backy = theBackground._y;
manx = man._x;
many = man._y;
dead = false;
gamePaused = false;
dodging = false;
var attack = false;
var kicking = false;
var manstate = 1;
var runSpeed = 15;
var xSpeed = 0;
var ySpeed = 0;
var jumping = false;
var jumpKeySwitch = false;
var mudkipXScale = man.mudkip._xscale;
var mageXScale = man.mage._xscale;
var manXScale = man.sprite._xscale;
var gravity = 2;
var color = new Color("_root.man");
var imdrawing = false;
var terrainVar = 1;
Frame 20
function onMouseDown() {
if ((terrainVar == 1) && (gamePaused == false)) {
createEmptyMovieClip("terrain1", man.getDepth() - 1);
terrain1.lineStyle(40, 3355443, 100);
if (imdrawing == false) {
terrain1.moveTo(_xmouse, _ymouse);
imdrawing = true;
xMouseStart = _xmouse;
yMouseStart = _ymouse;
}
} else if ((terrainVar == 20) && (gamePaused == false)) {
createEmptyMovieClip("terrain2", man.getDepth() - 2);
terrain2.lineStyle(40, 6710886, 100);
if (imdrawing == false) {
terrain2.moveTo(_xmouse, _ymouse);
imdrawing = true;
xMouseStart = _xmouse;
yMouseStart = _ymouse;
}
}
}
function Drawing() {
if (((terrainVar == 1) && (imdrawing == true)) && (!man.nodrawhitbox.hitTest(_xmouse, _ymouse, true))) {
if (((air == false) && (!Key.isDown(65))) && (!Key.isDown(68))) {
terrain1.lineTo(_xmouse, _ymouse);
}
} else if (((terrainVar == 2) && (imdrawing == true)) && (!man.nodrawhitbox.hitTest(_xmouse, _ymouse, true))) {
if (((air == false) && (!Key.isDown(65))) && (!Key.isDown(68))) {
terrain2.lineTo(_xmouse, _ymouse);
}
}
if (imdrawing == false) {
lineDrawed = false;
}
if (imdrawing == true) {
if ((((_xmouse != xMouseStart) && (lineDrawed == false)) && (terrainVar == 1)) or (((_ymouse != yMouseStart) && (lineDrawed == false)) && (terrainVar == 1))) {
line1Drawn = true;
lineDrawed = true;
gray_so.data.totalLines++;
levelLinesPlayer++;
} else if (((_xmouse == xMouseStart) && (_ymouse == yMouseStart)) && (terrainVar == 1)) {
line1Drawn = false;
lineDrawed = false;
}
if ((((_xmouse != xMouseStart) && (lineDrawed == false)) && (terrainVar == 2)) or (((_ymouse != yMouseStart) && (lineDrawed == false)) && (terrainVar == 2))) {
line2Drawn = true;
lineDrawed = true;
gray_so.data.totalLines++;
levelLinesPlayer++;
} else if (((_xmouse == xMouseStart) && (_ymouse == yMouseStart)) && (terrainVar == 2)) {
line2Drawn = false;
lineDrawed = false;
}
if ((((air == true) or Key.isDown(65)) or Key.isDown(68)) or (gamePaused == true)) {
imdrawing = false;
}
if (man.nodrawhitbox.hitTest(_xmouse, _ymouse, true)) {
imdrawing = false;
}
if ((((_xmouse > 750) or (_xmouse < 0)) or (_ymouse > 500)) or (_ymouse < 0)) {
imdrawing = false;
}
}
if (Key.isDown(69) && (terrainKeySwitch == false)) {
terrainVar = terrainVar + 0;
terrainKeySwitch = true;
} else if (!Key.isDown(69)) {
terrainKeySwitch = false;
}
if (terrainVar > 2) {
terrainVar = 1;
}
}
function switches() {
if ((platforms.switch1.hitTest(man._x + _x, man._y + _y, true) or ((platforms.switch1.hitTest(terrain1) == true) && (line1Drawn == true))) or ((platforms.switch1.hitTest(terrain2) == true) && (line2Drawn == true))) {
switchdoor1open = true;
} else if (!platforms.switch1.hitTest(man._x + _x, man._y + _y, true)) {
switchdoor1open = false;
}
if (switchdoor1open == true) {
platforms.switch1.gotoAndStop(2);
if (platforms.plats.switchdoor1._rotation > -180) {
platforms.plats.switchdoor1._rotation = platforms.plats.switchdoor1._rotation - 3;
}
} else if (switchdoor1open == false) {
platforms.switch1.gotoAndStop(1);
if (platforms.plats.switchdoor1._rotation < 0) {
platforms.plats.switchdoor1._rotation = platforms.plats.switchdoor1._rotation + 3;
}
}
if ((platforms.switch2.hitTest(man._x + _x, man._y + _y, true) or ((platforms.switch2.hitTest(terrain1) == true) && (line1Drawn == true))) or ((platforms.switch2.hitTest(terrain2) == true) && (line2Drawn == true))) {
switchdoor2open = true;
} else if (!platforms.switch2.hitTest(man._x + _x, man._y + _y, true)) {
switchdoor2open = false;
}
if (switchdoor2open == true) {
platforms.switch2.gotoAndStop(2);
if (platforms.plats.switchdoor2._rotation > -90) {
platforms.plats.switchdoor2._rotation = platforms.plats.switchdoor2._rotation - 3;
}
} else if (switchdoor2open == false) {
platforms.switch2.gotoAndStop(1);
if (platforms.plats.switchdoor2._rotation < 0) {
platforms.plats.switchdoor2._rotation = platforms.plats.switchdoor2._rotation + 3;
}
}
if ((platforms.switch3.hitTest(man._x + _x, man._y + _y, true) or ((platforms.switch3.hitTest(terrain1) == true) && (line1Drawn == true))) or ((platforms.switch3.hitTest(terrain2) == true) && (line2Drawn == true))) {
switchdoor3open = true;
} else if (!platforms.switch3.hitTest(man._x + _x, man._y + _y, true)) {
switchdoor3open = false;
}
if (switchdoor3open == true) {
platforms.switch3.gotoAndStop(2);
if (platforms.plats.switchdoor3._rotation > -90) {
platforms.plats.switchdoor3._rotation = platforms.plats.switchdoor3._rotation - 3;
}
} else if (switchdoor3open == false) {
platforms.switch3.gotoAndStop(1);
if (platforms.plats.switchdoor3._rotation < 0) {
platforms.plats.switchdoor3._rotation = platforms.plats.switchdoor3._rotation + 3;
}
}
}
function doorHit() {
if (platforms.door.hitTest(man._x + _x, man._y + _y, true)) {
gamePaused = true;
if (fader._alpha < 100) {
fader._alpha = fader._alpha + 5;
} else if (((fader._alpha >= 100) && (noJumpMode == false)) && (leastLinesMode == false)) {
man.sprite._xscale = manXScale;
man.mudkip._xscale = mudkipXScale;
man.mage._xscale = mageXScale;
createEmptyMovieClip("terrain1", man.getDepth() - 1);
createEmptyMovieClip("terrain2", man.getDepth() - 2);
man._x = 375;
man._y = 250;
if (gray_so.data.lvlsavailable == 5) {
gray_so.data.lvlsavailable++;
}
gotoAndStop ("lvl6");
} else if (((fader._alpha >= 100) && (noJumpMode == true)) && (leastLinesMode == false)) {
gray_so.data.lvl5noJump = true;
gotoAndStop ("noJumps");
} else if (((fader._alpha >= 100) && (leastLinesMode == true)) && (noJumpMode == false)) {
if (levelLinesPlayer < gray_so.data.lvl5leastLinesPlayer) {
gray_so.data.lvl5leastLinesPlayer = levelLinesPlayer;
}
gotoAndStop ("leastLines");
}
}
}
function onMouseUp() {
imdrawing = false;
}
function onEnterFrame() {
displayText();
wallClinging = false;
xVar = man._x;
yVar = man._y;
testVar = ySpeed + yUp;
music();
cheats();
achievementsFunc();
pauseGame();
customCursor();
doorHit();
if (gamePaused == false) {
Drawing();
timerCounter();
man._x = man._x + xSpeed;
man._y = man._y + ySpeed;
manCollision();
moveScreen();
lookAround();
if (dead == false) {
if (fader._alpha > 0) {
fader._alpha = fader._alpha - 2;
}
kick();
manJump(-20);
managemanSprite();
onGround();
manageColor();
suicide();
spikesHit();
switches();
if ((Key.isDown(68) && (dodging == false)) && (wallClinging == false)) {
xSpeed = runSpeed;
} else if ((Key.isDown(65) && (dodging == false)) && (wallClinging == false)) {
xSpeed = -runSpeed;
} else if (((!Key.isDown(65)) && (!Key.isDown(68))) && (dodging == false)) {
xSpeed = 0;
}
} else {
man.sprite.gotoAndStop(4);
man.mudkip.gotoAndStop(4);
man.mage.gotoAndStop(4);
xSpeed = 0;
}
if (((man._x + xSpeed) > Stage.width) or ((man._x + xSpeed) < 0)) {
xSpeed = xSpeed - xSpeed;
} else if (dead == true) {
levelLinesPlayer = 0;
if (fader._alpha < 100) {
fader._alpha = fader._alpha + 5;
}
if (fader._alpha >= 100) {
dead = false;
deathsThisTime++;
man.sprite.gotoAndStop(1);
man.mudkip.gotoAndStop(1);
man.mage.gotoAndStop(1);
platforms._x = platx;
platforms._y = platy;
theBackground._x = backx;
theBackground._y = backy;
man._x = manx;
man._y = many;
createEmptyMovieClip("terrain1", man.getDepth() - 1);
createEmptyMovieClip("terrain2", man.getDepth() - 2);
}
}
}
}
function managemanSprite() {
if ((man.sprite._currentframe != 4) && (attack == false)) {
if ((air == false) && (wallClinging == false)) {
if (((Key.isDown(68) == false) && (Key.isDown(65) == false)) && (dodging == false)) {
man.sprite.gotoAndStop(1);
} else if (((Key.isDown(68) == true) && (dodging == false)) or ((Key.isDown(65) == true) && (dodging == false))) {
if (Key.isDown(68) && (dodging == false)) {
man.sprite._xscale = manXScale;
} else if (Key.isDown(65) && (dodging == false)) {
man.sprite._xscale = -manXScale;
}
man.sprite.gotoAndStop(2);
}
} else if (((air == true) && (dodging == false)) && (wallClinging == false)) {
man.sprite.gotoAndStop(3);
} else if (wallClinging == true) {
man.sprite.gotoAndStop(6);
}
} else if ((man.sprite._currentframe != 4) && (attack == true)) {
if (kicking == true) {
man.sprite.gotoAndStop(7);
}
}
}
function manageColor() {
if (man.sprite._xscale == (-manXScale)) {
man.sprite.bwhite.blendMode = "invert";
} else if (man.sprite._xscale == manXScale) {
man.sprite.bwhite.blendMode = "alpha";
}
}
function manJump(jumpHeight) {
if ((((((Key.isDown(87) && (noJumpMode == false)) && (!Key.isDown(70))) && (jumpKeySwitch == false)) && (doubleJump < 2)) && (noJump == false)) && (ySpeed > -1)) {
gray_so.data.totalJumps++;
jumpKeySwitch = true;
jumping = true;
doubleJump++;
air = true;
yUp = 0;
wallClinging = false;
gravity = 2;
man.sprite.inSprite.play();
man.sprite.bwhite.play();
man.sprite.outline.play();
if (ySpeed > -5) {
ySpeed = jumpHeight;
}
if ((doubleJump >= 2) && (ySpeed < -5)) {
ySpeed = jumpHeight;
}
} else if (Key.isDown(87) == false) {
jumpKeySwitch = false;
}
if ((jumping == true) && (ySpeed > 0)) {
jumping = false;
}
}
function onGround() {
if (((platforms.plats.hitTest(man._x + _x, ((man._y + 38) - yUp) + _y, true) or terrain1.hitTest(man._x + _x, ((man._y + 38) - yUp) + _y, true)) or terrain2.hitTest(man._x + _x, ((man._y + 38) - yUp) + _y, true)) or (wallClinging == true)) {
gravity = 2;
air = false;
doubleJump = 1;
} else {
air = true;
man._rotation = 0;
if (ySpeed < 15) {
ySpeed = ySpeed + gravity;
}
}
}
function manCollision() {
yUp = 0;
while ((platforms.plats.hitTest(man._x + _x, (((man._y + 35) + yUp) + _y) - 4, true) or terrain1.hitTest(man._x + _x, (((man._y + 35) + yUp) + _y) - 4, true)) or terrain2.hitTest(man._x + _x, (((man._y + 35) + yUp) + _y) - 4, true)) {
yUp--;
if (((Key.isDown(65) && (air == false)) && (jumping == false)) or ((Key.isDown(68) && (air == false)) && (jumping == false))) {
if ((yUp < ySpeed) && (man.sprite._xscale == (-manXScale))) {
man._rotation = ((-(yUp - ySpeed)) * 3) - (ySpeed * 6.15);
} else if ((yUp > ySpeed) && (man.sprite._xscale == manXScale)) {
man._rotation = ((yUp - ySpeed) * 3) + (ySpeed * 6.15);
} else if ((yUp > ySpeed) && (man.sprite._xscale == (-manXScale))) {
man._rotation = ((-(yUp - ySpeed)) * 3) - (ySpeed * 6.15);
} else if ((yUp < ySpeed) && (man.sprite._xscale == manXScale)) {
man._rotation = ((yUp - ySpeed) * 3) + (ySpeed * 6.15);
}
}
}
if ((platforms.plats.hitTest(man._x + _x, ((man._y - 35) + yUp) + _y, true) or terrain1.hitTest(man._x + _x, ((man._y - 35) + yUp) + _y, true)) or terrain2.hitTest(man._x + _x, ((man._y - 35) + yUp) + _y, true)) {
yUp = -ySpeed;
}
while ((((xSpeed != 0) && (platforms.plats.hitTest((man._x + xSpeed) + _x, ((man._y - 35) + yUp) + _y, true))) or ((xSpeed != 0) && (terrain1.hitTest((man._x + xSpeed) + _x, ((man._y - 35) + yUp) + _y, true)))) or ((xSpeed != 0) && (terrain2.hitTest((man._x + xSpeed) + _x, ((man._y - 35) + yUp) + _y, true)))) {
man._x = man._x - xSpeed;
}
if (((yUp == 0) && (ySpeed == 0)) && (air == false)) {
yUp = -16;
ySpeed = 16;
}
if ((yUp < -50) && (ySpeed > 0)) {
xSpeed = 0;
yUp = -ySpeed;
} else if ((yUp < -50) && (ySpeed < 0)) {
yUp = -15;
}
noJump = false;
man._y = man._y + yUp;
collideVar = yUp - ySpeed;
while ((((((platforms.plats.hitTest((man._x + xSpeed) + _x, man._y + _y, true) && (xSpeed != 0)) or (platforms.plats.hitTest((man._x + xSpeed) + _x, man._y + _y, true) && (xSpeed != 0))) or (terrain1.hitTest((man._x + xSpeed) + _x, man._y + _y, true) && (xSpeed != 0))) or (terrain1.hitTest((man._x + xSpeed) + _x, man._y + _y, true) && (xSpeed != 0))) or (terrain2.hitTest((man._x + xSpeed) + _x, man._y + _y, true) && (xSpeed != 0))) or (terrain2.hitTest((man._x + xSpeed) + _x, man._y + _y, true) && (xSpeed != 0))) {
man._x = man._x - xSpeed;
}
while ((xSpeed == 0) && (platforms.plats.hitTest((man._x - 20) + _x, man._y + _y, true))) {
man._x = man._x + 21;
}
while ((xSpeed == 0) && (platforms.plats.hitTest((man._x + 20) + _x, man._y + _y, true))) {
man._x = man._x - 21;
}
}
function moveScreen() {
if (man._x > (Stage.width - 250)) {
platforms._x = platforms._x - runSpeed;
terrain1._x = terrain1._x - runSpeed;
terrain2._x = terrain2._x - runSpeed;
man._x = man._x - runSpeed;
theBackground._x = theBackground._x - (runSpeed / 8);
}
if (man._x < 250) {
platforms._x = platforms._x + runSpeed;
terrain1._x = terrain1._x + runSpeed;
terrain2._x = terrain2._x + runSpeed;
man._x = man._x + runSpeed;
theBackground._x = theBackground._x + (runSpeed / 8);
}
if (((man._y + ySpeed) + yUp) > (Stage.height - 150)) {
platforms._y = platforms._y - (ySpeed + yUp);
terrain1._y = terrain1._y - (ySpeed + yUp);
terrain2._y = terrain2._y - (ySpeed + yUp);
man._y = man._y - (ySpeed + yUp);
theBackground._y = theBackground._y - ((ySpeed + yUp) / 8);
}
if (((man._y + ySpeed) + yUp) < 150) {
platforms._y = platforms._y - (ySpeed + yUp);
terrain1._y = terrain1._y - (ySpeed + yUp);
terrain2._y = terrain2._y - (ySpeed + yUp);
man._y = man._y - (ySpeed + yUp);
theBackground._y = theBackground._y - ((ySpeed + yUp) / 8);
}
if (((man._y + ySpeed) + yUp) < 125) {
platforms._y = platforms._y - ((ySpeed + yUp) - 26);
terrain1._y = terrain1._y - ((ySpeed + yUp) - 26);
terrain2._y = terrain2._y - ((ySpeed + yUp) - 26);
man._y = man._y - ((ySpeed + yUp) - 26);
theBackground._y = theBackground._y - (((ySpeed + yUp) - 26) / 8);
}
if (((man._y + ySpeed) + yUp) > (Stage.height - 125)) {
platforms._y = platforms._y - ((ySpeed + yUp) + 26);
terrain1._y = terrain1._y - ((ySpeed + yUp) + 26);
terrain2._y = terrain2._y - ((ySpeed + yUp) + 26);
man._y = man._y - ((ySpeed + yUp) + 26);
theBackground._y = theBackground._y - (((ySpeed + yUp) + 26) / 8);
}
if ((((man._y + ySpeed) + yUp) < 139) && (Key.isDown(70))) {
platforms._y = platforms._y - ((ySpeed + yUp) - 15);
terrain1._y = terrain1._y - ((ySpeed + yUp) - 15);
terrain2._y = terrain2._y - ((ySpeed + yUp) - 15);
man._y = man._y - ((ySpeed + yUp) - 15);
theBackground._y = theBackground._y - (((ySpeed + yUp) - 15) / 8);
}
if ((((man._y + ySpeed) + yUp) > (Stage.height - 139)) && (Key.isDown(70))) {
platforms._y = platforms._y - ((ySpeed + yUp) + 15);
terrain1._y = terrain1._y - ((ySpeed + yUp) + 15);
terrain2._y = terrain2._y - ((ySpeed + yUp) + 15);
man._y = man._y - ((ySpeed + yUp) + 15);
theBackground._y = theBackground._y - (((ySpeed + yUp) + 15) / 8);
}
}
function lookAround() {
if (((Key.isDown(70) && (air == false)) && (!Key.isDown(65))) && (!Key.isDown(68))) {
imdrawing = false;
if (_xmouse > (Stage.width - 250)) {
platforms._x = platforms._x - runSpeed;
terrain1._x = terrain1._x - runSpeed;
terrain2._x = terrain2._x - runSpeed;
man._x = man._x - runSpeed;
theBackground._x = theBackground._x - (runSpeed / 8);
}
if (_xmouse < 250) {
platforms._x = platforms._x + runSpeed;
terrain1._x = terrain1._x + runSpeed;
terrain2._x = terrain2._x + runSpeed;
man._x = man._x + runSpeed;
theBackground._x = theBackground._x + (runSpeed / 8);
}
if (_ymouse < 139) {
platforms._y = platforms._y - ((ySpeed + yUp) - 15);
terrain1._y = terrain1._y - ((ySpeed + yUp) - 15);
terrain2._y = terrain2._y - ((ySpeed + yUp) - 15);
man._y = man._y - ((ySpeed + yUp) - 15);
theBackground._y = theBackground._y - (((ySpeed + yUp) - 15) / 8);
}
if (_ymouse > (Stage.height - 139)) {
platforms._y = platforms._y - ((ySpeed + yUp) + 15);
terrain1._y = terrain1._y - ((ySpeed + yUp) + 15);
terrain2._y = terrain2._y - ((ySpeed + yUp) + 15);
man._y = man._y - ((ySpeed + yUp) + 15);
theBackground._y = theBackground._y - (((ySpeed + yUp) + 15) / 8);
}
}
}
function customCursor() {
cursor.gotoAndStop(terrainVar);
linecolor.gotoAndStop(terrainVar);
cursor._x = _xmouse;
cursor._y = _ymouse;
cursor._rotation = cursor._rotation + 3;
}
function wallCling() {
if ((platforms.plats.hitTest(((man._x + xSpeed) + 16) + _x, (man._y - 60) + _y, true) && (air == true)) && (Key.isDown(39))) {
man.sprite._xscale = -manXScale;
wallClinging = true;
air = false;
ySpeed = 0;
doubleJump = 0;
} else if ((platforms.plats.hitTest(((man._x + xSpeed) - 16) + _x, man._y + _y, true) && (air == true)) && (Key.isDown(37))) {
man.sprite._xscale = manXScale;
wallClinging = true;
air = false;
ySpeed = 0;
doubleJump = 0;
}
if ((air == true) or Key.isDown(40)) {
wallClinging = false;
}
}
function manDodge() {
if (((Key.isDown(40) && (Key.isDown(68))) && (dodgeSwitch == false)) && (wallClinging == false)) {
dodging = "right";
dodgeSwitch = true;
} else if (((Key.isDown(40) && (Key.isDown(65))) && (dodgeSwitch == false)) && (wallClinging == false)) {
dodging = "left";
dodgeSwitch = true;
}
if (dodging == "right") {
man.sprite._xscale = manXScale;
man.sprite.gotoAndStop(5);
xSpeed = 25;
dodgeSwitch == true;
} else if (dodging == "left") {
man.sprite._xscale = -manXScale;
man.sprite.gotoAndStop(5);
xSpeed = -25;
dodgeSwitch == true;
}
if (!Key.isDown(40)) {
dodgeSwitch = false;
}
}
function spikesHit() {
if (((platforms.spikes.hitTest(man._x + _x, man._y + _y, true) or platforms.spikes2.hitTest(man._x + _x, man._y + _y, true)) or platforms.spikes3.hitTest(man._x + _x, man._y + _y, true)) or platforms.spikes4.hitTest(man._x + _x, man._y + _y, true)) {
gray_so.data.totalDeaths++;
currentDeaths++;
dead = true;
}
}
function kick() {
if (Key.isDown(32) && (kickKeySwitch == false)) {
attack = true;
kicking = true;
kickKeySwitch = true;
} else if (!Key.isDown(32)) {
kickKeySwitch = false;
}
}
function suicide() {
if (Key.isDown(13) && (suicideSwitch == false)) {
dead = true;
suicideSwitch = true;
}
if (!Key.isDown(13)) {
suicideSwitch = false;
}
}
function pauseGame() {
if (((Key.isDown(27) && (pauseSwitch == false)) && (gamePaused == false)) && (dead == false)) {
gamePaused = true;
imdrawing = false;
pauseScreen._visible = true;
inverter._visible = true;
pauseSwitch = true;
} else if ((Key.isDown(27) && (pauseSwitch == false)) && (gamePaused == true)) {
gamePaused = false;
pauseScreen._visible = false;
inverter._visible = false;
pauseSwitch = true;
} else if (!Key.isDown(27)) {
pauseSwitch = false;
}
}
function cheats() {
if (mudkipcheat == true) {
man.sprite._visible = false;
man.mudkip._visible = true;
man.mage._visible = false;
if ((man.mudkip._currentframe != 4) && (attack == false)) {
if (air == false) {
if ((Key.isDown(68) == false) && (Key.isDown(65) == false)) {
man.mudkip.gotoAndStop(1);
} else if ((Key.isDown(68) == true) or (Key.isDown(65) == true)) {
if (Key.isDown(68)) {
man.mudkip._xscale = mudkipXScale;
} else if (Key.isDown(65)) {
man.mudkip._xscale = -mudkipXScale;
}
man.mudkip.gotoAndStop(2);
}
} else if (air == true) {
man.mudkip.gotoAndStop(3);
}
if (Key.isDown(32) && (kickKeySwitch == false)) {
if (man.mudkip.inSprite.head._currentframe == 1) {
mudkipMouthOpen = true;
} else if (man.mudkip.inSprite.head._currentframe == 2) {
mudkipMouthOpen = false;
}
}
if (mudkipMouthOpen == true) {
man.mudkip.inSprite.head.gotoAndStop(2);
} else {
man.mudkip.inSprite.head.gotoAndStop(1);
}
}
} else if (magecheat == true) {
man.sprite._visible = false;
man.mudkip._visible = false;
man.mage._visible = true;
if ((man.mage._currentframe != 4) && (attack == false)) {
if (air == false) {
if ((Key.isDown(68) == false) && (Key.isDown(65) == false)) {
man.mage.gotoAndStop(1);
} else if ((Key.isDown(68) == true) or (Key.isDown(65) == true)) {
if (Key.isDown(68)) {
man.mage._xscale = mageXScale;
} else if (Key.isDown(65)) {
man.mage._xscale = -mageXScale;
}
man.mage.gotoAndStop(2);
}
} else if (air == true) {
man.mage.gotoAndStop(3);
}
}
} else if ((mudkipcheat == false) && (magecheat == false)) {
man.sprite._visible = true;
man.mudkip._visible = false;
man.mage._visible = false;
}
}
function achievementsFunc() {
if ((gray_so.data.totalDeaths == 100) && (gray_so.data.deathachievementplayed != true)) {
achpopup.dontfearthereaper._visible = true;
gray_so.data.deathachievementplayed = true;
achpopup.gotoAndPlay("start");
}
if ((gray_so.data.totalLines > 900) && (gray_so.data.over9000achievementplayed != true)) {
achpopup.over9000._visible = true;
gray_so.data.over9000achievementplayed = true;
achpopup.gotoAndPlay("start");
}
}
function timerCounter() {
timerPart++;
if (timerPart == 40) {
timer++;
gray_so.data.totalTimer++;
timerPart = 0;
}
}
stop();
pauseScreen._visible = false;
inverter._visible = false;
Mouse.hide();
platx = platforms._x;
platy = platforms._y;
backx = theBackground._x;
backy = theBackground._y;
manx = man._x;
many = man._y;
dead = false;
gamePaused = false;
dodging = false;
var attack = false;
var kicking = false;
var manstate = 1;
var runSpeed = 15;
var xSpeed = 0;
var ySpeed = 0;
var jumping = false;
var jumpKeySwitch = false;
var mudkipXScale = man.mudkip._xscale;
var mageXScale = man.mage._xscale;
var manXScale = man.sprite._xscale;
var gravity = 2;
var color = new Color("_root.man");
var imdrawing = false;
var terrainVar = 1;
Frame 21
function onMouseDown() {
if ((terrainVar == 1) && (gamePaused == false)) {
createEmptyMovieClip("terrain1", man.getDepth() - 1);
terrain1.lineStyle(40, 3355443, 100);
if (imdrawing == false) {
terrain1.moveTo(_xmouse, _ymouse);
imdrawing = true;
xMouseStart = _xmouse;
yMouseStart = _ymouse;
}
} else if ((terrainVar == 20) && (gamePaused == false)) {
createEmptyMovieClip("terrain2", man.getDepth() - 2);
terrain2.lineStyle(40, 6710886, 100);
if (imdrawing == false) {
terrain2.moveTo(_xmouse, _ymouse);
imdrawing = true;
xMouseStart = _xmouse;
yMouseStart = _ymouse;
}
}
}
function Drawing() {
if (((terrainVar == 1) && (imdrawing == true)) && (!man.nodrawhitbox.hitTest(_xmouse, _ymouse, true))) {
if (((air == false) && (!Key.isDown(65))) && (!Key.isDown(68))) {
terrain1.lineTo(_xmouse, _ymouse);
}
} else if (((terrainVar == 2) && (imdrawing == true)) && (!man.nodrawhitbox.hitTest(_xmouse, _ymouse, true))) {
if (((air == false) && (!Key.isDown(65))) && (!Key.isDown(68))) {
terrain2.lineTo(_xmouse, _ymouse);
}
}
if (imdrawing == false) {
lineDrawed = false;
}
if (imdrawing == true) {
if ((((_xmouse != xMouseStart) && (lineDrawed == false)) && (terrainVar == 1)) or (((_ymouse != yMouseStart) && (lineDrawed == false)) && (terrainVar == 1))) {
line1Drawn = true;
lineDrawed = true;
gray_so.data.totalLines++;
levelLinesPlayer++;
} else if (((_xmouse == xMouseStart) && (_ymouse == yMouseStart)) && (terrainVar == 1)) {
line1Drawn = false;
lineDrawed = false;
}
if ((((_xmouse != xMouseStart) && (lineDrawed == false)) && (terrainVar == 2)) or (((_ymouse != yMouseStart) && (lineDrawed == false)) && (terrainVar == 2))) {
line2Drawn = true;
lineDrawed = true;
gray_so.data.totalLines++;
levelLinesPlayer++;
} else if (((_xmouse == xMouseStart) && (_ymouse == yMouseStart)) && (terrainVar == 2)) {
line2Drawn = false;
lineDrawed = false;
}
if ((((air == true) or Key.isDown(65)) or Key.isDown(68)) or (gamePaused == true)) {
imdrawing = false;
}
if (man.nodrawhitbox.hitTest(_xmouse, _ymouse, true)) {
imdrawing = false;
}
if ((((_xmouse > 750) or (_xmouse < 0)) or (_ymouse > 500)) or (_ymouse < 0)) {
imdrawing = false;
}
}
if (Key.isDown(69) && (terrainKeySwitch == false)) {
terrainVar = terrainVar + 0;
terrainKeySwitch = true;
} else if (!Key.isDown(69)) {
terrainKeySwitch = false;
}
if (terrainVar > 2) {
terrainVar = 1;
}
}
function switches() {
if ((platforms.switch1.hitTest(man._x + _x, man._y + _y, true) or ((platforms.switch1.hitTest(terrain1) == true) && (line1Drawn == true))) or ((platforms.switch1.hitTest(terrain2) == true) && (line2Drawn == true))) {
switchdoor1open = true;
} else if (!platforms.switch1.hitTest(man._x + _x, man._y + _y, true)) {
switchdoor1open = false;
}
if (switchdoor1open == true) {
platforms.switch1.gotoAndStop(2);
if (platforms.plats.switchdoor1._rotation > -90) {
platforms.plats.switchdoor1._rotation = platforms.plats.switchdoor1._rotation - 3;
}
} else if (switchdoor1open == false) {
platforms.switch1.gotoAndStop(1);
if (platforms.plats.switchdoor1._rotation < 0) {
platforms.plats.switchdoor1._rotation = platforms.plats.switchdoor1._rotation + 3;
}
}
if ((platforms.switch2.hitTest(man._x + _x, man._y + _y, true) or ((platforms.switch2.hitTest(terrain1) == true) && (line1Drawn == true))) or ((platforms.switch2.hitTest(terrain2) == true) && (line2Drawn == true))) {
switchdoor2open = true;
} else if (!platforms.switch2.hitTest(man._x + _x, man._y + _y, true)) {
switchdoor2open = false;
}
if (switchdoor2open == true) {
platforms.switch2.gotoAndStop(2);
if (platforms.plats.switchdoor2._rotation < 180) {
platforms.plats.switchdoor2._rotation = platforms.plats.switchdoor2._rotation + 3;
}
} else if (switchdoor2open == false) {
platforms.switch2.gotoAndStop(1);
if (platforms.plats.switchdoor2._rotation > 0) {
platforms.plats.switchdoor2._rotation = platforms.plats.switchdoor2._rotation - 3;
}
}
if ((platforms.switch3.hitTest(man._x + _x, man._y + _y, true) or ((platforms.switch3.hitTest(terrain1) == true) && (line1Drawn == true))) or ((platforms.switch3.hitTest(terrain2) == true) && (line2Drawn == true))) {
switchdoor3open = true;
} else if (!platforms.switch3.hitTest(man._x + _x, man._y + _y, true)) {
switchdoor3open = false;
}
if (switchdoor3open == true) {
platforms.switch3.gotoAndStop(2);
if (platforms.plats.switchdoor3._rotation < 90) {
platforms.plats.switchdoor3._rotation = platforms.plats.switchdoor3._rotation + 3;
}
} else if (switchdoor3open == false) {
platforms.switch3.gotoAndStop(1);
if (platforms.plats.switchdoor3._rotation > 0) {
platforms.plats.switchdoor3._rotation = platforms.plats.switchdoor3._rotation - 3;
}
}
}
function doorHit() {
if (platforms.door.hitTest(man._x + _x, man._y + _y, true)) {
gamePaused = true;
if (fader._alpha < 100) {
fader._alpha = fader._alpha + 5;
} else if (((fader._alpha >= 100) && (noJumpMode == false)) && (leastLinesMode == false)) {
man.sprite._xscale = manXScale;
man.mudkip._xscale = mudkipXScale;
man.mage._xscale = mageXScale;
createEmptyMovieClip("terrain1", man.getDepth() - 1);
createEmptyMovieClip("terrain2", man.getDepth() - 2);
man._x = 375;
man._y = 250;
if (gray_so.data.lvlsavailable == 6) {
gray_so.data.lvlsavailable++;
}
gotoAndStop ("lvl7");
} else if (((fader._alpha >= 100) && (noJumpMode == true)) && (leastLinesMode == false)) {
gray_so.data.lvl6noJump = true;
gotoAndStop ("noJumps");
} else if (((fader._alpha >= 100) && (leastLinesMode == true)) && (noJumpMode == false)) {
if (levelLinesPlayer < gray_so.data.lvl6leastLinesPlayer) {
gray_so.data.lvl6leastLinesPlayer = levelLinesPlayer;
}
gotoAndStop ("leastLines");
}
}
}
function onMouseUp() {
imdrawing = false;
}
function onEnterFrame() {
displayText();
wallClinging = false;
xVar = man._x;
yVar = man._y;
testVar = ySpeed + yUp;
music();
cheats();
achievementsFunc();
pauseGame();
customCursor();
doorHit();
if (gamePaused == false) {
Drawing();
timerCounter();
man._x = man._x + xSpeed;
man._y = man._y + ySpeed;
manCollision();
moveScreen();
lookAround();
if (dead == false) {
if (fader._alpha > 0) {
fader._alpha = fader._alpha - 2;
}
kick();
manJump(-20);
managemanSprite();
onGround();
manageColor();
suicide();
spikesHit();
switches();
if ((Key.isDown(68) && (dodging == false)) && (wallClinging == false)) {
xSpeed = runSpeed;
} else if ((Key.isDown(65) && (dodging == false)) && (wallClinging == false)) {
xSpeed = -runSpeed;
} else if (((!Key.isDown(65)) && (!Key.isDown(68))) && (dodging == false)) {
xSpeed = 0;
}
} else {
man.sprite.gotoAndStop(4);
man.mudkip.gotoAndStop(4);
man.mage.gotoAndStop(4);
xSpeed = 0;
}
if (((man._x + xSpeed) > Stage.width) or ((man._x + xSpeed) < 0)) {
xSpeed = xSpeed - xSpeed;
} else if (dead == true) {
levelLinesPlayer = 0;
if (fader._alpha < 100) {
fader._alpha = fader._alpha + 5;
}
if (fader._alpha >= 100) {
dead = false;
deathsThisTime++;
man.sprite.gotoAndStop(1);
man.mudkip.gotoAndStop(1);
man.mage.gotoAndStop(1);
platforms._x = platx;
platforms._y = platy;
theBackground._x = backx;
theBackground._y = backy;
man._x = manx;
man._y = many;
createEmptyMovieClip("terrain1", man.getDepth() - 1);
createEmptyMovieClip("terrain2", man.getDepth() - 2);
}
}
}
}
function managemanSprite() {
if ((man.sprite._currentframe != 4) && (attack == false)) {
if ((air == false) && (wallClinging == false)) {
if (((Key.isDown(68) == false) && (Key.isDown(65) == false)) && (dodging == false)) {
man.sprite.gotoAndStop(1);
} else if (((Key.isDown(68) == true) && (dodging == false)) or ((Key.isDown(65) == true) && (dodging == false))) {
if (Key.isDown(68) && (dodging == false)) {
man.sprite._xscale = manXScale;
} else if (Key.isDown(65) && (dodging == false)) {
man.sprite._xscale = -manXScale;
}
man.sprite.gotoAndStop(2);
}
} else if (((air == true) && (dodging == false)) && (wallClinging == false)) {
man.sprite.gotoAndStop(3);
} else if (wallClinging == true) {
man.sprite.gotoAndStop(6);
}
} else if ((man.sprite._currentframe != 4) && (attack == true)) {
if (kicking == true) {
man.sprite.gotoAndStop(7);
}
}
}
function manageColor() {
if (man.sprite._xscale == (-manXScale)) {
man.sprite.bwhite.blendMode = "invert";
} else if (man.sprite._xscale == manXScale) {
man.sprite.bwhite.blendMode = "alpha";
}
}
function manJump(jumpHeight) {
if ((((((Key.isDown(87) && (noJumpMode == false)) && (!Key.isDown(70))) && (jumpKeySwitch == false)) && (doubleJump < 2)) && (noJump == false)) && (ySpeed > -1)) {
gray_so.data.totalJumps++;
jumpKeySwitch = true;
jumping = true;
doubleJump++;
air = true;
yUp = 0;
wallClinging = false;
gravity = 2;
man.sprite.inSprite.play();
man.sprite.bwhite.play();
man.sprite.outline.play();
if (ySpeed > -5) {
ySpeed = jumpHeight;
}
if ((doubleJump >= 2) && (ySpeed < -5)) {
ySpeed = jumpHeight;
}
} else if (Key.isDown(87) == false) {
jumpKeySwitch = false;
}
if ((jumping == true) && (ySpeed > 0)) {
jumping = false;
}
}
function onGround() {
if (((platforms.plats.hitTest(man._x + _x, ((man._y + 38) - yUp) + _y, true) or terrain1.hitTest(man._x + _x, ((man._y + 38) - yUp) + _y, true)) or terrain2.hitTest(man._x + _x, ((man._y + 38) - yUp) + _y, true)) or (wallClinging == true)) {
gravity = 2;
air = false;
doubleJump = 1;
} else {
air = true;
man._rotation = 0;
if (ySpeed < 15) {
ySpeed = ySpeed + gravity;
}
}
}
function manCollision() {
yUp = 0;
while ((platforms.plats.hitTest(man._x + _x, (((man._y + 35) + yUp) + _y) - 4, true) or terrain1.hitTest(man._x + _x, (((man._y + 35) + yUp) + _y) - 4, true)) or terrain2.hitTest(man._x + _x, (((man._y + 35) + yUp) + _y) - 4, true)) {
yUp--;
if (((Key.isDown(65) && (air == false)) && (jumping == false)) or ((Key.isDown(68) && (air == false)) && (jumping == false))) {
if ((yUp < ySpeed) && (man.sprite._xscale == (-manXScale))) {
man._rotation = ((-(yUp - ySpeed)) * 3) - (ySpeed * 6.15);
} else if ((yUp > ySpeed) && (man.sprite._xscale == manXScale)) {
man._rotation = ((yUp - ySpeed) * 3) + (ySpeed * 6.15);
} else if ((yUp > ySpeed) && (man.sprite._xscale == (-manXScale))) {
man._rotation = ((-(yUp - ySpeed)) * 3) - (ySpeed * 6.15);
} else if ((yUp < ySpeed) && (man.sprite._xscale == manXScale)) {
man._rotation = ((yUp - ySpeed) * 3) + (ySpeed * 6.15);
}
}
}
if ((platforms.plats.hitTest(man._x + _x, ((man._y - 35) + yUp) + _y, true) or terrain1.hitTest(man._x + _x, ((man._y - 35) + yUp) + _y, true)) or terrain2.hitTest(man._x + _x, ((man._y - 35) + yUp) + _y, true)) {
yUp = -ySpeed;
}
while ((((xSpeed != 0) && (platforms.plats.hitTest((man._x + xSpeed) + _x, ((man._y - 35) + yUp) + _y, true))) or ((xSpeed != 0) && (terrain1.hitTest((man._x + xSpeed) + _x, ((man._y - 35) + yUp) + _y, true)))) or ((xSpeed != 0) && (terrain2.hitTest((man._x + xSpeed) + _x, ((man._y - 35) + yUp) + _y, true)))) {
man._x = man._x - xSpeed;
}
if (((yUp == 0) && (ySpeed == 0)) && (air == false)) {
yUp = -16;
ySpeed = 16;
}
if ((yUp < -50) && (ySpeed > 0)) {
xSpeed = 0;
yUp = -ySpeed;
} else if ((yUp < -50) && (ySpeed < 0)) {
yUp = -15;
}
noJump = false;
man._y = man._y + yUp;
collideVar = yUp - ySpeed;
while ((((((platforms.plats.hitTest((man._x + xSpeed) + _x, man._y + _y, true) && (xSpeed != 0)) or (platforms.plats.hitTest((man._x + xSpeed) + _x, man._y + _y, true) && (xSpeed != 0))) or (terrain1.hitTest((man._x + xSpeed) + _x, man._y + _y, true) && (xSpeed != 0))) or (terrain1.hitTest((man._x + xSpeed) + _x, man._y + _y, true) && (xSpeed != 0))) or (terrain2.hitTest((man._x + xSpeed) + _x, man._y + _y, true) && (xSpeed != 0))) or (terrain2.hitTest((man._x + xSpeed) + _x, man._y + _y, true) && (xSpeed != 0))) {
man._x = man._x - xSpeed;
}
while ((xSpeed == 0) && (platforms.plats.hitTest((man._x - 20) + _x, man._y + _y, true))) {
man._x = man._x + 21;
}
while ((xSpeed == 0) && (platforms.plats.hitTest((man._x + 20) + _x, man._y + _y, true))) {
man._x = man._x - 21;
}
}
function moveScreen() {
if (man._x > (Stage.width - 250)) {
platforms._x = platforms._x - runSpeed;
terrain1._x = terrain1._x - runSpeed;
terrain2._x = terrain2._x - runSpeed;
man._x = man._x - runSpeed;
theBackground._x = theBackground._x - (runSpeed / 8);
}
if (man._x < 250) {
platforms._x = platforms._x + runSpeed;
terrain1._x = terrain1._x + runSpeed;
terrain2._x = terrain2._x + runSpeed;
man._x = man._x + runSpeed;
theBackground._x = theBackground._x + (runSpeed / 8);
}
if (((man._y + ySpeed) + yUp) > (Stage.height - 150)) {
platforms._y = platforms._y - (ySpeed + yUp);
terrain1._y = terrain1._y - (ySpeed + yUp);
terrain2._y = terrain2._y - (ySpeed + yUp);
man._y = man._y - (ySpeed + yUp);
theBackground._y = theBackground._y - ((ySpeed + yUp) / 8);
}
if (((man._y + ySpeed) + yUp) < 150) {
platforms._y = platforms._y - (ySpeed + yUp);
terrain1._y = terrain1._y - (ySpeed + yUp);
terrain2._y = terrain2._y - (ySpeed + yUp);
man._y = man._y - (ySpeed + yUp);
theBackground._y = theBackground._y - ((ySpeed + yUp) / 8);
}
if (((man._y + ySpeed) + yUp) < 125) {
platforms._y = platforms._y - ((ySpeed + yUp) - 26);
terrain1._y = terrain1._y - ((ySpeed + yUp) - 26);
terrain2._y = terrain2._y - ((ySpeed + yUp) - 26);
man._y = man._y - ((ySpeed + yUp) - 26);
theBackground._y = theBackground._y - (((ySpeed + yUp) - 26) / 8);
}
if (((man._y + ySpeed) + yUp) > (Stage.height - 125)) {
platforms._y = platforms._y - ((ySpeed + yUp) + 26);
terrain1._y = terrain1._y - ((ySpeed + yUp) + 26);
terrain2._y = terrain2._y - ((ySpeed + yUp) + 26);
man._y = man._y - ((ySpeed + yUp) + 26);
theBackground._y = theBackground._y - (((ySpeed + yUp) + 26) / 8);
}
if ((((man._y + ySpeed) + yUp) < 139) && (Key.isDown(70))) {
platforms._y = platforms._y - ((ySpeed + yUp) - 15);
terrain1._y = terrain1._y - ((ySpeed + yUp) - 15);
terrain2._y = terrain2._y - ((ySpeed + yUp) - 15);
man._y = man._y - ((ySpeed + yUp) - 15);
theBackground._y = theBackground._y - (((ySpeed + yUp) - 15) / 8);
}
if ((((man._y + ySpeed) + yUp) > (Stage.height - 139)) && (Key.isDown(70))) {
platforms._y = platforms._y - ((ySpeed + yUp) + 15);
terrain1._y = terrain1._y - ((ySpeed + yUp) + 15);
terrain2._y = terrain2._y - ((ySpeed + yUp) + 15);
man._y = man._y - ((ySpeed + yUp) + 15);
theBackground._y = theBackground._y - (((ySpeed + yUp) + 15) / 8);
}
}
function lookAround() {
if (((Key.isDown(70) && (air == false)) && (!Key.isDown(65))) && (!Key.isDown(68))) {
imdrawing = false;
if (_xmouse > (Stage.width - 250)) {
platforms._x = platforms._x - runSpeed;
terrain1._x = terrain1._x - runSpeed;
terrain2._x = terrain2._x - runSpeed;
man._x = man._x - runSpeed;
theBackground._x = theBackground._x - (runSpeed / 8);
}
if (_xmouse < 250) {
platforms._x = platforms._x + runSpeed;
terrain1._x = terrain1._x + runSpeed;
terrain2._x = terrain2._x + runSpeed;
man._x = man._x + runSpeed;
theBackground._x = theBackground._x + (runSpeed / 8);
}
if (_ymouse < 139) {
platforms._y = platforms._y - ((ySpeed + yUp) - 15);
terrain1._y = terrain1._y - ((ySpeed + yUp) - 15);
terrain2._y = terrain2._y - ((ySpeed + yUp) - 15);
man._y = man._y - ((ySpeed + yUp) - 15);
theBackground._y = theBackground._y - (((ySpeed + yUp) - 15) / 8);
}
if (_ymouse > (Stage.height - 139)) {
platforms._y = platforms._y - ((ySpeed + yUp) + 15);
terrain1._y = terrain1._y - ((ySpeed + yUp) + 15);
terrain2._y = terrain2._y - ((ySpeed + yUp) + 15);
man._y = man._y - ((ySpeed + yUp) + 15);
theBackground._y = theBackground._y - (((ySpeed + yUp) + 15) / 8);
}
}
}
function customCursor() {
cursor.gotoAndStop(terrainVar);
linecolor.gotoAndStop(terrainVar);
cursor._x = _xmouse;
cursor._y = _ymouse;
cursor._rotation = cursor._rotation + 3;
}
function wallCling() {
if ((platforms.plats.hitTest(((man._x + xSpeed) + 16) + _x, (man._y - 60) + _y, true) && (air == true)) && (Key.isDown(39))) {
man.sprite._xscale = -manXScale;
wallClinging = true;
air = false;
ySpeed = 0;
doubleJump = 0;
} else if ((platforms.plats.hitTest(((man._x + xSpeed) - 16) + _x, man._y + _y, true) && (air == true)) && (Key.isDown(37))) {
man.sprite._xscale = manXScale;
wallClinging = true;
air = false;
ySpeed = 0;
doubleJump = 0;
}
if ((air == true) or Key.isDown(40)) {
wallClinging = false;
}
}
function manDodge() {
if (((Key.isDown(40) && (Key.isDown(68))) && (dodgeSwitch == false)) && (wallClinging == false)) {
dodging = "right";
dodgeSwitch = true;
} else if (((Key.isDown(40) && (Key.isDown(65))) && (dodgeSwitch == false)) && (wallClinging == false)) {
dodging = "left";
dodgeSwitch = true;
}
if (dodging == "right") {
man.sprite._xscale = manXScale;
man.sprite.gotoAndStop(5);
xSpeed = 25;
dodgeSwitch == true;
} else if (dodging == "left") {
man.sprite._xscale = -manXScale;
man.sprite.gotoAndStop(5);
xSpeed = -25;
dodgeSwitch == true;
}
if (!Key.isDown(40)) {
dodgeSwitch = false;
}
}
function spikesHit() {
if (((platforms.spikes.hitTest(man._x + _x, man._y + _y, true) or platforms.spikes2.hitTest(man._x + _x, man._y + _y, true)) or platforms.spikes3.hitTest(man._x + _x, man._y + _y, true)) or platforms.spikes4.hitTest(man._x + _x, man._y + _y, true)) {
gray_so.data.totalDeaths++;
currentDeaths++;
dead = true;
}
}
function kick() {
if (Key.isDown(32) && (kickKeySwitch == false)) {
attack = true;
kicking = true;
kickKeySwitch = true;
} else if (!Key.isDown(32)) {
kickKeySwitch = false;
}
}
function suicide() {
if (Key.isDown(13) && (suicideSwitch == false)) {
dead = true;
suicideSwitch = true;
}
if (!Key.isDown(13)) {
suicideSwitch = false;
}
}
function pauseGame() {
if (((Key.isDown(27) && (pauseSwitch == false)) && (gamePaused == false)) && (dead == false)) {
gamePaused = true;
imdrawing = false;
pauseScreen._visible = true;
inverter._visible = true;
pauseSwitch = true;
} else if ((Key.isDown(27) && (pauseSwitch == false)) && (gamePaused == true)) {
gamePaused = false;
pauseScreen._visible = false;
inverter._visible = false;
pauseSwitch = true;
} else if (!Key.isDown(27)) {
pauseSwitch = false;
}
}
function cheats() {
if (mudkipcheat == true) {
man.sprite._visible = false;
man.mudkip._visible = true;
man.mage._visible = false;
if ((man.mudkip._currentframe != 4) && (attack == false)) {
if (air == false) {
if ((Key.isDown(68) == false) && (Key.isDown(65) == false)) {
man.mudkip.gotoAndStop(1);
} else if ((Key.isDown(68) == true) or (Key.isDown(65) == true)) {
if (Key.isDown(68)) {
man.mudkip._xscale = mudkipXScale;
} else if (Key.isDown(65)) {
man.mudkip._xscale = -mudkipXScale;
}
man.mudkip.gotoAndStop(2);
}
} else if (air == true) {
man.mudkip.gotoAndStop(3);
}
if (Key.isDown(32) && (kickKeySwitch == false)) {
if (man.mudkip.inSprite.head._currentframe == 1) {
mudkipMouthOpen = true;
} else if (man.mudkip.inSprite.head._currentframe == 2) {
mudkipMouthOpen = false;
}
}
if (mudkipMouthOpen == true) {
man.mudkip.inSprite.head.gotoAndStop(2);
} else {
man.mudkip.inSprite.head.gotoAndStop(1);
}
}
} else if (magecheat == true) {
man.sprite._visible = false;
man.mudkip._visible = false;
man.mage._visible = true;
if ((man.mage._currentframe != 4) && (attack == false)) {
if (air == false) {
if ((Key.isDown(68) == false) && (Key.isDown(65) == false)) {
man.mage.gotoAndStop(1);
} else if ((Key.isDown(68) == true) or (Key.isDown(65) == true)) {
if (Key.isDown(68)) {
man.mage._xscale = mageXScale;
} else if (Key.isDown(65)) {
man.mage._xscale = -mageXScale;
}
man.mage.gotoAndStop(2);
}
} else if (air == true) {
man.mage.gotoAndStop(3);
}
}
} else if ((mudkipcheat == false) && (magecheat == false)) {
man.sprite._visible = true;
man.mudkip._visible = false;
man.mage._visible = false;
}
}
function achievementsFunc() {
if ((gray_so.data.totalDeaths == 100) && (gray_so.data.deathachievementplayed != true)) {
achpopup.dontfearthereaper._visible = true;
gray_so.data.deathachievementplayed = true;
achpopup.gotoAndPlay("start");
}
if ((gray_so.data.totalLines > 900) && (gray_so.data.over9000achievementplayed != true)) {
achpopup.over9000._visible = true;
gray_so.data.over9000achievementplayed = true;
achpopup.gotoAndPlay("start");
}
}
function timerCounter() {
timerPart++;
if (timerPart == 40) {
timer++;
gray_so.data.totalTimer++;
timerPart = 0;
}
}
stop();
pauseScreen._visible = false;
inverter._visible = false;
Mouse.hide();
platx = platforms._x;
platy = platforms._y;
backx = theBackground._x;
backy = theBackground._y;
manx = man._x;
many = man._y;
dead = false;
gamePaused = false;
dodging = false;
var attack = false;
var kicking = false;
var manstate = 1;
var runSpeed = 15;
var xSpeed = 0;
var ySpeed = 0;
var jumping = false;
var jumpKeySwitch = false;
var mudkipXScale = man.mudkip._xscale;
var mageXScale = man.mage._xscale;
var manXScale = man.sprite._xscale;
var gravity = 2;
var color = new Color("_root.man");
var imdrawing = false;
var terrainVar = 1;
Frame 22
function onMouseDown() {
if ((terrainVar == 1) && (gamePaused == false)) {
createEmptyMovieClip("terrain1", man.getDepth() - 1);
terrain1.lineStyle(40, 3355443, 100);
if (imdrawing == false) {
terrain1.moveTo(_xmouse, _ymouse);
imdrawing = true;
xMouseStart = _xmouse;
yMouseStart = _ymouse;
}
} else if ((terrainVar == 20) && (gamePaused == false)) {
createEmptyMovieClip("terrain2", man.getDepth() - 2);
terrain2.lineStyle(40, 6710886, 100);
if (imdrawing == false) {
terrain2.moveTo(_xmouse, _ymouse);
imdrawing = true;
xMouseStart = _xmouse;
yMouseStart = _ymouse;
}
}
}
function Drawing() {
if (((terrainVar == 1) && (imdrawing == true)) && (!man.nodrawhitbox.hitTest(_xmouse, _ymouse, true))) {
if (((air == false) && (!Key.isDown(65))) && (!Key.isDown(68))) {
terrain1.lineTo(_xmouse, _ymouse);
}
} else if (((terrainVar == 2) && (imdrawing == true)) && (!man.nodrawhitbox.hitTest(_xmouse, _ymouse, true))) {
if (((air == false) && (!Key.isDown(65))) && (!Key.isDown(68))) {
terrain2.lineTo(_xmouse, _ymouse);
}
}
if (imdrawing == false) {
lineDrawed = false;
}
if (imdrawing == true) {
if ((((_xmouse != xMouseStart) && (lineDrawed == false)) && (terrainVar == 1)) or (((_ymouse != yMouseStart) && (lineDrawed == false)) && (terrainVar == 1))) {
line1Drawn = true;
lineDrawed = true;
gray_so.data.totalLines++;
levelLinesPlayer++;
} else if (((_xmouse == xMouseStart) && (_ymouse == yMouseStart)) && (terrainVar == 1)) {
line1Drawn = false;
lineDrawed = false;
}
if ((((_xmouse != xMouseStart) && (lineDrawed == false)) && (terrainVar == 2)) or (((_ymouse != yMouseStart) && (lineDrawed == false)) && (terrainVar == 2))) {
line2Drawn = true;
lineDrawed = true;
gray_so.data.totalLines++;
levelLinesPlayer++;
} else if (((_xmouse == xMouseStart) && (_ymouse == yMouseStart)) && (terrainVar == 2)) {
line2Drawn = false;
lineDrawed = false;
}
if ((((air == true) or Key.isDown(65)) or Key.isDown(68)) or (gamePaused == true)) {
imdrawing = false;
}
if (man.nodrawhitbox.hitTest(_xmouse, _ymouse, true)) {
imdrawing = false;
}
if ((((_xmouse > 750) or (_xmouse < 0)) or (_ymouse > 500)) or (_ymouse < 0)) {
imdrawing = false;
}
}
if (Key.isDown(69) && (terrainKeySwitch == false)) {
terrainVar = terrainVar + 0;
terrainKeySwitch = true;
} else if (!Key.isDown(69)) {
terrainKeySwitch = false;
}
if (terrainVar > 2) {
terrainVar = 1;
}
}
function switches() {
if ((platforms.switch1.hitTest(man._x + _x, man._y + _y, true) or ((platforms.switch1.hitTest(terrain1) == true) && (line1Drawn == true))) or ((platforms.switch1.hitTest(terrain2) == true) && (line2Drawn == true))) {
switchdoor1open = true;
} else if (dead == true) {
switchdoor1open = false;
}
if (switchdoor1open == true) {
platforms.switch1.gotoAndStop(2);
if (platforms.plats.switchdoor1._rotation < 180) {
platforms.plats.switchdoor1._rotation = platforms.plats.switchdoor1._rotation + 3;
}
} else if (switchdoor1open == false) {
platforms.switch1.gotoAndStop(1);
if (platforms.plats.switchdoor1._rotation > 90) {
platforms.plats.switchdoor1._rotation = platforms.plats.switchdoor1._rotation - 3;
}
}
if ((platforms.switch2.hitTest(man._x + _x, man._y + _y, true) or ((platforms.switch2.hitTest(terrain1) == true) && (line1Drawn == true))) or ((platforms.switch2.hitTest(terrain2) == true) && (line2Drawn == true))) {
switchdoor2open = true;
} else if (!platforms.switch2.hitTest(man._x + _x, man._y + _y, true)) {
switchdoor2open = false;
}
if (switchdoor2open == true) {
platforms.switch2.gotoAndStop(2);
if (platforms.plats.switchdoor2._rotation > 90) {
platforms.plats.switchdoor2._rotation = platforms.plats.switchdoor2._rotation - 3;
}
} else if (switchdoor2open == false) {
platforms.switch2.gotoAndStop(1);
if (platforms.plats.switchdoor2._rotation < 180) {
platforms.plats.switchdoor2._rotation = platforms.plats.switchdoor2._rotation + 3;
}
}
if ((platforms.switch3.hitTest(man._x + _x, man._y + _y, true) or ((platforms.switch3.hitTest(terrain1) == true) && (line1Drawn == true))) or ((platforms.switch3.hitTest(terrain2) == true) && (line2Drawn == true))) {
switchdoor3open = true;
} else if (!platforms.switch3.hitTest(man._x + _x, man._y + _y, true)) {
switchdoor3open = false;
}
if (switchdoor3open == true) {
platforms.switch3.gotoAndStop(2);
if (platforms.plats.switchdoor3._rotation > -90) {
platforms.plats.switchdoor3._rotation = platforms.plats.switchdoor3._rotation - 3;
}
} else if (switchdoor3open == false) {
platforms.switch3.gotoAndStop(1);
if (platforms.plats.switchdoor3._rotation < 0) {
platforms.plats.switchdoor3._rotation = platforms.plats.switchdoor3._rotation + 3;
}
}
}
function doorHit() {
if (platforms.door.hitTest(man._x + _x, man._y + _y, true)) {
gamePaused = true;
if (fader._alpha < 100) {
fader._alpha = fader._alpha + 5;
} else if (((fader._alpha >= 100) && (noJumpMode == false)) && (leastLinesMode == false)) {
man.sprite._xscale = manXScale;
man.mudkip._xscale = mudkipXScale;
man.mage._xscale = mageXScale;
createEmptyMovieClip("terrain1", man.getDepth() - 1);
createEmptyMovieClip("terrain2", man.getDepth() - 2);
man._x = 375;
man._y = 250;
if (gray_so.data.lvlsavailable == 7) {
gray_so.data.lvlsavailable++;
}
gotoAndStop ("lvl8");
} else if (((fader._alpha >= 100) && (noJumpMode == true)) && (leastLinesMode == false)) {
gray_so.data.lvl7noJump = true;
gotoAndStop ("noJumps");
} else if (((fader._alpha >= 100) && (leastLinesMode == true)) && (noJumpMode == false)) {
if (levelLinesPlayer < gray_so.data.lvl7leastLinesPlayer) {
gray_so.data.lvl7leastLinesPlayer = levelLinesPlayer;
}
gotoAndStop ("leastLines");
}
}
}
function onMouseUp() {
imdrawing = false;
}
function onEnterFrame() {
displayText();
wallClinging = false;
xVar = man._x;
yVar = man._y;
testVar = ySpeed + yUp;
music();
cheats();
achievementsFunc();
pauseGame();
customCursor();
doorHit();
if (gamePaused == false) {
Drawing();
timerCounter();
man._x = man._x + xSpeed;
man._y = man._y + ySpeed;
manCollision();
moveScreen();
lookAround();
if (dead == false) {
if (fader._alpha > 0) {
fader._alpha = fader._alpha - 2;
}
kick();
manJump(-20);
managemanSprite();
onGround();
manageColor();
suicide();
spikesHit();
switches();
if ((Key.isDown(68) && (dodging == false)) && (wallClinging == false)) {
xSpeed = runSpeed;
} else if ((Key.isDown(65) && (dodging == false)) && (wallClinging == false)) {
xSpeed = -runSpeed;
} else if (((!Key.isDown(65)) && (!Key.isDown(68))) && (dodging == false)) {
xSpeed = 0;
}
} else {
man.sprite.gotoAndStop(4);
man.mudkip.gotoAndStop(4);
man.mage.gotoAndStop(4);
xSpeed = 0;
}
if (((man._x + xSpeed) > Stage.width) or ((man._x + xSpeed) < 0)) {
xSpeed = xSpeed - xSpeed;
} else if (dead == true) {
levelLinesPlayer = 0;
if (fader._alpha < 100) {
fader._alpha = fader._alpha + 5;
}
if (fader._alpha >= 100) {
dead = false;
deathsThisTime++;
man.sprite.gotoAndStop(1);
man.mudkip.gotoAndStop(1);
man.mage.gotoAndStop(1);
platforms._x = platx;
platforms._y = platy;
theBackground._x = backx;
theBackground._y = backy;
man._x = manx;
man._y = many;
createEmptyMovieClip("terrain1", man.getDepth() - 1);
createEmptyMovieClip("terrain2", man.getDepth() - 2);
}
}
}
}
function managemanSprite() {
if ((man.sprite._currentframe != 4) && (attack == false)) {
if ((air == false) && (wallClinging == false)) {
if (((Key.isDown(68) == false) && (Key.isDown(65) == false)) && (dodging == false)) {
man.sprite.gotoAndStop(1);
} else if (((Key.isDown(68) == true) && (dodging == false)) or ((Key.isDown(65) == true) && (dodging == false))) {
if (Key.isDown(68) && (dodging == false)) {
man.sprite._xscale = manXScale;
} else if (Key.isDown(65) && (dodging == false)) {
man.sprite._xscale = -manXScale;
}
man.sprite.gotoAndStop(2);
}
} else if (((air == true) && (dodging == false)) && (wallClinging == false)) {
man.sprite.gotoAndStop(3);
} else if (wallClinging == true) {
man.sprite.gotoAndStop(6);
}
} else if ((man.sprite._currentframe != 4) && (attack == true)) {
if (kicking == true) {
man.sprite.gotoAndStop(7);
}
}
}
function manageColor() {
if (man.sprite._xscale == (-manXScale)) {
man.sprite.bwhite.blendMode = "invert";
} else if (man.sprite._xscale == manXScale) {
man.sprite.bwhite.blendMode = "alpha";
}
}
function manJump(jumpHeight) {
if ((((((Key.isDown(87) && (noJumpMode == false)) && (!Key.isDown(70))) && (jumpKeySwitch == false)) && (doubleJump < 2)) && (noJump == false)) && (ySpeed > -1)) {
gray_so.data.totalJumps++;
jumpKeySwitch = true;
jumping = true;
doubleJump++;
air = true;
yUp = 0;
wallClinging = false;
gravity = 2;
man.sprite.inSprite.play();
man.sprite.bwhite.play();
man.sprite.outline.play();
if (ySpeed > -5) {
ySpeed = jumpHeight;
}
if ((doubleJump >= 2) && (ySpeed < -5)) {
ySpeed = jumpHeight;
}
} else if (Key.isDown(87) == false) {
jumpKeySwitch = false;
}
if ((jumping == true) && (ySpeed > 0)) {
jumping = false;
}
}
function onGround() {
if (((platforms.plats.hitTest(man._x + _x, ((man._y + 38) - yUp) + _y, true) or terrain1.hitTest(man._x + _x, ((man._y + 38) - yUp) + _y, true)) or terrain2.hitTest(man._x + _x, ((man._y + 38) - yUp) + _y, true)) or (wallClinging == true)) {
gravity = 2;
air = false;
doubleJump = 1;
} else {
air = true;
man._rotation = 0;
if (ySpeed < 15) {
ySpeed = ySpeed + gravity;
}
}
}
function manCollision() {
yUp = 0;
while ((platforms.plats.hitTest(man._x + _x, (((man._y + 35) + yUp) + _y) - 4, true) or terrain1.hitTest(man._x + _x, (((man._y + 35) + yUp) + _y) - 4, true)) or terrain2.hitTest(man._x + _x, (((man._y + 35) + yUp) + _y) - 4, true)) {
yUp--;
if (((Key.isDown(65) && (air == false)) && (jumping == false)) or ((Key.isDown(68) && (air == false)) && (jumping == false))) {
if ((yUp < ySpeed) && (man.sprite._xscale == (-manXScale))) {
man._rotation = ((-(yUp - ySpeed)) * 3) - (ySpeed * 6.15);
} else if ((yUp > ySpeed) && (man.sprite._xscale == manXScale)) {
man._rotation = ((yUp - ySpeed) * 3) + (ySpeed * 6.15);
} else if ((yUp > ySpeed) && (man.sprite._xscale == (-manXScale))) {
man._rotation = ((-(yUp - ySpeed)) * 3) - (ySpeed * 6.15);
} else if ((yUp < ySpeed) && (man.sprite._xscale == manXScale)) {
man._rotation = ((yUp - ySpeed) * 3) + (ySpeed * 6.15);
}
}
}
if ((platforms.plats.hitTest(man._x + _x, ((man._y - 35) + yUp) + _y, true) or terrain1.hitTest(man._x + _x, ((man._y - 35) + yUp) + _y, true)) or terrain2.hitTest(man._x + _x, ((man._y - 35) + yUp) + _y, true)) {
yUp = -ySpeed;
}
while ((((xSpeed != 0) && (platforms.plats.hitTest((man._x + xSpeed) + _x, ((man._y - 35) + yUp) + _y, true))) or ((xSpeed != 0) && (terrain1.hitTest((man._x + xSpeed) + _x, ((man._y - 35) + yUp) + _y, true)))) or ((xSpeed != 0) && (terrain2.hitTest((man._x + xSpeed) + _x, ((man._y - 35) + yUp) + _y, true)))) {
man._x = man._x - xSpeed;
}
if (((yUp == 0) && (ySpeed == 0)) && (air == false)) {
yUp = -16;
ySpeed = 16;
}
if ((yUp < -50) && (ySpeed > 0)) {
xSpeed = 0;
yUp = -ySpeed;
} else if ((yUp < -50) && (ySpeed < 0)) {
yUp = -15;
}
noJump = false;
man._y = man._y + yUp;
collideVar = yUp - ySpeed;
while ((((((platforms.plats.hitTest((man._x + xSpeed) + _x, man._y + _y, true) && (xSpeed != 0)) or (platforms.plats.hitTest((man._x + xSpeed) + _x, man._y + _y, true) && (xSpeed != 0))) or (terrain1.hitTest((man._x + xSpeed) + _x, man._y + _y, true) && (xSpeed != 0))) or (terrain1.hitTest((man._x + xSpeed) + _x, man._y + _y, true) && (xSpeed != 0))) or (terrain2.hitTest((man._x + xSpeed) + _x, man._y + _y, true) && (xSpeed != 0))) or (terrain2.hitTest((man._x + xSpeed) + _x, man._y + _y, true) && (xSpeed != 0))) {
man._x = man._x - xSpeed;
}
while ((xSpeed == 0) && (platforms.plats.hitTest((man._x - 20) + _x, man._y + _y, true))) {
man._x = man._x + 21;
}
while ((xSpeed == 0) && (platforms.plats.hitTest((man._x + 20) + _x, man._y + _y, true))) {
man._x = man._x - 21;
}
}
function moveScreen() {
if (man._x > (Stage.width - 250)) {
platforms._x = platforms._x - runSpeed;
terrain1._x = terrain1._x - runSpeed;
terrain2._x = terrain2._x - runSpeed;
man._x = man._x - runSpeed;
theBackground._x = theBackground._x - (runSpeed / 8);
}
if (man._x < 250) {
platforms._x = platforms._x + runSpeed;
terrain1._x = terrain1._x + runSpeed;
terrain2._x = terrain2._x + runSpeed;
man._x = man._x + runSpeed;
theBackground._x = theBackground._x + (runSpeed / 8);
}
if (((man._y + ySpeed) + yUp) > (Stage.height - 150)) {
platforms._y = platforms._y - (ySpeed + yUp);
terrain1._y = terrain1._y - (ySpeed + yUp);
terrain2._y = terrain2._y - (ySpeed + yUp);
man._y = man._y - (ySpeed + yUp);
theBackground._y = theBackground._y - ((ySpeed + yUp) / 8);
}
if (((man._y + ySpeed) + yUp) < 150) {
platforms._y = platforms._y - (ySpeed + yUp);
terrain1._y = terrain1._y - (ySpeed + yUp);
terrain2._y = terrain2._y - (ySpeed + yUp);
man._y = man._y - (ySpeed + yUp);
theBackground._y = theBackground._y - ((ySpeed + yUp) / 8);
}
if (((man._y + ySpeed) + yUp) < 125) {
platforms._y = platforms._y - ((ySpeed + yUp) - 26);
terrain1._y = terrain1._y - ((ySpeed + yUp) - 26);
terrain2._y = terrain2._y - ((ySpeed + yUp) - 26);
man._y = man._y - ((ySpeed + yUp) - 26);
theBackground._y = theBackground._y - (((ySpeed + yUp) - 26) / 8);
}
if (((man._y + ySpeed) + yUp) > (Stage.height - 125)) {
platforms._y = platforms._y - ((ySpeed + yUp) + 26);
terrain1._y = terrain1._y - ((ySpeed + yUp) + 26);
terrain2._y = terrain2._y - ((ySpeed + yUp) + 26);
man._y = man._y - ((ySpeed + yUp) + 26);
theBackground._y = theBackground._y - (((ySpeed + yUp) + 26) / 8);
}
if ((((man._y + ySpeed) + yUp) < 139) && (Key.isDown(70))) {
platforms._y = platforms._y - ((ySpeed + yUp) - 15);
terrain1._y = terrain1._y - ((ySpeed + yUp) - 15);
terrain2._y = terrain2._y - ((ySpeed + yUp) - 15);
man._y = man._y - ((ySpeed + yUp) - 15);
theBackground._y = theBackground._y - (((ySpeed + yUp) - 15) / 8);
}
if ((((man._y + ySpeed) + yUp) > (Stage.height - 139)) && (Key.isDown(70))) {
platforms._y = platforms._y - ((ySpeed + yUp) + 15);
terrain1._y = terrain1._y - ((ySpeed + yUp) + 15);
terrain2._y = terrain2._y - ((ySpeed + yUp) + 15);
man._y = man._y - ((ySpeed + yUp) + 15);
theBackground._y = theBackground._y - (((ySpeed + yUp) + 15) / 8);
}
}
function lookAround() {
if (((Key.isDown(70) && (air == false)) && (!Key.isDown(65))) && (!Key.isDown(68))) {
imdrawing = false;
if (_xmouse > (Stage.width - 250)) {
platforms._x = platforms._x - runSpeed;
terrain1._x = terrain1._x - runSpeed;
terrain2._x = terrain2._x - runSpeed;
man._x = man._x - runSpeed;
theBackground._x = theBackground._x - (runSpeed / 8);
}
if (_xmouse < 250) {
platforms._x = platforms._x + runSpeed;
terrain1._x = terrain1._x + runSpeed;
terrain2._x = terrain2._x + runSpeed;
man._x = man._x + runSpeed;
theBackground._x = theBackground._x + (runSpeed / 8);
}
if (_ymouse < 139) {
platforms._y = platforms._y - ((ySpeed + yUp) - 15);
terrain1._y = terrain1._y - ((ySpeed + yUp) - 15);
terrain2._y = terrain2._y - ((ySpeed + yUp) - 15);
man._y = man._y - ((ySpeed + yUp) - 15);
theBackground._y = theBackground._y - (((ySpeed + yUp) - 15) / 8);
}
if (_ymouse > (Stage.height - 139)) {
platforms._y = platforms._y - ((ySpeed + yUp) + 15);
terrain1._y = terrain1._y - ((ySpeed + yUp) + 15);
terrain2._y = terrain2._y - ((ySpeed + yUp) + 15);
man._y = man._y - ((ySpeed + yUp) + 15);
theBackground._y = theBackground._y - (((ySpeed + yUp) + 15) / 8);
}
}
}
function customCursor() {
cursor.gotoAndStop(terrainVar);
linecolor.gotoAndStop(terrainVar);
cursor._x = _xmouse;
cursor._y = _ymouse;
cursor._rotation = cursor._rotation + 3;
}
function wallCling() {
if ((platforms.plats.hitTest(((man._x + xSpeed) + 16) + _x, (man._y - 60) + _y, true) && (air == true)) && (Key.isDown(39))) {
man.sprite._xscale = -manXScale;
wallClinging = true;
air = false;
ySpeed = 0;
doubleJump = 0;
} else if ((platforms.plats.hitTest(((man._x + xSpeed) - 16) + _x, man._y + _y, true) && (air == true)) && (Key.isDown(37))) {
man.sprite._xscale = manXScale;
wallClinging = true;
air = false;
ySpeed = 0;
doubleJump = 0;
}
if ((air == true) or Key.isDown(40)) {
wallClinging = false;
}
}
function manDodge() {
if (((Key.isDown(40) && (Key.isDown(68))) && (dodgeSwitch == false)) && (wallClinging == false)) {
dodging = "right";
dodgeSwitch = true;
} else if (((Key.isDown(40) && (Key.isDown(65))) && (dodgeSwitch == false)) && (wallClinging == false)) {
dodging = "left";
dodgeSwitch = true;
}
if (dodging == "right") {
man.sprite._xscale = manXScale;
man.sprite.gotoAndStop(5);
xSpeed = 25;
dodgeSwitch == true;
} else if (dodging == "left") {
man.sprite._xscale = -manXScale;
man.sprite.gotoAndStop(5);
xSpeed = -25;
dodgeSwitch == true;
}
if (!Key.isDown(40)) {
dodgeSwitch = false;
}
}
function spikesHit() {
if (((platforms.spikes.hitTest(man._x + _x, man._y + _y, true) or platforms.spikes2.hitTest(man._x + _x, man._y + _y, true)) or platforms.spikes3.hitTest(man._x + _x, man._y + _y, true)) or platforms.spikes4.hitTest(man._x + _x, man._y + _y, true)) {
gray_so.data.totalDeaths++;
currentDeaths++;
dead = true;
}
}
function kick() {
if (Key.isDown(32) && (kickKeySwitch == false)) {
attack = true;
kicking = true;
kickKeySwitch = true;
} else if (!Key.isDown(32)) {
kickKeySwitch = false;
}
}
function suicide() {
if (Key.isDown(13) && (suicideSwitch == false)) {
dead = true;
suicideSwitch = true;
}
if (!Key.isDown(13)) {
suicideSwitch = false;
}
}
function pauseGame() {
if (((Key.isDown(27) && (pauseSwitch == false)) && (gamePaused == false)) && (dead == false)) {
gamePaused = true;
imdrawing = false;
pauseScreen._visible = true;
inverter._visible = true;
pauseSwitch = true;
} else if ((Key.isDown(27) && (pauseSwitch == false)) && (gamePaused == true)) {
gamePaused = false;
pauseScreen._visible = false;
inverter._visible = false;
pauseSwitch = true;
} else if (!Key.isDown(27)) {
pauseSwitch = false;
}
}
function cheats() {
if (mudkipcheat == true) {
man.sprite._visible = false;
man.mudkip._visible = true;
man.mage._visible = false;
if ((man.mudkip._currentframe != 4) && (attack == false)) {
if (air == false) {
if ((Key.isDown(68) == false) && (Key.isDown(65) == false)) {
man.mudkip.gotoAndStop(1);
} else if ((Key.isDown(68) == true) or (Key.isDown(65) == true)) {
if (Key.isDown(68)) {
man.mudkip._xscale = mudkipXScale;
} else if (Key.isDown(65)) {
man.mudkip._xscale = -mudkipXScale;
}
man.mudkip.gotoAndStop(2);
}
} else if (air == true) {
man.mudkip.gotoAndStop(3);
}
if (Key.isDown(32) && (kickKeySwitch == false)) {
if (man.mudkip.inSprite.head._currentframe == 1) {
mudkipMouthOpen = true;
} else if (man.mudkip.inSprite.head._currentframe == 2) {
mudkipMouthOpen = false;
}
}
if (mudkipMouthOpen == true) {
man.mudkip.inSprite.head.gotoAndStop(2);
} else {
man.mudkip.inSprite.head.gotoAndStop(1);
}
}
} else if (magecheat == true) {
man.sprite._visible = false;
man.mudkip._visible = false;
man.mage._visible = true;
if ((man.mage._currentframe != 4) && (attack == false)) {
if (air == false) {
if ((Key.isDown(68) == false) && (Key.isDown(65) == false)) {
man.mage.gotoAndStop(1);
} else if ((Key.isDown(68) == true) or (Key.isDown(65) == true)) {
if (Key.isDown(68)) {
man.mage._xscale = mageXScale;
} else if (Key.isDown(65)) {
man.mage._xscale = -mageXScale;
}
man.mage.gotoAndStop(2);
}
} else if (air == true) {
man.mage.gotoAndStop(3);
}
}
} else if ((mudkipcheat == false) && (magecheat == false)) {
man.sprite._visible = true;
man.mudkip._visible = false;
man.mage._visible = false;
}
}
function achievementsFunc() {
if ((gray_so.data.totalDeaths == 100) && (gray_so.data.deathachievementplayed != true)) {
achpopup.dontfearthereaper._visible = true;
gray_so.data.deathachievementplayed = true;
achpopup.gotoAndPlay("start");
}
if ((gray_so.data.totalLines > 900) && (gray_so.data.over9000achievementplayed != true)) {
achpopup.over9000._visible = true;
gray_so.data.over9000achievementplayed = true;
achpopup.gotoAndPlay("start");
}
}
function timerCounter() {
timerPart++;
if (timerPart == 40) {
timer++;
gray_so.data.totalTimer++;
timerPart = 0;
}
}
stop();
pauseScreen._visible = false;
inverter._visible = false;
Mouse.hide();
platx = platforms._x;
platy = platforms._y;
backx = theBackground._x;
backy = theBackground._y;
manx = man._x;
many = man._y;
dead = false;
gamePaused = false;
dodging = false;
var attack = false;
var kicking = false;
var manstate = 1;
var runSpeed = 15;
var xSpeed = 0;
var ySpeed = 0;
var jumping = false;
var jumpKeySwitch = false;
var mudkipXScale = man.mudkip._xscale;
var mageXScale = man.mage._xscale;
var manXScale = man.sprite._xscale;
var gravity = 2;
var color = new Color("_root.man");
var imdrawing = false;
var terrainVar = 1;
Frame 23
function onMouseDown() {
if ((terrainVar == 1) && (gamePaused == false)) {
createEmptyMovieClip("terrain1", man.getDepth() - 1);
terrain1.lineStyle(40, 3355443, 100);
if (imdrawing == false) {
terrain1.moveTo(_xmouse, _ymouse);
imdrawing = true;
xMouseStart = _xmouse;
yMouseStart = _ymouse;
}
} else if ((terrainVar == 2) && (gamePaused == false)) {
createEmptyMovieClip("terrain2", man.getDepth() - 2);
terrain2.lineStyle(40, 6710886, 100);
if (imdrawing == false) {
terrain2.moveTo(_xmouse, _ymouse);
imdrawing = true;
xMouseStart = _xmouse;
yMouseStart = _ymouse;
}
}
}
function Drawing() {
if (((terrainVar == 1) && (imdrawing == true)) && (!man.nodrawhitbox.hitTest(_xmouse, _ymouse, true))) {
if (((air == false) && (!Key.isDown(65))) && (!Key.isDown(68))) {
terrain1.lineTo(_xmouse, _ymouse);
}
} else if (((terrainVar == 2) && (imdrawing == true)) && (!man.nodrawhitbox.hitTest(_xmouse, _ymouse, true))) {
if (((air == false) && (!Key.isDown(65))) && (!Key.isDown(68))) {
terrain2.lineTo(_xmouse, _ymouse);
}
}
if (imdrawing == false) {
lineDrawed = false;
}
if (imdrawing == true) {
if ((((_xmouse != xMouseStart) && (lineDrawed == false)) && (terrainVar == 1)) or (((_ymouse != yMouseStart) && (lineDrawed == false)) && (terrainVar == 1))) {
line1Drawn = true;
lineDrawed = true;
gray_so.data.totalLines++;
levelLinesPlayer++;
} else if (((_xmouse == xMouseStart) && (_ymouse == yMouseStart)) && (terrainVar == 1)) {
line1Drawn = false;
lineDrawed = false;
}
if ((((_xmouse != xMouseStart) && (lineDrawed == false)) && (terrainVar == 2)) or (((_ymouse != yMouseStart) && (lineDrawed == false)) && (terrainVar == 2))) {
line2Drawn = true;
lineDrawed = true;
gray_so.data.totalLines++;
levelLinesPlayer++;
} else if (((_xmouse == xMouseStart) && (_ymouse == yMouseStart)) && (terrainVar == 2)) {
line2Drawn = false;
lineDrawed = false;
}
if ((((air == true) or Key.isDown(65)) or Key.isDown(68)) or (gamePaused == true)) {
imdrawing = false;
}
if (man.nodrawhitbox.hitTest(_xmouse, _ymouse, true)) {
imdrawing = false;
}
if ((((_xmouse > 750) or (_xmouse < 0)) or (_ymouse > 500)) or (_ymouse < 0)) {
imdrawing = false;
}
}
if (Key.isDown(69) && (terrainKeySwitch == false)) {
terrainVar = terrainVar + 1;
terrainKeySwitch = true;
} else if (!Key.isDown(69)) {
terrainKeySwitch = false;
}
if (terrainVar > 2) {
terrainVar = 1;
}
}
function switches() {
if ((platforms.switch1.hitTest(man._x + _x, man._y + _y, true) or ((platforms.switch1.hitTest(terrain1) == true) && (line1Drawn == true))) or ((platforms.switch1.hitTest(terrain2) == true) && (line2Drawn == true))) {
switchdoor1open = true;
} else if (!platforms.switch1.hitTest(man._x + _x, man._y + _y, true)) {
switchdoor1open = false;
}
if (switchdoor1open == true) {
platforms.switch1.gotoAndStop(2);
if (platforms.plats.switchdoor1._rotation > 0) {
platforms.plats.switchdoor1._rotation = platforms.plats.switchdoor1._rotation - 3;
}
} else if (switchdoor1open == false) {
platforms.switch1.gotoAndStop(1);
if (platforms.plats.switchdoor1._rotation < 90) {
platforms.plats.switchdoor1._rotation = platforms.plats.switchdoor1._rotation + 3;
}
}
if ((platforms.switch2.hitTest(man._x + _x, man._y + _y, true) or ((platforms.switch2.hitTest(terrain1) == true) && (line1Drawn == true))) or ((platforms.switch2.hitTest(terrain2) == true) && (line2Drawn == true))) {
switchdoor2open = true;
} else if (!platforms.switch2.hitTest(man._x + _x, man._y + _y, true)) {
switchdoor2open = false;
}
if (switchdoor2open == true) {
platforms.switch2.gotoAndStop(2);
if (platforms.plats.switchdoor2._rotation < 90) {
platforms.plats.switchdoor2._rotation = platforms.plats.switchdoor2._rotation + 3;
}
} else if (switchdoor2open == false) {
platforms.switch2.gotoAndStop(1);
if (platforms.plats.switchdoor2._rotation > 0) {
platforms.plats.switchdoor2._rotation = platforms.plats.switchdoor2._rotation - 3;
}
}
if ((platforms.switch3.hitTest(man._x + _x, man._y + _y, true) or ((platforms.switch3.hitTest(terrain1) == true) && (line1Drawn == true))) or ((platforms.switch3.hitTest(terrain2) == true) && (line2Drawn == true))) {
switchdoor3open = true;
} else if (!platforms.switch3.hitTest(man._x + _x, man._y + _y, true)) {
switchdoor3open = false;
}
if (switchdoor3open == true) {
platforms.switch3.gotoAndStop(2);
if (platforms.plats.switchdoor3._rotation < 90) {
platforms.plats.switchdoor3._rotation = platforms.plats.switchdoor3._rotation + 3;
}
} else if (switchdoor3open == false) {
platforms.switch3.gotoAndStop(1);
if (platforms.plats.switchdoor3._rotation > 0) {
platforms.plats.switchdoor3._rotation = platforms.plats.switchdoor3._rotation - 3;
}
}
}
function doorHit() {
if (platforms.door.hitTest(man._x + _x, man._y + _y, true)) {
gamePaused = true;
if (fader._alpha < 100) {
fader._alpha = fader._alpha + 5;
} else if (((fader._alpha >= 100) && (noJumpMode == false)) && (leastLinesMode == false)) {
man.sprite._xscale = manXScale;
man.mudkip._xscale = mudkipXScale;
man.mage._xscale = mageXScale;
createEmptyMovieClip("terrain1", man.getDepth() - 1);
createEmptyMovieClip("terrain2", man.getDepth() - 2);
man._x = 375;
man._y = 250;
if (gray_so.data.lvlsavailable == 8) {
gray_so.data.lvlsavailable++;
}
gotoAndStop ("lvl9");
} else if (((fader._alpha >= 100) && (noJumpMode == true)) && (leastLinesMode == false)) {
gray_so.data.lvl8noJump = true;
gotoAndStop ("noJumps");
} else if (((fader._alpha >= 100) && (leastLinesMode == true)) && (noJumpMode == false)) {
if (levelLinesPlayer < gray_so.data.lvl8leastLinesPlayer) {
gray_so.data.lvl8leastLinesPlayer = levelLinesPlayer;
}
gotoAndStop ("leastLines");
}
}
}
function onMouseUp() {
imdrawing = false;
}
function onEnterFrame() {
displayText();
wallClinging = false;
xVar = man._x;
yVar = man._y;
testVar = ySpeed + yUp;
music();
cheats();
achievementsFunc();
pauseGame();
customCursor();
doorHit();
if (gamePaused == false) {
Drawing();
timerCounter();
man._x = man._x + xSpeed;
man._y = man._y + ySpeed;
manCollision();
moveScreen();
lookAround();
if (dead == false) {
if (fader._alpha > 0) {
fader._alpha = fader._alpha - 2;
}
kick();
manJump(-20);
managemanSprite();
onGround();
manageColor();
suicide();
spikesHit();
switches();
if ((Key.isDown(68) && (dodging == false)) && (wallClinging == false)) {
xSpeed = runSpeed;
} else if ((Key.isDown(65) && (dodging == false)) && (wallClinging == false)) {
xSpeed = -runSpeed;
} else if (((!Key.isDown(65)) && (!Key.isDown(68))) && (dodging == false)) {
xSpeed = 0;
}
} else {
man.sprite.gotoAndStop(4);
man.mudkip.gotoAndStop(4);
man.mage.gotoAndStop(4);
xSpeed = 0;
}
if (((man._x + xSpeed) > Stage.width) or ((man._x + xSpeed) < 0)) {
xSpeed = xSpeed - xSpeed;
} else if (dead == true) {
levelLinesPlayer = 0;
if (fader._alpha < 100) {
fader._alpha = fader._alpha + 5;
}
if (fader._alpha >= 100) {
dead = false;
deathsThisTime++;
man.sprite.gotoAndStop(1);
man.mudkip.gotoAndStop(1);
man.mage.gotoAndStop(1);
platforms._x = platx;
platforms._y = platy;
theBackground._x = backx;
theBackground._y = backy;
man._x = manx;
man._y = many;
createEmptyMovieClip("terrain1", man.getDepth() - 1);
createEmptyMovieClip("terrain2", man.getDepth() - 2);
}
}
}
}
function managemanSprite() {
if ((man.sprite._currentframe != 4) && (attack == false)) {
if ((air == false) && (wallClinging == false)) {
if (((Key.isDown(68) == false) && (Key.isDown(65) == false)) && (dodging == false)) {
man.sprite.gotoAndStop(1);
} else if (((Key.isDown(68) == true) && (dodging == false)) or ((Key.isDown(65) == true) && (dodging == false))) {
if (Key.isDown(68) && (dodging == false)) {
man.sprite._xscale = manXScale;
} else if (Key.isDown(65) && (dodging == false)) {
man.sprite._xscale = -manXScale;
}
man.sprite.gotoAndStop(2);
}
} else if (((air == true) && (dodging == false)) && (wallClinging == false)) {
man.sprite.gotoAndStop(3);
} else if (wallClinging == true) {
man.sprite.gotoAndStop(6);
}
} else if ((man.sprite._currentframe != 4) && (attack == true)) {
if (kicking == true) {
man.sprite.gotoAndStop(7);
}
}
}
function manageColor() {
if (man.sprite._xscale == (-manXScale)) {
man.sprite.bwhite.blendMode = "invert";
} else if (man.sprite._xscale == manXScale) {
man.sprite.bwhite.blendMode = "alpha";
}
}
function manJump(jumpHeight) {
if ((((((Key.isDown(87) && (noJumpMode == false)) && (!Key.isDown(70))) && (jumpKeySwitch == false)) && (doubleJump < 2)) && (noJump == false)) && (ySpeed > -1)) {
gray_so.data.totalJumps++;
jumpKeySwitch = true;
jumping = true;
doubleJump++;
air = true;
yUp = 0;
wallClinging = false;
gravity = 2;
man.sprite.inSprite.play();
man.sprite.bwhite.play();
man.sprite.outline.play();
if (ySpeed > -5) {
ySpeed = jumpHeight;
}
if ((doubleJump >= 2) && (ySpeed < -5)) {
ySpeed = jumpHeight;
}
} else if (Key.isDown(87) == false) {
jumpKeySwitch = false;
}
if ((jumping == true) && (ySpeed > 0)) {
jumping = false;
}
}
function onGround() {
if (((platforms.plats.hitTest(man._x + _x, ((man._y + 38) - yUp) + _y, true) or terrain1.hitTest(man._x + _x, ((man._y + 38) - yUp) + _y, true)) or terrain2.hitTest(man._x + _x, ((man._y + 38) - yUp) + _y, true)) or (wallClinging == true)) {
gravity = 2;
air = false;
doubleJump = 1;
} else {
air = true;
man._rotation = 0;
if (ySpeed < 15) {
ySpeed = ySpeed + gravity;
}
}
}
function manCollision() {
yUp = 0;
while ((platforms.plats.hitTest(man._x + _x, (((man._y + 35) + yUp) + _y) - 4, true) or terrain1.hitTest(man._x + _x, (((man._y + 35) + yUp) + _y) - 4, true)) or terrain2.hitTest(man._x + _x, (((man._y + 35) + yUp) + _y) - 4, true)) {
yUp--;
if (((Key.isDown(65) && (air == false)) && (jumping == false)) or ((Key.isDown(68) && (air == false)) && (jumping == false))) {
if ((yUp < ySpeed) && (man.sprite._xscale == (-manXScale))) {
man._rotation = ((-(yUp - ySpeed)) * 3) - (ySpeed * 6.15);
} else if ((yUp > ySpeed) && (man.sprite._xscale == manXScale)) {
man._rotation = ((yUp - ySpeed) * 3) + (ySpeed * 6.15);
} else if ((yUp > ySpeed) && (man.sprite._xscale == (-manXScale))) {
man._rotation = ((-(yUp - ySpeed)) * 3) - (ySpeed * 6.15);
} else if ((yUp < ySpeed) && (man.sprite._xscale == manXScale)) {
man._rotation = ((yUp - ySpeed) * 3) + (ySpeed * 6.15);
}
}
}
if ((platforms.plats.hitTest(man._x + _x, ((man._y - 35) + yUp) + _y, true) or terrain1.hitTest(man._x + _x, ((man._y - 35) + yUp) + _y, true)) or terrain2.hitTest(man._x + _x, ((man._y - 35) + yUp) + _y, true)) {
yUp = -ySpeed;
}
while ((((xSpeed != 0) && (platforms.plats.hitTest((man._x + xSpeed) + _x, ((man._y - 35) + yUp) + _y, true))) or ((xSpeed != 0) && (terrain1.hitTest((man._x + xSpeed) + _x, ((man._y - 35) + yUp) + _y, true)))) or ((xSpeed != 0) && (terrain2.hitTest((man._x + xSpeed) + _x, ((man._y - 35) + yUp) + _y, true)))) {
man._x = man._x - xSpeed;
}
if (((yUp == 0) && (ySpeed == 0)) && (air == false)) {
yUp = -16;
ySpeed = 16;
}
if ((yUp < -50) && (ySpeed > 0)) {
xSpeed = 0;
yUp = -ySpeed;
} else if ((yUp < -50) && (ySpeed < 0)) {
yUp = -15;
}
noJump = false;
man._y = man._y + yUp;
collideVar = yUp - ySpeed;
while ((((((platforms.plats.hitTest((man._x + xSpeed) + _x, man._y + _y, true) && (xSpeed != 0)) or (platforms.plats.hitTest((man._x + xSpeed) + _x, man._y + _y, true) && (xSpeed != 0))) or (terrain1.hitTest((man._x + xSpeed) + _x, man._y + _y, true) && (xSpeed != 0))) or (terrain1.hitTest((man._x + xSpeed) + _x, man._y + _y, true) && (xSpeed != 0))) or (terrain2.hitTest((man._x + xSpeed) + _x, man._y + _y, true) && (xSpeed != 0))) or (terrain2.hitTest((man._x + xSpeed) + _x, man._y + _y, true) && (xSpeed != 0))) {
man._x = man._x - xSpeed;
}
while ((xSpeed == 0) && (platforms.plats.hitTest((man._x - 20) + _x, man._y + _y, true))) {
man._x = man._x + 21;
}
while ((xSpeed == 0) && (platforms.plats.hitTest((man._x + 20) + _x, man._y + _y, true))) {
man._x = man._x - 21;
}
}
function moveScreen() {
if (man._x > (Stage.width - 250)) {
platforms._x = platforms._x - runSpeed;
terrain1._x = terrain1._x - runSpeed;
terrain2._x = terrain2._x - runSpeed;
man._x = man._x - runSpeed;
theBackground._x = theBackground._x - (runSpeed / 8);
}
if (man._x < 250) {
platforms._x = platforms._x + runSpeed;
terrain1._x = terrain1._x + runSpeed;
terrain2._x = terrain2._x + runSpeed;
man._x = man._x + runSpeed;
theBackground._x = theBackground._x + (runSpeed / 8);
}
if (((man._y + ySpeed) + yUp) > (Stage.height - 150)) {
platforms._y = platforms._y - (ySpeed + yUp);
terrain1._y = terrain1._y - (ySpeed + yUp);
terrain2._y = terrain2._y - (ySpeed + yUp);
man._y = man._y - (ySpeed + yUp);
theBackground._y = theBackground._y - ((ySpeed + yUp) / 8);
}
if (((man._y + ySpeed) + yUp) < 150) {
platforms._y = platforms._y - (ySpeed + yUp);
terrain1._y = terrain1._y - (ySpeed + yUp);
terrain2._y = terrain2._y - (ySpeed + yUp);
man._y = man._y - (ySpeed + yUp);
theBackground._y = theBackground._y - ((ySpeed + yUp) / 8);
}
if (((man._y + ySpeed) + yUp) < 125) {
platforms._y = platforms._y - ((ySpeed + yUp) - 26);
terrain1._y = terrain1._y - ((ySpeed + yUp) - 26);
terrain2._y = terrain2._y - ((ySpeed + yUp) - 26);
man._y = man._y - ((ySpeed + yUp) - 26);
theBackground._y = theBackground._y - (((ySpeed + yUp) - 26) / 8);
}
if (((man._y + ySpeed) + yUp) > (Stage.height - 125)) {
platforms._y = platforms._y - ((ySpeed + yUp) + 26);
terrain1._y = terrain1._y - ((ySpeed + yUp) + 26);
terrain2._y = terrain2._y - ((ySpeed + yUp) + 26);
man._y = man._y - ((ySpeed + yUp) + 26);
theBackground._y = theBackground._y - (((ySpeed + yUp) + 26) / 8);
}
if ((((man._y + ySpeed) + yUp) < 139) && (Key.isDown(70))) {
platforms._y = platforms._y - ((ySpeed + yUp) - 15);
terrain1._y = terrain1._y - ((ySpeed + yUp) - 15);
terrain2._y = terrain2._y - ((ySpeed + yUp) - 15);
man._y = man._y - ((ySpeed + yUp) - 15);
theBackground._y = theBackground._y - (((ySpeed + yUp) - 15) / 8);
}
if ((((man._y + ySpeed) + yUp) > (Stage.height - 139)) && (Key.isDown(70))) {
platforms._y = platforms._y - ((ySpeed + yUp) + 15);
terrain1._y = terrain1._y - ((ySpeed + yUp) + 15);
terrain2._y = terrain2._y - ((ySpeed + yUp) + 15);
man._y = man._y - ((ySpeed + yUp) + 15);
theBackground._y = theBackground._y - (((ySpeed + yUp) + 15) / 8);
}
}
function lookAround() {
if (((Key.isDown(70) && (air == false)) && (!Key.isDown(65))) && (!Key.isDown(68))) {
imdrawing = false;
if (_xmouse > (Stage.width - 250)) {
platforms._x = platforms._x - runSpeed;
terrain1._x = terrain1._x - runSpeed;
terrain2._x = terrain2._x - runSpeed;
man._x = man._x - runSpeed;
theBackground._x = theBackground._x - (runSpeed / 8);
}
if (_xmouse < 250) {
platforms._x = platforms._x + runSpeed;
terrain1._x = terrain1._x + runSpeed;
terrain2._x = terrain2._x + runSpeed;
man._x = man._x + runSpeed;
theBackground._x = theBackground._x + (runSpeed / 8);
}
if (_ymouse < 139) {
platforms._y = platforms._y - ((ySpeed + yUp) - 15);
terrain1._y = terrain1._y - ((ySpeed + yUp) - 15);
terrain2._y = terrain2._y - ((ySpeed + yUp) - 15);
man._y = man._y - ((ySpeed + yUp) - 15);
theBackground._y = theBackground._y - (((ySpeed + yUp) - 15) / 8);
}
if (_ymouse > (Stage.height - 139)) {
platforms._y = platforms._y - ((ySpeed + yUp) + 15);
terrain1._y = terrain1._y - ((ySpeed + yUp) + 15);
terrain2._y = terrain2._y - ((ySpeed + yUp) + 15);
man._y = man._y - ((ySpeed + yUp) + 15);
theBackground._y = theBackground._y - (((ySpeed + yUp) + 15) / 8);
}
}
}
function customCursor() {
cursor.gotoAndStop(terrainVar);
linecolor.gotoAndStop(terrainVar);
cursor._x = _xmouse;
cursor._y = _ymouse;
cursor._rotation = cursor._rotation + 3;
}
function wallCling() {
if ((platforms.plats.hitTest(((man._x + xSpeed) + 16) + _x, (man._y - 60) + _y, true) && (air == true)) && (Key.isDown(39))) {
man.sprite._xscale = -manXScale;
wallClinging = true;
air = false;
ySpeed = 0;
doubleJump = 0;
} else if ((platforms.plats.hitTest(((man._x + xSpeed) - 16) + _x, man._y + _y, true) && (air == true)) && (Key.isDown(37))) {
man.sprite._xscale = manXScale;
wallClinging = true;
air = false;
ySpeed = 0;
doubleJump = 0;
}
if ((air == true) or Key.isDown(40)) {
wallClinging = false;
}
}
function manDodge() {
if (((Key.isDown(40) && (Key.isDown(68))) && (dodgeSwitch == false)) && (wallClinging == false)) {
dodging = "right";
dodgeSwitch = true;
} else if (((Key.isDown(40) && (Key.isDown(65))) && (dodgeSwitch == false)) && (wallClinging == false)) {
dodging = "left";
dodgeSwitch = true;
}
if (dodging == "right") {
man.sprite._xscale = manXScale;
man.sprite.gotoAndStop(5);
xSpeed = 25;
dodgeSwitch == true;
} else if (dodging == "left") {
man.sprite._xscale = -manXScale;
man.sprite.gotoAndStop(5);
xSpeed = -25;
dodgeSwitch == true;
}
if (!Key.isDown(40)) {
dodgeSwitch = false;
}
}
function spikesHit() {
if (((platforms.spikes.hitTest(man._x + _x, man._y + _y, true) or platforms.spikes2.hitTest(man._x + _x, man._y + _y, true)) or platforms.spikes3.hitTest(man._x + _x, man._y + _y, true)) or platforms.spikes4.hitTest(man._x + _x, man._y + _y, true)) {
gray_so.data.totalDeaths++;
currentDeaths++;
dead = true;
}
}
function kick() {
if (Key.isDown(32) && (kickKeySwitch == false)) {
attack = true;
kicking = true;
kickKeySwitch = true;
} else if (!Key.isDown(32)) {
kickKeySwitch = false;
}
}
function suicide() {
if (Key.isDown(13) && (suicideSwitch == false)) {
dead = true;
suicideSwitch = true;
}
if (!Key.isDown(13)) {
suicideSwitch = false;
}
}
function pauseGame() {
if (((Key.isDown(27) && (pauseSwitch == false)) && (gamePaused == false)) && (dead == false)) {
gamePaused = true;
imdrawing = false;
pauseScreen._visible = true;
inverter._visible = true;
pauseSwitch = true;
} else if ((Key.isDown(27) && (pauseSwitch == false)) && (gamePaused == true)) {
gamePaused = false;
pauseScreen._visible = false;
inverter._visible = false;
pauseSwitch = true;
} else if (!Key.isDown(27)) {
pauseSwitch = false;
}
}
function cheats() {
if (mudkipcheat == true) {
man.sprite._visible = false;
man.mudkip._visible = true;
man.mage._visible = false;
if ((man.mudkip._currentframe != 4) && (attack == false)) {
if (air == false) {
if ((Key.isDown(68) == false) && (Key.isDown(65) == false)) {
man.mudkip.gotoAndStop(1);
} else if ((Key.isDown(68) == true) or (Key.isDown(65) == true)) {
if (Key.isDown(68)) {
man.mudkip._xscale = mudkipXScale;
} else if (Key.isDown(65)) {
man.mudkip._xscale = -mudkipXScale;
}
man.mudkip.gotoAndStop(2);
}
} else if (air == true) {
man.mudkip.gotoAndStop(3);
}
if (Key.isDown(32) && (kickKeySwitch == false)) {
if (man.mudkip.inSprite.head._currentframe == 1) {
mudkipMouthOpen = true;
} else if (man.mudkip.inSprite.head._currentframe == 2) {
mudkipMouthOpen = false;
}
}
if (mudkipMouthOpen == true) {
man.mudkip.inSprite.head.gotoAndStop(2);
} else {
man.mudkip.inSprite.head.gotoAndStop(1);
}
}
} else if (magecheat == true) {
man.sprite._visible = false;
man.mudkip._visible = false;
man.mage._visible = true;
if ((man.mage._currentframe != 4) && (attack == false)) {
if (air == false) {
if ((Key.isDown(68) == false) && (Key.isDown(65) == false)) {
man.mage.gotoAndStop(1);
} else if ((Key.isDown(68) == true) or (Key.isDown(65) == true)) {
if (Key.isDown(68)) {
man.mage._xscale = mageXScale;
} else if (Key.isDown(65)) {
man.mage._xscale = -mageXScale;
}
man.mage.gotoAndStop(2);
}
} else if (air == true) {
man.mage.gotoAndStop(3);
}
}
} else if ((mudkipcheat == false) && (magecheat == false)) {
man.sprite._visible = true;
man.mudkip._visible = false;
man.mage._visible = false;
}
}
function achievementsFunc() {
if ((gray_so.data.totalDeaths == 100) && (gray_so.data.deathachievementplayed != true)) {
achpopup.dontfearthereaper._visible = true;
gray_so.data.deathachievementplayed = true;
achpopup.gotoAndPlay("start");
}
if ((gray_so.data.totalLines > 900) && (gray_so.data.over9000achievementplayed != true)) {
achpopup.over9000._visible = true;
gray_so.data.over9000achievementplayed = true;
achpopup.gotoAndPlay("start");
}
}
function timerCounter() {
timerPart++;
if (timerPart == 40) {
timer++;
gray_so.data.totalTimer++;
timerPart = 0;
}
}
stop();
pauseScreen._visible = false;
inverter._visible = false;
Mouse.hide();
platx = platforms._x;
platy = platforms._y;
backx = theBackground._x;
backy = theBackground._y;
manx = man._x;
many = man._y;
dead = false;
gamePaused = false;
dodging = false;
var attack = false;
var kicking = false;
var manstate = 1;
var runSpeed = 15;
var xSpeed = 0;
var ySpeed = 0;
var jumping = false;
var jumpKeySwitch = false;
var mudkipXScale = man.mudkip._xscale;
var mageXScale = man.mage._xscale;
var manXScale = man.sprite._xscale;
var gravity = 2;
var color = new Color("_root.man");
var imdrawing = false;
var terrainVar = 1;
Frame 24
function onMouseDown() {
if ((terrainVar == 1) && (gamePaused == false)) {
createEmptyMovieClip("terrain1", man.getDepth() - 1);
terrain1.lineStyle(40, 3355443, 100);
if (imdrawing == false) {
terrain1.moveTo(_xmouse, _ymouse);
imdrawing = true;
xMouseStart = _xmouse;
yMouseStart = _ymouse;
}
} else if ((terrainVar == 2) && (gamePaused == false)) {
createEmptyMovieClip("terrain2", man.getDepth() - 2);
terrain2.lineStyle(40, 6710886, 100);
if (imdrawing == false) {
terrain2.moveTo(_xmouse, _ymouse);
imdrawing = true;
xMouseStart = _xmouse;
yMouseStart = _ymouse;
}
}
}
function Drawing() {
if (((terrainVar == 1) && (imdrawing == true)) && (!man.nodrawhitbox.hitTest(_xmouse, _ymouse, true))) {
if (((air == false) && (!Key.isDown(65))) && (!Key.isDown(68))) {
terrain1.lineTo(_xmouse, _ymouse);
}
} else if (((terrainVar == 2) && (imdrawing == true)) && (!man.nodrawhitbox.hitTest(_xmouse, _ymouse, true))) {
if (((air == false) && (!Key.isDown(65))) && (!Key.isDown(68))) {
terrain2.lineTo(_xmouse, _ymouse);
}
}
if (imdrawing == false) {
lineDrawed = false;
}
if (imdrawing == true) {
if ((((_xmouse != xMouseStart) && (lineDrawed == false)) && (terrainVar == 1)) or (((_ymouse != yMouseStart) && (lineDrawed == false)) && (terrainVar == 1))) {
line1Drawn = true;
lineDrawed = true;
gray_so.data.totalLines++;
levelLinesPlayer++;
} else if (((_xmouse == xMouseStart) && (_ymouse == yMouseStart)) && (terrainVar == 1)) {
line1Drawn = false;
lineDrawed = false;
}
if ((((_xmouse != xMouseStart) && (lineDrawed == false)) && (terrainVar == 2)) or (((_ymouse != yMouseStart) && (lineDrawed == false)) && (terrainVar == 2))) {
line2Drawn = true;
lineDrawed = true;
gray_so.data.totalLines++;
levelLinesPlayer++;
} else if (((_xmouse == xMouseStart) && (_ymouse == yMouseStart)) && (terrainVar == 2)) {
line2Drawn = false;
lineDrawed = false;
}
if ((((air == true) or Key.isDown(65)) or Key.isDown(68)) or (gamePaused == true)) {
imdrawing = false;
}
if (man.nodrawhitbox.hitTest(_xmouse, _ymouse, true)) {
imdrawing = false;
}
if ((((_xmouse > 750) or (_xmouse < 0)) or (_ymouse > 500)) or (_ymouse < 0)) {
imdrawing = false;
}
}
if (Key.isDown(69) && (terrainKeySwitch == false)) {
terrainVar = terrainVar + 1;
terrainKeySwitch = true;
} else if (!Key.isDown(69)) {
terrainKeySwitch = false;
}
if (terrainVar > 2) {
terrainVar = 1;
}
}
function switches() {
if ((platforms.switch1.hitTest(man._x + _x, man._y + _y, true) or ((platforms.switch1.hitTest(terrain1) == true) && (line1Drawn == true))) or ((platforms.switch1.hitTest(terrain2) == true) && (line2Drawn == true))) {
switchdoor1open = true;
} else if (!platforms.switch1.hitTest(man._x + _x, man._y + _y, true)) {
switchdoor1open = false;
}
if (switchdoor1open == true) {
platforms.switch1.gotoAndStop(2);
if (platforms.plats.switchdoor1._rotation > 0) {
platforms.plats.switchdoor1._rotation = platforms.plats.switchdoor1._rotation - 3;
}
} else if (switchdoor1open == false) {
platforms.switch1.gotoAndStop(1);
if (platforms.plats.switchdoor1._rotation < 90) {
platforms.plats.switchdoor1._rotation = platforms.plats.switchdoor1._rotation + 3;
}
}
if ((platforms.switch2.hitTest(man._x + _x, man._y + _y, true) or ((platforms.switch2.hitTest(terrain1) == true) && (line1Drawn == true))) or ((platforms.switch2.hitTest(terrain2) == true) && (line2Drawn == true))) {
switchdoor2open = true;
} else if (!platforms.switch2.hitTest(man._x + _x, man._y + _y, true)) {
switchdoor2open = false;
}
if (switchdoor2open == true) {
platforms.switch2.gotoAndStop(2);
if (platforms.plats.switchdoor2._rotation < 90) {
platforms.plats.switchdoor2._rotation = platforms.plats.switchdoor2._rotation + 3;
}
} else if (switchdoor2open == false) {
platforms.switch2.gotoAndStop(1);
if (platforms.plats.switchdoor2._rotation > 0) {
platforms.plats.switchdoor2._rotation = platforms.plats.switchdoor2._rotation - 3;
}
}
if ((platforms.switch3.hitTest(man._x + _x, man._y + _y, true) or ((platforms.switch3.hitTest(terrain1) == true) && (line1Drawn == true))) or ((platforms.switch3.hitTest(terrain2) == true) && (line2Drawn == true))) {
switchdoor3open = true;
} else if (!platforms.switch3.hitTest(man._x + _x, man._y + _y, true)) {
switchdoor3open = false;
}
if (switchdoor3open == true) {
platforms.switch3.gotoAndStop(2);
if (platforms.plats.switchdoor3._rotation < 90) {
platforms.plats.switchdoor3._rotation = platforms.plats.switchdoor3._rotation + 3;
}
} else if (switchdoor3open == false) {
platforms.switch3.gotoAndStop(1);
if (platforms.plats.switchdoor3._rotation > 0) {
platforms.plats.switchdoor3._rotation = platforms.plats.switchdoor3._rotation - 3;
}
}
}
function doorHit() {
if (platforms.door.hitTest(man._x + _x, man._y + _y, true)) {
gamePaused = true;
if (fader._alpha < 100) {
fader._alpha = fader._alpha + 5;
} else if (((fader._alpha >= 100) && (noJumpMode == false)) && (leastLinesMode == false)) {
man.sprite._xscale = manXScale;
man.mudkip._xscale = mudkipXScale;
man.mage._xscale = mageXScale;
createEmptyMovieClip("terrain1", man.getDepth() - 1);
createEmptyMovieClip("terrain2", man.getDepth() - 2);
man._x = 375;
man._y = 250;
if (gray_so.data.lvlsavailable == 9) {
gray_so.data.lvlsavailable++;
}
gotoAndStop ("lvl10");
} else if (((fader._alpha >= 100) && (noJumpMode == true)) && (leastLinesMode == false)) {
gray_so.data.lvl9noJump = true;
gotoAndStop ("noJumps");
} else if (((fader._alpha >= 100) && (leastLinesMode == true)) && (noJumpMode == false)) {
if (levelLinesPlayer < gray_so.data.lvl9leastLinesPlayer) {
gray_so.data.lvl9leastLinesPlayer = levelLinesPlayer;
}
gotoAndStop ("leastLines");
}
}
}
function onMouseUp() {
imdrawing = false;
}
function onEnterFrame() {
displayText();
wallClinging = false;
xVar = man._x;
yVar = man._y;
testVar = ySpeed + yUp;
music();
cheats();
achievementsFunc();
pauseGame();
customCursor();
doorHit();
if (gamePaused == false) {
Drawing();
timerCounter();
man._x = man._x + xSpeed;
man._y = man._y + ySpeed;
manCollision();
moveScreen();
lookAround();
if (dead == false) {
if (fader._alpha > 0) {
fader._alpha = fader._alpha - 2;
}
kick();
manJump(-20);
managemanSprite();
onGround();
manageColor();
suicide();
spikesHit();
switches();
if ((Key.isDown(68) && (dodging == false)) && (wallClinging == false)) {
xSpeed = runSpeed;
} else if ((Key.isDown(65) && (dodging == false)) && (wallClinging == false)) {
xSpeed = -runSpeed;
} else if (((!Key.isDown(65)) && (!Key.isDown(68))) && (dodging == false)) {
xSpeed = 0;
}
} else {
man.sprite.gotoAndStop(4);
man.mudkip.gotoAndStop(4);
man.mage.gotoAndStop(4);
xSpeed = 0;
}
if (((man._x + xSpeed) > Stage.width) or ((man._x + xSpeed) < 0)) {
xSpeed = xSpeed - xSpeed;
} else if (dead == true) {
levelLinesPlayer = 0;
if (fader._alpha < 100) {
fader._alpha = fader._alpha + 5;
}
if (fader._alpha >= 100) {
dead = false;
deathsThisTime++;
man.sprite.gotoAndStop(1);
man.mudkip.gotoAndStop(1);
man.mage.gotoAndStop(1);
platforms._x = platx;
platforms._y = platy;
theBackground._x = backx;
theBackground._y = backy;
man._x = manx;
man._y = many;
createEmptyMovieClip("terrain1", man.getDepth() - 1);
createEmptyMovieClip("terrain2", man.getDepth() - 2);
}
}
}
}
function managemanSprite() {
if ((man.sprite._currentframe != 4) && (attack == false)) {
if ((air == false) && (wallClinging == false)) {
if (((Key.isDown(68) == false) && (Key.isDown(65) == false)) && (dodging == false)) {
man.sprite.gotoAndStop(1);
} else if (((Key.isDown(68) == true) && (dodging == false)) or ((Key.isDown(65) == true) && (dodging == false))) {
if (Key.isDown(68) && (dodging == false)) {
man.sprite._xscale = manXScale;
} else if (Key.isDown(65) && (dodging == false)) {
man.sprite._xscale = -manXScale;
}
man.sprite.gotoAndStop(2);
}
} else if (((air == true) && (dodging == false)) && (wallClinging == false)) {
man.sprite.gotoAndStop(3);
} else if (wallClinging == true) {
man.sprite.gotoAndStop(6);
}
} else if ((man.sprite._currentframe != 4) && (attack == true)) {
if (kicking == true) {
man.sprite.gotoAndStop(7);
}
}
}
function manageColor() {
if (man.sprite._xscale == (-manXScale)) {
man.sprite.bwhite.blendMode = "invert";
} else if (man.sprite._xscale == manXScale) {
man.sprite.bwhite.blendMode = "alpha";
}
}
function manJump(jumpHeight) {
if ((((((Key.isDown(87) && (noJumpMode == false)) && (!Key.isDown(70))) && (jumpKeySwitch == false)) && (doubleJump < 2)) && (noJump == false)) && (ySpeed > -1)) {
gray_so.data.totalJumps++;
jumpKeySwitch = true;
jumping = true;
doubleJump++;
air = true;
yUp = 0;
wallClinging = false;
gravity = 2;
man.sprite.inSprite.play();
man.sprite.bwhite.play();
man.sprite.outline.play();
if (ySpeed > -5) {
ySpeed = jumpHeight;
}
if ((doubleJump >= 2) && (ySpeed < -5)) {
ySpeed = jumpHeight;
}
} else if (Key.isDown(87) == false) {
jumpKeySwitch = false;
}
if ((jumping == true) && (ySpeed > 0)) {
jumping = false;
}
}
function onGround() {
if (((platforms.plats.hitTest(man._x + _x, ((man._y + 38) - yUp) + _y, true) or terrain1.hitTest(man._x + _x, ((man._y + 38) - yUp) + _y, true)) or terrain2.hitTest(man._x + _x, ((man._y + 38) - yUp) + _y, true)) or (wallClinging == true)) {
gravity = 2;
air = false;
doubleJump = 1;
} else {
air = true;
man._rotation = 0;
if (ySpeed < 15) {
ySpeed = ySpeed + gravity;
}
}
}
function manCollision() {
yUp = 0;
while ((platforms.plats.hitTest(man._x + _x, (((man._y + 35) + yUp) + _y) - 4, true) or terrain1.hitTest(man._x + _x, (((man._y + 35) + yUp) + _y) - 4, true)) or terrain2.hitTest(man._x + _x, (((man._y + 35) + yUp) + _y) - 4, true)) {
yUp--;
if (((Key.isDown(65) && (air == false)) && (jumping == false)) or ((Key.isDown(68) && (air == false)) && (jumping == false))) {
if ((yUp < ySpeed) && (man.sprite._xscale == (-manXScale))) {
man._rotation = ((-(yUp - ySpeed)) * 3) - (ySpeed * 6.15);
} else if ((yUp > ySpeed) && (man.sprite._xscale == manXScale)) {
man._rotation = ((yUp - ySpeed) * 3) + (ySpeed * 6.15);
} else if ((yUp > ySpeed) && (man.sprite._xscale == (-manXScale))) {
man._rotation = ((-(yUp - ySpeed)) * 3) - (ySpeed * 6.15);
} else if ((yUp < ySpeed) && (man.sprite._xscale == manXScale)) {
man._rotation = ((yUp - ySpeed) * 3) + (ySpeed * 6.15);
}
}
}
if ((platforms.plats.hitTest(man._x + _x, ((man._y - 35) + yUp) + _y, true) or terrain1.hitTest(man._x + _x, ((man._y - 35) + yUp) + _y, true)) or terrain2.hitTest(man._x + _x, ((man._y - 35) + yUp) + _y, true)) {
yUp = -ySpeed;
}
while ((((xSpeed != 0) && (platforms.plats.hitTest((man._x + xSpeed) + _x, ((man._y - 35) + yUp) + _y, true))) or ((xSpeed != 0) && (terrain1.hitTest((man._x + xSpeed) + _x, ((man._y - 35) + yUp) + _y, true)))) or ((xSpeed != 0) && (terrain2.hitTest((man._x + xSpeed) + _x, ((man._y - 35) + yUp) + _y, true)))) {
man._x = man._x - xSpeed;
}
if (((yUp == 0) && (ySpeed == 0)) && (air == false)) {
yUp = -16;
ySpeed = 16;
}
if ((yUp < -50) && (ySpeed > 0)) {
xSpeed = 0;
yUp = -ySpeed;
} else if ((yUp < -50) && (ySpeed < 0)) {
yUp = -15;
}
noJump = false;
man._y = man._y + yUp;
collideVar = yUp - ySpeed;
while ((((((platforms.plats.hitTest((man._x + xSpeed) + _x, man._y + _y, true) && (xSpeed != 0)) or (platforms.plats.hitTest((man._x + xSpeed) + _x, man._y + _y, true) && (xSpeed != 0))) or (terrain1.hitTest((man._x + xSpeed) + _x, man._y + _y, true) && (xSpeed != 0))) or (terrain1.hitTest((man._x + xSpeed) + _x, man._y + _y, true) && (xSpeed != 0))) or (terrain2.hitTest((man._x + xSpeed) + _x, man._y + _y, true) && (xSpeed != 0))) or (terrain2.hitTest((man._x + xSpeed) + _x, man._y + _y, true) && (xSpeed != 0))) {
man._x = man._x - xSpeed;
}
while ((xSpeed == 0) && (platforms.plats.hitTest((man._x - 20) + _x, man._y + _y, true))) {
man._x = man._x + 21;
}
while ((xSpeed == 0) && (platforms.plats.hitTest((man._x + 20) + _x, man._y + _y, true))) {
man._x = man._x - 21;
}
}
function moveScreen() {
if (man._x > (Stage.width - 250)) {
platforms._x = platforms._x - runSpeed;
terrain1._x = terrain1._x - runSpeed;
terrain2._x = terrain2._x - runSpeed;
man._x = man._x - runSpeed;
theBackground._x = theBackground._x - (runSpeed / 8);
}
if (man._x < 250) {
platforms._x = platforms._x + runSpeed;
terrain1._x = terrain1._x + runSpeed;
terrain2._x = terrain2._x + runSpeed;
man._x = man._x + runSpeed;
theBackground._x = theBackground._x + (runSpeed / 8);
}
if (((man._y + ySpeed) + yUp) > (Stage.height - 150)) {
platforms._y = platforms._y - (ySpeed + yUp);
terrain1._y = terrain1._y - (ySpeed + yUp);
terrain2._y = terrain2._y - (ySpeed + yUp);
man._y = man._y - (ySpeed + yUp);
theBackground._y = theBackground._y - ((ySpeed + yUp) / 8);
}
if (((man._y + ySpeed) + yUp) < 150) {
platforms._y = platforms._y - (ySpeed + yUp);
terrain1._y = terrain1._y - (ySpeed + yUp);
terrain2._y = terrain2._y - (ySpeed + yUp);
man._y = man._y - (ySpeed + yUp);
theBackground._y = theBackground._y - ((ySpeed + yUp) / 8);
}
if (((man._y + ySpeed) + yUp) < 125) {
platforms._y = platforms._y - ((ySpeed + yUp) - 26);
terrain1._y = terrain1._y - ((ySpeed + yUp) - 26);
terrain2._y = terrain2._y - ((ySpeed + yUp) - 26);
man._y = man._y - ((ySpeed + yUp) - 26);
theBackground._y = theBackground._y - (((ySpeed + yUp) - 26) / 8);
}
if (((man._y + ySpeed) + yUp) > (Stage.height - 125)) {
platforms._y = platforms._y - ((ySpeed + yUp) + 26);
terrain1._y = terrain1._y - ((ySpeed + yUp) + 26);
terrain2._y = terrain2._y - ((ySpeed + yUp) + 26);
man._y = man._y - ((ySpeed + yUp) + 26);
theBackground._y = theBackground._y - (((ySpeed + yUp) + 26) / 8);
}
if ((((man._y + ySpeed) + yUp) < 139) && (Key.isDown(70))) {
platforms._y = platforms._y - ((ySpeed + yUp) - 15);
terrain1._y = terrain1._y - ((ySpeed + yUp) - 15);
terrain2._y = terrain2._y - ((ySpeed + yUp) - 15);
man._y = man._y - ((ySpeed + yUp) - 15);
theBackground._y = theBackground._y - (((ySpeed + yUp) - 15) / 8);
}
if ((((man._y + ySpeed) + yUp) > (Stage.height - 139)) && (Key.isDown(70))) {
platforms._y = platforms._y - ((ySpeed + yUp) + 15);
terrain1._y = terrain1._y - ((ySpeed + yUp) + 15);
terrain2._y = terrain2._y - ((ySpeed + yUp) + 15);
man._y = man._y - ((ySpeed + yUp) + 15);
theBackground._y = theBackground._y - (((ySpeed + yUp) + 15) / 8);
}
}
function lookAround() {
if (((Key.isDown(70) && (air == false)) && (!Key.isDown(65))) && (!Key.isDown(68))) {
imdrawing = false;
if (_xmouse > (Stage.width - 250)) {
platforms._x = platforms._x - runSpeed;
terrain1._x = terrain1._x - runSpeed;
terrain2._x = terrain2._x - runSpeed;
man._x = man._x - runSpeed;
theBackground._x = theBackground._x - (runSpeed / 8);
}
if (_xmouse < 250) {
platforms._x = platforms._x + runSpeed;
terrain1._x = terrain1._x + runSpeed;
terrain2._x = terrain2._x + runSpeed;
man._x = man._x + runSpeed;
theBackground._x = theBackground._x + (runSpeed / 8);
}
if (_ymouse < 139) {
platforms._y = platforms._y - ((ySpeed + yUp) - 15);
terrain1._y = terrain1._y - ((ySpeed + yUp) - 15);
terrain2._y = terrain2._y - ((ySpeed + yUp) - 15);
man._y = man._y - ((ySpeed + yUp) - 15);
theBackground._y = theBackground._y - (((ySpeed + yUp) - 15) / 8);
}
if (_ymouse > (Stage.height - 139)) {
platforms._y = platforms._y - ((ySpeed + yUp) + 15);
terrain1._y = terrain1._y - ((ySpeed + yUp) + 15);
terrain2._y = terrain2._y - ((ySpeed + yUp) + 15);
man._y = man._y - ((ySpeed + yUp) + 15);
theBackground._y = theBackground._y - (((ySpeed + yUp) + 15) / 8);
}
}
}
function customCursor() {
cursor.gotoAndStop(terrainVar);
linecolor.gotoAndStop(terrainVar);
cursor._x = _xmouse;
cursor._y = _ymouse;
cursor._rotation = cursor._rotation + 3;
}
function wallCling() {
if ((platforms.plats.hitTest(((man._x + xSpeed) + 16) + _x, (man._y - 60) + _y, true) && (air == true)) && (Key.isDown(39))) {
man.sprite._xscale = -manXScale;
wallClinging = true;
air = false;
ySpeed = 0;
doubleJump = 0;
} else if ((platforms.plats.hitTest(((man._x + xSpeed) - 16) + _x, man._y + _y, true) && (air == true)) && (Key.isDown(37))) {
man.sprite._xscale = manXScale;
wallClinging = true;
air = false;
ySpeed = 0;
doubleJump = 0;
}
if ((air == true) or Key.isDown(40)) {
wallClinging = false;
}
}
function manDodge() {
if (((Key.isDown(40) && (Key.isDown(68))) && (dodgeSwitch == false)) && (wallClinging == false)) {
dodging = "right";
dodgeSwitch = true;
} else if (((Key.isDown(40) && (Key.isDown(65))) && (dodgeSwitch == false)) && (wallClinging == false)) {
dodging = "left";
dodgeSwitch = true;
}
if (dodging == "right") {
man.sprite._xscale = manXScale;
man.sprite.gotoAndStop(5);
xSpeed = 25;
dodgeSwitch == true;
} else if (dodging == "left") {
man.sprite._xscale = -manXScale;
man.sprite.gotoAndStop(5);
xSpeed = -25;
dodgeSwitch == true;
}
if (!Key.isDown(40)) {
dodgeSwitch = false;
}
}
function spikesHit() {
if (((platforms.spikes.hitTest(man._x + _x, man._y + _y, true) or platforms.spikes2.hitTest(man._x + _x, man._y + _y, true)) or platforms.spikes3.hitTest(man._x + _x, man._y + _y, true)) or platforms.spikes4.hitTest(man._x + _x, man._y + _y, true)) {
gray_so.data.totalDeaths++;
currentDeaths++;
dead = true;
}
}
function kick() {
if (Key.isDown(32) && (kickKeySwitch == false)) {
attack = true;
kicking = true;
kickKeySwitch = true;
} else if (!Key.isDown(32)) {
kickKeySwitch = false;
}
}
function suicide() {
if (Key.isDown(13) && (suicideSwitch == false)) {
dead = true;
suicideSwitch = true;
}
if (!Key.isDown(13)) {
suicideSwitch = false;
}
}
function pauseGame() {
if (((Key.isDown(27) && (pauseSwitch == false)) && (gamePaused == false)) && (dead == false)) {
gamePaused = true;
imdrawing = false;
pauseScreen._visible = true;
inverter._visible = true;
pauseSwitch = true;
} else if ((Key.isDown(27) && (pauseSwitch == false)) && (gamePaused == true)) {
gamePaused = false;
pauseScreen._visible = false;
inverter._visible = false;
pauseSwitch = true;
} else if (!Key.isDown(27)) {
pauseSwitch = false;
}
}
function cheats() {
if (mudkipcheat == true) {
man.sprite._visible = false;
man.mudkip._visible = true;
man.mage._visible = false;
if ((man.mudkip._currentframe != 4) && (attack == false)) {
if (air == false) {
if ((Key.isDown(68) == false) && (Key.isDown(65) == false)) {
man.mudkip.gotoAndStop(1);
} else if ((Key.isDown(68) == true) or (Key.isDown(65) == true)) {
if (Key.isDown(68)) {
man.mudkip._xscale = mudkipXScale;
} else if (Key.isDown(65)) {
man.mudkip._xscale = -mudkipXScale;
}
man.mudkip.gotoAndStop(2);
}
} else if (air == true) {
man.mudkip.gotoAndStop(3);
}
if (Key.isDown(32) && (kickKeySwitch == false)) {
if (man.mudkip.inSprite.head._currentframe == 1) {
mudkipMouthOpen = true;
} else if (man.mudkip.inSprite.head._currentframe == 2) {
mudkipMouthOpen = false;
}
}
if (mudkipMouthOpen == true) {
man.mudkip.inSprite.head.gotoAndStop(2);
} else {
man.mudkip.inSprite.head.gotoAndStop(1);
}
}
} else if (magecheat == true) {
man.sprite._visible = false;
man.mudkip._visible = false;
man.mage._visible = true;
if ((man.mage._currentframe != 4) && (attack == false)) {
if (air == false) {
if ((Key.isDown(68) == false) && (Key.isDown(65) == false)) {
man.mage.gotoAndStop(1);
} else if ((Key.isDown(68) == true) or (Key.isDown(65) == true)) {
if (Key.isDown(68)) {
man.mage._xscale = mageXScale;
} else if (Key.isDown(65)) {
man.mage._xscale = -mageXScale;
}
man.mage.gotoAndStop(2);
}
} else if (air == true) {
man.mage.gotoAndStop(3);
}
}
} else if ((mudkipcheat == false) && (magecheat == false)) {
man.sprite._visible = true;
man.mudkip._visible = false;
man.mage._visible = false;
}
}
function achievementsFunc() {
if ((gray_so.data.totalDeaths == 100) && (gray_so.data.deathachievementplayed != true)) {
achpopup.dontfearthereaper._visible = true;
gray_so.data.deathachievementplayed = true;
achpopup.gotoAndPlay("start");
}
if ((gray_so.data.totalLines > 900) && (gray_so.data.over9000achievementplayed != true)) {
achpopup.over9000._visible = true;
gray_so.data.over9000achievementplayed = true;
achpopup.gotoAndPlay("start");
}
}
function timerCounter() {
timerPart++;
if (timerPart == 40) {
timer++;
gray_so.data.totalTimer++;
timerPart = 0;
}
}
stop();
pauseScreen._visible = false;
inverter._visible = false;
Mouse.hide();
platx = platforms._x;
platy = platforms._y;
backx = theBackground._x;
backy = theBackground._y;
manx = man._x;
many = man._y;
dead = false;
gamePaused = false;
dodging = false;
var attack = false;
var kicking = false;
var manstate = 1;
var runSpeed = 15;
var xSpeed = 0;
var ySpeed = 0;
var jumping = false;
var jumpKeySwitch = false;
var mudkipXScale = man.mudkip._xscale;
var mageXScale = man.mage._xscale;
var manXScale = man.sprite._xscale;
var gravity = 2;
var color = new Color("_root.man");
var imdrawing = false;
var terrainVar = 1;
Frame 25
function onMouseDown() {
if ((terrainVar == 1) && (gamePaused == false)) {
createEmptyMovieClip("terrain1", man.getDepth() - 1);
terrain1.lineStyle(40, 3355443, 100);
if (imdrawing == false) {
terrain1.moveTo(_xmouse, _ymouse);
imdrawing = true;
xMouseStart = _xmouse;
yMouseStart = _ymouse;
}
} else if ((terrainVar == 2) && (gamePaused == false)) {
createEmptyMovieClip("terrain2", man.getDepth() - 2);
terrain2.lineStyle(40, 6710886, 100);
if (imdrawing == false) {
terrain2.moveTo(_xmouse, _ymouse);
imdrawing = true;
xMouseStart = _xmouse;
yMouseStart = _ymouse;
}
}
}
function Drawing() {
if (((terrainVar == 1) && (imdrawing == true)) && (!man.nodrawhitbox.hitTest(_xmouse, _ymouse, true))) {
if (((air == false) && (!Key.isDown(65))) && (!Key.isDown(68))) {
terrain1.lineTo(_xmouse, _ymouse);
}
} else if (((terrainVar == 2) && (imdrawing == true)) && (!man.nodrawhitbox.hitTest(_xmouse, _ymouse, true))) {
if (((air == false) && (!Key.isDown(65))) && (!Key.isDown(68))) {
terrain2.lineTo(_xmouse, _ymouse);
}
}
if (imdrawing == false) {
lineDrawed = false;
}
if (imdrawing == true) {
if ((((_xmouse != xMouseStart) && (lineDrawed == false)) && (terrainVar == 1)) or (((_ymouse != yMouseStart) && (lineDrawed == false)) && (terrainVar == 1))) {
line1Drawn = true;
lineDrawed = true;
gray_so.data.totalLines++;
levelLinesPlayer++;
} else if (((_xmouse == xMouseStart) && (_ymouse == yMouseStart)) && (terrainVar == 1)) {
line1Drawn = false;
lineDrawed = false;
}
if ((((_xmouse != xMouseStart) && (lineDrawed == false)) && (terrainVar == 2)) or (((_ymouse != yMouseStart) && (lineDrawed == false)) && (terrainVar == 2))) {
line2Drawn = true;
lineDrawed = true;
gray_so.data.totalLines++;
levelLinesPlayer++;
} else if (((_xmouse == xMouseStart) && (_ymouse == yMouseStart)) && (terrainVar == 2)) {
line2Drawn = false;
lineDrawed = false;
}
if ((((air == true) or Key.isDown(65)) or Key.isDown(68)) or (gamePaused == true)) {
imdrawing = false;
}
if (man.nodrawhitbox.hitTest(_xmouse, _ymouse, true)) {
imdrawing = false;
}
if ((((_xmouse > 750) or (_xmouse < 0)) or (_ymouse > 500)) or (_ymouse < 0)) {
imdrawing = false;
}
}
if (Key.isDown(69) && (terrainKeySwitch == false)) {
terrainVar = terrainVar + 1;
terrainKeySwitch = true;
} else if (!Key.isDown(69)) {
terrainKeySwitch = false;
}
if (terrainVar > 2) {
terrainVar = 1;
}
}
function switches() {
if ((platforms.switch1.hitTest(man._x + _x, man._y + _y, true) or ((platforms.switch1.hitTest(terrain1) == true) && (line1Drawn == true))) or ((platforms.switch1.hitTest(terrain2) == true) && (line2Drawn == true))) {
switchdoor1open = true;
} else if (!platforms.switch1.hitTest(man._x + _x, man._y + _y, true)) {
switchdoor1open = false;
}
if (switchdoor1open == true) {
platforms.switch1.gotoAndStop(2);
if (platforms.plats.switchdoor1._rotation < 90) {
platforms.plats.switchdoor1._rotation = platforms.plats.switchdoor1._rotation + 3;
}
} else if (switchdoor1open == false) {
platforms.switch1.gotoAndStop(1);
if (platforms.plats.switchdoor1._rotation > 0) {
platforms.plats.switchdoor1._rotation = platforms.plats.switchdoor1._rotation - 3;
}
}
if ((platforms.switch2.hitTest(man._x + _x, man._y + _y, true) or ((platforms.switch2.hitTest(terrain1) == true) && (line1Drawn == true))) or ((platforms.switch2.hitTest(terrain2) == true) && (line2Drawn == true))) {
switchdoor2open = true;
} else if (!platforms.switch2.hitTest(man._x + _x, man._y + _y, true)) {
switchdoor2open = false;
}
if (switchdoor2open == true) {
platforms.switch2.gotoAndStop(2);
if (platforms.plats.switchdoor2._rotation > 0) {
platforms.plats.switchdoor2._rotation = platforms.plats.switchdoor2._rotation - 3;
}
} else if (switchdoor2open == false) {
platforms.switch2.gotoAndStop(1);
if (platforms.plats.switchdoor2._rotation < 90) {
platforms.plats.switchdoor2._rotation = platforms.plats.switchdoor2._rotation + 3;
}
}
if ((platforms.switch3.hitTest(man._x + _x, man._y + _y, true) or ((platforms.switch3.hitTest(terrain1) == true) && (line1Drawn == true))) or ((platforms.switch3.hitTest(terrain2) == true) && (line2Drawn == true))) {
switchdoor3open = true;
} else if (!platforms.switch3.hitTest(man._x + _x, man._y + _y, true)) {
switchdoor3open = false;
}
if (switchdoor3open == true) {
platforms.switch3.gotoAndStop(2);
if (platforms.plats.switchdoor3._rotation < 90) {
platforms.plats.switchdoor3._rotation = platforms.plats.switchdoor3._rotation + 3;
}
} else if (switchdoor3open == false) {
platforms.switch3.gotoAndStop(1);
if (platforms.plats.switchdoor3._rotation > 0) {
platforms.plats.switchdoor3._rotation = platforms.plats.switchdoor3._rotation - 3;
}
}
}
function doorHit() {
if (platforms.door.hitTest(man._x + _x, man._y + _y, true)) {
gamePaused = true;
if (fader._alpha < 100) {
fader._alpha = fader._alpha + 5;
} else if (((fader._alpha >= 100) && (noJumpMode == false)) && (leastLinesMode == false)) {
man.sprite._xscale = manXScale;
man.mudkip._xscale = mudkipXScale;
man.mage._xscale = mageXScale;
createEmptyMovieClip("terrain1", man.getDepth() - 1);
createEmptyMovieClip("terrain2", man.getDepth() - 2);
man._x = 375;
man._y = 250;
if (gray_so.data.lvlsavailable == 10) {
gray_so.data.lvlsavailable++;
}
gotoAndStop ("lvl11");
} else if (((fader._alpha >= 100) && (noJumpMode == true)) && (leastLinesMode == false)) {
gray_so.data.lvl10noJump = true;
gotoAndStop ("noJumps");
} else if (((fader._alpha >= 100) && (leastLinesMode == true)) && (noJumpMode == false)) {
if (levelLinesPlayer < gray_so.data.lvl10leastLinesPlayer) {
gray_so.data.lvl10leastLinesPlayer = levelLinesPlayer;
}
gotoAndStop ("leastLines");
}
}
}
function onMouseUp() {
imdrawing = false;
}
function onEnterFrame() {
displayText();
wallClinging = false;
xVar = man._x;
yVar = man._y;
testVar = ySpeed + yUp;
music();
cheats();
achievementsFunc();
pauseGame();
customCursor();
doorHit();
if (gamePaused == false) {
Drawing();
timerCounter();
man._x = man._x + xSpeed;
man._y = man._y + ySpeed;
manCollision();
moveScreen();
lookAround();
if (dead == false) {
if (fader._alpha > 0) {
fader._alpha = fader._alpha - 2;
}
kick();
manJump(-20);
managemanSprite();
onGround();
manageColor();
suicide();
spikesHit();
switches();
if ((Key.isDown(68) && (dodging == false)) && (wallClinging == false)) {
xSpeed = runSpeed;
} else if ((Key.isDown(65) && (dodging == false)) && (wallClinging == false)) {
xSpeed = -runSpeed;
} else if (((!Key.isDown(65)) && (!Key.isDown(68))) && (dodging == false)) {
xSpeed = 0;
}
} else {
man.sprite.gotoAndStop(4);
man.mudkip.gotoAndStop(4);
man.mage.gotoAndStop(4);
xSpeed = 0;
}
if (((man._x + xSpeed) > Stage.width) or ((man._x + xSpeed) < 0)) {
xSpeed = xSpeed - xSpeed;
} else if (dead == true) {
levelLinesPlayer = 0;
if (fader._alpha < 100) {
fader._alpha = fader._alpha + 5;
}
if (fader._alpha >= 100) {
dead = false;
deathsThisTime++;
man.sprite.gotoAndStop(1);
man.mudkip.gotoAndStop(1);
man.mage.gotoAndStop(1);
platforms._x = platx;
platforms._y = platy;
theBackground._x = backx;
theBackground._y = backy;
man._x = manx;
man._y = many;
createEmptyMovieClip("terrain1", man.getDepth() - 1);
createEmptyMovieClip("terrain2", man.getDepth() - 2);
}
}
}
}
function managemanSprite() {
if ((man.sprite._currentframe != 4) && (attack == false)) {
if ((air == false) && (wallClinging == false)) {
if (((Key.isDown(68) == false) && (Key.isDown(65) == false)) && (dodging == false)) {
man.sprite.gotoAndStop(1);
} else if (((Key.isDown(68) == true) && (dodging == false)) or ((Key.isDown(65) == true) && (dodging == false))) {
if (Key.isDown(68) && (dodging == false)) {
man.sprite._xscale = manXScale;
} else if (Key.isDown(65) && (dodging == false)) {
man.sprite._xscale = -manXScale;
}
man.sprite.gotoAndStop(2);
}
} else if (((air == true) && (dodging == false)) && (wallClinging == false)) {
man.sprite.gotoAndStop(3);
} else if (wallClinging == true) {
man.sprite.gotoAndStop(6);
}
} else if ((man.sprite._currentframe != 4) && (attack == true)) {
if (kicking == true) {
man.sprite.gotoAndStop(7);
}
}
}
function manageColor() {
if (man.sprite._xscale == (-manXScale)) {
man.sprite.bwhite.blendMode = "invert";
} else if (man.sprite._xscale == manXScale) {
man.sprite.bwhite.blendMode = "alpha";
}
}
function manJump(jumpHeight) {
if ((((((Key.isDown(87) && (noJumpMode == false)) && (!Key.isDown(70))) && (jumpKeySwitch == false)) && (doubleJump < 2)) && (noJump == false)) && (ySpeed > -1)) {
gray_so.data.totalJumps++;
jumpKeySwitch = true;
jumping = true;
doubleJump++;
air = true;
yUp = 0;
wallClinging = false;
gravity = 2;
man.sprite.inSprite.play();
man.sprite.bwhite.play();
man.sprite.outline.play();
if (ySpeed > -5) {
ySpeed = jumpHeight;
}
if ((doubleJump >= 2) && (ySpeed < -5)) {
ySpeed = jumpHeight;
}
} else if (Key.isDown(87) == false) {
jumpKeySwitch = false;
}
if ((jumping == true) && (ySpeed > 0)) {
jumping = false;
}
}
function onGround() {
if (((platforms.plats.hitTest(man._x + _x, ((man._y + 38) - yUp) + _y, true) or terrain1.hitTest(man._x + _x, ((man._y + 38) - yUp) + _y, true)) or terrain2.hitTest(man._x + _x, ((man._y + 38) - yUp) + _y, true)) or (wallClinging == true)) {
gravity = 2;
air = false;
doubleJump = 1;
} else {
air = true;
man._rotation = 0;
if (ySpeed < 15) {
ySpeed = ySpeed + gravity;
}
}
}
function manCollision() {
yUp = 0;
while ((platforms.plats.hitTest(man._x + _x, (((man._y + 35) + yUp) + _y) - 4, true) or terrain1.hitTest(man._x + _x, (((man._y + 35) + yUp) + _y) - 4, true)) or terrain2.hitTest(man._x + _x, (((man._y + 35) + yUp) + _y) - 4, true)) {
yUp--;
if (((Key.isDown(65) && (air == false)) && (jumping == false)) or ((Key.isDown(68) && (air == false)) && (jumping == false))) {
if ((yUp < ySpeed) && (man.sprite._xscale == (-manXScale))) {
man._rotation = ((-(yUp - ySpeed)) * 3) - (ySpeed * 6.15);
} else if ((yUp > ySpeed) && (man.sprite._xscale == manXScale)) {
man._rotation = ((yUp - ySpeed) * 3) + (ySpeed * 6.15);
} else if ((yUp > ySpeed) && (man.sprite._xscale == (-manXScale))) {
man._rotation = ((-(yUp - ySpeed)) * 3) - (ySpeed * 6.15);
} else if ((yUp < ySpeed) && (man.sprite._xscale == manXScale)) {
man._rotation = ((yUp - ySpeed) * 3) + (ySpeed * 6.15);
}
}
}
if ((platforms.plats.hitTest(man._x + _x, ((man._y - 35) + yUp) + _y, true) or terrain1.hitTest(man._x + _x, ((man._y - 35) + yUp) + _y, true)) or terrain2.hitTest(man._x + _x, ((man._y - 35) + yUp) + _y, true)) {
yUp = -ySpeed;
}
while ((((xSpeed != 0) && (platforms.plats.hitTest((man._x + xSpeed) + _x, ((man._y - 35) + yUp) + _y, true))) or ((xSpeed != 0) && (terrain1.hitTest((man._x + xSpeed) + _x, ((man._y - 35) + yUp) + _y, true)))) or ((xSpeed != 0) && (terrain2.hitTest((man._x + xSpeed) + _x, ((man._y - 35) + yUp) + _y, true)))) {
man._x = man._x - xSpeed;
}
if (((yUp == 0) && (ySpeed == 0)) && (air == false)) {
yUp = -16;
ySpeed = 16;
}
if ((yUp < -50) && (ySpeed > 0)) {
xSpeed = 0;
yUp = -ySpeed;
} else if ((yUp < -50) && (ySpeed < 0)) {
yUp = -15;
}
noJump = false;
man._y = man._y + yUp;
collideVar = yUp - ySpeed;
while ((((((platforms.plats.hitTest((man._x + xSpeed) + _x, man._y + _y, true) && (xSpeed != 0)) or (platforms.plats.hitTest((man._x + xSpeed) + _x, man._y + _y, true) && (xSpeed != 0))) or (terrain1.hitTest((man._x + xSpeed) + _x, man._y + _y, true) && (xSpeed != 0))) or (terrain1.hitTest((man._x + xSpeed) + _x, man._y + _y, true) && (xSpeed != 0))) or (terrain2.hitTest((man._x + xSpeed) + _x, man._y + _y, true) && (xSpeed != 0))) or (terrain2.hitTest((man._x + xSpeed) + _x, man._y + _y, true) && (xSpeed != 0))) {
man._x = man._x - xSpeed;
}
while ((xSpeed == 0) && (platforms.plats.hitTest((man._x - 20) + _x, man._y + _y, true))) {
man._x = man._x + 21;
}
while ((xSpeed == 0) && (platforms.plats.hitTest((man._x + 20) + _x, man._y + _y, true))) {
man._x = man._x - 21;
}
}
function moveScreen() {
if (man._x > (Stage.width - 250)) {
platforms._x = platforms._x - runSpeed;
terrain1._x = terrain1._x - runSpeed;
terrain2._x = terrain2._x - runSpeed;
man._x = man._x - runSpeed;
theBackground._x = theBackground._x - (runSpeed / 8);
}
if (man._x < 250) {
platforms._x = platforms._x + runSpeed;
terrain1._x = terrain1._x + runSpeed;
terrain2._x = terrain2._x + runSpeed;
man._x = man._x + runSpeed;
theBackground._x = theBackground._x + (runSpeed / 8);
}
if (((man._y + ySpeed) + yUp) > (Stage.height - 150)) {
platforms._y = platforms._y - (ySpeed + yUp);
terrain1._y = terrain1._y - (ySpeed + yUp);
terrain2._y = terrain2._y - (ySpeed + yUp);
man._y = man._y - (ySpeed + yUp);
theBackground._y = theBackground._y - ((ySpeed + yUp) / 8);
}
if (((man._y + ySpeed) + yUp) < 150) {
platforms._y = platforms._y - (ySpeed + yUp);
terrain1._y = terrain1._y - (ySpeed + yUp);
terrain2._y = terrain2._y - (ySpeed + yUp);
man._y = man._y - (ySpeed + yUp);
theBackground._y = theBackground._y - ((ySpeed + yUp) / 8);
}
if (((man._y + ySpeed) + yUp) < 125) {
platforms._y = platforms._y - ((ySpeed + yUp) - 26);
terrain1._y = terrain1._y - ((ySpeed + yUp) - 26);
terrain2._y = terrain2._y - ((ySpeed + yUp) - 26);
man._y = man._y - ((ySpeed + yUp) - 26);
theBackground._y = theBackground._y - (((ySpeed + yUp) - 26) / 8);
}
if (((man._y + ySpeed) + yUp) > (Stage.height - 125)) {
platforms._y = platforms._y - ((ySpeed + yUp) + 26);
terrain1._y = terrain1._y - ((ySpeed + yUp) + 26);
terrain2._y = terrain2._y - ((ySpeed + yUp) + 26);
man._y = man._y - ((ySpeed + yUp) + 26);
theBackground._y = theBackground._y - (((ySpeed + yUp) + 26) / 8);
}
if ((((man._y + ySpeed) + yUp) < 139) && (Key.isDown(70))) {
platforms._y = platforms._y - ((ySpeed + yUp) - 15);
terrain1._y = terrain1._y - ((ySpeed + yUp) - 15);
terrain2._y = terrain2._y - ((ySpeed + yUp) - 15);
man._y = man._y - ((ySpeed + yUp) - 15);
theBackground._y = theBackground._y - (((ySpeed + yUp) - 15) / 8);
}
if ((((man._y + ySpeed) + yUp) > (Stage.height - 139)) && (Key.isDown(70))) {
platforms._y = platforms._y - ((ySpeed + yUp) + 15);
terrain1._y = terrain1._y - ((ySpeed + yUp) + 15);
terrain2._y = terrain2._y - ((ySpeed + yUp) + 15);
man._y = man._y - ((ySpeed + yUp) + 15);
theBackground._y = theBackground._y - (((ySpeed + yUp) + 15) / 8);
}
}
function lookAround() {
if (((Key.isDown(70) && (air == false)) && (!Key.isDown(65))) && (!Key.isDown(68))) {
imdrawing = false;
if (_xmouse > (Stage.width - 250)) {
platforms._x = platforms._x - runSpeed;
terrain1._x = terrain1._x - runSpeed;
terrain2._x = terrain2._x - runSpeed;
man._x = man._x - runSpeed;
theBackground._x = theBackground._x - (runSpeed / 8);
}
if (_xmouse < 250) {
platforms._x = platforms._x + runSpeed;
terrain1._x = terrain1._x + runSpeed;
terrain2._x = terrain2._x + runSpeed;
man._x = man._x + runSpeed;
theBackground._x = theBackground._x + (runSpeed / 8);
}
if (_ymouse < 139) {
platforms._y = platforms._y - ((ySpeed + yUp) - 15);
terrain1._y = terrain1._y - ((ySpeed + yUp) - 15);
terrain2._y = terrain2._y - ((ySpeed + yUp) - 15);
man._y = man._y - ((ySpeed + yUp) - 15);
theBackground._y = theBackground._y - (((ySpeed + yUp) - 15) / 8);
}
if (_ymouse > (Stage.height - 139)) {
platforms._y = platforms._y - ((ySpeed + yUp) + 15);
terrain1._y = terrain1._y - ((ySpeed + yUp) + 15);
terrain2._y = terrain2._y - ((ySpeed + yUp) + 15);
man._y = man._y - ((ySpeed + yUp) + 15);
theBackground._y = theBackground._y - (((ySpeed + yUp) + 15) / 8);
}
}
}
function customCursor() {
cursor.gotoAndStop(terrainVar);
linecolor.gotoAndStop(terrainVar);
cursor._x = _xmouse;
cursor._y = _ymouse;
cursor._rotation = cursor._rotation + 3;
}
function wallCling() {
if ((platforms.plats.hitTest(((man._x + xSpeed) + 16) + _x, (man._y - 60) + _y, true) && (air == true)) && (Key.isDown(39))) {
man.sprite._xscale = -manXScale;
wallClinging = true;
air = false;
ySpeed = 0;
doubleJump = 0;
} else if ((platforms.plats.hitTest(((man._x + xSpeed) - 16) + _x, man._y + _y, true) && (air == true)) && (Key.isDown(37))) {
man.sprite._xscale = manXScale;
wallClinging = true;
air = false;
ySpeed = 0;
doubleJump = 0;
}
if ((air == true) or Key.isDown(40)) {
wallClinging = false;
}
}
function manDodge() {
if (((Key.isDown(40) && (Key.isDown(68))) && (dodgeSwitch == false)) && (wallClinging == false)) {
dodging = "right";
dodgeSwitch = true;
} else if (((Key.isDown(40) && (Key.isDown(65))) && (dodgeSwitch == false)) && (wallClinging == false)) {
dodging = "left";
dodgeSwitch = true;
}
if (dodging == "right") {
man.sprite._xscale = manXScale;
man.sprite.gotoAndStop(5);
xSpeed = 25;
dodgeSwitch == true;
} else if (dodging == "left") {
man.sprite._xscale = -manXScale;
man.sprite.gotoAndStop(5);
xSpeed = -25;
dodgeSwitch == true;
}
if (!Key.isDown(40)) {
dodgeSwitch = false;
}
}
function spikesHit() {
if (((platforms.spikes.hitTest(man._x + _x, man._y + _y, true) or platforms.spikes2.hitTest(man._x + _x, man._y + _y, true)) or platforms.spikes3.hitTest(man._x + _x, man._y + _y, true)) or platforms.spikes4.hitTest(man._x + _x, man._y + _y, true)) {
gray_so.data.totalDeaths++;
currentDeaths++;
dead = true;
}
}
function kick() {
if (Key.isDown(32) && (kickKeySwitch == false)) {
attack = true;
kicking = true;
kickKeySwitch = true;
} else if (!Key.isDown(32)) {
kickKeySwitch = false;
}
}
function suicide() {
if (Key.isDown(13) && (suicideSwitch == false)) {
dead = true;
suicideSwitch = true;
}
if (!Key.isDown(13)) {
suicideSwitch = false;
}
}
function pauseGame() {
if (((Key.isDown(27) && (pauseSwitch == false)) && (gamePaused == false)) && (dead == false)) {
gamePaused = true;
imdrawing = false;
pauseScreen._visible = true;
inverter._visible = true;
pauseSwitch = true;
} else if ((Key.isDown(27) && (pauseSwitch == false)) && (gamePaused == true)) {
gamePaused = false;
pauseScreen._visible = false;
inverter._visible = false;
pauseSwitch = true;
} else if (!Key.isDown(27)) {
pauseSwitch = false;
}
}
function cheats() {
if (mudkipcheat == true) {
man.sprite._visible = false;
man.mudkip._visible = true;
man.mage._visible = false;
if ((man.mudkip._currentframe != 4) && (attack == false)) {
if (air == false) {
if ((Key.isDown(68) == false) && (Key.isDown(65) == false)) {
man.mudkip.gotoAndStop(1);
} else if ((Key.isDown(68) == true) or (Key.isDown(65) == true)) {
if (Key.isDown(68)) {
man.mudkip._xscale = mudkipXScale;
} else if (Key.isDown(65)) {
man.mudkip._xscale = -mudkipXScale;
}
man.mudkip.gotoAndStop(2);
}
} else if (air == true) {
man.mudkip.gotoAndStop(3);
}
if (Key.isDown(32) && (kickKeySwitch == false)) {
if (man.mudkip.inSprite.head._currentframe == 1) {
mudkipMouthOpen = true;
} else if (man.mudkip.inSprite.head._currentframe == 2) {
mudkipMouthOpen = false;
}
}
if (mudkipMouthOpen == true) {
man.mudkip.inSprite.head.gotoAndStop(2);
} else {
man.mudkip.inSprite.head.gotoAndStop(1);
}
}
} else if (magecheat == true) {
man.sprite._visible = false;
man.mudkip._visible = false;
man.mage._visible = true;
if ((man.mage._currentframe != 4) && (attack == false)) {
if (air == false) {
if ((Key.isDown(68) == false) && (Key.isDown(65) == false)) {
man.mage.gotoAndStop(1);
} else if ((Key.isDown(68) == true) or (Key.isDown(65) == true)) {
if (Key.isDown(68)) {
man.mage._xscale = mageXScale;
} else if (Key.isDown(65)) {
man.mage._xscale = -mageXScale;
}
man.mage.gotoAndStop(2);
}
} else if (air == true) {
man.mage.gotoAndStop(3);
}
}
} else if ((mudkipcheat == false) && (magecheat == false)) {
man.sprite._visible = true;
man.mudkip._visible = false;
man.mage._visible = false;
}
}
function achievementsFunc() {
if ((gray_so.data.totalDeaths == 100) && (gray_so.data.deathachievementplayed != true)) {
achpopup.dontfearthereaper._visible = true;
gray_so.data.deathachievementplayed = true;
achpopup.gotoAndPlay("start");
}
if ((gray_so.data.totalLines > 900) && (gray_so.data.over9000achievementplayed != true)) {
achpopup.over9000._visible = true;
gray_so.data.over9000achievementplayed = true;
achpopup.gotoAndPlay("start");
}
}
function timerCounter() {
timerPart++;
if (timerPart == 40) {
timer++;
gray_so.data.totalTimer++;
timerPart = 0;
}
}
stop();
pauseScreen._visible = false;
inverter._visible = false;
Mouse.hide();
platx = platforms._x;
platy = platforms._y;
backx = theBackground._x;
backy = theBackground._y;
manx = man._x;
many = man._y;
dead = false;
gamePaused = false;
dodging = false;
var attack = false;
var kicking = false;
var manstate = 1;
var runSpeed = 15;
var xSpeed = 0;
var ySpeed = 0;
var jumping = false;
var jumpKeySwitch = false;
var mudkipXScale = man.mudkip._xscale;
var mageXScale = man.mage._xscale;
var manXScale = man.sprite._xscale;
var gravity = 2;
var color = new Color("_root.man");
var imdrawing = false;
var terrainVar = 1;
Frame 26
function onMouseDown() {
if ((terrainVar == 1) && (gamePaused == false)) {
createEmptyMovieClip("terrain1", man.getDepth() - 1);
terrain1.lineStyle(40, 3355443, 100);
if (imdrawing == false) {
terrain1.moveTo(_xmouse, _ymouse);
imdrawing = true;
xMouseStart = _xmouse;
yMouseStart = _ymouse;
}
} else if ((terrainVar == 2) && (gamePaused == false)) {
createEmptyMovieClip("terrain2", man.getDepth() - 2);
terrain2.lineStyle(40, 6710886, 100);
if (imdrawing == false) {
terrain2.moveTo(_xmouse, _ymouse);
imdrawing = true;
xMouseStart = _xmouse;
yMouseStart = _ymouse;
}
}
}
function Drawing() {
if (((terrainVar == 1) && (imdrawing == true)) && (!man.nodrawhitbox.hitTest(_xmouse, _ymouse, true))) {
if (((air == false) && (!Key.isDown(65))) && (!Key.isDown(68))) {
terrain1.lineTo(_xmouse, _ymouse);
}
} else if (((terrainVar == 2) && (imdrawing == true)) && (!man.nodrawhitbox.hitTest(_xmouse, _ymouse, true))) {
if (((air == false) && (!Key.isDown(65))) && (!Key.isDown(68))) {
terrain2.lineTo(_xmouse, _ymouse);
}
}
if (imdrawing == false) {
lineDrawed = false;
}
if (imdrawing == true) {
if ((((_xmouse != xMouseStart) && (lineDrawed == false)) && (terrainVar == 1)) or (((_ymouse != yMouseStart) && (lineDrawed == false)) && (terrainVar == 1))) {
line1Drawn = true;
lineDrawed = true;
gray_so.data.totalLines++;
levelLinesPlayer++;
} else if (((_xmouse == xMouseStart) && (_ymouse == yMouseStart)) && (terrainVar == 1)) {
line1Drawn = false;
lineDrawed = false;
}
if ((((_xmouse != xMouseStart) && (lineDrawed == false)) && (terrainVar == 2)) or (((_ymouse != yMouseStart) && (lineDrawed == false)) && (terrainVar == 2))) {
line2Drawn = true;
lineDrawed = true;
gray_so.data.totalLines++;
levelLinesPlayer++;
} else if (((_xmouse == xMouseStart) && (_ymouse == yMouseStart)) && (terrainVar == 2)) {
line2Drawn = false;
lineDrawed = false;
}
if ((((air == true) or Key.isDown(65)) or Key.isDown(68)) or (gamePaused == true)) {
imdrawing = false;
}
if (man.nodrawhitbox.hitTest(_xmouse, _ymouse, true)) {
imdrawing = false;
}
if ((((_xmouse > 750) or (_xmouse < 0)) or (_ymouse > 500)) or (_ymouse < 0)) {
imdrawing = false;
}
}
if (Key.isDown(69) && (terrainKeySwitch == false)) {
terrainVar = terrainVar + 1;
terrainKeySwitch = true;
} else if (!Key.isDown(69)) {
terrainKeySwitch = false;
}
if (terrainVar > 2) {
terrainVar = 1;
}
}
function switches() {
if ((platforms.switch1.hitTest(man._x + _x, man._y + _y, true) or ((platforms.switch1.hitTest(terrain1) == true) && (line1Drawn == true))) or ((platforms.switch1.hitTest(terrain2) == true) && (line2Drawn == true))) {
switchdoor1open = true;
} else if (!platforms.switch1.hitTest(man._x + _x, man._y + _y, true)) {
switchdoor1open = false;
}
if (switchdoor1open == true) {
platforms.switch1.gotoAndStop(2);
if (platforms.plats.switchdoor1._rotation > 0) {
platforms.plats.switchdoor1._rotation = platforms.plats.switchdoor1._rotation - 3;
}
} else if (switchdoor1open == false) {
platforms.switch1.gotoAndStop(1);
if (platforms.plats.switchdoor1._rotation < 90) {
platforms.plats.switchdoor1._rotation = platforms.plats.switchdoor1._rotation + 3;
}
}
if ((platforms.switch2.hitTest(man._x + _x, man._y + _y, true) or ((platforms.switch2.hitTest(terrain1) == true) && (line1Drawn == true))) or ((platforms.switch2.hitTest(terrain2) == true) && (line2Drawn == true))) {
switchdoor2open = true;
} else if (!platforms.switch2.hitTest(man._x + _x, man._y + _y, true)) {
switchdoor2open = false;
}
if (switchdoor2open == true) {
platforms.switch2.gotoAndStop(2);
if (platforms.plats.switchdoor2._rotation > 0) {
platforms.plats.switchdoor2._rotation = platforms.plats.switchdoor2._rotation - 3;
}
} else if (switchdoor2open == false) {
platforms.switch2.gotoAndStop(1);
if (platforms.plats.switchdoor2._rotation < 90) {
platforms.plats.switchdoor2._rotation = platforms.plats.switchdoor2._rotation + 3;
}
}
if ((platforms.switch3.hitTest(man._x + _x, man._y + _y, true) or ((platforms.switch3.hitTest(terrain1) == true) && (line1Drawn == true))) or ((platforms.switch3.hitTest(terrain2) == true) && (line2Drawn == true))) {
switchdoor3open = true;
} else if (!platforms.switch3.hitTest(man._x + _x, man._y + _y, true)) {
switchdoor3open = false;
}
if (switchdoor3open == true) {
platforms.switch3.gotoAndStop(2);
if (platforms.plats.switchdoor3._rotation > 0) {
platforms.plats.switchdoor3._rotation = platforms.plats.switchdoor3._rotation - 3;
}
} else if (switchdoor3open == false) {
platforms.switch3.gotoAndStop(1);
if (platforms.plats.switchdoor3._rotation < 90) {
platforms.plats.switchdoor3._rotation = platforms.plats.switchdoor3._rotation + 3;
}
}
}
function doorHit() {
if (platforms.door.hitTest(man._x + _x, man._y + _y, true)) {
gamePaused = true;
if (fader._alpha < 100) {
fader._alpha = fader._alpha + 5;
} else if (((fader._alpha >= 100) && (noJumpMode == false)) && (leastLinesMode == false)) {
man.sprite._xscale = manXScale;
man.mudkip._xscale = mudkipXScale;
man.mage._xscale = mageXScale;
createEmptyMovieClip("terrain1", man.getDepth() - 1);
createEmptyMovieClip("terrain2", man.getDepth() - 2);
man._x = 375;
man._y = 250;
if (gray_so.data.lvlsavailable == 11) {
gray_so.data.lvlsavailable++;
}
gotoAndStop ("lvl12");
} else if (((fader._alpha >= 100) && (noJumpMode == true)) && (leastLinesMode == false)) {
gray_so.data.lvl11noJump = true;
gotoAndStop ("noJumps");
} else if (((fader._alpha >= 100) && (leastLinesMode == true)) && (noJumpMode == false)) {
if (levelLinesPlayer < gray_so.data.lvl11leastLinesPlayer) {
gray_so.data.lvl11leastLinesPlayer = levelLinesPlayer;
}
gotoAndStop ("leastLines");
}
}
}
function onMouseUp() {
imdrawing = false;
}
function onEnterFrame() {
displayText();
wallClinging = false;
xVar = man._x;
yVar = man._y;
testVar = ySpeed + yUp;
music();
cheats();
achievementsFunc();
pauseGame();
customCursor();
doorHit();
if (gamePaused == false) {
Drawing();
timerCounter();
man._x = man._x + xSpeed;
man._y = man._y + ySpeed;
manCollision();
moveScreen();
lookAround();
if (dead == false) {
if (fader._alpha > 0) {
fader._alpha = fader._alpha - 2;
}
kick();
manJump(-20);
managemanSprite();
onGround();
manageColor();
suicide();
spikesHit();
switches();
if ((Key.isDown(68) && (dodging == false)) && (wallClinging == false)) {
xSpeed = runSpeed;
} else if ((Key.isDown(65) && (dodging == false)) && (wallClinging == false)) {
xSpeed = -runSpeed;
} else if (((!Key.isDown(65)) && (!Key.isDown(68))) && (dodging == false)) {
xSpeed = 0;
}
} else {
man.sprite.gotoAndStop(4);
man.mudkip.gotoAndStop(4);
man.mage.gotoAndStop(4);
xSpeed = 0;
}
if (((man._x + xSpeed) > Stage.width) or ((man._x + xSpeed) < 0)) {
xSpeed = xSpeed - xSpeed;
} else if (dead == true) {
levelLinesPlayer = 0;
if (fader._alpha < 100) {
fader._alpha = fader._alpha + 5;
}
if (fader._alpha >= 100) {
dead = false;
deathsThisTime++;
man.sprite.gotoAndStop(1);
man.mudkip.gotoAndStop(1);
man.mage.gotoAndStop(1);
platforms._x = platx;
platforms._y = platy;
theBackground._x = backx;
theBackground._y = backy;
man._x = manx;
man._y = many;
createEmptyMovieClip("terrain1", man.getDepth() - 1);
createEmptyMovieClip("terrain2", man.getDepth() - 2);
}
}
}
}
function managemanSprite() {
if ((man.sprite._currentframe != 4) && (attack == false)) {
if ((air == false) && (wallClinging == false)) {
if (((Key.isDown(68) == false) && (Key.isDown(65) == false)) && (dodging == false)) {
man.sprite.gotoAndStop(1);
} else if (((Key.isDown(68) == true) && (dodging == false)) or ((Key.isDown(65) == true) && (dodging == false))) {
if (Key.isDown(68) && (dodging == false)) {
man.sprite._xscale = manXScale;
} else if (Key.isDown(65) && (dodging == false)) {
man.sprite._xscale = -manXScale;
}
man.sprite.gotoAndStop(2);
}
} else if (((air == true) && (dodging == false)) && (wallClinging == false)) {
man.sprite.gotoAndStop(3);
} else if (wallClinging == true) {
man.sprite.gotoAndStop(6);
}
} else if ((man.sprite._currentframe != 4) && (attack == true)) {
if (kicking == true) {
man.sprite.gotoAndStop(7);
}
}
}
function manageColor() {
if (man.sprite._xscale == (-manXScale)) {
man.sprite.bwhite.blendMode = "invert";
} else if (man.sprite._xscale == manXScale) {
man.sprite.bwhite.blendMode = "alpha";
}
}
function manJump(jumpHeight) {
if ((((((Key.isDown(87) && (noJumpMode == false)) && (!Key.isDown(70))) && (jumpKeySwitch == false)) && (doubleJump < 2)) && (noJump == false)) && (ySpeed > -1)) {
gray_so.data.totalJumps++;
jumpKeySwitch = true;
jumping = true;
doubleJump++;
air = true;
yUp = 0;
wallClinging = false;
gravity = 2;
man.sprite.inSprite.play();
man.sprite.bwhite.play();
man.sprite.outline.play();
if (ySpeed > -5) {
ySpeed = jumpHeight;
}
if ((doubleJump >= 2) && (ySpeed < -5)) {
ySpeed = jumpHeight;
}
} else if (Key.isDown(87) == false) {
jumpKeySwitch = false;
}
if ((jumping == true) && (ySpeed > 0)) {
jumping = false;
}
}
function onGround() {
if (((platforms.plats.hitTest(man._x + _x, ((man._y + 38) - yUp) + _y, true) or terrain1.hitTest(man._x + _x, ((man._y + 38) - yUp) + _y, true)) or terrain2.hitTest(man._x + _x, ((man._y + 38) - yUp) + _y, true)) or (wallClinging == true)) {
gravity = 2;
air = false;
doubleJump = 1;
} else {
air = true;
man._rotation = 0;
if (ySpeed < 15) {
ySpeed = ySpeed + gravity;
}
}
}
function manCollision() {
yUp = 0;
while ((platforms.plats.hitTest(man._x + _x, (((man._y + 35) + yUp) + _y) - 4, true) or terrain1.hitTest(man._x + _x, (((man._y + 35) + yUp) + _y) - 4, true)) or terrain2.hitTest(man._x + _x, (((man._y + 35) + yUp) + _y) - 4, true)) {
yUp--;
if (((Key.isDown(65) && (air == false)) && (jumping == false)) or ((Key.isDown(68) && (air == false)) && (jumping == false))) {
if ((yUp < ySpeed) && (man.sprite._xscale == (-manXScale))) {
man._rotation = ((-(yUp - ySpeed)) * 3) - (ySpeed * 6.15);
} else if ((yUp > ySpeed) && (man.sprite._xscale == manXScale)) {
man._rotation = ((yUp - ySpeed) * 3) + (ySpeed * 6.15);
} else if ((yUp > ySpeed) && (man.sprite._xscale == (-manXScale))) {
man._rotation = ((-(yUp - ySpeed)) * 3) - (ySpeed * 6.15);
} else if ((yUp < ySpeed) && (man.sprite._xscale == manXScale)) {
man._rotation = ((yUp - ySpeed) * 3) + (ySpeed * 6.15);
}
}
}
if ((platforms.plats.hitTest(man._x + _x, ((man._y - 35) + yUp) + _y, true) or terrain1.hitTest(man._x + _x, ((man._y - 35) + yUp) + _y, true)) or terrain2.hitTest(man._x + _x, ((man._y - 35) + yUp) + _y, true)) {
yUp = -ySpeed;
}
while ((((xSpeed != 0) && (platforms.plats.hitTest((man._x + xSpeed) + _x, ((man._y - 35) + yUp) + _y, true))) or ((xSpeed != 0) && (terrain1.hitTest((man._x + xSpeed) + _x, ((man._y - 35) + yUp) + _y, true)))) or ((xSpeed != 0) && (terrain2.hitTest((man._x + xSpeed) + _x, ((man._y - 35) + yUp) + _y, true)))) {
man._x = man._x - xSpeed;
}
if (((yUp == 0) && (ySpeed == 0)) && (air == false)) {
yUp = -16;
ySpeed = 16;
}
if ((yUp < -50) && (ySpeed > 0)) {
xSpeed = 0;
yUp = -ySpeed;
} else if ((yUp < -50) && (ySpeed < 0)) {
yUp = -15;
}
noJump = false;
man._y = man._y + yUp;
collideVar = yUp - ySpeed;
while ((((((platforms.plats.hitTest((man._x + xSpeed) + _x, man._y + _y, true) && (xSpeed != 0)) or (platforms.plats.hitTest((man._x + xSpeed) + _x, man._y + _y, true) && (xSpeed != 0))) or (terrain1.hitTest((man._x + xSpeed) + _x, man._y + _y, true) && (xSpeed != 0))) or (terrain1.hitTest((man._x + xSpeed) + _x, man._y + _y, true) && (xSpeed != 0))) or (terrain2.hitTest((man._x + xSpeed) + _x, man._y + _y, true) && (xSpeed != 0))) or (terrain2.hitTest((man._x + xSpeed) + _x, man._y + _y, true) && (xSpeed != 0))) {
man._x = man._x - xSpeed;
}
while ((xSpeed == 0) && (platforms.plats.hitTest((man._x - 20) + _x, man._y + _y, true))) {
man._x = man._x + 21;
}
while ((xSpeed == 0) && (platforms.plats.hitTest((man._x + 20) + _x, man._y + _y, true))) {
man._x = man._x - 21;
}
}
function moveScreen() {
if (man._x > (Stage.width - 250)) {
platforms._x = platforms._x - runSpeed;
terrain1._x = terrain1._x - runSpeed;
terrain2._x = terrain2._x - runSpeed;
man._x = man._x - runSpeed;
theBackground._x = theBackground._x - (runSpeed / 8);
}
if (man._x < 250) {
platforms._x = platforms._x + runSpeed;
terrain1._x = terrain1._x + runSpeed;
terrain2._x = terrain2._x + runSpeed;
man._x = man._x + runSpeed;
theBackground._x = theBackground._x + (runSpeed / 8);
}
if (((man._y + ySpeed) + yUp) > (Stage.height - 150)) {
platforms._y = platforms._y - (ySpeed + yUp);
terrain1._y = terrain1._y - (ySpeed + yUp);
terrain2._y = terrain2._y - (ySpeed + yUp);
man._y = man._y - (ySpeed + yUp);
theBackground._y = theBackground._y - ((ySpeed + yUp) / 8);
}
if (((man._y + ySpeed) + yUp) < 150) {
platforms._y = platforms._y - (ySpeed + yUp);
terrain1._y = terrain1._y - (ySpeed + yUp);
terrain2._y = terrain2._y - (ySpeed + yUp);
man._y = man._y - (ySpeed + yUp);
theBackground._y = theBackground._y - ((ySpeed + yUp) / 8);
}
if (((man._y + ySpeed) + yUp) < 125) {
platforms._y = platforms._y - ((ySpeed + yUp) - 26);
terrain1._y = terrain1._y - ((ySpeed + yUp) - 26);
terrain2._y = terrain2._y - ((ySpeed + yUp) - 26);
man._y = man._y - ((ySpeed + yUp) - 26);
theBackground._y = theBackground._y - (((ySpeed + yUp) - 26) / 8);
}
if (((man._y + ySpeed) + yUp) > (Stage.height - 125)) {
platforms._y = platforms._y - ((ySpeed + yUp) + 26);
terrain1._y = terrain1._y - ((ySpeed + yUp) + 26);
terrain2._y = terrain2._y - ((ySpeed + yUp) + 26);
man._y = man._y - ((ySpeed + yUp) + 26);
theBackground._y = theBackground._y - (((ySpeed + yUp) + 26) / 8);
}
if ((((man._y + ySpeed) + yUp) < 139) && (Key.isDown(70))) {
platforms._y = platforms._y - ((ySpeed + yUp) - 15);
terrain1._y = terrain1._y - ((ySpeed + yUp) - 15);
terrain2._y = terrain2._y - ((ySpeed + yUp) - 15);
man._y = man._y - ((ySpeed + yUp) - 15);
theBackground._y = theBackground._y - (((ySpeed + yUp) - 15) / 8);
}
if ((((man._y + ySpeed) + yUp) > (Stage.height - 139)) && (Key.isDown(70))) {
platforms._y = platforms._y - ((ySpeed + yUp) + 15);
terrain1._y = terrain1._y - ((ySpeed + yUp) + 15);
terrain2._y = terrain2._y - ((ySpeed + yUp) + 15);
man._y = man._y - ((ySpeed + yUp) + 15);
theBackground._y = theBackground._y - (((ySpeed + yUp) + 15) / 8);
}
}
function lookAround() {
if (((Key.isDown(70) && (air == false)) && (!Key.isDown(65))) && (!Key.isDown(68))) {
imdrawing = false;
if (_xmouse > (Stage.width - 250)) {
platforms._x = platforms._x - runSpeed;
terrain1._x = terrain1._x - runSpeed;
terrain2._x = terrain2._x - runSpeed;
man._x = man._x - runSpeed;
theBackground._x = theBackground._x - (runSpeed / 8);
}
if (_xmouse < 250) {
platforms._x = platforms._x + runSpeed;
terrain1._x = terrain1._x + runSpeed;
terrain2._x = terrain2._x + runSpeed;
man._x = man._x + runSpeed;
theBackground._x = theBackground._x + (runSpeed / 8);
}
if (_ymouse < 139) {
platforms._y = platforms._y - ((ySpeed + yUp) - 15);
terrain1._y = terrain1._y - ((ySpeed + yUp) - 15);
terrain2._y = terrain2._y - ((ySpeed + yUp) - 15);
man._y = man._y - ((ySpeed + yUp) - 15);
theBackground._y = theBackground._y - (((ySpeed + yUp) - 15) / 8);
}
if (_ymouse > (Stage.height - 139)) {
platforms._y = platforms._y - ((ySpeed + yUp) + 15);
terrain1._y = terrain1._y - ((ySpeed + yUp) + 15);
terrain2._y = terrain2._y - ((ySpeed + yUp) + 15);
man._y = man._y - ((ySpeed + yUp) + 15);
theBackground._y = theBackground._y - (((ySpeed + yUp) + 15) / 8);
}
}
}
function customCursor() {
cursor.gotoAndStop(terrainVar);
linecolor.gotoAndStop(terrainVar);
cursor._x = _xmouse;
cursor._y = _ymouse;
cursor._rotation = cursor._rotation + 3;
}
function wallCling() {
if ((platforms.plats.hitTest(((man._x + xSpeed) + 16) + _x, (man._y - 60) + _y, true) && (air == true)) && (Key.isDown(39))) {
man.sprite._xscale = -manXScale;
wallClinging = true;
air = false;
ySpeed = 0;
doubleJump = 0;
} else if ((platforms.plats.hitTest(((man._x + xSpeed) - 16) + _x, man._y + _y, true) && (air == true)) && (Key.isDown(37))) {
man.sprite._xscale = manXScale;
wallClinging = true;
air = false;
ySpeed = 0;
doubleJump = 0;
}
if ((air == true) or Key.isDown(40)) {
wallClinging = false;
}
}
function manDodge() {
if (((Key.isDown(40) && (Key.isDown(68))) && (dodgeSwitch == false)) && (wallClinging == false)) {
dodging = "right";
dodgeSwitch = true;
} else if (((Key.isDown(40) && (Key.isDown(65))) && (dodgeSwitch == false)) && (wallClinging == false)) {
dodging = "left";
dodgeSwitch = true;
}
if (dodging == "right") {
man.sprite._xscale = manXScale;
man.sprite.gotoAndStop(5);
xSpeed = 25;
dodgeSwitch == true;
} else if (dodging == "left") {
man.sprite._xscale = -manXScale;
man.sprite.gotoAndStop(5);
xSpeed = -25;
dodgeSwitch == true;
}
if (!Key.isDown(40)) {
dodgeSwitch = false;
}
}
function spikesHit() {
if (((platforms.spikes.hitTest(man._x + _x, man._y + _y, true) or platforms.spikes2.hitTest(man._x + _x, man._y + _y, true)) or platforms.spikes3.hitTest(man._x + _x, man._y + _y, true)) or platforms.spikes4.hitTest(man._x + _x, man._y + _y, true)) {
gray_so.data.totalDeaths++;
currentDeaths++;
dead = true;
}
}
function kick() {
if (Key.isDown(32) && (kickKeySwitch == false)) {
attack = true;
kicking = true;
kickKeySwitch = true;
} else if (!Key.isDown(32)) {
kickKeySwitch = false;
}
}
function suicide() {
if (Key.isDown(13) && (suicideSwitch == false)) {
dead = true;
suicideSwitch = true;
}
if (!Key.isDown(13)) {
suicideSwitch = false;
}
}
function pauseGame() {
if (((Key.isDown(27) && (pauseSwitch == false)) && (gamePaused == false)) && (dead == false)) {
gamePaused = true;
imdrawing = false;
pauseScreen._visible = true;
inverter._visible = true;
pauseSwitch = true;
} else if ((Key.isDown(27) && (pauseSwitch == false)) && (gamePaused == true)) {
gamePaused = false;
pauseScreen._visible = false;
inverter._visible = false;
pauseSwitch = true;
} else if (!Key.isDown(27)) {
pauseSwitch = false;
}
}
function cheats() {
if (mudkipcheat == true) {
man.sprite._visible = false;
man.mudkip._visible = true;
man.mage._visible = false;
if ((man.mudkip._currentframe != 4) && (attack == false)) {
if (air == false) {
if ((Key.isDown(68) == false) && (Key.isDown(65) == false)) {
man.mudkip.gotoAndStop(1);
} else if ((Key.isDown(68) == true) or (Key.isDown(65) == true)) {
if (Key.isDown(68)) {
man.mudkip._xscale = mudkipXScale;
} else if (Key.isDown(65)) {
man.mudkip._xscale = -mudkipXScale;
}
man.mudkip.gotoAndStop(2);
}
} else if (air == true) {
man.mudkip.gotoAndStop(3);
}
if (Key.isDown(32) && (kickKeySwitch == false)) {
if (man.mudkip.inSprite.head._currentframe == 1) {
mudkipMouthOpen = true;
} else if (man.mudkip.inSprite.head._currentframe == 2) {
mudkipMouthOpen = false;
}
}
if (mudkipMouthOpen == true) {
man.mudkip.inSprite.head.gotoAndStop(2);
} else {
man.mudkip.inSprite.head.gotoAndStop(1);
}
}
} else if (magecheat == true) {
man.sprite._visible = false;
man.mudkip._visible = false;
man.mage._visible = true;
if ((man.mage._currentframe != 4) && (attack == false)) {
if (air == false) {
if ((Key.isDown(68) == false) && (Key.isDown(65) == false)) {
man.mage.gotoAndStop(1);
} else if ((Key.isDown(68) == true) or (Key.isDown(65) == true)) {
if (Key.isDown(68)) {
man.mage._xscale = mageXScale;
} else if (Key.isDown(65)) {
man.mage._xscale = -mageXScale;
}
man.mage.gotoAndStop(2);
}
} else if (air == true) {
man.mage.gotoAndStop(3);
}
}
} else if ((mudkipcheat == false) && (magecheat == false)) {
man.sprite._visible = true;
man.mudkip._visible = false;
man.mage._visible = false;
}
}
function achievementsFunc() {
if ((gray_so.data.totalDeaths == 100) && (gray_so.data.deathachievementplayed != true)) {
achpopup.dontfearthereaper._visible = true;
gray_so.data.deathachievementplayed = true;
achpopup.gotoAndPlay("start");
}
if ((gray_so.data.totalLines > 900) && (gray_so.data.over9000achievementplayed != true)) {
achpopup.over9000._visible = true;
gray_so.data.over9000achievementplayed = true;
achpopup.gotoAndPlay("start");
}
}
function timerCounter() {
timerPart++;
if (timerPart == 40) {
timer++;
gray_so.data.totalTimer++;
timerPart = 0;
}
}
stop();
pauseScreen._visible = false;
inverter._visible = false;
Mouse.hide();
platx = platforms._x;
platy = platforms._y;
backx = theBackground._x;
backy = theBackground._y;
manx = man._x;
many = man._y;
dead = false;
gamePaused = false;
dodging = false;
var attack = false;
var kicking = false;
var manstate = 1;
var runSpeed = 15;
var xSpeed = 0;
var ySpeed = 0;
var jumping = false;
var jumpKeySwitch = false;
var mudkipXScale = man.mudkip._xscale;
var mageXScale = man.mage._xscale;
var manXScale = man.sprite._xscale;
var gravity = 2;
var color = new Color("_root.man");
var imdrawing = false;
var terrainVar = 1;
Frame 27
function onMouseDown() {
if ((terrainVar == 1) && (gamePaused == false)) {
createEmptyMovieClip("terrain1", man.getDepth() - 1);
terrain1.lineStyle(40, 3355443, 100);
if (imdrawing == false) {
terrain1.moveTo(_xmouse, _ymouse);
imdrawing = true;
xMouseStart = _xmouse;
yMouseStart = _ymouse;
}
} else if ((terrainVar == 2) && (gamePaused == false)) {
createEmptyMovieClip("terrain2", man.getDepth() - 2);
terrain2.lineStyle(40, 6710886, 100);
if (imdrawing == false) {
terrain2.moveTo(_xmouse, _ymouse);
imdrawing = true;
xMouseStart = _xmouse;
yMouseStart = _ymouse;
}
}
}
function Drawing() {
if (((terrainVar == 1) && (imdrawing == true)) && (!man.nodrawhitbox.hitTest(_xmouse, _ymouse, true))) {
if (((air == false) && (!Key.isDown(65))) && (!Key.isDown(68))) {
terrain1.lineTo(_xmouse, _ymouse);
}
} else if (((terrainVar == 2) && (imdrawing == true)) && (!man.nodrawhitbox.hitTest(_xmouse, _ymouse, true))) {
if (((air == false) && (!Key.isDown(65))) && (!Key.isDown(68))) {
terrain2.lineTo(_xmouse, _ymouse);
}
}
if (imdrawing == false) {
lineDrawed = false;
}
if (imdrawing == true) {
if ((((_xmouse != xMouseStart) && (lineDrawed == false)) && (terrainVar == 1)) or (((_ymouse != yMouseStart) && (lineDrawed == false)) && (terrainVar == 1))) {
line1Drawn = true;
lineDrawed = true;
gray_so.data.totalLines++;
levelLinesPlayer++;
} else if (((_xmouse == xMouseStart) && (_ymouse == yMouseStart)) && (terrainVar == 1)) {
line1Drawn = false;
lineDrawed = false;
}
if ((((_xmouse != xMouseStart) && (lineDrawed == false)) && (terrainVar == 2)) or (((_ymouse != yMouseStart) && (lineDrawed == false)) && (terrainVar == 2))) {
line2Drawn = true;
lineDrawed = true;
gray_so.data.totalLines++;
levelLinesPlayer++;
} else if (((_xmouse == xMouseStart) && (_ymouse == yMouseStart)) && (terrainVar == 2)) {
line2Drawn = false;
lineDrawed = false;
}
if ((((air == true) or Key.isDown(65)) or Key.isDown(68)) or (gamePaused == true)) {
imdrawing = false;
}
if (man.nodrawhitbox.hitTest(_xmouse, _ymouse, true)) {
imdrawing = false;
}
if ((((_xmouse > 750) or (_xmouse < 0)) or (_ymouse > 500)) or (_ymouse < 0)) {
imdrawing = false;
}
}
if (Key.isDown(69) && (terrainKeySwitch == false)) {
terrainVar = terrainVar + 1;
terrainKeySwitch = true;
} else if (!Key.isDown(69)) {
terrainKeySwitch = false;
}
if (terrainVar > 2) {
terrainVar = 1;
}
}
function switches() {
if ((platforms.switch1.hitTest(man._x + _x, man._y + _y, true) or ((platforms.switch1.hitTest(terrain1) == true) && (line1Drawn == true))) or ((platforms.switch1.hitTest(terrain2) == true) && (line2Drawn == true))) {
switchdoor1open = true;
} else if (!platforms.switch1.hitTest(man._x + _x, man._y + _y, true)) {
switchdoor1open = false;
}
if (switchdoor1open == true) {
platforms.switch1.gotoAndStop(2);
if (platforms.plats.switchdoor1._rotation < 0) {
platforms.plats.switchdoor1._rotation = platforms.plats.switchdoor1._rotation + 3;
}
} else if (switchdoor1open == false) {
platforms.switch1.gotoAndStop(1);
if (platforms.plats.switchdoor1._rotation > -90) {
platforms.plats.switchdoor1._rotation = platforms.plats.switchdoor1._rotation - 3;
}
}
if ((platforms.switch2.hitTest(man._x + _x, man._y + _y, true) or ((platforms.switch2.hitTest(terrain1) == true) && (line1Drawn == true))) or ((platforms.switch2.hitTest(terrain2) == true) && (line2Drawn == true))) {
switchdoor2open = true;
} else if (!platforms.switch2.hitTest(man._x + _x, man._y + _y, true)) {
switchdoor2open = false;
}
if (switchdoor2open == true) {
platforms.switch2.gotoAndStop(2);
if (platforms.plats.switchdoor2._rotation > -180) {
platforms.plats.switchdoor2._rotation = platforms.plats.switchdoor2._rotation - 3;
}
} else if (switchdoor2open == false) {
platforms.switch2.gotoAndStop(1);
if (platforms.plats.switchdoor2._rotation < -90) {
platforms.plats.switchdoor2._rotation = platforms.plats.switchdoor2._rotation + 3;
}
}
if ((platforms.switch3.hitTest(man._x + _x, man._y + _y, true) or ((platforms.switch3.hitTest(terrain1) == true) && (line1Drawn == true))) or ((platforms.switch3.hitTest(terrain2) == true) && (line2Drawn == true))) {
switchdoor3open = true;
}
if (dead == true) {
switchdoor3open = false;
}
if (switchdoor3open == true) {
platforms.switch3.gotoAndStop(2);
if (platforms.plats.switchdoor3._rotation < 0) {
platforms.plats.switchdoor3._rotation = platforms.plats.switchdoor3._rotation + 3;
}
}
if (dead == true) {
platforms.switch3.gotoAndStop(1);
platforms.plats.switchdoor3._rotation = -90;
}
}
function doorHit() {
if (platforms.door.hitTest(man._x + _x, man._y + _y, true)) {
gamePaused = true;
if (fader._alpha < 100) {
fader._alpha = fader._alpha + 5;
} else if (((fader._alpha >= 100) && (noJumpMode == false)) && (leastLinesMode == false)) {
man.sprite._xscale = manXScale;
man.mudkip._xscale = mudkipXScale;
man.mage._xscale = mageXScale;
createEmptyMovieClip("terrain1", man.getDepth() - 1);
createEmptyMovieClip("terrain2", man.getDepth() - 2);
man._x = 375;
man._y = 250;
if (gray_so.data.lvlsavailable == 12) {
gray_so.data.lvlsavailable++;
}
gotoAndStop ("lvl13");
} else if (((fader._alpha >= 100) && (noJumpMode == true)) && (leastLinesMode == false)) {
gray_so.data.lvl12noJump = true;
gotoAndStop ("noJumps");
} else if (((fader._alpha >= 100) && (leastLinesMode == true)) && (noJumpMode == false)) {
if (levelLinesPlayer < gray_so.data.lvl12leastLinesPlayer) {
gray_so.data.lvl12leastLinesPlayer = levelLinesPlayer;
}
gotoAndStop ("leastLines");
}
}
}
function onMouseUp() {
imdrawing = false;
}
function onEnterFrame() {
displayText();
wallClinging = false;
xVar = man._x;
yVar = man._y;
testVar = ySpeed + yUp;
music();
cheats();
achievementsFunc();
pauseGame();
customCursor();
doorHit();
if (gamePaused == false) {
Drawing();
timerCounter();
man._x = man._x + xSpeed;
man._y = man._y + ySpeed;
manCollision();
moveScreen();
lookAround();
if (dead == false) {
if (fader._alpha > 0) {
fader._alpha = fader._alpha - 2;
}
kick();
manJump(-20);
managemanSprite();
onGround();
manageColor();
suicide();
spikesHit();
switches();
if ((Key.isDown(68) && (dodging == false)) && (wallClinging == false)) {
xSpeed = runSpeed;
} else if ((Key.isDown(65) && (dodging == false)) && (wallClinging == false)) {
xSpeed = -runSpeed;
} else if (((!Key.isDown(65)) && (!Key.isDown(68))) && (dodging == false)) {
xSpeed = 0;
}
} else {
man.sprite.gotoAndStop(4);
man.mudkip.gotoAndStop(4);
man.mage.gotoAndStop(4);
xSpeed = 0;
}
if (((man._x + xSpeed) > Stage.width) or ((man._x + xSpeed) < 0)) {
xSpeed = xSpeed - xSpeed;
} else if (dead == true) {
levelLinesPlayer = 0;
if (fader._alpha < 100) {
fader._alpha = fader._alpha + 5;
}
if (fader._alpha >= 100) {
dead = false;
deathsThisTime++;
man.sprite.gotoAndStop(1);
man.mudkip.gotoAndStop(1);
man.mage.gotoAndStop(1);
platforms._x = platx;
platforms._y = platy;
theBackground._x = backx;
theBackground._y = backy;
man._x = manx;
man._y = many;
createEmptyMovieClip("terrain1", man.getDepth() - 1);
createEmptyMovieClip("terrain2", man.getDepth() - 2);
}
}
}
}
function managemanSprite() {
if ((man.sprite._currentframe != 4) && (attack == false)) {
if ((air == false) && (wallClinging == false)) {
if (((Key.isDown(68) == false) && (Key.isDown(65) == false)) && (dodging == false)) {
man.sprite.gotoAndStop(1);
} else if (((Key.isDown(68) == true) && (dodging == false)) or ((Key.isDown(65) == true) && (dodging == false))) {
if (Key.isDown(68) && (dodging == false)) {
man.sprite._xscale = manXScale;
} else if (Key.isDown(65) && (dodging == false)) {
man.sprite._xscale = -manXScale;
}
man.sprite.gotoAndStop(2);
}
} else if (((air == true) && (dodging == false)) && (wallClinging == false)) {
man.sprite.gotoAndStop(3);
} else if (wallClinging == true) {
man.sprite.gotoAndStop(6);
}
} else if ((man.sprite._currentframe != 4) && (attack == true)) {
if (kicking == true) {
man.sprite.gotoAndStop(7);
}
}
}
function manageColor() {
if (man.sprite._xscale == (-manXScale)) {
man.sprite.bwhite.blendMode = "invert";
} else if (man.sprite._xscale == manXScale) {
man.sprite.bwhite.blendMode = "alpha";
}
}
function manJump(jumpHeight) {
if ((((((Key.isDown(87) && (noJumpMode == false)) && (!Key.isDown(70))) && (jumpKeySwitch == false)) && (doubleJump < 2)) && (noJump == false)) && (ySpeed > -1)) {
gray_so.data.totalJumps++;
jumpKeySwitch = true;
jumping = true;
doubleJump++;
air = true;
yUp = 0;
wallClinging = false;
gravity = 2;
man.sprite.inSprite.play();
man.sprite.bwhite.play();
man.sprite.outline.play();
if (ySpeed > -5) {
ySpeed = jumpHeight;
}
if ((doubleJump >= 2) && (ySpeed < -5)) {
ySpeed = jumpHeight;
}
} else if (Key.isDown(87) == false) {
jumpKeySwitch = false;
}
if ((jumping == true) && (ySpeed > 0)) {
jumping = false;
}
}
function onGround() {
if (((platforms.plats.hitTest(man._x + _x, ((man._y + 38) - yUp) + _y, true) or terrain1.hitTest(man._x + _x, ((man._y + 38) - yUp) + _y, true)) or terrain2.hitTest(man._x + _x, ((man._y + 38) - yUp) + _y, true)) or (wallClinging == true)) {
gravity = 2;
air = false;
doubleJump = 1;
} else {
air = true;
man._rotation = 0;
if (ySpeed < 15) {
ySpeed = ySpeed + gravity;
}
}
}
function manCollision() {
yUp = 0;
while ((platforms.plats.hitTest(man._x + _x, (((man._y + 35) + yUp) + _y) - 4, true) or terrain1.hitTest(man._x + _x, (((man._y + 35) + yUp) + _y) - 4, true)) or terrain2.hitTest(man._x + _x, (((man._y + 35) + yUp) + _y) - 4, true)) {
yUp--;
if (((Key.isDown(65) && (air == false)) && (jumping == false)) or ((Key.isDown(68) && (air == false)) && (jumping == false))) {
if ((yUp < ySpeed) && (man.sprite._xscale == (-manXScale))) {
man._rotation = ((-(yUp - ySpeed)) * 3) - (ySpeed * 6.15);
} else if ((yUp > ySpeed) && (man.sprite._xscale == manXScale)) {
man._rotation = ((yUp - ySpeed) * 3) + (ySpeed * 6.15);
} else if ((yUp > ySpeed) && (man.sprite._xscale == (-manXScale))) {
man._rotation = ((-(yUp - ySpeed)) * 3) - (ySpeed * 6.15);
} else if ((yUp < ySpeed) && (man.sprite._xscale == manXScale)) {
man._rotation = ((yUp - ySpeed) * 3) + (ySpeed * 6.15);
}
}
}
if ((platforms.plats.hitTest(man._x + _x, ((man._y - 35) + yUp) + _y, true) or terrain1.hitTest(man._x + _x, ((man._y - 35) + yUp) + _y, true)) or terrain2.hitTest(man._x + _x, ((man._y - 35) + yUp) + _y, true)) {
yUp = -ySpeed;
}
while ((((xSpeed != 0) && (platforms.plats.hitTest((man._x + xSpeed) + _x, ((man._y - 35) + yUp) + _y, true))) or ((xSpeed != 0) && (terrain1.hitTest((man._x + xSpeed) + _x, ((man._y - 35) + yUp) + _y, true)))) or ((xSpeed != 0) && (terrain2.hitTest((man._x + xSpeed) + _x, ((man._y - 35) + yUp) + _y, true)))) {
man._x = man._x - xSpeed;
}
if (((yUp == 0) && (ySpeed == 0)) && (air == false)) {
yUp = -16;
ySpeed = 16;
}
if ((yUp < -50) && (ySpeed > 0)) {
xSpeed = 0;
yUp = -ySpeed;
} else if ((yUp < -50) && (ySpeed < 0)) {
yUp = -15;
}
noJump = false;
man._y = man._y + yUp;
collideVar = yUp - ySpeed;
while ((((((platforms.plats.hitTest((man._x + xSpeed) + _x, man._y + _y, true) && (xSpeed != 0)) or (platforms.plats.hitTest((man._x + xSpeed) + _x, man._y + _y, true) && (xSpeed != 0))) or (terrain1.hitTest((man._x + xSpeed) + _x, man._y + _y, true) && (xSpeed != 0))) or (terrain1.hitTest((man._x + xSpeed) + _x, man._y + _y, true) && (xSpeed != 0))) or (terrain2.hitTest((man._x + xSpeed) + _x, man._y + _y, true) && (xSpeed != 0))) or (terrain2.hitTest((man._x + xSpeed) + _x, man._y + _y, true) && (xSpeed != 0))) {
man._x = man._x - xSpeed;
}
while ((xSpeed == 0) && (platforms.plats.hitTest((man._x - 20) + _x, man._y + _y, true))) {
man._x = man._x + 21;
}
while ((xSpeed == 0) && (platforms.plats.hitTest((man._x + 20) + _x, man._y + _y, true))) {
man._x = man._x - 21;
}
}
function moveScreen() {
if (man._x > (Stage.width - 250)) {
platforms._x = platforms._x - runSpeed;
terrain1._x = terrain1._x - runSpeed;
terrain2._x = terrain2._x - runSpeed;
man._x = man._x - runSpeed;
theBackground._x = theBackground._x - (runSpeed / 8);
}
if (man._x < 250) {
platforms._x = platforms._x + runSpeed;
terrain1._x = terrain1._x + runSpeed;
terrain2._x = terrain2._x + runSpeed;
man._x = man._x + runSpeed;
theBackground._x = theBackground._x + (runSpeed / 8);
}
if (((man._y + ySpeed) + yUp) > (Stage.height - 150)) {
platforms._y = platforms._y - (ySpeed + yUp);
terrain1._y = terrain1._y - (ySpeed + yUp);
terrain2._y = terrain2._y - (ySpeed + yUp);
man._y = man._y - (ySpeed + yUp);
theBackground._y = theBackground._y - ((ySpeed + yUp) / 8);
}
if (((man._y + ySpeed) + yUp) < 150) {
platforms._y = platforms._y - (ySpeed + yUp);
terrain1._y = terrain1._y - (ySpeed + yUp);
terrain2._y = terrain2._y - (ySpeed + yUp);
man._y = man._y - (ySpeed + yUp);
theBackground._y = theBackground._y - ((ySpeed + yUp) / 8);
}
if (((man._y + ySpeed) + yUp) < 125) {
platforms._y = platforms._y - ((ySpeed + yUp) - 26);
terrain1._y = terrain1._y - ((ySpeed + yUp) - 26);
terrain2._y = terrain2._y - ((ySpeed + yUp) - 26);
man._y = man._y - ((ySpeed + yUp) - 26);
theBackground._y = theBackground._y - (((ySpeed + yUp) - 26) / 8);
}
if (((man._y + ySpeed) + yUp) > (Stage.height - 125)) {
platforms._y = platforms._y - ((ySpeed + yUp) + 26);
terrain1._y = terrain1._y - ((ySpeed + yUp) + 26);
terrain2._y = terrain2._y - ((ySpeed + yUp) + 26);
man._y = man._y - ((ySpeed + yUp) + 26);
theBackground._y = theBackground._y - (((ySpeed + yUp) + 26) / 8);
}
if ((((man._y + ySpeed) + yUp) < 139) && (Key.isDown(70))) {
platforms._y = platforms._y - ((ySpeed + yUp) - 15);
terrain1._y = terrain1._y - ((ySpeed + yUp) - 15);
terrain2._y = terrain2._y - ((ySpeed + yUp) - 15);
man._y = man._y - ((ySpeed + yUp) - 15);
theBackground._y = theBackground._y - (((ySpeed + yUp) - 15) / 8);
}
if ((((man._y + ySpeed) + yUp) > (Stage.height - 139)) && (Key.isDown(70))) {
platforms._y = platforms._y - ((ySpeed + yUp) + 15);
terrain1._y = terrain1._y - ((ySpeed + yUp) + 15);
terrain2._y = terrain2._y - ((ySpeed + yUp) + 15);
man._y = man._y - ((ySpeed + yUp) + 15);
theBackground._y = theBackground._y - (((ySpeed + yUp) + 15) / 8);
}
}
function lookAround() {
if (((Key.isDown(70) && (air == false)) && (!Key.isDown(65))) && (!Key.isDown(68))) {
imdrawing = false;
if (_xmouse > (Stage.width - 250)) {
platforms._x = platforms._x - runSpeed;
terrain1._x = terrain1._x - runSpeed;
terrain2._x = terrain2._x - runSpeed;
man._x = man._x - runSpeed;
theBackground._x = theBackground._x - (runSpeed / 8);
}
if (_xmouse < 250) {
platforms._x = platforms._x + runSpeed;
terrain1._x = terrain1._x + runSpeed;
terrain2._x = terrain2._x + runSpeed;
man._x = man._x + runSpeed;
theBackground._x = theBackground._x + (runSpeed / 8);
}
if (_ymouse < 139) {
platforms._y = platforms._y - ((ySpeed + yUp) - 15);
terrain1._y = terrain1._y - ((ySpeed + yUp) - 15);
terrain2._y = terrain2._y - ((ySpeed + yUp) - 15);
man._y = man._y - ((ySpeed + yUp) - 15);
theBackground._y = theBackground._y - (((ySpeed + yUp) - 15) / 8);
}
if (_ymouse > (Stage.height - 139)) {
platforms._y = platforms._y - ((ySpeed + yUp) + 15);
terrain1._y = terrain1._y - ((ySpeed + yUp) + 15);
terrain2._y = terrain2._y - ((ySpeed + yUp) + 15);
man._y = man._y - ((ySpeed + yUp) + 15);
theBackground._y = theBackground._y - (((ySpeed + yUp) + 15) / 8);
}
}
}
function customCursor() {
cursor.gotoAndStop(terrainVar);
linecolor.gotoAndStop(terrainVar);
cursor._x = _xmouse;
cursor._y = _ymouse;
cursor._rotation = cursor._rotation + 3;
}
function wallCling() {
if ((platforms.plats.hitTest(((man._x + xSpeed) + 16) + _x, (man._y - 60) + _y, true) && (air == true)) && (Key.isDown(39))) {
man.sprite._xscale = -manXScale;
wallClinging = true;
air = false;
ySpeed = 0;
doubleJump = 0;
} else if ((platforms.plats.hitTest(((man._x + xSpeed) - 16) + _x, man._y + _y, true) && (air == true)) && (Key.isDown(37))) {
man.sprite._xscale = manXScale;
wallClinging = true;
air = false;
ySpeed = 0;
doubleJump = 0;
}
if ((air == true) or Key.isDown(40)) {
wallClinging = false;
}
}
function manDodge() {
if (((Key.isDown(40) && (Key.isDown(68))) && (dodgeSwitch == false)) && (wallClinging == false)) {
dodging = "right";
dodgeSwitch = true;
} else if (((Key.isDown(40) && (Key.isDown(65))) && (dodgeSwitch == false)) && (wallClinging == false)) {
dodging = "left";
dodgeSwitch = true;
}
if (dodging == "right") {
man.sprite._xscale = manXScale;
man.sprite.gotoAndStop(5);
xSpeed = 25;
dodgeSwitch == true;
} else if (dodging == "left") {
man.sprite._xscale = -manXScale;
man.sprite.gotoAndStop(5);
xSpeed = -25;
dodgeSwitch == true;
}
if (!Key.isDown(40)) {
dodgeSwitch = false;
}
}
function spikesHit() {
if (((platforms.spikes.hitTest(man._x + _x, man._y + _y, true) or platforms.spikes2.hitTest(man._x + _x, man._y + _y, true)) or platforms.spikes3.hitTest(man._x + _x, man._y + _y, true)) or platforms.spikes4.hitTest(man._x + _x, man._y + _y, true)) {
gray_so.data.totalDeaths++;
currentDeaths++;
dead = true;
}
}
function kick() {
if (Key.isDown(32) && (kickKeySwitch == false)) {
attack = true;
kicking = true;
kickKeySwitch = true;
} else if (!Key.isDown(32)) {
kickKeySwitch = false;
}
}
function suicide() {
if (Key.isDown(13) && (suicideSwitch == false)) {
dead = true;
suicideSwitch = true;
}
if (!Key.isDown(13)) {
suicideSwitch = false;
}
}
function pauseGame() {
if (((Key.isDown(27) && (pauseSwitch == false)) && (gamePaused == false)) && (dead == false)) {
gamePaused = true;
imdrawing = false;
pauseScreen._visible = true;
inverter._visible = true;
pauseSwitch = true;
} else if ((Key.isDown(27) && (pauseSwitch == false)) && (gamePaused == true)) {
gamePaused = false;
pauseScreen._visible = false;
inverter._visible = false;
pauseSwitch = true;
} else if (!Key.isDown(27)) {
pauseSwitch = false;
}
}
function cheats() {
if (mudkipcheat == true) {
man.sprite._visible = false;
man.mudkip._visible = true;
man.mage._visible = false;
if ((man.mudkip._currentframe != 4) && (attack == false)) {
if (air == false) {
if ((Key.isDown(68) == false) && (Key.isDown(65) == false)) {
man.mudkip.gotoAndStop(1);
} else if ((Key.isDown(68) == true) or (Key.isDown(65) == true)) {
if (Key.isDown(68)) {
man.mudkip._xscale = mudkipXScale;
} else if (Key.isDown(65)) {
man.mudkip._xscale = -mudkipXScale;
}
man.mudkip.gotoAndStop(2);
}
} else if (air == true) {
man.mudkip.gotoAndStop(3);
}
if (Key.isDown(32) && (kickKeySwitch == false)) {
if (man.mudkip.inSprite.head._currentframe == 1) {
mudkipMouthOpen = true;
} else if (man.mudkip.inSprite.head._currentframe == 2) {
mudkipMouthOpen = false;
}
}
if (mudkipMouthOpen == true) {
man.mudkip.inSprite.head.gotoAndStop(2);
} else {
man.mudkip.inSprite.head.gotoAndStop(1);
}
}
} else if (magecheat == true) {
man.sprite._visible = false;
man.mudkip._visible = false;
man.mage._visible = true;
if ((man.mage._currentframe != 4) && (attack == false)) {
if (air == false) {
if ((Key.isDown(68) == false) && (Key.isDown(65) == false)) {
man.mage.gotoAndStop(1);
} else if ((Key.isDown(68) == true) or (Key.isDown(65) == true)) {
if (Key.isDown(68)) {
man.mage._xscale = mageXScale;
} else if (Key.isDown(65)) {
man.mage._xscale = -mageXScale;
}
man.mage.gotoAndStop(2);
}
} else if (air == true) {
man.mage.gotoAndStop(3);
}
}
} else if ((mudkipcheat == false) && (magecheat == false)) {
man.sprite._visible = true;
man.mudkip._visible = false;
man.mage._visible = false;
}
}
function achievementsFunc() {
if ((gray_so.data.totalDeaths == 100) && (gray_so.data.deathachievementplayed != true)) {
achpopup.dontfearthereaper._visible = true;
gray_so.data.deathachievementplayed = true;
achpopup.gotoAndPlay("start");
}
if ((gray_so.data.totalLines > 900) && (gray_so.data.over9000achievementplayed != true)) {
achpopup.over9000._visible = true;
gray_so.data.over9000achievementplayed = true;
achpopup.gotoAndPlay("start");
}
}
function timerCounter() {
timerPart++;
if (timerPart == 40) {
timer++;
gray_so.data.totalTimer++;
timerPart = 0;
}
}
stop();
pauseScreen._visible = false;
inverter._visible = false;
Mouse.hide();
platx = platforms._x;
platy = platforms._y;
backx = theBackground._x;
backy = theBackground._y;
manx = man._x;
many = man._y;
dead = false;
gamePaused = false;
dodging = false;
var attack = false;
var kicking = false;
var manstate = 1;
var runSpeed = 15;
var xSpeed = 0;
var ySpeed = 0;
var jumping = false;
var jumpKeySwitch = false;
var mudkipXScale = man.mudkip._xscale;
var mageXScale = man.mage._xscale;
var manXScale = man.sprite._xscale;
var gravity = 2;
var color = new Color("_root.man");
var imdrawing = false;
var terrainVar = 1;
Frame 28
function onMouseDown() {
if ((terrainVar == 1) && (gamePaused == false)) {
createEmptyMovieClip("terrain1", man.getDepth() - 1);
terrain1.lineStyle(40, 3355443, 100);
if (imdrawing == false) {
terrain1.moveTo(_xmouse, _ymouse);
imdrawing = true;
xMouseStart = _xmouse;
yMouseStart = _ymouse;
}
} else if ((terrainVar == 2) && (gamePaused == false)) {
createEmptyMovieClip("terrain2", man.getDepth() - 2);
terrain2.lineStyle(40, 6710886, 100);
if (imdrawing == false) {
terrain2.moveTo(_xmouse, _ymouse);
imdrawing = true;
xMouseStart = _xmouse;
yMouseStart = _ymouse;
}
}
}
function Drawing() {
if (((terrainVar == 1) && (imdrawing == true)) && (!man.nodrawhitbox.hitTest(_xmouse, _ymouse, true))) {
if (((air == false) && (!Key.isDown(65))) && (!Key.isDown(68))) {
terrain1.lineTo(_xmouse, _ymouse);
}
} else if (((terrainVar == 2) && (imdrawing == true)) && (!man.nodrawhitbox.hitTest(_xmouse, _ymouse, true))) {
if (((air == false) && (!Key.isDown(65))) && (!Key.isDown(68))) {
terrain2.lineTo(_xmouse, _ymouse);
}
}
if (imdrawing == false) {
lineDrawed = false;
}
if (imdrawing == true) {
if ((((_xmouse != xMouseStart) && (lineDrawed == false)) && (terrainVar == 1)) or (((_ymouse != yMouseStart) && (lineDrawed == false)) && (terrainVar == 1))) {
line1Drawn = true;
lineDrawed = true;
gray_so.data.totalLines++;
levelLinesPlayer++;
} else if (((_xmouse == xMouseStart) && (_ymouse == yMouseStart)) && (terrainVar == 1)) {
line1Drawn = false;
lineDrawed = false;
}
if ((((_xmouse != xMouseStart) && (lineDrawed == false)) && (terrainVar == 2)) or (((_ymouse != yMouseStart) && (lineDrawed == false)) && (terrainVar == 2))) {
line2Drawn = true;
lineDrawed = true;
gray_so.data.totalLines++;
levelLinesPlayer++;
} else if (((_xmouse == xMouseStart) && (_ymouse == yMouseStart)) && (terrainVar == 2)) {
line2Drawn = false;
lineDrawed = false;
}
if ((((air == true) or Key.isDown(65)) or Key.isDown(68)) or (gamePaused == true)) {
imdrawing = false;
}
if (man.nodrawhitbox.hitTest(_xmouse, _ymouse, true)) {
imdrawing = false;
}
if ((((_xmouse > 750) or (_xmouse < 0)) or (_ymouse > 500)) or (_ymouse < 0)) {
imdrawing = false;
}
}
if (Key.isDown(69) && (terrainKeySwitch == false)) {
terrainVar = terrainVar + 1;
terrainKeySwitch = true;
} else if (!Key.isDown(69)) {
terrainKeySwitch = false;
}
if (terrainVar > 2) {
terrainVar = 1;
}
}
function switches() {
if ((platforms.switch1.hitTest(man._x + _x, man._y + _y, true) or ((platforms.switch1.hitTest(terrain1) == true) && (line1Drawn == true))) or ((platforms.switch1.hitTest(terrain2) == true) && (line2Drawn == true))) {
switchdoor1open = true;
} else if (!platforms.switch1.hitTest(man._x + _x, man._y + _y, true)) {
switchdoor1open = false;
}
if (switchdoor1open == true) {
platforms.switch1.gotoAndStop(2);
if (platforms.plats.switchdoor1._rotation < 180) {
platforms.plats.switchdoor1._rotation = platforms.plats.switchdoor1._rotation + 3;
}
} else if (switchdoor1open == false) {
platforms.switch1.gotoAndStop(1);
if (platforms.plats.switchdoor1._rotation > 90) {
platforms.plats.switchdoor1._rotation = platforms.plats.switchdoor1._rotation - 3;
}
}
if ((platforms.switch2.hitTest(man._x + _x, man._y + _y, true) or ((platforms.switch2.hitTest(terrain1) == true) && (line1Drawn == true))) or ((platforms.switch2.hitTest(terrain2) == true) && (line2Drawn == true))) {
switchdoor2open = true;
} else if (!platforms.switch2.hitTest(man._x + _x, man._y + _y, true)) {
switchdoor2open = false;
}
if (switchdoor2open == true) {
platforms.switch2.gotoAndStop(2);
if (platforms.plats.switchdoor2._rotation < 0) {
platforms.plats.switchdoor2._rotation = platforms.plats.switchdoor2._rotation + 3;
}
} else if (switchdoor2open == false) {
platforms.switch2.gotoAndStop(1);
if (platforms.plats.switchdoor2._rotation > -90) {
platforms.plats.switchdoor2._rotation = platforms.plats.switchdoor2._rotation - 3;
}
}
if ((platforms.switch3.hitTest(man._x + _x, man._y + _y, true) or ((platforms.switch3.hitTest(terrain1) == true) && (line1Drawn == true))) or ((platforms.switch3.hitTest(terrain2) == true) && (line2Drawn == true))) {
switchdoor3open = true;
} else if (!platforms.switch3.hitTest(man._x + _x, man._y + _y, true)) {
switchdoor3open = false;
}
if (switchdoor3open == true) {
platforms.switch3.gotoAndStop(2);
if (platforms.plats.switchdoor3._rotation > -180) {
platforms.plats.switchdoor3._rotation = platforms.plats.switchdoor3._rotation - 3;
}
} else if (switchdoor3open == false) {
platforms.switch3.gotoAndStop(1);
if (platforms.plats.switchdoor3._rotation < -90) {
platforms.plats.switchdoor3._rotation = platforms.plats.switchdoor3._rotation + 3;
}
}
}
function doorHit() {
if (platforms.door.hitTest(man._x + _x, man._y + _y, true)) {
gamePaused = true;
if (fader._alpha < 100) {
fader._alpha = fader._alpha + 5;
} else if (((fader._alpha >= 100) && (noJumpMode == false)) && (leastLinesMode == false)) {
man.sprite._xscale = manXScale;
man.mudkip._xscale = mudkipXScale;
man.mage._xscale = mageXScale;
createEmptyMovieClip("terrain1", man.getDepth() - 1);
createEmptyMovieClip("terrain2", man.getDepth() - 2);
man._x = 375;
man._y = 250;
if (gray_so.data.lvlsavailable == 13) {
gray_so.data.lvlsavailable++;
}
gotoAndStop ("lvl14");
} else if (((fader._alpha >= 100) && (noJumpMode == true)) && (leastLinesMode == false)) {
gray_so.data.lvl13noJump = true;
gotoAndStop ("noJumps");
} else if (((fader._alpha >= 100) && (leastLinesMode == true)) && (noJumpMode == false)) {
if (levelLinesPlayer < gray_so.data.lvl13leastLinesPlayer) {
gray_so.data.lvl13leastLinesPlayer = levelLinesPlayer;
}
gotoAndStop ("leastLines");
}
}
}
function onMouseUp() {
imdrawing = false;
}
function onEnterFrame() {
displayText();
wallClinging = false;
xVar = man._x;
yVar = man._y;
testVar = ySpeed + yUp;
music();
cheats();
achievementsFunc();
pauseGame();
customCursor();
doorHit();
if (gamePaused == false) {
Drawing();
timerCounter();
man._x = man._x + xSpeed;
man._y = man._y + ySpeed;
manCollision();
moveScreen();
lookAround();
if (dead == false) {
if (fader._alpha > 0) {
fader._alpha = fader._alpha - 2;
}
kick();
manJump(-20);
managemanSprite();
onGround();
manageColor();
suicide();
spikesHit();
switches();
if ((Key.isDown(68) && (dodging == false)) && (wallClinging == false)) {
xSpeed = runSpeed;
} else if ((Key.isDown(65) && (dodging == false)) && (wallClinging == false)) {
xSpeed = -runSpeed;
} else if (((!Key.isDown(65)) && (!Key.isDown(68))) && (dodging == false)) {
xSpeed = 0;
}
} else {
man.sprite.gotoAndStop(4);
man.mudkip.gotoAndStop(4);
man.mage.gotoAndStop(4);
xSpeed = 0;
}
if (((man._x + xSpeed) > Stage.width) or ((man._x + xSpeed) < 0)) {
xSpeed = xSpeed - xSpeed;
} else if (dead == true) {
levelLinesPlayer = 0;
if (fader._alpha < 100) {
fader._alpha = fader._alpha + 5;
}
if (fader._alpha >= 100) {
dead = false;
deathsThisTime++;
man.sprite.gotoAndStop(1);
man.mudkip.gotoAndStop(1);
man.mage.gotoAndStop(1);
platforms._x = platx;
platforms._y = platy;
theBackground._x = backx;
theBackground._y = backy;
man._x = manx;
man._y = many;
createEmptyMovieClip("terrain1", man.getDepth() - 1);
createEmptyMovieClip("terrain2", man.getDepth() - 2);
}
}
}
}
function managemanSprite() {
if ((man.sprite._currentframe != 4) && (attack == false)) {
if ((air == false) && (wallClinging == false)) {
if (((Key.isDown(68) == false) && (Key.isDown(65) == false)) && (dodging == false)) {
man.sprite.gotoAndStop(1);
} else if (((Key.isDown(68) == true) && (dodging == false)) or ((Key.isDown(65) == true) && (dodging == false))) {
if (Key.isDown(68) && (dodging == false)) {
man.sprite._xscale = manXScale;
} else if (Key.isDown(65) && (dodging == false)) {
man.sprite._xscale = -manXScale;
}
man.sprite.gotoAndStop(2);
}
} else if (((air == true) && (dodging == false)) && (wallClinging == false)) {
man.sprite.gotoAndStop(3);
} else if (wallClinging == true) {
man.sprite.gotoAndStop(6);
}
} else if ((man.sprite._currentframe != 4) && (attack == true)) {
if (kicking == true) {
man.sprite.gotoAndStop(7);
}
}
}
function manageColor() {
if (man.sprite._xscale == (-manXScale)) {
man.sprite.bwhite.blendMode = "invert";
} else if (man.sprite._xscale == manXScale) {
man.sprite.bwhite.blendMode = "alpha";
}
}
function manJump(jumpHeight) {
if ((((((Key.isDown(87) && (noJumpMode == false)) && (!Key.isDown(70))) && (jumpKeySwitch == false)) && (doubleJump < 2)) && (noJump == false)) && (ySpeed > -1)) {
gray_so.data.totalJumps++;
jumpKeySwitch = true;
jumping = true;
doubleJump++;
air = true;
yUp = 0;
wallClinging = false;
gravity = 2;
man.sprite.inSprite.play();
man.sprite.bwhite.play();
man.sprite.outline.play();
if (ySpeed > -5) {
ySpeed = jumpHeight;
}
if ((doubleJump >= 2) && (ySpeed < -5)) {
ySpeed = jumpHeight;
}
} else if (Key.isDown(87) == false) {
jumpKeySwitch = false;
}
if ((jumping == true) && (ySpeed > 0)) {
jumping = false;
}
}
function onGround() {
if (((platforms.plats.hitTest(man._x + _x, ((man._y + 38) - yUp) + _y, true) or terrain1.hitTest(man._x + _x, ((man._y + 38) - yUp) + _y, true)) or terrain2.hitTest(man._x + _x, ((man._y + 38) - yUp) + _y, true)) or (wallClinging == true)) {
gravity = 2;
air = false;
doubleJump = 1;
} else {
air = true;
man._rotation = 0;
if (ySpeed < 15) {
ySpeed = ySpeed + gravity;
}
}
}
function manCollision() {
yUp = 0;
while ((platforms.plats.hitTest(man._x + _x, (((man._y + 35) + yUp) + _y) - 4, true) or terrain1.hitTest(man._x + _x, (((man._y + 35) + yUp) + _y) - 4, true)) or terrain2.hitTest(man._x + _x, (((man._y + 35) + yUp) + _y) - 4, true)) {
yUp--;
if (((Key.isDown(65) && (air == false)) && (jumping == false)) or ((Key.isDown(68) && (air == false)) && (jumping == false))) {
if ((yUp < ySpeed) && (man.sprite._xscale == (-manXScale))) {
man._rotation = ((-(yUp - ySpeed)) * 3) - (ySpeed * 6.15);
} else if ((yUp > ySpeed) && (man.sprite._xscale == manXScale)) {
man._rotation = ((yUp - ySpeed) * 3) + (ySpeed * 6.15);
} else if ((yUp > ySpeed) && (man.sprite._xscale == (-manXScale))) {
man._rotation = ((-(yUp - ySpeed)) * 3) - (ySpeed * 6.15);
} else if ((yUp < ySpeed) && (man.sprite._xscale == manXScale)) {
man._rotation = ((yUp - ySpeed) * 3) + (ySpeed * 6.15);
}
}
}
if ((platforms.plats.hitTest(man._x + _x, ((man._y - 35) + yUp) + _y, true) or terrain1.hitTest(man._x + _x, ((man._y - 35) + yUp) + _y, true)) or terrain2.hitTest(man._x + _x, ((man._y - 35) + yUp) + _y, true)) {
yUp = -ySpeed;
}
while ((((xSpeed != 0) && (platforms.plats.hitTest((man._x + xSpeed) + _x, ((man._y - 35) + yUp) + _y, true))) or ((xSpeed != 0) && (terrain1.hitTest((man._x + xSpeed) + _x, ((man._y - 35) + yUp) + _y, true)))) or ((xSpeed != 0) && (terrain2.hitTest((man._x + xSpeed) + _x, ((man._y - 35) + yUp) + _y, true)))) {
man._x = man._x - xSpeed;
}
if (((yUp == 0) && (ySpeed == 0)) && (air == false)) {
yUp = -16;
ySpeed = 16;
}
if ((yUp < -50) && (ySpeed > 0)) {
xSpeed = 0;
yUp = -ySpeed;
} else if ((yUp < -50) && (ySpeed < 0)) {
yUp = -15;
}
noJump = false;
man._y = man._y + yUp;
collideVar = yUp - ySpeed;
while ((((((platforms.plats.hitTest((man._x + xSpeed) + _x, man._y + _y, true) && (xSpeed != 0)) or (platforms.plats.hitTest((man._x + xSpeed) + _x, man._y + _y, true) && (xSpeed != 0))) or (terrain1.hitTest((man._x + xSpeed) + _x, man._y + _y, true) && (xSpeed != 0))) or (terrain1.hitTest((man._x + xSpeed) + _x, man._y + _y, true) && (xSpeed != 0))) or (terrain2.hitTest((man._x + xSpeed) + _x, man._y + _y, true) && (xSpeed != 0))) or (terrain2.hitTest((man._x + xSpeed) + _x, man._y + _y, true) && (xSpeed != 0))) {
man._x = man._x - xSpeed;
}
while ((xSpeed == 0) && (platforms.plats.hitTest((man._x - 20) + _x, man._y + _y, true))) {
man._x = man._x + 21;
}
while ((xSpeed == 0) && (platforms.plats.hitTest((man._x + 20) + _x, man._y + _y, true))) {
man._x = man._x - 21;
}
}
function moveScreen() {
if (man._x > (Stage.width - 250)) {
platforms._x = platforms._x - runSpeed;
terrain1._x = terrain1._x - runSpeed;
terrain2._x = terrain2._x - runSpeed;
man._x = man._x - runSpeed;
theBackground._x = theBackground._x - (runSpeed / 8);
}
if (man._x < 250) {
platforms._x = platforms._x + runSpeed;
terrain1._x = terrain1._x + runSpeed;
terrain2._x = terrain2._x + runSpeed;
man._x = man._x + runSpeed;
theBackground._x = theBackground._x + (runSpeed / 8);
}
if (((man._y + ySpeed) + yUp) > (Stage.height - 150)) {
platforms._y = platforms._y - (ySpeed + yUp);
terrain1._y = terrain1._y - (ySpeed + yUp);
terrain2._y = terrain2._y - (ySpeed + yUp);
man._y = man._y - (ySpeed + yUp);
theBackground._y = theBackground._y - ((ySpeed + yUp) / 8);
}
if (((man._y + ySpeed) + yUp) < 150) {
platforms._y = platforms._y - (ySpeed + yUp);
terrain1._y = terrain1._y - (ySpeed + yUp);
terrain2._y = terrain2._y - (ySpeed + yUp);
man._y = man._y - (ySpeed + yUp);
theBackground._y = theBackground._y - ((ySpeed + yUp) / 8);
}
if (((man._y + ySpeed) + yUp) < 125) {
platforms._y = platforms._y - ((ySpeed + yUp) - 26);
terrain1._y = terrain1._y - ((ySpeed + yUp) - 26);
terrain2._y = terrain2._y - ((ySpeed + yUp) - 26);
man._y = man._y - ((ySpeed + yUp) - 26);
theBackground._y = theBackground._y - (((ySpeed + yUp) - 26) / 8);
}
if (((man._y + ySpeed) + yUp) > (Stage.height - 125)) {
platforms._y = platforms._y - ((ySpeed + yUp) + 26);
terrain1._y = terrain1._y - ((ySpeed + yUp) + 26);
terrain2._y = terrain2._y - ((ySpeed + yUp) + 26);
man._y = man._y - ((ySpeed + yUp) + 26);
theBackground._y = theBackground._y - (((ySpeed + yUp) + 26) / 8);
}
if ((((man._y + ySpeed) + yUp) < 139) && (Key.isDown(70))) {
platforms._y = platforms._y - ((ySpeed + yUp) - 15);
terrain1._y = terrain1._y - ((ySpeed + yUp) - 15);
terrain2._y = terrain2._y - ((ySpeed + yUp) - 15);
man._y = man._y - ((ySpeed + yUp) - 15);
theBackground._y = theBackground._y - (((ySpeed + yUp) - 15) / 8);
}
if ((((man._y + ySpeed) + yUp) > (Stage.height - 139)) && (Key.isDown(70))) {
platforms._y = platforms._y - ((ySpeed + yUp) + 15);
terrain1._y = terrain1._y - ((ySpeed + yUp) + 15);
terrain2._y = terrain2._y - ((ySpeed + yUp) + 15);
man._y = man._y - ((ySpeed + yUp) + 15);
theBackground._y = theBackground._y - (((ySpeed + yUp) + 15) / 8);
}
}
function lookAround() {
if (((Key.isDown(70) && (air == false)) && (!Key.isDown(65))) && (!Key.isDown(68))) {
imdrawing = false;
if (_xmouse > (Stage.width - 250)) {
platforms._x = platforms._x - runSpeed;
terrain1._x = terrain1._x - runSpeed;
terrain2._x = terrain2._x - runSpeed;
man._x = man._x - runSpeed;
theBackground._x = theBackground._x - (runSpeed / 8);
}
if (_xmouse < 250) {
platforms._x = platforms._x + runSpeed;
terrain1._x = terrain1._x + runSpeed;
terrain2._x = terrain2._x + runSpeed;
man._x = man._x + runSpeed;
theBackground._x = theBackground._x + (runSpeed / 8);
}
if (_ymouse < 139) {
platforms._y = platforms._y - ((ySpeed + yUp) - 15);
terrain1._y = terrain1._y - ((ySpeed + yUp) - 15);
terrain2._y = terrain2._y - ((ySpeed + yUp) - 15);
man._y = man._y - ((ySpeed + yUp) - 15);
theBackground._y = theBackground._y - (((ySpeed + yUp) - 15) / 8);
}
if (_ymouse > (Stage.height - 139)) {
platforms._y = platforms._y - ((ySpeed + yUp) + 15);
terrain1._y = terrain1._y - ((ySpeed + yUp) + 15);
terrain2._y = terrain2._y - ((ySpeed + yUp) + 15);
man._y = man._y - ((ySpeed + yUp) + 15);
theBackground._y = theBackground._y - (((ySpeed + yUp) + 15) / 8);
}
}
}
function customCursor() {
cursor.gotoAndStop(terrainVar);
linecolor.gotoAndStop(terrainVar);
cursor._x = _xmouse;
cursor._y = _ymouse;
cursor._rotation = cursor._rotation + 3;
}
function wallCling() {
if ((platforms.plats.hitTest(((man._x + xSpeed) + 16) + _x, (man._y - 60) + _y, true) && (air == true)) && (Key.isDown(39))) {
man.sprite._xscale = -manXScale;
wallClinging = true;
air = false;
ySpeed = 0;
doubleJump = 0;
} else if ((platforms.plats.hitTest(((man._x + xSpeed) - 16) + _x, man._y + _y, true) && (air == true)) && (Key.isDown(37))) {
man.sprite._xscale = manXScale;
wallClinging = true;
air = false;
ySpeed = 0;
doubleJump = 0;
}
if ((air == true) or Key.isDown(40)) {
wallClinging = false;
}
}
function manDodge() {
if (((Key.isDown(40) && (Key.isDown(68))) && (dodgeSwitch == false)) && (wallClinging == false)) {
dodging = "right";
dodgeSwitch = true;
} else if (((Key.isDown(40) && (Key.isDown(65))) && (dodgeSwitch == false)) && (wallClinging == false)) {
dodging = "left";
dodgeSwitch = true;
}
if (dodging == "right") {
man.sprite._xscale = manXScale;
man.sprite.gotoAndStop(5);
xSpeed = 25;
dodgeSwitch == true;
} else if (dodging == "left") {
man.sprite._xscale = -manXScale;
man.sprite.gotoAndStop(5);
xSpeed = -25;
dodgeSwitch == true;
}
if (!Key.isDown(40)) {
dodgeSwitch = false;
}
}
function spikesHit() {
if (((platforms.spikes.hitTest(man._x + _x, man._y + _y, true) or platforms.spikes2.hitTest(man._x + _x, man._y + _y, true)) or platforms.spikes3.hitTest(man._x + _x, man._y + _y, true)) or platforms.spikes4.hitTest(man._x + _x, man._y + _y, true)) {
gray_so.data.totalDeaths++;
currentDeaths++;
dead = true;
}
}
function kick() {
if (Key.isDown(32) && (kickKeySwitch == false)) {
attack = true;
kicking = true;
kickKeySwitch = true;
} else if (!Key.isDown(32)) {
kickKeySwitch = false;
}
}
function suicide() {
if (Key.isDown(13) && (suicideSwitch == false)) {
dead = true;
suicideSwitch = true;
}
if (!Key.isDown(13)) {
suicideSwitch = false;
}
}
function pauseGame() {
if (((Key.isDown(27) && (pauseSwitch == false)) && (gamePaused == false)) && (dead == false)) {
gamePaused = true;
imdrawing = false;
pauseScreen._visible = true;
inverter._visible = true;
pauseSwitch = true;
} else if ((Key.isDown(27) && (pauseSwitch == false)) && (gamePaused == true)) {
gamePaused = false;
pauseScreen._visible = false;
inverter._visible = false;
pauseSwitch = true;
} else if (!Key.isDown(27)) {
pauseSwitch = false;
}
}
function cheats() {
if (mudkipcheat == true) {
man.sprite._visible = false;
man.mudkip._visible = true;
man.mage._visible = false;
if ((man.mudkip._currentframe != 4) && (attack == false)) {
if (air == false) {
if ((Key.isDown(68) == false) && (Key.isDown(65) == false)) {
man.mudkip.gotoAndStop(1);
} else if ((Key.isDown(68) == true) or (Key.isDown(65) == true)) {
if (Key.isDown(68)) {
man.mudkip._xscale = mudkipXScale;
} else if (Key.isDown(65)) {
man.mudkip._xscale = -mudkipXScale;
}
man.mudkip.gotoAndStop(2);
}
} else if (air == true) {
man.mudkip.gotoAndStop(3);
}
if (Key.isDown(32) && (kickKeySwitch == false)) {
if (man.mudkip.inSprite.head._currentframe == 1) {
mudkipMouthOpen = true;
} else if (man.mudkip.inSprite.head._currentframe == 2) {
mudkipMouthOpen = false;
}
}
if (mudkipMouthOpen == true) {
man.mudkip.inSprite.head.gotoAndStop(2);
} else {
man.mudkip.inSprite.head.gotoAndStop(1);
}
}
} else if (magecheat == true) {
man.sprite._visible = false;
man.mudkip._visible = false;
man.mage._visible = true;
if ((man.mage._currentframe != 4) && (attack == false)) {
if (air == false) {
if ((Key.isDown(68) == false) && (Key.isDown(65) == false)) {
man.mage.gotoAndStop(1);
} else if ((Key.isDown(68) == true) or (Key.isDown(65) == true)) {
if (Key.isDown(68)) {
man.mage._xscale = mageXScale;
} else if (Key.isDown(65)) {
man.mage._xscale = -mageXScale;
}
man.mage.gotoAndStop(2);
}
} else if (air == true) {
man.mage.gotoAndStop(3);
}
}
} else if ((mudkipcheat == false) && (magecheat == false)) {
man.sprite._visible = true;
man.mudkip._visible = false;
man.mage._visible = false;
}
}
function achievementsFunc() {
if ((gray_so.data.totalDeaths == 100) && (gray_so.data.deathachievementplayed != true)) {
achpopup.dontfearthereaper._visible = true;
gray_so.data.deathachievementplayed = true;
achpopup.gotoAndPlay("start");
}
if ((gray_so.data.totalLines > 900) && (gray_so.data.over9000achievementplayed != true)) {
achpopup.over9000._visible = true;
gray_so.data.over9000achievementplayed = true;
achpopup.gotoAndPlay("start");
}
}
function timerCounter() {
timerPart++;
if (timerPart == 40) {
timer++;
gray_so.data.totalTimer++;
timerPart = 0;
}
}
stop();
pauseScreen._visible = false;
inverter._visible = false;
Mouse.hide();
platx = platforms._x;
platy = platforms._y;
backx = theBackground._x;
backy = theBackground._y;
manx = man._x;
many = man._y;
dead = false;
gamePaused = false;
dodging = false;
var attack = false;
var kicking = false;
var manstate = 1;
var runSpeed = 15;
var xSpeed = 0;
var ySpeed = 0;
var jumping = false;
var jumpKeySwitch = false;
var mudkipXScale = man.mudkip._xscale;
var mageXScale = man.mage._xscale;
var manXScale = man.sprite._xscale;
var gravity = 2;
var color = new Color("_root.man");
var imdrawing = false;
var terrainVar = 1;
Frame 29
function onMouseDown() {
if ((terrainVar == 1) && (gamePaused == false)) {
createEmptyMovieClip("terrain1", man.getDepth() - 1);
terrain1.lineStyle(40, 3355443, 100);
if (imdrawing == false) {
terrain1.moveTo(_xmouse, _ymouse);
imdrawing = true;
xMouseStart = _xmouse;
yMouseStart = _ymouse;
}
} else if ((terrainVar == 2) && (gamePaused == false)) {
createEmptyMovieClip("terrain2", man.getDepth() - 2);
terrain2.lineStyle(40, 6710886, 100);
if (imdrawing == false) {
terrain2.moveTo(_xmouse, _ymouse);
imdrawing = true;
xMouseStart = _xmouse;
yMouseStart = _ymouse;
}
}
}
function Drawing() {
if (((terrainVar == 1) && (imdrawing == true)) && (!man.nodrawhitbox.hitTest(_xmouse, _ymouse, true))) {
if (((air == false) && (!Key.isDown(65))) && (!Key.isDown(68))) {
terrain1.lineTo(_xmouse, _ymouse);
}
} else if (((terrainVar == 2) && (imdrawing == true)) && (!man.nodrawhitbox.hitTest(_xmouse, _ymouse, true))) {
if (((air == false) && (!Key.isDown(65))) && (!Key.isDown(68))) {
terrain2.lineTo(_xmouse, _ymouse);
}
}
if (imdrawing == false) {
lineDrawed = false;
}
if (imdrawing == true) {
if ((((_xmouse != xMouseStart) && (lineDrawed == false)) && (terrainVar == 1)) or (((_ymouse != yMouseStart) && (lineDrawed == false)) && (terrainVar == 1))) {
line1Drawn = true;
lineDrawed = true;
gray_so.data.totalLines++;
levelLinesPlayer++;
} else if (((_xmouse == xMouseStart) && (_ymouse == yMouseStart)) && (terrainVar == 1)) {
line1Drawn = false;
lineDrawed = false;
}
if ((((_xmouse != xMouseStart) && (lineDrawed == false)) && (terrainVar == 2)) or (((_ymouse != yMouseStart) && (lineDrawed == false)) && (terrainVar == 2))) {
line2Drawn = true;
lineDrawed = true;
gray_so.data.totalLines++;
levelLinesPlayer++;
} else if (((_xmouse == xMouseStart) && (_ymouse == yMouseStart)) && (terrainVar == 2)) {
line2Drawn = false;
lineDrawed = false;
}
if ((((air == true) or Key.isDown(65)) or Key.isDown(68)) or (gamePaused == true)) {
imdrawing = false;
}
if (man.nodrawhitbox.hitTest(_xmouse, _ymouse, true)) {
imdrawing = false;
}
if ((((_xmouse > 750) or (_xmouse < 0)) or (_ymouse > 500)) or (_ymouse < 0)) {
imdrawing = false;
}
}
if (Key.isDown(69) && (terrainKeySwitch == false)) {
terrainVar = terrainVar + 1;
terrainKeySwitch = true;
} else if (!Key.isDown(69)) {
terrainKeySwitch = false;
}
if (terrainVar > 2) {
terrainVar = 1;
}
}
function switches() {
if ((platforms.switch1.hitTest(man._x + _x, man._y + _y, true) or ((platforms.switch1.hitTest(terrain1) == true) && (line1Drawn == true))) or ((platforms.switch1.hitTest(terrain2) == true) && (line2Drawn == true))) {
switchdoor1open = true;
} else if (!platforms.switch1.hitTest(man._x + _x, man._y + _y, true)) {
switchdoor1open = false;
}
if (switchdoor1open == true) {
platforms.switch1.gotoAndStop(2);
if (platforms.plats.switchdoor1._rotation > 0) {
platforms.plats.switchdoor1._rotation = platforms.plats.switchdoor1._rotation - 3;
}
} else if (switchdoor1open == false) {
platforms.switch1.gotoAndStop(1);
if (platforms.plats.switchdoor1._rotation < 90) {
platforms.plats.switchdoor1._rotation = platforms.plats.switchdoor1._rotation + 3;
}
}
if ((platforms.switch2.hitTest(man._x + _x, man._y + _y, true) or ((platforms.switch2.hitTest(terrain1) == true) && (line1Drawn == true))) or ((platforms.switch2.hitTest(terrain2) == true) && (line2Drawn == true))) {
switchdoor2open = true;
} else if (!platforms.switch2.hitTest(man._x + _x, man._y + _y, true)) {
switchdoor2open = false;
}
if (switchdoor2open == true) {
platforms.switch2.gotoAndStop(2);
if (platforms.plats.switchdoor2._rotation < -90) {
platforms.plats.switchdoor2._rotation = platforms.plats.switchdoor2._rotation + 3;
}
} else if (switchdoor2open == false) {
platforms.switch2.gotoAndStop(1);
if (platforms.plats.switchdoor2._rotation > -180) {
platforms.plats.switchdoor2._rotation = platforms.plats.switchdoor2._rotation - 3;
}
}
if ((platforms.switch3.hitTest(man._x + _x, man._y + _y, true) or ((platforms.switch3.hitTest(terrain1) == true) && (line1Drawn == true))) or ((platforms.switch3.hitTest(terrain2) == true) && (line2Drawn == true))) {
switchdoor3open = true;
} else if (!platforms.switch3.hitTest(man._x + _x, man._y + _y, true)) {
switchdoor3open = false;
}
if (switchdoor3open == true) {
platforms.switch3.gotoAndStop(2);
if (platforms.plats.switchdoor3._rotation > 45) {
platforms.plats.switchdoor3._rotation = platforms.plats.switchdoor3._rotation - 3;
}
} else if (switchdoor3open == false) {
platforms.switch3.gotoAndStop(1);
if (platforms.plats.switchdoor3._rotation < 90) {
platforms.plats.switchdoor3._rotation = platforms.plats.switchdoor3._rotation + 3;
}
}
}
function doorHit() {
if (platforms.door.hitTest(man._x + _x, man._y + _y, true)) {
gamePaused = true;
if (fader._alpha < 100) {
fader._alpha = fader._alpha + 5;
} else if (((fader._alpha >= 100) && (noJumpMode == false)) && (leastLinesMode == false)) {
man.sprite._xscale = manXScale;
man.mudkip._xscale = mudkipXScale;
man.mage._xscale = mageXScale;
createEmptyMovieClip("terrain1", man.getDepth() - 1);
createEmptyMovieClip("terrain2", man.getDepth() - 2);
man._x = 375;
man._y = 250;
if (gray_so.data.lvlsavailable == 14) {
gray_so.data.lvlsavailable++;
}
if (deathsThisTime == 0) {
gray_so.data.stillaliveunlocked = true;
achpopup.stillalive._visible = true;
achpopup.gotoAndPlay("start");
}
if (mudkipcheat == true) {
gray_so.data.soiherdunlocked = true;
achpopup.soiherd._visible = true;
achpopup.gotoAndPlay("start");
}
if (raveLights._visible == true) {
gray_so.data.ravemeisterunlocked = true;
achpopup.ravemeister._visible = true;
achpopup.gotoAndPlay("start");
}
if (timer < gray_so.data.bestTime) {
gray_so.data.bestTime = timer;
}
gotoAndStop ("end");
} else if (((fader._alpha >= 100) && (noJumpMode == true)) && (leastLinesMode == false)) {
gray_so.data.lvl14noJump = true;
gotoAndStop ("noJumps");
} else if (((fader._alpha >= 100) && (leastLinesMode == true)) && (noJumpMode == false)) {
if (levelLinesPlayer < gray_so.data.lvl14leastLinesPlayer) {
gray_so.data.lvl14leastLinesPlayer = levelLinesPlayer;
}
gotoAndStop ("leastLines");
}
}
}
function onMouseUp() {
imdrawing = false;
}
function onEnterFrame() {
displayText();
wallClinging = false;
xVar = man._x;
yVar = man._y;
testVar = ySpeed + yUp;
music();
cheats();
achievementsFunc();
pauseGame();
customCursor();
doorHit();
if (gamePaused == false) {
Drawing();
timerCounter();
man._x = man._x + xSpeed;
man._y = man._y + ySpeed;
manCollision();
moveScreen();
lookAround();
if (dead == false) {
if (fader._alpha > 0) {
fader._alpha = fader._alpha - 2;
}
kick();
manJump(-20);
managemanSprite();
onGround();
manageColor();
suicide();
spikesHit();
switches();
if ((Key.isDown(68) && (dodging == false)) && (wallClinging == false)) {
xSpeed = runSpeed;
} else if ((Key.isDown(65) && (dodging == false)) && (wallClinging == false)) {
xSpeed = -runSpeed;
} else if (((!Key.isDown(65)) && (!Key.isDown(68))) && (dodging == false)) {
xSpeed = 0;
}
} else {
man.sprite.gotoAndStop(4);
man.mudkip.gotoAndStop(4);
man.mage.gotoAndStop(4);
xSpeed = 0;
}
if (((man._x + xSpeed) > Stage.width) or ((man._x + xSpeed) < 0)) {
xSpeed = xSpeed - xSpeed;
} else if (dead == true) {
levelLinesPlayer = 0;
if (fader._alpha < 100) {
fader._alpha = fader._alpha + 5;
}
if (fader._alpha >= 100) {
dead = false;
deathsThisTime++;
man.sprite.gotoAndStop(1);
man.mudkip.gotoAndStop(1);
man.mage.gotoAndStop(1);
platforms._x = platx;
platforms._y = platy;
theBackground._x = backx;
theBackground._y = backy;
man._x = manx;
man._y = many;
createEmptyMovieClip("terrain1", man.getDepth() - 1);
createEmptyMovieClip("terrain2", man.getDepth() - 2);
}
}
}
}
function managemanSprite() {
if ((man.sprite._currentframe != 4) && (attack == false)) {
if ((air == false) && (wallClinging == false)) {
if (((Key.isDown(68) == false) && (Key.isDown(65) == false)) && (dodging == false)) {
man.sprite.gotoAndStop(1);
} else if (((Key.isDown(68) == true) && (dodging == false)) or ((Key.isDown(65) == true) && (dodging == false))) {
if (Key.isDown(68) && (dodging == false)) {
man.sprite._xscale = manXScale;
} else if (Key.isDown(65) && (dodging == false)) {
man.sprite._xscale = -manXScale;
}
man.sprite.gotoAndStop(2);
}
} else if (((air == true) && (dodging == false)) && (wallClinging == false)) {
man.sprite.gotoAndStop(3);
} else if (wallClinging == true) {
man.sprite.gotoAndStop(6);
}
} else if ((man.sprite._currentframe != 4) && (attack == true)) {
if (kicking == true) {
man.sprite.gotoAndStop(7);
}
}
}
function manageColor() {
if (man.sprite._xscale == (-manXScale)) {
man.sprite.bwhite.blendMode = "invert";
} else if (man.sprite._xscale == manXScale) {
man.sprite.bwhite.blendMode = "alpha";
}
}
function manJump(jumpHeight) {
if ((((((Key.isDown(87) && (noJumpMode == false)) && (!Key.isDown(70))) && (jumpKeySwitch == false)) && (doubleJump < 2)) && (noJump == false)) && (ySpeed > -1)) {
gray_so.data.totalJumps++;
jumpKeySwitch = true;
jumping = true;
doubleJump++;
air = true;
yUp = 0;
wallClinging = false;
gravity = 2;
man.sprite.inSprite.play();
man.sprite.bwhite.play();
man.sprite.outline.play();
if (ySpeed > -5) {
ySpeed = jumpHeight;
}
if ((doubleJump >= 2) && (ySpeed < -5)) {
ySpeed = jumpHeight;
}
} else if (Key.isDown(87) == false) {
jumpKeySwitch = false;
}
if ((jumping == true) && (ySpeed > 0)) {
jumping = false;
}
}
function onGround() {
if (((platforms.plats.hitTest(man._x + _x, ((man._y + 38) - yUp) + _y, true) or terrain1.hitTest(man._x + _x, ((man._y + 38) - yUp) + _y, true)) or terrain2.hitTest(man._x + _x, ((man._y + 38) - yUp) + _y, true)) or (wallClinging == true)) {
gravity = 2;
air = false;
doubleJump = 1;
} else {
air = true;
man._rotation = 0;
if (ySpeed < 15) {
ySpeed = ySpeed + gravity;
}
}
}
function manCollision() {
yUp = 0;
while ((platforms.plats.hitTest(man._x + _x, (((man._y + 35) + yUp) + _y) - 4, true) or terrain1.hitTest(man._x + _x, (((man._y + 35) + yUp) + _y) - 4, true)) or terrain2.hitTest(man._x + _x, (((man._y + 35) + yUp) + _y) - 4, true)) {
yUp--;
if (((Key.isDown(65) && (air == false)) && (jumping == false)) or ((Key.isDown(68) && (air == false)) && (jumping == false))) {
if ((yUp < ySpeed) && (man.sprite._xscale == (-manXScale))) {
man._rotation = ((-(yUp - ySpeed)) * 3) - (ySpeed * 6.15);
} else if ((yUp > ySpeed) && (man.sprite._xscale == manXScale)) {
man._rotation = ((yUp - ySpeed) * 3) + (ySpeed * 6.15);
} else if ((yUp > ySpeed) && (man.sprite._xscale == (-manXScale))) {
man._rotation = ((-(yUp - ySpeed)) * 3) - (ySpeed * 6.15);
} else if ((yUp < ySpeed) && (man.sprite._xscale == manXScale)) {
man._rotation = ((yUp - ySpeed) * 3) + (ySpeed * 6.15);
}
}
}
if ((platforms.plats.hitTest(man._x + _x, ((man._y - 35) + yUp) + _y, true) or terrain1.hitTest(man._x + _x, ((man._y - 35) + yUp) + _y, true)) or terrain2.hitTest(man._x + _x, ((man._y - 35) + yUp) + _y, true)) {
yUp = -ySpeed;
}
while ((((xSpeed != 0) && (platforms.plats.hitTest((man._x + xSpeed) + _x, ((man._y - 35) + yUp) + _y, true))) or ((xSpeed != 0) && (terrain1.hitTest((man._x + xSpeed) + _x, ((man._y - 35) + yUp) + _y, true)))) or ((xSpeed != 0) && (terrain2.hitTest((man._x + xSpeed) + _x, ((man._y - 35) + yUp) + _y, true)))) {
man._x = man._x - xSpeed;
}
if (((yUp == 0) && (ySpeed == 0)) && (air == false)) {
yUp = -16;
ySpeed = 16;
}
if ((yUp < -50) && (ySpeed > 0)) {
xSpeed = 0;
yUp = -ySpeed;
} else if ((yUp < -50) && (ySpeed < 0)) {
yUp = -15;
}
noJump = false;
man._y = man._y + yUp;
collideVar = yUp - ySpeed;
while ((((((platforms.plats.hitTest((man._x + xSpeed) + _x, man._y + _y, true) && (xSpeed != 0)) or (platforms.plats.hitTest((man._x + xSpeed) + _x, man._y + _y, true) && (xSpeed != 0))) or (terrain1.hitTest((man._x + xSpeed) + _x, man._y + _y, true) && (xSpeed != 0))) or (terrain1.hitTest((man._x + xSpeed) + _x, man._y + _y, true) && (xSpeed != 0))) or (terrain2.hitTest((man._x + xSpeed) + _x, man._y + _y, true) && (xSpeed != 0))) or (terrain2.hitTest((man._x + xSpeed) + _x, man._y + _y, true) && (xSpeed != 0))) {
man._x = man._x - xSpeed;
}
while ((xSpeed == 0) && (platforms.plats.hitTest((man._x - 20) + _x, man._y + _y, true))) {
man._x = man._x + 21;
}
while ((xSpeed == 0) && (platforms.plats.hitTest((man._x + 20) + _x, man._y + _y, true))) {
man._x = man._x - 21;
}
}
function moveScreen() {
if (man._x > (Stage.width - 250)) {
platforms._x = platforms._x - runSpeed;
terrain1._x = terrain1._x - runSpeed;
terrain2._x = terrain2._x - runSpeed;
man._x = man._x - runSpeed;
theBackground._x = theBackground._x - (runSpeed / 8);
}
if (man._x < 250) {
platforms._x = platforms._x + runSpeed;
terrain1._x = terrain1._x + runSpeed;
terrain2._x = terrain2._x + runSpeed;
man._x = man._x + runSpeed;
theBackground._x = theBackground._x + (runSpeed / 8);
}
if (((man._y + ySpeed) + yUp) > (Stage.height - 150)) {
platforms._y = platforms._y - (ySpeed + yUp);
terrain1._y = terrain1._y - (ySpeed + yUp);
terrain2._y = terrain2._y - (ySpeed + yUp);
man._y = man._y - (ySpeed + yUp);
theBackground._y = theBackground._y - ((ySpeed + yUp) / 8);
}
if (((man._y + ySpeed) + yUp) < 150) {
platforms._y = platforms._y - (ySpeed + yUp);
terrain1._y = terrain1._y - (ySpeed + yUp);
terrain2._y = terrain2._y - (ySpeed + yUp);
man._y = man._y - (ySpeed + yUp);
theBackground._y = theBackground._y - ((ySpeed + yUp) / 8);
}
if (((man._y + ySpeed) + yUp) < 125) {
platforms._y = platforms._y - ((ySpeed + yUp) - 26);
terrain1._y = terrain1._y - ((ySpeed + yUp) - 26);
terrain2._y = terrain2._y - ((ySpeed + yUp) - 26);
man._y = man._y - ((ySpeed + yUp) - 26);
theBackground._y = theBackground._y - (((ySpeed + yUp) - 26) / 8);
}
if (((man._y + ySpeed) + yUp) > (Stage.height - 125)) {
platforms._y = platforms._y - ((ySpeed + yUp) + 26);
terrain1._y = terrain1._y - ((ySpeed + yUp) + 26);
terrain2._y = terrain2._y - ((ySpeed + yUp) + 26);
man._y = man._y - ((ySpeed + yUp) + 26);
theBackground._y = theBackground._y - (((ySpeed + yUp) + 26) / 8);
}
if ((((man._y + ySpeed) + yUp) < 139) && (Key.isDown(70))) {
platforms._y = platforms._y - ((ySpeed + yUp) - 15);
terrain1._y = terrain1._y - ((ySpeed + yUp) - 15);
terrain2._y = terrain2._y - ((ySpeed + yUp) - 15);
man._y = man._y - ((ySpeed + yUp) - 15);
theBackground._y = theBackground._y - (((ySpeed + yUp) - 15) / 8);
}
if ((((man._y + ySpeed) + yUp) > (Stage.height - 139)) && (Key.isDown(70))) {
platforms._y = platforms._y - ((ySpeed + yUp) + 15);
terrain1._y = terrain1._y - ((ySpeed + yUp) + 15);
terrain2._y = terrain2._y - ((ySpeed + yUp) + 15);
man._y = man._y - ((ySpeed + yUp) + 15);
theBackground._y = theBackground._y - (((ySpeed + yUp) + 15) / 8);
}
}
function lookAround() {
if (((Key.isDown(70) && (air == false)) && (!Key.isDown(65))) && (!Key.isDown(68))) {
imdrawing = false;
if (_xmouse > (Stage.width - 250)) {
platforms._x = platforms._x - runSpeed;
terrain1._x = terrain1._x - runSpeed;
terrain2._x = terrain2._x - runSpeed;
man._x = man._x - runSpeed;
theBackground._x = theBackground._x - (runSpeed / 8);
}
if (_xmouse < 250) {
platforms._x = platforms._x + runSpeed;
terrain1._x = terrain1._x + runSpeed;
terrain2._x = terrain2._x + runSpeed;
man._x = man._x + runSpeed;
theBackground._x = theBackground._x + (runSpeed / 8);
}
if (_ymouse < 139) {
platforms._y = platforms._y - ((ySpeed + yUp) - 15);
terrain1._y = terrain1._y - ((ySpeed + yUp) - 15);
terrain2._y = terrain2._y - ((ySpeed + yUp) - 15);
man._y = man._y - ((ySpeed + yUp) - 15);
theBackground._y = theBackground._y - (((ySpeed + yUp) - 15) / 8);
}
if (_ymouse > (Stage.height - 139)) {
platforms._y = platforms._y - ((ySpeed + yUp) + 15);
terrain1._y = terrain1._y - ((ySpeed + yUp) + 15);
terrain2._y = terrain2._y - ((ySpeed + yUp) + 15);
man._y = man._y - ((ySpeed + yUp) + 15);
theBackground._y = theBackground._y - (((ySpeed + yUp) + 15) / 8);
}
}
}
function customCursor() {
cursor.gotoAndStop(terrainVar);
linecolor.gotoAndStop(terrainVar);
cursor._x = _xmouse;
cursor._y = _ymouse;
cursor._rotation = cursor._rotation + 3;
}
function wallCling() {
if ((platforms.plats.hitTest(((man._x + xSpeed) + 16) + _x, (man._y - 60) + _y, true) && (air == true)) && (Key.isDown(39))) {
man.sprite._xscale = -manXScale;
wallClinging = true;
air = false;
ySpeed = 0;
doubleJump = 0;
} else if ((platforms.plats.hitTest(((man._x + xSpeed) - 16) + _x, man._y + _y, true) && (air == true)) && (Key.isDown(37))) {
man.sprite._xscale = manXScale;
wallClinging = true;
air = false;
ySpeed = 0;
doubleJump = 0;
}
if ((air == true) or Key.isDown(40)) {
wallClinging = false;
}
}
function manDodge() {
if (((Key.isDown(40) && (Key.isDown(68))) && (dodgeSwitch == false)) && (wallClinging == false)) {
dodging = "right";
dodgeSwitch = true;
} else if (((Key.isDown(40) && (Key.isDown(65))) && (dodgeSwitch == false)) && (wallClinging == false)) {
dodging = "left";
dodgeSwitch = true;
}
if (dodging == "right") {
man.sprite._xscale = manXScale;
man.sprite.gotoAndStop(5);
xSpeed = 25;
dodgeSwitch == true;
} else if (dodging == "left") {
man.sprite._xscale = -manXScale;
man.sprite.gotoAndStop(5);
xSpeed = -25;
dodgeSwitch == true;
}
if (!Key.isDown(40)) {
dodgeSwitch = false;
}
}
function spikesHit() {
if (((platforms.spikes.hitTest(man._x + _x, man._y + _y, true) or platforms.spikes2.hitTest(man._x + _x, man._y + _y, true)) or platforms.spikes3.hitTest(man._x + _x, man._y + _y, true)) or platforms.spikes4.hitTest(man._x + _x, man._y + _y, true)) {
gray_so.data.totalDeaths++;
currentDeaths++;
dead = true;
}
}
function kick() {
if (Key.isDown(32) && (kickKeySwitch == false)) {
attack = true;
kicking = true;
kickKeySwitch = true;
} else if (!Key.isDown(32)) {
kickKeySwitch = false;
}
}
function suicide() {
if (Key.isDown(13) && (suicideSwitch == false)) {
dead = true;
suicideSwitch = true;
}
if (!Key.isDown(13)) {
suicideSwitch = false;
}
}
function pauseGame() {
if (((Key.isDown(27) && (pauseSwitch == false)) && (gamePaused == false)) && (dead == false)) {
gamePaused = true;
imdrawing = false;
pauseScreen._visible = true;
inverter._visible = true;
pauseSwitch = true;
} else if ((Key.isDown(27) && (pauseSwitch == false)) && (gamePaused == true)) {
gamePaused = false;
pauseScreen._visible = false;
inverter._visible = false;
pauseSwitch = true;
} else if (!Key.isDown(27)) {
pauseSwitch = false;
}
}
function cheats() {
if (mudkipcheat == true) {
man.sprite._visible = false;
man.mudkip._visible = true;
man.mage._visible = false;
if ((man.mudkip._currentframe != 4) && (attack == false)) {
if (air == false) {
if ((Key.isDown(68) == false) && (Key.isDown(65) == false)) {
man.mudkip.gotoAndStop(1);
} else if ((Key.isDown(68) == true) or (Key.isDown(65) == true)) {
if (Key.isDown(68)) {
man.mudkip._xscale = mudkipXScale;
} else if (Key.isDown(65)) {
man.mudkip._xscale = -mudkipXScale;
}
man.mudkip.gotoAndStop(2);
}
} else if (air == true) {
man.mudkip.gotoAndStop(3);
}
if (Key.isDown(32) && (kickKeySwitch == false)) {
if (man.mudkip.inSprite.head._currentframe == 1) {
mudkipMouthOpen = true;
} else if (man.mudkip.inSprite.head._currentframe == 2) {
mudkipMouthOpen = false;
}
}
if (mudkipMouthOpen == true) {
man.mudkip.inSprite.head.gotoAndStop(2);
} else {
man.mudkip.inSprite.head.gotoAndStop(1);
}
}
} else if (magecheat == true) {
man.sprite._visible = false;
man.mudkip._visible = false;
man.mage._visible = true;
if ((man.mage._currentframe != 4) && (attack == false)) {
if (air == false) {
if ((Key.isDown(68) == false) && (Key.isDown(65) == false)) {
man.mage.gotoAndStop(1);
} else if ((Key.isDown(68) == true) or (Key.isDown(65) == true)) {
if (Key.isDown(68)) {
man.mage._xscale = mageXScale;
} else if (Key.isDown(65)) {
man.mage._xscale = -mageXScale;
}
man.mage.gotoAndStop(2);
}
} else if (air == true) {
man.mage.gotoAndStop(3);
}
}
} else if ((mudkipcheat == false) && (magecheat == false)) {
man.sprite._visible = true;
man.mudkip._visible = false;
man.mage._visible = false;
}
}
function achievementsFunc() {
if ((gray_so.data.totalDeaths == 100) && (gray_so.data.deathachievementplayed != true)) {
achpopup.dontfearthereaper._visible = true;
gray_so.data.deathachievementplayed = true;
achpopup.gotoAndPlay("start");
}
if ((gray_so.data.totalLines > 900) && (gray_so.data.over9000achievementplayed != true)) {
achpopup.over9000._visible = true;
gray_so.data.over9000achievementplayed = true;
achpopup.gotoAndPlay("start");
}
}
function timerCounter() {
timerPart++;
if (timerPart == 40) {
timer++;
gray_so.data.totalTimer++;
timerPart = 0;
}
}
stop();
pauseScreen._visible = false;
inverter._visible = false;
Mouse.hide();
platx = platforms._x;
platy = platforms._y;
backx = theBackground._x;
backy = theBackground._y;
manx = man._x;
many = man._y;
dead = false;
gamePaused = false;
dodging = false;
var attack = false;
var kicking = false;
var manstate = 1;
var runSpeed = 15;
var xSpeed = 0;
var ySpeed = 0;
var jumping = false;
var jumpKeySwitch = false;
var mudkipXScale = man.mudkip._xscale;
var mageXScale = man.mage._xscale;
var manXScale = man.sprite._xscale;
var gravity = 2;
var color = new Color("_root.man");
var imdrawing = false;
var terrainVar = 1;
Frame 35
levelsound.stop();
raveLights._visible = true;
levelsound.attachSound("raveMusic");
levelsound.start();
Symbol 15 Button
on (release) {
getURL ("http://www.omnomasaur.com", "_blank");
}
Symbol 20 Button
on (release) {
getURL ("http://www.omnomasaur.com", "_blank");
}
Symbol 21 MovieClip Frame 131
_root.gotoAndStop("menu");
Symbol 30 Button
on (release) {
gotoAndStop ("chooselevel");
}
Symbol 43 Button
on (release) {
deathsThisTime = 0;
timer = 0;
timerPart = 0;
gotoAndStop ("lvl1");
}
Symbol 48 Button
on (release) {
gotoAndStop ("achievements");
}
Symbol 53 Button
on (release) {
gotoAndStop ("noJumps");
}
Symbol 58 Button
on (release) {
gotoAndStop ("leastLines");
}
Symbol 63 Button
on (release) {
gotoAndStop ("options");
}
Symbol 110 MovieClip Frame 1
startthegame._visible = false;
tehh4xcheatz._visible = false;
stillalive._visible = false;
springless._visible = false;
soiherd._visible = false;
ravemeister._visible = false;
over9000._visible = false;
dontfearthereaper._visible = false;
artistach._visible = false;
overachiever._visible = false;
Symbol 110 MovieClip Frame 65
stop();
startthegame._visible = false;
tehh4xcheatz._visible = false;
stillalive._visible = false;
springless._visible = false;
soiherd._visible = false;
ravemeister._visible = false;
over9000._visible = false;
dontfearthereaper._visible = false;
artistach._visible = false;
overachiever._visible = false;
Symbol 116 Button
on (release) {
gotoAndStop ("beta");
menusound.stop();
levelsound = new Sound(this);
levelsound.attachSound("levelMusic");
levelsound.start(0, 9999);
levelMusicOn = true;
}
Symbol 121 Button
on (release) {
gotoAndStop ("lvl1");
menusound.stop();
levelsound = new Sound(this);
levelsound.attachSound("levelMusic");
levelsound.start(0, 9999);
levelMusicOn = true;
}
Symbol 126 Button
on (release) {
gotoAndStop ("lvl2");
menusound.stop();
levelsound = new Sound(this);
levelsound.attachSound("levelMusic");
levelsound.start(0, 9999);
levelMusicOn = true;
}
Symbol 131 Button
on (release) {
gotoAndStop ("lvl3");
menusound.stop();
levelsound = new Sound(this);
levelsound.attachSound("levelMusic");
levelsound.start(0, 9999);
levelMusicOn = true;
}
Symbol 134 Button
on (release) {
gotoAndStop ("lvl4");
menusound.stop();
levelsound = new Sound(this);
levelsound.attachSound("levelMusic");
levelsound.start(0, 9999);
levelMusicOn = true;
}
Symbol 137 Button
on (release) {
gotoAndStop ("lvl5");
menusound.stop();
levelsound = new Sound(this);
levelsound.attachSound("levelMusic");
levelsound.start(0, 9999);
levelMusicOn = true;
}
Symbol 141 Button
on (release) {
gotoAndStop ("lvl6");
menusound.stop();
levelsound = new Sound(this);
levelsound.attachSound("levelMusic");
levelsound.start(0, 9999);
levelMusicOn = true;
}
Symbol 145 Button
on (release) {
gotoAndStop ("lvl7");
menusound.stop();
levelsound = new Sound(this);
levelsound.attachSound("levelMusic");
levelsound.start(0, 9999);
levelMusicOn = true;
}
Symbol 151 Button
on (release) {
gotoAndStop ("lvl9");
menusound.stop();
levelsound = new Sound(this);
levelsound.attachSound("levelMusic");
levelsound.start(0, 9999);
levelMusicOn = true;
}
Symbol 156 Button
on (release) {
gotoAndStop ("lvl10");
menusound.stop();
levelsound = new Sound(this);
levelsound.attachSound("levelMusic");
levelsound.start(0, 9999);
levelMusicOn = true;
}
Symbol 160 Button
on (release) {
gotoAndStop ("lvl11");
menusound.stop();
levelsound = new Sound(this);
levelsound.attachSound("levelMusic");
levelsound.start(0, 9999);
levelMusicOn = true;
}
Symbol 163 Button
on (release) {
gotoAndStop ("lvl13");
menusound.stop();
levelsound = new Sound(this);
levelsound.attachSound("levelMusic");
levelsound.start(0, 9999);
levelMusicOn = true;
}
Symbol 166 Button
on (release) {
gotoAndStop ("lvl8");
menusound.stop();
levelsound = new Sound(this);
levelsound.attachSound("levelMusic");
levelsound.start(0, 9999);
levelMusicOn = true;
}
Symbol 168 Button
on (release) {
gotoAndStop ("lvl12");
menusound.stop();
levelsound = new Sound(this);
levelsound.attachSound("levelMusic");
levelsound.start(0, 9999);
levelMusicOn = true;
}
Symbol 170 Button
on (release) {
gotoAndStop ("menu");
}
Symbol 172 Button
on (release) {
gotoAndStop ("lvl14");
menusound.stop();
levelsound = new Sound(this);
levelsound.attachSound("levelMusic");
levelsound.start(0, 9999);
levelMusicOn = true;
}
Symbol 178 Button
on (release) {
gotoAndStop ("lvl3");
menusound.stop();
levelsound = new Sound(this);
levelsound.attachSound("levelMusic");
levelsound.start(0, 9999);
levelMusicOn = true;
noJumpMode = true;
}
Symbol 179 Button
on (release) {
gotoAndStop ("lvl4");
menusound.stop();
levelsound = new Sound(this);
levelsound.attachSound("levelMusic");
levelsound.start(0, 9999);
levelMusicOn = true;
noJumpMode = true;
}
Symbol 180 Button
on (release) {
gotoAndStop ("lvl5");
menusound.stop();
levelsound = new Sound(this);
levelsound.attachSound("levelMusic");
levelsound.start(0, 9999);
levelMusicOn = true;
noJumpMode = true;
}
Symbol 181 Button
on (release) {
gotoAndStop ("lvl6");
menusound.stop();
levelsound = new Sound(this);
levelsound.attachSound("levelMusic");
levelsound.start(0, 9999);
levelMusicOn = true;
noJumpMode = true;
}
Symbol 182 Button
on (release) {
gotoAndStop ("lvl7");
menusound.stop();
levelsound = new Sound(this);
levelsound.attachSound("levelMusic");
levelsound.start(0, 9999);
levelMusicOn = true;
noJumpMode = true;
}
Symbol 183 Button
on (release) {
gotoAndStop ("lvl9");
menusound.stop();
levelsound = new Sound(this);
levelsound.attachSound("levelMusic");
levelsound.start(0, 9999);
levelMusicOn = true;
noJumpMode = true;
}
Symbol 184 Button
on (release) {
gotoAndStop ("lvl10");
menusound.stop();
levelsound = new Sound(this);
levelsound.attachSound("levelMusic");
levelsound.start(0, 9999);
levelMusicOn = true;
noJumpMode = true;
}
Symbol 185 Button
on (release) {
gotoAndStop ("lvl11");
menusound.stop();
levelsound = new Sound(this);
levelsound.attachSound("levelMusic");
levelsound.start(0, 9999);
levelMusicOn = true;
noJumpMode = true;
}
Symbol 186 Button
on (release) {
gotoAndStop ("lvl13");
menusound.stop();
levelsound = new Sound(this);
levelsound.attachSound("levelMusic");
levelsound.start(0, 9999);
levelMusicOn = true;
noJumpMode = true;
}
Symbol 187 Button
on (release) {
gotoAndStop ("lvl8");
menusound.stop();
levelsound = new Sound(this);
levelsound.attachSound("levelMusic");
levelsound.start(0, 9999);
levelMusicOn = true;
noJumpMode = true;
}
Symbol 191 MovieClip Frame 1
stop();
Symbol 197 Button
on (release) {
gotoAndStop ("lvl6");
menusound.stop();
levelsound = new Sound(this);
levelsound.attachSound("levelMusic");
levelsound.start(0, 9999);
levelMusicOn = true;
leastLinesMode = true;
linesToBeatVar = 1;
}
on (rollOver) {
currentOverLinesToBeatVar = 1;
currentOverBestTryVar = gray_so.data.lvl6leastLinesPlayer;
}
Symbol 198 Button
on (release) {
gotoAndStop ("lvl7");
menusound.stop();
levelsound = new Sound(this);
levelsound.attachSound("levelMusic");
levelsound.start(0, 9999);
levelMusicOn = true;
leastLinesMode = true;
linesToBeatVar = 2;
}
on (rollOver) {
currentOverLinesToBeatVar = 2;
currentOverBestTryVar = gray_so.data.lvl7leastLinesPlayer;
}
Symbol 199 Button
on (release) {
gotoAndStop ("lvl9");
menusound.stop();
levelsound = new Sound(this);
levelsound.attachSound("levelMusic");
levelsound.start(0, 9999);
levelMusicOn = true;
leastLinesMode = true;
linesToBeatVar = 3;
}
on (rollOver) {
currentOverLinesToBeatVar = 3;
currentOverBestTryVar = gray_so.data.lvl9leastLinesPlayer;
}
Symbol 200 Button
on (release) {
gotoAndStop ("lvl10");
menusound.stop();
levelsound = new Sound(this);
levelsound.attachSound("levelMusic");
levelsound.start(0, 9999);
levelMusicOn = true;
leastLinesMode = true;
linesToBeatVar = 4;
}
on (rollOver) {
currentOverLinesToBeatVar = 4;
currentOverBestTryVar = gray_so.data.lvl10leastLinesPlayer;
}
Symbol 201 Button
on (release) {
gotoAndStop ("lvl11");
menusound.stop();
levelsound = new Sound(this);
levelsound.attachSound("levelMusic");
levelsound.start(0, 9999);
levelMusicOn = true;
leastLinesMode = true;
linesToBeatVar = 7;
}
on (rollOver) {
currentOverLinesToBeatVar = 7;
currentOverBestTryVar = gray_so.data.lvl11leastLinesPlayer;
}
Symbol 202 Button
on (release) {
gotoAndStop ("lvl13");
menusound.stop();
levelsound = new Sound(this);
levelsound.attachSound("levelMusic");
levelsound.start(0, 9999);
levelMusicOn = true;
leastLinesMode = true;
linesToBeatVar = 6;
}
on (rollOver) {
currentOverLinesToBeatVar = 6;
currentOverBestTryVar = gray_so.data.lvl13leastLinesPlayer;
}
Symbol 203 Button
on (release) {
gotoAndStop ("lvl8");
menusound.stop();
levelsound = new Sound(this);
levelsound.attachSound("levelMusic");
levelsound.start(0, 9999);
levelMusicOn = true;
leastLinesMode = true;
linesToBeatVar = 1;
}
on (rollOver) {
currentOverLinesToBeatVar = 1;
currentOverBestTryVar = gray_so.data.lvl8leastLinesPlayer;
}
Symbol 204 Button
on (release) {
gotoAndStop ("lvl12");
menusound.stop();
levelsound = new Sound(this);
levelsound.attachSound("levelMusic");
levelsound.start(0, 9999);
levelMusicOn = true;
leastLinesMode = true;
linesToBeatVar = 4;
}
on (rollOver) {
currentOverLinesToBeatVar = 4;
currentOverBestTryVar = gray_so.data.lvl12leastLinesPlayer;
}
Symbol 207 Button
on (release) {
gotoAndStop ("lvl14");
menusound.stop();
levelsound = new Sound(this);
levelsound.attachSound("levelMusic");
levelsound.start(0, 9999);
levelMusicOn = true;
leastLinesMode = true;
linesToBeatVar = 4;
}
on (rollOver) {
currentOverLinesToBeatVar = 5;
currentOverBestTryVar = gray_so.data.lvl14leastLinesPlayer;
}
Symbol 213 Button
on (release) {
gray_so.clear();
gotoAndStop ("menu");
}
Symbol 218 Button
on (release) {
gotoAndStop ("credits");
}
Symbol 223 Button
on (release) {
if (gray_so.data.musicOff == false) {
_root.levelsound.setVolume(0);
_root.menusound.setVolume(0);
gray_so.data.musicOff = true;
} else if (gray_so.data.musicOff == true) {
_root.levelsound.setVolume(100);
_root.menusound.setVolume(100);
gray_so.data.musicOff = false;
}
}
Symbol 228 Button
on (release) {
gotoAndStop ("stats");
}
Symbol 254 MovieClip Frame 29
stop();
Symbol 262 MovieClip Frame 11
stop();
Instance of Symbol 248 MovieClip in Symbol 263 MovieClip Frame 1
onClipEvent (enterFrame) {
if (_root.gamePaused == false) {
play();
} else {
stop();
}
}
Instance of Symbol 253 MovieClip in Symbol 263 MovieClip Frame 2
onClipEvent (enterFrame) {
if (_root.gamePaused == false) {
play();
} else {
stop();
}
}
Instance of Symbol 254 MovieClip in Symbol 263 MovieClip Frame 3
onClipEvent (enterFrame) {
if ((_root.gamePaused == false) && (_currentframe != 29)) {
play();
} else {
stop();
}
if ((((_root.air == true) && (_root.jumpKeySwitch == true)) && (_root.doubleJump == 2)) && (_currentframe >= 22)) {
gotoAndPlay (2);
_root.doubleJump++;
}
}
Instance of Symbol 262 MovieClip in Symbol 263 MovieClip Frame 4
onClipEvent (enterFrame) {
if ((_root.gamePaused == false) && (_currentframe != 11)) {
play();
} else {
stop();
}
}
Instance of Symbol 262 MovieClip in Symbol 287 MovieClip Frame 4
onClipEvent (enterFrame) {
if ((_root.gamePaused == false) && (_currentframe != 11)) {
play();
} else {
stop();
}
}
Symbol 346 MovieClip Frame 16
gotoAndPlay (11);
Symbol 347 MovieClip Frame 1
if (_root.jumpKeySwitch == true) {
play();
} else {
gotoAndStop (17);
}
Symbol 347 MovieClip Frame 17
stop();
Instance of Symbol 346 MovieClip in Symbol 347 MovieClip Frame 17
onClipEvent (enterFrame) {
if (_root.gamePaused == false) {
play();
} else {
stop();
}
}
Symbol 375 MovieClip Frame 16
gotoAndPlay (11);
Symbol 376 MovieClip Frame 1
if (_root.jumpKeySwitch == true) {
play();
} else {
gotoAndStop (17);
}
Symbol 376 MovieClip Frame 17
stop();
Instance of Symbol 375 MovieClip in Symbol 376 MovieClip Frame 17
onClipEvent (enterFrame) {
if (_root.gamePaused == false) {
play();
} else {
stop();
}
}
Symbol 378 MovieClip Frame 20
_root.wallClinging = false;
_root.air = true;
Symbol 393 MovieClip Frame 15
_root.attack = false;
_root.kicking = false;
Instance of Symbol 38 MovieClip "inSprite" in Symbol 409 MovieClip Frame 1
onClipEvent (enterFrame) {
if (_root.gamePaused == false) {
play();
} else {
stop();
}
}
Instance of Symbol 38 MovieClip "bwhite" in Symbol 409 MovieClip Frame 1
onClipEvent (enterFrame) {
if (_root.gamePaused == false) {
play();
} else {
stop();
}
}
Instance of Symbol 295 MovieClip "outline" in Symbol 409 MovieClip Frame 1
onClipEvent (enterFrame) {
if (_root.gamePaused == false) {
play();
} else {
stop();
}
}
Instance of Symbol 305 MovieClip "inSprite" in Symbol 409 MovieClip Frame 2
onClipEvent (enterFrame) {
if (_root.gamePaused == false) {
play();
} else {
stop();
}
}
Instance of Symbol 305 MovieClip "bwhite" in Symbol 409 MovieClip Frame 2
onClipEvent (enterFrame) {
if (_root.gamePaused == false) {
play();
} else {
stop();
}
}
Instance of Symbol 315 MovieClip "outline" in Symbol 409 MovieClip Frame 2
onClipEvent (enterFrame) {
if (_root.gamePaused == false) {
play();
} else {
stop();
}
}
Instance of Symbol 347 MovieClip "inSprite" in Symbol 409 MovieClip Frame 3
onClipEvent (enterFrame) {
if ((_root.gamePaused == false) && (_currentframe != 17)) {
play();
} else {
stop();
}
if ((((_root.air == true) && (_root.jumpKeySwitch == true)) && (_root.doubleJump == 2)) && (_currentframe >= 14)) {
gotoAndPlay (4);
_root.doubleJump++;
}
}
Instance of Symbol 347 MovieClip "bwhite" in Symbol 409 MovieClip Frame 3
onClipEvent (enterFrame) {
if ((_root.gamePaused == false) && (_currentframe != 17)) {
play();
} else {
stop();
}
if ((((_root.air == true) && (_root.jumpKeySwitch == true)) && (_root.doubleJump == 2)) && (_currentframe >= 14)) {
gotoAndPlay (4);
}
}
Instance of Symbol 376 MovieClip "outline" in Symbol 409 MovieClip Frame 3
onClipEvent (enterFrame) {
if ((_root.gamePaused == false) && (_currentframe != 17)) {
play();
} else {
stop();
}
if ((((_root.air == true) && (_root.jumpKeySwitch == true)) && (_root.doubleJump == 2)) && (_currentframe >= 14)) {
gotoAndPlay (4);
}
}
Instance of Symbol 262 MovieClip in Symbol 409 MovieClip Frame 4
onClipEvent (enterFrame) {
if ((_root.gamePaused == false) && (_currentframe != 11)) {
play();
} else {
stop();
}
}
Instance of Symbol 347 MovieClip "inSprite" in Symbol 409 MovieClip Frame 5
onClipEvent (enterFrame) {
if ((_root.gamePaused == false) && (_currentframe != 17)) {
play();
} else {
stop();
}
}
Instance of Symbol 393 MovieClip "inSprite" in Symbol 409 MovieClip Frame 7
onClipEvent (enterFrame) {
if (_root.gamePaused == false) {
play();
} else {
stop();
}
}
Instance of Symbol 393 MovieClip "bwhite" in Symbol 409 MovieClip Frame 7
onClipEvent (enterFrame) {
if (_root.gamePaused == false) {
play();
} else {
stop();
}
}
Instance of Symbol 408 MovieClip in Symbol 409 MovieClip Frame 7
onClipEvent (enterFrame) {
if (_root.gamePaused == false) {
play();
} else {
stop();
}
}
Symbol 414 MovieClip Frame 1
notmudkip._visible = false;
Symbol 416 Button
on (release) {
if (_root.gray_so.data.musicOff == false) {
_root.levelsound.setVolume(0);
_root.menusound.setVolume(0);
_root.gray_so.data.musicOff = true;
} else if (_root.gray_so.data.musicOff == true) {
_root.levelsound.setVolume(100);
_root.menusound.setVolume(100);
_root.gray_so.data.musicOff = false;
}
}
Symbol 421 Button
on (release) {
if (cheatmenu._visible == false) {
cheatmenu._visible = true;
} else if (cheatmenu._visible == true) {
cheatmenu._visible = false;
}
}
Symbol 431 Button
on (release) {
if (_root.mudkipcheat == true) {
_root.mudkipcheat = false;
} else if (_root.mudkipcheat == false) {
_root.mudkipcheat = true;
}
}
Symbol 436 Button
on (release) {
if (_root.raveLights._visible == false) {
_root.levelsound.stop();
_root.raveLights._visible = true;
_root.levelsound.attachSound("raveMusic");
_root.levelsound.start();
levelMusicOn = true;
} else if (_root.raveLights._visible == true) {
_root.levelsound.stop();
_root.raveLights._visible = false;
_root.levelsound.attachSound("levelMusic");
_root.levelsound.start();
levelMusicOn = true;
}
}
Symbol 438 Button
on (release) {
if (_root.magecheat == true) {
_root.magecheat = false;
} else if (_root.magecheat == false) {
_root.magecheat = true;
}
}
Symbol 440 Button
on (release) {
_root.gray_so.data.lvlsavailable = 1000;
}
Instance of Symbol 425 MovieClip in Symbol 441 MovieClip Frame 1
onClipEvent (enterFrame) {
if (this.cheatinput.text == "mygame") {
_parent.mudkipbutton._visible = true;
} else if (this.cheatinput.text == "unce unce") {
_parent.ravebutton._visible = true;
} else if (this.cheatinput.text == "magus") {
_parent.magebutton._visible = true;
} else if (this.cheatinput.text == "wtf? beta?") {
_parent.alllvlsbutton._visible = true;
}
if (Key.isDown(13)) {
_root.cheatactivate = "Input Cheat";
}
if (((((_parent.mudkipbutton._visible == true) && (_parent.ravebutton._visible == true)) && (_parent.magebutton._visible == true)) && (_parent.alllvlsbutton._visible == true)) && (_root.gray_so.data.allcheatsunlocked == false)) {
_root.gray_so.data.allcheatsunlocked = true;
_root.achpopup.tehh4xcheatz._visible = true;
_root.achpopup.gotoAndPlay("start");
}
}
Symbol 442 Button
on (release) {
_root.gotoAndStop("menu");
}
Symbol 443 MovieClip Frame 1
cheatmenu._visible = false;
if (_root.gray_so.data.allcheatsunlocked == false) {
cheatmenu.mudkipbutton._visible = false;
cheatmenu.ravebutton._visible = false;
cheatmenu.magebutton._visible = false;
cheatmenu.alllvlsbutton._visible = false;
} else if (_root.gray_so.data.allcheatsunlocked == true) {
cheatmenu.mudkipbutton._visible = true;
cheatmenu.ravebutton._visible = true;
cheatmenu.magebutton._visible = true;
cheatmenu.alllvlsbutton._visible = true;
}
Symbol 480 MovieClip Frame 1
stop();
Instance of Symbol 580 MovieClip in Symbol 625 MovieClip Frame 1
onClipEvent (load) {
_root.statechanger = true;
if (((((Key.isDown(65) && (_root.itemvar == 1)) && (_root.air == false)) && (_root.armvar == 1)) && (_root.punchvar < 3)) && (uppunch == false)) {
_root.punchvar = _root.punchvar + 1;
uppunch = true;
} else {
uppunch = false;
}
if (((_root.punchvar > 0) && (_root.punchvar < 4)) && (_root.punching == false)) {
with (this.rarmout.rarm) {
gotoAndPlay(2);
}
}
if (((_root.punchvar > 1) && (_root.punchvar < 3)) && (_root.leftpunching == false)) {
with (this.larmout.larm) {
gotoAndPlay(2);
}
}
}
onClipEvent (enterFrame) {
if (((((Key.isDown(65) && (_root.itemvar == 1)) && (_root.air == false)) && (_root.armvar == 1)) && (_root.punchvar < 3)) && (uppunch == false)) {
_root.punchvar = _root.punchvar + 1;
uppunch = true;
} else {
uppunch = false;
}
if (((_root.punchvar > 0) && (_root.punchvar < 4)) && (_root.punching == false)) {
with (this.rarmout.rarm) {
gotoAndPlay(2);
}
}
if (((_root.punchvar > 1) && (_root.punchvar < 3)) && (_root.leftpunching == false)) {
with (this.larmout.larm) {
gotoAndPlay(2);
}
}
if ((((Key.isDown(65) && (_root.itemvar == 2)) && (_root.air == false)) && (_root.punching == false)) && (_root.armvar == 1)) {
with (this.larmout.larm) {
gotoAndPlay(38);
}
}
if ((((Key.isDown(65) && (_root.itemvar == 3)) && (_root.air == false)) && (_root.punching == false)) && (_root.armvar == 1)) {
with (this.larmout.larm) {
gotoAndPlay(38);
}
}
if ((((Key.isDown(65) && (_root.itemvar == 4)) && (_root.air == false)) && (_root.punching == false)) && (_root.armvar == 1)) {
with (this.larmout.larm) {
gotoAndPlay(38);
}
}
if ((((Key.isDown(65) && (_root.itemvar == 5)) && (_root.air == false)) && (_root.punching == false)) && (_root.armvar == 1)) {
with (this.larmout.larm) {
gotoAndPlay(38);
}
}
if ((((Key.isDown(65) && (_root.itemvar == 6)) && (_root.air == false)) && (_root.punching == false)) && (_root.armvar == 1)) {
with (this.larmout.larm) {
gotoAndPlay(38);
}
}
if ((((Key.isDown(65) && (_root.itemvar == 7)) && (_root.air == false)) && (_root.punching == false)) && (_root.armvar == 1)) {
with (this.larmout.larm) {
gotoAndPlay(38);
}
}
if ((((Key.isDown(65) && (_root.itemvar == 8)) && (_root.air == false)) && (_root.punching == false)) && (_root.armvar == 1)) {
with (this.larmout.larm) {
gotoAndPlay(38);
}
}
if ((((Key.isDown(65) && (_root.itemvar == 9)) && (_root.air == false)) && (_root.punching == false)) && (_root.armvar == 1)) {
with (this.larmout.larm) {
gotoAndPlay(38);
}
}
if ((((Key.isDown(65) && (_root.itemvar == 11)) && (_root.punching == false)) && (_root.armvar == 1)) && (_root.lightcharged == true)) {
with (this.larmout.larm) {
gotoAndPlay(38);
}
_root.laserCounter++;
_root.laser.duplicateMovieClip("laser" + _root.laserCounter, _root.laserCounter);
_root["laser" + _root.laserCounter]._visible = true;
}
}
Symbol 625 MovieClip Frame 2000
_root.gotoAndStop("menu");