Frame 1
bytes_loaded = Math.round(_root.getBytesLoaded());
bytes_total = Math.round(_root.getBytesTotal());
getPercent = bytes_loaded / bytes_total;
_root.loadBar._width = getPercent * 100;
_root.loadText = Math.round(getPercent * 100) + "%";
if (bytes_loaded == bytes_total) {
_root.gotoAndStop(3);
}
function __com_mochibot__(swfid, mc, lv, trk) {
var x;
var g;
var s;
var fv;
var sb;
var u;
var res;
var mb;
var mbc;
var pv;
mb = "__mochibot__";
mbc = "mochibot.com";
g = (_global ? (_global) : (_level0._root));
if (g[mb + swfid]) {
return(g[mb + swfid]);
}
s = System.security;
x = mc._root.getSWFVersion;
fv = (x ? (mc.getSWFVersion()) : ((_global ? 6 : 5)));
if (!s) {
s = {};
}
sb = s.sandboxType;
if (sb == "localWithFile") {
return(null);
}
x = s.allowDomain;
if (x) {
s.allowDomain(mbc);
}
x = s.allowInsecureDomain;
if (x) {
s.allowInsecureDomain(mbc);
}
pv = ((fv == 5) ? (getVersion()) : (System.capabilities.version));
u = (((((((((((("http://" + mbc) + "/my/core.swf?mv=8&fv=") + fv) + "&v=") + escape(pv)) + "&swfid=") + escape(swfid)) + "&l=") + lv) + "&f=") + mc) + (sb ? ("&sb=" + sb) : "")) + (trk ? "&t=1" : "");
lv = ((fv > 6) ? (mc.getNextHighestDepth()) : ((g[mb + "level"] ? (g[mb + "level"] + 1) : (lv))));
g[mb + "level"] = lv;
if (fv == 5) {
res = "_level" + lv;
if (!eval (res)) {
loadMovieNum (u, lv);
}
} else {
res = mc.createEmptyMovieClip(mb + swfid, lv);
res.loadMovie(u);
}
return(res);
}
__com_mochibot__("97533f29", this, 10301, true);
var myMenu = new ContextMenu();
myMenu.hideBuiltInItems();
copyrightNotice.separatorBefore = true;
myMenu.customItems.push(mySiteLink, copyrightNotice);
_root.menu = myMenu;
Frame 2
gotoAndPlay (1);
Frame 3
function init() {
gradient_mc._width = (background_mc._width = (click_mc._width = Stage.width));
gradient_mc._height = (background_mc._height = (click_mc._height = Stage.height));
play_knop._x = Stage.width / 2;
play_knop._y = Stage.height - 40;
play_mc._x = (Stage.width / 2) + 100;
play_mc._y = (Stage.height / 2) + 50;
logo_mc._x = Stage.width / 2;
logo_mc._y = Stage.height / 2;
logo_glans_mc._x = Stage.width / 2;
logo_glans_mc._y = (Stage.height / 2) + 80;
flits_mc._x = Stage.width / 2;
flits_mc._y = Stage.height / 2;
glans1_mc._width = Stage.width;
glans1_mc._height = (Stage.height / 2) + 80;
glans2_mc._width = Stage.width;
glans2_mc._height = (Stage.height / 2) + 50;
stralen_mc._x = Stage.width / 2;
stralen_mc._y = Stage.height / 2;
flits_mc._alpha = 0;
logo_mc._alpha = 0;
play_mc._alpha = 0;
play_knop._alpha = 0;
logo_glans_mc._alpha = 0;
glans1_mc._alpha = 0;
glans2_mc._alpha = 0;
stralen_mc._alpha = 0;
gradient_mc._alpha = 0;
play_knop.enabled = false;
logo_mc.stop();
logo_glans_mc.stop();
start_animatie();
}
function start_animatie() {
var _local1 = new mx.transitions.Tween(gradient_mc, "_alpha", mx.transitions.easing.Regular.easeInOut, 0, 100, 0.5, true);
_local1.onMotionFinished = function () {
start_glans();
};
}
function start_glans() {
var _local1 = new mx.transitions.Tween(glans1_mc, "_alpha", mx.transitions.easing.Strong.easeInOut, 0, 15, 0.5, true);
_local1.onMotionFinished = function () {
start_stralen();
};
var _local2 = new mx.transitions.Tween(glans2_mc, "_alpha", mx.transitions.easing.Strong.easeInOut, 0, 15, 1, true);
_local2.onMotionFinished = function () {
start_logo();
};
}
function start_stralen() {
var _local1 = new mx.transitions.Tween(stralen_mc, "_alpha", mx.transitions.easing.Regular.easeInOut, 0, 10, 1, true);
}
function start_logo() {
var _local7 = new mx.transitions.Tween(logo_mc, "_alpha", mx.transitions.easing.Regular.easeOut, 0, 100, 0.5, true);
var _local5 = new mx.transitions.Tween(logo_mc, "_yscale", mx.transitions.easing.Elastic.easeOut, 40, 100, 1.5, true);
var _local3 = new mx.transitions.Tween(logo_mc, "_xscale", mx.transitions.easing.Elastic.easeOut, 40, 100, 1.5, true);
var _local2 = new mx.transitions.Tween(logo_glans_mc, "_alpha", mx.transitions.easing.Regular.easeOut, 0, 20, 0.5, true);
var _local6 = new mx.transitions.Tween(logo_glans_mc, "_xscale", mx.transitions.easing.Elastic.easeOut, 40, 100, 1.5, true);
var _local4 = new mx.transitions.Tween(logo_glans_mc, "_yscale", mx.transitions.easing.Elastic.easeOut, 40, 100, 1.5, true);
var _local1 = new mx.transitions.Tween(logo_glans_mc, "_y", mx.transitions.easing.Elastic.easeOut, Stage.height / 2, (Stage.height / 2) + 100, 1.5, true);
_local1.onMotionFinished = function () {
logo_shine();
};
}
function logo_shine() {
logo_mc.play();
logo_glans_mc.play();
var _local3 = new mx.transitions.Tween(play_mc, "_alpha", mx.transitions.easing.Regular.easeOut, 0, 100, 0.5, true);
var _local2 = new mx.transitions.Tween(play_mc, "_xscale", mx.transitions.easing.Elastic.easeOut, 40, 100, 1.5, true);
var _local1 = new mx.transitions.Tween(play_mc, "_yscale", mx.transitions.easing.Elastic.easeOut, 40, 100, 1.5, true);
var _local5 = new mx.transitions.Tween(play_knop, "_alpha", mx.transitions.easing.Strong.easeInOut, 0, 100, 0.5, true);
var _local6 = new mx.transitions.Tween(play_knop, "_xscale", mx.transitions.easing.Strong.easeInOut, 10, 100, 0.5, true);
var _local4 = new mx.transitions.Tween(play_knop, "_yscale", mx.transitions.easing.Strong.easeInOut, 10, 100, 0.5, true);
play_knop.enabled = true;
play_knop.onRelease = function () {
logo_groter();
};
}
function logo_groter() {
play_knop.enabled = false;
var _local2 = new mx.transitions.Tween(play_knop, "_alpha", mx.transitions.easing.Strong.easeIn, 100, 0, 0.5, true);
var _local10 = new mx.transitions.Tween(play_knop, "_xscale", mx.transitions.easing.Strong.easeIn, 100, 10, 0.5, true);
var _local8 = new mx.transitions.Tween(play_knop, "_yscale", mx.transitions.easing.Strong.easeIn, 100, 10, 0.5, true);
var _local3 = new mx.transitions.Tween(play_mc, "_alpha", mx.transitions.easing.Strong.easeIn, 100, 0, 0.5, true);
var _local7 = new mx.transitions.Tween(play_mc, "_xscale", mx.transitions.easing.Strong.easeIn, 100, 10, 0.5, true);
var _local5 = new mx.transitions.Tween(play_mc, "_yscale", mx.transitions.easing.Strong.easeIn, 100, 10, 0.5, true);
var _local6 = new mx.transitions.Tween(logo_mc, "_xscale", mx.transitions.easing.Regular.easeOut, 100, 110, 0.4, true);
var _local9 = new mx.transitions.Tween(logo_mc, "_yscale", mx.transitions.easing.Regular.easeOut, 100, 110, 0.4, true);
var _local4 = new mx.transitions.Tween(logo_glans_mc, "_xscale", mx.transitions.easing.Regular.easeOut, 100, 110, 0.4, true);
var _local1 = new mx.transitions.Tween(logo_glans_mc, "_yscale", mx.transitions.easing.Regular.easeOut, 100, 110, 0.4, true);
_local1.onMotionFinished = function () {
logo_weg();
};
}
function logo_weg() {
var _local1 = new mx.transitions.Tween(logo_glans_mc, "_xscale", mx.transitions.easing.Strong.easeIn, 110, 10, 0.5, true);
_local1 = new mx.transitions.Tween(logo_glans_mc, "_yscale", mx.transitions.easing.Strong.easeIn, 110, 10, 0.5, true);
var _local5 = new mx.transitions.Tween(logo_glans_mc, "_y", mx.transitions.easing.Strong.easeIn, (Stage.height / 2) + 100, Stage.height / 2, 0.5, true);
var _local3 = new mx.transitions.Tween(logo_mc, "_xscale", mx.transitions.easing.Strong.easeIn, 110, 10, 0.5, true);
var _local4 = new mx.transitions.Tween(logo_mc, "_yscale", mx.transitions.easing.Strong.easeIn, 110, 10, 0.5, true);
var _local2 = new mx.transitions.Tween(logo_mc, "_alpha", mx.transitions.easing.Strong.easeIn, 100, 0, 0.5, true);
_local2.onMotionFinished = function () {
start_flits();
};
}
function start_flits() {
var _local3 = new mx.transitions.Tween(flits_mc, "_xscale", mx.transitions.easing.Strong.easeOut, 10, 100, 0.5, true);
var _local2 = new mx.transitions.Tween(flits_mc, "_yscale", mx.transitions.easing.Strong.easeOut, 10, 100, 1, true);
var _local1 = new mx.transitions.Tween(flits_mc, "_alpha", mx.transitions.easing.Strong.easeOut, 100, 0, 1, true);
_local1.onMotionFinished = function () {
deel1_weg();
};
}
function deel1_weg() {
var _local1 = new mx.transitions.Tween(stralen_mc, "_xscale", mx.transitions.easing.Regular.easeInOut, 100, 10, 1, true);
var _local4 = new mx.transitions.Tween(stralen_mc, "_yscale", mx.transitions.easing.Regular.easeInOut, 100, 10, 1, true);
_local1.onMotionFinished = function () {
deel2_weg();
};
var _local2 = new mx.transitions.Tween(stralen_mc, "_alpha", mx.transitions.easing.Regular.easeInOut, 10, 0, 1, true);
_local2.onMotionFinished = function () {
deel3_weg();
};
var _local3 = new mx.transitions.Tween(glans1_mc, "_alpha", mx.transitions.easing.Regular.easeInOut, 15, 0, 1, true);
}
function deel2_weg() {
var _local1 = new mx.transitions.Tween(glans2_mc, "_alpha", mx.transitions.easing.Regular.easeInOut, 15, 0, 1, true);
}
function deel3_weg() {
gotoAndStop ("main_menu");
}
var deze_website;
if (_url.substr(0, 4) == "http") {
deze_website = _url;
} else {
deze_website = "local";
}
var content_knop = "splashscreen";
var spel_naam = "the_kid_spectre";
var link = "http://www.funnygames.nu";
if (!_root.tibaco) {
link = link.concat(((((("/?utm_source=" + deze_website) + "&utm_medium=flashgame&utm_term=") + spel_naam) + "&utm_content=") + content_knop) + "&utm_campaign=sponsored_games");
}
click_mc._alpha = 0;
click_mc.onRelease = function () {
getURL (link, "_blank");
};
init();
this.onEnterFrame = function () {
stralen_mc._rotation = stralen_mc._rotation + 0.2;
};
Frame 5
stop();
score = 0;
titlemusic = new Sound();
titlemusic.attachSound("title_music");
titlemusic.start(0, 1000);
Frame 6
stop();
stage = 1;
titlemusic.stop();
tutlvlmusic = new Sound();
tutlvlmusic.attachSound("tutmusic");
tutlvlmusic.start(0, 1000);
musicplayer = "play";
cam.playPause.gotoAndStop("pause");
cam.music_eq.gotoAndStop("play");
cam.playPause.onRollOver = function () {
if (this._currentframe == 1) {
this.gotoAndStop("pauseOver");
} else {
this.gotoAndStop("playOver");
}
};
cam.playPause.onRollOut = (cam.playPause.onReleaseOutside = function () {
if (this._currentframe == 10) {
this.gotoAndStop("pause");
} else {
this.gotoAndStop("play");
}
});
cam.playPause.onRelease = function () {
if (this._currentframe == 10) {
this.gotoAndStop("playOver");
tutlvlmusic.stop();
cam.music_eq.gotoAndStop("stop");
} else {
this.gotoAndStop("pauseOver");
tutlvlmusic.start(0, 1000);
cam.music_eq.gotoAndStop("play");
}
};
fall_sound = new Sound();
dun_hitsnd = new Sound();
collectsnd = new Sound();
echosnd = new Sound();
portalsnd = new Sound();
jumpsnd = new Sound();
dropsnd.attachSound("drop");
fall_sound.attachSound("fall_noise");
dun_hitsnd.attachSound("dun_hit");
collectsnd.attachSound("collectedsnd");
echosnd.attachSound("echo");
shootsnd = new Sound();
shootsnd.attachSound("shoot");
portalsnd.attachSound("portaljump");
jumpsnd.attachSound("jump");
ghostboosnd = new Sound();
ghostboosnd.attachSound("ghostboo");
cam.tic = 999;
toc = 32;
cam._xscale = 120;
cam._yscale = 120;
cam.lens._xscale = 50;
cam.lens._yscale = 50;
canMove = true;
myColor = new Color(player);
myColorTransform = new Object();
myColorTransform = {rb:-200, gb:-200, bb:-200};
myColor.setTransform(myColorTransform);
portal_mc.lvl_portal._visible = false;
player._alpha = 100;
player._x = 610.7;
player._y = 294.1;
portalOpen = false;
cam.ghostsleft = 1;
cam.hearts = 5;
cam.count = 0;
cam.ectoleft = 3;
enemyCount = 0;
fallonce = 1;
shootOnce = 1;
TimerWarn = 1;
PanicWarn = 1;
attacking = false;
is_attacking = 0;
inControl = true;
running = false;
gravity = 10;
gravityaccel = 1;
xaccel = 7;
runaccelamt = 0.7;
friction = 2;
airrisist = 0.07;
maxaccel = 7;
maxjump = 12;
doubleJump = false;
doubleJumping = false;
jump = true;
pressOnce = 0;
playerHit = false;
playerHitTimer = 0;
invulnerable = false;
invulnerableTimer = 0;
var monster = new Array();
monster.push(stageOneEnemy1);
var monsterAttacking = new Array();
monsterAttacking.push(false);
var monsterAlive = new Array();
monsterAlive.push(true);
var monsterAttackingTimer = new Array();
monsterAttackingTimer.push(0);
var monsterMovement = new Array();
monsterMovement.push(0);
var removeMonster = new Array();
removeMonster.push(0);
var collect = new Array();
collect.push(stageOneButton1, stageOneButton2, stageOneButton3);
player.onEnterFrame = function () {
fadein._x = player._x;
fadein._y = player._y;
lvl_intro._x = player._x - 150;
if ((cam.tic == 30) && (TimerWarn == 1)) {
TimerWarn = 0;
timer_warning.gotoAndPlay("playslide");
}
if ((cam.tic == 10) && (PanicWarn == 1)) {
PanicWarn = 0;
panic_warning.gotoAndPlay("playslide");
}
toc--;
if (toc == 0) {
cam.tic--;
toc = 32;
}
if ((cam.tic == 0) && (fallonce == 1)) {
fallonce = 0;
cam.tic = 0;
toc = 2000;
go_fadeout();
}
if (playerHit) {
player.gotoAndStop("hit");
playerHitTimer++;
invulnerable = true;
if (playerHitTimer == 15) {
playerHitTimer = 0;
cam.hearts--;
playerHit = false;
}
}
if (invulnerable) {
invulnerableTimer++;
player._alpha = 25;
if (invulnerableTimer == 75) {
invulnerable = false;
invulnerableTimer = 0;
player._alpha = 100;
}
}
i = collect.length - 1;
while (i >= 0) {
if (player.hitTest(collect[i])) {
if (collect[i]._alpha == 100) {
_root.collectsnd.start(0, 0);
cam.count++;
}
collect[i]._alpha = 0;
}
i--;
}
if ((player._y > 600) && (fallonce == 1)) {
canMove = false;
fall_sound.start();
fallonce = 0;
go_fadeout();
}
if (cam.hearts == 5) {
cam.health.gotoAndStop("5hearts");
}
if (cam.hearts == 4) {
cam.health.gotoAndStop("4hearts");
}
if (cam.hearts == 3) {
cam.health.gotoAndStop("3hearts");
}
if (cam.hearts == 2) {
cam.health.gotoAndStop("2hearts");
}
if (cam.hearts == 1) {
cam.health.gotoAndStop("1heart");
}
if (cam.hearts == 0) {
cam.health.gotoAndStop("0hearts");
_root.gotoAndStop("gameover");
}
i = monster.length - 1;
while (i >= 0) {
if (!monsterAlive[i]) {
removeMonster[i]++;
monster[i].gotoAndStop("hit");
if (removeMonster[i] < 2) {
monster[i]._y = monster[i]._y - 10;
}
if (removeMonster[i] > 10) {
monster[i].gotoAndStop("death");
cam.ghostsleft--;
}
if (removeMonster[i] > 10) {
monster[i].removeMovieClip();
monster.splice(i, 1);
removeMonster.splice(i, 1);
monsterMovement.splice(i, 1);
monsterAttackingTimer.splice(i, 1);
monsterAlive.splice(i, 1);
monsterAttacking.splice(i, 1);
}
}
if (monsterAlive[i]) {
if (!monsterAttacking[i]) {
monsterMovement[i]++;
monster[i].gotoAndStop("idle");
if (monsterMovement[i] == 80) {
monsterMovement[i] = 0;
}
if ((monsterMovement[i] > 0) && (monsterMovement[i] < 40)) {
monster[i]._xscale = 100;
}
}
if (player.hitTest(monster[i])) {
if (is_attacking > 8) {
ranNum++;
_root.attachMovie("hit", "hit" + ranNum, _root.getNextHighestDepth(), {_x:player._x, _y:player._y - 10});
monsterAlive[i] = false;
_root.kicksnd.start(0, 0);
_root.echosnd.start(0, 0);
}
monsterAttackingTimer[i]++;
if (monsterAttackingTimer[i] > 20) {
monsterAttacking[i] = true;
monster[i].gotoAndStop("attack");
}
if (monsterAttackingTimer[i] == 60) {
monsterAttackingTimer[i] = 0;
monsterAttacking[i] = false;
ghostboosnd.stop;
}
if (monsterAttacking[i] == true) {
if (!invulnerable) {
if (player.hitTest(monster[i])) {
ranNum++;
dun_hitsnd.start();
_root.attachMovie("en_hit", "en_hit" + ranNum, _root.getNextHighestDepth(), {_x:player._x, _y:player._y - 10});
playerHit = true;
ghostboosnd.start(0, 0);
}
}
}
} else {
monsterAttacking[i] = 0;
monsterAttacking[i] = false;
}
}
i--;
}
portal_notice._x = player._x + 150;
portal_notice._y = player._y - 150;
if (portalOpen == true) {
portal_mc.lvl_portal._visible = true;
}
if (((cam.count == 3) && (portalOpen == false)) && (cam.ghostsleft == 0)) {
portalOpen = true;
portal_notice.gotoAndPlay("playslide");
}
if (player.hitTest(_root.portal_mc.lvl_portal) && (portalOpen == true)) {
canMove = false;
portalOpen = false;
toc = 2000;
playerHit = false;
invulnerable = false;
inControl = false;
xaccel = 0;
gravity = 0;
cam.count = 0;
player._alpha = 0;
_root.portal_mc.lvl_portal.gotoAndStop("entered");
}
fadeout = function () {
_root.attachMovie("fade", "newfadeout", 200);
newfadeout._x = cam._x;
newfadeout._y = cam._y;
};
go_fadeout = function () {
_root.attachMovie("go_fade", "newgo_fadeout", 200);
newgo_fadeout._x = cam._x;
newgo_fadeout._y = cam._y;
};
if (Key.isDown(65) && (canMove)) {
attacking = true;
}
if (attacking) {
is_attacking++;
if (is_attacking == 20) {
attacking = false;
is_attacking = 0;
shootOnce = 0;
}
if (is_attacking == 1) {
shootsnd.start(0, 0);
if (shootOnce == 0) {
shootsnd.stop;
}
}
}
if (doubleJumping) {
if (!attacking) {
player.gotoAndStop("double");
}
if (attacking) {
player.gotoAndStop("jumpAttack");
}
}
if (inControl == false) {
running = false;
xaccel = 0;
gravity = 0;
gravityaccel = 0;
doubleJumping = false;
jump = false;
runaccelamt = 0;
doubleJumping = false;
doubleJump = false;
}
if (jump && (!doubleJumping)) {
if (running) {
if (!attacking) {
player.gotoAndStop("run");
}
if (attacking) {
player.gotoAndStop("runAttack");
}
} else {
if (!attacking) {
player.gotoAndStop("idle");
}
if (attacking) {
player.gotoAndStop("attack");
}
}
} else if (!doubleJumping) {
if (!attacking) {
player.gotoAndStop("jump");
}
if (attacking) {
player.gotoAndStop("jumpAttack");
}
}
if (Key.isDown(39) or Key.isDown(37)) {
running = true;
} else {
running = false;
}
if (!ground.hitTest(player._x, player._y + 10, true)) {
falling = true;
grounded = false;
}
if (ground.hitTest(player._x, player._y + 11, true)) {
doubleJumping = false;
doubleJump = false;
jump = true;
grounded = true;
falling = false;
while (ground.hitTest(player._x, player._y + 9, true)) {
player._y--;
}
}
if (falling == true) {
gravity = gravity + gravityaccel;
} else {
gravity = 0;
}
if (((canMove && (Key.isDown(39))) && (xaccel < maxaccel)) && (falling == true)) {
xaccel = xaccel + (runaccelamt - airrisist);
} else if (((canMove && (Key.isDown(37))) && (xaccel > (-maxaccel))) && (falling == true)) {
xaccel = xaccel - (runaccelamt - airrisist);
} else if (((canMove && (Key.isDown(37))) && (xaccel > (-maxaccel))) && (falling == false)) {
xaccel = xaccel - runaccelamt;
} else if (((canMove && (Key.isDown(39))) && (xaccel < maxaccel)) && (falling == false)) {
xaccel = xaccel + runaccelamt;
} else if (grounded == true) {
if (xaccel > 0) {
xaccel = xaccel - friction;
}
if (xaccel < 0) {
xaccel = xaccel + friction;
}
if ((xaccel < 0) && (xaccel > friction)) {
xaccel = 0;
}
if ((xaccel > 0) && (xaccel < friction)) {
xaccel = 0;
}
} else {
if (xaccel > 0) {
xaccel = xaccel - airrisist;
}
if (xaccel < 0) {
xaccel = xaccel + airrisist;
}
if ((xaccel < 0) && (xaccel > airrisist)) {
xaccel = 0;
}
if ((xaccel > 0) && (xaccel < airrisist)) {
xaccel = 0;
}
}
if (_root.ground.hitTest(this._x, this._y - 11, true)) {
gravity = 1;
while (_root.ground.hitTest(this._x, this._y - 10, true)) {
this._y++;
}
}
if (xaccel > 0) {
player._xscale = 40;
}
if (xaccel < 0) {
player._xscale = -40;
}
if (!Key.isDown(38)) {
pressOnce = 0;
}
if ((canMove && (Key.isDown(38))) && (jump == true)) {
gravity = gravity - (Math.cos(3.141593 * ((player._rotation * -1) / 180)) * maxjump);
jump = false;
doubleJump = true;
pressOnce = 1;
_root.jumpsnd.start(0, 0);
}
if (((canMove && (Key.isDown(38))) && (doubleJump == true)) && (pressOnce == 0)) {
gravity = 0;
gravity = gravity - (Math.cos(3.141593 * ((player._rotation * -1) / 180)) * maxjump);
doubleJump = false;
doubleJumping = true;
_root.jumpsnd.start(0, 0);
}
leftx = player._x + (Math.cos(3.141593 * (((player._rotation * -1) + 180) / 180)) * 7);
lefty = player._y - (Math.sin(3.141593 * (((player._rotation * -1) + 180) / 180)) * 7);
rightx = player._x + (Math.cos(3.141593 * ((player._rotation * -1) / 180)) * 7);
righty = player._y - (Math.sin(3.141593 * ((player._rotation * -1) / 180)) * 7);
if (ground.hitTest(leftx, lefty, true)) {
xaccel = 0;
player._x++;
}
if (ground.hitTest(rightx, righty, true)) {
xaccel = 0;
player._x--;
}
cam._x = _root.player._x;
if (player._y < 400) {
cam._y = _root.player._y;
}
cam.camControl();
player._y = player._y + gravity;
player._x = player._x + xaccel;
fade.swapDepths(_root.getNextHighestDepth());
go_fade.swapDepths(_root.getNextHighestDepth());
score = cam.tic;
};
Frame 7
stop();
stage = 2;
lvl2music = new Sound();
lvl2music.attachSound("2ndlvlmusic");
lvl2music.start(0, 1000);
musicplayer = "play";
cam.playPause.gotoAndStop("pause");
cam.music_eq.gotoAndStop("play");
cam.playPause.onRollOver = function () {
if (this._currentframe == 1) {
this.gotoAndStop("pauseOver");
} else {
this.gotoAndStop("playOver");
}
};
cam.playPause.onRollOut = (cam.playPause.onReleaseOutside = function () {
if (this._currentframe == 10) {
this.gotoAndStop("pause");
} else {
this.gotoAndStop("play");
}
});
cam.playPause.onRelease = function () {
if (this._currentframe == 10) {
this.gotoAndStop("playOver");
lvl2music.stop();
cam.music_eq.gotoAndStop("stop");
} else {
this.gotoAndStop("pauseOver");
lvl2music.start(0, 1000);
cam.music_eq.gotoAndStop("play");
}
};
fall_sound = new Sound();
dun_hitsnd = new Sound();
collectsnd = new Sound();
echosnd = new Sound();
shootsnd = new Sound();
portalsnd = new Sound();
jumpsnd = new Sound();
dropsnd.attachSound("drop");
fall_sound.attachSound("fall_noise");
dun_hitsnd.attachSound("dun_hit");
collectsnd.attachSound("collectedsnd");
echosnd.attachSound("echo");
shootsnd.attachSound("shoot");
portalsnd.attachSound("portaljump");
jumpsnd.attachSound("jump");
ghostboosnd = new Sound();
ghostboosnd.attachSound("ghostboo");
cam.tic = 999;
toc = 32;
_root.fadein.gotoAndPlay(1);
cam._xscale = 120;
cam._yscale = 120;
cam.lens._xscale = 50;
cam.lens._yscale = 50;
canMove = true;
myColor = new Color(player);
myColorTransform = new Object();
myColorTransform = {rb:0, gb:0, bb:0};
myColor.setTransform(myColorTransform);
portal_mc.lvl_portal._visible = false;
player._alpha = 100;
player._x = 412.7;
player._y = 225.1;
portalOpen = false;
cam.ghostsleft = 8;
cam.hearts = 5;
cam.ectoleft = 75;
cam.count = 0;
enemyCount = 8;
fallonce = 1;
TimerWarn = 1;
PanicWarn = 1;
attacking = false;
is_attacking = 0;
inControl = true;
running = false;
gravity = 10;
gravityaccel = 1;
xaccel = 7;
runaccelamt = 0.7;
friction = 2;
airrisist = 0.07;
maxaccel = 7;
maxjump = 12;
doubleJump = false;
doubleJumping = false;
jump = true;
pressOnce = 0;
playerHit = false;
playerHitTimer = 0;
invulnerable = false;
invulnerableTimer = 0;
var monster = new Array();
monster.push(stageTwoEnemy1, stageTwoEnemy2, stageTwoEnemy3, stageTwoEnemy4, stageTwoEnemy5, stageTwoEnemy6, stageTwoEnemy7, stageTwoEnemy8);
var monsterAttacking = new Array();
monsterAttacking.push(false, false, false, false, false, false, false, false);
var monsterAlive = new Array();
monsterAlive.push(true, true, true, true, true, true, true, true);
var monsterAttackingTimer = new Array();
monsterAttackingTimer.push(0, 0, 0, 0, 0, 0, 0, 0);
var monsterMovement = new Array();
monsterMovement.push(0, 0, 0, 0, 0, 0, 0, 0);
var removeMonster = new Array();
removeMonster.push(0, 0, 0, 0, 0, 0, 0, 0);
var collect = new Array();
collect.push(stageTwoButton1, stageTwoButton2, stageTwoButton3, stageTwoButton4, stageTwoButton5, stageTwoButton6, stageTwoButton7, stageTwoButton8, stageTwoButton9, stageTwoButton10, stageTwoButton11, stageTwoButton12, stageTwoButton13, stageTwoButton14, stageTwoButton15, stageTwoButton16, stageTwoButton17, stageTwoButton18, stageTwoButton19, stageTwoButton20, stageTwoButton21, stageTwoButton22, stageTwoButton23, stageTwoButton24, stageTwoButton25, stageTwoButton26, stageTwoButton27, stageTwoButton28, stageTwoButton29, stageTwoButton30, stageTwoButton31, stageTwoButton32, stageTwoButton33, stageTwoButton34, stageTwoButton35, stageTwoButton36, stageTwoButton37, stageTwoButton38, stageTwoButton39, stageTwoButton40, stageTwoButton41, stageTwoButton42, stageTwoButton43, stageTwoButton44, stageTwoButton45, stageTwoButton46, stageTwoButton47, stageTwoButton48, stageTwoButton49, stageTwoButton50, stageTwoButton51, stageTwoButton52, stageTwoButton53, stageTwoButton54, stageTwoButton55, stageTwoButton56, stageTwoButton57, stageTwoButton58, stageTwoButton59, stageTwoButton60, stageTwoButton61, stageTwoButton62, stageTwoButton63, stageTwoButton64, stageTwoButton65, stageTwoButton66, stageTwoButton67, stageTwoButton68, stageTwoButton69, stageTwoButton70, stageTwoButton71, stageTwoButton72, stageTwoButton73, stageTwoButton74, stageTwoButton75);
player.onEnterFrame = function () {
lvl_intro._x = player._x - 150;
if ((cam.tic == 30) && (TimerWarn == 1)) {
TimerWarn = 0;
timer_warning.gotoAndPlay("playslide");
}
if ((cam.tic == 10) && (PanicWarn == 1)) {
PanicWarn = 0;
panic_warning.gotoAndPlay("playslide");
}
toc--;
if (toc == 0) {
cam.tic--;
toc = 32;
}
if ((cam.tic == 0) && (fallonce == 1)) {
fallonce = 0;
cam.tic = 0;
toc = 2000;
go_fadeout();
}
if (playerHit) {
player.gotoAndStop("hit");
playerHitTimer++;
invulnerable = true;
if (playerHitTimer == 15) {
playerHitTimer = 0;
cam.hearts--;
playerHit = false;
}
}
if (invulnerable) {
invulnerableTimer++;
player._alpha = 25;
if (invulnerableTimer == 75) {
invulnerable = false;
invulnerableTimer = 0;
player._alpha = 100;
}
}
i = collect.length - 1;
while (i >= 0) {
if (player.hitTest(collect[i])) {
if (collect[i]._alpha == 100) {
_root.collectsnd.start(0, 0);
cam.count++;
}
collect[i]._alpha = 0;
}
i--;
}
if ((player._y > 600) && (fallonce == 1)) {
canMove = false;
fall_sound.start();
fallonce = 0;
go_fadeout();
}
if (cam.hearts == 5) {
cam.health.gotoAndStop("5hearts");
}
if (cam.hearts == 4) {
cam.health.gotoAndStop("4hearts");
}
if (cam.hearts == 3) {
cam.health.gotoAndStop("3hearts");
}
if (cam.hearts == 2) {
cam.health.gotoAndStop("2hearts");
}
if (cam.hearts == 1) {
cam.health.gotoAndStop("1heart");
}
if (cam.hearts == 0) {
cam.health.gotoAndStop("0hearts");
_root.gotoAndStop("gameover");
}
i = monster.length - 1;
while (i >= 0) {
if (!monsterAlive[i]) {
removeMonster[i]++;
monster[i].gotoAndStop("hit");
if (removeMonster[i] < 2) {
monster[i]._y = monster[i]._y - 10;
}
if (removeMonster[i] > 10) {
monster[i].gotoAndStop("death");
cam.ghostsleft--;
}
if (removeMonster[i] > 10) {
monster[i].removeMovieClip();
monster.splice(i, 1);
removeMonster.splice(i, 1);
monsterMovement.splice(i, 1);
monsterAttackingTimer.splice(i, 1);
monsterAlive.splice(i, 1);
monsterAttacking.splice(i, 1);
}
}
if (monsterAlive[i]) {
if (!monsterAttacking[i]) {
monsterMovement[i]++;
monster[i].gotoAndStop("idle");
if (monsterMovement[i] == 80) {
monsterMovement[i] = 0;
}
if ((monsterMovement[i] > 0) && (monsterMovement[i] < 40)) {
monster[i]._xscale = 100;
monster[i]._x = monster[i]._x - 3;
}
if (monsterMovement[i] > 40) {
monster[i]._xscale = -100;
monster[i]._x = monster[i]._x + 3;
}
}
if (player.hitTest(monster[i])) {
if (is_attacking > 8) {
ranNum++;
_root.attachMovie("hit", "hit" + ranNum, _root.getNextHighestDepth(), {_x:player._x, _y:player._y - 10});
monsterAlive[i] = false;
_root.kicksnd.start(0, 0);
_root.echosnd.start(0, 0);
}
monsterAttackingTimer[i]++;
if (monsterAttackingTimer[i] > 20) {
monsterAttacking[i] = true;
monster[i].gotoAndStop("attack");
}
if (monsterAttackingTimer[i] == 60) {
monsterAttackingTimer[i] = 0;
monsterAttacking[i] = false;
}
if (monsterAttacking[i] == true) {
if (!invulnerable) {
if (player.hitTest(monster[i])) {
ranNum++;
dun_hitsnd.start();
_root.attachMovie("en_hit", "en_hit" + ranNum, _root.getNextHighestDepth(), {_x:player._x, _y:player._y - 10});
playerHit = true;
ghostboosnd.start(0, 0);
}
}
}
} else {
monsterAttacking[i] = 0;
monsterAttacking[i] = false;
}
}
i--;
}
portal_notice._x = player._x + 150;
portal_notice._y = player._y - 150;
if (portalOpen == true) {
portal_mc.lvl_portal._visible = true;
}
if (((cam.count == 75) && (portalOpen == false)) && (cam.ghostsleft == 0)) {
portalOpen = true;
portal_notice.gotoAndPlay("playslide");
}
if (player.hitTest(_root.portal_mc.lvl_portal) && (portalOpen == true)) {
canMove = false;
portalOpen = false;
toc = 2000;
playerHit = false;
invulnerable = false;
inControl = false;
xaccel = 0;
gravity = 0;
cam.count = 0;
player._alpha = 0;
_root.portal_mc.lvl_portal.gotoAndStop("entered");
}
fadeout = function () {
_root.attachMovie("fade", "newfadeout", 200);
newfadeout._x = cam._x;
newfadeout._y = cam._y;
};
go_fadeout = function () {
_root.attachMovie("go_fade", "newgo_fadeout", 200);
newgo_fadeout._x = cam._x;
newgo_fadeout._y = cam._y;
};
if (Key.isDown(65) && (canMove)) {
attacking = true;
}
if (attacking) {
is_attacking++;
if (is_attacking == 20) {
attacking = false;
is_attacking = 0;
shootOnce = 0;
}
if (is_attacking == 1) {
shootsnd.start(0, 0);
if (shootOnce == 0) {
shootsnd.stop;
}
}
}
if (doubleJumping) {
if (!attacking) {
player.gotoAndStop("double");
}
if (attacking) {
player.gotoAndStop("jumpAttack");
}
}
if (inControl == false) {
running = false;
xaccel = 0;
gravity = 0;
gravityaccel = 0;
doubleJumping = false;
jump = false;
runaccelamt = 0;
doubleJumping = false;
doubleJump = false;
}
if (jump && (!doubleJumping)) {
if (running) {
if (!attacking) {
player.gotoAndStop("run");
}
if (attacking) {
player.gotoAndStop("runAttack");
}
} else {
if (!attacking) {
player.gotoAndStop("idle");
}
if (attacking) {
player.gotoAndStop("attack");
}
}
} else if (!doubleJumping) {
if (!attacking) {
player.gotoAndStop("jump");
}
if (attacking) {
player.gotoAndStop("jumpAttack");
}
}
if (Key.isDown(39) or Key.isDown(37)) {
running = true;
} else {
running = false;
}
if (!ground.hitTest(player._x, player._y + 10, true)) {
falling = true;
grounded = false;
}
if (ground.hitTest(player._x, player._y + 11, true)) {
doubleJumping = false;
doubleJump = false;
jump = true;
grounded = true;
falling = false;
while (ground.hitTest(player._x, player._y + 9, true)) {
player._y--;
}
}
if (falling == true) {
gravity = gravity + gravityaccel;
} else {
gravity = 0;
}
if (((canMove && (Key.isDown(39))) && (xaccel < maxaccel)) && (falling == true)) {
xaccel = xaccel + (runaccelamt - airrisist);
} else if (((canMove && (Key.isDown(37))) && (xaccel > (-maxaccel))) && (falling == true)) {
xaccel = xaccel - (runaccelamt - airrisist);
} else if (((canMove && (Key.isDown(37))) && (xaccel > (-maxaccel))) && (falling == false)) {
xaccel = xaccel - runaccelamt;
} else if (((canMove && (Key.isDown(39))) && (xaccel < maxaccel)) && (falling == false)) {
xaccel = xaccel + runaccelamt;
} else if (grounded == true) {
if (xaccel > 0) {
xaccel = xaccel - friction;
}
if (xaccel < 0) {
xaccel = xaccel + friction;
}
if ((xaccel < 0) && (xaccel > friction)) {
xaccel = 0;
}
if ((xaccel > 0) && (xaccel < friction)) {
xaccel = 0;
}
} else {
if (xaccel > 0) {
xaccel = xaccel - airrisist;
}
if (xaccel < 0) {
xaccel = xaccel + airrisist;
}
if ((xaccel < 0) && (xaccel > airrisist)) {
xaccel = 0;
}
if ((xaccel > 0) && (xaccel < airrisist)) {
xaccel = 0;
}
}
if (_root.ground.hitTest(this._x, this._y - 11, true)) {
gravity = 1;
while (_root.ground.hitTest(this._x, this._y - 10, true)) {
this._y++;
}
}
if (xaccel > 0) {
player._xscale = 40;
}
if (xaccel < 0) {
player._xscale = -40;
}
if (!Key.isDown(38)) {
pressOnce = 0;
}
if ((canMove && (Key.isDown(38))) && (jump == true)) {
gravity = gravity - (Math.cos(3.141593 * ((player._rotation * -1) / 180)) * maxjump);
jump = false;
doubleJump = true;
pressOnce = 1;
_root.jumpsnd.start(0, 0);
}
if (((canMove && (Key.isDown(38))) && (doubleJump == true)) && (pressOnce == 0)) {
gravity = 0;
gravity = gravity - (Math.cos(3.141593 * ((player._rotation * -1) / 180)) * maxjump);
doubleJump = false;
doubleJumping = true;
_root.jumpsnd.start(0, 0);
}
leftx = player._x + (Math.cos(3.141593 * (((player._rotation * -1) + 180) / 180)) * 7);
lefty = player._y - (Math.sin(3.141593 * (((player._rotation * -1) + 180) / 180)) * 7);
rightx = player._x + (Math.cos(3.141593 * ((player._rotation * -1) / 180)) * 7);
righty = player._y - (Math.sin(3.141593 * ((player._rotation * -1) / 180)) * 7);
if (ground.hitTest(leftx, lefty, true)) {
xaccel = 0;
player._x++;
}
if (ground.hitTest(rightx, righty, true)) {
xaccel = 0;
player._x--;
}
cam._x = _root.player._x;
if (player._y < 400) {
cam._y = _root.player._y;
}
cam.camControl();
player._y = player._y + gravity;
player._x = player._x + xaccel;
fade.swapDepths(_root.getNextHighestDepth());
go_fade.swapDepths(_root.getNextHighestDepth());
score = cam.tic;
};
Frame 8
stop();
portalOpen = false;
Frame 9
stop();
stage = 3;
lvl3music = new Sound();
lvl3music.attachSound("3rdlvlmusic");
lvl3music.start(0, 1000);
musicplayer = "play";
cam.playPause.gotoAndStop("pause");
cam.music_eq.gotoAndStop("play");
cam.playPause.onRollOver = function () {
if (this._currentframe == 1) {
this.gotoAndStop("pauseOver");
} else {
this.gotoAndStop("playOver");
}
};
cam.playPause.onRollOut = (cam.playPause.onReleaseOutside = function () {
if (this._currentframe == 10) {
this.gotoAndStop("pause");
} else {
this.gotoAndStop("play");
}
});
cam.playPause.onRelease = function () {
if (this._currentframe == 10) {
this.gotoAndStop("playOver");
lvl3music.stop();
cam.music_eq.gotoAndStop("stop");
} else {
this.gotoAndStop("pauseOver");
lvl3music.start(0, 1000);
cam.music_eq.gotoAndStop("play");
}
};
fall_sound = new Sound();
dun_hitsnd = new Sound();
collectsnd = new Sound();
echosnd = new Sound();
shootsnd = new Sound();
portalsnd = new Sound();
jumpsnd = new Sound();
dropsnd.attachSound("drop");
fall_sound.attachSound("fall_noise");
dun_hitsnd.attachSound("dun_hit");
collectsnd.attachSound("collectedsnd");
echosnd.attachSound("echo");
shootsnd.attachSound("shoot");
portalsnd.attachSound("portaljump");
jumpsnd.attachSound("jump");
ghostboosnd = new Sound();
ghostboosnd.attachSound("ghostboo");
cam.tic = 999;
toc = 32;
cam._xscale = 120;
cam._yscale = 120;
cam.lens._xscale = 50;
cam.lens._yscale = 50;
canMove = true;
myColor = new Color(player);
myColorTransform = new Object();
myColorTransform = {rb:0, gb:0, bb:0};
myColor.setTransform(myColorTransform);
lvl_portal._visible = false;
player._alpha = 100;
player._x = 412.7;
player._y = 185.1;
portalOpen = false;
cam.ghostsleft = 9;
cam.hearts = 5;
cam.count = 0;
cam.ectoleft = 51;
fallonce = 1;
TimerWarn = 1;
PanicWarn = 1;
attacking = false;
is_attacking = 0;
inControl = true;
running = false;
gravity = 10;
gravityaccel = 1;
xaccel = 7;
runaccelamt = 0.7;
friction = 2;
airrisist = 0.07;
maxaccel = 7;
maxjump = 12;
doubleJump = false;
doubleJumping = false;
jump = true;
pressOnce = 0;
playerHit = false;
playerHitTimer = 0;
invulnerable = false;
invulnerableTimer = 0;
var monster = new Array();
monster.push(stageThreeEnemy1, stageThreeEnemy2, stageThreeEnemy3, stageThreeEnemy4, stageThreeEnemy5, stageThreeEnemy6, stageThreeEnemy7, stageThreeEnemy8, stageThreeEnemy9);
var monsterAttacking = new Array();
monsterAttacking.push(false, false, false, false, false, false, false, false, false);
var monsterAlive = new Array();
monsterAlive.push(true, true, true, true, true, true, true, true, true);
var monsterAttackingTimer = new Array();
monsterAttackingTimer.push(0, 0, 0, 0, 0, 0, 0, 0, 0);
var monsterMovement = new Array();
monsterMovement.push(0, 0, 0, 0, 0, 0, 0, 0, 0);
var removeMonster = new Array();
removeMonster.push(0, 0, 0, 0, 0, 0, 0, 0, 0);
var collect = new Array();
collect.push(stageThreeButton1, stageThreeButton2, stageThreeButton3, stageThreeButton4, stageThreeButton5, stageThreeButton6, stageThreeButton7, stageThreeButton8, stageThreeButton9, stageThreeButton10, stageThreeButton11, stageThreeButton12, stageThreeButton13, stageThreeButton14, stageThreeButton15, stageThreeButton16, stageThreeButton17, stageThreeButton18, stageThreeButton19, stageThreeButton20, stageThreeButton21, stageThreeButton22, stageThreeButton23, stageThreeButton24, stageThreeButton25, stageThreeButton26, stageThreeButton27, stageThreeButton28, stageThreeButton29, stageThreeButton30, stageThreeButton31, stageThreeButton32, stageThreeButton33, stageThreeButton34, stageThreeButton35, stageThreeButton36, stageThreeButton37, stageThreeButton38, stageThreeButton39, stageThreeButton40, stageThreeButton41, stageThreeButton42, stageThreeButton43, stageThreeButton44, stageThreeButton45, stageThreeButton46, stageThreeButton47, stageThreeButton48, stageThreeButton49, stageThreeButton50, stageThreeButton51);
player.onEnterFrame = function () {
lvl_intro._x = player._x - 150;
if ((cam.tic == 30) && (TimerWarn == 1)) {
TimerWarn = 0;
timer_warning.gotoAndPlay("playslide");
}
if ((cam.tic == 10) && (PanicWarn == 1)) {
PanicWarn = 0;
panic_warning.gotoAndPlay("playslide");
}
toc--;
if (toc == 0) {
cam.tic--;
toc = 32;
}
if ((cam.tic == 0) && (fallonce == 1)) {
fallonce = 0;
cam.tic = 0;
toc = 2000;
go_fadeout();
}
if (playerHit) {
player.gotoAndStop("hit");
playerHitTimer++;
invulnerable = true;
if (playerHitTimer == 15) {
playerHitTimer = 0;
cam.hearts--;
playerHit = false;
}
}
if (invulnerable) {
invulnerableTimer++;
player._alpha = 25;
if (invulnerableTimer == 75) {
invulnerable = false;
invulnerableTimer = 0;
player._alpha = 100;
}
}
i = collect.length - 1;
while (i >= 0) {
if (player.hitTest(collect[i])) {
if (collect[i]._alpha == 100) {
_root.collectsnd.start(0, 0);
cam.count++;
}
collect[i]._alpha = 0;
}
i--;
}
if ((player._y > 600) && (fallonce == 1)) {
canMove = false;
fall_sound.start();
fallonce = 0;
go_fadeout();
}
if (cam.hearts == 5) {
cam.health.gotoAndStop("5hearts");
}
if (cam.hearts == 4) {
cam.health.gotoAndStop("4hearts");
}
if (cam.hearts == 3) {
cam.health.gotoAndStop("3hearts");
}
if (cam.hearts == 2) {
cam.health.gotoAndStop("2hearts");
}
if (cam.hearts == 1) {
cam.health.gotoAndStop("1heart");
}
if (cam.hearts == 0) {
cam.health.gotoAndStop("0hearts");
_root.gotoAndStop("gameover");
}
i = monster.length - 1;
while (i >= 0) {
if (!monsterAlive[i]) {
removeMonster[i]++;
monster[i].gotoAndStop("hit");
if (removeMonster[i] < 2) {
monster[i]._y = monster[i]._y - 10;
}
if (removeMonster[i] > 10) {
monster[i].gotoAndStop("death");
cam.ghostsleft--;
}
if (removeMonster[i] > 10) {
monster[i].removeMovieClip();
monster.splice(i, 1);
removeMonster.splice(i, 1);
monsterMovement.splice(i, 1);
monsterAttackingTimer.splice(i, 1);
monsterAlive.splice(i, 1);
monsterAttacking.splice(i, 1);
}
}
if (monsterAlive[i]) {
if (!monsterAttacking[i]) {
monsterMovement[i]++;
monster[i].gotoAndStop("idle");
if (monsterMovement[i] == 80) {
monsterMovement[i] = 0;
}
if ((monsterMovement[i] > 0) && (monsterMovement[i] < 40)) {
monster[i]._xscale = 100;
monster[i]._x = monster[i]._x - 3;
}
if (monsterMovement[i] > 40) {
monster[i]._xscale = -100;
monster[i]._x = monster[i]._x + 3;
}
}
if (player.hitTest(monster[i])) {
if (is_attacking > 8) {
ranNum++;
_root.attachMovie("hit", "hit" + ranNum, _root.getNextHighestDepth(), {_x:player._x, _y:player._y - 10});
monsterAlive[i] = false;
_root.kicksnd.start(0, 0);
_root.echosnd.start(0, 0);
}
monsterAttackingTimer[i]++;
if (monsterAttackingTimer[i] > 20) {
monsterAttacking[i] = true;
monster[i].gotoAndStop("attack");
}
if (monsterAttackingTimer[i] == 60) {
monsterAttackingTimer[i] = 0;
monsterAttacking[i] = false;
}
if (monsterAttacking[i] == true) {
if (!invulnerable) {
if (player.hitTest(monster[i])) {
ranNum++;
dun_hitsnd.start();
_root.attachMovie("en_hit", "en_hit" + ranNum, _root.getNextHighestDepth(), {_x:player._x, _y:player._y - 10});
playerHit = true;
ghostboosnd.start(0, 0);
}
}
}
} else {
monsterAttacking[i] = 0;
monsterAttacking[i] = false;
}
}
i--;
}
portal_notice._x = player._x + 150;
portal_notice._y = player._y - 150;
if (portalOpen == true) {
_root.lvl_portal._visible = true;
}
if (((cam.count == 51) && (portalOpen == false)) && (cam.ghostsleft == 0)) {
portalOpen = true;
portal_notice.gotoAndPlay("playslide");
}
if (player.hitTest(_root.lvl_portal) && (portalOpen == true)) {
canMove = false;
portalOpen = false;
toc = 2000;
playerHit = false;
invulnerable = false;
inControl = false;
xaccel = 0;
gravity = 0;
cam.count = 0;
player._alpha = 0;
_root.lvl_portal.gotoAndStop("entered");
}
fadeout = function () {
_root.attachMovie("fade", "newfadeout", 200);
newfadeout._x = cam._x;
newfadeout._y = cam._y;
};
go_fadeout = function () {
_root.attachMovie("go_fade", "newgo_fadeout", 200);
newgo_fadeout._x = cam._x;
newgo_fadeout._y = cam._y;
};
if (Key.isDown(65) && (canMove)) {
attacking = true;
}
if (attacking) {
is_attacking++;
if (is_attacking == 20) {
attacking = false;
is_attacking = 0;
shootOnce = 0;
}
if (is_attacking == 1) {
shootsnd.start(0, 0);
if (shootOnce == 0) {
shootsnd.stop;
}
}
}
if (doubleJumping) {
if (!attacking) {
player.gotoAndStop("double");
}
if (attacking) {
player.gotoAndStop("jumpAttack");
}
}
if (inControl == false) {
running = false;
xaccel = 0;
gravity = 0;
gravityaccel = 0;
doubleJumping = false;
jump = false;
runaccelamt = 0;
doubleJumping = false;
doubleJump = false;
}
if (jump && (!doubleJumping)) {
if (running) {
if (!attacking) {
player.gotoAndStop("run");
}
if (attacking) {
player.gotoAndStop("runAttack");
}
} else {
if (!attacking) {
player.gotoAndStop("idle");
}
if (attacking) {
player.gotoAndStop("attack");
}
}
} else if (!doubleJumping) {
if (!attacking) {
player.gotoAndStop("jump");
}
if (attacking) {
player.gotoAndStop("jumpAttack");
}
}
if (Key.isDown(39) or Key.isDown(37)) {
running = true;
} else {
running = false;
}
if (!ground.hitTest(player._x, player._y + 10, true)) {
falling = true;
grounded = false;
}
if (ground.hitTest(player._x, player._y + 11, true)) {
doubleJumping = false;
doubleJump = false;
jump = true;
grounded = true;
falling = false;
while (ground.hitTest(player._x, player._y + 9, true)) {
player._y--;
}
}
if (falling == true) {
gravity = gravity + gravityaccel;
} else {
gravity = 0;
}
if (((canMove && (Key.isDown(39))) && (xaccel < maxaccel)) && (falling == true)) {
xaccel = xaccel + (runaccelamt - airrisist);
} else if (((canMove && (Key.isDown(37))) && (xaccel > (-maxaccel))) && (falling == true)) {
xaccel = xaccel - (runaccelamt - airrisist);
} else if (((canMove && (Key.isDown(37))) && (xaccel > (-maxaccel))) && (falling == false)) {
xaccel = xaccel - runaccelamt;
} else if (((canMove && (Key.isDown(39))) && (xaccel < maxaccel)) && (falling == false)) {
xaccel = xaccel + runaccelamt;
} else if (grounded == true) {
if (xaccel > 0) {
xaccel = xaccel - friction;
}
if (xaccel < 0) {
xaccel = xaccel + friction;
}
if ((xaccel < 0) && (xaccel > friction)) {
xaccel = 0;
}
if ((xaccel > 0) && (xaccel < friction)) {
xaccel = 0;
}
} else {
if (xaccel > 0) {
xaccel = xaccel - airrisist;
}
if (xaccel < 0) {
xaccel = xaccel + airrisist;
}
if ((xaccel < 0) && (xaccel > airrisist)) {
xaccel = 0;
}
if ((xaccel > 0) && (xaccel < airrisist)) {
xaccel = 0;
}
}
if (_root.ground.hitTest(this._x, this._y - 11, true)) {
gravity = 1;
while (_root.ground.hitTest(this._x, this._y - 10, true)) {
this._y++;
}
}
if (xaccel > 0) {
player._xscale = 40;
}
if (xaccel < 0) {
player._xscale = -40;
}
if (!Key.isDown(38)) {
pressOnce = 0;
}
if ((canMove && (Key.isDown(38))) && (jump == true)) {
gravity = gravity - (Math.cos(3.141593 * ((player._rotation * -1) / 180)) * maxjump);
jump = false;
doubleJump = true;
pressOnce = 1;
_root.jumpsnd.start(0, 0);
}
if (((canMove && (Key.isDown(38))) && (doubleJump == true)) && (pressOnce == 0)) {
gravity = 0;
gravity = gravity - (Math.cos(3.141593 * ((player._rotation * -1) / 180)) * maxjump);
doubleJump = false;
doubleJumping = true;
_root.jumpsnd.start(0, 0);
}
leftx = player._x + (Math.cos(3.141593 * (((player._rotation * -1) + 180) / 180)) * 7);
lefty = player._y - (Math.sin(3.141593 * (((player._rotation * -1) + 180) / 180)) * 7);
rightx = player._x + (Math.cos(3.141593 * ((player._rotation * -1) / 180)) * 7);
righty = player._y - (Math.sin(3.141593 * ((player._rotation * -1) / 180)) * 7);
if (ground.hitTest(leftx, lefty, true)) {
xaccel = 0;
player._x++;
}
if (ground.hitTest(rightx, righty, true)) {
xaccel = 0;
player._x--;
}
cam._x = _root.player._x;
if (player._y < 400) {
cam._y = _root.player._y;
}
cam.camControl();
player._y = player._y + gravity;
player._x = player._x + xaccel;
fade.swapDepths(_root.getNextHighestDepth());
go_fade.swapDepths(_root.getNextHighestDepth());
score = cam.tic;
};
Frame 10
stop();
portalOpen = false;
Frame 11
stop();
stage = 4;
lvl4music = new Sound();
lvl4music.attachSound("4thlvlmusic");
lvl4music.start(0, 1000);
musicplayer = "play";
cam.playPause.gotoAndStop("pause");
cam.music_eq.gotoAndStop("play");
cam.playPause.onRollOver = function () {
if (this._currentframe == 1) {
this.gotoAndStop("pauseOver");
} else {
this.gotoAndStop("playOver");
}
};
cam.playPause.onRollOut = (cam.playPause.onReleaseOutside = function () {
if (this._currentframe == 10) {
this.gotoAndStop("pause");
} else {
this.gotoAndStop("play");
}
});
cam.playPause.onRelease = function () {
if (this._currentframe == 10) {
this.gotoAndStop("playOver");
lvl4music.stop();
cam.music_eq.gotoAndStop("stop");
} else {
this.gotoAndStop("pauseOver");
lvl4music.start(0, 1000);
cam.music_eq.gotoAndStop("play");
}
};
fall_sound = new Sound();
dun_hitsnd = new Sound();
collectsnd = new Sound();
echosnd = new Sound();
shootsnd = new Sound();
portalsnd = new Sound();
jumpsnd = new Sound();
dropsnd.attachSound("drop");
fall_sound.attachSound("fall_noise");
dun_hitsnd.attachSound("dun_hit");
collectsnd.attachSound("collectedsnd");
echosnd.attachSound("echo");
shootsnd.attachSound("shoot");
portalsnd.attachSound("portaljump");
jumpsnd.attachSound("jump");
ghostboosnd = new Sound();
ghostboosnd.attachSound("ghostboo");
cam.tic = 999;
toc = 32;
cam._xscale = 120;
cam._yscale = 120;
cam.lens._xscale = 50;
cam.lens._yscale = 50;
canMove = true;
myColor = new Color(player);
myColorTransform = new Object();
myColorTransform = {rb:0, gb:0, bb:0};
myColor.setTransform(myColorTransform);
lvl_portal._visible = false;
player._alpha = 100;
player._x = 388.7;
player._y = 127.1;
portalOpen = false;
cam.ghostsleft = 6;
cam.hearts = 5;
cam.count = 0;
cam.ectoleft = 57;
fallonce = 1;
TimerWarn = 1;
PanicWarn = 1;
attacking = false;
is_attacking = 0;
inControl = true;
running = false;
gravity = 10;
gravityaccel = 1;
xaccel = 7;
runaccelamt = 0.7;
friction = 2;
airrisist = 0.07;
maxaccel = 7;
maxjump = 12;
doubleJump = false;
doubleJumping = false;
jump = true;
pressOnce = 0;
playerHit = false;
playerHitTimer = 0;
invulnerable = false;
invulnerableTimer = 0;
var monster = new Array();
monster.push(stageFourEnemy1, stageFourEnemy2, stageFourEnemy3, stageFourEnemy4, stageFourEnemy5, stageFourEnemy6);
var monsterAttacking = new Array();
monsterAttacking.push(false, false, false, false, false, false, false, false, false);
var monsterAlive = new Array();
monsterAlive.push(true, true, true, true, true, true, true, true, true);
var monsterAttackingTimer = new Array();
monsterAttackingTimer.push(0, 0, 0, 0, 0, 0, 0, 0, 0);
var monsterMovement = new Array();
monsterMovement.push(0, 0, 0, 0, 0, 0, 0, 0, 0);
var removeMonster = new Array();
removeMonster.push(0, 0, 0, 0, 0, 0, 0, 0, 0);
var collect = new Array();
collect.push(stageFourButton1, stageFourButton2, stageFourButton3, stageFourButton4, stageFourButton5, stageFourButton6, stageFourButton7, stageFourButton8, stageFourButton9, stageFourButton10, stageFourButton11, stageFourButton12, stageFourButton13, stageFourButton14, stageFourButton15, stageFourButton16, stageFourButton17, stageFourButton18, stageFourButton19, stageFourButton20, stageFourButton21, stageFourButton22, stageFourButton23, stageFourButton24, stageFourButton25, stageFourButton26, stageFourButton27, stageFourButton28, stageFourButton29, stageFourButton30, stageFourButton31, stageFourButton32, stageFourButton33, stageFourButton34, stageFourButton35, stageFourButton36, stageFourButton37, stageFourButton38, stageFourButton39, stageFourButton40, stageFourButton41, stageFourButton42, stageFourButton43, stageFourButton44, stageFourButton45, stageFourButton46, stageFourButton47, stageFourButton48, stageFourButton49, stageFourButton50, stageFourButton51, stageFourButton52, stageFourButton53, stageFourButton54, stageFourButton55, stageFourButton56, stageFourButton57);
player.onEnterFrame = function () {
lvl_intro._x = player._x - 150;
if ((cam.tic == 30) && (TimerWarn == 1)) {
TimerWarn = 0;
timer_warning.gotoAndPlay("playslide");
}
if ((cam.tic == 10) && (PanicWarn == 1)) {
PanicWarn = 0;
panic_warning.gotoAndPlay("playslide");
}
toc--;
if (toc == 0) {
cam.tic--;
toc = 32;
}
if ((cam.tic == 0) && (fallonce == 1)) {
fallonce = 0;
cam.tic = 0;
toc = 2000;
go_fadeout();
}
if (playerHit) {
player.gotoAndStop("hit");
playerHitTimer++;
invulnerable = true;
if (playerHitTimer == 15) {
playerHitTimer = 0;
cam.hearts--;
playerHit = false;
}
}
if (invulnerable) {
invulnerableTimer++;
player._alpha = 25;
if (invulnerableTimer == 75) {
invulnerable = false;
invulnerableTimer = 0;
player._alpha = 100;
}
}
i = collect.length - 1;
while (i >= 0) {
if (player.hitTest(collect[i])) {
if (collect[i]._alpha == 100) {
_root.collectsnd.start(0, 0);
cam.count++;
}
collect[i]._alpha = 0;
}
i--;
}
if ((player._y > 600) && (fallonce == 1)) {
canMove = false;
fall_sound.start();
fallonce = 0;
go_fadeout();
}
if (cam.hearts == 5) {
cam.health.gotoAndStop("5hearts");
}
if (cam.hearts == 4) {
cam.health.gotoAndStop("4hearts");
}
if (cam.hearts == 3) {
cam.health.gotoAndStop("3hearts");
}
if (cam.hearts == 2) {
cam.health.gotoAndStop("2hearts");
}
if (cam.hearts == 1) {
cam.health.gotoAndStop("1heart");
}
if (cam.hearts == 0) {
cam.health.gotoAndStop("0hearts");
_root.gotoAndStop("gameover");
}
i = monster.length - 1;
while (i >= 0) {
if (!monsterAlive[i]) {
removeMonster[i]++;
monster[i].gotoAndStop("hit");
if (removeMonster[i] < 2) {
monster[i]._y = monster[i]._y - 10;
}
if (removeMonster[i] > 10) {
monster[i].gotoAndStop("death");
cam.ghostsleft--;
}
if (removeMonster[i] > 10) {
monster[i].removeMovieClip();
monster.splice(i, 1);
removeMonster.splice(i, 1);
monsterMovement.splice(i, 1);
monsterAttackingTimer.splice(i, 1);
monsterAlive.splice(i, 1);
monsterAttacking.splice(i, 1);
}
}
if (monsterAlive[i]) {
if (!monsterAttacking[i]) {
monsterMovement[i]++;
monster[i].gotoAndStop("idle");
if (monsterMovement[i] == 80) {
monsterMovement[i] = 0;
}
if ((monsterMovement[i] > 0) && (monsterMovement[i] < 40)) {
monster[i]._xscale = 100;
monster[i]._x = monster[i]._x - 3;
}
if (monsterMovement[i] > 40) {
monster[i]._xscale = -100;
monster[i]._x = monster[i]._x + 3;
}
}
if (player.hitTest(monster[i])) {
if (is_attacking > 8) {
ranNum++;
_root.attachMovie("hit", "hit" + ranNum, _root.getNextHighestDepth(), {_x:player._x, _y:player._y - 10});
monsterAlive[i] = false;
_root.kicksnd.start(0, 0);
_root.echosnd.start(0, 0);
}
monsterAttackingTimer[i]++;
if (monsterAttackingTimer[i] > 20) {
monsterAttacking[i] = true;
monster[i].gotoAndStop("attack");
}
if (monsterAttackingTimer[i] == 60) {
monsterAttackingTimer[i] = 0;
monsterAttacking[i] = false;
}
if (monsterAttacking[i] == true) {
if (!invulnerable) {
if (player.hitTest(monster[i])) {
ranNum++;
dun_hitsnd.start();
_root.attachMovie("en_hit", "en_hit" + ranNum, _root.getNextHighestDepth(), {_x:player._x, _y:player._y - 10});
playerHit = true;
ghostboosnd.start(0, 0);
}
}
}
} else {
monsterAttacking[i] = 0;
monsterAttacking[i] = false;
}
}
i--;
}
portal_notice._x = player._x + 150;
portal_notice._y = player._y - 150;
if (portalOpen == true) {
_root.lvl_portal._visible = true;
}
if (((cam.count == 57) && (portalOpen == false)) && (cam.ghostsleft == 0)) {
portalOpen = true;
portal_notice.gotoAndPlay("playslide");
}
if (player.hitTest(_root.lvl_portal) && (portalOpen == true)) {
canMove = false;
portalOpen = false;
toc = 2000;
playerHit = false;
invulnerable = false;
inControl = false;
xaccel = 0;
gravity = 0;
cam.count = 0;
player._alpha = 0;
_root.lvl_portal.gotoAndStop("entered");
}
fadeout = function () {
_root.attachMovie("fade", "newfadeout", 200);
newfadeout._x = cam._x;
newfadeout._y = cam._y;
};
go_fadeout = function () {
_root.attachMovie("go_fade", "newgo_fadeout", 200);
newgo_fadeout._x = cam._x;
newgo_fadeout._y = cam._y;
};
if (Key.isDown(65) && (canMove)) {
attacking = true;
}
if (attacking) {
is_attacking++;
if (is_attacking == 20) {
attacking = false;
is_attacking = 0;
shootOnce = 0;
}
if (is_attacking == 1) {
shootsnd.start(0, 0);
if (shootOnce == 0) {
shootsnd.stop;
}
}
}
if (doubleJumping) {
if (!attacking) {
player.gotoAndStop("double");
}
if (attacking) {
player.gotoAndStop("jumpAttack");
}
}
if (inControl == false) {
running = false;
xaccel = 0;
gravity = 0;
gravityaccel = 0;
doubleJumping = false;
jump = false;
runaccelamt = 0;
doubleJumping = false;
doubleJump = false;
}
if (jump && (!doubleJumping)) {
if (running) {
if (!attacking) {
player.gotoAndStop("run");
}
if (attacking) {
player.gotoAndStop("runAttack");
}
} else {
if (!attacking) {
player.gotoAndStop("idle");
}
if (attacking) {
player.gotoAndStop("attack");
}
}
} else if (!doubleJumping) {
if (!attacking) {
player.gotoAndStop("jump");
}
if (attacking) {
player.gotoAndStop("jumpAttack");
}
}
if (Key.isDown(39) or Key.isDown(37)) {
running = true;
} else {
running = false;
}
if (!ground.hitTest(player._x, player._y + 10, true)) {
falling = true;
grounded = false;
}
if (ground.hitTest(player._x, player._y + 11, true)) {
doubleJumping = false;
doubleJump = false;
jump = true;
grounded = true;
falling = false;
while (ground.hitTest(player._x, player._y + 9, true)) {
player._y--;
}
}
if (falling == true) {
gravity = gravity + gravityaccel;
} else {
gravity = 0;
}
if (((canMove && (Key.isDown(39))) && (xaccel < maxaccel)) && (falling == true)) {
xaccel = xaccel + (runaccelamt - airrisist);
} else if (((canMove && (Key.isDown(37))) && (xaccel > (-maxaccel))) && (falling == true)) {
xaccel = xaccel - (runaccelamt - airrisist);
} else if (((canMove && (Key.isDown(37))) && (xaccel > (-maxaccel))) && (falling == false)) {
xaccel = xaccel - runaccelamt;
} else if (((canMove && (Key.isDown(39))) && (xaccel < maxaccel)) && (falling == false)) {
xaccel = xaccel + runaccelamt;
} else if (grounded == true) {
if (xaccel > 0) {
xaccel = xaccel - friction;
}
if (xaccel < 0) {
xaccel = xaccel + friction;
}
if ((xaccel < 0) && (xaccel > friction)) {
xaccel = 0;
}
if ((xaccel > 0) && (xaccel < friction)) {
xaccel = 0;
}
} else {
if (xaccel > 0) {
xaccel = xaccel - airrisist;
}
if (xaccel < 0) {
xaccel = xaccel + airrisist;
}
if ((xaccel < 0) && (xaccel > airrisist)) {
xaccel = 0;
}
if ((xaccel > 0) && (xaccel < airrisist)) {
xaccel = 0;
}
}
if (_root.ground.hitTest(this._x, this._y - 11, true)) {
gravity = 1;
while (_root.ground.hitTest(this._x, this._y - 10, true)) {
this._y++;
}
}
if (xaccel > 0) {
player._xscale = 40;
}
if (xaccel < 0) {
player._xscale = -40;
}
if (!Key.isDown(38)) {
pressOnce = 0;
}
if ((canMove && (Key.isDown(38))) && (jump == true)) {
gravity = gravity - (Math.cos(3.141593 * ((player._rotation * -1) / 180)) * maxjump);
jump = false;
doubleJump = true;
pressOnce = 1;
_root.jumpsnd.start(0, 0);
}
if (((canMove && (Key.isDown(38))) && (doubleJump == true)) && (pressOnce == 0)) {
gravity = 0;
gravity = gravity - (Math.cos(3.141593 * ((player._rotation * -1) / 180)) * maxjump);
doubleJump = false;
doubleJumping = true;
_root.jumpsnd.start(0, 0);
}
leftx = player._x + (Math.cos(3.141593 * (((player._rotation * -1) + 180) / 180)) * 7);
lefty = player._y - (Math.sin(3.141593 * (((player._rotation * -1) + 180) / 180)) * 7);
rightx = player._x + (Math.cos(3.141593 * ((player._rotation * -1) / 180)) * 7);
righty = player._y - (Math.sin(3.141593 * ((player._rotation * -1) / 180)) * 7);
if (ground.hitTest(leftx, lefty, true)) {
xaccel = 0;
player._x++;
}
if (ground.hitTest(rightx, righty, true)) {
xaccel = 0;
player._x--;
}
cam._x = _root.player._x;
if (player._y < 400) {
cam._y = _root.player._y;
}
cam.camControl();
player._y = player._y + gravity;
player._x = player._x + xaccel;
fade.swapDepths(_root.getNextHighestDepth());
go_fade.swapDepths(_root.getNextHighestDepth());
score = cam.tic;
};
Frame 12
stop();
portalOpen = false;
Frame 13
stop();
stage = 5;
lvl5music = new Sound();
lvl5music.attachSound("5thlvlmusic");
lvl5music.start(0, 1000);
musicplayer = "play";
cam.playPause.gotoAndStop("pause");
cam.music_eq.gotoAndStop("play");
cam.playPause.onRollOver = function () {
if (this._currentframe == 1) {
this.gotoAndStop("pauseOver");
} else {
this.gotoAndStop("playOver");
}
};
cam.playPause.onRollOut = (cam.playPause.onReleaseOutside = function () {
if (this._currentframe == 10) {
this.gotoAndStop("pause");
} else {
this.gotoAndStop("play");
}
});
cam.playPause.onRelease = function () {
if (this._currentframe == 10) {
this.gotoAndStop("playOver");
lvl5music.stop();
cam.music_eq.gotoAndStop("stop");
} else {
this.gotoAndStop("pauseOver");
lvl5music.start(0, 1000);
cam.music_eq.gotoAndStop("play");
}
};
fall_sound = new Sound();
dun_hitsnd = new Sound();
collectsnd = new Sound();
echosnd = new Sound();
shootsnd = new Sound();
portalsnd = new Sound();
jumpsnd = new Sound();
dropsnd.attachSound("drop");
fall_sound.attachSound("fall_noise");
dun_hitsnd.attachSound("dun_hit");
collectsnd.attachSound("collectedsnd");
echosnd.attachSound("echo");
shootsnd.attachSound("shoot");
portalsnd.attachSound("portaljump");
jumpsnd.attachSound("jump");
ghostboosnd = new Sound();
ghostboosnd.attachSound("ghostboo");
cam.tic = 999;
toc = 32;
cam._xscale = 120;
cam._yscale = 120;
cam.lens._xscale = 50;
cam.lens._yscale = 50;
canMove = true;
myColor = new Color(player);
myColorTransform = new Object();
myColorTransform = {rb:0, gb:0, bb:0};
myColor.setTransform(myColorTransform);
lvl_portal._visible = false;
player._alpha = 100;
player._x = 412.7;
player._y = 225.1;
portalOpen = false;
cam.ghostsleft = 9;
cam.hearts = 5;
cam.count = 0;
cam.ectoleft = 69;
fallonce = 1;
TimerWarn = 1;
PanicWarn = 1;
attacking = false;
is_attacking = 0;
inControl = true;
running = false;
gravity = 10;
gravityaccel = 1;
xaccel = 7;
runaccelamt = 0.7;
friction = 2;
airrisist = 0.07;
maxaccel = 7;
maxjump = 12;
doubleJump = false;
doubleJumping = false;
jump = true;
pressOnce = 0;
playerHit = false;
playerHitTimer = 0;
invulnerable = false;
invulnerableTimer = 0;
var monster = new Array();
monster.push(stageFiveEnemy1, stageFiveEnemy2, stageFiveEnemy3, stageFiveEnemy4, stageFiveEnemy5, stageFiveEnemy6, stageFiveEnemy7, stageFiveEnemy8, stageFiveEnemy9);
var monsterAttacking = new Array();
monsterAttacking.push(false, false, false, false, false, false, false, false, false);
var monsterAlive = new Array();
monsterAlive.push(true, true, true, true, true, true, true, true, true);
var monsterAttackingTimer = new Array();
monsterAttackingTimer.push(0, 0, 0, 0, 0, 0, 0, 0, 0);
var monsterMovement = new Array();
monsterMovement.push(0, 0, 0, 0, 0, 0, 0, 0, 0);
var removeMonster = new Array();
removeMonster.push(0, 0, 0, 0, 0, 0, 0, 0, 0);
var collect = new Array();
collect.push(stageFiveButton1, stageFiveButton2, stageFiveButton3, stageFiveButton4, stageFiveButton5, stageFiveButton6, stageFiveButton7, stageFiveButton8, stageFiveButton9, stageFiveButton10, stageFiveButton11, stageFiveButton12, stageFiveButton13, stageFiveButton14, stageFiveButton15, stageFiveButton16, stageFiveButton17, stageFiveButton18, stageFiveButton19, stageFiveButton20, stageFiveButton21, stageFiveButton22, stageFiveButton23, stageFiveButton24, stageFiveButton25, stageFiveButton26, stageFiveButton27, stageFiveButton28, stageFiveButton29, stageFiveButton30, stageFiveButton31, stageFiveButton32, stageFiveButton33, stageFiveButton34, stageFiveButton35, stageFiveButton36, stageFiveButton37, stageFiveButton38, stageFiveButton39, stageFiveButton40, stageFiveButton41, stageFiveButton42, stageFiveButton43, stageFiveButton44, stageFiveButton45, stageFiveButton46, stageFiveButton47, stageFiveButton48, stageFiveButton49, stageFiveButton50, stageFiveButton51, stageFiveButton52, stageFiveButton53, stageFiveButton54, stageFiveButton55, stageFiveButton56, stageFiveButton57, stageFiveButton58, stageFiveButton59, stageFiveButton60, stageFiveButton61, stageFiveButton62, stageFiveButton63, stageFiveButton64, stageFiveButton65, stageFiveButton66, stageFiveButton67, stageFiveButton68, stageFiveButton69);
player.onEnterFrame = function () {
lvl_intro._x = player._x - 150;
if ((cam.tic == 30) && (TimerWarn == 1)) {
TimerWarn = 0;
timer_warning.gotoAndPlay("playslide");
}
if ((cam.tic == 10) && (PanicWarn == 1)) {
PanicWarn = 0;
panic_warning.gotoAndPlay("playslide");
}
toc--;
if (toc == 0) {
cam.tic--;
toc = 32;
}
if ((cam.tic == 0) && (fallonce == 1)) {
fallonce = 0;
cam.tic = 0;
toc = 2000;
go_fadeout();
}
if (playerHit) {
player.gotoAndStop("hit");
playerHitTimer++;
invulnerable = true;
if (playerHitTimer == 15) {
playerHitTimer = 0;
cam.hearts--;
playerHit = false;
}
}
if (invulnerable) {
invulnerableTimer++;
player._alpha = 25;
if (invulnerableTimer == 75) {
invulnerable = false;
invulnerableTimer = 0;
player._alpha = 100;
}
}
i = collect.length - 1;
while (i >= 0) {
if (player.hitTest(collect[i])) {
if (collect[i]._alpha == 100) {
_root.collectsnd.start(0, 0);
cam.count++;
}
collect[i]._alpha = 0;
}
i--;
}
if ((player._y > 600) && (fallonce == 1)) {
canMove = false;
fall_sound.start();
fallonce = 0;
go_fadeout();
}
if (cam.hearts == 5) {
cam.health.gotoAndStop("5hearts");
}
if (cam.hearts == 4) {
cam.health.gotoAndStop("4hearts");
}
if (cam.hearts == 3) {
cam.health.gotoAndStop("3hearts");
}
if (cam.hearts == 2) {
cam.health.gotoAndStop("2hearts");
}
if (cam.hearts == 1) {
cam.health.gotoAndStop("1heart");
}
if (cam.hearts == 0) {
cam.health.gotoAndStop("0hearts");
_root.gotoAndStop("gameover");
}
i = monster.length - 1;
while (i >= 0) {
if (!monsterAlive[i]) {
removeMonster[i]++;
monster[i].gotoAndStop("hit");
if (removeMonster[i] < 2) {
monster[i]._y = monster[i]._y - 10;
}
if (removeMonster[i] > 10) {
monster[i].gotoAndStop("death");
cam.ghostsleft--;
}
if (removeMonster[i] > 10) {
monster[i].removeMovieClip();
monster.splice(i, 1);
removeMonster.splice(i, 1);
monsterMovement.splice(i, 1);
monsterAttackingTimer.splice(i, 1);
monsterAlive.splice(i, 1);
monsterAttacking.splice(i, 1);
}
}
if (monsterAlive[i]) {
if (!monsterAttacking[i]) {
monsterMovement[i]++;
monster[i].gotoAndStop("idle");
if (monsterMovement[i] == 80) {
monsterMovement[i] = 0;
}
if ((monsterMovement[i] > 0) && (monsterMovement[i] < 40)) {
monster[i]._xscale = 100;
monster[i]._x = monster[i]._x - 3;
}
if (monsterMovement[i] > 40) {
monster[i]._xscale = -100;
monster[i]._x = monster[i]._x + 3;
}
}
if (player.hitTest(monster[i])) {
if (is_attacking > 8) {
ranNum++;
_root.attachMovie("hit", "hit" + ranNum, _root.getNextHighestDepth(), {_x:player._x, _y:player._y - 10});
monsterAlive[i] = false;
_root.kicksnd.start(0, 0);
_root.echosnd.start(0, 0);
}
monsterAttackingTimer[i]++;
if (monsterAttackingTimer[i] > 20) {
monsterAttacking[i] = true;
monster[i].gotoAndStop("attack");
}
if (monsterAttackingTimer[i] == 60) {
monsterAttackingTimer[i] = 0;
monsterAttacking[i] = false;
}
if (monsterAttacking[i] == true) {
if (!invulnerable) {
if (player.hitTest(monster[i])) {
ranNum++;
dun_hitsnd.start();
_root.attachMovie("en_hit", "en_hit" + ranNum, _root.getNextHighestDepth(), {_x:player._x, _y:player._y - 10});
playerHit = true;
ghostboosnd.start(0, 0);
}
}
}
} else {
monsterAttacking[i] = 0;
monsterAttacking[i] = false;
}
}
i--;
}
portal_notice._x = player._x + 150;
portal_notice._y = player._y - 150;
if (portalOpen == true) {
_root.lvl_portal._visible = true;
}
if (((cam.count == 69) && (portalOpen == false)) && (cam.ghostsleft == 0)) {
portalOpen = true;
portal_notice.gotoAndPlay("playslide");
}
if (player.hitTest(_root.lvl_portal) && (portalOpen == true)) {
canMove = false;
portalOpen = false;
toc = 2000;
playerHit = false;
invulnerable = false;
inControl = false;
xaccel = 0;
gravity = 0;
cam.count = 0;
player._alpha = 0;
_root.lvl_portal.gotoAndStop("entered");
}
fadeout = function () {
_root.attachMovie("fade", "newfadeout", 200);
newfadeout._x = cam._x;
newfadeout._y = cam._y;
};
go_fadeout = function () {
_root.attachMovie("go_fade", "newgo_fadeout", 200);
newgo_fadeout._x = cam._x;
newgo_fadeout._y = cam._y;
};
if (Key.isDown(65) && (canMove)) {
attacking = true;
}
if (attacking) {
is_attacking++;
if (is_attacking == 20) {
attacking = false;
is_attacking = 0;
shootOnce = 0;
}
if (is_attacking == 1) {
shootsnd.start(0, 0);
if (shootOnce == 0) {
shootsnd.stop;
}
}
}
if (doubleJumping) {
if (!attacking) {
player.gotoAndStop("double");
}
if (attacking) {
player.gotoAndStop("jumpAttack");
}
}
if (inControl == false) {
running = false;
xaccel = 0;
gravity = 0;
gravityaccel = 0;
doubleJumping = false;
jump = false;
runaccelamt = 0;
doubleJumping = false;
doubleJump = false;
}
if (jump && (!doubleJumping)) {
if (running) {
if (!attacking) {
player.gotoAndStop("run");
}
if (attacking) {
player.gotoAndStop("runAttack");
}
} else {
if (!attacking) {
player.gotoAndStop("idle");
}
if (attacking) {
player.gotoAndStop("attack");
}
}
} else if (!doubleJumping) {
if (!attacking) {
player.gotoAndStop("jump");
}
if (attacking) {
player.gotoAndStop("jumpAttack");
}
}
if (Key.isDown(39) or Key.isDown(37)) {
running = true;
} else {
running = false;
}
if (!ground.hitTest(player._x, player._y + 10, true)) {
falling = true;
grounded = false;
}
if (ground.hitTest(player._x, player._y + 11, true)) {
doubleJumping = false;
doubleJump = false;
jump = true;
grounded = true;
falling = false;
while (ground.hitTest(player._x, player._y + 9, true)) {
player._y--;
}
}
if (falling == true) {
gravity = gravity + gravityaccel;
} else {
gravity = 0;
}
if (((canMove && (Key.isDown(39))) && (xaccel < maxaccel)) && (falling == true)) {
xaccel = xaccel + (runaccelamt - airrisist);
} else if (((canMove && (Key.isDown(37))) && (xaccel > (-maxaccel))) && (falling == true)) {
xaccel = xaccel - (runaccelamt - airrisist);
} else if (((canMove && (Key.isDown(37))) && (xaccel > (-maxaccel))) && (falling == false)) {
xaccel = xaccel - runaccelamt;
} else if (((canMove && (Key.isDown(39))) && (xaccel < maxaccel)) && (falling == false)) {
xaccel = xaccel + runaccelamt;
} else if (grounded == true) {
if (xaccel > 0) {
xaccel = xaccel - friction;
}
if (xaccel < 0) {
xaccel = xaccel + friction;
}
if ((xaccel < 0) && (xaccel > friction)) {
xaccel = 0;
}
if ((xaccel > 0) && (xaccel < friction)) {
xaccel = 0;
}
} else {
if (xaccel > 0) {
xaccel = xaccel - airrisist;
}
if (xaccel < 0) {
xaccel = xaccel + airrisist;
}
if ((xaccel < 0) && (xaccel > airrisist)) {
xaccel = 0;
}
if ((xaccel > 0) && (xaccel < airrisist)) {
xaccel = 0;
}
}
if (_root.ground.hitTest(this._x, this._y - 11, true)) {
gravity = 1;
while (_root.ground.hitTest(this._x, this._y - 10, true)) {
this._y++;
}
}
if (xaccel > 0) {
player._xscale = 40;
}
if (xaccel < 0) {
player._xscale = -40;
}
if (!Key.isDown(38)) {
pressOnce = 0;
}
if ((canMove && (Key.isDown(38))) && (jump == true)) {
gravity = gravity - (Math.cos(3.141593 * ((player._rotation * -1) / 180)) * maxjump);
jump = false;
doubleJump = true;
pressOnce = 1;
_root.jumpsnd.start(0, 0);
}
if (((canMove && (Key.isDown(38))) && (doubleJump == true)) && (pressOnce == 0)) {
gravity = 0;
gravity = gravity - (Math.cos(3.141593 * ((player._rotation * -1) / 180)) * maxjump);
doubleJump = false;
doubleJumping = true;
_root.jumpsnd.start(0, 0);
}
leftx = player._x + (Math.cos(3.141593 * (((player._rotation * -1) + 180) / 180)) * 7);
lefty = player._y - (Math.sin(3.141593 * (((player._rotation * -1) + 180) / 180)) * 7);
rightx = player._x + (Math.cos(3.141593 * ((player._rotation * -1) / 180)) * 7);
righty = player._y - (Math.sin(3.141593 * ((player._rotation * -1) / 180)) * 7);
if (ground.hitTest(leftx, lefty, true)) {
xaccel = 0;
player._x++;
}
if (ground.hitTest(rightx, righty, true)) {
xaccel = 0;
player._x--;
}
cam._x = _root.player._x;
if (player._y < 400) {
cam._y = _root.player._y;
}
cam.camControl();
player._y = player._y + gravity;
player._x = player._x + xaccel;
fade.swapDepths(_root.getNextHighestDepth());
go_fade.swapDepths(_root.getNextHighestDepth());
score = cam.tic;
};
Frame 14
stop();
portalOpen = false;
Frame 15
stop();
stage = 6;
tutlvlmusic = new Sound();
tutlvlmusic.attachSound("tutmusic");
tutlvlmusic.start(0, 1000);
musicplayer = "play";
cam.playPause.gotoAndStop("pause");
cam.music_eq.gotoAndStop("play");
cam.playPause.onRollOver = function () {
if (this._currentframe == 1) {
this.gotoAndStop("pauseOver");
} else {
this.gotoAndStop("playOver");
}
};
cam.playPause.onRollOut = (cam.playPause.onReleaseOutside = function () {
if (this._currentframe == 10) {
this.gotoAndStop("pause");
} else {
this.gotoAndStop("play");
}
});
cam.playPause.onRelease = function () {
if (this._currentframe == 10) {
this.gotoAndStop("playOver");
tutlvlmusic.stop();
cam.music_eq.gotoAndStop("stop");
} else {
this.gotoAndStop("pauseOver");
tutlvlmusic.start(0, 1000);
cam.music_eq.gotoAndStop("play");
}
};
fall_sound = new Sound();
dun_hitsnd = new Sound();
collectsnd = new Sound();
echosnd = new Sound();
shootsnd = new Sound();
portalsnd = new Sound();
jumpsnd = new Sound();
dropsnd.attachSound("drop");
fall_sound.attachSound("fall_noise");
dun_hitsnd.attachSound("dun_hit");
collectsnd.attachSound("collectedsnd");
echosnd.attachSound("echo");
shootsnd.attachSound("shoot");
portalsnd.attachSound("portaljump");
jumpsnd.attachSound("jump");
ghostboosnd = new Sound();
ghostboosnd.attachSound("ghostboo");
portalReset();
cam.tic = 999;
toc = 32;
cam._xscale = 120;
cam._yscale = 120;
cam.lens._xscale = 50;
cam.lens._yscale = 50;
canMove = true;
myColor = new Color(player);
myColorTransform = new Object();
myColorTransform = {rb:0, gb:0, bb:0};
myColor.setTransform(myColorTransform);
lvl_portal._visible = false;
player._alpha = 100;
player._x = 380.7;
player._y = 137.1;
portalOpen = false;
cam.ghostsleft = 9;
cam.hearts = 5;
cam.count = 0;
cam.ectoleft = 78;
fallonce = 1;
TimerWarn = 1;
PanicWarn = 1;
attacking = false;
is_attacking = 0;
inControl = true;
running = false;
gravity = 10;
gravityaccel = 1;
xaccel = 7;
runaccelamt = 0.7;
friction = 2;
airrisist = 0.07;
maxaccel = 7;
maxjump = 12;
doubleJump = false;
doubleJumping = false;
jump = true;
pressOnce = 0;
playerHit = false;
playerHitTimer = 0;
invulnerable = false;
invulnerableTimer = 0;
var monster = new Array();
monster.push(stageSixEnemy1, stageSixEnemy2, stageSixEnemy3, stageSixEnemy4, stageSixEnemy5, stageSixEnemy6, stageSixEnemy7, stageSixEnemy8, stageSixEnemy9);
var monsterAttacking = new Array();
monsterAttacking.push(false, false, false, false, false, false, false, false, false);
var monsterAlive = new Array();
monsterAlive.push(true, true, true, true, true, true, true, true, true);
var monsterAttackingTimer = new Array();
monsterAttackingTimer.push(0, 0, 0, 0, 0, 0, 0, 0, 0);
var monsterMovement = new Array();
monsterMovement.push(0, 0, 0, 0, 0, 0, 0, 0, 0);
var removeMonster = new Array();
removeMonster.push(0, 0, 0, 0, 0, 0, 0, 0, 0);
var collect = new Array();
collect.push(stageSixButton1, stageSixButton2, stageSixButton3, stageSixButton4, stageSixButton5, stageSixButton6, stageSixButton7, stageSixButton8, stageSixButton9, stageSixButton10, stageSixButton11, stageSixButton12, stageSixButton13, stageSixButton14, stageSixButton15, stageSixButton16, stageSixButton17, stageSixButton18, stageSixButton19, stageSixButton20, stageSixButton21, stageSixButton22, stageSixButton23, stageSixButton24, stageSixButton25, stageSixButton26, stageSixButton27, stageSixButton28, stageSixButton29, stageSixButton30, stageSixButton31, stageSixButton32, stageSixButton33, stageSixButton34, stageSixButton35, stageSixButton36, stageSixButton37, stageSixButton38, stageSixButton39, stageSixButton40, stageSixButton41, stageSixButton42, stageSixButton43, stageSixButton44, stageSixButton45, stageSixButton46, stageSixButton47, stageSixButton48, stageSixButton49, stageSixButton50, stageSixButton51, stageSixButton52, stageSixButton53, stageSixButton54, stageSixButton55, stageSixButton56, stageSixButton57, stageSixButton58, stageSixButton59, stageSixButton60, stageSixButton61, stageSixButton62, stageSixButton63, stageSixButton64, stageSixButton65, stageSixButton66, stageSixButton67, stageSixButton68, stageSixButton69, stageSixButton70, stageSixButton71, stageSixButton72, stageSixButton73, stageSixButton74, stageSixButton75, stageSixButton76, stageSixButton77, stageSixButton78);
player.onEnterFrame = function () {
portalReset = function () {
lvl_portal.gotoAndStop("idle");
portflash.gotoAndPlay(1);
};
lvl_intro._x = player._x - 150;
if ((cam.tic == 30) && (TimerWarn == 1)) {
TimerWarn = 0;
timer_warning.gotoAndPlay("playslide");
}
if ((cam.tic == 10) && (PanicWarn == 1)) {
PanicWarn = 0;
panic_warning.gotoAndPlay("playslide");
}
toc--;
if (toc == 0) {
cam.tic--;
toc = 32;
}
if ((cam.tic == 0) && (fallonce == 1)) {
fallonce = 0;
cam.tic = 0;
toc = 2000;
go_fadeout();
}
if (playerHit) {
player.gotoAndStop("hit");
playerHitTimer++;
invulnerable = true;
if (playerHitTimer == 15) {
playerHitTimer = 0;
cam.hearts--;
playerHit = false;
}
}
if (invulnerable) {
invulnerableTimer++;
player._alpha = 25;
if (invulnerableTimer == 75) {
invulnerable = false;
invulnerableTimer = 0;
player._alpha = 100;
}
}
i = collect.length - 1;
while (i >= 0) {
if (player.hitTest(collect[i])) {
if (collect[i]._alpha == 100) {
_root.collectsnd.start(0, 0);
cam.count++;
}
collect[i]._alpha = 0;
}
i--;
}
if ((player._y > 600) && (fallonce == 1)) {
canMove = false;
fall_sound.start();
fallonce = 0;
go_fadeout();
}
if (cam.hearts == 5) {
cam.health.gotoAndStop("5hearts");
}
if (cam.hearts == 4) {
cam.health.gotoAndStop("4hearts");
}
if (cam.hearts == 3) {
cam.health.gotoAndStop("3hearts");
}
if (cam.hearts == 2) {
cam.health.gotoAndStop("2hearts");
}
if (cam.hearts == 1) {
cam.health.gotoAndStop("1heart");
}
if (cam.hearts == 0) {
cam.health.gotoAndStop("0hearts");
_root.gotoAndStop("gameover");
}
i = monster.length - 1;
while (i >= 0) {
if (!monsterAlive[i]) {
removeMonster[i]++;
monster[i].gotoAndStop("hit");
if (removeMonster[i] < 2) {
monster[i]._y = monster[i]._y - 10;
}
if (removeMonster[i] > 10) {
monster[i].gotoAndStop("death");
cam.ghostsleft--;
}
if (removeMonster[i] > 10) {
monster[i].removeMovieClip();
monster.splice(i, 1);
removeMonster.splice(i, 1);
monsterMovement.splice(i, 1);
monsterAttackingTimer.splice(i, 1);
monsterAlive.splice(i, 1);
monsterAttacking.splice(i, 1);
}
}
if (monsterAlive[i]) {
if (!monsterAttacking[i]) {
monsterMovement[i]++;
monster[i].gotoAndStop("idle");
if (monsterMovement[i] == 80) {
monsterMovement[i] = 0;
}
if ((monsterMovement[i] > 0) && (monsterMovement[i] < 40)) {
monster[i]._xscale = 100;
monster[i]._x = monster[i]._x - 3;
}
if (monsterMovement[i] > 40) {
monster[i]._xscale = -100;
monster[i]._x = monster[i]._x + 3;
}
}
if (player.hitTest(monster[i])) {
if (is_attacking > 8) {
ranNum++;
_root.attachMovie("hit", "hit" + ranNum, _root.getNextHighestDepth(), {_x:player._x, _y:player._y - 10});
monsterAlive[i] = false;
_root.kicksnd.start(0, 0);
_root.echosnd.start(0, 0);
}
monsterAttackingTimer[i]++;
if (monsterAttackingTimer[i] > 20) {
monsterAttacking[i] = true;
monster[i].gotoAndStop("attack");
}
if (monsterAttackingTimer[i] == 60) {
monsterAttackingTimer[i] = 0;
monsterAttacking[i] = false;
}
if (monsterAttacking[i] == true) {
if (!invulnerable) {
if (player.hitTest(monster[i])) {
ranNum++;
dun_hitsnd.start();
_root.attachMovie("en_hit", "en_hit" + ranNum, _root.getNextHighestDepth(), {_x:player._x, _y:player._y - 10});
playerHit = true;
ghostboosnd.start(0, 0);
}
}
}
} else {
monsterAttacking[i] = 0;
monsterAttacking[i] = false;
}
}
i--;
}
portal_notice._x = player._x + 150;
portal_notice._y = player._y - 150;
if (portalOpen == true) {
_root.lvl_portal._visible = true;
}
if (((cam.count == 78) && (portalOpen == false)) && (cam.ghostsleft == 0)) {
portalOpen = true;
portal_notice.gotoAndPlay("playslide");
}
if (player.hitTest(_root.lvl_portal) && (portalOpen == true)) {
canMove = false;
portalOpen = false;
toc = 2000;
playerHit = false;
invulnerable = false;
inControl = false;
xaccel = 0;
gravity = 0;
cam.count = 0;
player._alpha = 0;
_root.lvl_portal.gotoAndStop("entered");
}
fadeout = function () {
_root.attachMovie("fade", "newfadeout", 200);
newfadeout._x = cam._x;
newfadeout._y = cam._y;
};
go_fadeout = function () {
_root.attachMovie("go_fade", "newgo_fadeout", 200);
newgo_fadeout._x = cam._x;
newgo_fadeout._y = cam._y;
};
if (Key.isDown(65) && (canMove)) {
attacking = true;
}
if (attacking) {
is_attacking++;
if (is_attacking == 20) {
attacking = false;
is_attacking = 0;
shootOnce = 0;
}
if (is_attacking == 1) {
shootsnd.start(0, 0);
if (shootOnce == 0) {
shootsnd.stop;
}
}
}
if (doubleJumping) {
if (!attacking) {
player.gotoAndStop("double");
}
if (attacking) {
player.gotoAndStop("jumpAttack");
}
}
if (inControl == false) {
running = false;
xaccel = 0;
gravity = 0;
gravityaccel = 0;
doubleJumping = false;
jump = false;
runaccelamt = 0;
doubleJumping = false;
doubleJump = false;
}
if (jump && (!doubleJumping)) {
if (running) {
if (!attacking) {
player.gotoAndStop("run");
}
if (attacking) {
player.gotoAndStop("runAttack");
}
} else {
if (!attacking) {
player.gotoAndStop("idle");
}
if (attacking) {
player.gotoAndStop("attack");
}
}
} else if (!doubleJumping) {
if (!attacking) {
player.gotoAndStop("jump");
}
if (attacking) {
player.gotoAndStop("jumpAttack");
}
}
if (Key.isDown(39) or Key.isDown(37)) {
running = true;
} else {
running = false;
}
if (!ground.hitTest(player._x, player._y + 10, true)) {
falling = true;
grounded = false;
}
if (ground.hitTest(player._x, player._y + 11, true)) {
doubleJumping = false;
doubleJump = false;
jump = true;
grounded = true;
falling = false;
while (ground.hitTest(player._x, player._y + 9, true)) {
player._y--;
}
}
if (falling == true) {
gravity = gravity + gravityaccel;
} else {
gravity = 0;
}
if (((canMove && (Key.isDown(39))) && (xaccel < maxaccel)) && (falling == true)) {
xaccel = xaccel + (runaccelamt - airrisist);
} else if (((canMove && (Key.isDown(37))) && (xaccel > (-maxaccel))) && (falling == true)) {
xaccel = xaccel - (runaccelamt - airrisist);
} else if (((canMove && (Key.isDown(37))) && (xaccel > (-maxaccel))) && (falling == false)) {
xaccel = xaccel - runaccelamt;
} else if (((canMove && (Key.isDown(39))) && (xaccel < maxaccel)) && (falling == false)) {
xaccel = xaccel + runaccelamt;
} else if (grounded == true) {
if (xaccel > 0) {
xaccel = xaccel - friction;
}
if (xaccel < 0) {
xaccel = xaccel + friction;
}
if ((xaccel < 0) && (xaccel > friction)) {
xaccel = 0;
}
if ((xaccel > 0) && (xaccel < friction)) {
xaccel = 0;
}
} else {
if (xaccel > 0) {
xaccel = xaccel - airrisist;
}
if (xaccel < 0) {
xaccel = xaccel + airrisist;
}
if ((xaccel < 0) && (xaccel > airrisist)) {
xaccel = 0;
}
if ((xaccel > 0) && (xaccel < airrisist)) {
xaccel = 0;
}
}
if (_root.ground.hitTest(this._x, this._y - 11, true)) {
gravity = 1;
while (_root.ground.hitTest(this._x, this._y - 10, true)) {
this._y++;
}
}
if (xaccel > 0) {
player._xscale = 40;
}
if (xaccel < 0) {
player._xscale = -40;
}
if (!Key.isDown(38)) {
pressOnce = 0;
}
if ((canMove && (Key.isDown(38))) && (jump == true)) {
gravity = gravity - (Math.cos(3.141593 * ((player._rotation * -1) / 180)) * maxjump);
jump = false;
doubleJump = true;
pressOnce = 1;
_root.jumpsnd.start(0, 0);
}
if (((canMove && (Key.isDown(38))) && (doubleJump == true)) && (pressOnce == 0)) {
gravity = 0;
gravity = gravity - (Math.cos(3.141593 * ((player._rotation * -1) / 180)) * maxjump);
doubleJump = false;
doubleJumping = true;
_root.jumpsnd.start(0, 0);
}
leftx = player._x + (Math.cos(3.141593 * (((player._rotation * -1) + 180) / 180)) * 7);
lefty = player._y - (Math.sin(3.141593 * (((player._rotation * -1) + 180) / 180)) * 7);
rightx = player._x + (Math.cos(3.141593 * ((player._rotation * -1) / 180)) * 7);
righty = player._y - (Math.sin(3.141593 * ((player._rotation * -1) / 180)) * 7);
if (ground.hitTest(leftx, lefty, true)) {
xaccel = 0;
player._x++;
}
if (ground.hitTest(rightx, righty, true)) {
xaccel = 0;
player._x--;
}
cam._x = _root.player._x;
if (player._y < 400) {
cam._y = _root.player._y;
}
cam.camControl();
player._y = player._y + gravity;
player._x = player._x + xaccel;
fade.swapDepths(_root.getNextHighestDepth());
go_fade.swapDepths(_root.getNextHighestDepth());
score = cam.tic;
};
Frame 16
stop();
portalOpen = false;
Frame 17
stop();
stage = 7;
lvl7music = new Sound();
lvl7music.attachSound("7thlvlmusic");
lvl7music.start(0, 1000);
musicplayer = "play";
cam.playPause.gotoAndStop("pause");
cam.music_eq.gotoAndStop("play");
cam.playPause.onRollOver = function () {
if (this._currentframe == 1) {
this.gotoAndStop("pauseOver");
} else {
this.gotoAndStop("playOver");
}
};
cam.playPause.onRollOut = (cam.playPause.onReleaseOutside = function () {
if (this._currentframe == 10) {
this.gotoAndStop("pause");
} else {
this.gotoAndStop("play");
}
});
cam.playPause.onRelease = function () {
if (this._currentframe == 10) {
this.gotoAndStop("playOver");
lvl7music.stop();
cam.music_eq.gotoAndStop("stop");
} else {
this.gotoAndStop("pauseOver");
lvl7music.start(0, 1000);
cam.music_eq.gotoAndStop("play");
}
};
fall_sound = new Sound();
dun_hitsnd = new Sound();
collectsnd = new Sound();
echosnd = new Sound();
shootsnd = new Sound();
portalsnd = new Sound();
jumpsnd = new Sound();
dropsnd.attachSound("drop");
fall_sound.attachSound("fall_noise");
dun_hitsnd.attachSound("dun_hit");
collectsnd.attachSound("collectedsnd");
echosnd.attachSound("echo");
shootsnd.attachSound("shoot");
portalsnd.attachSound("portaljump");
jumpsnd.attachSound("jump");
ghostboosnd = new Sound();
ghostboosnd.attachSound("ghostboo");
cam.tic = 999;
toc = 32;
cam._xscale = 120;
cam._yscale = 120;
cam.lens._xscale = 50;
cam.lens._yscale = 50;
canMove = true;
myColor = new Color(player);
myColorTransform = new Object();
myColorTransform = {rb:0, gb:0, bb:0};
myColor.setTransform(myColorTransform);
lvl_portal._visible = false;
player._alpha = 100;
player._x = 392.7;
player._y = 269.1;
portalOpen = false;
cam.ghostsleft = 9;
cam.hearts = 5;
cam.count = 0;
cam.ectoleft = 90;
fallonce = 1;
TimerWarn = 1;
PanicWarn = 1;
attacking = false;
is_attacking = 0;
inControl = true;
running = false;
gravity = 10;
gravityaccel = 1;
xaccel = 7;
runaccelamt = 0.7;
friction = 2;
airrisist = 0.07;
maxaccel = 7;
maxjump = 12;
doubleJump = false;
doubleJumping = false;
jump = true;
pressOnce = 0;
playerHit = false;
playerHitTimer = 0;
invulnerable = false;
invulnerableTimer = 0;
var monster = new Array();
monster.push(stageSevenEnemy1, stageSevenEnemy2, stageSevenEnemy3, stageSevenEnemy4, stageSevenEnemy5, stageSevenEnemy6, stageSevenEnemy7, stageSevenEnemy8, stageSevenEnemy9);
var monsterAttacking = new Array();
monsterAttacking.push(false, false, false, false, false, false, false, false, false);
var monsterAlive = new Array();
monsterAlive.push(true, true, true, true, true, true, true, true, true);
var monsterAttackingTimer = new Array();
monsterAttackingTimer.push(0, 0, 0, 0, 0, 0, 0, 0, 0);
var monsterMovement = new Array();
monsterMovement.push(0, 0, 0, 0, 0, 0, 0, 0, 0);
var removeMonster = new Array();
removeMonster.push(0, 0, 0, 0, 0, 0, 0, 0, 0);
var collect = new Array();
collect.push(stageSevenButton1, stageSevenButton2, stageSevenButton3, stageSevenButton4, stageSevenButton5, stageSevenButton6, stageSevenButton7, stageSevenButton8, stageSevenButton9, stageSevenButton10, stageSevenButton11, stageSevenButton12, stageSevenButton13, stageSevenButton14, stageSevenButton15, stageSevenButton16, stageSevenButton17, stageSevenButton18, stageSevenButton19, stageSevenButton20, stageSevenButton21, stageSevenButton22, stageSevenButton23, stageSevenButton24, stageSevenButton25, stageSevenButton26, stageSevenButton27, stageSevenButton28, stageSevenButton29, stageSevenButton30, stageSevenButton31, stageSevenButton32, stageSevenButton33, stageSevenButton34, stageSevenButton35, stageSevenButton36, stageSevenButton37, stageSevenButton38, stageSevenButton39, stageSevenButton40, stageSevenButton41, stageSevenButton42, stageSevenButton43, stageSevenButton44, stageSevenButton45, stageSevenButton46, stageSevenButton47, stageSevenButton48, stageSevenButton49, stageSevenButton50, stageSevenButton51, stageSevenButton52, stageSevenButton53, stageSevenButton54, stageSevenButton55, stageSevenButton56, stageSevenButton57, stageSevenButton58, stageSevenButton59, stageSevenButton60, stageSevenButton61, stageSevenButton62, stageSevenButton63, stageSevenButton64, stageSevenButton65, stageSevenButton66, stageSevenButton67, stageSevenButton68, stageSevenButton69, stageSevenButton70, stageSevenButton71, stageSevenButton72, stageSevenButton73, stageSevenButton74, stageSevenButton75, stageSevenButton76, stageSevenButton77, stageSevenButton78, stageSevenButton79, stageSevenButton80, stageSevenButton81, stageSevenButton82, stageSevenButton83, stageSevenButton84, stageSevenButton85, stageSevenButton86, stageSevenButton87, stageSevenButton88, stageSevenButton89, stageSevenButton90);
player.onEnterFrame = function () {
lvl_intro._x = player._x - 150;
if ((cam.tic == 30) && (TimerWarn == 1)) {
TimerWarn = 0;
timer_warning.gotoAndPlay("playslide");
}
if ((cam.tic == 10) && (PanicWarn == 1)) {
PanicWarn = 0;
panic_warning.gotoAndPlay("playslide");
}
toc--;
if (toc == 0) {
cam.tic--;
toc = 32;
}
if ((cam.tic == 0) && (fallonce == 1)) {
fallonce = 0;
cam.tic = 0;
toc = 2000;
go_fadeout();
}
if (playerHit) {
player.gotoAndStop("hit");
playerHitTimer++;
invulnerable = true;
if (playerHitTimer == 15) {
playerHitTimer = 0;
cam.hearts--;
playerHit = false;
}
}
if (invulnerable) {
invulnerableTimer++;
player._alpha = 25;
if (invulnerableTimer == 75) {
invulnerable = false;
invulnerableTimer = 0;
player._alpha = 100;
}
}
i = collect.length - 1;
while (i >= 0) {
if (player.hitTest(collect[i])) {
if (collect[i]._alpha == 100) {
_root.collectsnd.start(0, 0);
cam.count++;
}
collect[i]._alpha = 0;
}
i--;
}
if ((player._y > 600) && (fallonce == 1)) {
canMove = false;
fall_sound.start();
fallonce = 0;
go_fadeout();
}
if (cam.hearts == 5) {
cam.health.gotoAndStop("5hearts");
}
if (cam.hearts == 4) {
cam.health.gotoAndStop("4hearts");
}
if (cam.hearts == 3) {
cam.health.gotoAndStop("3hearts");
}
if (cam.hearts == 2) {
cam.health.gotoAndStop("2hearts");
}
if (cam.hearts == 1) {
cam.health.gotoAndStop("1heart");
}
if (cam.hearts == 0) {
cam.health.gotoAndStop("0hearts");
_root.gotoAndStop("gameover");
}
i = monster.length - 1;
while (i >= 0) {
if (!monsterAlive[i]) {
removeMonster[i]++;
monster[i].gotoAndStop("hit");
if (removeMonster[i] < 2) {
monster[i]._y = monster[i]._y - 10;
}
if (removeMonster[i] > 10) {
monster[i].gotoAndStop("death");
cam.ghostsleft--;
}
if (removeMonster[i] > 10) {
monster[i].removeMovieClip();
monster.splice(i, 1);
removeMonster.splice(i, 1);
monsterMovement.splice(i, 1);
monsterAttackingTimer.splice(i, 1);
monsterAlive.splice(i, 1);
monsterAttacking.splice(i, 1);
}
}
if (monsterAlive[i]) {
if (!monsterAttacking[i]) {
monsterMovement[i]++;
monster[i].gotoAndStop("idle");
if (monsterMovement[i] == 80) {
monsterMovement[i] = 0;
}
if ((monsterMovement[i] > 0) && (monsterMovement[i] < 40)) {
monster[i]._xscale = 100;
monster[i]._x = monster[i]._x - 3;
}
if (monsterMovement[i] > 40) {
monster[i]._xscale = -100;
monster[i]._x = monster[i]._x + 3;
}
}
if (player.hitTest(monster[i])) {
if (is_attacking > 8) {
ranNum++;
_root.attachMovie("hit", "hit" + ranNum, _root.getNextHighestDepth(), {_x:player._x, _y:player._y - 10});
monsterAlive[i] = false;
_root.kicksnd.start(0, 0);
_root.echosnd.start(0, 0);
}
monsterAttackingTimer[i]++;
if (monsterAttackingTimer[i] > 20) {
monsterAttacking[i] = true;
monster[i].gotoAndStop("attack");
}
if (monsterAttackingTimer[i] == 60) {
monsterAttackingTimer[i] = 0;
monsterAttacking[i] = false;
}
if (monsterAttacking[i] == true) {
if (!invulnerable) {
if (player.hitTest(monster[i])) {
ranNum++;
dun_hitsnd.start();
_root.attachMovie("en_hit", "en_hit" + ranNum, _root.getNextHighestDepth(), {_x:player._x, _y:player._y - 10});
playerHit = true;
ghostboosnd.start(0, 0);
}
}
}
} else {
monsterAttacking[i] = 0;
monsterAttacking[i] = false;
}
}
i--;
}
portal_notice._x = player._x + 150;
portal_notice._y = player._y - 150;
if (portalOpen == true) {
_root.lvl_portal._visible = true;
}
if (((cam.count == 90) && (portalOpen == false)) && (cam.ghostsleft == 0)) {
portalOpen = true;
portal_notice.gotoAndPlay("playslide");
}
if (player.hitTest(_root.lvl_portal) && (portalOpen == true)) {
canMove = false;
portalOpen = false;
toc = 2000;
playerHit = false;
invulnerable = false;
inControl = false;
xaccel = 0;
gravity = 0;
cam.count = 0;
player._alpha = 0;
_root.lvl_portal.gotoAndStop("entered");
}
fadeout = function () {
_root.attachMovie("fade", "newfadeout", 200);
newfadeout._x = cam._x;
newfadeout._y = cam._y;
};
go_fadeout = function () {
_root.attachMovie("go_fade", "newgo_fadeout", 200);
newgo_fadeout._x = cam._x;
newgo_fadeout._y = cam._y;
};
if (Key.isDown(65) && (canMove)) {
attacking = true;
}
if (attacking) {
is_attacking++;
if (is_attacking == 20) {
attacking = false;
is_attacking = 0;
shootOnce = 0;
}
if (is_attacking == 1) {
shootsnd.start(0, 0);
if (shootOnce == 0) {
shootsnd.stop;
}
}
}
if (doubleJumping) {
if (!attacking) {
player.gotoAndStop("double");
}
if (attacking) {
player.gotoAndStop("jumpAttack");
}
}
if (inControl == false) {
running = false;
xaccel = 0;
gravity = 0;
gravityaccel = 0;
doubleJumping = false;
jump = false;
runaccelamt = 0;
doubleJumping = false;
doubleJump = false;
}
if (jump && (!doubleJumping)) {
if (running) {
if (!attacking) {
player.gotoAndStop("run");
}
if (attacking) {
player.gotoAndStop("runAttack");
}
} else {
if (!attacking) {
player.gotoAndStop("idle");
}
if (attacking) {
player.gotoAndStop("attack");
}
}
} else if (!doubleJumping) {
if (!attacking) {
player.gotoAndStop("jump");
}
if (attacking) {
player.gotoAndStop("jumpAttack");
}
}
if (Key.isDown(39) or Key.isDown(37)) {
running = true;
} else {
running = false;
}
if (!ground.hitTest(player._x, player._y + 10, true)) {
falling = true;
grounded = false;
}
if (ground.hitTest(player._x, player._y + 11, true)) {
doubleJumping = false;
doubleJump = false;
jump = true;
grounded = true;
falling = false;
while (ground.hitTest(player._x, player._y + 9, true)) {
player._y--;
}
}
if (falling == true) {
gravity = gravity + gravityaccel;
} else {
gravity = 0;
}
if (((canMove && (Key.isDown(39))) && (xaccel < maxaccel)) && (falling == true)) {
xaccel = xaccel + (runaccelamt - airrisist);
} else if (((canMove && (Key.isDown(37))) && (xaccel > (-maxaccel))) && (falling == true)) {
xaccel = xaccel - (runaccelamt - airrisist);
} else if (((canMove && (Key.isDown(37))) && (xaccel > (-maxaccel))) && (falling == false)) {
xaccel = xaccel - runaccelamt;
} else if (((canMove && (Key.isDown(39))) && (xaccel < maxaccel)) && (falling == false)) {
xaccel = xaccel + runaccelamt;
} else if (grounded == true) {
if (xaccel > 0) {
xaccel = xaccel - friction;
}
if (xaccel < 0) {
xaccel = xaccel + friction;
}
if ((xaccel < 0) && (xaccel > friction)) {
xaccel = 0;
}
if ((xaccel > 0) && (xaccel < friction)) {
xaccel = 0;
}
} else {
if (xaccel > 0) {
xaccel = xaccel - airrisist;
}
if (xaccel < 0) {
xaccel = xaccel + airrisist;
}
if ((xaccel < 0) && (xaccel > airrisist)) {
xaccel = 0;
}
if ((xaccel > 0) && (xaccel < airrisist)) {
xaccel = 0;
}
}
if (_root.ground.hitTest(this._x, this._y - 11, true)) {
gravity = 1;
while (_root.ground.hitTest(this._x, this._y - 10, true)) {
this._y++;
}
}
if (xaccel > 0) {
player._xscale = 40;
}
if (xaccel < 0) {
player._xscale = -40;
}
if (!Key.isDown(38)) {
pressOnce = 0;
}
if ((canMove && (Key.isDown(38))) && (jump == true)) {
gravity = gravity - (Math.cos(3.141593 * ((player._rotation * -1) / 180)) * maxjump);
jump = false;
doubleJump = true;
pressOnce = 1;
_root.jumpsnd.start(0, 0);
}
if (((canMove && (Key.isDown(38))) && (doubleJump == true)) && (pressOnce == 0)) {
gravity = 0;
gravity = gravity - (Math.cos(3.141593 * ((player._rotation * -1) / 180)) * maxjump);
doubleJump = false;
doubleJumping = true;
_root.jumpsnd.start(0, 0);
}
leftx = player._x + (Math.cos(3.141593 * (((player._rotation * -1) + 180) / 180)) * 7);
lefty = player._y - (Math.sin(3.141593 * (((player._rotation * -1) + 180) / 180)) * 7);
rightx = player._x + (Math.cos(3.141593 * ((player._rotation * -1) / 180)) * 7);
righty = player._y - (Math.sin(3.141593 * ((player._rotation * -1) / 180)) * 7);
if (ground.hitTest(leftx, lefty, true)) {
xaccel = 0;
player._x++;
}
if (ground.hitTest(rightx, righty, true)) {
xaccel = 0;
player._x--;
}
cam._x = _root.player._x;
if (player._y < 400) {
cam._y = _root.player._y;
}
cam.camControl();
player._y = player._y + gravity;
player._x = player._x + xaccel;
fade.swapDepths(_root.getNextHighestDepth());
go_fade.swapDepths(_root.getNextHighestDepth());
score = cam.tic;
};
Frame 18
stop();
portalOpen = false;
Frame 19
stop();
stage = 8;
lvl8music = new Sound();
lvl8music.attachSound("8thlvlmusic");
lvl8music.start(0, 1000);
musicplayer = "play";
cam.playPause.gotoAndStop("pause");
cam.music_eq.gotoAndStop("play");
cam.playPause.onRollOver = function () {
if (this._currentframe == 1) {
this.gotoAndStop("pauseOver");
} else {
this.gotoAndStop("playOver");
}
};
cam.playPause.onRollOut = (cam.playPause.onReleaseOutside = function () {
if (this._currentframe == 10) {
this.gotoAndStop("pause");
} else {
this.gotoAndStop("play");
}
});
cam.playPause.onRelease = function () {
if (this._currentframe == 10) {
this.gotoAndStop("playOver");
lvl8music.stop();
cam.music_eq.gotoAndStop("stop");
} else {
this.gotoAndStop("pauseOver");
lvl8music.start(0, 1000);
cam.music_eq.gotoAndStop("play");
}
};
fall_sound = new Sound();
dun_hitsnd = new Sound();
collectsnd = new Sound();
echosnd = new Sound();
shootsnd = new Sound();
portalsnd = new Sound();
jumpsnd = new Sound();
dropsnd.attachSound("drop");
fall_sound.attachSound("fall_noise");
dun_hitsnd.attachSound("dun_hit");
collectsnd.attachSound("collectedsnd");
echosnd.attachSound("echo");
shootsnd.attachSound("shoot");
portalsnd.attachSound("portaljump");
jumpsnd.attachSound("jump");
ghostboosnd = new Sound();
ghostboosnd.attachSound("ghostboo");
cam.tic = 999;
toc = 32;
cam._xscale = 120;
cam._yscale = 120;
cam.lens._xscale = 50;
cam.lens._yscale = 50;
canMove = true;
myColor = new Color(player);
myColorTransform = new Object();
myColorTransform = {rb:0, gb:0, bb:0};
myColor.setTransform(myColorTransform);
lvl_portal._visible = false;
player._alpha = 100;
player._x = 392.7;
player._y = 285.1;
portalOpen = false;
cam.ghostsleft = 6;
cam.hearts = 5;
cam.count = 0;
cam.ectoleft = 80;
fallonce = 1;
TimerWarn = 1;
PanicWarn = 1;
attacking = false;
is_attacking = 0;
inControl = true;
running = false;
gravity = 10;
gravityaccel = 1;
xaccel = 7;
runaccelamt = 0.7;
friction = 2;
airrisist = 0.07;
maxaccel = 7;
maxjump = 12;
doubleJump = false;
doubleJumping = false;
jump = true;
pressOnce = 0;
playerHit = false;
playerHitTimer = 0;
invulnerable = false;
invulnerableTimer = 0;
var monster = new Array();
monster.push(stageEightEnemy1, stageEightEnemy2, stageEightEnemy3, stageEightEnemy4, stageEightEnemy5, stageEightEnemy6);
var monsterAttacking = new Array();
monsterAttacking.push(false, false, false, false, false, false, false, false, false);
var monsterAlive = new Array();
monsterAlive.push(true, true, true, true, true, true, true, true, true);
var monsterAttackingTimer = new Array();
monsterAttackingTimer.push(0, 0, 0, 0, 0, 0, 0, 0, 0);
var monsterMovement = new Array();
monsterMovement.push(0, 0, 0, 0, 0, 0, 0, 0, 0);
var removeMonster = new Array();
removeMonster.push(0, 0, 0, 0, 0, 0, 0, 0, 0);
var collect = new Array();
collect.push(stageEightButton1, stageEightButton2, stageEightButton3, stageEightButton4, stageEightButton5, stageEightButton6, stageEightButton7, stageEightButton8, stageEightButton9, stageEightButton10, stageEightButton11, stageEightButton12, stageEightButton13, stageEightButton14, stageEightButton15, stageEightButton16, stageEightButton17, stageEightButton18, stageEightButton19, stageEightButton20, stageEightButton21, stageEightButton22, stageEightButton23, stageEightButton24, stageEightButton25, stageEightButton26, stageEightButton27, stageEightButton28, stageEightButton29, stageEightButton30, stageEightButton31, stageEightButton32, stageEightButton33, stageEightButton34, stageEightButton35, stageEightButton36, stageEightButton37, stageEightButton38, stageEightButton39, stageEightButton40, stageEightButton41, stageEightButton42, stageEightButton43, stageEightButton44, stageEightButton45, stageEightButton46, stageEightButton47, stageEightButton48, stageEightButton49, stageEightButton50, stageEightButton51, stageEightButton52, stageEightButton53, stageEightButton54, stageEightButton55, stageEightButton56, stageEightButton57, stageEightButton58, stageEightButton59, stageEightButton60, stageEightButton61, stageEightButton62, stageEightButton63, stageEightButton64, stageEightButton65, stageEightButton66, stageEightButton67, stageEightButton68, stageEightButton69, stageEightButton70, stageEightButton71, stageEightButton72, stageEightButton73, stageEightButton74, stageEightButton75, stageEightButton76, stageEightButton77, stageEightButton78, stageEightButton79, stageEightButton80);
player.onEnterFrame = function () {
lvl_intro._x = player._x - 150;
if ((cam.tic == 30) && (TimerWarn == 1)) {
TimerWarn = 0;
timer_warning.gotoAndPlay("playslide");
}
if ((cam.tic == 10) && (PanicWarn == 1)) {
PanicWarn = 0;
panic_warning.gotoAndPlay("playslide");
}
toc--;
if (toc == 0) {
cam.tic--;
toc = 32;
}
if ((cam.tic == 0) && (fallonce == 1)) {
fallonce = 0;
cam.tic = 0;
toc = 2000;
go_fadeout();
}
if (playerHit) {
player.gotoAndStop("hit");
playerHitTimer++;
invulnerable = true;
if (playerHitTimer == 15) {
playerHitTimer = 0;
cam.hearts--;
playerHit = false;
}
}
if (invulnerable) {
invulnerableTimer++;
player._alpha = 25;
if (invulnerableTimer == 75) {
invulnerable = false;
invulnerableTimer = 0;
player._alpha = 100;
}
}
i = collect.length - 1;
while (i >= 0) {
if (player.hitTest(collect[i])) {
if (collect[i]._alpha == 100) {
_root.collectsnd.start(0, 0);
cam.count++;
}
collect[i]._alpha = 0;
}
i--;
}
if ((player._y > 600) && (fallonce == 1)) {
canMove = false;
fall_sound.start();
fallonce = 0;
go_fadeout();
}
if (cam.hearts == 5) {
cam.health.gotoAndStop("5hearts");
}
if (cam.hearts == 4) {
cam.health.gotoAndStop("4hearts");
}
if (cam.hearts == 3) {
cam.health.gotoAndStop("3hearts");
}
if (cam.hearts == 2) {
cam.health.gotoAndStop("2hearts");
}
if (cam.hearts == 1) {
cam.health.gotoAndStop("1heart");
}
if (cam.hearts == 0) {
cam.health.gotoAndStop("0hearts");
_root.gotoAndStop("gameover");
}
i = monster.length - 1;
while (i >= 0) {
if (!monsterAlive[i]) {
removeMonster[i]++;
monster[i].gotoAndStop("hit");
if (removeMonster[i] < 2) {
monster[i]._y = monster[i]._y - 10;
}
if (removeMonster[i] > 10) {
monster[i].gotoAndStop("death");
cam.ghostsleft--;
}
if (removeMonster[i] > 10) {
monster[i].removeMovieClip();
monster.splice(i, 1);
removeMonster.splice(i, 1);
monsterMovement.splice(i, 1);
monsterAttackingTimer.splice(i, 1);
monsterAlive.splice(i, 1);
monsterAttacking.splice(i, 1);
}
}
if (monsterAlive[i]) {
if (!monsterAttacking[i]) {
monsterMovement[i]++;
monster[i].gotoAndStop("idle");
if (monsterMovement[i] == 80) {
monsterMovement[i] = 0;
}
if ((monsterMovement[i] > 0) && (monsterMovement[i] < 40)) {
monster[i]._xscale = 100;
monster[i]._x = monster[i]._x - 3;
}
if (monsterMovement[i] > 40) {
monster[i]._xscale = -100;
monster[i]._x = monster[i]._x + 3;
}
}
if (player.hitTest(monster[i])) {
if (is_attacking > 8) {
ranNum++;
_root.attachMovie("hit", "hit" + ranNum, _root.getNextHighestDepth(), {_x:player._x, _y:player._y - 10});
monsterAlive[i] = false;
_root.kicksnd.start(0, 0);
_root.echosnd.start(0, 0);
}
monsterAttackingTimer[i]++;
if (monsterAttackingTimer[i] > 20) {
monsterAttacking[i] = true;
monster[i].gotoAndStop("attack");
}
if (monsterAttackingTimer[i] == 60) {
monsterAttackingTimer[i] = 0;
monsterAttacking[i] = false;
}
if (monsterAttacking[i] == true) {
if (!invulnerable) {
if (player.hitTest(monster[i])) {
ranNum++;
dun_hitsnd.start();
_root.attachMovie("en_hit", "en_hit" + ranNum, _root.getNextHighestDepth(), {_x:player._x, _y:player._y - 10});
playerHit = true;
ghostboosnd.start(0, 0);
}
}
}
} else {
monsterAttacking[i] = 0;
monsterAttacking[i] = false;
}
}
i--;
}
portal_notice._x = player._x + 150;
portal_notice._y = player._y - 150;
if (portalOpen == true) {
_root.lvl_portal._visible = true;
}
if (((cam.count == 80) && (portalOpen == false)) && (cam.ghostsleft == 0)) {
portalOpen = true;
portal_notice.gotoAndPlay("playslide");
}
if (player.hitTest(_root.lvl_portal) && (portalOpen == true)) {
canMove = false;
portalOpen = false;
toc = 2000;
playerHit = false;
invulnerable = false;
inControl = false;
xaccel = 0;
gravity = 0;
cam.count = 0;
player._alpha = 0;
_root.lvl_portal.gotoAndStop("entered");
}
fadeout = function () {
_root.attachMovie("fade", "newfadeout", 200);
newfadeout._x = cam._x;
newfadeout._y = cam._y;
};
go_fadeout = function () {
_root.attachMovie("go_fade", "newgo_fadeout", 200);
newgo_fadeout._x = cam._x;
newgo_fadeout._y = cam._y;
};
if (Key.isDown(65) && (canMove)) {
attacking = true;
}
if (attacking) {
is_attacking++;
if (is_attacking == 20) {
attacking = false;
is_attacking = 0;
shootOnce = 0;
}
if (is_attacking == 1) {
shootsnd.start(0, 0);
if (shootOnce == 0) {
shootsnd.stop;
}
}
}
if (doubleJumping) {
if (!attacking) {
player.gotoAndStop("double");
}
if (attacking) {
player.gotoAndStop("jumpAttack");
}
}
if (inControl == false) {
running = false;
xaccel = 0;
gravity = 0;
gravityaccel = 0;
doubleJumping = false;
jump = false;
runaccelamt = 0;
doubleJumping = false;
doubleJump = false;
}
if (jump && (!doubleJumping)) {
if (running) {
if (!attacking) {
player.gotoAndStop("run");
}
if (attacking) {
player.gotoAndStop("runAttack");
}
} else {
if (!attacking) {
player.gotoAndStop("idle");
}
if (attacking) {
player.gotoAndStop("attack");
}
}
} else if (!doubleJumping) {
if (!attacking) {
player.gotoAndStop("jump");
}
if (attacking) {
player.gotoAndStop("jumpAttack");
}
}
if (Key.isDown(39) or Key.isDown(37)) {
running = true;
} else {
running = false;
}
if (!ground.hitTest(player._x, player._y + 10, true)) {
falling = true;
grounded = false;
}
if (ground.hitTest(player._x, player._y + 11, true)) {
doubleJumping = false;
doubleJump = false;
jump = true;
grounded = true;
falling = false;
while (ground.hitTest(player._x, player._y + 9, true)) {
player._y--;
}
}
if (falling == true) {
gravity = gravity + gravityaccel;
} else {
gravity = 0;
}
if (((canMove && (Key.isDown(39))) && (xaccel < maxaccel)) && (falling == true)) {
xaccel = xaccel + (runaccelamt - airrisist);
} else if (((canMove && (Key.isDown(37))) && (xaccel > (-maxaccel))) && (falling == true)) {
xaccel = xaccel - (runaccelamt - airrisist);
} else if (((canMove && (Key.isDown(37))) && (xaccel > (-maxaccel))) && (falling == false)) {
xaccel = xaccel - runaccelamt;
} else if (((canMove && (Key.isDown(39))) && (xaccel < maxaccel)) && (falling == false)) {
xaccel = xaccel + runaccelamt;
} else if (grounded == true) {
if (xaccel > 0) {
xaccel = xaccel - friction;
}
if (xaccel < 0) {
xaccel = xaccel + friction;
}
if ((xaccel < 0) && (xaccel > friction)) {
xaccel = 0;
}
if ((xaccel > 0) && (xaccel < friction)) {
xaccel = 0;
}
} else {
if (xaccel > 0) {
xaccel = xaccel - airrisist;
}
if (xaccel < 0) {
xaccel = xaccel + airrisist;
}
if ((xaccel < 0) && (xaccel > airrisist)) {
xaccel = 0;
}
if ((xaccel > 0) && (xaccel < airrisist)) {
xaccel = 0;
}
}
if (_root.ground.hitTest(this._x, this._y - 11, true)) {
gravity = 1;
while (_root.ground.hitTest(this._x, this._y - 10, true)) {
this._y++;
}
}
if (xaccel > 0) {
player._xscale = 40;
}
if (xaccel < 0) {
player._xscale = -40;
}
if (!Key.isDown(38)) {
pressOnce = 0;
}
if ((canMove && (Key.isDown(38))) && (jump == true)) {
gravity = gravity - (Math.cos(3.141593 * ((player._rotation * -1) / 180)) * maxjump);
jump = false;
doubleJump = true;
pressOnce = 1;
_root.jumpsnd.start(0, 0);
}
if (((canMove && (Key.isDown(38))) && (doubleJump == true)) && (pressOnce == 0)) {
gravity = 0;
gravity = gravity - (Math.cos(3.141593 * ((player._rotation * -1) / 180)) * maxjump);
doubleJump = false;
doubleJumping = true;
_root.jumpsnd.start(0, 0);
}
leftx = player._x + (Math.cos(3.141593 * (((player._rotation * -1) + 180) / 180)) * 7);
lefty = player._y - (Math.sin(3.141593 * (((player._rotation * -1) + 180) / 180)) * 7);
rightx = player._x + (Math.cos(3.141593 * ((player._rotation * -1) / 180)) * 7);
righty = player._y - (Math.sin(3.141593 * ((player._rotation * -1) / 180)) * 7);
if (ground.hitTest(leftx, lefty, true)) {
xaccel = 0;
player._x++;
}
if (ground.hitTest(rightx, righty, true)) {
xaccel = 0;
player._x--;
}
cam._x = _root.player._x;
if (player._y < 400) {
cam._y = _root.player._y;
}
cam.camControl();
player._y = player._y + gravity;
player._x = player._x + xaccel;
fade.swapDepths(_root.getNextHighestDepth());
go_fade.swapDepths(_root.getNextHighestDepth());
score = cam.tic;
};
Frame 20
stop();
portalOpen = false;
Frame 21
stop();
stage = 9;
lvl8music = new Sound();
lvl8music.attachSound("8thlvlmusic");
lvl8music.start(0, 1000);
musicplayer = "play";
cam.playPause.gotoAndStop("pause");
cam.music_eq.gotoAndStop("play");
cam.playPause.onRollOver = function () {
if (this._currentframe == 1) {
this.gotoAndStop("pauseOver");
} else {
this.gotoAndStop("playOver");
}
};
cam.playPause.onRollOut = (cam.playPause.onReleaseOutside = function () {
if (this._currentframe == 10) {
this.gotoAndStop("pause");
} else {
this.gotoAndStop("play");
}
});
cam.playPause.onRelease = function () {
if (this._currentframe == 10) {
this.gotoAndStop("playOver");
lvl8music.stop();
cam.music_eq.gotoAndStop("stop");
} else {
this.gotoAndStop("pauseOver");
lvl8music.start(0, 1000);
cam.music_eq.gotoAndStop("play");
}
};
fall_sound = new Sound();
dun_hitsnd = new Sound();
collectsnd = new Sound();
echosnd = new Sound();
shootsnd = new Sound();
portalsnd = new Sound();
jumpsnd = new Sound();
dropsnd.attachSound("drop");
fall_sound.attachSound("fall_noise");
dun_hitsnd.attachSound("dun_hit");
collectsnd.attachSound("collectedsnd");
echosnd.attachSound("echo");
shootsnd.attachSound("shoot");
portalsnd.attachSound("portaljump");
jumpsnd.attachSound("jump");
ghostboosnd = new Sound();
ghostboosnd.attachSound("ghostboo");
cam.tic = 999;
toc = 32;
cam._xscale = 120;
cam._yscale = 120;
cam.lens._xscale = 50;
cam.lens._yscale = 50;
canMove = true;
myColor = new Color(player);
myColorTransform = new Object();
myColorTransform = {rb:0, gb:0, bb:0};
myColor.setTransform(myColorTransform);
lvl_portal._visible = false;
player._alpha = 100;
player._x = 392.7;
player._y = 285.1;
portalOpen = false;
cam.ghostsleft = 8;
cam.hearts = 5;
cam.count = 0;
cam.ectoleft = 90;
fallonce = 1;
TimerWarn = 1;
PanicWarn = 1;
attacking = false;
is_attacking = 0;
inControl = true;
running = false;
gravity = 10;
gravityaccel = 1;
xaccel = 7;
runaccelamt = 0.7;
friction = 2;
airrisist = 0.07;
maxaccel = 7;
maxjump = 12;
doubleJump = false;
doubleJumping = false;
jump = true;
pressOnce = 0;
playerHit = false;
playerHitTimer = 0;
invulnerable = false;
invulnerableTimer = 0;
var monster = new Array();
monster.push(stageNineEnemy1, stageNineEnemy2, stageNineEnemy3, stageNineEnemy4, stageNineEnemy5, stageNineEnemy6, stageNineEnemy7, stageNineEnemy8, stageNineEnemy9);
var monsterAttacking = new Array();
monsterAttacking.push(false, false, false, false, false, false, false, false, false);
var monsterAlive = new Array();
monsterAlive.push(true, true, true, true, true, true, true, true, true);
var monsterAttackingTimer = new Array();
monsterAttackingTimer.push(0, 0, 0, 0, 0, 0, 0, 0, 0);
var monsterMovement = new Array();
monsterMovement.push(0, 0, 0, 0, 0, 0, 0, 0, 0);
var removeMonster = new Array();
removeMonster.push(0, 0, 0, 0, 0, 0, 0, 0, 0);
var collect = new Array();
collect.push(stageNineButton1, stageNineButton2, stageNineButton3, stageNineButton4, stageNineButton5, stageNineButton6, stageNineButton7, stageNineButton8, stageNineButton9, stageNineButton10, stageNineButton11, stageNineButton12, stageNineButton13, stageNineButton14, stageNineButton15, stageNineButton16, stageNineButton17, stageNineButton18, stageNineButton19, stageNineButton20, stageNineButton21, stageNineButton22, stageNineButton23, stageNineButton24, stageNineButton25, stageNineButton26, stageNineButton27, stageNineButton28, stageNineButton29, stageNineButton30, stageNineButton31, stageNineButton32, stageNineButton33, stageNineButton34, stageNineButton35, stageNineButton36, stageNineButton37, stageNineButton38, stageNineButton39, stageNineButton40, stageNineButton41, stageNineButton42, stageNineButton43, stageNineButton44, stageNineButton45, stageNineButton46, stageNineButton47, stageNineButton48, stageNineButton49, stageNineButton50, stageNineButton51, stageNineButton52, stageNineButton53, stageNineButton54, stageNineButton55, stageNineButton56, stageNineButton57, stageNineButton58, stageNineButton59, stageNineButton60, stageNineButton61, stageNineButton62, stageNineButton63, stageNineButton64, stageNineButton65, stageNineButton66, stageNineButton67, stageNineButton68, stageNineButton69, stageNineButton70, stageNineButton71, stageNineButton72, stageNineButton73, stageNineButton74, stageNineButton75, stageNineButton76, stageNineButton77, stageNineButton78, stageNineButton79, stageNineButton80, stageNineButton81, stageNineButton82, stageNineButton83, stageNineButton84, stageNineButton85, stageNineButton86, stageNineButton87, stageNineButton88, stageNineButton89, stageNineButton90);
player.onEnterFrame = function () {
lvl_intro._x = player._x - 150;
if ((cam.tic == 30) && (TimerWarn == 1)) {
TimerWarn = 0;
timer_warning.gotoAndPlay("playslide");
}
if ((cam.tic == 10) && (PanicWarn == 1)) {
PanicWarn = 0;
panic_warning.gotoAndPlay("playslide");
}
toc--;
if (toc == 0) {
cam.tic--;
toc = 32;
}
if ((cam.tic == 0) && (fallonce == 1)) {
fallonce = 0;
cam.tic = 0;
toc = 2000;
go_fadeout();
}
if (playerHit) {
player.gotoAndStop("hit");
playerHitTimer++;
invulnerable = true;
if (playerHitTimer == 15) {
playerHitTimer = 0;
cam.hearts--;
playerHit = false;
}
}
if (invulnerable) {
invulnerableTimer++;
player._alpha = 25;
if (invulnerableTimer == 75) {
invulnerable = false;
invulnerableTimer = 0;
player._alpha = 100;
}
}
i = collect.length - 1;
while (i >= 0) {
if (player.hitTest(collect[i])) {
if (collect[i]._alpha == 100) {
_root.collectsnd.start(0, 0);
cam.count++;
}
collect[i]._alpha = 0;
}
i--;
}
if ((player._y > 600) && (fallonce == 1)) {
canMove = false;
fall_sound.start();
fallonce = 0;
go_fadeout();
}
if (cam.hearts == 5) {
cam.health.gotoAndStop("5hearts");
}
if (cam.hearts == 4) {
cam.health.gotoAndStop("4hearts");
}
if (cam.hearts == 3) {
cam.health.gotoAndStop("3hearts");
}
if (cam.hearts == 2) {
cam.health.gotoAndStop("2hearts");
}
if (cam.hearts == 1) {
cam.health.gotoAndStop("1heart");
}
if (cam.hearts == 0) {
cam.health.gotoAndStop("0hearts");
_root.gotoAndStop("gameover");
}
i = monster.length - 1;
while (i >= 0) {
if (!monsterAlive[i]) {
removeMonster[i]++;
monster[i].gotoAndStop("hit");
if (removeMonster[i] < 2) {
monster[i]._y = monster[i]._y - 10;
}
if (removeMonster[i] > 10) {
monster[i].gotoAndStop("death");
cam.ghostsleft--;
}
if (removeMonster[i] > 10) {
monster[i].removeMovieClip();
monster.splice(i, 1);
removeMonster.splice(i, 1);
monsterMovement.splice(i, 1);
monsterAttackingTimer.splice(i, 1);
monsterAlive.splice(i, 1);
monsterAttacking.splice(i, 1);
}
}
if (monsterAlive[i]) {
if (!monsterAttacking[i]) {
monsterMovement[i]++;
monster[i].gotoAndStop("idle");
if (monsterMovement[i] == 80) {
monsterMovement[i] = 0;
}
if ((monsterMovement[i] > 0) && (monsterMovement[i] < 40)) {
monster[i]._xscale = 100;
monster[i]._x = monster[i]._x - 3;
}
if (monsterMovement[i] > 40) {
monster[i]._xscale = -100;
monster[i]._x = monster[i]._x + 3;
}
}
if (player.hitTest(monster[i])) {
if (is_attacking > 8) {
ranNum++;
_root.attachMovie("hit", "hit" + ranNum, _root.getNextHighestDepth(), {_x:player._x, _y:player._y - 10});
monsterAlive[i] = false;
_root.kicksnd.start(0, 0);
_root.echosnd.start(0, 0);
}
monsterAttackingTimer[i]++;
if (monsterAttackingTimer[i] > 20) {
monsterAttacking[i] = true;
monster[i].gotoAndStop("attack");
}
if (monsterAttackingTimer[i] == 60) {
monsterAttackingTimer[i] = 0;
monsterAttacking[i] = false;
}
if (monsterAttacking[i] == true) {
if (!invulnerable) {
if (player.hitTest(monster[i])) {
ranNum++;
dun_hitsnd.start();
_root.attachMovie("en_hit", "en_hit" + ranNum, _root.getNextHighestDepth(), {_x:player._x, _y:player._y - 10});
playerHit = true;
ghostboosnd.start(0, 0);
}
}
}
} else {
monsterAttacking[i] = 0;
monsterAttacking[i] = false;
}
}
i--;
}
portal_notice._x = player._x + 150;
portal_notice._y = player._y - 150;
if (portalOpen == true) {
_root.lvl_portal._visible = true;
}
if (((cam.count == 90) && (portalOpen == false)) && (cam.ghostsleft == 0)) {
portalOpen = true;
portal_notice.gotoAndPlay("playslide");
}
if (player.hitTest(_root.lvl_portal) && (portalOpen == true)) {
canMove = false;
portalOpen = false;
toc = 2000;
playerHit = false;
invulnerable = false;
inControl = false;
xaccel = 0;
gravity = 0;
cam.count = 0;
player._alpha = 0;
_root.lvl_portal.gotoAndStop("entered");
}
fadeout = function () {
_root.attachMovie("fade", "newfadeout", 200);
newfadeout._x = cam._x;
newfadeout._y = cam._y;
};
go_fadeout = function () {
_root.attachMovie("go_fade", "newgo_fadeout", 200);
newgo_fadeout._x = cam._x;
newgo_fadeout._y = cam._y;
};
if (Key.isDown(65) && (canMove)) {
attacking = true;
}
if (attacking) {
is_attacking++;
if (is_attacking == 20) {
attacking = false;
is_attacking = 0;
shootOnce = 0;
}
if (is_attacking == 1) {
shootsnd.start(0, 0);
if (shootOnce == 0) {
shootsnd.stop;
}
}
}
if (doubleJumping) {
if (!attacking) {
player.gotoAndStop("double");
}
if (attacking) {
player.gotoAndStop("jumpAttack");
}
}
if (inControl == false) {
running = false;
xaccel = 0;
gravity = 0;
gravityaccel = 0;
doubleJumping = false;
jump = false;
runaccelamt = 0;
doubleJumping = false;
doubleJump = false;
}
if (jump && (!doubleJumping)) {
if (running) {
if (!attacking) {
player.gotoAndStop("run");
}
if (attacking) {
player.gotoAndStop("runAttack");
}
} else {
if (!attacking) {
player.gotoAndStop("idle");
}
if (attacking) {
player.gotoAndStop("attack");
}
}
} else if (!doubleJumping) {
if (!attacking) {
player.gotoAndStop("jump");
}
if (attacking) {
player.gotoAndStop("jumpAttack");
}
}
if (Key.isDown(39) or Key.isDown(37)) {
running = true;
} else {
running = false;
}
if (!ground.hitTest(player._x, player._y + 10, true)) {
falling = true;
grounded = false;
}
if (ground.hitTest(player._x, player._y + 11, true)) {
doubleJumping = false;
doubleJump = false;
jump = true;
grounded = true;
falling = false;
while (ground.hitTest(player._x, player._y + 9, true)) {
player._y--;
}
}
if (falling == true) {
gravity = gravity + gravityaccel;
} else {
gravity = 0;
}
if (((canMove && (Key.isDown(39))) && (xaccel < maxaccel)) && (falling == true)) {
xaccel = xaccel + (runaccelamt - airrisist);
} else if (((canMove && (Key.isDown(37))) && (xaccel > (-maxaccel))) && (falling == true)) {
xaccel = xaccel - (runaccelamt - airrisist);
} else if (((canMove && (Key.isDown(37))) && (xaccel > (-maxaccel))) && (falling == false)) {
xaccel = xaccel - runaccelamt;
} else if (((canMove && (Key.isDown(39))) && (xaccel < maxaccel)) && (falling == false)) {
xaccel = xaccel + runaccelamt;
} else if (grounded == true) {
if (xaccel > 0) {
xaccel = xaccel - friction;
}
if (xaccel < 0) {
xaccel = xaccel + friction;
}
if ((xaccel < 0) && (xaccel > friction)) {
xaccel = 0;
}
if ((xaccel > 0) && (xaccel < friction)) {
xaccel = 0;
}
} else {
if (xaccel > 0) {
xaccel = xaccel - airrisist;
}
if (xaccel < 0) {
xaccel = xaccel + airrisist;
}
if ((xaccel < 0) && (xaccel > airrisist)) {
xaccel = 0;
}
if ((xaccel > 0) && (xaccel < airrisist)) {
xaccel = 0;
}
}
if (_root.ground.hitTest(this._x, this._y - 11, true)) {
gravity = 1;
while (_root.ground.hitTest(this._x, this._y - 10, true)) {
this._y++;
}
}
if (xaccel > 0) {
player._xscale = 40;
}
if (xaccel < 0) {
player._xscale = -40;
}
if (!Key.isDown(38)) {
pressOnce = 0;
}
if ((canMove && (Key.isDown(38))) && (jump == true)) {
gravity = gravity - (Math.cos(3.141593 * ((player._rotation * -1) / 180)) * maxjump);
jump = false;
doubleJump = true;
pressOnce = 1;
_root.jumpsnd.start(0, 0);
}
if (((canMove && (Key.isDown(38))) && (doubleJump == true)) && (pressOnce == 0)) {
gravity = 0;
gravity = gravity - (Math.cos(3.141593 * ((player._rotation * -1) / 180)) * maxjump);
doubleJump = false;
doubleJumping = true;
_root.jumpsnd.start(0, 0);
}
leftx = player._x + (Math.cos(3.141593 * (((player._rotation * -1) + 180) / 180)) * 7);
lefty = player._y - (Math.sin(3.141593 * (((player._rotation * -1) + 180) / 180)) * 7);
rightx = player._x + (Math.cos(3.141593 * ((player._rotation * -1) / 180)) * 7);
righty = player._y - (Math.sin(3.141593 * ((player._rotation * -1) / 180)) * 7);
if (ground.hitTest(leftx, lefty, true)) {
xaccel = 0;
player._x++;
}
if (ground.hitTest(rightx, righty, true)) {
xaccel = 0;
player._x--;
}
cam._x = _root.player._x;
if (player._y < 400) {
cam._y = _root.player._y;
}
cam.camControl();
player._y = player._y + gravity;
player._x = player._x + xaccel;
fade.swapDepths(_root.getNextHighestDepth());
go_fade.swapDepths(_root.getNextHighestDepth());
score = cam.tic;
};
Frame 22
stop();
portalOpen = false;
Frame 23
stop();
stage = 10;
titlemusic.stop();
tutlvlmusic = new Sound();
tutlvlmusic.attachSound("tutmusic");
tutlvlmusic.start(0, 1000);
musicplayer = "play";
cam.playPause.gotoAndStop("pause");
cam.music_eq.gotoAndStop("play");
cam.playPause.onRollOver = function () {
if (this._currentframe == 1) {
this.gotoAndStop("pauseOver");
} else {
this.gotoAndStop("playOver");
}
};
cam.playPause.onRollOut = (cam.playPause.onReleaseOutside = function () {
if (this._currentframe == 10) {
this.gotoAndStop("pause");
} else {
this.gotoAndStop("play");
}
});
cam.playPause.onRelease = function () {
if (this._currentframe == 10) {
this.gotoAndStop("playOver");
tutlvlmusic.stop();
cam.music_eq.gotoAndStop("stop");
} else {
this.gotoAndStop("pauseOver");
tutlvlmusic.start(0, 1000);
cam.music_eq.gotoAndStop("play");
}
};
fall_sound = new Sound();
dun_hitsnd = new Sound();
collectsnd = new Sound();
echosnd = new Sound();
shootsnd = new Sound();
portalsnd = new Sound();
jumpsnd = new Sound();
dropsnd.attachSound("drop");
fall_sound.attachSound("fall_noise");
dun_hitsnd.attachSound("dun_hit");
collectsnd.attachSound("collectedsnd");
echosnd.attachSound("echo");
shootsnd.attachSound("shoot");
portalsnd.attachSound("portaljump");
jumpsnd.attachSound("jump");
ghostboosnd = new Sound();
ghostboosnd.attachSound("ghostboo");
cam.tic = 999;
toc = 32;
cam._xscale = 120;
cam._yscale = 120;
cam.lens._xscale = 50;
cam.lens._yscale = 50;
canMove = true;
myColor = new Color(player);
myColorTransform = new Object();
myColorTransform = {rb:-200, gb:-200, bb:-200};
myColor.setTransform(myColorTransform);
portal_mc.lvl_portal._visible = false;
player._alpha = 100;
player._x = 300.7;
player._y = 99.1;
portalOpen = false;
cam.ghostsleft = 1;
cam.hearts = 5;
cam.count = 0;
cam.ectoleft = 0;
enemyCount = 0;
fallonce = 1;
shootOnce = 1;
TimerWarn = 1;
PanicWarn = 1;
attacking = false;
is_attacking = 0;
inControl = true;
running = false;
gravity = 10;
gravityaccel = 1;
xaccel = 7;
runaccelamt = 0.7;
friction = 2;
airrisist = 0.07;
maxaccel = 7;
maxjump = 12;
doubleJump = false;
doubleJumping = false;
jump = true;
pressOnce = 0;
playerHit = false;
playerHitTimer = 0;
invulnerable = false;
invulnerableTimer = 0;
var monster = new Array();
monster.push(stageEndEnemy1);
var monsterAttacking = new Array();
monsterAttacking.push(false);
var monsterAlive = new Array();
monsterAlive.push(true);
var monsterAttackingTimer = new Array();
monsterAttackingTimer.push(0);
var monsterMovement = new Array();
monsterMovement.push(0);
var removeMonster = new Array();
removeMonster.push(0);
var collect = new Array();
collect.push();
player.onEnterFrame = function () {
fadein._x = player._x;
fadein._y = player._y;
lvl_intro._x = player._x - 150;
if ((cam.tic == 30) && (TimerWarn == 1)) {
TimerWarn = 0;
timer_warning.gotoAndPlay("playslide");
}
if ((cam.tic == 10) && (PanicWarn == 1)) {
PanicWarn = 0;
panic_warning.gotoAndPlay("playslide");
}
toc--;
if (toc == 0) {
cam.tic--;
toc = 32;
}
if ((cam.tic == 0) && (fallonce == 1)) {
fallonce = 0;
cam.tic = 0;
toc = 2000;
go_fadeout();
}
if (playerHit) {
player.gotoAndStop("hit");
playerHitTimer++;
invulnerable = true;
if (playerHitTimer == 15) {
playerHitTimer = 0;
cam.hearts--;
playerHit = false;
}
}
if (invulnerable) {
invulnerableTimer++;
player._alpha = 25;
if (invulnerableTimer == 75) {
invulnerable = false;
invulnerableTimer = 0;
player._alpha = 100;
}
}
i = collect.length - 1;
while (i >= 0) {
if (player.hitTest(collect[i])) {
if (collect[i]._alpha == 100) {
_root.collectsnd.start(0, 0);
cam.count++;
}
collect[i]._alpha = 0;
}
i--;
}
if ((player._y > 600) && (fallonce == 1)) {
canMove = false;
fall_sound.start();
fallonce = 0;
go_fadeout();
}
if (cam.hearts == 5) {
cam.health.gotoAndStop("5hearts");
}
if (cam.hearts == 4) {
cam.health.gotoAndStop("4hearts");
}
if (cam.hearts == 3) {
cam.health.gotoAndStop("3hearts");
}
if (cam.hearts == 2) {
cam.health.gotoAndStop("2hearts");
}
if (cam.hearts == 1) {
cam.health.gotoAndStop("1heart");
}
if (cam.hearts == 0) {
cam.health.gotoAndStop("0hearts");
_root.gotoAndStop("gameover");
}
i = monster.length - 1;
while (i >= 0) {
if (!monsterAlive[i]) {
removeMonster[i]++;
monster[i].gotoAndStop("hit");
if (removeMonster[i] < 2) {
monster[i]._y = monster[i]._y - 10;
}
if (removeMonster[i] > 10) {
monster[i].gotoAndStop("death");
cam.ghostsleft--;
}
if (removeMonster[i] > 10) {
monster[i].removeMovieClip();
monster.splice(i, 1);
removeMonster.splice(i, 1);
monsterMovement.splice(i, 1);
monsterAttackingTimer.splice(i, 1);
monsterAlive.splice(i, 1);
monsterAttacking.splice(i, 1);
}
}
if (monsterAlive[i]) {
if (!monsterAttacking[i]) {
monsterMovement[i]++;
monster[i].gotoAndStop("idle");
if (monsterMovement[i] == 80) {
monsterMovement[i] = 0;
}
if ((monsterMovement[i] > 0) && (monsterMovement[i] < 40)) {
monster[i]._xscale = 170;
}
}
if (player.hitTest(monster[i])) {
if (is_attacking > 8) {
ranNum++;
_root.attachMovie("hit", "hit" + ranNum, _root.getNextHighestDepth(), {_x:player._x, _y:player._y - 10});
monsterAlive[i] = false;
_root.kicksnd.start(0, 0);
_root.echosnd.start(0, 0);
_root.fadeout();
inControl = false;
xaccel = 0;
}
monsterAttackingTimer[i]++;
if (monsterAttackingTimer[i] > 20) {
monsterAttacking[i] = true;
monster[i].gotoAndStop("attack");
}
if (monsterAttackingTimer[i] == 60) {
monsterAttackingTimer[i] = 0;
monsterAttacking[i] = false;
ghostboosnd.stop;
}
if (monsterAttacking[i] == true) {
if (!invulnerable) {
if (player.hitTest(monster[i])) {
ranNum++;
dun_hitsnd.start();
_root.attachMovie("en_hit", "en_hit" + ranNum, _root.getNextHighestDepth(), {_x:player._x, _y:player._y - 10});
playerHit = true;
ghostboosnd.start(0, 0);
}
}
}
} else {
monsterAttacking[i] = 0;
monsterAttacking[i] = false;
}
}
i--;
}
portal_notice._x = player._x + 150;
portal_notice._y = player._y - 150;
if (portalOpen == true) {
portal_mc.lvl_portal._visible = true;
}
if (((cam.count == 3) && (portalOpen == false)) && (cam.ghostsleft == 0)) {
portalOpen = true;
}
if (player.hitTest(_root.portal_mc.lvl_portal) && (portalOpen == true)) {
canMove = false;
portalOpen = false;
toc = 2000;
playerHit = false;
invulnerable = false;
inControl = false;
xaccel = 0;
gravity = 0;
cam.count = 0;
player._alpha = 0;
_root.portal_mc.lvl_portal.gotoAndStop("entered");
}
fadeout = function () {
_root.attachMovie("fade", "newfadeout", 200);
newfadeout._x = cam._x;
newfadeout._y = cam._y;
};
go_fadeout = function () {
_root.attachMovie("go_fade", "newgo_fadeout", 200);
newgo_fadeout._x = cam._x;
newgo_fadeout._y = cam._y;
};
if (Key.isDown(65) && (canMove)) {
attacking = true;
}
if (attacking) {
is_attacking++;
if (is_attacking == 20) {
attacking = false;
is_attacking = 0;
shootOnce = 0;
}
if (is_attacking == 1) {
shootsnd.start(0, 0);
if (shootOnce == 0) {
shootsnd.stop;
}
}
}
if (doubleJumping) {
if (!attacking) {
player.gotoAndStop("double");
}
if (attacking) {
player.gotoAndStop("jumpAttack");
}
}
if (inControl == false) {
running = false;
xaccel = 0;
gravity = 0;
gravityaccel = 0;
doubleJumping = false;
jump = false;
runaccelamt = 0;
doubleJumping = false;
doubleJump = false;
}
if (jump && (!doubleJumping)) {
if (running) {
if (!attacking) {
player.gotoAndStop("run");
}
if (attacking) {
player.gotoAndStop("runAttack");
}
} else {
if (!attacking) {
player.gotoAndStop("idle");
}
if (attacking) {
player.gotoAndStop("attack");
}
}
} else if (!doubleJumping) {
if (!attacking) {
player.gotoAndStop("jump");
}
if (attacking) {
player.gotoAndStop("jumpAttack");
}
}
if (Key.isDown(39) or Key.isDown(37)) {
running = true;
} else {
running = false;
}
if (!ground.hitTest(player._x, player._y + 10, true)) {
falling = true;
grounded = false;
}
if (ground.hitTest(player._x, player._y + 11, true)) {
doubleJumping = false;
doubleJump = false;
jump = true;
grounded = true;
falling = false;
while (ground.hitTest(player._x, player._y + 9, true)) {
player._y--;
}
}
if (falling == true) {
gravity = gravity + gravityaccel;
} else {
gravity = 0;
}
if (((canMove && (Key.isDown(39))) && (xaccel < maxaccel)) && (falling == true)) {
xaccel = xaccel + (runaccelamt - airrisist);
} else if (((canMove && (Key.isDown(37))) && (xaccel > (-maxaccel))) && (falling == true)) {
xaccel = xaccel - (runaccelamt - airrisist);
} else if (((canMove && (Key.isDown(37))) && (xaccel > (-maxaccel))) && (falling == false)) {
xaccel = xaccel - runaccelamt;
} else if (((canMove && (Key.isDown(39))) && (xaccel < maxaccel)) && (falling == false)) {
xaccel = xaccel + runaccelamt;
} else if (grounded == true) {
if (xaccel > 0) {
xaccel = xaccel - friction;
}
if (xaccel < 0) {
xaccel = xaccel + friction;
}
if ((xaccel < 0) && (xaccel > friction)) {
xaccel = 0;
}
if ((xaccel > 0) && (xaccel < friction)) {
xaccel = 0;
}
} else {
if (xaccel > 0) {
xaccel = xaccel - airrisist;
}
if (xaccel < 0) {
xaccel = xaccel + airrisist;
}
if ((xaccel < 0) && (xaccel > airrisist)) {
xaccel = 0;
}
if ((xaccel > 0) && (xaccel < airrisist)) {
xaccel = 0;
}
}
if (_root.ground.hitTest(this._x, this._y - 11, true)) {
gravity = 1;
while (_root.ground.hitTest(this._x, this._y - 10, true)) {
this._y++;
}
}
if (xaccel > 0) {
player._xscale = 40;
}
if (xaccel < 0) {
player._xscale = -40;
}
if (!Key.isDown(38)) {
pressOnce = 0;
}
if ((canMove && (Key.isDown(38))) && (jump == true)) {
gravity = gravity - (Math.cos(3.141593 * ((player._rotation * -1) / 180)) * maxjump);
jump = false;
doubleJump = true;
pressOnce = 1;
_root.jumpsnd.start(0, 0);
}
if (((canMove && (Key.isDown(38))) && (doubleJump == true)) && (pressOnce == 0)) {
gravity = 0;
gravity = gravity - (Math.cos(3.141593 * ((player._rotation * -1) / 180)) * maxjump);
doubleJump = false;
doubleJumping = true;
_root.jumpsnd.start(0, 0);
}
leftx = player._x + (Math.cos(3.141593 * (((player._rotation * -1) + 180) / 180)) * 7);
lefty = player._y - (Math.sin(3.141593 * (((player._rotation * -1) + 180) / 180)) * 7);
rightx = player._x + (Math.cos(3.141593 * ((player._rotation * -1) / 180)) * 7);
righty = player._y - (Math.sin(3.141593 * ((player._rotation * -1) / 180)) * 7);
if (ground.hitTest(leftx, lefty, true)) {
xaccel = 0;
player._x++;
}
if (ground.hitTest(rightx, righty, true)) {
xaccel = 0;
player._x--;
}
cam._x = _root.player._x;
if (player._y < 400) {
cam._y = _root.player._y;
}
cam.camControl();
player._y = player._y + gravity;
player._x = player._x + xaccel;
fade.swapDepths(_root.getNextHighestDepth());
go_fade.swapDepths(_root.getNextHighestDepth());
score = cam.tic;
};
Frame 24
function tws_submitScore(_tws_score) {
if (score == undefined) {
_tws_score = 0;
} else {
_tws_score = score;
}
var _local5 = 13913;
var _local7 = "utm_medium=flashgame&utm_term=the_kid_spectre&utm_content=highscore&utm_campaign=sponsored_games";
var _local3 = "0123456789abcdef";
var _local2 = _local3.charAt(Math.round((Math.random() * 16) + 0.5) - 1);
var _local6 = "http://www.funnygames.nu/highscores/submit.html";
_local2 = _local2 + _local3.charAt(Math.round((Math.random() * 16) + 0.5) - 1);
_local2 = _local2 + ((String(_tws_score).charAt(1).length > 0) ? (String(_tws_score).charAt(1)) : (_local3.charAt(Math.round((Math.random() * 16) + 0.5) - 1)));
_local2 = _local2 + _local3.charAt(Math.round((Math.random() * 16) + 0.5) - 1);
_local2 = _local2 + _local3.charAt(Math.round((Math.random() * 16) + 0.5) - 1);
_local2 = _local2 + ((String(_tws_score).charAt(6).length > 0) ? (String(_tws_score).charAt(6)) : (_local3.charAt(Math.round((Math.random() * 16) + 0.5) - 1)));
_local2 = _local2 + _local3.charAt(Math.round((Math.random() * 16) + 0.5) - 1);
_local2 = _local2 + _local3.charAt(Math.round((Math.random() * 16) + 0.5) - 1);
_local2 = _local2 + _local3.charAt(Math.round((Math.random() * 16) + 0.5) - 1);
_local2 = _local2 + _local3.charAt(Math.round((Math.random() * 16) + 0.5) - 1);
_local2 = _local2 + ((String(_tws_score).charAt(9).length > 0) ? (String(_tws_score).charAt(9)) : (_local3.charAt(Math.round((Math.random() * 16) + 0.5) - 1)));
_local2 = _local2 + ((String(_tws_score).charAt(8).length > 0) ? (String(_tws_score).charAt(8)) : (_local3.charAt(Math.round((Math.random() * 16) + 0.5) - 1)));
_local2 = _local2 + _local3.charAt(Math.round((Math.random() * 16) + 0.5) - 1);
_local2 = _local2 + _local3.charAt(Math.round((Math.random() * 16) + 0.5) - 1);
_local2 = _local2 + _local3.charAt(Math.round((Math.random() * 16) + 0.5) - 1);
_local2 = _local2 + _local3.charAt(Math.round((Math.random() * 16) + 0.5) - 1);
_local2 = _local2 + ((String(_tws_score).charAt(3).length > 0) ? (String(_tws_score).charAt(3)) : (_local3.charAt(Math.round((Math.random() * 16) + 0.5) - 1)));
_local2 = _local2 + _local3.charAt(Math.round((Math.random() * 16) + 0.5) - 1);
_local2 = _local2 + ((String(_tws_score).charAt(2).length > 0) ? (String(_tws_score).charAt(2)) : (_local3.charAt(Math.round((Math.random() * 16) + 0.5) - 1)));
_local2 = _local2 + _local3.charAt(Math.round((Math.random() * 16) + 0.5) - 1);
_local2 = _local2 + ((String(_tws_score).charAt(7).length > 0) ? (String(_tws_score).charAt(7)) : (_local3.charAt(Math.round((Math.random() * 16) + 0.5) - 1)));
_local2 = _local2 + _local3.charAt(Math.round((Math.random() * 16) + 0.5) - 1);
_local2 = _local2 + _local3.charAt(Math.round((Math.random() * 16) + 0.5) - 1);
_local2 = _local2 + ((String(_tws_score).charAt(0).length > 0) ? (String(_tws_score).charAt(0)) : (_local3.charAt(Math.round((Math.random() * 16) + 0.5) - 1)));
_local2 = _local2 + _local3.charAt(Math.round((Math.random() * 16) + 0.5) - 1);
_local2 = _local2 + _local3.charAt(Math.round((Math.random() * 16) + 0.5) - 1);
_local2 = _local2 + ((String(_tws_score).charAt(5).length > 0) ? (String(_tws_score).charAt(5)) : (_local3.charAt(Math.round((Math.random() * 16) + 0.5) - 1)));
_local2 = _local2 + _local3.charAt(Math.round((Math.random() * 16) + 0.5) - 1);
_local2 = _local2 + ((String(_tws_score).charAt(4).length > 0) ? (String(_tws_score).charAt(4)) : (_local3.charAt(Math.round((Math.random() * 16) + 0.5) - 1)));
_local2 = _local2 + _local3.charAt(Math.round((Math.random() * 16) + 0.5) - 1);
_local2 = _local2 + _local3.charAt(Math.round((Math.random() * 16) + 0.5) - 1);
_local2 = _local2 + _local3.charAt(Math.round((Math.random() * 16) + 0.5) - 1);
if (!_root.tibaco) {
getURL ((((((((((((_local6 + "?length=") + String(_tws_score).length) + "&score=") + _tws_score) + "&session=") + _local2) + "&gameid=") + _local5) + "&") + _local7) + "&utm_source=") + escape(_url), "_blank");
} else {
getURL ((((((((_local6 + "?length=") + String(_tws_score).length) + "&score=") + _tws_score) + "&session=") + _local2) + "&gameid=") + _local5, "_blank");
}
}
stop();
score = score * stage;
runonetime = 0;
sub.onRelease = function () {
tws_submitScore();
};
Instance of Symbol 784 MovieClip "sub" in Frame 24
on (rollOver) {
this.gotoAndStop(2);
}
on (rollOut) {
this.gotoAndStop(1);
}
Frame 25
function tws_submitScore(_tws_score) {
if (score == undefined) {
_tws_score = 0;
} else {
_tws_score = score;
}
var _local5 = 13913;
var _local7 = "utm_medium=flashgame&utm_term=the_kid_spectre&utm_content=highscore&utm_campaign=sponsored_games";
var _local3 = "0123456789abcdef";
var _local2 = _local3.charAt(Math.round((Math.random() * 16) + 0.5) - 1);
var _local6 = "http://www.funnygames.nu/highscores/submit.html";
_local2 = _local2 + _local3.charAt(Math.round((Math.random() * 16) + 0.5) - 1);
_local2 = _local2 + ((String(_tws_score).charAt(1).length > 0) ? (String(_tws_score).charAt(1)) : (_local3.charAt(Math.round((Math.random() * 16) + 0.5) - 1)));
_local2 = _local2 + _local3.charAt(Math.round((Math.random() * 16) + 0.5) - 1);
_local2 = _local2 + _local3.charAt(Math.round((Math.random() * 16) + 0.5) - 1);
_local2 = _local2 + ((String(_tws_score).charAt(6).length > 0) ? (String(_tws_score).charAt(6)) : (_local3.charAt(Math.round((Math.random() * 16) + 0.5) - 1)));
_local2 = _local2 + _local3.charAt(Math.round((Math.random() * 16) + 0.5) - 1);
_local2 = _local2 + _local3.charAt(Math.round((Math.random() * 16) + 0.5) - 1);
_local2 = _local2 + _local3.charAt(Math.round((Math.random() * 16) + 0.5) - 1);
_local2 = _local2 + _local3.charAt(Math.round((Math.random() * 16) + 0.5) - 1);
_local2 = _local2 + ((String(_tws_score).charAt(9).length > 0) ? (String(_tws_score).charAt(9)) : (_local3.charAt(Math.round((Math.random() * 16) + 0.5) - 1)));
_local2 = _local2 + ((String(_tws_score).charAt(8).length > 0) ? (String(_tws_score).charAt(8)) : (_local3.charAt(Math.round((Math.random() * 16) + 0.5) - 1)));
_local2 = _local2 + _local3.charAt(Math.round((Math.random() * 16) + 0.5) - 1);
_local2 = _local2 + _local3.charAt(Math.round((Math.random() * 16) + 0.5) - 1);
_local2 = _local2 + _local3.charAt(Math.round((Math.random() * 16) + 0.5) - 1);
_local2 = _local2 + _local3.charAt(Math.round((Math.random() * 16) + 0.5) - 1);
_local2 = _local2 + ((String(_tws_score).charAt(3).length > 0) ? (String(_tws_score).charAt(3)) : (_local3.charAt(Math.round((Math.random() * 16) + 0.5) - 1)));
_local2 = _local2 + _local3.charAt(Math.round((Math.random() * 16) + 0.5) - 1);
_local2 = _local2 + ((String(_tws_score).charAt(2).length > 0) ? (String(_tws_score).charAt(2)) : (_local3.charAt(Math.round((Math.random() * 16) + 0.5) - 1)));
_local2 = _local2 + _local3.charAt(Math.round((Math.random() * 16) + 0.5) - 1);
_local2 = _local2 + ((String(_tws_score).charAt(7).length > 0) ? (String(_tws_score).charAt(7)) : (_local3.charAt(Math.round((Math.random() * 16) + 0.5) - 1)));
_local2 = _local2 + _local3.charAt(Math.round((Math.random() * 16) + 0.5) - 1);
_local2 = _local2 + _local3.charAt(Math.round((Math.random() * 16) + 0.5) - 1);
_local2 = _local2 + ((String(_tws_score).charAt(0).length > 0) ? (String(_tws_score).charAt(0)) : (_local3.charAt(Math.round((Math.random() * 16) + 0.5) - 1)));
_local2 = _local2 + _local3.charAt(Math.round((Math.random() * 16) + 0.5) - 1);
_local2 = _local2 + _local3.charAt(Math.round((Math.random() * 16) + 0.5) - 1);
_local2 = _local2 + ((String(_tws_score).charAt(5).length > 0) ? (String(_tws_score).charAt(5)) : (_local3.charAt(Math.round((Math.random() * 16) + 0.5) - 1)));
_local2 = _local2 + _local3.charAt(Math.round((Math.random() * 16) + 0.5) - 1);
_local2 = _local2 + ((String(_tws_score).charAt(4).length > 0) ? (String(_tws_score).charAt(4)) : (_local3.charAt(Math.round((Math.random() * 16) + 0.5) - 1)));
_local2 = _local2 + _local3.charAt(Math.round((Math.random() * 16) + 0.5) - 1);
_local2 = _local2 + _local3.charAt(Math.round((Math.random() * 16) + 0.5) - 1);
_local2 = _local2 + _local3.charAt(Math.round((Math.random() * 16) + 0.5) - 1);
if (!_root.tibaco) {
getURL ((((((((((((_local6 + "?length=") + String(_tws_score).length) + "&score=") + _tws_score) + "&session=") + _local2) + "&gameid=") + _local5) + "&") + _local7) + "&utm_source=") + escape(_url), "_blank");
} else {
getURL ((((((((_local6 + "?length=") + String(_tws_score).length) + "&score=") + _tws_score) + "&session=") + _local2) + "&gameid=") + _local5, "_blank");
}
}
stop();
score = score * stage;
stopAllSounds();
count = 0;
runonetime = 0;
fallonce = 1;
_root.newgo_fadeout.removeMovieClip("GO_fade");
sub.onRelease = function () {
tws_submitScore();
};
try_again.onRollOver = function () {
this.gotoAndStop("over");
};
try_again.onRollOut = function () {
this.gotoAndStop("off");
};
try_again.onRelease = function () {
if (stage == 1) {
gotoAndStop ("tutorial_lvl");
}
if (stage == 2) {
gotoAndStop ("2nd_lvl");
}
if (stage == 3) {
gotoAndStop ("3rd_lvl");
}
if (stage == 3) {
gotoAndStop ("3rd_lvl");
}
if (stage == 4) {
gotoAndStop ("4th_lvl");
}
if (stage == 5) {
gotoAndStop ("5th_lvl");
}
if (stage == 6) {
gotoAndStop ("6th_lvl");
}
if (stage == 7) {
gotoAndStop ("7th_lvl");
}
if (stage == 8) {
gotoAndStop ("8th_lvl");
}
if (stage == 9) {
gotoAndStop ("9th_lvl");
}
if (stage == 10) {
gotoAndStop ("end_lvl");
}
};
Instance of Symbol 794 MovieClip "sub" in Frame 25
on (rollOver) {
this.gotoAndStop(2);
}
on (rollOut) {
this.gotoAndStop(1);
}
Frame 26
stop();
Symbol 28 MovieClip Frame 37
stop();
Symbol 814 MovieClip [__Packages.mx.transitions.OnEnterFrameBeacon] Frame 0
class mx.transitions.OnEnterFrameBeacon
{
function OnEnterFrameBeacon () {
}
static function init() {
var _local4 = _global.MovieClip;
if (!_root.__OnEnterFrameBeacon) {
mx.transitions.BroadcasterMX.initialize(_local4);
var _local3 = _root.createEmptyMovieClip("__OnEnterFrameBeacon", 9876);
_local3.onEnterFrame = function () {
_global.MovieClip.broadcastMessage("onEnterFrame");
};
}
}
static var version = "1.1.0.52";
}
Symbol 815 MovieClip [__Packages.mx.transitions.BroadcasterMX] Frame 0
class mx.transitions.BroadcasterMX
{
var _listeners;
function BroadcasterMX () {
}
static function initialize(o, dontCreateArray) {
if (o.broadcastMessage != undefined) {
delete o.broadcastMessage;
}
o.addListener = mx.transitions.BroadcasterMX.prototype.addListener;
o.removeListener = mx.transitions.BroadcasterMX.prototype.removeListener;
if (!dontCreateArray) {
o._listeners = new Array();
}
}
function addListener(o) {
removeListener(o);
if (broadcastMessage == undefined) {
broadcastMessage = mx.transitions.BroadcasterMX.prototype.broadcastMessage;
}
return(_listeners.push(o));
}
function removeListener(o) {
var _local2 = _listeners;
var _local3 = _local2.length;
while (_local3--) {
if (_local2[_local3] == o) {
_local2.splice(_local3, 1);
if (!_local2.length) {
broadcastMessage = undefined;
}
return(true);
}
}
return(false);
}
function broadcastMessage() {
var _local5 = String(arguments.shift());
var _local4 = _listeners.concat();
var _local6 = _local4.length;
var _local3 = 0;
while (_local3 < _local6) {
_local4[_local3][_local5].apply(_local4[_local3], arguments);
_local3++;
}
}
static var version = "1.1.0.52";
}
Symbol 816 MovieClip [__Packages.mx.transitions.Tween] Frame 0
class mx.transitions.Tween
{
var obj, prop, begin, useSeconds, _listeners, addListener, prevTime, _time, looping, _duration, broadcastMessage, isPlaying, _fps, prevPos, _pos, change, _intervalID, _startTime;
function Tween (obj, prop, func, begin, finish, duration, useSeconds) {
mx.transitions.OnEnterFrameBeacon.init();
if (!arguments.length) {
return;
}
this.obj = obj;
this.prop = prop;
this.begin = begin;
position = (begin);
this.duration = (duration);
this.useSeconds = useSeconds;
if (func) {
this.func = func;
}
this.finish = (finish);
_listeners = [];
addListener(this);
start();
}
function set time(t) {
prevTime = _time;
if (t > duration) {
if (looping) {
rewind(t - _duration);
update();
broadcastMessage("onMotionLooped", this);
} else {
if (useSeconds) {
_time = _duration;
update();
}
stop();
broadcastMessage("onMotionFinished", this);
}
} else if (t < 0) {
rewind();
update();
} else {
_time = t;
update();
}
//return(time);
}
function get time() {
return(_time);
}
function set duration(d) {
_duration = (((d == null) || (d <= 0)) ? (_global.Infinity) : (d));
//return(duration);
}
function get duration() {
return(_duration);
}
function set FPS(fps) {
var _local2 = isPlaying;
stopEnterFrame();
_fps = fps;
if (_local2) {
startEnterFrame();
}
//return(FPS);
}
function get FPS() {
return(_fps);
}
function set position(p) {
setPosition(p);
//return(position);
}
function setPosition(p) {
prevPos = _pos;
obj[prop] = (_pos = p);
broadcastMessage("onMotionChanged", this, _pos);
updateAfterEvent();
}
function get position() {
return(getPosition());
}
function getPosition(t) {
if (t == undefined) {
t = _time;
}
return(func(t, begin, change, _duration));
}
function set finish(f) {
change = f - begin;
//return(finish);
}
function get finish() {
return(begin + change);
}
function continueTo(finish, duration) {
begin = position;
this.finish = (finish);
if (duration != undefined) {
this.duration = (duration);
}
start();
}
function yoyo() {
continueTo(begin, time);
}
function startEnterFrame() {
if (_fps == undefined) {
_global.MovieClip.addListener(this);
} else {
_intervalID = setInterval(this, "onEnterFrame", 1000 / _fps);
}
isPlaying = true;
}
function stopEnterFrame() {
if (_fps == undefined) {
_global.MovieClip.removeListener(this);
} else {
clearInterval(_intervalID);
}
isPlaying = false;
}
function start() {
rewind();
startEnterFrame();
broadcastMessage("onMotionStarted", this);
}
function stop() {
stopEnterFrame();
broadcastMessage("onMotionStopped", this);
}
function resume() {
fixTime();
startEnterFrame();
broadcastMessage("onMotionResumed", this);
}
function rewind(t) {
_time = ((t == undefined) ? 0 : (t));
fixTime();
update();
}
function fforward() {
time = (_duration);
fixTime();
}
function nextFrame() {
if (useSeconds) {
time = ((getTimer() - _startTime) / 1000);
} else {
time = (_time + 1);
}
}
function onEnterFrame() {
nextFrame();
}
function prevFrame() {
if (!useSeconds) {
time = (_time - 1);
}
}
function toString() {
return("[Tween]");
}
function fixTime() {
if (useSeconds) {
_startTime = getTimer() - (_time * 1000);
}
}
function update() {
position = (getPosition(_time));
}
static var version = "1.1.0.52";
static var __initBeacon = mx.transitions.OnEnterFrameBeacon.init();
static var __initBroadcaster = mx.transitions.BroadcasterMX.initialize(mx.transitions.Tween.prototype, true);
function func(t, b, c, d) {
return(((c * t) / d) + b);
}
}
Symbol 817 MovieClip [__Packages.mx.transitions.easing.Elastic] Frame 0
class mx.transitions.easing.Elastic
{
function Elastic () {
}
static function easeIn(t, b, c, d, a, p) {
if (t == 0) {
return(b);
}
t = t / d;
if (t == 1) {
return(b + c);
}
if (!p) {
p = d * 0.3;
}
if ((!a) || (a < Math.abs(c))) {
a = c;
var _local7 = p / 4;
} else {
var _local7 = (p / (Math.PI*2)) * Math.asin(c / a);
}
t = t - 1;
return((-((a * Math.pow(2, 10 * t)) * Math.sin((((t * d) - _local7) * (Math.PI*2)) / p))) + b);
}
static function easeOut(t, b, c, d, a, p) {
if (t == 0) {
return(b);
}
t = t / d;
if (t == 1) {
return(b + c);
}
if (!p) {
p = d * 0.3;
}
if ((!a) || (a < Math.abs(c))) {
a = c;
var _local7 = p / 4;
} else {
var _local7 = (p / (Math.PI*2)) * Math.asin(c / a);
}
return((((a * Math.pow(2, -10 * t)) * Math.sin((((t * d) - _local7) * (Math.PI*2)) / p)) + c) + b);
}
static function easeInOut(t, b, c, d, a, p) {
if (t == 0) {
return(b);
}
t = t / (d / 2);
if (t == 2) {
return(b + c);
}
if (!p) {
p = d * 0.45;
}
if ((!a) || (a < Math.abs(c))) {
a = c;
var _local7 = p / 4;
} else {
var _local7 = (p / (Math.PI*2)) * Math.asin(c / a);
}
if (t < 1) {
t = t - 1;
return((-0.5 * ((a * Math.pow(2, 10 * t)) * Math.sin((((t * d) - _local7) * (Math.PI*2)) / p))) + b);
}
t = t - 1;
return(((((a * Math.pow(2, -10 * t)) * Math.sin((((t * d) - _local7) * (Math.PI*2)) / p)) * 0.5) + c) + b);
}
static var version = "1.1.0.52";
}
Symbol 818 MovieClip [__Packages.mx.transitions.easing.Strong] Frame 0
class mx.transitions.easing.Strong
{
function Strong () {
}
static function easeIn(t, b, c, d) {
t = t / d;
return((((((c * t) * t) * t) * t) * t) + b);
}
static function easeOut(t, b, c, d) {
t = (t / d) - 1;
return((c * (((((t * t) * t) * t) * t) + 1)) + b);
}
static function easeInOut(t, b, c, d) {
t = t / (d / 2);
if (t < 1) {
return(((((((c / 2) * t) * t) * t) * t) * t) + b);
}
t = t - 2;
return(((c / 2) * (((((t * t) * t) * t) * t) + 2)) + b);
}
static var version = "1.1.0.52";
}
Symbol 819 MovieClip [__Packages.mx.transitions.easing.Regular] Frame 0
class mx.transitions.easing.Regular
{
function Regular () {
}
static function easeIn(t, b, c, d) {
t = t / d;
return(((c * t) * t) + b);
}
static function easeOut(t, b, c, d) {
t = t / d;
return((((-c) * t) * (t - 2)) + b);
}
static function easeInOut(t, b, c, d) {
t = t / (d / 2);
if (t < 1) {
return((((c / 2) * t) * t) + b);
}
t--;
return((((-c) / 2) * ((t * (t - 2)) - 1)) + b);
}
static var version = "1.1.0.52";
}
Symbol 53 MovieClip Frame 41
stop();
Symbol 60 MovieClip Frame 41
stop();
Symbol 72 MovieClip [fade] Frame 84
stop();
_root.newfadout.removeMovieClip("fade");
_root.nextFrame();
this.removeMovieClip();
Symbol 75 MovieClip [go_fade] Frame 84
stop();
stopAllSounds();
_root.gotoAndStop("gameover");
this.removeMovieClip();
Symbol 97 MovieClip Frame 1
var deze_website;
if (_url.substr(0, 4) == "http") {
deze_website = _url;
} else {
deze_website = "local";
}
var content_knop = "logo";
var spel_naam = "the_kid_spectre";
var link = "http://www.funnygames.nu";
if (!_root.tibaco) {
link = link.concat(((((("/?utm_source=" + deze_website) + "&utm_medium=flashgame&utm_term=") + spel_naam) + "&utm_content=") + content_knop) + "&utm_campaign=sponsored_games");
}
funny.onRelease = function () {
getURL (link, "_blank");
};
Symbol 139 MovieClip Frame 1
stepOne = new Sound();
stepOne.attachSound("step1");
stepTwo = new Sound();
stepTwo.attachSound("step2");
Symbol 139 MovieClip Frame 7
stepOne.start(0, 0);
Symbol 139 MovieClip Frame 16
stepTwo.start(0, 0);
Symbol 162 MovieClip Frame 80
stop();
Symbol 169 MovieClip Frame 125
stop();
Symbol 187 Button
on (release) {
_root.nextFrame();
}
Symbol 191 Button
on (release) {
_root.gotoAndStop("credits");
}
Symbol 196 MovieClip Frame 1
var deze_website;
if (_url.substr(0, 4) == "http") {
deze_website = _url;
} else {
deze_website = "local";
}
var content_knop = "more_games";
var spel_naam = "the_kid_spectre";
var link = "http://www.funnygames.nu";
if (!_root.tibaco) {
link = link.concat(((((("/?utm_source=" + deze_website) + "&utm_medium=flashgame&utm_term=") + spel_naam) + "&utm_content=") + content_knop) + "&utm_campaign=sponsored_games");
}
pmg.onRelease = function () {
getURL (link, "_blank");
};
Symbol 201 MovieClip Frame 1
var deze_website;
if (_url.substr(0, 4) == "http") {
deze_website = _url;
} else {
deze_website = "local";
}
var content_knop = "download_game";
var spel_naam = "the_kid_spectre";
var link = "http://www.funnygames.nu/redirect.html?gameid=13913&page=download";
if (!_root.tibaco) {
link = link.concat(((((("&utm_source=" + deze_website) + "&utm_medium=flashgame&utm_term=") + spel_naam) + "&utm_content=") + content_knop) + "&utm_campaign=sponsored_games");
}
dlc.onRelease = function () {
getURL (link, "_blank");
};
Symbol 206 MovieClip Frame 1
var deze_website;
if (_url.substr(0, 4) == "http") {
deze_website = _url;
} else {
deze_website = "local";
}
var content_knop = "highscores";
var spel_naam = "the_kid_spectre";
var link = "http://www.funnygames.nu/redirect.html?gameid=13913&page=highscores";
if (!_root.tibaco) {
link = link.concat(((((("&utm_source=" + deze_website) + "&utm_medium=flashgame&utm_term=") + spel_naam) + "&utm_content=") + content_knop) + "&utm_campaign=sponsored_games");
}
hsc.onRelease = function () {
getURL (link, "_blank");
};
Symbol 208 MovieClip Frame 220
stop();
Instance of Symbol 222 MovieClip in Symbol 228 MovieClip Frame 1
onClipEvent (load) {
width = 450;
height = 180;
speed = Math.round(Math.random() * 2) + 0.2;
x = (this._x = Math.random() * width);
y = (this._y = Math.random() * height);
x_new = Math.random() * width;
y_new = Math.random() * height;
}
onClipEvent (enterFrame) {
if (x_new > this._x) {
sign_x = 1;
this._xscale = 100;
} else {
sign_x = -1;
this._xscale = -100;
}
dx = Math.abs(x_new - this._x);
if ((dx > speed) || (dx < (-speed))) {
this._x = this._x + (sign_x * speed);
} else {
x_new = Math.random() * width;
}
if (y_new > this._y) {
sign_y = 1;
} else {
sign_y = -1;
}
dy = Math.abs(y_new - this._y);
if ((dy > speed) || (dy < (-speed))) {
this._y = this._y + (sign_y * speed);
} else {
y_new = Math.random() * height;
}
}
Instance of Symbol 222 MovieClip in Symbol 228 MovieClip Frame 1
onClipEvent (load) {
width = 450;
height = 180;
speed = Math.round(Math.random() * 2) + 0.2;
x = (this._x = Math.random() * width);
y = (this._y = Math.random() * height);
x_new = Math.random() * width;
y_new = Math.random() * height;
}
onClipEvent (enterFrame) {
if (x_new > this._x) {
sign_x = 1;
this._xscale = 100;
} else {
sign_x = -1;
this._xscale = -100;
}
dx = Math.abs(x_new - this._x);
if ((dx > speed) || (dx < (-speed))) {
this._x = this._x + (sign_x * speed);
} else {
x_new = Math.random() * width;
}
if (y_new > this._y) {
sign_y = 1;
} else {
sign_y = -1;
}
dy = Math.abs(y_new - this._y);
if ((dy > speed) || (dy < (-speed))) {
this._y = this._y + (sign_y * speed);
} else {
y_new = Math.random() * height;
}
}
Instance of Symbol 222 MovieClip in Symbol 228 MovieClip Frame 1
onClipEvent (load) {
width = 450;
height = 180;
speed = Math.round(Math.random() * 2) + 0.2;
x = (this._x = Math.random() * width);
y = (this._y = Math.random() * height);
x_new = Math.random() * width;
y_new = Math.random() * height;
}
onClipEvent (enterFrame) {
if (x_new > this._x) {
sign_x = 1;
this._xscale = 100;
} else {
sign_x = -1;
this._xscale = -100;
}
dx = Math.abs(x_new - this._x);
if ((dx > speed) || (dx < (-speed))) {
this._x = this._x + (sign_x * speed);
} else {
x_new = Math.random() * width;
}
if (y_new > this._y) {
sign_y = 1;
} else {
sign_y = -1;
}
dy = Math.abs(y_new - this._y);
if ((dy > speed) || (dy < (-speed))) {
this._y = this._y + (sign_y * speed);
} else {
y_new = Math.random() * height;
}
}
Instance of Symbol 222 MovieClip in Symbol 228 MovieClip Frame 1
onClipEvent (load) {
width = 450;
height = 180;
speed = Math.round(Math.random() * 2) + 0.2;
x = (this._x = Math.random() * width);
y = (this._y = Math.random() * height);
x_new = Math.random() * width;
y_new = Math.random() * height;
}
onClipEvent (enterFrame) {
if (x_new > this._x) {
sign_x = 1;
this._xscale = 100;
} else {
sign_x = -1;
this._xscale = -100;
}
dx = Math.abs(x_new - this._x);
if ((dx > speed) || (dx < (-speed))) {
this._x = this._x + (sign_x * speed);
} else {
x_new = Math.random() * width;
}
if (y_new > this._y) {
sign_y = 1;
} else {
sign_y = -1;
}
dy = Math.abs(y_new - this._y);
if ((dy > speed) || (dy < (-speed))) {
this._y = this._y + (sign_y * speed);
} else {
y_new = Math.random() * height;
}
}
Instance of Symbol 222 MovieClip in Symbol 228 MovieClip Frame 1
onClipEvent (load) {
width = 450;
height = 180;
speed = Math.round(Math.random() * 2) + 0.2;
x = (this._x = Math.random() * width);
y = (this._y = Math.random() * height);
x_new = Math.random() * width;
y_new = Math.random() * height;
}
onClipEvent (enterFrame) {
if (x_new > this._x) {
sign_x = 1;
this._xscale = 100;
} else {
sign_x = -1;
this._xscale = -100;
}
dx = Math.abs(x_new - this._x);
if ((dx > speed) || (dx < (-speed))) {
this._x = this._x + (sign_x * speed);
} else {
x_new = Math.random() * width;
}
if (y_new > this._y) {
sign_y = 1;
} else {
sign_y = -1;
}
dy = Math.abs(y_new - this._y);
if ((dy > speed) || (dy < (-speed))) {
this._y = this._y + (sign_y * speed);
} else {
y_new = Math.random() * height;
}
}
Instance of Symbol 222 MovieClip in Symbol 228 MovieClip Frame 1
onClipEvent (load) {
width = 450;
height = 180;
speed = Math.round(Math.random() * 2) + 0.2;
x = (this._x = Math.random() * width);
y = (this._y = Math.random() * height);
x_new = Math.random() * width;
y_new = Math.random() * height;
}
onClipEvent (enterFrame) {
if (x_new > this._x) {
sign_x = 1;
this._xscale = 100;
} else {
sign_x = -1;
this._xscale = -100;
}
dx = Math.abs(x_new - this._x);
if ((dx > speed) || (dx < (-speed))) {
this._x = this._x + (sign_x * speed);
} else {
x_new = Math.random() * width;
}
if (y_new > this._y) {
sign_y = 1;
} else {
sign_y = -1;
}
dy = Math.abs(y_new - this._y);
if ((dy > speed) || (dy < (-speed))) {
this._y = this._y + (sign_y * speed);
} else {
y_new = Math.random() * height;
}
}
Instance of Symbol 222 MovieClip in Symbol 228 MovieClip Frame 1
onClipEvent (load) {
width = 450;
height = 180;
speed = Math.round(Math.random() * 2) + 0.2;
x = (this._x = Math.random() * width);
y = (this._y = Math.random() * height);
x_new = Math.random() * width;
y_new = Math.random() * height;
}
onClipEvent (enterFrame) {
if (x_new > this._x) {
sign_x = 1;
this._xscale = 100;
} else {
sign_x = -1;
this._xscale = -100;
}
dx = Math.abs(x_new - this._x);
if ((dx > speed) || (dx < (-speed))) {
this._x = this._x + (sign_x * speed);
} else {
x_new = Math.random() * width;
}
if (y_new > this._y) {
sign_y = 1;
} else {
sign_y = -1;
}
dy = Math.abs(y_new - this._y);
if ((dy > speed) || (dy < (-speed))) {
this._y = this._y + (sign_y * speed);
} else {
y_new = Math.random() * height;
}
}
Instance of Symbol 222 MovieClip in Symbol 228 MovieClip Frame 1
onClipEvent (load) {
width = 450;
height = 180;
speed = Math.round(Math.random() * 2) + 0.2;
x = (this._x = Math.random() * width);
y = (this._y = Math.random() * height);
x_new = Math.random() * width;
y_new = Math.random() * height;
}
onClipEvent (enterFrame) {
if (x_new > this._x) {
sign_x = 1;
this._xscale = 100;
} else {
sign_x = -1;
this._xscale = -100;
}
dx = Math.abs(x_new - this._x);
if ((dx > speed) || (dx < (-speed))) {
this._x = this._x + (sign_x * speed);
} else {
x_new = Math.random() * width;
}
if (y_new > this._y) {
sign_y = 1;
} else {
sign_y = -1;
}
dy = Math.abs(y_new - this._y);
if ((dy > speed) || (dy < (-speed))) {
this._y = this._y + (sign_y * speed);
} else {
y_new = Math.random() * height;
}
}
Instance of Symbol 222 MovieClip in Symbol 228 MovieClip Frame 1
onClipEvent (load) {
width = 450;
height = 180;
speed = Math.round(Math.random() * 2) + 0.2;
x = (this._x = Math.random() * width);
y = (this._y = Math.random() * height);
x_new = Math.random() * width;
y_new = Math.random() * height;
}
onClipEvent (enterFrame) {
if (x_new > this._x) {
sign_x = 1;
this._xscale = 100;
} else {
sign_x = -1;
this._xscale = -100;
}
dx = Math.abs(x_new - this._x);
if ((dx > speed) || (dx < (-speed))) {
this._x = this._x + (sign_x * speed);
} else {
x_new = Math.random() * width;
}
if (y_new > this._y) {
sign_y = 1;
} else {
sign_y = -1;
}
dy = Math.abs(y_new - this._y);
if ((dy > speed) || (dy < (-speed))) {
this._y = this._y + (sign_y * speed);
} else {
y_new = Math.random() * height;
}
}
Symbol 318 MovieClip Frame 27
stop();
Symbol 319 MovieClip Frame 1
stop();
Symbol 319 MovieClip Frame 2
stop();
Symbol 319 MovieClip Frame 3
stop();
Symbol 319 MovieClip Frame 4
stop();
Symbol 368 MovieClip Frame 1
stop();
Symbol 389 MovieClip Frame 1
stop();
Symbol 389 MovieClip Frame 2
stop();
Symbol 389 MovieClip Frame 3
stop();
Symbol 389 MovieClip Frame 4
stop();
Symbol 389 MovieClip Frame 5
stop();
Symbol 389 MovieClip Frame 6
stop();
Symbol 389 MovieClip Frame 7
stop();
Symbol 389 MovieClip Frame 8
stop();
Symbol 417 MovieClip Frame 1
_root.portalsnd.start(0, 0);
Symbol 417 MovieClip Frame 36
stop();
stopAllSounds();
_root.fadeout();
Symbol 418 MovieClip Frame 1
stop();
Symbol 418 MovieClip Frame 2
stop();
Symbol 454 MovieClip Frame 1
stop();
Symbol 454 MovieClip Frame 107
stop();
gotoAndStop (1);
Symbol 469 MovieClip Frame 121
stop();
Symbol 498 MovieClip Frame 1
stop();
Symbol 498 MovieClip Frame 2
stop();
Symbol 498 MovieClip Frame 3
stop();
Symbol 498 MovieClip Frame 4
stop();
Symbol 498 MovieClip Frame 5
stop();
Symbol 498 MovieClip Frame 6
stop();
Symbol 525 MovieClip Frame 10
stop();
Symbol 526 MovieClip Frame 1
stop();
Symbol 533 MovieClip Frame 1
stop();
Symbol 534 MovieClip Frame 1
function camControl() {
parentColor.setTransform(camColor.getTransform());
var _local3 = sX / this._width;
var _local4 = sY / this._height;
_parent._x = cX - (this._x * _local3);
_parent._y = cY - (this._y * _local4);
_parent._xscale = 100 * _local3;
_parent._yscale = 100 * _local4;
}
stop();
this._visible = true;
var oldMode = Stage.scaleMode;
Stage.scaleMode = "exactFit";
var cX = (Stage.width / 2);
var cY = (Stage.height / 2);
var sX = Stage.width;
var sY = Stage.height;
Stage.scaleMode = oldMode;
camControl();
Symbol 537 MovieClip Frame 61
stop();
Symbol 562 MovieClip Frame 1
_root.portalsnd.start(0, 0);
Symbol 562 MovieClip Frame 36
stop();
Symbol 571 MovieClip Frame 121
stop();
Symbol 582 MovieClip Frame 122
_root.nextFrame();
Symbol 583 MovieClip Frame 1
function camControl() {
parentColor.setTransform(camColor.getTransform());
var _local3 = sX / this._width;
var _local4 = sY / this._height;
_parent._x = cX - (this._x * _local3);
_parent._y = cY - (this._y * _local4);
_parent._xscale = 100 * _local3;
_parent._yscale = 100 * _local4;
}
stop();
this._visible = true;
var oldMode = Stage.scaleMode;
Stage.scaleMode = "exactFit";
var cX = (Stage.width / 2);
var cY = (Stage.height / 2);
var sX = Stage.width;
var sY = Stage.height;
Stage.scaleMode = oldMode;
camControl();
Symbol 595 MovieClip Frame 1
stop();
Symbol 595 MovieClip Frame 2
stop();
Symbol 601 MovieClip Frame 121
stop();
Symbol 610 MovieClip Frame 122
_root.nextFrame();
Symbol 622 MovieClip Frame 1
stop();
Symbol 622 MovieClip Frame 2
stop();
Symbol 628 MovieClip Frame 121
stop();
Symbol 637 MovieClip Frame 122
_root.nextFrame();
Symbol 651 MovieClip Frame 121
stop();
Symbol 660 MovieClip Frame 122
_root.nextFrame();
Symbol 677 MovieClip Frame 121
stop();
Symbol 686 MovieClip Frame 122
_root.nextFrame();
Symbol 697 MovieClip Frame 121
stop();
Symbol 706 MovieClip Frame 122
_root.nextFrame();
Symbol 712 MovieClip Frame 1
stop();
Symbol 712 MovieClip Frame 2
stop();
Symbol 718 MovieClip Frame 121
stop();
Symbol 727 MovieClip Frame 122
_root.nextFrame();
Symbol 738 MovieClip Frame 121
stop();
Symbol 747 MovieClip Frame 122
_root.nextFrame();
Symbol 768 MovieClip Frame 27
stop();
stopAllSounds();
Symbol 769 MovieClip Frame 1
stop();
Symbol 769 MovieClip Frame 2
stop();
Symbol 769 MovieClip Frame 3
stop();
Symbol 769 MovieClip Frame 4
stop();
Symbol 775 MovieClip Frame 121
stop();
Symbol 784 MovieClip Frame 1
stop();
Symbol 787 Button
on (release) {
_root.gotoAndStop("main_menu");
}
Symbol 788 MovieClip Frame 1
var deze_website;
if (_url.substr(0, 4) == "http") {
deze_website = _url;
} else {
deze_website = "local";
}
var content_knop = "highscores";
var spel_naam = "the_kid_spectre";
var link = "http://www.funnygames.nu/redirect.html?gameid=13913&page=highscores";
if (!_root.tibaco) {
link = link.concat(((((("&utm_source=" + deze_website) + "&utm_medium=flashgame&utm_term=") + spel_naam) + "&utm_content=") + content_knop) + "&utm_campaign=sponsored_games");
}
hsc2.onRelease = function () {
getURL (link, "_blank");
};
Symbol 789 MovieClip Frame 1
var deze_website;
if (_url.substr(0, 4) == "http") {
deze_website = _url;
} else {
deze_website = "local";
}
var content_knop = "more_games";
var spel_naam = "the_kid_spectre";
var link = "http://www.funnygames.nu";
if (!_root.tibaco) {
link = link.concat(((((("/?utm_source=" + deze_website) + "&utm_medium=flashgame&utm_term=") + spel_naam) + "&utm_content=") + content_knop) + "&utm_campaign=sponsored_games");
}
pmg2.onRelease = function () {
getURL (link, "_blank");
};
Symbol 793 MovieClip Frame 1
var deze_website;
if (_url.substr(0, 4) == "http") {
deze_website = _url;
} else {
deze_website = "local";
}
var content_knop = "logo";
var spel_naam = "the_kid_spectre";
var link = "http://www.funnygames.nu";
if (!_root.tibaco) {
link = link.concat(((((("/?utm_source=" + deze_website) + "&utm_medium=flashgame&utm_term=") + spel_naam) + "&utm_content=") + content_knop) + "&utm_campaign=sponsored_games");
}
funny.onRelease = function () {
getURL (link, "_blank");
};
Symbol 794 MovieClip Frame 1
stop();
Symbol 795 MovieClip Frame 1
var deze_website;
if (_url.substr(0, 4) == "http") {
deze_website = _url;
} else {
deze_website = "local";
}
var content_knop = "highscores";
var spel_naam = "the_kid_spectre";
var link = "http://www.funnygames.nu/redirect.html?gameid=13913&page=highscores";
if (!_root.tibaco) {
link = link.concat(((((("&utm_source=" + deze_website) + "&utm_medium=flashgame&utm_term=") + spel_naam) + "&utm_content=") + content_knop) + "&utm_campaign=sponsored_games");
}
hsc2.onRelease = function () {
getURL (link, "_blank");
};
Symbol 796 MovieClip Frame 1
var deze_website;
if (_url.substr(0, 4) == "http") {
deze_website = _url;
} else {
deze_website = "local";
}
var content_knop = "more_games";
var spel_naam = "the_kid_spectre";
var link = "http://www.funnygames.nu";
if (!_root.tibaco) {
link = link.concat(((((("/?utm_source=" + deze_website) + "&utm_medium=flashgame&utm_term=") + spel_naam) + "&utm_content=") + content_knop) + "&utm_campaign=sponsored_games");
}
pmg2.onRelease = function () {
getURL (link, "_blank");
};
Symbol 801 MovieClip Frame 1
stop();
Symbol 803 MovieClip Frame 1
var deze_website;
if (_url.substr(0, 4) == "http") {
deze_website = _url;
} else {
deze_website = "local";
}
var content_knop = "logo";
var spel_naam = "the_kid_spectre";
var link = "http://www.funnygames.nu";
if (!_root.tibaco) {
link = link.concat(((((("/?utm_source=" + deze_website) + "&utm_medium=flashgame&utm_term=") + spel_naam) + "&utm_content=") + content_knop) + "&utm_campaign=sponsored_games");
}
funny.onRelease = function () {
getURL (link, "_blank");
};