Frame 1
fscommand ("showmenu", "false");
_quality = "LOW";
Instance of Symbol 10 MovieClip "bar" in Frame 2
onClipEvent (enterFrame) {
this._width = 176 * (1 - (_root.getBytesLoaded() / _root.getBytesTotal()));
}
Frame 3
if (getBytesLoaded() != getBytesTotal()) {
gotoAndPlay (2);
}
Frame 4
function collision(x, y, w, h, b) {
j = 1;
while (eval ("opaque" + j) != null) {
s = eval ("opaque" + j);
if ((x <= (s._x + s._width)) && ((x + w) >= s._x)) {
if ((y <= (s._y + s._height)) && ((y + h) >= (s._y + yoffset))) {
c = 0;
if (b == -1) {
return(true);
}
if (b == 0) {
c = (s._y - h) + yoffset;
} else if (b == 1) {
c = s._y + s._height;
} else if (b == 2) {
c = s._x + s._width;
} else if (b == 3) {
c = s._x;
}
return(c);
}
}
j++;
}
if (b == -1) {
return(false);
}
return(0);
}
function dmgcollision(x, y, w, h, s1) {
if ((x <= (s1._x + s1._width)) && ((x + w) >= s1._x)) {
if ((y <= (s1._y + s1._height)) && ((y + h) >= s1._y)) {
return(true);
}
}
return(false);
}
function setShadow(a, b) {
eval (("p" + a) + "b")._visible = b;
eval (("p" + a) + "c")._visible = b;
}
function setState(a, b) {
if (a == 0) {
p0state = b;
} else if (a == 1) {
p1state = b;
}
}
function setJump(a, b) {
if (a == 0) {
p0jump = b;
} else if (a == 1) {
p1jump = b;
}
}
function setDmg(a, b, x, y) {
if (a == 0) {
p0dmg = b;
p0dmgx = x;
p0dmgy = y;
} else if (a == 1) {
p1dmg = b;
p1dmgx = x;
p1dmgy = y;
}
}
function reposDmg(a, x, y) {
if (a == 0) {
eval ("damage" + p0dmg)._x = x + p0dmgx;
eval ("damage" + p0dmg)._y = y + p0dmgy;
} else if (a == 1) {
eval ("damage" + p1dmg)._x = x + p1dmgx;
eval ("damage" + p1dmg)._y = y + p1dmgy;
}
}
function InVertRange(n) {
return(Math.abs(p0a._y - p1a._y) < n);
}
function InHoriRange(n) {
return(Math.abs(p0a._x - p1a._x) < n);
}
nightmare = false;
diff = 0.1;
diffs = "easy";
hyper = false;
soundon = true;
p0ai = false;
p1ai = false;
p0c.gotoAndStop("idle");
p1c.gotoAndStop("idle");
IDLE = 0;
RUN_L = 1;
RUN_R = 2;
SWORD_L = 3;
SWORD_R = 4;
BLOCK = 5;
WALL_L = 6;
WALL_R = 7;
SEISMIC_L = 8;
SEISMIC_R = 9;
BALL_L = 10;
BALL_R = 11;
DAMAGE = 12;
DEATH = 13;
p0dmgpwr = 0;
p1dmgpwr = 0;
ballpwr = 40;
hpmax = 460;
p0hp = hpmax;
p1hp = hpmax;
p0state = IDLE;
p0jump = 0;
p1state = IDLE;
p1jump = 0;
p0KEY_JUMP = 38;
p0KEY_BLOCK = 40;
p0KEY_LEFT = 37;
p0KEY_RIGHT = 39;
p0KEY_SWORD = 97;
p0KEY_SEISMIC = 98;
p0KEY_BALL = 99;
p1KEY_JUMP = 87;
p1KEY_BLOCK = 83;
p1KEY_LEFT = 65;
p1KEY_RIGHT = 68;
p1KEY_SWORD = 70;
p1KEY_SEISMIC = 71;
p1KEY_BALL = 72;
runspd = 8;
jumpheight = 15;
jumpspd = 30;
initjump = 0;
yoffset = 10;
defheight = 35;
defwidth = 25;
wallheight = 15;
ballheight = 35;
ballwidth = 50;
setShadow(0, false);
setShadow(1, false);
p0hpbar._width = 0;
p1hpbar._width = 0;
p0hpbar2._width = 0;
p1hpbar2._width = 0;
p1a._xscale = p1a._xscale * -1;
BALLDONE_FRAME = 23;
BALLEXP_FRAME = 6;
WALLDONE_FRAME = 120;
SEISMIC1_FRAME = 151;
SEISMIC2_FRAME = 173;
treespd = 4;
tree1d = 1;
tree2d = -1;
tree3d = 1;
tree4d = -1;
p0invinc = 0;
p1invinc = 0;
invinclen = 50;
swdcost = 1;
seismiccost = 1;
ballcost = 1;
dmgc = 0;
dmgcmax = 6;
p0dmg = -1;
p1dmg = -1;
lastTime = getTimer();
onelastTime = lastTime;
p0oldframe = 1;
p1oldframe = 1;
balldiaspd = 14;
ballhorspd = 20;
p0BALL_Z = 100;
p1BALL_Z = 101;
p0BALLDMG_Z = 102;
p1BALLDMG_Z = 103;
p0d._visible = false;
p1d._visible = false;
fscommand ("fullscreen", "false");
fscommand ("allowscale", "false");
fscommand ("showmenu", "false");
fscommand ("trapallkeys", "true");
stop();
Frame 5
gotoAndPlay (7);
Frame 6
gotoAndPlay (5);
Frame 7
delay = getTimer() - lastTime;
fps = Math.round(1000 / delay);
fps = fps + (("/30 fps (" + Math.max(0, delay - 33)) + ")");
lastTime = getTimer();
if ((((p0c._currentframe >= 285) || (p1c._currentframe >= 285)) && (p1jump == 0)) && (p0jump == 0)) {
gotoAndPlay (9);
}
if ((p0ai && (nightmare)) && ((p0a._currentframe % 5) == 0)) {
if ((++p0hp) > (hpmax * 2)) {
p0hp = hpmax * 2;
}
}
if ((p1ai && (nightmare)) && ((p1a._currentframe % 5) == 0)) {
if ((++p1hp) > (hpmax * 2)) {
p1hp = hpmax * 2;
}
}
p0oldx = p0a._x;
p0oldy = p0a._y;
p1oldx = p1a._x;
p1oldy = p1a._y;
i = 0;
pdmg = eval ("damage" + p0dmg);
while (i < 2) {
if (i == 1) {
pdmg = p0balldmg;
}
if ((((pdmg != null) && (p1state != DAMAGE)) && (p1state != DEATH)) && (((p0ai && (nightmare)) || (p1invinc == 0)) || (p1state == BLOCK))) {
x = p1a._x;
if (p1a._xscale < 0) {
x = x - defwidth;
}
if (dmgcollision(x, p1a._y, defwidth, defheight, pdmg)) {
if (p1state != BLOCK) {
p1a._y = p1a._y - 20;
p1jump = p1jump * -1;
p1invinc = invinclen;
p1state = DAMAGE;
p1a.gotoAndPlay("damage");
if ((i == 1) && (p0ball._currentframe < BALLEXP_FRAME)) {
p0ball.gotoAndPlay("explode");
}
if (i == 0) {
p1hp = p1hp - p0dmgpwr;
} else {
p1hp = p1hp - ballpwr;
}
} else {
if ((p1invinc == 0) && (i == 0)) {
p1hp = p1hp - Math.floor(p0dmgpwr / 4);
} else if ((p1invinc == 0) && (i == 1)) {
p1hp = p1hp - Math.floor(ballpwr / 4);
}
if (p1invinc != 10) {
p1invinc = 11;
}
if (p0state != BLOCK) {
pdmg._x = 800;
pdmg._y = 800;
p0dmg = -1;
pdmg.removeMovieClip();
}
if ((i == 1) && (p0ball._currentframe < BALLEXP_FRAME)) {
p0ball.gotoAndPlay("explode");
}
}
if (p1hp <= 0) {
p1hp = 0;
p1KEY_JUMP = 0;
p1KEY_BLOCK = 0;
p1KEY_LEFT = 0;
p1KEY_RIGHT = 0;
p1KEY_SWORD = 0;
p1KEY_SEISMIC = 0;
p1KEY_BALL = 0;
p0KEY_JUMP = 0;
p0KEY_BLOCK = 0;
p0KEY_LEFT = 0;
p0KEY_RIGHT = 0;
p0KEY_SWORD = 0;
p0KEY_SEISMIC = 0;
p0KEY_BALL = 0;
p1state = DEATH;
p1jump = p1jump * -1;
p1invinc = invinclen;
p1a.gotoAndPlay("death");
p1d._visible = false;
p0a.gotoAndPlay("idle");
p0state = IDLE;
p1ai = false;
p0ai = false;
}
}
}
i++;
}
i = 0;
pdmg = eval ("damage" + p1dmg);
while (i < 2) {
if (i == 1) {
pdmg = p1balldmg;
}
if ((((pdmg != null) && (p0state != DAMAGE)) && (p0state != DEATH)) && (((p1ai && (nightmare)) || (p0invinc == 0)) || (p0state == BLOCK))) {
x = p0a._x;
if (p0a._xscale < 0) {
x = x - defwidth;
}
if (dmgcollision(x, p0a._y, defwidth, defheight, pdmg)) {
if (p0state != BLOCK) {
p0a._y = p0a._y - 20;
p0jump = p0jump * -1;
p0invinc = invinclen;
p0state = DAMAGE;
p0a.gotoAndPlay("damage");
if ((i == 1) && (p1ball._currentframe < BALLEXP_FRAME)) {
p1ball.gotoAndPlay("explode");
}
if (i == 0) {
p0hp = p0hp - p1dmgpwr;
} else {
p0hp = p0hp - ballpwr;
}
} else {
if ((p0invinc == 0) && (i == 0)) {
p0hp = p0hp - Math.floor(p1dmgpwr / 4);
} else if ((p0invinc == 0) && (i == 1)) {
p0hp = p0hp - Math.floor(ballpwr / 4);
}
if (p0invinc != 10) {
p0invinc = 11;
}
if (p1state != BLOCK) {
pdmg._x = 800;
pdmg._y = 800;
p1dmg = -1;
pdmg.removeMovieClip();
}
if ((i == 1) && (p1ball._currentframe < BALLEXP_FRAME)) {
p1ball.gotoAndPlay("explode");
}
}
if (p0hp <= 0) {
p0hp = 0;
p0a.gotoAndPlay("death");
p0d._visible = false;
if (p1hp > 0) {
p1a.gotoAndPlay("idle");
p1state = IDLE;
}
p0state = DEATH;
p1ai = false;
p0ai = false;
p0jump = p0jump * -1;
p0invinc = invinclen;
p1KEY_JUMP = 0;
p1KEY_BLOCK = 0;
p1KEY_LEFT = 0;
p1KEY_RIGHT = 0;
p1KEY_SWORD = 0;
p1KEY_SEISMIC = 0;
p1KEY_BALL = 0;
p0KEY_JUMP = 0;
p0KEY_BLOCK = 0;
p0KEY_LEFT = 0;
p0KEY_RIGHT = 0;
p0KEY_SWORD = 0;
p0KEY_SEISMIC = 0;
p0KEY_BALL = 0;
}
}
}
i++;
}
if (((p0state == DAMAGE) || (p0state == DEATH)) && (p0a._currentframe != 1)) {
if (p1ai && (nightmare)) {
if (p0a._xscale > 0) {
p0a._x = p0a._x + (Math.floor(p0invinc / 8) + 1);
} else {
p0a._x = p0a._x - (Math.floor(p0invinc / 8) + 1);
}
} else if (p0a._xscale > 0) {
p0a._x = p0a._x + (Math.floor(p0invinc / 4) + 1);
} else {
p0a._x = p0a._x - (Math.floor(p0invinc / 4) + 1);
}
}
if (((p1state == DAMAGE) || (p1state == DAMAGE)) && (p1a._currentframe != 1)) {
if (p0ai && (nightmare)) {
if (p1a._xscale > 0) {
p1a._x = p1a._x + (Math.floor(p1invinc / 8) + 1);
} else {
p1a._x = p1a._x - (Math.floor(p1invinc / 8) + 1);
}
} else if (p1a._xscale > 0) {
p1a._x = p1a._x + (Math.floor(p1invinc / 4) + 1);
} else {
p1a._x = p1a._x - (Math.floor(p1invinc / 4) + 1);
}
}
if ((((((((p0state != SWORD_L) && (p0state != SWORD_R)) && (p0state != SEISMIC_L)) && (p0state != SEISMIC_R)) && (p0state != BALL_L)) && (p0state != BALL_R)) && (p0state != BLOCK)) && (eval ("damage" + p0dmg) != null)) {
eval ("damage" + p0dmg)._x = 800;
eval ("damage" + p0dmg)._y = 800;
p0dmg = -1;
eval ("damage" + p0dmg).removeMovieClip();
}
if ((((((((p1state != SWORD_L) && (p1state != SWORD_R)) && (p1state != SEISMIC_L)) && (p1state != SEISMIC_R)) && (p1state != BALL_L)) && (p1state != BALL_R)) && (p1state != BLOCK)) && (eval ("damage" + p1dmg) != null)) {
eval ("damage" + p1dmg)._x = 800;
eval ("damage" + p1dmg)._y = 800;
p1dmg = -1;
eval ("damage" + p1dmg).removeMovieClip();
}
pp = 0;
while (pp <= 1) {
p = "p" + pp;
pa = eval (p + "a");
pai = eval (p + "ai");
po = "p" + ((pp + 1) % 2);
poa = eval (po + "a");
runspdbk = runspd;
jumpheightbk = jumpheight;
jumpspdbk = jumpspd;
if ((pai && (nightmare)) || (hyper)) {
runspd = runspd + 5;
jumpheight = jumpheight + 10;
jumpspd = jumpspd + 3;
setShadow(pp, true);
}
eval (p + "c")._x = eval (p + "b")._x;
eval (p + "c")._y = eval (p + "b")._y;
eval (p + "c")._xscale = eval (p + "b")._xscale;
eval (p + "c").gotoAndStop(eval (p + "oldframe2"));
eval (p + "b")._x = eval (p + "oldx");
eval (p + "b")._y = eval (p + "oldy");
eval (p + "b")._xscale = pa._xscale;
eval (p + "b").gotoAndStop(eval (p + "oldframe"));
if (eval (p + "invinc") > 0) {
if (pp == 0) {
p0invinc--;
} else if (pp == 1) {
p1invinc--;
}
if ((eval (p + "invinc") % 2) == 0) {
eval (p + "d")._visible = false;
} else {
eval (p + "d")._visible = eval (p + "hp") > 0;
}
}
if (pa._currentframe == SEISMIC1_FRAME) {
if (dmgc == eval (po + "dmg")) {
dmgc = (dmgc + 1) % dmgcmax;
}
dmgop.duplicateMovieClip("damage" + dmgc, dmgc);
eval ("damage" + dmgc)._visible = false;
eval ("damage" + dmgc)._width = 100;
eval ("damage" + dmgc)._height = 320;
if (pa._xscale > 0) {
setDmg(pp, dmgc, -50, -300);
} else {
setDmg(pp, dmgc, -54 - defwidth, -300);
}
reposDmg(pp, pa._x, pa._y);
dmgc = (dmgc + 1) % dmgcmax;
} else if (pa._currentframe == SEISMIC2_FRAME) {
eval ("damage" + eval (p + "dmg")).removeMovieClip();
}
if (eval (p + "ball")._currentframe == BALLDONE_FRAME) {
eval (p + "ball").removeMovieClip();
eval (p + "balldmg").removeMovieClip();
}
if (((eval (p + "state") == WALL_L) || (eval (p + "state") == WALL_R)) && (pa._currentframe == WALLDONE_FRAME)) {
if (eval (p + "state") == WALL_L) {
pa._x = pa._x + (runspd * 3);
} else if (eval (p + "state") == WALL_R) {
pa._x = pa._x - (runspd * 3);
}
setState(pp, IDLE);
pa.gotoAndPlay("jump");
if (pp == 0) {
p0jump = jumpheight;
} else if (pp == 1) {
p1jump = jumpheight;
}
pa._y = pa._y - (initjump + jumpheight);
if (pp == 0) {
p0wallTrig = 0;
} else if (pp == 1) {
p1wallTrig = 0;
}
}
if ((eval (p + "state") == BLOCK) && ((!Key.isDown(eval (p + "KEY_BLOCK"))) && ((!pai) || (pai && ((((Math.random() < 0.05) || (poa._x <= (pa._x - (5 * defwidth)))) || (poa._x >= (pa._x + (5 * defwidth)))) || (eval (po + "state") == BLOCK)))))) {
pa.gotoAndPlay("idle");
setState(pp, IDLE);
eval ("damage" + eval (p + "dmg")).removeMovieClip();
if (pp == 0) {
p0downTrig = 0;
} else if (pp == 1) {
p1downTrig = 0;
}
}
if ((eval (p + "state") == DAMAGE) && (pa._currentframe == 1)) {
setState(pp, IDLE);
if (pp == 0) {
p0wallTrig = 0;
} else if (pp == 1) {
p1wallTrig = 0;
}
setShadow(pp, false);
}
if (((eval (p + "state") != BLOCK) && (eval (p + "state") != WALL_L)) && (eval (p + "state") != WALL_R)) {
if ((((eval (p + "state") == SWORD_L) || (eval (p + "state") == SWORD_R)) && ((pa._currentframe == 1) || (!Key.isDown(eval (p + "KEY_SWORD"))))) && (((!pai) || ((pai && (nightmare)) && (Math.random() < 0.1))) || (pai && ((pa._currentframe == 1) || ((((poa._x > (pa._x + defwidth)) && (eval (p + "state") == SWORD_L)) || ((poa._x < (pa._x - defwidth)) && (eval (p + "state") == SWORD_R))) && (InVertRange(defheight))))))) {
pa.gotoAndPlay(1);
setState(pp, IDLE);
eval ("damage" + eval (p + "dmg"))._x = 800;
eval ("damage" + eval (p + "dmg"))._y = 800;
if (pp == 0) {
p0dmg = -1;
} else if (pp == 1) {
p1dmg = -1;
}
eval ("damage" + eval (p + "dmg")).removeMovieClip();
setShadow(pp, false);
}
if (((eval (p + "state") == SEISMIC_L) || (eval (p + "state") == SEISMIC_R)) && (pa._currentframe == 1)) {
setState(pp, IDLE);
setShadow(pp, false);
}
if (((eval (p + "state") == BALL_L) || (eval (p + "state") == BALL_R)) && (pa._currentframe == 1)) {
if (pp == 0) {
ball.duplicateMovieClip(p + "ball", p0BALL_Z);
} else if (pp == 1) {
ball.duplicateMovieClip(p + "ball", p1BALL_Z);
}
if (eval (p + "state") == BALL_L) {
eval (p + "ball")._x = pa._x - 50;
if (eval (p + "ballair")) {
if (pp == 0) {
p0ballx = -balldiaspd;
} else if (pp == 1) {
p1ballx = -balldiaspd;
}
setJump(pp, 10);
} else if (pp == 0) {
p0ballx = -ballhorspd;
} else if (pp == 1) {
p1ballx = -ballhorspd;
}
} else if (eval (p + "state") == BALL_R) {
if (eval (p + "ballair")) {
if (pp == 0) {
p0ballx = balldiaspd;
} else if (pp == 1) {
p1ballx = balldiaspd;
}
} else if (pp == 0) {
p0ballx = ballhorspd;
} else if (pp == 1) {
p1ballx = ballhorspd;
}
eval (p + "ball")._x = pa._x + 2;
}
if (eval (p + "ballair")) {
if (pp == 0) {
p0bally = balldiaspd;
} else if (pp == 1) {
p1bally = balldiaspd;
}
eval (p + "ball")._y = pa._y + 15;
} else {
if (pp == 0) {
p0bally = 0;
} else if (pp == 1) {
p1bally = 0;
}
eval (p + "ball")._y = pa._y - 12;
}
if (pp == 0) {
dmgop.duplicateMovieClip("p0balldmg", p0BALLDMG_Z);
} else if (pp == 1) {
dmgop.duplicateMovieClip("p1balldmg", p1BALLDMG_Z);
}
eval (p + "balldmg")._visible = false;
eval (p + "balldmg")._width = 50;
eval (p + "balldmg")._height = 50;
eval (p + "balldmg")._x = eval (p + "ball")._x;
eval (p + "balldmg")._y = eval (p + "ball")._y;
setState(pp, IDLE);
setShadow(pp, false);
}
if (eval (p + "swdTrig") > 1) {
if (pp == 0) {
p0swdTrig--;
} else if (pp == 1) {
p1swdTrig--;
}
}
if ((eval (p + "swdTrig") == 1) && (!Key.isDown(eval (p + "KEY_SWORD")))) {
if (pp == 0) {
p0swdTrig = 0;
} else if (pp == 1) {
p1swdTrig = 0;
}
}
if (((eval (p + "swdTrig") != 1) && ((((((((eval (p + "state") != SWORD_L) && (eval (p + "state") != SWORD_R)) && (eval (p + "state") != SEISMIC_L)) && (eval (p + "state") != SEISMIC_R)) && (eval (p + "state") != BALL_L)) && (eval (p + "state") != BALL_R)) && (eval (p + "state") != DAMAGE)) && (eval (p + "state") != DEATH))) && ((Key.isDown(eval (p + "KEY_SWORD")) || ((pai && (nightmare)) && (Math.random() < 0.3))) || (((((pai && (!nightmare)) && ((Math.random() < (0.3 * diff)) || ((Math.random() < (0.4 * diff)) && (InVertRange(defheight))))) && (((poa._x > pa._x) && (pa._xscale < 0)) || ((poa._x < pa._x) && (pa._xscale > 0)))) && (InHoriRange(4 * defwidth))) && (InVertRange(4 * defheight) || (Math.random() < (0.3 * diff)))))) {
if (pa._xscale > 0) {
if (dmgc == eval (po + "dmg")) {
dmgc = (dmgc + 1) % dmgcmax;
}
setState(pp, SWORD_L);
dmgop.duplicateMovieClip("damage" + dmgc, dmgc);
eval ("damage" + dmgc)._visible = false;
eval ("damage" + dmgc)._width = 80;
eval ("damage" + dmgc)._height = 30;
setDmg(pp, dmgc, -70, 0);
reposDmg(pp, pa._x, pa._y);
dmgc = (dmgc + 1) % dmgcmax;
if (pp == 0) {
p0dmgpwr = 40;
} else if (pp == 1) {
p1dmgpwr = 40;
}
} else {
if (dmgc == eval (po + "dmg")) {
dmgc = (dmgc + 1) % dmgcmax;
}
setState(pp, SWORD_R);
dmgop.duplicateMovieClip("damage" + dmgc, dmgc);
eval ("damage" + dmgc)._visible = false;
eval ("damage" + dmgc)._width = 80;
eval ("damage" + dmgc)._height = 30;
setDmg(pp, dmgc, -10, 0);
reposDmg(pp, pa._x, pa._y);
dmgc = (dmgc + 1) % dmgcmax;
if (pp == 0) {
p0dmgpwr = 40;
} else if (pp == 1) {
p1dmgpwr = 40;
}
}
if (eval (p + "jump") == 0) {
pa.gotoAndPlay("sword");
} else {
pa.gotoAndPlay("swordair");
}
setShadow(pp, true);
if (pp == 0) {
p0swdTrig = 1;
} else if (pp == 1) {
p1swdTrig = 1;
}
}
if ((eval (p + "seismicTrig") == 1) && (!Key.isDown(eval (p + "KEY_SEISMIC")))) {
if (pp == 0) {
p0seismicTrig = 0;
} else if (pp == 1) {
p1seismicTrig = 0;
}
}
if (((eval (p + "seismicTrig") != 1) && ((((((((eval (p + "state") != SEISMIC_L) && (eval (p + "state") != SEISMIC_R)) && (eval (p + "state") != BALL_L)) && (eval (p + "state") != BALL_R)) && (eval (p + "state") != SWORD_L)) && (eval (p + "state") != SWORD_R)) && (eval (p + "state") != DAMAGE)) && (eval (p + "state") != DEATH))) && (Key.isDown(eval (p + "KEY_SEISMIC")) || (((((pai && (!nightmare)) && (Math.random() < 0.03)) && (poa._x > (pa._x - (2 * defwidth)))) && (poa._x <= (pa._x + (2 * defwidth)))) && (poa._y <= (pa._y - 5))))) {
if (pa._xscale > 0) {
setState(pp, SEISMIC_L);
} else {
setState(pp, SEISMIC_R);
}
if (eval (p + "jump") == 0) {
pa.gotoAndPlay("seismic");
} else {
pa.gotoAndPlay("seismic");
}
setShadow(pp, true);
if (pp == 0) {
p0seismicTrig = 1;
p0dmgpwr = 80;
} else if (pp == 1) {
p1seismicTrig = 1;
p1dmgpwr = 80;
}
}
if ((eval (p + "ballTrig") == 1) && (!Key.isDown(eval (p + "KEY_BALL")))) {
if (pp == 0) {
p0ballTrig = 0;
} else if (pp == 1) {
p1ballTrig = 0;
}
}
if ((((eval (p + "ballTrig") != 1) && ((((((((eval (p + "state") != SEISMIC_L) && (eval (p + "state") != SEISMIC_R)) && (eval (p + "state") != BALL_L)) && (eval (p + "state") != BALL_R)) && (eval (p + "state") != SWORD_L)) && (eval (p + "state") != SWORD_R)) && (eval (p + "state") != DAMAGE)) && (eval (p + "state") != DEATH))) && (eval (p + "ball") == null)) && (Key.isDown(eval (p + "KEY_BALL")) || ((((((pai && (!nightmare)) && (pa._y <= poa._y)) && (InHoriRange(16 * defwidth))) && (!InHoriRange(8 * defwidth))) && (((poa._x > pa._x) && (pa._xscale < 0)) || ((poa._x < pa._x) && (pa._xscale > 0)))) && (Math.random() < 0.07)))) {
if (pa._xscale > 0) {
setState(pp, BALL_L);
} else {
setState(pp, BALL_R);
}
if (eval (p + "jump") == 0) {
pa.gotoAndPlay("ball");
if (pp == 0) {
p0ballair = false;
} else if (pp == 1) {
p1ballair = false;
}
} else {
pa.gotoAndPlay("ballair");
if (pp == 0) {
p0ballair = true;
} else if (pp == 1) {
p1ballair = true;
}
}
setShadow(pp, true);
if (pp == 0) {
p0ballTrig = 1;
} else if (pp == 1) {
p1ballTrig = 1;
}
}
if ((((((((((eval (p + "state") == SEISMIC_L) || (eval (p + "state") == SEISMIC_R)) || (eval (p + "state") == BALL_L)) || (eval (p + "state") == BALL_R)) || (eval (p + "state") == SWORD_L)) || (eval (p + "state") == SWORD_R)) || (eval (p + "state") == WALL_L)) || (eval (p + "state") == WALL_R)) || (eval (p + "state") == DAMAGE)) || (eval (p + "state") == DEATH)) {
} else if ((eval (p + "uptrig") == 1) && (((!Key.isDown(eval (p + "KEY_JUMP"))) && (!pai)) || (pai && (eval (p + "jump") <= 0)))) {
if (pp == 0) {
p0upTrig = 0;
} else if (pp == 1) {
p1upTrig = 0;
}
} else if (((eval (p + "upTrig") != 1) && ((Key.isDown(eval (p + "KEY_JUMP")) || ((pai && (nightmare)) && (eval (po + "state") == SEISMIC))) || ((pai && (Math.random() < 0.15)) && ((pa._y < poa._y) || (Math.random() < 0.05))))) && (eval (p + "jump") == 0)) {
if (pp == 0) {
p0upTrig = 1;
} else if (pp == 1) {
p1upTrig = 1;
}
pa.gotoAndPlay("jump");
setJump(pp, jumpheight);
pa._y = pa._y - initjump;
} else if ((eval (p + "downTrig") != 1) && ((Key.isDown(eval (p + "KEY_BLOCK")) || ((pai && (Math.random() < (0.3 * diff))) && (((((pa._x + defwidth) >= (eval (po + "ball")._x + eval (po + "ballx"))) && (pa._x <= ((eval (po + "ball")._x + eval (po + "ballx")) + 50))) && ((pa._y + defheight) >= (eval (po + "ball")._y + eval (po + "bally")))) && (pa._y <= ((eval (po + "ball")._y + eval (po + "bally")) + 50))))) || ((((pai && (!nightmare)) && (eval (po + "state") != BLOCK)) && (pa._y <= (poa._y + (2 * defheight)))) && ((((eval (po + "state") == SEISMIC_L) || (eval (po + "state") == SEISMIC_R)) && (InHoriRange(2 * defwidth))) && (((InHoriRange(5 * defwidth) && (Math.random() < 0.1)) || (InHoriRange(3 * defwidth) && (Math.random() < 0.1))) || (InHoriRange(2 * defwidth) && (Math.random() < 0.1))))))) {
if (pp == 0) {
p0downTrig = 1;
p0dmgpwr = 0;
} else if (pp == 1) {
p1downTrig = 1;
p1dmgpwr = 0;
}
if (dmgc == eval (po + "dmg")) {
dmgc = (dmgc + 1) % dmgcmax;
}
setState(pp, BLOCK);
pa.gotoAndPlay("block");
dmgop.duplicateMovieClip("damage" + dmgc, dmgc);
eval ("damage" + dmgc)._visible = false;
eval ("damage" + dmgc)._width = 67;
eval ("damage" + dmgc)._height = 45;
if (pa._xscale > 0) {
setDmg(pp, dmgc, -18, -10);
} else {
setDmg(pp, dmgc, -24 - defwidth, -10);
}
reposDmg(pp, pa._x, pa._y);
dmgc = (dmgc + 1) % dmgcmax;
}
if (((((((((((eval (p + "state") == BLOCK) || (eval (p + "state") == SEISMIC_L)) || (eval (p + "state") == SEISMIC_R)) || (eval (p + "state") == BALL_L)) || (eval (p + "state") == BALL_R)) || (eval (p + "state") == SWORD_L)) || (eval (p + "state") == SWORD_R)) || (eval (p + "state") == WALL_L)) || (eval (p + "state") == WALL_R)) || (eval (p + "state") == DAMAGE)) || (eval (p + "state") == DEATH)) {
} else if ((Key.isDown(eval (p + "KEY_LEFT")) || ((pai && (nightmare)) && ((poa._x <= (pa._x - (2 * defwidth))) || (pa._x > (800 - defwidth))))) || ((pai && (!nightmare)) && ((((eval (p + "state") == RUN_L) || ((pa._xscale > 0) && (Math.random() < 0.4))) || (Math.random() < 0.1)) && (((poa._x <= (pa._x + (2 * defwidth))) || (pa._x > (800 - defwidth))) || ((eval (p + "state") == RUN_L) && (Math.random() < 0.8)))))) {
if (eval (p + "state") != RUN_L) {
if (eval (p + "jump") == 0) {
pa.gotoAndPlay("forward");
}
setState(pp, RUN_L);
}
} else if ((Key.isDown(eval (p + "KEY_RIGHT")) || ((pai && (nightmare)) && ((poa._x >= (pa._x + (2 * defwidth))) || (pa._x < defwidth)))) || (((pai && (!nightmare)) && (((eval (p + "state") == RUN_R) || ((pa._xscale < 0) && (Math.random() < 0.4))) || (Math.random() < 0.1))) && (((poa._x >= (pa._x - (2 * defwidth))) || (pa._x < defwidth)) || ((eval (p + "state") == RUN_R) && (Math.random() < 0.8))))) {
if (eval (p + "state") != RUN_R) {
if (eval (p + "jump") == 0) {
pa.gotoAndPlay("forward");
}
setState(pp, RUN_R);
}
} else if (eval (p + "state") != IDLE) {
if (eval (p + "jump") == 0) {
pa.gotoAndPlay("idle");
}
setState(pp, IDLE);
}
if (eval (p + "state") == SWORD_L) {
pa._x = pa._x - (runspd * 2);
} else if (eval (p + "state") == SWORD_R) {
pa._x = pa._x + (runspd * 2);
}
if (eval (p + "state") == BALL_L) {
pa._x = pa._x + 4;
if (eval (p + "jump") != 0) {
if (eval (p + "ballair")) {
pa._y = pa._y - 4;
} else {
pa._y = pa._y - 1;
}
setJump(pp, 1);
}
} else if (eval (p + "state") == BALL_R) {
pa._x = pa._x - 4;
if (eval (p + "jump") != 0) {
if (eval (p + "ballair")) {
pa._y = pa._y - 4;
} else {
pa._y = pa._y - 1;
}
setJump(pp, 1);
}
}
if (eval (p + "state") == RUN_L) {
if (pa._xscale < 0) {
pa._x = pa._x - defwidth;
pa._xscale = pa._xscale * -1;
} else {
pa._x = pa._x - runspd;
}
} else if (eval (p + "state") == RUN_R) {
if (pa._xscale > 0) {
pa._x = pa._x + defwidth;
pa._xscale = pa._xscale * -1;
} else {
pa._x = pa._x + runspd;
}
}
}
if ((eval (p + "jump") < 0) && (eval (p + "flr") != 0)) {
if (eval (p + "state") == IDLE) {
pa.gotoAndPlay("idle");
} else if ((eval (p + "state") == RUN_L) || (eval (p + "state") == RUN_R)) {
pa.gotoAndPlay("forward");
} else if ((eval (p + "state") == SWORD_L) || (eval (p + "state") == SWORD_R)) {
} else if ((eval (p + "state") == BALL_L) || (eval (p + "state") == BALL_R)) {
} else if ((eval (p + "state") == SEISMIC_L) || (eval (p + "state") == SEISMIC_R)) {
} else if (eval (p + "state") == DAMAGE) {
} else if (eval (p + "state") == DEATH) {
} else if (eval (p + "state") == BLOCK) {
}
setJump(pp, 0);
pa._y = eval (p + "flr") - 1;
} else if ((eval (p + "jump") > 0) && (eval (p + "ceil") != 0)) {
setJump(pp, -1);
pa._y = eval (p + "ceil") + 1;
} else if ((eval (p + "jump") < 0) && (eval (p + "jump") > (-jumpheight))) {
if ((!pai) || (!nightmare)) {
setJump(pp, eval (p + "jump") - 1);
} else {
setJump(pp, eval (p + "jump") - 2);
}
} else if ((((eval (p + "jump") > 0) && (eval (p + "state") != DAMAGE)) && (eval (p + "state") != DEATH)) && ((((!Key.isDown(eval (p + "KEY_JUMP"))) && (!pai)) || (eval (p + "state") == BLOCK)) || (((pai && ((nightmare && (eval (po + "state") == SEISMIC)) || (!nightmare))) && (Math.random() < 0.15)) && (pa._y < poa._y)))) {
setJump(pp, -1);
} else if (eval (p + "jump") > 0) {
setJump(pp, eval (p + "jump") - 1);
if (eval (p + "jump") == 0) {
setJump(pp, -1);
}
}
if (Math.abs(eval (p + "jump")) <= jumpspd) {
pa._y = pa._y - eval (p + "jump");
} else if (eval (p + "jump") < 0) {
pa._y = pa._y - (-jumpspd);
} else if (eval (p + "jump") > 0) {
pa._y = pa._y - jumpspd;
}
if (pp == 0) {
p0lwall = 0;
} else if (pp == 1) {
p1lwall = 0;
}
x = pa._x;
if (pa._xscale < 0) {
x = x - defwidth;
}
if (eval (p + "oldx") > pa._x) {
if (pp == 0) {
p0lwall = collision(x, eval (p + "oldy"), defwidth, defheight, 2);
} else if (pp == 1) {
p1lwall = collision(x, eval (p + "oldy"), defwidth, defheight, 2);
}
} else if (eval (p + "oldx") < pa._x) {
if (pp == 0) {
p0rwall = collision(x, eval (p + "oldy"), defwidth, defheight, 3);
} else if (pp == 1) {
p1rwall = collision(x, eval (p + "oldy"), defwidth, defheight, 3);
}
}
if (((((eval (p + "wallTrig") != 1) && (eval (p + "upTrig") != 1)) && (eval (p + "jump") != 0)) && (Key.isDown(eval (p + "KEY_JUMP")) || ((pai && (Math.random() < 0.8)) && (poa._y <= pa._y)))) && (pa._y > 0)) {
if ((eval (p + "state") == RUN_L) && (eval (p + "lwall") != 0)) {
if (pp == 0) {
p0wallTrig = 1;
} else if (pp == 1) {
p1wallTrig = 1;
}
if (pp == 0) {
p0upTrig = 1;
} else if (pp == 1) {
p1upTrig = 1;
}
pa._x = eval (p + "lwall") + 1;
pa._y = Math.min(pa._y, collision(eval (p + "lwall"), eval (p + "oldy"), defwidth, defheight, 1) - wallheight);
setState(pp, WALL_L);
pa.gotoAndPlay("wall");
setJump(pp, 4);
} else if ((eval (p + "state") == RUN_R) && (eval (p + "rwall") != 0)) {
if (pp == 0) {
p0wallTrig = 1;
} else if (pp == 1) {
p1wallTrig = 1;
}
if (pp == 0) {
p0upTrig = 1;
} else if (pp == 1) {
p1upTrig = 1;
}
pa._x = eval (p + "rwall") - 1;
pa._y = Math.min(pa._y, collision(eval (p + "rwall"), eval (p + "oldy"), defwidth, defheight, 1) - wallheight);
setState(pp, WALL_R);
pa.gotoAndPlay("wall");
setJump(pp, 4);
}
}
if (eval (p + "oldx") > pa._x) {
if (eval (p + "lwall") != 0) {
pa._x = eval (p + "lwall") + 1;
if (pa._xscale < 0) {
pa._x = pa._x + defwidth;
}
}
} else if (eval (p + "oldx") < pa._x) {
if (eval (p + "rwall") != 0) {
pa._x = eval (p + "rwall") - 1;
if (pa._xscale > 0) {
pa._x = pa._x - defwidth;
}
}
}
if (pp == 0) {
p0flr = 0;
} else if (pp == 1) {
p1flr = 0;
}
if (eval (p + "oldy") < pa._y) {
x = pa._x;
if (pa._xscale < 0) {
x = x - defwidth;
}
if (pp == 0) {
p0flr = collision(x, pa._y, defwidth, defheight, 0);
} else if (pp == 1) {
p1flr = collision(x, pa._y, defwidth, defheight, 0);
}
if (eval (p + "flr") != 0) {
pa._y = eval (p + "flr") - 1;
setJump(pp, 0);
if ((eval (p + "state") == RUN_L) || (eval (p + "state") == RUN_R)) {
pa.gotoAndPlay("forward");
} else if (eval (p + "state") == IDLE) {
pa.gotoAndPlay("idle");
} else if ((eval (p + "state") == SWORD_L) || (eval (p + "state") == SWORD_R)) {
} else if ((eval (p + "state") == SEISMIC_L) || (eval (p + "state") == SEISMIC_R)) {
} else if ((eval (p + "state") == BALL_L) || (eval (p + "state") == BALL_R)) {
} else if (eval (p + "state") == BLOCK) {
} else if (eval (p + "state") == DAMAGE) {
} else if (eval (p + "state") == DEATH) {
}
}
}
if (pp == 0) {
p0ceil = 0;
} else if (pp == 1) {
p1ceil = 0;
}
if (eval (p + "oldy") > pa._y) {
x = pa._x;
if (pa._xscale < 0) {
x = x - defwidth;
}
if (pp == 0) {
p0ceil = collision(x, pa._y, defwidth, defheight, 1);
} else if (pp == 1) {
p1ceil = collision(x, pa._y, defwidth, defheight, 1);
}
if (eval (p + "ceil") != 0) {
pa._y = eval (p + "ceil") + 1;
setJump(pp, -1);
if (pp == 0) {
p0ceil = 0;
} else if (pp == 1) {
p1ceil = 0;
}
}
}
x = pa._x;
if (pa._xscale < 0) {
x = x - defwidth;
}
x = pa._x;
if (pa._xscale < 0) {
x = x - defwidth;
}
d = collision(x, pa._y + 1, defwidth, defheight, 0);
if ((eval (p + "jump") == 0) && (d == 0)) {
setJump(pp, -1);
}
if ((eval (p + "jump") <= -1) && (((((((((((eval (p + "state") != SWORD_L) && (eval (p + "state") != SWORD_R)) && (eval (p + "state") != SEISMIC_L)) && (eval (p + "state") != SEISMIC_R)) && (eval (p + "state") != BALL_L)) && (eval (p + "state") != BALL_R)) && (eval (p + "state") != WALL_L)) && (eval (p + "state") != WALL_R)) && (eval (p + "state") != DAMAGE)) && (eval (p + "state") != DEATH)) && (eval (p + "state") != BLOCK))) {
pa.gotoAndPlay("fall");
}
if (pa._y > 530) {
pa._y = -30;
}
reposDmg(pp, pa._x, pa._y);
if ((eval (p + "ball") != null) && (eval (p + "ball")._currentframe < BALLEXP_FRAME)) {
b = eval (p + "ball");
b._x = b._x + eval (p + "ballx");
b._y = b._y + eval (p + "bally");
bd = eval (p + "balldmg");
bd._x = bd._x + eval (p + "ballx");
bd._y = bd._y + eval (p + "bally");
if ((b._y > 600) || (collision(b._x, b._y, ballwidth, ballheight, -1))) {
b.gotoAndPlay("explode");
if ((pp = 0)) {
p0ballx = 0;
p0bally = 0;
} else if (pp == 1) {
p1ballx = 0;
p1bally = 0;
}
}
}
runspd = runspdbk;
jumpheight = jumpheightbk;
jumpspd = jumpspdbk;
pp++;
}
p0oldframe = p0a._currentframe;
p0oldframe2 = p0b._currentframe;
p1oldframe = p1a._currentframe;
p1oldframe2 = p1b._currentframe;
p0d.gotoAndStop(p0a._currentframe);
p1d.gotoAndStop(p1a._currentframe);
p0d._xscale = p0a._xscale;
p1d._xscale = p1a._xscale;
p0d._x = p0a._x;
p1d._x = p1a._x;
p0d._y = p0a._y;
p1d._y = p1a._y;
if (p0hp <= hpmax) {
p0hpbar._width = (hpmax - p0hp) * (184 / hpmax);
p0hpbar2._width = 0;
} else {
p0hpbar2._width = (p0hp - hpmax) * (184 / hpmax);
p0hpbar._width = 0;
}
if (p1hp <= hpmax) {
p1hpbar._width = (hpmax - p1hp) * (184 / hpmax);
p1hpbar2._width = 0;
} else {
p1hpbar2._width = (p1hp - hpmax) * (184 / hpmax);
p1hpbar._width = 0;
}
Frame 8
gotoAndPlay (5);
Frame 9
p0d._visible = false;
p1d._visible = false;
setShadow(0, false);
setShadow(1, false);
p0downTrig = 0;
p1downTrig = 0;
p0upTrig = 0;
p1upTrig = 0;
p0wallTrig = 0;
p1wallTrig = 0;
stop();
Symbol 19 MovieClip Frame 5
gotoAndPlay (1);
Symbol 19 MovieClip Frame 6
if (_root.soundon) {
s_ballexp = new Sound();
s_ballexp.attachSound("explosion");
s_ballexp.start(0.5, 1);
}
Symbol 19 MovieClip Frame 23
stop();
Symbol 117 MovieClip Frame 39
gotoAndPlay (1);
Symbol 117 MovieClip Frame 55
gotoAndPlay (42);
Symbol 117 MovieClip Frame 69
gotoAndPlay (67);
Symbol 117 MovieClip Frame 72
gotoAndPlay (70);
Symbol 117 MovieClip Frame 73
if (_root.soundon) {
s_sword = new Sound(_root.opaque1);
s_sword.attachSound("sword");
s_sword.setVolume(30);
s_sword.start(0, 1);
}
Symbol 117 MovieClip Frame 91
gotoAndPlay (1);
Symbol 117 MovieClip Frame 115
gotoAndPlay (1);
Symbol 117 MovieClip Frame 121
gotoAndPlay (67);
Symbol 117 MovieClip Frame 122
if (_root.soundon) {
s_swordair = new Sound(_root.opaque1);
s_swordair.attachSound("sword");
s_swordair.setVolume(30);
s_swordair.start(0, 1);
}
Symbol 117 MovieClip Frame 128
gotoAndPlay (79);
Symbol 117 MovieClip Frame 129
if (_root.soundon) {
s_seismic = new Sound();
s_seismic.attachSound("seismic");
s_seismic.start(0.5, 1);
}
Symbol 117 MovieClip Frame 190
gotoAndPlay (1);
Symbol 117 MovieClip Frame 191
if (_root.soundon) {
s_ballair = new Sound();
s_ballair.attachSound("fireball");
s_ballair.start(0, 1);
}
Symbol 117 MovieClip Frame 203
gotoAndPlay (1);
Symbol 117 MovieClip Frame 204
if (_root.soundon) {
s_ballair = new Sound();
s_ballair.attachSound("fireball");
s_ballair.start(0, 1);
}
Symbol 117 MovieClip Frame 216
gotoAndPlay (1);
Symbol 117 MovieClip Frame 217
if (_root.soundon) {
s_damage = new Sound();
s_damage.attachSound("damage");
s_damage.start(0, 1);
}
Symbol 117 MovieClip Frame 237
gotoAndPlay (1);
Symbol 117 MovieClip Frame 240
gotoAndPlay (238);
Symbol 117 MovieClip Frame 241
if (_root.soundon) {
s_death = new Sound();
s_death.attachSound("death");
s_death.start(0.5, 1);
}
Symbol 117 MovieClip Frame 398
stop();
Symbol 121 Button
on (release) {
p0ai = !p0ai;
if (p0ai) {
ai0._alpha = 50;
p0KEY_JUMP = 0;
p0KEY_BLOCK = 0;
p0KEY_LEFT = 0;
p0KEY_RIGHT = 0;
p0KEY_SWORD = 0;
p0KEY_SEISMIC = 0;
p0KEY_BALL = 0;
} else {
ai0._alpha = 100;
p0KEY_JUMP = 38;
p0KEY_BLOCK = 40;
p0KEY_LEFT = 37;
p0KEY_RIGHT = 39;
p0KEY_SWORD = 97;
p0KEY_SEISMIC = 98;
p0KEY_BALL = 99;
}
}
Symbol 122 Button
on (release) {
p1ai = !p1ai;
if (p1ai) {
ai1._alpha = 50;
p1KEY_JUMP = 0;
p1KEY_BLOCK = 0;
p1KEY_LEFT = 0;
p1KEY_RIGHT = 0;
p1KEY_SWORD = 0;
p1KEY_SEISMIC = 0;
p1KEY_BALL = 0;
} else {
ai1._alpha = 100;
p1KEY_JUMP = 87;
p1KEY_BLOCK = 83;
p1KEY_LEFT = 65;
p1KEY_RIGHT = 68;
p1KEY_SWORD = 70;
p1KEY_SEISMIC = 71;
p1KEY_BALL = 72;
}
}
Symbol 132 Button
on (release) {
if (diffs == "easy") {
diffs = "normal";
diff = 1;
} else if (diffs == "normal") {
diffs = "hard";
diff = 2;
} else if (diffs == "hard") {
diffs = "nightmare";
diff = 3;
nightmare = true;
} else if (diffs == "nightmare") {
diffs = "easy";
diff = 0.1;
nightmare = false;
}
}
Symbol 136 Button
on (release) {
gotoAndPlay (5);
if (soundon) {
s = new Sound();
s.attachSound("music");
s.start(0, 9999);
}
}
Symbol 142 Button
on (release) {
hyper = !hyper;
}
Symbol 146 Button
on (release) {
soundon = !soundon;
}
Symbol 152 Button
on (release) {
getURL ("http://www.geocities.com/arayh_al/etherena-demo.html", _self);
}
Symbol 162 Button
on (release) {
gotoAndPlay (4);
stopAllSounds();
}