Frame 1
stopAllSounds();
Frame 2
if (_framesloaded >= _totalframes) {
gotoAndStop (3);
}
if (_framesloaded < _totalframes) {
gotoAndPlay (1);
}
Frame 3
var px;
var py;
var lives;
var continues;
Frame 4
var dif;
dif = 0;
stop();
var psn;
var pl;
var i;
var pcd;
var pstep;
var bstep;
var bcharge;
px = 0;
py = 0;
psx = new Array(5);
psy = new Array(5);
pst = new Array(5);
psd = new Array(5);
megas = new Sound(this);
megas.attachSound("laser");
megash = new Sound(this);
megash.attachSound("gun-1");
megah = new Sound(this);
megah.attachSound("Impact");
megad = new Sound(this);
megad.attachSound("Death");
joes = new Sound(this);
joes.attachSound("Shotgun-2");
cannons = new Sound(this);
cannons.attachSound("Gun-5");
baddyd1 = new Sound(this);
baddyd1.attachSound("Explosion-2");
baddyd2 = new Sound(this);
baddyd2.attachSound("Explosion-3");
deflect = new Sound(this);
deflect.attachSound("hit");
nunchakuswing = new Sound(this);
nunchakuswing.attachSound("metalclang");
machineg = new Sound(this);
machineg.attachSound("laserrepeat");
jetpass = new Sound(this);
jetpass.attachSound("passing");
bx = new Array(40);
by = new Array(40);
var r;
var e;
var c;
var w;
w = 0;
bgx = new Array(8);
bgy = new Array(8);
bgd = new Array(8);
bgs = new Array(8);
bgt = new Array(8);
bgl = new Array(8);
bgst = new Array(5);
bgsd = new Array(5);
bgsx = new Array(5);
bgsy = new Array(5);
var bi;
f = new Array(10);
bg1.gotoAndStop(1);
bg2.gotoAndStop(1);
bg3.gotoAndStop(1);
bg4.gotoAndStop(1);
bg5.gotoAndStop(1);
bg6.gotoAndStop(1);
bg7.gotoAndStop(1);
bg8.gotoAndStop(1);
var ex;
var ey;
Frame 5
px = 0;
py = 0;
if (continues < 0) {
gotoAndPlay (3);
}
stopAllSounds();
Frame 6
select._x = (60 * px) + 95;
select._y = (60 * py) + 95;
c = 0;
r = 1;
while (r < 5000) {
c = (random(100) * random(100)) * random(100);
r++;
}
if (Key.isDown(13)) {
gotoAndPlay (180);
}
if (Key.isDown(39)) {
px = px + 1;
if (px > 1) {
px = -1;
}
}
if (Key.isDown(37)) {
px = px - 1;
if (px < -1) {
px = 1;
}
}
if (Key.isDown(38)) {
py = py - 1;
if (py < -1) {
py = 1;
}
}
if (Key.isDown(40)) {
py = py + 1;
if (py > 1) {
py = -1;
}
}
if (px == -1) {
if (py == -1) {
names.gotoAndStop(1);
}
if (py == 0) {
names.gotoAndStop(4);
}
if (py == 1) {
names.gotoAndStop(7);
}
}
if (px == 0) {
if (py == -1) {
names.gotoAndStop(2);
}
if (py == 0) {
names.gotoAndStop(5);
}
if (py == 1) {
names.gotoAndStop(8);
}
}
if (px == 1) {
if (py == -1) {
names.gotoAndStop(3);
}
if (py == 0) {
names.gotoAndStop(6);
}
if (py == 1) {
names.gotoAndStop(9);
}
}
if (Key.isDown(32)) {
if ((px == -1) and (py == -1)) {
gotoAndPlay (10);
}
if ((px == -1) and (py == 5)) {
gotoAndPlay (145);
}
if ((px == 0) and (py == -1)) {
gotoAndPlay (55);
}
if ((px == 1) and (py == -1)) {
gotoAndPlay (100);
}
if ((px == 1) and (py == 5)) {
gotoAndPlay (190);
}
}
Frame 7
gotoAndPlay (6);
Frame 10
psn = 1;
bstep = 0;
pcd = 0;
bcharge = 0;
r = 1;
while (r <= 5) {
psx[r] = -200;
psy[r] = 0;
pst[r] = 0;
psd[r] = 0;
r++;
}
i = 0;
pl = 50;
px = 150;
py = 373;
r = 0;
while (r <= 31) {
bx[r] = -50;
by[r] = -50;
r++;
}
bx[1] = 50;
by[1] = 250;
bx[2] = 50;
by[2] = 350;
bx[3] = 150;
by[3] = 450;
bx[4] = 250;
by[4] = 450;
bx[5] = 350;
by[5] = 450;
bx[6] = 450;
by[6] = 450;
bx[7] = 550;
by[7] = 450;
bx[8] = 750;
by[8] = 450;
bx[9] = 950;
by[9] = 400;
bx[10] = 1050;
by[10] = 450;
bx[11] = 1150;
by[11] = 450;
bx[12] = 1250;
by[12] = 425;
bx[13] = 1350;
by[13] = 375;
bx[14] = 1450;
by[14] = 275;
bx[15] = 1450;
by[15] = 175;
bsn = 1;
r = 1;
while (r <= 8) {
bgx[r] = -200;
bgy[r] = -200;
bgt[r] = 0;
bgd[r] = -1;
bgs[r] = 0;
r++;
}
r = 1;
while (r <= 5) {
bgsx[r] = -200;
bgsy[r] = 0;
bgst[r] = 0;
bgsd[r] = 0;
r++;
}
r = 1;
while (r <= 8) {
f[r] = 20;
r++;
}
bgt[1] = 2;
bgd[1] = 3;
bgs[1] = 0;
bgl[1] = 3;
bgx[1] = 350;
bgy[1] = 350;
bgt[2] = 1;
bgd[2] = 2;
bgs[2] = 0;
bgl[2] = 2;
bgx[2] = 450;
bgy[2] = 350;
bgt[3] = 3;
bgd[3] = 0;
bgs[3] = 0;
bgl[3] = 3;
bgx[3] = 450;
bgy[3] = 180;
bgt[4] = 3;
bgd[4] = 0;
bgs[4] = 0;
bgl[4] = 3;
bgx[4] = 600;
bgy[4] = 180;
bgt[5] = 1;
bgd[5] = 2;
bgs[5] = 0;
bgl[5] = 2;
bgx[5] = 750;
bgy[5] = 350;
bgt[6] = 5;
bgd[6] = 2;
bgs[6] = 0;
bgl[6] = 6;
bgx[6] = 920;
bgy[6] = 300;
bgt[7] = 2;
bgd[7] = 3;
bgs[7] = 0;
bgl[7] = 3;
bgx[7] = 1150;
bgy[7] = 350;
bgt[8] = 5;
bgd[8] = 2;
bgs[8] = 0;
bgl[8] = 6;
bgx[8] = 1250;
bgy[8] = 325;
ex = 1350;
ey = 275;
stopAllSounds();
Frame 11
lbar._height = 2 * pl;
lbar._y = 120 - (2 * pl);
stage._x = (270 - px) / 2;
stage._y = (375 - py) / 2;
exit._x = ((ex + 275) - px) / 2;
exit._y = ((ey + 275) - py) / 2;
pc.gotoAndStop(1);
Frame 22
b1._x = bx[1] / 10;
b1._y = (by[1] / 10) + 120;
b2._x = bx[2] / 10;
b2._y = (by[2] / 10) + 120;
b3._x = bx[3] / 10;
b3._y = (by[3] / 10) + 120;
b4._x = bx[4] / 10;
b4._y = (by[4] / 10) + 120;
b5._x = bx[5] / 10;
b5._y = (by[5] / 10) + 120;
b6._x = bx[6] / 10;
b6._y = (by[6] / 10) + 120;
b7._x = bx[7] / 10;
b7._y = (by[7] / 10) + 120;
b8._x = bx[8] / 10;
b8._y = (by[8] / 10) + 120;
b9._x = bx[9] / 10;
b9._y = (by[9] / 10) + 120;
b10._x = bx[10] / 10;
b10._y = (by[10] / 10) + 120;
b11._x = bx[11] / 10;
b11._y = (by[11] / 10) + 120;
b12._x = bx[12] / 10;
b12._y = (by[12] / 10) + 120;
b13._x = bx[13] / 10;
b13._y = (by[13] / 10) + 120;
b14._x = bx[14] / 10;
b14._y = (by[14] / 10) + 120;
b15._x = bx[15] / 10;
b15._y = (by[15] / 10) + 120;
b16._x = bx[16] / 10;
b16._y = (by[16] / 10) + 120;
b17._x = bx[17] / 10;
b17._y = (by[17] / 10) + 120;
b18._x = bx[18] / 10;
b18._y = (by[18] / 10) + 120;
b19._x = bx[19] / 10;
b19._y = (by[19] / 10) + 120;
b20._x = bx[20] / 10;
b20._y = (by[20] / 10) + 120;
b21._x = bx[21] / 10;
b21._y = (by[21] / 10) + 120;
b22._x = bx[22] / 10;
b22._y = (by[22] / 10) + 120;
b23._x = bx[23] / 10;
b23._y = (by[23] / 10) + 120;
b24._x = bx[24] / 10;
b24._y = (by[24] / 10) + 120;
b25._x = bx[25] / 10;
b25._y = (by[25] / 10) + 120;
b26._x = bx[26] / 10;
b26._y = (by[26] / 10) + 120;
b27._x = bx[27] / 10;
b27._y = (by[27] / 10) + 120;
b28._x = bx[28] / 10;
b28._y = (by[28] / 10) + 120;
cir._x = px / 10;
cir._y = (py / 10) + 120;
shot1._x = psx[1] / 10;
shot1._y = (psy[1] / 10) + 120;
shot2._x = psx[2] / 10;
shot2._y = (psy[2] / 10) + 120;
shot3._x = psx[3] / 10;
shot3._y = (psy[3] / 10) + 120;
bshot1._x = bgsx[1] / 10;
bshot1._y = (bgsy[1] / 10) + 120;
bshot2._x = bgsx[2] / 10;
bshot2._y = (bgsy[2] / 10) + 120;
bshot3._x = bgsx[3] / 10;
bshot3._y = (bgsy[3] / 10) + 120;
bshot4._x = bgsx[4] / 10;
bshot4._y = (bgsy[4] / 10) + 120;
bshot5._x = bgsx[5] / 10;
bshot5._y = (bgsy[5] / 10) + 120;
bcir1._x = bgx[1] / 10;
bcir1._y = (bgy[1] / 10) + 120;
bcir2._x = bgx[2] / 10;
bcir2._y = (bgy[2] / 10) + 120;
bcir3._x = bgx[3] / 10;
bcir3._y = (bgy[3] / 10) + 120;
bcir4._x = bgx[4] / 10;
bcir4._y = (bgy[4] / 10) + 120;
bcir5._x = bgx[5] / 10;
bcir5._y = (bgy[5] / 10) + 120;
bcir6._x = bgx[6] / 10;
bcir6._y = (bgy[6] / 10) + 120;
bcir7._x = bgx[7] / 10;
bcir7._y = (bgy[7] / 10) + 120;
bcir8._x = bgx[8] / 10;
bcir8._y = (bgy[8] / 10) + 120;
bcir9._x = bgx[9] / 10;
bcir9._y = (bgy[9] / 10) + 120;
bcir10._x = bgx[10] / 10;
bcir10._y = (bgy[10] / 10) + 120;
bcir11._x = bgx[11] / 10;
bcir11._y = (bgy[11] / 10) + 120;
bcir12._x = bgx[12] / 10;
bcir12._y = (bgy[12] / 10) + 120;
bcir13._x = bgx[13] / 10;
bcir13._y = (bgy[13] / 10) + 120;
if (Key.isDown(39) and (pcd == 0)) {
pcd = 2;
}
if (Key.isDown(39) and ((pcd == 1) or (pcd == 3))) {
pcd = 0;
}
if (Key.isDown(37) and (pcd == 1)) {
pcd = 3;
}
if (Key.isDown(37) and ((pcd == 0) or (pcd == 2))) {
pcd = 1;
}
if (Key.isDown(38) and ((pcd == 0) or (pcd == 2))) {
pcd = 10;
pstep = 7;
}
if (Key.isDown(38) and ((pcd == 1) or (pcd == 3))) {
pcd = 11;
pstep = 7;
}
if (Key.isDown(40) and ((((pcd == 0) or (pcd == 1)) or (pcd == 2)) or (pcd == 3))) {
if (((pcd == 0) or (pcd == 2)) or (pcd == 8)) {
pcd = 6;
pstep = 3;
}
if (((pcd == 1) or (pcd == 3)) or (pcd == 9)) {
pcd = 7;
pstep = 3;
}
}
if (Key.isDown(16) and (bcharge < 100)) {
bcharge = bcharge + 5;
}
if (pcd == 0) {
pc.gotoAndStop(1);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(21);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 0;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
}
if (pcd == 1) {
pc.gotoAndStop(2);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(22);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 1;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
}
if (pcd == 2) {
px = px + 13;
if ((w == 0) or (w == 1)) {
pc.gotoAndStop(3);
}
if ((w == 2) or (w == 3)) {
pc.gotoAndStop(4);
}
if ((w == 4) or (w == 5)) {
pc.gotoAndStop(5);
}
if ((w == 6) or (w == 7)) {
pc.gotoAndStop(6);
}
if (Key.isDown(32)) {
if ((w == 0) or (w == 1)) {
pc.gotoAndStop(11);
}
if ((w == 2) or (w == 3)) {
pc.gotoAndStop(12);
}
if ((w == 4) or (w == 5)) {
pc.gotoAndStop(13);
}
if ((w == 6) or (w == 7)) {
pc.gotoAndStop(14);
}
if ((pst[psn] == 0) and (bstep == 0)) {
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 0;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
}
pcd = 0;
}
if (pcd == 3) {
px = px - 13;
if ((w == 0) or (w == 1)) {
pc.gotoAndStop(7);
}
if ((w == 2) or (w == 3)) {
pc.gotoAndStop(8);
}
if ((w == 4) or (w == 5)) {
pc.gotoAndStop(9);
}
if ((w == 6) or (w == 7)) {
pc.gotoAndStop(10);
}
if (Key.isDown(32)) {
if ((w == 0) or (w == 1)) {
pc.gotoAndStop(15);
}
if ((w == 2) or (w == 3)) {
pc.gotoAndStop(16);
}
if ((w == 4) or (w == 5)) {
pc.gotoAndStop(17);
}
if ((w == 6) or (w == 7)) {
pc.gotoAndStop(18);
}
if ((pst[psn] == 0) and (bstep == 0)) {
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 1;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
}
pcd = 1;
}
if (pcd == 9) {
pstep = pstep - 1;
if (pstep <= 0) {
pcd = 1;
}
}
if (pcd == 6) {
pc.gotoAndStop(19);
px = px + 20;
pstep = pstep - 1;
if (pstep <= 0) {
pcd = 0;
}
}
if (pcd == 7) {
pc.gotoAndStop(20);
px = px - 20;
pstep = pstep - 1;
if (pstep <= 0) {
pcd = 1;
}
}
if (pcd == 12) {
pc.gotoAndStop(23);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(25);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 0;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
py = py + (5 * (7 - pstep));
pstep = pstep - 1;
if (pstep <= 2) {
pstep = 2;
}
if (Key.isDown(39)) {
px = px + 13;
}
if (Key.isDown(37)) {
px = px - 13;
if (bstep == 0) {
pcd = 13;
}
}
}
if (pcd == 13) {
pc.gotoAndStop(24);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(26);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 1;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
py = py + (5 * (7 - pstep));
pstep = pstep - 1;
if (pstep <= 2) {
pstep = 2;
}
if (Key.isDown(39)) {
px = px + 13;
if (bstep == 0) {
pcd = 12;
}
}
if (Key.isDown(37)) {
px = px - 13;
}
}
if (pcd == 10) {
pc.gotoAndStop(23);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(25);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 0;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
py = py - (5 * pstep);
pstep = pstep - 1;
if (Key.isDown(39)) {
px = px + 13;
}
if (Key.isDown(37)) {
px = px - 13;
if (bstep == 0) {
pcd = 11;
}
}
if (Key.isDown(40)) {
pcd = 12;
pstep = pstep + 3;
}
if (pstep <= -1) {
pstep = 7;
pcd = 12;
}
}
if (pcd == 11) {
pc.gotoAndStop(24);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(26);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 1;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
py = py - (5 * pstep);
pstep = pstep - 1;
if (Key.isDown(39)) {
px = px + 13;
if (bstep == 0) {
pcd = 10;
}
}
if (Key.isDown(37)) {
px = px - 13;
}
if (Key.isDown(40)) {
pcd = 13;
pstep = pstep + 3;
}
if (pstep <= -1) {
pstep = 7;
pcd = 13;
}
}
if (pcd == 18) {
pc.gotoAndStop(27);
pstep = pstep - 1;
px = px - 5;
if (pstep <= -1) {
pstep = 2;
pcd = 0;
}
}
if (pcd == 19) {
pc.gotoAndStop(28);
pstep = pstep - 1;
px = px + 5;
if (pstep <= -1) {
pstep = 2;
pcd = 1;
}
}
if (pcd == 20) {
pc.gotoAndStop(69 - pstep);
bcharge = 0;
charge._alpha = 0;
bstep = 20;
pl = 1;
pstep = pstep - 1;
if (pstep < 0) {
lives = lives - 1;
if (lives >= 0) {
pl = 50;
gotoAndPlay (10);
}
if (lives < 0) {
lives = 2;
continues = continues - 1;
gotoAndPlay (5);
}
}
}
if (pl <= 0) {
c = 1;
while (c <= 8) {
bgx[c] = -600;
c++;
}
pc._alpha = 100;
pcd = 20;
pstep = 40;
megad.start();
}
if (bstep > 0) {
bcharge = 0;
charge._alpha = bcharge;
}
if (bstep > 0) {
bstep = bstep - 1;
}
if ((py > 500) and (pcd < 20)) {
megad.start();
pl = 0;
}
w = w - 1;
if (w < 0) {
w = 7;
}
e = pcd;
c = 0;
r = 1;
while (r <= 15) {
if (((((bx[r] - 150) < px) and ((bx[r] + 150) > px)) and ((by[r] - 150) < py)) and ((by[r] + 150) > py)) {
if (((((((px - 30) < (bx[r] + 50)) and ((px + 20) > (bx[r] - 50))) and (py < (by[r] - 50))) and ((py + 60) > (by[r] - 50))) and (pcd != 10)) and (pcd != 11)) {
if ((((pcd == 12) or (pcd == 13)) or (pcd == 16)) or (pcd == 17)) {
if ((pcd == 12) or (pcd == 16)) {
pcd = 0;
}
if ((pcd == 13) or (pcd == 17)) {
pcd = 1;
}
}
c = 1;
py = by[r] - 75;
}
if (((((px + 38) > (bx[r] - 50)) and ((px + 20) < bx[r])) and (py < (by[r] + 50))) and ((py + 20) > (by[r] - 50))) {
px = bx[r] - 85;
}
if (((((px - 35) < (bx[r] + 50)) and ((px - 20) > bx[r])) and (py < (by[r] + 50))) and ((py + 20) > (by[r] - 50))) {
px = bx[r] + 85;
}
if (((((px - 5) < (bx[r] + 50)) and ((px + 5) > (bx[r] - 50))) and ((py - 30) < (by[r] + 50))) and ((py + 10) > (by[r] + 50))) {
if ((((pcd == 10) or (pcd == 11)) or (pcd == 14)) or (pcd == 15)) {
if ((pcd == 10) or (pcd == 14)) {
pcd = 12;
pstep = 5;
}
if ((pcd == 11) or (pcd == 15)) {
pcd = 13;
pstep = 5;
}
}
py = by[r] + 90;
}
}
r++;
}
if (c == 0) {
if ((((pcd == 0) or (pcd == 2)) or (pcd == 6)) or (pcd == 18)) {
pcd = 12;
pstep = 6;
}
if ((((pcd == 1) or (pcd == 3)) or (pcd == 7)) or (pcd == 19)) {
pcd = 13;
pstep = 6;
}
}
r = 1;
while (r <= 3) {
if (pst[r] == 1) {
if (psd[r] == 0) {
psx[r] = psx[r] + 30;
if (r == 1) {
shot1p.gotoAndStop(1);
}
if (r == 2) {
shot2p.gotoAndStop(1);
}
if (r == 3) {
shot3p.gotoAndStop(1);
}
if (psx[r] > (px + 280)) {
pst[r] = 0;
psx[r] = -200;
}
}
if (psd[r] == 1) {
psx[r] = psx[r] - 30;
if (r == 1) {
shot1p.gotoAndStop(2);
}
if (r == 2) {
shot2p.gotoAndStop(2);
}
if (r == 3) {
shot3p.gotoAndStop(2);
}
if (psx[r] < (px - 280)) {
pst[r] = 0;
psx[r] = -200;
}
}
}
if (pst[r] == 2) {
if (psd[r] == 0) {
psx[r] = psx[r] + 35;
if (r == 1) {
shot1p.gotoAndStop(3);
}
if (r == 2) {
shot2p.gotoAndStop(3);
}
if (r == 3) {
shot3p.gotoAndStop(3);
}
if (psx[r] > (px + 280)) {
pst[r] = 0;
psx[r] = -200;
}
}
if (psd[r] == 1) {
psx[r] = psx[r] - 35;
if (r == 1) {
shot1p.gotoAndStop(4);
}
if (r == 2) {
shot2p.gotoAndStop(4);
}
if (r == 3) {
shot3p.gotoAndStop(4);
}
if (psx[r] < (px - 280)) {
pst[r] = 0;
psx[r] = -200;
}
}
}
if (pst[r] == 3) {
if (psd[r] == 0) {
psx[r] = psx[r] + 40;
if (r == 1) {
shot1p.gotoAndStop(5);
}
if (r == 2) {
shot2p.gotoAndStop(5);
}
if (r == 3) {
shot3p.gotoAndStop(5);
}
if (psx[r] > (px + 280)) {
pst[r] = 0;
psx[r] = -200;
}
}
if (psd[r] == 1) {
psx[r] = psx[r] - 40;
if (r == 1) {
shot1p.gotoAndStop(6);
}
if (r == 2) {
shot2p.gotoAndStop(6);
}
if (r == 3) {
shot3p.gotoAndStop(6);
}
if (psx[r] < (px - 280)) {
pst[r] = 0;
psx[r] = -200;
}
}
}
if (pst[r] == 4) {
if (r == 1) {
shot1p.gotoAndStop(10 - psd[r]);
}
if (r == 2) {
shot2p.gotoAndStop(10 - psd[r]);
}
if (r == 3) {
shot3p.gotoAndStop(10 - psd[r]);
}
psd[r] = psd[r] - 1;
if (psd[r] < 0) {
pst[r] = 0;
psx[r] = -200;
}
}
if (pst[r] == 5) {
if (r == 1) {
shot1p.gotoAndStop(14 - psd[r]);
}
if (r == 2) {
shot2p.gotoAndStop(14 - psd[r]);
}
if (r == 3) {
shot3p.gotoAndStop(14 - psd[r]);
}
psd[r] = psd[r] - 1;
if (psd[r] < 0) {
pst[r] = 0;
psx[r] = -200;
}
}
r++;
}
while (c <= 8) {
r = 1;
while (r <= 3) {
if ((pst[r] > 0) and (pst[r] < 4)) {
if (((((bgt[c] == 1) and ((bgx[c] - 35) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 35) > (psx[r] - ((pst[r] * 20) - 20)))) and ((bgy[c] - 5) < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 50) > (psy[r] - ((pst[r] * 20) - 20)))) {
if ((bgd[c] == 0) or (bgd[c] == 2)) {
deflect.start();
pst[r] = 5;
psd[r] = 3;
}
if ((bgd[c] == 1) or (bgd[c] == 3)) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd2.start();
bgd[c] = 4;
bgs[c] = 4;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 3;
}
}
}
if (((((bgt[c] == 2) and ((bgx[c] - 35) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 35) > (psx[r] - ((pst[r] * 20) - 20)))) and (bgy[c] < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 50) > (psy[r] - ((pst[r] * 20) - 20)))) {
if ((((bgd[c] == 0) or (bgd[c] == 3)) or (bgd[c] == 1)) or (bgd[c] == 4)) {
deflect.start();
pst[r] = 5;
psd[r] = 3;
}
if ((bgd[c] == 2) or (bgd[c] == 5)) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd2.start();
bgd[c] = 6;
bgs[c] = 6;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 3;
}
}
}
if (((((bgt[c] == 3) and ((bgx[c] - 35) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 35) > (psx[r] - ((pst[r] * 20) - 20)))) and ((bgy[c] - 20) < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 40) > (psy[r] - ((pst[r] * 20) - 20)))) {
if (bgd[c] == 0) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd2.start();
bgd[c] = 1;
bgs[c] = 4;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 3;
}
}
}
if (((((bgt[c] == 5) and ((bgx[c] - 40) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 40) > (psx[r] - ((pst[r] * 20) - 20)))) and ((bgy[c] - 20) < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 50) > (psy[r] - ((pst[r] * 20) - 20)))) {
if ((((bgd[c] == 0) or (bgd[c] == 1)) or (bgd[c] == 2)) or (bgd[c] == 3)) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd1.start();
bgd[c] = 4;
bgs[c] = 5;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
}
r++;
}
c++;
}
r = 1;
while (r <= 8) {
if (((((bgt[r] > 0) and ((bgx[r] - 340) < px)) and ((bgx[r] + 340) > px)) and ((bgy[r] - 180) < py)) and ((bgy[r] + 350) > py)) {
c = 0;
e = 1;
while (e <= 15) {
if (((((bx[e] - 150) < bgx[r]) and ((bx[e] + 150) > bgx[r])) and ((by[e] - 150) < bgy[r])) and ((by[e] + 150) > bgy[r])) {
if (((((bgx[r] + 20) >= (bx[e] - 50)) and ((bgx[r] - 20) <= (bx[e] + 50))) and ((bgy[r] + 45) > (by[e] - 60))) and ((bgy[r] - 10) < (by[e] - 40))) {
c = 1;
}
if (((((bgx[r] + 20) > (bx[e] - 50)) and ((bgx[r] + 20) < bx[e])) and (bgy[r] < (by[e] + 50))) and ((bgy[r] + 20) > (by[e] - 50))) {
bgx[r] = bx[e] - 70;
}
if (((((bgx[r] - 20) < (bx[e] + 50)) and ((bgx[r] + 20) > bx[e])) and (bgy[r] < (by[e] + 50))) and ((bgy[r] + 20) > (by[e] - 50))) {
bgx[r] = bx[e] + 70;
}
if (((((bgx[r] - 5) < (bx[e] + 50)) and ((bgx[r] + 5) > (bx[e] - 50))) and ((bgy[r] - 30) < (by[e] + 50))) and (bgy[r] > (by[e] + 50))) {
bgy[r] = by[e] + 70;
}
if (((((bgx[r] - 2) < (bx[e] + 50)) and ((bgx[r] + 2) > (bx[e] - 50))) and ((bgy[r] + 20) < (by[e] - 50))) and ((bgy[r] + 60) > (by[e] - 50))) {
c = 1;
bgy[r] = by[e] - 105;
}
}
e++;
}
if (c == 0) {
bgy[r] = bgy[r] + 10;
}
if (bgt[r] == 1) {
if (((((((bgx[r] - 10) < (px + 10)) and ((bgx[r] + 10) > (px - 10))) and ((bgy[r] + 80) > (py + 10))) and ((bgy[r] + 50) < (py + 50))) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 4;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 4;
}
megah.start();
i = 10;
}
if (bgd[r] == 0) {
f[r] = 1;
if (px < bgx[r]) {
bgd[r] = 2;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
joes.start();
bgd[r] = 1;
bgs[r] = 7;
bgst[bsn] = 1;
bgsx[bsn] = bgx[r] - 10;
bgsy[bsn] = bgy[r] + 30;
bgsd[bsn] = 0;
bsn = bsn + 1;
if (bsn > 5) {
bsn = 1;
}
}
}
if (bgd[r] == 2) {
f[r] = 3;
if (px > bgx[r]) {
bgd[r] = 0;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
joes.start();
bgd[r] = 3;
bgs[r] = 7;
bgst[bsn] = 1;
bgsx[bsn] = bgx[r] + 10;
bgsy[bsn] = bgy[r] + 30;
bgsd[bsn] = 1;
bsn = bsn + 1;
if (bsn > 5) {
bsn = 1;
}
}
}
if (bgd[r] == 1) {
f[r] = 2;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 0;
bgs[r] = 20;
}
}
if (bgd[r] == 3) {
f[r] = 4;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 2;
bgs[r] = 20;
}
}
if (bgd[r] == 4) {
if (bgs[r] == 4) {
f[r] = 5;
}
if (bgs[r] == 3) {
f[r] = 6;
}
if (bgs[r] == 2) {
f[r] = 7;
}
if (bgs[r] == 1) {
f[r] = 8;
}
bgy[r] = bgy[r] - 10;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
f[r] = 9;
bgt[r] = 0;
bgx[r] = -500;
bgs[r] = 0;
}
}
}
if (bgt[r] == 2) {
if (((((((bgx[r] - 15) < (px + 10)) and ((bgx[r] + 15) > (px - 10))) and ((bgy[r] + 80) > (py - 10))) and ((bgy[r] + 50) < (py + 50))) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 3;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 3;
}
megah.start();
i = 10;
}
if (bgd[r] == 0) {
f[r] = 1;
if (px < bgx[r]) {
bgd[r] = 3;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 1;
bgs[r] = 10;
}
}
if (bgd[r] == 3) {
f[r] = 5;
if (px > bgx[r]) {
bgd[r] = 0;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 4;
bgs[r] = 10;
}
}
if (bgd[r] == 1) {
f[r] = 2;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 2;
bgs[r] = 12;
}
}
if (bgd[r] == 2) {
if (((bgs[r] == 12) or (bgs[r] == 11)) or (bgs[r] == 10)) {
f[r] = 3;
}
if (((bgs[r] == 9) or (bgs[r] == 8)) or (bgs[r] == 7)) {
f[r] = 4;
}
if (((bgs[r] == 6) or (bgs[r] == 5)) or (bgs[r] == 4)) {
f[r] = 3;
}
if (((bgs[r] == 3) or (bgs[r] == 2)) or (bgs[r] == 1)) {
f[r] = 4;
}
bgx[r] = bgx[r] + 8;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 0;
bgs[r] = 10 + random(20);
}
}
if (bgd[r] == 4) {
f[r] = 6;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 5;
bgs[r] = 12;
}
}
if (bgd[r] == 5) {
if (((bgs[r] == 12) or (bgs[r] == 11)) or (bgs[r] == 10)) {
f[r] = 7;
}
if (((bgs[r] == 9) or (bgs[r] == 8)) or (bgs[r] == 7)) {
f[r] = 8;
}
if (((bgs[r] == 6) or (bgs[r] == 5)) or (bgs[r] == 4)) {
f[r] = 7;
}
if (((bgs[r] == 3) or (bgs[r] == 2)) or (bgs[r] == 1)) {
f[r] = 8;
}
bgx[r] = bgx[r] - 8;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 3;
bgs[r] = 10 + random(20);
}
}
if (bgd[r] == 6) {
if (bgs[r] == 6) {
f[r] = 9;
}
if (bgs[r] == 5) {
f[r] = 10;
}
if (bgs[r] == 4) {
f[r] = 11;
}
if (bgs[r] == 3) {
f[r] = 12;
}
if (bgs[r] == 2) {
f[r] = 13;
}
if (bgs[r] == 1) {
f[r] = 14;
}
bgs[r] = bgs[r] - 1;
bgy[r] = bgy[r] - 10;
if (bgs[r] <= 0) {
f[r] = 15;
bgt[r] = 0;
bgx[r] = -500;
bgs[r] = 0;
}
}
}
if (bgt[r] == 3) {
if ((((((((bgx[r] - 20) < (px + 10)) and ((bgx[r] + 20) > (px - 10))) and ((bgy[r] + 60) > (py + 5))) and ((bgy[r] + 40) < (py + 45))) and (pcd < 18)) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 4;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 4;
}
megah.start();
i = 10;
}
if (bgd[r] == 0) {
if ((bgs[r] == 0) or (bgs[r] == 1)) {
f[r] = 1;
}
if ((bgs[r] == 2) or (bgs[r] == 3)) {
f[r] = 2;
}
if ((bgs[r] == 4) or (bgs[r] == 5)) {
f[r] = 3;
}
if ((bgs[r] == 6) or (bgs[r] == 7)) {
f[r] = 4;
}
if ((bgs[r] == 8) or (bgs[r] == 9)) {
f[r] = 5;
}
if ((bgs[r] == 10) or (bgs[r] == 11)) {
f[r] = 6;
}
if (px < bgx[r]) {
bgx[r] = bgx[r] - 5;
}
if (px > bgx[r]) {
bgx[r] = bgx[r] + 5;
}
if ((py - 20) > bgy[r]) {
bgy[r] = bgy[r] - 5;
}
if ((py - 20) < bgy[r]) {
bgy[r] = bgy[r] - 15;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgs[r] = 11;
}
}
if (bgd[r] == 1) {
if (bgs[r] == 4) {
f[r] = 7;
}
if (bgs[r] == 3) {
f[r] = 8;
}
if (bgs[r] == 2) {
f[r] = 9;
}
if (bgs[r] == 1) {
f[r] = 10;
}
bgs[r] = bgs[r] - 1;
bgy[r] = bgy[r] - 10;
if (bgs[r] <= 0) {
bgx[r] = -500;
f[r] = 11;
bgt[r] = 0;
bgs[r] = 0;
}
}
}
if (bgt[r] == 5) {
if (((((((bgx[r] - 20) < (px + 10)) and ((bgx[r] + 20) > (px - 10))) and ((bgy[r] + 80) > (py + 10))) and ((bgy[r] + 30) < (py + 50))) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 3;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 3;
}
megah.start();
i = 10;
}
if (bgd[r] == 0) {
f[r] = 1;
if (px < bgx[r]) {
bgd[r] = 2;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
cannons.start();
bgd[r] = 1;
bgs[r] = 8;
bgst[bsn] = 2;
bgsx[bsn] = bgx[r] - 20;
bgsy[bsn] = bgy[r] + 20;
bgsd[bsn] = 0;
bsn = bsn + 1;
if (bsn > 5) {
bsn = 1;
}
}
}
if (bgd[r] == 2) {
f[r] = 3;
if (px > bgx[r]) {
bgd[r] = 0;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
cannons.start();
bgd[r] = 3;
bgs[r] = 7;
bgst[bsn] = 2;
bgsx[bsn] = bgx[r] + 20;
bgsy[bsn] = bgy[r] + 20;
bgsd[bsn] = 1;
bsn = bsn + 1;
if (bsn > 5) {
bsn = 1;
}
}
}
if (bgd[r] == 1) {
f[r] = 2;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 0;
bgs[r] = 10 + random(15);
}
}
if (bgd[r] == 3) {
f[r] = 4;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 2;
bgs[r] = 10 + random(15);
}
}
if (bgd[r] == 4) {
if (bgs[r] == 5) {
f[r] = 5;
}
if (bgs[r] == 4) {
f[r] = 6;
}
if (bgs[r] == 3) {
f[r] = 7;
}
if (bgs[r] == 2) {
f[r] = 8;
}
if (bgs[r] == 1) {
f[r] = 9;
}
bgs[r] = bgs[r] - 1;
bgy[r] = bgy[r] - 10;
if (bgs[r] <= 0) {
f[r] = 10;
bgt[r] = 0;
bgx[r] = -500;
bgs[r] = 0;
}
}
}
}
r++;
}
r = 1;
while (r <= 5) {
if (bgst[r] > 0) {
if (bgst[r] == 1) {
if (r == 1) {
bgs1.gotoAndStop(1);
}
if (r == 2) {
bgs2.gotoAndStop(1);
}
if (r == 3) {
bgs3.gotoAndStop(1);
}
if (r == 4) {
bgs4.gotoAndStop(1);
}
if (r == 5) {
bgs5.gotoAndStop(1);
}
if (bgsd[r] == 0) {
bgsx[r] = bgsx[r] + 20;
if (bgsx[r] > (px + 300)) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgsd[r] == 1) {
bgsx[r] = bgsx[r] - 20;
if (bgsx[r] < (px - 300)) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgsd[r] == 2) {
bgsx[r] = bgsx[r] + 15;
bgsy[r] = bgsy[r] + 15;
if ((bgsx[r] > (px + 300)) or (bgsy[r] > (py + 300))) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgsd[r] == 3) {
bgsx[r] = bgsx[r] - 15;
bgsy[r] = bgsy[r] + 15;
if ((bgsx[r] > (px + 300)) or (bgsy[r] > (py + 300))) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgsd[r] == 4) {
bgsy[r] = bgsy[r] + 20;
if (bgsy[r] > (py + 300)) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (((((((bgsx[r] - 15) < (px + 10)) and ((bgsx[r] + 15) > (px - 10))) and ((bgsy[r] + 15) > (py + 5))) and ((bgsy[r] - 15) < (py + 20))) and (pcd < 18)) and (i < 1)) {
if ((bgsd[r] == 0) or (bgsd[r] == 2)) {
pcd = 19;
}
if ((bgsd[r] == 1) or (bgsd[r] == 3)) {
pcd = 18;
}
pstep = 2;
pl = pl - 3;
megah.start();
i = 10;
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgst[r] == 2) {
if (r == 1) {
bgs1.gotoAndStop(2);
}
if (r == 2) {
bgs2.gotoAndStop(2);
}
if (r == 3) {
bgs3.gotoAndStop(2);
}
if (r == 4) {
bgs4.gotoAndStop(2);
}
if (r == 5) {
bgs5.gotoAndStop(2);
}
if (bgsd[r] == 0) {
bgsx[r] = bgsx[r] + 30;
if (bgsx[r] > (px + 300)) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgsd[r] == 1) {
bgsx[r] = bgsx[r] - 30;
if (bgsx[r] < (px - 300)) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (((((((bgsx[r] - 25) < (px + 10)) and ((bgsx[r] + 25) > (px - 10))) and ((bgsy[r] + 80) > (py + 40))) and ((bgsy[r] + 35) < (py + 60))) and (pcd < 18)) and (i < 1)) {
if (bgsd[r] == 0) {
pcd = 19;
}
if (bgsd[r] == 1) {
pcd = 18;
}
pstep = 2;
pl = pl - 6;
megah.start();
i = 10;
bgst[r] = 0;
bgsx[r] = -200;
}
}
}
r++;
}
bg1.gotoAndStop(f[1]);
bg2.gotoAndStop(f[2]);
bg3.gotoAndStop(f[3]);
bg4.gotoAndStop(f[4]);
bg5.gotoAndStop(f[5]);
bg6.gotoAndStop(f[6]);
bg7.gotoAndStop(f[7]);
bg8.gotoAndStop(f[8]);
bgs1._x = ((bgsx[1] + 275) - px) / 2;
bgs1._y = ((bgsy[1] + 275) - py) / 2;
bgs2._x = ((bgsx[2] + 275) - px) / 2;
bgs2._y = ((bgsy[2] + 275) - py) / 2;
bgs3._x = ((bgsx[3] + 275) - px) / 2;
bgs3._y = ((bgsy[3] + 275) - py) / 2;
bgs4._x = ((bgsx[4] + 275) - px) / 2;
bgs4._y = ((bgsy[4] + 275) - py) / 2;
bgs5._x = ((bgsx[5] + 275) - px) / 2;
bgs5._y = ((bgsy[5] + 275) - py) / 2;
bg1._x = ((bgx[1] + 275) - px) / 2;
bg1._y = ((bgy[1] + 275) - py) / 2;
bg2._x = ((bgx[2] + 275) - px) / 2;
bg2._y = ((bgy[2] + 275) - py) / 2;
bg3._x = ((bgx[3] + 275) - px) / 2;
bg3._y = ((bgy[3] + 275) - py) / 2;
bg4._x = ((bgx[4] + 275) - px) / 2;
bg4._y = ((bgy[4] + 275) - py) / 2;
bg5._x = ((bgx[5] + 275) - px) / 2;
bg5._y = ((bgy[5] + 275) - py) / 2;
bg6._x = ((bgx[6] + 275) - px) / 2;
bg6._y = ((bgy[6] + 275) - py) / 2;
bg7._x = ((bgx[7] + 275) - px) / 2;
bg7._y = ((bgy[7] + 275) - py) / 2;
bg8._x = ((bgx[8] + 275) - px) / 2;
bg8._y = ((bgy[8] + 275) - py) / 2;
r = 1;
while (r <= 3) {
if (((pst[r] > 0) and (pst[r] < 4)) and (psd[r] == 0)) {
if (r == 1) {
shot1p._x = ((297 + psx[1]) - px) / 2;
shot1p._y = ((270 + psy[1]) - py) / 2;
}
if (r == 2) {
shot2p._x = ((297 + psx[2]) - px) / 2;
shot2p._y = ((270 + psy[2]) - py) / 2;
}
if (r == 3) {
shot3p._x = ((297 + psx[3]) - px) / 2;
shot3p._y = ((270 + psy[3]) - py) / 2;
}
}
if (((pst[r] > 0) and (pst[r] < 4)) and (psd[r] == 1)) {
if (r == 1) {
shot1p._x = ((247 + psx[1]) - px) / 2;
shot1p._y = ((270 + psy[1]) - py) / 2;
}
if (r == 2) {
shot2p._x = ((247 + psx[2]) - px) / 2;
shot2p._y = ((270 + psy[2]) - py) / 2;
}
if (r == 3) {
shot3p._x = ((247 + psx[3]) - px) / 2;
shot3p._y = ((270 + psy[3]) - py) / 2;
}
}
if ((pst[r] == 4) or (pst[r] == 5)) {
if (r == 1) {
shot1p._x = ((272 + psx[1]) - px) / 2;
shot1p._y = ((270 + psy[1]) - py) / 2;
}
if (r == 2) {
shot2p._x = ((272 + psx[2]) - px) / 2;
shot2p._y = ((270 + psy[2]) - py) / 2;
}
if (r == 3) {
shot3p._x = ((272 + psx[3]) - px) / 2;
shot3p._y = ((270 + psy[3]) - py) / 2;
}
}
if (pst[r] == 0) {
if (r == 1) {
shot1p._x = -200;
shot1p._y = (270 + psy[1]) - py;
}
if (r == 2) {
shot2p._x = -200;
shot2p._y = (270 + psy[2]) - py;
}
if (r == 3) {
shot3p._x = -200;
shot3p._y = (270 + psy[3]) - py;
}
}
r++;
}
if (i > 0) {
i = i - 1;
pc._alpha = 50;
}
if (i <= 0) {
i = i - 1;
pc._alpha = 100;
}
if (bcharge > 0) {
charge._alpha = bcharge;
}
lbar._height = 2 * pl;
lbar._y = 120 - (2 * pl);
stage._x = (270 - px) / 2;
stage._y = (375 - py) / 2;
exit._x = ((ex + 275) - px) / 2;
exit._y = ((ey + 275) - py) / 2;
Frame 23
gotoAndPlay (22);
if ((((px + 10) > (ex - 20)) and ((px - 10) < (ex + 20))) and (((py + 30) > (ey - 20)) and (py < (ey + 50)))) {
gotoAndPlay (24);
}
Frame 24
pc.gotoAndStop(1);
lbar._height = 2 * pl;
lbar._y = 120 - (2 * pl);
stage._x = (270 - px) / 2;
stage._y = (375 - py) / 2;
exit._x = ((ex + 275) - px) / 2;
exit._y = ((ey + 275) - py) / 2;
Frame 27
psn = 1;
bstep = 0;
pcd = 0;
bcharge = 0;
r = 1;
while (r <= 5) {
psx[r] = -200;
psy[r] = 0;
pst[r] = 0;
psd[r] = 0;
r++;
}
i = 0;
pl = pl + 5;
if (pl > 50) {
pl = 50;
}
px = 150;
py = 245;
r = 0;
while (r <= 26) {
bx[r] = -50;
by[r] = -50;
r++;
}
bx[1] = 50;
by[1] = 150;
bx[2] = 50;
by[2] = 250;
bx[3] = 150;
by[3] = 350;
bx[4] = 250;
by[4] = 350;
bx[5] = 350;
by[5] = 300;
bx[6] = 450;
by[6] = 300;
bx[7] = 550;
by[7] = 300;
bx[8] = 800;
by[8] = 300;
bx[9] = 1000;
by[9] = 250;
bx[10] = 1100;
by[10] = 250;
bx[11] = 1150;
by[11] = 350;
bx[12] = 1350;
by[12] = 450;
bx[13] = 1450;
by[13] = 450;
bx[14] = 1550;
by[14] = 450;
bx[15] = 1650;
by[15] = 350;
bx[16] = 1550;
by[16] = 250;
bx[17] = 1550;
by[17] = 150;
bsn = 1;
r = 1;
while (r <= 8) {
bgx[r] = -200;
bgy[r] = -200;
bgt[r] = 0;
bgd[r] = -1;
bgs[r] = 0;
r++;
}
r = 1;
while (r <= 5) {
bgsx[r] = -200;
bgsy[r] = 0;
bgst[r] = 0;
bgsd[r] = 0;
r++;
}
r = 1;
while (r <= 8) {
f[r] = 20;
r++;
}
bgt[1] = 12;
bgd[1] = 0;
bgs[1] = 0;
bgl[1] = 2;
bgx[1] = 450;
bgy[1] = 150;
bgt[2] = 3;
bgd[2] = 0;
bgs[2] = 0;
bgl[2] = 3;
bgx[2] = 450;
bgy[2] = 0;
bgt[3] = 1;
bgd[3] = 2;
bgs[3] = 0;
bgl[3] = 2;
bgx[3] = 500;
bgy[3] = 200;
bgt[4] = 10;
bgd[4] = 0;
bgs[4] = 0;
bgl[4] = 3;
bgx[4] = 600;
bgy[4] = 100;
bgt[5] = 10;
bgd[5] = 0;
bgs[5] = 0;
bgl[5] = 3;
bgx[5] = 850;
bgy[5] = 100;
bgt[6] = 12;
bgd[6] = 1;
bgs[6] = 0;
bgl[6] = 2;
bgx[6] = 1000;
bgy[6] = 150;
bgt[7] = 12;
bgd[7] = 0;
bgs[7] = 0;
bgl[7] = 2;
bgx[7] = 1100;
bgy[7] = 100;
ex = 1550;
ey = 350;
Frame 28
b1._x = bx[1] / 10;
b1._y = (by[1] / 10) + 120;
b2._x = bx[2] / 10;
b2._y = (by[2] / 10) + 120;
b3._x = bx[3] / 10;
b3._y = (by[3] / 10) + 120;
b4._x = bx[4] / 10;
b4._y = (by[4] / 10) + 120;
b5._x = bx[5] / 10;
b5._y = (by[5] / 10) + 120;
b6._x = bx[6] / 10;
b6._y = (by[6] / 10) + 120;
b7._x = bx[7] / 10;
b7._y = (by[7] / 10) + 120;
b8._x = bx[8] / 10;
b8._y = (by[8] / 10) + 120;
b9._x = bx[9] / 10;
b9._y = (by[9] / 10) + 120;
b10._x = bx[10] / 10;
b10._y = (by[10] / 10) + 120;
b11._x = bx[11] / 10;
b11._y = (by[11] / 10) + 120;
b12._x = bx[12] / 10;
b12._y = (by[12] / 10) + 120;
b13._x = bx[13] / 10;
b13._y = (by[13] / 10) + 120;
b14._x = bx[14] / 10;
b14._y = (by[14] / 10) + 120;
b15._x = bx[15] / 10;
b15._y = (by[15] / 10) + 120;
b16._x = bx[16] / 10;
b16._y = (by[16] / 10) + 120;
b17._x = bx[17] / 10;
b17._y = (by[17] / 10) + 120;
b18._x = bx[18] / 10;
b18._y = (by[18] / 10) + 120;
b19._x = bx[19] / 10;
b19._y = (by[19] / 10) + 120;
b20._x = bx[20] / 10;
b20._y = (by[20] / 10) + 120;
b21._x = bx[21] / 10;
b21._y = (by[21] / 10) + 120;
b22._x = bx[22] / 10;
b22._y = (by[22] / 10) + 120;
b23._x = bx[23] / 10;
b23._y = (by[23] / 10) + 120;
b24._x = bx[24] / 10;
b24._y = (by[24] / 10) + 120;
b25._x = bx[25] / 10;
b25._y = (by[25] / 10) + 120;
b26._x = bx[26] / 10;
b26._y = (by[26] / 10) + 120;
b27._x = bx[27] / 10;
b27._y = (by[27] / 10) + 120;
b28._x = bx[28] / 10;
b28._y = (by[28] / 10) + 120;
cir._x = px / 10;
cir._y = (py / 10) + 120;
shot1._x = psx[1] / 10;
shot1._y = (psy[1] / 10) + 120;
shot2._x = psx[2] / 10;
shot2._y = (psy[2] / 10) + 120;
shot3._x = psx[3] / 10;
shot3._y = (psy[3] / 10) + 120;
bshot1._x = bgsx[1] / 10;
bshot1._y = (bgsy[1] / 10) + 120;
bshot2._x = bgsx[2] / 10;
bshot2._y = (bgsy[2] / 10) + 120;
bshot3._x = bgsx[3] / 10;
bshot3._y = (bgsy[3] / 10) + 120;
bshot4._x = bgsx[4] / 10;
bshot4._y = (bgsy[4] / 10) + 120;
bshot5._x = bgsx[5] / 10;
bshot5._y = (bgsy[5] / 10) + 120;
bcir1._x = bgx[1] / 10;
bcir1._y = (bgy[1] / 10) + 120;
bcir2._x = bgx[2] / 10;
bcir2._y = (bgy[2] / 10) + 120;
bcir3._x = bgx[3] / 10;
bcir3._y = (bgy[3] / 10) + 120;
bcir4._x = bgx[4] / 10;
bcir4._y = (bgy[4] / 10) + 120;
bcir5._x = bgx[5] / 10;
bcir5._y = (bgy[5] / 10) + 120;
bcir6._x = bgx[6] / 10;
bcir6._y = (bgy[6] / 10) + 120;
bcir7._x = bgx[7] / 10;
bcir7._y = (bgy[7] / 10) + 120;
bcir8._x = bgx[8] / 10;
bcir8._y = (bgy[8] / 10) + 120;
bcir9._x = bgx[9] / 10;
bcir9._y = (bgy[9] / 10) + 120;
bcir10._x = bgx[10] / 10;
bcir10._y = (bgy[10] / 10) + 120;
bcir11._x = bgx[11] / 10;
bcir11._y = (bgy[11] / 10) + 120;
bcir12._x = bgx[12] / 10;
bcir12._y = (bgy[12] / 10) + 120;
bcir13._x = bgx[13] / 10;
bcir13._y = (bgy[13] / 10) + 120;
if (Key.isDown(39) and (pcd == 0)) {
pcd = 2;
}
if (Key.isDown(39) and ((pcd == 1) or (pcd == 3))) {
pcd = 0;
}
if (Key.isDown(37) and (pcd == 1)) {
pcd = 3;
}
if (Key.isDown(37) and ((pcd == 0) or (pcd == 2))) {
pcd = 1;
}
if (Key.isDown(38) and ((pcd == 0) or (pcd == 2))) {
pcd = 10;
pstep = 7;
}
if (Key.isDown(38) and ((pcd == 1) or (pcd == 3))) {
pcd = 11;
pstep = 7;
}
if (Key.isDown(40) and ((((pcd == 0) or (pcd == 1)) or (pcd == 2)) or (pcd == 3))) {
if (((pcd == 0) or (pcd == 2)) or (pcd == 8)) {
pcd = 6;
pstep = 3;
}
if (((pcd == 1) or (pcd == 3)) or (pcd == 9)) {
pcd = 7;
pstep = 3;
}
}
if (Key.isDown(16) and (bcharge < 100)) {
bcharge = bcharge + 5;
}
if (pcd == 0) {
pc.gotoAndStop(1);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(21);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 0;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
}
if (pcd == 1) {
pc.gotoAndStop(2);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(22);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 1;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
}
if (pcd == 2) {
px = px + 13;
if ((w == 0) or (w == 1)) {
pc.gotoAndStop(3);
}
if ((w == 2) or (w == 3)) {
pc.gotoAndStop(4);
}
if ((w == 4) or (w == 5)) {
pc.gotoAndStop(5);
}
if ((w == 6) or (w == 7)) {
pc.gotoAndStop(6);
}
if (Key.isDown(32)) {
if ((w == 0) or (w == 1)) {
pc.gotoAndStop(11);
}
if ((w == 2) or (w == 3)) {
pc.gotoAndStop(12);
}
if ((w == 4) or (w == 5)) {
pc.gotoAndStop(13);
}
if ((w == 6) or (w == 7)) {
pc.gotoAndStop(14);
}
if ((pst[psn] == 0) and (bstep == 0)) {
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 0;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
}
pcd = 0;
}
if (pcd == 3) {
px = px - 13;
if ((w == 0) or (w == 1)) {
pc.gotoAndStop(7);
}
if ((w == 2) or (w == 3)) {
pc.gotoAndStop(8);
}
if ((w == 4) or (w == 5)) {
pc.gotoAndStop(9);
}
if ((w == 6) or (w == 7)) {
pc.gotoAndStop(10);
}
if (Key.isDown(32)) {
if ((w == 0) or (w == 1)) {
pc.gotoAndStop(15);
}
if ((w == 2) or (w == 3)) {
pc.gotoAndStop(16);
}
if ((w == 4) or (w == 5)) {
pc.gotoAndStop(17);
}
if ((w == 6) or (w == 7)) {
pc.gotoAndStop(18);
}
if ((pst[psn] == 0) and (bstep == 0)) {
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 1;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
}
pcd = 1;
}
if (pcd == 9) {
pstep = pstep - 1;
if (pstep <= 0) {
pcd = 1;
}
}
if (pcd == 6) {
pc.gotoAndStop(19);
px = px + 20;
pstep = pstep - 1;
if (pstep <= 0) {
pcd = 0;
}
}
if (pcd == 7) {
pc.gotoAndStop(20);
px = px - 20;
pstep = pstep - 1;
if (pstep <= 0) {
pcd = 1;
}
}
if (pcd == 12) {
pc.gotoAndStop(23);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(25);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 0;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
py = py + (5 * (7 - pstep));
pstep = pstep - 1;
if (pstep <= 2) {
pstep = 2;
}
if (Key.isDown(39)) {
px = px + 13;
}
if (Key.isDown(37)) {
px = px - 13;
if (bstep == 0) {
pcd = 13;
}
}
}
if (pcd == 13) {
pc.gotoAndStop(24);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(26);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 1;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
py = py + (5 * (7 - pstep));
pstep = pstep - 1;
if (pstep <= 2) {
pstep = 2;
}
if (Key.isDown(39)) {
px = px + 13;
if (bstep == 0) {
pcd = 12;
}
}
if (Key.isDown(37)) {
px = px - 13;
}
}
if (pcd == 10) {
pc.gotoAndStop(23);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(25);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 0;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
py = py - (5 * pstep);
pstep = pstep - 1;
if (Key.isDown(39)) {
px = px + 13;
}
if (Key.isDown(37)) {
px = px - 13;
if (bstep == 0) {
pcd = 11;
}
}
if (Key.isDown(40)) {
pcd = 12;
pstep = pstep + 3;
}
if (pstep <= -1) {
pstep = 7;
pcd = 12;
}
}
if (pcd == 11) {
pc.gotoAndStop(24);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(26);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 1;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
py = py - (5 * pstep);
pstep = pstep - 1;
if (Key.isDown(39)) {
px = px + 13;
if (bstep == 0) {
pcd = 10;
}
}
if (Key.isDown(37)) {
px = px - 13;
}
if (Key.isDown(40)) {
pcd = 13;
pstep = pstep + 3;
}
if (pstep <= -1) {
pstep = 7;
pcd = 13;
}
}
if (pcd == 18) {
pc.gotoAndStop(27);
pstep = pstep - 1;
px = px - 5;
if (pstep <= -1) {
pstep = 2;
pcd = 0;
}
}
if (pcd == 19) {
pc.gotoAndStop(28);
pstep = pstep - 1;
px = px + 5;
if (pstep <= -1) {
pstep = 2;
pcd = 1;
}
}
if (pcd == 20) {
pc.gotoAndStop(69 - pstep);
bcharge = 0;
charge._alpha = 0;
bstep = 20;
pl = 1;
pstep = pstep - 1;
if (pstep < 0) {
lives = lives - 1;
if (lives >= 0) {
pl = 50;
gotoAndPlay (10);
}
if (lives < 0) {
lives = 2;
continues = continues - 1;
gotoAndPlay (5);
}
}
}
if (pl <= 0) {
c = 1;
while (c <= 8) {
bgx[c] = -600;
c++;
}
pc._alpha = 100;
pcd = 20;
pstep = 40;
megad.start();
}
if (bstep > 0) {
bcharge = 0;
charge._alpha = bcharge;
}
if (bstep > 0) {
bstep = bstep - 1;
}
if ((py > 500) and (pcd < 20)) {
megad.start();
pl = 0;
}
w = w - 1;
if (w < 0) {
w = 7;
}
e = pcd;
c = 0;
r = 1;
while (r <= 17) {
if (((((bx[r] - 150) < px) and ((bx[r] + 150) > px)) and ((by[r] - 150) < py)) and ((by[r] + 150) > py)) {
if (((((((px - 30) < (bx[r] + 50)) and ((px + 20) > (bx[r] - 50))) and (py < (by[r] - 50))) and ((py + 60) > (by[r] - 50))) and (pcd != 10)) and (pcd != 11)) {
if ((((pcd == 12) or (pcd == 13)) or (pcd == 16)) or (pcd == 17)) {
if ((pcd == 12) or (pcd == 16)) {
pcd = 0;
}
if ((pcd == 13) or (pcd == 17)) {
pcd = 1;
}
}
c = 1;
py = by[r] - 75;
}
if (((((px + 38) > (bx[r] - 50)) and ((px + 20) < bx[r])) and (py < (by[r] + 50))) and ((py + 20) > (by[r] - 50))) {
px = bx[r] - 85;
}
if (((((px - 35) < (bx[r] + 50)) and ((px - 20) > bx[r])) and (py < (by[r] + 50))) and ((py + 20) > (by[r] - 50))) {
px = bx[r] + 85;
}
if (((((px - 5) < (bx[r] + 50)) and ((px + 5) > (bx[r] - 50))) and ((py - 30) < (by[r] + 50))) and ((py + 10) > (by[r] + 50))) {
if ((((pcd == 10) or (pcd == 11)) or (pcd == 14)) or (pcd == 15)) {
if ((pcd == 10) or (pcd == 14)) {
pcd = 12;
pstep = 5;
}
if ((pcd == 11) or (pcd == 15)) {
pcd = 13;
pstep = 5;
}
}
py = by[r] + 90;
}
}
r++;
}
if (c == 0) {
if ((((pcd == 0) or (pcd == 2)) or (pcd == 6)) or (pcd == 18)) {
pcd = 12;
pstep = 6;
}
if ((((pcd == 1) or (pcd == 3)) or (pcd == 7)) or (pcd == 19)) {
pcd = 13;
pstep = 6;
}
}
r = 1;
while (r <= 3) {
if (pst[r] == 1) {
if (psd[r] == 0) {
psx[r] = psx[r] + 30;
if (r == 1) {
shot1p.gotoAndStop(1);
}
if (r == 2) {
shot2p.gotoAndStop(1);
}
if (r == 3) {
shot3p.gotoAndStop(1);
}
if (psx[r] > (px + 280)) {
pst[r] = 0;
psx[r] = -200;
}
}
if (psd[r] == 1) {
psx[r] = psx[r] - 30;
if (r == 1) {
shot1p.gotoAndStop(2);
}
if (r == 2) {
shot2p.gotoAndStop(2);
}
if (r == 3) {
shot3p.gotoAndStop(2);
}
if (psx[r] < (px - 280)) {
pst[r] = 0;
psx[r] = -200;
}
}
}
if (pst[r] == 2) {
if (psd[r] == 0) {
psx[r] = psx[r] + 35;
if (r == 1) {
shot1p.gotoAndStop(3);
}
if (r == 2) {
shot2p.gotoAndStop(3);
}
if (r == 3) {
shot3p.gotoAndStop(3);
}
if (psx[r] > (px + 280)) {
pst[r] = 0;
psx[r] = -200;
}
}
if (psd[r] == 1) {
psx[r] = psx[r] - 35;
if (r == 1) {
shot1p.gotoAndStop(4);
}
if (r == 2) {
shot2p.gotoAndStop(4);
}
if (r == 3) {
shot3p.gotoAndStop(4);
}
if (psx[r] < (px - 280)) {
pst[r] = 0;
psx[r] = -200;
}
}
}
if (pst[r] == 3) {
if (psd[r] == 0) {
psx[r] = psx[r] + 40;
if (r == 1) {
shot1p.gotoAndStop(5);
}
if (r == 2) {
shot2p.gotoAndStop(5);
}
if (r == 3) {
shot3p.gotoAndStop(5);
}
if (psx[r] > (px + 280)) {
pst[r] = 0;
psx[r] = -200;
}
}
if (psd[r] == 1) {
psx[r] = psx[r] - 40;
if (r == 1) {
shot1p.gotoAndStop(6);
}
if (r == 2) {
shot2p.gotoAndStop(6);
}
if (r == 3) {
shot3p.gotoAndStop(6);
}
if (psx[r] < (px - 280)) {
pst[r] = 0;
psx[r] = -200;
}
}
}
if (pst[r] == 4) {
if (r == 1) {
shot1p.gotoAndStop(10 - psd[r]);
}
if (r == 2) {
shot2p.gotoAndStop(10 - psd[r]);
}
if (r == 3) {
shot3p.gotoAndStop(10 - psd[r]);
}
psd[r] = psd[r] - 1;
if (psd[r] < 0) {
pst[r] = 0;
psx[r] = -200;
}
}
if (pst[r] == 5) {
if (r == 1) {
shot1p.gotoAndStop(14 - psd[r]);
}
if (r == 2) {
shot2p.gotoAndStop(14 - psd[r]);
}
if (r == 3) {
shot3p.gotoAndStop(14 - psd[r]);
}
psd[r] = psd[r] - 1;
if (psd[r] < 0) {
pst[r] = 0;
psx[r] = -200;
}
}
r++;
}
while (c <= 7) {
r = 1;
while (r <= 3) {
if ((pst[r] > 0) and (pst[r] < 4)) {
if (((((bgt[c] == 1) and ((bgx[c] - 35) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 35) > (psx[r] - ((pst[r] * 20) - 20)))) and ((bgy[c] - 5) < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 50) > (psy[r] - ((pst[r] * 20) - 20)))) {
if ((bgd[c] == 0) or (bgd[c] == 2)) {
deflect.start();
pst[r] = 5;
psd[r] = 2;
}
if ((bgd[c] == 1) or (bgd[c] == 3)) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd2.start();
bgd[c] = 4;
bgs[c] = 4;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
if (((((bgt[c] == 3) and ((bgx[c] - 35) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 35) > (psx[r] - ((pst[r] * 20) - 20)))) and ((bgy[c] - 20) < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 40) > (psy[r] - ((pst[r] * 20) - 20)))) {
if (bgd[c] == 0) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd2.start();
bgd[c] = 1;
bgs[c] = 4;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
if (((((bgt[c] == 10) and ((bgx[c] - 20) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 20) > (psx[r] - ((pst[r] * 20) - 20)))) and ((bgy[c] - 50) < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 20) > (psy[r] - ((pst[r] * 20) - 20)))) {
if ((bgd[c] == 0) or (bgd[c] == 1)) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd2.start();
bgd[c] = 2;
bgs[c] = 3;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
if (((((bgt[c] == 12) and ((bgx[c] - 25) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 25) > (psx[r] - ((pst[r] * 20) - 20)))) and (bgy[c] < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 50) > (psy[r] - ((pst[r] * 20) - 20)))) {
if ((bgd[c] == 0) or (bgd[c] == 1)) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd2.start();
bgd[c] = 2;
bgs[c] = 3;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
}
r++;
}
c++;
}
r = 1;
while (r <= 7) {
if (((((bgt[r] > 0) and ((bgx[r] - 340) < px)) and ((bgx[r] + 340) > px)) and ((bgy[r] - 180) < py)) and ((bgy[r] + 350) > py)) {
c = 0;
e = 1;
while (e <= 17) {
if (((((bx[e] - 150) < bgx[r]) and ((bx[e] + 150) > bgx[r])) and ((by[e] - 150) < bgy[r])) and ((by[e] + 150) > bgy[r])) {
if (((((bgx[r] + 20) >= (bx[e] - 50)) and ((bgx[r] - 20) <= (bx[e] + 50))) and ((bgy[r] + 45) > (by[e] - 60))) and ((bgy[r] - 10) < (by[e] - 40))) {
c = 1;
}
if (((((bgx[r] + 20) > (bx[e] - 50)) and ((bgx[r] + 20) < bx[e])) and (bgy[r] < (by[e] + 50))) and ((bgy[r] + 20) > (by[e] - 50))) {
bgx[r] = bx[e] - 70;
}
if (((((bgx[r] - 20) < (bx[e] + 50)) and ((bgx[r] + 20) > bx[e])) and (bgy[r] < (by[e] + 50))) and ((bgy[r] + 20) > (by[e] - 50))) {
bgx[r] = bx[e] + 70;
}
if (((((bgx[r] - 5) < (bx[e] + 50)) and ((bgx[r] + 5) > (bx[e] - 50))) and ((bgy[r] - 30) < (by[e] + 50))) and (bgy[r] > (by[e] + 50))) {
bgy[r] = by[e] + 70;
}
if (((((bgx[r] - 2) < (bx[e] + 50)) and ((bgx[r] + 2) > (bx[e] - 50))) and ((bgy[r] + 20) < (by[e] - 50))) and ((bgy[r] + 60) > (by[e] - 50))) {
c = 1;
bgy[r] = by[e] - 105;
}
}
e++;
}
if (c == 0) {
bgy[r] = bgy[r] + 10;
}
if (bgt[r] == 1) {
if (((((((bgx[r] - 10) < (px + 10)) and ((bgx[r] + 10) > (px - 10))) and ((bgy[r] + 80) > (py + 10))) and ((bgy[r] + 50) < (py + 50))) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 4;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 4;
}
megah.start();
i = 10;
}
if (bgd[r] == 0) {
f[r] = 1;
if (px < bgx[r]) {
bgd[r] = 2;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
joes.start();
bgd[r] = 1;
bgs[r] = 7;
bgst[bsn] = 1;
bgsx[bsn] = bgx[r] - 10;
bgsy[bsn] = bgy[r] + 30;
bgsd[bsn] = 0;
bsn = bsn + 1;
if (bsn > 5) {
bsn = 1;
}
}
}
if (bgd[r] == 2) {
f[r] = 3;
if (px > bgx[r]) {
bgd[r] = 0;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
joes.start();
bgd[r] = 3;
bgs[r] = 7;
bgst[bsn] = 1;
bgsx[bsn] = bgx[r] + 10;
bgsy[bsn] = bgy[r] + 30;
bgsd[bsn] = 1;
bsn = bsn + 1;
if (bsn > 5) {
bsn = 1;
}
}
}
if (bgd[r] == 1) {
f[r] = 2;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 0;
bgs[r] = 20;
}
}
if (bgd[r] == 3) {
f[r] = 4;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 2;
bgs[r] = 20;
}
}
if (bgd[r] == 4) {
if (bgs[r] == 4) {
f[r] = 5;
}
if (bgs[r] == 3) {
f[r] = 6;
}
if (bgs[r] == 2) {
f[r] = 7;
}
if (bgs[r] == 1) {
f[r] = 8;
}
bgy[r] = bgy[r] - 10;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
f[r] = 9;
bgt[r] = 0;
bgx[r] = -500;
bgs[r] = 0;
}
}
}
if (bgt[r] == 3) {
if ((((((((bgx[r] - 20) < (px + 10)) and ((bgx[r] + 20) > (px - 10))) and ((bgy[r] + 60) > (py + 5))) and ((bgy[r] + 40) < (py + 45))) and (pcd < 18)) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 4;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 4;
}
megah.start();
i = 10;
}
if (bgd[r] == 0) {
if ((bgs[r] == 0) or (bgs[r] == 1)) {
f[r] = 1;
}
if ((bgs[r] == 2) or (bgs[r] == 3)) {
f[r] = 2;
}
if ((bgs[r] == 4) or (bgs[r] == 5)) {
f[r] = 3;
}
if ((bgs[r] == 6) or (bgs[r] == 7)) {
f[r] = 4;
}
if ((bgs[r] == 8) or (bgs[r] == 9)) {
f[r] = 5;
}
if ((bgs[r] == 10) or (bgs[r] == 11)) {
f[r] = 6;
}
if (px < bgx[r]) {
bgx[r] = bgx[r] - 5;
}
if (px > bgx[r]) {
bgx[r] = bgx[r] + 5;
}
if ((py - 20) > bgy[r]) {
bgy[r] = bgy[r] - 5;
}
if ((py - 20) < bgy[r]) {
bgy[r] = bgy[r] - 15;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgs[r] = 11;
}
}
if (bgd[r] == 1) {
if (bgs[r] == 4) {
f[r] = 7;
}
if (bgs[r] == 3) {
f[r] = 8;
}
if (bgs[r] == 2) {
f[r] = 9;
}
if (bgs[r] == 1) {
f[r] = 10;
}
bgs[r] = bgs[r] - 1;
bgy[r] = bgy[r] - 10;
if (bgs[r] <= 0) {
bgx[r] = -500;
f[r] = 11;
bgt[r] = 0;
bgs[r] = 0;
}
}
}
if (bgt[r] == 10) {
if (((((((bgx[r] - 20) < (px + 10)) and ((bgx[r] + 20) > (px - 10))) and ((bgy[r] + 20) > (py + 10))) and ((bgy[r] + 20) < (py + 50))) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 2;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 2;
}
megah.start();
i = 10;
}
if (bgd[r] == 0) {
f[r] = 1;
bgy[r] = bgy[r] - 10;
if (px < bgx[r]) {
bgx[r] = bgx[r] - 7;
}
if (px > bgx[r]) {
bgx[r] = bgx[r] + 7;
}
if ((py - 80) < bgy[r]) {
bgy[r] = bgy[r] - 8;
}
if ((py - 80) > bgy[r]) {
bgy[r] = bgy[r] + 8;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
joes.start();
bgd[r] = 1;
bgsd[bsn] = 4;
bgs[r] = 5;
bgst[bsn] = 1;
bgsx[bsn] = bgx[r];
bgsy[bsn] = bgy[r];
bsn = bsn + 1;
if (bsn > 5) {
bsn = 1;
}
}
}
if (bgd[r] == 1) {
f[r] = 2;
bgy[r] = bgy[r] - 10;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 0;
bgs[r] = 6 + random(16);
}
}
if (bgd[r] == 2) {
if (bgs[r] == 3) {
f[r] = 3;
}
if (bgs[r] == 2) {
f[r] = 4;
}
if (bgs[r] == 1) {
f[r] = 5;
}
bgs[r] = bgs[r] - 1;
bgy[r] = bgy[r] - 10;
if (bgs[r] <= 0) {
f[r] = 7;
bgt[r] = 0;
bgx[r] = -500;
bgs[r] = 0;
}
}
}
if (bgt[r] == 12) {
if (((((((bgx[r] - 20) < (px + 10)) and ((bgx[r] + 20) > (px - 10))) and ((bgy[r] + 40) > py)) and ((bgy[r] - 20) < (py + 50))) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 3;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 3;
}
megah.start();
i = 10;
}
if (bgd[r] == 0) {
if (bgs[r] == 1) {
f[r] = 1;
}
if (bgs[r] == 2) {
f[r] = 2;
}
bgy[r] = bgy[r] - 10;
bgx[r] = bgx[r] + 7;
if ((py - 60) < bgy[r]) {
bgy[r] = bgy[r] - 5;
}
if ((((px - 70) < bgx[r]) and ((px + 70) > bgx[r])) and (py > bgy[r])) {
bgy[r] = bgy[r] + 12;
}
if ((px + 100) < bgx[r]) {
bgd[r] = 1;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgs[r] = 2;
}
}
if (bgd[r] == 1) {
if (bgs[r] == 1) {
f[r] = 3;
}
if (bgs[r] == 2) {
f[r] = 4;
}
bgy[r] = bgy[r] - 10;
bgx[r] = bgx[r] - 7;
if ((py - 60) < bgy[r]) {
bgy[r] = bgy[r] - 5;
}
if ((((px - 70) < bgx[r]) and ((px + 70) > bgx[r])) and (py > bgy[r])) {
bgy[r] = bgy[r] + 12;
}
if ((px - 100) > bgx[r]) {
bgd[r] = 0;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgs[r] = 2;
}
}
if (bgd[r] == 2) {
if (bgs[r] == 4) {
f[r] = 5;
}
if (bgs[r] == 3) {
f[r] = 6;
}
if (bgs[r] == 2) {
f[r] = 7;
}
if (bgs[r] == 1) {
f[r] = 8;
}
bgs[r] = bgs[r] - 1;
bgy[r] = bgy[r] - 10;
if (bgs[r] <= 0) {
bgx[r] = -500;
f[r] = 9;
bgt[r] = 0;
bgs[r] = 0;
}
}
}
}
r++;
}
r = 1;
while (r <= 5) {
if (bgst[r] > 0) {
if (bgst[r] == 1) {
if (r == 1) {
bgs1.gotoAndStop(1);
}
if (r == 2) {
bgs2.gotoAndStop(1);
}
if (r == 3) {
bgs3.gotoAndStop(1);
}
if (r == 4) {
bgs4.gotoAndStop(1);
}
if (r == 5) {
bgs5.gotoAndStop(1);
}
if (bgsd[r] == 0) {
bgsx[r] = bgsx[r] + 20;
if (bgsx[r] > (px + 300)) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgsd[r] == 1) {
bgsx[r] = bgsx[r] - 20;
if (bgsx[r] < (px - 300)) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgsd[r] == 2) {
bgsx[r] = bgsx[r] + 15;
bgsy[r] = bgsy[r] + 15;
if ((bgsx[r] > (px + 300)) or (bgsy[r] > (py + 300))) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgsd[r] == 3) {
bgsx[r] = bgsx[r] - 15;
bgsy[r] = bgsy[r] + 15;
if ((bgsx[r] > (px + 300)) or (bgsy[r] > (py + 300))) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgsd[r] == 4) {
bgsy[r] = bgsy[r] + 20;
if (bgsy[r] > (py + 300)) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (((((((bgsx[r] - 15) < (px + 10)) and ((bgsx[r] + 15) > (px - 10))) and ((bgsy[r] + 15) > (py + 5))) and ((bgsy[r] - 15) < (py + 20))) and (pcd < 18)) and (i < 1)) {
if ((bgsd[r] == 0) or (bgsd[r] == 2)) {
pcd = 19;
}
if ((bgsd[r] == 1) or (bgsd[r] == 3)) {
pcd = 18;
}
pstep = 2;
pl = pl - 3;
megah.start();
i = 10;
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgst[r] == 2) {
if (r == 1) {
bgs1.gotoAndStop(2);
}
if (r == 2) {
bgs2.gotoAndStop(2);
}
if (r == 3) {
bgs3.gotoAndStop(2);
}
if (r == 4) {
bgs4.gotoAndStop(2);
}
if (r == 5) {
bgs5.gotoAndStop(2);
}
if (bgsd[r] == 0) {
bgsx[r] = bgsx[r] + 30;
if (bgsx[r] > (px + 300)) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgsd[r] == 1) {
bgsx[r] = bgsx[r] - 30;
if (bgsx[r] < (px - 300)) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (((((((bgsx[r] - 25) < (px + 10)) and ((bgsx[r] + 25) > (px - 10))) and ((bgsy[r] + 80) > (py + 40))) and ((bgsy[r] + 35) < (py + 60))) and (pcd < 18)) and (i < 1)) {
if (bgsd[r] == 0) {
pcd = 19;
}
if (bgsd[r] == 1) {
pcd = 18;
}
pstep = 2;
pl = pl - 6;
megah.start();
i = 10;
bgst[r] = 0;
bgsx[r] = -200;
}
}
}
r++;
}
bg1.gotoAndStop(f[1]);
bg2.gotoAndStop(f[2]);
bg3.gotoAndStop(f[3]);
bg4.gotoAndStop(f[4]);
bg5.gotoAndStop(f[5]);
bg6.gotoAndStop(f[6]);
bg7.gotoAndStop(f[7]);
bgs1._x = ((bgsx[1] + 275) - px) / 2;
bgs1._y = ((bgsy[1] + 275) - py) / 2;
bgs2._x = ((bgsx[2] + 275) - px) / 2;
bgs2._y = ((bgsy[2] + 275) - py) / 2;
bgs3._x = ((bgsx[3] + 275) - px) / 2;
bgs3._y = ((bgsy[3] + 275) - py) / 2;
bgs4._x = ((bgsx[4] + 275) - px) / 2;
bgs4._y = ((bgsy[4] + 275) - py) / 2;
bgs5._x = ((bgsx[5] + 275) - px) / 2;
bgs5._y = ((bgsy[5] + 275) - py) / 2;
bg1._x = ((bgx[1] + 275) - px) / 2;
bg1._y = ((bgy[1] + 275) - py) / 2;
bg2._x = ((bgx[2] + 275) - px) / 2;
bg2._y = ((bgy[2] + 275) - py) / 2;
bg3._x = ((bgx[3] + 275) - px) / 2;
bg3._y = ((bgy[3] + 275) - py) / 2;
bg4._x = ((bgx[4] + 275) - px) / 2;
bg4._y = ((bgy[4] + 275) - py) / 2;
bg5._x = ((bgx[5] + 275) - px) / 2;
bg5._y = ((bgy[5] + 275) - py) / 2;
bg6._x = ((bgx[6] + 275) - px) / 2;
bg6._y = ((bgy[6] + 275) - py) / 2;
bg7._x = ((bgx[7] + 275) - px) / 2;
bg7._y = ((bgy[7] + 275) - py) / 2;
r = 1;
while (r <= 3) {
if (((pst[r] > 0) and (pst[r] < 4)) and (psd[r] == 0)) {
if (r == 1) {
shot1p._x = ((297 + psx[1]) - px) / 2;
shot1p._y = ((270 + psy[1]) - py) / 2;
}
if (r == 2) {
shot2p._x = ((297 + psx[2]) - px) / 2;
shot2p._y = ((270 + psy[2]) - py) / 2;
}
if (r == 3) {
shot3p._x = ((297 + psx[3]) - px) / 2;
shot3p._y = ((270 + psy[3]) - py) / 2;
}
}
if (((pst[r] > 0) and (pst[r] < 4)) and (psd[r] == 1)) {
if (r == 1) {
shot1p._x = ((247 + psx[1]) - px) / 2;
shot1p._y = ((270 + psy[1]) - py) / 2;
}
if (r == 2) {
shot2p._x = ((247 + psx[2]) - px) / 2;
shot2p._y = ((270 + psy[2]) - py) / 2;
}
if (r == 3) {
shot3p._x = ((247 + psx[3]) - px) / 2;
shot3p._y = ((270 + psy[3]) - py) / 2;
}
}
if ((pst[r] == 4) or (pst[r] == 5)) {
if (r == 1) {
shot1p._x = ((272 + psx[1]) - px) / 2;
shot1p._y = ((270 + psy[1]) - py) / 2;
}
if (r == 2) {
shot2p._x = ((272 + psx[2]) - px) / 2;
shot2p._y = ((270 + psy[2]) - py) / 2;
}
if (r == 3) {
shot3p._x = ((272 + psx[3]) - px) / 2;
shot3p._y = ((270 + psy[3]) - py) / 2;
}
}
if (pst[r] == 0) {
if (r == 1) {
shot1p._x = -200;
shot1p._y = (270 + psy[1]) - py;
}
if (r == 2) {
shot2p._x = -200;
shot2p._y = (270 + psy[2]) - py;
}
if (r == 3) {
shot3p._x = -200;
shot3p._y = (270 + psy[3]) - py;
}
}
r++;
}
if (i > 0) {
i = i - 1;
pc._alpha = 50;
}
if (i <= 0) {
i = i - 1;
pc._alpha = 100;
}
if (bcharge > 0) {
charge._alpha = bcharge;
}
lbar._height = 2 * pl;
lbar._y = 120 - (2 * pl);
stage._x = (270 - px) / 2;
stage._y = (275 - py) / 2;
exit._x = ((ex + 275) - px) / 2;
exit._y = ((ey + 275) - py) / 2;
Frame 29
gotoAndPlay (28);
if ((((px + 10) > (ex - 20)) and ((px - 10) < (ex + 20))) and (((py + 30) > (ey - 20)) and (py < (ey + 50)))) {
gotoAndPlay (30);
}
Frame 30
pc.gotoAndStop(1);
lbar._height = 2 * pl;
lbar._y = 120 - (2 * pl);
stage._x = (270 - px) / 2;
stage._y = (275 - py) / 2;
exit._x = ((ex + 275) - px) / 2;
exit._y = ((ey + 275) - py) / 2;
Frame 33
psn = 1;
bstep = 0;
pcd = 0;
bcharge = 0;
r = 1;
while (r <= 5) {
psx[r] = -200;
psy[r] = 0;
pst[r] = 0;
psd[r] = 0;
r++;
}
i = 0;
pl = pl + 5;
if (pl > 50) {
pl = 50;
}
px = 150;
py = -845;
r = 0;
while (r <= 31) {
bx[r] = -50;
by[r] = -50;
r++;
}
bx[1] = 50;
by[1] = -950;
bx[2] = 50;
by[2] = -850;
bx[3] = 150;
by[3] = -750;
bx[4] = 250;
by[4] = -750;
bx[5] = 650;
by[5] = -750;
bx[6] = 350;
by[6] = -650;
bx[7] = 650;
by[7] = -650;
bx[8] = 550;
by[8] = -550;
bx[9] = 450;
by[9] = -450;
bx[10] = 350;
by[10] = -450;
bx[11] = 250;
by[11] = -450;
bx[12] = 650;
by[12] = -350;
bx[13] = 250;
by[13] = -250;
bx[14] = 350;
by[14] = -250;
bx[15] = 650;
by[15] = -250;
bx[16] = 450;
by[16] = -150;
bx[17] = 650;
by[17] = -150;
bx[18] = 450;
by[18] = -50;
bx[19] = 650;
by[19] = -50;
bx[20] = 450;
by[20] = 50;
bx[21] = 650;
by[21] = 50;
bx[22] = 450;
by[22] = 150;
bx[23] = 650;
by[23] = 150;
bx[24] = 450;
by[24] = 250;
bx[25] = 650;
by[25] = 250;
bx[26] = 750;
by[26] = 250;
bx[27] = 450;
by[27] = 350;
bx[28] = 850;
by[28] = 350;
bx[29] = 450;
by[29] = 450;
bx[30] = 650;
by[30] = 450;
bx[31] = 750;
by[31] = 450;
bsn = 1;
r = 1;
while (r <= 8) {
bgx[r] = -200;
bgy[r] = -200;
bgt[r] = 0;
bgd[r] = -1;
bgs[r] = 0;
r++;
}
r = 1;
while (r <= 5) {
bgsx[r] = -200;
bgsy[r] = 0;
bgst[r] = 0;
bgsd[r] = 0;
r++;
}
r = 1;
while (r <= 8) {
f[r] = 20;
r++;
}
bgt[1] = 3;
bgd[1] = 0;
bgs[1] = 0;
bgl[1] = 3;
bgx[1] = 450;
bgy[1] = -1000;
bgt[2] = 3;
bgd[2] = 0;
bgs[2] = 0;
bgl[2] = 3;
bgx[2] = 550;
bgy[2] = -950;
bgt[3] = 6;
bgd[3] = 0;
bgs[3] = 0;
bgl[3] = 2;
bgx[3] = 175;
bgy[3] = -650;
bgt[4] = 3;
bgd[4] = 0;
bgs[4] = 0;
bgl[4] = 3;
bgx[4] = -50;
bgy[4] = -350;
bgt[5] = 3;
bgd[5] = 0;
bgs[5] = 0;
bgl[5] = 3;
bgx[5] = 550;
bgy[5] = -250;
ex = 750;
ey = 350;
Frame 34
b1._x = bx[1] / 10;
b1._y = (by[1] / 10) + 120;
b2._x = bx[2] / 10;
b2._y = (by[2] / 10) + 120;
b3._x = bx[3] / 10;
b3._y = (by[3] / 10) + 120;
b4._x = bx[4] / 10;
b4._y = (by[4] / 10) + 120;
b5._x = bx[5] / 10;
b5._y = (by[5] / 10) + 120;
b6._x = bx[6] / 10;
b6._y = (by[6] / 10) + 120;
b7._x = bx[7] / 10;
b7._y = (by[7] / 10) + 120;
b8._x = bx[8] / 10;
b8._y = (by[8] / 10) + 120;
b9._x = bx[9] / 10;
b9._y = (by[9] / 10) + 120;
b10._x = bx[10] / 10;
b10._y = (by[10] / 10) + 120;
b11._x = bx[11] / 10;
b11._y = (by[11] / 10) + 120;
b12._x = bx[12] / 10;
b12._y = (by[12] / 10) + 120;
b13._x = bx[13] / 10;
b13._y = (by[13] / 10) + 120;
b14._x = bx[14] / 10;
b14._y = (by[14] / 10) + 120;
b15._x = bx[15] / 10;
b15._y = (by[15] / 10) + 120;
b16._x = bx[16] / 10;
b16._y = (by[16] / 10) + 120;
b17._x = bx[17] / 10;
b17._y = (by[17] / 10) + 120;
b18._x = bx[18] / 10;
b18._y = (by[18] / 10) + 120;
b19._x = bx[19] / 10;
b19._y = (by[19] / 10) + 120;
b20._x = bx[20] / 10;
b20._y = (by[20] / 10) + 120;
b21._x = bx[21] / 10;
b21._y = (by[21] / 10) + 120;
b22._x = bx[22] / 10;
b22._y = (by[22] / 10) + 120;
b23._x = bx[23] / 10;
b23._y = (by[23] / 10) + 120;
b24._x = bx[24] / 10;
b24._y = (by[24] / 10) + 120;
b25._x = bx[25] / 10;
b25._y = (by[25] / 10) + 120;
b26._x = bx[26] / 10;
b26._y = (by[26] / 10) + 120;
b27._x = bx[27] / 10;
b27._y = (by[27] / 10) + 120;
b28._x = bx[28] / 10;
b28._y = (by[28] / 10) + 120;
b29._x = bx[29] / 10;
b29._y = (by[29] / 10) + 120;
b30._x = bx[30] / 10;
b30._y = (by[30] / 10) + 120;
b31._x = bx[31] / 10;
b31._y = (by[31] / 10) + 120;
cir._x = px / 10;
cir._y = (py / 10) + 120;
shot1._x = psx[1] / 10;
shot1._y = (psy[1] / 10) + 120;
shot2._x = psx[2] / 10;
shot2._y = (psy[2] / 10) + 120;
shot3._x = psx[3] / 10;
shot3._y = (psy[3] / 10) + 120;
bshot1._x = bgsx[1] / 10;
bshot1._y = (bgsy[1] / 10) + 120;
bshot2._x = bgsx[2] / 10;
bshot2._y = (bgsy[2] / 10) + 120;
bshot3._x = bgsx[3] / 10;
bshot3._y = (bgsy[3] / 10) + 120;
bshot4._x = bgsx[4] / 10;
bshot4._y = (bgsy[4] / 10) + 120;
bshot5._x = bgsx[5] / 10;
bshot5._y = (bgsy[5] / 10) + 120;
bcir1._x = bgx[1] / 10;
bcir1._y = (bgy[1] / 10) + 120;
bcir2._x = bgx[2] / 10;
bcir2._y = (bgy[2] / 10) + 120;
bcir3._x = bgx[3] / 10;
bcir3._y = (bgy[3] / 10) + 120;
bcir4._x = bgx[4] / 10;
bcir4._y = (bgy[4] / 10) + 120;
bcir5._x = bgx[5] / 10;
bcir5._y = (bgy[5] / 10) + 120;
bcir6._x = bgx[6] / 10;
bcir6._y = (bgy[6] / 10) + 120;
bcir7._x = bgx[7] / 10;
bcir7._y = (bgy[7] / 10) + 120;
bcir8._x = bgx[8] / 10;
bcir8._y = (bgy[8] / 10) + 120;
bcir9._x = bgx[9] / 10;
bcir9._y = (bgy[9] / 10) + 120;
bcir10._x = bgx[10] / 10;
bcir10._y = (bgy[10] / 10) + 120;
bcir11._x = bgx[11] / 10;
bcir11._y = (bgy[11] / 10) + 120;
bcir12._x = bgx[12] / 10;
bcir12._y = (bgy[12] / 10) + 120;
bcir13._x = bgx[13] / 10;
bcir13._y = (bgy[13] / 10) + 120;
if (Key.isDown(39) and (pcd == 0)) {
pcd = 2;
}
if (Key.isDown(39) and ((pcd == 1) or (pcd == 3))) {
pcd = 0;
}
if (Key.isDown(37) and (pcd == 1)) {
pcd = 3;
}
if (Key.isDown(37) and ((pcd == 0) or (pcd == 2))) {
pcd = 1;
}
if (Key.isDown(38) and ((pcd == 0) or (pcd == 2))) {
pcd = 10;
pstep = 7;
}
if (Key.isDown(38) and ((pcd == 1) or (pcd == 3))) {
pcd = 11;
pstep = 7;
}
if (Key.isDown(40) and ((((pcd == 0) or (pcd == 1)) or (pcd == 2)) or (pcd == 3))) {
if (((pcd == 0) or (pcd == 2)) or (pcd == 8)) {
pcd = 6;
pstep = 3;
}
if (((pcd == 1) or (pcd == 3)) or (pcd == 9)) {
pcd = 7;
pstep = 3;
}
}
if (Key.isDown(16) and (bcharge < 100)) {
bcharge = bcharge + 5;
}
if (pcd == 0) {
pc.gotoAndStop(1);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(21);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 0;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
}
if (pcd == 1) {
pc.gotoAndStop(2);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(22);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 1;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
}
if (pcd == 2) {
px = px + 13;
if ((w == 0) or (w == 1)) {
pc.gotoAndStop(3);
}
if ((w == 2) or (w == 3)) {
pc.gotoAndStop(4);
}
if ((w == 4) or (w == 5)) {
pc.gotoAndStop(5);
}
if ((w == 6) or (w == 7)) {
pc.gotoAndStop(6);
}
if (Key.isDown(32)) {
if ((w == 0) or (w == 1)) {
pc.gotoAndStop(11);
}
if ((w == 2) or (w == 3)) {
pc.gotoAndStop(12);
}
if ((w == 4) or (w == 5)) {
pc.gotoAndStop(13);
}
if ((w == 6) or (w == 7)) {
pc.gotoAndStop(14);
}
if ((pst[psn] == 0) and (bstep == 0)) {
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 0;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
}
pcd = 0;
}
if (pcd == 3) {
px = px - 13;
if ((w == 0) or (w == 1)) {
pc.gotoAndStop(7);
}
if ((w == 2) or (w == 3)) {
pc.gotoAndStop(8);
}
if ((w == 4) or (w == 5)) {
pc.gotoAndStop(9);
}
if ((w == 6) or (w == 7)) {
pc.gotoAndStop(10);
}
if (Key.isDown(32)) {
if ((w == 0) or (w == 1)) {
pc.gotoAndStop(15);
}
if ((w == 2) or (w == 3)) {
pc.gotoAndStop(16);
}
if ((w == 4) or (w == 5)) {
pc.gotoAndStop(17);
}
if ((w == 6) or (w == 7)) {
pc.gotoAndStop(18);
}
if ((pst[psn] == 0) and (bstep == 0)) {
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 1;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
}
pcd = 1;
}
if (pcd == 9) {
pstep = pstep - 1;
if (pstep <= 0) {
pcd = 1;
}
}
if (pcd == 6) {
pc.gotoAndStop(19);
px = px + 20;
pstep = pstep - 1;
if (pstep <= 0) {
pcd = 0;
}
}
if (pcd == 7) {
pc.gotoAndStop(20);
px = px - 20;
pstep = pstep - 1;
if (pstep <= 0) {
pcd = 1;
}
}
if (pcd == 12) {
pc.gotoAndStop(23);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(25);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 0;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
py = py + (5 * (7 - pstep));
pstep = pstep - 1;
if (pstep <= 2) {
pstep = 2;
}
if (Key.isDown(39)) {
px = px + 13;
}
if (Key.isDown(37)) {
px = px - 13;
if (bstep == 0) {
pcd = 13;
}
}
}
if (pcd == 13) {
pc.gotoAndStop(24);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(26);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 1;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
py = py + (5 * (7 - pstep));
pstep = pstep - 1;
if (pstep <= 2) {
pstep = 2;
}
if (Key.isDown(39)) {
px = px + 13;
if (bstep == 0) {
pcd = 12;
}
}
if (Key.isDown(37)) {
px = px - 13;
}
}
if (pcd == 10) {
pc.gotoAndStop(23);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(25);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 0;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
py = py - (5 * pstep);
pstep = pstep - 1;
if (Key.isDown(39)) {
px = px + 13;
}
if (Key.isDown(37)) {
px = px - 13;
if (bstep == 0) {
pcd = 11;
}
}
if (Key.isDown(40)) {
pcd = 12;
pstep = pstep + 3;
}
if (pstep <= -1) {
pstep = 7;
pcd = 12;
}
}
if (pcd == 11) {
pc.gotoAndStop(24);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(26);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 1;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
py = py - (5 * pstep);
pstep = pstep - 1;
if (Key.isDown(39)) {
px = px + 13;
if (bstep == 0) {
pcd = 10;
}
}
if (Key.isDown(37)) {
px = px - 13;
}
if (Key.isDown(40)) {
pcd = 13;
pstep = pstep + 3;
}
if (pstep <= -1) {
pstep = 7;
pcd = 13;
}
}
if (pcd == 18) {
pc.gotoAndStop(27);
pstep = pstep - 1;
px = px - 5;
if (pstep <= -1) {
pstep = 2;
pcd = 0;
}
}
if (pcd == 19) {
pc.gotoAndStop(28);
pstep = pstep - 1;
px = px + 5;
if (pstep <= -1) {
pstep = 2;
pcd = 1;
}
}
if (pcd == 20) {
pc.gotoAndStop(69 - pstep);
bcharge = 0;
charge._alpha = 0;
bstep = 20;
pl = 1;
pstep = pstep - 1;
if (pstep < 0) {
lives = lives - 1;
if (lives >= 0) {
pl = 50;
gotoAndPlay (10);
}
if (lives < 0) {
lives = 2;
continues = continues - 1;
gotoAndPlay (5);
}
}
}
if (pl <= 0) {
c = 1;
while (c <= 8) {
bgx[c] = -600;
c++;
}
pc._alpha = 100;
pcd = 20;
pstep = 40;
megad.start();
}
if (bstep > 0) {
bcharge = 0;
charge._alpha = bcharge;
}
if (bstep > 0) {
bstep = bstep - 1;
}
if ((py > 500) and (pcd < 20)) {
megad.start();
pl = 0;
}
w = w - 1;
if (w < 0) {
w = 7;
}
e = pcd;
c = 0;
r = 1;
while (r <= 31) {
if (((((bx[r] - 150) < px) and ((bx[r] + 150) > px)) and ((by[r] - 150) < py)) and ((by[r] + 150) > py)) {
if (((((((px - 30) < (bx[r] + 50)) and ((px + 20) > (bx[r] - 50))) and (py < (by[r] - 50))) and ((py + 60) > (by[r] - 50))) and (pcd != 10)) and (pcd != 11)) {
if ((((pcd == 12) or (pcd == 13)) or (pcd == 16)) or (pcd == 17)) {
if ((pcd == 12) or (pcd == 16)) {
pcd = 0;
}
if ((pcd == 13) or (pcd == 17)) {
pcd = 1;
}
}
c = 1;
py = by[r] - 75;
}
if (((((px + 38) > (bx[r] - 50)) and ((px + 20) < bx[r])) and (py < (by[r] + 50))) and ((py + 20) > (by[r] - 50))) {
px = bx[r] - 85;
}
if (((((px - 35) < (bx[r] + 50)) and ((px - 20) > bx[r])) and (py < (by[r] + 50))) and ((py + 20) > (by[r] - 50))) {
px = bx[r] + 85;
}
if (((((px - 5) < (bx[r] + 50)) and ((px + 5) > (bx[r] - 50))) and ((py - 30) < (by[r] + 50))) and ((py + 10) > (by[r] + 50))) {
if ((((pcd == 10) or (pcd == 11)) or (pcd == 14)) or (pcd == 15)) {
if ((pcd == 10) or (pcd == 14)) {
pcd = 12;
pstep = 5;
}
if ((pcd == 11) or (pcd == 15)) {
pcd = 13;
pstep = 5;
}
}
py = by[r] + 90;
}
}
r++;
}
if (c == 0) {
if ((((pcd == 0) or (pcd == 2)) or (pcd == 6)) or (pcd == 18)) {
pcd = 12;
pstep = 6;
}
if ((((pcd == 1) or (pcd == 3)) or (pcd == 7)) or (pcd == 19)) {
pcd = 13;
pstep = 6;
}
}
r = 1;
while (r <= 3) {
if (pst[r] == 1) {
if (psd[r] == 0) {
psx[r] = psx[r] + 30;
if (r == 1) {
shot1p.gotoAndStop(1);
}
if (r == 2) {
shot2p.gotoAndStop(1);
}
if (r == 3) {
shot3p.gotoAndStop(1);
}
if (psx[r] > (px + 280)) {
pst[r] = 0;
psx[r] = -200;
}
}
if (psd[r] == 1) {
psx[r] = psx[r] - 30;
if (r == 1) {
shot1p.gotoAndStop(2);
}
if (r == 2) {
shot2p.gotoAndStop(2);
}
if (r == 3) {
shot3p.gotoAndStop(2);
}
if (psx[r] < (px - 280)) {
pst[r] = 0;
psx[r] = -200;
}
}
}
if (pst[r] == 2) {
if (psd[r] == 0) {
psx[r] = psx[r] + 35;
if (r == 1) {
shot1p.gotoAndStop(3);
}
if (r == 2) {
shot2p.gotoAndStop(3);
}
if (r == 3) {
shot3p.gotoAndStop(3);
}
if (psx[r] > (px + 280)) {
pst[r] = 0;
psx[r] = -200;
}
}
if (psd[r] == 1) {
psx[r] = psx[r] - 35;
if (r == 1) {
shot1p.gotoAndStop(4);
}
if (r == 2) {
shot2p.gotoAndStop(4);
}
if (r == 3) {
shot3p.gotoAndStop(4);
}
if (psx[r] < (px - 280)) {
pst[r] = 0;
psx[r] = -200;
}
}
}
if (pst[r] == 3) {
if (psd[r] == 0) {
psx[r] = psx[r] + 40;
if (r == 1) {
shot1p.gotoAndStop(5);
}
if (r == 2) {
shot2p.gotoAndStop(5);
}
if (r == 3) {
shot3p.gotoAndStop(5);
}
if (psx[r] > (px + 280)) {
pst[r] = 0;
psx[r] = -200;
}
}
if (psd[r] == 1) {
psx[r] = psx[r] - 40;
if (r == 1) {
shot1p.gotoAndStop(6);
}
if (r == 2) {
shot2p.gotoAndStop(6);
}
if (r == 3) {
shot3p.gotoAndStop(6);
}
if (psx[r] < (px - 280)) {
pst[r] = 0;
psx[r] = -200;
}
}
}
if (pst[r] == 4) {
if (r == 1) {
shot1p.gotoAndStop(10 - psd[r]);
}
if (r == 2) {
shot2p.gotoAndStop(10 - psd[r]);
}
if (r == 3) {
shot3p.gotoAndStop(10 - psd[r]);
}
psd[r] = psd[r] - 1;
if (psd[r] < 0) {
pst[r] = 0;
psx[r] = -200;
}
}
if (pst[r] == 5) {
if (r == 1) {
shot1p.gotoAndStop(14 - psd[r]);
}
if (r == 2) {
shot2p.gotoAndStop(14 - psd[r]);
}
if (r == 3) {
shot3p.gotoAndStop(14 - psd[r]);
}
psd[r] = psd[r] - 1;
if (psd[r] < 0) {
pst[r] = 0;
psx[r] = -200;
}
}
r++;
}
while (c <= 5) {
r = 1;
while (r <= 3) {
if ((pst[r] > 0) and (pst[r] < 4)) {
if (((((bgt[c] == 3) and ((bgx[c] - 35) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 35) > (psx[r] - ((pst[r] * 20) - 20)))) and ((bgy[c] - 20) < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 40) > (psy[r] - ((pst[r] * 20) - 20)))) {
if (bgd[c] == 0) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd2.start();
bgd[c] = 1;
bgs[c] = 4;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
if (((((bgt[c] == 6) and ((bgx[c] - 35) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 35) > (psx[r] - ((pst[r] * 20) - 20)))) and ((bgy[c] - 50) < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 20) > (psy[r] - ((pst[r] * 20) - 20)))) {
if ((bgd[c] == 0) or (bgd[c] == 1)) {
deflect.start();
pst[r] = 5;
psd[r] = 2;
}
if (bgd[c] == 2) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd2.start();
bgd[c] = 3;
bgs[c] = 4;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
}
r++;
}
c++;
}
r = 1;
while (r <= 5) {
if (((((bgt[r] > 0) and ((bgx[r] - 340) < px)) and ((bgx[r] + 340) > px)) and ((bgy[r] - 180) < py)) and ((bgy[r] + 350) > py)) {
c = 0;
e = 1;
while (e <= 31) {
if (((((bx[e] - 150) < bgx[r]) and ((bx[e] + 150) > bgx[r])) and ((by[e] - 150) < bgy[r])) and ((by[e] + 150) > bgy[r])) {
if (((((bgx[r] + 20) >= (bx[e] - 50)) and ((bgx[r] - 20) <= (bx[e] + 50))) and ((bgy[r] + 45) > (by[e] - 60))) and ((bgy[r] - 10) < (by[e] - 40))) {
c = 1;
}
if (((((bgx[r] + 20) > (bx[e] - 50)) and ((bgx[r] + 20) < bx[e])) and (bgy[r] < (by[e] + 50))) and ((bgy[r] + 20) > (by[e] - 50))) {
bgx[r] = bx[e] - 70;
}
if (((((bgx[r] - 20) < (bx[e] + 50)) and ((bgx[r] + 20) > bx[e])) and (bgy[r] < (by[e] + 50))) and ((bgy[r] + 20) > (by[e] - 50))) {
bgx[r] = bx[e] + 70;
}
if (((((bgx[r] - 5) < (bx[e] + 50)) and ((bgx[r] + 5) > (bx[e] - 50))) and ((bgy[r] - 30) < (by[e] + 50))) and (bgy[r] > (by[e] + 50))) {
bgy[r] = by[e] + 70;
}
if (((((bgx[r] - 2) < (bx[e] + 50)) and ((bgx[r] + 2) > (bx[e] - 50))) and ((bgy[r] + 20) < (by[e] - 50))) and ((bgy[r] + 60) > (by[e] - 50))) {
c = 1;
bgy[r] = by[e] - 105;
}
}
e++;
}
if (c == 0) {
bgy[r] = bgy[r] + 10;
}
if (bgt[r] == 3) {
if ((((((((bgx[r] - 20) < (px + 10)) and ((bgx[r] + 20) > (px - 10))) and ((bgy[r] + 60) > (py + 5))) and ((bgy[r] + 40) < (py + 45))) and (pcd < 18)) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 4;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 4;
}
megah.start();
i = 10;
}
if (bgd[r] == 0) {
if ((bgs[r] == 0) or (bgs[r] == 1)) {
f[r] = 1;
}
if ((bgs[r] == 2) or (bgs[r] == 3)) {
f[r] = 2;
}
if ((bgs[r] == 4) or (bgs[r] == 5)) {
f[r] = 3;
}
if ((bgs[r] == 6) or (bgs[r] == 7)) {
f[r] = 4;
}
if ((bgs[r] == 8) or (bgs[r] == 9)) {
f[r] = 5;
}
if ((bgs[r] == 10) or (bgs[r] == 11)) {
f[r] = 6;
}
if (px < bgx[r]) {
bgx[r] = bgx[r] - 5;
}
if (px > bgx[r]) {
bgx[r] = bgx[r] + 5;
}
if ((py - 20) > bgy[r]) {
bgy[r] = bgy[r] - 5;
}
if ((py - 20) < bgy[r]) {
bgy[r] = bgy[r] - 15;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgs[r] = 11;
}
}
if (bgd[r] == 1) {
if (bgs[r] == 4) {
f[r] = 7;
}
if (bgs[r] == 3) {
f[r] = 8;
}
if (bgs[r] == 2) {
f[r] = 9;
}
if (bgs[r] == 1) {
f[r] = 10;
}
bgs[r] = bgs[r] - 1;
bgy[r] = bgy[r] - 10;
if (bgs[r] <= 0) {
bgx[r] = -500;
f[r] = 11;
bgt[r] = 0;
bgs[r] = 0;
}
}
}
if (bgt[r] == 6) {
if (((((((bgx[r] - 10) < (px + 10)) and ((bgx[r] + 10) > (px - 10))) and ((bgy[r] + 50) > (py + 10))) and ((bgy[r] + 10) < (py + 50))) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 4;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 4;
}
megah.start();
i = 10;
}
if (bgd[r] == 0) {
f[r] = 1;
bgy[r] = bgy[r] - 10;
if (((((px - 120) < bgx[r]) and ((px + 120) > bgx[r])) and ((bgy[r] - 80) < py)) and ((bgy[r] + 150) > py)) {
bgd[r] = 1;
bgs[r] = 6;
}
}
if (bgd[r] == 1) {
bgy[r] = bgy[r] - 10;
if (((bgs[r] == 6) or (bgs[r] == 5)) or (bgs[r] == 4)) {
f[r] = 2;
}
if (((bgs[r] == 3) or (bgs[r] == 2)) or (bgs[r] == 1)) {
f[r] = 3;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgs[r] = 4;
bgd[r] = 2;
}
}
if (bgd[r] == 2) {
if ((bgs[r] == 4) or (bgs[r] == 3)) {
f[r] = 4;
}
if ((bgs[r] == 2) or (bgs[r] == 1)) {
f[r] = 5;
}
if (px < bgx[r]) {
bgx[r] = (bgx[r] - 1) - random(10);
}
if (px > bgx[r]) {
bgx[r] = (bgx[r] + 1) + random(10);
}
if (py > bgy[r]) {
bgy[r] = bgy[r] + random(8);
}
if (py < bgy[r]) {
bgy[r] = (bgy[r] - 10) - random(10);
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgs[r] = 4;
}
}
if (bgd[r] == 3) {
if (bgs[r] == 4) {
f[r] = 6;
}
if (bgs[r] == 3) {
f[r] = 7;
}
if (bgs[r] == 2) {
f[r] = 8;
}
if (bgs[r] == 1) {
f[r] = 9;
}
bgs[r] = bgs[r] - 1;
bgy[r] = bgy[r] - 10;
if (bgs[r] <= 0) {
f[r] = 10;
bgt[r] = 0;
bgx[r] = -500;
bgs[r] = 0;
}
}
}
}
r++;
}
r = 1;
while (r <= 5) {
if (bgst[r] > 0) {
if (bgst[r] == 1) {
if (r == 1) {
bgs1.gotoAndStop(1);
}
if (r == 2) {
bgs2.gotoAndStop(1);
}
if (r == 3) {
bgs3.gotoAndStop(1);
}
if (r == 4) {
bgs4.gotoAndStop(1);
}
if (r == 5) {
bgs5.gotoAndStop(1);
}
if (bgsd[r] == 0) {
bgsx[r] = bgsx[r] + 20;
if (bgsx[r] > (px + 300)) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgsd[r] == 1) {
bgsx[r] = bgsx[r] - 20;
if (bgsx[r] < (px - 300)) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgsd[r] == 2) {
bgsx[r] = bgsx[r] + 15;
bgsy[r] = bgsy[r] + 15;
if ((bgsx[r] > (px + 300)) or (bgsy[r] > (py + 300))) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgsd[r] == 3) {
bgsx[r] = bgsx[r] - 15;
bgsy[r] = bgsy[r] + 15;
if ((bgsx[r] > (px + 300)) or (bgsy[r] > (py + 300))) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgsd[r] == 4) {
bgsy[r] = bgsy[r] + 20;
if (bgsy[r] > (py + 300)) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (((((((bgsx[r] - 15) < (px + 10)) and ((bgsx[r] + 15) > (px - 10))) and ((bgsy[r] + 15) > (py + 5))) and ((bgsy[r] - 15) < (py + 20))) and (pcd < 18)) and (i < 1)) {
if ((bgsd[r] == 0) or (bgsd[r] == 2)) {
pcd = 19;
}
if ((bgsd[r] == 1) or (bgsd[r] == 3)) {
pcd = 18;
}
pstep = 2;
pl = pl - 3;
megah.start();
i = 10;
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgst[r] == 2) {
if (r == 1) {
bgs1.gotoAndStop(2);
}
if (r == 2) {
bgs2.gotoAndStop(2);
}
if (r == 3) {
bgs3.gotoAndStop(2);
}
if (r == 4) {
bgs4.gotoAndStop(2);
}
if (r == 5) {
bgs5.gotoAndStop(2);
}
if (bgsd[r] == 0) {
bgsx[r] = bgsx[r] + 30;
if (bgsx[r] > (px + 300)) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgsd[r] == 1) {
bgsx[r] = bgsx[r] - 30;
if (bgsx[r] < (px - 300)) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (((((((bgsx[r] - 25) < (px + 10)) and ((bgsx[r] + 25) > (px - 10))) and ((bgsy[r] + 80) > (py + 40))) and ((bgsy[r] + 35) < (py + 60))) and (pcd < 18)) and (i < 1)) {
if (bgsd[r] == 0) {
pcd = 19;
}
if (bgsd[r] == 1) {
pcd = 18;
}
pstep = 2;
pl = pl - 6;
megah.start();
i = 10;
bgst[r] = 0;
bgsx[r] = -200;
}
}
}
r++;
}
bg1.gotoAndStop(f[1]);
bg2.gotoAndStop(f[2]);
bg3.gotoAndStop(f[3]);
bg4.gotoAndStop(f[4]);
bg5.gotoAndStop(f[5]);
bg6.gotoAndStop(f[6]);
bg7.gotoAndStop(f[7]);
bg8.gotoAndStop(f[8]);
bgs1._x = ((bgsx[1] + 275) - px) / 2;
bgs1._y = ((bgsy[1] + 275) - py) / 2;
bgs2._x = ((bgsx[2] + 275) - px) / 2;
bgs2._y = ((bgsy[2] + 275) - py) / 2;
bgs3._x = ((bgsx[3] + 275) - px) / 2;
bgs3._y = ((bgsy[3] + 275) - py) / 2;
bgs4._x = ((bgsx[4] + 275) - px) / 2;
bgs4._y = ((bgsy[4] + 275) - py) / 2;
bgs5._x = ((bgsx[5] + 275) - px) / 2;
bgs5._y = ((bgsy[5] + 275) - py) / 2;
bg1._x = ((bgx[1] + 275) - px) / 2;
bg1._y = ((bgy[1] + 275) - py) / 2;
bg2._x = ((bgx[2] + 275) - px) / 2;
bg2._y = ((bgy[2] + 275) - py) / 2;
bg3._x = ((bgx[3] + 275) - px) / 2;
bg3._y = ((bgy[3] + 275) - py) / 2;
bg4._x = ((bgx[4] + 275) - px) / 2;
bg4._y = ((bgy[4] + 275) - py) / 2;
bg5._x = ((bgx[5] + 275) - px) / 2;
bg5._y = ((bgy[5] + 275) - py) / 2;
bg6._x = ((bgx[6] + 275) - px) / 2;
bg6._y = ((bgy[6] + 275) - py) / 2;
bg7._x = ((bgx[7] + 275) - px) / 2;
bg7._y = ((bgy[7] + 275) - py) / 2;
bg8._x = ((bgx[8] + 275) - px) / 2;
bg8._y = ((bgy[8] + 275) - py) / 2;
r = 1;
while (r <= 3) {
if (((pst[r] > 0) and (pst[r] < 4)) and (psd[r] == 0)) {
if (r == 1) {
shot1p._x = ((297 + psx[1]) - px) / 2;
shot1p._y = ((270 + psy[1]) - py) / 2;
}
if (r == 2) {
shot2p._x = ((297 + psx[2]) - px) / 2;
shot2p._y = ((270 + psy[2]) - py) / 2;
}
if (r == 3) {
shot3p._x = ((297 + psx[3]) - px) / 2;
shot3p._y = ((270 + psy[3]) - py) / 2;
}
}
if (((pst[r] > 0) and (pst[r] < 4)) and (psd[r] == 1)) {
if (r == 1) {
shot1p._x = ((247 + psx[1]) - px) / 2;
shot1p._y = ((270 + psy[1]) - py) / 2;
}
if (r == 2) {
shot2p._x = ((247 + psx[2]) - px) / 2;
shot2p._y = ((270 + psy[2]) - py) / 2;
}
if (r == 3) {
shot3p._x = ((247 + psx[3]) - px) / 2;
shot3p._y = ((270 + psy[3]) - py) / 2;
}
}
if ((pst[r] == 4) or (pst[r] == 5)) {
if (r == 1) {
shot1p._x = ((272 + psx[1]) - px) / 2;
shot1p._y = ((270 + psy[1]) - py) / 2;
}
if (r == 2) {
shot2p._x = ((272 + psx[2]) - px) / 2;
shot2p._y = ((270 + psy[2]) - py) / 2;
}
if (r == 3) {
shot3p._x = ((272 + psx[3]) - px) / 2;
shot3p._y = ((270 + psy[3]) - py) / 2;
}
}
if (pst[r] == 0) {
if (r == 1) {
shot1p._x = -200;
shot1p._y = (270 + psy[1]) - py;
}
if (r == 2) {
shot2p._x = -200;
shot2p._y = (270 + psy[2]) - py;
}
if (r == 3) {
shot3p._x = -200;
shot3p._y = (270 + psy[3]) - py;
}
}
r++;
}
if (i > 0) {
i = i - 1;
pc._alpha = 50;
}
if (i <= 0) {
i = i - 1;
pc._alpha = 100;
}
if (bcharge > 0) {
charge._alpha = bcharge;
}
lbar._height = 2 * pl;
lbar._y = 120 - (2 * pl);
stage._x = (270 - px) / 2;
stage._y = (-725 - py) / 2;
exit._x = ((ex + 275) - px) / 2;
exit._y = ((ey + 275) - py) / 2;
Frame 35
gotoAndPlay (34);
if ((((px + 10) > (ex - 20)) and ((px - 10) < (ex + 20))) and (((py + 30) > (ey - 20)) and (py < (ey + 50)))) {
gotoAndPlay (36);
}
Frame 36
pc.gotoAndStop(1);
lbar._height = 2 * pl;
lbar._y = 120 - (2 * pl);
stage._x = (270 - px) / 2;
stage._y = (-725 - py) / 2;
exit._x = ((ex + 275) - px) / 2;
exit._y = ((ey + 275) - py) / 2;
Frame 39
psn = 1;
bstep = 0;
pcd = 0;
bcharge = 0;
r = 1;
while (r <= 5) {
psx[r] = -200;
psy[r] = 0;
pst[r] = 0;
psd[r] = 0;
r++;
}
i = 0;
pl = pl + 5;
if (pl > 50) {
pl = 50;
}
px = 150;
py = 245;
r = 0;
while (r <= 31) {
bx[r] = -50;
by[r] = -50;
r++;
}
bx[1] = 50;
by[1] = 150;
bx[2] = 50;
by[2] = 250;
bx[3] = 150;
by[3] = 350;
bx[4] = 250;
by[4] = 350;
bx[5] = 350;
by[5] = 350;
bx[6] = 450;
by[6] = 350;
bx[7] = 550;
by[7] = 350;
bx[8] = 650;
by[8] = 350;
bx[9] = 750;
by[9] = 350;
bx[10] = 850;
by[10] = 350;
bx[11] = 950;
by[11] = 350;
bx[12] = 1050;
by[12] = 350;
bx[13] = 1150;
by[13] = 350;
bx[14] = 1250;
by[14] = 250;
bx[15] = 1150;
by[15] = 150;
bsn = 1;
r = 1;
while (r <= 8) {
bgx[r] = -200;
bgy[r] = -200;
bgt[r] = 0;
bgd[r] = -1;
bgs[r] = 0;
r++;
}
r = 1;
while (r <= 5) {
bgsx[r] = -200;
bgsy[r] = 0;
bgst[r] = 0;
bgsd[r] = 0;
r++;
}
r = 1;
while (r <= 8) {
f[r] = 20;
r++;
}
bgt[1] = 2;
bgd[1] = 3;
bgs[1] = 0;
bgl[1] = 3;
bgx[1] = 350;
bgy[1] = 250;
bgt[2] = 1;
bgd[2] = 2;
bgs[2] = 0;
bgl[2] = 2;
bgx[2] = 450;
bgy[2] = 250;
bgt[3] = 7;
bgd[3] = 0;
bgs[3] = 0;
bgl[3] = 3;
bgx[3] = 550;
bgy[3] = 100;
bgt[4] = 4;
bgd[4] = 0;
bgs[4] = 0;
bgl[4] = 4;
bgx[4] = 600;
bgy[4] = 250;
bgt[5] = 2;
bgd[5] = 3;
bgs[5] = 0;
bgl[5] = 3;
bgx[5] = 750;
bgy[5] = 250;
bgt[6] = 7;
bgd[6] = 0;
bgs[6] = 0;
bgl[6] = 3;
bgx[6] = 800;
bgy[6] = 100;
bgt[7] = 4;
bgd[7] = 0;
bgs[7] = 0;
bgl[7] = 4;
bgx[7] = 900;
bgy[7] = 250;
bgt[8] = 1;
bgd[8] = 2;
bgs[8] = 0;
bgl[8] = 2;
bgx[8] = 1050;
bgy[8] = 250;
ex = 1150;
ey = 250;
Frame 40
b1._x = bx[1] / 10;
b1._y = (by[1] / 10) + 120;
b2._x = bx[2] / 10;
b2._y = (by[2] / 10) + 120;
b3._x = bx[3] / 10;
b3._y = (by[3] / 10) + 120;
b4._x = bx[4] / 10;
b4._y = (by[4] / 10) + 120;
b5._x = bx[5] / 10;
b5._y = (by[5] / 10) + 120;
b6._x = bx[6] / 10;
b6._y = (by[6] / 10) + 120;
b7._x = bx[7] / 10;
b7._y = (by[7] / 10) + 120;
b8._x = bx[8] / 10;
b8._y = (by[8] / 10) + 120;
b9._x = bx[9] / 10;
b9._y = (by[9] / 10) + 120;
b10._x = bx[10] / 10;
b10._y = (by[10] / 10) + 120;
b11._x = bx[11] / 10;
b11._y = (by[11] / 10) + 120;
b12._x = bx[12] / 10;
b12._y = (by[12] / 10) + 120;
b13._x = bx[13] / 10;
b13._y = (by[13] / 10) + 120;
b14._x = bx[14] / 10;
b14._y = (by[14] / 10) + 120;
b15._x = bx[15] / 10;
b15._y = (by[15] / 10) + 120;
b16._x = bx[16] / 10;
b16._y = (by[16] / 10) + 120;
b17._x = bx[17] / 10;
b17._y = (by[17] / 10) + 120;
b18._x = bx[18] / 10;
b18._y = (by[18] / 10) + 120;
b19._x = bx[19] / 10;
b19._y = (by[19] / 10) + 120;
b20._x = bx[20] / 10;
b20._y = (by[20] / 10) + 120;
b21._x = bx[21] / 10;
b21._y = (by[21] / 10) + 120;
b22._x = bx[22] / 10;
b22._y = (by[22] / 10) + 120;
b23._x = bx[23] / 10;
b23._y = (by[23] / 10) + 120;
b24._x = bx[24] / 10;
b24._y = (by[24] / 10) + 120;
b25._x = bx[25] / 10;
b25._y = (by[25] / 10) + 120;
b26._x = bx[26] / 10;
b26._y = (by[26] / 10) + 120;
b27._x = bx[27] / 10;
b27._y = (by[27] / 10) + 120;
b28._x = bx[28] / 10;
b28._y = (by[28] / 10) + 120;
b29._x = bx[29] / 10;
b29._y = (by[29] / 10) + 120;
b30._x = bx[30] / 10;
b30._y = (by[30] / 10) + 120;
b31._x = bx[31] / 10;
b31._y = (by[31] / 10) + 120;
cir._x = px / 10;
cir._y = (py / 10) + 120;
shot1._x = psx[1] / 10;
shot1._y = (psy[1] / 10) + 120;
shot2._x = psx[2] / 10;
shot2._y = (psy[2] / 10) + 120;
shot3._x = psx[3] / 10;
shot3._y = (psy[3] / 10) + 120;
bshot1._x = bgsx[1] / 10;
bshot1._y = (bgsy[1] / 10) + 120;
bshot2._x = bgsx[2] / 10;
bshot2._y = (bgsy[2] / 10) + 120;
bshot3._x = bgsx[3] / 10;
bshot3._y = (bgsy[3] / 10) + 120;
bshot4._x = bgsx[4] / 10;
bshot4._y = (bgsy[4] / 10) + 120;
bshot5._x = bgsx[5] / 10;
bshot5._y = (bgsy[5] / 10) + 120;
bcir1._x = bgx[1] / 10;
bcir1._y = (bgy[1] / 10) + 120;
bcir2._x = bgx[2] / 10;
bcir2._y = (bgy[2] / 10) + 120;
bcir3._x = bgx[3] / 10;
bcir3._y = (bgy[3] / 10) + 120;
bcir4._x = bgx[4] / 10;
bcir4._y = (bgy[4] / 10) + 120;
bcir5._x = bgx[5] / 10;
bcir5._y = (bgy[5] / 10) + 120;
bcir6._x = bgx[6] / 10;
bcir6._y = (bgy[6] / 10) + 120;
bcir7._x = bgx[7] / 10;
bcir7._y = (bgy[7] / 10) + 120;
bcir8._x = bgx[8] / 10;
bcir8._y = (bgy[8] / 10) + 120;
bcir9._x = bgx[9] / 10;
bcir9._y = (bgy[9] / 10) + 120;
bcir10._x = bgx[10] / 10;
bcir10._y = (bgy[10] / 10) + 120;
bcir11._x = bgx[11] / 10;
bcir11._y = (bgy[11] / 10) + 120;
bcir12._x = bgx[12] / 10;
bcir12._y = (bgy[12] / 10) + 120;
bcir13._x = bgx[13] / 10;
bcir13._y = (bgy[13] / 10) + 120;
if (Key.isDown(39) and (pcd == 0)) {
pcd = 2;
}
if (Key.isDown(39) and ((pcd == 1) or (pcd == 3))) {
pcd = 0;
}
if (Key.isDown(37) and (pcd == 1)) {
pcd = 3;
}
if (Key.isDown(37) and ((pcd == 0) or (pcd == 2))) {
pcd = 1;
}
if (Key.isDown(38) and ((pcd == 0) or (pcd == 2))) {
pcd = 10;
pstep = 7;
}
if (Key.isDown(38) and ((pcd == 1) or (pcd == 3))) {
pcd = 11;
pstep = 7;
}
if (Key.isDown(40) and ((((pcd == 0) or (pcd == 1)) or (pcd == 2)) or (pcd == 3))) {
if (((pcd == 0) or (pcd == 2)) or (pcd == 8)) {
pcd = 6;
pstep = 3;
}
if (((pcd == 1) or (pcd == 3)) or (pcd == 9)) {
pcd = 7;
pstep = 3;
}
}
if (Key.isDown(16) and (bcharge < 100)) {
bcharge = bcharge + 5;
}
if (pcd == 0) {
pc.gotoAndStop(1);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(21);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 0;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
}
if (pcd == 1) {
pc.gotoAndStop(2);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(22);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 1;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
}
if (pcd == 2) {
px = px + 13;
if ((w == 0) or (w == 1)) {
pc.gotoAndStop(3);
}
if ((w == 2) or (w == 3)) {
pc.gotoAndStop(4);
}
if ((w == 4) or (w == 5)) {
pc.gotoAndStop(5);
}
if ((w == 6) or (w == 7)) {
pc.gotoAndStop(6);
}
if (Key.isDown(32)) {
if ((w == 0) or (w == 1)) {
pc.gotoAndStop(11);
}
if ((w == 2) or (w == 3)) {
pc.gotoAndStop(12);
}
if ((w == 4) or (w == 5)) {
pc.gotoAndStop(13);
}
if ((w == 6) or (w == 7)) {
pc.gotoAndStop(14);
}
if ((pst[psn] == 0) and (bstep == 0)) {
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 0;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
}
pcd = 0;
}
if (pcd == 3) {
px = px - 13;
if ((w == 0) or (w == 1)) {
pc.gotoAndStop(7);
}
if ((w == 2) or (w == 3)) {
pc.gotoAndStop(8);
}
if ((w == 4) or (w == 5)) {
pc.gotoAndStop(9);
}
if ((w == 6) or (w == 7)) {
pc.gotoAndStop(10);
}
if (Key.isDown(32)) {
if ((w == 0) or (w == 1)) {
pc.gotoAndStop(15);
}
if ((w == 2) or (w == 3)) {
pc.gotoAndStop(16);
}
if ((w == 4) or (w == 5)) {
pc.gotoAndStop(17);
}
if ((w == 6) or (w == 7)) {
pc.gotoAndStop(18);
}
if ((pst[psn] == 0) and (bstep == 0)) {
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 1;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
}
pcd = 1;
}
if (pcd == 9) {
pstep = pstep - 1;
if (pstep <= 0) {
pcd = 1;
}
}
if (pcd == 6) {
pc.gotoAndStop(19);
px = px + 20;
pstep = pstep - 1;
if (pstep <= 0) {
pcd = 0;
}
}
if (pcd == 7) {
pc.gotoAndStop(20);
px = px - 20;
pstep = pstep - 1;
if (pstep <= 0) {
pcd = 1;
}
}
if (pcd == 12) {
pc.gotoAndStop(23);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(25);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 0;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
py = py + (5 * (7 - pstep));
pstep = pstep - 1;
if (pstep <= 2) {
pstep = 2;
}
if (Key.isDown(39)) {
px = px + 13;
}
if (Key.isDown(37)) {
px = px - 13;
if (bstep == 0) {
pcd = 13;
}
}
}
if (pcd == 13) {
pc.gotoAndStop(24);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(26);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 1;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
py = py + (5 * (7 - pstep));
pstep = pstep - 1;
if (pstep <= 2) {
pstep = 2;
}
if (Key.isDown(39)) {
px = px + 13;
if (bstep == 0) {
pcd = 12;
}
}
if (Key.isDown(37)) {
px = px - 13;
}
}
if (pcd == 10) {
pc.gotoAndStop(23);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(25);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 0;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
py = py - (5 * pstep);
pstep = pstep - 1;
if (Key.isDown(39)) {
px = px + 13;
}
if (Key.isDown(37)) {
px = px - 13;
if (bstep == 0) {
pcd = 11;
}
}
if (Key.isDown(40)) {
pcd = 12;
pstep = pstep + 3;
}
if (pstep <= -1) {
pstep = 7;
pcd = 12;
}
}
if (pcd == 11) {
pc.gotoAndStop(24);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(26);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 1;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
py = py - (5 * pstep);
pstep = pstep - 1;
if (Key.isDown(39)) {
px = px + 13;
if (bstep == 0) {
pcd = 10;
}
}
if (Key.isDown(37)) {
px = px - 13;
}
if (Key.isDown(40)) {
pcd = 13;
pstep = pstep + 3;
}
if (pstep <= -1) {
pstep = 7;
pcd = 13;
}
}
if (pcd == 18) {
pc.gotoAndStop(27);
pstep = pstep - 1;
px = px - 5;
if (pstep <= -1) {
pstep = 2;
pcd = 0;
}
}
if (pcd == 19) {
pc.gotoAndStop(28);
pstep = pstep - 1;
px = px + 5;
if (pstep <= -1) {
pstep = 2;
pcd = 1;
}
}
if (pcd == 20) {
pc.gotoAndStop(69 - pstep);
bcharge = 0;
charge._alpha = 0;
bstep = 20;
pl = 1;
pstep = pstep - 1;
if (pstep < 0) {
lives = lives - 1;
if (lives >= 0) {
pl = 50;
gotoAndPlay (10);
}
if (lives < 0) {
lives = 2;
continues = continues - 1;
gotoAndPlay (5);
}
}
}
if (pl <= 0) {
c = 1;
while (c <= 8) {
bgx[c] = -600;
c++;
}
pc._alpha = 100;
pcd = 20;
pstep = 40;
megad.start();
}
if (bstep > 0) {
bcharge = 0;
charge._alpha = bcharge;
}
if (bstep > 0) {
bstep = bstep - 1;
}
if ((py > 500) and (pcd < 20)) {
megad.start();
pl = 0;
}
w = w - 1;
if (w < 0) {
w = 7;
}
e = pcd;
c = 0;
r = 1;
while (r <= 15) {
if (((((bx[r] - 150) < px) and ((bx[r] + 150) > px)) and ((by[r] - 150) < py)) and ((by[r] + 150) > py)) {
if (((((((px - 30) < (bx[r] + 50)) and ((px + 20) > (bx[r] - 50))) and (py < (by[r] - 50))) and ((py + 60) > (by[r] - 50))) and (pcd != 10)) and (pcd != 11)) {
if ((((pcd == 12) or (pcd == 13)) or (pcd == 16)) or (pcd == 17)) {
if ((pcd == 12) or (pcd == 16)) {
pcd = 0;
}
if ((pcd == 13) or (pcd == 17)) {
pcd = 1;
}
}
c = 1;
py = by[r] - 75;
}
if (((((px + 38) > (bx[r] - 50)) and ((px + 20) < bx[r])) and (py < (by[r] + 50))) and ((py + 20) > (by[r] - 50))) {
px = bx[r] - 85;
}
if (((((px - 35) < (bx[r] + 50)) and ((px - 20) > bx[r])) and (py < (by[r] + 50))) and ((py + 20) > (by[r] - 50))) {
px = bx[r] + 85;
}
if (((((px - 5) < (bx[r] + 50)) and ((px + 5) > (bx[r] - 50))) and ((py - 30) < (by[r] + 50))) and ((py + 10) > (by[r] + 50))) {
if ((((pcd == 10) or (pcd == 11)) or (pcd == 14)) or (pcd == 15)) {
if ((pcd == 10) or (pcd == 14)) {
pcd = 12;
pstep = 5;
}
if ((pcd == 11) or (pcd == 15)) {
pcd = 13;
pstep = 5;
}
}
py = by[r] + 90;
}
}
r++;
}
if (c == 0) {
if ((((pcd == 0) or (pcd == 2)) or (pcd == 6)) or (pcd == 18)) {
pcd = 12;
pstep = 6;
}
if ((((pcd == 1) or (pcd == 3)) or (pcd == 7)) or (pcd == 19)) {
pcd = 13;
pstep = 6;
}
}
r = 1;
while (r <= 3) {
if (pst[r] == 1) {
if (psd[r] == 0) {
psx[r] = psx[r] + 30;
if (r == 1) {
shot1p.gotoAndStop(1);
}
if (r == 2) {
shot2p.gotoAndStop(1);
}
if (r == 3) {
shot3p.gotoAndStop(1);
}
if (psx[r] > (px + 280)) {
pst[r] = 0;
psx[r] = -200;
}
}
if (psd[r] == 1) {
psx[r] = psx[r] - 30;
if (r == 1) {
shot1p.gotoAndStop(2);
}
if (r == 2) {
shot2p.gotoAndStop(2);
}
if (r == 3) {
shot3p.gotoAndStop(2);
}
if (psx[r] < (px - 280)) {
pst[r] = 0;
psx[r] = -200;
}
}
}
if (pst[r] == 2) {
if (psd[r] == 0) {
psx[r] = psx[r] + 35;
if (r == 1) {
shot1p.gotoAndStop(3);
}
if (r == 2) {
shot2p.gotoAndStop(3);
}
if (r == 3) {
shot3p.gotoAndStop(3);
}
if (psx[r] > (px + 280)) {
pst[r] = 0;
psx[r] = -200;
}
}
if (psd[r] == 1) {
psx[r] = psx[r] - 35;
if (r == 1) {
shot1p.gotoAndStop(4);
}
if (r == 2) {
shot2p.gotoAndStop(4);
}
if (r == 3) {
shot3p.gotoAndStop(4);
}
if (psx[r] < (px - 280)) {
pst[r] = 0;
psx[r] = -200;
}
}
}
if (pst[r] == 3) {
if (psd[r] == 0) {
psx[r] = psx[r] + 40;
if (r == 1) {
shot1p.gotoAndStop(5);
}
if (r == 2) {
shot2p.gotoAndStop(5);
}
if (r == 3) {
shot3p.gotoAndStop(5);
}
if (psx[r] > (px + 280)) {
pst[r] = 0;
psx[r] = -200;
}
}
if (psd[r] == 1) {
psx[r] = psx[r] - 40;
if (r == 1) {
shot1p.gotoAndStop(6);
}
if (r == 2) {
shot2p.gotoAndStop(6);
}
if (r == 3) {
shot3p.gotoAndStop(6);
}
if (psx[r] < (px - 280)) {
pst[r] = 0;
psx[r] = -200;
}
}
}
if (pst[r] == 4) {
if (r == 1) {
shot1p.gotoAndStop(10 - psd[r]);
}
if (r == 2) {
shot2p.gotoAndStop(10 - psd[r]);
}
if (r == 3) {
shot3p.gotoAndStop(10 - psd[r]);
}
psd[r] = psd[r] - 1;
if (psd[r] < 0) {
pst[r] = 0;
psx[r] = -200;
}
}
if (pst[r] == 5) {
if (r == 1) {
shot1p.gotoAndStop(14 - psd[r]);
}
if (r == 2) {
shot2p.gotoAndStop(14 - psd[r]);
}
if (r == 3) {
shot3p.gotoAndStop(14 - psd[r]);
}
psd[r] = psd[r] - 1;
if (psd[r] < 0) {
pst[r] = 0;
psx[r] = -200;
}
}
r++;
}
while (c <= 8) {
r = 1;
while (r <= 3) {
if ((pst[r] > 0) and (pst[r] < 4)) {
if (((((bgt[c] == 1) and ((bgx[c] - 35) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 35) > (psx[r] - ((pst[r] * 20) - 20)))) and ((bgy[c] - 5) < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 50) > (psy[r] - ((pst[r] * 20) - 20)))) {
if ((bgd[c] == 0) or (bgd[c] == 2)) {
deflect.start();
pst[r] = 5;
psd[r] = 2;
}
if ((bgd[c] == 1) or (bgd[c] == 3)) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd2.start();
bgd[c] = 4;
bgs[c] = 4;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
if (((((bgt[c] == 2) and ((bgx[c] - 35) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 35) > (psx[r] - ((pst[r] * 20) - 20)))) and (bgy[c] < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 50) > (psy[r] - ((pst[r] * 20) - 20)))) {
if ((((bgd[c] == 0) or (bgd[c] == 3)) or (bgd[c] == 1)) or (bgd[c] == 4)) {
deflect.start();
pst[r] = 5;
psd[r] = 2;
}
if ((bgd[c] == 2) or (bgd[c] == 5)) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd2.start();
bgd[c] = 6;
bgs[c] = 6;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
if (((((bgt[c] == 4) and ((bgx[c] - 40) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 40) > (psx[r] - ((pst[r] * 20) - 20)))) and ((bgy[c] - 20) < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 50) > (psy[r] - ((pst[r] * 20) - 20)))) {
if ((bgd[c] == 0) or (bgd[c] == 2)) {
deflect.start();
pst[r] = 5;
psd[r] = 2;
}
if ((bgd[c] == 1) or (bgd[c] == 3)) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd1.start();
bgd[c] = 4;
bgs[c] = 4;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
if (((((bgt[c] == 7) and ((bgx[c] - 35) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 35) > (psx[r] - ((pst[r] * 20) - 20)))) and ((bgy[c] - 50) < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 20) > (psy[r] - ((pst[r] * 20) - 20)))) {
if (bgd[c] == 0) {
deflect.start();
pst[r] = 5;
psd[r] = 2;
}
if ((bgd[c] == 2) or (bgd[c] == 1)) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd2.start();
bgd[c] = 3;
bgs[c] = 3;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
}
r++;
}
c++;
}
r = 1;
while (r <= 8) {
if (((((bgt[r] > 0) and ((bgx[r] - 340) < px)) and ((bgx[r] + 340) > px)) and ((bgy[r] - 180) < py)) and ((bgy[r] + 350) > py)) {
c = 0;
e = 1;
while (e <= 15) {
if (((((bx[e] - 150) < bgx[r]) and ((bx[e] + 150) > bgx[r])) and ((by[e] - 150) < bgy[r])) and ((by[e] + 150) > bgy[r])) {
if (((((bgx[r] + 20) >= (bx[e] - 50)) and ((bgx[r] - 20) <= (bx[e] + 50))) and ((bgy[r] + 45) > (by[e] - 60))) and ((bgy[r] - 10) < (by[e] - 40))) {
c = 1;
}
if (((((bgx[r] + 20) > (bx[e] - 50)) and ((bgx[r] + 20) < bx[e])) and (bgy[r] < (by[e] + 50))) and ((bgy[r] + 20) > (by[e] - 50))) {
bgx[r] = bx[e] - 70;
}
if (((((bgx[r] - 20) < (bx[e] + 50)) and ((bgx[r] + 20) > bx[e])) and (bgy[r] < (by[e] + 50))) and ((bgy[r] + 20) > (by[e] - 50))) {
bgx[r] = bx[e] + 70;
}
if (((((bgx[r] - 5) < (bx[e] + 50)) and ((bgx[r] + 5) > (bx[e] - 50))) and ((bgy[r] - 30) < (by[e] + 50))) and (bgy[r] > (by[e] + 50))) {
bgy[r] = by[e] + 70;
}
if (((((bgx[r] - 2) < (bx[e] + 50)) and ((bgx[r] + 2) > (bx[e] - 50))) and ((bgy[r] + 20) < (by[e] - 50))) and ((bgy[r] + 60) > (by[e] - 50))) {
c = 1;
bgy[r] = by[e] - 105;
}
}
e++;
}
if (c == 0) {
bgy[r] = bgy[r] + 10;
}
if (bgt[r] == 1) {
if (((((((bgx[r] - 10) < (px + 10)) and ((bgx[r] + 10) > (px - 10))) and ((bgy[r] + 80) > (py + 10))) and ((bgy[r] + 50) < (py + 50))) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 4;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 4;
}
megah.start();
i = 10;
}
if (bgd[r] == 0) {
f[r] = 1;
if (px < bgx[r]) {
bgd[r] = 2;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
joes.start();
bgd[r] = 1;
bgs[r] = 7;
bgst[bsn] = 1;
bgsx[bsn] = bgx[r] - 10;
bgsy[bsn] = bgy[r] + 30;
bgsd[bsn] = 0;
bsn = bsn + 1;
if (bsn > 5) {
bsn = 1;
}
}
}
if (bgd[r] == 2) {
f[r] = 3;
if (px > bgx[r]) {
bgd[r] = 0;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
joes.start();
bgd[r] = 3;
bgs[r] = 7;
bgst[bsn] = 1;
bgsx[bsn] = bgx[r] + 10;
bgsy[bsn] = bgy[r] + 30;
bgsd[bsn] = 1;
bsn = bsn + 1;
if (bsn > 5) {
bsn = 1;
}
}
}
if (bgd[r] == 1) {
f[r] = 2;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 0;
bgs[r] = 20;
}
}
if (bgd[r] == 3) {
f[r] = 4;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 2;
bgs[r] = 20;
}
}
if (bgd[r] == 4) {
if (bgs[r] == 4) {
f[r] = 5;
}
if (bgs[r] == 3) {
f[r] = 6;
}
if (bgs[r] == 2) {
f[r] = 7;
}
if (bgs[r] == 1) {
f[r] = 8;
}
bgy[r] = bgy[r] - 10;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
f[r] = 9;
bgt[r] = 0;
bgx[r] = -500;
bgs[r] = 0;
}
}
}
if (bgt[r] == 2) {
if (((((((bgx[r] - 15) < (px + 10)) and ((bgx[r] + 15) > (px - 10))) and ((bgy[r] + 80) > (py - 10))) and ((bgy[r] + 50) < (py + 50))) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 3;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 3;
}
megah.start();
i = 10;
}
if (bgd[r] == 0) {
f[r] = 1;
if (px < bgx[r]) {
bgd[r] = 3;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 1;
bgs[r] = 10;
}
}
if (bgd[r] == 3) {
f[r] = 5;
if (px > bgx[r]) {
bgd[r] = 0;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 4;
bgs[r] = 10;
}
}
if (bgd[r] == 1) {
f[r] = 2;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 2;
bgs[r] = 12;
}
}
if (bgd[r] == 2) {
if (((bgs[r] == 12) or (bgs[r] == 11)) or (bgs[r] == 10)) {
f[r] = 3;
}
if (((bgs[r] == 9) or (bgs[r] == 8)) or (bgs[r] == 7)) {
f[r] = 4;
}
if (((bgs[r] == 6) or (bgs[r] == 5)) or (bgs[r] == 4)) {
f[r] = 3;
}
if (((bgs[r] == 3) or (bgs[r] == 2)) or (bgs[r] == 1)) {
f[r] = 4;
}
bgx[r] = bgx[r] + 8;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 0;
bgs[r] = 10 + random(20);
}
}
if (bgd[r] == 4) {
f[r] = 6;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 5;
bgs[r] = 12;
}
}
if (bgd[r] == 5) {
if (((bgs[r] == 12) or (bgs[r] == 11)) or (bgs[r] == 10)) {
f[r] = 7;
}
if (((bgs[r] == 9) or (bgs[r] == 8)) or (bgs[r] == 7)) {
f[r] = 8;
}
if (((bgs[r] == 6) or (bgs[r] == 5)) or (bgs[r] == 4)) {
f[r] = 7;
}
if (((bgs[r] == 3) or (bgs[r] == 2)) or (bgs[r] == 1)) {
f[r] = 8;
}
bgx[r] = bgx[r] - 8;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 3;
bgs[r] = 10 + random(20);
}
}
if (bgd[r] == 6) {
if (bgs[r] == 6) {
f[r] = 9;
}
if (bgs[r] == 5) {
f[r] = 10;
}
if (bgs[r] == 4) {
f[r] = 11;
}
if (bgs[r] == 3) {
f[r] = 12;
}
if (bgs[r] == 2) {
f[r] = 13;
}
if (bgs[r] == 1) {
f[r] = 14;
}
bgs[r] = bgs[r] - 1;
bgy[r] = bgy[r] - 10;
if (bgs[r] <= 0) {
f[r] = 15;
bgt[r] = 0;
bgx[r] = -500;
bgs[r] = 0;
}
}
}
if (bgt[r] == 4) {
if (((((((bgx[r] - 20) < (px + 10)) and ((bgx[r] + 20) > (px - 10))) and ((bgy[r] + 80) > (py + 10))) and ((bgy[r] + 30) < (py + 50))) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 4;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 4;
}
megah.start();
i = 10;
}
if (bgd[r] == 0) {
f[r] = 1;
if ((px - 180) < bgx[r]) {
bgd[r] = 1;
bgs[r] = 4;
}
if (px < bgx[r]) {
bgd[r] = 2;
}
}
if (bgd[r] == 2) {
f[r] = 4;
if ((px + 180) > bgx[r]) {
bgd[r] = 3;
bgs[r] = 4;
}
if (px > bgx[r]) {
bgd[r] = 0;
}
}
if (bgd[r] == 1) {
if ((bgs[r] == 1) or (bgs[r] == 2)) {
f[r] = 2;
}
if ((bgs[r] == 3) or (bgs[r] == 4)) {
f[r] = 3;
}
bgx[r] = bgx[r] + 12;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgs[r] = 4;
}
}
if (bgd[r] == 3) {
if ((bgs[r] == 1) or (bgs[r] == 2)) {
f[r] = 5;
}
if ((bgs[r] == 3) or (bgs[r] == 4)) {
f[r] = 6;
}
bgx[r] = bgx[r] - 12;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgs[r] = 4;
}
}
if (bgd[r] == 4) {
if (bgs[r] == 4) {
f[r] = 7;
}
if (bgs[r] == 3) {
f[r] = 8;
}
if (bgs[r] == 2) {
f[r] = 9;
}
if (bgs[r] == 1) {
f[r] = 10;
}
bgs[r] = bgs[r] - 1;
bgy[r] = bgy[r] - 10;
if (bgs[r] <= 0) {
bgx[r] = -500;
f[r] = 11;
bgt[r] = 0;
bgs[r] = 0;
}
}
}
if (bgt[r] == 7) {
if (((((((bgx[r] - 20) < (px + 10)) and ((bgx[r] + 20) > (px - 10))) and ((bgy[r] + 20) > (py + 10))) and ((bgy[r] + 20) < (py + 50))) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 3;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 3;
}
megah.start();
i = 10;
}
if (bgd[r] == 0) {
f[r] = 1;
bgy[r] = bgy[r] - 10;
if ((px + 80) < bgx[r]) {
bgx[r] = bgx[r] - 5;
}
if ((px - 80) > bgx[r]) {
bgx[r] = bgx[r] + 5;
}
if ((py - 70) < bgy[r]) {
bgy[r] = bgy[r] - 5;
}
if ((py - 70) > bgy[r]) {
bgy[r] = bgy[r] + 5;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
joes.start();
if (px > bgx[r]) {
bgd[r] = 1;
}
if (px < bgx[r]) {
bgd[r] = 2;
}
if (px < bgx[r]) {
bgsd[bsn] = 3;
if ((py - 50) < bgy[r]) {
bgsd[bsn] = 1;
}
}
if (px > bgx[r]) {
bgsd[bsn] = 2;
if ((py - 50) < bgy[r]) {
bgsd[bsn] = 0;
}
}
bgs[r] = 12;
bgst[bsn] = 1;
bgsx[bsn] = bgx[r];
bgsy[bsn] = bgy[r];
bsn = bsn + 1;
if (bsn > 5) {
bsn = 1;
}
}
}
if (bgd[r] == 1) {
f[r] = 2;
bgy[r] = bgy[r] - 10;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 0;
bgs[r] = 10 + random(25);
}
}
if (bgd[r] == 2) {
f[r] = 3;
bgy[r] = bgy[r] - 10;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 0;
bgs[r] = 10 + random(25);
}
}
if (bgd[r] == 3) {
if (bgs[r] == 3) {
f[r] = 4;
}
if (bgs[r] == 2) {
f[r] = 5;
}
if (bgs[r] == 1) {
f[r] = 6;
}
bgs[r] = bgs[r] - 1;
bgy[r] = bgy[r] - 10;
if (bgs[r] <= 0) {
f[r] = 7;
bgt[r] = 0;
bgx[r] = -500;
bgs[r] = 0;
}
}
}
}
r++;
}
r = 1;
while (r <= 5) {
if (bgst[r] > 0) {
if (bgst[r] == 1) {
if (r == 1) {
bgs1.gotoAndStop(1);
}
if (r == 2) {
bgs2.gotoAndStop(1);
}
if (r == 3) {
bgs3.gotoAndStop(1);
}
if (r == 4) {
bgs4.gotoAndStop(1);
}
if (r == 5) {
bgs5.gotoAndStop(1);
}
if (bgsd[r] == 0) {
bgsx[r] = bgsx[r] + 20;
if (bgsx[r] > (px + 300)) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgsd[r] == 1) {
bgsx[r] = bgsx[r] - 20;
if (bgsx[r] < (px - 300)) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgsd[r] == 2) {
bgsx[r] = bgsx[r] + 15;
bgsy[r] = bgsy[r] + 15;
if ((bgsx[r] > (px + 300)) or (bgsy[r] > (py + 300))) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgsd[r] == 3) {
bgsx[r] = bgsx[r] - 15;
bgsy[r] = bgsy[r] + 15;
if ((bgsx[r] > (px + 300)) or (bgsy[r] > (py + 300))) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgsd[r] == 4) {
bgsy[r] = bgsy[r] + 20;
if (bgsy[r] > (py + 300)) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (((((((bgsx[r] - 15) < (px + 10)) and ((bgsx[r] + 15) > (px - 10))) and ((bgsy[r] + 15) > (py + 5))) and ((bgsy[r] - 15) < (py + 20))) and (pcd < 18)) and (i < 1)) {
if ((bgsd[r] == 0) or (bgsd[r] == 2)) {
pcd = 19;
}
if ((bgsd[r] == 1) or (bgsd[r] == 3)) {
pcd = 18;
}
pstep = 2;
pl = pl - 3;
megah.start();
i = 10;
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgst[r] == 2) {
if (r == 1) {
bgs1.gotoAndStop(2);
}
if (r == 2) {
bgs2.gotoAndStop(2);
}
if (r == 3) {
bgs3.gotoAndStop(2);
}
if (r == 4) {
bgs4.gotoAndStop(2);
}
if (r == 5) {
bgs5.gotoAndStop(2);
}
if (bgsd[r] == 0) {
bgsx[r] = bgsx[r] + 30;
if (bgsx[r] > (px + 300)) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgsd[r] == 1) {
bgsx[r] = bgsx[r] - 30;
if (bgsx[r] < (px - 300)) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (((((((bgsx[r] - 25) < (px + 10)) and ((bgsx[r] + 25) > (px - 10))) and ((bgsy[r] + 80) > (py + 40))) and ((bgsy[r] + 35) < (py + 60))) and (pcd < 18)) and (i < 1)) {
if (bgsd[r] == 0) {
pcd = 19;
}
if (bgsd[r] == 1) {
pcd = 18;
}
pstep = 2;
pl = pl - 6;
megah.start();
i = 10;
bgst[r] = 0;
bgsx[r] = -200;
}
}
}
r++;
}
bg1.gotoAndStop(f[1]);
bg2.gotoAndStop(f[2]);
bg3.gotoAndStop(f[3]);
bg4.gotoAndStop(f[4]);
bg5.gotoAndStop(f[5]);
bg6.gotoAndStop(f[6]);
bg7.gotoAndStop(f[7]);
bg8.gotoAndStop(f[8]);
bgs1._x = ((bgsx[1] + 275) - px) / 2;
bgs1._y = ((bgsy[1] + 275) - py) / 2;
bgs2._x = ((bgsx[2] + 275) - px) / 2;
bgs2._y = ((bgsy[2] + 275) - py) / 2;
bgs3._x = ((bgsx[3] + 275) - px) / 2;
bgs3._y = ((bgsy[3] + 275) - py) / 2;
bgs4._x = ((bgsx[4] + 275) - px) / 2;
bgs4._y = ((bgsy[4] + 275) - py) / 2;
bgs5._x = ((bgsx[5] + 275) - px) / 2;
bgs5._y = ((bgsy[5] + 275) - py) / 2;
bg1._x = ((bgx[1] + 275) - px) / 2;
bg1._y = ((bgy[1] + 275) - py) / 2;
bg2._x = ((bgx[2] + 275) - px) / 2;
bg2._y = ((bgy[2] + 275) - py) / 2;
bg3._x = ((bgx[3] + 275) - px) / 2;
bg3._y = ((bgy[3] + 275) - py) / 2;
bg4._x = ((bgx[4] + 275) - px) / 2;
bg4._y = ((bgy[4] + 275) - py) / 2;
bg5._x = ((bgx[5] + 275) - px) / 2;
bg5._y = ((bgy[5] + 275) - py) / 2;
bg6._x = ((bgx[6] + 275) - px) / 2;
bg6._y = ((bgy[6] + 275) - py) / 2;
bg7._x = ((bgx[7] + 275) - px) / 2;
bg7._y = ((bgy[7] + 275) - py) / 2;
bg8._x = ((bgx[8] + 275) - px) / 2;
bg8._y = ((bgy[8] + 275) - py) / 2;
r = 1;
while (r <= 3) {
if (((pst[r] > 0) and (pst[r] < 4)) and (psd[r] == 0)) {
if (r == 1) {
shot1p._x = ((297 + psx[1]) - px) / 2;
shot1p._y = ((270 + psy[1]) - py) / 2;
}
if (r == 2) {
shot2p._x = ((297 + psx[2]) - px) / 2;
shot2p._y = ((270 + psy[2]) - py) / 2;
}
if (r == 3) {
shot3p._x = ((297 + psx[3]) - px) / 2;
shot3p._y = ((270 + psy[3]) - py) / 2;
}
}
if (((pst[r] > 0) and (pst[r] < 4)) and (psd[r] == 1)) {
if (r == 1) {
shot1p._x = ((247 + psx[1]) - px) / 2;
shot1p._y = ((270 + psy[1]) - py) / 2;
}
if (r == 2) {
shot2p._x = ((247 + psx[2]) - px) / 2;
shot2p._y = ((270 + psy[2]) - py) / 2;
}
if (r == 3) {
shot3p._x = ((247 + psx[3]) - px) / 2;
shot3p._y = ((270 + psy[3]) - py) / 2;
}
}
if ((pst[r] == 4) or (pst[r] == 5)) {
if (r == 1) {
shot1p._x = ((272 + psx[1]) - px) / 2;
shot1p._y = ((270 + psy[1]) - py) / 2;
}
if (r == 2) {
shot2p._x = ((272 + psx[2]) - px) / 2;
shot2p._y = ((270 + psy[2]) - py) / 2;
}
if (r == 3) {
shot3p._x = ((272 + psx[3]) - px) / 2;
shot3p._y = ((270 + psy[3]) - py) / 2;
}
}
if (pst[r] == 0) {
if (r == 1) {
shot1p._x = -200;
shot1p._y = (270 + psy[1]) - py;
}
if (r == 2) {
shot2p._x = -200;
shot2p._y = (270 + psy[2]) - py;
}
if (r == 3) {
shot3p._x = -200;
shot3p._y = (270 + psy[3]) - py;
}
}
r++;
}
if (i > 0) {
i = i - 1;
pc._alpha = 50;
}
if (i <= 0) {
i = i - 1;
pc._alpha = 100;
}
if (bcharge > 0) {
charge._alpha = bcharge;
}
lbar._height = 2 * pl;
lbar._y = 120 - (2 * pl);
stage._x = (270 - px) / 2;
stage._y = (275 - py) / 2;
exit._x = ((ex + 275) - px) / 2;
exit._y = ((ey + 275) - py) / 2;
Frame 41
gotoAndPlay (40);
if ((((px + 10) > (ex - 20)) and ((px - 10) < (ex + 20))) and (((py + 30) > (ey - 20)) and (py < (ey + 50)))) {
gotoAndPlay (42);
}
Frame 42
pc.gotoAndStop(1);
lbar._height = 2 * pl;
lbar._y = 120 - (2 * pl);
stage._x = (270 - px) / 2;
stage._y = (-725 - py) / 2;
exit._x = ((ex + 275) - px) / 2;
exit._y = ((ey + 275) - py) / 2;
Frame 45
psn = 1;
bstep = 0;
pcd = 0;
bcharge = 0;
r = 1;
while (r <= 5) {
psx[r] = -200;
psy[r] = 0;
pst[r] = 0;
psd[r] = 0;
r++;
}
i = 0;
pl = pl + 5;
if (pl > 50) {
pl = 50;
}
px = 150;
py = 350;
r = 0;
while (r <= 31) {
bx[r] = -50;
by[r] = -50;
r++;
}
bx[1] = 50;
by[1] = 150;
bx[2] = 50;
by[2] = 250;
bx[3] = 150;
by[3] = 350;
bx[4] = 250;
by[4] = 350;
bx[5] = 350;
by[5] = 350;
bx[6] = 450;
by[6] = 350;
bx[7] = 550;
by[7] = 350;
bx[8] = 650;
by[8] = 350;
bx[9] = 750;
by[9] = 350;
bx[10] = 850;
by[10] = 350;
bx[11] = 950;
by[11] = 350;
bx[12] = 1050;
by[12] = 350;
bx[13] = 1150;
by[13] = 350;
bx[14] = 1250;
by[14] = 250;
bx[15] = 1150;
by[15] = 150;
bsn = 1;
bi = 0;
r = 1;
while (r <= 8) {
bgx[r] = -200;
bgy[r] = -200;
bgt[r] = 0;
bgd[r] = -1;
bgs[r] = 0;
r++;
}
r = 1;
while (r <= 5) {
bgsx[r] = -200;
bgsy[r] = 0;
bgst[r] = 0;
bgsd[r] = 0;
r++;
}
r = 1;
while (r <= 8) {
f[r] = 20;
r++;
}
bgd[1] = 0;
bgs[1] = 0;
bgl[1] = 50;
bgx[1] = 350;
bgy[1] = 350;
ex = 1150;
ey = 250;
stopAllSounds();
Frame 50
b1._x = bx[1] / 10;
b1._y = (by[1] / 10) + 120;
b2._x = bx[2] / 10;
b2._y = (by[2] / 10) + 120;
b3._x = bx[3] / 10;
b3._y = (by[3] / 10) + 120;
b4._x = bx[4] / 10;
b4._y = (by[4] / 10) + 120;
b5._x = bx[5] / 10;
b5._y = (by[5] / 10) + 120;
b6._x = bx[6] / 10;
b6._y = (by[6] / 10) + 120;
b7._x = bx[7] / 10;
b7._y = (by[7] / 10) + 120;
b8._x = bx[8] / 10;
b8._y = (by[8] / 10) + 120;
b9._x = bx[9] / 10;
b9._y = (by[9] / 10) + 120;
b10._x = bx[10] / 10;
b10._y = (by[10] / 10) + 120;
b11._x = bx[11] / 10;
b11._y = (by[11] / 10) + 120;
b12._x = bx[12] / 10;
b12._y = (by[12] / 10) + 120;
b13._x = bx[13] / 10;
b13._y = (by[13] / 10) + 120;
b14._x = bx[14] / 10;
b14._y = (by[14] / 10) + 120;
b15._x = bx[15] / 10;
b15._y = (by[15] / 10) + 120;
b16._x = bx[16] / 10;
b16._y = (by[16] / 10) + 120;
b17._x = bx[17] / 10;
b17._y = (by[17] / 10) + 120;
b18._x = bx[18] / 10;
b18._y = (by[18] / 10) + 120;
b19._x = bx[19] / 10;
b19._y = (by[19] / 10) + 120;
b20._x = bx[20] / 10;
b20._y = (by[20] / 10) + 120;
b21._x = bx[21] / 10;
b21._y = (by[21] / 10) + 120;
b22._x = bx[22] / 10;
b22._y = (by[22] / 10) + 120;
b23._x = bx[23] / 10;
b23._y = (by[23] / 10) + 120;
b24._x = bx[24] / 10;
b24._y = (by[24] / 10) + 120;
b25._x = bx[25] / 10;
b25._y = (by[25] / 10) + 120;
b26._x = bx[26] / 10;
b26._y = (by[26] / 10) + 120;
b27._x = bx[27] / 10;
b27._y = (by[27] / 10) + 120;
b28._x = bx[28] / 10;
b28._y = (by[28] / 10) + 120;
b29._x = bx[29] / 10;
b29._y = (by[29] / 10) + 120;
b30._x = bx[30] / 10;
b30._y = (by[30] / 10) + 120;
b31._x = bx[31] / 10;
b31._y = (by[31] / 10) + 120;
cir._x = px / 10;
cir._y = (py / 10) + 120;
shot1._x = psx[1] / 10;
shot1._y = (psy[1] / 10) + 120;
shot2._x = psx[2] / 10;
shot2._y = (psy[2] / 10) + 120;
shot3._x = psx[3] / 10;
shot3._y = (psy[3] / 10) + 120;
bshot1._x = bgsx[1] / 10;
bshot1._y = (bgsy[1] / 10) + 120;
bshot2._x = bgsx[2] / 10;
bshot2._y = (bgsy[2] / 10) + 120;
bshot3._x = bgsx[3] / 10;
bshot3._y = (bgsy[3] / 10) + 120;
bshot4._x = bgsx[4] / 10;
bshot4._y = (bgsy[4] / 10) + 120;
bshot5._x = bgsx[5] / 10;
bshot5._y = (bgsy[5] / 10) + 120;
bcir1._x = bgx[1] / 10;
bcir1._y = (bgy[1] / 10) + 120;
bcir2._x = bgx[2] / 10;
bcir2._y = (bgy[2] / 10) + 120;
bcir3._x = bgx[3] / 10;
bcir3._y = (bgy[3] / 10) + 120;
bcir4._x = bgx[4] / 10;
bcir4._y = (bgy[4] / 10) + 120;
bcir5._x = bgx[5] / 10;
bcir5._y = (bgy[5] / 10) + 120;
bcir6._x = bgx[6] / 10;
bcir6._y = (bgy[6] / 10) + 120;
bcir7._x = bgx[7] / 10;
bcir7._y = (bgy[7] / 10) + 120;
bcir8._x = bgx[8] / 10;
bcir8._y = (bgy[8] / 10) + 120;
bcir9._x = bgx[9] / 10;
bcir9._y = (bgy[9] / 10) + 120;
bcir10._x = bgx[10] / 10;
bcir10._y = (bgy[10] / 10) + 120;
bcir11._x = bgx[11] / 10;
bcir11._y = (bgy[11] / 10) + 120;
bcir12._x = bgx[12] / 10;
bcir12._y = (bgy[12] / 10) + 120;
bcir13._x = bgx[13] / 10;
bcir13._y = (bgy[13] / 10) + 120;
if (Key.isDown(39) and (pcd == 0)) {
pcd = 2;
}
if (Key.isDown(39) and ((pcd == 1) or (pcd == 3))) {
pcd = 0;
}
if (Key.isDown(37) and (pcd == 1)) {
pcd = 3;
}
if (Key.isDown(37) and ((pcd == 0) or (pcd == 2))) {
pcd = 1;
}
if (Key.isDown(38) and ((pcd == 0) or (pcd == 2))) {
pcd = 10;
pstep = 7;
}
if (Key.isDown(38) and ((pcd == 1) or (pcd == 3))) {
pcd = 11;
pstep = 7;
}
if (Key.isDown(40) and ((((pcd == 0) or (pcd == 1)) or (pcd == 2)) or (pcd == 3))) {
if (((pcd == 0) or (pcd == 2)) or (pcd == 8)) {
pcd = 6;
pstep = 3;
}
if (((pcd == 1) or (pcd == 3)) or (pcd == 9)) {
pcd = 7;
pstep = 3;
}
}
if (Key.isDown(16) and (bcharge < 100)) {
bcharge = bcharge + 5;
}
if (pcd == 0) {
pc.gotoAndStop(1);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(21);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px + 10;
psy[psn] = py;
psd[psn] = 0;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
}
if (pcd == 1) {
pc.gotoAndStop(2);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(22);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px - 10;
psy[psn] = py;
psd[psn] = 1;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
}
if (pcd == 2) {
px = px + 13;
if ((w == 0) or (w == 1)) {
pc.gotoAndStop(3);
}
if ((w == 2) or (w == 3)) {
pc.gotoAndStop(4);
}
if ((w == 4) or (w == 5)) {
pc.gotoAndStop(5);
}
if ((w == 6) or (w == 7)) {
pc.gotoAndStop(6);
}
if (Key.isDown(32)) {
if ((w == 0) or (w == 1)) {
pc.gotoAndStop(11);
}
if ((w == 2) or (w == 3)) {
pc.gotoAndStop(12);
}
if ((w == 4) or (w == 5)) {
pc.gotoAndStop(13);
}
if ((w == 6) or (w == 7)) {
pc.gotoAndStop(14);
}
if ((pst[psn] == 0) and (bstep == 0)) {
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px + 10;
psy[psn] = py;
psd[psn] = 0;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
}
pcd = 0;
}
if (pcd == 3) {
px = px - 13;
if ((w == 0) or (w == 1)) {
pc.gotoAndStop(7);
}
if ((w == 2) or (w == 3)) {
pc.gotoAndStop(8);
}
if ((w == 4) or (w == 5)) {
pc.gotoAndStop(9);
}
if ((w == 6) or (w == 7)) {
pc.gotoAndStop(10);
}
if (Key.isDown(32)) {
if ((w == 0) or (w == 1)) {
pc.gotoAndStop(15);
}
if ((w == 2) or (w == 3)) {
pc.gotoAndStop(16);
}
if ((w == 4) or (w == 5)) {
pc.gotoAndStop(17);
}
if ((w == 6) or (w == 7)) {
pc.gotoAndStop(18);
}
if ((pst[psn] == 0) and (bstep == 0)) {
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px - 10;
psy[psn] = py;
psd[psn] = 1;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
}
pcd = 1;
}
if (pcd == 9) {
pstep = pstep - 1;
if (pstep <= 0) {
pcd = 1;
}
}
if (pcd == 6) {
pc.gotoAndStop(19);
px = px + 20;
pstep = pstep - 1;
if (pstep <= 0) {
pcd = 0;
}
}
if (pcd == 7) {
pc.gotoAndStop(20);
px = px - 20;
pstep = pstep - 1;
if (pstep <= 0) {
pcd = 1;
}
}
if (pcd == 12) {
pc.gotoAndStop(23);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(25);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px + 10;
psy[psn] = py;
psd[psn] = 0;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
py = py + (5 * (7 - pstep));
pstep = pstep - 1;
if (pstep <= 2) {
pstep = 2;
}
if (Key.isDown(39)) {
px = px + 13;
}
if (Key.isDown(37)) {
px = px - 13;
if (bstep == 0) {
pcd = 13;
}
}
}
if (pcd == 13) {
pc.gotoAndStop(24);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(26);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px - 10;
psy[psn] = py;
psd[psn] = 1;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
py = py + (5 * (7 - pstep));
pstep = pstep - 1;
if (pstep <= 2) {
pstep = 2;
}
if (Key.isDown(39)) {
px = px + 13;
if (bstep == 0) {
pcd = 12;
}
}
if (Key.isDown(37)) {
px = px - 13;
}
}
if (pcd == 10) {
pc.gotoAndStop(23);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(25);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px + 10;
psy[psn] = py;
psd[psn] = 0;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
py = py - (5 * pstep);
pstep = pstep - 1;
if (Key.isDown(39)) {
px = px + 13;
}
if (Key.isDown(37)) {
px = px - 13;
if (bstep == 0) {
pcd = 11;
}
}
if (Key.isDown(40)) {
pcd = 12;
pstep = pstep + 3;
}
if (pstep <= -1) {
pstep = 7;
pcd = 12;
}
}
if (pcd == 11) {
pc.gotoAndStop(24);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(26);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px - 10;
psy[psn] = py;
psd[psn] = 1;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
py = py - (5 * pstep);
pstep = pstep - 1;
if (Key.isDown(39)) {
px = px + 13;
if (bstep == 0) {
pcd = 10;
}
}
if (Key.isDown(37)) {
px = px - 13;
}
if (Key.isDown(40)) {
pcd = 13;
pstep = pstep + 3;
}
if (pstep <= -1) {
pstep = 7;
pcd = 13;
}
}
if (pcd == 18) {
pc.gotoAndStop(27);
pstep = pstep - 1;
px = px - 5;
if (pstep <= -1) {
pstep = 2;
pcd = 0;
}
}
if (pcd == 19) {
pc.gotoAndStop(28);
pstep = pstep - 1;
px = px + 5;
if (pstep <= -1) {
pstep = 2;
pcd = 1;
}
}
if (pcd == 20) {
pc.gotoAndStop(69 - pstep);
bcharge = 0;
bstep = 20;
pl = 1;
pstep = pstep - 1;
if (pstep < 0) {
lives = lives - 1;
if (lives >= 0) {
pl = 50;
gotoAndPlay (45);
}
if (lives < 0) {
lives = 2;
continues = continues - 1;
gotoAndPlay (5);
}
}
}
if (pcd == 21) {
pc.gotoAndStop(77 - pstep);
charge._alpha = 0;
bcharge = 0;
bstep = 20;
pstep = pstep - 1;
if (pstep < 0) {
pstep = 0;
}
}
if (pl <= 0) {
pc._alpha = 100;
pcd = 20;
pstep = 40;
megad.start();
}
if (bstep > 0) {
bcharge = 0;
charge._alpha = bcharge;
}
if (bstep > 0) {
bstep = bstep - 1;
}
if (py > 350) {
py = 350;
if ((((pcd == 12) or (pcd == 13)) or (pcd == 16)) or (pcd == 17)) {
if ((pcd == 12) or (pcd == 16)) {
pcd = 0;
megaland.start();
}
if ((pcd == 13) or (pcd == 17)) {
pcd = 1;
megaland.start();
}
}
}
if ((pcd == 18) and (py < 350)) {
pcd = 12;
pstep = 5;
}
if ((pcd == 19) and (py < 350)) {
pcd = 13;
pstep = 5;
}
if (px < 25) {
px = 25;
}
if (px > 525) {
px = 525;
}
w = w - 1;
if (w < 0) {
w = 7;
}
e = pcd;
r = 1;
while (r <= 3) {
if (pst[r] == 1) {
if (psd[r] == 0) {
psx[r] = psx[r] + 30;
if (r == 1) {
shot1p.gotoAndStop(1);
}
if (r == 2) {
shot2p.gotoAndStop(1);
}
if (r == 3) {
shot3p.gotoAndStop(1);
}
if (psx[r] > 580) {
pst[r] = 0;
psx[r] = -200;
}
}
if (psd[r] == 1) {
psx[r] = psx[r] - 30;
if (r == 1) {
shot1p.gotoAndStop(2);
}
if (r == 2) {
shot2p.gotoAndStop(2);
}
if (r == 3) {
shot3p.gotoAndStop(2);
}
if (psx[r] < -30) {
pst[r] = 0;
psx[r] = -200;
}
}
}
if (pst[r] == 2) {
if (psd[r] == 0) {
psx[r] = psx[r] + 35;
if (r == 1) {
shot1p.gotoAndStop(3);
}
if (r == 2) {
shot2p.gotoAndStop(3);
}
if (r == 3) {
shot3p.gotoAndStop(3);
}
if (psx[r] > 600) {
pst[r] = 0;
psx[r] = -200;
}
}
if (psd[r] == 1) {
psx[r] = psx[r] - 35;
if (r == 1) {
shot1p.gotoAndStop(4);
}
if (r == 2) {
shot2p.gotoAndStop(4);
}
if (r == 3) {
shot3p.gotoAndStop(4);
}
if (psx[r] < -50) {
pst[r] = 0;
psx[r] = -200;
}
}
}
if (pst[r] == 3) {
if (psd[r] == 0) {
psx[r] = psx[r] + 40;
if (r == 1) {
shot1p.gotoAndStop(5);
}
if (r == 2) {
shot2p.gotoAndStop(5);
}
if (r == 3) {
shot3p.gotoAndStop(5);
}
if (psx[r] > 630) {
pst[r] = 0;
psx[r] = -200;
}
}
if (psd[r] == 1) {
psx[r] = psx[r] - 40;
if (r == 1) {
shot1p.gotoAndStop(6);
}
if (r == 2) {
shot2p.gotoAndStop(6);
}
if (r == 3) {
shot3p.gotoAndStop(6);
}
if (psx[r] < -80) {
pst[r] = 0;
psx[r] = -200;
}
}
}
if (pst[r] == 4) {
if (r == 1) {
shot1p.gotoAndStop(10 - psd[r]);
}
if (r == 2) {
shot2p.gotoAndStop(10 - psd[r]);
}
if (r == 3) {
shot3p.gotoAndStop(10 - psd[r]);
}
psd[r] = psd[r] - 1;
if (psd[r] < 0) {
pst[r] = 0;
psx[r] = -200;
}
}
if (pst[r] == 5) {
if (r == 1) {
shot1p.gotoAndStop(14 - psd[r]);
}
if (r == 2) {
shot2p.gotoAndStop(14 - psd[r]);
}
if (r == 3) {
shot3p.gotoAndStop(14 - psd[r]);
}
psd[r] = psd[r] - 1;
if (psd[r] < 0) {
pst[r] = 0;
psx[r] = -200;
}
}
r++;
}
r = 1;
while (r <= 3) {
if ((pst[r] > 0) and (pst[r] < 4)) {
if (((((((bgx[1] - 30) < (psx[r] + ((pst[r] * 20) - 20))) and ((bgx[1] + 30) > (psx[r] - ((pst[r] * 20) - 20)))) and ((bgy[1] - 50) < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[1] + 55) > (psy[r] - ((pst[r] * 20) - 20)))) and (bi < 1)) and (bgl[1] > 0)) {
if ((bgd[1] > 5) and (bgd[1] < 10)) {
deflect.start();
pst[r] = 5;
psd[r] = 2;
}
if ((bgd[1] < 6) or (bgd[1] > 9)) {
megash.start();
bgl[1] = bgl[1] - pst[r];
bi = 12;
if (bgl[1] < 1) {
bi = 0;
baddyd2.start();
bgd[1] = 14;
bgs[1] = 10;
pcd = 21;
pstep = 7;
}
if ((bgl[1] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
}
r++;
}
if (bgd[1] == 0) {
boss.gotoAndStop(1);
if (px < bgx[1]) {
bgd[1] = 1;
}
c = random(140 - (5 * dif));
if (c < 8) {
bgd[1] = 2;
bgs[1] = 9;
}
if ((c > 8) and (c < 15)) {
bgs1.gotoAndStop(20);
bgd[1] = 4;
bgs[1] = 10;
bgst[1] = 0;
bgsy[1] = bgy[1];
bgsx[1] = bgx[1];
}
if ((c > 15) and (c < 23)) {
bgd[1] = 10 + random(2);
bgs[1] = 10;
}
}
if (bgd[1] == 1) {
boss.gotoAndStop(6);
if (px > bgx[1]) {
bgd[1] = 0;
}
c = random(140 - (5 * dif));
if (c < 8) {
bgd[1] = 3;
bgs[1] = 9;
}
if ((c > 8) and (c < 15)) {
bgs1.gotoAndStop(20);
bgd[1] = 5;
bgs[1] = 10;
bgst[1] = 0;
bgsy[1] = bgy[1];
bgsx[1] = bgx[1];
}
if ((c > 15) and (c < 23)) {
bgd[1] = 10 + random(2);
bgs[1] = 10;
}
}
if (bgd[1] == 2) {
boss.gotoAndStop(2);
bgx[1] = bgx[1] + 2;
bgs[1] = bgs[1] - 1;
if (bgs[1] <= 0) {
cannons.start();
bgd[1] = 0;
bgst[bsn] = 1;
bgsx[bsn] = bgx[1] + 50;
bgsy[bsn] = bgy[1];
bgsd[bsn] = 0;
bsn = bsn + 1;
if (bsn > 5) {
bsn = 2;
}
}
}
if (bgd[1] == 3) {
boss.gotoAndStop(7);
bgx[1] = bgx[1] - 2;
bgs[1] = bgs[1] - 1;
if (bgs[1] <= 0) {
cannons.start();
bgd[1] = 1;
bgst[bsn] = 1;
bgsx[bsn] = bgx[1] - 50;
bgsy[bsn] = bgy[1];
bgsd[bsn] = 1;
bsn = bsn + 1;
if (bsn > 5) {
bsn = 2;
}
}
}
if (bgd[1] == 4) {
boss.gotoAndStop(4);
if ((bgs[1] == 0) or (bgs[1] == 1)) {
bgs1.gotoAndStop(6);
}
if ((bgs[1] == 2) or (bgs[1] == 3)) {
bgs1.gotoAndStop(5);
}
if ((bgs[1] == 4) or (bgs[1] == 5)) {
bgs1.gotoAndStop(4);
}
if ((bgs[1] == 6) or (bgs[1] == 7)) {
bgs1.gotoAndStop(3);
}
if ((bgs[1] == 8) or (bgs[1] == 9)) {
bgs1.gotoAndStop(2);
}
bgs[1] = bgs[1] - 1;
if (bgs[1] < 0) {
c = random(100);
if (py < 350) {
c = c + 10;
}
bgs1.gotoAndStop(20);
if (c < 70) {
cannons.start();
bgd[1] = 6;
bgs[1] = 10;
bgst[1] = 2;
bgsx[1] = bgx[1] + 87;
bgsy[1] = bgy[1] + 5;
bgsd[1] = 0;
}
if (c > 69) {
baddyd1.start();
bgd[1] = 8;
bgs[1] = 15;
bgst[1] = 3;
bgsx[1] = bgx[1] + 80;
bgsy[1] = bgy[1];
bgsd[1] = 0;
}
}
}
if (bgd[1] == 5) {
boss.gotoAndStop(9);
if ((bgs[1] == 0) or (bgs[1] == 1)) {
bgs1.gotoAndStop(6);
}
if ((bgs[1] == 2) or (bgs[1] == 3)) {
bgs1.gotoAndStop(5);
}
if ((bgs[1] == 4) or (bgs[1] == 5)) {
bgs1.gotoAndStop(4);
}
if ((bgs[1] == 6) or (bgs[1] == 7)) {
bgs1.gotoAndStop(3);
}
if ((bgs[1] == 8) or (bgs[1] == 9)) {
bgs1.gotoAndStop(2);
}
bgs[1] = bgs[1] - 1;
if (bgs[1] < 0) {
bgs1.gotoAndStop(20);
c = random(100);
if (py < 350) {
c = c + 10;
}
if (c < 70) {
cannons.start();
bgd[1] = 7;
bgs[1] = 10;
bgst[1] = 2;
bgsx[1] = bgx[1] - 87;
bgsy[1] = bgy[1] + 5;
bgsd[1] = 1;
}
if (c > 69) {
baddyd1.start();
bgd[1] = 9;
bgs[1] = 15;
bgst[1] = 3;
bgsx[1] = bgx[1] - 80;
bgsy[1] = bgy[1];
bgsd[1] = 0;
}
}
}
if (bgd[1] == 6) {
boss.gotoAndStop(2);
bgx[1] = bgx[1] + 21;
bgs[1] = bgs[1] - 1;
if (bgs[1] <= 0) {
bgd[1] = 0;
}
}
if (bgd[1] == 7) {
boss.gotoAndStop(7);
bgx[1] = bgx[1] - 21;
bgs[1] = bgs[1] - 1;
if (bgs[1] <= 0) {
bgd[1] = 0;
}
}
if (bgd[1] == 8) {
boss.gotoAndStop(5);
if ((bgs[1] == 0) or (bgs[1] == 1)) {
bgs1.gotoAndStop(13);
}
if ((bgs[1] == 2) or (bgs[1] == 3)) {
bgs1.gotoAndStop(12);
}
if ((bgs[1] == 4) or (bgs[1] == 5)) {
bgs1.gotoAndStop(11);
}
if ((bgs[1] == 6) or (bgs[1] == 7)) {
bgs1.gotoAndStop(10);
}
if ((bgs[1] == 8) or (bgs[1] == 9)) {
bgs1.gotoAndStop(9);
}
if ((bgs[1] == 10) or (bgs[1] == 11)) {
bgs1.gotoAndStop(8);
}
bgs[1] = bgs[1] - 1;
if (bgs[1] < 0) {
bgd[1] = 0;
bgst[1] = 0;
bgsx[1] = -200;
bgsy[1] = -200;
}
}
if (bgd[1] == 9) {
boss.gotoAndStop(10);
if ((bgs[1] == 0) or (bgs[1] == 1)) {
bgs1.gotoAndStop(13);
}
if ((bgs[1] == 2) or (bgs[1] == 3)) {
bgs1.gotoAndStop(12);
}
if ((bgs[1] == 4) or (bgs[1] == 5)) {
bgs1.gotoAndStop(11);
}
if ((bgs[1] == 6) or (bgs[1] == 7)) {
bgs1.gotoAndStop(10);
}
if ((bgs[1] == 8) or (bgs[1] == 9)) {
bgs1.gotoAndStop(9);
}
if ((bgs[1] == 10) or (bgs[1] == 11)) {
bgs1.gotoAndStop(8);
}
bgs[1] = bgs[1] - 1;
if (bgs[1] < 0) {
bgd[1] = 1;
bgst[1] = 0;
bgsx[1] = -200;
bgsy[1] = -200;
}
}
if (bgd[1] == 10) {
boss.gotoAndStop(3);
bgx[1] = bgx[1] + 14;
bgy[1] = bgy[1] - (3 * bgs[1]);
bgs[1] = bgs[1] - 1;
if (bgs[1] < 0) {
bgd[1] = 12;
bgs[1] = 10;
}
}
if (bgd[1] == 12) {
boss.gotoAndStop(3);
bgx[1] = bgx[1] + 14;
bgy[1] = bgy[1] + ((10 - bgs[1]) * 3);
bgs[1] = bgs[1] - 1;
if (bgs[1] < 0) {
if (px < bgx[1]) {
bgd[1] = 1;
}
if (px > bgx[1]) {
bgd[1] = 0;
}
}
}
if (bgd[1] == 11) {
boss.gotoAndStop(8);
bgx[1] = bgx[1] - 14;
bgy[1] = bgy[1] - (3 * bgs[1]);
bgs[1] = bgs[1] - 1;
if (bgs[1] < 0) {
bgd[1] = 13;
bgs[1] = 10;
}
}
if (bgd[1] == 13) {
boss.gotoAndStop(8);
bgx[1] = bgx[1] - 14;
bgy[1] = bgy[1] + ((10 - bgs[1]) * 3);
bgs[1] = bgs[1] - 1;
if (bgs[1] < 0) {
if (px < bgx[1]) {
bgd[1] = 1;
}
if (px > bgx[1]) {
bgd[1] = 0;
}
}
}
if (bgd[1] == 14) {
boss.gotoAndStop(10);
if ((bgs[1] == 0) or (bgs[1] == 1)) {
boss.gotoAndStop(16);
}
if ((bgs[1] == 2) or (bgs[1] == 3)) {
boss.gotoAndStop(15);
}
if ((bgs[1] == 4) or (bgs[1] == 5)) {
boss.gotoAndStop(14);
}
if ((bgs[1] == 6) or (bgs[1] == 7)) {
boss.gotoAndStop(13);
}
if ((bgs[1] == 8) or (bgs[1] == 9)) {
boss.gotoAndStop(12);
}
if (bgs[1] == 10) {
boss.gotoAndStop(11);
}
bgs[1] = bgs[1] - 1;
if (bgs[1] < 0) {
gotoAndPlay (52);
}
}
r = 1;
while (r <= 5) {
if (bgst[r] > 0) {
if (bgst[r] == 1) {
if (bgsd[r] == 0) {
if (r == 1) {
bgs1.gotoAndStop(1);
}
if (r == 2) {
bgs2.gotoAndStop(1);
}
if (r == 3) {
bgs3.gotoAndStop(1);
}
if (r == 4) {
bgs4.gotoAndStop(1);
}
if (r == 5) {
bgs5.gotoAndStop(1);
}
bgsx[r] = bgsx[r] + 12;
if (bgsx[r] > 580) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgsd[r] == 1) {
if (r == 1) {
bgs1.gotoAndStop(2);
}
if (r == 2) {
bgs2.gotoAndStop(2);
}
if (r == 3) {
bgs3.gotoAndStop(2);
}
if (r == 4) {
bgs4.gotoAndStop(2);
}
if (r == 5) {
bgs5.gotoAndStop(2);
}
bgsx[r] = bgsx[r] - 12;
if (bgsx[r] < -30) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if ((((((((bgsx[r] - 25) < (px + 10)) and ((bgsx[r] + 25) > (px - 10))) and ((bgsy[r] + 25) > (py + 5))) and ((bgsy[r] - 25) < (py + 20))) and (pcd < 18)) and (i < 1)) and (pl > 0)) {
if ((bgsd[r] == 0) or (bgsd[r] == 2)) {
pcd = 19;
}
if ((bgsd[r] == 1) or (bgsd[r] == 3)) {
pcd = 18;
}
pstep = 2;
pl = pl - 3;
megah.start();
i = 10;
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgst[r] == 2) {
if (bgsd[r] == 0) {
if (r == 1) {
bgs1.gotoAndStop(1);
}
if (r == 2) {
bgs2.gotoAndStop(1);
}
if (r == 3) {
bgs3.gotoAndStop(1);
}
if (r == 4) {
bgs4.gotoAndStop(1);
}
if (r == 5) {
bgs5.gotoAndStop(1);
}
bgsx[r] = bgsx[r] + 22;
if (bgsx[r] > 580) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgsd[r] == 1) {
if (r == 1) {
bgs1.gotoAndStop(2);
}
if (r == 2) {
bgs2.gotoAndStop(2);
}
if (r == 3) {
bgs3.gotoAndStop(2);
}
if (r == 4) {
bgs4.gotoAndStop(2);
}
if (r == 5) {
bgs5.gotoAndStop(2);
}
bgsx[r] = bgsx[r] - 22;
if (bgsx[r] < -30) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if ((((((((bgsx[r] - 28) < (px + 10)) and ((bgsx[r] + 28) > (px - 10))) and ((bgsy[r] + 25) > (py + 5))) and ((bgsy[r] - 25) < (py + 20))) and (pcd < 18)) and (i < 1)) and (pl > 0)) {
if ((bgsd[r] == 0) or (bgsd[r] == 2)) {
pcd = 19;
}
if ((bgsd[r] == 1) or (bgsd[r] == 3)) {
pcd = 18;
}
pstep = 2;
pl = pl - 5;
megah.start();
i = 10;
bgst[r] = 0;
bgsx[r] = -200;
}
}
}
r++;
}
if ((bgst[1] == 3) and (bgsd[1] == 0)) {
if (((((((((bgsx[1] - (10 * (13 - bgs[1]))) + 50) < (px + 10)) and (((bgsx[1] + (10 * (13 - bgs[1]))) + 50) > (px - 10))) and ((bgsy[1] + 25) > (py + 5))) and (((bgsy[1] + 50) - (20 * (13 - bgs[1]))) < (py + 20))) and (pcd < 18)) and (i < 1)) and (pl > 0)) {
if ((bgsd[r] == 0) or (bgsd[r] == 2)) {
pcd = 19;
}
if ((bgsd[r] == 1) or (bgsd[r] == 3)) {
pcd = 18;
}
pstep = 2;
pl = pl - 4;
megah.start();
i = 10;
bgst[r] = 0;
bgsx[r] = -200;
}
}
if ((((((((bgx[1] - 30) < (px + 10)) and ((bgx[1] + 30) > (px - 10))) and ((bgy[1] + 60) > (py + 10))) and ((bgy[1] + 20) < (py + 50))) and (pcd < 18)) and (i < 1)) and (pl > 0)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 2;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 2;
}
megah.start();
i = 10;
}
if (bgx[1] < 25) {
bgx[1] = 25;
}
if (bgx[1] > 525) {
bgx[1] = 525;
}
bgs1._x = bgsx[1] / 2;
bgs1._y = (bgsy[1] / 2) - 20;
bgs2._x = bgsx[2] / 2;
bgs2._y = (bgsy[2] / 2) - 20;
bgs3._x = bgsx[3] / 2;
bgs3._y = (bgsy[3] / 2) - 20;
bgs4._x = bgsx[4] / 2;
bgs4._y = (bgsy[4] / 2) - 20;
bgs5._x = bgsx[5] / 2;
bgs5._y = (bgsy[5] / 2) - 20;
r = 1;
while (r <= 3) {
if (((pst[r] > 0) and (pst[r] < 4)) and (psd[r] == 0)) {
if (r == 1) {
shot1p._x = psx[1] / 2;
shot1p._y = psy[1] / 2;
}
if (r == 2) {
shot2p._x = psx[2] / 2;
shot2p._y = psy[2] / 2;
}
if (r == 3) {
shot3p._x = psx[3] / 2;
shot3p._y = psy[3] / 2;
}
}
if (((pst[r] > 0) and (pst[r] < 4)) and (psd[r] == 1)) {
if (r == 1) {
shot1p._x = psx[1] / 2;
shot1p._y = psy[1] / 2;
}
if (r == 2) {
shot2p._x = psx[2] / 2;
shot2p._y = psy[2] / 2;
}
if (r == 3) {
shot3p._x = psx[3] / 2;
shot3p._y = psy[3] / 2;
}
}
if ((pst[r] == 4) or (pst[r] == 5)) {
if (r == 1) {
shot1p._x = psx[1] / 2;
shot1p._y = psy[1] / 2;
}
if (r == 2) {
shot2p._x = psx[2] / 2;
shot2p._y = psy[2] / 2;
}
if (r == 3) {
shot3p._x = psx[3] / 2;
shot3p._y = psy[3] / 2;
}
}
if (pst[r] == 0) {
if (r == 1) {
shot1p._x = -200;
shot1p._y = (270 + psy[1]) - py;
}
if (r == 2) {
shot2p._x = -200;
shot2p._y = (270 + psy[2]) - py;
}
if (r == 3) {
shot3p._x = -200;
shot3p._y = (270 + psy[3]) - py;
}
}
r++;
}
if (i > 0) {
i = i - 1;
pc._alpha = 50;
}
if (i <= 0) {
i = i - 1;
pc._alpha = 100;
}
if (bi > 0) {
bi = bi - 1;
boss._alpha = 50;
}
if (bi <= 0) {
boss._alpha = 100;
}
if (bcharge > 0) {
charge._alpha = bcharge;
}
charge._x = px / 2;
charge._y = py / 2;
boss._x = bgx[1] / 2;
boss._y = (bgy[1] / 2) - 14;
pc._x = px / 2;
pc._y = py / 2;
lbar._height = 2 * pl;
lbar._y = 120 - (2 * pl);
bbar._height = 2 * bgl[1];
bbar._y = 120 - (2 * bgl[1]);
Frame 51
gotoAndPlay (50);
Frame 52
lbar._height = 2 * pl;
lbar._y = 120 - (2 * pl);
stage._x = (270 - px) / 2;
stage._y = (-725 - py) / 2;
exit._x = ((ex + 275) - px) / 2;
exit._y = ((ey + 275) - py) / 2;
Frame 54
gotoAndPlay (5);
Frame 55
psn = 1;
bstep = 0;
pcd = 0;
bcharge = 0;
r = 1;
while (r <= 5) {
psx[r] = -200;
psy[r] = 0;
pst[r] = 0;
psd[r] = 0;
r++;
}
i = 0;
pl = 50;
px = 150;
py = 373;
r = 0;
while (r <= 31) {
bx[r] = -50;
by[r] = -50;
r++;
}
bx[1] = 50;
by[1] = 250;
bx[2] = 50;
by[2] = 350;
bx[3] = 150;
by[3] = 450;
bx[4] = 250;
by[4] = 450;
bx[5] = 350;
by[5] = 450;
bx[6] = 450;
by[6] = 450;
bx[7] = 550;
by[7] = 400;
bx[8] = 650;
by[8] = 350;
bx[9] = 750;
by[9] = 300;
bx[10] = 850;
by[10] = 300;
bx[11] = 950;
by[11] = 350;
bx[12] = 1050;
by[12] = 350;
bx[13] = 1150;
by[13] = 300;
bx[14] = 1250;
by[14] = 300;
bx[15] = 1350;
by[15] = 350;
bx[16] = 1450;
by[16] = 400;
bx[17] = 1550;
by[17] = 400;
bx[18] = 1650;
by[18] = 300;
bx[19] = 1750;
by[19] = 200;
bx[20] = 1750;
by[20] = 100;
bsn = 1;
r = 1;
while (r <= 8) {
bgx[r] = -200;
bgy[r] = -200;
bgt[r] = 0;
bgd[r] = -1;
bgs[r] = 0;
r++;
}
r = 1;
while (r <= 5) {
bgsx[r] = -200;
bgsy[r] = 0;
bgst[r] = 0;
bgsd[r] = 0;
r++;
}
r = 1;
while (r <= 8) {
f[r] = 20;
r++;
}
bgt[1] = 2;
bgd[1] = 3;
bgs[1] = 0;
bgl[1] = 3;
bgx[1] = 350;
bgy[1] = 350;
bgt[2] = 6;
bgd[2] = 0;
bgs[2] = 0;
bgl[2] = 2;
bgx[2] = 550;
bgy[2] = 150;
bgt[3] = 6;
bgd[3] = 0;
bgs[3] = 0;
bgl[3] = 2;
bgx[3] = 650;
bgy[3] = 170;
bgt[4] = 6;
bgd[4] = 0;
bgs[4] = 0;
bgl[4] = 2;
bgx[4] = 800;
bgy[4] = 150;
bgt[5] = 2;
bgd[5] = 2;
bgs[5] = 0;
bgl[5] = 3;
bgx[5] = 850;
bgy[5] = 200;
bgt[6] = 6;
bgd[6] = 0;
bgs[6] = 0;
bgl[6] = 2;
bgx[6] = 950;
bgy[6] = 130;
bgt[7] = 6;
bgd[7] = 3;
bgs[7] = 0;
bgl[7] = 2;
bgx[7] = 1200;
bgy[7] = 120;
bgt[8] = 6;
bgd[8] = 0;
bgs[8] = 0;
bgl[8] = 2;
bgx[8] = 1300;
bgy[8] = 150;
ex = 1650;
ey = 200;
stopAllSounds();
Frame 56
lbar._height = 2 * pl;
lbar._y = 120 - (2 * pl);
stage._x = (170 - px) / 2;
stage._y = (180 - py) / 2;
exit._x = ((ex + 275) - px) / 2;
exit._y = ((ey + 275) - py) / 2;
pc.gotoAndStop(1);
Frame 67
b1._x = bx[1] / 10;
b1._y = (by[1] / 10) + 120;
b2._x = bx[2] / 10;
b2._y = (by[2] / 10) + 120;
b3._x = bx[3] / 10;
b3._y = (by[3] / 10) + 120;
b4._x = bx[4] / 10;
b4._y = (by[4] / 10) + 120;
b5._x = bx[5] / 10;
b5._y = (by[5] / 10) + 120;
b6._x = bx[6] / 10;
b6._y = (by[6] / 10) + 120;
b7._x = bx[7] / 10;
b7._y = (by[7] / 10) + 120;
b8._x = bx[8] / 10;
b8._y = (by[8] / 10) + 120;
b9._x = bx[9] / 10;
b9._y = (by[9] / 10) + 120;
b10._x = bx[10] / 10;
b10._y = (by[10] / 10) + 120;
b11._x = bx[11] / 10;
b11._y = (by[11] / 10) + 120;
b12._x = bx[12] / 10;
b12._y = (by[12] / 10) + 120;
b13._x = bx[13] / 10;
b13._y = (by[13] / 10) + 120;
b14._x = bx[14] / 10;
b14._y = (by[14] / 10) + 120;
b15._x = bx[15] / 10;
b15._y = (by[15] / 10) + 120;
b16._x = bx[16] / 10;
b16._y = (by[16] / 10) + 120;
b17._x = bx[17] / 10;
b17._y = (by[17] / 10) + 120;
b18._x = bx[18] / 10;
b18._y = (by[18] / 10) + 120;
b19._x = bx[19] / 10;
b19._y = (by[19] / 10) + 120;
b20._x = bx[20] / 10;
b20._y = (by[20] / 10) + 120;
b21._x = bx[21] / 10;
b21._y = (by[21] / 10) + 120;
b22._x = bx[22] / 10;
b22._y = (by[22] / 10) + 120;
b23._x = bx[23] / 10;
b23._y = (by[23] / 10) + 120;
b24._x = bx[24] / 10;
b24._y = (by[24] / 10) + 120;
b25._x = bx[25] / 10;
b25._y = (by[25] / 10) + 120;
b26._x = bx[26] / 10;
b26._y = (by[26] / 10) + 120;
b27._x = bx[27] / 10;
b27._y = (by[27] / 10) + 120;
b28._x = bx[28] / 10;
b28._y = (by[28] / 10) + 120;
cir._x = px / 10;
cir._y = (py / 10) + 120;
shot1._x = psx[1] / 10;
shot1._y = (psy[1] / 10) + 120;
shot2._x = psx[2] / 10;
shot2._y = (psy[2] / 10) + 120;
shot3._x = psx[3] / 10;
shot3._y = (psy[3] / 10) + 120;
bshot1._x = bgsx[1] / 10;
bshot1._y = (bgsy[1] / 10) + 120;
bshot2._x = bgsx[2] / 10;
bshot2._y = (bgsy[2] / 10) + 120;
bshot3._x = bgsx[3] / 10;
bshot3._y = (bgsy[3] / 10) + 120;
bshot4._x = bgsx[4] / 10;
bshot4._y = (bgsy[4] / 10) + 120;
bshot5._x = bgsx[5] / 10;
bshot5._y = (bgsy[5] / 10) + 120;
bcir1._x = bgx[1] / 10;
bcir1._y = (bgy[1] / 10) + 120;
bcir2._x = bgx[2] / 10;
bcir2._y = (bgy[2] / 10) + 120;
bcir3._x = bgx[3] / 10;
bcir3._y = (bgy[3] / 10) + 120;
bcir4._x = bgx[4] / 10;
bcir4._y = (bgy[4] / 10) + 120;
bcir5._x = bgx[5] / 10;
bcir5._y = (bgy[5] / 10) + 120;
bcir6._x = bgx[6] / 10;
bcir6._y = (bgy[6] / 10) + 120;
bcir7._x = bgx[7] / 10;
bcir7._y = (bgy[7] / 10) + 120;
bcir8._x = bgx[8] / 10;
bcir8._y = (bgy[8] / 10) + 120;
bcir9._x = bgx[9] / 10;
bcir9._y = (bgy[9] / 10) + 120;
bcir10._x = bgx[10] / 10;
bcir10._y = (bgy[10] / 10) + 120;
bcir11._x = bgx[11] / 10;
bcir11._y = (bgy[11] / 10) + 120;
bcir12._x = bgx[12] / 10;
bcir12._y = (bgy[12] / 10) + 120;
bcir13._x = bgx[13] / 10;
bcir13._y = (bgy[13] / 10) + 120;
if (Key.isDown(39) and (pcd == 0)) {
pcd = 2;
}
if (Key.isDown(39) and ((pcd == 1) or (pcd == 3))) {
pcd = 0;
}
if (Key.isDown(37) and (pcd == 1)) {
pcd = 3;
}
if (Key.isDown(37) and ((pcd == 0) or (pcd == 2))) {
pcd = 1;
}
if (Key.isDown(38) and ((pcd == 0) or (pcd == 2))) {
pcd = 10;
pstep = 7;
}
if (Key.isDown(38) and ((pcd == 1) or (pcd == 3))) {
pcd = 11;
pstep = 7;
}
if (Key.isDown(40) and ((((pcd == 0) or (pcd == 1)) or (pcd == 2)) or (pcd == 3))) {
if (((pcd == 0) or (pcd == 2)) or (pcd == 8)) {
pcd = 6;
pstep = 3;
}
if (((pcd == 1) or (pcd == 3)) or (pcd == 9)) {
pcd = 7;
pstep = 3;
}
}
if (Key.isDown(16) and (bcharge < 100)) {
bcharge = bcharge + 5;
}
if (pcd == 0) {
pc.gotoAndStop(1);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(21);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 0;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
}
if (pcd == 1) {
pc.gotoAndStop(2);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(22);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 1;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
}
if (pcd == 2) {
px = px + 13;
if ((w == 0) or (w == 1)) {
pc.gotoAndStop(3);
}
if ((w == 2) or (w == 3)) {
pc.gotoAndStop(4);
}
if ((w == 4) or (w == 5)) {
pc.gotoAndStop(5);
}
if ((w == 6) or (w == 7)) {
pc.gotoAndStop(6);
}
if (Key.isDown(32)) {
if ((w == 0) or (w == 1)) {
pc.gotoAndStop(11);
}
if ((w == 2) or (w == 3)) {
pc.gotoAndStop(12);
}
if ((w == 4) or (w == 5)) {
pc.gotoAndStop(13);
}
if ((w == 6) or (w == 7)) {
pc.gotoAndStop(14);
}
if ((pst[psn] == 0) and (bstep == 0)) {
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 0;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
}
pcd = 0;
}
if (pcd == 3) {
px = px - 13;
if ((w == 0) or (w == 1)) {
pc.gotoAndStop(7);
}
if ((w == 2) or (w == 3)) {
pc.gotoAndStop(8);
}
if ((w == 4) or (w == 5)) {
pc.gotoAndStop(9);
}
if ((w == 6) or (w == 7)) {
pc.gotoAndStop(10);
}
if (Key.isDown(32)) {
if ((w == 0) or (w == 1)) {
pc.gotoAndStop(15);
}
if ((w == 2) or (w == 3)) {
pc.gotoAndStop(16);
}
if ((w == 4) or (w == 5)) {
pc.gotoAndStop(17);
}
if ((w == 6) or (w == 7)) {
pc.gotoAndStop(18);
}
if ((pst[psn] == 0) and (bstep == 0)) {
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 1;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
}
pcd = 1;
}
if (pcd == 9) {
pstep = pstep - 1;
if (pstep <= 0) {
pcd = 1;
}
}
if (pcd == 6) {
pc.gotoAndStop(19);
px = px + 20;
pstep = pstep - 1;
if (pstep <= 0) {
pcd = 0;
}
}
if (pcd == 7) {
pc.gotoAndStop(20);
px = px - 20;
pstep = pstep - 1;
if (pstep <= 0) {
pcd = 1;
}
}
if (pcd == 12) {
pc.gotoAndStop(23);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(25);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 0;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
py = py + (5 * (7 - pstep));
pstep = pstep - 1;
if (pstep <= 2) {
pstep = 2;
}
if (Key.isDown(39)) {
px = px + 13;
}
if (Key.isDown(37)) {
px = px - 13;
if (bstep == 0) {
pcd = 13;
}
}
}
if (pcd == 13) {
pc.gotoAndStop(24);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(26);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 1;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
py = py + (5 * (7 - pstep));
pstep = pstep - 1;
if (pstep <= 2) {
pstep = 2;
}
if (Key.isDown(39)) {
px = px + 13;
if (bstep == 0) {
pcd = 12;
}
}
if (Key.isDown(37)) {
px = px - 13;
}
}
if (pcd == 10) {
pc.gotoAndStop(23);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(25);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 0;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
py = py - (5 * pstep);
pstep = pstep - 1;
if (Key.isDown(39)) {
px = px + 13;
}
if (Key.isDown(37)) {
px = px - 13;
if (bstep == 0) {
pcd = 11;
}
}
if (Key.isDown(40)) {
pcd = 12;
pstep = pstep + 3;
}
if (pstep <= -1) {
pstep = 7;
pcd = 12;
}
}
if (pcd == 11) {
pc.gotoAndStop(24);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(26);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 1;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
py = py - (5 * pstep);
pstep = pstep - 1;
if (Key.isDown(39)) {
px = px + 13;
if (bstep == 0) {
pcd = 10;
}
}
if (Key.isDown(37)) {
px = px - 13;
}
if (Key.isDown(40)) {
pcd = 13;
pstep = pstep + 3;
}
if (pstep <= -1) {
pstep = 7;
pcd = 13;
}
}
if (pcd == 18) {
pc.gotoAndStop(27);
pstep = pstep - 1;
px = px - 5;
if (pstep <= -1) {
pstep = 2;
pcd = 0;
}
}
if (pcd == 19) {
pc.gotoAndStop(28);
pstep = pstep - 1;
px = px + 5;
if (pstep <= -1) {
pstep = 2;
pcd = 1;
}
}
if (pcd == 20) {
pc.gotoAndStop(69 - pstep);
bcharge = 0;
charge._alpha = 0;
bstep = 20;
pl = 1;
pstep = pstep - 1;
if (pstep < 0) {
lives = lives - 1;
if (lives >= 0) {
pl = 50;
gotoAndPlay (55);
}
if (lives < 0) {
lives = 2;
continues = continues - 1;
gotoAndPlay (5);
}
}
}
if (pl <= 0) {
c = 1;
while (c <= 8) {
bgx[c] = -600;
c++;
}
pc._alpha = 100;
pcd = 20;
pstep = 40;
megad.start();
}
if (bstep > 0) {
bcharge = 0;
charge._alpha = bcharge;
}
if (bstep > 0) {
bstep = bstep - 1;
}
if ((py > 500) and (pcd < 20)) {
megad.start();
pl = 0;
}
w = w - 1;
if (w < 0) {
w = 7;
}
e = pcd;
c = 0;
r = 1;
while (r <= 20) {
if (((((bx[r] - 150) < px) and ((bx[r] + 150) > px)) and ((by[r] - 150) < py)) and ((by[r] + 150) > py)) {
if (((((((px - 30) < (bx[r] + 50)) and ((px + 20) > (bx[r] - 50))) and (py < (by[r] - 50))) and ((py + 60) > (by[r] - 50))) and (pcd != 10)) and (pcd != 11)) {
if ((((pcd == 12) or (pcd == 13)) or (pcd == 16)) or (pcd == 17)) {
if ((pcd == 12) or (pcd == 16)) {
pcd = 0;
}
if ((pcd == 13) or (pcd == 17)) {
pcd = 1;
}
}
c = 1;
py = by[r] - 75;
}
if (((((px + 38) > (bx[r] - 50)) and ((px + 20) < bx[r])) and (py < (by[r] + 50))) and ((py + 20) > (by[r] - 50))) {
px = bx[r] - 85;
}
if (((((px - 35) < (bx[r] + 50)) and ((px - 20) > bx[r])) and (py < (by[r] + 50))) and ((py + 20) > (by[r] - 50))) {
px = bx[r] + 85;
}
if (((((px - 5) < (bx[r] + 50)) and ((px + 5) > (bx[r] - 50))) and ((py - 30) < (by[r] + 50))) and ((py + 10) > (by[r] + 50))) {
if ((((pcd == 10) or (pcd == 11)) or (pcd == 14)) or (pcd == 15)) {
if ((pcd == 10) or (pcd == 14)) {
pcd = 12;
pstep = 5;
}
if ((pcd == 11) or (pcd == 15)) {
pcd = 13;
pstep = 5;
}
}
py = by[r] + 90;
}
}
r++;
}
if (c == 0) {
if ((((pcd == 0) or (pcd == 2)) or (pcd == 6)) or (pcd == 18)) {
pcd = 12;
pstep = 6;
}
if ((((pcd == 1) or (pcd == 3)) or (pcd == 7)) or (pcd == 19)) {
pcd = 13;
pstep = 6;
}
}
r = 1;
while (r <= 3) {
if (pst[r] == 1) {
if (psd[r] == 0) {
psx[r] = psx[r] + 30;
if (r == 1) {
shot1p.gotoAndStop(1);
}
if (r == 2) {
shot2p.gotoAndStop(1);
}
if (r == 3) {
shot3p.gotoAndStop(1);
}
if (psx[r] > (px + 280)) {
pst[r] = 0;
psx[r] = -200;
}
}
if (psd[r] == 1) {
psx[r] = psx[r] - 30;
if (r == 1) {
shot1p.gotoAndStop(2);
}
if (r == 2) {
shot2p.gotoAndStop(2);
}
if (r == 3) {
shot3p.gotoAndStop(2);
}
if (psx[r] < (px - 280)) {
pst[r] = 0;
psx[r] = -200;
}
}
}
if (pst[r] == 2) {
if (psd[r] == 0) {
psx[r] = psx[r] + 35;
if (r == 1) {
shot1p.gotoAndStop(3);
}
if (r == 2) {
shot2p.gotoAndStop(3);
}
if (r == 3) {
shot3p.gotoAndStop(3);
}
if (psx[r] > (px + 280)) {
pst[r] = 0;
psx[r] = -200;
}
}
if (psd[r] == 1) {
psx[r] = psx[r] - 35;
if (r == 1) {
shot1p.gotoAndStop(4);
}
if (r == 2) {
shot2p.gotoAndStop(4);
}
if (r == 3) {
shot3p.gotoAndStop(4);
}
if (psx[r] < (px - 280)) {
pst[r] = 0;
psx[r] = -200;
}
}
}
if (pst[r] == 3) {
if (psd[r] == 0) {
psx[r] = psx[r] + 40;
if (r == 1) {
shot1p.gotoAndStop(5);
}
if (r == 2) {
shot2p.gotoAndStop(5);
}
if (r == 3) {
shot3p.gotoAndStop(5);
}
if (psx[r] > (px + 280)) {
pst[r] = 0;
psx[r] = -200;
}
}
if (psd[r] == 1) {
psx[r] = psx[r] - 40;
if (r == 1) {
shot1p.gotoAndStop(6);
}
if (r == 2) {
shot2p.gotoAndStop(6);
}
if (r == 3) {
shot3p.gotoAndStop(6);
}
if (psx[r] < (px - 280)) {
pst[r] = 0;
psx[r] = -200;
}
}
}
if (pst[r] == 4) {
if (r == 1) {
shot1p.gotoAndStop(10 - psd[r]);
}
if (r == 2) {
shot2p.gotoAndStop(10 - psd[r]);
}
if (r == 3) {
shot3p.gotoAndStop(10 - psd[r]);
}
psd[r] = psd[r] - 1;
if (psd[r] < 0) {
pst[r] = 0;
psx[r] = -200;
}
}
if (pst[r] == 5) {
if (r == 1) {
shot1p.gotoAndStop(14 - psd[r]);
}
if (r == 2) {
shot2p.gotoAndStop(14 - psd[r]);
}
if (r == 3) {
shot3p.gotoAndStop(14 - psd[r]);
}
psd[r] = psd[r] - 1;
if (psd[r] < 0) {
pst[r] = 0;
psx[r] = -200;
}
}
r++;
}
while (c <= 8) {
r = 1;
while (r <= 3) {
if ((pst[r] > 0) and (pst[r] < 4)) {
if (((((bgt[c] == 2) and ((bgx[c] - 35) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 35) > (psx[r] - ((pst[r] * 20) - 20)))) and (bgy[c] < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 50) > (psy[r] - ((pst[r] * 20) - 20)))) {
if ((((bgd[c] == 0) or (bgd[c] == 3)) or (bgd[c] == 1)) or (bgd[c] == 4)) {
deflect.start();
pst[r] = 5;
psd[r] = 2;
}
if ((bgd[c] == 2) or (bgd[c] == 5)) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd2.start();
bgd[c] = 6;
bgs[c] = 6;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
if (((((bgt[c] == 6) and ((bgx[c] - 35) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 35) > (psx[r] - ((pst[r] * 20) - 20)))) and ((bgy[c] - 50) < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 20) > (psy[r] - ((pst[r] * 20) - 20)))) {
if ((bgd[c] == 0) or (bgd[c] == 1)) {
deflect.start();
pst[r] = 5;
psd[r] = 2;
}
if (bgd[c] == 2) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd2.start();
bgd[c] = 3;
bgs[c] = 4;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
}
r++;
}
c++;
}
r = 1;
while (r <= 8) {
if (((((bgt[r] > 0) and ((bgx[r] - 340) < px)) and ((bgx[r] + 340) > px)) and ((bgy[r] - 180) < py)) and ((bgy[r] + 350) > py)) {
c = 0;
e = 1;
while (e <= 20) {
if (((((bx[e] - 150) < bgx[r]) and ((bx[e] + 150) > bgx[r])) and ((by[e] - 150) < bgy[r])) and ((by[e] + 150) > bgy[r])) {
if (((((bgx[r] + 20) >= (bx[e] - 50)) and ((bgx[r] - 20) <= (bx[e] + 50))) and ((bgy[r] + 45) > (by[e] - 60))) and ((bgy[r] - 10) < (by[e] - 40))) {
c = 1;
}
if (((((bgx[r] + 20) > (bx[e] - 50)) and ((bgx[r] + 20) < bx[e])) and (bgy[r] < (by[e] + 50))) and ((bgy[r] + 20) > (by[e] - 50))) {
bgx[r] = bx[e] - 70;
}
if (((((bgx[r] - 20) < (bx[e] + 50)) and ((bgx[r] + 20) > bx[e])) and (bgy[r] < (by[e] + 50))) and ((bgy[r] + 20) > (by[e] - 50))) {
bgx[r] = bx[e] + 70;
}
if (((((bgx[r] - 5) < (bx[e] + 50)) and ((bgx[r] + 5) > (bx[e] - 50))) and ((bgy[r] - 30) < (by[e] + 50))) and (bgy[r] > (by[e] + 50))) {
bgy[r] = by[e] + 70;
}
if (((((bgx[r] - 2) < (bx[e] + 50)) and ((bgx[r] + 2) > (bx[e] - 50))) and ((bgy[r] + 20) < (by[e] - 50))) and ((bgy[r] + 60) > (by[e] - 50))) {
c = 1;
bgy[r] = by[e] - 105;
}
}
e++;
}
if (c == 0) {
bgy[r] = bgy[r] + 10;
}
if (bgt[r] == 2) {
if (((((((bgx[r] - 15) < (px + 10)) and ((bgx[r] + 15) > (px - 10))) and ((bgy[r] + 80) > (py - 10))) and ((bgy[r] + 50) < (py + 50))) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 3;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 3;
}
megah.start();
i = 10;
}
if (bgd[r] == 0) {
f[r] = 1;
if (px < bgx[r]) {
bgd[r] = 3;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 1;
bgs[r] = 10;
}
}
if (bgd[r] == 3) {
f[r] = 5;
if (px > bgx[r]) {
bgd[r] = 0;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 4;
bgs[r] = 10;
}
}
if (bgd[r] == 1) {
f[r] = 2;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 2;
bgs[r] = 12;
}
}
if (bgd[r] == 2) {
if (((bgs[r] == 12) or (bgs[r] == 11)) or (bgs[r] == 10)) {
f[r] = 3;
}
if (((bgs[r] == 9) or (bgs[r] == 8)) or (bgs[r] == 7)) {
f[r] = 4;
}
if (((bgs[r] == 6) or (bgs[r] == 5)) or (bgs[r] == 4)) {
f[r] = 3;
}
if (((bgs[r] == 3) or (bgs[r] == 2)) or (bgs[r] == 1)) {
f[r] = 4;
}
bgx[r] = bgx[r] + 8;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 0;
bgs[r] = 10 + random(20);
}
}
if (bgd[r] == 4) {
f[r] = 6;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 5;
bgs[r] = 12;
}
}
if (bgd[r] == 5) {
if (((bgs[r] == 12) or (bgs[r] == 11)) or (bgs[r] == 10)) {
f[r] = 7;
}
if (((bgs[r] == 9) or (bgs[r] == 8)) or (bgs[r] == 7)) {
f[r] = 8;
}
if (((bgs[r] == 6) or (bgs[r] == 5)) or (bgs[r] == 4)) {
f[r] = 7;
}
if (((bgs[r] == 3) or (bgs[r] == 2)) or (bgs[r] == 1)) {
f[r] = 8;
}
bgx[r] = bgx[r] - 8;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 3;
bgs[r] = 10 + random(20);
}
}
if (bgd[r] == 6) {
if (bgs[r] == 6) {
f[r] = 9;
}
if (bgs[r] == 5) {
f[r] = 10;
}
if (bgs[r] == 4) {
f[r] = 11;
}
if (bgs[r] == 3) {
f[r] = 12;
}
if (bgs[r] == 2) {
f[r] = 13;
}
if (bgs[r] == 1) {
f[r] = 14;
}
bgs[r] = bgs[r] - 1;
bgy[r] = bgy[r] - 10;
if (bgs[r] <= 0) {
f[r] = 15;
bgt[r] = 0;
bgx[r] = -500;
bgs[r] = 0;
}
}
}
if (bgt[r] == 6) {
if (((((((bgx[r] - 10) < (px + 10)) and ((bgx[r] + 10) > (px - 10))) and ((bgy[r] + 50) > (py + 10))) and ((bgy[r] + 10) < (py + 50))) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 4;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 4;
}
megah.start();
i = 10;
}
if (bgd[r] == 0) {
f[r] = 1;
bgy[r] = bgy[r] - 10;
if (((((px - 120) < bgx[r]) and ((px + 120) > bgx[r])) and ((bgy[r] - 80) < py)) and ((bgy[r] + 150) > py)) {
bgd[r] = 1;
bgs[r] = 6;
}
}
if (bgd[r] == 1) {
bgy[r] = bgy[r] - 10;
if (((bgs[r] == 6) or (bgs[r] == 5)) or (bgs[r] == 4)) {
f[r] = 2;
}
if (((bgs[r] == 3) or (bgs[r] == 2)) or (bgs[r] == 1)) {
f[r] = 3;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgs[r] = 4;
bgd[r] = 2;
}
}
if (bgd[r] == 2) {
if ((bgs[r] == 4) or (bgs[r] == 3)) {
f[r] = 4;
}
if ((bgs[r] == 2) or (bgs[r] == 1)) {
f[r] = 5;
}
if (px < bgx[r]) {
bgx[r] = (bgx[r] - 1) - random(10);
}
if (px > bgx[r]) {
bgx[r] = (bgx[r] + 1) + random(10);
}
if (py > bgy[r]) {
bgy[r] = bgy[r] + random(8);
}
if (py < bgy[r]) {
bgy[r] = (bgy[r] - 10) - random(10);
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgs[r] = 4;
}
}
if (bgd[r] == 3) {
if (bgs[r] == 4) {
f[r] = 6;
}
if (bgs[r] == 3) {
f[r] = 7;
}
if (bgs[r] == 2) {
f[r] = 8;
}
if (bgs[r] == 1) {
f[r] = 9;
}
bgs[r] = bgs[r] - 1;
bgy[r] = bgy[r] - 10;
if (bgs[r] <= 0) {
f[r] = 10;
bgt[r] = 0;
bgx[r] = -500;
bgs[r] = 0;
}
}
}
}
r++;
}
r = 1;
while (r <= 5) {
if (bgst[r] > 0) {
if (bgst[r] == 1) {
if (r == 1) {
bgs1.gotoAndStop(1);
}
if (r == 2) {
bgs2.gotoAndStop(1);
}
if (r == 3) {
bgs3.gotoAndStop(1);
}
if (r == 4) {
bgs4.gotoAndStop(1);
}
if (r == 5) {
bgs5.gotoAndStop(1);
}
if (bgsd[r] == 0) {
bgsx[r] = bgsx[r] + 20;
if (bgsx[r] > (px + 300)) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgsd[r] == 1) {
bgsx[r] = bgsx[r] - 20;
if (bgsx[r] < (px - 300)) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgsd[r] == 2) {
bgsx[r] = bgsx[r] + 15;
bgsy[r] = bgsy[r] + 15;
if ((bgsx[r] > (px + 300)) or (bgsy[r] > (py + 300))) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgsd[r] == 3) {
bgsx[r] = bgsx[r] - 15;
bgsy[r] = bgsy[r] + 15;
if ((bgsx[r] > (px + 300)) or (bgsy[r] > (py + 300))) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgsd[r] == 4) {
bgsy[r] = bgsy[r] + 20;
if (bgsy[r] > (py + 300)) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (((((((bgsx[r] - 15) < (px + 10)) and ((bgsx[r] + 15) > (px - 10))) and ((bgsy[r] + 15) > (py + 5))) and ((bgsy[r] - 15) < (py + 20))) and (pcd < 18)) and (i < 1)) {
if ((bgsd[r] == 0) or (bgsd[r] == 2)) {
pcd = 19;
}
if ((bgsd[r] == 1) or (bgsd[r] == 3)) {
pcd = 18;
}
pstep = 2;
pl = pl - 3;
megah.start();
i = 10;
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgst[r] == 2) {
if (r == 1) {
bgs1.gotoAndStop(2);
}
if (r == 2) {
bgs2.gotoAndStop(2);
}
if (r == 3) {
bgs3.gotoAndStop(2);
}
if (r == 4) {
bgs4.gotoAndStop(2);
}
if (r == 5) {
bgs5.gotoAndStop(2);
}
if (bgsd[r] == 0) {
bgsx[r] = bgsx[r] + 30;
if (bgsx[r] > (px + 300)) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgsd[r] == 1) {
bgsx[r] = bgsx[r] - 30;
if (bgsx[r] < (px - 300)) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (((((((bgsx[r] - 25) < (px + 10)) and ((bgsx[r] + 25) > (px - 10))) and ((bgsy[r] + 80) > (py + 40))) and ((bgsy[r] + 35) < (py + 60))) and (pcd < 18)) and (i < 1)) {
if (bgsd[r] == 0) {
pcd = 19;
}
if (bgsd[r] == 1) {
pcd = 18;
}
pstep = 2;
pl = pl - 6;
megah.start();
i = 10;
bgst[r] = 0;
bgsx[r] = -200;
}
}
}
r++;
}
bg1.gotoAndStop(f[1]);
bg2.gotoAndStop(f[2]);
bg3.gotoAndStop(f[3]);
bg4.gotoAndStop(f[4]);
bg5.gotoAndStop(f[5]);
bg6.gotoAndStop(f[6]);
bg7.gotoAndStop(f[7]);
bg8.gotoAndStop(f[8]);
bgs1._x = ((bgsx[1] + 275) - px) / 2;
bgs1._y = ((bgsy[1] + 275) - py) / 2;
bgs2._x = ((bgsx[2] + 275) - px) / 2;
bgs2._y = ((bgsy[2] + 275) - py) / 2;
bgs3._x = ((bgsx[3] + 275) - px) / 2;
bgs3._y = ((bgsy[3] + 275) - py) / 2;
bgs4._x = ((bgsx[4] + 275) - px) / 2;
bgs4._y = ((bgsy[4] + 275) - py) / 2;
bgs5._x = ((bgsx[5] + 275) - px) / 2;
bgs5._y = ((bgsy[5] + 275) - py) / 2;
bg1._x = ((bgx[1] + 275) - px) / 2;
bg1._y = ((bgy[1] + 275) - py) / 2;
bg2._x = ((bgx[2] + 275) - px) / 2;
bg2._y = ((bgy[2] + 275) - py) / 2;
bg3._x = ((bgx[3] + 275) - px) / 2;
bg3._y = ((bgy[3] + 275) - py) / 2;
bg4._x = ((bgx[4] + 275) - px) / 2;
bg4._y = ((bgy[4] + 275) - py) / 2;
bg5._x = ((bgx[5] + 275) - px) / 2;
bg5._y = ((bgy[5] + 275) - py) / 2;
bg6._x = ((bgx[6] + 275) - px) / 2;
bg6._y = ((bgy[6] + 275) - py) / 2;
bg7._x = ((bgx[7] + 275) - px) / 2;
bg7._y = ((bgy[7] + 275) - py) / 2;
bg8._x = ((bgx[8] + 275) - px) / 2;
bg8._y = ((bgy[8] + 275) - py) / 2;
r = 1;
while (r <= 3) {
if (((pst[r] > 0) and (pst[r] < 4)) and (psd[r] == 0)) {
if (r == 1) {
shot1p._x = ((297 + psx[1]) - px) / 2;
shot1p._y = ((270 + psy[1]) - py) / 2;
}
if (r == 2) {
shot2p._x = ((297 + psx[2]) - px) / 2;
shot2p._y = ((270 + psy[2]) - py) / 2;
}
if (r == 3) {
shot3p._x = ((297 + psx[3]) - px) / 2;
shot3p._y = ((270 + psy[3]) - py) / 2;
}
}
if (((pst[r] > 0) and (pst[r] < 4)) and (psd[r] == 1)) {
if (r == 1) {
shot1p._x = ((247 + psx[1]) - px) / 2;
shot1p._y = ((270 + psy[1]) - py) / 2;
}
if (r == 2) {
shot2p._x = ((247 + psx[2]) - px) / 2;
shot2p._y = ((270 + psy[2]) - py) / 2;
}
if (r == 3) {
shot3p._x = ((247 + psx[3]) - px) / 2;
shot3p._y = ((270 + psy[3]) - py) / 2;
}
}
if ((pst[r] == 4) or (pst[r] == 5)) {
if (r == 1) {
shot1p._x = ((272 + psx[1]) - px) / 2;
shot1p._y = ((270 + psy[1]) - py) / 2;
}
if (r == 2) {
shot2p._x = ((272 + psx[2]) - px) / 2;
shot2p._y = ((270 + psy[2]) - py) / 2;
}
if (r == 3) {
shot3p._x = ((272 + psx[3]) - px) / 2;
shot3p._y = ((270 + psy[3]) - py) / 2;
}
}
if (pst[r] == 0) {
if (r == 1) {
shot1p._x = -200;
shot1p._y = (270 + psy[1]) - py;
}
if (r == 2) {
shot2p._x = -200;
shot2p._y = (270 + psy[2]) - py;
}
if (r == 3) {
shot3p._x = -200;
shot3p._y = (270 + psy[3]) - py;
}
}
r++;
}
if (i > 0) {
i = i - 1;
pc._alpha = 50;
}
if (i <= 0) {
i = i - 1;
pc._alpha = 100;
}
if (bcharge > 0) {
charge._alpha = bcharge;
}
lbar._height = 2 * pl;
lbar._y = 120 - (2 * pl);
stage._x = (170 - px) / 2;
stage._y = (180 - py) / 2;
exit._x = ((ex + 275) - px) / 2;
exit._y = ((ey + 275) - py) / 2;
Frame 68
gotoAndPlay (67);
if ((((px + 10) > (ex - 20)) and ((px - 10) < (ex + 20))) and (((py + 30) > (ey - 20)) and (py < (ey + 50)))) {
gotoAndPlay (69);
}
Frame 69
lbar._height = 2 * pl;
lbar._y = 120 - (2 * pl);
stage._x = (170 - px) / 2;
stage._y = (180 - py) / 2;
exit._x = ((ex + 275) - px) / 2;
exit._y = ((ey + 275) - py) / 2;
Frame 72
psn = 1;
bstep = 0;
pcd = 0;
bcharge = 0;
r = 1;
while (r <= 5) {
psx[r] = -200;
psy[r] = 0;
pst[r] = 0;
psd[r] = 0;
r++;
}
i = 0;
pl = pl + 5;
if (pl > 50) {
pl = 50;
}
px = 350;
py = 50;
r = 0;
while (r <= 31) {
bx[r] = -50;
by[r] = -50;
r++;
}
bx[1] = 250;
by[1] = -50;
bx[2] = 250;
by[2] = 50;
bx[3] = 350;
by[3] = 150;
bx[4] = 450;
by[4] = 250;
bx[5] = 550;
by[5] = 250;
bx[6] = 650;
by[6] = 300;
bx[7] = 750;
by[7] = 300;
bx[8] = 850;
by[8] = 200;
bx[9] = 950;
by[9] = 175;
bx[10] = 950;
by[10] = 75;
bx[11] = 1050;
by[11] = 0;
bx[12] = 1150;
by[12] = 100;
bx[13] = 1250;
by[13] = 200;
bx[14] = 1350;
by[14] = 200;
bx[15] = 1450;
by[15] = 300;
bx[16] = 1550;
by[16] = 350;
bx[17] = 1650;
by[17] = 350;
bx[18] = 1750;
by[18] = 250;
bx[19] = 1650;
by[19] = 150;
bx[20] = 1650;
by[20] = 50;
bx[21] = 1650;
by[21] = -50;
bsn = 1;
r = 1;
while (r <= 8) {
bgx[r] = -200;
bgy[r] = -200;
bgt[r] = 0;
bgd[r] = -1;
bgs[r] = 0;
r++;
}
r = 1;
while (r <= 5) {
bgsx[r] = -200;
bgsy[r] = 0;
bgst[r] = 0;
bgsd[r] = 0;
r++;
}
r = 1;
while (r <= 8) {
f[r] = 20;
r++;
}
bgt[1] = 6;
bgd[1] = 0;
bgs[1] = 0;
bgl[1] = 2;
bgx[1] = 650;
bgy[1] = 50;
bgt[2] = 6;
bgd[2] = 0;
bgs[2] = 0;
bgl[2] = 2;
bgx[2] = 850;
bgy[2] = -70;
bgt[3] = 13;
bgd[3] = 0;
bgs[3] = 0;
bgl[3] = 6;
bgx[3] = 800;
bgy[3] = 190;
bgt[4] = 6;
bgd[4] = 0;
bgs[4] = 0;
bgl[4] = 2;
bgx[4] = 1350;
bgy[4] = -50;
bgt[5] = 13;
bgd[5] = 0;
bgs[5] = 0;
bgl[5] = 6;
bgx[5] = 1450;
bgy[5] = 200;
ex = 1650;
ey = 250;
Frame 73
b1._x = bx[1] / 10;
b1._y = (by[1] / 10) + 120;
b2._x = bx[2] / 10;
b2._y = (by[2] / 10) + 120;
b3._x = bx[3] / 10;
b3._y = (by[3] / 10) + 120;
b4._x = bx[4] / 10;
b4._y = (by[4] / 10) + 120;
b5._x = bx[5] / 10;
b5._y = (by[5] / 10) + 120;
b6._x = bx[6] / 10;
b6._y = (by[6] / 10) + 120;
b7._x = bx[7] / 10;
b7._y = (by[7] / 10) + 120;
b8._x = bx[8] / 10;
b8._y = (by[8] / 10) + 120;
b9._x = bx[9] / 10;
b9._y = (by[9] / 10) + 120;
b10._x = bx[10] / 10;
b10._y = (by[10] / 10) + 120;
b11._x = bx[11] / 10;
b11._y = (by[11] / 10) + 120;
b12._x = bx[12] / 10;
b12._y = (by[12] / 10) + 120;
b13._x = bx[13] / 10;
b13._y = (by[13] / 10) + 120;
b14._x = bx[14] / 10;
b14._y = (by[14] / 10) + 120;
b15._x = bx[15] / 10;
b15._y = (by[15] / 10) + 120;
b16._x = bx[16] / 10;
b16._y = (by[16] / 10) + 120;
b17._x = bx[17] / 10;
b17._y = (by[17] / 10) + 120;
b18._x = bx[18] / 10;
b18._y = (by[18] / 10) + 120;
b19._x = bx[19] / 10;
b19._y = (by[19] / 10) + 120;
b20._x = bx[20] / 10;
b20._y = (by[20] / 10) + 120;
b21._x = bx[21] / 10;
b21._y = (by[21] / 10) + 120;
b22._x = bx[22] / 10;
b22._y = (by[22] / 10) + 120;
b23._x = bx[23] / 10;
b23._y = (by[23] / 10) + 120;
b24._x = bx[24] / 10;
b24._y = (by[24] / 10) + 120;
b25._x = bx[25] / 10;
b25._y = (by[25] / 10) + 120;
b26._x = bx[26] / 10;
b26._y = (by[26] / 10) + 120;
b27._x = bx[27] / 10;
b27._y = (by[27] / 10) + 120;
b28._x = bx[28] / 10;
b28._y = (by[28] / 10) + 120;
cir._x = px / 10;
cir._y = (py / 10) + 120;
shot1._x = psx[1] / 10;
shot1._y = (psy[1] / 10) + 120;
shot2._x = psx[2] / 10;
shot2._y = (psy[2] / 10) + 120;
shot3._x = psx[3] / 10;
shot3._y = (psy[3] / 10) + 120;
bshot1._x = bgsx[1] / 10;
bshot1._y = (bgsy[1] / 10) + 120;
bshot2._x = bgsx[2] / 10;
bshot2._y = (bgsy[2] / 10) + 120;
bshot3._x = bgsx[3] / 10;
bshot3._y = (bgsy[3] / 10) + 120;
bshot4._x = bgsx[4] / 10;
bshot4._y = (bgsy[4] / 10) + 120;
bshot5._x = bgsx[5] / 10;
bshot5._y = (bgsy[5] / 10) + 120;
bcir1._x = bgx[1] / 10;
bcir1._y = (bgy[1] / 10) + 120;
bcir2._x = bgx[2] / 10;
bcir2._y = (bgy[2] / 10) + 120;
bcir3._x = bgx[3] / 10;
bcir3._y = (bgy[3] / 10) + 120;
bcir4._x = bgx[4] / 10;
bcir4._y = (bgy[4] / 10) + 120;
bcir5._x = bgx[5] / 10;
bcir5._y = (bgy[5] / 10) + 120;
bcir6._x = bgx[6] / 10;
bcir6._y = (bgy[6] / 10) + 120;
bcir7._x = bgx[7] / 10;
bcir7._y = (bgy[7] / 10) + 120;
bcir8._x = bgx[8] / 10;
bcir8._y = (bgy[8] / 10) + 120;
bcir9._x = bgx[9] / 10;
bcir9._y = (bgy[9] / 10) + 120;
bcir10._x = bgx[10] / 10;
bcir10._y = (bgy[10] / 10) + 120;
bcir11._x = bgx[11] / 10;
bcir11._y = (bgy[11] / 10) + 120;
bcir12._x = bgx[12] / 10;
bcir12._y = (bgy[12] / 10) + 120;
bcir13._x = bgx[13] / 10;
bcir13._y = (bgy[13] / 10) + 120;
if (Key.isDown(39) and (pcd == 0)) {
pcd = 2;
}
if (Key.isDown(39) and ((pcd == 1) or (pcd == 3))) {
pcd = 0;
}
if (Key.isDown(37) and (pcd == 1)) {
pcd = 3;
}
if (Key.isDown(37) and ((pcd == 0) or (pcd == 2))) {
pcd = 1;
}
if (Key.isDown(38) and ((pcd == 0) or (pcd == 2))) {
pcd = 10;
pstep = 7;
}
if (Key.isDown(38) and ((pcd == 1) or (pcd == 3))) {
pcd = 11;
pstep = 7;
}
if (Key.isDown(40) and ((((pcd == 0) or (pcd == 1)) or (pcd == 2)) or (pcd == 3))) {
if (((pcd == 0) or (pcd == 2)) or (pcd == 8)) {
pcd = 6;
pstep = 3;
}
if (((pcd == 1) or (pcd == 3)) or (pcd == 9)) {
pcd = 7;
pstep = 3;
}
}
if (Key.isDown(16) and (bcharge < 100)) {
bcharge = bcharge + 5;
}
if (pcd == 0) {
pc.gotoAndStop(1);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(21);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 0;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
}
if (pcd == 1) {
pc.gotoAndStop(2);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(22);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 1;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
}
if (pcd == 2) {
px = px + 13;
if ((w == 0) or (w == 1)) {
pc.gotoAndStop(3);
}
if ((w == 2) or (w == 3)) {
pc.gotoAndStop(4);
}
if ((w == 4) or (w == 5)) {
pc.gotoAndStop(5);
}
if ((w == 6) or (w == 7)) {
pc.gotoAndStop(6);
}
if (Key.isDown(32)) {
if ((w == 0) or (w == 1)) {
pc.gotoAndStop(11);
}
if ((w == 2) or (w == 3)) {
pc.gotoAndStop(12);
}
if ((w == 4) or (w == 5)) {
pc.gotoAndStop(13);
}
if ((w == 6) or (w == 7)) {
pc.gotoAndStop(14);
}
if ((pst[psn] == 0) and (bstep == 0)) {
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 0;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
}
pcd = 0;
}
if (pcd == 3) {
px = px - 13;
if ((w == 0) or (w == 1)) {
pc.gotoAndStop(7);
}
if ((w == 2) or (w == 3)) {
pc.gotoAndStop(8);
}
if ((w == 4) or (w == 5)) {
pc.gotoAndStop(9);
}
if ((w == 6) or (w == 7)) {
pc.gotoAndStop(10);
}
if (Key.isDown(32)) {
if ((w == 0) or (w == 1)) {
pc.gotoAndStop(15);
}
if ((w == 2) or (w == 3)) {
pc.gotoAndStop(16);
}
if ((w == 4) or (w == 5)) {
pc.gotoAndStop(17);
}
if ((w == 6) or (w == 7)) {
pc.gotoAndStop(18);
}
if ((pst[psn] == 0) and (bstep == 0)) {
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 1;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
}
pcd = 1;
}
if (pcd == 9) {
pstep = pstep - 1;
if (pstep <= 0) {
pcd = 1;
}
}
if (pcd == 6) {
pc.gotoAndStop(19);
px = px + 20;
pstep = pstep - 1;
if (pstep <= 0) {
pcd = 0;
}
}
if (pcd == 7) {
pc.gotoAndStop(20);
px = px - 20;
pstep = pstep - 1;
if (pstep <= 0) {
pcd = 1;
}
}
if (pcd == 12) {
pc.gotoAndStop(23);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(25);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 0;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
py = py + (5 * (7 - pstep));
pstep = pstep - 1;
if (pstep <= 2) {
pstep = 2;
}
if (Key.isDown(39)) {
px = px + 13;
}
if (Key.isDown(37)) {
px = px - 13;
if (bstep == 0) {
pcd = 13;
}
}
}
if (pcd == 13) {
pc.gotoAndStop(24);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(26);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 1;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
py = py + (5 * (7 - pstep));
pstep = pstep - 1;
if (pstep <= 2) {
pstep = 2;
}
if (Key.isDown(39)) {
px = px + 13;
if (bstep == 0) {
pcd = 12;
}
}
if (Key.isDown(37)) {
px = px - 13;
}
}
if (pcd == 10) {
pc.gotoAndStop(23);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(25);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 0;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
py = py - (5 * pstep);
pstep = pstep - 1;
if (Key.isDown(39)) {
px = px + 13;
}
if (Key.isDown(37)) {
px = px - 13;
if (bstep == 0) {
pcd = 11;
}
}
if (Key.isDown(40)) {
pcd = 12;
pstep = pstep + 3;
}
if (pstep <= -1) {
pstep = 7;
pcd = 12;
}
}
if (pcd == 11) {
pc.gotoAndStop(24);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(26);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 1;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
py = py - (5 * pstep);
pstep = pstep - 1;
if (Key.isDown(39)) {
px = px + 13;
if (bstep == 0) {
pcd = 10;
}
}
if (Key.isDown(37)) {
px = px - 13;
}
if (Key.isDown(40)) {
pcd = 13;
pstep = pstep + 3;
}
if (pstep <= -1) {
pstep = 7;
pcd = 13;
}
}
if (pcd == 18) {
pc.gotoAndStop(27);
pstep = pstep - 1;
px = px - 5;
if (pstep <= -1) {
pstep = 2;
pcd = 0;
}
}
if (pcd == 19) {
pc.gotoAndStop(28);
pstep = pstep - 1;
px = px + 5;
if (pstep <= -1) {
pstep = 2;
pcd = 1;
}
}
if (pcd == 20) {
pc.gotoAndStop(69 - pstep);
bcharge = 0;
charge._alpha = 0;
bstep = 20;
pl = 1;
pstep = pstep - 1;
if (pstep < 0) {
lives = lives - 1;
if (lives >= 0) {
pl = 50;
gotoAndPlay (55);
}
if (lives < 0) {
lives = 2;
continues = continues - 1;
gotoAndPlay (5);
}
}
}
if (pl <= 0) {
c = 1;
while (c <= 8) {
bgx[c] = -600;
c++;
}
pc._alpha = 100;
pcd = 20;
pstep = 40;
megad.start();
}
if (bstep > 0) {
bcharge = 0;
charge._alpha = bcharge;
}
if (bstep > 0) {
bstep = bstep - 1;
}
if ((py > 500) and (pcd < 20)) {
megad.start();
pl = 0;
}
w = w - 1;
if (w < 0) {
w = 7;
}
e = pcd;
c = 0;
r = 1;
while (r <= 21) {
if (((((bx[r] - 150) < px) and ((bx[r] + 150) > px)) and ((by[r] - 150) < py)) and ((by[r] + 150) > py)) {
if (((((((px - 30) < (bx[r] + 50)) and ((px + 20) > (bx[r] - 50))) and (py < (by[r] - 50))) and ((py + 60) > (by[r] - 50))) and (pcd != 10)) and (pcd != 11)) {
if ((((pcd == 12) or (pcd == 13)) or (pcd == 16)) or (pcd == 17)) {
if ((pcd == 12) or (pcd == 16)) {
pcd = 0;
}
if ((pcd == 13) or (pcd == 17)) {
pcd = 1;
}
}
c = 1;
py = by[r] - 75;
}
if (((((px + 38) > (bx[r] - 50)) and ((px + 20) < bx[r])) and (py < (by[r] + 50))) and ((py + 20) > (by[r] - 50))) {
px = bx[r] - 85;
}
if (((((px - 35) < (bx[r] + 50)) and ((px - 20) > bx[r])) and (py < (by[r] + 50))) and ((py + 20) > (by[r] - 50))) {
px = bx[r] + 85;
}
if (((((px - 5) < (bx[r] + 50)) and ((px + 5) > (bx[r] - 50))) and ((py - 30) < (by[r] + 50))) and ((py + 10) > (by[r] + 50))) {
if ((((pcd == 10) or (pcd == 11)) or (pcd == 14)) or (pcd == 15)) {
if ((pcd == 10) or (pcd == 14)) {
pcd = 12;
pstep = 5;
}
if ((pcd == 11) or (pcd == 15)) {
pcd = 13;
pstep = 5;
}
}
py = by[r] + 90;
}
}
r++;
}
if (c == 0) {
if ((((pcd == 0) or (pcd == 2)) or (pcd == 6)) or (pcd == 18)) {
pcd = 12;
pstep = 6;
}
if ((((pcd == 1) or (pcd == 3)) or (pcd == 7)) or (pcd == 19)) {
pcd = 13;
pstep = 6;
}
}
r = 1;
while (r <= 3) {
if (pst[r] == 1) {
if (psd[r] == 0) {
psx[r] = psx[r] + 30;
if (r == 1) {
shot1p.gotoAndStop(1);
}
if (r == 2) {
shot2p.gotoAndStop(1);
}
if (r == 3) {
shot3p.gotoAndStop(1);
}
if (psx[r] > (px + 280)) {
pst[r] = 0;
psx[r] = -200;
}
}
if (psd[r] == 1) {
psx[r] = psx[r] - 30;
if (r == 1) {
shot1p.gotoAndStop(2);
}
if (r == 2) {
shot2p.gotoAndStop(2);
}
if (r == 3) {
shot3p.gotoAndStop(2);
}
if (psx[r] < (px - 280)) {
pst[r] = 0;
psx[r] = -200;
}
}
}
if (pst[r] == 2) {
if (psd[r] == 0) {
psx[r] = psx[r] + 35;
if (r == 1) {
shot1p.gotoAndStop(3);
}
if (r == 2) {
shot2p.gotoAndStop(3);
}
if (r == 3) {
shot3p.gotoAndStop(3);
}
if (psx[r] > (px + 280)) {
pst[r] = 0;
psx[r] = -200;
}
}
if (psd[r] == 1) {
psx[r] = psx[r] - 35;
if (r == 1) {
shot1p.gotoAndStop(4);
}
if (r == 2) {
shot2p.gotoAndStop(4);
}
if (r == 3) {
shot3p.gotoAndStop(4);
}
if (psx[r] < (px - 280)) {
pst[r] = 0;
psx[r] = -200;
}
}
}
if (pst[r] == 3) {
if (psd[r] == 0) {
psx[r] = psx[r] + 40;
if (r == 1) {
shot1p.gotoAndStop(5);
}
if (r == 2) {
shot2p.gotoAndStop(5);
}
if (r == 3) {
shot3p.gotoAndStop(5);
}
if (psx[r] > (px + 280)) {
pst[r] = 0;
psx[r] = -200;
}
}
if (psd[r] == 1) {
psx[r] = psx[r] - 40;
if (r == 1) {
shot1p.gotoAndStop(6);
}
if (r == 2) {
shot2p.gotoAndStop(6);
}
if (r == 3) {
shot3p.gotoAndStop(6);
}
if (psx[r] < (px - 280)) {
pst[r] = 0;
psx[r] = -200;
}
}
}
if (pst[r] == 4) {
if (r == 1) {
shot1p.gotoAndStop(10 - psd[r]);
}
if (r == 2) {
shot2p.gotoAndStop(10 - psd[r]);
}
if (r == 3) {
shot3p.gotoAndStop(10 - psd[r]);
}
psd[r] = psd[r] - 1;
if (psd[r] < 0) {
pst[r] = 0;
psx[r] = -200;
}
}
if (pst[r] == 5) {
if (r == 1) {
shot1p.gotoAndStop(14 - psd[r]);
}
if (r == 2) {
shot2p.gotoAndStop(14 - psd[r]);
}
if (r == 3) {
shot3p.gotoAndStop(14 - psd[r]);
}
psd[r] = psd[r] - 1;
if (psd[r] < 0) {
pst[r] = 0;
psx[r] = -200;
}
}
r++;
}
while (c <= 5) {
r = 1;
while (r <= 3) {
if ((pst[r] > 0) and (pst[r] < 4)) {
if (((((bgt[c] == 6) and ((bgx[c] - 35) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 35) > (psx[r] - ((pst[r] * 20) - 20)))) and ((bgy[c] - 50) < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 20) > (psy[r] - ((pst[r] * 20) - 20)))) {
if ((bgd[c] == 0) or (bgd[c] == 1)) {
deflect.start();
pst[r] = 5;
psd[r] = 2;
}
if (bgd[c] == 2) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd2.start();
bgd[c] = 3;
bgs[c] = 4;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
if (((((bgt[c] == 13) and ((bgx[c] - 35) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 35) > (psx[r] - ((pst[r] * 20) - 20)))) and (bgy[c] < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 60) > (psy[r] - ((pst[r] * 20) - 20)))) {
if (bgd[c] < 6) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd1.start();
bgd[c] = 6;
bgs[c] = 8;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
}
r++;
}
c++;
}
r = 1;
while (r <= 5) {
if (((((bgt[r] > 0) and ((bgx[r] - 340) < px)) and ((bgx[r] + 340) > px)) and ((bgy[r] - 180) < py)) and ((bgy[r] + 350) > py)) {
c = 0;
e = 1;
while (e <= 21) {
if (((((bx[e] - 150) < bgx[r]) and ((bx[e] + 150) > bgx[r])) and ((by[e] - 150) < bgy[r])) and ((by[e] + 150) > bgy[r])) {
if (((((bgx[r] + 20) >= (bx[e] - 50)) and ((bgx[r] - 20) <= (bx[e] + 50))) and ((bgy[r] + 45) > (by[e] - 60))) and ((bgy[r] - 10) < (by[e] - 40))) {
c = 1;
}
if (((((bgx[r] + 20) > (bx[e] - 50)) and ((bgx[r] + 20) < bx[e])) and (bgy[r] < (by[e] + 50))) and ((bgy[r] + 20) > (by[e] - 50))) {
bgx[r] = bx[e] - 70;
}
if (((((bgx[r] - 20) < (bx[e] + 50)) and ((bgx[r] + 20) > bx[e])) and (bgy[r] < (by[e] + 50))) and ((bgy[r] + 20) > (by[e] - 50))) {
bgx[r] = bx[e] + 70;
}
if (((((bgx[r] - 5) < (bx[e] + 50)) and ((bgx[r] + 5) > (bx[e] - 50))) and ((bgy[r] - 30) < (by[e] + 50))) and (bgy[r] > (by[e] + 50))) {
bgy[r] = by[e] + 70;
}
if (((((bgx[r] - 2) < (bx[e] + 50)) and ((bgx[r] + 2) > (bx[e] - 50))) and ((bgy[r] + 20) < (by[e] - 50))) and ((bgy[r] + 60) > (by[e] - 50))) {
c = 1;
bgy[r] = by[e] - 105;
}
}
e++;
}
if (bgt[r] == 6) {
if (((((((bgx[r] - 10) < (px + 10)) and ((bgx[r] + 10) > (px - 10))) and ((bgy[r] + 50) > (py + 10))) and ((bgy[r] + 10) < (py + 50))) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 4;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 4;
}
megah.start();
i = 10;
}
if (bgd[r] == 0) {
f[r] = 1;
bgy[r] = bgy[r] - 10;
if (((((px - 120) < bgx[r]) and ((px + 120) > bgx[r])) and ((bgy[r] - 80) < py)) and ((bgy[r] + 150) > py)) {
bgd[r] = 1;
bgs[r] = 6;
}
}
if (bgd[r] == 1) {
bgy[r] = bgy[r] - 10;
if (((bgs[r] == 6) or (bgs[r] == 5)) or (bgs[r] == 4)) {
f[r] = 2;
}
if (((bgs[r] == 3) or (bgs[r] == 2)) or (bgs[r] == 1)) {
f[r] = 3;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgs[r] = 4;
bgd[r] = 2;
}
}
if (bgd[r] == 2) {
if ((bgs[r] == 4) or (bgs[r] == 3)) {
f[r] = 4;
}
if ((bgs[r] == 2) or (bgs[r] == 1)) {
f[r] = 5;
}
if (px < bgx[r]) {
bgx[r] = (bgx[r] - 1) - random(10);
}
if (px > bgx[r]) {
bgx[r] = (bgx[r] + 1) + random(10);
}
if (py > bgy[r]) {
bgy[r] = bgy[r] + random(8);
}
if (py < bgy[r]) {
bgy[r] = (bgy[r] - 10) - random(10);
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgs[r] = 4;
}
}
if (bgd[r] == 3) {
if (bgs[r] == 4) {
f[r] = 6;
}
if (bgs[r] == 3) {
f[r] = 7;
}
if (bgs[r] == 2) {
f[r] = 8;
}
if (bgs[r] == 1) {
f[r] = 9;
}
bgs[r] = bgs[r] - 1;
bgy[r] = bgy[r] - 10;
if (bgs[r] <= 0) {
f[r] = 10;
bgt[r] = 0;
bgx[r] = -500;
bgs[r] = 0;
}
}
}
if (bgt[r] == 13) {
if (((((((bgx[r] - 50) < (px + 10)) and ((bgx[r] + 50) > (px - 10))) and ((bgy[r] + 70) > (py + 10))) and (bgy[r] < (py + 50))) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 4;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 4;
}
megah.start();
i = 10;
}
if (bgd[r] == 0) {
f[r] = 1;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
if ((px - 190) < bgx[r]) {
bgd[r] = 1;
bgs[r] = 7;
}
}
if (px < bgx[r]) {
bgd[r] = 3;
}
}
if (bgd[r] == 1) {
f[r] = 2;
bgx[r] = bgx[r] + 20;
bgy[r] = bgy[r] - 15;
if (bgy[r] < py) {
bgy[r] = bgy[r] + 10;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 2;
bgs[r] = 12;
}
}
if (bgd[r] == 2) {
f[r] = 3;
bgx[r] = bgx[r] + 5;
bgy[r] = bgy[r] + 2;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 0;
bgs[r] = random(12) + 6;
}
}
if (bgd[r] == 3) {
f[r] = 4;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
if ((px + 190) > bgx[r]) {
bgd[r] = 4;
bgs[r] = 7;
}
}
if (px > bgx[r]) {
bgd[r] = 0;
}
}
if (bgd[r] == 4) {
f[r] = 5;
bgx[r] = bgx[r] - 20;
bgy[r] = bgy[r] - 15;
bgs[r] = bgs[r] - 1;
if (bgy[r] < py) {
bgy[r] = bgy[r] + 10;
}
if (bgs[r] <= 0) {
bgd[r] = 5;
bgs[r] = 12;
}
}
if (bgd[r] == 5) {
f[r] = 6;
bgx[r] = bgx[r] - 5;
bgy[r] = bgy[r] + 2;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 3;
bgs[r] = random(12) + 6;
}
}
if (bgd[r] == 6) {
if ((bgs[r] == 7) or (bgs[r] == 8)) {
f[r] = 7;
}
if ((bgs[r] == 5) or (bgs[r] == 6)) {
f[r] = 8;
}
if ((bgs[r] == 3) or (bgs[r] == 4)) {
f[r] = 9;
}
if ((bgs[r] == 1) or (bgs[r] == 2)) {
f[r] = 10;
}
bgs[r] = bgs[r] - 1;
bgy[r] = bgy[r] - 10;
if (bgs[r] < 0) {
bgx[r] = -500;
f[r] = 11;
bgt[r] = 0;
bgs[r] = 0;
}
}
}
if (c == 0) {
bgy[r] = bgy[r] + 10;
}
}
r++;
}
r = 1;
while (r <= 5) {
if (bgst[r] > 0) {
if (bgst[r] == 1) {
if (r == 1) {
bgs1.gotoAndStop(1);
}
if (r == 2) {
bgs2.gotoAndStop(1);
}
if (r == 3) {
bgs3.gotoAndStop(1);
}
if (r == 4) {
bgs4.gotoAndStop(1);
}
if (r == 5) {
bgs5.gotoAndStop(1);
}
if (bgsd[r] == 0) {
bgsx[r] = bgsx[r] + 20;
if (bgsx[r] > (px + 300)) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgsd[r] == 1) {
bgsx[r] = bgsx[r] - 20;
if (bgsx[r] < (px - 300)) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgsd[r] == 2) {
bgsx[r] = bgsx[r] + 15;
bgsy[r] = bgsy[r] + 15;
if ((bgsx[r] > (px + 300)) or (bgsy[r] > (py + 300))) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgsd[r] == 3) {
bgsx[r] = bgsx[r] - 15;
bgsy[r] = bgsy[r] + 15;
if ((bgsx[r] > (px + 300)) or (bgsy[r] > (py + 300))) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgsd[r] == 4) {
bgsy[r] = bgsy[r] + 20;
if (bgsy[r] > (py + 300)) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (((((((bgsx[r] - 15) < (px + 10)) and ((bgsx[r] + 15) > (px - 10))) and ((bgsy[r] + 15) > (py + 5))) and ((bgsy[r] - 15) < (py + 20))) and (pcd < 18)) and (i < 1)) {
if ((bgsd[r] == 0) or (bgsd[r] == 2)) {
pcd = 19;
}
if ((bgsd[r] == 1) or (bgsd[r] == 3)) {
pcd = 18;
}
pstep = 2;
pl = pl - 3;
megah.start();
i = 10;
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgst[r] == 2) {
if (r == 1) {
bgs1.gotoAndStop(2);
}
if (r == 2) {
bgs2.gotoAndStop(2);
}
if (r == 3) {
bgs3.gotoAndStop(2);
}
if (r == 4) {
bgs4.gotoAndStop(2);
}
if (r == 5) {
bgs5.gotoAndStop(2);
}
if (bgsd[r] == 0) {
bgsx[r] = bgsx[r] + 30;
if (bgsx[r] > (px + 300)) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgsd[r] == 1) {
bgsx[r] = bgsx[r] - 30;
if (bgsx[r] < (px - 300)) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (((((((bgsx[r] - 25) < (px + 10)) and ((bgsx[r] + 25) > (px - 10))) and ((bgsy[r] + 80) > (py + 40))) and ((bgsy[r] + 35) < (py + 60))) and (pcd < 18)) and (i < 1)) {
if (bgsd[r] == 0) {
pcd = 19;
}
if (bgsd[r] == 1) {
pcd = 18;
}
pstep = 2;
pl = pl - 6;
megah.start();
i = 10;
bgst[r] = 0;
bgsx[r] = -200;
}
}
}
r++;
}
bg1.gotoAndStop(f[1]);
bg2.gotoAndStop(f[2]);
bg3.gotoAndStop(f[3]);
bg4.gotoAndStop(f[4]);
bg5.gotoAndStop(f[5]);
bg6.gotoAndStop(f[6]);
bg7.gotoAndStop(f[7]);
bg8.gotoAndStop(f[8]);
bgs1._x = ((bgsx[1] + 275) - px) / 2;
bgs1._y = ((bgsy[1] + 275) - py) / 2;
bgs2._x = ((bgsx[2] + 275) - px) / 2;
bgs2._y = ((bgsy[2] + 275) - py) / 2;
bgs3._x = ((bgsx[3] + 275) - px) / 2;
bgs3._y = ((bgsy[3] + 275) - py) / 2;
bgs4._x = ((bgsx[4] + 275) - px) / 2;
bgs4._y = ((bgsy[4] + 275) - py) / 2;
bgs5._x = ((bgsx[5] + 275) - px) / 2;
bgs5._y = ((bgsy[5] + 275) - py) / 2;
bg1._x = ((bgx[1] + 275) - px) / 2;
bg1._y = ((bgy[1] + 275) - py) / 2;
bg2._x = ((bgx[2] + 275) - px) / 2;
bg2._y = ((bgy[2] + 275) - py) / 2;
bg3._x = ((bgx[3] + 275) - px) / 2;
bg3._y = ((bgy[3] + 275) - py) / 2;
bg4._x = ((bgx[4] + 275) - px) / 2;
bg4._y = ((bgy[4] + 275) - py) / 2;
bg5._x = ((bgx[5] + 275) - px) / 2;
bg5._y = ((bgy[5] + 275) - py) / 2;
bg6._x = ((bgx[6] + 275) - px) / 2;
bg6._y = ((bgy[6] + 275) - py) / 2;
bg7._x = ((bgx[7] + 275) - px) / 2;
bg7._y = ((bgy[7] + 275) - py) / 2;
r = 1;
while (r <= 3) {
if (((pst[r] > 0) and (pst[r] < 4)) and (psd[r] == 0)) {
if (r == 1) {
shot1p._x = ((297 + psx[1]) - px) / 2;
shot1p._y = ((270 + psy[1]) - py) / 2;
}
if (r == 2) {
shot2p._x = ((297 + psx[2]) - px) / 2;
shot2p._y = ((270 + psy[2]) - py) / 2;
}
if (r == 3) {
shot3p._x = ((297 + psx[3]) - px) / 2;
shot3p._y = ((270 + psy[3]) - py) / 2;
}
}
if (((pst[r] > 0) and (pst[r] < 4)) and (psd[r] == 1)) {
if (r == 1) {
shot1p._x = ((247 + psx[1]) - px) / 2;
shot1p._y = ((270 + psy[1]) - py) / 2;
}
if (r == 2) {
shot2p._x = ((247 + psx[2]) - px) / 2;
shot2p._y = ((270 + psy[2]) - py) / 2;
}
if (r == 3) {
shot3p._x = ((247 + psx[3]) - px) / 2;
shot3p._y = ((270 + psy[3]) - py) / 2;
}
}
if ((pst[r] == 4) or (pst[r] == 5)) {
if (r == 1) {
shot1p._x = ((272 + psx[1]) - px) / 2;
shot1p._y = ((270 + psy[1]) - py) / 2;
}
if (r == 2) {
shot2p._x = ((272 + psx[2]) - px) / 2;
shot2p._y = ((270 + psy[2]) - py) / 2;
}
if (r == 3) {
shot3p._x = ((272 + psx[3]) - px) / 2;
shot3p._y = ((270 + psy[3]) - py) / 2;
}
}
if (pst[r] == 0) {
if (r == 1) {
shot1p._x = -200;
shot1p._y = (270 + psy[1]) - py;
}
if (r == 2) {
shot2p._x = -200;
shot2p._y = (270 + psy[2]) - py;
}
if (r == 3) {
shot3p._x = -200;
shot3p._y = (270 + psy[3]) - py;
}
}
r++;
}
if (i > 0) {
i = i - 1;
pc._alpha = 50;
}
if (i <= 0) {
i = i - 1;
pc._alpha = 100;
}
if (bcharge > 0) {
charge._alpha = bcharge;
}
lbar._height = 2 * pl;
lbar._y = 120 - (2 * pl);
stage._x = (270 - px) / 2;
stage._y = (80 - py) / 2;
exit._x = ((ex + 275) - px) / 2;
exit._y = ((ey + 275) - py) / 2;
Frame 74
gotoAndPlay (73);
if ((((px + 10) > (ex - 20)) and ((px - 10) < (ex + 20))) and (((py + 30) > (ey - 20)) and (py < (ey + 50)))) {
gotoAndPlay (75);
}
Frame 75
lbar._height = 2 * pl;
lbar._y = 120 - (2 * pl);
stage._x = (270 - px) / 2;
stage._y = (80 - py) / 2;
exit._x = ((ex + 275) - px) / 2;
exit._y = ((ey + 275) - py) / 2;
Frame 78
psn = 1;
bstep = 0;
pcd = 0;
bcharge = 0;
r = 1;
while (r <= 5) {
psx[r] = -200;
psy[r] = 0;
pst[r] = 0;
psd[r] = 0;
r++;
}
i = 0;
pl = pl + 5;
if (pl > 50) {
pl = 50;
}
px = 350;
py = 250;
r = 0;
while (r <= 31) {
bx[r] = -50;
by[r] = -50;
r++;
}
bx[1] = 250;
by[1] = 150;
bx[2] = 250;
by[2] = 250;
bx[3] = 350;
by[3] = 350;
bx[4] = 450;
by[4] = 350;
bx[5] = 550;
by[5] = 350;
bx[6] = 650;
by[6] = 350;
bx[7] = 750;
by[7] = 350;
bx[8] = 850;
by[8] = 350;
bx[9] = 950;
by[9] = 350;
bx[10] = 1050;
by[10] = 350;
bx[11] = 1150;
by[11] = 350;
bx[12] = 1250;
by[12] = 350;
bx[13] = 1350;
by[13] = 350;
bx[14] = 1450;
by[14] = 350;
bx[15] = 1550;
by[15] = 350;
bx[16] = 1650;
by[16] = 350;
bx[17] = 1750;
by[17] = 350;
bx[18] = 1850;
by[18] = 350;
bx[19] = 1950;
by[19] = 350;
bx[20] = 2050;
by[20] = 250;
bx[21] = 1950;
by[21] = 150;
bsn = 1;
r = 1;
while (r <= 8) {
bgx[r] = -200;
bgy[r] = -200;
bgt[r] = 0;
bgd[r] = -1;
bgs[r] = 0;
r++;
}
r = 1;
while (r <= 5) {
bgsx[r] = -200;
bgsy[r] = 0;
bgst[r] = 0;
bgsd[r] = 0;
r++;
}
r = 1;
while (r <= 8) {
f[r] = 20;
r++;
}
bgt[1] = 11;
bgd[1] = 0;
bgs[1] = 0;
bgl[1] = 6;
bgx[1] = 650;
bgy[1] = 250;
bgt[2] = 6;
bgd[2] = 0;
bgs[2] = 0;
bgl[2] = 2;
bgx[2] = 650;
bgy[2] = 110;
bgt[3] = 6;
bgd[3] = 0;
bgs[3] = 0;
bgl[3] = 2;
bgx[3] = 850;
bgy[3] = 110;
bgt[4] = 11;
bgd[4] = 0;
bgs[4] = 0;
bgl[4] = 6;
bgx[4] = 950;
bgy[4] = 250;
bgt[5] = 6;
bgd[5] = 0;
bgs[5] = 0;
bgl[5] = 2;
bgx[5] = 1250;
bgy[5] = 110;
bgt[6] = 6;
bgd[6] = 0;
bgs[6] = 0;
bgl[6] = 2;
bgx[6] = 1350;
bgy[6] = 110;
bgt[7] = 6;
bgd[7] = 0;
bgs[7] = 0;
bgl[7] = 2;
bgx[7] = 1650;
bgy[7] = 110;
bgt[8] = 6;
bgd[8] = 0;
bgs[8] = 0;
bgl[8] = 2;
bgx[8] = 1750;
bgy[8] = 110;
ex = 1950;
ey = 250;
Frame 79
b1._x = bx[1] / 10;
b1._y = (by[1] / 10) + 120;
b2._x = bx[2] / 10;
b2._y = (by[2] / 10) + 120;
b3._x = bx[3] / 10;
b3._y = (by[3] / 10) + 120;
b4._x = bx[4] / 10;
b4._y = (by[4] / 10) + 120;
b5._x = bx[5] / 10;
b5._y = (by[5] / 10) + 120;
b6._x = bx[6] / 10;
b6._y = (by[6] / 10) + 120;
b7._x = bx[7] / 10;
b7._y = (by[7] / 10) + 120;
b8._x = bx[8] / 10;
b8._y = (by[8] / 10) + 120;
b9._x = bx[9] / 10;
b9._y = (by[9] / 10) + 120;
b10._x = bx[10] / 10;
b10._y = (by[10] / 10) + 120;
b11._x = bx[11] / 10;
b11._y = (by[11] / 10) + 120;
b12._x = bx[12] / 10;
b12._y = (by[12] / 10) + 120;
b13._x = bx[13] / 10;
b13._y = (by[13] / 10) + 120;
b14._x = bx[14] / 10;
b14._y = (by[14] / 10) + 120;
b15._x = bx[15] / 10;
b15._y = (by[15] / 10) + 120;
b16._x = bx[16] / 10;
b16._y = (by[16] / 10) + 120;
b17._x = bx[17] / 10;
b17._y = (by[17] / 10) + 120;
b18._x = bx[18] / 10;
b18._y = (by[18] / 10) + 120;
b19._x = bx[19] / 10;
b19._y = (by[19] / 10) + 120;
b20._x = bx[20] / 10;
b20._y = (by[20] / 10) + 120;
b21._x = bx[21] / 10;
b21._y = (by[21] / 10) + 120;
b22._x = bx[22] / 10;
b22._y = (by[22] / 10) + 120;
b23._x = bx[23] / 10;
b23._y = (by[23] / 10) + 120;
b24._x = bx[24] / 10;
b24._y = (by[24] / 10) + 120;
b25._x = bx[25] / 10;
b25._y = (by[25] / 10) + 120;
b26._x = bx[26] / 10;
b26._y = (by[26] / 10) + 120;
b27._x = bx[27] / 10;
b27._y = (by[27] / 10) + 120;
b28._x = bx[28] / 10;
b28._y = (by[28] / 10) + 120;
b29._x = bx[29] / 10;
b29._y = (by[29] / 10) + 120;
b30._x = bx[30] / 10;
b30._y = (by[30] / 10) + 120;
b31._x = bx[31] / 10;
b31._y = (by[31] / 10) + 120;
cir._x = px / 10;
cir._y = (py / 10) + 120;
shot1._x = psx[1] / 10;
shot1._y = (psy[1] / 10) + 120;
shot2._x = psx[2] / 10;
shot2._y = (psy[2] / 10) + 120;
shot3._x = psx[3] / 10;
shot3._y = (psy[3] / 10) + 120;
bshot1._x = bgsx[1] / 10;
bshot1._y = (bgsy[1] / 10) + 120;
bshot2._x = bgsx[2] / 10;
bshot2._y = (bgsy[2] / 10) + 120;
bshot3._x = bgsx[3] / 10;
bshot3._y = (bgsy[3] / 10) + 120;
bshot4._x = bgsx[4] / 10;
bshot4._y = (bgsy[4] / 10) + 120;
bshot5._x = bgsx[5] / 10;
bshot5._y = (bgsy[5] / 10) + 120;
bcir1._x = bgx[1] / 10;
bcir1._y = (bgy[1] / 10) + 120;
bcir2._x = bgx[2] / 10;
bcir2._y = (bgy[2] / 10) + 120;
bcir3._x = bgx[3] / 10;
bcir3._y = (bgy[3] / 10) + 120;
bcir4._x = bgx[4] / 10;
bcir4._y = (bgy[4] / 10) + 120;
bcir5._x = bgx[5] / 10;
bcir5._y = (bgy[5] / 10) + 120;
bcir6._x = bgx[6] / 10;
bcir6._y = (bgy[6] / 10) + 120;
bcir7._x = bgx[7] / 10;
bcir7._y = (bgy[7] / 10) + 120;
bcir8._x = bgx[8] / 10;
bcir8._y = (bgy[8] / 10) + 120;
bcir9._x = bgx[9] / 10;
bcir9._y = (bgy[9] / 10) + 120;
bcir10._x = bgx[10] / 10;
bcir10._y = (bgy[10] / 10) + 120;
bcir11._x = bgx[11] / 10;
bcir11._y = (bgy[11] / 10) + 120;
bcir12._x = bgx[12] / 10;
bcir12._y = (bgy[12] / 10) + 120;
bcir13._x = bgx[13] / 10;
bcir13._y = (bgy[13] / 10) + 120;
if (Key.isDown(39) and (pcd == 0)) {
pcd = 2;
}
if (Key.isDown(39) and ((pcd == 1) or (pcd == 3))) {
pcd = 0;
}
if (Key.isDown(37) and (pcd == 1)) {
pcd = 3;
}
if (Key.isDown(37) and ((pcd == 0) or (pcd == 2))) {
pcd = 1;
}
if (Key.isDown(38) and ((pcd == 0) or (pcd == 2))) {
pcd = 10;
pstep = 7;
}
if (Key.isDown(38) and ((pcd == 1) or (pcd == 3))) {
pcd = 11;
pstep = 7;
}
if (Key.isDown(40) and ((((pcd == 0) or (pcd == 1)) or (pcd == 2)) or (pcd == 3))) {
if (((pcd == 0) or (pcd == 2)) or (pcd == 8)) {
pcd = 6;
pstep = 3;
}
if (((pcd == 1) or (pcd == 3)) or (pcd == 9)) {
pcd = 7;
pstep = 3;
}
}
if (Key.isDown(16) and (bcharge < 100)) {
bcharge = bcharge + 5;
}
if (pcd == 0) {
pc.gotoAndStop(1);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(21);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 0;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
}
if (pcd == 1) {
pc.gotoAndStop(2);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(22);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 1;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
}
if (pcd == 2) {
px = px + 13;
if ((w == 0) or (w == 1)) {
pc.gotoAndStop(3);
}
if ((w == 2) or (w == 3)) {
pc.gotoAndStop(4);
}
if ((w == 4) or (w == 5)) {
pc.gotoAndStop(5);
}
if ((w == 6) or (w == 7)) {
pc.gotoAndStop(6);
}
if (Key.isDown(32)) {
if ((w == 0) or (w == 1)) {
pc.gotoAndStop(11);
}
if ((w == 2) or (w == 3)) {
pc.gotoAndStop(12);
}
if ((w == 4) or (w == 5)) {
pc.gotoAndStop(13);
}
if ((w == 6) or (w == 7)) {
pc.gotoAndStop(14);
}
if ((pst[psn] == 0) and (bstep == 0)) {
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 0;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
}
pcd = 0;
}
if (pcd == 3) {
px = px - 13;
if ((w == 0) or (w == 1)) {
pc.gotoAndStop(7);
}
if ((w == 2) or (w == 3)) {
pc.gotoAndStop(8);
}
if ((w == 4) or (w == 5)) {
pc.gotoAndStop(9);
}
if ((w == 6) or (w == 7)) {
pc.gotoAndStop(10);
}
if (Key.isDown(32)) {
if ((w == 0) or (w == 1)) {
pc.gotoAndStop(15);
}
if ((w == 2) or (w == 3)) {
pc.gotoAndStop(16);
}
if ((w == 4) or (w == 5)) {
pc.gotoAndStop(17);
}
if ((w == 6) or (w == 7)) {
pc.gotoAndStop(18);
}
if ((pst[psn] == 0) and (bstep == 0)) {
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 1;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
}
pcd = 1;
}
if (pcd == 9) {
pstep = pstep - 1;
if (pstep <= 0) {
pcd = 1;
}
}
if (pcd == 6) {
pc.gotoAndStop(19);
px = px + 20;
pstep = pstep - 1;
if (pstep <= 0) {
pcd = 0;
}
}
if (pcd == 7) {
pc.gotoAndStop(20);
px = px - 20;
pstep = pstep - 1;
if (pstep <= 0) {
pcd = 1;
}
}
if (pcd == 12) {
pc.gotoAndStop(23);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(25);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 0;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
py = py + (5 * (7 - pstep));
pstep = pstep - 1;
if (pstep <= 2) {
pstep = 2;
}
if (Key.isDown(39)) {
px = px + 13;
}
if (Key.isDown(37)) {
px = px - 13;
if (bstep == 0) {
pcd = 13;
}
}
}
if (pcd == 13) {
pc.gotoAndStop(24);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(26);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 1;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
py = py + (5 * (7 - pstep));
pstep = pstep - 1;
if (pstep <= 2) {
pstep = 2;
}
if (Key.isDown(39)) {
px = px + 13;
if (bstep == 0) {
pcd = 12;
}
}
if (Key.isDown(37)) {
px = px - 13;
}
}
if (pcd == 10) {
pc.gotoAndStop(23);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(25);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 0;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
py = py - (5 * pstep);
pstep = pstep - 1;
if (Key.isDown(39)) {
px = px + 13;
}
if (Key.isDown(37)) {
px = px - 13;
if (bstep == 0) {
pcd = 11;
}
}
if (Key.isDown(40)) {
pcd = 12;
pstep = pstep + 3;
}
if (pstep <= -1) {
pstep = 7;
pcd = 12;
}
}
if (pcd == 11) {
pc.gotoAndStop(24);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(26);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 1;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
py = py - (5 * pstep);
pstep = pstep - 1;
if (Key.isDown(39)) {
px = px + 13;
if (bstep == 0) {
pcd = 10;
}
}
if (Key.isDown(37)) {
px = px - 13;
}
if (Key.isDown(40)) {
pcd = 13;
pstep = pstep + 3;
}
if (pstep <= -1) {
pstep = 7;
pcd = 13;
}
}
if (pcd == 18) {
pc.gotoAndStop(27);
pstep = pstep - 1;
px = px - 5;
if (pstep <= -1) {
pstep = 2;
pcd = 0;
}
}
if (pcd == 19) {
pc.gotoAndStop(28);
pstep = pstep - 1;
px = px + 5;
if (pstep <= -1) {
pstep = 2;
pcd = 1;
}
}
if (pcd == 20) {
pc.gotoAndStop(69 - pstep);
bcharge = 0;
charge._alpha = 0;
bstep = 20;
pl = 1;
pstep = pstep - 1;
if (pstep < 0) {
lives = lives - 1;
if (lives >= 0) {
pl = 50;
gotoAndPlay (55);
}
if (lives < 0) {
lives = 2;
continues = continues - 1;
gotoAndPlay (5);
}
}
}
if (pl <= 0) {
c = 1;
while (c <= 8) {
bgx[c] = -600;
c++;
}
pc._alpha = 100;
pcd = 20;
pstep = 40;
megad.start();
}
if (bstep > 0) {
bcharge = 0;
charge._alpha = bcharge;
}
if (bstep > 0) {
bstep = bstep - 1;
}
if ((py > 500) and (pcd < 20)) {
megad.start();
pl = 0;
}
w = w - 1;
if (w < 0) {
w = 7;
}
e = pcd;
c = 0;
r = 1;
while (r <= 21) {
if (((((bx[r] - 150) < px) and ((bx[r] + 150) > px)) and ((by[r] - 150) < py)) and ((by[r] + 150) > py)) {
if (((((((px - 30) < (bx[r] + 50)) and ((px + 20) > (bx[r] - 50))) and (py < (by[r] - 50))) and ((py + 60) > (by[r] - 50))) and (pcd != 10)) and (pcd != 11)) {
if ((((pcd == 12) or (pcd == 13)) or (pcd == 16)) or (pcd == 17)) {
if ((pcd == 12) or (pcd == 16)) {
pcd = 0;
}
if ((pcd == 13) or (pcd == 17)) {
pcd = 1;
}
}
c = 1;
py = by[r] - 75;
}
if (((((px + 38) > (bx[r] - 50)) and ((px + 20) < bx[r])) and (py < (by[r] + 50))) and ((py + 20) > (by[r] - 50))) {
px = bx[r] - 85;
}
if (((((px - 35) < (bx[r] + 50)) and ((px - 20) > bx[r])) and (py < (by[r] + 50))) and ((py + 20) > (by[r] - 50))) {
px = bx[r] + 85;
}
if (((((px - 5) < (bx[r] + 50)) and ((px + 5) > (bx[r] - 50))) and ((py - 30) < (by[r] + 50))) and ((py + 10) > (by[r] + 50))) {
if ((((pcd == 10) or (pcd == 11)) or (pcd == 14)) or (pcd == 15)) {
if ((pcd == 10) or (pcd == 14)) {
pcd = 12;
pstep = 5;
}
if ((pcd == 11) or (pcd == 15)) {
pcd = 13;
pstep = 5;
}
}
py = by[r] + 90;
}
}
r++;
}
if (c == 0) {
if ((((pcd == 0) or (pcd == 2)) or (pcd == 6)) or (pcd == 18)) {
pcd = 12;
pstep = 6;
}
if ((((pcd == 1) or (pcd == 3)) or (pcd == 7)) or (pcd == 19)) {
pcd = 13;
pstep = 6;
}
}
r = 1;
while (r <= 3) {
if (pst[r] == 1) {
if (psd[r] == 0) {
psx[r] = psx[r] + 30;
if (r == 1) {
shot1p.gotoAndStop(1);
}
if (r == 2) {
shot2p.gotoAndStop(1);
}
if (r == 3) {
shot3p.gotoAndStop(1);
}
if (psx[r] > (px + 280)) {
pst[r] = 0;
psx[r] = -200;
}
}
if (psd[r] == 1) {
psx[r] = psx[r] - 30;
if (r == 1) {
shot1p.gotoAndStop(2);
}
if (r == 2) {
shot2p.gotoAndStop(2);
}
if (r == 3) {
shot3p.gotoAndStop(2);
}
if (psx[r] < (px - 280)) {
pst[r] = 0;
psx[r] = -200;
}
}
}
if (pst[r] == 2) {
if (psd[r] == 0) {
psx[r] = psx[r] + 35;
if (r == 1) {
shot1p.gotoAndStop(3);
}
if (r == 2) {
shot2p.gotoAndStop(3);
}
if (r == 3) {
shot3p.gotoAndStop(3);
}
if (psx[r] > (px + 280)) {
pst[r] = 0;
psx[r] = -200;
}
}
if (psd[r] == 1) {
psx[r] = psx[r] - 35;
if (r == 1) {
shot1p.gotoAndStop(4);
}
if (r == 2) {
shot2p.gotoAndStop(4);
}
if (r == 3) {
shot3p.gotoAndStop(4);
}
if (psx[r] < (px - 280)) {
pst[r] = 0;
psx[r] = -200;
}
}
}
if (pst[r] == 3) {
if (psd[r] == 0) {
psx[r] = psx[r] + 40;
if (r == 1) {
shot1p.gotoAndStop(5);
}
if (r == 2) {
shot2p.gotoAndStop(5);
}
if (r == 3) {
shot3p.gotoAndStop(5);
}
if (psx[r] > (px + 280)) {
pst[r] = 0;
psx[r] = -200;
}
}
if (psd[r] == 1) {
psx[r] = psx[r] - 40;
if (r == 1) {
shot1p.gotoAndStop(6);
}
if (r == 2) {
shot2p.gotoAndStop(6);
}
if (r == 3) {
shot3p.gotoAndStop(6);
}
if (psx[r] < (px - 280)) {
pst[r] = 0;
psx[r] = -200;
}
}
}
if (pst[r] == 4) {
if (r == 1) {
shot1p.gotoAndStop(10 - psd[r]);
}
if (r == 2) {
shot2p.gotoAndStop(10 - psd[r]);
}
if (r == 3) {
shot3p.gotoAndStop(10 - psd[r]);
}
psd[r] = psd[r] - 1;
if (psd[r] < 0) {
pst[r] = 0;
psx[r] = -200;
}
}
if (pst[r] == 5) {
if (r == 1) {
shot1p.gotoAndStop(14 - psd[r]);
}
if (r == 2) {
shot2p.gotoAndStop(14 - psd[r]);
}
if (r == 3) {
shot3p.gotoAndStop(14 - psd[r]);
}
psd[r] = psd[r] - 1;
if (psd[r] < 0) {
pst[r] = 0;
psx[r] = -200;
}
}
r++;
}
while (c <= 8) {
r = 1;
while (r <= 3) {
if ((pst[r] > 0) and (pst[r] < 4)) {
if (((((bgt[c] == 6) and ((bgx[c] - 35) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 35) > (psx[r] - ((pst[r] * 20) - 20)))) and ((bgy[c] - 50) < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 20) > (psy[r] - ((pst[r] * 20) - 20)))) {
if ((bgd[c] == 0) or (bgd[c] == 1)) {
deflect.start();
pst[r] = 5;
psd[r] = 2;
}
if (bgd[c] == 2) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd2.start();
bgd[c] = 3;
bgs[c] = 4;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
if (((((bgt[c] == 11) and ((bgx[c] - 25) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 25) > (psx[r] - ((pst[r] * 20) - 20)))) and (bgy[c] < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 50) > (psy[r] - ((pst[r] * 20) - 20)))) {
if (bgd[c] < 6) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd2.start();
bgd[c] = 6;
bgs[c] = 3;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
}
r++;
}
c++;
}
r = 1;
while (r <= 8) {
if (((((bgt[r] > 0) and ((bgx[r] - 340) < px)) and ((bgx[r] + 340) > px)) and ((bgy[r] - 180) < py)) and ((bgy[r] + 350) > py)) {
c = 0;
e = 1;
while (e <= 21) {
if (((((bx[e] - 150) < bgx[r]) and ((bx[e] + 150) > bgx[r])) and ((by[e] - 150) < bgy[r])) and ((by[e] + 150) > bgy[r])) {
if (((((bgx[r] + 20) >= (bx[e] - 50)) and ((bgx[r] - 20) <= (bx[e] + 50))) and ((bgy[r] + 45) > (by[e] - 60))) and ((bgy[r] - 10) < (by[e] - 40))) {
c = 1;
}
if (((((bgx[r] + 20) > (bx[e] - 50)) and ((bgx[r] + 20) < bx[e])) and (bgy[r] < (by[e] + 50))) and ((bgy[r] + 20) > (by[e] - 50))) {
bgx[r] = bx[e] - 70;
}
if (((((bgx[r] - 20) < (bx[e] + 50)) and ((bgx[r] + 20) > bx[e])) and (bgy[r] < (by[e] + 50))) and ((bgy[r] + 20) > (by[e] - 50))) {
bgx[r] = bx[e] + 70;
}
if (((((bgx[r] - 5) < (bx[e] + 50)) and ((bgx[r] + 5) > (bx[e] - 50))) and ((bgy[r] - 30) < (by[e] + 50))) and (bgy[r] > (by[e] + 50))) {
bgy[r] = by[e] + 70;
}
if (((((bgx[r] - 2) < (bx[e] + 50)) and ((bgx[r] + 2) > (bx[e] - 50))) and ((bgy[r] + 20) < (by[e] - 50))) and ((bgy[r] + 60) > (by[e] - 50))) {
c = 1;
bgy[r] = by[e] - 105;
}
}
e++;
}
if (c == 0) {
bgy[r] = bgy[r] + 10;
}
if (bgt[r] == 6) {
if (((((((bgx[r] - 10) < (px + 10)) and ((bgx[r] + 10) > (px - 10))) and ((bgy[r] + 40) > (py + 10))) and ((bgy[r] + 10) < (py + 50))) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 4;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 4;
}
megah.start();
i = 10;
}
if (bgd[r] == 0) {
f[r] = 1;
bgy[r] = bgy[r] - 10;
if (((((px - 120) < bgx[r]) and ((px + 120) > bgx[r])) and ((bgy[r] - 80) < py)) and ((bgy[r] + 220) > py)) {
bgd[r] = 1;
bgs[r] = 6;
}
}
if (bgd[r] == 1) {
bgy[r] = bgy[r] - 10;
if (((bgs[r] == 6) or (bgs[r] == 5)) or (bgs[r] == 4)) {
f[r] = 2;
}
if (((bgs[r] == 3) or (bgs[r] == 2)) or (bgs[r] == 1)) {
f[r] = 3;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgs[r] = 4;
bgd[r] = 2;
}
}
if (bgd[r] == 2) {
if ((bgs[r] == 4) or (bgs[r] == 3)) {
f[r] = 4;
}
if ((bgs[r] == 2) or (bgs[r] == 1)) {
f[r] = 5;
}
if (px < bgx[r]) {
bgx[r] = (bgx[r] - 1) - random(10);
}
if (px > bgx[r]) {
bgx[r] = (bgx[r] + 1) + random(10);
}
if (py > bgy[r]) {
bgy[r] = bgy[r] + random(8);
}
if (py < bgy[r]) {
bgy[r] = (bgy[r] - 10) - random(10);
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgs[r] = 4;
}
}
if (bgd[r] == 3) {
if (bgs[r] == 4) {
f[r] = 6;
}
if (bgs[r] == 3) {
f[r] = 7;
}
if (bgs[r] == 2) {
f[r] = 8;
}
if (bgs[r] == 1) {
f[r] = 9;
}
bgs[r] = bgs[r] - 1;
bgy[r] = bgy[r] - 10;
if (bgs[r] <= 0) {
f[r] = 10;
bgt[r] = 0;
bgx[r] = -500;
bgs[r] = 0;
}
}
}
if (bgt[r] == 11) {
if (((((((bgx[r] - 20) < (px + 10)) and ((bgx[r] + 20) > (px - 10))) and ((bgy[r] + 50) > (py - 10))) and (bgy[r] < (py + 50))) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 3;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 3;
}
megah.start();
i = 10;
}
if (bgd[r] == 0) {
if (((bgs[r] == 12) or (bgs[r] == 11)) or (bgs[r] == 10)) {
f[r] = 1;
}
if (((bgs[r] == 9) or (bgs[r] == 8)) or (bgs[r] == 7)) {
f[r] = 2;
}
if (((bgs[r] == 6) or (bgs[r] == 5)) or (bgs[r] == 4)) {
f[r] = 1;
}
if (((bgs[r] == 3) or (bgs[r] == 2)) or (bgs[r] == 1)) {
f[r] = 2;
}
if (bgx[r] > px) {
bgd[r] = 3;
bgs[r] = 12;
}
bgx[r] = bgx[r] + 6;
if (((bgx[r] + 150) > (px - 20)) and (bgx[r] < px)) {
bgd[r] = 1;
bgs[r] = 9;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgs[r] = 12;
}
}
if (bgd[r] == 1) {
f[r] = 3;
bgx[r] = bgx[r] + 12;
bgy[r] = bgy[r] - 20;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 2;
bgs[r] = 10;
}
}
if (bgd[r] == 2) {
f[r] = 3;
bgx[r] = bgx[r] + 12;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 0;
bgs[r] = 12;
}
}
if (bgd[r] == 3) {
if (((bgs[r] == 12) or (bgs[r] == 11)) or (bgs[r] == 10)) {
f[r] = 4;
}
if (((bgs[r] == 9) or (bgs[r] == 8)) or (bgs[r] == 7)) {
f[r] = 5;
}
if (((bgs[r] == 6) or (bgs[r] == 5)) or (bgs[r] == 4)) {
f[r] = 4;
}
if (((bgs[r] == 3) or (bgs[r] == 2)) or (bgs[r] == 1)) {
f[r] = 5;
}
if (bgx[r] < px) {
bgd[r] = 0;
bgs[r] = 12;
}
bgx[r] = bgx[r] - 6;
if (((bgx[r] - 150) < (px - 20)) and (bgx[r] > px)) {
bgd[r] = 4;
bgs[r] = 9;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgs[r] = 12;
}
}
if (bgd[r] == 4) {
f[r] = 6;
bgx[r] = bgx[r] - 12;
bgy[r] = bgy[r] - 20;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 5;
bgs[r] = 10;
}
}
if (bgd[r] == 5) {
f[r] = 6;
bgx[r] = bgx[r] - 12;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 3;
bgs[r] = 12;
}
}
if (bgd[r] == 6) {
if (bgs[r] == 3) {
f[r] = 7;
}
if (bgs[r] == 2) {
f[r] = 8;
}
if (bgs[r] == 1) {
f[r] = 9;
}
bgs[r] = bgs[r] - 1;
bgy[r] = bgy[r] - 10;
if (bgs[r] <= 0) {
f[r] = 15;
bgt[r] = 0;
bgx[r] = -500;
bgs[r] = 0;
}
}
}
if (bgt[r] == 13) {
if (((((((bgx[r] - 50) < (px + 10)) and ((bgx[r] + 50) > (px - 10))) and ((bgy[r] + 70) > (py + 10))) and (bgy[r] < (py + 50))) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 4;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 4;
}
megah.start();
i = 10;
}
if (bgd[r] == 0) {
f[r] = 1;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
if ((px - 170) < bgx[r]) {
bgd[r] = 1;
bgs[r] = 7;
}
}
if (px < bgx[r]) {
bgd[r] = 3;
}
}
if (bgd[r] == 1) {
f[r] = 2;
bgx[r] = bgx[r] + 20;
bgy[r] = bgy[r] - 15;
if (bgy[r] < py) {
bgy[r] = bgy[r] + 10;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 2;
bgs[r] = 12;
}
}
if (bgd[r] == 2) {
f[r] = 3;
bgx[r] = bgx[r] + 5;
bgy[r] = bgy[r] + 2;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 0;
bgs[r] = random(12);
}
}
if (bgd[r] == 3) {
f[r] = 4;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
if ((px + 170) > bgx[r]) {
bgd[r] = 4;
bgs[r] = 7;
}
}
if (px > bgx[r]) {
bgd[r] = 0;
}
}
if (bgd[r] == 4) {
f[r] = 5;
bgx[r] = bgx[r] - 30;
bgy[r] = bgy[r] - 20;
bgs[r] = bgs[r] - 1;
if (bgy[r] < py) {
bgy[r] = bgy[r] + 10;
}
if (bgs[r] <= 0) {
bgd[r] = 5;
bgs[r] = 12;
}
}
if (bgd[r] == 5) {
f[r] = 6;
bgx[r] = bgx[r] - 5;
bgy[r] = bgy[r] + 2;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 3;
bgs[r] = random(12);
}
}
if (bgd[r] == 6) {
if (bgs[r] == 4) {
f[r] = 7;
}
if (bgs[r] == 3) {
f[r] = 8;
}
if (bgs[r] == 2) {
f[r] = 9;
}
if (bgs[r] == 1) {
f[r] = 10;
}
bgs[r] = bgs[r] - 1;
bgy[r] = bgy[r] - 10;
if (bgs[r] <= 0) {
bgx[r] = -500;
f[r] = 11;
bgt[r] = 0;
bgs[r] = 0;
}
}
}
}
r++;
}
r = 1;
while (r <= 5) {
if (bgst[r] > 0) {
if (bgst[r] == 1) {
if (r == 1) {
bgs1.gotoAndStop(1);
}
if (r == 2) {
bgs2.gotoAndStop(1);
}
if (r == 3) {
bgs3.gotoAndStop(1);
}
if (r == 4) {
bgs4.gotoAndStop(1);
}
if (r == 5) {
bgs5.gotoAndStop(1);
}
if (bgsd[r] == 0) {
bgsx[r] = bgsx[r] + 20;
if (bgsx[r] > (px + 300)) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgsd[r] == 1) {
bgsx[r] = bgsx[r] - 20;
if (bgsx[r] < (px - 300)) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgsd[r] == 2) {
bgsx[r] = bgsx[r] + 15;
bgsy[r] = bgsy[r] + 15;
if ((bgsx[r] > (px + 300)) or (bgsy[r] > (py + 300))) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgsd[r] == 3) {
bgsx[r] = bgsx[r] - 15;
bgsy[r] = bgsy[r] + 15;
if ((bgsx[r] > (px + 300)) or (bgsy[r] > (py + 300))) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgsd[r] == 4) {
bgsy[r] = bgsy[r] + 20;
if (bgsy[r] > (py + 300)) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (((((((bgsx[r] - 15) < (px + 10)) and ((bgsx[r] + 15) > (px - 10))) and ((bgsy[r] + 15) > (py + 5))) and ((bgsy[r] - 15) < (py + 20))) and (pcd < 18)) and (i < 1)) {
if ((bgsd[r] == 0) or (bgsd[r] == 2)) {
pcd = 19;
}
if ((bgsd[r] == 1) or (bgsd[r] == 3)) {
pcd = 18;
}
pstep = 2;
pl = pl - 3;
megah.start();
i = 10;
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgst[r] == 2) {
if (r == 1) {
bgs1.gotoAndStop(2);
}
if (r == 2) {
bgs2.gotoAndStop(2);
}
if (r == 3) {
bgs3.gotoAndStop(2);
}
if (r == 4) {
bgs4.gotoAndStop(2);
}
if (r == 5) {
bgs5.gotoAndStop(2);
}
if (bgsd[r] == 0) {
bgsx[r] = bgsx[r] + 30;
if (bgsx[r] > (px + 300)) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgsd[r] == 1) {
bgsx[r] = bgsx[r] - 30;
if (bgsx[r] < (px - 300)) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (((((((bgsx[r] - 25) < (px + 10)) and ((bgsx[r] + 25) > (px - 10))) and ((bgsy[r] + 80) > (py + 40))) and ((bgsy[r] + 35) < (py + 60))) and (pcd < 18)) and (i < 1)) {
if (bgsd[r] == 0) {
pcd = 19;
}
if (bgsd[r] == 1) {
pcd = 18;
}
pstep = 2;
pl = pl - 6;
megah.start();
i = 10;
bgst[r] = 0;
bgsx[r] = -200;
}
}
}
r++;
}
bg1.gotoAndStop(f[1]);
bg2.gotoAndStop(f[2]);
bg3.gotoAndStop(f[3]);
bg4.gotoAndStop(f[4]);
bg5.gotoAndStop(f[5]);
bg6.gotoAndStop(f[6]);
bg7.gotoAndStop(f[7]);
bg8.gotoAndStop(f[8]);
bgs1._x = ((bgsx[1] + 275) - px) / 2;
bgs1._y = ((bgsy[1] + 275) - py) / 2;
bgs2._x = ((bgsx[2] + 275) - px) / 2;
bgs2._y = ((bgsy[2] + 275) - py) / 2;
bgs3._x = ((bgsx[3] + 275) - px) / 2;
bgs3._y = ((bgsy[3] + 275) - py) / 2;
bgs4._x = ((bgsx[4] + 275) - px) / 2;
bgs4._y = ((bgsy[4] + 275) - py) / 2;
bgs5._x = ((bgsx[5] + 275) - px) / 2;
bgs5._y = ((bgsy[5] + 275) - py) / 2;
bg1._x = ((bgx[1] + 275) - px) / 2;
bg1._y = ((bgy[1] + 275) - py) / 2;
bg2._x = ((bgx[2] + 275) - px) / 2;
bg2._y = ((bgy[2] + 275) - py) / 2;
bg3._x = ((bgx[3] + 275) - px) / 2;
bg3._y = ((bgy[3] + 275) - py) / 2;
bg4._x = ((bgx[4] + 275) - px) / 2;
bg4._y = ((bgy[4] + 275) - py) / 2;
bg5._x = ((bgx[5] + 275) - px) / 2;
bg5._y = ((bgy[5] + 275) - py) / 2;
bg6._x = ((bgx[6] + 275) - px) / 2;
bg6._y = ((bgy[6] + 275) - py) / 2;
bg7._x = ((bgx[7] + 275) - px) / 2;
bg7._y = ((bgy[7] + 275) - py) / 2;
bg8._x = ((bgx[8] + 275) - px) / 2;
bg8._y = ((bgy[8] + 275) - py) / 2;
r = 1;
while (r <= 3) {
if (((pst[r] > 0) and (pst[r] < 4)) and (psd[r] == 0)) {
if (r == 1) {
shot1p._x = ((297 + psx[1]) - px) / 2;
shot1p._y = ((270 + psy[1]) - py) / 2;
}
if (r == 2) {
shot2p._x = ((297 + psx[2]) - px) / 2;
shot2p._y = ((270 + psy[2]) - py) / 2;
}
if (r == 3) {
shot3p._x = ((297 + psx[3]) - px) / 2;
shot3p._y = ((270 + psy[3]) - py) / 2;
}
}
if (((pst[r] > 0) and (pst[r] < 4)) and (psd[r] == 1)) {
if (r == 1) {
shot1p._x = ((247 + psx[1]) - px) / 2;
shot1p._y = ((270 + psy[1]) - py) / 2;
}
if (r == 2) {
shot2p._x = ((247 + psx[2]) - px) / 2;
shot2p._y = ((270 + psy[2]) - py) / 2;
}
if (r == 3) {
shot3p._x = ((247 + psx[3]) - px) / 2;
shot3p._y = ((270 + psy[3]) - py) / 2;
}
}
if ((pst[r] == 4) or (pst[r] == 5)) {
if (r == 1) {
shot1p._x = ((272 + psx[1]) - px) / 2;
shot1p._y = ((270 + psy[1]) - py) / 2;
}
if (r == 2) {
shot2p._x = ((272 + psx[2]) - px) / 2;
shot2p._y = ((270 + psy[2]) - py) / 2;
}
if (r == 3) {
shot3p._x = ((272 + psx[3]) - px) / 2;
shot3p._y = ((270 + psy[3]) - py) / 2;
}
}
if (pst[r] == 0) {
if (r == 1) {
shot1p._x = -200;
shot1p._y = (270 + psy[1]) - py;
}
if (r == 2) {
shot2p._x = -200;
shot2p._y = (270 + psy[2]) - py;
}
if (r == 3) {
shot3p._x = -200;
shot3p._y = (270 + psy[3]) - py;
}
}
r++;
}
if (i > 0) {
i = i - 1;
pc._alpha = 50;
}
if (i <= 0) {
i = i - 1;
pc._alpha = 100;
}
if (bcharge > 0) {
charge._alpha = bcharge;
}
lbar._height = 2 * pl;
lbar._y = 120 - (2 * pl);
stage._x = (270 - px) / 2;
stage._y = (75 - py) / 2;
exit._x = ((ex + 275) - px) / 2;
exit._y = ((ey + 275) - py) / 2;
Frame 80
gotoAndPlay (79);
if ((((px + 10) > (ex - 20)) and ((px - 10) < (ex + 20))) and (((py + 30) > (ey - 20)) and (py < (ey + 50)))) {
gotoAndPlay (81);
}
Frame 81
lbar._height = 2 * pl;
lbar._y = 120 - (2 * pl);
stage._x = (270 - px) / 2;
stage._y = (75 - py) / 2;
exit._x = ((ex + 275) - px) / 2;
exit._y = ((ey + 275) - py) / 2;
Frame 84
psn = 1;
bstep = 0;
pcd = 0;
bcharge = 0;
r = 1;
while (r <= 5) {
psx[r] = -200;
psy[r] = 0;
pst[r] = 0;
psd[r] = 0;
r++;
}
i = 0;
pl = pl + 5;
if (pl > 50) {
pl = 50;
}
px = 350;
py = 250;
r = 0;
while (r <= 31) {
bx[r] = -50;
by[r] = -50;
r++;
}
bx[1] = 250;
by[1] = 150;
bx[2] = 250;
by[2] = 250;
bx[3] = 350;
by[3] = 350;
bx[4] = 450;
by[4] = 350;
bx[5] = 550;
by[5] = 250;
bx[6] = 650;
by[6] = 200;
bx[7] = 750;
by[7] = 200;
bx[8] = 850;
by[8] = 100;
bx[9] = 900;
by[9] = 50;
bx[10] = 1000;
by[10] = -50;
bx[11] = 1100;
by[11] = -100;
bx[12] = 1200;
by[12] = -50;
bx[13] = 1300;
by[13] = -50;
bx[14] = 1400;
by[14] = -150;
bx[15] = 1500;
by[15] = -250;
bx[16] = 1600;
by[16] = -250;
bx[17] = 1650;
by[17] = -350;
bx[18] = 1650;
by[18] = -450;
bx[19] = 250;
by[19] = 50;
bsn = 1;
r = 1;
while (r <= 8) {
bgx[r] = -200;
bgy[r] = -200;
bgt[r] = 0;
bgd[r] = -1;
bgs[r] = 0;
r++;
}
r = 1;
while (r <= 5) {
bgsx[r] = -200;
bgsy[r] = 0;
bgst[r] = 0;
bgsd[r] = 0;
r++;
}
r = 1;
while (r <= 8) {
f[r] = 20;
r++;
}
bgt[1] = 10;
bgd[1] = 0;
bgs[1] = 0;
bgl[1] = 2;
bgx[1] = 450;
bgy[1] = 150;
bgt[2] = 13;
bgd[2] = 0;
bgs[2] = 0;
bgl[2] = 6;
bgx[2] = 550;
bgy[2] = 150;
bgt[3] = 6;
bgd[3] = 0;
bgs[3] = 0;
bgl[3] = 2;
bgx[3] = 650;
bgy[3] = 50;
bgt[4] = 10;
bgd[4] = 0;
bgs[4] = 0;
bgl[4] = 2;
bgx[4] = 800;
bgy[4] = -150;
bgt[5] = 6;
bgd[5] = 0;
bgs[5] = 0;
bgl[5] = 2;
bgx[5] = 850;
bgy[5] = -180;
bgt[6] = 13;
bgd[6] = 0;
bgs[6] = 0;
bgl[6] = 6;
bgx[6] = 1000;
bgy[6] = -150;
bgt[7] = 13;
bgd[7] = 0;
bgs[7] = 0;
bgl[7] = 6;
bgx[7] = 1350;
bgy[7] = -150;
bgt[8] = 13;
bgd[8] = 0;
bgs[8] = 0;
bgl[8] = 6;
bgx[8] = 1450;
bgy[8] = -250;
ex = 1550;
ey = -350;
Frame 85
b1._x = bx[1] / 10;
b1._y = (by[1] / 10) + 120;
b2._x = bx[2] / 10;
b2._y = (by[2] / 10) + 120;
b3._x = bx[3] / 10;
b3._y = (by[3] / 10) + 120;
b4._x = bx[4] / 10;
b4._y = (by[4] / 10) + 120;
b5._x = bx[5] / 10;
b5._y = (by[5] / 10) + 120;
b6._x = bx[6] / 10;
b6._y = (by[6] / 10) + 120;
b7._x = bx[7] / 10;
b7._y = (by[7] / 10) + 120;
b8._x = bx[8] / 10;
b8._y = (by[8] / 10) + 120;
b9._x = bx[9] / 10;
b9._y = (by[9] / 10) + 120;
b10._x = bx[10] / 10;
b10._y = (by[10] / 10) + 120;
b11._x = bx[11] / 10;
b11._y = (by[11] / 10) + 120;
b12._x = bx[12] / 10;
b12._y = (by[12] / 10) + 120;
b13._x = bx[13] / 10;
b13._y = (by[13] / 10) + 120;
b14._x = bx[14] / 10;
b14._y = (by[14] / 10) + 120;
b15._x = bx[15] / 10;
b15._y = (by[15] / 10) + 120;
b16._x = bx[16] / 10;
b16._y = (by[16] / 10) + 120;
b17._x = bx[17] / 10;
b17._y = (by[17] / 10) + 120;
b18._x = bx[18] / 10;
b18._y = (by[18] / 10) + 120;
b19._x = bx[19] / 10;
b19._y = (by[19] / 10) + 120;
b20._x = bx[20] / 10;
b20._y = (by[20] / 10) + 120;
b21._x = bx[21] / 10;
b21._y = (by[21] / 10) + 120;
b22._x = bx[22] / 10;
b22._y = (by[22] / 10) + 120;
b23._x = bx[23] / 10;
b23._y = (by[23] / 10) + 120;
b24._x = bx[24] / 10;
b24._y = (by[24] / 10) + 120;
b25._x = bx[25] / 10;
b25._y = (by[25] / 10) + 120;
b26._x = bx[26] / 10;
b26._y = (by[26] / 10) + 120;
b27._x = bx[27] / 10;
b27._y = (by[27] / 10) + 120;
b28._x = bx[28] / 10;
b28._y = (by[28] / 10) + 120;
b29._x = bx[29] / 10;
b29._y = (by[29] / 10) + 120;
b30._x = bx[30] / 10;
b30._y = (by[30] / 10) + 120;
b31._x = bx[31] / 10;
b31._y = (by[31] / 10) + 120;
cir._x = px / 10;
cir._y = (py / 10) + 120;
shot1._x = psx[1] / 10;
shot1._y = (psy[1] / 10) + 120;
shot2._x = psx[2] / 10;
shot2._y = (psy[2] / 10) + 120;
shot3._x = psx[3] / 10;
shot3._y = (psy[3] / 10) + 120;
bshot1._x = bgsx[1] / 10;
bshot1._y = (bgsy[1] / 10) + 120;
bshot2._x = bgsx[2] / 10;
bshot2._y = (bgsy[2] / 10) + 120;
bshot3._x = bgsx[3] / 10;
bshot3._y = (bgsy[3] / 10) + 120;
bshot4._x = bgsx[4] / 10;
bshot4._y = (bgsy[4] / 10) + 120;
bshot5._x = bgsx[5] / 10;
bshot5._y = (bgsy[5] / 10) + 120;
bcir1._x = bgx[1] / 10;
bcir1._y = (bgy[1] / 10) + 120;
bcir2._x = bgx[2] / 10;
bcir2._y = (bgy[2] / 10) + 120;
bcir3._x = bgx[3] / 10;
bcir3._y = (bgy[3] / 10) + 120;
bcir4._x = bgx[4] / 10;
bcir4._y = (bgy[4] / 10) + 120;
bcir5._x = bgx[5] / 10;
bcir5._y = (bgy[5] / 10) + 120;
bcir6._x = bgx[6] / 10;
bcir6._y = (bgy[6] / 10) + 120;
bcir7._x = bgx[7] / 10;
bcir7._y = (bgy[7] / 10) + 120;
bcir8._x = bgx[8] / 10;
bcir8._y = (bgy[8] / 10) + 120;
bcir9._x = bgx[9] / 10;
bcir9._y = (bgy[9] / 10) + 120;
bcir10._x = bgx[10] / 10;
bcir10._y = (bgy[10] / 10) + 120;
bcir11._x = bgx[11] / 10;
bcir11._y = (bgy[11] / 10) + 120;
bcir12._x = bgx[12] / 10;
bcir12._y = (bgy[12] / 10) + 120;
bcir13._x = bgx[13] / 10;
bcir13._y = (bgy[13] / 10) + 120;
if (Key.isDown(39) and (pcd == 0)) {
pcd = 2;
}
if (Key.isDown(39) and ((pcd == 1) or (pcd == 3))) {
pcd = 0;
}
if (Key.isDown(37) and (pcd == 1)) {
pcd = 3;
}
if (Key.isDown(37) and ((pcd == 0) or (pcd == 2))) {
pcd = 1;
}
if (Key.isDown(38) and ((pcd == 0) or (pcd == 2))) {
pcd = 10;
pstep = 7;
}
if (Key.isDown(38) and ((pcd == 1) or (pcd == 3))) {
pcd = 11;
pstep = 7;
}
if (Key.isDown(40) and ((((pcd == 0) or (pcd == 1)) or (pcd == 2)) or (pcd == 3))) {
if (((pcd == 0) or (pcd == 2)) or (pcd == 8)) {
pcd = 6;
pstep = 3;
}
if (((pcd == 1) or (pcd == 3)) or (pcd == 9)) {
pcd = 7;
pstep = 3;
}
}
if (Key.isDown(16) and (bcharge < 100)) {
bcharge = bcharge + 5;
}
if (pcd == 0) {
pc.gotoAndStop(1);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(21);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 0;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
}
if (pcd == 1) {
pc.gotoAndStop(2);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(22);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 1;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
}
if (pcd == 2) {
px = px + 13;
if ((w == 0) or (w == 1)) {
pc.gotoAndStop(3);
}
if ((w == 2) or (w == 3)) {
pc.gotoAndStop(4);
}
if ((w == 4) or (w == 5)) {
pc.gotoAndStop(5);
}
if ((w == 6) or (w == 7)) {
pc.gotoAndStop(6);
}
if (Key.isDown(32)) {
if ((w == 0) or (w == 1)) {
pc.gotoAndStop(11);
}
if ((w == 2) or (w == 3)) {
pc.gotoAndStop(12);
}
if ((w == 4) or (w == 5)) {
pc.gotoAndStop(13);
}
if ((w == 6) or (w == 7)) {
pc.gotoAndStop(14);
}
if ((pst[psn] == 0) and (bstep == 0)) {
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 0;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
}
pcd = 0;
}
if (pcd == 3) {
px = px - 13;
if ((w == 0) or (w == 1)) {
pc.gotoAndStop(7);
}
if ((w == 2) or (w == 3)) {
pc.gotoAndStop(8);
}
if ((w == 4) or (w == 5)) {
pc.gotoAndStop(9);
}
if ((w == 6) or (w == 7)) {
pc.gotoAndStop(10);
}
if (Key.isDown(32)) {
if ((w == 0) or (w == 1)) {
pc.gotoAndStop(15);
}
if ((w == 2) or (w == 3)) {
pc.gotoAndStop(16);
}
if ((w == 4) or (w == 5)) {
pc.gotoAndStop(17);
}
if ((w == 6) or (w == 7)) {
pc.gotoAndStop(18);
}
if ((pst[psn] == 0) and (bstep == 0)) {
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 1;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
}
pcd = 1;
}
if (pcd == 9) {
pstep = pstep - 1;
if (pstep <= 0) {
pcd = 1;
}
}
if (pcd == 6) {
pc.gotoAndStop(19);
px = px + 20;
pstep = pstep - 1;
if (pstep <= 0) {
pcd = 0;
}
}
if (pcd == 7) {
pc.gotoAndStop(20);
px = px - 20;
pstep = pstep - 1;
if (pstep <= 0) {
pcd = 1;
}
}
if (pcd == 12) {
pc.gotoAndStop(23);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(25);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 0;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
py = py + (5 * (7 - pstep));
pstep = pstep - 1;
if (pstep <= 2) {
pstep = 2;
}
if (Key.isDown(39)) {
px = px + 13;
}
if (Key.isDown(37)) {
px = px - 13;
if (bstep == 0) {
pcd = 13;
}
}
}
if (pcd == 13) {
pc.gotoAndStop(24);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(26);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 1;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
py = py + (5 * (7 - pstep));
pstep = pstep - 1;
if (pstep <= 2) {
pstep = 2;
}
if (Key.isDown(39)) {
px = px + 13;
if (bstep == 0) {
pcd = 12;
}
}
if (Key.isDown(37)) {
px = px - 13;
}
}
if (pcd == 10) {
pc.gotoAndStop(23);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(25);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 0;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
py = py - (5 * pstep);
pstep = pstep - 1;
if (Key.isDown(39)) {
px = px + 13;
}
if (Key.isDown(37)) {
px = px - 13;
if (bstep == 0) {
pcd = 11;
}
}
if (Key.isDown(40)) {
pcd = 12;
pstep = pstep + 3;
}
if (pstep <= -1) {
pstep = 7;
pcd = 12;
}
}
if (pcd == 11) {
pc.gotoAndStop(24);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(26);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 1;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
py = py - (5 * pstep);
pstep = pstep - 1;
if (Key.isDown(39)) {
px = px + 13;
if (bstep == 0) {
pcd = 10;
}
}
if (Key.isDown(37)) {
px = px - 13;
}
if (Key.isDown(40)) {
pcd = 13;
pstep = pstep + 3;
}
if (pstep <= -1) {
pstep = 7;
pcd = 13;
}
}
if (pcd == 18) {
pc.gotoAndStop(27);
pstep = pstep - 1;
px = px - 5;
if (pstep <= -1) {
pstep = 2;
pcd = 0;
}
}
if (pcd == 19) {
pc.gotoAndStop(28);
pstep = pstep - 1;
px = px + 5;
if (pstep <= -1) {
pstep = 2;
pcd = 1;
}
}
if (pcd == 20) {
pc.gotoAndStop(69 - pstep);
bcharge = 0;
charge._alpha = 0;
bstep = 20;
pl = 1;
pstep = pstep - 1;
if (pstep < 0) {
lives = lives - 1;
if (lives >= 0) {
pl = 50;
gotoAndPlay (55);
}
if (lives < 0) {
lives = 2;
continues = continues - 1;
gotoAndPlay (5);
}
}
}
if (pl <= 0) {
c = 1;
while (c <= 8) {
bgx[c] = -600;
c++;
}
pc._alpha = 100;
pcd = 20;
pstep = 40;
megad.start();
}
if (bstep > 0) {
bcharge = 0;
charge._alpha = bcharge;
}
if (bstep > 0) {
bstep = bstep - 1;
}
if ((py > 500) and (pcd < 20)) {
megad.start();
pl = 0;
}
w = w - 1;
if (w < 0) {
w = 7;
}
e = pcd;
c = 0;
r = 1;
while (r <= 19) {
if (((((bx[r] - 150) < px) and ((bx[r] + 150) > px)) and ((by[r] - 150) < py)) and ((by[r] + 150) > py)) {
if (((((((px - 30) < (bx[r] + 50)) and ((px + 20) > (bx[r] - 50))) and (py < (by[r] - 50))) and ((py + 60) > (by[r] - 50))) and (pcd != 10)) and (pcd != 11)) {
if ((((pcd == 12) or (pcd == 13)) or (pcd == 16)) or (pcd == 17)) {
if ((pcd == 12) or (pcd == 16)) {
pcd = 0;
}
if ((pcd == 13) or (pcd == 17)) {
pcd = 1;
}
}
c = 1;
py = by[r] - 75;
}
if (((((px + 38) > (bx[r] - 50)) and ((px + 20) < bx[r])) and (py < (by[r] + 50))) and ((py + 20) > (by[r] - 50))) {
px = bx[r] - 85;
}
if (((((px - 35) < (bx[r] + 50)) and ((px - 20) > bx[r])) and (py < (by[r] + 50))) and ((py + 20) > (by[r] - 50))) {
px = bx[r] + 85;
}
if (((((px - 5) < (bx[r] + 50)) and ((px + 5) > (bx[r] - 50))) and ((py - 30) < (by[r] + 50))) and ((py + 10) > (by[r] + 50))) {
if ((((pcd == 10) or (pcd == 11)) or (pcd == 14)) or (pcd == 15)) {
if ((pcd == 10) or (pcd == 14)) {
pcd = 12;
pstep = 5;
}
if ((pcd == 11) or (pcd == 15)) {
pcd = 13;
pstep = 5;
}
}
py = by[r] + 90;
}
}
r++;
}
if (c == 0) {
if ((((pcd == 0) or (pcd == 2)) or (pcd == 6)) or (pcd == 18)) {
pcd = 12;
pstep = 6;
}
if ((((pcd == 1) or (pcd == 3)) or (pcd == 7)) or (pcd == 19)) {
pcd = 13;
pstep = 6;
}
}
r = 1;
while (r <= 3) {
if (pst[r] == 1) {
if (psd[r] == 0) {
psx[r] = psx[r] + 30;
if (r == 1) {
shot1p.gotoAndStop(1);
}
if (r == 2) {
shot2p.gotoAndStop(1);
}
if (r == 3) {
shot3p.gotoAndStop(1);
}
if (psx[r] > (px + 280)) {
pst[r] = 0;
psx[r] = -200;
}
}
if (psd[r] == 1) {
psx[r] = psx[r] - 30;
if (r == 1) {
shot1p.gotoAndStop(2);
}
if (r == 2) {
shot2p.gotoAndStop(2);
}
if (r == 3) {
shot3p.gotoAndStop(2);
}
if (psx[r] < (px - 280)) {
pst[r] = 0;
psx[r] = -200;
}
}
}
if (pst[r] == 2) {
if (psd[r] == 0) {
psx[r] = psx[r] + 35;
if (r == 1) {
shot1p.gotoAndStop(3);
}
if (r == 2) {
shot2p.gotoAndStop(3);
}
if (r == 3) {
shot3p.gotoAndStop(3);
}
if (psx[r] > (px + 280)) {
pst[r] = 0;
psx[r] = -200;
}
}
if (psd[r] == 1) {
psx[r] = psx[r] - 35;
if (r == 1) {
shot1p.gotoAndStop(4);
}
if (r == 2) {
shot2p.gotoAndStop(4);
}
if (r == 3) {
shot3p.gotoAndStop(4);
}
if (psx[r] < (px - 280)) {
pst[r] = 0;
psx[r] = -200;
}
}
}
if (pst[r] == 3) {
if (psd[r] == 0) {
psx[r] = psx[r] + 40;
if (r == 1) {
shot1p.gotoAndStop(5);
}
if (r == 2) {
shot2p.gotoAndStop(5);
}
if (r == 3) {
shot3p.gotoAndStop(5);
}
if (psx[r] > (px + 280)) {
pst[r] = 0;
psx[r] = -200;
}
}
if (psd[r] == 1) {
psx[r] = psx[r] - 40;
if (r == 1) {
shot1p.gotoAndStop(6);
}
if (r == 2) {
shot2p.gotoAndStop(6);
}
if (r == 3) {
shot3p.gotoAndStop(6);
}
if (psx[r] < (px - 280)) {
pst[r] = 0;
psx[r] = -200;
}
}
}
if (pst[r] == 4) {
if (r == 1) {
shot1p.gotoAndStop(10 - psd[r]);
}
if (r == 2) {
shot2p.gotoAndStop(10 - psd[r]);
}
if (r == 3) {
shot3p.gotoAndStop(10 - psd[r]);
}
psd[r] = psd[r] - 1;
if (psd[r] < 0) {
pst[r] = 0;
psx[r] = -200;
}
}
if (pst[r] == 5) {
if (r == 1) {
shot1p.gotoAndStop(14 - psd[r]);
}
if (r == 2) {
shot2p.gotoAndStop(14 - psd[r]);
}
if (r == 3) {
shot3p.gotoAndStop(14 - psd[r]);
}
psd[r] = psd[r] - 1;
if (psd[r] < 0) {
pst[r] = 0;
psx[r] = -200;
}
}
r++;
}
while (c <= 8) {
r = 1;
while (r <= 3) {
if ((pst[r] > 0) and (pst[r] < 4)) {
if (((((bgt[c] == 6) and ((bgx[c] - 35) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 35) > (psx[r] - ((pst[r] * 20) - 20)))) and ((bgy[c] - 50) < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 20) > (psy[r] - ((pst[r] * 20) - 20)))) {
if ((bgd[c] == 0) or (bgd[c] == 1)) {
deflect.start();
pst[r] = 5;
psd[r] = 2;
}
if (bgd[c] == 2) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd2.start();
bgd[c] = 3;
bgs[c] = 4;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
if (((((bgt[c] == 10) and ((bgx[c] - 20) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 20) > (psx[r] - ((pst[r] * 20) - 20)))) and ((bgy[c] - 50) < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 20) > (psy[r] - ((pst[r] * 20) - 20)))) {
if ((bgd[c] == 0) or (bgd[c] == 1)) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd2.start();
bgd[c] = 2;
bgs[c] = 3;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
}
if (((((bgt[c] == 13) and ((bgx[c] - 35) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 35) > (psx[r] - ((pst[r] * 20) - 20)))) and (bgy[c] < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 60) > (psy[r] - ((pst[r] * 20) - 20)))) {
if ((((((bgd[c] == 0) or (bgd[c] == 1)) or (bgd[c] == 2)) or (bgd[c] == 3)) or (bgd[c] == 4)) or (bgd[c] == 5)) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd1.start();
bgd[c] = 6;
bgs[c] = 8;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
}
r++;
}
c++;
}
r = 1;
while (r <= 8) {
if (((((bgt[r] > 0) and ((bgx[r] - 340) < px)) and ((bgx[r] + 340) > px)) and ((bgy[r] - 180) < py)) and ((bgy[r] + 350) > py)) {
c = 0;
e = 1;
while (e <= 19) {
if (((((bx[e] - 150) < bgx[r]) and ((bx[e] + 150) > bgx[r])) and ((by[e] - 150) < bgy[r])) and ((by[e] + 150) > bgy[r])) {
if (((((bgx[r] + 20) >= (bx[e] - 50)) and ((bgx[r] - 20) <= (bx[e] + 50))) and ((bgy[r] + 45) > (by[e] - 60))) and ((bgy[r] - 10) < (by[e] - 40))) {
c = 1;
}
if (((((bgx[r] + 20) > (bx[e] - 50)) and ((bgx[r] + 20) < bx[e])) and (bgy[r] < (by[e] + 50))) and ((bgy[r] + 20) > (by[e] - 50))) {
bgx[r] = bx[e] - 70;
}
if (((((bgx[r] - 20) < (bx[e] + 50)) and ((bgx[r] + 20) > bx[e])) and (bgy[r] < (by[e] + 50))) and ((bgy[r] + 20) > (by[e] - 50))) {
bgx[r] = bx[e] + 70;
}
if (((((bgx[r] - 5) < (bx[e] + 50)) and ((bgx[r] + 5) > (bx[e] - 50))) and ((bgy[r] - 30) < (by[e] + 50))) and (bgy[r] > (by[e] + 50))) {
bgy[r] = by[e] + 70;
}
if (((((bgx[r] - 2) < (bx[e] + 50)) and ((bgx[r] + 2) > (bx[e] - 50))) and ((bgy[r] + 20) < (by[e] - 50))) and ((bgy[r] + 60) > (by[e] - 50))) {
c = 1;
bgy[r] = by[e] - 105;
}
}
e++;
}
if (c == 0) {
bgy[r] = bgy[r] + 10;
}
if (bgt[r] == 6) {
if (((((((bgx[r] - 10) < (px + 10)) and ((bgx[r] + 10) > (px - 10))) and ((bgy[r] + 50) > (py + 10))) and ((bgy[r] + 10) < (py + 50))) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 4;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 4;
}
megah.start();
i = 10;
}
if (bgd[r] == 0) {
f[r] = 1;
bgy[r] = bgy[r] - 10;
if (((((px - 120) < bgx[r]) and ((px + 120) > bgx[r])) and ((bgy[r] - 80) < py)) and ((bgy[r] + 150) > py)) {
bgd[r] = 1;
bgs[r] = 6;
}
}
if (bgd[r] == 1) {
bgy[r] = bgy[r] - 10;
if (((bgs[r] == 6) or (bgs[r] == 5)) or (bgs[r] == 4)) {
f[r] = 2;
}
if (((bgs[r] == 3) or (bgs[r] == 2)) or (bgs[r] == 1)) {
f[r] = 3;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgs[r] = 4;
bgd[r] = 2;
}
}
if (bgd[r] == 2) {
if ((bgs[r] == 4) or (bgs[r] == 3)) {
f[r] = 4;
}
if ((bgs[r] == 2) or (bgs[r] == 1)) {
f[r] = 5;
}
if (px < bgx[r]) {
bgx[r] = (bgx[r] - 1) - random(10);
}
if (px > bgx[r]) {
bgx[r] = (bgx[r] + 1) + random(10);
}
if (py > bgy[r]) {
bgy[r] = bgy[r] + random(8);
}
if (py < bgy[r]) {
bgy[r] = (bgy[r] - 10) - random(10);
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgs[r] = 4;
}
}
if (bgd[r] == 3) {
if (bgs[r] == 4) {
f[r] = 6;
}
if (bgs[r] == 3) {
f[r] = 7;
}
if (bgs[r] == 2) {
f[r] = 8;
}
if (bgs[r] == 1) {
f[r] = 9;
}
bgs[r] = bgs[r] - 1;
bgy[r] = bgy[r] - 10;
if (bgs[r] <= 0) {
f[r] = 10;
bgt[r] = 0;
bgx[r] = -500;
bgs[r] = 0;
}
}
}
if (bgt[r] == 13) {
if (((((((bgx[r] - 50) < (px + 10)) and ((bgx[r] + 50) > (px - 10))) and ((bgy[r] + 70) > (py + 10))) and (bgy[r] < (py + 50))) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 4;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 4;
}
megah.start();
i = 10;
}
if (bgd[r] == 0) {
f[r] = 1;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
if ((px - 190) < bgx[r]) {
bgd[r] = 1;
bgs[r] = 7;
}
}
if (px < bgx[r]) {
bgd[r] = 3;
}
}
if (bgd[r] == 1) {
f[r] = 2;
bgx[r] = bgx[r] + 20;
bgy[r] = bgy[r] - 15;
if (bgy[r] < py) {
bgy[r] = bgy[r] + 10;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 2;
bgs[r] = 12;
}
}
if (bgd[r] == 2) {
f[r] = 3;
bgx[r] = bgx[r] + 5;
bgy[r] = bgy[r] + 2;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 0;
bgs[r] = random(12) + 6;
}
}
if (bgd[r] == 3) {
f[r] = 4;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
if ((px + 190) > bgx[r]) {
bgd[r] = 4;
bgs[r] = 7;
}
}
if (px > bgx[r]) {
bgd[r] = 0;
}
}
if (bgd[r] == 4) {
f[r] = 5;
bgx[r] = bgx[r] - 20;
bgy[r] = bgy[r] - 15;
bgs[r] = bgs[r] - 1;
if (bgy[r] < py) {
bgy[r] = bgy[r] + 10;
}
if (bgs[r] <= 0) {
bgd[r] = 5;
bgs[r] = 12;
}
}
if (bgd[r] == 5) {
f[r] = 6;
bgx[r] = bgx[r] - 5;
bgy[r] = bgy[r] + 2;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 3;
bgs[r] = random(12) + 6;
}
}
if (bgd[r] == 6) {
if ((bgs[r] == 7) or (bgs[r] == 8)) {
f[r] = 7;
}
if ((bgs[r] == 5) or (bgs[r] == 6)) {
f[r] = 8;
}
if ((bgs[r] == 3) or (bgs[r] == 4)) {
f[r] = 9;
}
if ((bgs[r] == 1) or (bgs[r] == 2)) {
f[r] = 10;
}
bgs[r] = bgs[r] - 1;
bgy[r] = bgy[r] - 10;
if (bgs[r] <= 0) {
bgx[r] = -500;
f[r] = 11;
bgt[r] = 0;
bgs[r] = 0;
}
}
}
}
r++;
}
r = 1;
while (r <= 5) {
if (bgst[r] > 0) {
if (bgst[r] == 1) {
if (r == 1) {
bgs1.gotoAndStop(1);
}
if (r == 2) {
bgs2.gotoAndStop(1);
}
if (r == 3) {
bgs3.gotoAndStop(1);
}
if (r == 4) {
bgs4.gotoAndStop(1);
}
if (r == 5) {
bgs5.gotoAndStop(1);
}
if (bgsd[r] == 0) {
bgsx[r] = bgsx[r] + 20;
if (bgsx[r] > (px + 300)) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgsd[r] == 1) {
bgsx[r] = bgsx[r] - 20;
if (bgsx[r] < (px - 300)) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgsd[r] == 2) {
bgsx[r] = bgsx[r] + 15;
bgsy[r] = bgsy[r] + 15;
if ((bgsx[r] > (px + 300)) or (bgsy[r] > (py + 300))) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgsd[r] == 3) {
bgsx[r] = bgsx[r] - 15;
bgsy[r] = bgsy[r] + 15;
if ((bgsx[r] > (px + 300)) or (bgsy[r] > (py + 300))) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgsd[r] == 4) {
bgsy[r] = bgsy[r] + 20;
if (bgsy[r] > (py + 300)) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (((((((bgsx[r] - 15) < (px + 10)) and ((bgsx[r] + 15) > (px - 10))) and ((bgsy[r] + 15) > (py + 5))) and ((bgsy[r] - 15) < (py + 20))) and (pcd < 18)) and (i < 1)) {
if ((bgsd[r] == 0) or (bgsd[r] == 2)) {
pcd = 19;
}
if ((bgsd[r] == 1) or (bgsd[r] == 3)) {
pcd = 18;
}
pstep = 2;
pl = pl - 3;
megah.start();
i = 10;
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgst[r] == 2) {
if (r == 1) {
bgs1.gotoAndStop(2);
}
if (r == 2) {
bgs2.gotoAndStop(2);
}
if (r == 3) {
bgs3.gotoAndStop(2);
}
if (r == 4) {
bgs4.gotoAndStop(2);
}
if (r == 5) {
bgs5.gotoAndStop(2);
}
if (bgsd[r] == 0) {
bgsx[r] = bgsx[r] + 30;
if (bgsx[r] > (px + 300)) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgsd[r] == 1) {
bgsx[r] = bgsx[r] - 30;
if (bgsx[r] < (px - 300)) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (((((((bgsx[r] - 25) < (px + 10)) and ((bgsx[r] + 25) > (px - 10))) and ((bgsy[r] + 80) > (py + 40))) and ((bgsy[r] + 35) < (py + 60))) and (pcd < 18)) and (i < 1)) {
if (bgsd[r] == 0) {
pcd = 19;
}
if (bgsd[r] == 1) {
pcd = 18;
}
pstep = 2;
pl = pl - 6;
megah.start();
i = 10;
bgst[r] = 0;
bgsx[r] = -200;
}
}
}
r++;
}
bg1.gotoAndStop(f[1]);
bg2.gotoAndStop(f[2]);
bg3.gotoAndStop(f[3]);
bg4.gotoAndStop(f[4]);
bg5.gotoAndStop(f[5]);
bg6.gotoAndStop(f[6]);
bg7.gotoAndStop(f[7]);
bg8.gotoAndStop(f[8]);
bgs1._x = ((bgsx[1] + 275) - px) / 2;
bgs1._y = ((bgsy[1] + 275) - py) / 2;
bgs2._x = ((bgsx[2] + 275) - px) / 2;
bgs2._y = ((bgsy[2] + 275) - py) / 2;
bgs3._x = ((bgsx[3] + 275) - px) / 2;
bgs3._y = ((bgsy[3] + 275) - py) / 2;
bgs4._x = ((bgsx[4] + 275) - px) / 2;
bgs4._y = ((bgsy[4] + 275) - py) / 2;
bgs5._x = ((bgsx[5] + 275) - px) / 2;
bgs5._y = ((bgsy[5] + 275) - py) / 2;
bg1._x = ((bgx[1] + 275) - px) / 2;
bg1._y = ((bgy[1] + 275) - py) / 2;
bg2._x = ((bgx[2] + 275) - px) / 2;
bg2._y = ((bgy[2] + 275) - py) / 2;
bg3._x = ((bgx[3] + 275) - px) / 2;
bg3._y = ((bgy[3] + 275) - py) / 2;
bg4._x = ((bgx[4] + 275) - px) / 2;
bg4._y = ((bgy[4] + 275) - py) / 2;
bg5._x = ((bgx[5] + 275) - px) / 2;
bg5._y = ((bgy[5] + 275) - py) / 2;
bg6._x = ((bgx[6] + 275) - px) / 2;
bg6._y = ((bgy[6] + 275) - py) / 2;
bg7._x = ((bgx[7] + 275) - px) / 2;
bg7._y = ((bgy[7] + 275) - py) / 2;
bg8._x = ((bgx[8] + 275) - px) / 2;
bg8._y = ((bgy[8] + 275) - py) / 2;
r = 1;
while (r <= 3) {
if (((pst[r] > 0) and (pst[r] < 4)) and (psd[r] == 0)) {
if (r == 1) {
shot1p._x = ((297 + psx[1]) - px) / 2;
shot1p._y = ((270 + psy[1]) - py) / 2;
}
if (r == 2) {
shot2p._x = ((297 + psx[2]) - px) / 2;
shot2p._y = ((270 + psy[2]) - py) / 2;
}
if (r == 3) {
shot3p._x = ((297 + psx[3]) - px) / 2;
shot3p._y = ((270 + psy[3]) - py) / 2;
}
}
if (((pst[r] > 0) and (pst[r] < 4)) and (psd[r] == 1)) {
if (r == 1) {
shot1p._x = ((247 + psx[1]) - px) / 2;
shot1p._y = ((270 + psy[1]) - py) / 2;
}
if (r == 2) {
shot2p._x = ((247 + psx[2]) - px) / 2;
shot2p._y = ((270 + psy[2]) - py) / 2;
}
if (r == 3) {
shot3p._x = ((247 + psx[3]) - px) / 2;
shot3p._y = ((270 + psy[3]) - py) / 2;
}
}
if ((pst[r] == 4) or (pst[r] == 5)) {
if (r == 1) {
shot1p._x = ((272 + psx[1]) - px) / 2;
shot1p._y = ((270 + psy[1]) - py) / 2;
}
if (r == 2) {
shot2p._x = ((272 + psx[2]) - px) / 2;
shot2p._y = ((270 + psy[2]) - py) / 2;
}
if (r == 3) {
shot3p._x = ((272 + psx[3]) - px) / 2;
shot3p._y = ((270 + psy[3]) - py) / 2;
}
}
if (pst[r] == 0) {
if (r == 1) {
shot1p._x = -200;
shot1p._y = (270 + psy[1]) - py;
}
if (r == 2) {
shot2p._x = -200;
shot2p._y = (270 + psy[2]) - py;
}
if (r == 3) {
shot3p._x = -200;
shot3p._y = (270 + psy[3]) - py;
}
}
r++;
}
if (i > 0) {
i = i - 1;
pc._alpha = 50;
}
if (i <= 0) {
i = i - 1;
pc._alpha = 100;
}
if (bcharge > 0) {
charge._alpha = bcharge;
}
lbar._height = 2 * pl;
lbar._y = 120 - (2 * pl);
stage._x = (270 - px) / 2;
stage._y = (-425 - py) / 2;
exit._x = ((ex + 275) - px) / 2;
exit._y = ((ey + 275) - py) / 2;
Frame 86
gotoAndPlay (85);
if ((((px + 10) > (ex - 20)) and ((px - 10) < (ex + 20))) and (((py + 30) > (ey - 20)) and (py < (ey + 50)))) {
gotoAndPlay (87);
}
Frame 87
lbar._height = 2 * pl;
lbar._y = 120 - (2 * pl);
stage._x = (270 - px) / 2;
stage._y = (-425 - py) / 2;
exit._x = ((ex + 275) - px) / 2;
exit._y = ((ey + 275) - py) / 2;
Frame 90
psn = 1;
bstep = 0;
pcd = 0;
bcharge = 0;
r = 1;
while (r <= 5) {
psx[r] = -200;
psy[r] = 0;
pst[r] = 0;
psd[r] = 0;
r++;
}
i = 0;
pl = pl + 5;
if (pl > 50) {
pl = 50;
}
px = 150;
py = 350;
r = 0;
while (r <= 31) {
bx[r] = -50;
by[r] = -50;
r++;
}
bx[1] = 50;
by[1] = 150;
bx[2] = 50;
by[2] = 250;
bx[3] = 150;
by[3] = 350;
bx[4] = 250;
by[4] = 350;
bx[5] = 350;
by[5] = 350;
bx[6] = 450;
by[6] = 350;
bx[7] = 550;
by[7] = 350;
bx[8] = 650;
by[8] = 350;
bx[9] = 750;
by[9] = 350;
bx[10] = 850;
by[10] = 350;
bx[11] = 950;
by[11] = 350;
bx[12] = 1050;
by[12] = 350;
bx[13] = 1150;
by[13] = 350;
bx[14] = 1250;
by[14] = 250;
bx[15] = 1150;
by[15] = 150;
bsn = 1;
bi = 0;
r = 1;
while (r <= 8) {
bgx[r] = -200;
bgy[r] = -200;
bgt[r] = 0;
bgd[r] = -1;
bgs[r] = 0;
r++;
}
r = 1;
while (r <= 5) {
bgsx[r] = -200;
bgsy[r] = 0;
bgst[r] = 0;
bgsd[r] = 0;
r++;
}
r = 1;
while (r <= 8) {
f[r] = 20;
r++;
}
bgd[1] = 0;
bgs[1] = 0;
bgl[1] = 50;
bgx[1] = 350;
bgy[1] = 350;
ex = 1150;
ey = 250;
stopAllSounds();
Frame 95
b1._x = bx[1] / 10;
b1._y = (by[1] / 10) + 120;
b2._x = bx[2] / 10;
b2._y = (by[2] / 10) + 120;
b3._x = bx[3] / 10;
b3._y = (by[3] / 10) + 120;
b4._x = bx[4] / 10;
b4._y = (by[4] / 10) + 120;
b5._x = bx[5] / 10;
b5._y = (by[5] / 10) + 120;
b6._x = bx[6] / 10;
b6._y = (by[6] / 10) + 120;
b7._x = bx[7] / 10;
b7._y = (by[7] / 10) + 120;
b8._x = bx[8] / 10;
b8._y = (by[8] / 10) + 120;
b9._x = bx[9] / 10;
b9._y = (by[9] / 10) + 120;
b10._x = bx[10] / 10;
b10._y = (by[10] / 10) + 120;
b11._x = bx[11] / 10;
b11._y = (by[11] / 10) + 120;
b12._x = bx[12] / 10;
b12._y = (by[12] / 10) + 120;
b13._x = bx[13] / 10;
b13._y = (by[13] / 10) + 120;
b14._x = bx[14] / 10;
b14._y = (by[14] / 10) + 120;
b15._x = bx[15] / 10;
b15._y = (by[15] / 10) + 120;
b16._x = bx[16] / 10;
b16._y = (by[16] / 10) + 120;
b17._x = bx[17] / 10;
b17._y = (by[17] / 10) + 120;
b18._x = bx[18] / 10;
b18._y = (by[18] / 10) + 120;
b19._x = bx[19] / 10;
b19._y = (by[19] / 10) + 120;
b20._x = bx[20] / 10;
b20._y = (by[20] / 10) + 120;
b21._x = bx[21] / 10;
b21._y = (by[21] / 10) + 120;
b22._x = bx[22] / 10;
b22._y = (by[22] / 10) + 120;
b23._x = bx[23] / 10;
b23._y = (by[23] / 10) + 120;
b24._x = bx[24] / 10;
b24._y = (by[24] / 10) + 120;
b25._x = bx[25] / 10;
b25._y = (by[25] / 10) + 120;
b26._x = bx[26] / 10;
b26._y = (by[26] / 10) + 120;
b27._x = bx[27] / 10;
b27._y = (by[27] / 10) + 120;
b28._x = bx[28] / 10;
b28._y = (by[28] / 10) + 120;
b29._x = bx[29] / 10;
b29._y = (by[29] / 10) + 120;
b30._x = bx[30] / 10;
b30._y = (by[30] / 10) + 120;
b31._x = bx[31] / 10;
b31._y = (by[31] / 10) + 120;
cir._x = px / 10;
cir._y = (py / 10) + 120;
shot1._x = psx[1] / 10;
shot1._y = (psy[1] / 10) + 120;
shot2._x = psx[2] / 10;
shot2._y = (psy[2] / 10) + 120;
shot3._x = psx[3] / 10;
shot3._y = (psy[3] / 10) + 120;
bshot1._x = bgsx[1] / 10;
bshot1._y = (bgsy[1] / 10) + 120;
bshot2._x = bgsx[2] / 10;
bshot2._y = (bgsy[2] / 10) + 120;
bshot3._x = bgsx[3] / 10;
bshot3._y = (bgsy[3] / 10) + 120;
bshot4._x = bgsx[4] / 10;
bshot4._y = (bgsy[4] / 10) + 120;
bshot5._x = bgsx[5] / 10;
bshot5._y = (bgsy[5] / 10) + 120;
bcir1._x = bgx[1] / 10;
bcir1._y = (bgy[1] / 10) + 120;
bcir2._x = bgx[2] / 10;
bcir2._y = (bgy[2] / 10) + 120;
bcir3._x = bgx[3] / 10;
bcir3._y = (bgy[3] / 10) + 120;
bcir4._x = bgx[4] / 10;
bcir4._y = (bgy[4] / 10) + 120;
bcir5._x = bgx[5] / 10;
bcir5._y = (bgy[5] / 10) + 120;
bcir6._x = bgx[6] / 10;
bcir6._y = (bgy[6] / 10) + 120;
bcir7._x = bgx[7] / 10;
bcir7._y = (bgy[7] / 10) + 120;
bcir8._x = bgx[8] / 10;
bcir8._y = (bgy[8] / 10) + 120;
bcir9._x = bgx[9] / 10;
bcir9._y = (bgy[9] / 10) + 120;
bcir10._x = bgx[10] / 10;
bcir10._y = (bgy[10] / 10) + 120;
bcir11._x = bgx[11] / 10;
bcir11._y = (bgy[11] / 10) + 120;
bcir12._x = bgx[12] / 10;
bcir12._y = (bgy[12] / 10) + 120;
bcir13._x = bgx[13] / 10;
bcir13._y = (bgy[13] / 10) + 120;
if (Key.isDown(39) and (pcd == 0)) {
pcd = 2;
}
if (Key.isDown(39) and ((pcd == 1) or (pcd == 3))) {
pcd = 0;
}
if (Key.isDown(37) and (pcd == 1)) {
pcd = 3;
}
if (Key.isDown(37) and ((pcd == 0) or (pcd == 2))) {
pcd = 1;
}
if (Key.isDown(38) and ((pcd == 0) or (pcd == 2))) {
pcd = 10;
pstep = 7;
}
if (Key.isDown(38) and ((pcd == 1) or (pcd == 3))) {
pcd = 11;
pstep = 7;
}
if (Key.isDown(40) and ((((pcd == 0) or (pcd == 1)) or (pcd == 2)) or (pcd == 3))) {
if (((pcd == 0) or (pcd == 2)) or (pcd == 8)) {
pcd = 6;
pstep = 3;
}
if (((pcd == 1) or (pcd == 3)) or (pcd == 9)) {
pcd = 7;
pstep = 3;
}
}
if (Key.isDown(16) and (bcharge < 100)) {
bcharge = bcharge + 5;
}
if (pcd == 0) {
pc.gotoAndStop(1);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(21);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px + 10;
psy[psn] = py;
psd[psn] = 0;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
}
if (pcd == 1) {
pc.gotoAndStop(2);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(22);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px - 10;
psy[psn] = py;
psd[psn] = 1;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
}
if (pcd == 2) {
px = px + 13;
if ((w == 0) or (w == 1)) {
pc.gotoAndStop(3);
}
if ((w == 2) or (w == 3)) {
pc.gotoAndStop(4);
}
if ((w == 4) or (w == 5)) {
pc.gotoAndStop(5);
}
if ((w == 6) or (w == 7)) {
pc.gotoAndStop(6);
}
if (Key.isDown(32)) {
if ((w == 0) or (w == 1)) {
pc.gotoAndStop(11);
}
if ((w == 2) or (w == 3)) {
pc.gotoAndStop(12);
}
if ((w == 4) or (w == 5)) {
pc.gotoAndStop(13);
}
if ((w == 6) or (w == 7)) {
pc.gotoAndStop(14);
}
if ((pst[psn] == 0) and (bstep == 0)) {
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px + 10;
psy[psn] = py;
psd[psn] = 0;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
}
pcd = 0;
}
if (pcd == 3) {
px = px - 13;
if ((w == 0) or (w == 1)) {
pc.gotoAndStop(7);
}
if ((w == 2) or (w == 3)) {
pc.gotoAndStop(8);
}
if ((w == 4) or (w == 5)) {
pc.gotoAndStop(9);
}
if ((w == 6) or (w == 7)) {
pc.gotoAndStop(10);
}
if (Key.isDown(32)) {
if ((w == 0) or (w == 1)) {
pc.gotoAndStop(15);
}
if ((w == 2) or (w == 3)) {
pc.gotoAndStop(16);
}
if ((w == 4) or (w == 5)) {
pc.gotoAndStop(17);
}
if ((w == 6) or (w == 7)) {
pc.gotoAndStop(18);
}
if ((pst[psn] == 0) and (bstep == 0)) {
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px - 10;
psy[psn] = py;
psd[psn] = 1;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
}
pcd = 1;
}
if (pcd == 9) {
pstep = pstep - 1;
if (pstep <= 0) {
pcd = 1;
}
}
if (pcd == 6) {
pc.gotoAndStop(19);
px = px + 20;
pstep = pstep - 1;
if (pstep <= 0) {
pcd = 0;
}
}
if (pcd == 7) {
pc.gotoAndStop(20);
px = px - 20;
pstep = pstep - 1;
if (pstep <= 0) {
pcd = 1;
}
}
if (pcd == 12) {
pc.gotoAndStop(23);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(25);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px + 10;
psy[psn] = py;
psd[psn] = 0;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
py = py + (5 * (7 - pstep));
pstep = pstep - 1;
if (pstep <= 2) {
pstep = 2;
}
if (Key.isDown(39)) {
px = px + 13;
}
if (Key.isDown(37)) {
px = px - 13;
if (bstep == 0) {
pcd = 13;
}
}
}
if (pcd == 13) {
pc.gotoAndStop(24);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(26);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px - 10;
psy[psn] = py;
psd[psn] = 1;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
py = py + (5 * (7 - pstep));
pstep = pstep - 1;
if (pstep <= 2) {
pstep = 2;
}
if (Key.isDown(39)) {
px = px + 13;
if (bstep == 0) {
pcd = 12;
}
}
if (Key.isDown(37)) {
px = px - 13;
}
}
if (pcd == 10) {
pc.gotoAndStop(23);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(25);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px + 10;
psy[psn] = py;
psd[psn] = 0;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
py = py - (5 * pstep);
pstep = pstep - 1;
if (Key.isDown(39)) {
px = px + 13;
}
if (Key.isDown(37)) {
px = px - 13;
if (bstep == 0) {
pcd = 11;
}
}
if (Key.isDown(40)) {
pcd = 12;
pstep = pstep + 3;
}
if (pstep <= -1) {
pstep = 7;
pcd = 12;
}
}
if (pcd == 11) {
pc.gotoAndStop(24);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(26);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px - 10;
psy[psn] = py;
psd[psn] = 1;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
py = py - (5 * pstep);
pstep = pstep - 1;
if (Key.isDown(39)) {
px = px + 13;
if (bstep == 0) {
pcd = 10;
}
}
if (Key.isDown(37)) {
px = px - 13;
}
if (Key.isDown(40)) {
pcd = 13;
pstep = pstep + 3;
}
if (pstep <= -1) {
pstep = 7;
pcd = 13;
}
}
if (pcd == 18) {
pc.gotoAndStop(27);
pstep = pstep - 1;
px = px - 5;
if (pstep <= -1) {
pstep = 2;
pcd = 0;
}
}
if (pcd == 19) {
pc.gotoAndStop(28);
pstep = pstep - 1;
px = px + 5;
if (pstep <= -1) {
pstep = 2;
pcd = 1;
}
}
if (pcd == 20) {
pc.gotoAndStop(69 - pstep);
bcharge = 0;
bstep = 20;
pl = 1;
pstep = pstep - 1;
if (pstep < 0) {
lives = lives - 1;
if (lives >= 0) {
pl = 50;
gotoAndPlay (90);
}
if (lives < 0) {
lives = 2;
continues = continues - 1;
gotoAndPlay (5);
}
}
}
if (pcd == 21) {
pc.gotoAndStop(77 - pstep);
charge._alpha = 0;
bcharge = 0;
bstep = 20;
pstep = pstep - 1;
if (pstep < 0) {
pstep = 0;
}
}
if (pl <= 0) {
pc._alpha = 100;
pcd = 20;
pstep = 40;
megad.start();
}
if (bstep > 0) {
bcharge = 0;
charge._alpha = bcharge;
}
if (bstep > 0) {
bstep = bstep - 1;
}
if (py > 350) {
py = 350;
if ((((pcd == 12) or (pcd == 13)) or (pcd == 16)) or (pcd == 17)) {
if ((pcd == 12) or (pcd == 16)) {
pcd = 0;
}
if ((pcd == 13) or (pcd == 17)) {
pcd = 1;
}
}
}
if ((pcd == 18) and (py < 350)) {
pcd = 12;
pstep = 5;
}
if ((pcd == 19) and (py < 350)) {
pcd = 13;
pstep = 5;
}
if (px < 25) {
px = 25;
}
if (px > 525) {
px = 525;
}
w = w - 1;
if (w < 0) {
w = 7;
}
e = pcd;
r = 1;
while (r <= 3) {
if (pst[r] == 1) {
if (psd[r] == 0) {
psx[r] = psx[r] + 30;
if (r == 1) {
shot1p.gotoAndStop(1);
}
if (r == 2) {
shot2p.gotoAndStop(1);
}
if (r == 3) {
shot3p.gotoAndStop(1);
}
if (psx[r] > 580) {
pst[r] = 0;
psx[r] = -200;
}
}
if (psd[r] == 1) {
psx[r] = psx[r] - 30;
if (r == 1) {
shot1p.gotoAndStop(2);
}
if (r == 2) {
shot2p.gotoAndStop(2);
}
if (r == 3) {
shot3p.gotoAndStop(2);
}
if (psx[r] < -30) {
pst[r] = 0;
psx[r] = -200;
}
}
}
if (pst[r] == 2) {
if (psd[r] == 0) {
psx[r] = psx[r] + 35;
if (r == 1) {
shot1p.gotoAndStop(3);
}
if (r == 2) {
shot2p.gotoAndStop(3);
}
if (r == 3) {
shot3p.gotoAndStop(3);
}
if (psx[r] > 600) {
pst[r] = 0;
psx[r] = -200;
}
}
if (psd[r] == 1) {
psx[r] = psx[r] - 35;
if (r == 1) {
shot1p.gotoAndStop(4);
}
if (r == 2) {
shot2p.gotoAndStop(4);
}
if (r == 3) {
shot3p.gotoAndStop(4);
}
if (psx[r] < -50) {
pst[r] = 0;
psx[r] = -200;
}
}
}
if (pst[r] == 3) {
if (psd[r] == 0) {
psx[r] = psx[r] + 40;
if (r == 1) {
shot1p.gotoAndStop(5);
}
if (r == 2) {
shot2p.gotoAndStop(5);
}
if (r == 3) {
shot3p.gotoAndStop(5);
}
if (psx[r] > 630) {
pst[r] = 0;
psx[r] = -200;
}
}
if (psd[r] == 1) {
psx[r] = psx[r] - 40;
if (r == 1) {
shot1p.gotoAndStop(6);
}
if (r == 2) {
shot2p.gotoAndStop(6);
}
if (r == 3) {
shot3p.gotoAndStop(6);
}
if (psx[r] < -80) {
pst[r] = 0;
psx[r] = -200;
}
}
}
if (pst[r] == 4) {
if (r == 1) {
shot1p.gotoAndStop(10 - psd[r]);
}
if (r == 2) {
shot2p.gotoAndStop(10 - psd[r]);
}
if (r == 3) {
shot3p.gotoAndStop(10 - psd[r]);
}
psd[r] = psd[r] - 1;
if (psd[r] < 0) {
pst[r] = 0;
psx[r] = -200;
}
}
if (pst[r] == 5) {
if (r == 1) {
shot1p.gotoAndStop(14 - psd[r]);
}
if (r == 2) {
shot2p.gotoAndStop(14 - psd[r]);
}
if (r == 3) {
shot3p.gotoAndStop(14 - psd[r]);
}
psd[r] = psd[r] - 1;
if (psd[r] < 0) {
pst[r] = 0;
psx[r] = -200;
}
}
r++;
}
r = 1;
while (r <= 3) {
if ((pst[r] > 0) and (pst[r] < 4)) {
if (((((((bgx[1] - 22) < (psx[r] + ((pst[r] * 20) - 20))) and ((bgx[1] + 22) > (psx[r] - ((pst[r] * 20) - 20)))) and ((bgy[1] - 35) < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[1] + 35) > (psy[r] - ((pst[r] * 20) - 20)))) and (bi < 1)) and (bgl[1] > 0)) {
if ((((bgd[1] == 2) or (bgd[1] == 3)) or (bgd[1] == 8)) or (bgd[1] == 9)) {
deflect.start();
pst[r] = 5;
psd[r] = 2;
}
if ((((((((((bgd[1] == 0) or (bgd[1] == 1)) or (bgd[1] == 4)) or (bgd[1] == 5)) or (bgd[1] == 6)) or (bgd[1] == 7)) or (bgd[1] == 10)) or (bgd[1] == 11)) or (bgd[1] == 12)) or (bgd[1] == 13)) {
megash.start();
bgl[1] = bgl[1] - pst[r];
bi = 12;
if (bgl[1] < 1) {
bi = 0;
baddyd2.start();
bgd[1] = 14;
bgs[1] = 10;
pcd = 21;
pstep = 7;
}
if ((bgl[1] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
}
r++;
}
if (bgd[1] == 0) {
boss.gotoAndStop(1);
if (px < bgx[1]) {
bgd[1] = 1;
}
c = random(160 - (5 * dif));
if (c < 10) {
bgd[1] = 2;
bgs[1] = 7;
}
if ((c > 10) and (c < 40)) {
if (py > 300) {
bgd[1] = 4;
}
if (py <= 300) {
bgd[1] = 6;
}
bgs[1] = 8;
}
if ((c > 45) and (c < 60)) {
bgd[1] = 10;
bgs[1] = 9;
}
}
if (bgd[1] == 1) {
boss.gotoAndStop(13);
if (px > bgx[1]) {
bgd[1] = 0;
}
c = random(160 - (5 * dif));
if (c < 10) {
bgd[1] = 3;
bgs[1] = 7;
}
if ((c > 10) and (c < 40)) {
if (py > 300) {
bgd[1] = 5;
}
if (py <= 300) {
bgd[1] = 7;
}
bgs[1] = 8;
}
if ((c > 45) and (c < 60)) {
bgd[1] = 11;
bgs[1] = 9;
}
}
if (bgd[1] == 2) {
if ((bgs[1] == 0) or (bgs[1] == 1)) {
boss.gotoAndStop(2);
}
if ((bgs[1] == 2) or (bgs[1] == 3)) {
boss.gotoAndStop(3);
}
if ((bgs[1] == 4) or (bgs[1] == 5)) {
boss.gotoAndStop(2);
}
if ((bgs[1] == 6) or (bgs[1] == 7)) {
boss.gotoAndStop(3);
}
bgs[1] = bgs[1] - 1;
if (bgs[1] < 0) {
bgd[1] = 0;
c = random(100 - (3 * dif));
if (c < 7) {
bgd[1] = 8;
bgs[1] = 29;
}
}
}
if (bgd[1] == 3) {
if ((bgs[1] == 0) or (bgs[1] == 1)) {
boss.gotoAndStop(14);
}
if ((bgs[1] == 2) or (bgs[1] == 3)) {
boss.gotoAndStop(15);
}
if ((bgs[1] == 4) or (bgs[1] == 5)) {
boss.gotoAndStop(14);
}
if ((bgs[1] == 6) or (bgs[1] == 7)) {
boss.gotoAndStop(15);
}
bgs[1] = bgs[1] - 1;
if (bgs[1] < 0) {
bgd[1] = 1;
c = random(100 - (3 * dif));
if (c < 7) {
bgd[1] = 9;
bgs[1] = 29;
}
}
}
if (bgd[1] == 4) {
if (((bgs[1] == 0) or (bgs[1] == 1)) or (bgs[1] == 2)) {
boss.gotoAndStop(7);
}
if (((bgs[1] == 3) or (bgs[1] == 4)) or (bgs[1] == 5)) {
boss.gotoAndStop(6);
}
if (((bgs[1] == 6) or (bgs[1] == 7)) or (bgs[1] == 8)) {
boss.gotoAndStop(5);
}
bgx[1] = bgx[1] + 4;
bgs[1] = bgs[1] - 1;
if (bgs[1] <= 0) {
nunchakuswing.start();
bgd[1] = 2;
bgs[1] = 3;
bgst[bsn] = 1;
bgsx[bsn] = bgx[1] + 20;
bgsy[bsn] = bgy[1] + 15;
bgsd[bsn] = 0;
bsn = bsn + 1;
if (bsn > 5) {
bsn = 1;
}
}
}
if (bgd[1] == 5) {
if (((bgs[1] == 0) or (bgs[1] == 1)) or (bgs[1] == 2)) {
boss.gotoAndStop(19);
}
if (((bgs[1] == 3) or (bgs[1] == 4)) or (bgs[1] == 5)) {
boss.gotoAndStop(18);
}
if (((bgs[1] == 6) or (bgs[1] == 7)) or (bgs[1] == 8)) {
boss.gotoAndStop(17);
}
bgx[1] = bgx[1] - 4;
bgs[1] = bgs[1] - 1;
if (bgs[1] <= 0) {
nunchakuswing.start();
bgd[1] = 3;
bgs[1] = 3;
bgst[bsn] = 1;
bgsx[bsn] = bgx[1] - 20;
bgsy[bsn] = bgy[1] + 15;
bgsd[bsn] = 1;
bsn = bsn + 1;
if (bsn > 5) {
bsn = 1;
}
}
}
if (bgd[1] == 6) {
if (((bgs[1] == 0) or (bgs[1] == 1)) or (bgs[1] == 2)) {
boss.gotoAndStop(10);
}
if (((bgs[1] == 3) or (bgs[1] == 4)) or (bgs[1] == 5)) {
boss.gotoAndStop(9);
}
if (((bgs[1] == 6) or (bgs[1] == 7)) or (bgs[1] == 8)) {
boss.gotoAndStop(8);
}
bgx[1] = bgx[1] + 4;
bgs[1] = bgs[1] - 1;
if (bgs[1] <= 0) {
nunchakuswing.start();
bgd[1] = 2;
bgs[1] = 3;
bgst[bsn] = 1;
bgsx[bsn] = bgx[1] + 20;
bgsy[bsn] = bgy[1] + 15;
bgsd[bsn] = 2;
bsn = bsn + 1;
if (bsn > 5) {
bsn = 1;
}
}
}
if (bgd[1] == 7) {
if (((bgs[1] == 0) or (bgs[1] == 1)) or (bgs[1] == 2)) {
boss.gotoAndStop(22);
}
if (((bgs[1] == 3) or (bgs[1] == 4)) or (bgs[1] == 5)) {
boss.gotoAndStop(21);
}
if (((bgs[1] == 6) or (bgs[1] == 7)) or (bgs[1] == 8)) {
boss.gotoAndStop(20);
}
bgx[1] = bgx[1] - 4;
bgs[1] = bgs[1] - 1;
if (bgs[1] <= 0) {
nunchakuswing.start();
bgd[1] = 3;
bgs[1] = 3;
bgst[bsn] = 1;
bgsx[bsn] = bgx[1] - 20;
bgsy[bsn] = bgy[1] + 15;
bgsd[bsn] = 3;
bsn = bsn + 1;
if (bsn > 5) {
bsn = 1;
}
}
}
if (bgd[1] == 8) {
if (((bgs[1] == 0) or (bgs[1] == 1)) or (bgs[1] == 2)) {
boss.gotoAndStop(12);
}
if (((bgs[1] == 3) or (bgs[1] == 4)) or (bgs[1] == 5)) {
boss.gotoAndStop(11);
}
if (((bgs[1] == 6) or (bgs[1] == 7)) or (bgs[1] == 8)) {
boss.gotoAndStop(12);
}
if (((bgs[1] == 9) or (bgs[1] == 10)) or (bgs[1] == 11)) {
boss.gotoAndStop(11);
}
if (((bgs[1] == 12) or (bgs[1] == 13)) or (bgs[1] == 14)) {
boss.gotoAndStop(12);
}
if (((bgs[1] == 15) or (bgs[1] == 16)) or (bgs[1] == 17)) {
boss.gotoAndStop(11);
}
if (((bgs[1] == 18) or (bgs[1] == 19)) or (bgs[1] == 20)) {
boss.gotoAndStop(12);
}
if (((bgs[1] == 21) or (bgs[1] == 22)) or (bgs[1] == 23)) {
boss.gotoAndStop(11);
}
if (((bgs[1] == 24) or (bgs[1] == 25)) or (bgs[1] == 26)) {
boss.gotoAndStop(12);
}
if (((bgs[1] == 27) or (bgs[1] == 28)) or (bgs[1] == 29)) {
boss.gotoAndStop(11);
}
bgx[1] = bgx[1] + 1;
bgs[1] = bgs[1] - 1;
if (((((bgs[1] == 0) or (bgs[1] == 6)) or (bgs[1] == 12)) or (bgs[1] == 18)) or (bgs[1] == 24)) {
cannons.start();
bgst[bsn] = 1;
bgsx[bsn] = bgx[1] + 20;
bgsy[bsn] = bgy[1] + 15;
bgsd[bsn] = 2 * random(2);
bsn = bsn + 1;
if (bsn > 5) {
bsn = 1;
}
}
if (bgs[1] < 0) {
bgd[1] = 2;
bgs[1] = 7;
}
}
if (bgd[1] == 9) {
if (((bgs[1] == 0) or (bgs[1] == 1)) or (bgs[1] == 2)) {
boss.gotoAndStop(24);
}
if (((bgs[1] == 3) or (bgs[1] == 4)) or (bgs[1] == 5)) {
boss.gotoAndStop(23);
}
if (((bgs[1] == 6) or (bgs[1] == 7)) or (bgs[1] == 8)) {
boss.gotoAndStop(24);
}
if (((bgs[1] == 9) or (bgs[1] == 10)) or (bgs[1] == 11)) {
boss.gotoAndStop(23);
}
if (((bgs[1] == 12) or (bgs[1] == 13)) or (bgs[1] == 14)) {
boss.gotoAndStop(24);
}
if (((bgs[1] == 15) or (bgs[1] == 16)) or (bgs[1] == 17)) {
boss.gotoAndStop(23);
}
if (((bgs[1] == 18) or (bgs[1] == 19)) or (bgs[1] == 20)) {
boss.gotoAndStop(24);
}
if (((bgs[1] == 21) or (bgs[1] == 22)) or (bgs[1] == 23)) {
boss.gotoAndStop(23);
}
if (((bgs[1] == 24) or (bgs[1] == 25)) or (bgs[1] == 26)) {
boss.gotoAndStop(24);
}
if (((bgs[1] == 27) or (bgs[1] == 28)) or (bgs[1] == 29)) {
boss.gotoAndStop(23);
}
bgx[1] = bgx[1] - 1;
bgs[1] = bgs[1] - 1;
if (((((bgs[1] == 0) or (bgs[1] == 6)) or (bgs[1] == 12)) or (bgs[1] == 18)) or (bgs[1] == 24)) {
cannons.start();
bgst[bsn] = 1;
bgsx[bsn] = bgx[1] - 20;
bgsy[bsn] = bgy[1] + 15;
bgsd[bsn] = (2 * random(2)) + 1;
bsn = bsn + 1;
if (bsn > 5) {
bsn = 1;
}
}
if (bgs[1] < 0) {
bgd[1] = 3;
bgs[1] = 7;
}
}
if (bgd[1] == 10) {
boss.gotoAndStop(4);
bgx[1] = bgx[1] + 18;
bgy[1] = bgy[1] - (2 * bgs[1]);
bgs[1] = bgs[1] - 1;
if (bgs[1] < 0) {
bgd[1] = 12;
bgs[1] = 9;
}
}
if (bgd[1] == 12) {
boss.gotoAndStop(4);
bgx[1] = bgx[1] + 18;
bgy[1] = bgy[1] + ((9 - bgs[1]) * 2);
bgs[1] = bgs[1] - 1;
if (bgs[1] < 0) {
if (px < bgx[1]) {
bgd[1] = 1;
}
if (px > bgx[1]) {
bgd[1] = 0;
}
}
}
if (bgd[1] == 11) {
boss.gotoAndStop(16);
bgx[1] = bgx[1] - 18;
bgy[1] = bgy[1] - (2 * bgs[1]);
bgs[1] = bgs[1] - 1;
if (bgs[1] < 0) {
bgd[1] = 13;
bgs[1] = 9;
}
}
if (bgd[1] == 13) {
boss.gotoAndStop(16);
bgx[1] = bgx[1] - 18;
bgy[1] = bgy[1] + ((9 - bgs[1]) * 2);
bgs[1] = bgs[1] - 1;
if (bgs[1] < 0) {
if (px < bgx[1]) {
bgd[1] = 1;
}
if (px > bgx[1]) {
bgd[1] = 0;
}
}
}
if (bgd[1] == 14) {
boss.gotoAndStop(10);
if ((bgs[1] == 0) or (bgs[1] == 1)) {
boss.gotoAndStop(30);
}
if ((bgs[1] == 2) or (bgs[1] == 3)) {
boss.gotoAndStop(29);
}
if ((bgs[1] == 4) or (bgs[1] == 5)) {
boss.gotoAndStop(28);
}
if ((bgs[1] == 6) or (bgs[1] == 7)) {
boss.gotoAndStop(27);
}
if ((bgs[1] == 8) or (bgs[1] == 9)) {
boss.gotoAndStop(26);
}
if (bgs[1] == 10) {
boss.gotoAndStop(25);
}
bgs[1] = bgs[1] - 1;
if (bgs[1] < 0) {
gotoAndPlay (97);
}
}
r = 1;
while (r <= 5) {
if (bgst[r] > 0) {
if (bgst[r] == 1) {
if (bgsd[r] == 0) {
if (r == 1) {
bgs1.gotoAndStop(1);
}
if (r == 2) {
bgs2.gotoAndStop(1);
}
if (r == 3) {
bgs3.gotoAndStop(1);
}
if (r == 4) {
bgs4.gotoAndStop(1);
}
if (r == 5) {
bgs5.gotoAndStop(1);
}
bgsx[r] = bgsx[r] + 25;
if (bgsx[r] > 580) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgsd[r] == 1) {
if (r == 1) {
bgs1.gotoAndStop(2);
}
if (r == 2) {
bgs2.gotoAndStop(2);
}
if (r == 3) {
bgs3.gotoAndStop(2);
}
if (r == 4) {
bgs4.gotoAndStop(2);
}
if (r == 5) {
bgs5.gotoAndStop(2);
}
bgsx[r] = bgsx[r] - 25;
if (bgsx[r] < -30) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgsd[r] == 2) {
if (r == 1) {
bgs1.gotoAndStop(1);
}
if (r == 2) {
bgs2.gotoAndStop(1);
}
if (r == 3) {
bgs3.gotoAndStop(1);
}
if (r == 4) {
bgs4.gotoAndStop(1);
}
if (r == 5) {
bgs5.gotoAndStop(1);
}
bgsx[r] = bgsx[r] + 25;
bgsy[r] = bgsy[r] - 7;
if (bgsx[r] > 580) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgsd[r] == 3) {
if (r == 1) {
bgs1.gotoAndStop(2);
}
if (r == 2) {
bgs2.gotoAndStop(2);
}
if (r == 3) {
bgs3.gotoAndStop(2);
}
if (r == 4) {
bgs4.gotoAndStop(2);
}
if (r == 5) {
bgs5.gotoAndStop(2);
}
bgsx[r] = bgsx[r] - 25;
bgsy[r] = bgsy[r] - 7;
if (bgsx[r] < -30) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if ((((((((bgsx[r] - 15) < (px + 10)) and ((bgsx[r] + 15) > (px - 10))) and ((bgsy[r] + 25) > (py + 5))) and ((bgsy[r] - 25) < (py + 20))) and (pcd < 18)) and (i < 1)) and (pl > 0)) {
if ((bgsd[r] == 0) or (bgsd[r] == 2)) {
pcd = 19;
}
if ((bgsd[r] == 1) or (bgsd[r] == 3)) {
pcd = 18;
}
pstep = 2;
pl = pl - 2;
megah.start();
i = 10;
bgst[r] = 0;
bgsx[r] = -200;
}
}
}
r++;
}
if ((((((((bgx[1] - 20) < (px + 10)) and ((bgx[1] + 20) > (px - 10))) and ((bgy[1] + 60) > (py + 10))) and ((bgy[1] + 20) < (py + 50))) and (pcd < 18)) and (i < 1)) and (pl > 0)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 2;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 2;
}
megah.start();
i = 10;
}
if (bgx[1] < 25) {
bgx[1] = 25;
}
if (bgx[1] > 525) {
bgx[1] = 525;
}
if (bgy[1] > 350) {
bgy[1] = 350;
}
bgs1._x = bgsx[1] / 2;
bgs1._y = (bgsy[1] / 2) - 20;
bgs2._x = bgsx[2] / 2;
bgs2._y = (bgsy[2] / 2) - 20;
bgs3._x = bgsx[3] / 2;
bgs3._y = (bgsy[3] / 2) - 20;
bgs4._x = bgsx[4] / 2;
bgs4._y = (bgsy[4] / 2) - 20;
bgs5._x = bgsx[5] / 2;
bgs5._y = (bgsy[5] / 2) - 20;
r = 1;
while (r <= 3) {
if (((pst[r] > 0) and (pst[r] < 4)) and (psd[r] == 0)) {
if (r == 1) {
shot1p._x = psx[1] / 2;
shot1p._y = psy[1] / 2;
}
if (r == 2) {
shot2p._x = psx[2] / 2;
shot2p._y = psy[2] / 2;
}
if (r == 3) {
shot3p._x = psx[3] / 2;
shot3p._y = psy[3] / 2;
}
}
if (((pst[r] > 0) and (pst[r] < 4)) and (psd[r] == 1)) {
if (r == 1) {
shot1p._x = psx[1] / 2;
shot1p._y = psy[1] / 2;
}
if (r == 2) {
shot2p._x = psx[2] / 2;
shot2p._y = psy[2] / 2;
}
if (r == 3) {
shot3p._x = psx[3] / 2;
shot3p._y = psy[3] / 2;
}
}
if ((pst[r] == 4) or (pst[r] == 5)) {
if (r == 1) {
shot1p._x = psx[1] / 2;
shot1p._y = psy[1] / 2;
}
if (r == 2) {
shot2p._x = psx[2] / 2;
shot2p._y = psy[2] / 2;
}
if (r == 3) {
shot3p._x = psx[3] / 2;
shot3p._y = psy[3] / 2;
}
}
if (pst[r] == 0) {
if (r == 1) {
shot1p._x = -200;
shot1p._y = (270 + psy[1]) - py;
}
if (r == 2) {
shot2p._x = -200;
shot2p._y = (270 + psy[2]) - py;
}
if (r == 3) {
shot3p._x = -200;
shot3p._y = (270 + psy[3]) - py;
}
}
r++;
}
if (i > 0) {
i = i - 1;
pc._alpha = 50;
}
if (i <= 0) {
i = i - 1;
pc._alpha = 100;
}
if (bi > 0) {
bi = bi - 1;
boss._alpha = 50;
}
if (bi <= 0) {
boss._alpha = 100;
}
if (bcharge > 0) {
charge._alpha = bcharge;
}
charge._x = px / 2;
charge._y = py / 2;
boss._x = bgx[1] / 2;
boss._y = (bgy[1] / 2) - 11;
pc._x = px / 2;
pc._y = py / 2;
lbar._height = 2 * pl;
lbar._y = 120 - (2 * pl);
bbar._height = 2 * bgl[1];
bbar._y = 120 - (2 * bgl[1]);
Frame 96
gotoAndPlay (95);
Frame 97
lbar._height = 2 * pl;
lbar._y = 120 - (2 * pl);
stage._x = (270 - px) / 2;
stage._y = (-725 - py) / 2;
exit._x = ((ex + 275) - px) / 2;
exit._y = ((ey + 275) - py) / 2;
Frame 99
gotoAndPlay (5);
Frame 100
psn = 1;
bstep = 0;
pcd = 0;
bcharge = 0;
r = 1;
while (r <= 5) {
psx[r] = -200;
psy[r] = 0;
pst[r] = 0;
psd[r] = 0;
r++;
}
i = 0;
pl = 50;
px = 150;
py = 175;
r = 0;
while (r <= 31) {
bx[r] = -50;
by[r] = -50;
r++;
}
bx[1] = 150;
by[1] = 250;
bx[2] = 350;
by[2] = 250;
bx[3] = 450;
by[3] = 200;
bx[4] = 750;
by[4] = 200;
bx[5] = 850;
by[5] = 200;
bx[6] = 950;
by[6] = 150;
bx[7] = 1000;
by[7] = 100;
bx[8] = 1250;
by[8] = 50;
bx[9] = 1450;
by[9] = 50;
bx[10] = 1650;
by[10] = 50;
bx[11] = 1850;
by[11] = 50;
bx[12] = 1950;
by[12] = 50;
bx[13] = 2150;
by[13] = -75;
bsn = 1;
r = 1;
while (r <= 8) {
bgx[r] = -200;
bgy[r] = -200;
bgt[r] = 0;
bgd[r] = -1;
bgs[r] = 0;
r++;
}
r = 1;
while (r <= 5) {
bgsx[r] = -200;
bgsy[r] = 0;
bgst[r] = 0;
bgsd[r] = 0;
r++;
}
r = 1;
while (r <= 8) {
f[r] = 20;
r++;
}
bgt[1] = 12;
bgd[1] = 0;
bgs[1] = 0;
bgl[1] = 2;
bgx[1] = 550;
bgy[1] = 0;
bgt[2] = 3;
bgd[2] = 0;
bgs[2] = 0;
bgl[2] = 3;
bgx[2] = 750;
bgy[2] = -50;
bgt[3] = 3;
bgd[3] = 0;
bgs[3] = 0;
bgl[3] = 3;
bgx[3] = 1150;
bgy[3] = -100;
bgt[4] = 12;
bgd[4] = 0;
bgs[4] = 0;
bgl[4] = 2;
bgx[4] = 1300;
bgy[4] = -150;
bgt[5] = 12;
bgd[5] = 0;
bgs[5] = 0;
bgl[5] = 2;
bgx[5] = 1550;
bgy[5] = -100;
ex = 2150;
ey = -175;
stopAllSounds();
Frame 101
lbar._height = 2 * pl;
lbar._y = 120 - (2 * pl);
stage._x = (275 - px) / 2;
stage._y = (-225 - py) / 2;
exit._x = ((ex + 275) - px) / 2;
exit._y = ((ey + 275) - py) / 2;
pc.gotoAndStop(1);
Frame 112
b1._x = bx[1] / 10;
b1._y = (by[1] / 10) + 120;
b2._x = bx[2] / 10;
b2._y = (by[2] / 10) + 120;
b3._x = bx[3] / 10;
b3._y = (by[3] / 10) + 120;
b4._x = bx[4] / 10;
b4._y = (by[4] / 10) + 120;
b5._x = bx[5] / 10;
b5._y = (by[5] / 10) + 120;
b6._x = bx[6] / 10;
b6._y = (by[6] / 10) + 120;
b7._x = bx[7] / 10;
b7._y = (by[7] / 10) + 120;
b8._x = bx[8] / 10;
b8._y = (by[8] / 10) + 120;
b9._x = bx[9] / 10;
b9._y = (by[9] / 10) + 120;
b10._x = bx[10] / 10;
b10._y = (by[10] / 10) + 120;
b11._x = bx[11] / 10;
b11._y = (by[11] / 10) + 120;
b12._x = bx[12] / 10;
b12._y = (by[12] / 10) + 120;
b13._x = bx[13] / 10;
b13._y = (by[13] / 10) + 120;
b14._x = bx[14] / 10;
b14._y = (by[14] / 10) + 120;
b15._x = bx[15] / 10;
b15._y = (by[15] / 10) + 120;
b16._x = bx[16] / 10;
b16._y = (by[16] / 10) + 120;
b17._x = bx[17] / 10;
b17._y = (by[17] / 10) + 120;
b18._x = bx[18] / 10;
b18._y = (by[18] / 10) + 120;
b19._x = bx[19] / 10;
b19._y = (by[19] / 10) + 120;
b20._x = bx[20] / 10;
b20._y = (by[20] / 10) + 120;
b21._x = bx[21] / 10;
b21._y = (by[21] / 10) + 120;
b22._x = bx[22] / 10;
b22._y = (by[22] / 10) + 120;
b23._x = bx[23] / 10;
b23._y = (by[23] / 10) + 120;
b24._x = bx[24] / 10;
b24._y = (by[24] / 10) + 120;
b25._x = bx[25] / 10;
b25._y = (by[25] / 10) + 120;
b26._x = bx[26] / 10;
b26._y = (by[26] / 10) + 120;
b27._x = bx[27] / 10;
b27._y = (by[27] / 10) + 120;
b28._x = bx[28] / 10;
b28._y = (by[28] / 10) + 120;
cir._x = px / 10;
cir._y = (py / 10) + 120;
shot1._x = psx[1] / 10;
shot1._y = (psy[1] / 10) + 120;
shot2._x = psx[2] / 10;
shot2._y = (psy[2] / 10) + 120;
shot3._x = psx[3] / 10;
shot3._y = (psy[3] / 10) + 120;
bshot1._x = bgsx[1] / 10;
bshot1._y = (bgsy[1] / 10) + 120;
bshot2._x = bgsx[2] / 10;
bshot2._y = (bgsy[2] / 10) + 120;
bshot3._x = bgsx[3] / 10;
bshot3._y = (bgsy[3] / 10) + 120;
bshot4._x = bgsx[4] / 10;
bshot4._y = (bgsy[4] / 10) + 120;
bshot5._x = bgsx[5] / 10;
bshot5._y = (bgsy[5] / 10) + 120;
bcir1._x = bgx[1] / 10;
bcir1._y = (bgy[1] / 10) + 120;
bcir2._x = bgx[2] / 10;
bcir2._y = (bgy[2] / 10) + 120;
bcir3._x = bgx[3] / 10;
bcir3._y = (bgy[3] / 10) + 120;
bcir4._x = bgx[4] / 10;
bcir4._y = (bgy[4] / 10) + 120;
bcir5._x = bgx[5] / 10;
bcir5._y = (bgy[5] / 10) + 120;
bcir6._x = bgx[6] / 10;
bcir6._y = (bgy[6] / 10) + 120;
bcir7._x = bgx[7] / 10;
bcir7._y = (bgy[7] / 10) + 120;
bcir8._x = bgx[8] / 10;
bcir8._y = (bgy[8] / 10) + 120;
bcir9._x = bgx[9] / 10;
bcir9._y = (bgy[9] / 10) + 120;
bcir10._x = bgx[10] / 10;
bcir10._y = (bgy[10] / 10) + 120;
bcir11._x = bgx[11] / 10;
bcir11._y = (bgy[11] / 10) + 120;
bcir12._x = bgx[12] / 10;
bcir12._y = (bgy[12] / 10) + 120;
bcir13._x = bgx[13] / 10;
bcir13._y = (bgy[13] / 10) + 120;
if (Key.isDown(39) and (pcd == 0)) {
pcd = 2;
}
if (Key.isDown(39) and ((pcd == 1) or (pcd == 3))) {
pcd = 0;
}
if (Key.isDown(37) and (pcd == 1)) {
pcd = 3;
}
if (Key.isDown(37) and ((pcd == 0) or (pcd == 2))) {
pcd = 1;
}
if (Key.isDown(38) and ((pcd == 0) or (pcd == 2))) {
pcd = 10;
pstep = 7;
}
if (Key.isDown(38) and ((pcd == 1) or (pcd == 3))) {
pcd = 11;
pstep = 7;
}
if (Key.isDown(40) and ((((pcd == 0) or (pcd == 1)) or (pcd == 2)) or (pcd == 3))) {
if (((pcd == 0) or (pcd == 2)) or (pcd == 8)) {
pcd = 6;
pstep = 3;
}
if (((pcd == 1) or (pcd == 3)) or (pcd == 9)) {
pcd = 7;
pstep = 3;
}
}
if (Key.isDown(16) and (bcharge < 100)) {
bcharge = bcharge + 5;
}
if (pcd == 0) {
pc.gotoAndStop(1);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(21);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 0;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
}
if (pcd == 1) {
pc.gotoAndStop(2);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(22);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 1;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
}
if (pcd == 2) {
px = px + 13;
if ((w == 0) or (w == 1)) {
pc.gotoAndStop(3);
}
if ((w == 2) or (w == 3)) {
pc.gotoAndStop(4);
}
if ((w == 4) or (w == 5)) {
pc.gotoAndStop(5);
}
if ((w == 6) or (w == 7)) {
pc.gotoAndStop(6);
}
if (Key.isDown(32)) {
if ((w == 0) or (w == 1)) {
pc.gotoAndStop(11);
}
if ((w == 2) or (w == 3)) {
pc.gotoAndStop(12);
}
if ((w == 4) or (w == 5)) {
pc.gotoAndStop(13);
}
if ((w == 6) or (w == 7)) {
pc.gotoAndStop(14);
}
if ((pst[psn] == 0) and (bstep == 0)) {
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 0;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
}
pcd = 0;
}
if (pcd == 3) {
px = px - 13;
if ((w == 0) or (w == 1)) {
pc.gotoAndStop(7);
}
if ((w == 2) or (w == 3)) {
pc.gotoAndStop(8);
}
if ((w == 4) or (w == 5)) {
pc.gotoAndStop(9);
}
if ((w == 6) or (w == 7)) {
pc.gotoAndStop(10);
}
if (Key.isDown(32)) {
if ((w == 0) or (w == 1)) {
pc.gotoAndStop(15);
}
if ((w == 2) or (w == 3)) {
pc.gotoAndStop(16);
}
if ((w == 4) or (w == 5)) {
pc.gotoAndStop(17);
}
if ((w == 6) or (w == 7)) {
pc.gotoAndStop(18);
}
if ((pst[psn] == 0) and (bstep == 0)) {
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 1;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
}
pcd = 1;
}
if (pcd == 9) {
pstep = pstep - 1;
if (pstep <= 0) {
pcd = 1;
}
}
if (pcd == 6) {
pc.gotoAndStop(19);
px = px + 20;
pstep = pstep - 1;
if (pstep <= 0) {
pcd = 0;
}
}
if (pcd == 7) {
pc.gotoAndStop(20);
px = px - 20;
pstep = pstep - 1;
if (pstep <= 0) {
pcd = 1;
}
}
if (pcd == 12) {
pc.gotoAndStop(23);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(25);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 0;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
py = py + (5 * (7 - pstep));
pstep = pstep - 1;
if (pstep <= 2) {
pstep = 2;
}
if (Key.isDown(39)) {
px = px + 13;
}
if (Key.isDown(37)) {
px = px - 13;
if (bstep == 0) {
pcd = 13;
}
}
}
if (pcd == 13) {
pc.gotoAndStop(24);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(26);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 1;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
py = py + (5 * (7 - pstep));
pstep = pstep - 1;
if (pstep <= 2) {
pstep = 2;
}
if (Key.isDown(39)) {
px = px + 13;
if (bstep == 0) {
pcd = 12;
}
}
if (Key.isDown(37)) {
px = px - 13;
}
}
if (pcd == 10) {
pc.gotoAndStop(23);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(25);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 0;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
py = py - (5 * pstep);
pstep = pstep - 1;
if (Key.isDown(39)) {
px = px + 13;
}
if (Key.isDown(37)) {
px = px - 13;
if (bstep == 0) {
pcd = 11;
}
}
if (Key.isDown(40)) {
pcd = 12;
pstep = pstep + 3;
}
if (pstep <= -1) {
pstep = 7;
pcd = 12;
}
}
if (pcd == 11) {
pc.gotoAndStop(24);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(26);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 1;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
py = py - (5 * pstep);
pstep = pstep - 1;
if (Key.isDown(39)) {
px = px + 13;
if (bstep == 0) {
pcd = 10;
}
}
if (Key.isDown(37)) {
px = px - 13;
}
if (Key.isDown(40)) {
pcd = 13;
pstep = pstep + 3;
}
if (pstep <= -1) {
pstep = 7;
pcd = 13;
}
}
if (pcd == 18) {
pc.gotoAndStop(27);
pstep = pstep - 1;
px = px - 5;
if (pstep <= -1) {
pstep = 2;
pcd = 0;
}
}
if (pcd == 19) {
pc.gotoAndStop(28);
pstep = pstep - 1;
px = px + 5;
if (pstep <= -1) {
pstep = 2;
pcd = 1;
}
}
if (pcd == 20) {
pc.gotoAndStop(69 - pstep);
bcharge = 0;
charge._alpha = 0;
bstep = 20;
pl = 1;
pstep = pstep - 1;
if (pstep < 0) {
lives = lives - 1;
if (lives >= 0) {
pl = 50;
gotoAndPlay (100);
}
if (lives < 0) {
lives = 2;
continues = continues - 1;
gotoAndPlay (5);
}
}
}
if (pl <= 0) {
c = 1;
while (c <= 8) {
bgx[c] = -600;
c++;
}
pc._alpha = 100;
pcd = 20;
pstep = 40;
megad.start();
}
if (bstep > 0) {
bcharge = 0;
charge._alpha = bcharge;
}
if (bstep > 0) {
bstep = bstep - 1;
}
if ((py > 500) and (pcd < 20)) {
megad.start();
pl = 0;
}
w = w - 1;
if (w < 0) {
w = 7;
}
e = pcd;
c = 0;
r = 1;
while (r <= 13) {
if (((((bx[r] - 150) < px) and ((bx[r] + 150) > px)) and ((by[r] - 150) < py)) and ((by[r] + 150) > py)) {
if (((((((px - 30) < (bx[r] + 50)) and ((px + 20) > (bx[r] - 50))) and (py < (by[r] - 50))) and ((py + 60) > (by[r] - 50))) and (pcd != 10)) and (pcd != 11)) {
if ((((pcd == 12) or (pcd == 13)) or (pcd == 16)) or (pcd == 17)) {
if ((pcd == 12) or (pcd == 16)) {
pcd = 0;
}
if ((pcd == 13) or (pcd == 17)) {
pcd = 1;
}
}
c = 1;
py = by[r] - 75;
}
if (((((px + 38) > (bx[r] - 50)) and ((px + 20) < bx[r])) and (py < (by[r] + 50))) and ((py + 20) > (by[r] - 50))) {
px = bx[r] - 85;
}
if (((((px - 35) < (bx[r] + 50)) and ((px - 20) > bx[r])) and (py < (by[r] + 50))) and ((py + 20) > (by[r] - 50))) {
px = bx[r] + 85;
}
if (((((px - 5) < (bx[r] + 50)) and ((px + 5) > (bx[r] - 50))) and ((py - 30) < (by[r] + 50))) and ((py + 10) > (by[r] + 50))) {
if ((((pcd == 10) or (pcd == 11)) or (pcd == 14)) or (pcd == 15)) {
if ((pcd == 10) or (pcd == 14)) {
pcd = 12;
pstep = 5;
}
if ((pcd == 11) or (pcd == 15)) {
pcd = 13;
pstep = 5;
}
}
py = by[r] + 90;
}
}
r++;
}
if (c == 0) {
if ((((pcd == 0) or (pcd == 2)) or (pcd == 6)) or (pcd == 18)) {
pcd = 12;
pstep = 6;
}
if ((((pcd == 1) or (pcd == 3)) or (pcd == 7)) or (pcd == 19)) {
pcd = 13;
pstep = 6;
}
}
r = 1;
while (r <= 3) {
if (pst[r] == 1) {
if (psd[r] == 0) {
psx[r] = psx[r] + 30;
if (r == 1) {
shot1p.gotoAndStop(1);
}
if (r == 2) {
shot2p.gotoAndStop(1);
}
if (r == 3) {
shot3p.gotoAndStop(1);
}
if (psx[r] > (px + 280)) {
pst[r] = 0;
psx[r] = -200;
}
}
if (psd[r] == 1) {
psx[r] = psx[r] - 30;
if (r == 1) {
shot1p.gotoAndStop(2);
}
if (r == 2) {
shot2p.gotoAndStop(2);
}
if (r == 3) {
shot3p.gotoAndStop(2);
}
if (psx[r] < (px - 280)) {
pst[r] = 0;
psx[r] = -200;
}
}
}
if (pst[r] == 2) {
if (psd[r] == 0) {
psx[r] = psx[r] + 35;
if (r == 1) {
shot1p.gotoAndStop(3);
}
if (r == 2) {
shot2p.gotoAndStop(3);
}
if (r == 3) {
shot3p.gotoAndStop(3);
}
if (psx[r] > (px + 280)) {
pst[r] = 0;
psx[r] = -200;
}
}
if (psd[r] == 1) {
psx[r] = psx[r] - 35;
if (r == 1) {
shot1p.gotoAndStop(4);
}
if (r == 2) {
shot2p.gotoAndStop(4);
}
if (r == 3) {
shot3p.gotoAndStop(4);
}
if (psx[r] < (px - 280)) {
pst[r] = 0;
psx[r] = -200;
}
}
}
if (pst[r] == 3) {
if (psd[r] == 0) {
psx[r] = psx[r] + 40;
if (r == 1) {
shot1p.gotoAndStop(5);
}
if (r == 2) {
shot2p.gotoAndStop(5);
}
if (r == 3) {
shot3p.gotoAndStop(5);
}
if (psx[r] > (px + 280)) {
pst[r] = 0;
psx[r] = -200;
}
}
if (psd[r] == 1) {
psx[r] = psx[r] - 40;
if (r == 1) {
shot1p.gotoAndStop(6);
}
if (r == 2) {
shot2p.gotoAndStop(6);
}
if (r == 3) {
shot3p.gotoAndStop(6);
}
if (psx[r] < (px - 280)) {
pst[r] = 0;
psx[r] = -200;
}
}
}
if (pst[r] == 4) {
if (r == 1) {
shot1p.gotoAndStop(10 - psd[r]);
}
if (r == 2) {
shot2p.gotoAndStop(10 - psd[r]);
}
if (r == 3) {
shot3p.gotoAndStop(10 - psd[r]);
}
psd[r] = psd[r] - 1;
if (psd[r] < 0) {
pst[r] = 0;
psx[r] = -200;
}
}
if (pst[r] == 5) {
if (r == 1) {
shot1p.gotoAndStop(14 - psd[r]);
}
if (r == 2) {
shot2p.gotoAndStop(14 - psd[r]);
}
if (r == 3) {
shot3p.gotoAndStop(14 - psd[r]);
}
psd[r] = psd[r] - 1;
if (psd[r] < 0) {
pst[r] = 0;
psx[r] = -200;
}
}
r++;
}
while (c <= 5) {
r = 1;
while (r <= 3) {
if ((pst[r] > 0) and (pst[r] < 4)) {
if (((((bgt[c] == 12) and ((bgx[c] - 25) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 25) > (psx[r] - ((pst[r] * 20) - 20)))) and (bgy[c] < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 50) > (psy[r] - ((pst[r] * 20) - 20)))) {
if ((bgd[c] == 0) or (bgd[c] == 1)) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd2.start();
bgd[c] = 2;
bgs[c] = 3;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
if (((((bgt[c] == 3) and ((bgx[c] - 35) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 35) > (psx[r] - ((pst[r] * 20) - 20)))) and ((bgy[c] - 20) < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 40) > (psy[r] - ((pst[r] * 20) - 20)))) {
if (bgd[c] == 0) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd2.start();
bgd[c] = 1;
bgs[c] = 4;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
}
r++;
}
c++;
}
r = 1;
while (r <= 5) {
if (((((bgt[r] > 0) and ((bgx[r] - 340) < px)) and ((bgx[r] + 340) > px)) and ((bgy[r] - 180) < py)) and ((bgy[r] + 350) > py)) {
c = 0;
e = 1;
while (e <= 13) {
if (((((bx[e] - 150) < bgx[r]) and ((bx[e] + 150) > bgx[r])) and ((by[e] - 150) < bgy[r])) and ((by[e] + 150) > bgy[r])) {
if (((((bgx[r] + 20) >= (bx[e] - 50)) and ((bgx[r] - 20) <= (bx[e] + 50))) and ((bgy[r] + 45) > (by[e] - 60))) and ((bgy[r] - 10) < (by[e] - 40))) {
c = 1;
}
if (((((bgx[r] + 20) > (bx[e] - 50)) and ((bgx[r] + 20) < bx[e])) and (bgy[r] < (by[e] + 50))) and ((bgy[r] + 20) > (by[e] - 50))) {
bgx[r] = bx[e] - 70;
}
if (((((bgx[r] - 20) < (bx[e] + 50)) and ((bgx[r] + 20) > bx[e])) and (bgy[r] < (by[e] + 50))) and ((bgy[r] + 20) > (by[e] - 50))) {
bgx[r] = bx[e] + 70;
}
if (((((bgx[r] - 5) < (bx[e] + 50)) and ((bgx[r] + 5) > (bx[e] - 50))) and ((bgy[r] - 30) < (by[e] + 50))) and (bgy[r] > (by[e] + 50))) {
bgy[r] = by[e] + 70;
}
if (((((bgx[r] - 2) < (bx[e] + 50)) and ((bgx[r] + 2) > (bx[e] - 50))) and ((bgy[r] + 20) < (by[e] - 50))) and ((bgy[r] + 60) > (by[e] - 50))) {
c = 1;
bgy[r] = by[e] - 105;
}
}
e++;
}
if (c == 0) {
bgy[r] = bgy[r] + 10;
}
if (bgt[r] == 3) {
if ((((((((bgx[r] - 20) < (px + 10)) and ((bgx[r] + 20) > (px - 10))) and ((bgy[r] + 60) > (py + 5))) and ((bgy[r] + 40) < (py + 45))) and (pcd < 18)) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 4;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 4;
}
megah.start();
i = 10;
}
if (bgd[r] == 0) {
if ((bgs[r] == 0) or (bgs[r] == 1)) {
f[r] = 1;
}
if ((bgs[r] == 2) or (bgs[r] == 3)) {
f[r] = 2;
}
if ((bgs[r] == 4) or (bgs[r] == 5)) {
f[r] = 3;
}
if ((bgs[r] == 6) or (bgs[r] == 7)) {
f[r] = 4;
}
if ((bgs[r] == 8) or (bgs[r] == 9)) {
f[r] = 5;
}
if ((bgs[r] == 10) or (bgs[r] == 11)) {
f[r] = 6;
}
if (px < bgx[r]) {
bgx[r] = bgx[r] - 5;
}
if (px > bgx[r]) {
bgx[r] = bgx[r] + 5;
}
if ((py - 20) > bgy[r]) {
bgy[r] = bgy[r] - 5;
}
if ((py - 20) < bgy[r]) {
bgy[r] = bgy[r] - 15;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgs[r] = 11;
}
}
if (bgd[r] == 1) {
if (bgs[r] == 4) {
f[r] = 7;
}
if (bgs[r] == 3) {
f[r] = 8;
}
if (bgs[r] == 2) {
f[r] = 9;
}
if (bgs[r] == 1) {
f[r] = 10;
}
bgs[r] = bgs[r] - 1;
bgy[r] = bgy[r] - 10;
if (bgs[r] <= 0) {
bgx[r] = -500;
f[r] = 11;
bgt[r] = 0;
bgs[r] = 0;
}
}
}
if (bgt[r] == 12) {
if (((((((bgx[r] - 20) < (px + 10)) and ((bgx[r] + 20) > (px - 10))) and ((bgy[r] + 40) > py)) and ((bgy[r] - 20) < (py + 50))) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 3;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 3;
}
megah.start();
i = 10;
}
if (bgd[r] == 0) {
if (bgs[r] == 1) {
f[r] = 1;
}
if (bgs[r] == 2) {
f[r] = 2;
}
bgy[r] = bgy[r] - 10;
bgx[r] = bgx[r] + 7;
if ((py - 60) < bgy[r]) {
bgy[r] = bgy[r] - 5;
}
if ((((px - 70) < bgx[r]) and ((px + 70) > bgx[r])) and (py > bgy[r])) {
bgy[r] = bgy[r] + 12;
}
if ((px + 100) < bgx[r]) {
bgd[r] = 1;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgs[r] = 2;
}
}
if (bgd[r] == 1) {
if (bgs[r] == 1) {
f[r] = 3;
}
if (bgs[r] == 2) {
f[r] = 4;
}
bgy[r] = bgy[r] - 10;
bgx[r] = bgx[r] - 7;
if ((py - 60) < bgy[r]) {
bgy[r] = bgy[r] - 5;
}
if ((((px - 70) < bgx[r]) and ((px + 70) > bgx[r])) and (py > bgy[r])) {
bgy[r] = bgy[r] + 12;
}
if ((px - 100) > bgx[r]) {
bgd[r] = 0;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgs[r] = 2;
}
}
if (bgd[r] == 2) {
if (bgs[r] == 4) {
f[r] = 5;
}
if (bgs[r] == 3) {
f[r] = 6;
}
if (bgs[r] == 2) {
f[r] = 7;
}
if (bgs[r] == 1) {
f[r] = 8;
}
bgs[r] = bgs[r] - 1;
bgy[r] = bgy[r] - 10;
if (bgs[r] <= 0) {
bgx[r] = -500;
f[r] = 9;
bgt[r] = 0;
bgs[r] = 0;
}
}
}
}
r++;
}
r = 1;
while (r <= 5) {
if (bgst[r] > 0) {
if (bgst[r] == 1) {
if (r == 1) {
bgs1.gotoAndStop(1);
}
if (r == 2) {
bgs2.gotoAndStop(1);
}
if (r == 3) {
bgs3.gotoAndStop(1);
}
if (r == 4) {
bgs4.gotoAndStop(1);
}
if (r == 5) {
bgs5.gotoAndStop(1);
}
if (bgsd[r] == 0) {
bgsx[r] = bgsx[r] + 20;
if (bgsx[r] > (px + 300)) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgsd[r] == 1) {
bgsx[r] = bgsx[r] - 20;
if (bgsx[r] < (px - 300)) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgsd[r] == 2) {
bgsx[r] = bgsx[r] + 15;
bgsy[r] = bgsy[r] + 15;
if ((bgsx[r] > (px + 300)) or (bgsy[r] > (py + 300))) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgsd[r] == 3) {
bgsx[r] = bgsx[r] - 15;
bgsy[r] = bgsy[r] + 15;
if ((bgsx[r] > (px + 300)) or (bgsy[r] > (py + 300))) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgsd[r] == 4) {
bgsy[r] = bgsy[r] + 20;
if (bgsy[r] > (py + 300)) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (((((((bgsx[r] - 15) < (px + 10)) and ((bgsx[r] + 15) > (px - 10))) and ((bgsy[r] + 15) > (py + 5))) and ((bgsy[r] - 15) < (py + 20))) and (pcd < 18)) and (i < 1)) {
if ((bgsd[r] == 0) or (bgsd[r] == 2)) {
pcd = 19;
}
if ((bgsd[r] == 1) or (bgsd[r] == 3)) {
pcd = 18;
}
pstep = 2;
pl = pl - 3;
megah.start();
i = 10;
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgst[r] == 2) {
if (r == 1) {
bgs1.gotoAndStop(2);
}
if (r == 2) {
bgs2.gotoAndStop(2);
}
if (r == 3) {
bgs3.gotoAndStop(2);
}
if (r == 4) {
bgs4.gotoAndStop(2);
}
if (r == 5) {
bgs5.gotoAndStop(2);
}
if (bgsd[r] == 0) {
bgsx[r] = bgsx[r] + 30;
if (bgsx[r] > (px + 300)) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgsd[r] == 1) {
bgsx[r] = bgsx[r] - 30;
if (bgsx[r] < (px - 300)) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (((((((bgsx[r] - 25) < (px + 10)) and ((bgsx[r] + 25) > (px - 10))) and ((bgsy[r] + 80) > (py + 40))) and ((bgsy[r] + 35) < (py + 60))) and (pcd < 18)) and (i < 1)) {
if (bgsd[r] == 0) {
pcd = 19;
}
if (bgsd[r] == 1) {
pcd = 18;
}
pstep = 2;
pl = pl - 6;
megah.start();
i = 10;
bgst[r] = 0;
bgsx[r] = -200;
}
}
}
r++;
}
bg1.gotoAndStop(f[1]);
bg2.gotoAndStop(f[2]);
bg3.gotoAndStop(f[3]);
bg4.gotoAndStop(f[4]);
bg5.gotoAndStop(f[5]);
bgs1._x = ((bgsx[1] + 275) - px) / 2;
bgs1._y = ((bgsy[1] + 275) - py) / 2;
bgs2._x = ((bgsx[2] + 275) - px) / 2;
bgs2._y = ((bgsy[2] + 275) - py) / 2;
bgs3._x = ((bgsx[3] + 275) - px) / 2;
bgs3._y = ((bgsy[3] + 275) - py) / 2;
bgs4._x = ((bgsx[4] + 275) - px) / 2;
bgs4._y = ((bgsy[4] + 275) - py) / 2;
bgs5._x = ((bgsx[5] + 275) - px) / 2;
bgs5._y = ((bgsy[5] + 275) - py) / 2;
bg1._x = ((bgx[1] + 275) - px) / 2;
bg1._y = ((bgy[1] + 275) - py) / 2;
bg2._x = ((bgx[2] + 275) - px) / 2;
bg2._y = ((bgy[2] + 275) - py) / 2;
bg3._x = ((bgx[3] + 275) - px) / 2;
bg3._y = ((bgy[3] + 275) - py) / 2;
bg4._x = ((bgx[4] + 275) - px) / 2;
bg4._y = ((bgy[4] + 275) - py) / 2;
bg5._x = ((bgx[5] + 275) - px) / 2;
bg5._y = ((bgy[5] + 275) - py) / 2;
r = 1;
while (r <= 3) {
if (((pst[r] > 0) and (pst[r] < 4)) and (psd[r] == 0)) {
if (r == 1) {
shot1p._x = ((297 + psx[1]) - px) / 2;
shot1p._y = ((270 + psy[1]) - py) / 2;
}
if (r == 2) {
shot2p._x = ((297 + psx[2]) - px) / 2;
shot2p._y = ((270 + psy[2]) - py) / 2;
}
if (r == 3) {
shot3p._x = ((297 + psx[3]) - px) / 2;
shot3p._y = ((270 + psy[3]) - py) / 2;
}
}
if (((pst[r] > 0) and (pst[r] < 4)) and (psd[r] == 1)) {
if (r == 1) {
shot1p._x = ((247 + psx[1]) - px) / 2;
shot1p._y = ((270 + psy[1]) - py) / 2;
}
if (r == 2) {
shot2p._x = ((247 + psx[2]) - px) / 2;
shot2p._y = ((270 + psy[2]) - py) / 2;
}
if (r == 3) {
shot3p._x = ((247 + psx[3]) - px) / 2;
shot3p._y = ((270 + psy[3]) - py) / 2;
}
}
if ((pst[r] == 4) or (pst[r] == 5)) {
if (r == 1) {
shot1p._x = ((272 + psx[1]) - px) / 2;
shot1p._y = ((270 + psy[1]) - py) / 2;
}
if (r == 2) {
shot2p._x = ((272 + psx[2]) - px) / 2;
shot2p._y = ((270 + psy[2]) - py) / 2;
}
if (r == 3) {
shot3p._x = ((272 + psx[3]) - px) / 2;
shot3p._y = ((270 + psy[3]) - py) / 2;
}
}
if (pst[r] == 0) {
if (r == 1) {
shot1p._x = -200;
shot1p._y = (270 + psy[1]) - py;
}
if (r == 2) {
shot2p._x = -200;
shot2p._y = (270 + psy[2]) - py;
}
if (r == 3) {
shot3p._x = -200;
shot3p._y = (270 + psy[3]) - py;
}
}
r++;
}
if (i > 0) {
i = i - 1;
pc._alpha = 50;
}
if (i <= 0) {
i = i - 1;
pc._alpha = 100;
}
if (bcharge > 0) {
charge._alpha = bcharge;
}
lbar._height = 2 * pl;
lbar._y = 120 - (2 * pl);
stage._x = (275 - px) / 2;
stage._y = (-225 - py) / 2;
exit._x = ((ex + 275) - px) / 2;
exit._y = ((ey + 275) - py) / 2;
stage2._x = stage2._x - 20;
if (stage2._x < -60) {
stage2._x = 340;
stage2._y = random(180) + 20;
}
Frame 113
gotoAndPlay (112);
if ((((px + 10) > (ex - 20)) and ((px - 10) < (ex + 20))) and (((py + 30) > (ey - 20)) and (py < (ey + 50)))) {
gotoAndPlay (114);
}
Frame 114
lbar._height = 2 * pl;
lbar._y = 120 - (2 * pl);
stage._x = (275 - px) / 2;
stage._y = (-225 - py) / 2;
exit._x = ((ex + 275) - px) / 2;
exit._y = ((ey + 275) - py) / 2;
stage2._x = stage2._x - 20;
if (stage2._x < -60) {
stage2._x = 340;
stage2._y = random(180) + 20;
}
Frame 117
psn = 1;
bstep = 0;
pcd = 0;
bcharge = 0;
r = 1;
while (r <= 5) {
psx[r] = -200;
psy[r] = 0;
pst[r] = 0;
psd[r] = 0;
r++;
}
i = 0;
pl = pl + 5;
if (pl > 50) {
pl = 50;
}
px = 50;
py = 50;
r = 0;
while (r <= 31) {
bx[r] = -50;
by[r] = -50;
r++;
}
bx[1] = 50;
by[1] = 150;
bx[2] = 250;
by[2] = 100;
bx[3] = 550;
by[3] = 150;
bx[4] = 750;
by[4] = 250;
bx[5] = 850;
by[5] = 250;
bx[6] = 950;
by[6] = 250;
bx[7] = 1200;
by[7] = 150;
bx[8] = 1250;
by[8] = 200;
bx[9] = 1550;
by[9] = 200;
bx[10] = 1700;
by[10] = 100;
bx[11] = 1750;
by[11] = 50;
bx[12] = 1550;
by[12] = -50;
bx[13] = 1450;
by[13] = -150;
bx[14] = 1350;
by[14] = -175;
bx[15] = 1350;
by[15] = -275;
bx[16] = 1100;
by[16] = -350;
bx[17] = 950;
by[17] = -450;
bx[18] = 750;
by[18] = -450;
bx[19] = 450;
by[19] = -450;
bsn = 1;
r = 1;
while (r <= 8) {
bgx[r] = -200;
bgy[r] = -200;
bgt[r] = 0;
bgd[r] = -1;
bgs[r] = 0;
r++;
}
r = 1;
while (r <= 5) {
bgsx[r] = -200;
bgsy[r] = 0;
bgst[r] = 0;
bgsd[r] = 0;
r++;
}
r = 1;
while (r <= 8) {
f[r] = 20;
r++;
}
bgt[1] = 3;
bgd[1] = 0;
bgs[1] = 0;
bgl[1] = 3;
bgx[1] = 350;
bgy[1] = -80;
bgt[2] = 3;
bgd[2] = 0;
bgs[2] = 0;
bgl[2] = 3;
bgx[2] = 650;
bgy[2] = -100;
bgt[3] = 7;
bgd[3] = 0;
bgs[3] = 0;
bgl[3] = 2;
bgx[3] = 950;
bgy[3] = -50;
bgt[4] = 5;
bgd[4] = 0;
bgs[4] = 0;
bgl[4] = 6;
bgx[4] = 1550;
bgy[4] = 100;
bgt[5] = 3;
bgd[5] = 0;
bgs[5] = 0;
bgl[5] = 3;
bgx[5] = 1650;
bgy[5] = -200;
bgt[6] = 7;
bgd[6] = 0;
bgs[6] = 0;
bgl[6] = 2;
bgx[6] = 850;
bgy[6] = -600;
ex = 450;
ey = -550;
Frame 118
b1._x = bx[1] / 10;
b1._y = (by[1] / 10) + 120;
b2._x = bx[2] / 10;
b2._y = (by[2] / 10) + 120;
b3._x = bx[3] / 10;
b3._y = (by[3] / 10) + 120;
b4._x = bx[4] / 10;
b4._y = (by[4] / 10) + 120;
b5._x = bx[5] / 10;
b5._y = (by[5] / 10) + 120;
b6._x = bx[6] / 10;
b6._y = (by[6] / 10) + 120;
b7._x = bx[7] / 10;
b7._y = (by[7] / 10) + 120;
b8._x = bx[8] / 10;
b8._y = (by[8] / 10) + 120;
b9._x = bx[9] / 10;
b9._y = (by[9] / 10) + 120;
b10._x = bx[10] / 10;
b10._y = (by[10] / 10) + 120;
b11._x = bx[11] / 10;
b11._y = (by[11] / 10) + 120;
b12._x = bx[12] / 10;
b12._y = (by[12] / 10) + 120;
b13._x = bx[13] / 10;
b13._y = (by[13] / 10) + 120;
b14._x = bx[14] / 10;
b14._y = (by[14] / 10) + 120;
b15._x = bx[15] / 10;
b15._y = (by[15] / 10) + 120;
b16._x = bx[16] / 10;
b16._y = (by[16] / 10) + 120;
b17._x = bx[17] / 10;
b17._y = (by[17] / 10) + 120;
b18._x = bx[18] / 10;
b18._y = (by[18] / 10) + 120;
b19._x = bx[19] / 10;
b19._y = (by[19] / 10) + 120;
b20._x = bx[20] / 10;
b20._y = (by[20] / 10) + 120;
b21._x = bx[21] / 10;
b21._y = (by[21] / 10) + 120;
b22._x = bx[22] / 10;
b22._y = (by[22] / 10) + 120;
b23._x = bx[23] / 10;
b23._y = (by[23] / 10) + 120;
b24._x = bx[24] / 10;
b24._y = (by[24] / 10) + 120;
b25._x = bx[25] / 10;
b25._y = (by[25] / 10) + 120;
b26._x = bx[26] / 10;
b26._y = (by[26] / 10) + 120;
b27._x = bx[27] / 10;
b27._y = (by[27] / 10) + 120;
b28._x = bx[28] / 10;
b28._y = (by[28] / 10) + 120;
cir._x = px / 10;
cir._y = (py / 10) + 120;
shot1._x = psx[1] / 10;
shot1._y = (psy[1] / 10) + 120;
shot2._x = psx[2] / 10;
shot2._y = (psy[2] / 10) + 120;
shot3._x = psx[3] / 10;
shot3._y = (psy[3] / 10) + 120;
bshot1._x = bgsx[1] / 10;
bshot1._y = (bgsy[1] / 10) + 120;
bshot2._x = bgsx[2] / 10;
bshot2._y = (bgsy[2] / 10) + 120;
bshot3._x = bgsx[3] / 10;
bshot3._y = (bgsy[3] / 10) + 120;
bshot4._x = bgsx[4] / 10;
bshot4._y = (bgsy[4] / 10) + 120;
bshot5._x = bgsx[5] / 10;
bshot5._y = (bgsy[5] / 10) + 120;
bcir1._x = bgx[1] / 10;
bcir1._y = (bgy[1] / 10) + 120;
bcir2._x = bgx[2] / 10;
bcir2._y = (bgy[2] / 10) + 120;
bcir3._x = bgx[3] / 10;
bcir3._y = (bgy[3] / 10) + 120;
bcir4._x = bgx[4] / 10;
bcir4._y = (bgy[4] / 10) + 120;
bcir5._x = bgx[5] / 10;
bcir5._y = (bgy[5] / 10) + 120;
bcir6._x = bgx[6] / 10;
bcir6._y = (bgy[6] / 10) + 120;
bcir7._x = bgx[7] / 10;
bcir7._y = (bgy[7] / 10) + 120;
bcir8._x = bgx[8] / 10;
bcir8._y = (bgy[8] / 10) + 120;
bcir9._x = bgx[9] / 10;
bcir9._y = (bgy[9] / 10) + 120;
bcir10._x = bgx[10] / 10;
bcir10._y = (bgy[10] / 10) + 120;
bcir11._x = bgx[11] / 10;
bcir11._y = (bgy[11] / 10) + 120;
bcir12._x = bgx[12] / 10;
bcir12._y = (bgy[12] / 10) + 120;
bcir13._x = bgx[13] / 10;
bcir13._y = (bgy[13] / 10) + 120;
if (Key.isDown(39) and (pcd == 0)) {
pcd = 2;
}
if (Key.isDown(39) and ((pcd == 1) or (pcd == 3))) {
pcd = 0;
}
if (Key.isDown(37) and (pcd == 1)) {
pcd = 3;
}
if (Key.isDown(37) and ((pcd == 0) or (pcd == 2))) {
pcd = 1;
}
if (Key.isDown(38) and ((pcd == 0) or (pcd == 2))) {
pcd = 10;
pstep = 7;
}
if (Key.isDown(38) and ((pcd == 1) or (pcd == 3))) {
pcd = 11;
pstep = 7;
}
if (Key.isDown(40) and ((((pcd == 0) or (pcd == 1)) or (pcd == 2)) or (pcd == 3))) {
if (((pcd == 0) or (pcd == 2)) or (pcd == 8)) {
pcd = 6;
pstep = 3;
}
if (((pcd == 1) or (pcd == 3)) or (pcd == 9)) {
pcd = 7;
pstep = 3;
}
}
if (Key.isDown(16) and (bcharge < 100)) {
bcharge = bcharge + 5;
}
if (pcd == 0) {
pc.gotoAndStop(1);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(21);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 0;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
}
if (pcd == 1) {
pc.gotoAndStop(2);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(22);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 1;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
}
if (pcd == 2) {
px = px + 13;
if ((w == 0) or (w == 1)) {
pc.gotoAndStop(3);
}
if ((w == 2) or (w == 3)) {
pc.gotoAndStop(4);
}
if ((w == 4) or (w == 5)) {
pc.gotoAndStop(5);
}
if ((w == 6) or (w == 7)) {
pc.gotoAndStop(6);
}
if (Key.isDown(32)) {
if ((w == 0) or (w == 1)) {
pc.gotoAndStop(11);
}
if ((w == 2) or (w == 3)) {
pc.gotoAndStop(12);
}
if ((w == 4) or (w == 5)) {
pc.gotoAndStop(13);
}
if ((w == 6) or (w == 7)) {
pc.gotoAndStop(14);
}
if ((pst[psn] == 0) and (bstep == 0)) {
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 0;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
}
pcd = 0;
}
if (pcd == 3) {
px = px - 13;
if ((w == 0) or (w == 1)) {
pc.gotoAndStop(7);
}
if ((w == 2) or (w == 3)) {
pc.gotoAndStop(8);
}
if ((w == 4) or (w == 5)) {
pc.gotoAndStop(9);
}
if ((w == 6) or (w == 7)) {
pc.gotoAndStop(10);
}
if (Key.isDown(32)) {
if ((w == 0) or (w == 1)) {
pc.gotoAndStop(15);
}
if ((w == 2) or (w == 3)) {
pc.gotoAndStop(16);
}
if ((w == 4) or (w == 5)) {
pc.gotoAndStop(17);
}
if ((w == 6) or (w == 7)) {
pc.gotoAndStop(18);
}
if ((pst[psn] == 0) and (bstep == 0)) {
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 1;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
}
pcd = 1;
}
if (pcd == 9) {
pstep = pstep - 1;
if (pstep <= 0) {
pcd = 1;
}
}
if (pcd == 6) {
pc.gotoAndStop(19);
px = px + 20;
pstep = pstep - 1;
if (pstep <= 0) {
pcd = 0;
}
}
if (pcd == 7) {
pc.gotoAndStop(20);
px = px - 20;
pstep = pstep - 1;
if (pstep <= 0) {
pcd = 1;
}
}
if (pcd == 12) {
pc.gotoAndStop(23);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(25);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 0;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
py = py + (5 * (7 - pstep));
pstep = pstep - 1;
if (pstep <= 2) {
pstep = 2;
}
if (Key.isDown(39)) {
px = px + 13;
}
if (Key.isDown(37)) {
px = px - 13;
if (bstep == 0) {
pcd = 13;
}
}
}
if (pcd == 13) {
pc.gotoAndStop(24);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(26);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 1;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
py = py + (5 * (7 - pstep));
pstep = pstep - 1;
if (pstep <= 2) {
pstep = 2;
}
if (Key.isDown(39)) {
px = px + 13;
if (bstep == 0) {
pcd = 12;
}
}
if (Key.isDown(37)) {
px = px - 13;
}
}
if (pcd == 10) {
pc.gotoAndStop(23);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(25);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 0;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
py = py - (5 * pstep);
pstep = pstep - 1;
if (Key.isDown(39)) {
px = px + 13;
}
if (Key.isDown(37)) {
px = px - 13;
if (bstep == 0) {
pcd = 11;
}
}
if (Key.isDown(40)) {
pcd = 12;
pstep = pstep + 3;
}
if (pstep <= -1) {
pstep = 7;
pcd = 12;
}
}
if (pcd == 11) {
pc.gotoAndStop(24);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(26);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 1;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
py = py - (5 * pstep);
pstep = pstep - 1;
if (Key.isDown(39)) {
px = px + 13;
if (bstep == 0) {
pcd = 10;
}
}
if (Key.isDown(37)) {
px = px - 13;
}
if (Key.isDown(40)) {
pcd = 13;
pstep = pstep + 3;
}
if (pstep <= -1) {
pstep = 7;
pcd = 13;
}
}
if (pcd == 18) {
pc.gotoAndStop(27);
pstep = pstep - 1;
px = px - 5;
if (pstep <= -1) {
pstep = 2;
pcd = 0;
}
}
if (pcd == 19) {
pc.gotoAndStop(28);
pstep = pstep - 1;
px = px + 5;
if (pstep <= -1) {
pstep = 2;
pcd = 1;
}
}
if (pcd == 20) {
pc.gotoAndStop(69 - pstep);
bcharge = 0;
charge._alpha = 0;
bstep = 20;
pl = 1;
pstep = pstep - 1;
if (pstep < 0) {
lives = lives - 1;
if (lives >= 0) {
pl = 50;
gotoAndPlay (100);
}
if (lives < 0) {
lives = 2;
continues = continues - 1;
gotoAndPlay (5);
}
}
}
if (pl <= 0) {
c = 1;
while (c <= 8) {
bgx[c] = -600;
c++;
}
pc._alpha = 100;
pcd = 20;
pstep = 40;
megad.start();
}
if (bstep > 0) {
bcharge = 0;
charge._alpha = bcharge;
}
if (bstep > 0) {
bstep = bstep - 1;
}
if ((py > 500) and (pcd < 20)) {
megad.start();
pl = 0;
}
w = w - 1;
if (w < 0) {
w = 7;
}
e = pcd;
c = 0;
r = 1;
while (r <= 19) {
if (((((bx[r] - 150) < px) and ((bx[r] + 150) > px)) and ((by[r] - 150) < py)) and ((by[r] + 150) > py)) {
if (((((((px - 30) < (bx[r] + 50)) and ((px + 20) > (bx[r] - 50))) and (py < (by[r] - 50))) and ((py + 60) > (by[r] - 50))) and (pcd != 10)) and (pcd != 11)) {
if ((((pcd == 12) or (pcd == 13)) or (pcd == 16)) or (pcd == 17)) {
if ((pcd == 12) or (pcd == 16)) {
pcd = 0;
}
if ((pcd == 13) or (pcd == 17)) {
pcd = 1;
}
}
c = 1;
py = by[r] - 75;
}
if (((((px + 38) > (bx[r] - 50)) and ((px + 20) < bx[r])) and (py < (by[r] + 50))) and ((py + 20) > (by[r] - 50))) {
px = bx[r] - 85;
}
if (((((px - 35) < (bx[r] + 50)) and ((px - 20) > bx[r])) and (py < (by[r] + 50))) and ((py + 20) > (by[r] - 50))) {
px = bx[r] + 85;
}
if (((((px - 5) < (bx[r] + 50)) and ((px + 5) > (bx[r] - 50))) and ((py - 30) < (by[r] + 50))) and ((py + 10) > (by[r] + 50))) {
if ((((pcd == 10) or (pcd == 11)) or (pcd == 14)) or (pcd == 15)) {
if ((pcd == 10) or (pcd == 14)) {
pcd = 12;
pstep = 5;
}
if ((pcd == 11) or (pcd == 15)) {
pcd = 13;
pstep = 5;
}
}
py = by[r] + 90;
}
}
r++;
}
if (c == 0) {
if ((((pcd == 0) or (pcd == 2)) or (pcd == 6)) or (pcd == 18)) {
pcd = 12;
pstep = 6;
}
if ((((pcd == 1) or (pcd == 3)) or (pcd == 7)) or (pcd == 19)) {
pcd = 13;
pstep = 6;
}
}
r = 1;
while (r <= 3) {
if (pst[r] == 1) {
if (psd[r] == 0) {
psx[r] = psx[r] + 30;
if (r == 1) {
shot1p.gotoAndStop(1);
}
if (r == 2) {
shot2p.gotoAndStop(1);
}
if (r == 3) {
shot3p.gotoAndStop(1);
}
if (psx[r] > (px + 280)) {
pst[r] = 0;
psx[r] = -200;
}
}
if (psd[r] == 1) {
psx[r] = psx[r] - 30;
if (r == 1) {
shot1p.gotoAndStop(2);
}
if (r == 2) {
shot2p.gotoAndStop(2);
}
if (r == 3) {
shot3p.gotoAndStop(2);
}
if (psx[r] < (px - 280)) {
pst[r] = 0;
psx[r] = -200;
}
}
}
if (pst[r] == 2) {
if (psd[r] == 0) {
psx[r] = psx[r] + 35;
if (r == 1) {
shot1p.gotoAndStop(3);
}
if (r == 2) {
shot2p.gotoAndStop(3);
}
if (r == 3) {
shot3p.gotoAndStop(3);
}
if (psx[r] > (px + 280)) {
pst[r] = 0;
psx[r] = -200;
}
}
if (psd[r] == 1) {
psx[r] = psx[r] - 35;
if (r == 1) {
shot1p.gotoAndStop(4);
}
if (r == 2) {
shot2p.gotoAndStop(4);
}
if (r == 3) {
shot3p.gotoAndStop(4);
}
if (psx[r] < (px - 280)) {
pst[r] = 0;
psx[r] = -200;
}
}
}
if (pst[r] == 3) {
if (psd[r] == 0) {
psx[r] = psx[r] + 40;
if (r == 1) {
shot1p.gotoAndStop(5);
}
if (r == 2) {
shot2p.gotoAndStop(5);
}
if (r == 3) {
shot3p.gotoAndStop(5);
}
if (psx[r] > (px + 280)) {
pst[r] = 0;
psx[r] = -200;
}
}
if (psd[r] == 1) {
psx[r] = psx[r] - 40;
if (r == 1) {
shot1p.gotoAndStop(6);
}
if (r == 2) {
shot2p.gotoAndStop(6);
}
if (r == 3) {
shot3p.gotoAndStop(6);
}
if (psx[r] < (px - 280)) {
pst[r] = 0;
psx[r] = -200;
}
}
}
if (pst[r] == 4) {
if (r == 1) {
shot1p.gotoAndStop(10 - psd[r]);
}
if (r == 2) {
shot2p.gotoAndStop(10 - psd[r]);
}
if (r == 3) {
shot3p.gotoAndStop(10 - psd[r]);
}
psd[r] = psd[r] - 1;
if (psd[r] < 0) {
pst[r] = 0;
psx[r] = -200;
}
}
if (pst[r] == 5) {
if (r == 1) {
shot1p.gotoAndStop(14 - psd[r]);
}
if (r == 2) {
shot2p.gotoAndStop(14 - psd[r]);
}
if (r == 3) {
shot3p.gotoAndStop(14 - psd[r]);
}
psd[r] = psd[r] - 1;
if (psd[r] < 0) {
pst[r] = 0;
psx[r] = -200;
}
}
r++;
}
while (c <= 6) {
r = 1;
while (r <= 3) {
if ((pst[r] > 0) and (pst[r] < 4)) {
if (((((bgt[c] == 5) and ((bgx[c] - 40) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 40) > (psx[r] - ((pst[r] * 20) - 20)))) and ((bgy[c] - 20) < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 50) > (psy[r] - ((pst[r] * 20) - 20)))) {
if ((((bgd[c] == 0) or (bgd[c] == 1)) or (bgd[c] == 2)) or (bgd[c] == 3)) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd1.start();
bgd[c] = 4;
bgs[c] = 5;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
if (((((bgt[c] == 7) and ((bgx[c] - 35) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 35) > (psx[r] - ((pst[r] * 20) - 20)))) and ((bgy[c] - 50) < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 20) > (psy[r] - ((pst[r] * 20) - 20)))) {
if (bgd[c] == 0) {
deflect.start();
pst[r] = 5;
psd[r] = 2;
}
if ((bgd[c] == 2) or (bgd[c] == 1)) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd2.start();
bgd[c] = 3;
bgs[c] = 3;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
if (((((bgt[c] == 3) and ((bgx[c] - 35) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 35) > (psx[r] - ((pst[r] * 20) - 20)))) and ((bgy[c] - 20) < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 40) > (psy[r] - ((pst[r] * 20) - 20)))) {
if (bgd[c] == 0) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd2.start();
bgd[c] = 1;
bgs[c] = 4;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
}
r++;
}
c++;
}
r = 1;
while (r <= 6) {
if (((((bgt[r] > 0) and ((bgx[r] - 340) < px)) and ((bgx[r] + 340) > px)) and ((bgy[r] - 180) < py)) and ((bgy[r] + 350) > py)) {
c = 0;
e = 1;
while (e <= 19) {
if (((((bx[e] - 150) < bgx[r]) and ((bx[e] + 150) > bgx[r])) and ((by[e] - 150) < bgy[r])) and ((by[e] + 150) > bgy[r])) {
if (((((bgx[r] + 20) >= (bx[e] - 50)) and ((bgx[r] - 20) <= (bx[e] + 50))) and ((bgy[r] + 45) > (by[e] - 60))) and ((bgy[r] - 10) < (by[e] - 40))) {
c = 1;
}
if (((((bgx[r] + 20) > (bx[e] - 50)) and ((bgx[r] + 20) < bx[e])) and (bgy[r] < (by[e] + 50))) and ((bgy[r] + 20) > (by[e] - 50))) {
bgx[r] = bx[e] - 70;
}
if (((((bgx[r] - 20) < (bx[e] + 50)) and ((bgx[r] + 20) > bx[e])) and (bgy[r] < (by[e] + 50))) and ((bgy[r] + 20) > (by[e] - 50))) {
bgx[r] = bx[e] + 70;
}
if (((((bgx[r] - 5) < (bx[e] + 50)) and ((bgx[r] + 5) > (bx[e] - 50))) and ((bgy[r] - 30) < (by[e] + 50))) and (bgy[r] > (by[e] + 50))) {
bgy[r] = by[e] + 70;
}
if (((((bgx[r] - 2) < (bx[e] + 50)) and ((bgx[r] + 2) > (bx[e] - 50))) and ((bgy[r] + 20) < (by[e] - 50))) and ((bgy[r] + 60) > (by[e] - 50))) {
c = 1;
bgy[r] = by[e] - 105;
}
}
e++;
}
if (bgt[r] == 3) {
if ((((((((bgx[r] - 20) < (px + 10)) and ((bgx[r] + 20) > (px - 10))) and ((bgy[r] + 60) > (py + 5))) and ((bgy[r] + 40) < (py + 45))) and (pcd < 18)) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 4;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 4;
}
megah.start();
i = 10;
}
if (bgd[r] == 0) {
if ((bgs[r] == 0) or (bgs[r] == 1)) {
f[r] = 1;
}
if ((bgs[r] == 2) or (bgs[r] == 3)) {
f[r] = 2;
}
if ((bgs[r] == 4) or (bgs[r] == 5)) {
f[r] = 3;
}
if ((bgs[r] == 6) or (bgs[r] == 7)) {
f[r] = 4;
}
if ((bgs[r] == 8) or (bgs[r] == 9)) {
f[r] = 5;
}
if ((bgs[r] == 10) or (bgs[r] == 11)) {
f[r] = 6;
}
if (px < bgx[r]) {
bgx[r] = bgx[r] - 5;
}
if (px > bgx[r]) {
bgx[r] = bgx[r] + 5;
}
if ((py - 20) > bgy[r]) {
bgy[r] = bgy[r] - 5;
}
if ((py - 20) < bgy[r]) {
bgy[r] = bgy[r] - 15;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgs[r] = 11;
}
}
if (bgd[r] == 1) {
if (bgs[r] == 4) {
f[r] = 7;
}
if (bgs[r] == 3) {
f[r] = 8;
}
if (bgs[r] == 2) {
f[r] = 9;
}
if (bgs[r] == 1) {
f[r] = 10;
}
bgs[r] = bgs[r] - 1;
bgy[r] = bgy[r] - 10;
if (bgs[r] <= 0) {
bgx[r] = -500;
f[r] = 11;
bgt[r] = 0;
bgs[r] = 0;
}
}
}
if (bgt[r] == 5) {
if (((((((bgx[r] - 20) < (px + 10)) and ((bgx[r] + 20) > (px - 10))) and ((bgy[r] + 80) > (py + 10))) and ((bgy[r] + 30) < (py + 50))) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 3;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 3;
}
megah.start();
i = 10;
}
if (bgd[r] == 0) {
f[r] = 1;
if (px < bgx[r]) {
bgd[r] = 2;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
cannons.start();
bgd[r] = 1;
bgs[r] = 8;
bgst[bsn] = 2;
bgsx[bsn] = bgx[r] - 20;
bgsy[bsn] = bgy[r] + 20;
bgsd[bsn] = 0;
bsn = bsn + 1;
if (bsn > 5) {
bsn = 1;
}
}
}
if (bgd[r] == 2) {
f[r] = 3;
if (px > bgx[r]) {
bgd[r] = 0;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
cannons.start();
bgd[r] = 3;
bgs[r] = 7;
bgst[bsn] = 2;
bgsx[bsn] = bgx[r] + 20;
bgsy[bsn] = bgy[r] + 20;
bgsd[bsn] = 1;
bsn = bsn + 1;
if (bsn > 5) {
bsn = 1;
}
}
}
if (bgd[r] == 1) {
f[r] = 2;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 0;
bgs[r] = 10 + random(15);
}
}
if (bgd[r] == 3) {
f[r] = 4;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 2;
bgs[r] = 10 + random(15);
}
}
if (bgd[r] == 4) {
if (bgs[r] == 5) {
f[r] = 5;
}
if (bgs[r] == 4) {
f[r] = 6;
}
if (bgs[r] == 3) {
f[r] = 7;
}
if (bgs[r] == 2) {
f[r] = 8;
}
if (bgs[r] == 1) {
f[r] = 9;
}
bgs[r] = bgs[r] - 1;
bgy[r] = bgy[r] - 10;
if (bgs[r] <= 0) {
f[r] = 10;
bgt[r] = 0;
bgx[r] = -500;
bgs[r] = 0;
}
}
}
if (bgt[r] == 7) {
if (((((((bgx[r] - 20) < (px + 10)) and ((bgx[r] + 20) > (px - 10))) and ((bgy[r] + 20) > (py + 10))) and ((bgy[r] + 20) < (py + 50))) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 3;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 3;
}
megah.start();
i = 10;
}
if (bgd[r] == 0) {
f[r] = 1;
bgy[r] = bgy[r] - 10;
if ((px + 80) < bgx[r]) {
bgx[r] = bgx[r] - 5;
}
if ((px - 80) > bgx[r]) {
bgx[r] = bgx[r] + 5;
}
if ((py - 70) < bgy[r]) {
bgy[r] = bgy[r] - 5;
}
if ((py - 70) > bgy[r]) {
bgy[r] = bgy[r] + 5;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
joes.start();
if (px > bgx[r]) {
bgd[r] = 1;
}
if (px < bgx[r]) {
bgd[r] = 2;
}
if (px < bgx[r]) {
bgsd[bsn] = 3;
if ((py - 50) < bgy[r]) {
bgsd[bsn] = 1;
}
}
if (px > bgx[r]) {
bgsd[bsn] = 2;
if ((py - 50) < bgy[r]) {
bgsd[bsn] = 0;
}
}
bgs[r] = 12;
bgst[bsn] = 1;
bgsx[bsn] = bgx[r];
bgsy[bsn] = bgy[r];
bsn = bsn + 1;
if (bsn > 5) {
bsn = 1;
}
}
}
if (bgd[r] == 1) {
f[r] = 2;
bgy[r] = bgy[r] - 10;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 0;
bgs[r] = 10 + random(25);
}
}
if (bgd[r] == 2) {
f[r] = 3;
bgy[r] = bgy[r] - 10;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 0;
bgs[r] = 10 + random(25);
}
}
if (bgd[r] == 3) {
if (bgs[r] == 3) {
f[r] = 4;
}
if (bgs[r] == 2) {
f[r] = 5;
}
if (bgs[r] == 1) {
f[r] = 6;
}
bgs[r] = bgs[r] - 1;
bgy[r] = bgy[r] - 10;
if (bgs[r] <= 0) {
f[r] = 7;
bgt[r] = 0;
bgx[r] = -500;
bgs[r] = 0;
}
}
}
if (c == 0) {
bgy[r] = bgy[r] + 10;
}
}
r++;
}
r = 1;
while (r <= 5) {
if (bgst[r] > 0) {
if (bgst[r] == 1) {
if (r == 1) {
bgs1.gotoAndStop(1);
}
if (r == 2) {
bgs2.gotoAndStop(1);
}
if (r == 3) {
bgs3.gotoAndStop(1);
}
if (r == 4) {
bgs4.gotoAndStop(1);
}
if (r == 5) {
bgs5.gotoAndStop(1);
}
if (bgsd[r] == 0) {
bgsx[r] = bgsx[r] + 20;
if (bgsx[r] > (px + 300)) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgsd[r] == 1) {
bgsx[r] = bgsx[r] - 20;
if (bgsx[r] < (px - 300)) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgsd[r] == 2) {
bgsx[r] = bgsx[r] + 15;
bgsy[r] = bgsy[r] + 15;
if ((bgsx[r] > (px + 300)) or (bgsy[r] > (py + 300))) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgsd[r] == 3) {
bgsx[r] = bgsx[r] - 15;
bgsy[r] = bgsy[r] + 15;
if ((bgsx[r] > (px + 300)) or (bgsy[r] > (py + 300))) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgsd[r] == 4) {
bgsy[r] = bgsy[r] + 20;
if (bgsy[r] > (py + 300)) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (((((((bgsx[r] - 15) < (px + 10)) and ((bgsx[r] + 15) > (px - 10))) and ((bgsy[r] + 15) > (py + 5))) and ((bgsy[r] - 15) < (py + 20))) and (pcd < 18)) and (i < 1)) {
if ((bgsd[r] == 0) or (bgsd[r] == 2)) {
pcd = 19;
}
if ((bgsd[r] == 1) or (bgsd[r] == 3)) {
pcd = 18;
}
pstep = 2;
pl = pl - 3;
megah.start();
i = 10;
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgst[r] == 2) {
if (r == 1) {
bgs1.gotoAndStop(2);
}
if (r == 2) {
bgs2.gotoAndStop(2);
}
if (r == 3) {
bgs3.gotoAndStop(2);
}
if (r == 4) {
bgs4.gotoAndStop(2);
}
if (r == 5) {
bgs5.gotoAndStop(2);
}
if (bgsd[r] == 0) {
bgsx[r] = bgsx[r] + 30;
if (bgsx[r] > (px + 300)) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgsd[r] == 1) {
bgsx[r] = bgsx[r] - 30;
if (bgsx[r] < (px - 300)) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (((((((bgsx[r] - 25) < (px + 10)) and ((bgsx[r] + 25) > (px - 10))) and ((bgsy[r] + 80) > (py + 40))) and ((bgsy[r] + 35) < (py + 60))) and (pcd < 18)) and (i < 1)) {
if (bgsd[r] == 0) {
pcd = 19;
}
if (bgsd[r] == 1) {
pcd = 18;
}
pstep = 2;
pl = pl - 6;
megah.start();
i = 10;
bgst[r] = 0;
bgsx[r] = -200;
}
}
}
r++;
}
bg1.gotoAndStop(f[1]);
bg2.gotoAndStop(f[2]);
bg3.gotoAndStop(f[3]);
bg4.gotoAndStop(f[4]);
bg5.gotoAndStop(f[5]);
bg6.gotoAndStop(f[6]);
bgs1._x = ((bgsx[1] + 275) - px) / 2;
bgs1._y = ((bgsy[1] + 275) - py) / 2;
bgs2._x = ((bgsx[2] + 275) - px) / 2;
bgs2._y = ((bgsy[2] + 275) - py) / 2;
bgs3._x = ((bgsx[3] + 275) - px) / 2;
bgs3._y = ((bgsy[3] + 275) - py) / 2;
bgs4._x = ((bgsx[4] + 275) - px) / 2;
bgs4._y = ((bgsy[4] + 275) - py) / 2;
bgs5._x = ((bgsx[5] + 275) - px) / 2;
bgs5._y = ((bgsy[5] + 275) - py) / 2;
bg1._x = ((bgx[1] + 275) - px) / 2;
bg1._y = ((bgy[1] + 275) - py) / 2;
bg2._x = ((bgx[2] + 275) - px) / 2;
bg2._y = ((bgy[2] + 275) - py) / 2;
bg3._x = ((bgx[3] + 275) - px) / 2;
bg3._y = ((bgy[3] + 275) - py) / 2;
bg4._x = ((bgx[4] + 275) - px) / 2;
bg4._y = ((bgy[4] + 275) - py) / 2;
bg5._x = ((bgx[5] + 275) - px) / 2;
bg5._y = ((bgy[5] + 275) - py) / 2;
bg6._x = ((bgx[6] + 275) - px) / 2;
bg6._y = ((bgy[6] + 275) - py) / 2;
r = 1;
while (r <= 3) {
if (((pst[r] > 0) and (pst[r] < 4)) and (psd[r] == 0)) {
if (r == 1) {
shot1p._x = ((297 + psx[1]) - px) / 2;
shot1p._y = ((270 + psy[1]) - py) / 2;
}
if (r == 2) {
shot2p._x = ((297 + psx[2]) - px) / 2;
shot2p._y = ((270 + psy[2]) - py) / 2;
}
if (r == 3) {
shot3p._x = ((297 + psx[3]) - px) / 2;
shot3p._y = ((270 + psy[3]) - py) / 2;
}
}
if (((pst[r] > 0) and (pst[r] < 4)) and (psd[r] == 1)) {
if (r == 1) {
shot1p._x = ((247 + psx[1]) - px) / 2;
shot1p._y = ((270 + psy[1]) - py) / 2;
}
if (r == 2) {
shot2p._x = ((247 + psx[2]) - px) / 2;
shot2p._y = ((270 + psy[2]) - py) / 2;
}
if (r == 3) {
shot3p._x = ((247 + psx[3]) - px) / 2;
shot3p._y = ((270 + psy[3]) - py) / 2;
}
}
if ((pst[r] == 4) or (pst[r] == 5)) {
if (r == 1) {
shot1p._x = ((272 + psx[1]) - px) / 2;
shot1p._y = ((270 + psy[1]) - py) / 2;
}
if (r == 2) {
shot2p._x = ((272 + psx[2]) - px) / 2;
shot2p._y = ((270 + psy[2]) - py) / 2;
}
if (r == 3) {
shot3p._x = ((272 + psx[3]) - px) / 2;
shot3p._y = ((270 + psy[3]) - py) / 2;
}
}
if (pst[r] == 0) {
if (r == 1) {
shot1p._x = -200;
shot1p._y = (270 + psy[1]) - py;
}
if (r == 2) {
shot2p._x = -200;
shot2p._y = (270 + psy[2]) - py;
}
if (r == 3) {
shot3p._x = -200;
shot3p._y = (270 + psy[3]) - py;
}
}
r++;
}
if (i > 0) {
i = i - 1;
pc._alpha = 50;
}
if (i <= 0) {
i = i - 1;
pc._alpha = 100;
}
if (bcharge > 0) {
charge._alpha = bcharge;
}
lbar._height = 2 * pl;
lbar._y = 120 - (2 * pl);
stage._x = (270 - px) / 2;
stage._y = (-428 - py) / 2;
exit._x = ((ex + 275) - px) / 2;
exit._y = ((ey + 275) - py) / 2;
stage2._x = stage2._x - 20;
if (stage2._x < -60) {
stage2._x = 340;
stage2._y = random(180) + 20;
}
Frame 119
gotoAndPlay (118);
if ((((px + 10) > (ex - 20)) and ((px - 10) < (ex + 20))) and (((py + 30) > (ey - 20)) and (py < (ey + 50)))) {
gotoAndPlay (120);
}
Frame 120
lbar._height = 2 * pl;
lbar._y = 120 - (2 * pl);
stage._x = (270 - px) / 2;
stage._y = (-428 - py) / 2;
exit._x = ((ex + 275) - px) / 2;
exit._y = ((ey + 275) - py) / 2;
stage2._x = stage2._x - 20;
if (stage2._x < -60) {
stage2._x = 340;
stage2._y = random(180) + 20;
}
Frame 123
psn = 1;
bstep = 0;
pcd = 0;
bcharge = 0;
r = 1;
while (r <= 5) {
psx[r] = -200;
psy[r] = 0;
pst[r] = 0;
psd[r] = 0;
r++;
}
i = 0;
pl = pl + 5;
if (pl > 50) {
pl = 50;
}
px = 50;
py = -1450;
r = 0;
while (r <= 31) {
bx[r] = -50;
by[r] = -50;
r++;
}
bx[1] = 50;
by[1] = -1350;
bx[2] = 250;
by[2] = -1250;
bx[3] = 550;
by[3] = -1150;
bx[4] = 350;
by[4] = -950;
bx[5] = 400;
by[5] = -750;
bx[6] = 750;
by[6] = -650;
bx[7] = 850;
by[7] = -450;
bx[8] = 650;
by[8] = -350;
bx[9] = 350;
by[9] = -350;
bx[10] = 50;
by[10] = -250;
bx[11] = 300;
by[11] = -150;
bx[12] = 450;
by[12] = -50;
bx[13] = 550;
by[13] = 350;
bsn = 1;
r = 1;
while (r <= 8) {
bgx[r] = -200;
bgy[r] = -200;
bgt[r] = 0;
bgd[r] = -1;
bgs[r] = 0;
r++;
}
r = 1;
while (r <= 5) {
bgsx[r] = -200;
bgsy[r] = 0;
bgst[r] = 0;
bgsd[r] = 0;
r++;
}
r = 1;
while (r <= 8) {
f[r] = 20;
r++;
}
ex = 550;
ey = 250;
Frame 124
b1._x = bx[1] / 10;
b1._y = (by[1] / 10) + 120;
b2._x = bx[2] / 10;
b2._y = (by[2] / 10) + 120;
b3._x = bx[3] / 10;
b3._y = (by[3] / 10) + 120;
b4._x = bx[4] / 10;
b4._y = (by[4] / 10) + 120;
b5._x = bx[5] / 10;
b5._y = (by[5] / 10) + 120;
b6._x = bx[6] / 10;
b6._y = (by[6] / 10) + 120;
b7._x = bx[7] / 10;
b7._y = (by[7] / 10) + 120;
b8._x = bx[8] / 10;
b8._y = (by[8] / 10) + 120;
b9._x = bx[9] / 10;
b9._y = (by[9] / 10) + 120;
b10._x = bx[10] / 10;
b10._y = (by[10] / 10) + 120;
b11._x = bx[11] / 10;
b11._y = (by[11] / 10) + 120;
b12._x = bx[12] / 10;
b12._y = (by[12] / 10) + 120;
b13._x = bx[13] / 10;
b13._y = (by[13] / 10) + 120;
b14._x = bx[14] / 10;
b14._y = (by[14] / 10) + 120;
b15._x = bx[15] / 10;
b15._y = (by[15] / 10) + 120;
b16._x = bx[16] / 10;
b16._y = (by[16] / 10) + 120;
b17._x = bx[17] / 10;
b17._y = (by[17] / 10) + 120;
b18._x = bx[18] / 10;
b18._y = (by[18] / 10) + 120;
b19._x = bx[19] / 10;
b19._y = (by[19] / 10) + 120;
b20._x = bx[20] / 10;
b20._y = (by[20] / 10) + 120;
b21._x = bx[21] / 10;
b21._y = (by[21] / 10) + 120;
b22._x = bx[22] / 10;
b22._y = (by[22] / 10) + 120;
b23._x = bx[23] / 10;
b23._y = (by[23] / 10) + 120;
b24._x = bx[24] / 10;
b24._y = (by[24] / 10) + 120;
b25._x = bx[25] / 10;
b25._y = (by[25] / 10) + 120;
b26._x = bx[26] / 10;
b26._y = (by[26] / 10) + 120;
b27._x = bx[27] / 10;
b27._y = (by[27] / 10) + 120;
b28._x = bx[28] / 10;
b28._y = (by[28] / 10) + 120;
b29._x = bx[29] / 10;
b29._y = (by[29] / 10) + 120;
b30._x = bx[30] / 10;
b30._y = (by[30] / 10) + 120;
b31._x = bx[31] / 10;
b31._y = (by[31] / 10) + 120;
cir._x = px / 10;
cir._y = (py / 10) + 120;
shot1._x = psx[1] / 10;
shot1._y = (psy[1] / 10) + 120;
shot2._x = psx[2] / 10;
shot2._y = (psy[2] / 10) + 120;
shot3._x = psx[3] / 10;
shot3._y = (psy[3] / 10) + 120;
bshot1._x = bgsx[1] / 10;
bshot1._y = (bgsy[1] / 10) + 120;
bshot2._x = bgsx[2] / 10;
bshot2._y = (bgsy[2] / 10) + 120;
bshot3._x = bgsx[3] / 10;
bshot3._y = (bgsy[3] / 10) + 120;
bshot4._x = bgsx[4] / 10;
bshot4._y = (bgsy[4] / 10) + 120;
bshot5._x = bgsx[5] / 10;
bshot5._y = (bgsy[5] / 10) + 120;
bcir1._x = bgx[1] / 10;
bcir1._y = (bgy[1] / 10) + 120;
bcir2._x = bgx[2] / 10;
bcir2._y = (bgy[2] / 10) + 120;
bcir3._x = bgx[3] / 10;
bcir3._y = (bgy[3] / 10) + 120;
bcir4._x = bgx[4] / 10;
bcir4._y = (bgy[4] / 10) + 120;
bcir5._x = bgx[5] / 10;
bcir5._y = (bgy[5] / 10) + 120;
bcir6._x = bgx[6] / 10;
bcir6._y = (bgy[6] / 10) + 120;
bcir7._x = bgx[7] / 10;
bcir7._y = (bgy[7] / 10) + 120;
bcir8._x = bgx[8] / 10;
bcir8._y = (bgy[8] / 10) + 120;
bcir9._x = bgx[9] / 10;
bcir9._y = (bgy[9] / 10) + 120;
bcir10._x = bgx[10] / 10;
bcir10._y = (bgy[10] / 10) + 120;
bcir11._x = bgx[11] / 10;
bcir11._y = (bgy[11] / 10) + 120;
bcir12._x = bgx[12] / 10;
bcir12._y = (bgy[12] / 10) + 120;
bcir13._x = bgx[13] / 10;
bcir13._y = (bgy[13] / 10) + 120;
if (Key.isDown(39) and (pcd == 0)) {
pcd = 2;
}
if (Key.isDown(39) and ((pcd == 1) or (pcd == 3))) {
pcd = 0;
}
if (Key.isDown(37) and (pcd == 1)) {
pcd = 3;
}
if (Key.isDown(37) and ((pcd == 0) or (pcd == 2))) {
pcd = 1;
}
if (Key.isDown(38) and ((pcd == 0) or (pcd == 2))) {
pcd = 10;
pstep = 7;
}
if (Key.isDown(38) and ((pcd == 1) or (pcd == 3))) {
pcd = 11;
pstep = 7;
}
if (Key.isDown(40) and ((((pcd == 0) or (pcd == 1)) or (pcd == 2)) or (pcd == 3))) {
if (((pcd == 0) or (pcd == 2)) or (pcd == 8)) {
pcd = 6;
pstep = 3;
}
if (((pcd == 1) or (pcd == 3)) or (pcd == 9)) {
pcd = 7;
pstep = 3;
}
}
if (Key.isDown(16) and (bcharge < 100)) {
bcharge = bcharge + 5;
}
if (pcd == 0) {
pc.gotoAndStop(1);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(21);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 0;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
}
if (pcd == 1) {
pc.gotoAndStop(2);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(22);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 1;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
}
if (pcd == 2) {
px = px + 13;
if ((w == 0) or (w == 1)) {
pc.gotoAndStop(3);
}
if ((w == 2) or (w == 3)) {
pc.gotoAndStop(4);
}
if ((w == 4) or (w == 5)) {
pc.gotoAndStop(5);
}
if ((w == 6) or (w == 7)) {
pc.gotoAndStop(6);
}
if (Key.isDown(32)) {
if ((w == 0) or (w == 1)) {
pc.gotoAndStop(11);
}
if ((w == 2) or (w == 3)) {
pc.gotoAndStop(12);
}
if ((w == 4) or (w == 5)) {
pc.gotoAndStop(13);
}
if ((w == 6) or (w == 7)) {
pc.gotoAndStop(14);
}
if ((pst[psn] == 0) and (bstep == 0)) {
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 0;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
}
pcd = 0;
}
if (pcd == 3) {
px = px - 13;
if ((w == 0) or (w == 1)) {
pc.gotoAndStop(7);
}
if ((w == 2) or (w == 3)) {
pc.gotoAndStop(8);
}
if ((w == 4) or (w == 5)) {
pc.gotoAndStop(9);
}
if ((w == 6) or (w == 7)) {
pc.gotoAndStop(10);
}
if (Key.isDown(32)) {
if ((w == 0) or (w == 1)) {
pc.gotoAndStop(15);
}
if ((w == 2) or (w == 3)) {
pc.gotoAndStop(16);
}
if ((w == 4) or (w == 5)) {
pc.gotoAndStop(17);
}
if ((w == 6) or (w == 7)) {
pc.gotoAndStop(18);
}
if ((pst[psn] == 0) and (bstep == 0)) {
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 1;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
}
pcd = 1;
}
if (pcd == 9) {
pstep = pstep - 1;
if (pstep <= 0) {
pcd = 1;
}
}
if (pcd == 6) {
pc.gotoAndStop(19);
px = px + 20;
pstep = pstep - 1;
if (pstep <= 0) {
pcd = 0;
}
}
if (pcd == 7) {
pc.gotoAndStop(20);
px = px - 20;
pstep = pstep - 1;
if (pstep <= 0) {
pcd = 1;
}
}
if (pcd == 12) {
pc.gotoAndStop(23);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(25);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 0;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
py = py + (5 * (7 - pstep));
pstep = pstep - 1;
if (pstep <= 2) {
pstep = 2;
}
if (Key.isDown(39)) {
px = px + 13;
}
if (Key.isDown(37)) {
px = px - 13;
if (bstep == 0) {
pcd = 13;
}
}
}
if (pcd == 13) {
pc.gotoAndStop(24);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(26);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 1;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
py = py + (5 * (7 - pstep));
pstep = pstep - 1;
if (pstep <= 2) {
pstep = 2;
}
if (Key.isDown(39)) {
px = px + 13;
if (bstep == 0) {
pcd = 12;
}
}
if (Key.isDown(37)) {
px = px - 13;
}
}
if (pcd == 10) {
pc.gotoAndStop(23);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(25);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 0;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
py = py - (5 * pstep);
pstep = pstep - 1;
if (Key.isDown(39)) {
px = px + 13;
}
if (Key.isDown(37)) {
px = px - 13;
if (bstep == 0) {
pcd = 11;
}
}
if (Key.isDown(40)) {
pcd = 12;
pstep = pstep + 3;
}
if (pstep <= -1) {
pstep = 7;
pcd = 12;
}
}
if (pcd == 11) {
pc.gotoAndStop(24);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(26);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 1;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
py = py - (5 * pstep);
pstep = pstep - 1;
if (Key.isDown(39)) {
px = px + 13;
if (bstep == 0) {
pcd = 10;
}
}
if (Key.isDown(37)) {
px = px - 13;
}
if (Key.isDown(40)) {
pcd = 13;
pstep = pstep + 3;
}
if (pstep <= -1) {
pstep = 7;
pcd = 13;
}
}
if (pcd == 18) {
pc.gotoAndStop(27);
pstep = pstep - 1;
px = px - 5;
if (pstep <= -1) {
pstep = 2;
pcd = 0;
}
}
if (pcd == 19) {
pc.gotoAndStop(28);
pstep = pstep - 1;
px = px + 5;
if (pstep <= -1) {
pstep = 2;
pcd = 1;
}
}
if (pcd == 20) {
pc.gotoAndStop(69 - pstep);
bcharge = 0;
charge._alpha = 0;
bstep = 20;
pl = 1;
pstep = pstep - 1;
if (pstep < 0) {
lives = lives - 1;
if (lives >= 0) {
pl = 50;
gotoAndPlay (100);
}
if (lives < 0) {
lives = 2;
continues = continues - 1;
gotoAndPlay (5);
}
}
}
if (pl <= 0) {
c = 1;
while (c <= 8) {
bgx[c] = -600;
c++;
}
pc._alpha = 100;
pcd = 20;
pstep = 40;
megad.start();
}
if (bstep > 0) {
bcharge = 0;
charge._alpha = bcharge;
}
if (bstep > 0) {
bstep = bstep - 1;
}
if ((py > 500) and (pcd < 20)) {
megad.start();
pl = 0;
}
w = w - 1;
if (w < 0) {
w = 7;
}
e = pcd;
c = 0;
r = 1;
while (r <= 13) {
if (((((bx[r] - 150) < px) and ((bx[r] + 150) > px)) and ((by[r] - 150) < py)) and ((by[r] + 150) > py)) {
if (((((((px - 30) < (bx[r] + 50)) and ((px + 20) > (bx[r] - 50))) and (py < (by[r] - 50))) and ((py + 60) > (by[r] - 50))) and (pcd != 10)) and (pcd != 11)) {
if ((((pcd == 12) or (pcd == 13)) or (pcd == 16)) or (pcd == 17)) {
if ((pcd == 12) or (pcd == 16)) {
pcd = 0;
}
if ((pcd == 13) or (pcd == 17)) {
pcd = 1;
}
}
c = 1;
py = by[r] - 75;
}
if (((((px + 38) > (bx[r] - 50)) and ((px + 20) < bx[r])) and (py < (by[r] + 50))) and ((py + 20) > (by[r] - 50))) {
px = bx[r] - 85;
}
if (((((px - 35) < (bx[r] + 50)) and ((px - 20) > bx[r])) and (py < (by[r] + 50))) and ((py + 20) > (by[r] - 50))) {
px = bx[r] + 85;
}
if (((((px - 5) < (bx[r] + 50)) and ((px + 5) > (bx[r] - 50))) and ((py - 30) < (by[r] + 50))) and ((py + 10) > (by[r] + 50))) {
if ((((pcd == 10) or (pcd == 11)) or (pcd == 14)) or (pcd == 15)) {
if ((pcd == 10) or (pcd == 14)) {
pcd = 12;
pstep = 5;
}
if ((pcd == 11) or (pcd == 15)) {
pcd = 13;
pstep = 5;
}
}
py = by[r] + 90;
}
}
r++;
}
if (c == 0) {
if ((((pcd == 0) or (pcd == 2)) or (pcd == 6)) or (pcd == 18)) {
pcd = 12;
pstep = 6;
}
if ((((pcd == 1) or (pcd == 3)) or (pcd == 7)) or (pcd == 19)) {
pcd = 13;
pstep = 6;
}
}
r = 1;
while (r <= 3) {
if (pst[r] == 1) {
if (psd[r] == 0) {
psx[r] = psx[r] + 30;
if (r == 1) {
shot1p.gotoAndStop(1);
}
if (r == 2) {
shot2p.gotoAndStop(1);
}
if (r == 3) {
shot3p.gotoAndStop(1);
}
if (psx[r] > (px + 280)) {
pst[r] = 0;
psx[r] = -200;
}
}
if (psd[r] == 1) {
psx[r] = psx[r] - 30;
if (r == 1) {
shot1p.gotoAndStop(2);
}
if (r == 2) {
shot2p.gotoAndStop(2);
}
if (r == 3) {
shot3p.gotoAndStop(2);
}
if (psx[r] < (px - 280)) {
pst[r] = 0;
psx[r] = -200;
}
}
}
if (pst[r] == 2) {
if (psd[r] == 0) {
psx[r] = psx[r] + 35;
if (r == 1) {
shot1p.gotoAndStop(3);
}
if (r == 2) {
shot2p.gotoAndStop(3);
}
if (r == 3) {
shot3p.gotoAndStop(3);
}
if (psx[r] > (px + 280)) {
pst[r] = 0;
psx[r] = -200;
}
}
if (psd[r] == 1) {
psx[r] = psx[r] - 35;
if (r == 1) {
shot1p.gotoAndStop(4);
}
if (r == 2) {
shot2p.gotoAndStop(4);
}
if (r == 3) {
shot3p.gotoAndStop(4);
}
if (psx[r] < (px - 280)) {
pst[r] = 0;
psx[r] = -200;
}
}
}
if (pst[r] == 3) {
if (psd[r] == 0) {
psx[r] = psx[r] + 40;
if (r == 1) {
shot1p.gotoAndStop(5);
}
if (r == 2) {
shot2p.gotoAndStop(5);
}
if (r == 3) {
shot3p.gotoAndStop(5);
}
if (psx[r] > (px + 280)) {
pst[r] = 0;
psx[r] = -200;
}
}
if (psd[r] == 1) {
psx[r] = psx[r] - 40;
if (r == 1) {
shot1p.gotoAndStop(6);
}
if (r == 2) {
shot2p.gotoAndStop(6);
}
if (r == 3) {
shot3p.gotoAndStop(6);
}
if (psx[r] < (px - 280)) {
pst[r] = 0;
psx[r] = -200;
}
}
}
if (pst[r] == 4) {
if (r == 1) {
shot1p.gotoAndStop(10 - psd[r]);
}
if (r == 2) {
shot2p.gotoAndStop(10 - psd[r]);
}
if (r == 3) {
shot3p.gotoAndStop(10 - psd[r]);
}
psd[r] = psd[r] - 1;
if (psd[r] < 0) {
pst[r] = 0;
psx[r] = -200;
}
}
if (pst[r] == 5) {
if (r == 1) {
shot1p.gotoAndStop(14 - psd[r]);
}
if (r == 2) {
shot2p.gotoAndStop(14 - psd[r]);
}
if (r == 3) {
shot3p.gotoAndStop(14 - psd[r]);
}
psd[r] = psd[r] - 1;
if (psd[r] < 0) {
pst[r] = 0;
psx[r] = -200;
}
}
r++;
}
bg1.gotoAndStop(f[1]);
bg2.gotoAndStop(f[2]);
bg3.gotoAndStop(f[3]);
bg4.gotoAndStop(f[4]);
bg5.gotoAndStop(f[5]);
bg6.gotoAndStop(f[6]);
bg7.gotoAndStop(f[7]);
bg8.gotoAndStop(f[8]);
bgs1._x = ((bgsx[1] + 275) - px) / 2;
bgs1._y = ((bgsy[1] + 275) - py) / 2;
bgs2._x = ((bgsx[2] + 275) - px) / 2;
bgs2._y = ((bgsy[2] + 275) - py) / 2;
bgs3._x = ((bgsx[3] + 275) - px) / 2;
bgs3._y = ((bgsy[3] + 275) - py) / 2;
bgs4._x = ((bgsx[4] + 275) - px) / 2;
bgs4._y = ((bgsy[4] + 275) - py) / 2;
bgs5._x = ((bgsx[5] + 275) - px) / 2;
bgs5._y = ((bgsy[5] + 275) - py) / 2;
bg1._x = ((bgx[1] + 275) - px) / 2;
bg1._y = ((bgy[1] + 275) - py) / 2;
bg2._x = ((bgx[2] + 275) - px) / 2;
bg2._y = ((bgy[2] + 275) - py) / 2;
bg3._x = ((bgx[3] + 275) - px) / 2;
bg3._y = ((bgy[3] + 275) - py) / 2;
bg4._x = ((bgx[4] + 275) - px) / 2;
bg4._y = ((bgy[4] + 275) - py) / 2;
bg5._x = ((bgx[5] + 275) - px) / 2;
bg5._y = ((bgy[5] + 275) - py) / 2;
bg6._x = ((bgx[6] + 275) - px) / 2;
bg6._y = ((bgy[6] + 275) - py) / 2;
bg7._x = ((bgx[7] + 275) - px) / 2;
bg7._y = ((bgy[7] + 275) - py) / 2;
bg8._x = ((bgx[8] + 275) - px) / 2;
bg8._y = ((bgy[8] + 275) - py) / 2;
r = 1;
while (r <= 3) {
if (((pst[r] > 0) and (pst[r] < 4)) and (psd[r] == 0)) {
if (r == 1) {
shot1p._x = ((297 + psx[1]) - px) / 2;
shot1p._y = ((270 + psy[1]) - py) / 2;
}
if (r == 2) {
shot2p._x = ((297 + psx[2]) - px) / 2;
shot2p._y = ((270 + psy[2]) - py) / 2;
}
if (r == 3) {
shot3p._x = ((297 + psx[3]) - px) / 2;
shot3p._y = ((270 + psy[3]) - py) / 2;
}
}
if (((pst[r] > 0) and (pst[r] < 4)) and (psd[r] == 1)) {
if (r == 1) {
shot1p._x = ((247 + psx[1]) - px) / 2;
shot1p._y = ((270 + psy[1]) - py) / 2;
}
if (r == 2) {
shot2p._x = ((247 + psx[2]) - px) / 2;
shot2p._y = ((270 + psy[2]) - py) / 2;
}
if (r == 3) {
shot3p._x = ((247 + psx[3]) - px) / 2;
shot3p._y = ((270 + psy[3]) - py) / 2;
}
}
if ((pst[r] == 4) or (pst[r] == 5)) {
if (r == 1) {
shot1p._x = ((272 + psx[1]) - px) / 2;
shot1p._y = ((270 + psy[1]) - py) / 2;
}
if (r == 2) {
shot2p._x = ((272 + psx[2]) - px) / 2;
shot2p._y = ((270 + psy[2]) - py) / 2;
}
if (r == 3) {
shot3p._x = ((272 + psx[3]) - px) / 2;
shot3p._y = ((270 + psy[3]) - py) / 2;
}
}
if (pst[r] == 0) {
if (r == 1) {
shot1p._x = -200;
shot1p._y = (270 + psy[1]) - py;
}
if (r == 2) {
shot2p._x = -200;
shot2p._y = (270 + psy[2]) - py;
}
if (r == 3) {
shot3p._x = -200;
shot3p._y = (270 + psy[3]) - py;
}
}
r++;
}
if (i > 0) {
i = i - 1;
pc._alpha = 50;
}
if (i <= 0) {
i = i - 1;
pc._alpha = 100;
}
if (bcharge > 0) {
charge._alpha = bcharge;
}
lbar._height = 2 * pl;
lbar._y = 120 - (2 * pl);
stage._x = (270 - px) / 2;
stage._y = (-1225 - py) / 2;
exit._x = ((ex + 275) - px) / 2;
exit._y = ((ey + 275) - py) / 2;
stage2._x = stage2._x - 20;
if (stage2._x < -60) {
stage2._x = 340;
stage2._y = random(180) + 20;
}
Frame 125
gotoAndPlay (124);
if ((((px + 10) > (ex - 20)) and ((px - 10) < (ex + 20))) and (((py + 30) > (ey - 20)) and (py < (ey + 50)))) {
gotoAndPlay (126);
}
Frame 126
lbar._height = 2 * pl;
lbar._y = 120 - (2 * pl);
stage._x = (270 - px) / 2;
stage._y = (-1225 - py) / 2;
exit._x = ((ex + 275) - px) / 2;
exit._y = ((ey + 275) - py) / 2;
stage2._x = stage2._x - 20;
if (stage2._x < -60) {
stage2._x = 340;
stage2._y = random(180) + 20;
}
Frame 129
psn = 1;
bstep = 0;
pcd = 0;
bcharge = 0;
r = 1;
while (r <= 5) {
psx[r] = -200;
psy[r] = 0;
pst[r] = 0;
psd[r] = 0;
r++;
}
i = 0;
pl = pl + 5;
if (pl > 50) {
pl = 50;
}
px = 150;
py = 200;
r = 0;
while (r <= 31) {
bx[r] = -50;
by[r] = -50;
r++;
}
bx[1] = 150;
by[1] = 300;
bx[2] = 350;
by[2] = 250;
bx[3] = 450;
by[3] = 250;
bx[4] = 750;
by[4] = 300;
bx[5] = 850;
by[5] = 250;
bx[6] = 1050;
by[6] = 250;
bx[7] = 1350;
by[7] = 250;
bx[8] = 1600;
by[8] = 150;
bx[9] = 1850;
by[9] = 100;
bx[10] = 2050;
by[10] = 0;
bx[11] = 2150;
by[11] = 150;
bsn = 1;
r = 1;
while (r <= 8) {
bgx[r] = -200;
bgy[r] = -200;
bgt[r] = 0;
bgd[r] = -1;
bgs[r] = 0;
r++;
}
r = 1;
while (r <= 5) {
bgsx[r] = -200;
bgsy[r] = 0;
bgst[r] = 0;
bgsd[r] = 0;
r++;
}
r = 1;
while (r <= 8) {
f[r] = 20;
r++;
}
bgt[1] = 7;
bgd[1] = 0;
bgs[1] = 0;
bgl[1] = 2;
bgx[1] = 550;
bgy[1] = 0;
bgt[2] = 12;
bgd[2] = 0;
bgs[2] = 0;
bgl[2] = 2;
bgx[2] = 650;
bgy[2] = 0;
bgt[3] = 12;
bgd[3] = 0;
bgs[3] = 0;
bgl[3] = 2;
bgx[3] = 850;
bgy[3] = 0;
bgt[4] = 12;
bgd[4] = 0;
bgs[4] = 0;
bgl[4] = 2;
bgx[4] = 1000;
bgy[4] = -20;
bgt[5] = 5;
bgd[5] = 0;
bgs[5] = 0;
bgl[5] = 6;
bgx[5] = 1350;
bgy[5] = 150;
bgt[6] = 7;
bgd[6] = 0;
bgs[6] = 0;
bgl[6] = 2;
bgx[6] = 1550;
bgy[6] = -50;
bgt[7] = 7;
bgd[7] = 0;
bgs[7] = 0;
bgl[7] = 2;
bgx[7] = 1700;
bgy[7] = -150;
bgt[8] = 12;
bgd[8] = 0;
bgs[8] = 0;
bgl[8] = 2;
bgx[8] = 1800;
bgy[8] = -50;
ex = 2150;
ey = 50;
Frame 130
b1._x = bx[1] / 10;
b1._y = (by[1] / 10) + 120;
b2._x = bx[2] / 10;
b2._y = (by[2] / 10) + 120;
b3._x = bx[3] / 10;
b3._y = (by[3] / 10) + 120;
b4._x = bx[4] / 10;
b4._y = (by[4] / 10) + 120;
b5._x = bx[5] / 10;
b5._y = (by[5] / 10) + 120;
b6._x = bx[6] / 10;
b6._y = (by[6] / 10) + 120;
b7._x = bx[7] / 10;
b7._y = (by[7] / 10) + 120;
b8._x = bx[8] / 10;
b8._y = (by[8] / 10) + 120;
b9._x = bx[9] / 10;
b9._y = (by[9] / 10) + 120;
b10._x = bx[10] / 10;
b10._y = (by[10] / 10) + 120;
b11._x = bx[11] / 10;
b11._y = (by[11] / 10) + 120;
b12._x = bx[12] / 10;
b12._y = (by[12] / 10) + 120;
b13._x = bx[13] / 10;
b13._y = (by[13] / 10) + 120;
b14._x = bx[14] / 10;
b14._y = (by[14] / 10) + 120;
b15._x = bx[15] / 10;
b15._y = (by[15] / 10) + 120;
b16._x = bx[16] / 10;
b16._y = (by[16] / 10) + 120;
b17._x = bx[17] / 10;
b17._y = (by[17] / 10) + 120;
b18._x = bx[18] / 10;
b18._y = (by[18] / 10) + 120;
b19._x = bx[19] / 10;
b19._y = (by[19] / 10) + 120;
b20._x = bx[20] / 10;
b20._y = (by[20] / 10) + 120;
b21._x = bx[21] / 10;
b21._y = (by[21] / 10) + 120;
b22._x = bx[22] / 10;
b22._y = (by[22] / 10) + 120;
b23._x = bx[23] / 10;
b23._y = (by[23] / 10) + 120;
b24._x = bx[24] / 10;
b24._y = (by[24] / 10) + 120;
b25._x = bx[25] / 10;
b25._y = (by[25] / 10) + 120;
b26._x = bx[26] / 10;
b26._y = (by[26] / 10) + 120;
b27._x = bx[27] / 10;
b27._y = (by[27] / 10) + 120;
b28._x = bx[28] / 10;
b28._y = (by[28] / 10) + 120;
b29._x = bx[29] / 10;
b29._y = (by[29] / 10) + 120;
b30._x = bx[30] / 10;
b30._y = (by[30] / 10) + 120;
b31._x = bx[31] / 10;
b31._y = (by[31] / 10) + 120;
cir._x = px / 10;
cir._y = (py / 10) + 120;
shot1._x = psx[1] / 10;
shot1._y = (psy[1] / 10) + 120;
shot2._x = psx[2] / 10;
shot2._y = (psy[2] / 10) + 120;
shot3._x = psx[3] / 10;
shot3._y = (psy[3] / 10) + 120;
bshot1._x = bgsx[1] / 10;
bshot1._y = (bgsy[1] / 10) + 120;
bshot2._x = bgsx[2] / 10;
bshot2._y = (bgsy[2] / 10) + 120;
bshot3._x = bgsx[3] / 10;
bshot3._y = (bgsy[3] / 10) + 120;
bshot4._x = bgsx[4] / 10;
bshot4._y = (bgsy[4] / 10) + 120;
bshot5._x = bgsx[5] / 10;
bshot5._y = (bgsy[5] / 10) + 120;
bcir1._x = bgx[1] / 10;
bcir1._y = (bgy[1] / 10) + 120;
bcir2._x = bgx[2] / 10;
bcir2._y = (bgy[2] / 10) + 120;
bcir3._x = bgx[3] / 10;
bcir3._y = (bgy[3] / 10) + 120;
bcir4._x = bgx[4] / 10;
bcir4._y = (bgy[4] / 10) + 120;
bcir5._x = bgx[5] / 10;
bcir5._y = (bgy[5] / 10) + 120;
bcir6._x = bgx[6] / 10;
bcir6._y = (bgy[6] / 10) + 120;
bcir7._x = bgx[7] / 10;
bcir7._y = (bgy[7] / 10) + 120;
bcir8._x = bgx[8] / 10;
bcir8._y = (bgy[8] / 10) + 120;
bcir9._x = bgx[9] / 10;
bcir9._y = (bgy[9] / 10) + 120;
bcir10._x = bgx[10] / 10;
bcir10._y = (bgy[10] / 10) + 120;
bcir11._x = bgx[11] / 10;
bcir11._y = (bgy[11] / 10) + 120;
bcir12._x = bgx[12] / 10;
bcir12._y = (bgy[12] / 10) + 120;
bcir13._x = bgx[13] / 10;
bcir13._y = (bgy[13] / 10) + 120;
if (Key.isDown(39) and (pcd == 0)) {
pcd = 2;
}
if (Key.isDown(39) and ((pcd == 1) or (pcd == 3))) {
pcd = 0;
}
if (Key.isDown(37) and (pcd == 1)) {
pcd = 3;
}
if (Key.isDown(37) and ((pcd == 0) or (pcd == 2))) {
pcd = 1;
}
if (Key.isDown(38) and ((pcd == 0) or (pcd == 2))) {
pcd = 10;
pstep = 7;
}
if (Key.isDown(38) and ((pcd == 1) or (pcd == 3))) {
pcd = 11;
pstep = 7;
}
if (Key.isDown(40) and ((((pcd == 0) or (pcd == 1)) or (pcd == 2)) or (pcd == 3))) {
if (((pcd == 0) or (pcd == 2)) or (pcd == 8)) {
pcd = 6;
pstep = 3;
}
if (((pcd == 1) or (pcd == 3)) or (pcd == 9)) {
pcd = 7;
pstep = 3;
}
}
if (Key.isDown(16) and (bcharge < 100)) {
bcharge = bcharge + 5;
}
if (pcd == 0) {
pc.gotoAndStop(1);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(21);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 0;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
}
if (pcd == 1) {
pc.gotoAndStop(2);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(22);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 1;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
}
if (pcd == 2) {
px = px + 13;
if ((w == 0) or (w == 1)) {
pc.gotoAndStop(3);
}
if ((w == 2) or (w == 3)) {
pc.gotoAndStop(4);
}
if ((w == 4) or (w == 5)) {
pc.gotoAndStop(5);
}
if ((w == 6) or (w == 7)) {
pc.gotoAndStop(6);
}
if (Key.isDown(32)) {
if ((w == 0) or (w == 1)) {
pc.gotoAndStop(11);
}
if ((w == 2) or (w == 3)) {
pc.gotoAndStop(12);
}
if ((w == 4) or (w == 5)) {
pc.gotoAndStop(13);
}
if ((w == 6) or (w == 7)) {
pc.gotoAndStop(14);
}
if ((pst[psn] == 0) and (bstep == 0)) {
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 0;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
}
pcd = 0;
}
if (pcd == 3) {
px = px - 13;
if ((w == 0) or (w == 1)) {
pc.gotoAndStop(7);
}
if ((w == 2) or (w == 3)) {
pc.gotoAndStop(8);
}
if ((w == 4) or (w == 5)) {
pc.gotoAndStop(9);
}
if ((w == 6) or (w == 7)) {
pc.gotoAndStop(10);
}
if (Key.isDown(32)) {
if ((w == 0) or (w == 1)) {
pc.gotoAndStop(15);
}
if ((w == 2) or (w == 3)) {
pc.gotoAndStop(16);
}
if ((w == 4) or (w == 5)) {
pc.gotoAndStop(17);
}
if ((w == 6) or (w == 7)) {
pc.gotoAndStop(18);
}
if ((pst[psn] == 0) and (bstep == 0)) {
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 1;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
}
pcd = 1;
}
if (pcd == 9) {
pstep = pstep - 1;
if (pstep <= 0) {
pcd = 1;
}
}
if (pcd == 6) {
pc.gotoAndStop(19);
px = px + 20;
pstep = pstep - 1;
if (pstep <= 0) {
pcd = 0;
}
}
if (pcd == 7) {
pc.gotoAndStop(20);
px = px - 20;
pstep = pstep - 1;
if (pstep <= 0) {
pcd = 1;
}
}
if (pcd == 12) {
pc.gotoAndStop(23);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(25);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 0;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
py = py + (5 * (7 - pstep));
pstep = pstep - 1;
if (pstep <= 2) {
pstep = 2;
}
if (Key.isDown(39)) {
px = px + 13;
}
if (Key.isDown(37)) {
px = px - 13;
if (bstep == 0) {
pcd = 13;
}
}
}
if (pcd == 13) {
pc.gotoAndStop(24);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(26);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 1;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
py = py + (5 * (7 - pstep));
pstep = pstep - 1;
if (pstep <= 2) {
pstep = 2;
}
if (Key.isDown(39)) {
px = px + 13;
if (bstep == 0) {
pcd = 12;
}
}
if (Key.isDown(37)) {
px = px - 13;
}
}
if (pcd == 10) {
pc.gotoAndStop(23);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(25);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 0;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
py = py - (5 * pstep);
pstep = pstep - 1;
if (Key.isDown(39)) {
px = px + 13;
}
if (Key.isDown(37)) {
px = px - 13;
if (bstep == 0) {
pcd = 11;
}
}
if (Key.isDown(40)) {
pcd = 12;
pstep = pstep + 3;
}
if (pstep <= -1) {
pstep = 7;
pcd = 12;
}
}
if (pcd == 11) {
pc.gotoAndStop(24);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(26);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 1;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
py = py - (5 * pstep);
pstep = pstep - 1;
if (Key.isDown(39)) {
px = px + 13;
if (bstep == 0) {
pcd = 10;
}
}
if (Key.isDown(37)) {
px = px - 13;
}
if (Key.isDown(40)) {
pcd = 13;
pstep = pstep + 3;
}
if (pstep <= -1) {
pstep = 7;
pcd = 13;
}
}
if (pcd == 18) {
pc.gotoAndStop(27);
pstep = pstep - 1;
px = px - 5;
if (pstep <= -1) {
pstep = 2;
pcd = 0;
}
}
if (pcd == 19) {
pc.gotoAndStop(28);
pstep = pstep - 1;
px = px + 5;
if (pstep <= -1) {
pstep = 2;
pcd = 1;
}
}
if (pcd == 20) {
pc.gotoAndStop(69 - pstep);
bcharge = 0;
charge._alpha = 0;
bstep = 20;
pl = 1;
pstep = pstep - 1;
if (pstep < 0) {
lives = lives - 1;
if (lives >= 0) {
pl = 50;
gotoAndPlay (100);
}
if (lives < 0) {
lives = 2;
continues = continues - 1;
gotoAndPlay (5);
}
}
}
if (pl <= 0) {
c = 1;
while (c <= 8) {
bgx[c] = -600;
c++;
}
pc._alpha = 100;
pcd = 20;
pstep = 40;
megad.start();
}
if (bstep > 0) {
bcharge = 0;
charge._alpha = bcharge;
}
if (bstep > 0) {
bstep = bstep - 1;
}
if ((py > 500) and (pcd < 20)) {
megad.start();
pl = 0;
}
w = w - 1;
if (w < 0) {
w = 7;
}
e = pcd;
c = 0;
r = 1;
while (r <= 12) {
if (((((bx[r] - 150) < px) and ((bx[r] + 150) > px)) and ((by[r] - 150) < py)) and ((by[r] + 150) > py)) {
if (((((((px - 30) < (bx[r] + 50)) and ((px + 20) > (bx[r] - 50))) and (py < (by[r] - 50))) and ((py + 60) > (by[r] - 50))) and (pcd != 10)) and (pcd != 11)) {
if ((((pcd == 12) or (pcd == 13)) or (pcd == 16)) or (pcd == 17)) {
if ((pcd == 12) or (pcd == 16)) {
pcd = 0;
}
if ((pcd == 13) or (pcd == 17)) {
pcd = 1;
}
}
c = 1;
py = by[r] - 75;
}
if (((((px + 38) > (bx[r] - 50)) and ((px + 20) < bx[r])) and (py < (by[r] + 50))) and ((py + 20) > (by[r] - 50))) {
px = bx[r] - 85;
}
if (((((px - 35) < (bx[r] + 50)) and ((px - 20) > bx[r])) and (py < (by[r] + 50))) and ((py + 20) > (by[r] - 50))) {
px = bx[r] + 85;
}
if (((((px - 5) < (bx[r] + 50)) and ((px + 5) > (bx[r] - 50))) and ((py - 30) < (by[r] + 50))) and ((py + 10) > (by[r] + 50))) {
if ((((pcd == 10) or (pcd == 11)) or (pcd == 14)) or (pcd == 15)) {
if ((pcd == 10) or (pcd == 14)) {
pcd = 12;
pstep = 5;
}
if ((pcd == 11) or (pcd == 15)) {
pcd = 13;
pstep = 5;
}
}
py = by[r] + 90;
}
}
r++;
}
if (c == 0) {
if ((((pcd == 0) or (pcd == 2)) or (pcd == 6)) or (pcd == 18)) {
pcd = 12;
pstep = 6;
}
if ((((pcd == 1) or (pcd == 3)) or (pcd == 7)) or (pcd == 19)) {
pcd = 13;
pstep = 6;
}
}
r = 1;
while (r <= 3) {
if (pst[r] == 1) {
if (psd[r] == 0) {
psx[r] = psx[r] + 30;
if (r == 1) {
shot1p.gotoAndStop(1);
}
if (r == 2) {
shot2p.gotoAndStop(1);
}
if (r == 3) {
shot3p.gotoAndStop(1);
}
if (psx[r] > (px + 280)) {
pst[r] = 0;
psx[r] = -200;
}
}
if (psd[r] == 1) {
psx[r] = psx[r] - 30;
if (r == 1) {
shot1p.gotoAndStop(2);
}
if (r == 2) {
shot2p.gotoAndStop(2);
}
if (r == 3) {
shot3p.gotoAndStop(2);
}
if (psx[r] < (px - 280)) {
pst[r] = 0;
psx[r] = -200;
}
}
}
if (pst[r] == 2) {
if (psd[r] == 0) {
psx[r] = psx[r] + 35;
if (r == 1) {
shot1p.gotoAndStop(3);
}
if (r == 2) {
shot2p.gotoAndStop(3);
}
if (r == 3) {
shot3p.gotoAndStop(3);
}
if (psx[r] > (px + 280)) {
pst[r] = 0;
psx[r] = -200;
}
}
if (psd[r] == 1) {
psx[r] = psx[r] - 35;
if (r == 1) {
shot1p.gotoAndStop(4);
}
if (r == 2) {
shot2p.gotoAndStop(4);
}
if (r == 3) {
shot3p.gotoAndStop(4);
}
if (psx[r] < (px - 280)) {
pst[r] = 0;
psx[r] = -200;
}
}
}
if (pst[r] == 3) {
if (psd[r] == 0) {
psx[r] = psx[r] + 40;
if (r == 1) {
shot1p.gotoAndStop(5);
}
if (r == 2) {
shot2p.gotoAndStop(5);
}
if (r == 3) {
shot3p.gotoAndStop(5);
}
if (psx[r] > (px + 280)) {
pst[r] = 0;
psx[r] = -200;
}
}
if (psd[r] == 1) {
psx[r] = psx[r] - 40;
if (r == 1) {
shot1p.gotoAndStop(6);
}
if (r == 2) {
shot2p.gotoAndStop(6);
}
if (r == 3) {
shot3p.gotoAndStop(6);
}
if (psx[r] < (px - 280)) {
pst[r] = 0;
psx[r] = -200;
}
}
}
if (pst[r] == 4) {
if (r == 1) {
shot1p.gotoAndStop(10 - psd[r]);
}
if (r == 2) {
shot2p.gotoAndStop(10 - psd[r]);
}
if (r == 3) {
shot3p.gotoAndStop(10 - psd[r]);
}
psd[r] = psd[r] - 1;
if (psd[r] < 0) {
pst[r] = 0;
psx[r] = -200;
}
}
if (pst[r] == 5) {
if (r == 1) {
shot1p.gotoAndStop(14 - psd[r]);
}
if (r == 2) {
shot2p.gotoAndStop(14 - psd[r]);
}
if (r == 3) {
shot3p.gotoAndStop(14 - psd[r]);
}
psd[r] = psd[r] - 1;
if (psd[r] < 0) {
pst[r] = 0;
psx[r] = -200;
}
}
r++;
}
while (c <= 8) {
r = 1;
while (r <= 3) {
if ((pst[r] > 0) and (pst[r] < 4)) {
if (((((bgt[c] == 5) and ((bgx[c] - 40) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 40) > (psx[r] - ((pst[r] * 20) - 20)))) and ((bgy[c] - 20) < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 50) > (psy[r] - ((pst[r] * 20) - 20)))) {
if ((((bgd[c] == 0) or (bgd[c] == 1)) or (bgd[c] == 2)) or (bgd[c] == 3)) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd1.start();
bgd[c] = 4;
bgs[c] = 5;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
if (((((bgt[c] == 7) and ((bgx[c] - 35) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 35) > (psx[r] - ((pst[r] * 20) - 20)))) and ((bgy[c] - 50) < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 20) > (psy[r] - ((pst[r] * 20) - 20)))) {
if (bgd[c] == 0) {
deflect.start();
pst[r] = 5;
psd[r] = 2;
}
if ((bgd[c] == 2) or (bgd[c] == 1)) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd2.start();
bgd[c] = 3;
bgs[c] = 3;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
if (((((bgt[c] == 12) and ((bgx[c] - 25) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 25) > (psx[r] - ((pst[r] * 20) - 20)))) and (bgy[c] < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 50) > (psy[r] - ((pst[r] * 20) - 20)))) {
if ((bgd[c] == 0) or (bgd[c] == 1)) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd2.start();
bgd[c] = 2;
bgs[c] = 3;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
}
r++;
}
c++;
}
r = 1;
while (r <= 8) {
if (((((bgt[r] > 0) and ((bgx[r] - 340) < px)) and ((bgx[r] + 340) > px)) and ((bgy[r] - 180) < py)) and ((bgy[r] + 350) > py)) {
c = 0;
e = 1;
while (e <= 12) {
if (((((bx[e] - 150) < bgx[r]) and ((bx[e] + 150) > bgx[r])) and ((by[e] - 150) < bgy[r])) and ((by[e] + 150) > bgy[r])) {
if (((((bgx[r] + 20) >= (bx[e] - 50)) and ((bgx[r] - 20) <= (bx[e] + 50))) and ((bgy[r] + 45) > (by[e] - 60))) and ((bgy[r] - 10) < (by[e] - 40))) {
c = 1;
}
if (((((bgx[r] + 20) > (bx[e] - 50)) and ((bgx[r] + 20) < bx[e])) and (bgy[r] < (by[e] + 50))) and ((bgy[r] + 20) > (by[e] - 50))) {
bgx[r] = bx[e] - 70;
}
if (((((bgx[r] - 20) < (bx[e] + 50)) and ((bgx[r] + 20) > bx[e])) and (bgy[r] < (by[e] + 50))) and ((bgy[r] + 20) > (by[e] - 50))) {
bgx[r] = bx[e] + 70;
}
if (((((bgx[r] - 5) < (bx[e] + 50)) and ((bgx[r] + 5) > (bx[e] - 50))) and ((bgy[r] - 30) < (by[e] + 50))) and (bgy[r] > (by[e] + 50))) {
bgy[r] = by[e] + 70;
}
if (((((bgx[r] - 2) < (bx[e] + 50)) and ((bgx[r] + 2) > (bx[e] - 50))) and ((bgy[r] + 20) < (by[e] - 50))) and ((bgy[r] + 60) > (by[e] - 50))) {
c = 1;
bgy[r] = by[e] - 105;
}
}
e++;
}
if (c == 0) {
bgy[r] = bgy[r] + 10;
}
if (bgt[r] == 12) {
if (((((((bgx[r] - 20) < (px + 10)) and ((bgx[r] + 20) > (px - 10))) and ((bgy[r] + 40) > py)) and ((bgy[r] - 20) < (py + 50))) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 3;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 3;
}
megah.start();
i = 10;
}
if (bgd[r] == 0) {
if (bgs[r] == 1) {
f[r] = 1;
}
if (bgs[r] == 2) {
f[r] = 2;
}
bgy[r] = bgy[r] - 10;
bgx[r] = bgx[r] + 7;
if ((py - 60) < bgy[r]) {
bgy[r] = bgy[r] - 5;
}
if ((((px - 70) < bgx[r]) and ((px + 70) > bgx[r])) and (py > bgy[r])) {
bgy[r] = bgy[r] + 12;
}
if ((px + 100) < bgx[r]) {
bgd[r] = 1;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgs[r] = 2;
}
}
if (bgd[r] == 1) {
if (bgs[r] == 1) {
f[r] = 3;
}
if (bgs[r] == 2) {
f[r] = 4;
}
bgy[r] = bgy[r] - 10;
bgx[r] = bgx[r] - 7;
if ((py - 60) < bgy[r]) {
bgy[r] = bgy[r] - 5;
}
if ((((px - 70) < bgx[r]) and ((px + 70) > bgx[r])) and (py > bgy[r])) {
bgy[r] = bgy[r] + 12;
}
if ((px - 100) > bgx[r]) {
bgd[r] = 0;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgs[r] = 2;
}
}
if (bgd[r] == 2) {
if (bgs[r] == 4) {
f[r] = 5;
}
if (bgs[r] == 3) {
f[r] = 6;
}
if (bgs[r] == 2) {
f[r] = 7;
}
if (bgs[r] == 1) {
f[r] = 8;
}
bgs[r] = bgs[r] - 1;
bgy[r] = bgy[r] - 10;
if (bgs[r] <= 0) {
bgx[r] = -500;
f[r] = 9;
bgt[r] = 0;
bgs[r] = 0;
}
}
}
if (bgt[r] == 5) {
if (((((((bgx[r] - 20) < (px + 10)) and ((bgx[r] + 20) > (px - 10))) and ((bgy[r] + 80) > (py + 10))) and ((bgy[r] + 30) < (py + 50))) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 3;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 3;
}
megah.start();
i = 10;
}
if (bgd[r] == 0) {
f[r] = 1;
if (px < bgx[r]) {
bgd[r] = 2;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
cannons.start();
bgd[r] = 1;
bgs[r] = 8;
bgst[bsn] = 2;
bgsx[bsn] = bgx[r] - 20;
bgsy[bsn] = bgy[r] + 20;
bgsd[bsn] = 0;
bsn = bsn + 1;
if (bsn > 5) {
bsn = 1;
}
}
}
if (bgd[r] == 2) {
f[r] = 3;
if (px > bgx[r]) {
bgd[r] = 0;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
cannons.start();
bgd[r] = 3;
bgs[r] = 7;
bgst[bsn] = 2;
bgsx[bsn] = bgx[r] + 20;
bgsy[bsn] = bgy[r] + 20;
bgsd[bsn] = 1;
bsn = bsn + 1;
if (bsn > 5) {
bsn = 1;
}
}
}
if (bgd[r] == 1) {
f[r] = 2;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 0;
bgs[r] = 10 + random(15);
}
}
if (bgd[r] == 3) {
f[r] = 4;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 2;
bgs[r] = 10 + random(15);
}
}
if (bgd[r] == 4) {
if (bgs[r] == 5) {
f[r] = 5;
}
if (bgs[r] == 4) {
f[r] = 6;
}
if (bgs[r] == 3) {
f[r] = 7;
}
if (bgs[r] == 2) {
f[r] = 8;
}
if (bgs[r] == 1) {
f[r] = 9;
}
bgs[r] = bgs[r] - 1;
bgy[r] = bgy[r] - 10;
if (bgs[r] <= 0) {
f[r] = 10;
bgt[r] = 0;
bgx[r] = -500;
bgs[r] = 0;
}
}
}
if (bgt[r] == 7) {
if (((((((bgx[r] - 20) < (px + 10)) and ((bgx[r] + 20) > (px - 10))) and ((bgy[r] + 20) > (py + 10))) and ((bgy[r] + 20) < (py + 50))) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 3;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 3;
}
megah.start();
i = 10;
}
if (bgd[r] == 0) {
f[r] = 1;
bgy[r] = bgy[r] - 10;
if ((px + 80) < bgx[r]) {
bgx[r] = bgx[r] - 5;
}
if ((px - 80) > bgx[r]) {
bgx[r] = bgx[r] + 5;
}
if ((py - 70) < bgy[r]) {
bgy[r] = bgy[r] - 5;
}
if ((py - 70) > bgy[r]) {
bgy[r] = bgy[r] + 5;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
joes.start();
if (px > bgx[r]) {
bgd[r] = 1;
}
if (px < bgx[r]) {
bgd[r] = 2;
}
if (px < bgx[r]) {
bgsd[bsn] = 3;
if ((py - 50) < bgy[r]) {
bgsd[bsn] = 1;
}
}
if (px > bgx[r]) {
bgsd[bsn] = 2;
if ((py - 50) < bgy[r]) {
bgsd[bsn] = 0;
}
}
bgs[r] = 12;
bgst[bsn] = 1;
bgsx[bsn] = bgx[r];
bgsy[bsn] = bgy[r];
bsn = bsn + 1;
if (bsn > 5) {
bsn = 1;
}
}
}
if (bgd[r] == 1) {
f[r] = 2;
bgy[r] = bgy[r] - 10;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 0;
bgs[r] = 10 + random(25);
}
}
if (bgd[r] == 2) {
f[r] = 3;
bgy[r] = bgy[r] - 10;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 0;
bgs[r] = 10 + random(25);
}
}
if (bgd[r] == 3) {
if (bgs[r] == 3) {
f[r] = 4;
}
if (bgs[r] == 2) {
f[r] = 5;
}
if (bgs[r] == 1) {
f[r] = 6;
}
bgs[r] = bgs[r] - 1;
bgy[r] = bgy[r] - 10;
if (bgs[r] <= 0) {
f[r] = 7;
bgt[r] = 0;
bgx[r] = -500;
bgs[r] = 0;
}
}
}
}
r++;
}
r = 1;
while (r <= 5) {
if (bgst[r] > 0) {
if (bgst[r] == 1) {
if (r == 1) {
bgs1.gotoAndStop(1);
}
if (r == 2) {
bgs2.gotoAndStop(1);
}
if (r == 3) {
bgs3.gotoAndStop(1);
}
if (r == 4) {
bgs4.gotoAndStop(1);
}
if (r == 5) {
bgs5.gotoAndStop(1);
}
if (bgsd[r] == 0) {
bgsx[r] = bgsx[r] + 20;
if (bgsx[r] > (px + 300)) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgsd[r] == 1) {
bgsx[r] = bgsx[r] - 20;
if (bgsx[r] < (px - 300)) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgsd[r] == 2) {
bgsx[r] = bgsx[r] + 15;
bgsy[r] = bgsy[r] + 15;
if ((bgsx[r] > (px + 300)) or (bgsy[r] > (py + 300))) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgsd[r] == 3) {
bgsx[r] = bgsx[r] - 15;
bgsy[r] = bgsy[r] + 15;
if ((bgsx[r] > (px + 300)) or (bgsy[r] > (py + 300))) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgsd[r] == 4) {
bgsy[r] = bgsy[r] + 20;
if (bgsy[r] > (py + 300)) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (((((((bgsx[r] - 15) < (px + 10)) and ((bgsx[r] + 15) > (px - 10))) and ((bgsy[r] + 15) > (py + 5))) and ((bgsy[r] - 15) < (py + 20))) and (pcd < 18)) and (i < 1)) {
if ((bgsd[r] == 0) or (bgsd[r] == 2)) {
pcd = 19;
}
if ((bgsd[r] == 1) or (bgsd[r] == 3)) {
pcd = 18;
}
pstep = 2;
pl = pl - 3;
megah.start();
i = 10;
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgst[r] == 2) {
if (r == 1) {
bgs1.gotoAndStop(2);
}
if (r == 2) {
bgs2.gotoAndStop(2);
}
if (r == 3) {
bgs3.gotoAndStop(2);
}
if (r == 4) {
bgs4.gotoAndStop(2);
}
if (r == 5) {
bgs5.gotoAndStop(2);
}
if (bgsd[r] == 0) {
bgsx[r] = bgsx[r] + 30;
if (bgsx[r] > (px + 300)) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgsd[r] == 1) {
bgsx[r] = bgsx[r] - 30;
if (bgsx[r] < (px - 300)) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (((((((bgsx[r] - 25) < (px + 10)) and ((bgsx[r] + 25) > (px - 10))) and ((bgsy[r] + 80) > (py + 40))) and ((bgsy[r] + 35) < (py + 60))) and (pcd < 18)) and (i < 1)) {
if (bgsd[r] == 0) {
pcd = 19;
}
if (bgsd[r] == 1) {
pcd = 18;
}
pstep = 2;
pl = pl - 6;
megah.start();
i = 10;
bgst[r] = 0;
bgsx[r] = -200;
}
}
}
r++;
}
bg1.gotoAndStop(f[1]);
bg2.gotoAndStop(f[2]);
bg3.gotoAndStop(f[3]);
bg4.gotoAndStop(f[4]);
bg5.gotoAndStop(f[5]);
bg6.gotoAndStop(f[6]);
bg7.gotoAndStop(f[7]);
bg8.gotoAndStop(f[8]);
bgs1._x = ((bgsx[1] + 275) - px) / 2;
bgs1._y = ((bgsy[1] + 275) - py) / 2;
bgs2._x = ((bgsx[2] + 275) - px) / 2;
bgs2._y = ((bgsy[2] + 275) - py) / 2;
bgs3._x = ((bgsx[3] + 275) - px) / 2;
bgs3._y = ((bgsy[3] + 275) - py) / 2;
bgs4._x = ((bgsx[4] + 275) - px) / 2;
bgs4._y = ((bgsy[4] + 275) - py) / 2;
bgs5._x = ((bgsx[5] + 275) - px) / 2;
bgs5._y = ((bgsy[5] + 275) - py) / 2;
bg1._x = ((bgx[1] + 275) - px) / 2;
bg1._y = ((bgy[1] + 275) - py) / 2;
bg2._x = ((bgx[2] + 275) - px) / 2;
bg2._y = ((bgy[2] + 275) - py) / 2;
bg3._x = ((bgx[3] + 275) - px) / 2;
bg3._y = ((bgy[3] + 275) - py) / 2;
bg4._x = ((bgx[4] + 275) - px) / 2;
bg4._y = ((bgy[4] + 275) - py) / 2;
bg5._x = ((bgx[5] + 275) - px) / 2;
bg5._y = ((bgy[5] + 275) - py) / 2;
bg6._x = ((bgx[6] + 275) - px) / 2;
bg6._y = ((bgy[6] + 275) - py) / 2;
bg7._x = ((bgx[7] + 275) - px) / 2;
bg7._y = ((bgy[7] + 275) - py) / 2;
bg8._x = ((bgx[8] + 275) - px) / 2;
bg8._y = ((bgy[8] + 275) - py) / 2;
r = 1;
while (r <= 3) {
if (((pst[r] > 0) and (pst[r] < 4)) and (psd[r] == 0)) {
if (r == 1) {
shot1p._x = ((297 + psx[1]) - px) / 2;
shot1p._y = ((270 + psy[1]) - py) / 2;
}
if (r == 2) {
shot2p._x = ((297 + psx[2]) - px) / 2;
shot2p._y = ((270 + psy[2]) - py) / 2;
}
if (r == 3) {
shot3p._x = ((297 + psx[3]) - px) / 2;
shot3p._y = ((270 + psy[3]) - py) / 2;
}
}
if (((pst[r] > 0) and (pst[r] < 4)) and (psd[r] == 1)) {
if (r == 1) {
shot1p._x = ((247 + psx[1]) - px) / 2;
shot1p._y = ((270 + psy[1]) - py) / 2;
}
if (r == 2) {
shot2p._x = ((247 + psx[2]) - px) / 2;
shot2p._y = ((270 + psy[2]) - py) / 2;
}
if (r == 3) {
shot3p._x = ((247 + psx[3]) - px) / 2;
shot3p._y = ((270 + psy[3]) - py) / 2;
}
}
if ((pst[r] == 4) or (pst[r] == 5)) {
if (r == 1) {
shot1p._x = ((272 + psx[1]) - px) / 2;
shot1p._y = ((270 + psy[1]) - py) / 2;
}
if (r == 2) {
shot2p._x = ((272 + psx[2]) - px) / 2;
shot2p._y = ((270 + psy[2]) - py) / 2;
}
if (r == 3) {
shot3p._x = ((272 + psx[3]) - px) / 2;
shot3p._y = ((270 + psy[3]) - py) / 2;
}
}
if (pst[r] == 0) {
if (r == 1) {
shot1p._x = -200;
shot1p._y = (270 + psy[1]) - py;
}
if (r == 2) {
shot2p._x = -200;
shot2p._y = (270 + psy[2]) - py;
}
if (r == 3) {
shot3p._x = -200;
shot3p._y = (270 + psy[3]) - py;
}
}
r++;
}
if (i > 0) {
i = i - 1;
pc._alpha = 50;
}
if (i <= 0) {
i = i - 1;
pc._alpha = 100;
}
if (bcharge > 0) {
charge._alpha = bcharge;
}
lbar._height = 2 * pl;
lbar._y = 120 - (2 * pl);
stage._x = (270 - px) / 2;
stage._y = (75 - py) / 2;
exit._x = ((ex + 275) - px) / 2;
exit._y = ((ey + 275) - py) / 2;
stage2._x = stage2._x - 20;
if (stage2._x < -60) {
stage2._x = 340;
stage2._y = random(180) + 20;
}
Frame 131
gotoAndPlay (130);
if ((((px + 10) > (ex - 20)) and ((px - 10) < (ex + 20))) and (((py + 30) > (ey - 20)) and (py < (ey + 50)))) {
gotoAndPlay (132);
}
Frame 132
lbar._height = 2 * pl;
lbar._y = 120 - (2 * pl);
stage._x = (270 - px) / 2;
stage._y = (75 - py) / 2;
exit._x = ((ex + 275) - px) / 2;
exit._y = ((ey + 275) - py) / 2;
stage2._x = stage2._x - 20;
if (stage2._x < -60) {
stage2._x = 340;
stage2._y = random(180) + 20;
}
Frame 135
psn = 1;
bstep = 0;
pcd = 0;
bcharge = 0;
r = 1;
while (r <= 5) {
psx[r] = -200;
psy[r] = 0;
pst[r] = 0;
psd[r] = 0;
r++;
}
i = 0;
pl = pl + 5;
if (pl > 50) {
pl = 50;
}
px = 150;
py = 350;
r = 0;
while (r <= 31) {
bx[r] = -50;
by[r] = -50;
r++;
}
bx[1] = 50;
by[1] = 150;
bx[2] = 50;
by[2] = 250;
bx[3] = 150;
by[3] = 350;
bx[4] = 250;
by[4] = 350;
bx[5] = 350;
by[5] = 350;
bx[6] = 450;
by[6] = 350;
bx[7] = 550;
by[7] = 350;
bx[8] = 650;
by[8] = 350;
bx[9] = 750;
by[9] = 350;
bx[10] = 850;
by[10] = 350;
bx[11] = 950;
by[11] = 350;
bx[12] = 1050;
by[12] = 350;
bx[13] = 1150;
by[13] = 350;
bx[14] = 1250;
by[14] = 250;
bx[15] = 1150;
by[15] = 150;
bsn = 1;
bi = 0;
r = 1;
while (r <= 8) {
bgx[r] = -200;
bgy[r] = -200;
bgt[r] = 0;
bgd[r] = -1;
bgs[r] = 0;
r++;
}
r = 1;
while (r <= 5) {
bgsx[r] = -200;
bgsy[r] = 0;
bgst[r] = 0;
bgsd[r] = 0;
r++;
}
r = 1;
while (r <= 8) {
f[r] = 20;
r++;
}
bgd[1] = 0;
bgs[1] = 0;
bgl[1] = 50;
bgx[1] = 350;
bgy[1] = 350;
ex = 1150;
ey = 250;
stopAllSounds();
Frame 140
b1._x = bx[1] / 10;
b1._y = (by[1] / 10) + 120;
b2._x = bx[2] / 10;
b2._y = (by[2] / 10) + 120;
b3._x = bx[3] / 10;
b3._y = (by[3] / 10) + 120;
b4._x = bx[4] / 10;
b4._y = (by[4] / 10) + 120;
b5._x = bx[5] / 10;
b5._y = (by[5] / 10) + 120;
b6._x = bx[6] / 10;
b6._y = (by[6] / 10) + 120;
b7._x = bx[7] / 10;
b7._y = (by[7] / 10) + 120;
b8._x = bx[8] / 10;
b8._y = (by[8] / 10) + 120;
b9._x = bx[9] / 10;
b9._y = (by[9] / 10) + 120;
b10._x = bx[10] / 10;
b10._y = (by[10] / 10) + 120;
b11._x = bx[11] / 10;
b11._y = (by[11] / 10) + 120;
b12._x = bx[12] / 10;
b12._y = (by[12] / 10) + 120;
b13._x = bx[13] / 10;
b13._y = (by[13] / 10) + 120;
b14._x = bx[14] / 10;
b14._y = (by[14] / 10) + 120;
b15._x = bx[15] / 10;
b15._y = (by[15] / 10) + 120;
b16._x = bx[16] / 10;
b16._y = (by[16] / 10) + 120;
b17._x = bx[17] / 10;
b17._y = (by[17] / 10) + 120;
b18._x = bx[18] / 10;
b18._y = (by[18] / 10) + 120;
b19._x = bx[19] / 10;
b19._y = (by[19] / 10) + 120;
b20._x = bx[20] / 10;
b20._y = (by[20] / 10) + 120;
b21._x = bx[21] / 10;
b21._y = (by[21] / 10) + 120;
b22._x = bx[22] / 10;
b22._y = (by[22] / 10) + 120;
b23._x = bx[23] / 10;
b23._y = (by[23] / 10) + 120;
b24._x = bx[24] / 10;
b24._y = (by[24] / 10) + 120;
b25._x = bx[25] / 10;
b25._y = (by[25] / 10) + 120;
b26._x = bx[26] / 10;
b26._y = (by[26] / 10) + 120;
b27._x = bx[27] / 10;
b27._y = (by[27] / 10) + 120;
b28._x = bx[28] / 10;
b28._y = (by[28] / 10) + 120;
b29._x = bx[29] / 10;
b29._y = (by[29] / 10) + 120;
b30._x = bx[30] / 10;
b30._y = (by[30] / 10) + 120;
b31._x = bx[31] / 10;
b31._y = (by[31] / 10) + 120;
cir._x = px / 10;
cir._y = (py / 10) + 120;
shot1._x = psx[1] / 10;
shot1._y = (psy[1] / 10) + 120;
shot2._x = psx[2] / 10;
shot2._y = (psy[2] / 10) + 120;
shot3._x = psx[3] / 10;
shot3._y = (psy[3] / 10) + 120;
bshot1._x = bgsx[1] / 10;
bshot1._y = (bgsy[1] / 10) + 120;
bshot2._x = bgsx[2] / 10;
bshot2._y = (bgsy[2] / 10) + 120;
bshot3._x = bgsx[3] / 10;
bshot3._y = (bgsy[3] / 10) + 120;
bshot4._x = bgsx[4] / 10;
bshot4._y = (bgsy[4] / 10) + 120;
bshot5._x = bgsx[5] / 10;
bshot5._y = (bgsy[5] / 10) + 120;
bcir1._x = bgx[1] / 10;
bcir1._y = (bgy[1] / 10) + 120;
bcir2._x = bgx[2] / 10;
bcir2._y = (bgy[2] / 10) + 120;
bcir3._x = bgx[3] / 10;
bcir3._y = (bgy[3] / 10) + 120;
bcir4._x = bgx[4] / 10;
bcir4._y = (bgy[4] / 10) + 120;
bcir5._x = bgx[5] / 10;
bcir5._y = (bgy[5] / 10) + 120;
bcir6._x = bgx[6] / 10;
bcir6._y = (bgy[6] / 10) + 120;
bcir7._x = bgx[7] / 10;
bcir7._y = (bgy[7] / 10) + 120;
bcir8._x = bgx[8] / 10;
bcir8._y = (bgy[8] / 10) + 120;
bcir9._x = bgx[9] / 10;
bcir9._y = (bgy[9] / 10) + 120;
bcir10._x = bgx[10] / 10;
bcir10._y = (bgy[10] / 10) + 120;
bcir11._x = bgx[11] / 10;
bcir11._y = (bgy[11] / 10) + 120;
bcir12._x = bgx[12] / 10;
bcir12._y = (bgy[12] / 10) + 120;
bcir13._x = bgx[13] / 10;
bcir13._y = (bgy[13] / 10) + 120;
if (Key.isDown(39) and (pcd == 0)) {
pcd = 2;
}
if (Key.isDown(39) and ((pcd == 1) or (pcd == 3))) {
pcd = 0;
}
if (Key.isDown(37) and (pcd == 1)) {
pcd = 3;
}
if (Key.isDown(37) and ((pcd == 0) or (pcd == 2))) {
pcd = 1;
}
if (Key.isDown(38) and ((pcd == 0) or (pcd == 2))) {
pcd = 10;
pstep = 7;
}
if (Key.isDown(38) and ((pcd == 1) or (pcd == 3))) {
pcd = 11;
pstep = 7;
}
if (Key.isDown(40) and ((((pcd == 0) or (pcd == 1)) or (pcd == 2)) or (pcd == 3))) {
if (((pcd == 0) or (pcd == 2)) or (pcd == 8)) {
pcd = 6;
pstep = 3;
}
if (((pcd == 1) or (pcd == 3)) or (pcd == 9)) {
pcd = 7;
pstep = 3;
}
}
if (Key.isDown(16) and (bcharge < 100)) {
bcharge = bcharge + 5;
}
if (pcd == 0) {
pc.gotoAndStop(1);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(21);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px + 10;
psy[psn] = py;
psd[psn] = 0;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
}
if (pcd == 1) {
pc.gotoAndStop(2);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(22);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px - 10;
psy[psn] = py;
psd[psn] = 1;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
}
if (pcd == 2) {
px = px + 13;
if ((w == 0) or (w == 1)) {
pc.gotoAndStop(3);
}
if ((w == 2) or (w == 3)) {
pc.gotoAndStop(4);
}
if ((w == 4) or (w == 5)) {
pc.gotoAndStop(5);
}
if ((w == 6) or (w == 7)) {
pc.gotoAndStop(6);
}
if (Key.isDown(32)) {
if ((w == 0) or (w == 1)) {
pc.gotoAndStop(11);
}
if ((w == 2) or (w == 3)) {
pc.gotoAndStop(12);
}
if ((w == 4) or (w == 5)) {
pc.gotoAndStop(13);
}
if ((w == 6) or (w == 7)) {
pc.gotoAndStop(14);
}
if ((pst[psn] == 0) and (bstep == 0)) {
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px + 10;
psy[psn] = py;
psd[psn] = 0;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
}
pcd = 0;
}
if (pcd == 3) {
px = px - 13;
if ((w == 0) or (w == 1)) {
pc.gotoAndStop(7);
}
if ((w == 2) or (w == 3)) {
pc.gotoAndStop(8);
}
if ((w == 4) or (w == 5)) {
pc.gotoAndStop(9);
}
if ((w == 6) or (w == 7)) {
pc.gotoAndStop(10);
}
if (Key.isDown(32)) {
if ((w == 0) or (w == 1)) {
pc.gotoAndStop(15);
}
if ((w == 2) or (w == 3)) {
pc.gotoAndStop(16);
}
if ((w == 4) or (w == 5)) {
pc.gotoAndStop(17);
}
if ((w == 6) or (w == 7)) {
pc.gotoAndStop(18);
}
if ((pst[psn] == 0) and (bstep == 0)) {
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px - 10;
psy[psn] = py;
psd[psn] = 1;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
}
pcd = 1;
}
if (pcd == 9) {
pstep = pstep - 1;
if (pstep <= 0) {
pcd = 1;
}
}
if (pcd == 6) {
pc.gotoAndStop(19);
px = px + 20;
pstep = pstep - 1;
if (pstep <= 0) {
pcd = 0;
}
}
if (pcd == 7) {
pc.gotoAndStop(20);
px = px - 20;
pstep = pstep - 1;
if (pstep <= 0) {
pcd = 1;
}
}
if (pcd == 12) {
pc.gotoAndStop(23);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(25);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px + 10;
psy[psn] = py;
psd[psn] = 0;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
py = py + (5 * (7 - pstep));
pstep = pstep - 1;
if (pstep <= 2) {
pstep = 2;
}
if (Key.isDown(39)) {
px = px + 13;
}
if (Key.isDown(37)) {
px = px - 13;
if (bstep == 0) {
pcd = 13;
}
}
}
if (pcd == 13) {
pc.gotoAndStop(24);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(26);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px - 10;
psy[psn] = py;
psd[psn] = 1;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
py = py + (5 * (7 - pstep));
pstep = pstep - 1;
if (pstep <= 2) {
pstep = 2;
}
if (Key.isDown(39)) {
px = px + 13;
if (bstep == 0) {
pcd = 12;
}
}
if (Key.isDown(37)) {
px = px - 13;
}
}
if (pcd == 10) {
pc.gotoAndStop(23);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(25);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px + 10;
psy[psn] = py;
psd[psn] = 0;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
py = py - (5 * pstep);
pstep = pstep - 1;
if (Key.isDown(39)) {
px = px + 13;
}
if (Key.isDown(37)) {
px = px - 13;
if (bstep == 0) {
pcd = 11;
}
}
if (Key.isDown(40)) {
pcd = 12;
pstep = pstep + 3;
}
if (pstep <= -1) {
pstep = 7;
pcd = 12;
}
}
if (pcd == 11) {
pc.gotoAndStop(24);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(26);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px - 10;
psy[psn] = py;
psd[psn] = 1;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
py = py - (5 * pstep);
pstep = pstep - 1;
if (Key.isDown(39)) {
px = px + 13;
if (bstep == 0) {
pcd = 10;
}
}
if (Key.isDown(37)) {
px = px - 13;
}
if (Key.isDown(40)) {
pcd = 13;
pstep = pstep + 3;
}
if (pstep <= -1) {
pstep = 7;
pcd = 13;
}
}
if (pcd == 18) {
pc.gotoAndStop(27);
pstep = pstep - 1;
px = px - 5;
if (pstep <= -1) {
pstep = 2;
pcd = 0;
}
}
if (pcd == 19) {
pc.gotoAndStop(28);
pstep = pstep - 1;
px = px + 5;
if (pstep <= -1) {
pstep = 2;
pcd = 1;
}
}
if (pcd == 20) {
pc.gotoAndStop(69 - pstep);
bcharge = 0;
bstep = 20;
pl = 1;
pstep = pstep - 1;
if (pstep < 0) {
lives = lives - 1;
if (lives >= 0) {
pl = 50;
gotoAndPlay (135);
}
if (lives < 0) {
lives = 2;
continues = continues - 1;
gotoAndPlay (5);
}
}
}
if (pcd == 21) {
pc.gotoAndStop(77 - pstep);
charge._alpha = 0;
bcharge = 0;
bstep = 20;
pstep = pstep - 1;
if (pstep < 0) {
pstep = 0;
}
}
if (pl <= 0) {
pc._alpha = 100;
pcd = 20;
pstep = 40;
megad.start();
}
if (bstep > 0) {
bcharge = 0;
charge._alpha = bcharge;
}
if (bstep > 0) {
bstep = bstep - 1;
}
if (py > 350) {
py = 350;
if ((((pcd == 12) or (pcd == 13)) or (pcd == 16)) or (pcd == 17)) {
if ((pcd == 12) or (pcd == 16)) {
pcd = 0;
}
if ((pcd == 13) or (pcd == 17)) {
pcd = 1;
}
}
}
if ((pcd == 18) and (py < 350)) {
pcd = 12;
pstep = 5;
}
if ((pcd == 19) and (py < 350)) {
pcd = 13;
pstep = 5;
}
if (px < 25) {
px = 25;
}
if (px > 525) {
px = 525;
}
w = w - 1;
if (w < 0) {
w = 7;
}
e = pcd;
r = 1;
while (r <= 3) {
if (pst[r] == 1) {
if (psd[r] == 0) {
psx[r] = psx[r] + 30;
if (r == 1) {
shot1p.gotoAndStop(1);
}
if (r == 2) {
shot2p.gotoAndStop(1);
}
if (r == 3) {
shot3p.gotoAndStop(1);
}
if (psx[r] > 580) {
pst[r] = 0;
psx[r] = -200;
}
}
if (psd[r] == 1) {
psx[r] = psx[r] - 30;
if (r == 1) {
shot1p.gotoAndStop(2);
}
if (r == 2) {
shot2p.gotoAndStop(2);
}
if (r == 3) {
shot3p.gotoAndStop(2);
}
if (psx[r] < -30) {
pst[r] = 0;
psx[r] = -200;
}
}
}
if (pst[r] == 2) {
if (psd[r] == 0) {
psx[r] = psx[r] + 35;
if (r == 1) {
shot1p.gotoAndStop(3);
}
if (r == 2) {
shot2p.gotoAndStop(3);
}
if (r == 3) {
shot3p.gotoAndStop(3);
}
if (psx[r] > 600) {
pst[r] = 0;
psx[r] = -200;
}
}
if (psd[r] == 1) {
psx[r] = psx[r] - 35;
if (r == 1) {
shot1p.gotoAndStop(4);
}
if (r == 2) {
shot2p.gotoAndStop(4);
}
if (r == 3) {
shot3p.gotoAndStop(4);
}
if (psx[r] < -50) {
pst[r] = 0;
psx[r] = -200;
}
}
}
if (pst[r] == 3) {
if (psd[r] == 0) {
psx[r] = psx[r] + 40;
if (r == 1) {
shot1p.gotoAndStop(5);
}
if (r == 2) {
shot2p.gotoAndStop(5);
}
if (r == 3) {
shot3p.gotoAndStop(5);
}
if (psx[r] > 630) {
pst[r] = 0;
psx[r] = -200;
}
}
if (psd[r] == 1) {
psx[r] = psx[r] - 40;
if (r == 1) {
shot1p.gotoAndStop(6);
}
if (r == 2) {
shot2p.gotoAndStop(6);
}
if (r == 3) {
shot3p.gotoAndStop(6);
}
if (psx[r] < -80) {
pst[r] = 0;
psx[r] = -200;
}
}
}
if (pst[r] == 4) {
if (r == 1) {
shot1p.gotoAndStop(10 - psd[r]);
}
if (r == 2) {
shot2p.gotoAndStop(10 - psd[r]);
}
if (r == 3) {
shot3p.gotoAndStop(10 - psd[r]);
}
psd[r] = psd[r] - 1;
if (psd[r] < 0) {
pst[r] = 0;
psx[r] = -200;
}
}
if (pst[r] == 5) {
if (r == 1) {
shot1p.gotoAndStop(14 - psd[r]);
}
if (r == 2) {
shot2p.gotoAndStop(14 - psd[r]);
}
if (r == 3) {
shot3p.gotoAndStop(14 - psd[r]);
}
psd[r] = psd[r] - 1;
if (psd[r] < 0) {
pst[r] = 0;
psx[r] = -200;
}
}
r++;
}
r = 1;
while (r <= 3) {
if ((pst[r] > 0) and (pst[r] < 4)) {
if (((((((bgx[1] - 22) < (psx[r] + ((pst[r] * 20) - 20))) and ((bgx[1] + 22) > (psx[r] - ((pst[r] * 20) - 20)))) and ((bgy[1] - 35) < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[1] + 35) > (psy[r] - ((pst[r] * 20) - 20)))) and (bi < 1)) and (bgl[1] > 0)) {
if (bgd[1] > 5) {
deflect.start();
pst[r] = 5;
psd[r] = 2;
}
if (bgd[1] < 6) {
megash.start();
bgl[1] = bgl[1] - pst[r];
bi = 12;
if (bgl[1] < 1) {
bi = 0;
baddyd2.start();
bgd[1] = 14;
bgs[1] = 10;
pcd = 21;
pstep = 7;
}
if ((bgl[1] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
}
r++;
}
if (bgd[1] == 0) {
boss.gotoAndStop(1);
if (px < bgx[1]) {
bgd[1] = 1;
}
c = random(140 - (3 * dif));
if (c < 6) {
machineg.start();
bgd[1] = 2;
bgs[1] = 8;
}
if ((c > 10) and (c < 16)) {
cannons.start();
bgd[1] = 4;
bgs[1] = 8;
}
if ((c > 20) and (c < 25)) {
jetpass.start();
bgd[1] = 6;
bgs[1] = 12;
}
}
if (bgd[1] == 1) {
boss.gotoAndStop(6);
if (px > bgx[1]) {
bgd[1] = 0;
}
c = random(140 - (3 * dif));
if (c < 6) {
machineg.start();
bgd[1] = 3;
bgs[1] = 8;
}
if ((c > 10) and (c < 16)) {
cannons.start();
bgd[1] = 5;
bgs[1] = 8;
}
if ((c > 20) and (c < 25)) {
jetpass.start();
bgd[1] = 7;
bgs[1] = 12;
}
}
if (bgd[1] == 2) {
boss.gotoAndStop(3);
bgs[1] = bgs[1] - 1;
if (bgs[1] <= 0) {
bgd[1] = 0;
bgst[bsn] = 1;
bgsx[bsn] = bgx[1] + 20;
bgsy[bsn] = bgy[1] + 20;
bgsd[bsn] = 0;
bsn = bsn + 1;
if (bsn > 5) {
bsn = 1;
}
}
}
if (bgd[1] == 3) {
boss.gotoAndStop(8);
bgs[1] = bgs[1] - 1;
if (bgs[1] <= 0) {
bgd[1] = 1;
bgst[bsn] = 1;
bgsx[bsn] = bgx[1] - 20;
bgsy[bsn] = bgy[1] + 20;
bgsd[bsn] = 1;
bsn = bsn + 1;
if (bsn > 5) {
bsn = 1;
}
}
}
if (bgd[1] == 4) {
boss.gotoAndStop(3);
bgs[1] = bgs[1] - 1;
if (bgs[1] <= 0) {
bgd[1] = 0;
bgst[bsn] = 2;
bgsx[bsn] = bgx[1] + 40;
bgsy[bsn] = bgy[1] + 20;
bgsd[bsn] = 0;
bsn = bsn + 1;
if (bsn > 5) {
bsn = 1;
}
}
}
if (bgd[1] == 5) {
boss.gotoAndStop(8);
bgs[1] = bgs[1] - 1;
if (bgs[1] <= 0) {
bgd[1] = 1;
bgst[bsn] = 2;
bgsx[bsn] = bgx[1] - 40;
bgsy[bsn] = bgy[1] + 20;
bgsd[bsn] = 1;
bsn = bsn + 1;
if (bsn > 5) {
bsn = 1;
}
}
}
if (bgd[1] == 6) {
boss.gotoAndStop(2);
bgy[1] = bgy[1] - 40;
if (bgy[1] < -50) {
c = random(40);
if ((c >= 0) and (c < 10)) {
jetpass.start();
bgd[1] = 8;
bgs[1] = 25;
bgx[1] = -50;
bgy[1] = 350 - random(80);
}
if ((c >= 10) and (c < 20)) {
jetpass.start();
bgd[1] = 9;
bgs[1] = 25;
bgx[1] = 600;
bgy[1] = 350 - random(80);
}
if (c >= 20) {
bgd[1] = 10;
bgs[1] = 20 + random(20 + Dif);
bgx[1] = 275;
bgy[1] = -200;
}
}
}
if (bgd[1] == 7) {
boss.gotoAndStop(7);
bgy[1] = bgy[1] - 40;
bgs[1] = bgs[1] - 1;
if (bgy[1] < -50) {
c = random(40);
if ((c >= 0) and (c < 10)) {
jetpass.start();
bgd[1] = 8;
bgs[1] = 25;
bgx[1] = -50;
bgy[1] = 350 - random(80);
}
if ((c >= 10) and (c < 20)) {
jetpass.start();
bgd[1] = 9;
bgs[1] = 25;
bgx[1] = 600;
bgy[1] = 350 - random(80);
}
if (c >= 20) {
bgd[1] = 10;
bgs[1] = 10 + random(10 + Dif);
bgx[1] = 275;
bgy[1] = -200;
}
}
}
if (bgd[1] == 8) {
boss.gotoAndStop(4 + random(2));
bgx[1] = bgx[1] + 15;
bgs[1] = bgs[1] - 1;
if (bgx[1] > 600) {
bgd[1] = 11;
bgx[1] = random(450) + 50;
bgy[1] = -100;
}
if (((bgs[1] == 22) or (bgs[1] == 15)) or (bgs[1] == 8)) {
c = 1 + random(2);
if (c == 1) {
machineg.start();
}
if (c == 2) {
cannons.start();
}
bgst[bsn] = c;
bgsx[bsn] = bgx[1] + 20;
bgsy[bsn] = bgy[1] + 40;
bgsd[bsn] = 0;
bsn = bsn + 1;
if (bsn > 5) {
bsn = 1;
}
}
}
if (bgd[1] == 9) {
boss.gotoAndStop(9 + random(2));
bgx[1] = bgx[1] - 15;
bgs[1] = bgs[1] - 1;
if (bgx[1] < -50) {
bgd[1] = 11;
bgx[1] = random(450) + 50;
bgy[1] = -100;
}
if (((bgs[1] == 22) or (bgs[1] == 15)) or (bgs[1] == 8)) {
c = 1 + random(2);
if (c == 1) {
machineg.start();
}
if (c == 2) {
cannons.start();
}
bgst[bsn] = c;
bgsx[bsn] = bgx[1] + 20;
bgsy[bsn] = bgy[1] + 40;
bgsd[bsn] = 1;
bsn = bsn + 1;
if (bsn > 5) {
bsn = 1;
}
}
}
if (bgd[1] == 10) {
boss.gotoAndStop(1);
bgs[1] = bgs[1] - 1;
if (bgs[1] < 0) {
bgd[1] = 11;
bgx[1] = random(450) + 50;
bgy[1] = -100;
}
if ((((((bgs[1] == 0) or (bgs[1] == 7)) or (bgs[1] == 15)) or (bgs[1] == 23)) or (bgs[1] == 31)) or (bgs[1] == 37)) {
cannons.start();
bgst[bsn] = 3;
bgsx[bsn] = (px - 60) + random(120);
bgsy[bsn] = -50;
bgsd[bsn] = 0;
bsn = bsn + 1;
if (bsn > 5) {
bsn = 1;
}
}
}
if (bgd[1] == 11) {
boss.gotoAndStop(2);
bgy[1] = bgy[1] + 40;
if (bgy[1] > 350) {
bgd[1] = random(2);
bgy[1] = 350;
}
}
if (bgd[1] == 14) {
boss.gotoAndStop(10);
if ((bgs[1] == 0) or (bgs[1] == 1)) {
boss.gotoAndStop(16);
}
if ((bgs[1] == 2) or (bgs[1] == 3)) {
boss.gotoAndStop(15);
}
if ((bgs[1] == 4) or (bgs[1] == 5)) {
boss.gotoAndStop(14);
}
if ((bgs[1] == 6) or (bgs[1] == 7)) {
boss.gotoAndStop(13);
}
if ((bgs[1] == 8) or (bgs[1] == 9)) {
boss.gotoAndStop(12);
}
if (bgs[1] == 10) {
boss.gotoAndStop(11);
}
bgs[1] = bgs[1] - 1;
if (bgs[1] < 0) {
gotoAndPlay (142);
}
}
r = 1;
while (r <= 5) {
if (bgst[r] > 0) {
if (bgst[r] == 1) {
if (bgsd[r] == 0) {
if (r == 1) {
bgs1.gotoAndStop(1);
}
if (r == 2) {
bgs2.gotoAndStop(1);
}
if (r == 3) {
bgs3.gotoAndStop(1);
}
if (r == 4) {
bgs4.gotoAndStop(1);
}
if (r == 5) {
bgs5.gotoAndStop(1);
}
bgsx[r] = bgsx[r] + 30;
if (bgsx[r] > 580) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgsd[r] == 1) {
if (r == 1) {
bgs1.gotoAndStop(2);
}
if (r == 2) {
bgs2.gotoAndStop(2);
}
if (r == 3) {
bgs3.gotoAndStop(2);
}
if (r == 4) {
bgs4.gotoAndStop(2);
}
if (r == 5) {
bgs5.gotoAndStop(2);
}
bgsx[r] = bgsx[r] - 30;
if (bgsx[r] < -30) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if ((((((((bgsx[r] - 30) < (px + 10)) and ((bgsx[r] + 30) > (px - 10))) and ((bgsy[r] + 25) > (py + 5))) and ((bgsy[r] - 25) < (py + 20))) and (pcd < 18)) and (i < 1)) and (pl > 0)) {
if ((bgsd[r] == 0) or (bgsd[r] == 2)) {
pcd = 19;
}
if ((bgsd[r] == 1) or (bgsd[r] == 3)) {
pcd = 18;
}
pstep = 2;
pl = pl - 2;
megah.start();
i = 10;
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgst[r] == 2) {
if (bgsd[r] == 0) {
if (r == 1) {
bgs1.gotoAndStop(3 + random(2));
}
if (r == 2) {
bgs2.gotoAndStop(3 + random(2));
}
if (r == 3) {
bgs3.gotoAndStop(3 + random(2));
}
if (r == 4) {
bgs4.gotoAndStop(3 + random(2));
}
if (r == 5) {
bgs5.gotoAndStop(3 + random(2));
}
bgsx[r] = bgsx[r] + 20;
if ((py + 20) < bgsy[r]) {
bgsy[r] = bgsy[r] - 3;
}
if ((py + 20) > bgsy[r]) {
bgsy[r] = bgsy[r] + 3;
}
if (bgsx[r] > 580) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgsd[r] == 1) {
if (r == 1) {
bgs1.gotoAndStop(5 + random(2));
}
if (r == 2) {
bgs2.gotoAndStop(5 + random(2));
}
if (r == 3) {
bgs3.gotoAndStop(5 + random(2));
}
if (r == 4) {
bgs4.gotoAndStop(5 + random(2));
}
if (r == 5) {
bgs5.gotoAndStop(5 + random(2));
}
bgsx[r] = bgsx[r] - 20;
if ((py + 20) < bgsy[r]) {
bgsy[r] = bgsy[r] - 3;
}
if ((py + 20) > bgsy[r]) {
bgsy[r] = bgsy[r] + 3;
}
if (bgsx[r] < -30) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if ((((((((bgsx[r] - 30) < (px + 10)) and ((bgsx[r] + 30) > (px - 10))) and ((bgsy[r] + 25) > (py + 5))) and ((bgsy[r] - 25) < (py + 20))) and (pcd < 18)) and (i < 1)) and (pl > 0)) {
if ((bgsd[r] == 0) or (bgsd[r] == 2)) {
pcd = 19;
}
if ((bgsd[r] == 1) or (bgsd[r] == 3)) {
pcd = 18;
}
pstep = 2;
pl = pl - 4;
megah.start();
i = 10;
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgst[r] == 3) {
if (bgsd[r] == 0) {
if (r == 1) {
bgs1.gotoAndStop(11 + random(2));
}
if (r == 2) {
bgs2.gotoAndStop(11 + random(2));
}
if (r == 3) {
bgs3.gotoAndStop(11 + random(2));
}
if (r == 4) {
bgs4.gotoAndStop(11 + random(2));
}
if (r == 5) {
bgs5.gotoAndStop(11 + random(2));
}
bgsy[r] = bgsy[r] + 30;
if (bgsy[r] > 340) {
baddyd2.start();
bgst[r] = 4;
bgsd[r] = 0;
}
}
if ((((((((bgsx[r] - 12) < (px + 10)) and ((bgsx[r] + 12) > (px - 10))) and ((bgsy[r] + 35) > (py + 5))) and ((bgsy[r] - 35) < (py + 20))) and (pcd < 18)) and (i < 1)) and (pl > 0)) {
if ((bgsd[r] == 0) or (bgsd[r] == 2)) {
pcd = 19;
}
if ((bgsd[r] == 1) or (bgsd[r] == 3)) {
pcd = 18;
}
pstep = 2;
pl = pl - 3;
megah.start();
i = 10;
bgst[r] = 4;
bgsd[r] = 0;
}
}
if (bgst[r] == 4) {
if (bgsd[r] >= 0) {
if (r == 1) {
bgs1.gotoAndStop(7 + bgsd[r]);
}
if (r == 2) {
bgs2.gotoAndStop(7 + bgsd[r]);
}
if (r == 3) {
bgs3.gotoAndStop(7 + bgsd[r]);
}
if (r == 4) {
bgs4.gotoAndStop(7 + bgsd[r]);
}
if (r == 5) {
bgs5.gotoAndStop(7 + bgsd[r]);
}
bgsd[r] = bgsd[r] + 1;
if (bgsd[r] > 3) {
bgst[r] = 0;
bgsd[r] = 0;
bgsx[r] = -500;
bgsy[r] = 0;
}
}
if (((((((((bgsx[r] - 20) - (3 * bgsd[r])) < (px + 10)) and (((bgsx[r] + 20) + (3 * bgsd[r])) > (px - 10))) and ((bgsy[r] + 50) > (py + 5))) and (((bgsy[r] - 10) - (5 * bgsd[r])) < (py + 20))) and (pcd < 18)) and (i < 1)) and (pl > 0)) {
pcd = 18 + random(2);
pstep = 2;
pl = pl - 5;
megah.start();
i = 10;
}
}
}
r++;
}
if ((((((((bgx[1] - 20) < (px + 10)) and ((bgx[1] + 20) > (px - 10))) and ((bgy[1] + 60) > (py + 10))) and ((bgy[1] + 20) < (py + 50))) and (pcd < 18)) and (i < 1)) and (pl > 0)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
}
if (bgx[r] > px) {
pcd = 18;
}
pl = pl - 4;
megah.start();
i = 10;
}
if (bgy[1] > 350) {
bgy[1] = 350;
}
bgs1._x = bgsx[1] / 2;
bgs1._y = (bgsy[1] / 2) - 20;
bgs2._x = bgsx[2] / 2;
bgs2._y = (bgsy[2] / 2) - 20;
bgs3._x = bgsx[3] / 2;
bgs3._y = (bgsy[3] / 2) - 20;
bgs4._x = bgsx[4] / 2;
bgs4._y = (bgsy[4] / 2) - 20;
bgs5._x = bgsx[5] / 2;
bgs5._y = (bgsy[5] / 2) - 20;
r = 1;
while (r <= 3) {
if (((pst[r] > 0) and (pst[r] < 4)) and (psd[r] == 0)) {
if (r == 1) {
shot1p._x = psx[1] / 2;
shot1p._y = psy[1] / 2;
}
if (r == 2) {
shot2p._x = psx[2] / 2;
shot2p._y = psy[2] / 2;
}
if (r == 3) {
shot3p._x = psx[3] / 2;
shot3p._y = psy[3] / 2;
}
}
if (((pst[r] > 0) and (pst[r] < 4)) and (psd[r] == 1)) {
if (r == 1) {
shot1p._x = psx[1] / 2;
shot1p._y = psy[1] / 2;
}
if (r == 2) {
shot2p._x = psx[2] / 2;
shot2p._y = psy[2] / 2;
}
if (r == 3) {
shot3p._x = psx[3] / 2;
shot3p._y = psy[3] / 2;
}
}
if ((pst[r] == 4) or (pst[r] == 5)) {
if (r == 1) {
shot1p._x = psx[1] / 2;
shot1p._y = psy[1] / 2;
}
if (r == 2) {
shot2p._x = psx[2] / 2;
shot2p._y = psy[2] / 2;
}
if (r == 3) {
shot3p._x = psx[3] / 2;
shot3p._y = psy[3] / 2;
}
}
if (pst[r] == 0) {
if (r == 1) {
shot1p._x = -200;
shot1p._y = (270 + psy[1]) - py;
}
if (r == 2) {
shot2p._x = -200;
shot2p._y = (270 + psy[2]) - py;
}
if (r == 3) {
shot3p._x = -200;
shot3p._y = (270 + psy[3]) - py;
}
}
r++;
}
if (i > 0) {
i = i - 1;
pc._alpha = 50;
}
if (i <= 0) {
i = i - 1;
pc._alpha = 100;
}
if (bi > 0) {
bi = bi - 1;
boss._alpha = 50;
}
if (bi <= 0) {
boss._alpha = 100;
}
if (bcharge > 0) {
charge._alpha = bcharge;
}
charge._x = px / 2;
charge._y = py / 2;
boss._x = bgx[1] / 2;
boss._y = (bgy[1] / 2) - 11;
pc._x = px / 2;
pc._y = py / 2;
lbar._height = 2 * pl;
lbar._y = 120 - (2 * pl);
bbar._height = 2 * bgl[1];
bbar._y = 120 - (2 * bgl[1]);
stage2._x = stage2._x - 20;
if (stage2._x < -60) {
stage2._x = 340;
stage2._y = random(180) + 20;
}
Frame 141
gotoAndPlay (140);
Frame 142
lbar._height = 2 * pl;
lbar._y = 120 - (2 * pl);
stage._x = (270 - px) / 2;
stage._y = (-725 - py) / 2;
exit._x = ((ex + 275) - px) / 2;
exit._y = ((ey + 275) - py) / 2;
stage2._x = stage2._x - 20;
if (stage2._x < -60) {
stage2._x = 340;
stage2._y = random(180) + 20;
}
Frame 144
gotoAndPlay (5);
Frame 145
psn = 1;
bstep = 0;
pcd = 0;
bcharge = 0;
r = 1;
while (r <= 5) {
psx[r] = -200;
psy[r] = 0;
pst[r] = 0;
psd[r] = 0;
r++;
}
i = 0;
pl = 50;
px = 150;
py = 370;
r = 0;
while (r <= 26) {
bx[r] = -50;
by[r] = -50;
r++;
}
bx[1] = 50;
by[1] = 250;
bx[2] = 50;
by[2] = 350;
bx[3] = 150;
by[3] = 450;
bx[4] = 250;
by[4] = 450;
bx[5] = 350;
by[5] = 450;
bx[6] = 450;
by[6] = 450;
bx[7] = 550;
by[7] = 450;
bx[8] = 550;
by[8] = 250;
bx[9] = 800;
by[9] = 250;
bx[10] = 800;
by[10] = 450;
bx[11] = 900;
by[11] = 450;
bx[12] = 1000;
by[12] = 450;
bx[13] = 1100;
by[13] = 450;
bx[14] = 1100;
by[14] = 250;
bx[15] = 1400;
by[15] = 450;
bx[16] = 1500;
by[16] = 450;
bx[17] = 1600;
by[17] = 450;
bx[18] = 1700;
by[18] = 450;
bx[19] = 1950;
by[19] = 450;
bx[20] = 2050;
by[20] = 450;
bx[21] = 2150;
by[21] = 350;
bx[22] = 2150;
by[22] = 250;
bsn = 1;
r = 1;
while (r <= 8) {
bgx[r] = -200;
bgy[r] = -200;
bgt[r] = 0;
bgd[r] = -1;
bgs[r] = 0;
r++;
}
r = 1;
while (r <= 5) {
bgsx[r] = -200;
bgsy[r] = 0;
bgst[r] = 0;
bgsd[r] = 0;
r++;
}
r = 1;
while (r <= 8) {
f[r] = 20;
r++;
}
bgt[1] = 2;
bgd[1] = 0;
bgs[1] = 0;
bgl[1] = 3;
bgx[1] = 400;
bgy[1] = 350;
bgt[2] = 5;
bgd[2] = 0;
bgs[2] = 0;
bgl[2] = 6;
bgx[2] = 800;
bgy[2] = 350;
bgt[3] = 2;
bgd[3] = 0;
bgs[3] = 0;
bgl[3] = 3;
bgx[3] = 1050;
bgy[3] = 350;
bgt[4] = 10;
bgd[4] = 0;
bgs[4] = 0;
bgl[4] = 3;
bgx[4] = 1450;
bgy[4] = 150;
bgt[5] = 11;
bgd[5] = 0;
bgs[5] = 0;
bgl[5] = 6;
bgx[5] = 1550;
bgy[5] = 350;
bgt[6] = 2;
bgd[6] = 0;
bgs[6] = 0;
bgl[6] = 3;
bgx[6] = 1550;
bgy[6] = 350;
bgt[7] = 11;
bgd[7] = 0;
bgs[7] = 0;
bgl[7] = 6;
bgx[7] = 1650;
bgy[7] = 350;
bgt[8] = 5;
bgd[8] = 0;
bgs[8] = 0;
bgl[8] = 6;
bgx[8] = 1950;
bgy[8] = 350;
ex = 2050;
ey = 350;
stopAllSounds();
Frame 146
pc.gotoAndStop(1);
bg1.gotoAndStop(20);
bg2.gotoAndStop(20);
bg3.gotoAndStop(20);
bg4.gotoAndStop(20);
bg5.gotoAndStop(20);
bg6.gotoAndStop(20);
bg7.gotoAndStop(20);
bg8.gotoAndStop(20);
bgs1.gotoAndStop(20);
bgs2.gotoAndStop(20);
bgs3.gotoAndStop(20);
bgs4.gotoAndStop(20);
bgs5.gotoAndStop(20);
shot1.gotoAndStop(20);
shot2.gotoAndStop(20);
shot3.gotoAndStop(20);
bg1._x = ((bgx[1] + 275) - px) / 2;
bg1._y = ((bgy[1] + 275) - py) / 2;
bg2._x = ((bgx[2] + 275) - px) / 2;
bg2._y = ((bgy[2] + 275) - py) / 2;
bg3._x = ((bgx[3] + 275) - px) / 2;
bg3._y = ((bgy[3] + 275) - py) / 2;
bg4._x = ((bgx[4] + 275) - px) / 2;
bg4._y = ((bgy[4] + 275) - py) / 2;
bg5._x = ((bgx[5] + 275) - px) / 2;
bg5._y = ((bgy[5] + 275) - py) / 2;
bg6._x = ((bgx[6] + 275) - px) / 2;
bg6._y = ((bgy[6] + 275) - py) / 2;
bg7._x = ((bgx[7] + 275) - px) / 2;
bg7._y = ((bgy[7] + 275) - py) / 2;
bg8._x = ((bgx[8] + 275) - px) / 2;
bg8._y = ((bgy[8] + 275) - py) / 2;
lbar._height = 2 * pl;
lbar._y = 120 - (2 * pl);
stage._x = (275 - px) / 2;
stage._y = (375 - py) / 2;
exit._x = ((ex + 275) - px) / 2;
exit._y = ((ey + 275) - py) / 2;
Frame 157
b1._x = bx[1] / 10;
b1._y = (by[1] / 10) + 120;
b2._x = bx[2] / 10;
b2._y = (by[2] / 10) + 120;
b3._x = bx[3] / 10;
b3._y = (by[3] / 10) + 120;
b4._x = bx[4] / 10;
b4._y = (by[4] / 10) + 120;
b5._x = bx[5] / 10;
b5._y = (by[5] / 10) + 120;
b6._x = bx[6] / 10;
b6._y = (by[6] / 10) + 120;
b7._x = bx[7] / 10;
b7._y = (by[7] / 10) + 120;
b8._x = bx[8] / 10;
b8._y = (by[8] / 10) + 120;
b9._x = bx[9] / 10;
b9._y = (by[9] / 10) + 120;
b10._x = bx[10] / 10;
b10._y = (by[10] / 10) + 120;
b11._x = bx[11] / 10;
b11._y = (by[11] / 10) + 120;
b12._x = bx[12] / 10;
b12._y = (by[12] / 10) + 120;
b13._x = bx[13] / 10;
b13._y = (by[13] / 10) + 120;
b14._x = bx[14] / 10;
b14._y = (by[14] / 10) + 120;
b15._x = bx[15] / 10;
b15._y = (by[15] / 10) + 120;
b16._x = bx[16] / 10;
b16._y = (by[16] / 10) + 120;
b17._x = bx[17] / 10;
b17._y = (by[17] / 10) + 120;
b18._x = bx[18] / 10;
b18._y = (by[18] / 10) + 120;
b19._x = bx[19] / 10;
b19._y = (by[19] / 10) + 120;
b20._x = bx[20] / 10;
b20._y = (by[20] / 10) + 120;
b21._x = bx[21] / 10;
b21._y = (by[21] / 10) + 120;
b22._x = bx[22] / 10;
b22._y = (by[22] / 10) + 120;
b23._x = bx[23] / 10;
b23._y = (by[23] / 10) + 120;
b24._x = bx[24] / 10;
b24._y = (by[24] / 10) + 120;
b25._x = bx[25] / 10;
b25._y = (by[25] / 10) + 120;
b26._x = bx[26] / 10;
b26._y = (by[26] / 10) + 120;
b27._x = bx[27] / 10;
b27._y = (by[27] / 10) + 120;
b28._x = bx[28] / 10;
b28._y = (by[28] / 10) + 120;
cir._x = px / 10;
cir._y = (py / 10) + 120;
shot1._x = psx[1] / 10;
shot1._y = (psy[1] / 10) + 120;
shot2._x = psx[2] / 10;
shot2._y = (psy[2] / 10) + 120;
shot3._x = psx[3] / 10;
shot3._y = (psy[3] / 10) + 120;
bshot1._x = bgsx[1] / 10;
bshot1._y = (bgsy[1] / 10) + 120;
bshot2._x = bgsx[2] / 10;
bshot2._y = (bgsy[2] / 10) + 120;
bshot3._x = bgsx[3] / 10;
bshot3._y = (bgsy[3] / 10) + 120;
bshot4._x = bgsx[4] / 10;
bshot4._y = (bgsy[4] / 10) + 120;
bshot5._x = bgsx[5] / 10;
bshot5._y = (bgsy[5] / 10) + 120;
bcir1._x = bgx[1] / 10;
bcir1._y = (bgy[1] / 10) + 120;
bcir2._x = bgx[2] / 10;
bcir2._y = (bgy[2] / 10) + 120;
bcir3._x = bgx[3] / 10;
bcir3._y = (bgy[3] / 10) + 120;
bcir4._x = bgx[4] / 10;
bcir4._y = (bgy[4] / 10) + 120;
bcir5._x = bgx[5] / 10;
bcir5._y = (bgy[5] / 10) + 120;
bcir6._x = bgx[6] / 10;
bcir6._y = (bgy[6] / 10) + 120;
bcir7._x = bgx[7] / 10;
bcir7._y = (bgy[7] / 10) + 120;
bcir8._x = bgx[8] / 10;
bcir8._y = (bgy[8] / 10) + 120;
bcir9._x = bgx[9] / 10;
bcir9._y = (bgy[9] / 10) + 120;
bcir10._x = bgx[10] / 10;
bcir10._y = (bgy[10] / 10) + 120;
bcir11._x = bgx[11] / 10;
bcir11._y = (bgy[11] / 10) + 120;
bcir12._x = bgx[12] / 10;
bcir12._y = (bgy[12] / 10) + 120;
bcir13._x = bgx[13] / 10;
bcir13._y = (bgy[13] / 10) + 120;
if (Key.isDown(39) and (pcd == 0)) {
pcd = 2;
}
if (Key.isDown(39) and ((pcd == 1) or (pcd == 3))) {
pcd = 0;
}
if (Key.isDown(37) and (pcd == 1)) {
pcd = 3;
}
if (Key.isDown(37) and ((pcd == 0) or (pcd == 2))) {
pcd = 1;
}
if (Key.isDown(38) and ((pcd == 0) or (pcd == 2))) {
pcd = 10;
pstep = 7;
}
if (Key.isDown(38) and ((pcd == 1) or (pcd == 3))) {
pcd = 11;
pstep = 7;
}
if (Key.isDown(40) and ((((pcd == 0) or (pcd == 1)) or (pcd == 2)) or (pcd == 3))) {
if (((pcd == 0) or (pcd == 2)) or (pcd == 8)) {
pcd = 6;
pstep = 3;
}
if (((pcd == 1) or (pcd == 3)) or (pcd == 9)) {
pcd = 7;
pstep = 3;
}
}
if (Key.isDown(16) and (bcharge < 100)) {
bcharge = bcharge + 5;
}
if (pcd == 0) {
pc.gotoAndStop(1);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(21);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 0;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
}
if (pcd == 1) {
pc.gotoAndStop(2);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(22);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 1;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
}
if (pcd == 2) {
px = px + 13;
if ((w == 0) or (w == 1)) {
pc.gotoAndStop(3);
}
if ((w == 2) or (w == 3)) {
pc.gotoAndStop(4);
}
if ((w == 4) or (w == 5)) {
pc.gotoAndStop(5);
}
if ((w == 6) or (w == 7)) {
pc.gotoAndStop(6);
}
if (Key.isDown(32)) {
if ((w == 0) or (w == 1)) {
pc.gotoAndStop(11);
}
if ((w == 2) or (w == 3)) {
pc.gotoAndStop(12);
}
if ((w == 4) or (w == 5)) {
pc.gotoAndStop(13);
}
if ((w == 6) or (w == 7)) {
pc.gotoAndStop(14);
}
if ((pst[psn] == 0) and (bstep == 0)) {
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 0;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
}
pcd = 0;
}
if (pcd == 3) {
px = px - 13;
if ((w == 0) or (w == 1)) {
pc.gotoAndStop(7);
}
if ((w == 2) or (w == 3)) {
pc.gotoAndStop(8);
}
if ((w == 4) or (w == 5)) {
pc.gotoAndStop(9);
}
if ((w == 6) or (w == 7)) {
pc.gotoAndStop(10);
}
if (Key.isDown(32)) {
if ((w == 0) or (w == 1)) {
pc.gotoAndStop(15);
}
if ((w == 2) or (w == 3)) {
pc.gotoAndStop(16);
}
if ((w == 4) or (w == 5)) {
pc.gotoAndStop(17);
}
if ((w == 6) or (w == 7)) {
pc.gotoAndStop(18);
}
if ((pst[psn] == 0) and (bstep == 0)) {
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 1;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
}
pcd = 1;
}
if (pcd == 9) {
pstep = pstep - 1;
if (pstep <= 0) {
pcd = 1;
}
}
if (pcd == 6) {
pc.gotoAndStop(19);
px = px + 20;
pstep = pstep - 1;
if (pstep <= 0) {
pcd = 0;
}
}
if (pcd == 7) {
pc.gotoAndStop(20);
px = px - 20;
pstep = pstep - 1;
if (pstep <= 0) {
pcd = 1;
}
}
if (pcd == 12) {
pc.gotoAndStop(23);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(25);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 0;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
py = py + (5 * (7 - pstep));
pstep = pstep - 1;
if (pstep <= 2) {
pstep = 2;
}
if (Key.isDown(39)) {
px = px + 13;
}
if (Key.isDown(37)) {
px = px - 13;
if (bstep == 0) {
pcd = 13;
}
}
}
if (pcd == 13) {
pc.gotoAndStop(24);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(26);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 1;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
py = py + (5 * (7 - pstep));
pstep = pstep - 1;
if (pstep <= 2) {
pstep = 2;
}
if (Key.isDown(39)) {
px = px + 13;
if (bstep == 0) {
pcd = 12;
}
}
if (Key.isDown(37)) {
px = px - 13;
}
}
if (pcd == 10) {
pc.gotoAndStop(23);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(25);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 0;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
py = py - (5 * pstep);
pstep = pstep - 1;
if (Key.isDown(39)) {
px = px + 13;
}
if (Key.isDown(37)) {
px = px - 13;
if (bstep == 0) {
pcd = 11;
}
}
if (Key.isDown(40)) {
pcd = 12;
pstep = pstep + 3;
}
if (pstep <= -1) {
pstep = 7;
pcd = 12;
}
}
if (pcd == 11) {
pc.gotoAndStop(24);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(26);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 1;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
py = py - (5 * pstep);
pstep = pstep - 1;
if (Key.isDown(39)) {
px = px + 13;
if (bstep == 0) {
pcd = 10;
}
}
if (Key.isDown(37)) {
px = px - 13;
}
if (Key.isDown(40)) {
pcd = 13;
pstep = pstep + 3;
}
if (pstep <= -1) {
pstep = 7;
pcd = 13;
}
}
if (pcd == 18) {
pc.gotoAndStop(27);
pstep = pstep - 1;
px = px - 5;
if (pstep <= -1) {
pstep = 2;
pcd = 0;
}
}
if (pcd == 19) {
pc.gotoAndStop(28);
pstep = pstep - 1;
px = px + 5;
if (pstep <= -1) {
pstep = 2;
pcd = 1;
}
}
if (pcd == 20) {
pc.gotoAndStop(69 - pstep);
bcharge = 0;
charge._alpha = 0;
bstep = 20;
pl = 1;
pstep = pstep - 1;
if (pstep < 0) {
lives = lives - 1;
if (lives >= 0) {
pl = 50;
gotoAndPlay (145);
}
if (lives < 0) {
lives = 2;
continues = continues - 1;
gotoAndPlay (5);
}
}
}
if (pl <= 0) {
c = 1;
while (c <= 8) {
bgx[c] = -600;
c++;
}
pc._alpha = 100;
pcd = 20;
pstep = 40;
megad.start();
}
if (bstep > 0) {
bcharge = 0;
charge._alpha = bcharge;
}
if (bstep > 0) {
bstep = bstep - 1;
}
if ((py > 500) and (pcd < 20)) {
megad.start();
pl = 0;
}
w = w - 1;
if (w < 0) {
w = 7;
}
e = pcd;
c = 0;
r = 1;
while (r <= 22) {
if (((((bx[r] - 150) < px) and ((bx[r] + 150) > px)) and ((by[r] - 150) < py)) and ((by[r] + 150) > py)) {
if (((((((px - 30) < (bx[r] + 50)) and ((px + 20) > (bx[r] - 50))) and (py < (by[r] - 50))) and ((py + 60) > (by[r] - 50))) and (pcd != 10)) and (pcd != 11)) {
if ((((pcd == 12) or (pcd == 13)) or (pcd == 16)) or (pcd == 17)) {
if ((pcd == 12) or (pcd == 16)) {
pcd = 0;
}
if ((pcd == 13) or (pcd == 17)) {
pcd = 1;
}
}
c = 1;
py = by[r] - 75;
}
if (((((px + 38) > (bx[r] - 50)) and ((px + 20) < bx[r])) and (py < (by[r] + 50))) and ((py + 20) > (by[r] - 50))) {
px = bx[r] - 85;
}
if (((((px - 35) < (bx[r] + 50)) and ((px - 20) > bx[r])) and (py < (by[r] + 50))) and ((py + 20) > (by[r] - 50))) {
px = bx[r] + 85;
}
if (((((px - 5) < (bx[r] + 50)) and ((px + 5) > (bx[r] - 50))) and ((py - 30) < (by[r] + 50))) and ((py + 10) > (by[r] + 50))) {
if ((((pcd == 10) or (pcd == 11)) or (pcd == 14)) or (pcd == 15)) {
if ((pcd == 10) or (pcd == 14)) {
pcd = 12;
pstep = 5;
}
if ((pcd == 11) or (pcd == 15)) {
pcd = 13;
pstep = 5;
}
}
py = by[r] + 90;
}
}
r++;
}
if (c == 0) {
if ((((pcd == 0) or (pcd == 2)) or (pcd == 6)) or (pcd == 18)) {
pcd = 12;
pstep = 6;
}
if ((((pcd == 1) or (pcd == 3)) or (pcd == 7)) or (pcd == 19)) {
pcd = 13;
pstep = 6;
}
}
r = 1;
while (r <= 3) {
if (pst[r] == 1) {
if (psd[r] == 0) {
psx[r] = psx[r] + 30;
if (r == 1) {
shot1p.gotoAndStop(1);
}
if (r == 2) {
shot2p.gotoAndStop(1);
}
if (r == 3) {
shot3p.gotoAndStop(1);
}
if (psx[r] > (px + 280)) {
pst[r] = 0;
psx[r] = -200;
}
}
if (psd[r] == 1) {
psx[r] = psx[r] - 30;
if (r == 1) {
shot1p.gotoAndStop(2);
}
if (r == 2) {
shot2p.gotoAndStop(2);
}
if (r == 3) {
shot3p.gotoAndStop(2);
}
if (psx[r] < (px - 280)) {
pst[r] = 0;
psx[r] = -200;
}
}
}
if (pst[r] == 2) {
if (psd[r] == 0) {
psx[r] = psx[r] + 35;
if (r == 1) {
shot1p.gotoAndStop(3);
}
if (r == 2) {
shot2p.gotoAndStop(3);
}
if (r == 3) {
shot3p.gotoAndStop(3);
}
if (psx[r] > (px + 280)) {
pst[r] = 0;
psx[r] = -200;
}
}
if (psd[r] == 1) {
psx[r] = psx[r] - 35;
if (r == 1) {
shot1p.gotoAndStop(4);
}
if (r == 2) {
shot2p.gotoAndStop(4);
}
if (r == 3) {
shot3p.gotoAndStop(4);
}
if (psx[r] < (px - 280)) {
pst[r] = 0;
psx[r] = -200;
}
}
}
if (pst[r] == 3) {
if (psd[r] == 0) {
psx[r] = psx[r] + 40;
if (r == 1) {
shot1p.gotoAndStop(5);
}
if (r == 2) {
shot2p.gotoAndStop(5);
}
if (r == 3) {
shot3p.gotoAndStop(5);
}
if (psx[r] > (px + 280)) {
pst[r] = 0;
psx[r] = -200;
}
}
if (psd[r] == 1) {
psx[r] = psx[r] - 40;
if (r == 1) {
shot1p.gotoAndStop(6);
}
if (r == 2) {
shot2p.gotoAndStop(6);
}
if (r == 3) {
shot3p.gotoAndStop(6);
}
if (psx[r] < (px - 280)) {
pst[r] = 0;
psx[r] = -200;
}
}
}
if (pst[r] == 4) {
if (r == 1) {
shot1p.gotoAndStop(10 - psd[r]);
}
if (r == 2) {
shot2p.gotoAndStop(10 - psd[r]);
}
if (r == 3) {
shot3p.gotoAndStop(10 - psd[r]);
}
psd[r] = psd[r] - 1;
if (psd[r] < 0) {
pst[r] = 0;
psx[r] = -200;
}
}
if (pst[r] == 5) {
if (r == 1) {
shot1p.gotoAndStop(14 - psd[r]);
}
if (r == 2) {
shot2p.gotoAndStop(14 - psd[r]);
}
if (r == 3) {
shot3p.gotoAndStop(14 - psd[r]);
}
psd[r] = psd[r] - 1;
if (psd[r] < 0) {
pst[r] = 0;
psx[r] = -200;
}
}
r++;
}
while (c <= 8) {
r = 1;
while (r <= 3) {
if ((pst[r] > 0) and (pst[r] < 4)) {
if ((pst[r] > 0) and (pst[r] < 4)) {
if (((((bgt[c] == 2) and ((bgx[c] - 35) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 35) > (psx[r] - ((pst[r] * 20) - 20)))) and (bgy[c] < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 50) > (psy[r] - ((pst[r] * 20) - 20)))) {
if ((((bgd[c] == 0) or (bgd[c] == 3)) or (bgd[c] == 1)) or (bgd[c] == 4)) {
deflect.start();
pst[r] = 5;
psd[r] = 2;
}
if ((bgd[c] == 2) or (bgd[c] == 5)) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd2.start();
bgd[c] = 6;
bgs[c] = 6;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
if (((((bgt[c] == 5) and ((bgx[c] - 40) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 40) > (psx[r] - ((pst[r] * 20) - 20)))) and ((bgy[c] - 20) < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 50) > (psy[r] - ((pst[r] * 20) - 20)))) {
if ((((bgd[c] == 0) or (bgd[c] == 1)) or (bgd[c] == 2)) or (bgd[c] == 3)) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd1.start();
bgd[c] = 4;
bgs[c] = 5;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
if (((((bgt[c] == 10) and ((bgx[c] - 20) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 20) > (psx[r] - ((pst[r] * 20) - 20)))) and ((bgy[c] - 50) < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 20) > (psy[r] - ((pst[r] * 20) - 20)))) {
if ((bgd[c] == 0) or (bgd[c] == 1)) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd2.start();
bgd[c] = 2;
bgs[c] = 3;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
if (((((bgt[c] == 11) and ((bgx[c] - 25) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 25) > (psx[r] - ((pst[r] * 20) - 20)))) and (bgy[c] < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 50) > (psy[r] - ((pst[r] * 20) - 20)))) {
if ((((((bgd[c] == 0) or (bgd[c] == 1)) or (bgd[c] == 2)) or (bgd[c] == 3)) or (bgd[c] == 4)) or (bgd[c] == 5)) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd2.start();
bgd[c] = 6;
bgs[c] = 3;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
}
}
r++;
}
c++;
}
r = 1;
while (r <= 8) {
if (((((bgt[r] > 0) and ((bgx[r] - 340) < px)) and ((bgx[r] + 340) > px)) and ((bgy[r] - 180) < py)) and ((bgy[r] + 350) > py)) {
c = 0;
e = 1;
while (e <= 22) {
if (((((bx[e] - 150) < bgx[r]) and ((bx[e] + 150) > bgx[r])) and ((by[e] - 150) < bgy[r])) and ((by[e] + 150) > bgy[r])) {
if (((((bgx[r] + 20) >= (bx[e] - 50)) and ((bgx[r] - 20) <= (bx[e] + 50))) and ((bgy[r] + 45) > (by[e] - 60))) and ((bgy[r] - 10) < (by[e] - 40))) {
c = 1;
}
if (((((bgx[r] + 20) > (bx[e] - 50)) and ((bgx[r] + 20) < bx[e])) and (bgy[r] < (by[e] + 50))) and ((bgy[r] + 20) > (by[e] - 50))) {
bgx[r] = bx[e] - 70;
}
if (((((bgx[r] - 20) < (bx[e] + 50)) and ((bgx[r] + 20) > bx[e])) and (bgy[r] < (by[e] + 50))) and ((bgy[r] + 20) > (by[e] - 50))) {
bgx[r] = bx[e] + 70;
}
if (((((bgx[r] - 5) < (bx[e] + 50)) and ((bgx[r] + 5) > (bx[e] - 50))) and ((bgy[r] - 30) < (by[e] + 50))) and (bgy[r] > (by[e] + 50))) {
bgy[r] = by[e] + 70;
}
if (((((bgx[r] - 2) < (bx[e] + 50)) and ((bgx[r] + 2) > (bx[e] - 50))) and ((bgy[r] + 20) < (by[e] - 50))) and ((bgy[r] + 60) > (by[e] - 50))) {
c = 1;
bgy[r] = by[e] - 105;
}
}
e++;
}
if (c == 0) {
bgy[r] = bgy[r] + 10;
}
if (bgt[r] == 2) {
if (((((((bgx[r] - 15) < (px + 10)) and ((bgx[r] + 15) > (px - 10))) and ((bgy[r] + 80) > (py - 10))) and ((bgy[r] + 50) < (py + 50))) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 3;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 3;
}
megah.start();
i = 10;
}
if (bgd[r] == 0) {
f[r] = 1;
if (px < bgx[r]) {
bgd[r] = 3;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 1;
bgs[r] = 10;
}
}
if (bgd[r] == 3) {
f[r] = 5;
if (px > bgx[r]) {
bgd[r] = 0;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 4;
bgs[r] = 10;
}
}
if (bgd[r] == 1) {
f[r] = 2;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 2;
bgs[r] = 12;
}
}
if (bgd[r] == 2) {
if (((bgs[r] == 12) or (bgs[r] == 11)) or (bgs[r] == 10)) {
f[r] = 3;
}
if (((bgs[r] == 9) or (bgs[r] == 8)) or (bgs[r] == 7)) {
f[r] = 4;
}
if (((bgs[r] == 6) or (bgs[r] == 5)) or (bgs[r] == 4)) {
f[r] = 3;
}
if (((bgs[r] == 3) or (bgs[r] == 2)) or (bgs[r] == 1)) {
f[r] = 4;
}
bgx[r] = bgx[r] + 8;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 0;
bgs[r] = 10 + random(20);
}
}
if (bgd[r] == 4) {
f[r] = 6;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 5;
bgs[r] = 12;
}
}
if (bgd[r] == 5) {
if (((bgs[r] == 12) or (bgs[r] == 11)) or (bgs[r] == 10)) {
f[r] = 7;
}
if (((bgs[r] == 9) or (bgs[r] == 8)) or (bgs[r] == 7)) {
f[r] = 8;
}
if (((bgs[r] == 6) or (bgs[r] == 5)) or (bgs[r] == 4)) {
f[r] = 7;
}
if (((bgs[r] == 3) or (bgs[r] == 2)) or (bgs[r] == 1)) {
f[r] = 8;
}
bgx[r] = bgx[r] - 8;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 3;
bgs[r] = 10 + random(20);
}
}
if (bgd[r] == 6) {
if (bgs[r] == 6) {
f[r] = 9;
}
if (bgs[r] == 5) {
f[r] = 10;
}
if (bgs[r] == 4) {
f[r] = 11;
}
if (bgs[r] == 3) {
f[r] = 12;
}
if (bgs[r] == 2) {
f[r] = 13;
}
if (bgs[r] == 1) {
f[r] = 14;
}
bgs[r] = bgs[r] - 1;
bgy[r] = bgy[r] - 10;
if (bgs[r] <= 0) {
f[r] = 15;
bgt[r] = 0;
bgx[r] = -500;
bgs[r] = 0;
}
}
}
if (bgt[r] == 5) {
if (((((((bgx[r] - 20) < (px + 10)) and ((bgx[r] + 20) > (px - 10))) and ((bgy[r] + 80) > (py + 10))) and ((bgy[r] + 30) < (py + 50))) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 3;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 3;
}
megah.start();
i = 10;
}
if (bgd[r] == 0) {
f[r] = 1;
if (px < bgx[r]) {
bgd[r] = 2;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
cannons.start();
bgd[r] = 1;
bgs[r] = 8;
bgst[bsn] = 2;
bgsx[bsn] = bgx[r] - 20;
bgsy[bsn] = bgy[r] + 20;
bgsd[bsn] = 0;
bsn = bsn + 1;
if (bsn > 5) {
bsn = 1;
}
}
}
if (bgd[r] == 2) {
f[r] = 3;
if (px > bgx[r]) {
bgd[r] = 0;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
cannons.start();
bgd[r] = 3;
bgs[r] = 7;
bgst[bsn] = 2;
bgsx[bsn] = bgx[r] + 20;
bgsy[bsn] = bgy[r] + 20;
bgsd[bsn] = 1;
bsn = bsn + 1;
if (bsn > 5) {
bsn = 1;
}
}
}
if (bgd[r] == 1) {
f[r] = 2;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 0;
bgs[r] = 10 + random(15);
}
}
if (bgd[r] == 3) {
f[r] = 4;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 2;
bgs[r] = 10 + random(15);
}
}
if (bgd[r] == 4) {
if (bgs[r] == 5) {
f[r] = 5;
}
if (bgs[r] == 4) {
f[r] = 6;
}
if (bgs[r] == 3) {
f[r] = 7;
}
if (bgs[r] == 2) {
f[r] = 8;
}
if (bgs[r] == 1) {
f[r] = 9;
}
bgs[r] = bgs[r] - 1;
bgy[r] = bgy[r] - 10;
if (bgs[r] <= 0) {
f[r] = 10;
bgt[r] = 0;
bgx[r] = -500;
bgs[r] = 0;
}
}
}
if (bgt[r] == 10) {
if (((((((bgx[r] - 20) < (px + 10)) and ((bgx[r] + 20) > (px - 10))) and ((bgy[r] + 20) > (py + 10))) and ((bgy[r] + 20) < (py + 50))) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 2;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 2;
}
megah.start();
i = 10;
}
if (bgd[r] == 0) {
f[r] = 1;
bgy[r] = bgy[r] - 10;
if (px < bgx[r]) {
bgx[r] = bgx[r] - 7;
}
if (px > bgx[r]) {
bgx[r] = bgx[r] + 7;
}
if ((py - 80) < bgy[r]) {
bgy[r] = bgy[r] - 8;
}
if ((py - 80) > bgy[r]) {
bgy[r] = bgy[r] + 8;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
joes.start();
bgd[r] = 1;
bgsd[bsn] = 4;
bgs[r] = 5;
bgst[bsn] = 1;
bgsx[bsn] = bgx[r];
bgsy[bsn] = bgy[r];
bsn = bsn + 1;
if (bsn > 5) {
bsn = 1;
}
}
}
if (bgd[r] == 1) {
f[r] = 2;
bgy[r] = bgy[r] - 10;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 0;
bgs[r] = 6 + random(16);
}
}
if (bgd[r] == 2) {
if (bgs[r] == 3) {
f[r] = 3;
}
if (bgs[r] == 2) {
f[r] = 4;
}
if (bgs[r] == 1) {
f[r] = 5;
}
bgs[r] = bgs[r] - 1;
bgy[r] = bgy[r] - 10;
if (bgs[r] <= 0) {
f[r] = 7;
bgt[r] = 0;
bgx[r] = -500;
bgs[r] = 0;
}
}
}
if (bgt[r] == 11) {
if (((((((bgx[r] - 20) < (px + 10)) and ((bgx[r] + 20) > (px - 10))) and ((bgy[r] + 50) > (py - 10))) and (bgy[r] < (py + 50))) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 3;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 3;
}
megah.start();
i = 10;
}
if (bgd[r] == 0) {
if (((bgs[r] == 12) or (bgs[r] == 11)) or (bgs[r] == 10)) {
f[r] = 1;
}
if (((bgs[r] == 9) or (bgs[r] == 8)) or (bgs[r] == 7)) {
f[r] = 2;
}
if (((bgs[r] == 6) or (bgs[r] == 5)) or (bgs[r] == 4)) {
f[r] = 1;
}
if (((bgs[r] == 3) or (bgs[r] == 2)) or (bgs[r] == 1)) {
f[r] = 2;
}
if (bgx[r] > px) {
bgd[r] = 3;
bgs[r] = 12;
}
bgx[r] = bgx[r] + 6;
if (((bgx[r] + 150) > (px - 20)) and (bgx[r] < px)) {
bgd[r] = 1;
bgs[r] = 9;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgs[r] = 12;
}
}
if (bgd[r] == 1) {
f[r] = 3;
bgx[r] = bgx[r] + 12;
bgy[r] = bgy[r] - 20;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 2;
bgs[r] = 10;
}
}
if (bgd[r] == 2) {
f[r] = 3;
bgx[r] = bgx[r] + 12;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 0;
bgs[r] = 12;
}
}
if (bgd[r] == 3) {
if (((bgs[r] == 12) or (bgs[r] == 11)) or (bgs[r] == 10)) {
f[r] = 4;
}
if (((bgs[r] == 9) or (bgs[r] == 8)) or (bgs[r] == 7)) {
f[r] = 5;
}
if (((bgs[r] == 6) or (bgs[r] == 5)) or (bgs[r] == 4)) {
f[r] = 4;
}
if (((bgs[r] == 3) or (bgs[r] == 2)) or (bgs[r] == 1)) {
f[r] = 5;
}
if (bgx[r] < px) {
bgd[r] = 0;
bgs[r] = 12;
}
bgx[r] = bgx[r] - 6;
if (((bgx[r] - 150) < (px - 20)) and (bgx[r] > px)) {
bgd[r] = 4;
bgs[r] = 9;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgs[r] = 12;
}
}
if (bgd[r] == 4) {
f[r] = 6;
bgx[r] = bgx[r] - 12;
bgy[r] = bgy[r] - 20;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 5;
bgs[r] = 10;
}
}
if (bgd[r] == 5) {
f[r] = 6;
bgx[r] = bgx[r] - 12;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 3;
bgs[r] = 12;
}
}
if (bgd[r] == 6) {
if (bgs[r] == 3) {
f[r] = 7;
}
if (bgs[r] == 2) {
f[r] = 8;
}
if (bgs[r] == 1) {
f[r] = 9;
}
bgs[r] = bgs[r] - 1;
bgy[r] = bgy[r] - 10;
if (bgs[r] <= 0) {
f[r] = 15;
bgt[r] = 0;
bgx[r] = -500;
bgs[r] = 0;
}
}
}
}
r++;
}
r = 1;
while (r <= 5) {
if (bgst[r] > 0) {
if (bgst[r] == 1) {
if (r == 1) {
bgs1.gotoAndStop(1);
}
if (r == 2) {
bgs2.gotoAndStop(1);
}
if (r == 3) {
bgs3.gotoAndStop(1);
}
if (r == 4) {
bgs4.gotoAndStop(1);
}
if (r == 5) {
bgs5.gotoAndStop(1);
}
if (bgsd[r] == 0) {
bgsx[r] = bgsx[r] + 20;
if (bgsx[r] > (px + 300)) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgsd[r] == 1) {
bgsx[r] = bgsx[r] - 20;
if (bgsx[r] < (px - 300)) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgsd[r] == 2) {
bgsx[r] = bgsx[r] + 15;
bgsy[r] = bgsy[r] + 15;
if ((bgsx[r] > (px + 300)) or (bgsy[r] > (py + 300))) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgsd[r] == 3) {
bgsx[r] = bgsx[r] - 15;
bgsy[r] = bgsy[r] + 15;
if ((bgsx[r] > (px + 300)) or (bgsy[r] > (py + 300))) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgsd[r] == 4) {
bgsy[r] = bgsy[r] + 20;
if (bgsy[r] > (py + 300)) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (((((((bgsx[r] - 15) < (px + 10)) and ((bgsx[r] + 15) > (px - 10))) and ((bgsy[r] + 15) > (py + 5))) and ((bgsy[r] - 15) < (py + 20))) and (pcd < 18)) and (i < 1)) {
if ((bgsd[r] == 0) or (bgsd[r] == 2)) {
pcd = 19;
}
if ((bgsd[r] == 1) or (bgsd[r] == 3)) {
pcd = 18;
}
pstep = 2;
pl = pl - 3;
megah.start();
i = 10;
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgst[r] == 2) {
if (r == 1) {
bgs1.gotoAndStop(2);
}
if (r == 2) {
bgs2.gotoAndStop(2);
}
if (r == 3) {
bgs3.gotoAndStop(2);
}
if (r == 4) {
bgs4.gotoAndStop(2);
}
if (r == 5) {
bgs5.gotoAndStop(2);
}
if (bgsd[r] == 0) {
bgsx[r] = bgsx[r] + 30;
if (bgsx[r] > (px + 300)) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgsd[r] == 1) {
bgsx[r] = bgsx[r] - 30;
if (bgsx[r] < (px - 300)) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (((((((bgsx[r] - 25) < (px + 10)) and ((bgsx[r] + 25) > (px - 10))) and ((bgsy[r] + 80) > (py + 40))) and ((bgsy[r] + 35) < (py + 60))) and (pcd < 18)) and (i < 1)) {
if (bgsd[r] == 0) {
pcd = 19;
}
if (bgsd[r] == 1) {
pcd = 18;
}
pstep = 2;
pl = pl - 6;
megah.start();
i = 10;
bgst[r] = 0;
bgsx[r] = -200;
}
}
}
r++;
}
bg1.gotoAndStop(f[1]);
bg2.gotoAndStop(f[2]);
bg3.gotoAndStop(f[3]);
bg4.gotoAndStop(f[4]);
bg5.gotoAndStop(f[5]);
bg6.gotoAndStop(f[6]);
bg7.gotoAndStop(f[7]);
bg8.gotoAndStop(f[8]);
bgs1._x = ((bgsx[1] + 275) - px) / 2;
bgs1._y = ((bgsy[1] + 275) - py) / 2;
bgs2._x = ((bgsx[2] + 275) - px) / 2;
bgs2._y = ((bgsy[2] + 275) - py) / 2;
bgs3._x = ((bgsx[3] + 275) - px) / 2;
bgs3._y = ((bgsy[3] + 275) - py) / 2;
bgs4._x = ((bgsx[4] + 275) - px) / 2;
bgs4._y = ((bgsy[4] + 275) - py) / 2;
bgs5._x = ((bgsx[5] + 275) - px) / 2;
bgs5._y = ((bgsy[5] + 275) - py) / 2;
bg1._x = ((bgx[1] + 275) - px) / 2;
bg1._y = ((bgy[1] + 275) - py) / 2;
bg2._x = ((bgx[2] + 275) - px) / 2;
bg2._y = ((bgy[2] + 275) - py) / 2;
bg3._x = ((bgx[3] + 275) - px) / 2;
bg3._y = ((bgy[3] + 275) - py) / 2;
bg4._x = ((bgx[4] + 275) - px) / 2;
bg4._y = ((bgy[4] + 275) - py) / 2;
bg5._x = ((bgx[5] + 275) - px) / 2;
bg5._y = ((bgy[5] + 275) - py) / 2;
bg6._x = ((bgx[6] + 275) - px) / 2;
bg6._y = ((bgy[6] + 275) - py) / 2;
bg7._x = ((bgx[7] + 275) - px) / 2;
bg7._y = ((bgy[7] + 275) - py) / 2;
bg8._x = ((bgx[8] + 275) - px) / 2;
bg8._y = ((bgy[8] + 275) - py) / 2;
r = 1;
while (r <= 3) {
if (((pst[r] > 0) and (pst[r] < 4)) and (psd[r] == 0)) {
if (r == 1) {
shot1p._x = ((297 + psx[1]) - px) / 2;
shot1p._y = ((270 + psy[1]) - py) / 2;
}
if (r == 2) {
shot2p._x = ((297 + psx[2]) - px) / 2;
shot2p._y = ((270 + psy[2]) - py) / 2;
}
if (r == 3) {
shot3p._x = ((297 + psx[3]) - px) / 2;
shot3p._y = ((270 + psy[3]) - py) / 2;
}
}
if (((pst[r] > 0) and (pst[r] < 4)) and (psd[r] == 1)) {
if (r == 1) {
shot1p._x = ((247 + psx[1]) - px) / 2;
shot1p._y = ((270 + psy[1]) - py) / 2;
}
if (r == 2) {
shot2p._x = ((247 + psx[2]) - px) / 2;
shot2p._y = ((270 + psy[2]) - py) / 2;
}
if (r == 3) {
shot3p._x = ((247 + psx[3]) - px) / 2;
shot3p._y = ((270 + psy[3]) - py) / 2;
}
}
if ((pst[r] == 4) or (pst[r] == 5)) {
if (r == 1) {
shot1p._x = ((272 + psx[1]) - px) / 2;
shot1p._y = ((270 + psy[1]) - py) / 2;
}
if (r == 2) {
shot2p._x = ((272 + psx[2]) - px) / 2;
shot2p._y = ((270 + psy[2]) - py) / 2;
}
if (r == 3) {
shot3p._x = ((272 + psx[3]) - px) / 2;
shot3p._y = ((270 + psy[3]) - py) / 2;
}
}
if (pst[r] == 0) {
if (r == 1) {
shot1p._x = -200;
shot1p._y = (270 + psy[1]) - py;
}
if (r == 2) {
shot2p._x = -200;
shot2p._y = (270 + psy[2]) - py;
}
if (r == 3) {
shot3p._x = -200;
shot3p._y = (270 + psy[3]) - py;
}
}
r++;
}
if (i > 0) {
i = i - 1;
pc._alpha = 50;
}
if (i <= 0) {
i = i - 1;
pc._alpha = 100;
}
if (bcharge > 0) {
charge._alpha = bcharge;
}
lbar._height = 2 * pl;
lbar._y = 120 - (2 * pl);
stage._x = (275 - px) / 2;
stage._y = (375 - py) / 2;
exit._x = ((ex + 275) - px) / 2;
exit._y = ((ey + 275) - py) / 2;
stage2._x = stage2._x - 40;
if (stage2._x < -60) {
stage2._x = 325;
stage2._y = random(100) + 60;
}
Frame 158
gotoAndPlay (157);
if ((((px + 10) > (ex - 20)) and ((px - 10) < (ex + 20))) and (((py + 30) > (ey - 20)) and (py < (ey + 50)))) {
gotoAndPlay (159);
}
Frame 159
lbar._height = 2 * pl;
lbar._y = 120 - (2 * pl);
stage._x = (275 - px) / 2;
stage._y = (375 - py) / 2;
exit._x = ((ex + 275) - px) / 2;
exit._y = ((ey + 275) - py) / 2;
stage2._x = stage2._x - 40;
if (stage2._x < -60) {
stage2._x = 325;
stage2._y = random(100) + 60;
}
Frame 162
psn = 1;
bstep = 0;
pcd = 0;
bcharge = 0;
r = 1;
while (r <= 5) {
psx[r] = -200;
psy[r] = 0;
pst[r] = 0;
psd[r] = 0;
r++;
}
i = 0;
pl = pl + 5;
if (pl > 50) {
pl = 50;
}
px = 150;
py = 370;
r = 0;
while (r <= 26) {
bx[r] = -50;
by[r] = -50;
r++;
}
bx[1] = 50;
by[1] = 250;
bx[2] = 50;
by[2] = 350;
bx[3] = 150;
by[3] = 450;
bx[4] = 250;
by[4] = 450;
bx[5] = 350;
by[5] = 450;
bx[6] = 450;
by[6] = 450;
bx[7] = 550;
by[7] = 450;
bx[8] = 650;
by[8] = 400;
bx[9] = 750;
by[9] = 450;
bx[10] = 850;
by[10] = 450;
bx[11] = 950;
by[11] = 350;
bx[12] = 1050;
by[12] = 450;
bx[13] = 1150;
by[13] = 450;
bx[14] = 1250;
by[14] = 450;
bx[15] = 1250;
by[15] = 250;
bx[16] = 1250;
by[16] = 150;
bx[17] = 1350;
by[17] = 450;
bx[18] = 1450;
by[18] = 450;
bx[19] = 1550;
by[19] = 450;
bx[20] = 1650;
by[20] = 450;
bx[21] = 1750;
by[21] = 450;
bx[22] = 1850;
by[22] = 350;
bx[23] = 1750;
by[23] = 250;
bx[24] = 1650;
by[24] = 250;
bsn = 1;
r = 1;
while (r <= 8) {
bgx[r] = -200;
bgy[r] = -200;
bgt[r] = 0;
bgd[r] = -1;
bgs[r] = 0;
r++;
}
r = 1;
while (r <= 5) {
bgsx[r] = -200;
bgsy[r] = 0;
bgst[r] = 0;
bgsd[r] = 0;
r++;
}
r = 1;
while (r <= 8) {
f[r] = 20;
r++;
}
bgt[1] = 2;
bgd[1] = 0;
bgs[1] = 0;
bgl[1] = 3;
bgx[1] = 350;
bgy[1] = 350;
bgt[2] = 2;
bgd[2] = 0;
bgs[2] = 0;
bgl[2] = 3;
bgx[2] = 500;
bgy[2] = 350;
bgt[3] = 14;
bgd[3] = 3;
bgs[3] = 0;
bgl[3] = 2;
bgx[3] = 575;
bgy[3] = 370;
bgt[4] = 14;
bgd[4] = 3;
bgs[4] = 0;
bgl[4] = 2;
bgx[4] = 875;
bgy[4] = 300;
bgt[5] = 14;
bgd[5] = 3;
bgs[5] = 0;
bgl[5] = 2;
bgx[5] = 1175;
bgy[5] = 250;
bgt[6] = 2;
bgd[6] = 0;
bgs[6] = 0;
bgl[6] = 3;
bgx[6] = 1250;
bgy[6] = 350;
bgt[7] = 7;
bgd[7] = 0;
bgs[7] = 0;
bgl[7] = 2;
bgx[7] = 1450;
bgy[7] = 200;
bgt[8] = 2;
bgd[8] = 0;
bgs[8] = 0;
bgl[8] = 3;
bgx[8] = 1650;
bgy[8] = 350;
ex = 1750;
ey = 350;
Frame 163
b1._x = bx[1] / 10;
b1._y = (by[1] / 10) + 120;
b2._x = bx[2] / 10;
b2._y = (by[2] / 10) + 120;
b3._x = bx[3] / 10;
b3._y = (by[3] / 10) + 120;
b4._x = bx[4] / 10;
b4._y = (by[4] / 10) + 120;
b5._x = bx[5] / 10;
b5._y = (by[5] / 10) + 120;
b6._x = bx[6] / 10;
b6._y = (by[6] / 10) + 120;
b7._x = bx[7] / 10;
b7._y = (by[7] / 10) + 120;
b8._x = bx[8] / 10;
b8._y = (by[8] / 10) + 120;
b9._x = bx[9] / 10;
b9._y = (by[9] / 10) + 120;
b10._x = bx[10] / 10;
b10._y = (by[10] / 10) + 120;
b11._x = bx[11] / 10;
b11._y = (by[11] / 10) + 120;
b12._x = bx[12] / 10;
b12._y = (by[12] / 10) + 120;
b13._x = bx[13] / 10;
b13._y = (by[13] / 10) + 120;
b14._x = bx[14] / 10;
b14._y = (by[14] / 10) + 120;
b15._x = bx[15] / 10;
b15._y = (by[15] / 10) + 120;
b16._x = bx[16] / 10;
b16._y = (by[16] / 10) + 120;
b17._x = bx[17] / 10;
b17._y = (by[17] / 10) + 120;
b18._x = bx[18] / 10;
b18._y = (by[18] / 10) + 120;
b19._x = bx[19] / 10;
b19._y = (by[19] / 10) + 120;
b20._x = bx[20] / 10;
b20._y = (by[20] / 10) + 120;
b21._x = bx[21] / 10;
b21._y = (by[21] / 10) + 120;
b22._x = bx[22] / 10;
b22._y = (by[22] / 10) + 120;
b23._x = bx[23] / 10;
b23._y = (by[23] / 10) + 120;
b24._x = bx[24] / 10;
b24._y = (by[24] / 10) + 120;
b25._x = bx[25] / 10;
b25._y = (by[25] / 10) + 120;
b26._x = bx[26] / 10;
b26._y = (by[26] / 10) + 120;
b27._x = bx[27] / 10;
b27._y = (by[27] / 10) + 120;
b28._x = bx[28] / 10;
b28._y = (by[28] / 10) + 120;
cir._x = px / 10;
cir._y = (py / 10) + 120;
shot1._x = psx[1] / 10;
shot1._y = (psy[1] / 10) + 120;
shot2._x = psx[2] / 10;
shot2._y = (psy[2] / 10) + 120;
shot3._x = psx[3] / 10;
shot3._y = (psy[3] / 10) + 120;
bshot1._x = bgsx[1] / 10;
bshot1._y = (bgsy[1] / 10) + 120;
bshot2._x = bgsx[2] / 10;
bshot2._y = (bgsy[2] / 10) + 120;
bshot3._x = bgsx[3] / 10;
bshot3._y = (bgsy[3] / 10) + 120;
bshot4._x = bgsx[4] / 10;
bshot4._y = (bgsy[4] / 10) + 120;
bshot5._x = bgsx[5] / 10;
bshot5._y = (bgsy[5] / 10) + 120;
bcir1._x = bgx[1] / 10;
bcir1._y = (bgy[1] / 10) + 120;
bcir2._x = bgx[2] / 10;
bcir2._y = (bgy[2] / 10) + 120;
bcir3._x = bgx[3] / 10;
bcir3._y = (bgy[3] / 10) + 120;
bcir4._x = bgx[4] / 10;
bcir4._y = (bgy[4] / 10) + 120;
bcir5._x = bgx[5] / 10;
bcir5._y = (bgy[5] / 10) + 120;
bcir6._x = bgx[6] / 10;
bcir6._y = (bgy[6] / 10) + 120;
bcir7._x = bgx[7] / 10;
bcir7._y = (bgy[7] / 10) + 120;
bcir8._x = bgx[8] / 10;
bcir8._y = (bgy[8] / 10) + 120;
bcir9._x = bgx[9] / 10;
bcir9._y = (bgy[9] / 10) + 120;
bcir10._x = bgx[10] / 10;
bcir10._y = (bgy[10] / 10) + 120;
bcir11._x = bgx[11] / 10;
bcir11._y = (bgy[11] / 10) + 120;
bcir12._x = bgx[12] / 10;
bcir12._y = (bgy[12] / 10) + 120;
bcir13._x = bgx[13] / 10;
bcir13._y = (bgy[13] / 10) + 120;
if (Key.isDown(39) and (pcd == 0)) {
pcd = 2;
}
if (Key.isDown(39) and ((pcd == 1) or (pcd == 3))) {
pcd = 0;
}
if (Key.isDown(37) and (pcd == 1)) {
pcd = 3;
}
if (Key.isDown(37) and ((pcd == 0) or (pcd == 2))) {
pcd = 1;
}
if (Key.isDown(38) and ((pcd == 0) or (pcd == 2))) {
pcd = 10;
pstep = 7;
}
if (Key.isDown(38) and ((pcd == 1) or (pcd == 3))) {
pcd = 11;
pstep = 7;
}
if (Key.isDown(40) and ((((pcd == 0) or (pcd == 1)) or (pcd == 2)) or (pcd == 3))) {
if (((pcd == 0) or (pcd == 2)) or (pcd == 8)) {
pcd = 6;
pstep = 3;
}
if (((pcd == 1) or (pcd == 3)) or (pcd == 9)) {
pcd = 7;
pstep = 3;
}
}
if (Key.isDown(16) and (bcharge < 100)) {
bcharge = bcharge + 5;
}
if (pcd == 0) {
pc.gotoAndStop(1);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(21);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 0;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
}
if (pcd == 1) {
pc.gotoAndStop(2);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(22);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 1;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
}
if (pcd == 2) {
px = px + 13;
if ((w == 0) or (w == 1)) {
pc.gotoAndStop(3);
}
if ((w == 2) or (w == 3)) {
pc.gotoAndStop(4);
}
if ((w == 4) or (w == 5)) {
pc.gotoAndStop(5);
}
if ((w == 6) or (w == 7)) {
pc.gotoAndStop(6);
}
if (Key.isDown(32)) {
if ((w == 0) or (w == 1)) {
pc.gotoAndStop(11);
}
if ((w == 2) or (w == 3)) {
pc.gotoAndStop(12);
}
if ((w == 4) or (w == 5)) {
pc.gotoAndStop(13);
}
if ((w == 6) or (w == 7)) {
pc.gotoAndStop(14);
}
if ((pst[psn] == 0) and (bstep == 0)) {
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 0;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
}
pcd = 0;
}
if (pcd == 3) {
px = px - 13;
if ((w == 0) or (w == 1)) {
pc.gotoAndStop(7);
}
if ((w == 2) or (w == 3)) {
pc.gotoAndStop(8);
}
if ((w == 4) or (w == 5)) {
pc.gotoAndStop(9);
}
if ((w == 6) or (w == 7)) {
pc.gotoAndStop(10);
}
if (Key.isDown(32)) {
if ((w == 0) or (w == 1)) {
pc.gotoAndStop(15);
}
if ((w == 2) or (w == 3)) {
pc.gotoAndStop(16);
}
if ((w == 4) or (w == 5)) {
pc.gotoAndStop(17);
}
if ((w == 6) or (w == 7)) {
pc.gotoAndStop(18);
}
if ((pst[psn] == 0) and (bstep == 0)) {
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 1;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
}
pcd = 1;
}
if (pcd == 9) {
pstep = pstep - 1;
if (pstep <= 0) {
pcd = 1;
}
}
if (pcd == 6) {
pc.gotoAndStop(19);
px = px + 20;
pstep = pstep - 1;
if (pstep <= 0) {
pcd = 0;
}
}
if (pcd == 7) {
pc.gotoAndStop(20);
px = px - 20;
pstep = pstep - 1;
if (pstep <= 0) {
pcd = 1;
}
}
if (pcd == 12) {
pc.gotoAndStop(23);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(25);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 0;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
py = py + (5 * (7 - pstep));
pstep = pstep - 1;
if (pstep <= 2) {
pstep = 2;
}
if (Key.isDown(39)) {
px = px + 13;
}
if (Key.isDown(37)) {
px = px - 13;
if (bstep == 0) {
pcd = 13;
}
}
}
if (pcd == 13) {
pc.gotoAndStop(24);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(26);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 1;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
py = py + (5 * (7 - pstep));
pstep = pstep - 1;
if (pstep <= 2) {
pstep = 2;
}
if (Key.isDown(39)) {
px = px + 13;
if (bstep == 0) {
pcd = 12;
}
}
if (Key.isDown(37)) {
px = px - 13;
}
}
if (pcd == 10) {
pc.gotoAndStop(23);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(25);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 0;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
py = py - (5 * pstep);
pstep = pstep - 1;
if (Key.isDown(39)) {
px = px + 13;
}
if (Key.isDown(37)) {
px = px - 13;
if (bstep == 0) {
pcd = 11;
}
}
if (Key.isDown(40)) {
pcd = 12;
pstep = pstep + 3;
}
if (pstep <= -1) {
pstep = 7;
pcd = 12;
}
}
if (pcd == 11) {
pc.gotoAndStop(24);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(26);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 1;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
py = py - (5 * pstep);
pstep = pstep - 1;
if (Key.isDown(39)) {
px = px + 13;
if (bstep == 0) {
pcd = 10;
}
}
if (Key.isDown(37)) {
px = px - 13;
}
if (Key.isDown(40)) {
pcd = 13;
pstep = pstep + 3;
}
if (pstep <= -1) {
pstep = 7;
pcd = 13;
}
}
if (pcd == 18) {
pc.gotoAndStop(27);
pstep = pstep - 1;
px = px - 5;
if (pstep <= -1) {
pstep = 2;
pcd = 0;
}
}
if (pcd == 19) {
pc.gotoAndStop(28);
pstep = pstep - 1;
px = px + 5;
if (pstep <= -1) {
pstep = 2;
pcd = 1;
}
}
if (pcd == 20) {
pc.gotoAndStop(69 - pstep);
bcharge = 0;
charge._alpha = 0;
bstep = 20;
pl = 1;
pstep = pstep - 1;
if (pstep < 0) {
lives = lives - 1;
if (lives >= 0) {
pl = 50;
gotoAndPlay (145);
}
if (lives < 0) {
lives = 2;
continues = continues - 1;
gotoAndPlay (5);
}
}
}
if (pl <= 0) {
c = 1;
while (c <= 8) {
bgx[c] = -600;
c++;
}
pc._alpha = 100;
pcd = 20;
pstep = 40;
megad.start();
}
if (bstep > 0) {
bcharge = 0;
charge._alpha = bcharge;
}
if (bstep > 0) {
bstep = bstep - 1;
}
if ((py > 500) and (pcd < 20)) {
megad.start();
pl = 0;
}
w = w - 1;
if (w < 0) {
w = 7;
}
e = pcd;
c = 0;
r = 1;
while (r <= 24) {
if (((((bx[r] - 150) < px) and ((bx[r] + 150) > px)) and ((by[r] - 150) < py)) and ((by[r] + 150) > py)) {
if (((((((px - 30) < (bx[r] + 50)) and ((px + 20) > (bx[r] - 50))) and (py < (by[r] - 50))) and ((py + 60) > (by[r] - 50))) and (pcd != 10)) and (pcd != 11)) {
if ((((pcd == 12) or (pcd == 13)) or (pcd == 16)) or (pcd == 17)) {
if ((pcd == 12) or (pcd == 16)) {
pcd = 0;
}
if ((pcd == 13) or (pcd == 17)) {
pcd = 1;
}
}
c = 1;
py = by[r] - 75;
}
if (((((px + 38) > (bx[r] - 50)) and ((px + 20) < bx[r])) and (py < (by[r] + 50))) and ((py + 20) > (by[r] - 50))) {
px = bx[r] - 85;
}
if (((((px - 35) < (bx[r] + 50)) and ((px - 20) > bx[r])) and (py < (by[r] + 50))) and ((py + 20) > (by[r] - 50))) {
px = bx[r] + 85;
}
if (((((px - 5) < (bx[r] + 50)) and ((px + 5) > (bx[r] - 50))) and ((py - 30) < (by[r] + 50))) and ((py + 10) > (by[r] + 50))) {
if ((((pcd == 10) or (pcd == 11)) or (pcd == 14)) or (pcd == 15)) {
if ((pcd == 10) or (pcd == 14)) {
pcd = 12;
pstep = 5;
}
if ((pcd == 11) or (pcd == 15)) {
pcd = 13;
pstep = 5;
}
}
py = by[r] + 90;
}
}
r++;
}
if (c == 0) {
if ((((pcd == 0) or (pcd == 2)) or (pcd == 6)) or (pcd == 18)) {
pcd = 12;
pstep = 6;
}
if ((((pcd == 1) or (pcd == 3)) or (pcd == 7)) or (pcd == 19)) {
pcd = 13;
pstep = 6;
}
}
r = 1;
while (r <= 3) {
if (pst[r] == 1) {
if (psd[r] == 0) {
psx[r] = psx[r] + 30;
if (r == 1) {
shot1p.gotoAndStop(1);
}
if (r == 2) {
shot2p.gotoAndStop(1);
}
if (r == 3) {
shot3p.gotoAndStop(1);
}
if (psx[r] > (px + 280)) {
pst[r] = 0;
psx[r] = -200;
}
}
if (psd[r] == 1) {
psx[r] = psx[r] - 30;
if (r == 1) {
shot1p.gotoAndStop(2);
}
if (r == 2) {
shot2p.gotoAndStop(2);
}
if (r == 3) {
shot3p.gotoAndStop(2);
}
if (psx[r] < (px - 280)) {
pst[r] = 0;
psx[r] = -200;
}
}
}
if (pst[r] == 2) {
if (psd[r] == 0) {
psx[r] = psx[r] + 35;
if (r == 1) {
shot1p.gotoAndStop(3);
}
if (r == 2) {
shot2p.gotoAndStop(3);
}
if (r == 3) {
shot3p.gotoAndStop(3);
}
if (psx[r] > (px + 280)) {
pst[r] = 0;
psx[r] = -200;
}
}
if (psd[r] == 1) {
psx[r] = psx[r] - 35;
if (r == 1) {
shot1p.gotoAndStop(4);
}
if (r == 2) {
shot2p.gotoAndStop(4);
}
if (r == 3) {
shot3p.gotoAndStop(4);
}
if (psx[r] < (px - 280)) {
pst[r] = 0;
psx[r] = -200;
}
}
}
if (pst[r] == 3) {
if (psd[r] == 0) {
psx[r] = psx[r] + 40;
if (r == 1) {
shot1p.gotoAndStop(5);
}
if (r == 2) {
shot2p.gotoAndStop(5);
}
if (r == 3) {
shot3p.gotoAndStop(5);
}
if (psx[r] > (px + 280)) {
pst[r] = 0;
psx[r] = -200;
}
}
if (psd[r] == 1) {
psx[r] = psx[r] - 40;
if (r == 1) {
shot1p.gotoAndStop(6);
}
if (r == 2) {
shot2p.gotoAndStop(6);
}
if (r == 3) {
shot3p.gotoAndStop(6);
}
if (psx[r] < (px - 280)) {
pst[r] = 0;
psx[r] = -200;
}
}
}
if (pst[r] == 4) {
if (r == 1) {
shot1p.gotoAndStop(10 - psd[r]);
}
if (r == 2) {
shot2p.gotoAndStop(10 - psd[r]);
}
if (r == 3) {
shot3p.gotoAndStop(10 - psd[r]);
}
psd[r] = psd[r] - 1;
if (psd[r] < 0) {
pst[r] = 0;
psx[r] = -200;
}
}
if (pst[r] == 5) {
if (r == 1) {
shot1p.gotoAndStop(14 - psd[r]);
}
if (r == 2) {
shot2p.gotoAndStop(14 - psd[r]);
}
if (r == 3) {
shot3p.gotoAndStop(14 - psd[r]);
}
psd[r] = psd[r] - 1;
if (psd[r] < 0) {
pst[r] = 0;
psx[r] = -200;
}
}
r++;
}
while (c <= 8) {
r = 1;
while (r <= 3) {
if ((pst[r] > 0) and (pst[r] < 4)) {
if (((((bgt[c] == 2) and ((bgx[c] - 35) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 35) > (psx[r] - ((pst[r] * 20) - 20)))) and (bgy[c] < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 50) > (psy[r] - ((pst[r] * 20) - 20)))) {
if ((((bgd[c] == 0) or (bgd[c] == 3)) or (bgd[c] == 1)) or (bgd[c] == 4)) {
deflect.start();
pst[r] = 5;
psd[r] = 2;
}
if ((bgd[c] == 2) or (bgd[c] == 5)) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd2.start();
bgd[c] = 6;
bgs[c] = 6;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
if (((((bgt[c] == 7) and ((bgx[c] - 35) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 35) > (psx[r] - ((pst[r] * 20) - 20)))) and ((bgy[c] - 50) < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 20) > (psy[r] - ((pst[r] * 20) - 20)))) {
if (bgd[c] == 0) {
deflect.start();
pst[r] = 5;
psd[r] = 2;
}
if ((bgd[c] == 2) or (bgd[c] == 1)) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd2.start();
bgd[c] = 3;
bgs[c] = 3;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
if (((((bgt[c] == 14) and ((bgx[c] - 20) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 20) > (psx[r] - ((pst[r] * 20) - 20)))) and ((bgy[c] - 20) < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 20) > (psy[r] - ((pst[r] * 20) - 20)))) {
if ((((bgd[c] == 0) or (bgd[c] == 1)) or (bgd[c] == 3)) or (bgd[c] == 4)) {
deflect.start();
pst[r] = 5;
psd[r] = 2;
}
if ((bgd[c] == 2) or (bgd[c] == 5)) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd2.start();
bgd[c] = 6;
bgs[c] = 3;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
}
r++;
}
c++;
}
r = 1;
while (r <= 8) {
if (((((bgt[r] > 0) and ((bgx[r] - 340) < px)) and ((bgx[r] + 340) > px)) and ((bgy[r] - 180) < py)) and ((bgy[r] + 350) > py)) {
c = 0;
e = 1;
while (e <= 24) {
if (((((bx[e] - 150) < bgx[r]) and ((bx[e] + 150) > bgx[r])) and ((by[e] - 150) < bgy[r])) and ((by[e] + 150) > bgy[r])) {
if (((((bgx[r] + 20) >= (bx[e] - 50)) and ((bgx[r] - 20) <= (bx[e] + 50))) and ((bgy[r] + 45) > (by[e] - 60))) and ((bgy[r] - 10) < (by[e] - 40))) {
c = 1;
}
if (((((bgx[r] + 20) > (bx[e] - 50)) and ((bgx[r] + 20) < bx[e])) and (bgy[r] < (by[e] + 50))) and ((bgy[r] + 20) > (by[e] - 50))) {
bgx[r] = bx[e] - 70;
}
if (((((bgx[r] - 20) < (bx[e] + 50)) and ((bgx[r] + 20) > bx[e])) and (bgy[r] < (by[e] + 50))) and ((bgy[r] + 20) > (by[e] - 50))) {
bgx[r] = bx[e] + 70;
}
if (((((bgx[r] - 5) < (bx[e] + 50)) and ((bgx[r] + 5) > (bx[e] - 50))) and ((bgy[r] - 30) < (by[e] + 50))) and (bgy[r] > (by[e] + 50))) {
bgy[r] = by[e] + 70;
}
if (((((bgx[r] - 2) < (bx[e] + 50)) and ((bgx[r] + 2) > (bx[e] - 50))) and ((bgy[r] + 20) < (by[e] - 50))) and ((bgy[r] + 60) > (by[e] - 50))) {
c = 1;
bgy[r] = by[e] - 105;
}
}
e++;
}
if (c == 0) {
bgy[r] = bgy[r] + 10;
}
if (bgt[r] == 2) {
if (((((((bgx[r] - 15) < (px + 10)) and ((bgx[r] + 15) > (px - 10))) and ((bgy[r] + 80) > (py - 10))) and ((bgy[r] + 50) < (py + 50))) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 3;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 3;
}
megah.start();
i = 10;
}
if (bgd[r] == 0) {
f[r] = 1;
if (px < bgx[r]) {
bgd[r] = 3;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 1;
bgs[r] = 10;
}
}
if (bgd[r] == 3) {
f[r] = 5;
if (px > bgx[r]) {
bgd[r] = 0;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 4;
bgs[r] = 10;
}
}
if (bgd[r] == 1) {
f[r] = 2;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 2;
bgs[r] = 12;
}
}
if (bgd[r] == 2) {
if (((bgs[r] == 12) or (bgs[r] == 11)) or (bgs[r] == 10)) {
f[r] = 3;
}
if (((bgs[r] == 9) or (bgs[r] == 8)) or (bgs[r] == 7)) {
f[r] = 4;
}
if (((bgs[r] == 6) or (bgs[r] == 5)) or (bgs[r] == 4)) {
f[r] = 3;
}
if (((bgs[r] == 3) or (bgs[r] == 2)) or (bgs[r] == 1)) {
f[r] = 4;
}
bgx[r] = bgx[r] + 8;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 0;
bgs[r] = 10 + random(20);
}
}
if (bgd[r] == 4) {
f[r] = 6;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 5;
bgs[r] = 12;
}
}
if (bgd[r] == 5) {
if (((bgs[r] == 12) or (bgs[r] == 11)) or (bgs[r] == 10)) {
f[r] = 7;
}
if (((bgs[r] == 9) or (bgs[r] == 8)) or (bgs[r] == 7)) {
f[r] = 8;
}
if (((bgs[r] == 6) or (bgs[r] == 5)) or (bgs[r] == 4)) {
f[r] = 7;
}
if (((bgs[r] == 3) or (bgs[r] == 2)) or (bgs[r] == 1)) {
f[r] = 8;
}
bgx[r] = bgx[r] - 8;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 3;
bgs[r] = 10 + random(20);
}
}
if (bgd[r] == 6) {
if (bgs[r] == 6) {
f[r] = 9;
}
if (bgs[r] == 5) {
f[r] = 10;
}
if (bgs[r] == 4) {
f[r] = 11;
}
if (bgs[r] == 3) {
f[r] = 12;
}
if (bgs[r] == 2) {
f[r] = 13;
}
if (bgs[r] == 1) {
f[r] = 14;
}
bgs[r] = bgs[r] - 1;
bgy[r] = bgy[r] - 10;
if (bgs[r] <= 0) {
f[r] = 15;
bgt[r] = 0;
bgx[r] = -500;
bgs[r] = 0;
}
}
}
if (bgt[r] == 7) {
if (((((((bgx[r] - 20) < (px + 10)) and ((bgx[r] + 20) > (px - 10))) and ((bgy[r] + 20) > (py + 10))) and ((bgy[r] + 20) < (py + 50))) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 3;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 3;
}
megah.start();
i = 10;
}
if (bgd[r] == 0) {
f[r] = 1;
bgy[r] = bgy[r] - 10;
if ((px + 80) < bgx[r]) {
bgx[r] = bgx[r] - 5;
}
if ((px - 80) > bgx[r]) {
bgx[r] = bgx[r] + 5;
}
if ((py - 70) < bgy[r]) {
bgy[r] = bgy[r] - 5;
}
if ((py - 70) > bgy[r]) {
bgy[r] = bgy[r] + 5;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
joes.start();
if (px > bgx[r]) {
bgd[r] = 1;
}
if (px < bgx[r]) {
bgd[r] = 2;
}
if (px < bgx[r]) {
bgsd[bsn] = 3;
if ((py - 50) < bgy[r]) {
bgsd[bsn] = 1;
}
}
if (px > bgx[r]) {
bgsd[bsn] = 2;
if ((py - 50) < bgy[r]) {
bgsd[bsn] = 0;
}
}
bgs[r] = 12;
bgst[bsn] = 1;
bgsx[bsn] = bgx[r];
bgsy[bsn] = bgy[r];
bsn = bsn + 1;
if (bsn > 5) {
bsn = 1;
}
}
}
if (bgd[r] == 1) {
f[r] = 2;
bgy[r] = bgy[r] - 10;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 0;
bgs[r] = 10 + random(25);
}
}
if (bgd[r] == 2) {
f[r] = 3;
bgy[r] = bgy[r] - 10;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 0;
bgs[r] = 10 + random(25);
}
}
if (bgd[r] == 3) {
if (bgs[r] == 3) {
f[r] = 4;
}
if (bgs[r] == 2) {
f[r] = 5;
}
if (bgs[r] == 1) {
f[r] = 6;
}
bgs[r] = bgs[r] - 1;
bgy[r] = bgy[r] - 10;
if (bgs[r] <= 0) {
f[r] = 7;
bgt[r] = 0;
bgx[r] = -500;
bgs[r] = 0;
}
}
}
if (bgt[r] == 14) {
if (((((((bgx[r] - 20) < (px + 10)) and ((bgx[r] + 20) > (px - 10))) and ((bgy[r] + 50) > (py + 10))) and ((bgy[r] + 20) < (py + 50))) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 2;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 2;
}
megah.start();
i = 10;
}
if (bgt[r] > 0) {
bgy[r] = bgy[r] - 10;
}
if (bgd[r] == 0) {
f[r] = 1;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 1;
bgs[r] = 6;
}
}
if (bgd[r] == 1) {
if (((bgs[r] == 6) or (bgs[r] == 5)) or (bgs[r] == 4)) {
f[r] = 2;
}
if (((bgs[r] == 3) or (bgs[r] == 2)) or (bgs[r] == 1)) {
f[r] = 3;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 2;
bgs[r] = 15;
}
}
if (bgd[r] == 2) {
f[r] = 4;
if (((bgs[r] == 15) or (bgs[r] == 10)) or (bgs[r] == 5)) {
cannons.start();
bgst[bsn] = 2;
bgsx[bsn] = bgx[r] + 20;
bgsy[bsn] = bgy[r] + 20;
bgsd[bsn] = 0;
bsn = bsn + 1;
if (bsn > 5) {
bsn = 1;
}
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 0;
bgs[r] = 20;
}
}
if (bgd[r] == 3) {
f[r] = 5;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 4;
bgs[r] = 6;
}
}
if (bgd[r] == 4) {
if (((bgs[r] == 6) or (bgs[r] == 5)) or (bgs[r] == 4)) {
f[r] = 6;
}
if (((bgs[r] == 3) or (bgs[r] == 2)) or (bgs[r] == 1)) {
f[r] = 7;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 5;
bgs[r] = 15;
}
}
if (bgd[r] == 5) {
f[r] = 8;
if (((bgs[r] == 15) or (bgs[r] == 10)) or (bgs[r] == 5)) {
cannons.start();
bgst[bsn] = 2;
bgsx[bsn] = bgx[r] - 20;
bgsy[bsn] = bgy[r] + 20;
bgsd[bsn] = 1;
bsn = bsn + 1;
if (bsn > 5) {
bsn = 1;
}
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 3;
bgs[r] = 20;
}
}
if (bgd[r] == 6) {
if (bgs[r] == 2) {
f[r] = 9;
}
if (bgs[r] == 1) {
f[r] = 10;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
f[r] = 11;
bgt[r] = 0;
bgx[r] = -500;
bgs[r] = 0;
}
}
}
}
r++;
}
r = 1;
while (r <= 5) {
if (bgst[r] > 0) {
if (bgst[r] == 1) {
if (r == 1) {
bgs1.gotoAndStop(1);
}
if (r == 2) {
bgs2.gotoAndStop(1);
}
if (r == 3) {
bgs3.gotoAndStop(1);
}
if (r == 4) {
bgs4.gotoAndStop(1);
}
if (r == 5) {
bgs5.gotoAndStop(1);
}
if (bgsd[r] == 0) {
bgsx[r] = bgsx[r] + 20;
if (bgsx[r] > (px + 300)) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgsd[r] == 1) {
bgsx[r] = bgsx[r] - 20;
if (bgsx[r] < (px - 300)) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgsd[r] == 2) {
bgsx[r] = bgsx[r] + 15;
bgsy[r] = bgsy[r] + 15;
if ((bgsx[r] > (px + 300)) or (bgsy[r] > (py + 300))) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgsd[r] == 3) {
bgsx[r] = bgsx[r] - 15;
bgsy[r] = bgsy[r] + 15;
if ((bgsx[r] > (px + 300)) or (bgsy[r] > (py + 300))) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgsd[r] == 4) {
bgsy[r] = bgsy[r] + 20;
if (bgsy[r] > (py + 300)) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (((((((bgsx[r] - 15) < (px + 10)) and ((bgsx[r] + 15) > (px - 10))) and ((bgsy[r] + 15) > (py + 5))) and ((bgsy[r] - 15) < (py + 20))) and (pcd < 18)) and (i < 1)) {
if ((bgsd[r] == 0) or (bgsd[r] == 2)) {
pcd = 19;
}
if ((bgsd[r] == 1) or (bgsd[r] == 3)) {
pcd = 18;
}
pstep = 2;
pl = pl - 3;
megah.start();
i = 10;
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgst[r] == 2) {
if (r == 1) {
bgs1.gotoAndStop(2);
}
if (r == 2) {
bgs2.gotoAndStop(2);
}
if (r == 3) {
bgs3.gotoAndStop(2);
}
if (r == 4) {
bgs4.gotoAndStop(2);
}
if (r == 5) {
bgs5.gotoAndStop(2);
}
if (bgsd[r] == 0) {
bgsx[r] = bgsx[r] + 30;
if (bgsx[r] > (px + 300)) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgsd[r] == 1) {
bgsx[r] = bgsx[r] - 30;
if (bgsx[r] < (px - 300)) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (((((((bgsx[r] - 25) < (px + 10)) and ((bgsx[r] + 25) > (px - 10))) and ((bgsy[r] + 80) > (py + 40))) and ((bgsy[r] + 35) < (py + 60))) and (pcd < 18)) and (i < 1)) {
if (bgsd[r] == 0) {
pcd = 19;
}
if (bgsd[r] == 1) {
pcd = 18;
}
pstep = 2;
pl = pl - 6;
megah.start();
i = 10;
bgst[r] = 0;
bgsx[r] = -200;
}
}
}
r++;
}
bg1.gotoAndStop(f[1]);
bg2.gotoAndStop(f[2]);
bg3.gotoAndStop(f[3]);
bg4.gotoAndStop(f[4]);
bg5.gotoAndStop(f[5]);
bg6.gotoAndStop(f[6]);
bg7.gotoAndStop(f[7]);
bg8.gotoAndStop(f[8]);
bgs1._x = ((bgsx[1] + 275) - px) / 2;
bgs1._y = ((bgsy[1] + 275) - py) / 2;
bgs2._x = ((bgsx[2] + 275) - px) / 2;
bgs2._y = ((bgsy[2] + 275) - py) / 2;
bgs3._x = ((bgsx[3] + 275) - px) / 2;
bgs3._y = ((bgsy[3] + 275) - py) / 2;
bgs4._x = ((bgsx[4] + 275) - px) / 2;
bgs4._y = ((bgsy[4] + 275) - py) / 2;
bgs5._x = ((bgsx[5] + 275) - px) / 2;
bgs5._y = ((bgsy[5] + 275) - py) / 2;
bg1._x = ((bgx[1] + 275) - px) / 2;
bg1._y = ((bgy[1] + 275) - py) / 2;
bg2._x = ((bgx[2] + 275) - px) / 2;
bg2._y = ((bgy[2] + 275) - py) / 2;
bg3._x = ((bgx[3] + 275) - px) / 2;
bg3._y = ((bgy[3] + 275) - py) / 2;
bg4._x = ((bgx[4] + 275) - px) / 2;
bg4._y = ((bgy[4] + 275) - py) / 2;
bg5._x = ((bgx[5] + 275) - px) / 2;
bg5._y = ((bgy[5] + 275) - py) / 2;
bg6._x = ((bgx[6] + 275) - px) / 2;
bg6._y = ((bgy[6] + 275) - py) / 2;
bg7._x = ((bgx[7] + 275) - px) / 2;
bg7._y = ((bgy[7] + 275) - py) / 2;
bg8._x = ((bgx[8] + 275) - px) / 2;
bg8._y = ((bgy[8] + 275) - py) / 2;
r = 1;
while (r <= 3) {
if (((pst[r] > 0) and (pst[r] < 4)) and (psd[r] == 0)) {
if (r == 1) {
shot1p._x = ((297 + psx[1]) - px) / 2;
shot1p._y = ((270 + psy[1]) - py) / 2;
}
if (r == 2) {
shot2p._x = ((297 + psx[2]) - px) / 2;
shot2p._y = ((270 + psy[2]) - py) / 2;
}
if (r == 3) {
shot3p._x = ((297 + psx[3]) - px) / 2;
shot3p._y = ((270 + psy[3]) - py) / 2;
}
}
if (((pst[r] > 0) and (pst[r] < 4)) and (psd[r] == 1)) {
if (r == 1) {
shot1p._x = ((247 + psx[1]) - px) / 2;
shot1p._y = ((270 + psy[1]) - py) / 2;
}
if (r == 2) {
shot2p._x = ((247 + psx[2]) - px) / 2;
shot2p._y = ((270 + psy[2]) - py) / 2;
}
if (r == 3) {
shot3p._x = ((247 + psx[3]) - px) / 2;
shot3p._y = ((270 + psy[3]) - py) / 2;
}
}
if ((pst[r] == 4) or (pst[r] == 5)) {
if (r == 1) {
shot1p._x = ((272 + psx[1]) - px) / 2;
shot1p._y = ((270 + psy[1]) - py) / 2;
}
if (r == 2) {
shot2p._x = ((272 + psx[2]) - px) / 2;
shot2p._y = ((270 + psy[2]) - py) / 2;
}
if (r == 3) {
shot3p._x = ((272 + psx[3]) - px) / 2;
shot3p._y = ((270 + psy[3]) - py) / 2;
}
}
if (pst[r] == 0) {
if (r == 1) {
shot1p._x = -200;
shot1p._y = (270 + psy[1]) - py;
}
if (r == 2) {
shot2p._x = -200;
shot2p._y = (270 + psy[2]) - py;
}
if (r == 3) {
shot3p._x = -200;
shot3p._y = (270 + psy[3]) - py;
}
}
r++;
}
if (i > 0) {
i = i - 1;
pc._alpha = 50;
}
if (i <= 0) {
i = i - 1;
pc._alpha = 100;
}
if (bcharge > 0) {
charge._alpha = bcharge;
}
lbar._height = 2 * pl;
lbar._y = 120 - (2 * pl);
stage._x = (275 - px) / 2;
stage._y = (375 - py) / 2;
exit._x = ((ex + 275) - px) / 2;
exit._y = ((ey + 275) - py) / 2;
stage2._x = stage2._x - 40;
if (stage2._x < -60) {
stage2._x = 325;
stage2._y = random(100) + 60;
}
Frame 164
gotoAndPlay (163);
if ((((px + 10) > (ex - 20)) and ((px - 10) < (ex + 20))) and (((py + 30) > (ey - 20)) and (py < (ey + 50)))) {
gotoAndPlay (165);
}
Frame 165
lbar._height = 2 * pl;
lbar._y = 120 - (2 * pl);
stage._x = (275 - px) / 2;
stage._y = (375 - py) / 2;
exit._x = ((ex + 275) - px) / 2;
exit._y = ((ey + 275) - py) / 2;
stage2._x = stage2._x - 40;
if (stage2._x < -60) {
stage2._x = 325;
stage2._y = random(100) + 60;
}
Frame 168
psn = 1;
bstep = 0;
pcd = 0;
bcharge = 0;
r = 1;
while (r <= 5) {
psx[r] = -200;
psy[r] = 0;
pst[r] = 0;
psd[r] = 0;
r++;
}
i = 0;
pl = pl + 5;
if (pl > 50) {
pl = 50;
}
px = 150;
py = 370;
r = 0;
while (r <= 26) {
bx[r] = -50;
by[r] = -50;
r++;
}
bx[1] = 50;
by[1] = 250;
bx[2] = 50;
by[2] = 350;
bx[3] = 150;
by[3] = 450;
bx[4] = 250;
by[4] = 450;
bx[5] = 350;
by[5] = 400;
bx[6] = 450;
by[6] = 350;
bx[7] = 550;
by[7] = 300;
bx[8] = 850;
by[8] = 450;
bx[9] = 950;
by[9] = 450;
bx[10] = 1050;
by[10] = 350;
bx[11] = 1150;
by[11] = 300;
bx[12] = 1250;
by[12] = 350;
bx[13] = 1350;
by[13] = 450;
bx[14] = 1450;
by[14] = 450;
bx[15] = 1750;
by[15] = 250;
bx[16] = 1750;
by[16] = 450;
bx[17] = 1850;
by[17] = 450;
bx[18] = 1950;
by[18] = 450;
bx[19] = 2050;
by[19] = 450;
bx[20] = 2050;
by[20] = 250;
bx[21] = 2150;
by[21] = 350;
bsn = 1;
r = 1;
while (r <= 8) {
bgx[r] = -200;
bgy[r] = -200;
bgt[r] = 0;
bgd[r] = -1;
bgs[r] = 0;
r++;
}
r = 1;
while (r <= 5) {
bgsx[r] = -200;
bgsy[r] = 0;
bgst[r] = 0;
bgsd[r] = 0;
r++;
}
r = 1;
while (r <= 8) {
f[r] = 20;
r++;
}
bgt[1] = 2;
bgd[1] = 0;
bgs[1] = 0;
bgl[1] = 3;
bgx[1] = 350;
bgy[1] = 300;
bgt[2] = 2;
bgd[2] = 0;
bgs[2] = 0;
bgl[2] = 3;
bgx[2] = 450;
bgy[2] = 250;
bgt[3] = 12;
bgd[3] = 0;
bgs[3] = 0;
bgl[3] = 2;
bgx[3] = 700;
bgy[3] = 100;
bgt[4] = 12;
bgd[4] = 0;
bgs[4] = 0;
bgl[4] = 2;
bgx[4] = 950;
bgy[4] = 250;
bgt[5] = 5;
bgd[5] = 0;
bgs[5] = 0;
bgl[5] = 6;
bgx[5] = 1050;
bgy[5] = 250;
bgt[6] = 12;
bgd[6] = 0;
bgs[6] = 0;
bgl[6] = 2;
bgx[6] = 1450;
bgy[6] = 150;
bgt[7] = 2;
bgd[7] = 0;
bgs[7] = 0;
bgl[7] = 3;
bgx[7] = 1350;
bgy[7] = 350;
bgt[8] = 5;
bgd[8] = 0;
bgs[8] = 0;
bgl[8] = 6;
bgx[8] = 1950;
bgy[8] = 350;
ex = 2050;
ey = 350;
Frame 169
b1._x = bx[1] / 10;
b1._y = (by[1] / 10) + 120;
b2._x = bx[2] / 10;
b2._y = (by[2] / 10) + 120;
b3._x = bx[3] / 10;
b3._y = (by[3] / 10) + 120;
b4._x = bx[4] / 10;
b4._y = (by[4] / 10) + 120;
b5._x = bx[5] / 10;
b5._y = (by[5] / 10) + 120;
b6._x = bx[6] / 10;
b6._y = (by[6] / 10) + 120;
b7._x = bx[7] / 10;
b7._y = (by[7] / 10) + 120;
b8._x = bx[8] / 10;
b8._y = (by[8] / 10) + 120;
b9._x = bx[9] / 10;
b9._y = (by[9] / 10) + 120;
b10._x = bx[10] / 10;
b10._y = (by[10] / 10) + 120;
b11._x = bx[11] / 10;
b11._y = (by[11] / 10) + 120;
b12._x = bx[12] / 10;
b12._y = (by[12] / 10) + 120;
b13._x = bx[13] / 10;
b13._y = (by[13] / 10) + 120;
b14._x = bx[14] / 10;
b14._y = (by[14] / 10) + 120;
b15._x = bx[15] / 10;
b15._y = (by[15] / 10) + 120;
b16._x = bx[16] / 10;
b16._y = (by[16] / 10) + 120;
b17._x = bx[17] / 10;
b17._y = (by[17] / 10) + 120;
b18._x = bx[18] / 10;
b18._y = (by[18] / 10) + 120;
b19._x = bx[19] / 10;
b19._y = (by[19] / 10) + 120;
b20._x = bx[20] / 10;
b20._y = (by[20] / 10) + 120;
b21._x = bx[21] / 10;
b21._y = (by[21] / 10) + 120;
b22._x = bx[22] / 10;
b22._y = (by[22] / 10) + 120;
b23._x = bx[23] / 10;
b23._y = (by[23] / 10) + 120;
b24._x = bx[24] / 10;
b24._y = (by[24] / 10) + 120;
b25._x = bx[25] / 10;
b25._y = (by[25] / 10) + 120;
b26._x = bx[26] / 10;
b26._y = (by[26] / 10) + 120;
b27._x = bx[27] / 10;
b27._y = (by[27] / 10) + 120;
b28._x = bx[28] / 10;
b28._y = (by[28] / 10) + 120;
cir._x = px / 10;
cir._y = (py / 10) + 120;
shot1._x = psx[1] / 10;
shot1._y = (psy[1] / 10) + 120;
shot2._x = psx[2] / 10;
shot2._y = (psy[2] / 10) + 120;
shot3._x = psx[3] / 10;
shot3._y = (psy[3] / 10) + 120;
bshot1._x = bgsx[1] / 10;
bshot1._y = (bgsy[1] / 10) + 120;
bshot2._x = bgsx[2] / 10;
bshot2._y = (bgsy[2] / 10) + 120;
bshot3._x = bgsx[3] / 10;
bshot3._y = (bgsy[3] / 10) + 120;
bshot4._x = bgsx[4] / 10;
bshot4._y = (bgsy[4] / 10) + 120;
bshot5._x = bgsx[5] / 10;
bshot5._y = (bgsy[5] / 10) + 120;
bcir1._x = bgx[1] / 10;
bcir1._y = (bgy[1] / 10) + 120;
bcir2._x = bgx[2] / 10;
bcir2._y = (bgy[2] / 10) + 120;
bcir3._x = bgx[3] / 10;
bcir3._y = (bgy[3] / 10) + 120;
bcir4._x = bgx[4] / 10;
bcir4._y = (bgy[4] / 10) + 120;
bcir5._x = bgx[5] / 10;
bcir5._y = (bgy[5] / 10) + 120;
bcir6._x = bgx[6] / 10;
bcir6._y = (bgy[6] / 10) + 120;
bcir7._x = bgx[7] / 10;
bcir7._y = (bgy[7] / 10) + 120;
bcir8._x = bgx[8] / 10;
bcir8._y = (bgy[8] / 10) + 120;
bcir9._x = bgx[9] / 10;
bcir9._y = (bgy[9] / 10) + 120;
bcir10._x = bgx[10] / 10;
bcir10._y = (bgy[10] / 10) + 120;
bcir11._x = bgx[11] / 10;
bcir11._y = (bgy[11] / 10) + 120;
bcir12._x = bgx[12] / 10;
bcir12._y = (bgy[12] / 10) + 120;
bcir13._x = bgx[13] / 10;
bcir13._y = (bgy[13] / 10) + 120;
if (Key.isDown(39) and (pcd == 0)) {
pcd = 2;
}
if (Key.isDown(39) and ((pcd == 1) or (pcd == 3))) {
pcd = 0;
}
if (Key.isDown(37) and (pcd == 1)) {
pcd = 3;
}
if (Key.isDown(37) and ((pcd == 0) or (pcd == 2))) {
pcd = 1;
}
if (Key.isDown(38) and ((pcd == 0) or (pcd == 2))) {
pcd = 10;
pstep = 7;
}
if (Key.isDown(38) and ((pcd == 1) or (pcd == 3))) {
pcd = 11;
pstep = 7;
}
if (Key.isDown(40) and ((((pcd == 0) or (pcd == 1)) or (pcd == 2)) or (pcd == 3))) {
if (((pcd == 0) or (pcd == 2)) or (pcd == 8)) {
pcd = 6;
pstep = 3;
}
if (((pcd == 1) or (pcd == 3)) or (pcd == 9)) {
pcd = 7;
pstep = 3;
}
}
if (Key.isDown(16) and (bcharge < 100)) {
bcharge = bcharge + 5;
}
if (pcd == 0) {
pc.gotoAndStop(1);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(21);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 0;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
}
if (pcd == 1) {
pc.gotoAndStop(2);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(22);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 1;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
}
if (pcd == 2) {
px = px + 13;
if ((w == 0) or (w == 1)) {
pc.gotoAndStop(3);
}
if ((w == 2) or (w == 3)) {
pc.gotoAndStop(4);
}
if ((w == 4) or (w == 5)) {
pc.gotoAndStop(5);
}
if ((w == 6) or (w == 7)) {
pc.gotoAndStop(6);
}
if (Key.isDown(32)) {
if ((w == 0) or (w == 1)) {
pc.gotoAndStop(11);
}
if ((w == 2) or (w == 3)) {
pc.gotoAndStop(12);
}
if ((w == 4) or (w == 5)) {
pc.gotoAndStop(13);
}
if ((w == 6) or (w == 7)) {
pc.gotoAndStop(14);
}
if ((pst[psn] == 0) and (bstep == 0)) {
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 0;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
}
pcd = 0;
}
if (pcd == 3) {
px = px - 13;
if ((w == 0) or (w == 1)) {
pc.gotoAndStop(7);
}
if ((w == 2) or (w == 3)) {
pc.gotoAndStop(8);
}
if ((w == 4) or (w == 5)) {
pc.gotoAndStop(9);
}
if ((w == 6) or (w == 7)) {
pc.gotoAndStop(10);
}
if (Key.isDown(32)) {
if ((w == 0) or (w == 1)) {
pc.gotoAndStop(15);
}
if ((w == 2) or (w == 3)) {
pc.gotoAndStop(16);
}
if ((w == 4) or (w == 5)) {
pc.gotoAndStop(17);
}
if ((w == 6) or (w == 7)) {
pc.gotoAndStop(18);
}
if ((pst[psn] == 0) and (bstep == 0)) {
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 1;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
}
pcd = 1;
}
if (pcd == 9) {
pstep = pstep - 1;
if (pstep <= 0) {
pcd = 1;
}
}
if (pcd == 6) {
pc.gotoAndStop(19);
px = px + 20;
pstep = pstep - 1;
if (pstep <= 0) {
pcd = 0;
}
}
if (pcd == 7) {
pc.gotoAndStop(20);
px = px - 20;
pstep = pstep - 1;
if (pstep <= 0) {
pcd = 1;
}
}
if (pcd == 12) {
pc.gotoAndStop(23);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(25);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 0;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
py = py + (5 * (7 - pstep));
pstep = pstep - 1;
if (pstep <= 2) {
pstep = 2;
}
if (Key.isDown(39)) {
px = px + 13;
}
if (Key.isDown(37)) {
px = px - 13;
if (bstep == 0) {
pcd = 13;
}
}
}
if (pcd == 13) {
pc.gotoAndStop(24);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(26);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 1;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
py = py + (5 * (7 - pstep));
pstep = pstep - 1;
if (pstep <= 2) {
pstep = 2;
}
if (Key.isDown(39)) {
px = px + 13;
if (bstep == 0) {
pcd = 12;
}
}
if (Key.isDown(37)) {
px = px - 13;
}
}
if (pcd == 10) {
pc.gotoAndStop(23);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(25);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 0;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
py = py - (5 * pstep);
pstep = pstep - 1;
if (Key.isDown(39)) {
px = px + 13;
}
if (Key.isDown(37)) {
px = px - 13;
if (bstep == 0) {
pcd = 11;
}
}
if (Key.isDown(40)) {
pcd = 12;
pstep = pstep + 3;
}
if (pstep <= -1) {
pstep = 7;
pcd = 12;
}
}
if (pcd == 11) {
pc.gotoAndStop(24);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(26);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 1;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
py = py - (5 * pstep);
pstep = pstep - 1;
if (Key.isDown(39)) {
px = px + 13;
if (bstep == 0) {
pcd = 10;
}
}
if (Key.isDown(37)) {
px = px - 13;
}
if (Key.isDown(40)) {
pcd = 13;
pstep = pstep + 3;
}
if (pstep <= -1) {
pstep = 7;
pcd = 13;
}
}
if (pcd == 18) {
pc.gotoAndStop(27);
pstep = pstep - 1;
px = px - 5;
if (pstep <= -1) {
pstep = 2;
pcd = 0;
}
}
if (pcd == 19) {
pc.gotoAndStop(28);
pstep = pstep - 1;
px = px + 5;
if (pstep <= -1) {
pstep = 2;
pcd = 1;
}
}
if (pcd == 20) {
pc.gotoAndStop(69 - pstep);
bcharge = 0;
charge._alpha = 0;
bstep = 20;
pl = 1;
pstep = pstep - 1;
if (pstep < 0) {
lives = lives - 1;
if (lives >= 0) {
pl = 50;
gotoAndPlay (145);
}
if (lives < 0) {
lives = 2;
continues = continues - 1;
gotoAndPlay (5);
}
}
}
if (pl <= 0) {
c = 1;
while (c <= 8) {
bgx[c] = -600;
c++;
}
pc._alpha = 100;
pcd = 20;
pstep = 40;
megad.start();
}
if (bstep > 0) {
bcharge = 0;
charge._alpha = bcharge;
}
if (bstep > 0) {
bstep = bstep - 1;
}
if ((py > 500) and (pcd < 20)) {
megad.start();
pl = 0;
}
w = w - 1;
if (w < 0) {
w = 7;
}
e = pcd;
c = 0;
r = 1;
while (r <= 21) {
if (((((bx[r] - 150) < px) and ((bx[r] + 150) > px)) and ((by[r] - 150) < py)) and ((by[r] + 150) > py)) {
if (((((((px - 30) < (bx[r] + 50)) and ((px + 20) > (bx[r] - 50))) and (py < (by[r] - 50))) and ((py + 60) > (by[r] - 50))) and (pcd != 10)) and (pcd != 11)) {
if ((((pcd == 12) or (pcd == 13)) or (pcd == 16)) or (pcd == 17)) {
if ((pcd == 12) or (pcd == 16)) {
pcd = 0;
}
if ((pcd == 13) or (pcd == 17)) {
pcd = 1;
}
}
c = 1;
py = by[r] - 75;
}
if (((((px + 38) > (bx[r] - 50)) and ((px + 20) < bx[r])) and (py < (by[r] + 50))) and ((py + 20) > (by[r] - 50))) {
px = bx[r] - 85;
}
if (((((px - 35) < (bx[r] + 50)) and ((px - 20) > bx[r])) and (py < (by[r] + 50))) and ((py + 20) > (by[r] - 50))) {
px = bx[r] + 85;
}
if (((((px - 5) < (bx[r] + 50)) and ((px + 5) > (bx[r] - 50))) and ((py - 30) < (by[r] + 50))) and ((py + 10) > (by[r] + 50))) {
if ((((pcd == 10) or (pcd == 11)) or (pcd == 14)) or (pcd == 15)) {
if ((pcd == 10) or (pcd == 14)) {
pcd = 12;
pstep = 5;
}
if ((pcd == 11) or (pcd == 15)) {
pcd = 13;
pstep = 5;
}
}
py = by[r] + 90;
}
}
r++;
}
if (c == 0) {
if ((((pcd == 0) or (pcd == 2)) or (pcd == 6)) or (pcd == 18)) {
pcd = 12;
pstep = 6;
}
if ((((pcd == 1) or (pcd == 3)) or (pcd == 7)) or (pcd == 19)) {
pcd = 13;
pstep = 6;
}
}
r = 1;
while (r <= 3) {
if (pst[r] == 1) {
if (psd[r] == 0) {
psx[r] = psx[r] + 30;
if (r == 1) {
shot1p.gotoAndStop(1);
}
if (r == 2) {
shot2p.gotoAndStop(1);
}
if (r == 3) {
shot3p.gotoAndStop(1);
}
if (psx[r] > (px + 280)) {
pst[r] = 0;
psx[r] = -200;
}
}
if (psd[r] == 1) {
psx[r] = psx[r] - 30;
if (r == 1) {
shot1p.gotoAndStop(2);
}
if (r == 2) {
shot2p.gotoAndStop(2);
}
if (r == 3) {
shot3p.gotoAndStop(2);
}
if (psx[r] < (px - 280)) {
pst[r] = 0;
psx[r] = -200;
}
}
}
if (pst[r] == 2) {
if (psd[r] == 0) {
psx[r] = psx[r] + 35;
if (r == 1) {
shot1p.gotoAndStop(3);
}
if (r == 2) {
shot2p.gotoAndStop(3);
}
if (r == 3) {
shot3p.gotoAndStop(3);
}
if (psx[r] > (px + 280)) {
pst[r] = 0;
psx[r] = -200;
}
}
if (psd[r] == 1) {
psx[r] = psx[r] - 35;
if (r == 1) {
shot1p.gotoAndStop(4);
}
if (r == 2) {
shot2p.gotoAndStop(4);
}
if (r == 3) {
shot3p.gotoAndStop(4);
}
if (psx[r] < (px - 280)) {
pst[r] = 0;
psx[r] = -200;
}
}
}
if (pst[r] == 3) {
if (psd[r] == 0) {
psx[r] = psx[r] + 40;
if (r == 1) {
shot1p.gotoAndStop(5);
}
if (r == 2) {
shot2p.gotoAndStop(5);
}
if (r == 3) {
shot3p.gotoAndStop(5);
}
if (psx[r] > (px + 280)) {
pst[r] = 0;
psx[r] = -200;
}
}
if (psd[r] == 1) {
psx[r] = psx[r] - 40;
if (r == 1) {
shot1p.gotoAndStop(6);
}
if (r == 2) {
shot2p.gotoAndStop(6);
}
if (r == 3) {
shot3p.gotoAndStop(6);
}
if (psx[r] < (px - 280)) {
pst[r] = 0;
psx[r] = -200;
}
}
}
if (pst[r] == 4) {
if (r == 1) {
shot1p.gotoAndStop(10 - psd[r]);
}
if (r == 2) {
shot2p.gotoAndStop(10 - psd[r]);
}
if (r == 3) {
shot3p.gotoAndStop(10 - psd[r]);
}
psd[r] = psd[r] - 1;
if (psd[r] < 0) {
pst[r] = 0;
psx[r] = -200;
}
}
if (pst[r] == 5) {
if (r == 1) {
shot1p.gotoAndStop(14 - psd[r]);
}
if (r == 2) {
shot2p.gotoAndStop(14 - psd[r]);
}
if (r == 3) {
shot3p.gotoAndStop(14 - psd[r]);
}
psd[r] = psd[r] - 1;
if (psd[r] < 0) {
pst[r] = 0;
psx[r] = -200;
}
}
r++;
}
while (c <= 8) {
r = 1;
while (r <= 3) {
if ((pst[r] > 0) and (pst[r] < 4)) {
if (((((bgt[c] == 2) and ((bgx[c] - 35) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 35) > (psx[r] - ((pst[r] * 20) - 20)))) and (bgy[c] < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 50) > (psy[r] - ((pst[r] * 20) - 20)))) {
if ((((bgd[c] == 0) or (bgd[c] == 3)) or (bgd[c] == 1)) or (bgd[c] == 4)) {
deflect.start();
pst[r] = 5;
psd[r] = 2;
}
if ((bgd[c] == 2) or (bgd[c] == 5)) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd2.start();
bgd[c] = 6;
bgs[c] = 6;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
if (((((bgt[c] == 5) and ((bgx[c] - 40) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 40) > (psx[r] - ((pst[r] * 20) - 20)))) and ((bgy[c] - 20) < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 50) > (psy[r] - ((pst[r] * 20) - 20)))) {
if ((((bgd[c] == 0) or (bgd[c] == 1)) or (bgd[c] == 2)) or (bgd[c] == 3)) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd1.start();
bgd[c] = 4;
bgs[c] = 5;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
if (((((bgt[c] == 12) and ((bgx[c] - 25) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 25) > (psx[r] - ((pst[r] * 20) - 20)))) and (bgy[c] < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 50) > (psy[r] - ((pst[r] * 20) - 20)))) {
if ((bgd[c] == 0) or (bgd[c] == 1)) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd2.start();
bgd[c] = 2;
bgs[c] = 3;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
}
r++;
}
c++;
}
r = 1;
while (r <= 8) {
if (((((bgt[r] > 0) and ((bgx[r] - 340) < px)) and ((bgx[r] + 340) > px)) and ((bgy[r] - 180) < py)) and ((bgy[r] + 350) > py)) {
c = 0;
e = 1;
while (e <= 21) {
if (((((bx[e] - 150) < bgx[r]) and ((bx[e] + 150) > bgx[r])) and ((by[e] - 150) < bgy[r])) and ((by[e] + 150) > bgy[r])) {
if (((((bgx[r] + 20) >= (bx[e] - 50)) and ((bgx[r] - 20) <= (bx[e] + 50))) and ((bgy[r] + 45) > (by[e] - 60))) and ((bgy[r] - 10) < (by[e] - 40))) {
c = 1;
}
if (((((bgx[r] + 20) > (bx[e] - 50)) and ((bgx[r] + 20) < bx[e])) and (bgy[r] < (by[e] + 50))) and ((bgy[r] + 20) > (by[e] - 50))) {
bgx[r] = bx[e] - 70;
}
if (((((bgx[r] - 20) < (bx[e] + 50)) and ((bgx[r] + 20) > bx[e])) and (bgy[r] < (by[e] + 50))) and ((bgy[r] + 20) > (by[e] - 50))) {
bgx[r] = bx[e] + 70;
}
if (((((bgx[r] - 5) < (bx[e] + 50)) and ((bgx[r] + 5) > (bx[e] - 50))) and ((bgy[r] - 30) < (by[e] + 50))) and (bgy[r] > (by[e] + 50))) {
bgy[r] = by[e] + 70;
}
if (((((bgx[r] - 2) < (bx[e] + 50)) and ((bgx[r] + 2) > (bx[e] - 50))) and ((bgy[r] + 20) < (by[e] - 50))) and ((bgy[r] + 60) > (by[e] - 50))) {
c = 1;
bgy[r] = by[e] - 105;
}
}
e++;
}
if (c == 0) {
bgy[r] = bgy[r] + 10;
}
if (bgt[r] == 2) {
if (((((((bgx[r] - 15) < (px + 10)) and ((bgx[r] + 15) > (px - 10))) and ((bgy[r] + 80) > (py - 10))) and ((bgy[r] + 50) < (py + 50))) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 3;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 3;
}
megah.start();
i = 10;
}
if (bgd[r] == 0) {
f[r] = 1;
if (px < bgx[r]) {
bgd[r] = 3;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 1;
bgs[r] = 10;
}
}
if (bgd[r] == 3) {
f[r] = 5;
if (px > bgx[r]) {
bgd[r] = 0;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 4;
bgs[r] = 10;
}
}
if (bgd[r] == 1) {
f[r] = 2;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 2;
bgs[r] = 12;
}
}
if (bgd[r] == 2) {
if (((bgs[r] == 12) or (bgs[r] == 11)) or (bgs[r] == 10)) {
f[r] = 3;
}
if (((bgs[r] == 9) or (bgs[r] == 8)) or (bgs[r] == 7)) {
f[r] = 4;
}
if (((bgs[r] == 6) or (bgs[r] == 5)) or (bgs[r] == 4)) {
f[r] = 3;
}
if (((bgs[r] == 3) or (bgs[r] == 2)) or (bgs[r] == 1)) {
f[r] = 4;
}
bgx[r] = bgx[r] + 8;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 0;
bgs[r] = 10 + random(20);
}
}
if (bgd[r] == 4) {
f[r] = 6;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 5;
bgs[r] = 12;
}
}
if (bgd[r] == 5) {
if (((bgs[r] == 12) or (bgs[r] == 11)) or (bgs[r] == 10)) {
f[r] = 7;
}
if (((bgs[r] == 9) or (bgs[r] == 8)) or (bgs[r] == 7)) {
f[r] = 8;
}
if (((bgs[r] == 6) or (bgs[r] == 5)) or (bgs[r] == 4)) {
f[r] = 7;
}
if (((bgs[r] == 3) or (bgs[r] == 2)) or (bgs[r] == 1)) {
f[r] = 8;
}
bgx[r] = bgx[r] - 8;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 3;
bgs[r] = 10 + random(20);
}
}
if (bgd[r] == 6) {
if (bgs[r] == 6) {
f[r] = 9;
}
if (bgs[r] == 5) {
f[r] = 10;
}
if (bgs[r] == 4) {
f[r] = 11;
}
if (bgs[r] == 3) {
f[r] = 12;
}
if (bgs[r] == 2) {
f[r] = 13;
}
if (bgs[r] == 1) {
f[r] = 14;
}
bgs[r] = bgs[r] - 1;
bgy[r] = bgy[r] - 10;
if (bgs[r] <= 0) {
f[r] = 15;
bgt[r] = 0;
bgx[r] = -500;
bgs[r] = 0;
}
}
}
if (bgt[r] == 5) {
if (((((((bgx[r] - 20) < (px + 10)) and ((bgx[r] + 20) > (px - 10))) and ((bgy[r] + 80) > (py + 10))) and ((bgy[r] + 30) < (py + 50))) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 3;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 3;
}
megah.start();
i = 10;
}
if (bgd[r] == 0) {
f[r] = 1;
if (px < bgx[r]) {
bgd[r] = 2;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
cannons.start();
bgd[r] = 1;
bgs[r] = 8;
bgst[bsn] = 2;
bgsx[bsn] = bgx[r] - 20;
bgsy[bsn] = bgy[r] + 20;
bgsd[bsn] = 0;
bsn = bsn + 1;
if (bsn > 5) {
bsn = 1;
}
}
}
if (bgd[r] == 2) {
f[r] = 3;
if (px > bgx[r]) {
bgd[r] = 0;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
cannons.start();
bgd[r] = 3;
bgs[r] = 7;
bgst[bsn] = 2;
bgsx[bsn] = bgx[r] + 20;
bgsy[bsn] = bgy[r] + 20;
bgsd[bsn] = 1;
bsn = bsn + 1;
if (bsn > 5) {
bsn = 1;
}
}
}
if (bgd[r] == 1) {
f[r] = 2;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 0;
bgs[r] = 10 + random(15);
}
}
if (bgd[r] == 3) {
f[r] = 4;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 2;
bgs[r] = 10 + random(15);
}
}
if (bgd[r] == 4) {
if (bgs[r] == 5) {
f[r] = 5;
}
if (bgs[r] == 4) {
f[r] = 6;
}
if (bgs[r] == 3) {
f[r] = 7;
}
if (bgs[r] == 2) {
f[r] = 8;
}
if (bgs[r] == 1) {
f[r] = 9;
}
bgs[r] = bgs[r] - 1;
bgy[r] = bgy[r] - 10;
if (bgs[r] <= 0) {
f[r] = 10;
bgt[r] = 0;
bgx[r] = -500;
bgs[r] = 0;
}
}
}
if (bgt[r] == 12) {
if (((((((bgx[r] - 20) < (px + 10)) and ((bgx[r] + 20) > (px - 10))) and ((bgy[r] + 40) > py)) and ((bgy[r] - 20) < (py + 50))) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 3;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 3;
}
megah.start();
i = 10;
}
if (bgd[r] == 0) {
if (bgs[r] == 1) {
f[r] = 1;
}
if (bgs[r] == 2) {
f[r] = 2;
}
bgy[r] = bgy[r] - 10;
bgx[r] = bgx[r] + 7;
if ((py - 60) < bgy[r]) {
bgy[r] = bgy[r] - 5;
}
if ((((px - 70) < bgx[r]) and ((px + 70) > bgx[r])) and (py > bgy[r])) {
bgy[r] = bgy[r] + 12;
}
if ((px + 100) < bgx[r]) {
bgd[r] = 1;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgs[r] = 2;
}
}
if (bgd[r] == 1) {
if (bgs[r] == 1) {
f[r] = 3;
}
if (bgs[r] == 2) {
f[r] = 4;
}
bgy[r] = bgy[r] - 10;
bgx[r] = bgx[r] - 7;
if ((py - 60) < bgy[r]) {
bgy[r] = bgy[r] - 5;
}
if ((((px - 70) < bgx[r]) and ((px + 70) > bgx[r])) and (py > bgy[r])) {
bgy[r] = bgy[r] + 12;
}
if ((px - 100) > bgx[r]) {
bgd[r] = 0;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgs[r] = 2;
}
}
if (bgd[r] == 2) {
if (bgs[r] == 4) {
f[r] = 5;
}
if (bgs[r] == 3) {
f[r] = 6;
}
if (bgs[r] == 2) {
f[r] = 7;
}
if (bgs[r] == 1) {
f[r] = 8;
}
bgs[r] = bgs[r] - 1;
bgy[r] = bgy[r] - 10;
if (bgs[r] <= 0) {
bgx[r] = -500;
f[r] = 9;
bgt[r] = 0;
bgs[r] = 0;
}
}
}
}
r++;
}
r = 1;
while (r <= 5) {
if (bgst[r] > 0) {
if (bgst[r] == 1) {
if (r == 1) {
bgs1.gotoAndStop(1);
}
if (r == 2) {
bgs2.gotoAndStop(1);
}
if (r == 3) {
bgs3.gotoAndStop(1);
}
if (r == 4) {
bgs4.gotoAndStop(1);
}
if (r == 5) {
bgs5.gotoAndStop(1);
}
if (bgsd[r] == 0) {
bgsx[r] = bgsx[r] + 20;
if (bgsx[r] > (px + 300)) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgsd[r] == 1) {
bgsx[r] = bgsx[r] - 20;
if (bgsx[r] < (px - 300)) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgsd[r] == 2) {
bgsx[r] = bgsx[r] + 15;
bgsy[r] = bgsy[r] + 15;
if ((bgsx[r] > (px + 300)) or (bgsy[r] > (py + 300))) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgsd[r] == 3) {
bgsx[r] = bgsx[r] - 15;
bgsy[r] = bgsy[r] + 15;
if ((bgsx[r] > (px + 300)) or (bgsy[r] > (py + 300))) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgsd[r] == 4) {
bgsy[r] = bgsy[r] + 20;
if (bgsy[r] > (py + 300)) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (((((((bgsx[r] - 15) < (px + 10)) and ((bgsx[r] + 15) > (px - 10))) and ((bgsy[r] + 15) > (py + 5))) and ((bgsy[r] - 15) < (py + 20))) and (pcd < 18)) and (i < 1)) {
if ((bgsd[r] == 0) or (bgsd[r] == 2)) {
pcd = 19;
}
if ((bgsd[r] == 1) or (bgsd[r] == 3)) {
pcd = 18;
}
pstep = 2;
pl = pl - 3;
megah.start();
i = 10;
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgst[r] == 2) {
if (r == 1) {
bgs1.gotoAndStop(2);
}
if (r == 2) {
bgs2.gotoAndStop(2);
}
if (r == 3) {
bgs3.gotoAndStop(2);
}
if (r == 4) {
bgs4.gotoAndStop(2);
}
if (r == 5) {
bgs5.gotoAndStop(2);
}
if (bgsd[r] == 0) {
bgsx[r] = bgsx[r] + 30;
if (bgsx[r] > (px + 300)) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgsd[r] == 1) {
bgsx[r] = bgsx[r] - 30;
if (bgsx[r] < (px - 300)) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (((((((bgsx[r] - 25) < (px + 10)) and ((bgsx[r] + 25) > (px - 10))) and ((bgsy[r] + 80) > (py + 40))) and ((bgsy[r] + 35) < (py + 60))) and (pcd < 18)) and (i < 1)) {
if (bgsd[r] == 0) {
pcd = 19;
}
if (bgsd[r] == 1) {
pcd = 18;
}
pstep = 2;
pl = pl - 6;
megah.start();
i = 10;
bgst[r] = 0;
bgsx[r] = -200;
}
}
}
r++;
}
bg1.gotoAndStop(f[1]);
bg2.gotoAndStop(f[2]);
bg3.gotoAndStop(f[3]);
bg4.gotoAndStop(f[4]);
bg5.gotoAndStop(f[5]);
bg6.gotoAndStop(f[6]);
bg7.gotoAndStop(f[7]);
bg8.gotoAndStop(f[8]);
bgs1._x = ((bgsx[1] + 275) - px) / 2;
bgs1._y = ((bgsy[1] + 275) - py) / 2;
bgs2._x = ((bgsx[2] + 275) - px) / 2;
bgs2._y = ((bgsy[2] + 275) - py) / 2;
bgs3._x = ((bgsx[3] + 275) - px) / 2;
bgs3._y = ((bgsy[3] + 275) - py) / 2;
bgs4._x = ((bgsx[4] + 275) - px) / 2;
bgs4._y = ((bgsy[4] + 275) - py) / 2;
bgs5._x = ((bgsx[5] + 275) - px) / 2;
bgs5._y = ((bgsy[5] + 275) - py) / 2;
bg1._x = ((bgx[1] + 275) - px) / 2;
bg1._y = ((bgy[1] + 275) - py) / 2;
bg2._x = ((bgx[2] + 275) - px) / 2;
bg2._y = ((bgy[2] + 275) - py) / 2;
bg3._x = ((bgx[3] + 275) - px) / 2;
bg3._y = ((bgy[3] + 275) - py) / 2;
bg4._x = ((bgx[4] + 275) - px) / 2;
bg4._y = ((bgy[4] + 275) - py) / 2;
bg5._x = ((bgx[5] + 275) - px) / 2;
bg5._y = ((bgy[5] + 275) - py) / 2;
bg6._x = ((bgx[6] + 275) - px) / 2;
bg6._y = ((bgy[6] + 275) - py) / 2;
bg7._x = ((bgx[7] + 275) - px) / 2;
bg7._y = ((bgy[7] + 275) - py) / 2;
bg8._x = ((bgx[8] + 275) - px) / 2;
bg8._y = ((bgy[8] + 275) - py) / 2;
r = 1;
while (r <= 3) {
if (((pst[r] > 0) and (pst[r] < 4)) and (psd[r] == 0)) {
if (r == 1) {
shot1p._x = ((297 + psx[1]) - px) / 2;
shot1p._y = ((270 + psy[1]) - py) / 2;
}
if (r == 2) {
shot2p._x = ((297 + psx[2]) - px) / 2;
shot2p._y = ((270 + psy[2]) - py) / 2;
}
if (r == 3) {
shot3p._x = ((297 + psx[3]) - px) / 2;
shot3p._y = ((270 + psy[3]) - py) / 2;
}
}
if (((pst[r] > 0) and (pst[r] < 4)) and (psd[r] == 1)) {
if (r == 1) {
shot1p._x = ((247 + psx[1]) - px) / 2;
shot1p._y = ((270 + psy[1]) - py) / 2;
}
if (r == 2) {
shot2p._x = ((247 + psx[2]) - px) / 2;
shot2p._y = ((270 + psy[2]) - py) / 2;
}
if (r == 3) {
shot3p._x = ((247 + psx[3]) - px) / 2;
shot3p._y = ((270 + psy[3]) - py) / 2;
}
}
if ((pst[r] == 4) or (pst[r] == 5)) {
if (r == 1) {
shot1p._x = ((272 + psx[1]) - px) / 2;
shot1p._y = ((270 + psy[1]) - py) / 2;
}
if (r == 2) {
shot2p._x = ((272 + psx[2]) - px) / 2;
shot2p._y = ((270 + psy[2]) - py) / 2;
}
if (r == 3) {
shot3p._x = ((272 + psx[3]) - px) / 2;
shot3p._y = ((270 + psy[3]) - py) / 2;
}
}
if (pst[r] == 0) {
if (r == 1) {
shot1p._x = -200;
shot1p._y = (270 + psy[1]) - py;
}
if (r == 2) {
shot2p._x = -200;
shot2p._y = (270 + psy[2]) - py;
}
if (r == 3) {
shot3p._x = -200;
shot3p._y = (270 + psy[3]) - py;
}
}
r++;
}
if (i > 0) {
i = i - 1;
pc._alpha = 50;
}
if (i <= 0) {
i = i - 1;
pc._alpha = 100;
}
if (bcharge > 0) {
charge._alpha = bcharge;
}
lbar._height = 2 * pl;
lbar._y = 120 - (2 * pl);
stage._x = (275 - px) / 2;
stage._y = (375 - py) / 2;
exit._x = ((ex + 275) - px) / 2;
exit._y = ((ey + 275) - py) / 2;
stage2._x = stage2._x - 40;
if (stage2._x < -60) {
stage2._x = 325;
stage2._y = random(100) + 60;
}
Frame 170
gotoAndPlay (169);
if ((((px + 10) > (ex - 20)) and ((px - 10) < (ex + 20))) and (((py + 30) > (ey - 20)) and (py < (ey + 50)))) {
gotoAndPlay (171);
}
Frame 171
lbar._height = 2 * pl;
lbar._y = 120 - (2 * pl);
stage._x = (275 - px) / 2;
stage._y = (375 - py) / 2;
exit._x = ((ex + 275) - px) / 2;
exit._y = ((ey + 275) - py) / 2;
stage2._x = stage2._x - 40;
if (stage2._x < -60) {
stage2._x = 325;
stage2._y = random(100) + 60;
}
Frame 174
psn = 1;
bstep = 0;
pcd = 0;
bcharge = 0;
r = 1;
while (r <= 5) {
psx[r] = -200;
psy[r] = 0;
pst[r] = 0;
psd[r] = 0;
r++;
}
i = 0;
pl = pl + 5;
if (pl > 50) {
pl = 50;
}
px = 150;
py = 370;
r = 0;
while (r <= 26) {
bx[r] = -50;
by[r] = -50;
r++;
}
bx[1] = 50;
by[1] = 250;
bx[2] = 50;
by[2] = 350;
bx[3] = 150;
by[3] = 450;
bx[4] = 250;
by[4] = 450;
bx[5] = 550;
by[5] = 450;
bx[6] = 650;
by[6] = 450;
bx[7] = 750;
by[7] = 450;
bx[8] = 650;
by[8] = 250;
bx[9] = 950;
by[9] = 450;
bx[10] = 1050;
by[10] = 450;
bx[11] = 1150;
by[11] = 450;
bx[12] = 1050;
by[12] = 250;
bx[13] = 1450;
by[13] = 400;
bx[14] = 1550;
by[14] = 450;
bx[15] = 1650;
by[15] = 450;
bx[16] = 1650;
by[16] = 250;
bx[17] = 1850;
by[17] = 450;
bx[18] = 1850;
by[18] = 250;
bx[19] = 2050;
by[19] = 250;
bx[20] = 2050;
by[20] = 450;
bx[21] = 2150;
by[21] = 450;
bx[22] = 2150;
by[22] = 250;
bx[23] = 2250;
by[23] = 350;
bsn = 1;
r = 1;
while (r <= 8) {
bgx[r] = -200;
bgy[r] = -200;
bgt[r] = 0;
bgd[r] = -1;
bgs[r] = 0;
r++;
}
r = 1;
while (r <= 5) {
bgsx[r] = -200;
bgsy[r] = 0;
bgst[r] = 0;
bgsd[r] = 0;
r++;
}
r = 1;
while (r <= 8) {
f[r] = 20;
r++;
}
bgt[1] = 5;
bgd[1] = 0;
bgs[1] = 0;
bgl[1] = 6;
bgx[1] = 550;
bgy[1] = 350;
bgt[2] = 7;
bgd[2] = 0;
bgs[2] = 0;
bgl[2] = 2;
bgx[2] = 900;
bgy[2] = 200;
bgt[3] = 5;
bgd[3] = 0;
bgs[3] = 0;
bgl[3] = 6;
bgx[3] = 750;
bgy[3] = 350;
bgt[4] = 11;
bgd[4] = 0;
bgs[4] = 0;
bgl[4] = 6;
bgx[4] = 950;
bgy[4] = 350;
bgt[5] = 14;
bgd[5] = 3;
bgs[5] = 0;
bgl[5] = 2;
bgx[5] = 1375;
bgy[5] = 350;
bgt[6] = 5;
bgd[6] = 0;
bgs[6] = 0;
bgl[6] = 6;
bgx[6] = 1850;
bgy[6] = 350;
bgt[7] = 5;
bgd[7] = 0;
bgs[7] = 0;
bgl[7] = 6;
bgx[7] = 2050;
bgy[7] = 350;
ex = 2150;
ey = 350;
Frame 175
b1._x = bx[1] / 10;
b1._y = (by[1] / 10) + 120;
b2._x = bx[2] / 10;
b2._y = (by[2] / 10) + 120;
b3._x = bx[3] / 10;
b3._y = (by[3] / 10) + 120;
b4._x = bx[4] / 10;
b4._y = (by[4] / 10) + 120;
b5._x = bx[5] / 10;
b5._y = (by[5] / 10) + 120;
b6._x = bx[6] / 10;
b6._y = (by[6] / 10) + 120;
b7._x = bx[7] / 10;
b7._y = (by[7] / 10) + 120;
b8._x = bx[8] / 10;
b8._y = (by[8] / 10) + 120;
b9._x = bx[9] / 10;
b9._y = (by[9] / 10) + 120;
b10._x = bx[10] / 10;
b10._y = (by[10] / 10) + 120;
b11._x = bx[11] / 10;
b11._y = (by[11] / 10) + 120;
b12._x = bx[12] / 10;
b12._y = (by[12] / 10) + 120;
b13._x = bx[13] / 10;
b13._y = (by[13] / 10) + 120;
b14._x = bx[14] / 10;
b14._y = (by[14] / 10) + 120;
b15._x = bx[15] / 10;
b15._y = (by[15] / 10) + 120;
b16._x = bx[16] / 10;
b16._y = (by[16] / 10) + 120;
b17._x = bx[17] / 10;
b17._y = (by[17] / 10) + 120;
b18._x = bx[18] / 10;
b18._y = (by[18] / 10) + 120;
b19._x = bx[19] / 10;
b19._y = (by[19] / 10) + 120;
b20._x = bx[20] / 10;
b20._y = (by[20] / 10) + 120;
b21._x = bx[21] / 10;
b21._y = (by[21] / 10) + 120;
b22._x = bx[22] / 10;
b22._y = (by[22] / 10) + 120;
b23._x = bx[23] / 10;
b23._y = (by[23] / 10) + 120;
b24._x = bx[24] / 10;
b24._y = (by[24] / 10) + 120;
b25._x = bx[25] / 10;
b25._y = (by[25] / 10) + 120;
b26._x = bx[26] / 10;
b26._y = (by[26] / 10) + 120;
b27._x = bx[27] / 10;
b27._y = (by[27] / 10) + 120;
b28._x = bx[28] / 10;
b28._y = (by[28] / 10) + 120;
cir._x = px / 10;
cir._y = (py / 10) + 120;
shot1._x = psx[1] / 10;
shot1._y = (psy[1] / 10) + 120;
shot2._x = psx[2] / 10;
shot2._y = (psy[2] / 10) + 120;
shot3._x = psx[3] / 10;
shot3._y = (psy[3] / 10) + 120;
bshot1._x = bgsx[1] / 10;
bshot1._y = (bgsy[1] / 10) + 120;
bshot2._x = bgsx[2] / 10;
bshot2._y = (bgsy[2] / 10) + 120;
bshot3._x = bgsx[3] / 10;
bshot3._y = (bgsy[3] / 10) + 120;
bshot4._x = bgsx[4] / 10;
bshot4._y = (bgsy[4] / 10) + 120;
bshot5._x = bgsx[5] / 10;
bshot5._y = (bgsy[5] / 10) + 120;
bcir1._x = bgx[1] / 10;
bcir1._y = (bgy[1] / 10) + 120;
bcir2._x = bgx[2] / 10;
bcir2._y = (bgy[2] / 10) + 120;
bcir3._x = bgx[3] / 10;
bcir3._y = (bgy[3] / 10) + 120;
bcir4._x = bgx[4] / 10;
bcir4._y = (bgy[4] / 10) + 120;
bcir5._x = bgx[5] / 10;
bcir5._y = (bgy[5] / 10) + 120;
bcir6._x = bgx[6] / 10;
bcir6._y = (bgy[6] / 10) + 120;
bcir7._x = bgx[7] / 10;
bcir7._y = (bgy[7] / 10) + 120;
bcir8._x = bgx[8] / 10;
bcir8._y = (bgy[8] / 10) + 120;
bcir9._x = bgx[9] / 10;
bcir9._y = (bgy[9] / 10) + 120;
bcir10._x = bgx[10] / 10;
bcir10._y = (bgy[10] / 10) + 120;
bcir11._x = bgx[11] / 10;
bcir11._y = (bgy[11] / 10) + 120;
bcir12._x = bgx[12] / 10;
bcir12._y = (bgy[12] / 10) + 120;
bcir13._x = bgx[13] / 10;
bcir13._y = (bgy[13] / 10) + 120;
if (Key.isDown(39) and (pcd == 0)) {
pcd = 2;
}
if (Key.isDown(39) and ((pcd == 1) or (pcd == 3))) {
pcd = 0;
}
if (Key.isDown(37) and (pcd == 1)) {
pcd = 3;
}
if (Key.isDown(37) and ((pcd == 0) or (pcd == 2))) {
pcd = 1;
}
if (Key.isDown(38) and ((pcd == 0) or (pcd == 2))) {
pcd = 10;
pstep = 7;
}
if (Key.isDown(38) and ((pcd == 1) or (pcd == 3))) {
pcd = 11;
pstep = 7;
}
if (Key.isDown(40) and ((((pcd == 0) or (pcd == 1)) or (pcd == 2)) or (pcd == 3))) {
if (((pcd == 0) or (pcd == 2)) or (pcd == 8)) {
pcd = 6;
pstep = 3;
}
if (((pcd == 1) or (pcd == 3)) or (pcd == 9)) {
pcd = 7;
pstep = 3;
}
}
if (Key.isDown(16) and (bcharge < 100)) {
bcharge = bcharge + 5;
}
if (pcd == 0) {
pc.gotoAndStop(1);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(21);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 0;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
}
if (pcd == 1) {
pc.gotoAndStop(2);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(22);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 1;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
}
if (pcd == 2) {
px = px + 13;
if ((w == 0) or (w == 1)) {
pc.gotoAndStop(3);
}
if ((w == 2) or (w == 3)) {
pc.gotoAndStop(4);
}
if ((w == 4) or (w == 5)) {
pc.gotoAndStop(5);
}
if ((w == 6) or (w == 7)) {
pc.gotoAndStop(6);
}
if (Key.isDown(32)) {
if ((w == 0) or (w == 1)) {
pc.gotoAndStop(11);
}
if ((w == 2) or (w == 3)) {
pc.gotoAndStop(12);
}
if ((w == 4) or (w == 5)) {
pc.gotoAndStop(13);
}
if ((w == 6) or (w == 7)) {
pc.gotoAndStop(14);
}
if ((pst[psn] == 0) and (bstep == 0)) {
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 0;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
}
pcd = 0;
}
if (pcd == 3) {
px = px - 13;
if ((w == 0) or (w == 1)) {
pc.gotoAndStop(7);
}
if ((w == 2) or (w == 3)) {
pc.gotoAndStop(8);
}
if ((w == 4) or (w == 5)) {
pc.gotoAndStop(9);
}
if ((w == 6) or (w == 7)) {
pc.gotoAndStop(10);
}
if (Key.isDown(32)) {
if ((w == 0) or (w == 1)) {
pc.gotoAndStop(15);
}
if ((w == 2) or (w == 3)) {
pc.gotoAndStop(16);
}
if ((w == 4) or (w == 5)) {
pc.gotoAndStop(17);
}
if ((w == 6) or (w == 7)) {
pc.gotoAndStop(18);
}
if ((pst[psn] == 0) and (bstep == 0)) {
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 1;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
}
pcd = 1;
}
if (pcd == 9) {
pstep = pstep - 1;
if (pstep <= 0) {
pcd = 1;
}
}
if (pcd == 6) {
pc.gotoAndStop(19);
px = px + 20;
pstep = pstep - 1;
if (pstep <= 0) {
pcd = 0;
}
}
if (pcd == 7) {
pc.gotoAndStop(20);
px = px - 20;
pstep = pstep - 1;
if (pstep <= 0) {
pcd = 1;
}
}
if (pcd == 12) {
pc.gotoAndStop(23);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(25);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 0;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
py = py + (5 * (7 - pstep));
pstep = pstep - 1;
if (pstep <= 2) {
pstep = 2;
}
if (Key.isDown(39)) {
px = px + 13;
}
if (Key.isDown(37)) {
px = px - 13;
if (bstep == 0) {
pcd = 13;
}
}
}
if (pcd == 13) {
pc.gotoAndStop(24);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(26);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 1;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
py = py + (5 * (7 - pstep));
pstep = pstep - 1;
if (pstep <= 2) {
pstep = 2;
}
if (Key.isDown(39)) {
px = px + 13;
if (bstep == 0) {
pcd = 12;
}
}
if (Key.isDown(37)) {
px = px - 13;
}
}
if (pcd == 10) {
pc.gotoAndStop(23);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(25);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 0;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
py = py - (5 * pstep);
pstep = pstep - 1;
if (Key.isDown(39)) {
px = px + 13;
}
if (Key.isDown(37)) {
px = px - 13;
if (bstep == 0) {
pcd = 11;
}
}
if (Key.isDown(40)) {
pcd = 12;
pstep = pstep + 3;
}
if (pstep <= -1) {
pstep = 7;
pcd = 12;
}
}
if (pcd == 11) {
pc.gotoAndStop(24);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(26);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 1;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
py = py - (5 * pstep);
pstep = pstep - 1;
if (Key.isDown(39)) {
px = px + 13;
if (bstep == 0) {
pcd = 10;
}
}
if (Key.isDown(37)) {
px = px - 13;
}
if (Key.isDown(40)) {
pcd = 13;
pstep = pstep + 3;
}
if (pstep <= -1) {
pstep = 7;
pcd = 13;
}
}
if (pcd == 18) {
pc.gotoAndStop(27);
pstep = pstep - 1;
px = px - 5;
if (pstep <= -1) {
pstep = 2;
pcd = 0;
}
}
if (pcd == 19) {
pc.gotoAndStop(28);
pstep = pstep - 1;
px = px + 5;
if (pstep <= -1) {
pstep = 2;
pcd = 1;
}
}
if (pcd == 20) {
pc.gotoAndStop(69 - pstep);
bcharge = 0;
charge._alpha = 0;
bstep = 20;
pl = 1;
pstep = pstep - 1;
if (pstep < 0) {
lives = lives - 1;
if (lives >= 0) {
pl = 50;
gotoAndPlay (145);
}
if (lives < 0) {
lives = 2;
continues = continues - 1;
gotoAndPlay (5);
}
}
}
if (pl <= 0) {
c = 1;
while (c <= 8) {
bgx[c] = -600;
c++;
}
pc._alpha = 100;
pcd = 20;
pstep = 40;
megad.start();
}
if (bstep > 0) {
bcharge = 0;
charge._alpha = bcharge;
}
if (bstep > 0) {
bstep = bstep - 1;
}
if ((py > 500) and (pcd < 20)) {
megad.start();
pl = 0;
}
w = w - 1;
if (w < 0) {
w = 7;
}
e = pcd;
c = 0;
r = 1;
while (r <= 23) {
if (((((bx[r] - 150) < px) and ((bx[r] + 150) > px)) and ((by[r] - 150) < py)) and ((by[r] + 150) > py)) {
if (((((((px - 30) < (bx[r] + 50)) and ((px + 20) > (bx[r] - 50))) and (py < (by[r] - 50))) and ((py + 60) > (by[r] - 50))) and (pcd != 10)) and (pcd != 11)) {
if ((((pcd == 12) or (pcd == 13)) or (pcd == 16)) or (pcd == 17)) {
if ((pcd == 12) or (pcd == 16)) {
pcd = 0;
}
if ((pcd == 13) or (pcd == 17)) {
pcd = 1;
}
}
c = 1;
py = by[r] - 75;
}
if (((((px + 38) > (bx[r] - 50)) and ((px + 20) < bx[r])) and (py < (by[r] + 50))) and ((py + 20) > (by[r] - 50))) {
px = bx[r] - 85;
}
if (((((px - 35) < (bx[r] + 50)) and ((px - 20) > bx[r])) and (py < (by[r] + 50))) and ((py + 20) > (by[r] - 50))) {
px = bx[r] + 85;
}
if (((((px - 5) < (bx[r] + 50)) and ((px + 5) > (bx[r] - 50))) and ((py - 30) < (by[r] + 50))) and ((py + 10) > (by[r] + 50))) {
if ((((pcd == 10) or (pcd == 11)) or (pcd == 14)) or (pcd == 15)) {
if ((pcd == 10) or (pcd == 14)) {
pcd = 12;
pstep = 5;
}
if ((pcd == 11) or (pcd == 15)) {
pcd = 13;
pstep = 5;
}
}
py = by[r] + 90;
}
}
r++;
}
if (c == 0) {
if ((((pcd == 0) or (pcd == 2)) or (pcd == 6)) or (pcd == 18)) {
pcd = 12;
pstep = 6;
}
if ((((pcd == 1) or (pcd == 3)) or (pcd == 7)) or (pcd == 19)) {
pcd = 13;
pstep = 6;
}
}
r = 1;
while (r <= 3) {
if (pst[r] == 1) {
if (psd[r] == 0) {
psx[r] = psx[r] + 30;
if (r == 1) {
shot1p.gotoAndStop(1);
}
if (r == 2) {
shot2p.gotoAndStop(1);
}
if (r == 3) {
shot3p.gotoAndStop(1);
}
if (psx[r] > (px + 280)) {
pst[r] = 0;
psx[r] = -200;
}
}
if (psd[r] == 1) {
psx[r] = psx[r] - 30;
if (r == 1) {
shot1p.gotoAndStop(2);
}
if (r == 2) {
shot2p.gotoAndStop(2);
}
if (r == 3) {
shot3p.gotoAndStop(2);
}
if (psx[r] < (px - 280)) {
pst[r] = 0;
psx[r] = -200;
}
}
}
if (pst[r] == 2) {
if (psd[r] == 0) {
psx[r] = psx[r] + 35;
if (r == 1) {
shot1p.gotoAndStop(3);
}
if (r == 2) {
shot2p.gotoAndStop(3);
}
if (r == 3) {
shot3p.gotoAndStop(3);
}
if (psx[r] > (px + 280)) {
pst[r] = 0;
psx[r] = -200;
}
}
if (psd[r] == 1) {
psx[r] = psx[r] - 35;
if (r == 1) {
shot1p.gotoAndStop(4);
}
if (r == 2) {
shot2p.gotoAndStop(4);
}
if (r == 3) {
shot3p.gotoAndStop(4);
}
if (psx[r] < (px - 280)) {
pst[r] = 0;
psx[r] = -200;
}
}
}
if (pst[r] == 3) {
if (psd[r] == 0) {
psx[r] = psx[r] + 40;
if (r == 1) {
shot1p.gotoAndStop(5);
}
if (r == 2) {
shot2p.gotoAndStop(5);
}
if (r == 3) {
shot3p.gotoAndStop(5);
}
if (psx[r] > (px + 280)) {
pst[r] = 0;
psx[r] = -200;
}
}
if (psd[r] == 1) {
psx[r] = psx[r] - 40;
if (r == 1) {
shot1p.gotoAndStop(6);
}
if (r == 2) {
shot2p.gotoAndStop(6);
}
if (r == 3) {
shot3p.gotoAndStop(6);
}
if (psx[r] < (px - 280)) {
pst[r] = 0;
psx[r] = -200;
}
}
}
if (pst[r] == 4) {
if (r == 1) {
shot1p.gotoAndStop(10 - psd[r]);
}
if (r == 2) {
shot2p.gotoAndStop(10 - psd[r]);
}
if (r == 3) {
shot3p.gotoAndStop(10 - psd[r]);
}
psd[r] = psd[r] - 1;
if (psd[r] < 0) {
pst[r] = 0;
psx[r] = -200;
}
}
if (pst[r] == 5) {
if (r == 1) {
shot1p.gotoAndStop(14 - psd[r]);
}
if (r == 2) {
shot2p.gotoAndStop(14 - psd[r]);
}
if (r == 3) {
shot3p.gotoAndStop(14 - psd[r]);
}
psd[r] = psd[r] - 1;
if (psd[r] < 0) {
pst[r] = 0;
psx[r] = -200;
}
}
r++;
}
while (c <= 7) {
r = 1;
while (r <= 3) {
if ((pst[r] > 0) and (pst[r] < 4)) {
if (((((bgt[c] == 5) and ((bgx[c] - 40) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 40) > (psx[r] - ((pst[r] * 20) - 20)))) and ((bgy[c] - 20) < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 50) > (psy[r] - ((pst[r] * 20) - 20)))) {
if ((((bgd[c] == 0) or (bgd[c] == 1)) or (bgd[c] == 2)) or (bgd[c] == 3)) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd1.start();
bgd[c] = 4;
bgs[c] = 5;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
if (((((bgt[c] == 7) and ((bgx[c] - 35) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 35) > (psx[r] - ((pst[r] * 20) - 20)))) and ((bgy[c] - 50) < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 20) > (psy[r] - ((pst[r] * 20) - 20)))) {
if (bgd[c] == 0) {
deflect.start();
pst[r] = 5;
psd[r] = 2;
}
if ((bgd[c] == 2) or (bgd[c] == 1)) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd2.start();
bgd[c] = 3;
bgs[c] = 3;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
if (((((bgt[c] == 11) and ((bgx[c] - 25) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 25) > (psx[r] - ((pst[r] * 20) - 20)))) and (bgy[c] < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 50) > (psy[r] - ((pst[r] * 20) - 20)))) {
if ((((((bgd[c] == 0) or (bgd[c] == 1)) or (bgd[c] == 2)) or (bgd[c] == 3)) or (bgd[c] == 4)) or (bgd[c] == 5)) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd2.start();
bgd[c] = 6;
bgs[c] = 3;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
if (((((bgt[c] == 14) and ((bgx[c] - 20) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 20) > (psx[r] - ((pst[r] * 20) - 20)))) and ((bgy[c] - 20) < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 20) > (psy[r] - ((pst[r] * 20) - 20)))) {
if ((((bgd[c] == 0) or (bgd[c] == 1)) or (bgd[c] == 3)) or (bgd[c] == 4)) {
deflect.start();
pst[r] = 5;
psd[r] = 2;
}
if ((bgd[c] == 2) or (bgd[c] == 5)) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd2.start();
bgd[c] = 6;
bgs[c] = 3;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
}
r++;
}
c++;
}
r = 1;
while (r <= 7) {
if (((((bgt[r] > 0) and ((bgx[r] - 340) < px)) and ((bgx[r] + 340) > px)) and ((bgy[r] - 180) < py)) and ((bgy[r] + 350) > py)) {
c = 0;
e = 1;
while (e <= 23) {
if (((((bx[e] - 150) < bgx[r]) and ((bx[e] + 150) > bgx[r])) and ((by[e] - 150) < bgy[r])) and ((by[e] + 150) > bgy[r])) {
if (((((bgx[r] + 20) >= (bx[e] - 50)) and ((bgx[r] - 20) <= (bx[e] + 50))) and ((bgy[r] + 45) > (by[e] - 60))) and ((bgy[r] - 10) < (by[e] - 40))) {
c = 1;
}
if (((((bgx[r] + 20) > (bx[e] - 50)) and ((bgx[r] + 20) < bx[e])) and (bgy[r] < (by[e] + 50))) and ((bgy[r] + 20) > (by[e] - 50))) {
bgx[r] = bx[e] - 70;
}
if (((((bgx[r] - 20) < (bx[e] + 50)) and ((bgx[r] + 20) > bx[e])) and (bgy[r] < (by[e] + 50))) and ((bgy[r] + 20) > (by[e] - 50))) {
bgx[r] = bx[e] + 70;
}
if (((((bgx[r] - 5) < (bx[e] + 50)) and ((bgx[r] + 5) > (bx[e] - 50))) and ((bgy[r] - 30) < (by[e] + 50))) and (bgy[r] > (by[e] + 50))) {
bgy[r] = by[e] + 70;
}
if (((((bgx[r] - 2) < (bx[e] + 50)) and ((bgx[r] + 2) > (bx[e] - 50))) and ((bgy[r] + 20) < (by[e] - 50))) and ((bgy[r] + 60) > (by[e] - 50))) {
c = 1;
bgy[r] = by[e] - 105;
}
}
e++;
}
if (c == 0) {
bgy[r] = bgy[r] + 10;
}
if (bgt[r] == 5) {
if (((((((bgx[r] - 20) < (px + 10)) and ((bgx[r] + 20) > (px - 10))) and ((bgy[r] + 80) > (py + 10))) and ((bgy[r] + 30) < (py + 50))) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 3;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 3;
}
megah.start();
i = 10;
}
if (bgd[r] == 0) {
f[r] = 1;
if (px < bgx[r]) {
bgd[r] = 2;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
cannons.start();
bgd[r] = 1;
bgs[r] = 8;
bgst[bsn] = 2;
bgsx[bsn] = bgx[r] - 20;
bgsy[bsn] = bgy[r] + 20;
bgsd[bsn] = 0;
bsn = bsn + 1;
if (bsn > 5) {
bsn = 1;
}
}
}
if (bgd[r] == 2) {
f[r] = 3;
if (px > bgx[r]) {
bgd[r] = 0;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
cannons.start();
bgd[r] = 3;
bgs[r] = 7;
bgst[bsn] = 2;
bgsx[bsn] = bgx[r] + 20;
bgsy[bsn] = bgy[r] + 20;
bgsd[bsn] = 1;
bsn = bsn + 1;
if (bsn > 5) {
bsn = 1;
}
}
}
if (bgd[r] == 1) {
f[r] = 2;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 0;
bgs[r] = 10 + random(15);
}
}
if (bgd[r] == 3) {
f[r] = 4;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 2;
bgs[r] = 10 + random(15);
}
}
if (bgd[r] == 4) {
if (bgs[r] == 5) {
f[r] = 5;
}
if (bgs[r] == 4) {
f[r] = 6;
}
if (bgs[r] == 3) {
f[r] = 7;
}
if (bgs[r] == 2) {
f[r] = 8;
}
if (bgs[r] == 1) {
f[r] = 9;
}
bgs[r] = bgs[r] - 1;
bgy[r] = bgy[r] - 10;
if (bgs[r] <= 0) {
f[r] = 10;
bgt[r] = 0;
bgx[r] = -500;
bgs[r] = 0;
}
}
}
if (bgt[r] == 7) {
if (((((((bgx[r] - 20) < (px + 10)) and ((bgx[r] + 20) > (px - 10))) and ((bgy[r] + 20) > (py + 10))) and ((bgy[r] + 20) < (py + 50))) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 3;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 3;
}
megah.start();
i = 10;
}
if (bgd[r] == 0) {
f[r] = 1;
bgy[r] = bgy[r] - 10;
if ((px + 80) < bgx[r]) {
bgx[r] = bgx[r] - 5;
}
if ((px - 80) > bgx[r]) {
bgx[r] = bgx[r] + 5;
}
if ((py - 70) < bgy[r]) {
bgy[r] = bgy[r] - 5;
}
if ((py - 70) > bgy[r]) {
bgy[r] = bgy[r] + 5;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
joes.start();
if (px > bgx[r]) {
bgd[r] = 1;
}
if (px < bgx[r]) {
bgd[r] = 2;
}
if (px < bgx[r]) {
bgsd[bsn] = 3;
if ((py - 50) < bgy[r]) {
bgsd[bsn] = 1;
}
}
if (px > bgx[r]) {
bgsd[bsn] = 2;
if ((py - 50) < bgy[r]) {
bgsd[bsn] = 0;
}
}
bgs[r] = 12;
bgst[bsn] = 1;
bgsx[bsn] = bgx[r];
bgsy[bsn] = bgy[r];
bsn = bsn + 1;
if (bsn > 5) {
bsn = 1;
}
}
}
if (bgd[r] == 1) {
f[r] = 2;
bgy[r] = bgy[r] - 10;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 0;
bgs[r] = 10 + random(25);
}
}
if (bgd[r] == 2) {
f[r] = 3;
bgy[r] = bgy[r] - 10;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 0;
bgs[r] = 10 + random(25);
}
}
if (bgd[r] == 3) {
if (bgs[r] == 3) {
f[r] = 4;
}
if (bgs[r] == 2) {
f[r] = 5;
}
if (bgs[r] == 1) {
f[r] = 6;
}
bgs[r] = bgs[r] - 1;
bgy[r] = bgy[r] - 10;
if (bgs[r] <= 0) {
f[r] = 7;
bgt[r] = 0;
bgx[r] = -500;
bgs[r] = 0;
}
}
}
if (bgt[r] == 11) {
if (((((((bgx[r] - 20) < (px + 10)) and ((bgx[r] + 20) > (px - 10))) and ((bgy[r] + 50) > (py - 10))) and (bgy[r] < (py + 50))) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 3;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 3;
}
megah.start();
i = 10;
}
if (bgd[r] == 0) {
if (((bgs[r] == 12) or (bgs[r] == 11)) or (bgs[r] == 10)) {
f[r] = 1;
}
if (((bgs[r] == 9) or (bgs[r] == 8)) or (bgs[r] == 7)) {
f[r] = 2;
}
if (((bgs[r] == 6) or (bgs[r] == 5)) or (bgs[r] == 4)) {
f[r] = 1;
}
if (((bgs[r] == 3) or (bgs[r] == 2)) or (bgs[r] == 1)) {
f[r] = 2;
}
if (bgx[r] > px) {
bgd[r] = 3;
bgs[r] = 12;
}
bgx[r] = bgx[r] + 6;
if (((bgx[r] + 150) > (px - 20)) and (bgx[r] < px)) {
bgd[r] = 1;
bgs[r] = 9;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgs[r] = 12;
}
}
if (bgd[r] == 1) {
f[r] = 3;
bgx[r] = bgx[r] + 12;
bgy[r] = bgy[r] - 20;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 2;
bgs[r] = 10;
}
}
if (bgd[r] == 2) {
f[r] = 3;
bgx[r] = bgx[r] + 12;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 0;
bgs[r] = 12;
}
}
if (bgd[r] == 3) {
if (((bgs[r] == 12) or (bgs[r] == 11)) or (bgs[r] == 10)) {
f[r] = 4;
}
if (((bgs[r] == 9) or (bgs[r] == 8)) or (bgs[r] == 7)) {
f[r] = 5;
}
if (((bgs[r] == 6) or (bgs[r] == 5)) or (bgs[r] == 4)) {
f[r] = 4;
}
if (((bgs[r] == 3) or (bgs[r] == 2)) or (bgs[r] == 1)) {
f[r] = 5;
}
if (bgx[r] < px) {
bgd[r] = 0;
bgs[r] = 12;
}
bgx[r] = bgx[r] - 6;
if (((bgx[r] - 150) < (px - 20)) and (bgx[r] > px)) {
bgd[r] = 4;
bgs[r] = 9;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgs[r] = 12;
}
}
if (bgd[r] == 4) {
f[r] = 6;
bgx[r] = bgx[r] - 12;
bgy[r] = bgy[r] - 20;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 5;
bgs[r] = 10;
}
}
if (bgd[r] == 5) {
f[r] = 6;
bgx[r] = bgx[r] - 12;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 3;
bgs[r] = 12;
}
}
if (bgd[r] == 6) {
if (bgs[r] == 3) {
f[r] = 7;
}
if (bgs[r] == 2) {
f[r] = 8;
}
if (bgs[r] == 1) {
f[r] = 9;
}
bgs[r] = bgs[r] - 1;
bgy[r] = bgy[r] - 10;
if (bgs[r] <= 0) {
f[r] = 15;
bgt[r] = 0;
bgx[r] = -500;
bgs[r] = 0;
}
}
}
if (bgt[r] == 14) {
if (((((((bgx[r] - 20) < (px + 10)) and ((bgx[r] + 20) > (px - 10))) and ((bgy[r] + 50) > (py + 10))) and ((bgy[r] + 20) < (py + 50))) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 2;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 2;
}
megah.start();
i = 10;
}
if (bgt[r] > 0) {
bgy[r] = bgy[r] - 10;
}
if (bgd[r] == 0) {
f[r] = 1;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 1;
bgs[r] = 6;
}
}
if (bgd[r] == 1) {
if (((bgs[r] == 6) or (bgs[r] == 5)) or (bgs[r] == 4)) {
f[r] = 2;
}
if (((bgs[r] == 3) or (bgs[r] == 2)) or (bgs[r] == 1)) {
f[r] = 3;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 2;
bgs[r] = 15;
}
}
if (bgd[r] == 2) {
f[r] = 4;
if (((bgs[r] == 15) or (bgs[r] == 10)) or (bgs[r] == 5)) {
cannons.start();
bgst[bsn] = 2;
bgsx[bsn] = bgx[r] + 20;
bgsy[bsn] = bgy[r] + 20;
bgsd[bsn] = 0;
bsn = bsn + 1;
if (bsn > 5) {
bsn = 1;
}
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 0;
bgs[r] = 20;
}
}
if (bgd[r] == 3) {
f[r] = 5;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 4;
bgs[r] = 6;
}
}
if (bgd[r] == 4) {
if (((bgs[r] == 6) or (bgs[r] == 5)) or (bgs[r] == 4)) {
f[r] = 6;
}
if (((bgs[r] == 3) or (bgs[r] == 2)) or (bgs[r] == 1)) {
f[r] = 7;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 5;
bgs[r] = 15;
}
}
if (bgd[r] == 5) {
f[r] = 8;
if (((bgs[r] == 15) or (bgs[r] == 10)) or (bgs[r] == 5)) {
cannons.start();
bgst[bsn] = 2;
bgsx[bsn] = bgx[r] - 20;
bgsy[bsn] = bgy[r] + 20;
bgsd[bsn] = 1;
bsn = bsn + 1;
if (bsn > 5) {
bsn = 1;
}
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 3;
bgs[r] = 20;
}
}
if (bgd[r] == 6) {
if (bgs[r] == 2) {
f[r] = 9;
}
if (bgs[r] == 1) {
f[r] = 10;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
f[r] = 11;
bgt[r] = 0;
bgx[r] = -500;
bgs[r] = 0;
}
}
}
}
r++;
}
r = 1;
while (r <= 5) {
if (bgst[r] > 0) {
if (bgst[r] == 1) {
if (r == 1) {
bgs1.gotoAndStop(1);
}
if (r == 2) {
bgs2.gotoAndStop(1);
}
if (r == 3) {
bgs3.gotoAndStop(1);
}
if (r == 4) {
bgs4.gotoAndStop(1);
}
if (r == 5) {
bgs5.gotoAndStop(1);
}
if (bgsd[r] == 0) {
bgsx[r] = bgsx[r] + 20;
if (bgsx[r] > (px + 300)) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgsd[r] == 1) {
bgsx[r] = bgsx[r] - 20;
if (bgsx[r] < (px - 300)) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgsd[r] == 2) {
bgsx[r] = bgsx[r] + 15;
bgsy[r] = bgsy[r] + 15;
if ((bgsx[r] > (px + 300)) or (bgsy[r] > (py + 300))) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgsd[r] == 3) {
bgsx[r] = bgsx[r] - 15;
bgsy[r] = bgsy[r] + 15;
if ((bgsx[r] > (px + 300)) or (bgsy[r] > (py + 300))) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgsd[r] == 4) {
bgsy[r] = bgsy[r] + 20;
if (bgsy[r] > (py + 300)) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (((((((bgsx[r] - 15) < (px + 10)) and ((bgsx[r] + 15) > (px - 10))) and ((bgsy[r] + 15) > (py + 5))) and ((bgsy[r] - 15) < (py + 20))) and (pcd < 18)) and (i < 1)) {
if ((bgsd[r] == 0) or (bgsd[r] == 2)) {
pcd = 19;
}
if ((bgsd[r] == 1) or (bgsd[r] == 3)) {
pcd = 18;
}
pstep = 2;
pl = pl - 3;
megah.start();
i = 10;
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgst[r] == 2) {
if (r == 1) {
bgs1.gotoAndStop(2);
}
if (r == 2) {
bgs2.gotoAndStop(2);
}
if (r == 3) {
bgs3.gotoAndStop(2);
}
if (r == 4) {
bgs4.gotoAndStop(2);
}
if (r == 5) {
bgs5.gotoAndStop(2);
}
if (bgsd[r] == 0) {
bgsx[r] = bgsx[r] + 30;
if (bgsx[r] > (px + 300)) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgsd[r] == 1) {
bgsx[r] = bgsx[r] - 30;
if (bgsx[r] < (px - 300)) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (((((((bgsx[r] - 25) < (px + 10)) and ((bgsx[r] + 25) > (px - 10))) and ((bgsy[r] + 80) > (py + 40))) and ((bgsy[r] + 35) < (py + 60))) and (pcd < 18)) and (i < 1)) {
if (bgsd[r] == 0) {
pcd = 19;
}
if (bgsd[r] == 1) {
pcd = 18;
}
pstep = 2;
pl = pl - 6;
megah.start();
i = 10;
bgst[r] = 0;
bgsx[r] = -200;
}
}
}
r++;
}
bg1.gotoAndStop(f[1]);
bg2.gotoAndStop(f[2]);
bg3.gotoAndStop(f[3]);
bg4.gotoAndStop(f[4]);
bg5.gotoAndStop(f[5]);
bg6.gotoAndStop(f[6]);
bg7.gotoAndStop(f[7]);
bg8.gotoAndStop(f[8]);
bgs1._x = ((bgsx[1] + 275) - px) / 2;
bgs1._y = ((bgsy[1] + 275) - py) / 2;
bgs2._x = ((bgsx[2] + 275) - px) / 2;
bgs2._y = ((bgsy[2] + 275) - py) / 2;
bgs3._x = ((bgsx[3] + 275) - px) / 2;
bgs3._y = ((bgsy[3] + 275) - py) / 2;
bgs4._x = ((bgsx[4] + 275) - px) / 2;
bgs4._y = ((bgsy[4] + 275) - py) / 2;
bgs5._x = ((bgsx[5] + 275) - px) / 2;
bgs5._y = ((bgsy[5] + 275) - py) / 2;
bg1._x = ((bgx[1] + 275) - px) / 2;
bg1._y = ((bgy[1] + 275) - py) / 2;
bg2._x = ((bgx[2] + 275) - px) / 2;
bg2._y = ((bgy[2] + 275) - py) / 2;
bg3._x = ((bgx[3] + 275) - px) / 2;
bg3._y = ((bgy[3] + 275) - py) / 2;
bg4._x = ((bgx[4] + 275) - px) / 2;
bg4._y = ((bgy[4] + 275) - py) / 2;
bg5._x = ((bgx[5] + 275) - px) / 2;
bg5._y = ((bgy[5] + 275) - py) / 2;
bg6._x = ((bgx[6] + 275) - px) / 2;
bg6._y = ((bgy[6] + 275) - py) / 2;
bg7._x = ((bgx[7] + 275) - px) / 2;
bg7._y = ((bgy[7] + 275) - py) / 2;
bg8._x = ((bgx[8] + 275) - px) / 2;
bg8._y = ((bgy[8] + 275) - py) / 2;
r = 1;
while (r <= 3) {
if (((pst[r] > 0) and (pst[r] < 4)) and (psd[r] == 0)) {
if (r == 1) {
shot1p._x = ((297 + psx[1]) - px) / 2;
shot1p._y = ((270 + psy[1]) - py) / 2;
}
if (r == 2) {
shot2p._x = ((297 + psx[2]) - px) / 2;
shot2p._y = ((270 + psy[2]) - py) / 2;
}
if (r == 3) {
shot3p._x = ((297 + psx[3]) - px) / 2;
shot3p._y = ((270 + psy[3]) - py) / 2;
}
}
if (((pst[r] > 0) and (pst[r] < 4)) and (psd[r] == 1)) {
if (r == 1) {
shot1p._x = ((247 + psx[1]) - px) / 2;
shot1p._y = ((270 + psy[1]) - py) / 2;
}
if (r == 2) {
shot2p._x = ((247 + psx[2]) - px) / 2;
shot2p._y = ((270 + psy[2]) - py) / 2;
}
if (r == 3) {
shot3p._x = ((247 + psx[3]) - px) / 2;
shot3p._y = ((270 + psy[3]) - py) / 2;
}
}
if ((pst[r] == 4) or (pst[r] == 5)) {
if (r == 1) {
shot1p._x = ((272 + psx[1]) - px) / 2;
shot1p._y = ((270 + psy[1]) - py) / 2;
}
if (r == 2) {
shot2p._x = ((272 + psx[2]) - px) / 2;
shot2p._y = ((270 + psy[2]) - py) / 2;
}
if (r == 3) {
shot3p._x = ((272 + psx[3]) - px) / 2;
shot3p._y = ((270 + psy[3]) - py) / 2;
}
}
if (pst[r] == 0) {
if (r == 1) {
shot1p._x = -200;
shot1p._y = (270 + psy[1]) - py;
}
if (r == 2) {
shot2p._x = -200;
shot2p._y = (270 + psy[2]) - py;
}
if (r == 3) {
shot3p._x = -200;
shot3p._y = (270 + psy[3]) - py;
}
}
r++;
}
if (i > 0) {
i = i - 1;
pc._alpha = 50;
}
if (i <= 0) {
i = i - 1;
pc._alpha = 100;
}
if (bcharge > 0) {
charge._alpha = bcharge;
}
lbar._height = 2 * pl;
lbar._y = 120 - (2 * pl);
stage._x = (275 - px) / 2;
stage._y = (375 - py) / 2;
exit._x = ((ex + 275) - px) / 2;
exit._y = ((ey + 275) - py) / 2;
stage2._x = stage2._x - 40;
if (stage2._x < -60) {
stage2._x = 325;
stage2._y = random(100) + 60;
}
Frame 176
gotoAndPlay (175);
if ((((px + 10) > (ex - 20)) and ((px - 10) < (ex + 20))) and (((py + 30) > (ey - 20)) and (py < (ey + 50)))) {
gotoAndPlay (177);
}
Frame 177
lbar._height = 2 * pl;
lbar._y = 120 - (2 * pl);
stage._x = (275 - px) / 2;
stage._y = (375 - py) / 2;
exit._x = ((ex + 275) - px) / 2;
exit._y = ((ey + 275) - py) / 2;
stage2._x = stage2._x - 40;
if (stage2._x < -60) {
stage2._x = 325;
stage2._y = random(100) + 60;
}
Frame 180
psn = 1;
bstep = 0;
pcd = 0;
bcharge = 0;
r = 1;
while (r <= 5) {
psx[r] = -200;
psy[r] = 0;
pst[r] = 0;
psd[r] = 0;
r++;
}
i = 0;
pl = pl + 5;
if (pl > 50) {
pl = 50;
}
px = 150;
py = 350;
r = 0;
while (r <= 31) {
bx[r] = -50;
by[r] = -50;
r++;
}
bx[1] = 50;
by[1] = 150;
bx[2] = 50;
by[2] = 250;
bx[3] = 150;
by[3] = 350;
bx[4] = 250;
by[4] = 350;
bx[5] = 350;
by[5] = 350;
bx[6] = 450;
by[6] = 350;
bx[7] = 550;
by[7] = 350;
bx[8] = 650;
by[8] = 350;
bx[9] = 750;
by[9] = 350;
bx[10] = 850;
by[10] = 350;
bx[11] = 950;
by[11] = 350;
bx[12] = 1050;
by[12] = 350;
bx[13] = 1150;
by[13] = 350;
bx[14] = 1250;
by[14] = 250;
bx[15] = 1150;
by[15] = 150;
bsn = 1;
bi = 0;
r = 1;
while (r <= 8) {
bgx[r] = -200;
bgy[r] = -200;
bgt[r] = 0;
bgd[r] = -1;
bgs[r] = 0;
r++;
}
r = 1;
while (r <= 5) {
bgsx[r] = -200;
bgsy[r] = 0;
bgst[r] = 0;
bgsd[r] = 0;
r++;
}
r = 1;
while (r <= 8) {
f[r] = 20;
r++;
}
bgd[1] = 0;
bgs[1] = 0;
bgl[1] = 50;
bgx[1] = 430;
bgy[1] = 340;
ex = 1150;
ey = 250;
stopAllSounds();
Frame 185
b1._x = bx[1] / 10;
b1._y = (by[1] / 10) + 120;
b2._x = bx[2] / 10;
b2._y = (by[2] / 10) + 120;
b3._x = bx[3] / 10;
b3._y = (by[3] / 10) + 120;
b4._x = bx[4] / 10;
b4._y = (by[4] / 10) + 120;
b5._x = bx[5] / 10;
b5._y = (by[5] / 10) + 120;
b6._x = bx[6] / 10;
b6._y = (by[6] / 10) + 120;
b7._x = bx[7] / 10;
b7._y = (by[7] / 10) + 120;
b8._x = bx[8] / 10;
b8._y = (by[8] / 10) + 120;
b9._x = bx[9] / 10;
b9._y = (by[9] / 10) + 120;
b10._x = bx[10] / 10;
b10._y = (by[10] / 10) + 120;
b11._x = bx[11] / 10;
b11._y = (by[11] / 10) + 120;
b12._x = bx[12] / 10;
b12._y = (by[12] / 10) + 120;
b13._x = bx[13] / 10;
b13._y = (by[13] / 10) + 120;
b14._x = bx[14] / 10;
b14._y = (by[14] / 10) + 120;
b15._x = bx[15] / 10;
b15._y = (by[15] / 10) + 120;
b16._x = bx[16] / 10;
b16._y = (by[16] / 10) + 120;
b17._x = bx[17] / 10;
b17._y = (by[17] / 10) + 120;
b18._x = bx[18] / 10;
b18._y = (by[18] / 10) + 120;
b19._x = bx[19] / 10;
b19._y = (by[19] / 10) + 120;
b20._x = bx[20] / 10;
b20._y = (by[20] / 10) + 120;
b21._x = bx[21] / 10;
b21._y = (by[21] / 10) + 120;
b22._x = bx[22] / 10;
b22._y = (by[22] / 10) + 120;
b23._x = bx[23] / 10;
b23._y = (by[23] / 10) + 120;
b24._x = bx[24] / 10;
b24._y = (by[24] / 10) + 120;
b25._x = bx[25] / 10;
b25._y = (by[25] / 10) + 120;
b26._x = bx[26] / 10;
b26._y = (by[26] / 10) + 120;
b27._x = bx[27] / 10;
b27._y = (by[27] / 10) + 120;
b28._x = bx[28] / 10;
b28._y = (by[28] / 10) + 120;
b29._x = bx[29] / 10;
b29._y = (by[29] / 10) + 120;
b30._x = bx[30] / 10;
b30._y = (by[30] / 10) + 120;
b31._x = bx[31] / 10;
b31._y = (by[31] / 10) + 120;
cir._x = px / 10;
cir._y = (py / 10) + 120;
shot1._x = psx[1] / 10;
shot1._y = (psy[1] / 10) + 120;
shot2._x = psx[2] / 10;
shot2._y = (psy[2] / 10) + 120;
shot3._x = psx[3] / 10;
shot3._y = (psy[3] / 10) + 120;
bshot1._x = bgsx[1] / 10;
bshot1._y = (bgsy[1] / 10) + 120;
bshot2._x = bgsx[2] / 10;
bshot2._y = (bgsy[2] / 10) + 120;
bshot3._x = bgsx[3] / 10;
bshot3._y = (bgsy[3] / 10) + 120;
bshot4._x = bgsx[4] / 10;
bshot4._y = (bgsy[4] / 10) + 120;
bshot5._x = bgsx[5] / 10;
bshot5._y = (bgsy[5] / 10) + 120;
bcir1._x = bgx[1] / 10;
bcir1._y = (bgy[1] / 10) + 120;
bcir2._x = bgx[2] / 10;
bcir2._y = (bgy[2] / 10) + 120;
bcir3._x = bgx[3] / 10;
bcir3._y = (bgy[3] / 10) + 120;
bcir4._x = bgx[4] / 10;
bcir4._y = (bgy[4] / 10) + 120;
bcir5._x = bgx[5] / 10;
bcir5._y = (bgy[5] / 10) + 120;
bcir6._x = bgx[6] / 10;
bcir6._y = (bgy[6] / 10) + 120;
bcir7._x = bgx[7] / 10;
bcir7._y = (bgy[7] / 10) + 120;
bcir8._x = bgx[8] / 10;
bcir8._y = (bgy[8] / 10) + 120;
bcir9._x = bgx[9] / 10;
bcir9._y = (bgy[9] / 10) + 120;
bcir10._x = bgx[10] / 10;
bcir10._y = (bgy[10] / 10) + 120;
bcir11._x = bgx[11] / 10;
bcir11._y = (bgy[11] / 10) + 120;
bcir12._x = bgx[12] / 10;
bcir12._y = (bgy[12] / 10) + 120;
bcir13._x = bgx[13] / 10;
bcir13._y = (bgy[13] / 10) + 120;
if (Key.isDown(39) and (pcd == 0)) {
pcd = 2;
}
if (Key.isDown(39) and ((pcd == 1) or (pcd == 3))) {
pcd = 0;
}
if (Key.isDown(37) and (pcd == 1)) {
pcd = 3;
}
if (Key.isDown(37) and ((pcd == 0) or (pcd == 2))) {
pcd = 1;
}
if (Key.isDown(38) and ((pcd == 0) or (pcd == 2))) {
pcd = 10;
pstep = 7;
}
if (Key.isDown(38) and ((pcd == 1) or (pcd == 3))) {
pcd = 11;
pstep = 7;
}
if (Key.isDown(40) and ((((pcd == 0) or (pcd == 1)) or (pcd == 2)) or (pcd == 3))) {
if (((pcd == 0) or (pcd == 2)) or (pcd == 8)) {
pcd = 6;
pstep = 3;
}
if (((pcd == 1) or (pcd == 3)) or (pcd == 9)) {
pcd = 7;
pstep = 3;
}
}
if (Key.isDown(16) and (bcharge < 100)) {
bcharge = bcharge + 5;
}
if (pcd == 0) {
pc.gotoAndStop(1);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(21);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px + 10;
psy[psn] = py;
psd[psn] = 0;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
}
if (pcd == 1) {
pc.gotoAndStop(2);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(22);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px - 10;
psy[psn] = py;
psd[psn] = 1;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
}
if (pcd == 2) {
px = px + 13;
if ((w == 0) or (w == 1)) {
pc.gotoAndStop(3);
}
if ((w == 2) or (w == 3)) {
pc.gotoAndStop(4);
}
if ((w == 4) or (w == 5)) {
pc.gotoAndStop(5);
}
if ((w == 6) or (w == 7)) {
pc.gotoAndStop(6);
}
if (Key.isDown(32)) {
if ((w == 0) or (w == 1)) {
pc.gotoAndStop(11);
}
if ((w == 2) or (w == 3)) {
pc.gotoAndStop(12);
}
if ((w == 4) or (w == 5)) {
pc.gotoAndStop(13);
}
if ((w == 6) or (w == 7)) {
pc.gotoAndStop(14);
}
if ((pst[psn] == 0) and (bstep == 0)) {
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px + 10;
psy[psn] = py;
psd[psn] = 0;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
}
pcd = 0;
}
if (pcd == 3) {
px = px - 13;
if ((w == 0) or (w == 1)) {
pc.gotoAndStop(7);
}
if ((w == 2) or (w == 3)) {
pc.gotoAndStop(8);
}
if ((w == 4) or (w == 5)) {
pc.gotoAndStop(9);
}
if ((w == 6) or (w == 7)) {
pc.gotoAndStop(10);
}
if (Key.isDown(32)) {
if ((w == 0) or (w == 1)) {
pc.gotoAndStop(15);
}
if ((w == 2) or (w == 3)) {
pc.gotoAndStop(16);
}
if ((w == 4) or (w == 5)) {
pc.gotoAndStop(17);
}
if ((w == 6) or (w == 7)) {
pc.gotoAndStop(18);
}
if ((pst[psn] == 0) and (bstep == 0)) {
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px - 10;
psy[psn] = py;
psd[psn] = 1;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
}
pcd = 1;
}
if (pcd == 9) {
pstep = pstep - 1;
if (pstep <= 0) {
pcd = 1;
}
}
if (pcd == 6) {
pc.gotoAndStop(19);
px = px + 20;
pstep = pstep - 1;
if (pstep <= 0) {
pcd = 0;
}
}
if (pcd == 7) {
pc.gotoAndStop(20);
px = px - 20;
pstep = pstep - 1;
if (pstep <= 0) {
pcd = 1;
}
}
if (pcd == 12) {
pc.gotoAndStop(23);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(25);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px + 10;
psy[psn] = py;
psd[psn] = 0;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
py = py + (5 * (7 - pstep));
pstep = pstep - 1;
if (pstep <= 2) {
pstep = 2;
}
if (Key.isDown(39)) {
px = px + 13;
}
if (Key.isDown(37)) {
px = px - 13;
if (bstep == 0) {
pcd = 13;
}
}
}
if (pcd == 13) {
pc.gotoAndStop(24);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(26);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px - 10;
psy[psn] = py;
psd[psn] = 1;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
py = py + (5 * (7 - pstep));
pstep = pstep - 1;
if (pstep <= 2) {
pstep = 2;
}
if (Key.isDown(39)) {
px = px + 13;
if (bstep == 0) {
pcd = 12;
}
}
if (Key.isDown(37)) {
px = px - 13;
}
}
if (pcd == 10) {
pc.gotoAndStop(23);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(25);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px + 10;
psy[psn] = py;
psd[psn] = 0;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
py = py - (5 * pstep);
pstep = pstep - 1;
if (Key.isDown(39)) {
px = px + 13;
}
if (Key.isDown(37)) {
px = px - 13;
if (bstep == 0) {
pcd = 11;
}
}
if (Key.isDown(40)) {
pcd = 12;
pstep = pstep + 3;
}
if (pstep <= -1) {
pstep = 7;
pcd = 12;
}
}
if (pcd == 11) {
pc.gotoAndStop(24);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(26);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px - 10;
psy[psn] = py;
psd[psn] = 1;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
py = py - (5 * pstep);
pstep = pstep - 1;
if (Key.isDown(39)) {
px = px + 13;
if (bstep == 0) {
pcd = 10;
}
}
if (Key.isDown(37)) {
px = px - 13;
}
if (Key.isDown(40)) {
pcd = 13;
pstep = pstep + 3;
}
if (pstep <= -1) {
pstep = 7;
pcd = 13;
}
}
if (pcd == 18) {
pc.gotoAndStop(27);
pstep = pstep - 1;
px = px - 5;
if (pstep <= -1) {
pstep = 2;
pcd = 0;
}
}
if (pcd == 19) {
pc.gotoAndStop(28);
pstep = pstep - 1;
px = px + 5;
if (pstep <= -1) {
pstep = 2;
pcd = 1;
}
}
if (pcd == 20) {
pc.gotoAndStop(69 - pstep);
bcharge = 0;
bstep = 20;
pl = 1;
pstep = pstep - 1;
if (pstep < 0) {
lives = lives - 1;
if (lives >= 0) {
pl = 50;
gotoAndPlay (180);
}
if (lives < 0) {
lives = 2;
continues = continues - 1;
gotoAndPlay (5);
}
}
}
if (pcd == 21) {
pc.gotoAndStop(77 - pstep);
charge._alpha = 0;
bcharge = 0;
bstep = 20;
pstep = pstep - 1;
if (pstep < 0) {
pstep = 0;
}
}
if (pl <= 0) {
pc._alpha = 100;
pcd = 20;
pstep = 40;
megad.start();
}
if (bstep > 0) {
bcharge = 0;
charge._alpha = bcharge;
}
if (bstep > 0) {
bstep = bstep - 1;
}
if ((py > 440) and (pcd < 20)) {
megad.start();
pl = 0;
}
if ((px >= 290) and (pcd < 10)) {
pcd = 12;
pstep = 5;
}
if (((py > 350) and (py < 415)) and (px < 290)) {
py = 350;
if ((((pcd == 12) or (pcd == 13)) or (pcd == 16)) or (pcd == 17)) {
if ((pcd == 12) or (pcd == 16)) {
pcd = 0;
}
if ((pcd == 13) or (pcd == 17)) {
pcd = 1;
}
}
}
if ((pcd == 18) and (py < 350)) {
pcd = 12;
pstep = 5;
}
if ((pcd == 19) and (py < 350)) {
pcd = 13;
pstep = 5;
}
if (px < 25) {
px = 25;
}
if (px > 525) {
px = 525;
}
w = w - 1;
if (w < 0) {
w = 7;
}
e = pcd;
r = 1;
while (r <= 3) {
if (pst[r] == 1) {
if (psd[r] == 0) {
psx[r] = psx[r] + 30;
if (r == 1) {
shot1p.gotoAndStop(1);
}
if (r == 2) {
shot2p.gotoAndStop(1);
}
if (r == 3) {
shot3p.gotoAndStop(1);
}
if (psx[r] > 580) {
pst[r] = 0;
psx[r] = -200;
}
}
if (psd[r] == 1) {
psx[r] = psx[r] - 30;
if (r == 1) {
shot1p.gotoAndStop(2);
}
if (r == 2) {
shot2p.gotoAndStop(2);
}
if (r == 3) {
shot3p.gotoAndStop(2);
}
if (psx[r] < -30) {
pst[r] = 0;
psx[r] = -200;
}
}
}
if (pst[r] == 2) {
if (psd[r] == 0) {
psx[r] = psx[r] + 35;
if (r == 1) {
shot1p.gotoAndStop(3);
}
if (r == 2) {
shot2p.gotoAndStop(3);
}
if (r == 3) {
shot3p.gotoAndStop(3);
}
if (psx[r] > 600) {
pst[r] = 0;
psx[r] = -200;
}
}
if (psd[r] == 1) {
psx[r] = psx[r] - 35;
if (r == 1) {
shot1p.gotoAndStop(4);
}
if (r == 2) {
shot2p.gotoAndStop(4);
}
if (r == 3) {
shot3p.gotoAndStop(4);
}
if (psx[r] < -50) {
pst[r] = 0;
psx[r] = -200;
}
}
}
if (pst[r] == 3) {
if (psd[r] == 0) {
psx[r] = psx[r] + 40;
if (r == 1) {
shot1p.gotoAndStop(5);
}
if (r == 2) {
shot2p.gotoAndStop(5);
}
if (r == 3) {
shot3p.gotoAndStop(5);
}
if (psx[r] > 630) {
pst[r] = 0;
psx[r] = -200;
}
}
if (psd[r] == 1) {
psx[r] = psx[r] - 40;
if (r == 1) {
shot1p.gotoAndStop(6);
}
if (r == 2) {
shot2p.gotoAndStop(6);
}
if (r == 3) {
shot3p.gotoAndStop(6);
}
if (psx[r] < -80) {
pst[r] = 0;
psx[r] = -200;
}
}
}
if (pst[r] == 4) {
if (r == 1) {
shot1p.gotoAndStop(10 - psd[r]);
}
if (r == 2) {
shot2p.gotoAndStop(10 - psd[r]);
}
if (r == 3) {
shot3p.gotoAndStop(10 - psd[r]);
}
psd[r] = psd[r] - 1;
if (psd[r] < 0) {
pst[r] = 0;
psx[r] = -200;
}
}
if (pst[r] == 5) {
if (r == 1) {
shot1p.gotoAndStop(14 - psd[r]);
}
if (r == 2) {
shot2p.gotoAndStop(14 - psd[r]);
}
if (r == 3) {
shot3p.gotoAndStop(14 - psd[r]);
}
psd[r] = psd[r] - 1;
if (psd[r] < 0) {
pst[r] = 0;
psx[r] = -200;
}
}
r++;
}
r = 1;
while (r <= 3) {
if ((pst[r] > 0) and (pst[r] < 4)) {
if (((((((bgx[1] - 22) < (psx[r] + ((pst[r] * 20) - 20))) and ((bgx[1] + 22) > (psx[r] - ((pst[r] * 20) - 20)))) and ((bgy[1] - 65) < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[1] + 35) > (psy[r] - ((pst[r] * 20) - 20)))) and (bi < 1)) and (bgl[1] > 0)) {
if (bgd[1] < 3) {
megash.start();
bgl[1] = bgl[1] - pst[r];
bi = 15;
if (bgl[1] < 1) {
bi = 0;
baddyd2.start();
bgd[1] = 14;
bgs[1] = 10;
pcd = 21;
pstep = 7;
}
if ((bgl[1] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
}
r++;
}
if (bgd[1] == 0) {
if ((bgs[1] == 0) or (bgs[1] == 1)) {
boss.gotoAndStop(1);
}
if ((bgs[1] == 2) or (bgs[1] == 3)) {
boss.gotoAndStop(2);
}
bgs[1] = bgs[1] - 1;
if (bgs[1] < 0) {
bgs[1] = 3;
}
c = random(140 - (3 * dif));
if (c < (10 + dif)) {
if (bgst[bsn] == 0) {
cannons.start();
bgst[bsn] = 1;
bgsx[bsn] = bgx[1] + 60;
bgsy[bsn] = bgy[1] - 20;
bgsd[bsn] = 0;
}
bsn = bsn + 1;
if (bsn > 5) {
bsn = 1;
}
}
if (((c < 12) and (bgst[bsn] == 0)) and ((bgs[1] == 1) or (bgs[1] == 3))) {
bgd[1] = 1;
bgs[1] = 7;
baddyd2.start();
bgst[bsn] = 3;
bgsx[bsn] = bgx[1] - 60;
bgsy[bsn] = bgy[1] - 10;
bgsd[bsn] = 0;
bsn = bsn + 1;
if (bsn > 5) {
bsn = 1;
}
}
if ((((c > 10) and (c < 19)) and (bgst[bsn] == 0)) and ((bgs[1] == 1) or (bgs[1] == 3))) {
bgd[1] = 2;
bgs[1] = 7;
}
}
if (bgd[1] == 1) {
if ((bgs[1] == 0) or (bgs[1] == 0)) {
boss.gotoAndStop(3);
}
if ((bgs[1] == 2) or (bgs[1] == 3)) {
boss.gotoAndStop(4);
}
if ((bgs[1] == 4) or (bgs[1] == 5)) {
boss.gotoAndStop(3);
}
if ((bgs[1] == 6) or (bgs[1] == 7)) {
boss.gotoAndStop(4);
}
bgs[1] = bgs[1] - 1;
if (bgs[1] <= 0) {
bgd[1] = 0;
bgs[1] = 3;
}
}
if (bgd[1] == 2) {
if ((bgs[1] == 0) or (bgs[1] == 1)) {
boss.gotoAndStop(5);
}
if ((bgs[1] == 2) or (bgs[1] == 3)) {
boss.gotoAndStop(6);
}
if ((bgs[1] == 4) or (bgs[1] == 5)) {
boss.gotoAndStop(5);
}
if ((bgs[1] == 6) or (bgs[1] == 7)) {
boss.gotoAndStop(6);
}
bgs[1] = bgs[1] - 1;
if (bgs[1] <= 0) {
bgd[1] = 0;
bgs[1] = 3;
cannons.start();
bgst[bsn] = 4;
bgsd[bsn] = 1;
bgsx[bsn] = bgx[1] - 80;
bgsy[bsn] = bgy[1] + 20;
bsn = bsn + 1;
if (bsn > 5) {
bsn = 1;
}
}
}
if (bgd[1] == 14) {
boss.gotoAndStop(10);
if ((bgs[1] == 0) or (bgs[1] == 1)) {
boss.gotoAndStop(16);
}
if ((bgs[1] == 2) or (bgs[1] == 3)) {
boss.gotoAndStop(11);
}
if ((bgs[1] == 4) or (bgs[1] == 5)) {
boss.gotoAndStop(10);
}
if ((bgs[1] == 6) or (bgs[1] == 7)) {
boss.gotoAndStop(9);
}
if ((bgs[1] == 8) or (bgs[1] == 9)) {
boss.gotoAndStop(8);
}
if (bgs[1] == 10) {
boss.gotoAndStop(7);
}
bgs[1] = bgs[1] - 1;
if (bgs[1] < 0) {
gotoAndPlay (187);
}
}
r = 1;
while (r <= 5) {
if (bgst[r] > 0) {
if (bgst[r] == 1) {
if (bgsd[r] == 0) {
if (r == 1) {
bgs1.gotoAndStop(3 + random(2));
}
if (r == 2) {
bgs2.gotoAndStop(3 + random(2));
}
if (r == 3) {
bgs3.gotoAndStop(3 + random(2));
}
if (r == 4) {
bgs4.gotoAndStop(3 + random(2));
}
if (r == 5) {
bgs5.gotoAndStop(3 + random(2));
}
bgsy[r] = bgsy[r] - 40;
if (bgsy[r] < -80) {
bgst[r] = 2;
bgsd[r] = random(3);
bgsx[r] = random(250) + 50;
bgsy[r] = -50;
}
}
if ((((((((bgsx[r] - 20) < (px + 10)) and ((bgsx[r] + 20) > (px - 10))) and ((bgsy[r] + 35) > (py + 5))) and ((bgsy[r] - 35) < (py + 20))) and (pcd < 18)) and (i < 1)) and (pl > 0)) {
if ((bgsd[r] == 0) or (bgsd[r] == 2)) {
pcd = 19;
}
if ((bgsd[r] == 1) or (bgsd[r] == 3)) {
pcd = 18;
}
pstep = 2;
pl = pl - 2;
megah.start();
i = 10;
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgst[r] == 2) {
if (bgsd[r] == 0) {
if (r == 1) {
bgs1.gotoAndStop(1 + random(2));
}
if (r == 2) {
bgs2.gotoAndStop(1 + random(2));
}
if (r == 3) {
bgs3.gotoAndStop(1 + random(2));
}
if (r == 4) {
bgs4.gotoAndStop(1 + random(2));
}
if (r == 5) {
bgs5.gotoAndStop(1 + random(2));
}
bgsx[r] = bgsx[r] - 6;
bgsy[r] = bgsy[r] + 30;
if ((bgsx[r] < -20) or (bgsy[r] > 370)) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgsd[r] == 1) {
if (r == 1) {
bgs1.gotoAndStop(1 + random(2));
}
if (r == 2) {
bgs2.gotoAndStop(1 + random(2));
}
if (r == 3) {
bgs3.gotoAndStop(1 + random(2));
}
if (r == 4) {
bgs4.gotoAndStop(1 + random(2));
}
if (r == 5) {
bgs5.gotoAndStop(1 + random(2));
}
bgsy[r] = bgsy[r] + 30;
if (bgsy[r] > 375) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgsd[r] == 2) {
if (r == 1) {
bgs1.gotoAndStop(1 + random(2));
}
if (r == 2) {
bgs2.gotoAndStop(1 + random(2));
}
if (r == 3) {
bgs3.gotoAndStop(1 + random(2));
}
if (r == 4) {
bgs4.gotoAndStop(1 + random(2));
}
if (r == 5) {
bgs5.gotoAndStop(1 + random(2));
}
bgsx[r] = bgsx[r] + 6;
bgsy[r] = bgsy[r] + 30;
if (bgsy[r] > 375) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if ((((((((bgsx[r] - 25) < (px + 10)) and ((bgsx[r] + 25) > (px - 10))) and ((bgsy[r] + 35) > (py + 5))) and ((bgsy[r] - 35) < (py + 20))) and (pcd < 18)) and (i < 1)) and (pl > 0)) {
if ((bgsd[r] == 0) or (bgsd[r] == 2)) {
pcd = 19;
}
if ((bgsd[r] == 1) or (bgsd[r] == 3)) {
pcd = 18;
}
pstep = 2;
pl = pl - 3;
megah.start();
i = 10;
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgst[r] == 3) {
if (bgsd[r] == 0) {
if (r == 1) {
bgs1.gotoAndStop(5);
}
if (r == 2) {
bgs2.gotoAndStop(5);
}
if (r == 3) {
bgs3.gotoAndStop(5);
}
if (r == 4) {
bgs4.gotoAndStop(5);
}
if (r == 5) {
bgs5.gotoAndStop(5);
}
bgsx[r] = bgsx[r] - 32;
if (bgsx[r] < -70) {
bgst[r] = 0;
bgsd[r] = 0;
}
}
if ((((((((bgsx[r] - 40) < (px + 10)) and ((bgsx[r] + 40) > (px - 10))) and ((bgsy[r] + 10) > (py + 5))) and ((bgsy[r] - 10) < (py + 20))) and (pcd < 18)) and (i < 1)) and (pl > 0)) {
if ((bgsd[r] == 0) or (bgsd[r] == 2)) {
pcd = 19;
}
if ((bgsd[r] == 1) or (bgsd[r] == 3)) {
pcd = 18;
}
pstep = 2;
pl = pl - 7;
megah.start();
i = 10;
bgst[r] = 0;
bgsx[r] = -300;
bgsd[r] = 0;
}
}
if (bgst[r] == 4) {
if (bgsd[r] > 0) {
if (r == 1) {
bgs1.gotoAndStop(6 + random(2));
}
if (r == 2) {
bgs2.gotoAndStop(6 + random(2));
}
if (r == 3) {
bgs3.gotoAndStop(6 + random(2));
}
if (r == 4) {
bgs4.gotoAndStop(6 + random(2));
}
if (r == 5) {
bgs5.gotoAndStop(6 + random(2));
}
bgsx[r] = bgsx[r] - bgsd[r];
bgsd[r] = bgsd[r] + 1;
if (bgsx[r] < -60) {
bgst[r] = 0;
bgsd[r] = 0;
bgsx[r] = -500;
bgsy[r] = 0;
}
}
if ((((((((bgsx[r] - 80) < (px + 10)) and ((bgsx[r] + 80) > (px - 10))) and ((bgsy[r] + 40) > (py + 5))) and ((bgsy[r] - 40) < (py + 20))) and (pcd < 18)) and (i < 1)) and (pl > 0)) {
if ((bgsd[r] == 0) or (bgsd[r] == 2)) {
pcd = 19;
}
if ((bgsd[r] == 1) or (bgsd[r] == 3)) {
pcd = 18;
}
pstep = 2;
pl = pl - 9;
baddy1d.start();
i = 10;
}
}
}
r++;
}
if ((((((((bgx[1] - 20) < (px + 10)) and ((bgx[1] + 20) > (px - 10))) and ((bgy[1] + 60) > (py + 10))) and ((bgy[1] + 20) < (py + 50))) and (pcd < 18)) and (i < 1)) and (pl > 0)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
}
pl = pl - 2;
megah.start();
i = 10;
}
bgs1._x = bgsx[1] / 2;
bgs1._y = (bgsy[1] / 2) - 20;
bgs2._x = bgsx[2] / 2;
bgs2._y = (bgsy[2] / 2) - 20;
bgs3._x = bgsx[3] / 2;
bgs3._y = (bgsy[3] / 2) - 20;
bgs4._x = bgsx[4] / 2;
bgs4._y = (bgsy[4] / 2) - 20;
bgs5._x = bgsx[5] / 2;
bgs5._y = (bgsy[5] / 2) - 20;
r = 1;
while (r <= 3) {
if (((pst[r] > 0) and (pst[r] < 4)) and (psd[r] == 0)) {
if (r == 1) {
shot1p._x = psx[1] / 2;
shot1p._y = psy[1] / 2;
}
if (r == 2) {
shot2p._x = psx[2] / 2;
shot2p._y = psy[2] / 2;
}
if (r == 3) {
shot3p._x = psx[3] / 2;
shot3p._y = psy[3] / 2;
}
}
if (((pst[r] > 0) and (pst[r] < 4)) and (psd[r] == 1)) {
if (r == 1) {
shot1p._x = psx[1] / 2;
shot1p._y = psy[1] / 2;
}
if (r == 2) {
shot2p._x = psx[2] / 2;
shot2p._y = psy[2] / 2;
}
if (r == 3) {
shot3p._x = psx[3] / 2;
shot3p._y = psy[3] / 2;
}
}
if ((pst[r] == 4) or (pst[r] == 5)) {
if (r == 1) {
shot1p._x = psx[1] / 2;
shot1p._y = psy[1] / 2;
}
if (r == 2) {
shot2p._x = psx[2] / 2;
shot2p._y = psy[2] / 2;
}
if (r == 3) {
shot3p._x = psx[3] / 2;
shot3p._y = psy[3] / 2;
}
}
if (pst[r] == 0) {
if (r == 1) {
shot1p._x = -200;
shot1p._y = (270 + psy[1]) - py;
}
if (r == 2) {
shot2p._x = -200;
shot2p._y = (270 + psy[2]) - py;
}
if (r == 3) {
shot3p._x = -200;
shot3p._y = (270 + psy[3]) - py;
}
}
r++;
}
if (i > 0) {
i = i - 1;
pc._alpha = 50;
}
if (i <= 0) {
i = i - 1;
pc._alpha = 100;
}
if (bi > 0) {
bi = bi - 1;
boss._alpha = 50;
}
if (bi <= 0) {
boss._alpha = 100;
}
if (bcharge > 0) {
charge._alpha = bcharge;
}
charge._x = px / 2;
charge._y = py / 2;
boss._x = ((bgx[1] / 2) - 2) + random(4);
boss._y = (bgy[1] / 2) - 11;
pc._x = px / 2;
pc._y = py / 2;
lbar._height = 2 * pl;
lbar._y = 120 - (2 * pl);
bbar._height = 2 * bgl[1];
bbar._y = 120 - (2 * bgl[1]);
stage2._x = stage2._x - 20;
if (stage2._x < -30) {
stage2._x = 325;
stage2._y = 110;
}
stage3._x = stage3._x - 40;
if (stage3._x < -60) {
stage3._x = 325;
stage3._y = 110;
}
Frame 186
gotoAndPlay (185);
Frame 187
lbar._height = 2 * pl;
lbar._y = 120 - (2 * pl);
stage._x = (270 - px) / 2;
stage._y = (-725 - py) / 2;
exit._x = ((ex + 275) - px) / 2;
exit._y = ((ey + 275) - py) / 2;
Frame 189
gotoAndPlay (5);
Frame 190
psn = 1;
bstep = 0;
pcd = 0;
bcharge = 0;
r = 1;
while (r <= 5) {
psx[r] = -200;
psy[r] = 0;
pst[r] = 0;
psd[r] = 0;
r++;
}
i = 0;
pl = 50;
px = 150;
py = 350;
r = 0;
while (r <= 26) {
bx[r] = -50;
by[r] = -50;
r++;
}
bx[1] = 150;
by[1] = 450;
bx[2] = 250;
by[2] = 450;
bx[3] = 350;
by[3] = 450;
bx[4] = 450;
by[4] = 450;
bx[5] = 550;
by[5] = 450;
bx[6] = 650;
by[6] = 450;
bx[7] = 750;
by[7] = 450;
bx[8] = 950;
by[8] = 350;
bx[9] = 700;
by[9] = 250;
bx[10] = 550;
by[10] = 150;
bx[11] = 450;
by[11] = 150;
bx[12] = 350;
by[12] = 150;
bx[13] = 250;
by[13] = 150;
bx[14] = 50;
by[14] = 50;
bx[15] = 250;
by[15] = -50;
bx[16] = 350;
by[16] = -50;
bx[17] = 450;
by[17] = -150;
bx[18] = 550;
by[18] = -150;
bx[19] = 750;
by[19] = -150;
bx[20] = 950;
by[20] = -250;
bx[21] = 750;
by[21] = -350;
bx[22] = 550;
by[22] = -350;
bx[23] = 450;
by[23] = -350;
bx[24] = 150;
by[24] = -350;
bsn = 1;
r = 1;
while (r <= 8) {
bgx[r] = -200;
bgy[r] = -200;
bgt[r] = 0;
bgd[r] = -1;
bgs[r] = 0;
r++;
}
r = 1;
while (r <= 5) {
bgsx[r] = -200;
bgsy[r] = 0;
bgst[r] = 0;
bgsd[r] = 0;
r++;
}
r = 1;
while (r <= 8) {
f[r] = 20;
r++;
}
bgt[1] = 1;
bgd[1] = 0;
bgs[1] = 0;
bgl[1] = 3;
bgx[1] = 680;
bgy[1] = -650;
bgt[2] = 2;
bgd[2] = 0;
bgs[2] = 0;
bgl[2] = 3;
bgx[2] = 550;
bgy[2] = -550;
bgt[3] = 2;
bgd[3] = 0;
bgs[3] = 0;
bgl[3] = 3;
bgx[3] = 500;
bgy[3] = -550;
bgt[4] = 3;
bgd[4] = 0;
bgs[4] = 0;
bgl[4] = 5;
bgx[4] = 400;
bgy[4] = -650;
bgt[5] = 14;
bgd[5] = 0;
bgs[5] = 0;
bgl[5] = 3;
bgx[5] = 200;
bgy[5] = -450;
bgt[6] = 14;
bgd[6] = 3;
bgs[6] = 0;
bgl[6] = 3;
bgx[6] = 500;
bgy[6] = -350;
bgt[7] = 3;
bgd[7] = 0;
bgs[7] = 0;
bgl[7] = 5;
bgx[7] = 250;
bgy[7] = -250;
bgt[8] = 2;
bgd[8] = 0;
bgs[8] = 0;
bgl[8] = 3;
bgx[8] = 450;
bgy[8] = -50;
ex = 150;
ey = -450;
stopAllSounds();
Frame 191
pc.gotoAndStop(1);
bg1.gotoAndStop(20);
bg2.gotoAndStop(20);
bg3.gotoAndStop(20);
bg4.gotoAndStop(20);
bg5.gotoAndStop(20);
bg6.gotoAndStop(20);
bg7.gotoAndStop(20);
bg8.gotoAndStop(20);
bgs1.gotoAndStop(20);
bgs2.gotoAndStop(20);
bgs3.gotoAndStop(20);
bgs4.gotoAndStop(20);
bgs5.gotoAndStop(20);
shot1.gotoAndStop(20);
shot2.gotoAndStop(20);
shot3.gotoAndStop(20);
bg1._x = ((bgx[1] + 275) - px) / 2;
bg1._y = ((bgy[1] + 275) - py) / 2;
bg2._x = ((bgx[2] + 275) - px) / 2;
bg2._y = ((bgy[2] + 275) - py) / 2;
bg3._x = ((bgx[3] + 275) - px) / 2;
bg3._y = ((bgy[3] + 275) - py) / 2;
bg4._x = ((bgx[4] + 275) - px) / 2;
bg4._y = ((bgy[4] + 275) - py) / 2;
bg5._x = ((bgx[5] + 275) - px) / 2;
bg5._y = ((bgy[5] + 275) - py) / 2;
bg6._x = ((bgx[6] + 275) - px) / 2;
bg6._y = ((bgy[6] + 275) - py) / 2;
bg7._x = ((bgx[7] + 275) - px) / 2;
bg7._y = ((bgy[7] + 275) - py) / 2;
bg8._x = ((bgx[8] + 275) - px) / 2;
bg8._y = ((bgy[8] + 275) - py) / 2;
lbar._height = 2 * pl;
lbar._y = 120 - (2 * pl);
stage._x = (275 - px) / 2;
stage._y = (-225 - py) / 2;
exit._x = ((ex + 275) - px) / 2;
exit._y = ((ey + 275) - py) / 2;
Frame 202
b1._x = bx[1] / 10;
b1._y = (by[1] / 10) + 120;
b2._x = bx[2] / 10;
b2._y = (by[2] / 10) + 120;
b3._x = bx[3] / 10;
b3._y = (by[3] / 10) + 120;
b4._x = bx[4] / 10;
b4._y = (by[4] / 10) + 120;
b5._x = bx[5] / 10;
b5._y = (by[5] / 10) + 120;
b6._x = bx[6] / 10;
b6._y = (by[6] / 10) + 120;
b7._x = bx[7] / 10;
b7._y = (by[7] / 10) + 120;
b8._x = bx[8] / 10;
b8._y = (by[8] / 10) + 120;
b9._x = bx[9] / 10;
b9._y = (by[9] / 10) + 120;
b10._x = bx[10] / 10;
b10._y = (by[10] / 10) + 120;
b11._x = bx[11] / 10;
b11._y = (by[11] / 10) + 120;
b12._x = bx[12] / 10;
b12._y = (by[12] / 10) + 120;
b13._x = bx[13] / 10;
b13._y = (by[13] / 10) + 120;
b14._x = bx[14] / 10;
b14._y = (by[14] / 10) + 120;
b15._x = bx[15] / 10;
b15._y = (by[15] / 10) + 120;
b16._x = bx[16] / 10;
b16._y = (by[16] / 10) + 120;
b17._x = bx[17] / 10;
b17._y = (by[17] / 10) + 120;
b18._x = bx[18] / 10;
b18._y = (by[18] / 10) + 120;
b19._x = bx[19] / 10;
b19._y = (by[19] / 10) + 120;
b20._x = bx[20] / 10;
b20._y = (by[20] / 10) + 120;
b21._x = bx[21] / 10;
b21._y = (by[21] / 10) + 120;
b22._x = bx[22] / 10;
b22._y = (by[22] / 10) + 120;
b23._x = bx[23] / 10;
b23._y = (by[23] / 10) + 120;
b24._x = bx[24] / 10;
b24._y = (by[24] / 10) + 120;
b25._x = bx[25] / 10;
b25._y = (by[25] / 10) + 120;
b26._x = bx[26] / 10;
b26._y = (by[26] / 10) + 120;
b27._x = bx[27] / 10;
b27._y = (by[27] / 10) + 120;
b28._x = bx[28] / 10;
b28._y = (by[28] / 10) + 120;
cir._x = px / 10;
cir._y = (py / 10) + 120;
shot1._x = psx[1] / 10;
shot1._y = (psy[1] / 10) + 120;
shot2._x = psx[2] / 10;
shot2._y = (psy[2] / 10) + 120;
shot3._x = psx[3] / 10;
shot3._y = (psy[3] / 10) + 120;
bshot1._x = bgsx[1] / 10;
bshot1._y = (bgsy[1] / 10) + 120;
bshot2._x = bgsx[2] / 10;
bshot2._y = (bgsy[2] / 10) + 120;
bshot3._x = bgsx[3] / 10;
bshot3._y = (bgsy[3] / 10) + 120;
bshot4._x = bgsx[4] / 10;
bshot4._y = (bgsy[4] / 10) + 120;
bshot5._x = bgsx[5] / 10;
bshot5._y = (bgsy[5] / 10) + 120;
bcir1._x = bgx[1] / 10;
bcir1._y = (bgy[1] / 10) + 120;
bcir2._x = bgx[2] / 10;
bcir2._y = (bgy[2] / 10) + 120;
bcir3._x = bgx[3] / 10;
bcir3._y = (bgy[3] / 10) + 120;
bcir4._x = bgx[4] / 10;
bcir4._y = (bgy[4] / 10) + 120;
bcir5._x = bgx[5] / 10;
bcir5._y = (bgy[5] / 10) + 120;
bcir6._x = bgx[6] / 10;
bcir6._y = (bgy[6] / 10) + 120;
bcir7._x = bgx[7] / 10;
bcir7._y = (bgy[7] / 10) + 120;
bcir8._x = bgx[8] / 10;
bcir8._y = (bgy[8] / 10) + 120;
bcir9._x = bgx[9] / 10;
bcir9._y = (bgy[9] / 10) + 120;
bcir10._x = bgx[10] / 10;
bcir10._y = (bgy[10] / 10) + 120;
bcir11._x = bgx[11] / 10;
bcir11._y = (bgy[11] / 10) + 120;
bcir12._x = bgx[12] / 10;
bcir12._y = (bgy[12] / 10) + 120;
bcir13._x = bgx[13] / 10;
bcir13._y = (bgy[13] / 10) + 120;
if (Key.isDown(39) and (pcd == 0)) {
pcd = 2;
}
if (Key.isDown(39) and ((pcd == 1) or (pcd == 3))) {
pcd = 0;
}
if (Key.isDown(37) and (pcd == 1)) {
pcd = 3;
}
if (Key.isDown(37) and ((pcd == 0) or (pcd == 2))) {
pcd = 1;
}
if (Key.isDown(38) and ((pcd == 0) or (pcd == 2))) {
pcd = 10;
pstep = 7;
}
if (Key.isDown(38) and ((pcd == 1) or (pcd == 3))) {
pcd = 11;
pstep = 7;
}
if (Key.isDown(40) and ((((pcd == 0) or (pcd == 1)) or (pcd == 2)) or (pcd == 3))) {
if (((pcd == 0) or (pcd == 2)) or (pcd == 8)) {
pcd = 6;
pstep = 3;
}
if (((pcd == 1) or (pcd == 3)) or (pcd == 9)) {
pcd = 7;
pstep = 3;
}
}
if (Key.isDown(16) and (bcharge < 100)) {
bcharge = bcharge + 5;
}
if (pcd == 0) {
pc.gotoAndStop(1);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(21);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 0;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
}
if (pcd == 1) {
pc.gotoAndStop(2);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(22);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 1;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
}
if (pcd == 2) {
px = px + 13;
if ((w == 0) or (w == 1)) {
pc.gotoAndStop(3);
}
if ((w == 2) or (w == 3)) {
pc.gotoAndStop(4);
}
if ((w == 4) or (w == 5)) {
pc.gotoAndStop(5);
}
if ((w == 6) or (w == 7)) {
pc.gotoAndStop(6);
}
if (Key.isDown(32)) {
if ((w == 0) or (w == 1)) {
pc.gotoAndStop(11);
}
if ((w == 2) or (w == 3)) {
pc.gotoAndStop(12);
}
if ((w == 4) or (w == 5)) {
pc.gotoAndStop(13);
}
if ((w == 6) or (w == 7)) {
pc.gotoAndStop(14);
}
if ((pst[psn] == 0) and (bstep == 0)) {
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 0;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
}
pcd = 0;
}
if (pcd == 3) {
px = px - 13;
if ((w == 0) or (w == 1)) {
pc.gotoAndStop(7);
}
if ((w == 2) or (w == 3)) {
pc.gotoAndStop(8);
}
if ((w == 4) or (w == 5)) {
pc.gotoAndStop(9);
}
if ((w == 6) or (w == 7)) {
pc.gotoAndStop(10);
}
if (Key.isDown(32)) {
if ((w == 0) or (w == 1)) {
pc.gotoAndStop(15);
}
if ((w == 2) or (w == 3)) {
pc.gotoAndStop(16);
}
if ((w == 4) or (w == 5)) {
pc.gotoAndStop(17);
}
if ((w == 6) or (w == 7)) {
pc.gotoAndStop(18);
}
if ((pst[psn] == 0) and (bstep == 0)) {
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 1;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
}
pcd = 1;
}
if (pcd == 9) {
pstep = pstep - 1;
if (pstep <= 0) {
pcd = 1;
}
}
if (pcd == 6) {
pc.gotoAndStop(19);
px = px + 20;
pstep = pstep - 1;
if (pstep <= 0) {
pcd = 0;
}
}
if (pcd == 7) {
pc.gotoAndStop(20);
px = px - 20;
pstep = pstep - 1;
if (pstep <= 0) {
pcd = 1;
}
}
if (pcd == 12) {
pc.gotoAndStop(23);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(25);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 0;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
py = py + (5 * (7 - pstep));
pstep = pstep - 1;
if (pstep <= 2) {
pstep = 2;
}
if (Key.isDown(39)) {
px = px + 13;
}
if (Key.isDown(37)) {
px = px - 13;
if (bstep == 0) {
pcd = 13;
}
}
}
if (pcd == 13) {
pc.gotoAndStop(24);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(26);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 1;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
py = py + (5 * (7 - pstep));
pstep = pstep - 1;
if (pstep <= 2) {
pstep = 2;
}
if (Key.isDown(39)) {
px = px + 13;
if (bstep == 0) {
pcd = 12;
}
}
if (Key.isDown(37)) {
px = px - 13;
}
}
if (pcd == 10) {
pc.gotoAndStop(23);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(25);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 0;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
py = py - (5 * pstep);
pstep = pstep - 1;
if (Key.isDown(39)) {
px = px + 13;
}
if (Key.isDown(37)) {
px = px - 13;
if (bstep == 0) {
pcd = 11;
}
}
if (Key.isDown(40)) {
pcd = 12;
pstep = pstep + 3;
}
if (pstep <= -1) {
pstep = 7;
pcd = 12;
}
}
if (pcd == 11) {
pc.gotoAndStop(24);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(26);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 1;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
py = py - (5 * pstep);
pstep = pstep - 1;
if (Key.isDown(39)) {
px = px + 13;
if (bstep == 0) {
pcd = 10;
}
}
if (Key.isDown(37)) {
px = px - 13;
}
if (Key.isDown(40)) {
pcd = 13;
pstep = pstep + 3;
}
if (pstep <= -1) {
pstep = 7;
pcd = 13;
}
}
if (pcd == 18) {
pc.gotoAndStop(27);
pstep = pstep - 1;
px = px - 5;
if (pstep <= -1) {
pstep = 2;
pcd = 0;
}
}
if (pcd == 19) {
pc.gotoAndStop(28);
pstep = pstep - 1;
px = px + 5;
if (pstep <= -1) {
pstep = 2;
pcd = 1;
}
}
if (pcd == 20) {
pc.gotoAndStop(69 - pstep);
bcharge = 0;
charge._alpha = 0;
bstep = 20;
pl = 1;
pstep = pstep - 1;
if (pstep < 0) {
lives = lives - 1;
if (lives >= 0) {
pl = 50;
gotoAndPlay (190);
}
if (lives < 0) {
lives = 2;
continues = continues - 1;
gotoAndPlay (5);
}
}
}
if (pl <= 0) {
c = 1;
while (c <= 8) {
bgx[c] = -600;
c++;
}
pc._alpha = 100;
pcd = 20;
pstep = 40;
megad.start();
}
if (bstep > 0) {
bcharge = 0;
charge._alpha = bcharge;
}
if (bstep > 0) {
bstep = bstep - 1;
}
if ((py > 500) and (pcd < 20)) {
megad.start();
pl = 0;
}
w = w - 1;
if (w < 0) {
w = 7;
}
e = pcd;
c = 0;
r = 1;
while (r <= 24) {
if (((((bx[r] - 150) < px) and ((bx[r] + 150) > px)) and ((by[r] - 150) < py)) and ((by[r] + 150) > py)) {
if (((((((px - 30) < (bx[r] + 50)) and ((px + 20) > (bx[r] - 50))) and (py < (by[r] - 50))) and ((py + 60) > (by[r] - 50))) and (pcd != 10)) and (pcd != 11)) {
if ((((pcd == 12) or (pcd == 13)) or (pcd == 16)) or (pcd == 17)) {
if ((pcd == 12) or (pcd == 16)) {
pcd = 0;
}
if ((pcd == 13) or (pcd == 17)) {
pcd = 1;
}
}
c = 1;
py = by[r] - 75;
}
if (((((px + 38) > (bx[r] - 50)) and ((px + 20) < bx[r])) and (py < (by[r] + 50))) and ((py + 20) > (by[r] - 50))) {
px = bx[r] - 85;
}
if (((((px - 35) < (bx[r] + 50)) and ((px - 20) > bx[r])) and (py < (by[r] + 50))) and ((py + 20) > (by[r] - 50))) {
px = bx[r] + 85;
}
if (((((px - 5) < (bx[r] + 50)) and ((px + 5) > (bx[r] - 50))) and ((py - 30) < (by[r] + 50))) and ((py + 10) > (by[r] + 50))) {
if ((((pcd == 10) or (pcd == 11)) or (pcd == 14)) or (pcd == 15)) {
if ((pcd == 10) or (pcd == 14)) {
pcd = 12;
pstep = 5;
}
if ((pcd == 11) or (pcd == 15)) {
pcd = 13;
pstep = 5;
}
}
py = by[r] + 90;
}
}
r++;
}
if (c == 0) {
if ((((pcd == 0) or (pcd == 2)) or (pcd == 6)) or (pcd == 18)) {
pcd = 12;
pstep = 6;
}
if ((((pcd == 1) or (pcd == 3)) or (pcd == 7)) or (pcd == 19)) {
pcd = 13;
pstep = 6;
}
}
r = 1;
while (r <= 3) {
if (pst[r] == 1) {
if (psd[r] == 0) {
psx[r] = psx[r] + 30;
if (r == 1) {
shot1p.gotoAndStop(1);
}
if (r == 2) {
shot2p.gotoAndStop(1);
}
if (r == 3) {
shot3p.gotoAndStop(1);
}
if (psx[r] > (px + 280)) {
pst[r] = 0;
psx[r] = -200;
}
}
if (psd[r] == 1) {
psx[r] = psx[r] - 30;
if (r == 1) {
shot1p.gotoAndStop(2);
}
if (r == 2) {
shot2p.gotoAndStop(2);
}
if (r == 3) {
shot3p.gotoAndStop(2);
}
if (psx[r] < (px - 280)) {
pst[r] = 0;
psx[r] = -200;
}
}
}
if (pst[r] == 2) {
if (psd[r] == 0) {
psx[r] = psx[r] + 35;
if (r == 1) {
shot1p.gotoAndStop(3);
}
if (r == 2) {
shot2p.gotoAndStop(3);
}
if (r == 3) {
shot3p.gotoAndStop(3);
}
if (psx[r] > (px + 280)) {
pst[r] = 0;
psx[r] = -200;
}
}
if (psd[r] == 1) {
psx[r] = psx[r] - 35;
if (r == 1) {
shot1p.gotoAndStop(4);
}
if (r == 2) {
shot2p.gotoAndStop(4);
}
if (r == 3) {
shot3p.gotoAndStop(4);
}
if (psx[r] < (px - 280)) {
pst[r] = 0;
psx[r] = -200;
}
}
}
if (pst[r] == 3) {
if (psd[r] == 0) {
psx[r] = psx[r] + 40;
if (r == 1) {
shot1p.gotoAndStop(5);
}
if (r == 2) {
shot2p.gotoAndStop(5);
}
if (r == 3) {
shot3p.gotoAndStop(5);
}
if (psx[r] > (px + 280)) {
pst[r] = 0;
psx[r] = -200;
}
}
if (psd[r] == 1) {
psx[r] = psx[r] - 40;
if (r == 1) {
shot1p.gotoAndStop(6);
}
if (r == 2) {
shot2p.gotoAndStop(6);
}
if (r == 3) {
shot3p.gotoAndStop(6);
}
if (psx[r] < (px - 280)) {
pst[r] = 0;
psx[r] = -200;
}
}
}
if (pst[r] == 4) {
if (r == 1) {
shot1p.gotoAndStop(10 - psd[r]);
}
if (r == 2) {
shot2p.gotoAndStop(10 - psd[r]);
}
if (r == 3) {
shot3p.gotoAndStop(10 - psd[r]);
}
psd[r] = psd[r] - 1;
if (psd[r] < 0) {
pst[r] = 0;
psx[r] = -200;
}
}
if (pst[r] == 5) {
if (r == 1) {
shot1p.gotoAndStop(14 - psd[r]);
}
if (r == 2) {
shot2p.gotoAndStop(14 - psd[r]);
}
if (r == 3) {
shot3p.gotoAndStop(14 - psd[r]);
}
psd[r] = psd[r] - 1;
if (psd[r] < 0) {
pst[r] = 0;
psx[r] = -200;
}
}
r++;
}
while (c <= 8) {
r = 1;
while (r <= 3) {
if ((pst[r] > 0) and (pst[r] < 4)) {
if (((((bgt[c] == 1) and ((bgx[c] - 35) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 35) > (psx[r] - ((pst[r] * 20) - 20)))) and ((bgy[c] - 5) < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 50) > (psy[r] - ((pst[r] * 20) - 20)))) {
if ((bgd[c] == 0) or (bgd[c] == 2)) {
deflect.start();
pst[r] = 5;
psd[r] = 2;
}
if ((bgd[c] == 1) or (bgd[c] == 3)) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd2.start();
bgd[c] = 4;
bgs[c] = 4;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
if (((((bgt[c] == 2) and ((bgx[c] - 35) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 35) > (psx[r] - ((pst[r] * 20) - 20)))) and (bgy[c] < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 50) > (psy[r] - ((pst[r] * 20) - 20)))) {
if ((((bgd[c] == 0) or (bgd[c] == 3)) or (bgd[c] == 1)) or (bgd[c] == 4)) {
deflect.start();
pst[r] = 5;
psd[r] = 2;
}
if ((bgd[c] == 2) or (bgd[c] == 5)) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd2.start();
bgd[c] = 6;
bgs[c] = 6;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
if (((((bgt[c] == 3) and ((bgx[c] - 35) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 35) > (psx[r] - ((pst[r] * 20) - 20)))) and ((bgy[c] - 20) < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 40) > (psy[r] - ((pst[r] * 20) - 20)))) {
if (bgd[c] == 0) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd2.start();
bgd[c] = 1;
bgs[c] = 4;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
if (((((bgt[c] == 4) and ((bgx[c] - 40) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 40) > (psx[r] - ((pst[r] * 20) - 20)))) and ((bgy[c] - 20) < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 50) > (psy[r] - ((pst[r] * 20) - 20)))) {
if ((bgd[c] == 0) or (bgd[c] == 2)) {
deflect.start();
pst[r] = 5;
psd[r] = 2;
}
if ((bgd[c] == 1) or (bgd[c] == 3)) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd1.start();
bgd[c] = 4;
bgs[c] = 4;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
if (((((bgt[c] == 5) and ((bgx[c] - 40) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 40) > (psx[r] - ((pst[r] * 20) - 20)))) and ((bgy[c] - 20) < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 50) > (psy[r] - ((pst[r] * 20) - 20)))) {
if ((((bgd[c] == 0) or (bgd[c] == 1)) or (bgd[c] == 2)) or (bgd[c] == 3)) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd1.start();
bgd[c] = 4;
bgs[c] = 5;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
if (((((bgt[c] == 6) and ((bgx[c] - 35) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 35) > (psx[r] - ((pst[r] * 20) - 20)))) and ((bgy[c] - 50) < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 20) > (psy[r] - ((pst[r] * 20) - 20)))) {
if ((bgd[c] == 0) or (bgd[c] == 1)) {
deflect.start();
pst[r] = 5;
psd[r] = 2;
}
if (bgd[c] == 2) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd2.start();
bgd[c] = 3;
bgs[c] = 4;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
if (((((bgt[c] == 7) and ((bgx[c] - 35) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 35) > (psx[r] - ((pst[r] * 20) - 20)))) and ((bgy[c] - 50) < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 20) > (psy[r] - ((pst[r] * 20) - 20)))) {
if (bgd[c] == 0) {
deflect.start();
pst[r] = 5;
psd[r] = 2;
}
if ((bgd[c] == 2) or (bgd[c] == 1)) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd2.start();
bgd[c] = 3;
bgs[c] = 3;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
if (((((bgt[c] == 8) and ((bgx[c] - 35) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 35) > (psx[r] - ((pst[r] * 20) - 20)))) and ((bgy[c] - 50) < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 20) > (psy[r] - ((pst[r] * 20) - 20)))) {
if ((bgd[c] == 0) or (bgd[c] == 1)) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd1.start();
bgd[c] = 2;
bgs[c] = 5;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
if (((((bgt[c] == 9) and ((bgx[c] - 40) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 40) > (psx[r] - ((pst[r] * 20) - 20)))) and ((bgy[c] - 20) < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 50) > (psy[r] - ((pst[r] * 20) - 20)))) {
if ((bgd[c] == 0) and (px > bgx[c])) {
deflect.start();
pst[r] = 5;
psd[r] = 2;
}
if ((bgd[c] == 1) and (px < bgx[c])) {
deflect.start();
pst[r] = 5;
psd[r] = 2;
}
if ((bgd[c] == 0) and (px < bgx[c])) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd1.start();
bgd[c] = 4;
bgs[c] = 4;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
if ((bgd[c] == 1) and (px > bgx[c])) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd1.start();
bgd[c] = 2;
bgs[c] = 4;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
if (((((bgt[c] == 10) and ((bgx[c] - 20) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 20) > (psx[r] - ((pst[r] * 20) - 20)))) and ((bgy[c] - 50) < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 20) > (psy[r] - ((pst[r] * 20) - 20)))) {
if ((bgd[c] == 0) or (bgd[c] == 1)) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd2.start();
bgd[c] = 2;
bgs[c] = 3;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
if (((((bgt[c] == 11) and ((bgx[c] - 25) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 25) > (psx[r] - ((pst[r] * 20) - 20)))) and (bgy[c] < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 50) > (psy[r] - ((pst[r] * 20) - 20)))) {
if ((((((bgd[c] == 0) or (bgd[c] == 1)) or (bgd[c] == 2)) or (bgd[c] == 3)) or (bgd[c] == 4)) or (bgd[c] == 5)) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd2.start();
bgd[c] = 6;
bgs[c] = 3;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
if (((((bgt[c] == 12) and ((bgx[c] - 25) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 25) > (psx[r] - ((pst[r] * 20) - 20)))) and (bgy[c] < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 50) > (psy[r] - ((pst[r] * 20) - 20)))) {
if ((bgd[c] == 0) or (bgd[c] == 1)) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd2.start();
bgd[c] = 2;
bgs[c] = 3;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
if (((((bgt[c] == 13) and ((bgx[c] - 35) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 35) > (psx[r] - ((pst[r] * 20) - 20)))) and (bgy[c] < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 60) > (psy[r] - ((pst[r] * 20) - 20)))) {
if ((((((bgd[c] == 0) or (bgd[c] == 1)) or (bgd[c] == 2)) or (bgd[c] == 3)) or (bgd[c] == 4)) or (bgd[c] == 5)) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd1.start();
bgd[c] = 6;
bgs[c] = 4;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
if (((((bgt[c] == 14) and ((bgx[c] - 20) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 20) > (psx[r] - ((pst[r] * 20) - 20)))) and ((bgy[c] - 20) < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 20) > (psy[r] - ((pst[r] * 20) - 20)))) {
if ((((bgd[c] == 0) or (bgd[c] == 1)) or (bgd[c] == 3)) or (bgd[c] == 4)) {
deflect.start();
pst[r] = 5;
psd[r] = 2;
}
if ((bgd[c] == 2) or (bgd[c] == 5)) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd2.start();
bgd[c] = 6;
bgs[c] = 3;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
}
r++;
}
c++;
}
r = 1;
while (r <= 8) {
if (((((bgt[r] > 0) and ((bgx[r] - 340) < px)) and ((bgx[r] + 340) > px)) and ((bgy[r] - 180) < py)) and ((bgy[r] + 350) > py)) {
c = 0;
e = 1;
while (e <= 24) {
if (((((bx[e] - 150) < bgx[r]) and ((bx[e] + 150) > bgx[r])) and ((by[e] - 150) < bgy[r])) and ((by[e] + 150) > bgy[r])) {
if (((((bgx[r] + 20) >= (bx[e] - 50)) and ((bgx[r] - 20) <= (bx[e] + 50))) and ((bgy[r] + 45) > (by[e] - 60))) and ((bgy[r] - 10) < (by[e] - 40))) {
c = 1;
}
if (((((bgx[r] + 20) > (bx[e] - 50)) and ((bgx[r] + 20) < bx[e])) and (bgy[r] < (by[e] + 50))) and ((bgy[r] + 20) > (by[e] - 50))) {
bgx[r] = bx[e] - 70;
}
if (((((bgx[r] - 20) < (bx[e] + 50)) and ((bgx[r] + 20) > bx[e])) and (bgy[r] < (by[e] + 50))) and ((bgy[r] + 20) > (by[e] - 50))) {
bgx[r] = bx[e] + 70;
}
if (((((bgx[r] - 5) < (bx[e] + 50)) and ((bgx[r] + 5) > (bx[e] - 50))) and ((bgy[r] - 30) < (by[e] + 50))) and (bgy[r] > (by[e] + 50))) {
bgy[r] = by[e] + 70;
}
if (((((bgx[r] - 2) < (bx[e] + 50)) and ((bgx[r] + 2) > (bx[e] - 50))) and ((bgy[r] + 20) < (by[e] - 50))) and ((bgy[r] + 60) > (by[e] - 50))) {
c = 1;
bgy[r] = by[e] - 105;
}
}
e++;
}
if (c == 0) {
bgy[r] = bgy[r] + 10;
}
if (bgt[r] == 1) {
if (((((((bgx[r] - 10) < (px + 10)) and ((bgx[r] + 10) > (px - 10))) and ((bgy[r] + 80) > (py + 10))) and ((bgy[r] + 50) < (py + 50))) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 4;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 4;
}
megah.start();
i = 10;
}
if (bgd[r] == 0) {
f[r] = 1;
if (px < bgx[r]) {
bgd[r] = 2;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
joes.start();
bgd[r] = 1;
bgs[r] = 7;
bgst[bsn] = 1;
bgsx[bsn] = bgx[r] - 10;
bgsy[bsn] = bgy[r] + 30;
bgsd[bsn] = 0;
bsn = bsn + 1;
if (bsn > 5) {
bsn = 1;
}
}
}
if (bgd[r] == 2) {
f[r] = 3;
if (px > bgx[r]) {
bgd[r] = 0;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
joes.start();
bgd[r] = 3;
bgs[r] = 7;
bgst[bsn] = 1;
bgsx[bsn] = bgx[r] + 10;
bgsy[bsn] = bgy[r] + 30;
bgsd[bsn] = 1;
bsn = bsn + 1;
if (bsn > 5) {
bsn = 1;
}
}
}
if (bgd[r] == 1) {
f[r] = 2;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 0;
bgs[r] = 20;
}
}
if (bgd[r] == 3) {
f[r] = 4;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 2;
bgs[r] = 20;
}
}
if (bgd[r] == 4) {
if (bgs[r] == 4) {
f[r] = 5;
}
if (bgs[r] == 3) {
f[r] = 6;
}
if (bgs[r] == 2) {
f[r] = 7;
}
if (bgs[r] == 1) {
f[r] = 8;
}
bgy[r] = bgy[r] - 10;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
f[r] = 9;
bgt[r] = 0;
bgx[r] = -500;
bgs[r] = 0;
}
}
}
if (bgt[r] == 2) {
if (((((((bgx[r] - 15) < (px + 10)) and ((bgx[r] + 15) > (px - 10))) and ((bgy[r] + 80) > (py - 10))) and ((bgy[r] + 50) < (py + 50))) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 3;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 3;
}
megah.start();
i = 10;
}
if (bgd[r] == 0) {
f[r] = 1;
if (px < bgx[r]) {
bgd[r] = 3;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 1;
bgs[r] = 10;
}
}
if (bgd[r] == 3) {
f[r] = 5;
if (px > bgx[r]) {
bgd[r] = 0;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 4;
bgs[r] = 10;
}
}
if (bgd[r] == 1) {
f[r] = 2;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 2;
bgs[r] = 12;
}
}
if (bgd[r] == 2) {
if (((bgs[r] == 12) or (bgs[r] == 11)) or (bgs[r] == 10)) {
f[r] = 3;
}
if (((bgs[r] == 9) or (bgs[r] == 8)) or (bgs[r] == 7)) {
f[r] = 4;
}
if (((bgs[r] == 6) or (bgs[r] == 5)) or (bgs[r] == 4)) {
f[r] = 3;
}
if (((bgs[r] == 3) or (bgs[r] == 2)) or (bgs[r] == 1)) {
f[r] = 4;
}
bgx[r] = bgx[r] + 8;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 0;
bgs[r] = 10 + random(20);
}
}
if (bgd[r] == 4) {
f[r] = 6;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 5;
bgs[r] = 12;
}
}
if (bgd[r] == 5) {
if (((bgs[r] == 12) or (bgs[r] == 11)) or (bgs[r] == 10)) {
f[r] = 7;
}
if (((bgs[r] == 9) or (bgs[r] == 8)) or (bgs[r] == 7)) {
f[r] = 8;
}
if (((bgs[r] == 6) or (bgs[r] == 5)) or (bgs[r] == 4)) {
f[r] = 7;
}
if (((bgs[r] == 3) or (bgs[r] == 2)) or (bgs[r] == 1)) {
f[r] = 8;
}
bgx[r] = bgx[r] - 8;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 3;
bgs[r] = 10 + random(20);
}
}
if (bgd[r] == 6) {
if (bgs[r] == 6) {
f[r] = 9;
}
if (bgs[r] == 5) {
f[r] = 10;
}
if (bgs[r] == 4) {
f[r] = 11;
}
if (bgs[r] == 3) {
f[r] = 12;
}
if (bgs[r] == 2) {
f[r] = 13;
}
if (bgs[r] == 1) {
f[r] = 14;
}
bgs[r] = bgs[r] - 1;
bgy[r] = bgy[r] - 10;
if (bgs[r] <= 0) {
f[r] = 15;
bgt[r] = 0;
bgx[r] = -500;
bgs[r] = 0;
}
}
}
if (bgt[r] == 3) {
if ((((((((bgx[r] - 20) < (px + 10)) and ((bgx[r] + 20) > (px - 10))) and ((bgy[r] + 60) > (py + 5))) and ((bgy[r] + 40) < (py + 45))) and (pcd < 18)) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 4;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 4;
}
megah.start();
i = 10;
}
if (bgd[r] == 0) {
if ((bgs[r] == 0) or (bgs[r] == 1)) {
f[r] = 1;
}
if ((bgs[r] == 2) or (bgs[r] == 3)) {
f[r] = 2;
}
if ((bgs[r] == 4) or (bgs[r] == 5)) {
f[r] = 3;
}
if ((bgs[r] == 6) or (bgs[r] == 7)) {
f[r] = 4;
}
if ((bgs[r] == 8) or (bgs[r] == 9)) {
f[r] = 5;
}
if ((bgs[r] == 10) or (bgs[r] == 11)) {
f[r] = 6;
}
if (px < bgx[r]) {
bgx[r] = bgx[r] - 5;
}
if (px > bgx[r]) {
bgx[r] = bgx[r] + 5;
}
if ((py - 20) > bgy[r]) {
bgy[r] = bgy[r] - 5;
}
if ((py - 20) < bgy[r]) {
bgy[r] = bgy[r] - 15;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgs[r] = 11;
}
}
if (bgd[r] == 1) {
if (bgs[r] == 4) {
f[r] = 7;
}
if (bgs[r] == 3) {
f[r] = 8;
}
if (bgs[r] == 2) {
f[r] = 9;
}
if (bgs[r] == 1) {
f[r] = 10;
}
bgs[r] = bgs[r] - 1;
bgy[r] = bgy[r] - 10;
if (bgs[r] <= 0) {
bgx[r] = -500;
f[r] = 11;
bgt[r] = 0;
bgs[r] = 0;
}
}
}
if (bgt[r] == 4) {
if (((((((bgx[r] - 20) < (px + 10)) and ((bgx[r] + 20) > (px - 10))) and ((bgy[r] + 80) > (py + 10))) and ((bgy[r] + 30) < (py + 50))) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 4;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 4;
}
megah.start();
i = 10;
}
if (bgd[r] == 0) {
f[r] = 1;
if ((px - 180) < bgx[r]) {
bgd[r] = 1;
bgs[r] = 4;
}
if (px < bgx[r]) {
bgd[r] = 2;
}
}
if (bgd[r] == 2) {
f[r] = 4;
if ((px + 180) > bgx[r]) {
bgd[r] = 3;
bgs[r] = 4;
}
if (px > bgx[r]) {
bgd[r] = 0;
}
}
if (bgd[r] == 1) {
if ((bgs[r] == 1) or (bgs[r] == 2)) {
f[r] = 2;
}
if ((bgs[r] == 3) or (bgs[r] == 4)) {
f[r] = 3;
}
bgx[r] = bgx[r] + 12;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgs[r] = 4;
}
}
if (bgd[r] == 3) {
if ((bgs[r] == 1) or (bgs[r] == 2)) {
f[r] = 5;
}
if ((bgs[r] == 3) or (bgs[r] == 4)) {
f[r] = 6;
}
bgx[r] = bgx[r] - 12;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgs[r] = 4;
}
}
if (bgd[r] == 4) {
if (bgs[r] == 4) {
f[r] = 7;
}
if (bgs[r] == 3) {
f[r] = 8;
}
if (bgs[r] == 2) {
f[r] = 9;
}
if (bgs[r] == 1) {
f[r] = 10;
}
bgs[r] = bgs[r] - 1;
bgy[r] = bgy[r] - 10;
if (bgs[r] <= 0) {
bgx[r] = -500;
f[r] = 11;
bgt[r] = 0;
bgs[r] = 0;
}
}
}
if (bgt[r] == 5) {
if (((((((bgx[r] - 20) < (px + 10)) and ((bgx[r] + 20) > (px - 10))) and ((bgy[r] + 80) > (py + 10))) and ((bgy[r] + 30) < (py + 50))) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 3;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 3;
}
megah.start();
i = 10;
}
if (bgd[r] == 0) {
f[r] = 1;
if (px < bgx[r]) {
bgd[r] = 2;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
cannons.start();
bgd[r] = 1;
bgs[r] = 8;
bgst[bsn] = 2;
bgsx[bsn] = bgx[r] - 20;
bgsy[bsn] = bgy[r] + 20;
bgsd[bsn] = 0;
bsn = bsn + 1;
if (bsn > 5) {
bsn = 1;
}
}
}
if (bgd[r] == 2) {
f[r] = 3;
if (px > bgx[r]) {
bgd[r] = 0;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
cannons.start();
bgd[r] = 3;
bgs[r] = 7;
bgst[bsn] = 2;
bgsx[bsn] = bgx[r] + 20;
bgsy[bsn] = bgy[r] + 20;
bgsd[bsn] = 1;
bsn = bsn + 1;
if (bsn > 5) {
bsn = 1;
}
}
}
if (bgd[r] == 1) {
f[r] = 2;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 0;
bgs[r] = 10 + random(15);
}
}
if (bgd[r] == 3) {
f[r] = 4;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 2;
bgs[r] = 10 + random(15);
}
}
if (bgd[r] == 4) {
if (bgs[r] == 5) {
f[r] = 5;
}
if (bgs[r] == 4) {
f[r] = 6;
}
if (bgs[r] == 3) {
f[r] = 7;
}
if (bgs[r] == 2) {
f[r] = 8;
}
if (bgs[r] == 1) {
f[r] = 9;
}
bgs[r] = bgs[r] - 1;
bgy[r] = bgy[r] - 10;
if (bgs[r] <= 0) {
f[r] = 10;
bgt[r] = 0;
bgx[r] = -500;
bgs[r] = 0;
}
}
}
if (bgt[r] == 6) {
if (((((((bgx[r] - 10) < (px + 10)) and ((bgx[r] + 10) > (px - 10))) and ((bgy[r] + 50) > (py + 10))) and ((bgy[r] + 10) < (py + 50))) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 4;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 4;
}
megah.start();
i = 10;
}
if (bgd[r] == 0) {
f[r] = 1;
bgy[r] = bgy[r] - 10;
if (((((px - 120) < bgx[r]) and ((px + 120) > bgx[r])) and ((bgy[r] - 80) < py)) and ((bgy[r] + 150) > py)) {
bgd[r] = 1;
bgs[r] = 6;
}
}
if (bgd[r] == 1) {
bgy[r] = bgy[r] - 10;
if (((bgs[r] == 6) or (bgs[r] == 5)) or (bgs[r] == 4)) {
f[r] = 2;
}
if (((bgs[r] == 3) or (bgs[r] == 2)) or (bgs[r] == 1)) {
f[r] = 3;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgs[r] = 4;
bgd[r] = 2;
}
}
if (bgd[r] == 2) {
if ((bgs[r] == 4) or (bgs[r] == 3)) {
f[r] = 4;
}
if ((bgs[r] == 2) or (bgs[r] == 1)) {
f[r] = 5;
}
if (px < bgx[r]) {
bgx[r] = (bgx[r] - 1) - random(10);
}
if (px > bgx[r]) {
bgx[r] = (bgx[r] + 1) + random(10);
}
if (py > bgy[r]) {
bgy[r] = bgy[r] + random(8);
}
if (py < bgy[r]) {
bgy[r] = (bgy[r] - 10) - random(10);
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgs[r] = 4;
}
}
if (bgd[r] == 3) {
if (bgs[r] == 4) {
f[r] = 6;
}
if (bgs[r] == 3) {
f[r] = 7;
}
if (bgs[r] == 2) {
f[r] = 8;
}
if (bgs[r] == 1) {
f[r] = 9;
}
bgs[r] = bgs[r] - 1;
bgy[r] = bgy[r] - 10;
if (bgs[r] <= 0) {
f[r] = 10;
bgt[r] = 0;
bgx[r] = -500;
bgs[r] = 0;
}
}
}
if (bgt[r] == 7) {
if (((((((bgx[r] - 20) < (px + 10)) and ((bgx[r] + 20) > (px - 10))) and ((bgy[r] + 20) > (py + 10))) and ((bgy[r] + 20) < (py + 50))) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 3;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 3;
}
megah.start();
i = 10;
}
if (bgd[r] == 0) {
f[r] = 1;
bgy[r] = bgy[r] - 10;
if ((px + 80) < bgx[r]) {
bgx[r] = bgx[r] - 5;
}
if ((px - 80) > bgx[r]) {
bgx[r] = bgx[r] + 5;
}
if ((py - 70) < bgy[r]) {
bgy[r] = bgy[r] - 5;
}
if ((py - 70) > bgy[r]) {
bgy[r] = bgy[r] + 5;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
joes.start();
if (px > bgx[r]) {
bgd[r] = 1;
}
if (px < bgx[r]) {
bgd[r] = 2;
}
if (px < bgx[r]) {
bgsd[bsn] = 3;
if ((py - 50) < bgy[r]) {
bgsd[bsn] = 1;
}
}
if (px > bgx[r]) {
bgsd[bsn] = 2;
if ((py - 50) < bgy[r]) {
bgsd[bsn] = 0;
}
}
bgs[r] = 12;
bgst[bsn] = 1;
bgsx[bsn] = bgx[r];
bgsy[bsn] = bgy[r];
bsn = bsn + 1;
if (bsn > 5) {
bsn = 1;
}
}
}
if (bgd[r] == 1) {
f[r] = 2;
bgy[r] = bgy[r] - 10;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 0;
bgs[r] = 10 + random(25);
}
}
if (bgd[r] == 2) {
f[r] = 3;
bgy[r] = bgy[r] - 10;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 0;
bgs[r] = 10 + random(25);
}
}
if (bgd[r] == 3) {
if (bgs[r] == 3) {
f[r] = 4;
}
if (bgs[r] == 2) {
f[r] = 5;
}
if (bgs[r] == 1) {
f[r] = 6;
}
bgs[r] = bgs[r] - 1;
bgy[r] = bgy[r] - 10;
if (bgs[r] <= 0) {
f[r] = 7;
bgt[r] = 0;
bgx[r] = -500;
bgs[r] = 0;
}
}
}
if (bgt[r] == 8) {
if (((((((bgx[r] - 20) < (px + 10)) and ((bgx[r] + 20) > (px - 10))) and ((bgy[r] + 35) > (py + 10))) and ((bgy[r] + 20) < (py + 50))) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 8;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 8;
}
bgd[r] = 2;
bgs[r] = 10;
baddyd1.start();
i = 10;
}
if (bgd[r] == 0) {
f[r] = 1;
bgx[r] = bgx[r] + 20;
if ((py + 30) > bgy[r]) {
bgy[r] = bgy[r] - 8;
}
if ((py + 30) < bgy[r]) {
bgy[r] = bgy[r] - 12;
}
if ((px + 100) < bgx[r]) {
bgd[r] = 1;
}
}
if (bgd[r] == 1) {
f[r] = 2;
bgx[r] = bgx[r] - 20;
if ((py + 30) > bgy[r]) {
bgy[r] = bgy[r] - 8;
}
if ((py + 30) < bgy[r]) {
bgy[r] = bgy[r] - 12;
}
if ((px - 100) > bgx[r]) {
bgd[r] = 0;
}
}
if (bgd[r] == 2) {
if (bgs[r] == 5) {
f[r] = 3;
}
if (bgs[r] == 4) {
f[r] = 4;
}
if (bgs[r] == 3) {
f[r] = 5;
}
if (bgs[r] == 2) {
f[r] = 6;
}
if (bgs[r] == 1) {
f[r] = 7;
}
bgs[r] = bgs[r] - 1;
bgy[r] = bgy[r] - 10;
if (bgs[r] <= 0) {
bgx[r] = -500;
f[r] = 8;
bgt[r] = 0;
bgs[r] = 0;
}
}
}
if (bgt[r] == 9) {
if (((((((bgx[r] - 30) < (px + 10)) and ((bgx[r] + 30) > (px - 10))) and ((bgy[r] + 55) > (py + 10))) and ((bgy[r] + 20) < (py + 50))) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 5;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 5;
}
megah.start();
i = 10;
}
if (bgd[r] == 0) {
if ((bgs[r] == 1) or (bgs[r] == 2)) {
f[r] = 1;
}
if ((bgs[r] == 3) or (bgs[r] == 4)) {
f[r] = 2;
}
bgx[r] = bgx[r] + 8;
if ((px + 80) < bgx[r]) {
bgd[r] = 1;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgs[r] = 4;
}
}
if (bgd[r] == 1) {
if ((bgs[r] == 1) or (bgs[r] == 2)) {
f[r] = 3;
}
if ((bgs[r] == 3) or (bgs[r] == 4)) {
f[r] = 4;
}
bgx[r] = bgx[r] - 8;
if ((px - 80) > bgx[r]) {
bgd[r] = 0;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgs[r] = 4;
}
}
if (bgd[r] == 2) {
if (bgs[r] == 4) {
f[r] = 5;
}
if (bgs[r] == 3) {
f[r] = 6;
}
if (bgs[r] == 2) {
f[r] = 7;
}
if (bgs[r] == 1) {
f[r] = 8;
}
bgs[r] = bgs[r] - 1;
bgy[r] = bgy[r] - 10;
if (bgs[r] <= 0) {
bgx[r] = -500;
f[r] = 9;
bgt[r] = 0;
bgs[r] = 0;
}
}
}
if (bgt[r] == 10) {
if (((((((bgx[r] - 20) < (px + 10)) and ((bgx[r] + 20) > (px - 10))) and ((bgy[r] + 20) > (py + 10))) and ((bgy[r] + 20) < (py + 50))) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 2;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 2;
}
megah.start();
i = 10;
}
if (bgd[r] == 0) {
f[r] = 1;
bgy[r] = bgy[r] - 10;
if (px < bgx[r]) {
bgx[r] = bgx[r] - 7;
}
if (px > bgx[r]) {
bgx[r] = bgx[r] + 7;
}
if ((py - 80) < bgy[r]) {
bgy[r] = bgy[r] - 8;
}
if ((py - 80) > bgy[r]) {
bgy[r] = bgy[r] + 8;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
joes.start();
bgd[r] = 1;
bgsd[bsn] = 4;
bgs[r] = 5;
bgst[bsn] = 1;
bgsx[bsn] = bgx[r];
bgsy[bsn] = bgy[r];
bsn = bsn + 1;
if (bsn > 5) {
bsn = 1;
}
}
}
if (bgd[r] == 1) {
f[r] = 2;
bgy[r] = bgy[r] - 10;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 0;
bgs[r] = 6 + random(16);
}
}
if (bgd[r] == 2) {
if (bgs[r] == 3) {
f[r] = 3;
}
if (bgs[r] == 2) {
f[r] = 4;
}
if (bgs[r] == 1) {
f[r] = 5;
}
bgs[r] = bgs[r] - 1;
bgy[r] = bgy[r] - 10;
if (bgs[r] <= 0) {
f[r] = 7;
bgt[r] = 0;
bgx[r] = -500;
bgs[r] = 0;
}
}
}
if (bgt[r] == 11) {
if (((((((bgx[r] - 20) < (px + 10)) and ((bgx[r] + 20) > (px - 10))) and ((bgy[r] + 50) > (py - 10))) and (bgy[r] < (py + 50))) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 3;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 3;
}
megah.start();
i = 10;
}
if (bgd[r] == 0) {
if (((bgs[r] == 12) or (bgs[r] == 11)) or (bgs[r] == 10)) {
f[r] = 1;
}
if (((bgs[r] == 9) or (bgs[r] == 8)) or (bgs[r] == 7)) {
f[r] = 2;
}
if (((bgs[r] == 6) or (bgs[r] == 5)) or (bgs[r] == 4)) {
f[r] = 1;
}
if (((bgs[r] == 3) or (bgs[r] == 2)) or (bgs[r] == 1)) {
f[r] = 2;
}
if (bgx[r] > px) {
bgd[r] = 3;
bgs[r] = 12;
}
bgx[r] = bgx[r] + 6;
if (((bgx[r] + 150) > (px - 20)) and (bgx[r] < px)) {
bgd[r] = 1;
bgs[r] = 9;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgs[r] = 12;
}
}
if (bgd[r] == 1) {
f[r] = 3;
bgx[r] = bgx[r] + 12;
bgy[r] = bgy[r] - 20;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 2;
bgs[r] = 10;
}
}
if (bgd[r] == 2) {
f[r] = 3;
bgx[r] = bgx[r] + 12;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 0;
bgs[r] = 12;
}
}
if (bgd[r] == 3) {
if (((bgs[r] == 12) or (bgs[r] == 11)) or (bgs[r] == 10)) {
f[r] = 4;
}
if (((bgs[r] == 9) or (bgs[r] == 8)) or (bgs[r] == 7)) {
f[r] = 5;
}
if (((bgs[r] == 6) or (bgs[r] == 5)) or (bgs[r] == 4)) {
f[r] = 4;
}
if (((bgs[r] == 3) or (bgs[r] == 2)) or (bgs[r] == 1)) {
f[r] = 5;
}
if (bgx[r] < px) {
bgd[r] = 0;
bgs[r] = 12;
}
bgx[r] = bgx[r] - 6;
if (((bgx[r] - 150) < (px - 20)) and (bgx[r] > px)) {
bgd[r] = 4;
bgs[r] = 9;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgs[r] = 12;
}
}
if (bgd[r] == 4) {
f[r] = 6;
bgx[r] = bgx[r] - 12;
bgy[r] = bgy[r] - 20;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 5;
bgs[r] = 10;
}
}
if (bgd[r] == 5) {
f[r] = 6;
bgx[r] = bgx[r] - 12;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 3;
bgs[r] = 12;
}
}
if (bgd[r] == 6) {
if (bgs[r] == 3) {
f[r] = 7;
}
if (bgs[r] == 2) {
f[r] = 8;
}
if (bgs[r] == 1) {
f[r] = 9;
}
bgs[r] = bgs[r] - 1;
bgy[r] = bgy[r] - 10;
if (bgs[r] <= 0) {
f[r] = 15;
bgt[r] = 0;
bgx[r] = -500;
bgs[r] = 0;
}
}
}
if (bgt[r] == 12) {
if (((((((bgx[r] - 20) < (px + 10)) and ((bgx[r] + 20) > (px - 10))) and ((bgy[r] + 40) > py)) and ((bgy[r] - 20) < (py + 50))) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 3;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 3;
}
megah.start();
i = 10;
}
if (bgd[r] == 0) {
if (bgs[r] == 1) {
f[r] = 1;
}
if (bgs[r] == 2) {
f[r] = 2;
}
bgy[r] = bgy[r] - 10;
bgx[r] = bgx[r] + 7;
if ((py - 60) < bgy[r]) {
bgy[r] = bgy[r] - 5;
}
if ((((px - 70) < bgx[r]) and ((px + 70) > bgx[r])) and (py > bgy[r])) {
bgy[r] = bgy[r] + 12;
}
if ((px + 100) < bgx[r]) {
bgd[r] = 1;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgs[r] = 2;
}
}
if (bgd[r] == 1) {
if (bgs[r] == 1) {
f[r] = 3;
}
if (bgs[r] == 2) {
f[r] = 4;
}
bgy[r] = bgy[r] - 10;
bgx[r] = bgx[r] - 7;
if ((py - 60) < bgy[r]) {
bgy[r] = bgy[r] - 5;
}
if ((((px - 70) < bgx[r]) and ((px + 70) > bgx[r])) and (py > bgy[r])) {
bgy[r] = bgy[r] + 12;
}
if ((px - 100) > bgx[r]) {
bgd[r] = 0;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgs[r] = 2;
}
}
if (bgd[r] == 2) {
if (bgs[r] == 4) {
f[r] = 5;
}
if (bgs[r] == 3) {
f[r] = 6;
}
if (bgs[r] == 2) {
f[r] = 7;
}
if (bgs[r] == 1) {
f[r] = 8;
}
bgs[r] = bgs[r] - 1;
bgy[r] = bgy[r] - 10;
if (bgs[r] <= 0) {
bgx[r] = -500;
f[r] = 9;
bgt[r] = 0;
bgs[r] = 0;
}
}
}
if (bgt[r] == 13) {
if (((((((bgx[r] - 50) < (px + 10)) and ((bgx[r] + 50) > (px - 10))) and ((bgy[r] + 70) > (py + 10))) and (bgy[r] < (py + 50))) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 4;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 4;
}
megah.start();
i = 10;
}
if (bgd[r] == 0) {
f[r] = 1;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
if ((px - 170) < bgx[r]) {
bgd[r] = 1;
bgs[r] = 7;
}
}
if (px < bgx[r]) {
bgd[r] = 3;
}
}
if (bgd[r] == 1) {
f[r] = 2;
bgx[r] = bgx[r] + 30;
bgy[r] = bgy[r] - 20;
if (bgy[r] < py) {
bgy[r] = bgy[r] + 10;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 2;
bgs[r] = 12;
}
}
if (bgd[r] == 2) {
f[r] = 3;
bgx[r] = bgx[r] + 5;
bgy[r] = bgy[r] + 2;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 0;
bgs[r] = random(12);
}
}
if (bgd[r] == 3) {
f[r] = 4;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
if ((px + 170) > bgx[r]) {
bgd[r] = 4;
bgs[r] = 7;
}
}
if (px > bgx[r]) {
bgd[r] = 0;
}
}
if (bgd[r] == 4) {
f[r] = 5;
bgx[r] = bgx[r] - 30;
bgy[r] = bgy[r] - 20;
bgs[r] = bgs[r] - 1;
if (bgy[r] < py) {
bgy[r] = bgy[r] + 10;
}
if (bgs[r] <= 0) {
bgd[r] = 5;
bgs[r] = 12;
}
}
if (bgd[r] == 5) {
f[r] = 6;
bgx[r] = bgx[r] - 5;
bgy[r] = bgy[r] + 2;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 3;
bgs[r] = random(12);
}
}
if (bgd[r] == 6) {
if (bgs[r] == 4) {
f[r] = 7;
}
if (bgs[r] == 3) {
f[r] = 8;
}
if (bgs[r] == 2) {
f[r] = 9;
}
if (bgs[r] == 1) {
f[r] = 10;
}
bgs[r] = bgs[r] - 1;
bgy[r] = bgy[r] - 10;
if (bgs[r] <= 0) {
bgx[r] = -500;
f[r] = 11;
bgt[r] = 0;
bgs[r] = 0;
}
}
}
if (bgt[r] == 14) {
if (((((((bgx[r] - 20) < (px + 10)) and ((bgx[r] + 20) > (px - 10))) and ((bgy[r] + 50) > (py + 10))) and ((bgy[r] + 20) < (py + 50))) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 2;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 2;
}
megah.start();
i = 10;
}
if (bgt[r] > 0) {
bgy[r] = bgy[r] - 10;
}
if (bgd[r] == 0) {
f[r] = 1;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 1;
bgs[r] = 6;
}
}
if (bgd[r] == 1) {
if (((bgs[r] == 6) or (bgs[r] == 5)) or (bgs[r] == 4)) {
f[r] = 2;
}
if (((bgs[r] == 3) or (bgs[r] == 2)) or (bgs[r] == 1)) {
f[r] = 3;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 2;
bgs[r] = 15;
}
}
if (bgd[r] == 2) {
f[r] = 4;
if (((bgs[r] == 15) or (bgs[r] == 10)) or (bgs[r] == 5)) {
cannons.start();
bgst[bsn] = 2;
bgsx[bsn] = bgx[r] + 20;
bgsy[bsn] = bgy[r];
bgsd[bsn] = 0;
bsn = bsn + 1;
if (bsn > 5) {
bsn = 1;
}
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 0;
bgs[r] = 20;
}
}
if (bgd[r] == 3) {
f[r] = 5;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 4;
bgs[r] = 6;
}
}
if (bgd[r] == 4) {
if (((bgs[r] == 6) or (bgs[r] == 5)) or (bgs[r] == 4)) {
f[r] = 6;
}
if (((bgs[r] == 3) or (bgs[r] == 2)) or (bgs[r] == 1)) {
f[r] = 7;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 5;
bgs[r] = 15;
}
}
if (bgd[r] == 5) {
f[r] = 8;
if (((bgs[r] == 15) or (bgs[r] == 10)) or (bgs[r] == 5)) {
cannons.start();
bgst[bsn] = 2;
bgsx[bsn] = bgx[r] - 20;
bgsy[bsn] = bgy[r];
bgsd[bsn] = 1;
bsn = bsn + 1;
if (bsn > 5) {
bsn = 1;
}
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 3;
bgs[r] = 20;
}
}
if (bgd[r] == 6) {
if (bgs[r] == 2) {
f[r] = 9;
}
if (bgs[r] == 1) {
f[r] = 10;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
f[r] = 11;
bgt[r] = 0;
bgx[r] = -500;
bgs[r] = 0;
}
}
}
}
r++;
}
r = 1;
while (r <= 5) {
if (bgst[r] > 0) {
if (bgst[r] == 1) {
if (r == 1) {
bgs1.gotoAndStop(1);
}
if (r == 2) {
bgs2.gotoAndStop(1);
}
if (r == 3) {
bgs3.gotoAndStop(1);
}
if (r == 4) {
bgs4.gotoAndStop(1);
}
if (r == 5) {
bgs5.gotoAndStop(1);
}
if (bgsd[r] == 0) {
bgsx[r] = bgsx[r] + 20;
if (bgsx[r] > (px + 300)) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgsd[r] == 1) {
bgsx[r] = bgsx[r] - 20;
if (bgsx[r] < (px - 300)) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgsd[r] == 2) {
bgsx[r] = bgsx[r] + 15;
bgsy[r] = bgsy[r] + 15;
if ((bgsx[r] > (px + 300)) or (bgsy[r] > (py + 300))) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgsd[r] == 3) {
bgsx[r] = bgsx[r] - 15;
bgsy[r] = bgsy[r] + 15;
if ((bgsx[r] > (px + 300)) or (bgsy[r] > (py + 300))) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgsd[r] == 4) {
bgsy[r] = bgsy[r] + 20;
if (bgsy[r] > (py + 300)) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (((((((bgsx[r] - 15) < (px + 10)) and ((bgsx[r] + 15) > (px - 10))) and ((bgsy[r] + 15) > (py + 5))) and ((bgsy[r] - 15) < (py + 20))) and (pcd < 18)) and (i < 1)) {
if ((bgsd[r] == 0) or (bgsd[r] == 2)) {
pcd = 19;
}
if ((bgsd[r] == 1) or (bgsd[r] == 3)) {
pcd = 18;
}
pstep = 2;
pl = pl - 3;
megah.start();
i = 10;
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgst[r] == 2) {
if (r == 1) {
bgs1.gotoAndStop(2);
}
if (r == 2) {
bgs2.gotoAndStop(2);
}
if (r == 3) {
bgs3.gotoAndStop(2);
}
if (r == 4) {
bgs4.gotoAndStop(2);
}
if (r == 5) {
bgs5.gotoAndStop(2);
}
if (bgsd[r] == 0) {
bgsx[r] = bgsx[r] + 30;
if (bgsx[r] > (px + 300)) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgsd[r] == 1) {
bgsx[r] = bgsx[r] - 30;
if (bgsx[r] < (px - 300)) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (((((((bgsx[r] - 25) < (px + 10)) and ((bgsx[r] + 25) > (px - 10))) and ((bgsy[r] + 80) > (py + 40))) and ((bgsy[r] + 35) < (py + 60))) and (pcd < 18)) and (i < 1)) {
if (bgsd[r] == 0) {
pcd = 19;
}
if (bgsd[r] == 1) {
pcd = 18;
}
pstep = 2;
pl = pl - 6;
megah.start();
i = 10;
bgst[r] = 0;
bgsx[r] = -200;
}
}
}
r++;
}
bg1.gotoAndStop(f[1]);
bg2.gotoAndStop(f[2]);
bg3.gotoAndStop(f[3]);
bg4.gotoAndStop(f[4]);
bg5.gotoAndStop(f[5]);
bg6.gotoAndStop(f[6]);
bg7.gotoAndStop(f[7]);
bg8.gotoAndStop(f[8]);
bgs1._x = ((bgsx[1] + 275) - px) / 2;
bgs1._y = ((bgsy[1] + 275) - py) / 2;
bgs2._x = ((bgsx[2] + 275) - px) / 2;
bgs2._y = ((bgsy[2] + 275) - py) / 2;
bgs3._x = ((bgsx[3] + 275) - px) / 2;
bgs3._y = ((bgsy[3] + 275) - py) / 2;
bgs4._x = ((bgsx[4] + 275) - px) / 2;
bgs4._y = ((bgsy[4] + 275) - py) / 2;
bgs5._x = ((bgsx[5] + 275) - px) / 2;
bgs5._y = ((bgsy[5] + 275) - py) / 2;
bg1._x = ((bgx[1] + 275) - px) / 2;
bg1._y = ((bgy[1] + 275) - py) / 2;
bg2._x = ((bgx[2] + 275) - px) / 2;
bg2._y = ((bgy[2] + 275) - py) / 2;
bg3._x = ((bgx[3] + 275) - px) / 2;
bg3._y = ((bgy[3] + 275) - py) / 2;
bg4._x = ((bgx[4] + 275) - px) / 2;
bg4._y = ((bgy[4] + 275) - py) / 2;
bg5._x = ((bgx[5] + 275) - px) / 2;
bg5._y = ((bgy[5] + 275) - py) / 2;
bg6._x = ((bgx[6] + 275) - px) / 2;
bg6._y = ((bgy[6] + 275) - py) / 2;
bg7._x = ((bgx[7] + 275) - px) / 2;
bg7._y = ((bgy[7] + 275) - py) / 2;
bg8._x = ((bgx[8] + 275) - px) / 2;
bg8._y = ((bgy[8] + 275) - py) / 2;
r = 1;
while (r <= 3) {
if (((pst[r] > 0) and (pst[r] < 4)) and (psd[r] == 0)) {
if (r == 1) {
shot1p._x = ((297 + psx[1]) - px) / 2;
shot1p._y = ((270 + psy[1]) - py) / 2;
}
if (r == 2) {
shot2p._x = ((297 + psx[2]) - px) / 2;
shot2p._y = ((270 + psy[2]) - py) / 2;
}
if (r == 3) {
shot3p._x = ((297 + psx[3]) - px) / 2;
shot3p._y = ((270 + psy[3]) - py) / 2;
}
}
if (((pst[r] > 0) and (pst[r] < 4)) and (psd[r] == 1)) {
if (r == 1) {
shot1p._x = ((247 + psx[1]) - px) / 2;
shot1p._y = ((270 + psy[1]) - py) / 2;
}
if (r == 2) {
shot2p._x = ((247 + psx[2]) - px) / 2;
shot2p._y = ((270 + psy[2]) - py) / 2;
}
if (r == 3) {
shot3p._x = ((247 + psx[3]) - px) / 2;
shot3p._y = ((270 + psy[3]) - py) / 2;
}
}
if ((pst[r] == 4) or (pst[r] == 5)) {
if (r == 1) {
shot1p._x = ((272 + psx[1]) - px) / 2;
shot1p._y = ((270 + psy[1]) - py) / 2;
}
if (r == 2) {
shot2p._x = ((272 + psx[2]) - px) / 2;
shot2p._y = ((270 + psy[2]) - py) / 2;
}
if (r == 3) {
shot3p._x = ((272 + psx[3]) - px) / 2;
shot3p._y = ((270 + psy[3]) - py) / 2;
}
}
if (pst[r] == 0) {
if (r == 1) {
shot1p._x = -200;
shot1p._y = (270 + psy[1]) - py;
}
if (r == 2) {
shot2p._x = -200;
shot2p._y = (270 + psy[2]) - py;
}
if (r == 3) {
shot3p._x = -200;
shot3p._y = (270 + psy[3]) - py;
}
}
r++;
}
if (i > 0) {
i = i - 1;
pc._alpha = 50;
}
if (i <= 0) {
i = i - 1;
pc._alpha = 100;
}
if (bcharge > 0) {
charge._alpha = bcharge;
}
lbar._height = 2 * pl;
lbar._y = 120 - (2 * pl);
stage._x = (275 - px) / 2;
stage._y = (-225 - py) / 2;
exit._x = ((ex + 275) - px) / 2;
exit._y = ((ey + 275) - py) / 2;
Frame 203
gotoAndPlay (202);
if ((((px + 10) > (ex - 20)) and ((px - 10) < (ex + 20))) and (((py + 30) > (ey - 20)) and (py < (ey + 50)))) {
gotoAndPlay (204);
}
Frame 204
lbar._height = 2 * pl;
lbar._y = 120 - (2 * pl);
stage._x = (275 - px) / 2;
stage._y = (-225 - py) / 2;
exit._x = ((ex + 275) - px) / 2;
exit._y = ((ey + 275) - py) / 2;
Frame 207
psn = 1;
bstep = 0;
pcd = 0;
bcharge = 0;
r = 1;
while (r <= 5) {
psx[r] = -200;
psy[r] = 0;
pst[r] = 0;
psd[r] = 0;
r++;
}
i = 0;
pl = pl + 5;
if (pl > 50) {
pl = 50;
}
px = 750;
py = 350;
r = 0;
while (r <= 26) {
bx[r] = -50;
by[r] = -50;
r++;
}
bx[1] = 750;
by[1] = 450;
bx[2] = 450;
by[2] = 400;
bx[3] = 250;
by[3] = 350;
bx[4] = 50;
by[4] = 250;
bx[5] = 300;
by[5] = 150;
bx[6] = 450;
by[6] = 150;
bx[7] = 700;
by[7] = 150;
bx[8] = 850;
by[8] = 50;
bx[9] = 700;
by[9] = -50;
bx[10] = 450;
by[10] = -50;
bx[11] = 350;
by[11] = -50;
bx[12] = 150;
by[12] = -150;
bx[13] = 350;
by[13] = -250;
bx[14] = 150;
by[14] = -350;
bx[15] = 350;
by[15] = -450;
bx[16] = 450;
by[16] = -450;
bx[17] = 550;
by[17] = -450;
bx[18] = 650;
by[18] = -550;
bx[19] = 550;
by[19] = -650;
bx[20] = 450;
by[20] = -650;
bx[21] = 350;
by[21] = -650;
bx[22] = 250;
by[22] = -650;
bsn = 1;
r = 1;
while (r <= 8) {
bgx[r] = -200;
bgy[r] = -200;
bgt[r] = 0;
bgd[r] = -1;
bgs[r] = 0;
r++;
}
r = 1;
while (r <= 5) {
bgsx[r] = -200;
bgsy[r] = 0;
bgst[r] = 0;
bgsd[r] = 0;
r++;
}
r = 1;
while (r <= 8) {
f[r] = 20;
r++;
}
bgt[1] = 1;
bgd[1] = 0;
bgs[1] = 0;
bgl[1] = 3;
bgx[1] = 680;
bgy[1] = -650;
bgt[2] = 2;
bgd[2] = 0;
bgs[2] = 0;
bgl[2] = 3;
bgx[2] = 550;
bgy[2] = -550;
bgt[3] = 2;
bgd[3] = 0;
bgs[3] = 0;
bgl[3] = 3;
bgx[3] = 500;
bgy[3] = -550;
bgt[4] = 3;
bgd[4] = 0;
bgs[4] = 0;
bgl[4] = 5;
bgx[4] = 400;
bgy[4] = -650;
bgt[5] = 14;
bgd[5] = 0;
bgs[5] = 0;
bgl[5] = 3;
bgx[5] = 200;
bgy[5] = -450;
bgt[6] = 14;
bgd[6] = 3;
bgs[6] = 0;
bgl[6] = 3;
bgx[6] = 500;
bgy[6] = -350;
bgt[7] = 3;
bgd[7] = 0;
bgs[7] = 0;
bgl[7] = 5;
bgx[7] = 250;
bgy[7] = -250;
bgt[8] = 2;
bgd[8] = 0;
bgs[8] = 0;
bgl[8] = 3;
bgx[8] = 450;
bgy[8] = -50;
ex = 550;
ey = -550;
Frame 208
b1._x = bx[1] / 10;
b1._y = (by[1] / 10) + 120;
b2._x = bx[2] / 10;
b2._y = (by[2] / 10) + 120;
b3._x = bx[3] / 10;
b3._y = (by[3] / 10) + 120;
b4._x = bx[4] / 10;
b4._y = (by[4] / 10) + 120;
b5._x = bx[5] / 10;
b5._y = (by[5] / 10) + 120;
b6._x = bx[6] / 10;
b6._y = (by[6] / 10) + 120;
b7._x = bx[7] / 10;
b7._y = (by[7] / 10) + 120;
b8._x = bx[8] / 10;
b8._y = (by[8] / 10) + 120;
b9._x = bx[9] / 10;
b9._y = (by[9] / 10) + 120;
b10._x = bx[10] / 10;
b10._y = (by[10] / 10) + 120;
b11._x = bx[11] / 10;
b11._y = (by[11] / 10) + 120;
b12._x = bx[12] / 10;
b12._y = (by[12] / 10) + 120;
b13._x = bx[13] / 10;
b13._y = (by[13] / 10) + 120;
b14._x = bx[14] / 10;
b14._y = (by[14] / 10) + 120;
b15._x = bx[15] / 10;
b15._y = (by[15] / 10) + 120;
b16._x = bx[16] / 10;
b16._y = (by[16] / 10) + 120;
b17._x = bx[17] / 10;
b17._y = (by[17] / 10) + 120;
b18._x = bx[18] / 10;
b18._y = (by[18] / 10) + 120;
b19._x = bx[19] / 10;
b19._y = (by[19] / 10) + 120;
b20._x = bx[20] / 10;
b20._y = (by[20] / 10) + 120;
b21._x = bx[21] / 10;
b21._y = (by[21] / 10) + 120;
b22._x = bx[22] / 10;
b22._y = (by[22] / 10) + 120;
b23._x = bx[23] / 10;
b23._y = (by[23] / 10) + 120;
b24._x = bx[24] / 10;
b24._y = (by[24] / 10) + 120;
b25._x = bx[25] / 10;
b25._y = (by[25] / 10) + 120;
b26._x = bx[26] / 10;
b26._y = (by[26] / 10) + 120;
b27._x = bx[27] / 10;
b27._y = (by[27] / 10) + 120;
b28._x = bx[28] / 10;
b28._y = (by[28] / 10) + 120;
cir._x = px / 10;
cir._y = (py / 10) + 120;
shot1._x = psx[1] / 10;
shot1._y = (psy[1] / 10) + 120;
shot2._x = psx[2] / 10;
shot2._y = (psy[2] / 10) + 120;
shot3._x = psx[3] / 10;
shot3._y = (psy[3] / 10) + 120;
bshot1._x = bgsx[1] / 10;
bshot1._y = (bgsy[1] / 10) + 120;
bshot2._x = bgsx[2] / 10;
bshot2._y = (bgsy[2] / 10) + 120;
bshot3._x = bgsx[3] / 10;
bshot3._y = (bgsy[3] / 10) + 120;
bshot4._x = bgsx[4] / 10;
bshot4._y = (bgsy[4] / 10) + 120;
bshot5._x = bgsx[5] / 10;
bshot5._y = (bgsy[5] / 10) + 120;
bcir1._x = bgx[1] / 10;
bcir1._y = (bgy[1] / 10) + 120;
bcir2._x = bgx[2] / 10;
bcir2._y = (bgy[2] / 10) + 120;
bcir3._x = bgx[3] / 10;
bcir3._y = (bgy[3] / 10) + 120;
bcir4._x = bgx[4] / 10;
bcir4._y = (bgy[4] / 10) + 120;
bcir5._x = bgx[5] / 10;
bcir5._y = (bgy[5] / 10) + 120;
bcir6._x = bgx[6] / 10;
bcir6._y = (bgy[6] / 10) + 120;
bcir7._x = bgx[7] / 10;
bcir7._y = (bgy[7] / 10) + 120;
bcir8._x = bgx[8] / 10;
bcir8._y = (bgy[8] / 10) + 120;
bcir9._x = bgx[9] / 10;
bcir9._y = (bgy[9] / 10) + 120;
bcir10._x = bgx[10] / 10;
bcir10._y = (bgy[10] / 10) + 120;
bcir11._x = bgx[11] / 10;
bcir11._y = (bgy[11] / 10) + 120;
bcir12._x = bgx[12] / 10;
bcir12._y = (bgy[12] / 10) + 120;
bcir13._x = bgx[13] / 10;
bcir13._y = (bgy[13] / 10) + 120;
if (Key.isDown(39) and (pcd == 0)) {
pcd = 2;
}
if (Key.isDown(39) and ((pcd == 1) or (pcd == 3))) {
pcd = 0;
}
if (Key.isDown(37) and (pcd == 1)) {
pcd = 3;
}
if (Key.isDown(37) and ((pcd == 0) or (pcd == 2))) {
pcd = 1;
}
if (Key.isDown(38) and ((pcd == 0) or (pcd == 2))) {
pcd = 10;
pstep = 7;
}
if (Key.isDown(38) and ((pcd == 1) or (pcd == 3))) {
pcd = 11;
pstep = 7;
}
if (Key.isDown(40) and ((((pcd == 0) or (pcd == 1)) or (pcd == 2)) or (pcd == 3))) {
if (((pcd == 0) or (pcd == 2)) or (pcd == 8)) {
pcd = 6;
pstep = 3;
}
if (((pcd == 1) or (pcd == 3)) or (pcd == 9)) {
pcd = 7;
pstep = 3;
}
}
if (Key.isDown(16) and (bcharge < 100)) {
bcharge = bcharge + 5;
}
if (pcd == 0) {
pc.gotoAndStop(1);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(21);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 0;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
}
if (pcd == 1) {
pc.gotoAndStop(2);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(22);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 1;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
}
if (pcd == 2) {
px = px + 13;
if ((w == 0) or (w == 1)) {
pc.gotoAndStop(3);
}
if ((w == 2) or (w == 3)) {
pc.gotoAndStop(4);
}
if ((w == 4) or (w == 5)) {
pc.gotoAndStop(5);
}
if ((w == 6) or (w == 7)) {
pc.gotoAndStop(6);
}
if (Key.isDown(32)) {
if ((w == 0) or (w == 1)) {
pc.gotoAndStop(11);
}
if ((w == 2) or (w == 3)) {
pc.gotoAndStop(12);
}
if ((w == 4) or (w == 5)) {
pc.gotoAndStop(13);
}
if ((w == 6) or (w == 7)) {
pc.gotoAndStop(14);
}
if ((pst[psn] == 0) and (bstep == 0)) {
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 0;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
}
pcd = 0;
}
if (pcd == 3) {
px = px - 13;
if ((w == 0) or (w == 1)) {
pc.gotoAndStop(7);
}
if ((w == 2) or (w == 3)) {
pc.gotoAndStop(8);
}
if ((w == 4) or (w == 5)) {
pc.gotoAndStop(9);
}
if ((w == 6) or (w == 7)) {
pc.gotoAndStop(10);
}
if (Key.isDown(32)) {
if ((w == 0) or (w == 1)) {
pc.gotoAndStop(15);
}
if ((w == 2) or (w == 3)) {
pc.gotoAndStop(16);
}
if ((w == 4) or (w == 5)) {
pc.gotoAndStop(17);
}
if ((w == 6) or (w == 7)) {
pc.gotoAndStop(18);
}
if ((pst[psn] == 0) and (bstep == 0)) {
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 1;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
}
pcd = 1;
}
if (pcd == 9) {
pstep = pstep - 1;
if (pstep <= 0) {
pcd = 1;
}
}
if (pcd == 6) {
pc.gotoAndStop(19);
px = px + 20;
pstep = pstep - 1;
if (pstep <= 0) {
pcd = 0;
}
}
if (pcd == 7) {
pc.gotoAndStop(20);
px = px - 20;
pstep = pstep - 1;
if (pstep <= 0) {
pcd = 1;
}
}
if (pcd == 12) {
pc.gotoAndStop(23);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(25);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 0;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
py = py + (5 * (7 - pstep));
pstep = pstep - 1;
if (pstep <= 2) {
pstep = 2;
}
if (Key.isDown(39)) {
px = px + 13;
}
if (Key.isDown(37)) {
px = px - 13;
if (bstep == 0) {
pcd = 13;
}
}
}
if (pcd == 13) {
pc.gotoAndStop(24);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(26);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 1;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
py = py + (5 * (7 - pstep));
pstep = pstep - 1;
if (pstep <= 2) {
pstep = 2;
}
if (Key.isDown(39)) {
px = px + 13;
if (bstep == 0) {
pcd = 12;
}
}
if (Key.isDown(37)) {
px = px - 13;
}
}
if (pcd == 10) {
pc.gotoAndStop(23);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(25);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 0;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
py = py - (5 * pstep);
pstep = pstep - 1;
if (Key.isDown(39)) {
px = px + 13;
}
if (Key.isDown(37)) {
px = px - 13;
if (bstep == 0) {
pcd = 11;
}
}
if (Key.isDown(40)) {
pcd = 12;
pstep = pstep + 3;
}
if (pstep <= -1) {
pstep = 7;
pcd = 12;
}
}
if (pcd == 11) {
pc.gotoAndStop(24);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(26);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 1;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
py = py - (5 * pstep);
pstep = pstep - 1;
if (Key.isDown(39)) {
px = px + 13;
if (bstep == 0) {
pcd = 10;
}
}
if (Key.isDown(37)) {
px = px - 13;
}
if (Key.isDown(40)) {
pcd = 13;
pstep = pstep + 3;
}
if (pstep <= -1) {
pstep = 7;
pcd = 13;
}
}
if (pcd == 18) {
pc.gotoAndStop(27);
pstep = pstep - 1;
px = px - 5;
if (pstep <= -1) {
pstep = 2;
pcd = 0;
}
}
if (pcd == 19) {
pc.gotoAndStop(28);
pstep = pstep - 1;
px = px + 5;
if (pstep <= -1) {
pstep = 2;
pcd = 1;
}
}
if (pcd == 20) {
pc.gotoAndStop(69 - pstep);
bcharge = 0;
charge._alpha = 0;
bstep = 20;
pl = 1;
pstep = pstep - 1;
if (pstep < 0) {
lives = lives - 1;
if (lives >= 0) {
pl = 50;
gotoAndPlay (190);
}
if (lives < 0) {
lives = 2;
continues = continues - 1;
gotoAndPlay (5);
}
}
}
if (pl <= 0) {
c = 1;
while (c <= 8) {
bgx[c] = -600;
c++;
}
pc._alpha = 100;
pcd = 20;
pstep = 40;
megad.start();
}
if (bstep > 0) {
bcharge = 0;
charge._alpha = bcharge;
}
if (bstep > 0) {
bstep = bstep - 1;
}
if ((py > 500) and (pcd < 20)) {
megad.start();
pl = 0;
}
w = w - 1;
if (w < 0) {
w = 7;
}
e = pcd;
c = 0;
r = 1;
while (r <= 22) {
if (((((bx[r] - 150) < px) and ((bx[r] + 150) > px)) and ((by[r] - 150) < py)) and ((by[r] + 150) > py)) {
if (((((((px - 30) < (bx[r] + 50)) and ((px + 20) > (bx[r] - 50))) and (py < (by[r] - 50))) and ((py + 60) > (by[r] - 50))) and (pcd != 10)) and (pcd != 11)) {
if ((((pcd == 12) or (pcd == 13)) or (pcd == 16)) or (pcd == 17)) {
if ((pcd == 12) or (pcd == 16)) {
pcd = 0;
}
if ((pcd == 13) or (pcd == 17)) {
pcd = 1;
}
}
c = 1;
py = by[r] - 75;
}
if (((((px + 38) > (bx[r] - 50)) and ((px + 20) < bx[r])) and (py < (by[r] + 50))) and ((py + 20) > (by[r] - 50))) {
px = bx[r] - 85;
}
if (((((px - 35) < (bx[r] + 50)) and ((px - 20) > bx[r])) and (py < (by[r] + 50))) and ((py + 20) > (by[r] - 50))) {
px = bx[r] + 85;
}
if (((((px - 5) < (bx[r] + 50)) and ((px + 5) > (bx[r] - 50))) and ((py - 30) < (by[r] + 50))) and ((py + 10) > (by[r] + 50))) {
if ((((pcd == 10) or (pcd == 11)) or (pcd == 14)) or (pcd == 15)) {
if ((pcd == 10) or (pcd == 14)) {
pcd = 12;
pstep = 5;
}
if ((pcd == 11) or (pcd == 15)) {
pcd = 13;
pstep = 5;
}
}
py = by[r] + 90;
}
}
r++;
}
if (c == 0) {
if ((((pcd == 0) or (pcd == 2)) or (pcd == 6)) or (pcd == 18)) {
pcd = 12;
pstep = 6;
}
if ((((pcd == 1) or (pcd == 3)) or (pcd == 7)) or (pcd == 19)) {
pcd = 13;
pstep = 6;
}
}
r = 1;
while (r <= 3) {
if (pst[r] == 1) {
if (psd[r] == 0) {
psx[r] = psx[r] + 30;
if (r == 1) {
shot1p.gotoAndStop(1);
}
if (r == 2) {
shot2p.gotoAndStop(1);
}
if (r == 3) {
shot3p.gotoAndStop(1);
}
if (psx[r] > (px + 280)) {
pst[r] = 0;
psx[r] = -200;
}
}
if (psd[r] == 1) {
psx[r] = psx[r] - 30;
if (r == 1) {
shot1p.gotoAndStop(2);
}
if (r == 2) {
shot2p.gotoAndStop(2);
}
if (r == 3) {
shot3p.gotoAndStop(2);
}
if (psx[r] < (px - 280)) {
pst[r] = 0;
psx[r] = -200;
}
}
}
if (pst[r] == 2) {
if (psd[r] == 0) {
psx[r] = psx[r] + 35;
if (r == 1) {
shot1p.gotoAndStop(3);
}
if (r == 2) {
shot2p.gotoAndStop(3);
}
if (r == 3) {
shot3p.gotoAndStop(3);
}
if (psx[r] > (px + 280)) {
pst[r] = 0;
psx[r] = -200;
}
}
if (psd[r] == 1) {
psx[r] = psx[r] - 35;
if (r == 1) {
shot1p.gotoAndStop(4);
}
if (r == 2) {
shot2p.gotoAndStop(4);
}
if (r == 3) {
shot3p.gotoAndStop(4);
}
if (psx[r] < (px - 280)) {
pst[r] = 0;
psx[r] = -200;
}
}
}
if (pst[r] == 3) {
if (psd[r] == 0) {
psx[r] = psx[r] + 40;
if (r == 1) {
shot1p.gotoAndStop(5);
}
if (r == 2) {
shot2p.gotoAndStop(5);
}
if (r == 3) {
shot3p.gotoAndStop(5);
}
if (psx[r] > (px + 280)) {
pst[r] = 0;
psx[r] = -200;
}
}
if (psd[r] == 1) {
psx[r] = psx[r] - 40;
if (r == 1) {
shot1p.gotoAndStop(6);
}
if (r == 2) {
shot2p.gotoAndStop(6);
}
if (r == 3) {
shot3p.gotoAndStop(6);
}
if (psx[r] < (px - 280)) {
pst[r] = 0;
psx[r] = -200;
}
}
}
if (pst[r] == 4) {
if (r == 1) {
shot1p.gotoAndStop(10 - psd[r]);
}
if (r == 2) {
shot2p.gotoAndStop(10 - psd[r]);
}
if (r == 3) {
shot3p.gotoAndStop(10 - psd[r]);
}
psd[r] = psd[r] - 1;
if (psd[r] < 0) {
pst[r] = 0;
psx[r] = -200;
}
}
if (pst[r] == 5) {
if (r == 1) {
shot1p.gotoAndStop(14 - psd[r]);
}
if (r == 2) {
shot2p.gotoAndStop(14 - psd[r]);
}
if (r == 3) {
shot3p.gotoAndStop(14 - psd[r]);
}
psd[r] = psd[r] - 1;
if (psd[r] < 0) {
pst[r] = 0;
psx[r] = -200;
}
}
r++;
}
while (c <= 8) {
r = 1;
while (r <= 3) {
if ((pst[r] > 0) and (pst[r] < 4)) {
if (((((bgt[c] == 1) and ((bgx[c] - 35) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 35) > (psx[r] - ((pst[r] * 20) - 20)))) and ((bgy[c] - 5) < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 50) > (psy[r] - ((pst[r] * 20) - 20)))) {
if ((bgd[c] == 0) or (bgd[c] == 2)) {
deflect.start();
pst[r] = 5;
psd[r] = 2;
}
if ((bgd[c] == 1) or (bgd[c] == 3)) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd2.start();
bgd[c] = 4;
bgs[c] = 4;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
if (((((bgt[c] == 2) and ((bgx[c] - 35) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 35) > (psx[r] - ((pst[r] * 20) - 20)))) and (bgy[c] < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 50) > (psy[r] - ((pst[r] * 20) - 20)))) {
if ((((bgd[c] == 0) or (bgd[c] == 3)) or (bgd[c] == 1)) or (bgd[c] == 4)) {
deflect.start();
pst[r] = 5;
psd[r] = 2;
}
if ((bgd[c] == 2) or (bgd[c] == 5)) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd2.start();
bgd[c] = 6;
bgs[c] = 6;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
if (((((bgt[c] == 3) and ((bgx[c] - 35) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 35) > (psx[r] - ((pst[r] * 20) - 20)))) and ((bgy[c] - 20) < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 40) > (psy[r] - ((pst[r] * 20) - 20)))) {
if (bgd[c] == 0) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd2.start();
bgd[c] = 1;
bgs[c] = 4;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
if (((((bgt[c] == 4) and ((bgx[c] - 40) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 40) > (psx[r] - ((pst[r] * 20) - 20)))) and ((bgy[c] - 20) < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 50) > (psy[r] - ((pst[r] * 20) - 20)))) {
if ((bgd[c] == 0) or (bgd[c] == 2)) {
deflect.start();
pst[r] = 5;
psd[r] = 2;
}
if ((bgd[c] == 1) or (bgd[c] == 3)) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd1.start();
bgd[c] = 4;
bgs[c] = 4;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
if (((((bgt[c] == 5) and ((bgx[c] - 40) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 40) > (psx[r] - ((pst[r] * 20) - 20)))) and ((bgy[c] - 20) < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 50) > (psy[r] - ((pst[r] * 20) - 20)))) {
if ((((bgd[c] == 0) or (bgd[c] == 1)) or (bgd[c] == 2)) or (bgd[c] == 3)) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd1.start();
bgd[c] = 4;
bgs[c] = 5;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
if (((((bgt[c] == 6) and ((bgx[c] - 35) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 35) > (psx[r] - ((pst[r] * 20) - 20)))) and ((bgy[c] - 50) < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 20) > (psy[r] - ((pst[r] * 20) - 20)))) {
if ((bgd[c] == 0) or (bgd[c] == 1)) {
deflect.start();
pst[r] = 5;
psd[r] = 2;
}
if (bgd[c] == 2) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd2.start();
bgd[c] = 3;
bgs[c] = 4;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
if (((((bgt[c] == 7) and ((bgx[c] - 35) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 35) > (psx[r] - ((pst[r] * 20) - 20)))) and ((bgy[c] - 50) < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 20) > (psy[r] - ((pst[r] * 20) - 20)))) {
if (bgd[c] == 0) {
deflect.start();
pst[r] = 5;
psd[r] = 2;
}
if ((bgd[c] == 2) or (bgd[c] == 1)) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd2.start();
bgd[c] = 3;
bgs[c] = 3;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
if (((((bgt[c] == 8) and ((bgx[c] - 35) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 35) > (psx[r] - ((pst[r] * 20) - 20)))) and ((bgy[c] - 50) < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 20) > (psy[r] - ((pst[r] * 20) - 20)))) {
if ((bgd[c] == 0) or (bgd[c] == 1)) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd1.start();
bgd[c] = 2;
bgs[c] = 5;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
if (((((bgt[c] == 9) and ((bgx[c] - 40) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 40) > (psx[r] - ((pst[r] * 20) - 20)))) and ((bgy[c] - 20) < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 50) > (psy[r] - ((pst[r] * 20) - 20)))) {
if ((bgd[c] == 0) and (px > bgx[c])) {
deflect.start();
pst[r] = 5;
psd[r] = 2;
}
if ((bgd[c] == 1) and (px < bgx[c])) {
deflect.start();
pst[r] = 5;
psd[r] = 2;
}
if ((bgd[c] == 0) and (px < bgx[c])) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd1.start();
bgd[c] = 4;
bgs[c] = 4;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
if ((bgd[c] == 1) and (px > bgx[c])) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd1.start();
bgd[c] = 2;
bgs[c] = 4;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
if (((((bgt[c] == 10) and ((bgx[c] - 20) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 20) > (psx[r] - ((pst[r] * 20) - 20)))) and ((bgy[c] - 50) < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 20) > (psy[r] - ((pst[r] * 20) - 20)))) {
if ((bgd[c] == 0) or (bgd[c] == 1)) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd2.start();
bgd[c] = 2;
bgs[c] = 3;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
if (((((bgt[c] == 11) and ((bgx[c] - 25) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 25) > (psx[r] - ((pst[r] * 20) - 20)))) and (bgy[c] < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 50) > (psy[r] - ((pst[r] * 20) - 20)))) {
if ((((((bgd[c] == 0) or (bgd[c] == 1)) or (bgd[c] == 2)) or (bgd[c] == 3)) or (bgd[c] == 4)) or (bgd[c] == 5)) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd2.start();
bgd[c] = 6;
bgs[c] = 3;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
if (((((bgt[c] == 12) and ((bgx[c] - 25) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 25) > (psx[r] - ((pst[r] * 20) - 20)))) and (bgy[c] < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 50) > (psy[r] - ((pst[r] * 20) - 20)))) {
if ((bgd[c] == 0) or (bgd[c] == 1)) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd2.start();
bgd[c] = 2;
bgs[c] = 3;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
if (((((bgt[c] == 13) and ((bgx[c] - 35) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 35) > (psx[r] - ((pst[r] * 20) - 20)))) and (bgy[c] < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 60) > (psy[r] - ((pst[r] * 20) - 20)))) {
if ((((((bgd[c] == 0) or (bgd[c] == 1)) or (bgd[c] == 2)) or (bgd[c] == 3)) or (bgd[c] == 4)) or (bgd[c] == 5)) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd1.start();
bgd[c] = 6;
bgs[c] = 4;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
if (((((bgt[c] == 14) and ((bgx[c] - 20) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 20) > (psx[r] - ((pst[r] * 20) - 20)))) and ((bgy[c] - 20) < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 20) > (psy[r] - ((pst[r] * 20) - 20)))) {
if ((((bgd[c] == 0) or (bgd[c] == 1)) or (bgd[c] == 3)) or (bgd[c] == 4)) {
deflect.start();
pst[r] = 5;
psd[r] = 2;
}
if ((bgd[c] == 2) or (bgd[c] == 5)) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd2.start();
bgd[c] = 6;
bgs[c] = 3;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
}
r++;
}
c++;
}
r = 1;
while (r <= 8) {
if (((((bgt[r] > 0) and ((bgx[r] - 340) < px)) and ((bgx[r] + 340) > px)) and ((bgy[r] - 180) < py)) and ((bgy[r] + 350) > py)) {
c = 0;
e = 1;
while (e <= 22) {
if (((((bx[e] - 150) < bgx[r]) and ((bx[e] + 150) > bgx[r])) and ((by[e] - 150) < bgy[r])) and ((by[e] + 150) > bgy[r])) {
if (((((bgx[r] + 20) >= (bx[e] - 50)) and ((bgx[r] - 20) <= (bx[e] + 50))) and ((bgy[r] + 45) > (by[e] - 60))) and ((bgy[r] - 10) < (by[e] - 40))) {
c = 1;
}
if (((((bgx[r] + 20) > (bx[e] - 50)) and ((bgx[r] + 20) < bx[e])) and (bgy[r] < (by[e] + 50))) and ((bgy[r] + 20) > (by[e] - 50))) {
bgx[r] = bx[e] - 70;
}
if (((((bgx[r] - 20) < (bx[e] + 50)) and ((bgx[r] + 20) > bx[e])) and (bgy[r] < (by[e] + 50))) and ((bgy[r] + 20) > (by[e] - 50))) {
bgx[r] = bx[e] + 70;
}
if (((((bgx[r] - 5) < (bx[e] + 50)) and ((bgx[r] + 5) > (bx[e] - 50))) and ((bgy[r] - 30) < (by[e] + 50))) and (bgy[r] > (by[e] + 50))) {
bgy[r] = by[e] + 70;
}
if (((((bgx[r] - 2) < (bx[e] + 50)) and ((bgx[r] + 2) > (bx[e] - 50))) and ((bgy[r] + 20) < (by[e] - 50))) and ((bgy[r] + 60) > (by[e] - 50))) {
c = 1;
bgy[r] = by[e] - 105;
}
}
e++;
}
if (c == 0) {
bgy[r] = bgy[r] + 10;
}
if (bgt[r] == 1) {
if (((((((bgx[r] - 10) < (px + 10)) and ((bgx[r] + 10) > (px - 10))) and ((bgy[r] + 80) > (py + 10))) and ((bgy[r] + 50) < (py + 50))) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 4;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 4;
}
megah.start();
i = 10;
}
if (bgd[r] == 0) {
f[r] = 1;
if (px < bgx[r]) {
bgd[r] = 2;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
joes.start();
bgd[r] = 1;
bgs[r] = 7;
bgst[bsn] = 1;
bgsx[bsn] = bgx[r] - 10;
bgsy[bsn] = bgy[r] + 30;
bgsd[bsn] = 0;
bsn = bsn + 1;
if (bsn > 5) {
bsn = 1;
}
}
}
if (bgd[r] == 2) {
f[r] = 3;
if (px > bgx[r]) {
bgd[r] = 0;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
joes.start();
bgd[r] = 3;
bgs[r] = 7;
bgst[bsn] = 1;
bgsx[bsn] = bgx[r] + 10;
bgsy[bsn] = bgy[r] + 30;
bgsd[bsn] = 1;
bsn = bsn + 1;
if (bsn > 5) {
bsn = 1;
}
}
}
if (bgd[r] == 1) {
f[r] = 2;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 0;
bgs[r] = 20;
}
}
if (bgd[r] == 3) {
f[r] = 4;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 2;
bgs[r] = 20;
}
}
if (bgd[r] == 4) {
if (bgs[r] == 4) {
f[r] = 5;
}
if (bgs[r] == 3) {
f[r] = 6;
}
if (bgs[r] == 2) {
f[r] = 7;
}
if (bgs[r] == 1) {
f[r] = 8;
}
bgy[r] = bgy[r] - 10;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
f[r] = 9;
bgt[r] = 0;
bgx[r] = -500;
bgs[r] = 0;
}
}
}
if (bgt[r] == 2) {
if (((((((bgx[r] - 15) < (px + 10)) and ((bgx[r] + 15) > (px - 10))) and ((bgy[r] + 80) > (py - 10))) and ((bgy[r] + 50) < (py + 50))) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 3;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 3;
}
megah.start();
i = 10;
}
if (bgd[r] == 0) {
f[r] = 1;
if (px < bgx[r]) {
bgd[r] = 3;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 1;
bgs[r] = 10;
}
}
if (bgd[r] == 3) {
f[r] = 5;
if (px > bgx[r]) {
bgd[r] = 0;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 4;
bgs[r] = 10;
}
}
if (bgd[r] == 1) {
f[r] = 2;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 2;
bgs[r] = 12;
}
}
if (bgd[r] == 2) {
if (((bgs[r] == 12) or (bgs[r] == 11)) or (bgs[r] == 10)) {
f[r] = 3;
}
if (((bgs[r] == 9) or (bgs[r] == 8)) or (bgs[r] == 7)) {
f[r] = 4;
}
if (((bgs[r] == 6) or (bgs[r] == 5)) or (bgs[r] == 4)) {
f[r] = 3;
}
if (((bgs[r] == 3) or (bgs[r] == 2)) or (bgs[r] == 1)) {
f[r] = 4;
}
bgx[r] = bgx[r] + 8;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 0;
bgs[r] = 10 + random(20);
}
}
if (bgd[r] == 4) {
f[r] = 6;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 5;
bgs[r] = 12;
}
}
if (bgd[r] == 5) {
if (((bgs[r] == 12) or (bgs[r] == 11)) or (bgs[r] == 10)) {
f[r] = 7;
}
if (((bgs[r] == 9) or (bgs[r] == 8)) or (bgs[r] == 7)) {
f[r] = 8;
}
if (((bgs[r] == 6) or (bgs[r] == 5)) or (bgs[r] == 4)) {
f[r] = 7;
}
if (((bgs[r] == 3) or (bgs[r] == 2)) or (bgs[r] == 1)) {
f[r] = 8;
}
bgx[r] = bgx[r] - 8;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 3;
bgs[r] = 10 + random(20);
}
}
if (bgd[r] == 6) {
if (bgs[r] == 6) {
f[r] = 9;
}
if (bgs[r] == 5) {
f[r] = 10;
}
if (bgs[r] == 4) {
f[r] = 11;
}
if (bgs[r] == 3) {
f[r] = 12;
}
if (bgs[r] == 2) {
f[r] = 13;
}
if (bgs[r] == 1) {
f[r] = 14;
}
bgs[r] = bgs[r] - 1;
bgy[r] = bgy[r] - 10;
if (bgs[r] <= 0) {
f[r] = 15;
bgt[r] = 0;
bgx[r] = -500;
bgs[r] = 0;
}
}
}
if (bgt[r] == 3) {
if ((((((((bgx[r] - 20) < (px + 10)) and ((bgx[r] + 20) > (px - 10))) and ((bgy[r] + 60) > (py + 5))) and ((bgy[r] + 40) < (py + 45))) and (pcd < 18)) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 4;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 4;
}
megah.start();
i = 10;
}
if (bgd[r] == 0) {
if ((bgs[r] == 0) or (bgs[r] == 1)) {
f[r] = 1;
}
if ((bgs[r] == 2) or (bgs[r] == 3)) {
f[r] = 2;
}
if ((bgs[r] == 4) or (bgs[r] == 5)) {
f[r] = 3;
}
if ((bgs[r] == 6) or (bgs[r] == 7)) {
f[r] = 4;
}
if ((bgs[r] == 8) or (bgs[r] == 9)) {
f[r] = 5;
}
if ((bgs[r] == 10) or (bgs[r] == 11)) {
f[r] = 6;
}
if (px < bgx[r]) {
bgx[r] = bgx[r] - 5;
}
if (px > bgx[r]) {
bgx[r] = bgx[r] + 5;
}
if ((py - 20) > bgy[r]) {
bgy[r] = bgy[r] - 5;
}
if ((py - 20) < bgy[r]) {
bgy[r] = bgy[r] - 15;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgs[r] = 11;
}
}
if (bgd[r] == 1) {
if (bgs[r] == 4) {
f[r] = 7;
}
if (bgs[r] == 3) {
f[r] = 8;
}
if (bgs[r] == 2) {
f[r] = 9;
}
if (bgs[r] == 1) {
f[r] = 10;
}
bgs[r] = bgs[r] - 1;
bgy[r] = bgy[r] - 10;
if (bgs[r] <= 0) {
bgx[r] = -500;
f[r] = 11;
bgt[r] = 0;
bgs[r] = 0;
}
}
}
if (bgt[r] == 4) {
if (((((((bgx[r] - 20) < (px + 10)) and ((bgx[r] + 20) > (px - 10))) and ((bgy[r] + 80) > (py + 10))) and ((bgy[r] + 30) < (py + 50))) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 4;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 4;
}
megah.start();
i = 10;
}
if (bgd[r] == 0) {
f[r] = 1;
if ((px - 180) < bgx[r]) {
bgd[r] = 1;
bgs[r] = 4;
}
if (px < bgx[r]) {
bgd[r] = 2;
}
}
if (bgd[r] == 2) {
f[r] = 4;
if ((px + 180) > bgx[r]) {
bgd[r] = 3;
bgs[r] = 4;
}
if (px > bgx[r]) {
bgd[r] = 0;
}
}
if (bgd[r] == 1) {
if ((bgs[r] == 1) or (bgs[r] == 2)) {
f[r] = 2;
}
if ((bgs[r] == 3) or (bgs[r] == 4)) {
f[r] = 3;
}
bgx[r] = bgx[r] + 12;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgs[r] = 4;
}
}
if (bgd[r] == 3) {
if ((bgs[r] == 1) or (bgs[r] == 2)) {
f[r] = 5;
}
if ((bgs[r] == 3) or (bgs[r] == 4)) {
f[r] = 6;
}
bgx[r] = bgx[r] - 12;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgs[r] = 4;
}
}
if (bgd[r] == 4) {
if (bgs[r] == 4) {
f[r] = 7;
}
if (bgs[r] == 3) {
f[r] = 8;
}
if (bgs[r] == 2) {
f[r] = 9;
}
if (bgs[r] == 1) {
f[r] = 10;
}
bgs[r] = bgs[r] - 1;
bgy[r] = bgy[r] - 10;
if (bgs[r] <= 0) {
bgx[r] = -500;
f[r] = 11;
bgt[r] = 0;
bgs[r] = 0;
}
}
}
if (bgt[r] == 5) {
if (((((((bgx[r] - 20) < (px + 10)) and ((bgx[r] + 20) > (px - 10))) and ((bgy[r] + 80) > (py + 10))) and ((bgy[r] + 30) < (py + 50))) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 3;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 3;
}
megah.start();
i = 10;
}
if (bgd[r] == 0) {
f[r] = 1;
if (px < bgx[r]) {
bgd[r] = 2;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
cannons.start();
bgd[r] = 1;
bgs[r] = 8;
bgst[bsn] = 2;
bgsx[bsn] = bgx[r] - 20;
bgsy[bsn] = bgy[r] + 20;
bgsd[bsn] = 0;
bsn = bsn + 1;
if (bsn > 5) {
bsn = 1;
}
}
}
if (bgd[r] == 2) {
f[r] = 3;
if (px > bgx[r]) {
bgd[r] = 0;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
cannons.start();
bgd[r] = 3;
bgs[r] = 7;
bgst[bsn] = 2;
bgsx[bsn] = bgx[r] + 20;
bgsy[bsn] = bgy[r] + 20;
bgsd[bsn] = 1;
bsn = bsn + 1;
if (bsn > 5) {
bsn = 1;
}
}
}
if (bgd[r] == 1) {
f[r] = 2;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 0;
bgs[r] = 10 + random(15);
}
}
if (bgd[r] == 3) {
f[r] = 4;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 2;
bgs[r] = 10 + random(15);
}
}
if (bgd[r] == 4) {
if (bgs[r] == 5) {
f[r] = 5;
}
if (bgs[r] == 4) {
f[r] = 6;
}
if (bgs[r] == 3) {
f[r] = 7;
}
if (bgs[r] == 2) {
f[r] = 8;
}
if (bgs[r] == 1) {
f[r] = 9;
}
bgs[r] = bgs[r] - 1;
bgy[r] = bgy[r] - 10;
if (bgs[r] <= 0) {
f[r] = 10;
bgt[r] = 0;
bgx[r] = -500;
bgs[r] = 0;
}
}
}
if (bgt[r] == 6) {
if (((((((bgx[r] - 10) < (px + 10)) and ((bgx[r] + 10) > (px - 10))) and ((bgy[r] + 50) > (py + 10))) and ((bgy[r] + 10) < (py + 50))) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 4;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 4;
}
megah.start();
i = 10;
}
if (bgd[r] == 0) {
f[r] = 1;
bgy[r] = bgy[r] - 10;
if (((((px - 120) < bgx[r]) and ((px + 120) > bgx[r])) and ((bgy[r] - 80) < py)) and ((bgy[r] + 150) > py)) {
bgd[r] = 1;
bgs[r] = 6;
}
}
if (bgd[r] == 1) {
bgy[r] = bgy[r] - 10;
if (((bgs[r] == 6) or (bgs[r] == 5)) or (bgs[r] == 4)) {
f[r] = 2;
}
if (((bgs[r] == 3) or (bgs[r] == 2)) or (bgs[r] == 1)) {
f[r] = 3;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgs[r] = 4;
bgd[r] = 2;
}
}
if (bgd[r] == 2) {
if ((bgs[r] == 4) or (bgs[r] == 3)) {
f[r] = 4;
}
if ((bgs[r] == 2) or (bgs[r] == 1)) {
f[r] = 5;
}
if (px < bgx[r]) {
bgx[r] = (bgx[r] - 1) - random(10);
}
if (px > bgx[r]) {
bgx[r] = (bgx[r] + 1) + random(10);
}
if (py > bgy[r]) {
bgy[r] = bgy[r] + random(8);
}
if (py < bgy[r]) {
bgy[r] = (bgy[r] - 10) - random(10);
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgs[r] = 4;
}
}
if (bgd[r] == 3) {
if (bgs[r] == 4) {
f[r] = 6;
}
if (bgs[r] == 3) {
f[r] = 7;
}
if (bgs[r] == 2) {
f[r] = 8;
}
if (bgs[r] == 1) {
f[r] = 9;
}
bgs[r] = bgs[r] - 1;
bgy[r] = bgy[r] - 10;
if (bgs[r] <= 0) {
f[r] = 10;
bgt[r] = 0;
bgx[r] = -500;
bgs[r] = 0;
}
}
}
if (bgt[r] == 7) {
if (((((((bgx[r] - 20) < (px + 10)) and ((bgx[r] + 20) > (px - 10))) and ((bgy[r] + 20) > (py + 10))) and ((bgy[r] + 20) < (py + 50))) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 3;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 3;
}
megah.start();
i = 10;
}
if (bgd[r] == 0) {
f[r] = 1;
bgy[r] = bgy[r] - 10;
if ((px + 80) < bgx[r]) {
bgx[r] = bgx[r] - 5;
}
if ((px - 80) > bgx[r]) {
bgx[r] = bgx[r] + 5;
}
if ((py - 70) < bgy[r]) {
bgy[r] = bgy[r] - 5;
}
if ((py - 70) > bgy[r]) {
bgy[r] = bgy[r] + 5;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
joes.start();
if (px > bgx[r]) {
bgd[r] = 1;
}
if (px < bgx[r]) {
bgd[r] = 2;
}
if (px < bgx[r]) {
bgsd[bsn] = 3;
if ((py - 50) < bgy[r]) {
bgsd[bsn] = 1;
}
}
if (px > bgx[r]) {
bgsd[bsn] = 2;
if ((py - 50) < bgy[r]) {
bgsd[bsn] = 0;
}
}
bgs[r] = 12;
bgst[bsn] = 1;
bgsx[bsn] = bgx[r];
bgsy[bsn] = bgy[r];
bsn = bsn + 1;
if (bsn > 5) {
bsn = 1;
}
}
}
if (bgd[r] == 1) {
f[r] = 2;
bgy[r] = bgy[r] - 10;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 0;
bgs[r] = 10 + random(25);
}
}
if (bgd[r] == 2) {
f[r] = 3;
bgy[r] = bgy[r] - 10;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 0;
bgs[r] = 10 + random(25);
}
}
if (bgd[r] == 3) {
if (bgs[r] == 3) {
f[r] = 4;
}
if (bgs[r] == 2) {
f[r] = 5;
}
if (bgs[r] == 1) {
f[r] = 6;
}
bgs[r] = bgs[r] - 1;
bgy[r] = bgy[r] - 10;
if (bgs[r] <= 0) {
f[r] = 7;
bgt[r] = 0;
bgx[r] = -500;
bgs[r] = 0;
}
}
}
if (bgt[r] == 8) {
if (((((((bgx[r] - 20) < (px + 10)) and ((bgx[r] + 20) > (px - 10))) and ((bgy[r] + 35) > (py + 10))) and ((bgy[r] + 20) < (py + 50))) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 8;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 8;
}
bgd[r] = 2;
bgs[r] = 10;
baddyd1.start();
i = 10;
}
if (bgd[r] == 0) {
f[r] = 1;
bgx[r] = bgx[r] + 20;
if ((py + 30) > bgy[r]) {
bgy[r] = bgy[r] - 8;
}
if ((py + 30) < bgy[r]) {
bgy[r] = bgy[r] - 12;
}
if ((px + 100) < bgx[r]) {
bgd[r] = 1;
}
}
if (bgd[r] == 1) {
f[r] = 2;
bgx[r] = bgx[r] - 20;
if ((py + 30) > bgy[r]) {
bgy[r] = bgy[r] - 8;
}
if ((py + 30) < bgy[r]) {
bgy[r] = bgy[r] - 12;
}
if ((px - 100) > bgx[r]) {
bgd[r] = 0;
}
}
if (bgd[r] == 2) {
if (bgs[r] == 5) {
f[r] = 3;
}
if (bgs[r] == 4) {
f[r] = 4;
}
if (bgs[r] == 3) {
f[r] = 5;
}
if (bgs[r] == 2) {
f[r] = 6;
}
if (bgs[r] == 1) {
f[r] = 7;
}
bgs[r] = bgs[r] - 1;
bgy[r] = bgy[r] - 10;
if (bgs[r] <= 0) {
bgx[r] = -500;
f[r] = 8;
bgt[r] = 0;
bgs[r] = 0;
}
}
}
if (bgt[r] == 9) {
if (((((((bgx[r] - 30) < (px + 10)) and ((bgx[r] + 30) > (px - 10))) and ((bgy[r] + 55) > (py + 10))) and ((bgy[r] + 20) < (py + 50))) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 5;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 5;
}
megah.start();
i = 10;
}
if (bgd[r] == 0) {
if ((bgs[r] == 1) or (bgs[r] == 2)) {
f[r] = 1;
}
if ((bgs[r] == 3) or (bgs[r] == 4)) {
f[r] = 2;
}
bgx[r] = bgx[r] + 8;
if ((px + 80) < bgx[r]) {
bgd[r] = 1;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgs[r] = 4;
}
}
if (bgd[r] == 1) {
if ((bgs[r] == 1) or (bgs[r] == 2)) {
f[r] = 3;
}
if ((bgs[r] == 3) or (bgs[r] == 4)) {
f[r] = 4;
}
bgx[r] = bgx[r] - 8;
if ((px - 80) > bgx[r]) {
bgd[r] = 0;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgs[r] = 4;
}
}
if (bgd[r] == 2) {
if (bgs[r] == 4) {
f[r] = 5;
}
if (bgs[r] == 3) {
f[r] = 6;
}
if (bgs[r] == 2) {
f[r] = 7;
}
if (bgs[r] == 1) {
f[r] = 8;
}
bgs[r] = bgs[r] - 1;
bgy[r] = bgy[r] - 10;
if (bgs[r] <= 0) {
bgx[r] = -500;
f[r] = 9;
bgt[r] = 0;
bgs[r] = 0;
}
}
}
if (bgt[r] == 10) {
if (((((((bgx[r] - 20) < (px + 10)) and ((bgx[r] + 20) > (px - 10))) and ((bgy[r] + 20) > (py + 10))) and ((bgy[r] + 20) < (py + 50))) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 2;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 2;
}
megah.start();
i = 10;
}
if (bgd[r] == 0) {
f[r] = 1;
bgy[r] = bgy[r] - 10;
if (px < bgx[r]) {
bgx[r] = bgx[r] - 7;
}
if (px > bgx[r]) {
bgx[r] = bgx[r] + 7;
}
if ((py - 80) < bgy[r]) {
bgy[r] = bgy[r] - 8;
}
if ((py - 80) > bgy[r]) {
bgy[r] = bgy[r] + 8;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
joes.start();
bgd[r] = 1;
bgsd[bsn] = 4;
bgs[r] = 5;
bgst[bsn] = 1;
bgsx[bsn] = bgx[r];
bgsy[bsn] = bgy[r];
bsn = bsn + 1;
if (bsn > 5) {
bsn = 1;
}
}
}
if (bgd[r] == 1) {
f[r] = 2;
bgy[r] = bgy[r] - 10;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 0;
bgs[r] = 6 + random(16);
}
}
if (bgd[r] == 2) {
if (bgs[r] == 3) {
f[r] = 3;
}
if (bgs[r] == 2) {
f[r] = 4;
}
if (bgs[r] == 1) {
f[r] = 5;
}
bgs[r] = bgs[r] - 1;
bgy[r] = bgy[r] - 10;
if (bgs[r] <= 0) {
f[r] = 7;
bgt[r] = 0;
bgx[r] = -500;
bgs[r] = 0;
}
}
}
if (bgt[r] == 11) {
if (((((((bgx[r] - 20) < (px + 10)) and ((bgx[r] + 20) > (px - 10))) and ((bgy[r] + 50) > (py - 10))) and (bgy[r] < (py + 50))) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 3;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 3;
}
megah.start();
i = 10;
}
if (bgd[r] == 0) {
if (((bgs[r] == 12) or (bgs[r] == 11)) or (bgs[r] == 10)) {
f[r] = 1;
}
if (((bgs[r] == 9) or (bgs[r] == 8)) or (bgs[r] == 7)) {
f[r] = 2;
}
if (((bgs[r] == 6) or (bgs[r] == 5)) or (bgs[r] == 4)) {
f[r] = 1;
}
if (((bgs[r] == 3) or (bgs[r] == 2)) or (bgs[r] == 1)) {
f[r] = 2;
}
if (bgx[r] > px) {
bgd[r] = 3;
bgs[r] = 12;
}
bgx[r] = bgx[r] + 6;
if (((bgx[r] + 150) > (px - 20)) and (bgx[r] < px)) {
bgd[r] = 1;
bgs[r] = 9;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgs[r] = 12;
}
}
if (bgd[r] == 1) {
f[r] = 3;
bgx[r] = bgx[r] + 12;
bgy[r] = bgy[r] - 20;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 2;
bgs[r] = 10;
}
}
if (bgd[r] == 2) {
f[r] = 3;
bgx[r] = bgx[r] + 12;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 0;
bgs[r] = 12;
}
}
if (bgd[r] == 3) {
if (((bgs[r] == 12) or (bgs[r] == 11)) or (bgs[r] == 10)) {
f[r] = 4;
}
if (((bgs[r] == 9) or (bgs[r] == 8)) or (bgs[r] == 7)) {
f[r] = 5;
}
if (((bgs[r] == 6) or (bgs[r] == 5)) or (bgs[r] == 4)) {
f[r] = 4;
}
if (((bgs[r] == 3) or (bgs[r] == 2)) or (bgs[r] == 1)) {
f[r] = 5;
}
if (bgx[r] < px) {
bgd[r] = 0;
bgs[r] = 12;
}
bgx[r] = bgx[r] - 6;
if (((bgx[r] - 150) < (px - 20)) and (bgx[r] > px)) {
bgd[r] = 4;
bgs[r] = 9;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgs[r] = 12;
}
}
if (bgd[r] == 4) {
f[r] = 6;
bgx[r] = bgx[r] - 12;
bgy[r] = bgy[r] - 20;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 5;
bgs[r] = 10;
}
}
if (bgd[r] == 5) {
f[r] = 6;
bgx[r] = bgx[r] - 12;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 3;
bgs[r] = 12;
}
}
if (bgd[r] == 6) {
if (bgs[r] == 3) {
f[r] = 7;
}
if (bgs[r] == 2) {
f[r] = 8;
}
if (bgs[r] == 1) {
f[r] = 9;
}
bgs[r] = bgs[r] - 1;
bgy[r] = bgy[r] - 10;
if (bgs[r] <= 0) {
f[r] = 15;
bgt[r] = 0;
bgx[r] = -500;
bgs[r] = 0;
}
}
}
if (bgt[r] == 12) {
if (((((((bgx[r] - 20) < (px + 10)) and ((bgx[r] + 20) > (px - 10))) and ((bgy[r] + 40) > py)) and ((bgy[r] - 20) < (py + 50))) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 3;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 3;
}
megah.start();
i = 10;
}
if (bgd[r] == 0) {
if (bgs[r] == 1) {
f[r] = 1;
}
if (bgs[r] == 2) {
f[r] = 2;
}
bgy[r] = bgy[r] - 10;
bgx[r] = bgx[r] + 7;
if ((py - 60) < bgy[r]) {
bgy[r] = bgy[r] - 5;
}
if ((((px - 70) < bgx[r]) and ((px + 70) > bgx[r])) and (py > bgy[r])) {
bgy[r] = bgy[r] + 12;
}
if ((px + 100) < bgx[r]) {
bgd[r] = 1;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgs[r] = 2;
}
}
if (bgd[r] == 1) {
if (bgs[r] == 1) {
f[r] = 3;
}
if (bgs[r] == 2) {
f[r] = 4;
}
bgy[r] = bgy[r] - 10;
bgx[r] = bgx[r] - 7;
if ((py - 60) < bgy[r]) {
bgy[r] = bgy[r] - 5;
}
if ((((px - 70) < bgx[r]) and ((px + 70) > bgx[r])) and (py > bgy[r])) {
bgy[r] = bgy[r] + 12;
}
if ((px - 100) > bgx[r]) {
bgd[r] = 0;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgs[r] = 2;
}
}
if (bgd[r] == 2) {
if (bgs[r] == 4) {
f[r] = 5;
}
if (bgs[r] == 3) {
f[r] = 6;
}
if (bgs[r] == 2) {
f[r] = 7;
}
if (bgs[r] == 1) {
f[r] = 8;
}
bgs[r] = bgs[r] - 1;
bgy[r] = bgy[r] - 10;
if (bgs[r] <= 0) {
bgx[r] = -500;
f[r] = 9;
bgt[r] = 0;
bgs[r] = 0;
}
}
}
if (bgt[r] == 13) {
if (((((((bgx[r] - 50) < (px + 10)) and ((bgx[r] + 50) > (px - 10))) and ((bgy[r] + 70) > (py + 10))) and (bgy[r] < (py + 50))) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 4;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 4;
}
megah.start();
i = 10;
}
if (bgd[r] == 0) {
f[r] = 1;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
if ((px - 170) < bgx[r]) {
bgd[r] = 1;
bgs[r] = 7;
}
}
if (px < bgx[r]) {
bgd[r] = 3;
}
}
if (bgd[r] == 1) {
f[r] = 2;
bgx[r] = bgx[r] + 30;
bgy[r] = bgy[r] - 20;
if (bgy[r] < py) {
bgy[r] = bgy[r] + 10;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 2;
bgs[r] = 12;
}
}
if (bgd[r] == 2) {
f[r] = 3;
bgx[r] = bgx[r] + 5;
bgy[r] = bgy[r] + 2;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 0;
bgs[r] = random(12);
}
}
if (bgd[r] == 3) {
f[r] = 4;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
if ((px + 170) > bgx[r]) {
bgd[r] = 4;
bgs[r] = 7;
}
}
if (px > bgx[r]) {
bgd[r] = 0;
}
}
if (bgd[r] == 4) {
f[r] = 5;
bgx[r] = bgx[r] - 30;
bgy[r] = bgy[r] - 20;
bgs[r] = bgs[r] - 1;
if (bgy[r] < py) {
bgy[r] = bgy[r] + 10;
}
if (bgs[r] <= 0) {
bgd[r] = 5;
bgs[r] = 12;
}
}
if (bgd[r] == 5) {
f[r] = 6;
bgx[r] = bgx[r] - 5;
bgy[r] = bgy[r] + 2;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 3;
bgs[r] = random(12);
}
}
if (bgd[r] == 6) {
if (bgs[r] == 4) {
f[r] = 7;
}
if (bgs[r] == 3) {
f[r] = 8;
}
if (bgs[r] == 2) {
f[r] = 9;
}
if (bgs[r] == 1) {
f[r] = 10;
}
bgs[r] = bgs[r] - 1;
bgy[r] = bgy[r] - 10;
if (bgs[r] <= 0) {
bgx[r] = -500;
f[r] = 11;
bgt[r] = 0;
bgs[r] = 0;
}
}
}
if (bgt[r] == 14) {
if (((((((bgx[r] - 20) < (px + 10)) and ((bgx[r] + 20) > (px - 10))) and ((bgy[r] + 50) > (py + 10))) and ((bgy[r] + 20) < (py + 50))) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 2;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 2;
}
megah.start();
i = 10;
}
if (bgt[r] > 0) {
bgy[r] = bgy[r] - 10;
}
if (bgd[r] == 0) {
f[r] = 1;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 1;
bgs[r] = 6;
}
}
if (bgd[r] == 1) {
if (((bgs[r] == 6) or (bgs[r] == 5)) or (bgs[r] == 4)) {
f[r] = 2;
}
if (((bgs[r] == 3) or (bgs[r] == 2)) or (bgs[r] == 1)) {
f[r] = 3;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 2;
bgs[r] = 15;
}
}
if (bgd[r] == 2) {
f[r] = 4;
if (((bgs[r] == 15) or (bgs[r] == 10)) or (bgs[r] == 5)) {
cannons.start();
bgst[bsn] = 2;
bgsx[bsn] = bgx[r] + 20;
bgsy[bsn] = bgy[r];
bgsd[bsn] = 0;
bsn = bsn + 1;
if (bsn > 5) {
bsn = 1;
}
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 0;
bgs[r] = 20;
}
}
if (bgd[r] == 3) {
f[r] = 5;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 4;
bgs[r] = 6;
}
}
if (bgd[r] == 4) {
if (((bgs[r] == 6) or (bgs[r] == 5)) or (bgs[r] == 4)) {
f[r] = 6;
}
if (((bgs[r] == 3) or (bgs[r] == 2)) or (bgs[r] == 1)) {
f[r] = 7;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 5;
bgs[r] = 15;
}
}
if (bgd[r] == 5) {
f[r] = 8;
if (((bgs[r] == 15) or (bgs[r] == 10)) or (bgs[r] == 5)) {
cannons.start();
bgst[bsn] = 2;
bgsx[bsn] = bgx[r] - 20;
bgsy[bsn] = bgy[r];
bgsd[bsn] = 1;
bsn = bsn + 1;
if (bsn > 5) {
bsn = 1;
}
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 3;
bgs[r] = 20;
}
}
if (bgd[r] == 6) {
if (bgs[r] == 2) {
f[r] = 9;
}
if (bgs[r] == 1) {
f[r] = 10;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
f[r] = 11;
bgt[r] = 0;
bgx[r] = -500;
bgs[r] = 0;
}
}
}
}
r++;
}
r = 1;
while (r <= 5) {
if (bgst[r] > 0) {
if (bgst[r] == 1) {
if (r == 1) {
bgs1.gotoAndStop(1);
}
if (r == 2) {
bgs2.gotoAndStop(1);
}
if (r == 3) {
bgs3.gotoAndStop(1);
}
if (r == 4) {
bgs4.gotoAndStop(1);
}
if (r == 5) {
bgs5.gotoAndStop(1);
}
if (bgsd[r] == 0) {
bgsx[r] = bgsx[r] + 20;
if (bgsx[r] > (px + 300)) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgsd[r] == 1) {
bgsx[r] = bgsx[r] - 20;
if (bgsx[r] < (px - 300)) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgsd[r] == 2) {
bgsx[r] = bgsx[r] + 15;
bgsy[r] = bgsy[r] + 15;
if ((bgsx[r] > (px + 300)) or (bgsy[r] > (py + 300))) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgsd[r] == 3) {
bgsx[r] = bgsx[r] - 15;
bgsy[r] = bgsy[r] + 15;
if ((bgsx[r] > (px + 300)) or (bgsy[r] > (py + 300))) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgsd[r] == 4) {
bgsy[r] = bgsy[r] + 20;
if (bgsy[r] > (py + 300)) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (((((((bgsx[r] - 15) < (px + 10)) and ((bgsx[r] + 15) > (px - 10))) and ((bgsy[r] + 15) > (py + 5))) and ((bgsy[r] - 15) < (py + 20))) and (pcd < 18)) and (i < 1)) {
if ((bgsd[r] == 0) or (bgsd[r] == 2)) {
pcd = 19;
}
if ((bgsd[r] == 1) or (bgsd[r] == 3)) {
pcd = 18;
}
pstep = 2;
pl = pl - 3;
megah.start();
i = 10;
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgst[r] == 2) {
if (r == 1) {
bgs1.gotoAndStop(2);
}
if (r == 2) {
bgs2.gotoAndStop(2);
}
if (r == 3) {
bgs3.gotoAndStop(2);
}
if (r == 4) {
bgs4.gotoAndStop(2);
}
if (r == 5) {
bgs5.gotoAndStop(2);
}
if (bgsd[r] == 0) {
bgsx[r] = bgsx[r] + 30;
if (bgsx[r] > (px + 300)) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgsd[r] == 1) {
bgsx[r] = bgsx[r] - 30;
if (bgsx[r] < (px - 300)) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (((((((bgsx[r] - 25) < (px + 10)) and ((bgsx[r] + 25) > (px - 10))) and ((bgsy[r] + 80) > (py + 40))) and ((bgsy[r] + 35) < (py + 60))) and (pcd < 18)) and (i < 1)) {
if (bgsd[r] == 0) {
pcd = 19;
}
if (bgsd[r] == 1) {
pcd = 18;
}
pstep = 2;
pl = pl - 6;
megah.start();
i = 10;
bgst[r] = 0;
bgsx[r] = -200;
}
}
}
r++;
}
bg1.gotoAndStop(f[1]);
bg2.gotoAndStop(f[2]);
bg3.gotoAndStop(f[3]);
bg4.gotoAndStop(f[4]);
bg5.gotoAndStop(f[5]);
bg6.gotoAndStop(f[6]);
bg7.gotoAndStop(f[7]);
bg8.gotoAndStop(f[8]);
bgs1._x = ((bgsx[1] + 275) - px) / 2;
bgs1._y = ((bgsy[1] + 275) - py) / 2;
bgs2._x = ((bgsx[2] + 275) - px) / 2;
bgs2._y = ((bgsy[2] + 275) - py) / 2;
bgs3._x = ((bgsx[3] + 275) - px) / 2;
bgs3._y = ((bgsy[3] + 275) - py) / 2;
bgs4._x = ((bgsx[4] + 275) - px) / 2;
bgs4._y = ((bgsy[4] + 275) - py) / 2;
bgs5._x = ((bgsx[5] + 275) - px) / 2;
bgs5._y = ((bgsy[5] + 275) - py) / 2;
bg1._x = ((bgx[1] + 275) - px) / 2;
bg1._y = ((bgy[1] + 275) - py) / 2;
bg2._x = ((bgx[2] + 275) - px) / 2;
bg2._y = ((bgy[2] + 275) - py) / 2;
bg3._x = ((bgx[3] + 275) - px) / 2;
bg3._y = ((bgy[3] + 275) - py) / 2;
bg4._x = ((bgx[4] + 275) - px) / 2;
bg4._y = ((bgy[4] + 275) - py) / 2;
bg5._x = ((bgx[5] + 275) - px) / 2;
bg5._y = ((bgy[5] + 275) - py) / 2;
bg6._x = ((bgx[6] + 275) - px) / 2;
bg6._y = ((bgy[6] + 275) - py) / 2;
bg7._x = ((bgx[7] + 275) - px) / 2;
bg7._y = ((bgy[7] + 275) - py) / 2;
bg8._x = ((bgx[8] + 275) - px) / 2;
bg8._y = ((bgy[8] + 275) - py) / 2;
r = 1;
while (r <= 3) {
if (((pst[r] > 0) and (pst[r] < 4)) and (psd[r] == 0)) {
if (r == 1) {
shot1p._x = ((297 + psx[1]) - px) / 2;
shot1p._y = ((270 + psy[1]) - py) / 2;
}
if (r == 2) {
shot2p._x = ((297 + psx[2]) - px) / 2;
shot2p._y = ((270 + psy[2]) - py) / 2;
}
if (r == 3) {
shot3p._x = ((297 + psx[3]) - px) / 2;
shot3p._y = ((270 + psy[3]) - py) / 2;
}
}
if (((pst[r] > 0) and (pst[r] < 4)) and (psd[r] == 1)) {
if (r == 1) {
shot1p._x = ((247 + psx[1]) - px) / 2;
shot1p._y = ((270 + psy[1]) - py) / 2;
}
if (r == 2) {
shot2p._x = ((247 + psx[2]) - px) / 2;
shot2p._y = ((270 + psy[2]) - py) / 2;
}
if (r == 3) {
shot3p._x = ((247 + psx[3]) - px) / 2;
shot3p._y = ((270 + psy[3]) - py) / 2;
}
}
if ((pst[r] == 4) or (pst[r] == 5)) {
if (r == 1) {
shot1p._x = ((272 + psx[1]) - px) / 2;
shot1p._y = ((270 + psy[1]) - py) / 2;
}
if (r == 2) {
shot2p._x = ((272 + psx[2]) - px) / 2;
shot2p._y = ((270 + psy[2]) - py) / 2;
}
if (r == 3) {
shot3p._x = ((272 + psx[3]) - px) / 2;
shot3p._y = ((270 + psy[3]) - py) / 2;
}
}
if (pst[r] == 0) {
if (r == 1) {
shot1p._x = -200;
shot1p._y = (270 + psy[1]) - py;
}
if (r == 2) {
shot2p._x = -200;
shot2p._y = (270 + psy[2]) - py;
}
if (r == 3) {
shot3p._x = -200;
shot3p._y = (270 + psy[3]) - py;
}
}
r++;
}
if (i > 0) {
i = i - 1;
pc._alpha = 50;
}
if (i <= 0) {
i = i - 1;
pc._alpha = 100;
}
if (bcharge > 0) {
charge._alpha = bcharge;
}
lbar._height = 2 * pl;
lbar._y = 120 - (2 * pl);
stage._x = (275 - px) / 2;
stage._y = (-525 - py) / 2;
exit._x = ((ex + 275) - px) / 2;
exit._y = ((ey + 275) - py) / 2;
Frame 209
gotoAndPlay (208);
if ((((px + 10) > (ex - 20)) and ((px - 10) < (ex + 20))) and (((py + 30) > (ey - 20)) and (py < (ey + 50)))) {
gotoAndPlay (210);
}
Frame 210
lbar._height = 2 * pl;
lbar._y = 120 - (2 * pl);
stage._x = (275 - px) / 2;
stage._y = (-525 - py) / 2;
exit._x = ((ex + 275) - px) / 2;
exit._y = ((ey + 275) - py) / 2;
Frame 213
psn = 1;
bstep = 0;
pcd = 0;
bcharge = 0;
r = 1;
while (r <= 5) {
psx[r] = -200;
psy[r] = 0;
pst[r] = 0;
psd[r] = 0;
r++;
}
i = 0;
pl = pl + 5;
if (pl > 50) {
pl = 50;
}
px = 950;
py = -525;
r = 0;
while (r <= 26) {
bx[r] = -50;
by[r] = -50;
r++;
}
bx[1] = 1050;
by[1] = -650;
bx[2] = 150;
by[2] = -550;
bx[3] = 650;
by[3] = -550;
bx[4] = 1050;
by[4] = -550;
bx[5] = 150;
by[5] = -450;
bx[6] = 450;
by[6] = -450;
bx[7] = 550;
by[7] = -450;
bx[8] = 750;
by[8] = -450;
bx[9] = 850;
by[9] = -450;
bx[10] = 950;
by[10] = -450;
bx[11] = 150;
by[11] = -350;
bx[12] = 250;
by[12] = -350;
bx[13] = 550;
by[13] = -350;
bx[14] = 150;
by[14] = -250;
bx[15] = 450;
by[15] = -250;
bx[16] = 150;
by[16] = -150;
bx[17] = 550;
by[17] = -150;
bx[18] = 650;
by[18] = -150;
bx[19] = 750;
by[19] = -100;
bx[20] = 250;
by[20] = -50;
bx[21] = 350;
by[21] = 50;
bx[22] = 450;
by[22] = 50;
bx[23] = 550;
by[23] = 100;
bx[24] = 650;
by[24] = 150;
bx[25] = 750;
by[25] = 150;
bsn = 1;
r = 1;
while (r <= 8) {
bgx[r] = -200;
bgy[r] = -200;
bgt[r] = 0;
bgd[r] = -1;
bgs[r] = 0;
r++;
}
r = 1;
while (r <= 5) {
bgsx[r] = -200;
bgsy[r] = 0;
bgst[r] = 0;
bgsd[r] = 0;
r++;
}
r = 1;
while (r <= 8) {
f[r] = 20;
r++;
}
bgt[1] = 1;
bgd[1] = 0;
bgs[1] = 0;
bgl[1] = 3;
bgx[1] = 680;
bgy[1] = -650;
bgt[2] = 2;
bgd[2] = 0;
bgs[2] = 0;
bgl[2] = 3;
bgx[2] = 550;
bgy[2] = -550;
bgt[3] = 2;
bgd[3] = 0;
bgs[3] = 0;
bgl[3] = 3;
bgx[3] = 500;
bgy[3] = -550;
bgt[4] = 3;
bgd[4] = 0;
bgs[4] = 0;
bgl[4] = 5;
bgx[4] = 400;
bgy[4] = -650;
bgt[5] = 14;
bgd[5] = 0;
bgs[5] = 0;
bgl[5] = 3;
bgx[5] = 200;
bgy[5] = -450;
bgt[6] = 14;
bgd[6] = 3;
bgs[6] = 0;
bgl[6] = 3;
bgx[6] = 500;
bgy[6] = -350;
bgt[7] = 3;
bgd[7] = 0;
bgs[7] = 0;
bgl[7] = 5;
bgx[7] = 250;
bgy[7] = -250;
bgt[8] = 2;
bgd[8] = 0;
bgs[8] = 0;
bgl[8] = 3;
bgx[8] = 450;
bgy[8] = -50;
ex = 750;
ey = 50;
Frame 214
b1._x = bx[1] / 10;
b1._y = (by[1] / 10) + 120;
b2._x = bx[2] / 10;
b2._y = (by[2] / 10) + 120;
b3._x = bx[3] / 10;
b3._y = (by[3] / 10) + 120;
b4._x = bx[4] / 10;
b4._y = (by[4] / 10) + 120;
b5._x = bx[5] / 10;
b5._y = (by[5] / 10) + 120;
b6._x = bx[6] / 10;
b6._y = (by[6] / 10) + 120;
b7._x = bx[7] / 10;
b7._y = (by[7] / 10) + 120;
b8._x = bx[8] / 10;
b8._y = (by[8] / 10) + 120;
b9._x = bx[9] / 10;
b9._y = (by[9] / 10) + 120;
b10._x = bx[10] / 10;
b10._y = (by[10] / 10) + 120;
b11._x = bx[11] / 10;
b11._y = (by[11] / 10) + 120;
b12._x = bx[12] / 10;
b12._y = (by[12] / 10) + 120;
b13._x = bx[13] / 10;
b13._y = (by[13] / 10) + 120;
b14._x = bx[14] / 10;
b14._y = (by[14] / 10) + 120;
b15._x = bx[15] / 10;
b15._y = (by[15] / 10) + 120;
b16._x = bx[16] / 10;
b16._y = (by[16] / 10) + 120;
b17._x = bx[17] / 10;
b17._y = (by[17] / 10) + 120;
b18._x = bx[18] / 10;
b18._y = (by[18] / 10) + 120;
b19._x = bx[19] / 10;
b19._y = (by[19] / 10) + 120;
b20._x = bx[20] / 10;
b20._y = (by[20] / 10) + 120;
b21._x = bx[21] / 10;
b21._y = (by[21] / 10) + 120;
b22._x = bx[22] / 10;
b22._y = (by[22] / 10) + 120;
b23._x = bx[23] / 10;
b23._y = (by[23] / 10) + 120;
b24._x = bx[24] / 10;
b24._y = (by[24] / 10) + 120;
b25._x = bx[25] / 10;
b25._y = (by[25] / 10) + 120;
b26._x = bx[26] / 10;
b26._y = (by[26] / 10) + 120;
b27._x = bx[27] / 10;
b27._y = (by[27] / 10) + 120;
b28._x = bx[28] / 10;
b28._y = (by[28] / 10) + 120;
cir._x = px / 10;
cir._y = (py / 10) + 120;
shot1._x = psx[1] / 10;
shot1._y = (psy[1] / 10) + 120;
shot2._x = psx[2] / 10;
shot2._y = (psy[2] / 10) + 120;
shot3._x = psx[3] / 10;
shot3._y = (psy[3] / 10) + 120;
bshot1._x = bgsx[1] / 10;
bshot1._y = (bgsy[1] / 10) + 120;
bshot2._x = bgsx[2] / 10;
bshot2._y = (bgsy[2] / 10) + 120;
bshot3._x = bgsx[3] / 10;
bshot3._y = (bgsy[3] / 10) + 120;
bshot4._x = bgsx[4] / 10;
bshot4._y = (bgsy[4] / 10) + 120;
bshot5._x = bgsx[5] / 10;
bshot5._y = (bgsy[5] / 10) + 120;
bcir1._x = bgx[1] / 10;
bcir1._y = (bgy[1] / 10) + 120;
bcir2._x = bgx[2] / 10;
bcir2._y = (bgy[2] / 10) + 120;
bcir3._x = bgx[3] / 10;
bcir3._y = (bgy[3] / 10) + 120;
bcir4._x = bgx[4] / 10;
bcir4._y = (bgy[4] / 10) + 120;
bcir5._x = bgx[5] / 10;
bcir5._y = (bgy[5] / 10) + 120;
bcir6._x = bgx[6] / 10;
bcir6._y = (bgy[6] / 10) + 120;
bcir7._x = bgx[7] / 10;
bcir7._y = (bgy[7] / 10) + 120;
bcir8._x = bgx[8] / 10;
bcir8._y = (bgy[8] / 10) + 120;
bcir9._x = bgx[9] / 10;
bcir9._y = (bgy[9] / 10) + 120;
bcir10._x = bgx[10] / 10;
bcir10._y = (bgy[10] / 10) + 120;
bcir11._x = bgx[11] / 10;
bcir11._y = (bgy[11] / 10) + 120;
bcir12._x = bgx[12] / 10;
bcir12._y = (bgy[12] / 10) + 120;
bcir13._x = bgx[13] / 10;
bcir13._y = (bgy[13] / 10) + 120;
if (Key.isDown(39) and (pcd == 0)) {
pcd = 2;
}
if (Key.isDown(39) and ((pcd == 1) or (pcd == 3))) {
pcd = 0;
}
if (Key.isDown(37) and (pcd == 1)) {
pcd = 3;
}
if (Key.isDown(37) and ((pcd == 0) or (pcd == 2))) {
pcd = 1;
}
if (Key.isDown(38) and ((pcd == 0) or (pcd == 2))) {
pcd = 10;
pstep = 7;
}
if (Key.isDown(38) and ((pcd == 1) or (pcd == 3))) {
pcd = 11;
pstep = 7;
}
if (Key.isDown(40) and ((((pcd == 0) or (pcd == 1)) or (pcd == 2)) or (pcd == 3))) {
if (((pcd == 0) or (pcd == 2)) or (pcd == 8)) {
pcd = 6;
pstep = 3;
}
if (((pcd == 1) or (pcd == 3)) or (pcd == 9)) {
pcd = 7;
pstep = 3;
}
}
if (Key.isDown(16) and (bcharge < 100)) {
bcharge = bcharge + 5;
}
if (pcd == 0) {
pc.gotoAndStop(1);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(21);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 0;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
}
if (pcd == 1) {
pc.gotoAndStop(2);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(22);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 1;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
}
if (pcd == 2) {
px = px + 13;
if ((w == 0) or (w == 1)) {
pc.gotoAndStop(3);
}
if ((w == 2) or (w == 3)) {
pc.gotoAndStop(4);
}
if ((w == 4) or (w == 5)) {
pc.gotoAndStop(5);
}
if ((w == 6) or (w == 7)) {
pc.gotoAndStop(6);
}
if (Key.isDown(32)) {
if ((w == 0) or (w == 1)) {
pc.gotoAndStop(11);
}
if ((w == 2) or (w == 3)) {
pc.gotoAndStop(12);
}
if ((w == 4) or (w == 5)) {
pc.gotoAndStop(13);
}
if ((w == 6) or (w == 7)) {
pc.gotoAndStop(14);
}
if ((pst[psn] == 0) and (bstep == 0)) {
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 0;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
}
pcd = 0;
}
if (pcd == 3) {
px = px - 13;
if ((w == 0) or (w == 1)) {
pc.gotoAndStop(7);
}
if ((w == 2) or (w == 3)) {
pc.gotoAndStop(8);
}
if ((w == 4) or (w == 5)) {
pc.gotoAndStop(9);
}
if ((w == 6) or (w == 7)) {
pc.gotoAndStop(10);
}
if (Key.isDown(32)) {
if ((w == 0) or (w == 1)) {
pc.gotoAndStop(15);
}
if ((w == 2) or (w == 3)) {
pc.gotoAndStop(16);
}
if ((w == 4) or (w == 5)) {
pc.gotoAndStop(17);
}
if ((w == 6) or (w == 7)) {
pc.gotoAndStop(18);
}
if ((pst[psn] == 0) and (bstep == 0)) {
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 1;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
}
pcd = 1;
}
if (pcd == 9) {
pstep = pstep - 1;
if (pstep <= 0) {
pcd = 1;
}
}
if (pcd == 6) {
pc.gotoAndStop(19);
px = px + 20;
pstep = pstep - 1;
if (pstep <= 0) {
pcd = 0;
}
}
if (pcd == 7) {
pc.gotoAndStop(20);
px = px - 20;
pstep = pstep - 1;
if (pstep <= 0) {
pcd = 1;
}
}
if (pcd == 12) {
pc.gotoAndStop(23);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(25);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 0;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
py = py + (5 * (7 - pstep));
pstep = pstep - 1;
if (pstep <= 2) {
pstep = 2;
}
if (Key.isDown(39)) {
px = px + 13;
}
if (Key.isDown(37)) {
px = px - 13;
if (bstep == 0) {
pcd = 13;
}
}
}
if (pcd == 13) {
pc.gotoAndStop(24);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(26);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 1;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
py = py + (5 * (7 - pstep));
pstep = pstep - 1;
if (pstep <= 2) {
pstep = 2;
}
if (Key.isDown(39)) {
px = px + 13;
if (bstep == 0) {
pcd = 12;
}
}
if (Key.isDown(37)) {
px = px - 13;
}
}
if (pcd == 10) {
pc.gotoAndStop(23);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(25);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 0;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
py = py - (5 * pstep);
pstep = pstep - 1;
if (Key.isDown(39)) {
px = px + 13;
}
if (Key.isDown(37)) {
px = px - 13;
if (bstep == 0) {
pcd = 11;
}
}
if (Key.isDown(40)) {
pcd = 12;
pstep = pstep + 3;
}
if (pstep <= -1) {
pstep = 7;
pcd = 12;
}
}
if (pcd == 11) {
pc.gotoAndStop(24);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(26);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 1;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
py = py - (5 * pstep);
pstep = pstep - 1;
if (Key.isDown(39)) {
px = px + 13;
if (bstep == 0) {
pcd = 10;
}
}
if (Key.isDown(37)) {
px = px - 13;
}
if (Key.isDown(40)) {
pcd = 13;
pstep = pstep + 3;
}
if (pstep <= -1) {
pstep = 7;
pcd = 13;
}
}
if (pcd == 18) {
pc.gotoAndStop(27);
pstep = pstep - 1;
px = px - 5;
if (pstep <= -1) {
pstep = 2;
pcd = 0;
}
}
if (pcd == 19) {
pc.gotoAndStop(28);
pstep = pstep - 1;
px = px + 5;
if (pstep <= -1) {
pstep = 2;
pcd = 1;
}
}
if (pcd == 20) {
pc.gotoAndStop(69 - pstep);
bcharge = 0;
charge._alpha = 0;
bstep = 20;
pl = 1;
pstep = pstep - 1;
if (pstep < 0) {
lives = lives - 1;
if (lives >= 0) {
pl = 50;
gotoAndPlay (190);
}
if (lives < 0) {
lives = 2;
continues = continues - 1;
gotoAndPlay (5);
}
}
}
if (pl <= 0) {
c = 1;
while (c <= 8) {
bgx[c] = -600;
c++;
}
pc._alpha = 100;
pcd = 20;
pstep = 40;
megad.start();
}
if (bstep > 0) {
bcharge = 0;
charge._alpha = bcharge;
}
if (bstep > 0) {
bstep = bstep - 1;
}
if ((py > 500) and (pcd < 20)) {
megad.start();
pl = 0;
}
w = w - 1;
if (w < 0) {
w = 7;
}
e = pcd;
c = 0;
r = 1;
while (r <= 12) {
if (((((bx[r] - 150) < px) and ((bx[r] + 150) > px)) and ((by[r] - 150) < py)) and ((by[r] + 150) > py)) {
if (((((((px - 30) < (bx[r] + 50)) and ((px + 20) > (bx[r] - 50))) and (py < (by[r] - 50))) and ((py + 60) > (by[r] - 50))) and (pcd != 10)) and (pcd != 11)) {
if ((((pcd == 12) or (pcd == 13)) or (pcd == 16)) or (pcd == 17)) {
if ((pcd == 12) or (pcd == 16)) {
pcd = 0;
}
if ((pcd == 13) or (pcd == 17)) {
pcd = 1;
}
}
c = 1;
py = by[r] - 75;
}
if (((((px + 38) > (bx[r] - 50)) and ((px + 20) < bx[r])) and (py < (by[r] + 50))) and ((py + 20) > (by[r] - 50))) {
px = bx[r] - 85;
}
if (((((px - 35) < (bx[r] + 50)) and ((px - 20) > bx[r])) and (py < (by[r] + 50))) and ((py + 20) > (by[r] - 50))) {
px = bx[r] + 85;
}
if (((((px - 5) < (bx[r] + 50)) and ((px + 5) > (bx[r] - 50))) and ((py - 30) < (by[r] + 50))) and ((py + 10) > (by[r] + 50))) {
if ((((pcd == 10) or (pcd == 11)) or (pcd == 14)) or (pcd == 15)) {
if ((pcd == 10) or (pcd == 14)) {
pcd = 12;
pstep = 5;
}
if ((pcd == 11) or (pcd == 15)) {
pcd = 13;
pstep = 5;
}
}
py = by[r] + 90;
}
}
r++;
}
if (c == 0) {
if ((((pcd == 0) or (pcd == 2)) or (pcd == 6)) or (pcd == 18)) {
pcd = 12;
pstep = 6;
}
if ((((pcd == 1) or (pcd == 3)) or (pcd == 7)) or (pcd == 19)) {
pcd = 13;
pstep = 6;
}
}
r = 1;
while (r <= 3) {
if (pst[r] == 1) {
if (psd[r] == 0) {
psx[r] = psx[r] + 30;
if (r == 1) {
shot1p.gotoAndStop(1);
}
if (r == 2) {
shot2p.gotoAndStop(1);
}
if (r == 3) {
shot3p.gotoAndStop(1);
}
if (psx[r] > (px + 280)) {
pst[r] = 0;
psx[r] = -200;
}
}
if (psd[r] == 1) {
psx[r] = psx[r] - 30;
if (r == 1) {
shot1p.gotoAndStop(2);
}
if (r == 2) {
shot2p.gotoAndStop(2);
}
if (r == 3) {
shot3p.gotoAndStop(2);
}
if (psx[r] < (px - 280)) {
pst[r] = 0;
psx[r] = -200;
}
}
}
if (pst[r] == 2) {
if (psd[r] == 0) {
psx[r] = psx[r] + 35;
if (r == 1) {
shot1p.gotoAndStop(3);
}
if (r == 2) {
shot2p.gotoAndStop(3);
}
if (r == 3) {
shot3p.gotoAndStop(3);
}
if (psx[r] > (px + 280)) {
pst[r] = 0;
psx[r] = -200;
}
}
if (psd[r] == 1) {
psx[r] = psx[r] - 35;
if (r == 1) {
shot1p.gotoAndStop(4);
}
if (r == 2) {
shot2p.gotoAndStop(4);
}
if (r == 3) {
shot3p.gotoAndStop(4);
}
if (psx[r] < (px - 280)) {
pst[r] = 0;
psx[r] = -200;
}
}
}
if (pst[r] == 3) {
if (psd[r] == 0) {
psx[r] = psx[r] + 40;
if (r == 1) {
shot1p.gotoAndStop(5);
}
if (r == 2) {
shot2p.gotoAndStop(5);
}
if (r == 3) {
shot3p.gotoAndStop(5);
}
if (psx[r] > (px + 280)) {
pst[r] = 0;
psx[r] = -200;
}
}
if (psd[r] == 1) {
psx[r] = psx[r] - 40;
if (r == 1) {
shot1p.gotoAndStop(6);
}
if (r == 2) {
shot2p.gotoAndStop(6);
}
if (r == 3) {
shot3p.gotoAndStop(6);
}
if (psx[r] < (px - 280)) {
pst[r] = 0;
psx[r] = -200;
}
}
}
if (pst[r] == 4) {
if (r == 1) {
shot1p.gotoAndStop(10 - psd[r]);
}
if (r == 2) {
shot2p.gotoAndStop(10 - psd[r]);
}
if (r == 3) {
shot3p.gotoAndStop(10 - psd[r]);
}
psd[r] = psd[r] - 1;
if (psd[r] < 0) {
pst[r] = 0;
psx[r] = -200;
}
}
if (pst[r] == 5) {
if (r == 1) {
shot1p.gotoAndStop(14 - psd[r]);
}
if (r == 2) {
shot2p.gotoAndStop(14 - psd[r]);
}
if (r == 3) {
shot3p.gotoAndStop(14 - psd[r]);
}
psd[r] = psd[r] - 1;
if (psd[r] < 0) {
pst[r] = 0;
psx[r] = -200;
}
}
r++;
}
while (c <= 8) {
r = 1;
while (r <= 3) {
if ((pst[r] > 0) and (pst[r] < 4)) {
if (((((bgt[c] == 1) and ((bgx[c] - 35) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 35) > (psx[r] - ((pst[r] * 20) - 20)))) and ((bgy[c] - 5) < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 50) > (psy[r] - ((pst[r] * 20) - 20)))) {
if ((bgd[c] == 0) or (bgd[c] == 2)) {
deflect.start();
pst[r] = 5;
psd[r] = 2;
}
if ((bgd[c] == 1) or (bgd[c] == 3)) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd2.start();
bgd[c] = 4;
bgs[c] = 4;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
if (((((bgt[c] == 2) and ((bgx[c] - 35) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 35) > (psx[r] - ((pst[r] * 20) - 20)))) and (bgy[c] < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 50) > (psy[r] - ((pst[r] * 20) - 20)))) {
if ((((bgd[c] == 0) or (bgd[c] == 3)) or (bgd[c] == 1)) or (bgd[c] == 4)) {
deflect.start();
pst[r] = 5;
psd[r] = 2;
}
if ((bgd[c] == 2) or (bgd[c] == 5)) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd2.start();
bgd[c] = 6;
bgs[c] = 6;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
if (((((bgt[c] == 3) and ((bgx[c] - 35) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 35) > (psx[r] - ((pst[r] * 20) - 20)))) and ((bgy[c] - 20) < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 40) > (psy[r] - ((pst[r] * 20) - 20)))) {
if (bgd[c] == 0) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd2.start();
bgd[c] = 1;
bgs[c] = 4;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
if (((((bgt[c] == 4) and ((bgx[c] - 40) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 40) > (psx[r] - ((pst[r] * 20) - 20)))) and ((bgy[c] - 20) < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 50) > (psy[r] - ((pst[r] * 20) - 20)))) {
if ((bgd[c] == 0) or (bgd[c] == 2)) {
deflect.start();
pst[r] = 5;
psd[r] = 2;
}
if ((bgd[c] == 1) or (bgd[c] == 3)) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd1.start();
bgd[c] = 4;
bgs[c] = 4;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
if (((((bgt[c] == 5) and ((bgx[c] - 40) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 40) > (psx[r] - ((pst[r] * 20) - 20)))) and ((bgy[c] - 20) < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 50) > (psy[r] - ((pst[r] * 20) - 20)))) {
if ((((bgd[c] == 0) or (bgd[c] == 1)) or (bgd[c] == 2)) or (bgd[c] == 3)) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd1.start();
bgd[c] = 4;
bgs[c] = 5;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
if (((((bgt[c] == 6) and ((bgx[c] - 35) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 35) > (psx[r] - ((pst[r] * 20) - 20)))) and ((bgy[c] - 50) < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 20) > (psy[r] - ((pst[r] * 20) - 20)))) {
if ((bgd[c] == 0) or (bgd[c] == 1)) {
deflect.start();
pst[r] = 5;
psd[r] = 2;
}
if (bgd[c] == 2) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd2.start();
bgd[c] = 3;
bgs[c] = 4;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
if (((((bgt[c] == 7) and ((bgx[c] - 35) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 35) > (psx[r] - ((pst[r] * 20) - 20)))) and ((bgy[c] - 50) < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 20) > (psy[r] - ((pst[r] * 20) - 20)))) {
if (bgd[c] == 0) {
deflect.start();
pst[r] = 5;
psd[r] = 2;
}
if ((bgd[c] == 2) or (bgd[c] == 1)) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd2.start();
bgd[c] = 3;
bgs[c] = 3;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
if (((((bgt[c] == 8) and ((bgx[c] - 35) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 35) > (psx[r] - ((pst[r] * 20) - 20)))) and ((bgy[c] - 50) < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 20) > (psy[r] - ((pst[r] * 20) - 20)))) {
if ((bgd[c] == 0) or (bgd[c] == 1)) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd1.start();
bgd[c] = 2;
bgs[c] = 5;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
if (((((bgt[c] == 9) and ((bgx[c] - 40) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 40) > (psx[r] - ((pst[r] * 20) - 20)))) and ((bgy[c] - 20) < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 50) > (psy[r] - ((pst[r] * 20) - 20)))) {
if ((bgd[c] == 0) and (px > bgx[c])) {
deflect.start();
pst[r] = 5;
psd[r] = 2;
}
if ((bgd[c] == 1) and (px < bgx[c])) {
deflect.start();
pst[r] = 5;
psd[r] = 2;
}
if ((bgd[c] == 0) and (px < bgx[c])) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd1.start();
bgd[c] = 4;
bgs[c] = 4;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
if ((bgd[c] == 1) and (px > bgx[c])) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd1.start();
bgd[c] = 2;
bgs[c] = 4;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
if (((((bgt[c] == 10) and ((bgx[c] - 20) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 20) > (psx[r] - ((pst[r] * 20) - 20)))) and ((bgy[c] - 50) < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 20) > (psy[r] - ((pst[r] * 20) - 20)))) {
if ((bgd[c] == 0) or (bgd[c] == 1)) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd2.start();
bgd[c] = 2;
bgs[c] = 3;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
if (((((bgt[c] == 11) and ((bgx[c] - 25) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 25) > (psx[r] - ((pst[r] * 20) - 20)))) and (bgy[c] < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 50) > (psy[r] - ((pst[r] * 20) - 20)))) {
if ((((((bgd[c] == 0) or (bgd[c] == 1)) or (bgd[c] == 2)) or (bgd[c] == 3)) or (bgd[c] == 4)) or (bgd[c] == 5)) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd2.start();
bgd[c] = 6;
bgs[c] = 3;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
if (((((bgt[c] == 12) and ((bgx[c] - 25) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 25) > (psx[r] - ((pst[r] * 20) - 20)))) and (bgy[c] < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 50) > (psy[r] - ((pst[r] * 20) - 20)))) {
if ((bgd[c] == 0) or (bgd[c] == 1)) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd2.start();
bgd[c] = 2;
bgs[c] = 3;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
if (((((bgt[c] == 13) and ((bgx[c] - 35) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 35) > (psx[r] - ((pst[r] * 20) - 20)))) and (bgy[c] < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 60) > (psy[r] - ((pst[r] * 20) - 20)))) {
if ((((((bgd[c] == 0) or (bgd[c] == 1)) or (bgd[c] == 2)) or (bgd[c] == 3)) or (bgd[c] == 4)) or (bgd[c] == 5)) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd1.start();
bgd[c] = 6;
bgs[c] = 4;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
if (((((bgt[c] == 14) and ((bgx[c] - 20) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 20) > (psx[r] - ((pst[r] * 20) - 20)))) and ((bgy[c] - 20) < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 20) > (psy[r] - ((pst[r] * 20) - 20)))) {
if ((((bgd[c] == 0) or (bgd[c] == 1)) or (bgd[c] == 3)) or (bgd[c] == 4)) {
deflect.start();
pst[r] = 5;
psd[r] = 2;
}
if ((bgd[c] == 2) or (bgd[c] == 5)) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd2.start();
bgd[c] = 6;
bgs[c] = 3;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
}
r++;
}
c++;
}
r = 1;
while (r <= 8) {
if (((((bgt[r] > 0) and ((bgx[r] - 340) < px)) and ((bgx[r] + 340) > px)) and ((bgy[r] - 180) < py)) and ((bgy[r] + 350) > py)) {
c = 0;
e = 1;
while (e <= 26) {
if (((((bx[e] - 150) < bgx[r]) and ((bx[e] + 150) > bgx[r])) and ((by[e] - 150) < bgy[r])) and ((by[e] + 150) > bgy[r])) {
if (((((bgx[r] + 20) >= (bx[e] - 50)) and ((bgx[r] - 20) <= (bx[e] + 50))) and ((bgy[r] + 45) > (by[e] - 60))) and ((bgy[r] - 10) < (by[e] - 40))) {
c = 1;
}
if (((((bgx[r] + 20) > (bx[e] - 50)) and ((bgx[r] + 20) < bx[e])) and (bgy[r] < (by[e] + 50))) and ((bgy[r] + 20) > (by[e] - 50))) {
bgx[r] = bx[e] - 70;
}
if (((((bgx[r] - 20) < (bx[e] + 50)) and ((bgx[r] + 20) > bx[e])) and (bgy[r] < (by[e] + 50))) and ((bgy[r] + 20) > (by[e] - 50))) {
bgx[r] = bx[e] + 70;
}
if (((((bgx[r] - 5) < (bx[e] + 50)) and ((bgx[r] + 5) > (bx[e] - 50))) and ((bgy[r] - 30) < (by[e] + 50))) and (bgy[r] > (by[e] + 50))) {
bgy[r] = by[e] + 70;
}
if (((((bgx[r] - 2) < (bx[e] + 50)) and ((bgx[r] + 2) > (bx[e] - 50))) and ((bgy[r] + 20) < (by[e] - 50))) and ((bgy[r] + 60) > (by[e] - 50))) {
c = 1;
bgy[r] = by[e] - 105;
}
}
e++;
}
if (c == 0) {
bgy[r] = bgy[r] + 10;
}
if (bgt[r] == 1) {
if (((((((bgx[r] - 10) < (px + 10)) and ((bgx[r] + 10) > (px - 10))) and ((bgy[r] + 80) > (py + 10))) and ((bgy[r] + 50) < (py + 50))) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 4;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 4;
}
megah.start();
i = 10;
}
if (bgd[r] == 0) {
f[r] = 1;
if (px < bgx[r]) {
bgd[r] = 2;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
joes.start();
bgd[r] = 1;
bgs[r] = 7;
bgst[bsn] = 1;
bgsx[bsn] = bgx[r] - 10;
bgsy[bsn] = bgy[r] + 30;
bgsd[bsn] = 0;
bsn = bsn + 1;
if (bsn > 5) {
bsn = 1;
}
}
}
if (bgd[r] == 2) {
f[r] = 3;
if (px > bgx[r]) {
bgd[r] = 0;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
joes.start();
bgd[r] = 3;
bgs[r] = 7;
bgst[bsn] = 1;
bgsx[bsn] = bgx[r] + 10;
bgsy[bsn] = bgy[r] + 30;
bgsd[bsn] = 1;
bsn = bsn + 1;
if (bsn > 5) {
bsn = 1;
}
}
}
if (bgd[r] == 1) {
f[r] = 2;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 0;
bgs[r] = 20;
}
}
if (bgd[r] == 3) {
f[r] = 4;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 2;
bgs[r] = 20;
}
}
if (bgd[r] == 4) {
if (bgs[r] == 4) {
f[r] = 5;
}
if (bgs[r] == 3) {
f[r] = 6;
}
if (bgs[r] == 2) {
f[r] = 7;
}
if (bgs[r] == 1) {
f[r] = 8;
}
bgy[r] = bgy[r] - 10;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
f[r] = 9;
bgt[r] = 0;
bgx[r] = -500;
bgs[r] = 0;
}
}
}
if (bgt[r] == 2) {
if (((((((bgx[r] - 15) < (px + 10)) and ((bgx[r] + 15) > (px - 10))) and ((bgy[r] + 80) > (py - 10))) and ((bgy[r] + 50) < (py + 50))) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 3;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 3;
}
megah.start();
i = 10;
}
if (bgd[r] == 0) {
f[r] = 1;
if (px < bgx[r]) {
bgd[r] = 3;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 1;
bgs[r] = 10;
}
}
if (bgd[r] == 3) {
f[r] = 5;
if (px > bgx[r]) {
bgd[r] = 0;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 4;
bgs[r] = 10;
}
}
if (bgd[r] == 1) {
f[r] = 2;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 2;
bgs[r] = 12;
}
}
if (bgd[r] == 2) {
if (((bgs[r] == 12) or (bgs[r] == 11)) or (bgs[r] == 10)) {
f[r] = 3;
}
if (((bgs[r] == 9) or (bgs[r] == 8)) or (bgs[r] == 7)) {
f[r] = 4;
}
if (((bgs[r] == 6) or (bgs[r] == 5)) or (bgs[r] == 4)) {
f[r] = 3;
}
if (((bgs[r] == 3) or (bgs[r] == 2)) or (bgs[r] == 1)) {
f[r] = 4;
}
bgx[r] = bgx[r] + 8;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 0;
bgs[r] = 10 + random(20);
}
}
if (bgd[r] == 4) {
f[r] = 6;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 5;
bgs[r] = 12;
}
}
if (bgd[r] == 5) {
if (((bgs[r] == 12) or (bgs[r] == 11)) or (bgs[r] == 10)) {
f[r] = 7;
}
if (((bgs[r] == 9) or (bgs[r] == 8)) or (bgs[r] == 7)) {
f[r] = 8;
}
if (((bgs[r] == 6) or (bgs[r] == 5)) or (bgs[r] == 4)) {
f[r] = 7;
}
if (((bgs[r] == 3) or (bgs[r] == 2)) or (bgs[r] == 1)) {
f[r] = 8;
}
bgx[r] = bgx[r] - 8;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 3;
bgs[r] = 10 + random(20);
}
}
if (bgd[r] == 6) {
if (bgs[r] == 6) {
f[r] = 9;
}
if (bgs[r] == 5) {
f[r] = 10;
}
if (bgs[r] == 4) {
f[r] = 11;
}
if (bgs[r] == 3) {
f[r] = 12;
}
if (bgs[r] == 2) {
f[r] = 13;
}
if (bgs[r] == 1) {
f[r] = 14;
}
bgs[r] = bgs[r] - 1;
bgy[r] = bgy[r] - 10;
if (bgs[r] <= 0) {
f[r] = 15;
bgt[r] = 0;
bgx[r] = -500;
bgs[r] = 0;
}
}
}
if (bgt[r] == 3) {
if ((((((((bgx[r] - 20) < (px + 10)) and ((bgx[r] + 20) > (px - 10))) and ((bgy[r] + 60) > (py + 5))) and ((bgy[r] + 40) < (py + 45))) and (pcd < 18)) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 4;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 4;
}
megah.start();
i = 10;
}
if (bgd[r] == 0) {
if ((bgs[r] == 0) or (bgs[r] == 1)) {
f[r] = 1;
}
if ((bgs[r] == 2) or (bgs[r] == 3)) {
f[r] = 2;
}
if ((bgs[r] == 4) or (bgs[r] == 5)) {
f[r] = 3;
}
if ((bgs[r] == 6) or (bgs[r] == 7)) {
f[r] = 4;
}
if ((bgs[r] == 8) or (bgs[r] == 9)) {
f[r] = 5;
}
if ((bgs[r] == 10) or (bgs[r] == 11)) {
f[r] = 6;
}
if (px < bgx[r]) {
bgx[r] = bgx[r] - 5;
}
if (px > bgx[r]) {
bgx[r] = bgx[r] + 5;
}
if ((py - 20) > bgy[r]) {
bgy[r] = bgy[r] - 5;
}
if ((py - 20) < bgy[r]) {
bgy[r] = bgy[r] - 15;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgs[r] = 11;
}
}
if (bgd[r] == 1) {
if (bgs[r] == 4) {
f[r] = 7;
}
if (bgs[r] == 3) {
f[r] = 8;
}
if (bgs[r] == 2) {
f[r] = 9;
}
if (bgs[r] == 1) {
f[r] = 10;
}
bgs[r] = bgs[r] - 1;
bgy[r] = bgy[r] - 10;
if (bgs[r] <= 0) {
bgx[r] = -500;
f[r] = 11;
bgt[r] = 0;
bgs[r] = 0;
}
}
}
if (bgt[r] == 4) {
if (((((((bgx[r] - 20) < (px + 10)) and ((bgx[r] + 20) > (px - 10))) and ((bgy[r] + 80) > (py + 10))) and ((bgy[r] + 30) < (py + 50))) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 4;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 4;
}
megah.start();
i = 10;
}
if (bgd[r] == 0) {
f[r] = 1;
if ((px - 180) < bgx[r]) {
bgd[r] = 1;
bgs[r] = 4;
}
if (px < bgx[r]) {
bgd[r] = 2;
}
}
if (bgd[r] == 2) {
f[r] = 4;
if ((px + 180) > bgx[r]) {
bgd[r] = 3;
bgs[r] = 4;
}
if (px > bgx[r]) {
bgd[r] = 0;
}
}
if (bgd[r] == 1) {
if ((bgs[r] == 1) or (bgs[r] == 2)) {
f[r] = 2;
}
if ((bgs[r] == 3) or (bgs[r] == 4)) {
f[r] = 3;
}
bgx[r] = bgx[r] + 12;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgs[r] = 4;
}
}
if (bgd[r] == 3) {
if ((bgs[r] == 1) or (bgs[r] == 2)) {
f[r] = 5;
}
if ((bgs[r] == 3) or (bgs[r] == 4)) {
f[r] = 6;
}
bgx[r] = bgx[r] - 12;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgs[r] = 4;
}
}
if (bgd[r] == 4) {
if (bgs[r] == 4) {
f[r] = 7;
}
if (bgs[r] == 3) {
f[r] = 8;
}
if (bgs[r] == 2) {
f[r] = 9;
}
if (bgs[r] == 1) {
f[r] = 10;
}
bgs[r] = bgs[r] - 1;
bgy[r] = bgy[r] - 10;
if (bgs[r] <= 0) {
bgx[r] = -500;
f[r] = 11;
bgt[r] = 0;
bgs[r] = 0;
}
}
}
if (bgt[r] == 5) {
if (((((((bgx[r] - 20) < (px + 10)) and ((bgx[r] + 20) > (px - 10))) and ((bgy[r] + 80) > (py + 10))) and ((bgy[r] + 30) < (py + 50))) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 3;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 3;
}
megah.start();
i = 10;
}
if (bgd[r] == 0) {
f[r] = 1;
if (px < bgx[r]) {
bgd[r] = 2;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
cannons.start();
bgd[r] = 1;
bgs[r] = 8;
bgst[bsn] = 2;
bgsx[bsn] = bgx[r] - 20;
bgsy[bsn] = bgy[r] + 20;
bgsd[bsn] = 0;
bsn = bsn + 1;
if (bsn > 5) {
bsn = 1;
}
}
}
if (bgd[r] == 2) {
f[r] = 3;
if (px > bgx[r]) {
bgd[r] = 0;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
cannons.start();
bgd[r] = 3;
bgs[r] = 7;
bgst[bsn] = 2;
bgsx[bsn] = bgx[r] + 20;
bgsy[bsn] = bgy[r] + 20;
bgsd[bsn] = 1;
bsn = bsn + 1;
if (bsn > 5) {
bsn = 1;
}
}
}
if (bgd[r] == 1) {
f[r] = 2;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 0;
bgs[r] = 10 + random(15);
}
}
if (bgd[r] == 3) {
f[r] = 4;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 2;
bgs[r] = 10 + random(15);
}
}
if (bgd[r] == 4) {
if (bgs[r] == 5) {
f[r] = 5;
}
if (bgs[r] == 4) {
f[r] = 6;
}
if (bgs[r] == 3) {
f[r] = 7;
}
if (bgs[r] == 2) {
f[r] = 8;
}
if (bgs[r] == 1) {
f[r] = 9;
}
bgs[r] = bgs[r] - 1;
bgy[r] = bgy[r] - 10;
if (bgs[r] <= 0) {
f[r] = 10;
bgt[r] = 0;
bgx[r] = -500;
bgs[r] = 0;
}
}
}
if (bgt[r] == 6) {
if (((((((bgx[r] - 10) < (px + 10)) and ((bgx[r] + 10) > (px - 10))) and ((bgy[r] + 50) > (py + 10))) and ((bgy[r] + 10) < (py + 50))) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 4;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 4;
}
megah.start();
i = 10;
}
if (bgd[r] == 0) {
f[r] = 1;
bgy[r] = bgy[r] - 10;
if (((((px - 120) < bgx[r]) and ((px + 120) > bgx[r])) and ((bgy[r] - 80) < py)) and ((bgy[r] + 150) > py)) {
bgd[r] = 1;
bgs[r] = 6;
}
}
if (bgd[r] == 1) {
bgy[r] = bgy[r] - 10;
if (((bgs[r] == 6) or (bgs[r] == 5)) or (bgs[r] == 4)) {
f[r] = 2;
}
if (((bgs[r] == 3) or (bgs[r] == 2)) or (bgs[r] == 1)) {
f[r] = 3;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgs[r] = 4;
bgd[r] = 2;
}
}
if (bgd[r] == 2) {
if ((bgs[r] == 4) or (bgs[r] == 3)) {
f[r] = 4;
}
if ((bgs[r] == 2) or (bgs[r] == 1)) {
f[r] = 5;
}
if (px < bgx[r]) {
bgx[r] = (bgx[r] - 1) - random(10);
}
if (px > bgx[r]) {
bgx[r] = (bgx[r] + 1) + random(10);
}
if (py > bgy[r]) {
bgy[r] = bgy[r] + random(8);
}
if (py < bgy[r]) {
bgy[r] = (bgy[r] - 10) - random(10);
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgs[r] = 4;
}
}
if (bgd[r] == 3) {
if (bgs[r] == 4) {
f[r] = 6;
}
if (bgs[r] == 3) {
f[r] = 7;
}
if (bgs[r] == 2) {
f[r] = 8;
}
if (bgs[r] == 1) {
f[r] = 9;
}
bgs[r] = bgs[r] - 1;
bgy[r] = bgy[r] - 10;
if (bgs[r] <= 0) {
f[r] = 10;
bgt[r] = 0;
bgx[r] = -500;
bgs[r] = 0;
}
}
}
if (bgt[r] == 7) {
if (((((((bgx[r] - 20) < (px + 10)) and ((bgx[r] + 20) > (px - 10))) and ((bgy[r] + 20) > (py + 10))) and ((bgy[r] + 20) < (py + 50))) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 3;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 3;
}
megah.start();
i = 10;
}
if (bgd[r] == 0) {
f[r] = 1;
bgy[r] = bgy[r] - 10;
if ((px + 80) < bgx[r]) {
bgx[r] = bgx[r] - 5;
}
if ((px - 80) > bgx[r]) {
bgx[r] = bgx[r] + 5;
}
if ((py - 70) < bgy[r]) {
bgy[r] = bgy[r] - 5;
}
if ((py - 70) > bgy[r]) {
bgy[r] = bgy[r] + 5;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
joes.start();
if (px > bgx[r]) {
bgd[r] = 1;
}
if (px < bgx[r]) {
bgd[r] = 2;
}
if (px < bgx[r]) {
bgsd[bsn] = 3;
if ((py - 50) < bgy[r]) {
bgsd[bsn] = 1;
}
}
if (px > bgx[r]) {
bgsd[bsn] = 2;
if ((py - 50) < bgy[r]) {
bgsd[bsn] = 0;
}
}
bgs[r] = 12;
bgst[bsn] = 1;
bgsx[bsn] = bgx[r];
bgsy[bsn] = bgy[r];
bsn = bsn + 1;
if (bsn > 5) {
bsn = 1;
}
}
}
if (bgd[r] == 1) {
f[r] = 2;
bgy[r] = bgy[r] - 10;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 0;
bgs[r] = 10 + random(25);
}
}
if (bgd[r] == 2) {
f[r] = 3;
bgy[r] = bgy[r] - 10;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 0;
bgs[r] = 10 + random(25);
}
}
if (bgd[r] == 3) {
if (bgs[r] == 3) {
f[r] = 4;
}
if (bgs[r] == 2) {
f[r] = 5;
}
if (bgs[r] == 1) {
f[r] = 6;
}
bgs[r] = bgs[r] - 1;
bgy[r] = bgy[r] - 10;
if (bgs[r] <= 0) {
f[r] = 7;
bgt[r] = 0;
bgx[r] = -500;
bgs[r] = 0;
}
}
}
if (bgt[r] == 8) {
if (((((((bgx[r] - 20) < (px + 10)) and ((bgx[r] + 20) > (px - 10))) and ((bgy[r] + 35) > (py + 10))) and ((bgy[r] + 20) < (py + 50))) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 8;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 8;
}
bgd[r] = 2;
bgs[r] = 10;
baddyd1.start();
i = 10;
}
if (bgd[r] == 0) {
f[r] = 1;
bgx[r] = bgx[r] + 20;
if ((py + 30) > bgy[r]) {
bgy[r] = bgy[r] - 8;
}
if ((py + 30) < bgy[r]) {
bgy[r] = bgy[r] - 12;
}
if ((px + 100) < bgx[r]) {
bgd[r] = 1;
}
}
if (bgd[r] == 1) {
f[r] = 2;
bgx[r] = bgx[r] - 20;
if ((py + 30) > bgy[r]) {
bgy[r] = bgy[r] - 8;
}
if ((py + 30) < bgy[r]) {
bgy[r] = bgy[r] - 12;
}
if ((px - 100) > bgx[r]) {
bgd[r] = 0;
}
}
if (bgd[r] == 2) {
if (bgs[r] == 5) {
f[r] = 3;
}
if (bgs[r] == 4) {
f[r] = 4;
}
if (bgs[r] == 3) {
f[r] = 5;
}
if (bgs[r] == 2) {
f[r] = 6;
}
if (bgs[r] == 1) {
f[r] = 7;
}
bgs[r] = bgs[r] - 1;
bgy[r] = bgy[r] - 10;
if (bgs[r] <= 0) {
bgx[r] = -500;
f[r] = 8;
bgt[r] = 0;
bgs[r] = 0;
}
}
}
if (bgt[r] == 9) {
if (((((((bgx[r] - 30) < (px + 10)) and ((bgx[r] + 30) > (px - 10))) and ((bgy[r] + 55) > (py + 10))) and ((bgy[r] + 20) < (py + 50))) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 5;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 5;
}
megah.start();
i = 10;
}
if (bgd[r] == 0) {
if ((bgs[r] == 1) or (bgs[r] == 2)) {
f[r] = 1;
}
if ((bgs[r] == 3) or (bgs[r] == 4)) {
f[r] = 2;
}
bgx[r] = bgx[r] + 8;
if ((px + 80) < bgx[r]) {
bgd[r] = 1;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgs[r] = 4;
}
}
if (bgd[r] == 1) {
if ((bgs[r] == 1) or (bgs[r] == 2)) {
f[r] = 3;
}
if ((bgs[r] == 3) or (bgs[r] == 4)) {
f[r] = 4;
}
bgx[r] = bgx[r] - 8;
if ((px - 80) > bgx[r]) {
bgd[r] = 0;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgs[r] = 4;
}
}
if (bgd[r] == 2) {
if (bgs[r] == 4) {
f[r] = 5;
}
if (bgs[r] == 3) {
f[r] = 6;
}
if (bgs[r] == 2) {
f[r] = 7;
}
if (bgs[r] == 1) {
f[r] = 8;
}
bgs[r] = bgs[r] - 1;
bgy[r] = bgy[r] - 10;
if (bgs[r] <= 0) {
bgx[r] = -500;
f[r] = 9;
bgt[r] = 0;
bgs[r] = 0;
}
}
}
if (bgt[r] == 10) {
if (((((((bgx[r] - 20) < (px + 10)) and ((bgx[r] + 20) > (px - 10))) and ((bgy[r] + 20) > (py + 10))) and ((bgy[r] + 20) < (py + 50))) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 2;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 2;
}
megah.start();
i = 10;
}
if (bgd[r] == 0) {
f[r] = 1;
bgy[r] = bgy[r] - 10;
if (px < bgx[r]) {
bgx[r] = bgx[r] - 7;
}
if (px > bgx[r]) {
bgx[r] = bgx[r] + 7;
}
if ((py - 80) < bgy[r]) {
bgy[r] = bgy[r] - 8;
}
if ((py - 80) > bgy[r]) {
bgy[r] = bgy[r] + 8;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
joes.start();
bgd[r] = 1;
bgsd[bsn] = 4;
bgs[r] = 5;
bgst[bsn] = 1;
bgsx[bsn] = bgx[r];
bgsy[bsn] = bgy[r];
bsn = bsn + 1;
if (bsn > 5) {
bsn = 1;
}
}
}
if (bgd[r] == 1) {
f[r] = 2;
bgy[r] = bgy[r] - 10;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 0;
bgs[r] = 6 + random(16);
}
}
if (bgd[r] == 2) {
if (bgs[r] == 3) {
f[r] = 3;
}
if (bgs[r] == 2) {
f[r] = 4;
}
if (bgs[r] == 1) {
f[r] = 5;
}
bgs[r] = bgs[r] - 1;
bgy[r] = bgy[r] - 10;
if (bgs[r] <= 0) {
f[r] = 7;
bgt[r] = 0;
bgx[r] = -500;
bgs[r] = 0;
}
}
}
if (bgt[r] == 11) {
if (((((((bgx[r] - 20) < (px + 10)) and ((bgx[r] + 20) > (px - 10))) and ((bgy[r] + 50) > (py - 10))) and (bgy[r] < (py + 50))) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 3;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 3;
}
megah.start();
i = 10;
}
if (bgd[r] == 0) {
if (((bgs[r] == 12) or (bgs[r] == 11)) or (bgs[r] == 10)) {
f[r] = 1;
}
if (((bgs[r] == 9) or (bgs[r] == 8)) or (bgs[r] == 7)) {
f[r] = 2;
}
if (((bgs[r] == 6) or (bgs[r] == 5)) or (bgs[r] == 4)) {
f[r] = 1;
}
if (((bgs[r] == 3) or (bgs[r] == 2)) or (bgs[r] == 1)) {
f[r] = 2;
}
if (bgx[r] > px) {
bgd[r] = 3;
bgs[r] = 12;
}
bgx[r] = bgx[r] + 6;
if (((bgx[r] + 150) > (px - 20)) and (bgx[r] < px)) {
bgd[r] = 1;
bgs[r] = 9;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgs[r] = 12;
}
}
if (bgd[r] == 1) {
f[r] = 3;
bgx[r] = bgx[r] + 12;
bgy[r] = bgy[r] - 20;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 2;
bgs[r] = 10;
}
}
if (bgd[r] == 2) {
f[r] = 3;
bgx[r] = bgx[r] + 12;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 0;
bgs[r] = 12;
}
}
if (bgd[r] == 3) {
if (((bgs[r] == 12) or (bgs[r] == 11)) or (bgs[r] == 10)) {
f[r] = 4;
}
if (((bgs[r] == 9) or (bgs[r] == 8)) or (bgs[r] == 7)) {
f[r] = 5;
}
if (((bgs[r] == 6) or (bgs[r] == 5)) or (bgs[r] == 4)) {
f[r] = 4;
}
if (((bgs[r] == 3) or (bgs[r] == 2)) or (bgs[r] == 1)) {
f[r] = 5;
}
if (bgx[r] < px) {
bgd[r] = 0;
bgs[r] = 12;
}
bgx[r] = bgx[r] - 6;
if (((bgx[r] - 150) < (px - 20)) and (bgx[r] > px)) {
bgd[r] = 4;
bgs[r] = 9;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgs[r] = 12;
}
}
if (bgd[r] == 4) {
f[r] = 6;
bgx[r] = bgx[r] - 12;
bgy[r] = bgy[r] - 20;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 5;
bgs[r] = 10;
}
}
if (bgd[r] == 5) {
f[r] = 6;
bgx[r] = bgx[r] - 12;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 3;
bgs[r] = 12;
}
}
if (bgd[r] == 6) {
if (bgs[r] == 3) {
f[r] = 7;
}
if (bgs[r] == 2) {
f[r] = 8;
}
if (bgs[r] == 1) {
f[r] = 9;
}
bgs[r] = bgs[r] - 1;
bgy[r] = bgy[r] - 10;
if (bgs[r] <= 0) {
f[r] = 15;
bgt[r] = 0;
bgx[r] = -500;
bgs[r] = 0;
}
}
}
if (bgt[r] == 12) {
if (((((((bgx[r] - 20) < (px + 10)) and ((bgx[r] + 20) > (px - 10))) and ((bgy[r] + 40) > py)) and ((bgy[r] - 20) < (py + 50))) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 3;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 3;
}
megah.start();
i = 10;
}
if (bgd[r] == 0) {
if (bgs[r] == 1) {
f[r] = 1;
}
if (bgs[r] == 2) {
f[r] = 2;
}
bgy[r] = bgy[r] - 10;
bgx[r] = bgx[r] + 7;
if ((py - 60) < bgy[r]) {
bgy[r] = bgy[r] - 5;
}
if ((((px - 70) < bgx[r]) and ((px + 70) > bgx[r])) and (py > bgy[r])) {
bgy[r] = bgy[r] + 12;
}
if ((px + 100) < bgx[r]) {
bgd[r] = 1;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgs[r] = 2;
}
}
if (bgd[r] == 1) {
if (bgs[r] == 1) {
f[r] = 3;
}
if (bgs[r] == 2) {
f[r] = 4;
}
bgy[r] = bgy[r] - 10;
bgx[r] = bgx[r] - 7;
if ((py - 60) < bgy[r]) {
bgy[r] = bgy[r] - 5;
}
if ((((px - 70) < bgx[r]) and ((px + 70) > bgx[r])) and (py > bgy[r])) {
bgy[r] = bgy[r] + 12;
}
if ((px - 100) > bgx[r]) {
bgd[r] = 0;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgs[r] = 2;
}
}
if (bgd[r] == 2) {
if (bgs[r] == 4) {
f[r] = 5;
}
if (bgs[r] == 3) {
f[r] = 6;
}
if (bgs[r] == 2) {
f[r] = 7;
}
if (bgs[r] == 1) {
f[r] = 8;
}
bgs[r] = bgs[r] - 1;
bgy[r] = bgy[r] - 10;
if (bgs[r] <= 0) {
bgx[r] = -500;
f[r] = 9;
bgt[r] = 0;
bgs[r] = 0;
}
}
}
if (bgt[r] == 13) {
if (((((((bgx[r] - 50) < (px + 10)) and ((bgx[r] + 50) > (px - 10))) and ((bgy[r] + 70) > (py + 10))) and (bgy[r] < (py + 50))) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 4;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 4;
}
megah.start();
i = 10;
}
if (bgd[r] == 0) {
f[r] = 1;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
if ((px - 170) < bgx[r]) {
bgd[r] = 1;
bgs[r] = 7;
}
}
if (px < bgx[r]) {
bgd[r] = 3;
}
}
if (bgd[r] == 1) {
f[r] = 2;
bgx[r] = bgx[r] + 30;
bgy[r] = bgy[r] - 20;
if (bgy[r] < py) {
bgy[r] = bgy[r] + 10;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 2;
bgs[r] = 12;
}
}
if (bgd[r] == 2) {
f[r] = 3;
bgx[r] = bgx[r] + 5;
bgy[r] = bgy[r] + 2;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 0;
bgs[r] = random(12);
}
}
if (bgd[r] == 3) {
f[r] = 4;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
if ((px + 170) > bgx[r]) {
bgd[r] = 4;
bgs[r] = 7;
}
}
if (px > bgx[r]) {
bgd[r] = 0;
}
}
if (bgd[r] == 4) {
f[r] = 5;
bgx[r] = bgx[r] - 30;
bgy[r] = bgy[r] - 20;
bgs[r] = bgs[r] - 1;
if (bgy[r] < py) {
bgy[r] = bgy[r] + 10;
}
if (bgs[r] <= 0) {
bgd[r] = 5;
bgs[r] = 12;
}
}
if (bgd[r] == 5) {
f[r] = 6;
bgx[r] = bgx[r] - 5;
bgy[r] = bgy[r] + 2;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 3;
bgs[r] = random(12);
}
}
if (bgd[r] == 6) {
if (bgs[r] == 4) {
f[r] = 7;
}
if (bgs[r] == 3) {
f[r] = 8;
}
if (bgs[r] == 2) {
f[r] = 9;
}
if (bgs[r] == 1) {
f[r] = 10;
}
bgs[r] = bgs[r] - 1;
bgy[r] = bgy[r] - 10;
if (bgs[r] <= 0) {
bgx[r] = -500;
f[r] = 11;
bgt[r] = 0;
bgs[r] = 0;
}
}
}
if (bgt[r] == 14) {
if (((((((bgx[r] - 20) < (px + 10)) and ((bgx[r] + 20) > (px - 10))) and ((bgy[r] + 50) > (py + 10))) and ((bgy[r] + 20) < (py + 50))) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 2;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 2;
}
megah.start();
i = 10;
}
if (bgt[r] > 0) {
bgy[r] = bgy[r] - 10;
}
if (bgd[r] == 0) {
f[r] = 1;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 1;
bgs[r] = 6;
}
}
if (bgd[r] == 1) {
if (((bgs[r] == 6) or (bgs[r] == 5)) or (bgs[r] == 4)) {
f[r] = 2;
}
if (((bgs[r] == 3) or (bgs[r] == 2)) or (bgs[r] == 1)) {
f[r] = 3;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 2;
bgs[r] = 15;
}
}
if (bgd[r] == 2) {
f[r] = 4;
if (((bgs[r] == 15) or (bgs[r] == 10)) or (bgs[r] == 5)) {
cannons.start();
bgst[bsn] = 2;
bgsx[bsn] = bgx[r] + 20;
bgsy[bsn] = bgy[r];
bgsd[bsn] = 0;
bsn = bsn + 1;
if (bsn > 5) {
bsn = 1;
}
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 0;
bgs[r] = 20;
}
}
if (bgd[r] == 3) {
f[r] = 5;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 4;
bgs[r] = 6;
}
}
if (bgd[r] == 4) {
if (((bgs[r] == 6) or (bgs[r] == 5)) or (bgs[r] == 4)) {
f[r] = 6;
}
if (((bgs[r] == 3) or (bgs[r] == 2)) or (bgs[r] == 1)) {
f[r] = 7;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 5;
bgs[r] = 15;
}
}
if (bgd[r] == 5) {
f[r] = 8;
if (((bgs[r] == 15) or (bgs[r] == 10)) or (bgs[r] == 5)) {
cannons.start();
bgst[bsn] = 2;
bgsx[bsn] = bgx[r] - 20;
bgsy[bsn] = bgy[r];
bgsd[bsn] = 1;
bsn = bsn + 1;
if (bsn > 5) {
bsn = 1;
}
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 3;
bgs[r] = 20;
}
}
if (bgd[r] == 6) {
if (bgs[r] == 2) {
f[r] = 9;
}
if (bgs[r] == 1) {
f[r] = 10;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
f[r] = 11;
bgt[r] = 0;
bgx[r] = -500;
bgs[r] = 0;
}
}
}
}
r++;
}
r = 1;
while (r <= 5) {
if (bgst[r] > 0) {
if (bgst[r] == 1) {
if (r == 1) {
bgs1.gotoAndStop(1);
}
if (r == 2) {
bgs2.gotoAndStop(1);
}
if (r == 3) {
bgs3.gotoAndStop(1);
}
if (r == 4) {
bgs4.gotoAndStop(1);
}
if (r == 5) {
bgs5.gotoAndStop(1);
}
if (bgsd[r] == 0) {
bgsx[r] = bgsx[r] + 20;
if (bgsx[r] > (px + 300)) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgsd[r] == 1) {
bgsx[r] = bgsx[r] - 20;
if (bgsx[r] < (px - 300)) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgsd[r] == 2) {
bgsx[r] = bgsx[r] + 15;
bgsy[r] = bgsy[r] + 15;
if ((bgsx[r] > (px + 300)) or (bgsy[r] > (py + 300))) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgsd[r] == 3) {
bgsx[r] = bgsx[r] - 15;
bgsy[r] = bgsy[r] + 15;
if ((bgsx[r] > (px + 300)) or (bgsy[r] > (py + 300))) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgsd[r] == 4) {
bgsy[r] = bgsy[r] + 20;
if (bgsy[r] > (py + 300)) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (((((((bgsx[r] - 15) < (px + 10)) and ((bgsx[r] + 15) > (px - 10))) and ((bgsy[r] + 15) > (py + 5))) and ((bgsy[r] - 15) < (py + 20))) and (pcd < 18)) and (i < 1)) {
if ((bgsd[r] == 0) or (bgsd[r] == 2)) {
pcd = 19;
}
if ((bgsd[r] == 1) or (bgsd[r] == 3)) {
pcd = 18;
}
pstep = 2;
pl = pl - 3;
megah.start();
i = 10;
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgst[r] == 2) {
if (r == 1) {
bgs1.gotoAndStop(2);
}
if (r == 2) {
bgs2.gotoAndStop(2);
}
if (r == 3) {
bgs3.gotoAndStop(2);
}
if (r == 4) {
bgs4.gotoAndStop(2);
}
if (r == 5) {
bgs5.gotoAndStop(2);
}
if (bgsd[r] == 0) {
bgsx[r] = bgsx[r] + 30;
if (bgsx[r] > (px + 300)) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgsd[r] == 1) {
bgsx[r] = bgsx[r] - 30;
if (bgsx[r] < (px - 300)) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (((((((bgsx[r] - 25) < (px + 10)) and ((bgsx[r] + 25) > (px - 10))) and ((bgsy[r] + 80) > (py + 40))) and ((bgsy[r] + 35) < (py + 60))) and (pcd < 18)) and (i < 1)) {
if (bgsd[r] == 0) {
pcd = 19;
}
if (bgsd[r] == 1) {
pcd = 18;
}
pstep = 2;
pl = pl - 6;
megah.start();
i = 10;
bgst[r] = 0;
bgsx[r] = -200;
}
}
}
r++;
}
bg1.gotoAndStop(f[1]);
bg2.gotoAndStop(f[2]);
bg3.gotoAndStop(f[3]);
bg4.gotoAndStop(f[4]);
bg5.gotoAndStop(f[5]);
bg6.gotoAndStop(f[6]);
bg7.gotoAndStop(f[7]);
bg8.gotoAndStop(f[8]);
bgs1._x = ((bgsx[1] + 275) - px) / 2;
bgs1._y = ((bgsy[1] + 275) - py) / 2;
bgs2._x = ((bgsx[2] + 275) - px) / 2;
bgs2._y = ((bgsy[2] + 275) - py) / 2;
bgs3._x = ((bgsx[3] + 275) - px) / 2;
bgs3._y = ((bgsy[3] + 275) - py) / 2;
bgs4._x = ((bgsx[4] + 275) - px) / 2;
bgs4._y = ((bgsy[4] + 275) - py) / 2;
bgs5._x = ((bgsx[5] + 275) - px) / 2;
bgs5._y = ((bgsy[5] + 275) - py) / 2;
bg1._x = ((bgx[1] + 275) - px) / 2;
bg1._y = ((bgy[1] + 275) - py) / 2;
bg2._x = ((bgx[2] + 275) - px) / 2;
bg2._y = ((bgy[2] + 275) - py) / 2;
bg3._x = ((bgx[3] + 275) - px) / 2;
bg3._y = ((bgy[3] + 275) - py) / 2;
bg4._x = ((bgx[4] + 275) - px) / 2;
bg4._y = ((bgy[4] + 275) - py) / 2;
bg5._x = ((bgx[5] + 275) - px) / 2;
bg5._y = ((bgy[5] + 275) - py) / 2;
bg6._x = ((bgx[6] + 275) - px) / 2;
bg6._y = ((bgy[6] + 275) - py) / 2;
bg7._x = ((bgx[7] + 275) - px) / 2;
bg7._y = ((bgy[7] + 275) - py) / 2;
bg8._x = ((bgx[8] + 275) - px) / 2;
bg8._y = ((bgy[8] + 275) - py) / 2;
r = 1;
while (r <= 3) {
if (((pst[r] > 0) and (pst[r] < 4)) and (psd[r] == 0)) {
if (r == 1) {
shot1p._x = ((297 + psx[1]) - px) / 2;
shot1p._y = ((270 + psy[1]) - py) / 2;
}
if (r == 2) {
shot2p._x = ((297 + psx[2]) - px) / 2;
shot2p._y = ((270 + psy[2]) - py) / 2;
}
if (r == 3) {
shot3p._x = ((297 + psx[3]) - px) / 2;
shot3p._y = ((270 + psy[3]) - py) / 2;
}
}
if (((pst[r] > 0) and (pst[r] < 4)) and (psd[r] == 1)) {
if (r == 1) {
shot1p._x = ((247 + psx[1]) - px) / 2;
shot1p._y = ((270 + psy[1]) - py) / 2;
}
if (r == 2) {
shot2p._x = ((247 + psx[2]) - px) / 2;
shot2p._y = ((270 + psy[2]) - py) / 2;
}
if (r == 3) {
shot3p._x = ((247 + psx[3]) - px) / 2;
shot3p._y = ((270 + psy[3]) - py) / 2;
}
}
if ((pst[r] == 4) or (pst[r] == 5)) {
if (r == 1) {
shot1p._x = ((272 + psx[1]) - px) / 2;
shot1p._y = ((270 + psy[1]) - py) / 2;
}
if (r == 2) {
shot2p._x = ((272 + psx[2]) - px) / 2;
shot2p._y = ((270 + psy[2]) - py) / 2;
}
if (r == 3) {
shot3p._x = ((272 + psx[3]) - px) / 2;
shot3p._y = ((270 + psy[3]) - py) / 2;
}
}
if (pst[r] == 0) {
if (r == 1) {
shot1p._x = -200;
shot1p._y = (270 + psy[1]) - py;
}
if (r == 2) {
shot2p._x = -200;
shot2p._y = (270 + psy[2]) - py;
}
if (r == 3) {
shot3p._x = -200;
shot3p._y = (270 + psy[3]) - py;
}
}
r++;
}
if (i > 0) {
i = i - 1;
pc._alpha = 50;
}
if (i <= 0) {
i = i - 1;
pc._alpha = 100;
}
if (bcharge > 0) {
charge._alpha = bcharge;
}
lbar._height = 2 * pl;
lbar._y = 120 - (2 * pl);
stage._x = (770 - px) / 2;
stage._y = (175 - py) / 2;
exit._x = ((ex + 275) - px) / 2;
exit._y = ((ey + 275) - py) / 2;
Frame 215
gotoAndPlay (214);
if ((((px + 10) > (ex - 20)) and ((px - 10) < (ex + 20))) and (((py + 30) > (ey - 20)) and (py < (ey + 50)))) {
gotoAndPlay (216);
}
Frame 216
lbar._height = 2 * pl;
lbar._y = 120 - (2 * pl);
stage._x = (275 - px) / 2;
stage._y = (-225 - py) / 2;
exit._x = ((ex + 275) - px) / 2;
exit._y = ((ey + 275) - py) / 2;
Frame 219
psn = 1;
bstep = 0;
pcd = 0;
bcharge = 0;
r = 1;
while (r <= 5) {
psx[r] = -200;
psy[r] = 0;
pst[r] = 0;
psd[r] = 0;
r++;
}
i = 0;
pl = pl + 5;
if (pl > 50) {
pl = 50;
}
px = 950;
py = -525;
r = 0;
while (r <= 26) {
bx[r] = -50;
by[r] = -50;
r++;
}
bx[1] = 1050;
by[1] = -650;
bx[2] = 150;
by[2] = -550;
bx[3] = 650;
by[3] = -550;
bx[4] = 1050;
by[4] = -550;
bx[5] = 150;
by[5] = -450;
bx[6] = 450;
by[6] = -450;
bx[7] = 550;
by[7] = -450;
bx[8] = 750;
by[8] = -450;
bx[9] = 850;
by[9] = -450;
bx[10] = 950;
by[10] = -450;
bx[11] = 150;
by[11] = -350;
bx[12] = 250;
by[12] = -350;
bx[13] = 550;
by[13] = -350;
bx[14] = 150;
by[14] = -250;
bx[15] = 450;
by[15] = -250;
bx[16] = 150;
by[16] = -150;
bx[17] = 550;
by[17] = -150;
bx[18] = 650;
by[18] = -150;
bx[19] = 750;
by[19] = -100;
bx[20] = 250;
by[20] = -50;
bx[21] = 350;
by[21] = 50;
bx[22] = 450;
by[22] = 50;
bx[23] = 550;
by[23] = 100;
bx[24] = 650;
by[24] = 150;
bx[25] = 750;
by[25] = 150;
bsn = 1;
r = 1;
while (r <= 8) {
bgx[r] = -200;
bgy[r] = -200;
bgt[r] = 0;
bgd[r] = -1;
bgs[r] = 0;
r++;
}
r = 1;
while (r <= 5) {
bgsx[r] = -200;
bgsy[r] = 0;
bgst[r] = 0;
bgsd[r] = 0;
r++;
}
r = 1;
while (r <= 8) {
f[r] = 20;
r++;
}
bgt[1] = 1;
bgd[1] = 0;
bgs[1] = 0;
bgl[1] = 3;
bgx[1] = 680;
bgy[1] = -650;
bgt[2] = 2;
bgd[2] = 0;
bgs[2] = 0;
bgl[2] = 3;
bgx[2] = 550;
bgy[2] = -550;
bgt[3] = 2;
bgd[3] = 0;
bgs[3] = 0;
bgl[3] = 3;
bgx[3] = 500;
bgy[3] = -550;
bgt[4] = 3;
bgd[4] = 0;
bgs[4] = 0;
bgl[4] = 5;
bgx[4] = 400;
bgy[4] = -650;
bgt[5] = 14;
bgd[5] = 0;
bgs[5] = 0;
bgl[5] = 3;
bgx[5] = 200;
bgy[5] = -450;
bgt[6] = 14;
bgd[6] = 3;
bgs[6] = 0;
bgl[6] = 3;
bgx[6] = 500;
bgy[6] = -350;
bgt[7] = 3;
bgd[7] = 0;
bgs[7] = 0;
bgl[7] = 5;
bgx[7] = 250;
bgy[7] = -250;
bgt[8] = 2;
bgd[8] = 0;
bgs[8] = 0;
bgl[8] = 3;
bgx[8] = 450;
bgy[8] = -50;
ex = 750;
ey = 50;
Frame 220
b1._x = bx[1] / 10;
b1._y = (by[1] / 10) + 120;
b2._x = bx[2] / 10;
b2._y = (by[2] / 10) + 120;
b3._x = bx[3] / 10;
b3._y = (by[3] / 10) + 120;
b4._x = bx[4] / 10;
b4._y = (by[4] / 10) + 120;
b5._x = bx[5] / 10;
b5._y = (by[5] / 10) + 120;
b6._x = bx[6] / 10;
b6._y = (by[6] / 10) + 120;
b7._x = bx[7] / 10;
b7._y = (by[7] / 10) + 120;
b8._x = bx[8] / 10;
b8._y = (by[8] / 10) + 120;
b9._x = bx[9] / 10;
b9._y = (by[9] / 10) + 120;
b10._x = bx[10] / 10;
b10._y = (by[10] / 10) + 120;
b11._x = bx[11] / 10;
b11._y = (by[11] / 10) + 120;
b12._x = bx[12] / 10;
b12._y = (by[12] / 10) + 120;
b13._x = bx[13] / 10;
b13._y = (by[13] / 10) + 120;
b14._x = bx[14] / 10;
b14._y = (by[14] / 10) + 120;
b15._x = bx[15] / 10;
b15._y = (by[15] / 10) + 120;
b16._x = bx[16] / 10;
b16._y = (by[16] / 10) + 120;
b17._x = bx[17] / 10;
b17._y = (by[17] / 10) + 120;
b18._x = bx[18] / 10;
b18._y = (by[18] / 10) + 120;
b19._x = bx[19] / 10;
b19._y = (by[19] / 10) + 120;
b20._x = bx[20] / 10;
b20._y = (by[20] / 10) + 120;
b21._x = bx[21] / 10;
b21._y = (by[21] / 10) + 120;
b22._x = bx[22] / 10;
b22._y = (by[22] / 10) + 120;
b23._x = bx[23] / 10;
b23._y = (by[23] / 10) + 120;
b24._x = bx[24] / 10;
b24._y = (by[24] / 10) + 120;
b25._x = bx[25] / 10;
b25._y = (by[25] / 10) + 120;
b26._x = bx[26] / 10;
b26._y = (by[26] / 10) + 120;
b27._x = bx[27] / 10;
b27._y = (by[27] / 10) + 120;
b28._x = bx[28] / 10;
b28._y = (by[28] / 10) + 120;
cir._x = px / 10;
cir._y = (py / 10) + 120;
shot1._x = psx[1] / 10;
shot1._y = (psy[1] / 10) + 120;
shot2._x = psx[2] / 10;
shot2._y = (psy[2] / 10) + 120;
shot3._x = psx[3] / 10;
shot3._y = (psy[3] / 10) + 120;
bshot1._x = bgsx[1] / 10;
bshot1._y = (bgsy[1] / 10) + 120;
bshot2._x = bgsx[2] / 10;
bshot2._y = (bgsy[2] / 10) + 120;
bshot3._x = bgsx[3] / 10;
bshot3._y = (bgsy[3] / 10) + 120;
bshot4._x = bgsx[4] / 10;
bshot4._y = (bgsy[4] / 10) + 120;
bshot5._x = bgsx[5] / 10;
bshot5._y = (bgsy[5] / 10) + 120;
bcir1._x = bgx[1] / 10;
bcir1._y = (bgy[1] / 10) + 120;
bcir2._x = bgx[2] / 10;
bcir2._y = (bgy[2] / 10) + 120;
bcir3._x = bgx[3] / 10;
bcir3._y = (bgy[3] / 10) + 120;
bcir4._x = bgx[4] / 10;
bcir4._y = (bgy[4] / 10) + 120;
bcir5._x = bgx[5] / 10;
bcir5._y = (bgy[5] / 10) + 120;
bcir6._x = bgx[6] / 10;
bcir6._y = (bgy[6] / 10) + 120;
bcir7._x = bgx[7] / 10;
bcir7._y = (bgy[7] / 10) + 120;
bcir8._x = bgx[8] / 10;
bcir8._y = (bgy[8] / 10) + 120;
bcir9._x = bgx[9] / 10;
bcir9._y = (bgy[9] / 10) + 120;
bcir10._x = bgx[10] / 10;
bcir10._y = (bgy[10] / 10) + 120;
bcir11._x = bgx[11] / 10;
bcir11._y = (bgy[11] / 10) + 120;
bcir12._x = bgx[12] / 10;
bcir12._y = (bgy[12] / 10) + 120;
bcir13._x = bgx[13] / 10;
bcir13._y = (bgy[13] / 10) + 120;
if (Key.isDown(39) and (pcd == 0)) {
pcd = 2;
}
if (Key.isDown(39) and ((pcd == 1) or (pcd == 3))) {
pcd = 0;
}
if (Key.isDown(37) and (pcd == 1)) {
pcd = 3;
}
if (Key.isDown(37) and ((pcd == 0) or (pcd == 2))) {
pcd = 1;
}
if (Key.isDown(38) and ((pcd == 0) or (pcd == 2))) {
pcd = 10;
pstep = 7;
}
if (Key.isDown(38) and ((pcd == 1) or (pcd == 3))) {
pcd = 11;
pstep = 7;
}
if (Key.isDown(40) and ((((pcd == 0) or (pcd == 1)) or (pcd == 2)) or (pcd == 3))) {
if (((pcd == 0) or (pcd == 2)) or (pcd == 8)) {
pcd = 6;
pstep = 3;
}
if (((pcd == 1) or (pcd == 3)) or (pcd == 9)) {
pcd = 7;
pstep = 3;
}
}
if (Key.isDown(16) and (bcharge < 100)) {
bcharge = bcharge + 5;
}
if (pcd == 0) {
pc.gotoAndStop(1);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(21);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 0;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
}
if (pcd == 1) {
pc.gotoAndStop(2);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(22);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 1;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
}
if (pcd == 2) {
px = px + 13;
if ((w == 0) or (w == 1)) {
pc.gotoAndStop(3);
}
if ((w == 2) or (w == 3)) {
pc.gotoAndStop(4);
}
if ((w == 4) or (w == 5)) {
pc.gotoAndStop(5);
}
if ((w == 6) or (w == 7)) {
pc.gotoAndStop(6);
}
if (Key.isDown(32)) {
if ((w == 0) or (w == 1)) {
pc.gotoAndStop(11);
}
if ((w == 2) or (w == 3)) {
pc.gotoAndStop(12);
}
if ((w == 4) or (w == 5)) {
pc.gotoAndStop(13);
}
if ((w == 6) or (w == 7)) {
pc.gotoAndStop(14);
}
if ((pst[psn] == 0) and (bstep == 0)) {
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 0;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
}
pcd = 0;
}
if (pcd == 3) {
px = px - 13;
if ((w == 0) or (w == 1)) {
pc.gotoAndStop(7);
}
if ((w == 2) or (w == 3)) {
pc.gotoAndStop(8);
}
if ((w == 4) or (w == 5)) {
pc.gotoAndStop(9);
}
if ((w == 6) or (w == 7)) {
pc.gotoAndStop(10);
}
if (Key.isDown(32)) {
if ((w == 0) or (w == 1)) {
pc.gotoAndStop(15);
}
if ((w == 2) or (w == 3)) {
pc.gotoAndStop(16);
}
if ((w == 4) or (w == 5)) {
pc.gotoAndStop(17);
}
if ((w == 6) or (w == 7)) {
pc.gotoAndStop(18);
}
if ((pst[psn] == 0) and (bstep == 0)) {
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 1;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
}
pcd = 1;
}
if (pcd == 9) {
pstep = pstep - 1;
if (pstep <= 0) {
pcd = 1;
}
}
if (pcd == 6) {
pc.gotoAndStop(19);
px = px + 20;
pstep = pstep - 1;
if (pstep <= 0) {
pcd = 0;
}
}
if (pcd == 7) {
pc.gotoAndStop(20);
px = px - 20;
pstep = pstep - 1;
if (pstep <= 0) {
pcd = 1;
}
}
if (pcd == 12) {
pc.gotoAndStop(23);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(25);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 0;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
py = py + (5 * (7 - pstep));
pstep = pstep - 1;
if (pstep <= 2) {
pstep = 2;
}
if (Key.isDown(39)) {
px = px + 13;
}
if (Key.isDown(37)) {
px = px - 13;
if (bstep == 0) {
pcd = 13;
}
}
}
if (pcd == 13) {
pc.gotoAndStop(24);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(26);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 1;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
py = py + (5 * (7 - pstep));
pstep = pstep - 1;
if (pstep <= 2) {
pstep = 2;
}
if (Key.isDown(39)) {
px = px + 13;
if (bstep == 0) {
pcd = 12;
}
}
if (Key.isDown(37)) {
px = px - 13;
}
}
if (pcd == 10) {
pc.gotoAndStop(23);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(25);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 0;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
py = py - (5 * pstep);
pstep = pstep - 1;
if (Key.isDown(39)) {
px = px + 13;
}
if (Key.isDown(37)) {
px = px - 13;
if (bstep == 0) {
pcd = 11;
}
}
if (Key.isDown(40)) {
pcd = 12;
pstep = pstep + 3;
}
if (pstep <= -1) {
pstep = 7;
pcd = 12;
}
}
if (pcd == 11) {
pc.gotoAndStop(24);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(26);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 1;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
py = py - (5 * pstep);
pstep = pstep - 1;
if (Key.isDown(39)) {
px = px + 13;
if (bstep == 0) {
pcd = 10;
}
}
if (Key.isDown(37)) {
px = px - 13;
}
if (Key.isDown(40)) {
pcd = 13;
pstep = pstep + 3;
}
if (pstep <= -1) {
pstep = 7;
pcd = 13;
}
}
if (pcd == 18) {
pc.gotoAndStop(27);
pstep = pstep - 1;
px = px - 5;
if (pstep <= -1) {
pstep = 2;
pcd = 0;
}
}
if (pcd == 19) {
pc.gotoAndStop(28);
pstep = pstep - 1;
px = px + 5;
if (pstep <= -1) {
pstep = 2;
pcd = 1;
}
}
if (pcd == 20) {
pc.gotoAndStop(69 - pstep);
bcharge = 0;
charge._alpha = 0;
bstep = 20;
pl = 1;
pstep = pstep - 1;
if (pstep < 0) {
lives = lives - 1;
if (lives >= 0) {
pl = 50;
gotoAndPlay (190);
}
if (lives < 0) {
lives = 2;
continues = continues - 1;
gotoAndPlay (5);
}
}
}
if (pl <= 0) {
c = 1;
while (c <= 8) {
bgx[c] = -600;
c++;
}
pc._alpha = 100;
pcd = 20;
pstep = 40;
megad.start();
}
if (bstep > 0) {
bcharge = 0;
charge._alpha = bcharge;
}
if (bstep > 0) {
bstep = bstep - 1;
}
if ((py > 500) and (pcd < 20)) {
megad.start();
pl = 0;
}
w = w - 1;
if (w < 0) {
w = 7;
}
e = pcd;
c = 0;
r = 1;
while (r <= 12) {
if (((((bx[r] - 150) < px) and ((bx[r] + 150) > px)) and ((by[r] - 150) < py)) and ((by[r] + 150) > py)) {
if (((((((px - 30) < (bx[r] + 50)) and ((px + 20) > (bx[r] - 50))) and (py < (by[r] - 50))) and ((py + 60) > (by[r] - 50))) and (pcd != 10)) and (pcd != 11)) {
if ((((pcd == 12) or (pcd == 13)) or (pcd == 16)) or (pcd == 17)) {
if ((pcd == 12) or (pcd == 16)) {
pcd = 0;
}
if ((pcd == 13) or (pcd == 17)) {
pcd = 1;
}
}
c = 1;
py = by[r] - 75;
}
if (((((px + 38) > (bx[r] - 50)) and ((px + 20) < bx[r])) and (py < (by[r] + 50))) and ((py + 20) > (by[r] - 50))) {
px = bx[r] - 85;
}
if (((((px - 35) < (bx[r] + 50)) and ((px - 20) > bx[r])) and (py < (by[r] + 50))) and ((py + 20) > (by[r] - 50))) {
px = bx[r] + 85;
}
if (((((px - 5) < (bx[r] + 50)) and ((px + 5) > (bx[r] - 50))) and ((py - 30) < (by[r] + 50))) and ((py + 10) > (by[r] + 50))) {
if ((((pcd == 10) or (pcd == 11)) or (pcd == 14)) or (pcd == 15)) {
if ((pcd == 10) or (pcd == 14)) {
pcd = 12;
pstep = 5;
}
if ((pcd == 11) or (pcd == 15)) {
pcd = 13;
pstep = 5;
}
}
py = by[r] + 90;
}
}
r++;
}
if (c == 0) {
if ((((pcd == 0) or (pcd == 2)) or (pcd == 6)) or (pcd == 18)) {
pcd = 12;
pstep = 6;
}
if ((((pcd == 1) or (pcd == 3)) or (pcd == 7)) or (pcd == 19)) {
pcd = 13;
pstep = 6;
}
}
r = 1;
while (r <= 3) {
if (pst[r] == 1) {
if (psd[r] == 0) {
psx[r] = psx[r] + 30;
if (r == 1) {
shot1p.gotoAndStop(1);
}
if (r == 2) {
shot2p.gotoAndStop(1);
}
if (r == 3) {
shot3p.gotoAndStop(1);
}
if (psx[r] > (px + 280)) {
pst[r] = 0;
psx[r] = -200;
}
}
if (psd[r] == 1) {
psx[r] = psx[r] - 30;
if (r == 1) {
shot1p.gotoAndStop(2);
}
if (r == 2) {
shot2p.gotoAndStop(2);
}
if (r == 3) {
shot3p.gotoAndStop(2);
}
if (psx[r] < (px - 280)) {
pst[r] = 0;
psx[r] = -200;
}
}
}
if (pst[r] == 2) {
if (psd[r] == 0) {
psx[r] = psx[r] + 35;
if (r == 1) {
shot1p.gotoAndStop(3);
}
if (r == 2) {
shot2p.gotoAndStop(3);
}
if (r == 3) {
shot3p.gotoAndStop(3);
}
if (psx[r] > (px + 280)) {
pst[r] = 0;
psx[r] = -200;
}
}
if (psd[r] == 1) {
psx[r] = psx[r] - 35;
if (r == 1) {
shot1p.gotoAndStop(4);
}
if (r == 2) {
shot2p.gotoAndStop(4);
}
if (r == 3) {
shot3p.gotoAndStop(4);
}
if (psx[r] < (px - 280)) {
pst[r] = 0;
psx[r] = -200;
}
}
}
if (pst[r] == 3) {
if (psd[r] == 0) {
psx[r] = psx[r] + 40;
if (r == 1) {
shot1p.gotoAndStop(5);
}
if (r == 2) {
shot2p.gotoAndStop(5);
}
if (r == 3) {
shot3p.gotoAndStop(5);
}
if (psx[r] > (px + 280)) {
pst[r] = 0;
psx[r] = -200;
}
}
if (psd[r] == 1) {
psx[r] = psx[r] - 40;
if (r == 1) {
shot1p.gotoAndStop(6);
}
if (r == 2) {
shot2p.gotoAndStop(6);
}
if (r == 3) {
shot3p.gotoAndStop(6);
}
if (psx[r] < (px - 280)) {
pst[r] = 0;
psx[r] = -200;
}
}
}
if (pst[r] == 4) {
if (r == 1) {
shot1p.gotoAndStop(10 - psd[r]);
}
if (r == 2) {
shot2p.gotoAndStop(10 - psd[r]);
}
if (r == 3) {
shot3p.gotoAndStop(10 - psd[r]);
}
psd[r] = psd[r] - 1;
if (psd[r] < 0) {
pst[r] = 0;
psx[r] = -200;
}
}
if (pst[r] == 5) {
if (r == 1) {
shot1p.gotoAndStop(14 - psd[r]);
}
if (r == 2) {
shot2p.gotoAndStop(14 - psd[r]);
}
if (r == 3) {
shot3p.gotoAndStop(14 - psd[r]);
}
psd[r] = psd[r] - 1;
if (psd[r] < 0) {
pst[r] = 0;
psx[r] = -200;
}
}
r++;
}
while (c <= 8) {
r = 1;
while (r <= 3) {
if ((pst[r] > 0) and (pst[r] < 4)) {
if (((((bgt[c] == 1) and ((bgx[c] - 35) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 35) > (psx[r] - ((pst[r] * 20) - 20)))) and ((bgy[c] - 5) < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 50) > (psy[r] - ((pst[r] * 20) - 20)))) {
if ((bgd[c] == 0) or (bgd[c] == 2)) {
deflect.start();
pst[r] = 5;
psd[r] = 2;
}
if ((bgd[c] == 1) or (bgd[c] == 3)) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd2.start();
bgd[c] = 4;
bgs[c] = 4;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
if (((((bgt[c] == 2) and ((bgx[c] - 35) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 35) > (psx[r] - ((pst[r] * 20) - 20)))) and (bgy[c] < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 50) > (psy[r] - ((pst[r] * 20) - 20)))) {
if ((((bgd[c] == 0) or (bgd[c] == 3)) or (bgd[c] == 1)) or (bgd[c] == 4)) {
deflect.start();
pst[r] = 5;
psd[r] = 2;
}
if ((bgd[c] == 2) or (bgd[c] == 5)) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd2.start();
bgd[c] = 6;
bgs[c] = 6;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
if (((((bgt[c] == 3) and ((bgx[c] - 35) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 35) > (psx[r] - ((pst[r] * 20) - 20)))) and ((bgy[c] - 20) < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 40) > (psy[r] - ((pst[r] * 20) - 20)))) {
if (bgd[c] == 0) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd2.start();
bgd[c] = 1;
bgs[c] = 4;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
if (((((bgt[c] == 4) and ((bgx[c] - 40) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 40) > (psx[r] - ((pst[r] * 20) - 20)))) and ((bgy[c] - 20) < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 50) > (psy[r] - ((pst[r] * 20) - 20)))) {
if ((bgd[c] == 0) or (bgd[c] == 2)) {
deflect.start();
pst[r] = 5;
psd[r] = 2;
}
if ((bgd[c] == 1) or (bgd[c] == 3)) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd1.start();
bgd[c] = 4;
bgs[c] = 4;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
if (((((bgt[c] == 5) and ((bgx[c] - 40) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 40) > (psx[r] - ((pst[r] * 20) - 20)))) and ((bgy[c] - 20) < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 50) > (psy[r] - ((pst[r] * 20) - 20)))) {
if ((((bgd[c] == 0) or (bgd[c] == 1)) or (bgd[c] == 2)) or (bgd[c] == 3)) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd1.start();
bgd[c] = 4;
bgs[c] = 5;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
if (((((bgt[c] == 6) and ((bgx[c] - 35) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 35) > (psx[r] - ((pst[r] * 20) - 20)))) and ((bgy[c] - 50) < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 20) > (psy[r] - ((pst[r] * 20) - 20)))) {
if ((bgd[c] == 0) or (bgd[c] == 1)) {
deflect.start();
pst[r] = 5;
psd[r] = 2;
}
if (bgd[c] == 2) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd2.start();
bgd[c] = 3;
bgs[c] = 4;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
if (((((bgt[c] == 7) and ((bgx[c] - 35) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 35) > (psx[r] - ((pst[r] * 20) - 20)))) and ((bgy[c] - 50) < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 20) > (psy[r] - ((pst[r] * 20) - 20)))) {
if (bgd[c] == 0) {
deflect.start();
pst[r] = 5;
psd[r] = 2;
}
if ((bgd[c] == 2) or (bgd[c] == 1)) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd2.start();
bgd[c] = 3;
bgs[c] = 3;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
if (((((bgt[c] == 8) and ((bgx[c] - 35) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 35) > (psx[r] - ((pst[r] * 20) - 20)))) and ((bgy[c] - 50) < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 20) > (psy[r] - ((pst[r] * 20) - 20)))) {
if ((bgd[c] == 0) or (bgd[c] == 1)) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd1.start();
bgd[c] = 2;
bgs[c] = 5;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
if (((((bgt[c] == 9) and ((bgx[c] - 40) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 40) > (psx[r] - ((pst[r] * 20) - 20)))) and ((bgy[c] - 20) < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 50) > (psy[r] - ((pst[r] * 20) - 20)))) {
if ((bgd[c] == 0) and (px > bgx[c])) {
deflect.start();
pst[r] = 5;
psd[r] = 2;
}
if ((bgd[c] == 1) and (px < bgx[c])) {
deflect.start();
pst[r] = 5;
psd[r] = 2;
}
if ((bgd[c] == 0) and (px < bgx[c])) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd1.start();
bgd[c] = 4;
bgs[c] = 4;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
if ((bgd[c] == 1) and (px > bgx[c])) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd1.start();
bgd[c] = 2;
bgs[c] = 4;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
if (((((bgt[c] == 10) and ((bgx[c] - 20) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 20) > (psx[r] - ((pst[r] * 20) - 20)))) and ((bgy[c] - 50) < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 20) > (psy[r] - ((pst[r] * 20) - 20)))) {
if ((bgd[c] == 0) or (bgd[c] == 1)) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd2.start();
bgd[c] = 2;
bgs[c] = 3;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
if (((((bgt[c] == 11) and ((bgx[c] - 25) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 25) > (psx[r] - ((pst[r] * 20) - 20)))) and (bgy[c] < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 50) > (psy[r] - ((pst[r] * 20) - 20)))) {
if ((((((bgd[c] == 0) or (bgd[c] == 1)) or (bgd[c] == 2)) or (bgd[c] == 3)) or (bgd[c] == 4)) or (bgd[c] == 5)) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd2.start();
bgd[c] = 6;
bgs[c] = 3;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
if (((((bgt[c] == 12) and ((bgx[c] - 25) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 25) > (psx[r] - ((pst[r] * 20) - 20)))) and (bgy[c] < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 50) > (psy[r] - ((pst[r] * 20) - 20)))) {
if ((bgd[c] == 0) or (bgd[c] == 1)) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd2.start();
bgd[c] = 2;
bgs[c] = 3;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
if (((((bgt[c] == 13) and ((bgx[c] - 35) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 35) > (psx[r] - ((pst[r] * 20) - 20)))) and (bgy[c] < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 60) > (psy[r] - ((pst[r] * 20) - 20)))) {
if ((((((bgd[c] == 0) or (bgd[c] == 1)) or (bgd[c] == 2)) or (bgd[c] == 3)) or (bgd[c] == 4)) or (bgd[c] == 5)) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd1.start();
bgd[c] = 6;
bgs[c] = 4;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
if (((((bgt[c] == 14) and ((bgx[c] - 20) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 20) > (psx[r] - ((pst[r] * 20) - 20)))) and ((bgy[c] - 20) < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 20) > (psy[r] - ((pst[r] * 20) - 20)))) {
if ((((bgd[c] == 0) or (bgd[c] == 1)) or (bgd[c] == 3)) or (bgd[c] == 4)) {
deflect.start();
pst[r] = 5;
psd[r] = 2;
}
if ((bgd[c] == 2) or (bgd[c] == 5)) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd2.start();
bgd[c] = 6;
bgs[c] = 3;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
}
r++;
}
c++;
}
r = 1;
while (r <= 8) {
if (((((bgt[r] > 0) and ((bgx[r] - 340) < px)) and ((bgx[r] + 340) > px)) and ((bgy[r] - 180) < py)) and ((bgy[r] + 350) > py)) {
c = 0;
e = 1;
while (e <= 26) {
if (((((bx[e] - 150) < bgx[r]) and ((bx[e] + 150) > bgx[r])) and ((by[e] - 150) < bgy[r])) and ((by[e] + 150) > bgy[r])) {
if (((((bgx[r] + 20) >= (bx[e] - 50)) and ((bgx[r] - 20) <= (bx[e] + 50))) and ((bgy[r] + 45) > (by[e] - 60))) and ((bgy[r] - 10) < (by[e] - 40))) {
c = 1;
}
if (((((bgx[r] + 20) > (bx[e] - 50)) and ((bgx[r] + 20) < bx[e])) and (bgy[r] < (by[e] + 50))) and ((bgy[r] + 20) > (by[e] - 50))) {
bgx[r] = bx[e] - 70;
}
if (((((bgx[r] - 20) < (bx[e] + 50)) and ((bgx[r] + 20) > bx[e])) and (bgy[r] < (by[e] + 50))) and ((bgy[r] + 20) > (by[e] - 50))) {
bgx[r] = bx[e] + 70;
}
if (((((bgx[r] - 5) < (bx[e] + 50)) and ((bgx[r] + 5) > (bx[e] - 50))) and ((bgy[r] - 30) < (by[e] + 50))) and (bgy[r] > (by[e] + 50))) {
bgy[r] = by[e] + 70;
}
if (((((bgx[r] - 2) < (bx[e] + 50)) and ((bgx[r] + 2) > (bx[e] - 50))) and ((bgy[r] + 20) < (by[e] - 50))) and ((bgy[r] + 60) > (by[e] - 50))) {
c = 1;
bgy[r] = by[e] - 105;
}
}
e++;
}
if (c == 0) {
bgy[r] = bgy[r] + 10;
}
if (bgt[r] == 1) {
if (((((((bgx[r] - 10) < (px + 10)) and ((bgx[r] + 10) > (px - 10))) and ((bgy[r] + 80) > (py + 10))) and ((bgy[r] + 50) < (py + 50))) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 4;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 4;
}
megah.start();
i = 10;
}
if (bgd[r] == 0) {
f[r] = 1;
if (px < bgx[r]) {
bgd[r] = 2;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
joes.start();
bgd[r] = 1;
bgs[r] = 7;
bgst[bsn] = 1;
bgsx[bsn] = bgx[r] - 10;
bgsy[bsn] = bgy[r] + 30;
bgsd[bsn] = 0;
bsn = bsn + 1;
if (bsn > 5) {
bsn = 1;
}
}
}
if (bgd[r] == 2) {
f[r] = 3;
if (px > bgx[r]) {
bgd[r] = 0;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
joes.start();
bgd[r] = 3;
bgs[r] = 7;
bgst[bsn] = 1;
bgsx[bsn] = bgx[r] + 10;
bgsy[bsn] = bgy[r] + 30;
bgsd[bsn] = 1;
bsn = bsn + 1;
if (bsn > 5) {
bsn = 1;
}
}
}
if (bgd[r] == 1) {
f[r] = 2;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 0;
bgs[r] = 20;
}
}
if (bgd[r] == 3) {
f[r] = 4;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 2;
bgs[r] = 20;
}
}
if (bgd[r] == 4) {
if (bgs[r] == 4) {
f[r] = 5;
}
if (bgs[r] == 3) {
f[r] = 6;
}
if (bgs[r] == 2) {
f[r] = 7;
}
if (bgs[r] == 1) {
f[r] = 8;
}
bgy[r] = bgy[r] - 10;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
f[r] = 9;
bgt[r] = 0;
bgx[r] = -500;
bgs[r] = 0;
}
}
}
if (bgt[r] == 2) {
if (((((((bgx[r] - 15) < (px + 10)) and ((bgx[r] + 15) > (px - 10))) and ((bgy[r] + 80) > (py - 10))) and ((bgy[r] + 50) < (py + 50))) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 3;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 3;
}
megah.start();
i = 10;
}
if (bgd[r] == 0) {
f[r] = 1;
if (px < bgx[r]) {
bgd[r] = 3;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 1;
bgs[r] = 10;
}
}
if (bgd[r] == 3) {
f[r] = 5;
if (px > bgx[r]) {
bgd[r] = 0;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 4;
bgs[r] = 10;
}
}
if (bgd[r] == 1) {
f[r] = 2;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 2;
bgs[r] = 12;
}
}
if (bgd[r] == 2) {
if (((bgs[r] == 12) or (bgs[r] == 11)) or (bgs[r] == 10)) {
f[r] = 3;
}
if (((bgs[r] == 9) or (bgs[r] == 8)) or (bgs[r] == 7)) {
f[r] = 4;
}
if (((bgs[r] == 6) or (bgs[r] == 5)) or (bgs[r] == 4)) {
f[r] = 3;
}
if (((bgs[r] == 3) or (bgs[r] == 2)) or (bgs[r] == 1)) {
f[r] = 4;
}
bgx[r] = bgx[r] + 8;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 0;
bgs[r] = 10 + random(20);
}
}
if (bgd[r] == 4) {
f[r] = 6;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 5;
bgs[r] = 12;
}
}
if (bgd[r] == 5) {
if (((bgs[r] == 12) or (bgs[r] == 11)) or (bgs[r] == 10)) {
f[r] = 7;
}
if (((bgs[r] == 9) or (bgs[r] == 8)) or (bgs[r] == 7)) {
f[r] = 8;
}
if (((bgs[r] == 6) or (bgs[r] == 5)) or (bgs[r] == 4)) {
f[r] = 7;
}
if (((bgs[r] == 3) or (bgs[r] == 2)) or (bgs[r] == 1)) {
f[r] = 8;
}
bgx[r] = bgx[r] - 8;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 3;
bgs[r] = 10 + random(20);
}
}
if (bgd[r] == 6) {
if (bgs[r] == 6) {
f[r] = 9;
}
if (bgs[r] == 5) {
f[r] = 10;
}
if (bgs[r] == 4) {
f[r] = 11;
}
if (bgs[r] == 3) {
f[r] = 12;
}
if (bgs[r] == 2) {
f[r] = 13;
}
if (bgs[r] == 1) {
f[r] = 14;
}
bgs[r] = bgs[r] - 1;
bgy[r] = bgy[r] - 10;
if (bgs[r] <= 0) {
f[r] = 15;
bgt[r] = 0;
bgx[r] = -500;
bgs[r] = 0;
}
}
}
if (bgt[r] == 3) {
if ((((((((bgx[r] - 20) < (px + 10)) and ((bgx[r] + 20) > (px - 10))) and ((bgy[r] + 60) > (py + 5))) and ((bgy[r] + 40) < (py + 45))) and (pcd < 18)) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 4;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 4;
}
megah.start();
i = 10;
}
if (bgd[r] == 0) {
if ((bgs[r] == 0) or (bgs[r] == 1)) {
f[r] = 1;
}
if ((bgs[r] == 2) or (bgs[r] == 3)) {
f[r] = 2;
}
if ((bgs[r] == 4) or (bgs[r] == 5)) {
f[r] = 3;
}
if ((bgs[r] == 6) or (bgs[r] == 7)) {
f[r] = 4;
}
if ((bgs[r] == 8) or (bgs[r] == 9)) {
f[r] = 5;
}
if ((bgs[r] == 10) or (bgs[r] == 11)) {
f[r] = 6;
}
if (px < bgx[r]) {
bgx[r] = bgx[r] - 5;
}
if (px > bgx[r]) {
bgx[r] = bgx[r] + 5;
}
if ((py - 20) > bgy[r]) {
bgy[r] = bgy[r] - 5;
}
if ((py - 20) < bgy[r]) {
bgy[r] = bgy[r] - 15;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgs[r] = 11;
}
}
if (bgd[r] == 1) {
if (bgs[r] == 4) {
f[r] = 7;
}
if (bgs[r] == 3) {
f[r] = 8;
}
if (bgs[r] == 2) {
f[r] = 9;
}
if (bgs[r] == 1) {
f[r] = 10;
}
bgs[r] = bgs[r] - 1;
bgy[r] = bgy[r] - 10;
if (bgs[r] <= 0) {
bgx[r] = -500;
f[r] = 11;
bgt[r] = 0;
bgs[r] = 0;
}
}
}
if (bgt[r] == 4) {
if (((((((bgx[r] - 20) < (px + 10)) and ((bgx[r] + 20) > (px - 10))) and ((bgy[r] + 80) > (py + 10))) and ((bgy[r] + 30) < (py + 50))) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 4;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 4;
}
megah.start();
i = 10;
}
if (bgd[r] == 0) {
f[r] = 1;
if ((px - 180) < bgx[r]) {
bgd[r] = 1;
bgs[r] = 4;
}
if (px < bgx[r]) {
bgd[r] = 2;
}
}
if (bgd[r] == 2) {
f[r] = 4;
if ((px + 180) > bgx[r]) {
bgd[r] = 3;
bgs[r] = 4;
}
if (px > bgx[r]) {
bgd[r] = 0;
}
}
if (bgd[r] == 1) {
if ((bgs[r] == 1) or (bgs[r] == 2)) {
f[r] = 2;
}
if ((bgs[r] == 3) or (bgs[r] == 4)) {
f[r] = 3;
}
bgx[r] = bgx[r] + 12;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgs[r] = 4;
}
}
if (bgd[r] == 3) {
if ((bgs[r] == 1) or (bgs[r] == 2)) {
f[r] = 5;
}
if ((bgs[r] == 3) or (bgs[r] == 4)) {
f[r] = 6;
}
bgx[r] = bgx[r] - 12;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgs[r] = 4;
}
}
if (bgd[r] == 4) {
if (bgs[r] == 4) {
f[r] = 7;
}
if (bgs[r] == 3) {
f[r] = 8;
}
if (bgs[r] == 2) {
f[r] = 9;
}
if (bgs[r] == 1) {
f[r] = 10;
}
bgs[r] = bgs[r] - 1;
bgy[r] = bgy[r] - 10;
if (bgs[r] <= 0) {
bgx[r] = -500;
f[r] = 11;
bgt[r] = 0;
bgs[r] = 0;
}
}
}
if (bgt[r] == 5) {
if (((((((bgx[r] - 20) < (px + 10)) and ((bgx[r] + 20) > (px - 10))) and ((bgy[r] + 80) > (py + 10))) and ((bgy[r] + 30) < (py + 50))) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 3;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 3;
}
megah.start();
i = 10;
}
if (bgd[r] == 0) {
f[r] = 1;
if (px < bgx[r]) {
bgd[r] = 2;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
cannons.start();
bgd[r] = 1;
bgs[r] = 8;
bgst[bsn] = 2;
bgsx[bsn] = bgx[r] - 20;
bgsy[bsn] = bgy[r] + 20;
bgsd[bsn] = 0;
bsn = bsn + 1;
if (bsn > 5) {
bsn = 1;
}
}
}
if (bgd[r] == 2) {
f[r] = 3;
if (px > bgx[r]) {
bgd[r] = 0;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
cannons.start();
bgd[r] = 3;
bgs[r] = 7;
bgst[bsn] = 2;
bgsx[bsn] = bgx[r] + 20;
bgsy[bsn] = bgy[r] + 20;
bgsd[bsn] = 1;
bsn = bsn + 1;
if (bsn > 5) {
bsn = 1;
}
}
}
if (bgd[r] == 1) {
f[r] = 2;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 0;
bgs[r] = 10 + random(15);
}
}
if (bgd[r] == 3) {
f[r] = 4;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 2;
bgs[r] = 10 + random(15);
}
}
if (bgd[r] == 4) {
if (bgs[r] == 5) {
f[r] = 5;
}
if (bgs[r] == 4) {
f[r] = 6;
}
if (bgs[r] == 3) {
f[r] = 7;
}
if (bgs[r] == 2) {
f[r] = 8;
}
if (bgs[r] == 1) {
f[r] = 9;
}
bgs[r] = bgs[r] - 1;
bgy[r] = bgy[r] - 10;
if (bgs[r] <= 0) {
f[r] = 10;
bgt[r] = 0;
bgx[r] = -500;
bgs[r] = 0;
}
}
}
if (bgt[r] == 6) {
if (((((((bgx[r] - 10) < (px + 10)) and ((bgx[r] + 10) > (px - 10))) and ((bgy[r] + 50) > (py + 10))) and ((bgy[r] + 10) < (py + 50))) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 4;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 4;
}
megah.start();
i = 10;
}
if (bgd[r] == 0) {
f[r] = 1;
bgy[r] = bgy[r] - 10;
if (((((px - 120) < bgx[r]) and ((px + 120) > bgx[r])) and ((bgy[r] - 80) < py)) and ((bgy[r] + 150) > py)) {
bgd[r] = 1;
bgs[r] = 6;
}
}
if (bgd[r] == 1) {
bgy[r] = bgy[r] - 10;
if (((bgs[r] == 6) or (bgs[r] == 5)) or (bgs[r] == 4)) {
f[r] = 2;
}
if (((bgs[r] == 3) or (bgs[r] == 2)) or (bgs[r] == 1)) {
f[r] = 3;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgs[r] = 4;
bgd[r] = 2;
}
}
if (bgd[r] == 2) {
if ((bgs[r] == 4) or (bgs[r] == 3)) {
f[r] = 4;
}
if ((bgs[r] == 2) or (bgs[r] == 1)) {
f[r] = 5;
}
if (px < bgx[r]) {
bgx[r] = (bgx[r] - 1) - random(10);
}
if (px > bgx[r]) {
bgx[r] = (bgx[r] + 1) + random(10);
}
if (py > bgy[r]) {
bgy[r] = bgy[r] + random(8);
}
if (py < bgy[r]) {
bgy[r] = (bgy[r] - 10) - random(10);
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgs[r] = 4;
}
}
if (bgd[r] == 3) {
if (bgs[r] == 4) {
f[r] = 6;
}
if (bgs[r] == 3) {
f[r] = 7;
}
if (bgs[r] == 2) {
f[r] = 8;
}
if (bgs[r] == 1) {
f[r] = 9;
}
bgs[r] = bgs[r] - 1;
bgy[r] = bgy[r] - 10;
if (bgs[r] <= 0) {
f[r] = 10;
bgt[r] = 0;
bgx[r] = -500;
bgs[r] = 0;
}
}
}
if (bgt[r] == 7) {
if (((((((bgx[r] - 20) < (px + 10)) and ((bgx[r] + 20) > (px - 10))) and ((bgy[r] + 20) > (py + 10))) and ((bgy[r] + 20) < (py + 50))) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 3;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 3;
}
megah.start();
i = 10;
}
if (bgd[r] == 0) {
f[r] = 1;
bgy[r] = bgy[r] - 10;
if ((px + 80) < bgx[r]) {
bgx[r] = bgx[r] - 5;
}
if ((px - 80) > bgx[r]) {
bgx[r] = bgx[r] + 5;
}
if ((py - 70) < bgy[r]) {
bgy[r] = bgy[r] - 5;
}
if ((py - 70) > bgy[r]) {
bgy[r] = bgy[r] + 5;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
joes.start();
if (px > bgx[r]) {
bgd[r] = 1;
}
if (px < bgx[r]) {
bgd[r] = 2;
}
if (px < bgx[r]) {
bgsd[bsn] = 3;
if ((py - 50) < bgy[r]) {
bgsd[bsn] = 1;
}
}
if (px > bgx[r]) {
bgsd[bsn] = 2;
if ((py - 50) < bgy[r]) {
bgsd[bsn] = 0;
}
}
bgs[r] = 12;
bgst[bsn] = 1;
bgsx[bsn] = bgx[r];
bgsy[bsn] = bgy[r];
bsn = bsn + 1;
if (bsn > 5) {
bsn = 1;
}
}
}
if (bgd[r] == 1) {
f[r] = 2;
bgy[r] = bgy[r] - 10;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 0;
bgs[r] = 10 + random(25);
}
}
if (bgd[r] == 2) {
f[r] = 3;
bgy[r] = bgy[r] - 10;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 0;
bgs[r] = 10 + random(25);
}
}
if (bgd[r] == 3) {
if (bgs[r] == 3) {
f[r] = 4;
}
if (bgs[r] == 2) {
f[r] = 5;
}
if (bgs[r] == 1) {
f[r] = 6;
}
bgs[r] = bgs[r] - 1;
bgy[r] = bgy[r] - 10;
if (bgs[r] <= 0) {
f[r] = 7;
bgt[r] = 0;
bgx[r] = -500;
bgs[r] = 0;
}
}
}
if (bgt[r] == 8) {
if (((((((bgx[r] - 20) < (px + 10)) and ((bgx[r] + 20) > (px - 10))) and ((bgy[r] + 35) > (py + 10))) and ((bgy[r] + 20) < (py + 50))) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 8;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 8;
}
bgd[r] = 2;
bgs[r] = 10;
baddyd1.start();
i = 10;
}
if (bgd[r] == 0) {
f[r] = 1;
bgx[r] = bgx[r] + 20;
if ((py + 30) > bgy[r]) {
bgy[r] = bgy[r] - 8;
}
if ((py + 30) < bgy[r]) {
bgy[r] = bgy[r] - 12;
}
if ((px + 100) < bgx[r]) {
bgd[r] = 1;
}
}
if (bgd[r] == 1) {
f[r] = 2;
bgx[r] = bgx[r] - 20;
if ((py + 30) > bgy[r]) {
bgy[r] = bgy[r] - 8;
}
if ((py + 30) < bgy[r]) {
bgy[r] = bgy[r] - 12;
}
if ((px - 100) > bgx[r]) {
bgd[r] = 0;
}
}
if (bgd[r] == 2) {
if (bgs[r] == 5) {
f[r] = 3;
}
if (bgs[r] == 4) {
f[r] = 4;
}
if (bgs[r] == 3) {
f[r] = 5;
}
if (bgs[r] == 2) {
f[r] = 6;
}
if (bgs[r] == 1) {
f[r] = 7;
}
bgs[r] = bgs[r] - 1;
bgy[r] = bgy[r] - 10;
if (bgs[r] <= 0) {
bgx[r] = -500;
f[r] = 8;
bgt[r] = 0;
bgs[r] = 0;
}
}
}
if (bgt[r] == 9) {
if (((((((bgx[r] - 30) < (px + 10)) and ((bgx[r] + 30) > (px - 10))) and ((bgy[r] + 55) > (py + 10))) and ((bgy[r] + 20) < (py + 50))) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 5;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 5;
}
megah.start();
i = 10;
}
if (bgd[r] == 0) {
if ((bgs[r] == 1) or (bgs[r] == 2)) {
f[r] = 1;
}
if ((bgs[r] == 3) or (bgs[r] == 4)) {
f[r] = 2;
}
bgx[r] = bgx[r] + 8;
if ((px + 80) < bgx[r]) {
bgd[r] = 1;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgs[r] = 4;
}
}
if (bgd[r] == 1) {
if ((bgs[r] == 1) or (bgs[r] == 2)) {
f[r] = 3;
}
if ((bgs[r] == 3) or (bgs[r] == 4)) {
f[r] = 4;
}
bgx[r] = bgx[r] - 8;
if ((px - 80) > bgx[r]) {
bgd[r] = 0;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgs[r] = 4;
}
}
if (bgd[r] == 2) {
if (bgs[r] == 4) {
f[r] = 5;
}
if (bgs[r] == 3) {
f[r] = 6;
}
if (bgs[r] == 2) {
f[r] = 7;
}
if (bgs[r] == 1) {
f[r] = 8;
}
bgs[r] = bgs[r] - 1;
bgy[r] = bgy[r] - 10;
if (bgs[r] <= 0) {
bgx[r] = -500;
f[r] = 9;
bgt[r] = 0;
bgs[r] = 0;
}
}
}
if (bgt[r] == 10) {
if (((((((bgx[r] - 20) < (px + 10)) and ((bgx[r] + 20) > (px - 10))) and ((bgy[r] + 20) > (py + 10))) and ((bgy[r] + 20) < (py + 50))) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 2;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 2;
}
megah.start();
i = 10;
}
if (bgd[r] == 0) {
f[r] = 1;
bgy[r] = bgy[r] - 10;
if (px < bgx[r]) {
bgx[r] = bgx[r] - 7;
}
if (px > bgx[r]) {
bgx[r] = bgx[r] + 7;
}
if ((py - 80) < bgy[r]) {
bgy[r] = bgy[r] - 8;
}
if ((py - 80) > bgy[r]) {
bgy[r] = bgy[r] + 8;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
joes.start();
bgd[r] = 1;
bgsd[bsn] = 4;
bgs[r] = 5;
bgst[bsn] = 1;
bgsx[bsn] = bgx[r];
bgsy[bsn] = bgy[r];
bsn = bsn + 1;
if (bsn > 5) {
bsn = 1;
}
}
}
if (bgd[r] == 1) {
f[r] = 2;
bgy[r] = bgy[r] - 10;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 0;
bgs[r] = 6 + random(16);
}
}
if (bgd[r] == 2) {
if (bgs[r] == 3) {
f[r] = 3;
}
if (bgs[r] == 2) {
f[r] = 4;
}
if (bgs[r] == 1) {
f[r] = 5;
}
bgs[r] = bgs[r] - 1;
bgy[r] = bgy[r] - 10;
if (bgs[r] <= 0) {
f[r] = 7;
bgt[r] = 0;
bgx[r] = -500;
bgs[r] = 0;
}
}
}
if (bgt[r] == 11) {
if (((((((bgx[r] - 20) < (px + 10)) and ((bgx[r] + 20) > (px - 10))) and ((bgy[r] + 50) > (py - 10))) and (bgy[r] < (py + 50))) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 3;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 3;
}
megah.start();
i = 10;
}
if (bgd[r] == 0) {
if (((bgs[r] == 12) or (bgs[r] == 11)) or (bgs[r] == 10)) {
f[r] = 1;
}
if (((bgs[r] == 9) or (bgs[r] == 8)) or (bgs[r] == 7)) {
f[r] = 2;
}
if (((bgs[r] == 6) or (bgs[r] == 5)) or (bgs[r] == 4)) {
f[r] = 1;
}
if (((bgs[r] == 3) or (bgs[r] == 2)) or (bgs[r] == 1)) {
f[r] = 2;
}
if (bgx[r] > px) {
bgd[r] = 3;
bgs[r] = 12;
}
bgx[r] = bgx[r] + 6;
if (((bgx[r] + 150) > (px - 20)) and (bgx[r] < px)) {
bgd[r] = 1;
bgs[r] = 9;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgs[r] = 12;
}
}
if (bgd[r] == 1) {
f[r] = 3;
bgx[r] = bgx[r] + 12;
bgy[r] = bgy[r] - 20;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 2;
bgs[r] = 10;
}
}
if (bgd[r] == 2) {
f[r] = 3;
bgx[r] = bgx[r] + 12;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 0;
bgs[r] = 12;
}
}
if (bgd[r] == 3) {
if (((bgs[r] == 12) or (bgs[r] == 11)) or (bgs[r] == 10)) {
f[r] = 4;
}
if (((bgs[r] == 9) or (bgs[r] == 8)) or (bgs[r] == 7)) {
f[r] = 5;
}
if (((bgs[r] == 6) or (bgs[r] == 5)) or (bgs[r] == 4)) {
f[r] = 4;
}
if (((bgs[r] == 3) or (bgs[r] == 2)) or (bgs[r] == 1)) {
f[r] = 5;
}
if (bgx[r] < px) {
bgd[r] = 0;
bgs[r] = 12;
}
bgx[r] = bgx[r] - 6;
if (((bgx[r] - 150) < (px - 20)) and (bgx[r] > px)) {
bgd[r] = 4;
bgs[r] = 9;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgs[r] = 12;
}
}
if (bgd[r] == 4) {
f[r] = 6;
bgx[r] = bgx[r] - 12;
bgy[r] = bgy[r] - 20;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 5;
bgs[r] = 10;
}
}
if (bgd[r] == 5) {
f[r] = 6;
bgx[r] = bgx[r] - 12;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 3;
bgs[r] = 12;
}
}
if (bgd[r] == 6) {
if (bgs[r] == 3) {
f[r] = 7;
}
if (bgs[r] == 2) {
f[r] = 8;
}
if (bgs[r] == 1) {
f[r] = 9;
}
bgs[r] = bgs[r] - 1;
bgy[r] = bgy[r] - 10;
if (bgs[r] <= 0) {
f[r] = 15;
bgt[r] = 0;
bgx[r] = -500;
bgs[r] = 0;
}
}
}
if (bgt[r] == 12) {
if (((((((bgx[r] - 20) < (px + 10)) and ((bgx[r] + 20) > (px - 10))) and ((bgy[r] + 40) > py)) and ((bgy[r] - 20) < (py + 50))) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 3;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 3;
}
megah.start();
i = 10;
}
if (bgd[r] == 0) {
if (bgs[r] == 1) {
f[r] = 1;
}
if (bgs[r] == 2) {
f[r] = 2;
}
bgy[r] = bgy[r] - 10;
bgx[r] = bgx[r] + 7;
if ((py - 60) < bgy[r]) {
bgy[r] = bgy[r] - 5;
}
if ((((px - 70) < bgx[r]) and ((px + 70) > bgx[r])) and (py > bgy[r])) {
bgy[r] = bgy[r] + 12;
}
if ((px + 100) < bgx[r]) {
bgd[r] = 1;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgs[r] = 2;
}
}
if (bgd[r] == 1) {
if (bgs[r] == 1) {
f[r] = 3;
}
if (bgs[r] == 2) {
f[r] = 4;
}
bgy[r] = bgy[r] - 10;
bgx[r] = bgx[r] - 7;
if ((py - 60) < bgy[r]) {
bgy[r] = bgy[r] - 5;
}
if ((((px - 70) < bgx[r]) and ((px + 70) > bgx[r])) and (py > bgy[r])) {
bgy[r] = bgy[r] + 12;
}
if ((px - 100) > bgx[r]) {
bgd[r] = 0;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgs[r] = 2;
}
}
if (bgd[r] == 2) {
if (bgs[r] == 4) {
f[r] = 5;
}
if (bgs[r] == 3) {
f[r] = 6;
}
if (bgs[r] == 2) {
f[r] = 7;
}
if (bgs[r] == 1) {
f[r] = 8;
}
bgs[r] = bgs[r] - 1;
bgy[r] = bgy[r] - 10;
if (bgs[r] <= 0) {
bgx[r] = -500;
f[r] = 9;
bgt[r] = 0;
bgs[r] = 0;
}
}
}
if (bgt[r] == 13) {
if (((((((bgx[r] - 50) < (px + 10)) and ((bgx[r] + 50) > (px - 10))) and ((bgy[r] + 70) > (py + 10))) and (bgy[r] < (py + 50))) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 4;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 4;
}
megah.start();
i = 10;
}
if (bgd[r] == 0) {
f[r] = 1;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
if ((px - 170) < bgx[r]) {
bgd[r] = 1;
bgs[r] = 7;
}
}
if (px < bgx[r]) {
bgd[r] = 3;
}
}
if (bgd[r] == 1) {
f[r] = 2;
bgx[r] = bgx[r] + 30;
bgy[r] = bgy[r] - 20;
if (bgy[r] < py) {
bgy[r] = bgy[r] + 10;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 2;
bgs[r] = 12;
}
}
if (bgd[r] == 2) {
f[r] = 3;
bgx[r] = bgx[r] + 5;
bgy[r] = bgy[r] + 2;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 0;
bgs[r] = random(12);
}
}
if (bgd[r] == 3) {
f[r] = 4;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
if ((px + 170) > bgx[r]) {
bgd[r] = 4;
bgs[r] = 7;
}
}
if (px > bgx[r]) {
bgd[r] = 0;
}
}
if (bgd[r] == 4) {
f[r] = 5;
bgx[r] = bgx[r] - 30;
bgy[r] = bgy[r] - 20;
bgs[r] = bgs[r] - 1;
if (bgy[r] < py) {
bgy[r] = bgy[r] + 10;
}
if (bgs[r] <= 0) {
bgd[r] = 5;
bgs[r] = 12;
}
}
if (bgd[r] == 5) {
f[r] = 6;
bgx[r] = bgx[r] - 5;
bgy[r] = bgy[r] + 2;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 3;
bgs[r] = random(12);
}
}
if (bgd[r] == 6) {
if (bgs[r] == 4) {
f[r] = 7;
}
if (bgs[r] == 3) {
f[r] = 8;
}
if (bgs[r] == 2) {
f[r] = 9;
}
if (bgs[r] == 1) {
f[r] = 10;
}
bgs[r] = bgs[r] - 1;
bgy[r] = bgy[r] - 10;
if (bgs[r] <= 0) {
bgx[r] = -500;
f[r] = 11;
bgt[r] = 0;
bgs[r] = 0;
}
}
}
if (bgt[r] == 14) {
if (((((((bgx[r] - 20) < (px + 10)) and ((bgx[r] + 20) > (px - 10))) and ((bgy[r] + 50) > (py + 10))) and ((bgy[r] + 20) < (py + 50))) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 2;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 2;
}
megah.start();
i = 10;
}
if (bgt[r] > 0) {
bgy[r] = bgy[r] - 10;
}
if (bgd[r] == 0) {
f[r] = 1;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 1;
bgs[r] = 6;
}
}
if (bgd[r] == 1) {
if (((bgs[r] == 6) or (bgs[r] == 5)) or (bgs[r] == 4)) {
f[r] = 2;
}
if (((bgs[r] == 3) or (bgs[r] == 2)) or (bgs[r] == 1)) {
f[r] = 3;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 2;
bgs[r] = 15;
}
}
if (bgd[r] == 2) {
f[r] = 4;
if (((bgs[r] == 15) or (bgs[r] == 10)) or (bgs[r] == 5)) {
cannons.start();
bgst[bsn] = 2;
bgsx[bsn] = bgx[r] + 20;
bgsy[bsn] = bgy[r];
bgsd[bsn] = 0;
bsn = bsn + 1;
if (bsn > 5) {
bsn = 1;
}
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 0;
bgs[r] = 20;
}
}
if (bgd[r] == 3) {
f[r] = 5;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 4;
bgs[r] = 6;
}
}
if (bgd[r] == 4) {
if (((bgs[r] == 6) or (bgs[r] == 5)) or (bgs[r] == 4)) {
f[r] = 6;
}
if (((bgs[r] == 3) or (bgs[r] == 2)) or (bgs[r] == 1)) {
f[r] = 7;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 5;
bgs[r] = 15;
}
}
if (bgd[r] == 5) {
f[r] = 8;
if (((bgs[r] == 15) or (bgs[r] == 10)) or (bgs[r] == 5)) {
cannons.start();
bgst[bsn] = 2;
bgsx[bsn] = bgx[r] - 20;
bgsy[bsn] = bgy[r];
bgsd[bsn] = 1;
bsn = bsn + 1;
if (bsn > 5) {
bsn = 1;
}
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 3;
bgs[r] = 20;
}
}
if (bgd[r] == 6) {
if (bgs[r] == 2) {
f[r] = 9;
}
if (bgs[r] == 1) {
f[r] = 10;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
f[r] = 11;
bgt[r] = 0;
bgx[r] = -500;
bgs[r] = 0;
}
}
}
}
r++;
}
r = 1;
while (r <= 5) {
if (bgst[r] > 0) {
if (bgst[r] == 1) {
if (r == 1) {
bgs1.gotoAndStop(1);
}
if (r == 2) {
bgs2.gotoAndStop(1);
}
if (r == 3) {
bgs3.gotoAndStop(1);
}
if (r == 4) {
bgs4.gotoAndStop(1);
}
if (r == 5) {
bgs5.gotoAndStop(1);
}
if (bgsd[r] == 0) {
bgsx[r] = bgsx[r] + 20;
if (bgsx[r] > (px + 300)) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgsd[r] == 1) {
bgsx[r] = bgsx[r] - 20;
if (bgsx[r] < (px - 300)) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgsd[r] == 2) {
bgsx[r] = bgsx[r] + 15;
bgsy[r] = bgsy[r] + 15;
if ((bgsx[r] > (px + 300)) or (bgsy[r] > (py + 300))) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgsd[r] == 3) {
bgsx[r] = bgsx[r] - 15;
bgsy[r] = bgsy[r] + 15;
if ((bgsx[r] > (px + 300)) or (bgsy[r] > (py + 300))) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgsd[r] == 4) {
bgsy[r] = bgsy[r] + 20;
if (bgsy[r] > (py + 300)) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (((((((bgsx[r] - 15) < (px + 10)) and ((bgsx[r] + 15) > (px - 10))) and ((bgsy[r] + 15) > (py + 5))) and ((bgsy[r] - 15) < (py + 20))) and (pcd < 18)) and (i < 1)) {
if ((bgsd[r] == 0) or (bgsd[r] == 2)) {
pcd = 19;
}
if ((bgsd[r] == 1) or (bgsd[r] == 3)) {
pcd = 18;
}
pstep = 2;
pl = pl - 3;
megah.start();
i = 10;
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgst[r] == 2) {
if (r == 1) {
bgs1.gotoAndStop(2);
}
if (r == 2) {
bgs2.gotoAndStop(2);
}
if (r == 3) {
bgs3.gotoAndStop(2);
}
if (r == 4) {
bgs4.gotoAndStop(2);
}
if (r == 5) {
bgs5.gotoAndStop(2);
}
if (bgsd[r] == 0) {
bgsx[r] = bgsx[r] + 30;
if (bgsx[r] > (px + 300)) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgsd[r] == 1) {
bgsx[r] = bgsx[r] - 30;
if (bgsx[r] < (px - 300)) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (((((((bgsx[r] - 25) < (px + 10)) and ((bgsx[r] + 25) > (px - 10))) and ((bgsy[r] + 80) > (py + 40))) and ((bgsy[r] + 35) < (py + 60))) and (pcd < 18)) and (i < 1)) {
if (bgsd[r] == 0) {
pcd = 19;
}
if (bgsd[r] == 1) {
pcd = 18;
}
pstep = 2;
pl = pl - 6;
megah.start();
i = 10;
bgst[r] = 0;
bgsx[r] = -200;
}
}
}
r++;
}
bg1.gotoAndStop(f[1]);
bg2.gotoAndStop(f[2]);
bg3.gotoAndStop(f[3]);
bg4.gotoAndStop(f[4]);
bg5.gotoAndStop(f[5]);
bg6.gotoAndStop(f[6]);
bg7.gotoAndStop(f[7]);
bg8.gotoAndStop(f[8]);
bgs1._x = ((bgsx[1] + 275) - px) / 2;
bgs1._y = ((bgsy[1] + 275) - py) / 2;
bgs2._x = ((bgsx[2] + 275) - px) / 2;
bgs2._y = ((bgsy[2] + 275) - py) / 2;
bgs3._x = ((bgsx[3] + 275) - px) / 2;
bgs3._y = ((bgsy[3] + 275) - py) / 2;
bgs4._x = ((bgsx[4] + 275) - px) / 2;
bgs4._y = ((bgsy[4] + 275) - py) / 2;
bgs5._x = ((bgsx[5] + 275) - px) / 2;
bgs5._y = ((bgsy[5] + 275) - py) / 2;
bg1._x = ((bgx[1] + 275) - px) / 2;
bg1._y = ((bgy[1] + 275) - py) / 2;
bg2._x = ((bgx[2] + 275) - px) / 2;
bg2._y = ((bgy[2] + 275) - py) / 2;
bg3._x = ((bgx[3] + 275) - px) / 2;
bg3._y = ((bgy[3] + 275) - py) / 2;
bg4._x = ((bgx[4] + 275) - px) / 2;
bg4._y = ((bgy[4] + 275) - py) / 2;
bg5._x = ((bgx[5] + 275) - px) / 2;
bg5._y = ((bgy[5] + 275) - py) / 2;
bg6._x = ((bgx[6] + 275) - px) / 2;
bg6._y = ((bgy[6] + 275) - py) / 2;
bg7._x = ((bgx[7] + 275) - px) / 2;
bg7._y = ((bgy[7] + 275) - py) / 2;
bg8._x = ((bgx[8] + 275) - px) / 2;
bg8._y = ((bgy[8] + 275) - py) / 2;
r = 1;
while (r <= 3) {
if (((pst[r] > 0) and (pst[r] < 4)) and (psd[r] == 0)) {
if (r == 1) {
shot1p._x = ((297 + psx[1]) - px) / 2;
shot1p._y = ((270 + psy[1]) - py) / 2;
}
if (r == 2) {
shot2p._x = ((297 + psx[2]) - px) / 2;
shot2p._y = ((270 + psy[2]) - py) / 2;
}
if (r == 3) {
shot3p._x = ((297 + psx[3]) - px) / 2;
shot3p._y = ((270 + psy[3]) - py) / 2;
}
}
if (((pst[r] > 0) and (pst[r] < 4)) and (psd[r] == 1)) {
if (r == 1) {
shot1p._x = ((247 + psx[1]) - px) / 2;
shot1p._y = ((270 + psy[1]) - py) / 2;
}
if (r == 2) {
shot2p._x = ((247 + psx[2]) - px) / 2;
shot2p._y = ((270 + psy[2]) - py) / 2;
}
if (r == 3) {
shot3p._x = ((247 + psx[3]) - px) / 2;
shot3p._y = ((270 + psy[3]) - py) / 2;
}
}
if ((pst[r] == 4) or (pst[r] == 5)) {
if (r == 1) {
shot1p._x = ((272 + psx[1]) - px) / 2;
shot1p._y = ((270 + psy[1]) - py) / 2;
}
if (r == 2) {
shot2p._x = ((272 + psx[2]) - px) / 2;
shot2p._y = ((270 + psy[2]) - py) / 2;
}
if (r == 3) {
shot3p._x = ((272 + psx[3]) - px) / 2;
shot3p._y = ((270 + psy[3]) - py) / 2;
}
}
if (pst[r] == 0) {
if (r == 1) {
shot1p._x = -200;
shot1p._y = (270 + psy[1]) - py;
}
if (r == 2) {
shot2p._x = -200;
shot2p._y = (270 + psy[2]) - py;
}
if (r == 3) {
shot3p._x = -200;
shot3p._y = (270 + psy[3]) - py;
}
}
r++;
}
if (i > 0) {
i = i - 1;
pc._alpha = 50;
}
if (i <= 0) {
i = i - 1;
pc._alpha = 100;
}
if (bcharge > 0) {
charge._alpha = bcharge;
}
lbar._height = 2 * pl;
lbar._y = 120 - (2 * pl);
stage._x = (770 - px) / 2;
stage._y = (175 - py) / 2;
exit._x = ((ex + 275) - px) / 2;
exit._y = ((ey + 275) - py) / 2;
Frame 221
gotoAndPlay (220);
if ((((px + 10) > (ex - 20)) and ((px - 10) < (ex + 20))) and (((py + 30) > (ey - 20)) and (py < (ey + 50)))) {
gotoAndPlay (222);
}
Frame 222
lbar._height = 2 * pl;
lbar._y = 120 - (2 * pl);
stage._x = (275 - px) / 2;
stage._y = (-225 - py) / 2;
exit._x = ((ex + 275) - px) / 2;
exit._y = ((ey + 275) - py) / 2;
Frame 225
psn = 1;
bstep = 0;
pcd = 0;
bcharge = 0;
r = 1;
while (r <= 5) {
psx[r] = -200;
psy[r] = 0;
pst[r] = 0;
psd[r] = 0;
r++;
}
i = 0;
pl = pl + 5;
if (pl > 50) {
pl = 50;
}
px = 150;
py = 350;
r = 0;
while (r <= 31) {
bx[r] = -50;
by[r] = -50;
r++;
}
bx[1] = 50;
by[1] = 150;
bx[2] = 50;
by[2] = 250;
bx[3] = 150;
by[3] = 350;
bx[4] = 250;
by[4] = 350;
bx[5] = 350;
by[5] = 350;
bx[6] = 450;
by[6] = 350;
bx[7] = 550;
by[7] = 350;
bx[8] = 650;
by[8] = 350;
bx[9] = 750;
by[9] = 350;
bx[10] = 850;
by[10] = 350;
bx[11] = 950;
by[11] = 350;
bx[12] = 1050;
by[12] = 350;
bx[13] = 1150;
by[13] = 350;
bx[14] = 1250;
by[14] = 250;
bx[15] = 1150;
by[15] = 150;
bsn = 1;
bi = 0;
r = 1;
while (r <= 8) {
bgx[r] = -200;
bgy[r] = -200;
bgt[r] = 0;
bgd[r] = -1;
bgs[r] = 0;
r++;
}
r = 1;
while (r <= 5) {
bgsx[r] = -200;
bgsy[r] = 0;
bgst[r] = 0;
bgsd[r] = 0;
r++;
}
r = 1;
while (r <= 8) {
f[r] = 20;
r++;
}
bgd[1] = 0;
bgs[1] = 0;
bgl[1] = 50;
bgx[1] = 350;
bgy[1] = 350;
ex = 1150;
ey = 250;
stopAllSounds();
Frame 230
b1._x = bx[1] / 10;
b1._y = (by[1] / 10) + 120;
b2._x = bx[2] / 10;
b2._y = (by[2] / 10) + 120;
b3._x = bx[3] / 10;
b3._y = (by[3] / 10) + 120;
b4._x = bx[4] / 10;
b4._y = (by[4] / 10) + 120;
b5._x = bx[5] / 10;
b5._y = (by[5] / 10) + 120;
b6._x = bx[6] / 10;
b6._y = (by[6] / 10) + 120;
b7._x = bx[7] / 10;
b7._y = (by[7] / 10) + 120;
b8._x = bx[8] / 10;
b8._y = (by[8] / 10) + 120;
b9._x = bx[9] / 10;
b9._y = (by[9] / 10) + 120;
b10._x = bx[10] / 10;
b10._y = (by[10] / 10) + 120;
b11._x = bx[11] / 10;
b11._y = (by[11] / 10) + 120;
b12._x = bx[12] / 10;
b12._y = (by[12] / 10) + 120;
b13._x = bx[13] / 10;
b13._y = (by[13] / 10) + 120;
b14._x = bx[14] / 10;
b14._y = (by[14] / 10) + 120;
b15._x = bx[15] / 10;
b15._y = (by[15] / 10) + 120;
b16._x = bx[16] / 10;
b16._y = (by[16] / 10) + 120;
b17._x = bx[17] / 10;
b17._y = (by[17] / 10) + 120;
b18._x = bx[18] / 10;
b18._y = (by[18] / 10) + 120;
b19._x = bx[19] / 10;
b19._y = (by[19] / 10) + 120;
b20._x = bx[20] / 10;
b20._y = (by[20] / 10) + 120;
b21._x = bx[21] / 10;
b21._y = (by[21] / 10) + 120;
b22._x = bx[22] / 10;
b22._y = (by[22] / 10) + 120;
b23._x = bx[23] / 10;
b23._y = (by[23] / 10) + 120;
b24._x = bx[24] / 10;
b24._y = (by[24] / 10) + 120;
b25._x = bx[25] / 10;
b25._y = (by[25] / 10) + 120;
b26._x = bx[26] / 10;
b26._y = (by[26] / 10) + 120;
b27._x = bx[27] / 10;
b27._y = (by[27] / 10) + 120;
b28._x = bx[28] / 10;
b28._y = (by[28] / 10) + 120;
b29._x = bx[29] / 10;
b29._y = (by[29] / 10) + 120;
b30._x = bx[30] / 10;
b30._y = (by[30] / 10) + 120;
b31._x = bx[31] / 10;
b31._y = (by[31] / 10) + 120;
cir._x = px / 10;
cir._y = (py / 10) + 120;
shot1._x = psx[1] / 10;
shot1._y = (psy[1] / 10) + 120;
shot2._x = psx[2] / 10;
shot2._y = (psy[2] / 10) + 120;
shot3._x = psx[3] / 10;
shot3._y = (psy[3] / 10) + 120;
bshot1._x = bgsx[1] / 10;
bshot1._y = (bgsy[1] / 10) + 120;
bshot2._x = bgsx[2] / 10;
bshot2._y = (bgsy[2] / 10) + 120;
bshot3._x = bgsx[3] / 10;
bshot3._y = (bgsy[3] / 10) + 120;
bshot4._x = bgsx[4] / 10;
bshot4._y = (bgsy[4] / 10) + 120;
bshot5._x = bgsx[5] / 10;
bshot5._y = (bgsy[5] / 10) + 120;
bcir1._x = bgx[1] / 10;
bcir1._y = (bgy[1] / 10) + 120;
bcir2._x = bgx[2] / 10;
bcir2._y = (bgy[2] / 10) + 120;
bcir3._x = bgx[3] / 10;
bcir3._y = (bgy[3] / 10) + 120;
bcir4._x = bgx[4] / 10;
bcir4._y = (bgy[4] / 10) + 120;
bcir5._x = bgx[5] / 10;
bcir5._y = (bgy[5] / 10) + 120;
bcir6._x = bgx[6] / 10;
bcir6._y = (bgy[6] / 10) + 120;
bcir7._x = bgx[7] / 10;
bcir7._y = (bgy[7] / 10) + 120;
bcir8._x = bgx[8] / 10;
bcir8._y = (bgy[8] / 10) + 120;
bcir9._x = bgx[9] / 10;
bcir9._y = (bgy[9] / 10) + 120;
bcir10._x = bgx[10] / 10;
bcir10._y = (bgy[10] / 10) + 120;
bcir11._x = bgx[11] / 10;
bcir11._y = (bgy[11] / 10) + 120;
bcir12._x = bgx[12] / 10;
bcir12._y = (bgy[12] / 10) + 120;
bcir13._x = bgx[13] / 10;
bcir13._y = (bgy[13] / 10) + 120;
if (Key.isDown(39) and (pcd == 0)) {
pcd = 2;
}
if (Key.isDown(39) and ((pcd == 1) or (pcd == 3))) {
pcd = 0;
}
if (Key.isDown(37) and (pcd == 1)) {
pcd = 3;
}
if (Key.isDown(37) and ((pcd == 0) or (pcd == 2))) {
pcd = 1;
}
if (Key.isDown(38) and ((pcd == 0) or (pcd == 2))) {
pcd = 10;
pstep = 7;
}
if (Key.isDown(38) and ((pcd == 1) or (pcd == 3))) {
pcd = 11;
pstep = 7;
}
if (Key.isDown(40) and ((((pcd == 0) or (pcd == 1)) or (pcd == 2)) or (pcd == 3))) {
if (((pcd == 0) or (pcd == 2)) or (pcd == 8)) {
pcd = 6;
pstep = 3;
}
if (((pcd == 1) or (pcd == 3)) or (pcd == 9)) {
pcd = 7;
pstep = 3;
}
}
if (Key.isDown(16) and (bcharge < 100)) {
bcharge = bcharge + 5;
}
if (pcd == 0) {
pc.gotoAndStop(1);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(21);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px + 10;
psy[psn] = py;
psd[psn] = 0;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
}
if (pcd == 1) {
pc.gotoAndStop(2);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(22);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px - 10;
psy[psn] = py;
psd[psn] = 1;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
}
if (pcd == 2) {
px = px + 13;
if ((w == 0) or (w == 1)) {
pc.gotoAndStop(3);
}
if ((w == 2) or (w == 3)) {
pc.gotoAndStop(4);
}
if ((w == 4) or (w == 5)) {
pc.gotoAndStop(5);
}
if ((w == 6) or (w == 7)) {
pc.gotoAndStop(6);
}
if (Key.isDown(32)) {
if ((w == 0) or (w == 1)) {
pc.gotoAndStop(11);
}
if ((w == 2) or (w == 3)) {
pc.gotoAndStop(12);
}
if ((w == 4) or (w == 5)) {
pc.gotoAndStop(13);
}
if ((w == 6) or (w == 7)) {
pc.gotoAndStop(14);
}
if ((pst[psn] == 0) and (bstep == 0)) {
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px + 10;
psy[psn] = py;
psd[psn] = 0;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
}
pcd = 0;
}
if (pcd == 3) {
px = px - 13;
if ((w == 0) or (w == 1)) {
pc.gotoAndStop(7);
}
if ((w == 2) or (w == 3)) {
pc.gotoAndStop(8);
}
if ((w == 4) or (w == 5)) {
pc.gotoAndStop(9);
}
if ((w == 6) or (w == 7)) {
pc.gotoAndStop(10);
}
if (Key.isDown(32)) {
if ((w == 0) or (w == 1)) {
pc.gotoAndStop(15);
}
if ((w == 2) or (w == 3)) {
pc.gotoAndStop(16);
}
if ((w == 4) or (w == 5)) {
pc.gotoAndStop(17);
}
if ((w == 6) or (w == 7)) {
pc.gotoAndStop(18);
}
if ((pst[psn] == 0) and (bstep == 0)) {
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px - 10;
psy[psn] = py;
psd[psn] = 1;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
}
pcd = 1;
}
if (pcd == 9) {
pstep = pstep - 1;
if (pstep <= 0) {
pcd = 1;
}
}
if (pcd == 6) {
pc.gotoAndStop(19);
px = px + 20;
pstep = pstep - 1;
if (pstep <= 0) {
pcd = 0;
}
}
if (pcd == 7) {
pc.gotoAndStop(20);
px = px - 20;
pstep = pstep - 1;
if (pstep <= 0) {
pcd = 1;
}
}
if (pcd == 12) {
pc.gotoAndStop(23);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(25);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px + 10;
psy[psn] = py;
psd[psn] = 0;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
py = py + (5 * (7 - pstep));
pstep = pstep - 1;
if (pstep <= 2) {
pstep = 2;
}
if (Key.isDown(39)) {
px = px + 13;
}
if (Key.isDown(37)) {
px = px - 13;
if (bstep == 0) {
pcd = 13;
}
}
}
if (pcd == 13) {
pc.gotoAndStop(24);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(26);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px - 10;
psy[psn] = py;
psd[psn] = 1;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
py = py + (5 * (7 - pstep));
pstep = pstep - 1;
if (pstep <= 2) {
pstep = 2;
}
if (Key.isDown(39)) {
px = px + 13;
if (bstep == 0) {
pcd = 12;
}
}
if (Key.isDown(37)) {
px = px - 13;
}
}
if (pcd == 10) {
pc.gotoAndStop(23);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(25);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px + 10;
psy[psn] = py;
psd[psn] = 0;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
py = py - (5 * pstep);
pstep = pstep - 1;
if (Key.isDown(39)) {
px = px + 13;
}
if (Key.isDown(37)) {
px = px - 13;
if (bstep == 0) {
pcd = 11;
}
}
if (Key.isDown(40)) {
pcd = 12;
pstep = pstep + 3;
}
if (pstep <= -1) {
pstep = 7;
pcd = 12;
}
}
if (pcd == 11) {
pc.gotoAndStop(24);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(26);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px - 10;
psy[psn] = py;
psd[psn] = 1;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
py = py - (5 * pstep);
pstep = pstep - 1;
if (Key.isDown(39)) {
px = px + 13;
if (bstep == 0) {
pcd = 10;
}
}
if (Key.isDown(37)) {
px = px - 13;
}
if (Key.isDown(40)) {
pcd = 13;
pstep = pstep + 3;
}
if (pstep <= -1) {
pstep = 7;
pcd = 13;
}
}
if (pcd == 18) {
pc.gotoAndStop(27);
pstep = pstep - 1;
px = px - 5;
if (pstep <= -1) {
pstep = 2;
pcd = 0;
}
}
if (pcd == 19) {
pc.gotoAndStop(28);
pstep = pstep - 1;
px = px + 5;
if (pstep <= -1) {
pstep = 2;
pcd = 1;
}
}
if (pcd == 20) {
pc.gotoAndStop(69 - pstep);
bcharge = 0;
bstep = 20;
pl = 1;
pstep = pstep - 1;
if (pstep < 0) {
lives = lives - 1;
if (lives >= 0) {
pl = 50;
gotoAndPlay (225);
}
if (lives < 0) {
lives = 2;
continues = continues - 1;
gotoAndPlay (5);
}
}
}
if (pcd == 21) {
pc.gotoAndStop(77 - pstep);
charge._alpha = 0;
bcharge = 0;
bstep = 20;
pstep = pstep - 1;
if (pstep < 0) {
pstep = 0;
}
}
if (pl <= 0) {
pc._alpha = 100;
pcd = 20;
pstep = 40;
megad.start();
}
if (bstep > 0) {
bcharge = 0;
charge._alpha = bcharge;
}
if (bstep > 0) {
bstep = bstep - 1;
}
if (py > 350) {
py = 350;
if ((((pcd == 12) or (pcd == 13)) or (pcd == 16)) or (pcd == 17)) {
if ((pcd == 12) or (pcd == 16)) {
pcd = 0;
}
if ((pcd == 13) or (pcd == 17)) {
pcd = 1;
}
}
}
if ((pcd == 18) and (py < 350)) {
pcd = 12;
pstep = 5;
}
if ((pcd == 19) and (py < 350)) {
pcd = 13;
pstep = 5;
}
if (px < 25) {
px = 25;
}
if (px > 525) {
px = 525;
}
w = w - 1;
if (w < 0) {
w = 7;
}
e = pcd;
r = 1;
while (r <= 3) {
if (pst[r] == 1) {
if (psd[r] == 0) {
psx[r] = psx[r] + 30;
if (r == 1) {
shot1p.gotoAndStop(1);
}
if (r == 2) {
shot2p.gotoAndStop(1);
}
if (r == 3) {
shot3p.gotoAndStop(1);
}
if (psx[r] > 580) {
pst[r] = 0;
psx[r] = -200;
}
}
if (psd[r] == 1) {
psx[r] = psx[r] - 30;
if (r == 1) {
shot1p.gotoAndStop(2);
}
if (r == 2) {
shot2p.gotoAndStop(2);
}
if (r == 3) {
shot3p.gotoAndStop(2);
}
if (psx[r] < -30) {
pst[r] = 0;
psx[r] = -200;
}
}
}
if (pst[r] == 2) {
if (psd[r] == 0) {
psx[r] = psx[r] + 35;
if (r == 1) {
shot1p.gotoAndStop(3);
}
if (r == 2) {
shot2p.gotoAndStop(3);
}
if (r == 3) {
shot3p.gotoAndStop(3);
}
if (psx[r] > 600) {
pst[r] = 0;
psx[r] = -200;
}
}
if (psd[r] == 1) {
psx[r] = psx[r] - 35;
if (r == 1) {
shot1p.gotoAndStop(4);
}
if (r == 2) {
shot2p.gotoAndStop(4);
}
if (r == 3) {
shot3p.gotoAndStop(4);
}
if (psx[r] < -50) {
pst[r] = 0;
psx[r] = -200;
}
}
}
if (pst[r] == 3) {
if (psd[r] == 0) {
psx[r] = psx[r] + 40;
if (r == 1) {
shot1p.gotoAndStop(5);
}
if (r == 2) {
shot2p.gotoAndStop(5);
}
if (r == 3) {
shot3p.gotoAndStop(5);
}
if (psx[r] > 630) {
pst[r] = 0;
psx[r] = -200;
}
}
if (psd[r] == 1) {
psx[r] = psx[r] - 40;
if (r == 1) {
shot1p.gotoAndStop(6);
}
if (r == 2) {
shot2p.gotoAndStop(6);
}
if (r == 3) {
shot3p.gotoAndStop(6);
}
if (psx[r] < -80) {
pst[r] = 0;
psx[r] = -200;
}
}
}
if (pst[r] == 4) {
if (r == 1) {
shot1p.gotoAndStop(10 - psd[r]);
}
if (r == 2) {
shot2p.gotoAndStop(10 - psd[r]);
}
if (r == 3) {
shot3p.gotoAndStop(10 - psd[r]);
}
psd[r] = psd[r] - 1;
if (psd[r] < 0) {
pst[r] = 0;
psx[r] = -200;
}
}
if (pst[r] == 5) {
if (r == 1) {
shot1p.gotoAndStop(14 - psd[r]);
}
if (r == 2) {
shot2p.gotoAndStop(14 - psd[r]);
}
if (r == 3) {
shot3p.gotoAndStop(14 - psd[r]);
}
psd[r] = psd[r] - 1;
if (psd[r] < 0) {
pst[r] = 0;
psx[r] = -200;
}
}
r++;
}
r = 1;
while (r <= 3) {
if ((pst[r] > 0) and (pst[r] < 4)) {
if (((((((bgx[1] - 22) < (psx[r] + ((pst[r] * 20) - 20))) and ((bgx[1] + 22) > (psx[r] - ((pst[r] * 20) - 20)))) and ((bgy[1] - 35) < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[1] + 35) > (psy[r] - ((pst[r] * 20) - 20)))) and (bi < 1)) and (bgl[1] > 0)) {
if (bgd[1] > 5) {
deflect.start();
}
if (bgd[1] < 6) {
megash.start();
bgl[1] = bgl[1] - pst[r];
bi = 12;
if (bgl[1] < 1) {
bi = 0;
baddyd2.start();
bgd[1] = 14;
bgs[1] = 10;
pcd = 21;
pstep = 7;
}
}
if (bgl[1] > 0) {
pst[r] = 0;
psx[r] = -200;
}
}
}
r++;
}
if (bgd[1] == 0) {
boss.gotoAndStop(1);
if (px < bgx[1]) {
bgd[1] = 1;
}
c = random(140 - (3 * dif));
if (c < 6) {
machineg.start();
bgd[1] = 2;
bgs[1] = 8;
}
if ((c > 10) and (c < 16)) {
cannons.start();
bgd[1] = 4;
bgs[1] = 8;
}
if ((c > 20) and (c < 25)) {
jetpass.start();
bgd[1] = 6;
bgs[1] = 12;
}
}
if (bgd[1] == 1) {
boss.gotoAndStop(6);
if (px > bgx[1]) {
bgd[1] = 0;
}
c = random(140 - (3 * dif));
if (c < 6) {
machineg.start();
bgd[1] = 3;
bgs[1] = 8;
}
if ((c > 10) and (c < 16)) {
cannons.start();
bgd[1] = 5;
bgs[1] = 8;
}
if ((c > 20) and (c < 25)) {
jetpass.start();
bgd[1] = 7;
bgs[1] = 12;
}
}
if (bgd[1] == 2) {
boss.gotoAndStop(3);
bgs[1] = bgs[1] - 1;
if (bgs[1] <= 0) {
bgd[1] = 0;
bgst[bsn] = 1;
bgsx[bsn] = bgx[1] + 20;
bgsy[bsn] = bgy[1] + 20;
bgsd[bsn] = 0;
bsn = bsn + 1;
if (bsn > 5) {
bsn = 1;
}
}
}
if (bgd[1] == 3) {
boss.gotoAndStop(8);
bgs[1] = bgs[1] - 1;
if (bgs[1] <= 0) {
bgd[1] = 1;
bgst[bsn] = 1;
bgsx[bsn] = bgx[1] - 20;
bgsy[bsn] = bgy[1] + 20;
bgsd[bsn] = 1;
bsn = bsn + 1;
if (bsn > 5) {
bsn = 1;
}
}
}
if (bgd[1] == 4) {
boss.gotoAndStop(3);
bgs[1] = bgs[1] - 1;
if (bgs[1] <= 0) {
bgd[1] = 0;
bgst[bsn] = 2;
bgsx[bsn] = bgx[1] + 40;
bgsy[bsn] = bgy[1] + 20;
bgsd[bsn] = 0;
bsn = bsn + 1;
if (bsn > 5) {
bsn = 1;
}
}
}
if (bgd[1] == 5) {
boss.gotoAndStop(8);
bgs[1] = bgs[1] - 1;
if (bgs[1] <= 0) {
bgd[1] = 1;
bgst[bsn] = 2;
bgsx[bsn] = bgx[1] - 40;
bgsy[bsn] = bgy[1] + 20;
bgsd[bsn] = 1;
bsn = bsn + 1;
if (bsn > 5) {
bsn = 1;
}
}
}
if (bgd[1] == 6) {
boss.gotoAndStop(2);
bgy[1] = bgy[1] - 30;
if (bgy[1] < -50) {
c = random(40);
if ((c >= 0) and (c < 10)) {
jetpass.start();
bgd[1] = 8;
bgs[1] = 25;
bgx[1] = -50;
bgy[1] = 330 - random(100);
}
if ((c >= 10) and (c < 20)) {
jetpass.start();
bgd[1] = 9;
bgs[1] = 25;
bgx[1] = 600;
bgy[1] = 330 - random(100);
}
if (c >= 20) {
bgd[1] = 10;
bgs[1] = 20 + random(20 + Dif);
bgx[1] = 275;
bgy[1] = -200;
}
}
}
if (bgd[1] == 7) {
boss.gotoAndStop(7);
bgy[1] = bgy[1] - 30;
bgs[1] = bgs[1] - 1;
if (bgy[1] < -50) {
c = random(40);
if ((c >= 0) and (c < 10)) {
jetpass.start();
bgd[1] = 8;
bgs[1] = 25;
bgx[1] = -50;
bgy[1] = 330 - random(100);
}
if ((c >= 10) and (c < 20)) {
jetpass.start();
bgd[1] = 9;
bgs[1] = 25;
bgx[1] = 600;
bgy[1] = 330 - random(100);
}
if (c >= 20) {
bgd[1] = 10;
bgs[1] = 10 + random(10 + Dif);
bgx[1] = 275;
bgy[1] = -200;
}
}
}
if (bgd[1] == 8) {
boss.gotoAndStop(4 + random(2));
bgx[1] = bgx[1] + 15;
bgs[1] = bgs[1] - 1;
if (bgx[1] > 600) {
bgd[1] = 11;
bgx[1] = random(450) + 50;
bgy[1] = -100;
}
if (((bgs[1] == 22) or (bgs[1] == 15)) or (bgs[1] == 8)) {
c = 1 + random(2);
if (c == 1) {
machineg.start();
}
if (c == 2) {
cannons.start();
}
bgst[bsn] = c;
bgsx[bsn] = bgx[1] + 20;
bgsy[bsn] = bgy[1] + 40;
bgsd[bsn] = 0;
bsn = bsn + 1;
if (bsn > 5) {
bsn = 1;
}
}
}
if (bgd[1] == 9) {
boss.gotoAndStop(9 + random(2));
bgx[1] = bgx[1] - 15;
bgs[1] = bgs[1] - 1;
if (bgx[1] < -50) {
bgd[1] = 11;
bgx[1] = random(450) + 50;
bgy[1] = -100;
}
if (((bgs[1] == 22) or (bgs[1] == 15)) or (bgs[1] == 8)) {
c = 1 + random(2);
if (c == 1) {
machineg.start();
}
if (c == 2) {
cannons.start();
}
bgst[bsn] = c;
bgsx[bsn] = bgx[1] + 20;
bgsy[bsn] = bgy[1] + 40;
bgsd[bsn] = 1;
bsn = bsn + 1;
if (bsn > 5) {
bsn = 1;
}
}
}
if (bgd[1] == 10) {
boss.gotoAndStop(1);
bgs[1] = bgs[1] - 1;
if (bgs[1] < 0) {
bgd[1] = 11;
bgx[1] = random(450) + 50;
bgy[1] = -100;
}
if ((((((bgs[1] == 0) or (bgs[1] == 7)) or (bgs[1] == 15)) or (bgs[1] == 23)) or (bgs[1] == 31)) or (bgs[1] == 37)) {
cannons.start();
bgst[bsn] = 3;
bgsx[bsn] = (px - 60) + random(120);
bgsy[bsn] = -50;
bgsd[bsn] = 0;
bsn = bsn + 1;
if (bsn > 5) {
bsn = 1;
}
}
}
if (bgd[1] == 11) {
boss.gotoAndStop(2);
bgy[1] = bgy[1] + 30;
if (bgy[1] > 350) {
bgd[1] = random(2);
bgy[1] = 350;
}
}
if (bgd[1] == 14) {
boss.gotoAndStop(10);
if ((bgs[1] == 0) or (bgs[1] == 1)) {
boss.gotoAndStop(16);
}
if ((bgs[1] == 2) or (bgs[1] == 3)) {
boss.gotoAndStop(15);
}
if ((bgs[1] == 4) or (bgs[1] == 5)) {
boss.gotoAndStop(14);
}
if ((bgs[1] == 6) or (bgs[1] == 7)) {
boss.gotoAndStop(13);
}
if ((bgs[1] == 8) or (bgs[1] == 9)) {
boss.gotoAndStop(12);
}
if (bgs[1] == 10) {
boss.gotoAndStop(11);
}
bgs[1] = bgs[1] - 1;
if (bgs[1] < 0) {
gotoAndPlay (142);
}
}
r = 1;
while (r <= 5) {
if (bgst[r] > 0) {
if (bgst[r] == 1) {
if (bgsd[r] == 0) {
if (r == 1) {
bgs1.gotoAndStop(1);
}
if (r == 2) {
bgs2.gotoAndStop(1);
}
if (r == 3) {
bgs3.gotoAndStop(1);
}
if (r == 4) {
bgs4.gotoAndStop(1);
}
if (r == 5) {
bgs5.gotoAndStop(1);
}
bgsx[r] = bgsx[r] + 25;
if (bgsx[r] > 580) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgsd[r] == 1) {
if (r == 1) {
bgs1.gotoAndStop(2);
}
if (r == 2) {
bgs2.gotoAndStop(2);
}
if (r == 3) {
bgs3.gotoAndStop(2);
}
if (r == 4) {
bgs4.gotoAndStop(2);
}
if (r == 5) {
bgs5.gotoAndStop(2);
}
bgsx[r] = bgsx[r] - 25;
if (bgsx[r] < -30) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if ((((((((bgsx[r] - 30) < (px + 10)) and ((bgsx[r] + 30) > (px - 10))) and ((bgsy[r] + 25) > (py + 5))) and ((bgsy[r] - 25) < (py + 20))) and (pcd < 18)) and (i < 1)) and (pl > 0)) {
if ((bgsd[r] == 0) or (bgsd[r] == 2)) {
pcd = 19;
}
if ((bgsd[r] == 1) or (bgsd[r] == 3)) {
pcd = 18;
}
pstep = 2;
pl = pl - 2;
megah.start();
i = 10;
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgst[r] == 2) {
if (bgsd[r] == 0) {
if (r == 1) {
bgs1.gotoAndStop(3 + random(2));
}
if (r == 2) {
bgs2.gotoAndStop(3 + random(2));
}
if (r == 3) {
bgs3.gotoAndStop(3 + random(2));
}
if (r == 4) {
bgs4.gotoAndStop(3 + random(2));
}
if (r == 5) {
bgs5.gotoAndStop(3 + random(2));
}
bgsx[r] = bgsx[r] + 20;
if ((py + 20) < bgsy[r]) {
bgsy[r] = bgsy[r] - 3;
}
if ((py + 20) > bgsy[r]) {
bgsy[r] = bgsy[r] + 3;
}
if (bgsx[r] > 580) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgsd[r] == 1) {
if (r == 1) {
bgs1.gotoAndStop(5 + random(2));
}
if (r == 2) {
bgs2.gotoAndStop(5 + random(2));
}
if (r == 3) {
bgs3.gotoAndStop(5 + random(2));
}
if (r == 4) {
bgs4.gotoAndStop(5 + random(2));
}
if (r == 5) {
bgs5.gotoAndStop(5 + random(2));
}
bgsx[r] = bgsx[r] - 20;
if ((py + 20) < bgsy[r]) {
bgsy[r] = bgsy[r] - 3;
}
if ((py + 20) > bgsy[r]) {
bgsy[r] = bgsy[r] + 3;
}
if (bgsx[r] < -30) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if ((((((((bgsx[r] - 30) < (px + 10)) and ((bgsx[r] + 30) > (px - 10))) and ((bgsy[r] + 25) > (py + 5))) and ((bgsy[r] - 25) < (py + 20))) and (pcd < 18)) and (i < 1)) and (pl > 0)) {
if ((bgsd[r] == 0) or (bgsd[r] == 2)) {
pcd = 19;
}
if ((bgsd[r] == 1) or (bgsd[r] == 3)) {
pcd = 18;
}
pstep = 2;
pl = pl - 3;
megah.start();
i = 10;
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgst[r] == 3) {
if (bgsd[r] == 0) {
if (r == 1) {
bgs1.gotoAndStop(11 + random(2));
}
if (r == 2) {
bgs2.gotoAndStop(11 + random(2));
}
if (r == 3) {
bgs3.gotoAndStop(11 + random(2));
}
if (r == 4) {
bgs4.gotoAndStop(11 + random(2));
}
if (r == 5) {
bgs5.gotoAndStop(11 + random(2));
}
bgsy[r] = bgsy[r] + 30;
if (bgsy[r] > 340) {
baddyd2.start();
bgst[r] = 4;
bgsd[r] = 0;
}
}
if ((((((((bgsx[r] - 12) < (px + 10)) and ((bgsx[r] + 12) > (px - 10))) and ((bgsy[r] + 35) > (py + 5))) and ((bgsy[r] - 35) < (py + 20))) and (pcd < 18)) and (i < 1)) and (pl > 0)) {
if ((bgsd[r] == 0) or (bgsd[r] == 2)) {
pcd = 19;
}
if ((bgsd[r] == 1) or (bgsd[r] == 3)) {
pcd = 18;
}
pstep = 2;
pl = pl - 3;
megah.start();
i = 10;
bgst[r] = 4;
bgsd[r] = 0;
}
}
if (bgst[r] == 4) {
if (bgsd[r] >= 0) {
if (r == 1) {
bgs1.gotoAndStop(7 + bgsd[r]);
}
if (r == 2) {
bgs2.gotoAndStop(7 + bgsd[r]);
}
if (r == 3) {
bgs3.gotoAndStop(7 + bgsd[r]);
}
if (r == 4) {
bgs4.gotoAndStop(7 + bgsd[r]);
}
if (r == 5) {
bgs5.gotoAndStop(7 + bgsd[r]);
}
bgsd[r] = bgsd[r] + 1;
if (bgsd[r] > 3) {
bgst[r] = 0;
bgsd[r] = 0;
bgsx[r] = -500;
bgsy[r] = 0;
}
}
if (((((((((bgsx[r] - 20) - (3 * bgsd[r])) < (px + 10)) and (((bgsx[r] + 20) + (3 * bgsd[r])) > (px - 10))) and ((bgsy[r] + 50) > (py + 5))) and (((bgsy[r] - 10) - (5 * bgsd[r])) < (py + 20))) and (pcd < 18)) and (i < 1)) and (pl > 0)) {
pcd = 18 + random(2);
pstep = 2;
pl = pl - 4;
megah.start();
i = 10;
}
}
}
r++;
}
if ((((((((bgx[1] - 20) < (px + 10)) and ((bgx[1] + 20) > (px - 10))) and ((bgy[1] + 60) > (py + 10))) and ((bgy[1] + 20) < (py + 50))) and (pcd < 18)) and (i < 1)) and (pl > 0)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 2;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 2;
}
megah.start();
i = 10;
}
if (bgy[1] > 350) {
bgy[1] = 350;
}
bgs1._x = bgsx[1] / 2;
bgs1._y = (bgsy[1] / 2) - 20;
bgs2._x = bgsx[2] / 2;
bgs2._y = (bgsy[2] / 2) - 20;
bgs3._x = bgsx[3] / 2;
bgs3._y = (bgsy[3] / 2) - 20;
bgs4._x = bgsx[4] / 2;
bgs4._y = (bgsy[4] / 2) - 20;
bgs5._x = bgsx[5] / 2;
bgs5._y = (bgsy[5] / 2) - 20;
r = 1;
while (r <= 3) {
if (((pst[r] > 0) and (pst[r] < 4)) and (psd[r] == 0)) {
if (r == 1) {
shot1p._x = psx[1] / 2;
shot1p._y = psy[1] / 2;
}
if (r == 2) {
shot2p._x = psx[2] / 2;
shot2p._y = psy[2] / 2;
}
if (r == 3) {
shot3p._x = psx[3] / 2;
shot3p._y = psy[3] / 2;
}
}
if (((pst[r] > 0) and (pst[r] < 4)) and (psd[r] == 1)) {
if (r == 1) {
shot1p._x = psx[1] / 2;
shot1p._y = psy[1] / 2;
}
if (r == 2) {
shot2p._x = psx[2] / 2;
shot2p._y = psy[2] / 2;
}
if (r == 3) {
shot3p._x = psx[3] / 2;
shot3p._y = psy[3] / 2;
}
}
if ((pst[r] == 4) or (pst[r] == 5)) {
if (r == 1) {
shot1p._x = psx[1] / 2;
shot1p._y = psy[1] / 2;
}
if (r == 2) {
shot2p._x = psx[2] / 2;
shot2p._y = psy[2] / 2;
}
if (r == 3) {
shot3p._x = psx[3] / 2;
shot3p._y = psy[3] / 2;
}
}
if (pst[r] == 0) {
if (r == 1) {
shot1p._x = -200;
shot1p._y = (270 + psy[1]) - py;
}
if (r == 2) {
shot2p._x = -200;
shot2p._y = (270 + psy[2]) - py;
}
if (r == 3) {
shot3p._x = -200;
shot3p._y = (270 + psy[3]) - py;
}
}
r++;
}
if (i > 0) {
i = i - 1;
pc._alpha = 50;
}
if (i <= 0) {
i = i - 1;
pc._alpha = 100;
}
if (bi > 0) {
bi = bi - 1;
boss._alpha = 50;
}
if (bi <= 0) {
boss._alpha = 100;
}
if (bcharge > 0) {
charge._alpha = bcharge;
}
charge._x = px / 2;
charge._y = py / 2;
boss._x = bgx[1] / 2;
boss._y = (bgy[1] / 2) - 11;
pc._x = px / 2;
pc._y = py / 2;
lbar._height = 2 * pl;
lbar._y = 120 - (2 * pl);
bbar._height = 2 * bgl[1];
bbar._y = 120 - (2 * bgl[1]);
Frame 231
gotoAndPlay (230);
Frame 232
lbar._height = 2 * pl;
lbar._y = 120 - (2 * pl);
stage._x = (270 - px) / 2;
stage._y = (-725 - py) / 2;
exit._x = ((ex + 275) - px) / 2;
exit._y = ((ey + 275) - py) / 2;
Frame 234
gotoAndPlay (5);
Frame 235
psn = 1;
bstep = 0;
pcd = 0;
bcharge = 0;
r = 1;
while (r <= 5) {
psx[r] = -200;
psy[r] = 0;
pst[r] = 0;
psd[r] = 0;
r++;
}
i = 0;
pl = 50;
px = 950;
py = -525;
r = 0;
while (r <= 26) {
bx[r] = -50;
by[r] = -50;
r++;
}
bx[1] = 1050;
by[1] = -650;
bx[2] = 150;
by[2] = -550;
bx[3] = 650;
by[3] = -550;
bx[4] = 1050;
by[4] = -550;
bx[5] = 150;
by[5] = -450;
bx[6] = 450;
by[6] = -450;
bx[7] = 550;
by[7] = -450;
bx[8] = 750;
by[8] = -450;
bx[9] = 850;
by[9] = -450;
bx[10] = 950;
by[10] = -450;
bx[11] = 150;
by[11] = -350;
bx[12] = 250;
by[12] = -350;
bx[13] = 550;
by[13] = -350;
bx[14] = 150;
by[14] = -250;
bx[15] = 450;
by[15] = -250;
bx[16] = 150;
by[16] = -150;
bx[17] = 550;
by[17] = -150;
bx[18] = 650;
by[18] = -150;
bx[19] = 750;
by[19] = -100;
bx[20] = 250;
by[20] = -50;
bx[21] = 350;
by[21] = 50;
bx[22] = 450;
by[22] = 50;
bx[23] = 550;
by[23] = 100;
bx[24] = 650;
by[24] = 150;
bx[25] = 750;
by[25] = 150;
bsn = 1;
r = 1;
while (r <= 8) {
bgx[r] = -200;
bgy[r] = -200;
bgt[r] = 0;
bgd[r] = -1;
bgs[r] = 0;
r++;
}
r = 1;
while (r <= 5) {
bgsx[r] = -200;
bgsy[r] = 0;
bgst[r] = 0;
bgsd[r] = 0;
r++;
}
r = 1;
while (r <= 8) {
f[r] = 20;
r++;
}
bgt[1] = 1;
bgd[1] = 0;
bgs[1] = 0;
bgl[1] = 3;
bgx[1] = 680;
bgy[1] = -650;
bgt[2] = 2;
bgd[2] = 0;
bgs[2] = 0;
bgl[2] = 3;
bgx[2] = 550;
bgy[2] = -550;
bgt[3] = 2;
bgd[3] = 0;
bgs[3] = 0;
bgl[3] = 3;
bgx[3] = 500;
bgy[3] = -550;
bgt[4] = 3;
bgd[4] = 0;
bgs[4] = 0;
bgl[4] = 5;
bgx[4] = 400;
bgy[4] = -650;
bgt[5] = 14;
bgd[5] = 0;
bgs[5] = 0;
bgl[5] = 3;
bgx[5] = 200;
bgy[5] = -450;
bgt[6] = 14;
bgd[6] = 3;
bgs[6] = 0;
bgl[6] = 3;
bgx[6] = 500;
bgy[6] = -350;
bgt[7] = 3;
bgd[7] = 0;
bgs[7] = 0;
bgl[7] = 5;
bgx[7] = 250;
bgy[7] = -250;
bgt[8] = 2;
bgd[8] = 0;
bgs[8] = 0;
bgl[8] = 3;
bgx[8] = 450;
bgy[8] = -50;
ex = 750;
ey = 50;
stopAllSounds();
Frame 236
pc.gotoAndStop(1);
bg1.gotoAndStop(20);
bg2.gotoAndStop(20);
bg3.gotoAndStop(20);
bg4.gotoAndStop(20);
bg5.gotoAndStop(20);
bg6.gotoAndStop(20);
bg7.gotoAndStop(20);
bg8.gotoAndStop(20);
bgs1.gotoAndStop(20);
bgs2.gotoAndStop(20);
bgs3.gotoAndStop(20);
bgs4.gotoAndStop(20);
bgs5.gotoAndStop(20);
shot1.gotoAndStop(20);
shot2.gotoAndStop(20);
shot3.gotoAndStop(20);
bg1._x = ((bgx[1] + 275) - px) / 2;
bg1._y = ((bgy[1] + 275) - py) / 2;
bg2._x = ((bgx[2] + 275) - px) / 2;
bg2._y = ((bgy[2] + 275) - py) / 2;
bg3._x = ((bgx[3] + 275) - px) / 2;
bg3._y = ((bgy[3] + 275) - py) / 2;
bg4._x = ((bgx[4] + 275) - px) / 2;
bg4._y = ((bgy[4] + 275) - py) / 2;
bg5._x = ((bgx[5] + 275) - px) / 2;
bg5._y = ((bgy[5] + 275) - py) / 2;
bg6._x = ((bgx[6] + 275) - px) / 2;
bg6._y = ((bgy[6] + 275) - py) / 2;
bg7._x = ((bgx[7] + 275) - px) / 2;
bg7._y = ((bgy[7] + 275) - py) / 2;
bg8._x = ((bgx[8] + 275) - px) / 2;
bg8._y = ((bgy[8] + 275) - py) / 2;
lbar._height = 2 * pl;
lbar._y = 120 - (2 * pl);
stage._x = (770 - px) / 2;
stage._y = (175 - py) / 2;
exit._x = ((ex + 275) - px) / 2;
exit._y = ((ey + 275) - py) / 2;
Frame 247
b1._x = bx[1] / 10;
b1._y = (by[1] / 10) + 120;
b2._x = bx[2] / 10;
b2._y = (by[2] / 10) + 120;
b3._x = bx[3] / 10;
b3._y = (by[3] / 10) + 120;
b4._x = bx[4] / 10;
b4._y = (by[4] / 10) + 120;
b5._x = bx[5] / 10;
b5._y = (by[5] / 10) + 120;
b6._x = bx[6] / 10;
b6._y = (by[6] / 10) + 120;
b7._x = bx[7] / 10;
b7._y = (by[7] / 10) + 120;
b8._x = bx[8] / 10;
b8._y = (by[8] / 10) + 120;
b9._x = bx[9] / 10;
b9._y = (by[9] / 10) + 120;
b10._x = bx[10] / 10;
b10._y = (by[10] / 10) + 120;
b11._x = bx[11] / 10;
b11._y = (by[11] / 10) + 120;
b12._x = bx[12] / 10;
b12._y = (by[12] / 10) + 120;
b13._x = bx[13] / 10;
b13._y = (by[13] / 10) + 120;
b14._x = bx[14] / 10;
b14._y = (by[14] / 10) + 120;
b15._x = bx[15] / 10;
b15._y = (by[15] / 10) + 120;
b16._x = bx[16] / 10;
b16._y = (by[16] / 10) + 120;
b17._x = bx[17] / 10;
b17._y = (by[17] / 10) + 120;
b18._x = bx[18] / 10;
b18._y = (by[18] / 10) + 120;
b19._x = bx[19] / 10;
b19._y = (by[19] / 10) + 120;
b20._x = bx[20] / 10;
b20._y = (by[20] / 10) + 120;
b21._x = bx[21] / 10;
b21._y = (by[21] / 10) + 120;
b22._x = bx[22] / 10;
b22._y = (by[22] / 10) + 120;
b23._x = bx[23] / 10;
b23._y = (by[23] / 10) + 120;
b24._x = bx[24] / 10;
b24._y = (by[24] / 10) + 120;
b25._x = bx[25] / 10;
b25._y = (by[25] / 10) + 120;
b26._x = bx[26] / 10;
b26._y = (by[26] / 10) + 120;
b27._x = bx[27] / 10;
b27._y = (by[27] / 10) + 120;
b28._x = bx[28] / 10;
b28._y = (by[28] / 10) + 120;
cir._x = px / 10;
cir._y = (py / 10) + 120;
shot1._x = psx[1] / 10;
shot1._y = (psy[1] / 10) + 120;
shot2._x = psx[2] / 10;
shot2._y = (psy[2] / 10) + 120;
shot3._x = psx[3] / 10;
shot3._y = (psy[3] / 10) + 120;
bshot1._x = bgsx[1] / 10;
bshot1._y = (bgsy[1] / 10) + 120;
bshot2._x = bgsx[2] / 10;
bshot2._y = (bgsy[2] / 10) + 120;
bshot3._x = bgsx[3] / 10;
bshot3._y = (bgsy[3] / 10) + 120;
bshot4._x = bgsx[4] / 10;
bshot4._y = (bgsy[4] / 10) + 120;
bshot5._x = bgsx[5] / 10;
bshot5._y = (bgsy[5] / 10) + 120;
bcir1._x = bgx[1] / 10;
bcir1._y = (bgy[1] / 10) + 120;
bcir2._x = bgx[2] / 10;
bcir2._y = (bgy[2] / 10) + 120;
bcir3._x = bgx[3] / 10;
bcir3._y = (bgy[3] / 10) + 120;
bcir4._x = bgx[4] / 10;
bcir4._y = (bgy[4] / 10) + 120;
bcir5._x = bgx[5] / 10;
bcir5._y = (bgy[5] / 10) + 120;
bcir6._x = bgx[6] / 10;
bcir6._y = (bgy[6] / 10) + 120;
bcir7._x = bgx[7] / 10;
bcir7._y = (bgy[7] / 10) + 120;
bcir8._x = bgx[8] / 10;
bcir8._y = (bgy[8] / 10) + 120;
bcir9._x = bgx[9] / 10;
bcir9._y = (bgy[9] / 10) + 120;
bcir10._x = bgx[10] / 10;
bcir10._y = (bgy[10] / 10) + 120;
bcir11._x = bgx[11] / 10;
bcir11._y = (bgy[11] / 10) + 120;
bcir12._x = bgx[12] / 10;
bcir12._y = (bgy[12] / 10) + 120;
bcir13._x = bgx[13] / 10;
bcir13._y = (bgy[13] / 10) + 120;
if (Key.isDown(39) and (pcd == 0)) {
pcd = 2;
}
if (Key.isDown(39) and ((pcd == 1) or (pcd == 3))) {
pcd = 0;
}
if (Key.isDown(37) and (pcd == 1)) {
pcd = 3;
}
if (Key.isDown(37) and ((pcd == 0) or (pcd == 2))) {
pcd = 1;
}
if (Key.isDown(38) and ((pcd == 0) or (pcd == 2))) {
pcd = 10;
pstep = 7;
}
if (Key.isDown(38) and ((pcd == 1) or (pcd == 3))) {
pcd = 11;
pstep = 7;
}
if (Key.isDown(40) and ((((pcd == 0) or (pcd == 1)) or (pcd == 2)) or (pcd == 3))) {
if (((pcd == 0) or (pcd == 2)) or (pcd == 8)) {
pcd = 6;
pstep = 3;
}
if (((pcd == 1) or (pcd == 3)) or (pcd == 9)) {
pcd = 7;
pstep = 3;
}
}
if (Key.isDown(16) and (bcharge < 100)) {
bcharge = bcharge + 5;
}
if (pcd == 0) {
pc.gotoAndStop(1);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(21);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 0;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
}
if (pcd == 1) {
pc.gotoAndStop(2);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(22);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 1;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
}
if (pcd == 2) {
px = px + 13;
if ((w == 0) or (w == 1)) {
pc.gotoAndStop(3);
}
if ((w == 2) or (w == 3)) {
pc.gotoAndStop(4);
}
if ((w == 4) or (w == 5)) {
pc.gotoAndStop(5);
}
if ((w == 6) or (w == 7)) {
pc.gotoAndStop(6);
}
if (Key.isDown(32)) {
if ((w == 0) or (w == 1)) {
pc.gotoAndStop(11);
}
if ((w == 2) or (w == 3)) {
pc.gotoAndStop(12);
}
if ((w == 4) or (w == 5)) {
pc.gotoAndStop(13);
}
if ((w == 6) or (w == 7)) {
pc.gotoAndStop(14);
}
if ((pst[psn] == 0) and (bstep == 0)) {
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 0;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
}
pcd = 0;
}
if (pcd == 3) {
px = px - 13;
if ((w == 0) or (w == 1)) {
pc.gotoAndStop(7);
}
if ((w == 2) or (w == 3)) {
pc.gotoAndStop(8);
}
if ((w == 4) or (w == 5)) {
pc.gotoAndStop(9);
}
if ((w == 6) or (w == 7)) {
pc.gotoAndStop(10);
}
if (Key.isDown(32)) {
if ((w == 0) or (w == 1)) {
pc.gotoAndStop(15);
}
if ((w == 2) or (w == 3)) {
pc.gotoAndStop(16);
}
if ((w == 4) or (w == 5)) {
pc.gotoAndStop(17);
}
if ((w == 6) or (w == 7)) {
pc.gotoAndStop(18);
}
if ((pst[psn] == 0) and (bstep == 0)) {
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 1;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
}
pcd = 1;
}
if (pcd == 9) {
pstep = pstep - 1;
if (pstep <= 0) {
pcd = 1;
}
}
if (pcd == 6) {
pc.gotoAndStop(19);
px = px + 20;
pstep = pstep - 1;
if (pstep <= 0) {
pcd = 0;
}
}
if (pcd == 7) {
pc.gotoAndStop(20);
px = px - 20;
pstep = pstep - 1;
if (pstep <= 0) {
pcd = 1;
}
}
if (pcd == 12) {
pc.gotoAndStop(23);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(25);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 0;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
py = py + (5 * (7 - pstep));
pstep = pstep - 1;
if (pstep <= 2) {
pstep = 2;
}
if (Key.isDown(39)) {
px = px + 13;
}
if (Key.isDown(37)) {
px = px - 13;
if (bstep == 0) {
pcd = 13;
}
}
}
if (pcd == 13) {
pc.gotoAndStop(24);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(26);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 1;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
py = py + (5 * (7 - pstep));
pstep = pstep - 1;
if (pstep <= 2) {
pstep = 2;
}
if (Key.isDown(39)) {
px = px + 13;
if (bstep == 0) {
pcd = 12;
}
}
if (Key.isDown(37)) {
px = px - 13;
}
}
if (pcd == 10) {
pc.gotoAndStop(23);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(25);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 0;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
py = py - (5 * pstep);
pstep = pstep - 1;
if (Key.isDown(39)) {
px = px + 13;
}
if (Key.isDown(37)) {
px = px - 13;
if (bstep == 0) {
pcd = 11;
}
}
if (Key.isDown(40)) {
pcd = 12;
pstep = pstep + 3;
}
if (pstep <= -1) {
pstep = 7;
pcd = 12;
}
}
if (pcd == 11) {
pc.gotoAndStop(24);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(26);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 1;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
py = py - (5 * pstep);
pstep = pstep - 1;
if (Key.isDown(39)) {
px = px + 13;
if (bstep == 0) {
pcd = 10;
}
}
if (Key.isDown(37)) {
px = px - 13;
}
if (Key.isDown(40)) {
pcd = 13;
pstep = pstep + 3;
}
if (pstep <= -1) {
pstep = 7;
pcd = 13;
}
}
if (pcd == 18) {
pc.gotoAndStop(27);
pstep = pstep - 1;
px = px - 5;
if (pstep <= -1) {
pstep = 2;
pcd = 0;
}
}
if (pcd == 19) {
pc.gotoAndStop(28);
pstep = pstep - 1;
px = px + 5;
if (pstep <= -1) {
pstep = 2;
pcd = 1;
}
}
if (pcd == 20) {
pc.gotoAndStop(69 - pstep);
bcharge = 0;
charge._alpha = 0;
bstep = 20;
pl = 1;
pstep = pstep - 1;
if (pstep < 0) {
lives = lives - 1;
if (lives >= 0) {
pl = 50;
gotoAndPlay (100);
}
if (lives < 0) {
lives = 2;
continues = continues - 1;
gotoAndPlay (5);
}
}
}
if (pl <= 0) {
c = 1;
while (c <= 8) {
bgx[c] = -600;
c++;
}
pc._alpha = 100;
pcd = 20;
pstep = 40;
megad.start();
}
if (bstep > 0) {
bcharge = 0;
charge._alpha = bcharge;
}
if (bstep > 0) {
bstep = bstep - 1;
}
if ((py > 500) and (pcd < 20)) {
megad.start();
pl = 0;
}
w = w - 1;
if (w < 0) {
w = 7;
}
e = pcd;
c = 0;
r = 1;
while (r <= 12) {
if (((((bx[r] - 150) < px) and ((bx[r] + 150) > px)) and ((by[r] - 150) < py)) and ((by[r] + 150) > py)) {
if (((((((px - 30) < (bx[r] + 50)) and ((px + 20) > (bx[r] - 50))) and (py < (by[r] - 50))) and ((py + 60) > (by[r] - 50))) and (pcd != 10)) and (pcd != 11)) {
if ((((pcd == 12) or (pcd == 13)) or (pcd == 16)) or (pcd == 17)) {
if ((pcd == 12) or (pcd == 16)) {
pcd = 0;
}
if ((pcd == 13) or (pcd == 17)) {
pcd = 1;
}
}
c = 1;
py = by[r] - 75;
}
if (((((px + 38) > (bx[r] - 50)) and ((px + 20) < bx[r])) and (py < (by[r] + 50))) and ((py + 20) > (by[r] - 50))) {
px = bx[r] - 85;
}
if (((((px - 35) < (bx[r] + 50)) and ((px - 20) > bx[r])) and (py < (by[r] + 50))) and ((py + 20) > (by[r] - 50))) {
px = bx[r] + 85;
}
if (((((px - 5) < (bx[r] + 50)) and ((px + 5) > (bx[r] - 50))) and ((py - 30) < (by[r] + 50))) and ((py + 10) > (by[r] + 50))) {
if ((((pcd == 10) or (pcd == 11)) or (pcd == 14)) or (pcd == 15)) {
if ((pcd == 10) or (pcd == 14)) {
pcd = 12;
pstep = 5;
}
if ((pcd == 11) or (pcd == 15)) {
pcd = 13;
pstep = 5;
}
}
py = by[r] + 90;
}
}
r++;
}
if (c == 0) {
if ((((pcd == 0) or (pcd == 2)) or (pcd == 6)) or (pcd == 18)) {
pcd = 12;
pstep = 6;
}
if ((((pcd == 1) or (pcd == 3)) or (pcd == 7)) or (pcd == 19)) {
pcd = 13;
pstep = 6;
}
}
r = 1;
while (r <= 3) {
if (pst[r] == 1) {
if (psd[r] == 0) {
psx[r] = psx[r] + 30;
if (r == 1) {
shot1p.gotoAndStop(1);
}
if (r == 2) {
shot2p.gotoAndStop(1);
}
if (r == 3) {
shot3p.gotoAndStop(1);
}
if (psx[r] > (px + 280)) {
pst[r] = 0;
psx[r] = -200;
}
}
if (psd[r] == 1) {
psx[r] = psx[r] - 30;
if (r == 1) {
shot1p.gotoAndStop(2);
}
if (r == 2) {
shot2p.gotoAndStop(2);
}
if (r == 3) {
shot3p.gotoAndStop(2);
}
if (psx[r] < (px - 280)) {
pst[r] = 0;
psx[r] = -200;
}
}
}
if (pst[r] == 2) {
if (psd[r] == 0) {
psx[r] = psx[r] + 35;
if (r == 1) {
shot1p.gotoAndStop(3);
}
if (r == 2) {
shot2p.gotoAndStop(3);
}
if (r == 3) {
shot3p.gotoAndStop(3);
}
if (psx[r] > (px + 280)) {
pst[r] = 0;
psx[r] = -200;
}
}
if (psd[r] == 1) {
psx[r] = psx[r] - 35;
if (r == 1) {
shot1p.gotoAndStop(4);
}
if (r == 2) {
shot2p.gotoAndStop(4);
}
if (r == 3) {
shot3p.gotoAndStop(4);
}
if (psx[r] < (px - 280)) {
pst[r] = 0;
psx[r] = -200;
}
}
}
if (pst[r] == 3) {
if (psd[r] == 0) {
psx[r] = psx[r] + 40;
if (r == 1) {
shot1p.gotoAndStop(5);
}
if (r == 2) {
shot2p.gotoAndStop(5);
}
if (r == 3) {
shot3p.gotoAndStop(5);
}
if (psx[r] > (px + 280)) {
pst[r] = 0;
psx[r] = -200;
}
}
if (psd[r] == 1) {
psx[r] = psx[r] - 40;
if (r == 1) {
shot1p.gotoAndStop(6);
}
if (r == 2) {
shot2p.gotoAndStop(6);
}
if (r == 3) {
shot3p.gotoAndStop(6);
}
if (psx[r] < (px - 280)) {
pst[r] = 0;
psx[r] = -200;
}
}
}
if (pst[r] == 4) {
if (r == 1) {
shot1p.gotoAndStop(10 - psd[r]);
}
if (r == 2) {
shot2p.gotoAndStop(10 - psd[r]);
}
if (r == 3) {
shot3p.gotoAndStop(10 - psd[r]);
}
psd[r] = psd[r] - 1;
if (psd[r] < 0) {
pst[r] = 0;
psx[r] = -200;
}
}
if (pst[r] == 5) {
if (r == 1) {
shot1p.gotoAndStop(14 - psd[r]);
}
if (r == 2) {
shot2p.gotoAndStop(14 - psd[r]);
}
if (r == 3) {
shot3p.gotoAndStop(14 - psd[r]);
}
psd[r] = psd[r] - 1;
if (psd[r] < 0) {
pst[r] = 0;
psx[r] = -200;
}
}
r++;
}
while (c <= 8) {
r = 1;
while (r <= 3) {
if ((pst[r] > 0) and (pst[r] < 4)) {
if (((((bgt[c] == 1) and ((bgx[c] - 35) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 35) > (psx[r] - ((pst[r] * 20) - 20)))) and ((bgy[c] - 5) < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 50) > (psy[r] - ((pst[r] * 20) - 20)))) {
if ((bgd[c] == 0) or (bgd[c] == 2)) {
deflect.start();
pst[r] = 5;
psd[r] = 2;
}
if ((bgd[c] == 1) or (bgd[c] == 3)) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd2.start();
bgd[c] = 4;
bgs[c] = 4;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
if (((((bgt[c] == 2) and ((bgx[c] - 35) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 35) > (psx[r] - ((pst[r] * 20) - 20)))) and (bgy[c] < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 50) > (psy[r] - ((pst[r] * 20) - 20)))) {
if ((((bgd[c] == 0) or (bgd[c] == 3)) or (bgd[c] == 1)) or (bgd[c] == 4)) {
deflect.start();
pst[r] = 5;
psd[r] = 2;
}
if ((bgd[c] == 2) or (bgd[c] == 5)) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd2.start();
bgd[c] = 6;
bgs[c] = 6;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
if (((((bgt[c] == 3) and ((bgx[c] - 35) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 35) > (psx[r] - ((pst[r] * 20) - 20)))) and ((bgy[c] - 20) < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 40) > (psy[r] - ((pst[r] * 20) - 20)))) {
if (bgd[c] == 0) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd2.start();
bgd[c] = 1;
bgs[c] = 4;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
if (((((bgt[c] == 4) and ((bgx[c] - 40) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 40) > (psx[r] - ((pst[r] * 20) - 20)))) and ((bgy[c] - 20) < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 50) > (psy[r] - ((pst[r] * 20) - 20)))) {
if ((bgd[c] == 0) or (bgd[c] == 2)) {
deflect.start();
pst[r] = 5;
psd[r] = 2;
}
if ((bgd[c] == 1) or (bgd[c] == 3)) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd1.start();
bgd[c] = 4;
bgs[c] = 4;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
if (((((bgt[c] == 5) and ((bgx[c] - 40) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 40) > (psx[r] - ((pst[r] * 20) - 20)))) and ((bgy[c] - 20) < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 50) > (psy[r] - ((pst[r] * 20) - 20)))) {
if ((((bgd[c] == 0) or (bgd[c] == 1)) or (bgd[c] == 2)) or (bgd[c] == 3)) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd1.start();
bgd[c] = 4;
bgs[c] = 5;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
if (((((bgt[c] == 6) and ((bgx[c] - 35) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 35) > (psx[r] - ((pst[r] * 20) - 20)))) and ((bgy[c] - 50) < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 20) > (psy[r] - ((pst[r] * 20) - 20)))) {
if ((bgd[c] == 0) or (bgd[c] == 1)) {
deflect.start();
pst[r] = 5;
psd[r] = 2;
}
if (bgd[c] == 2) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd2.start();
bgd[c] = 3;
bgs[c] = 4;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
if (((((bgt[c] == 7) and ((bgx[c] - 35) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 35) > (psx[r] - ((pst[r] * 20) - 20)))) and ((bgy[c] - 50) < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 20) > (psy[r] - ((pst[r] * 20) - 20)))) {
if (bgd[c] == 0) {
deflect.start();
pst[r] = 5;
psd[r] = 2;
}
if ((bgd[c] == 2) or (bgd[c] == 1)) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd2.start();
bgd[c] = 3;
bgs[c] = 3;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
if (((((bgt[c] == 8) and ((bgx[c] - 35) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 35) > (psx[r] - ((pst[r] * 20) - 20)))) and ((bgy[c] - 50) < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 20) > (psy[r] - ((pst[r] * 20) - 20)))) {
if ((bgd[c] == 0) or (bgd[c] == 1)) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd1.start();
bgd[c] = 2;
bgs[c] = 5;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
if (((((bgt[c] == 9) and ((bgx[c] - 40) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 40) > (psx[r] - ((pst[r] * 20) - 20)))) and ((bgy[c] - 20) < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 50) > (psy[r] - ((pst[r] * 20) - 20)))) {
if ((bgd[c] == 0) and (px > bgx[c])) {
deflect.start();
pst[r] = 5;
psd[r] = 2;
}
if ((bgd[c] == 1) and (px < bgx[c])) {
deflect.start();
pst[r] = 5;
psd[r] = 2;
}
if ((bgd[c] == 0) and (px < bgx[c])) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd1.start();
bgd[c] = 4;
bgs[c] = 4;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
if ((bgd[c] == 1) and (px > bgx[c])) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd1.start();
bgd[c] = 2;
bgs[c] = 4;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
if (((((bgt[c] == 10) and ((bgx[c] - 20) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 20) > (psx[r] - ((pst[r] * 20) - 20)))) and ((bgy[c] - 50) < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 20) > (psy[r] - ((pst[r] * 20) - 20)))) {
if ((bgd[c] == 0) or (bgd[c] == 1)) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd2.start();
bgd[c] = 2;
bgs[c] = 3;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
if (((((bgt[c] == 11) and ((bgx[c] - 25) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 25) > (psx[r] - ((pst[r] * 20) - 20)))) and (bgy[c] < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 50) > (psy[r] - ((pst[r] * 20) - 20)))) {
if ((((((bgd[c] == 0) or (bgd[c] == 1)) or (bgd[c] == 2)) or (bgd[c] == 3)) or (bgd[c] == 4)) or (bgd[c] == 5)) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd2.start();
bgd[c] = 6;
bgs[c] = 3;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
if (((((bgt[c] == 12) and ((bgx[c] - 25) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 25) > (psx[r] - ((pst[r] * 20) - 20)))) and (bgy[c] < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 50) > (psy[r] - ((pst[r] * 20) - 20)))) {
if ((bgd[c] == 0) or (bgd[c] == 1)) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd2.start();
bgd[c] = 2;
bgs[c] = 3;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
if (((((bgt[c] == 13) and ((bgx[c] - 35) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 35) > (psx[r] - ((pst[r] * 20) - 20)))) and (bgy[c] < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 60) > (psy[r] - ((pst[r] * 20) - 20)))) {
if ((((((bgd[c] == 0) or (bgd[c] == 1)) or (bgd[c] == 2)) or (bgd[c] == 3)) or (bgd[c] == 4)) or (bgd[c] == 5)) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd1.start();
bgd[c] = 6;
bgs[c] = 4;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
if (((((bgt[c] == 14) and ((bgx[c] - 20) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 20) > (psx[r] - ((pst[r] * 20) - 20)))) and ((bgy[c] - 20) < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 20) > (psy[r] - ((pst[r] * 20) - 20)))) {
if ((((bgd[c] == 0) or (bgd[c] == 1)) or (bgd[c] == 3)) or (bgd[c] == 4)) {
deflect.start();
pst[r] = 5;
psd[r] = 2;
}
if ((bgd[c] == 2) or (bgd[c] == 5)) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd2.start();
bgd[c] = 6;
bgs[c] = 3;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
}
r++;
}
c++;
}
r = 1;
while (r <= 8) {
if (((((bgt[r] > 0) and ((bgx[r] - 340) < px)) and ((bgx[r] + 340) > px)) and ((bgy[r] - 180) < py)) and ((bgy[r] + 350) > py)) {
c = 0;
e = 1;
while (e <= 26) {
if (((((bx[e] - 150) < bgx[r]) and ((bx[e] + 150) > bgx[r])) and ((by[e] - 150) < bgy[r])) and ((by[e] + 150) > bgy[r])) {
if (((((bgx[r] + 20) >= (bx[e] - 50)) and ((bgx[r] - 20) <= (bx[e] + 50))) and ((bgy[r] + 45) > (by[e] - 60))) and ((bgy[r] - 10) < (by[e] - 40))) {
c = 1;
}
if (((((bgx[r] + 20) > (bx[e] - 50)) and ((bgx[r] + 20) < bx[e])) and (bgy[r] < (by[e] + 50))) and ((bgy[r] + 20) > (by[e] - 50))) {
bgx[r] = bx[e] - 70;
}
if (((((bgx[r] - 20) < (bx[e] + 50)) and ((bgx[r] + 20) > bx[e])) and (bgy[r] < (by[e] + 50))) and ((bgy[r] + 20) > (by[e] - 50))) {
bgx[r] = bx[e] + 70;
}
if (((((bgx[r] - 5) < (bx[e] + 50)) and ((bgx[r] + 5) > (bx[e] - 50))) and ((bgy[r] - 30) < (by[e] + 50))) and (bgy[r] > (by[e] + 50))) {
bgy[r] = by[e] + 70;
}
if (((((bgx[r] - 2) < (bx[e] + 50)) and ((bgx[r] + 2) > (bx[e] - 50))) and ((bgy[r] + 20) < (by[e] - 50))) and ((bgy[r] + 60) > (by[e] - 50))) {
c = 1;
bgy[r] = by[e] - 105;
}
}
e++;
}
if (c == 0) {
bgy[r] = bgy[r] + 10;
}
if (bgt[r] == 1) {
if (((((((bgx[r] - 10) < (px + 10)) and ((bgx[r] + 10) > (px - 10))) and ((bgy[r] + 80) > (py + 10))) and ((bgy[r] + 50) < (py + 50))) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 4;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 4;
}
megah.start();
i = 10;
}
if (bgd[r] == 0) {
f[r] = 1;
if (px < bgx[r]) {
bgd[r] = 2;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
joes.start();
bgd[r] = 1;
bgs[r] = 7;
bgst[bsn] = 1;
bgsx[bsn] = bgx[r] - 10;
bgsy[bsn] = bgy[r] + 30;
bgsd[bsn] = 0;
bsn = bsn + 1;
if (bsn > 5) {
bsn = 1;
}
}
}
if (bgd[r] == 2) {
f[r] = 3;
if (px > bgx[r]) {
bgd[r] = 0;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
joes.start();
bgd[r] = 3;
bgs[r] = 7;
bgst[bsn] = 1;
bgsx[bsn] = bgx[r] + 10;
bgsy[bsn] = bgy[r] + 30;
bgsd[bsn] = 1;
bsn = bsn + 1;
if (bsn > 5) {
bsn = 1;
}
}
}
if (bgd[r] == 1) {
f[r] = 2;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 0;
bgs[r] = 20;
}
}
if (bgd[r] == 3) {
f[r] = 4;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 2;
bgs[r] = 20;
}
}
if (bgd[r] == 4) {
if (bgs[r] == 4) {
f[r] = 5;
}
if (bgs[r] == 3) {
f[r] = 6;
}
if (bgs[r] == 2) {
f[r] = 7;
}
if (bgs[r] == 1) {
f[r] = 8;
}
bgy[r] = bgy[r] - 10;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
f[r] = 9;
bgt[r] = 0;
bgx[r] = -500;
bgs[r] = 0;
}
}
}
if (bgt[r] == 2) {
if (((((((bgx[r] - 15) < (px + 10)) and ((bgx[r] + 15) > (px - 10))) and ((bgy[r] + 80) > (py - 10))) and ((bgy[r] + 50) < (py + 50))) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 3;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 3;
}
megah.start();
i = 10;
}
if (bgd[r] == 0) {
f[r] = 1;
if (px < bgx[r]) {
bgd[r] = 3;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 1;
bgs[r] = 10;
}
}
if (bgd[r] == 3) {
f[r] = 5;
if (px > bgx[r]) {
bgd[r] = 0;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 4;
bgs[r] = 10;
}
}
if (bgd[r] == 1) {
f[r] = 2;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 2;
bgs[r] = 12;
}
}
if (bgd[r] == 2) {
if (((bgs[r] == 12) or (bgs[r] == 11)) or (bgs[r] == 10)) {
f[r] = 3;
}
if (((bgs[r] == 9) or (bgs[r] == 8)) or (bgs[r] == 7)) {
f[r] = 4;
}
if (((bgs[r] == 6) or (bgs[r] == 5)) or (bgs[r] == 4)) {
f[r] = 3;
}
if (((bgs[r] == 3) or (bgs[r] == 2)) or (bgs[r] == 1)) {
f[r] = 4;
}
bgx[r] = bgx[r] + 8;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 0;
bgs[r] = 10 + random(20);
}
}
if (bgd[r] == 4) {
f[r] = 6;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 5;
bgs[r] = 12;
}
}
if (bgd[r] == 5) {
if (((bgs[r] == 12) or (bgs[r] == 11)) or (bgs[r] == 10)) {
f[r] = 7;
}
if (((bgs[r] == 9) or (bgs[r] == 8)) or (bgs[r] == 7)) {
f[r] = 8;
}
if (((bgs[r] == 6) or (bgs[r] == 5)) or (bgs[r] == 4)) {
f[r] = 7;
}
if (((bgs[r] == 3) or (bgs[r] == 2)) or (bgs[r] == 1)) {
f[r] = 8;
}
bgx[r] = bgx[r] - 8;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 3;
bgs[r] = 10 + random(20);
}
}
if (bgd[r] == 6) {
if (bgs[r] == 6) {
f[r] = 9;
}
if (bgs[r] == 5) {
f[r] = 10;
}
if (bgs[r] == 4) {
f[r] = 11;
}
if (bgs[r] == 3) {
f[r] = 12;
}
if (bgs[r] == 2) {
f[r] = 13;
}
if (bgs[r] == 1) {
f[r] = 14;
}
bgs[r] = bgs[r] - 1;
bgy[r] = bgy[r] - 10;
if (bgs[r] <= 0) {
f[r] = 15;
bgt[r] = 0;
bgx[r] = -500;
bgs[r] = 0;
}
}
}
if (bgt[r] == 3) {
if ((((((((bgx[r] - 20) < (px + 10)) and ((bgx[r] + 20) > (px - 10))) and ((bgy[r] + 60) > (py + 5))) and ((bgy[r] + 40) < (py + 45))) and (pcd < 18)) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 4;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 4;
}
megah.start();
i = 10;
}
if (bgd[r] == 0) {
if ((bgs[r] == 0) or (bgs[r] == 1)) {
f[r] = 1;
}
if ((bgs[r] == 2) or (bgs[r] == 3)) {
f[r] = 2;
}
if ((bgs[r] == 4) or (bgs[r] == 5)) {
f[r] = 3;
}
if ((bgs[r] == 6) or (bgs[r] == 7)) {
f[r] = 4;
}
if ((bgs[r] == 8) or (bgs[r] == 9)) {
f[r] = 5;
}
if ((bgs[r] == 10) or (bgs[r] == 11)) {
f[r] = 6;
}
if (px < bgx[r]) {
bgx[r] = bgx[r] - 5;
}
if (px > bgx[r]) {
bgx[r] = bgx[r] + 5;
}
if ((py - 20) > bgy[r]) {
bgy[r] = bgy[r] - 5;
}
if ((py - 20) < bgy[r]) {
bgy[r] = bgy[r] - 15;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgs[r] = 11;
}
}
if (bgd[r] == 1) {
if (bgs[r] == 4) {
f[r] = 7;
}
if (bgs[r] == 3) {
f[r] = 8;
}
if (bgs[r] == 2) {
f[r] = 9;
}
if (bgs[r] == 1) {
f[r] = 10;
}
bgs[r] = bgs[r] - 1;
bgy[r] = bgy[r] - 10;
if (bgs[r] <= 0) {
bgx[r] = -500;
f[r] = 11;
bgt[r] = 0;
bgs[r] = 0;
}
}
}
if (bgt[r] == 4) {
if (((((((bgx[r] - 20) < (px + 10)) and ((bgx[r] + 20) > (px - 10))) and ((bgy[r] + 80) > (py + 10))) and ((bgy[r] + 30) < (py + 50))) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 4;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 4;
}
megah.start();
i = 10;
}
if (bgd[r] == 0) {
f[r] = 1;
if ((px - 180) < bgx[r]) {
bgd[r] = 1;
bgs[r] = 4;
}
if (px < bgx[r]) {
bgd[r] = 2;
}
}
if (bgd[r] == 2) {
f[r] = 4;
if ((px + 180) > bgx[r]) {
bgd[r] = 3;
bgs[r] = 4;
}
if (px > bgx[r]) {
bgd[r] = 0;
}
}
if (bgd[r] == 1) {
if ((bgs[r] == 1) or (bgs[r] == 2)) {
f[r] = 2;
}
if ((bgs[r] == 3) or (bgs[r] == 4)) {
f[r] = 3;
}
bgx[r] = bgx[r] + 12;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgs[r] = 4;
}
}
if (bgd[r] == 3) {
if ((bgs[r] == 1) or (bgs[r] == 2)) {
f[r] = 5;
}
if ((bgs[r] == 3) or (bgs[r] == 4)) {
f[r] = 6;
}
bgx[r] = bgx[r] - 12;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgs[r] = 4;
}
}
if (bgd[r] == 4) {
if (bgs[r] == 4) {
f[r] = 7;
}
if (bgs[r] == 3) {
f[r] = 8;
}
if (bgs[r] == 2) {
f[r] = 9;
}
if (bgs[r] == 1) {
f[r] = 10;
}
bgs[r] = bgs[r] - 1;
bgy[r] = bgy[r] - 10;
if (bgs[r] <= 0) {
bgx[r] = -500;
f[r] = 11;
bgt[r] = 0;
bgs[r] = 0;
}
}
}
if (bgt[r] == 5) {
if (((((((bgx[r] - 20) < (px + 10)) and ((bgx[r] + 20) > (px - 10))) and ((bgy[r] + 80) > (py + 10))) and ((bgy[r] + 30) < (py + 50))) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 3;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 3;
}
megah.start();
i = 10;
}
if (bgd[r] == 0) {
f[r] = 1;
if (px < bgx[r]) {
bgd[r] = 2;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
cannons.start();
bgd[r] = 1;
bgs[r] = 8;
bgst[bsn] = 2;
bgsx[bsn] = bgx[r] - 20;
bgsy[bsn] = bgy[r] + 20;
bgsd[bsn] = 0;
bsn = bsn + 1;
if (bsn > 5) {
bsn = 1;
}
}
}
if (bgd[r] == 2) {
f[r] = 3;
if (px > bgx[r]) {
bgd[r] = 0;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
cannons.start();
bgd[r] = 3;
bgs[r] = 7;
bgst[bsn] = 2;
bgsx[bsn] = bgx[r] + 20;
bgsy[bsn] = bgy[r] + 20;
bgsd[bsn] = 1;
bsn = bsn + 1;
if (bsn > 5) {
bsn = 1;
}
}
}
if (bgd[r] == 1) {
f[r] = 2;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 0;
bgs[r] = 10 + random(15);
}
}
if (bgd[r] == 3) {
f[r] = 4;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 2;
bgs[r] = 10 + random(15);
}
}
if (bgd[r] == 4) {
if (bgs[r] == 5) {
f[r] = 5;
}
if (bgs[r] == 4) {
f[r] = 6;
}
if (bgs[r] == 3) {
f[r] = 7;
}
if (bgs[r] == 2) {
f[r] = 8;
}
if (bgs[r] == 1) {
f[r] = 9;
}
bgs[r] = bgs[r] - 1;
bgy[r] = bgy[r] - 10;
if (bgs[r] <= 0) {
f[r] = 10;
bgt[r] = 0;
bgx[r] = -500;
bgs[r] = 0;
}
}
}
if (bgt[r] == 6) {
if (((((((bgx[r] - 10) < (px + 10)) and ((bgx[r] + 10) > (px - 10))) and ((bgy[r] + 50) > (py + 10))) and ((bgy[r] + 10) < (py + 50))) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 4;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 4;
}
megah.start();
i = 10;
}
if (bgd[r] == 0) {
f[r] = 1;
bgy[r] = bgy[r] - 10;
if (((((px - 120) < bgx[r]) and ((px + 120) > bgx[r])) and ((bgy[r] - 80) < py)) and ((bgy[r] + 150) > py)) {
bgd[r] = 1;
bgs[r] = 6;
}
}
if (bgd[r] == 1) {
bgy[r] = bgy[r] - 10;
if (((bgs[r] == 6) or (bgs[r] == 5)) or (bgs[r] == 4)) {
f[r] = 2;
}
if (((bgs[r] == 3) or (bgs[r] == 2)) or (bgs[r] == 1)) {
f[r] = 3;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgs[r] = 4;
bgd[r] = 2;
}
}
if (bgd[r] == 2) {
if ((bgs[r] == 4) or (bgs[r] == 3)) {
f[r] = 4;
}
if ((bgs[r] == 2) or (bgs[r] == 1)) {
f[r] = 5;
}
if (px < bgx[r]) {
bgx[r] = (bgx[r] - 1) - random(10);
}
if (px > bgx[r]) {
bgx[r] = (bgx[r] + 1) + random(10);
}
if (py > bgy[r]) {
bgy[r] = bgy[r] + random(8);
}
if (py < bgy[r]) {
bgy[r] = (bgy[r] - 10) - random(10);
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgs[r] = 4;
}
}
if (bgd[r] == 3) {
if (bgs[r] == 4) {
f[r] = 6;
}
if (bgs[r] == 3) {
f[r] = 7;
}
if (bgs[r] == 2) {
f[r] = 8;
}
if (bgs[r] == 1) {
f[r] = 9;
}
bgs[r] = bgs[r] - 1;
bgy[r] = bgy[r] - 10;
if (bgs[r] <= 0) {
f[r] = 10;
bgt[r] = 0;
bgx[r] = -500;
bgs[r] = 0;
}
}
}
if (bgt[r] == 7) {
if (((((((bgx[r] - 20) < (px + 10)) and ((bgx[r] + 20) > (px - 10))) and ((bgy[r] + 20) > (py + 10))) and ((bgy[r] + 20) < (py + 50))) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 3;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 3;
}
megah.start();
i = 10;
}
if (bgd[r] == 0) {
f[r] = 1;
bgy[r] = bgy[r] - 10;
if ((px + 80) < bgx[r]) {
bgx[r] = bgx[r] - 5;
}
if ((px - 80) > bgx[r]) {
bgx[r] = bgx[r] + 5;
}
if ((py - 70) < bgy[r]) {
bgy[r] = bgy[r] - 5;
}
if ((py - 70) > bgy[r]) {
bgy[r] = bgy[r] + 5;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
joes.start();
if (px > bgx[r]) {
bgd[r] = 1;
}
if (px < bgx[r]) {
bgd[r] = 2;
}
if (px < bgx[r]) {
bgsd[bsn] = 3;
if ((py - 50) < bgy[r]) {
bgsd[bsn] = 1;
}
}
if (px > bgx[r]) {
bgsd[bsn] = 2;
if ((py - 50) < bgy[r]) {
bgsd[bsn] = 0;
}
}
bgs[r] = 12;
bgst[bsn] = 1;
bgsx[bsn] = bgx[r];
bgsy[bsn] = bgy[r];
bsn = bsn + 1;
if (bsn > 5) {
bsn = 1;
}
}
}
if (bgd[r] == 1) {
f[r] = 2;
bgy[r] = bgy[r] - 10;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 0;
bgs[r] = 10 + random(25);
}
}
if (bgd[r] == 2) {
f[r] = 3;
bgy[r] = bgy[r] - 10;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 0;
bgs[r] = 10 + random(25);
}
}
if (bgd[r] == 3) {
if (bgs[r] == 3) {
f[r] = 4;
}
if (bgs[r] == 2) {
f[r] = 5;
}
if (bgs[r] == 1) {
f[r] = 6;
}
bgs[r] = bgs[r] - 1;
bgy[r] = bgy[r] - 10;
if (bgs[r] <= 0) {
f[r] = 7;
bgt[r] = 0;
bgx[r] = -500;
bgs[r] = 0;
}
}
}
if (bgt[r] == 8) {
if (((((((bgx[r] - 20) < (px + 10)) and ((bgx[r] + 20) > (px - 10))) and ((bgy[r] + 35) > (py + 10))) and ((bgy[r] + 20) < (py + 50))) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 8;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 8;
}
bgd[r] = 2;
bgs[r] = 10;
baddyd1.start();
i = 10;
}
if (bgd[r] == 0) {
f[r] = 1;
bgx[r] = bgx[r] + 20;
if ((py + 30) > bgy[r]) {
bgy[r] = bgy[r] - 8;
}
if ((py + 30) < bgy[r]) {
bgy[r] = bgy[r] - 12;
}
if ((px + 100) < bgx[r]) {
bgd[r] = 1;
}
}
if (bgd[r] == 1) {
f[r] = 2;
bgx[r] = bgx[r] - 20;
if ((py + 30) > bgy[r]) {
bgy[r] = bgy[r] - 8;
}
if ((py + 30) < bgy[r]) {
bgy[r] = bgy[r] - 12;
}
if ((px - 100) > bgx[r]) {
bgd[r] = 0;
}
}
if (bgd[r] == 2) {
if (bgs[r] == 5) {
f[r] = 3;
}
if (bgs[r] == 4) {
f[r] = 4;
}
if (bgs[r] == 3) {
f[r] = 5;
}
if (bgs[r] == 2) {
f[r] = 6;
}
if (bgs[r] == 1) {
f[r] = 7;
}
bgs[r] = bgs[r] - 1;
bgy[r] = bgy[r] - 10;
if (bgs[r] <= 0) {
bgx[r] = -500;
f[r] = 8;
bgt[r] = 0;
bgs[r] = 0;
}
}
}
if (bgt[r] == 9) {
if (((((((bgx[r] - 30) < (px + 10)) and ((bgx[r] + 30) > (px - 10))) and ((bgy[r] + 55) > (py + 10))) and ((bgy[r] + 20) < (py + 50))) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 5;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 5;
}
megah.start();
i = 10;
}
if (bgd[r] == 0) {
if ((bgs[r] == 1) or (bgs[r] == 2)) {
f[r] = 1;
}
if ((bgs[r] == 3) or (bgs[r] == 4)) {
f[r] = 2;
}
bgx[r] = bgx[r] + 8;
if ((px + 80) < bgx[r]) {
bgd[r] = 1;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgs[r] = 4;
}
}
if (bgd[r] == 1) {
if ((bgs[r] == 1) or (bgs[r] == 2)) {
f[r] = 3;
}
if ((bgs[r] == 3) or (bgs[r] == 4)) {
f[r] = 4;
}
bgx[r] = bgx[r] - 8;
if ((px - 80) > bgx[r]) {
bgd[r] = 0;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgs[r] = 4;
}
}
if (bgd[r] == 2) {
if (bgs[r] == 4) {
f[r] = 5;
}
if (bgs[r] == 3) {
f[r] = 6;
}
if (bgs[r] == 2) {
f[r] = 7;
}
if (bgs[r] == 1) {
f[r] = 8;
}
bgs[r] = bgs[r] - 1;
bgy[r] = bgy[r] - 10;
if (bgs[r] <= 0) {
bgx[r] = -500;
f[r] = 9;
bgt[r] = 0;
bgs[r] = 0;
}
}
}
if (bgt[r] == 10) {
if (((((((bgx[r] - 20) < (px + 10)) and ((bgx[r] + 20) > (px - 10))) and ((bgy[r] + 20) > (py + 10))) and ((bgy[r] + 20) < (py + 50))) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 2;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 2;
}
megah.start();
i = 10;
}
if (bgd[r] == 0) {
f[r] = 1;
bgy[r] = bgy[r] - 10;
if (px < bgx[r]) {
bgx[r] = bgx[r] - 7;
}
if (px > bgx[r]) {
bgx[r] = bgx[r] + 7;
}
if ((py - 80) < bgy[r]) {
bgy[r] = bgy[r] - 8;
}
if ((py - 80) > bgy[r]) {
bgy[r] = bgy[r] + 8;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
joes.start();
bgd[r] = 1;
bgsd[bsn] = 4;
bgs[r] = 5;
bgst[bsn] = 1;
bgsx[bsn] = bgx[r];
bgsy[bsn] = bgy[r];
bsn = bsn + 1;
if (bsn > 5) {
bsn = 1;
}
}
}
if (bgd[r] == 1) {
f[r] = 2;
bgy[r] = bgy[r] - 10;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 0;
bgs[r] = 6 + random(16);
}
}
if (bgd[r] == 2) {
if (bgs[r] == 3) {
f[r] = 3;
}
if (bgs[r] == 2) {
f[r] = 4;
}
if (bgs[r] == 1) {
f[r] = 5;
}
bgs[r] = bgs[r] - 1;
bgy[r] = bgy[r] - 10;
if (bgs[r] <= 0) {
f[r] = 7;
bgt[r] = 0;
bgx[r] = -500;
bgs[r] = 0;
}
}
}
if (bgt[r] == 11) {
if (((((((bgx[r] - 20) < (px + 10)) and ((bgx[r] + 20) > (px - 10))) and ((bgy[r] + 50) > (py - 10))) and (bgy[r] < (py + 50))) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 3;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 3;
}
megah.start();
i = 10;
}
if (bgd[r] == 0) {
if (((bgs[r] == 12) or (bgs[r] == 11)) or (bgs[r] == 10)) {
f[r] = 1;
}
if (((bgs[r] == 9) or (bgs[r] == 8)) or (bgs[r] == 7)) {
f[r] = 2;
}
if (((bgs[r] == 6) or (bgs[r] == 5)) or (bgs[r] == 4)) {
f[r] = 1;
}
if (((bgs[r] == 3) or (bgs[r] == 2)) or (bgs[r] == 1)) {
f[r] = 2;
}
if (bgx[r] > px) {
bgd[r] = 3;
bgs[r] = 12;
}
bgx[r] = bgx[r] + 6;
if (((bgx[r] + 150) > (px - 20)) and (bgx[r] < px)) {
bgd[r] = 1;
bgs[r] = 9;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgs[r] = 12;
}
}
if (bgd[r] == 1) {
f[r] = 3;
bgx[r] = bgx[r] + 12;
bgy[r] = bgy[r] - 20;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 2;
bgs[r] = 10;
}
}
if (bgd[r] == 2) {
f[r] = 3;
bgx[r] = bgx[r] + 12;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 0;
bgs[r] = 12;
}
}
if (bgd[r] == 3) {
if (((bgs[r] == 12) or (bgs[r] == 11)) or (bgs[r] == 10)) {
f[r] = 4;
}
if (((bgs[r] == 9) or (bgs[r] == 8)) or (bgs[r] == 7)) {
f[r] = 5;
}
if (((bgs[r] == 6) or (bgs[r] == 5)) or (bgs[r] == 4)) {
f[r] = 4;
}
if (((bgs[r] == 3) or (bgs[r] == 2)) or (bgs[r] == 1)) {
f[r] = 5;
}
if (bgx[r] < px) {
bgd[r] = 0;
bgs[r] = 12;
}
bgx[r] = bgx[r] - 6;
if (((bgx[r] - 150) < (px - 20)) and (bgx[r] > px)) {
bgd[r] = 4;
bgs[r] = 9;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgs[r] = 12;
}
}
if (bgd[r] == 4) {
f[r] = 6;
bgx[r] = bgx[r] - 12;
bgy[r] = bgy[r] - 20;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 5;
bgs[r] = 10;
}
}
if (bgd[r] == 5) {
f[r] = 6;
bgx[r] = bgx[r] - 12;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 3;
bgs[r] = 12;
}
}
if (bgd[r] == 6) {
if (bgs[r] == 3) {
f[r] = 7;
}
if (bgs[r] == 2) {
f[r] = 8;
}
if (bgs[r] == 1) {
f[r] = 9;
}
bgs[r] = bgs[r] - 1;
bgy[r] = bgy[r] - 10;
if (bgs[r] <= 0) {
f[r] = 15;
bgt[r] = 0;
bgx[r] = -500;
bgs[r] = 0;
}
}
}
if (bgt[r] == 12) {
if (((((((bgx[r] - 20) < (px + 10)) and ((bgx[r] + 20) > (px - 10))) and ((bgy[r] + 40) > py)) and ((bgy[r] - 20) < (py + 50))) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 3;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 3;
}
megah.start();
i = 10;
}
if (bgd[r] == 0) {
if (bgs[r] == 1) {
f[r] = 1;
}
if (bgs[r] == 2) {
f[r] = 2;
}
bgy[r] = bgy[r] - 10;
bgx[r] = bgx[r] + 7;
if ((py - 60) < bgy[r]) {
bgy[r] = bgy[r] - 5;
}
if ((((px - 70) < bgx[r]) and ((px + 70) > bgx[r])) and (py > bgy[r])) {
bgy[r] = bgy[r] + 12;
}
if ((px + 100) < bgx[r]) {
bgd[r] = 1;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgs[r] = 2;
}
}
if (bgd[r] == 1) {
if (bgs[r] == 1) {
f[r] = 3;
}
if (bgs[r] == 2) {
f[r] = 4;
}
bgy[r] = bgy[r] - 10;
bgx[r] = bgx[r] - 7;
if ((py - 60) < bgy[r]) {
bgy[r] = bgy[r] - 5;
}
if ((((px - 70) < bgx[r]) and ((px + 70) > bgx[r])) and (py > bgy[r])) {
bgy[r] = bgy[r] + 12;
}
if ((px - 100) > bgx[r]) {
bgd[r] = 0;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgs[r] = 2;
}
}
if (bgd[r] == 2) {
if (bgs[r] == 4) {
f[r] = 5;
}
if (bgs[r] == 3) {
f[r] = 6;
}
if (bgs[r] == 2) {
f[r] = 7;
}
if (bgs[r] == 1) {
f[r] = 8;
}
bgs[r] = bgs[r] - 1;
bgy[r] = bgy[r] - 10;
if (bgs[r] <= 0) {
bgx[r] = -500;
f[r] = 9;
bgt[r] = 0;
bgs[r] = 0;
}
}
}
if (bgt[r] == 13) {
if (((((((bgx[r] - 50) < (px + 10)) and ((bgx[r] + 50) > (px - 10))) and ((bgy[r] + 70) > (py + 10))) and (bgy[r] < (py + 50))) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 4;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 4;
}
megah.start();
i = 10;
}
if (bgd[r] == 0) {
f[r] = 1;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
if ((px - 170) < bgx[r]) {
bgd[r] = 1;
bgs[r] = 7;
}
}
if (px < bgx[r]) {
bgd[r] = 3;
}
}
if (bgd[r] == 1) {
f[r] = 2;
bgx[r] = bgx[r] + 30;
bgy[r] = bgy[r] - 20;
if (bgy[r] < py) {
bgy[r] = bgy[r] + 10;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 2;
bgs[r] = 12;
}
}
if (bgd[r] == 2) {
f[r] = 3;
bgx[r] = bgx[r] + 5;
bgy[r] = bgy[r] + 2;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 0;
bgs[r] = random(12);
}
}
if (bgd[r] == 3) {
f[r] = 4;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
if ((px + 170) > bgx[r]) {
bgd[r] = 4;
bgs[r] = 7;
}
}
if (px > bgx[r]) {
bgd[r] = 0;
}
}
if (bgd[r] == 4) {
f[r] = 5;
bgx[r] = bgx[r] - 30;
bgy[r] = bgy[r] - 20;
bgs[r] = bgs[r] - 1;
if (bgy[r] < py) {
bgy[r] = bgy[r] + 10;
}
if (bgs[r] <= 0) {
bgd[r] = 5;
bgs[r] = 12;
}
}
if (bgd[r] == 5) {
f[r] = 6;
bgx[r] = bgx[r] - 5;
bgy[r] = bgy[r] + 2;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 3;
bgs[r] = random(12);
}
}
if (bgd[r] == 6) {
if (bgs[r] == 4) {
f[r] = 7;
}
if (bgs[r] == 3) {
f[r] = 8;
}
if (bgs[r] == 2) {
f[r] = 9;
}
if (bgs[r] == 1) {
f[r] = 10;
}
bgs[r] = bgs[r] - 1;
bgy[r] = bgy[r] - 10;
if (bgs[r] <= 0) {
bgx[r] = -500;
f[r] = 11;
bgt[r] = 0;
bgs[r] = 0;
}
}
}
if (bgt[r] == 14) {
if (((((((bgx[r] - 20) < (px + 10)) and ((bgx[r] + 20) > (px - 10))) and ((bgy[r] + 50) > (py + 10))) and ((bgy[r] + 20) < (py + 50))) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 2;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 2;
}
megah.start();
i = 10;
}
if (bgt[r] > 0) {
bgy[r] = bgy[r] - 10;
}
if (bgd[r] == 0) {
f[r] = 1;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 1;
bgs[r] = 6;
}
}
if (bgd[r] == 1) {
if (((bgs[r] == 6) or (bgs[r] == 5)) or (bgs[r] == 4)) {
f[r] = 2;
}
if (((bgs[r] == 3) or (bgs[r] == 2)) or (bgs[r] == 1)) {
f[r] = 3;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 2;
bgs[r] = 15;
}
}
if (bgd[r] == 2) {
f[r] = 4;
if (((bgs[r] == 15) or (bgs[r] == 10)) or (bgs[r] == 5)) {
cannons.start();
bgst[bsn] = 2;
bgsx[bsn] = bgx[r] + 20;
bgsy[bsn] = bgy[r];
bgsd[bsn] = 0;
bsn = bsn + 1;
if (bsn > 5) {
bsn = 1;
}
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 0;
bgs[r] = 20;
}
}
if (bgd[r] == 3) {
f[r] = 5;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 4;
bgs[r] = 6;
}
}
if (bgd[r] == 4) {
if (((bgs[r] == 6) or (bgs[r] == 5)) or (bgs[r] == 4)) {
f[r] = 6;
}
if (((bgs[r] == 3) or (bgs[r] == 2)) or (bgs[r] == 1)) {
f[r] = 7;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 5;
bgs[r] = 15;
}
}
if (bgd[r] == 5) {
f[r] = 8;
if (((bgs[r] == 15) or (bgs[r] == 10)) or (bgs[r] == 5)) {
cannons.start();
bgst[bsn] = 2;
bgsx[bsn] = bgx[r] - 20;
bgsy[bsn] = bgy[r];
bgsd[bsn] = 1;
bsn = bsn + 1;
if (bsn > 5) {
bsn = 1;
}
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 3;
bgs[r] = 20;
}
}
if (bgd[r] == 6) {
if (bgs[r] == 2) {
f[r] = 9;
}
if (bgs[r] == 1) {
f[r] = 10;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
f[r] = 11;
bgt[r] = 0;
bgx[r] = -500;
bgs[r] = 0;
}
}
}
}
r++;
}
r = 1;
while (r <= 5) {
if (bgst[r] > 0) {
if (bgst[r] == 1) {
if (r == 1) {
bgs1.gotoAndStop(1);
}
if (r == 2) {
bgs2.gotoAndStop(1);
}
if (r == 3) {
bgs3.gotoAndStop(1);
}
if (r == 4) {
bgs4.gotoAndStop(1);
}
if (r == 5) {
bgs5.gotoAndStop(1);
}
if (bgsd[r] == 0) {
bgsx[r] = bgsx[r] + 20;
if (bgsx[r] > (px + 300)) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgsd[r] == 1) {
bgsx[r] = bgsx[r] - 20;
if (bgsx[r] < (px - 300)) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgsd[r] == 2) {
bgsx[r] = bgsx[r] + 15;
bgsy[r] = bgsy[r] + 15;
if ((bgsx[r] > (px + 300)) or (bgsy[r] > (py + 300))) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgsd[r] == 3) {
bgsx[r] = bgsx[r] - 15;
bgsy[r] = bgsy[r] + 15;
if ((bgsx[r] > (px + 300)) or (bgsy[r] > (py + 300))) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgsd[r] == 4) {
bgsy[r] = bgsy[r] + 20;
if (bgsy[r] > (py + 300)) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (((((((bgsx[r] - 15) < (px + 10)) and ((bgsx[r] + 15) > (px - 10))) and ((bgsy[r] + 15) > (py + 5))) and ((bgsy[r] - 15) < (py + 20))) and (pcd < 18)) and (i < 1)) {
if ((bgsd[r] == 0) or (bgsd[r] == 2)) {
pcd = 19;
}
if ((bgsd[r] == 1) or (bgsd[r] == 3)) {
pcd = 18;
}
pstep = 2;
pl = pl - 3;
megah.start();
i = 10;
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgst[r] == 2) {
if (r == 1) {
bgs1.gotoAndStop(2);
}
if (r == 2) {
bgs2.gotoAndStop(2);
}
if (r == 3) {
bgs3.gotoAndStop(2);
}
if (r == 4) {
bgs4.gotoAndStop(2);
}
if (r == 5) {
bgs5.gotoAndStop(2);
}
if (bgsd[r] == 0) {
bgsx[r] = bgsx[r] + 30;
if (bgsx[r] > (px + 300)) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgsd[r] == 1) {
bgsx[r] = bgsx[r] - 30;
if (bgsx[r] < (px - 300)) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (((((((bgsx[r] - 25) < (px + 10)) and ((bgsx[r] + 25) > (px - 10))) and ((bgsy[r] + 80) > (py + 40))) and ((bgsy[r] + 35) < (py + 60))) and (pcd < 18)) and (i < 1)) {
if (bgsd[r] == 0) {
pcd = 19;
}
if (bgsd[r] == 1) {
pcd = 18;
}
pstep = 2;
pl = pl - 6;
megah.start();
i = 10;
bgst[r] = 0;
bgsx[r] = -200;
}
}
}
r++;
}
bg1.gotoAndStop(f[1]);
bg2.gotoAndStop(f[2]);
bg3.gotoAndStop(f[3]);
bg4.gotoAndStop(f[4]);
bg5.gotoAndStop(f[5]);
bg6.gotoAndStop(f[6]);
bg7.gotoAndStop(f[7]);
bg8.gotoAndStop(f[8]);
bgs1._x = ((bgsx[1] + 275) - px) / 2;
bgs1._y = ((bgsy[1] + 275) - py) / 2;
bgs2._x = ((bgsx[2] + 275) - px) / 2;
bgs2._y = ((bgsy[2] + 275) - py) / 2;
bgs3._x = ((bgsx[3] + 275) - px) / 2;
bgs3._y = ((bgsy[3] + 275) - py) / 2;
bgs4._x = ((bgsx[4] + 275) - px) / 2;
bgs4._y = ((bgsy[4] + 275) - py) / 2;
bgs5._x = ((bgsx[5] + 275) - px) / 2;
bgs5._y = ((bgsy[5] + 275) - py) / 2;
bg1._x = ((bgx[1] + 275) - px) / 2;
bg1._y = ((bgy[1] + 275) - py) / 2;
bg2._x = ((bgx[2] + 275) - px) / 2;
bg2._y = ((bgy[2] + 275) - py) / 2;
bg3._x = ((bgx[3] + 275) - px) / 2;
bg3._y = ((bgy[3] + 275) - py) / 2;
bg4._x = ((bgx[4] + 275) - px) / 2;
bg4._y = ((bgy[4] + 275) - py) / 2;
bg5._x = ((bgx[5] + 275) - px) / 2;
bg5._y = ((bgy[5] + 275) - py) / 2;
bg6._x = ((bgx[6] + 275) - px) / 2;
bg6._y = ((bgy[6] + 275) - py) / 2;
bg7._x = ((bgx[7] + 275) - px) / 2;
bg7._y = ((bgy[7] + 275) - py) / 2;
bg8._x = ((bgx[8] + 275) - px) / 2;
bg8._y = ((bgy[8] + 275) - py) / 2;
r = 1;
while (r <= 3) {
if (((pst[r] > 0) and (pst[r] < 4)) and (psd[r] == 0)) {
if (r == 1) {
shot1p._x = ((297 + psx[1]) - px) / 2;
shot1p._y = ((270 + psy[1]) - py) / 2;
}
if (r == 2) {
shot2p._x = ((297 + psx[2]) - px) / 2;
shot2p._y = ((270 + psy[2]) - py) / 2;
}
if (r == 3) {
shot3p._x = ((297 + psx[3]) - px) / 2;
shot3p._y = ((270 + psy[3]) - py) / 2;
}
}
if (((pst[r] > 0) and (pst[r] < 4)) and (psd[r] == 1)) {
if (r == 1) {
shot1p._x = ((247 + psx[1]) - px) / 2;
shot1p._y = ((270 + psy[1]) - py) / 2;
}
if (r == 2) {
shot2p._x = ((247 + psx[2]) - px) / 2;
shot2p._y = ((270 + psy[2]) - py) / 2;
}
if (r == 3) {
shot3p._x = ((247 + psx[3]) - px) / 2;
shot3p._y = ((270 + psy[3]) - py) / 2;
}
}
if ((pst[r] == 4) or (pst[r] == 5)) {
if (r == 1) {
shot1p._x = ((272 + psx[1]) - px) / 2;
shot1p._y = ((270 + psy[1]) - py) / 2;
}
if (r == 2) {
shot2p._x = ((272 + psx[2]) - px) / 2;
shot2p._y = ((270 + psy[2]) - py) / 2;
}
if (r == 3) {
shot3p._x = ((272 + psx[3]) - px) / 2;
shot3p._y = ((270 + psy[3]) - py) / 2;
}
}
if (pst[r] == 0) {
if (r == 1) {
shot1p._x = -200;
shot1p._y = (270 + psy[1]) - py;
}
if (r == 2) {
shot2p._x = -200;
shot2p._y = (270 + psy[2]) - py;
}
if (r == 3) {
shot3p._x = -200;
shot3p._y = (270 + psy[3]) - py;
}
}
r++;
}
if (i > 0) {
i = i - 1;
pc._alpha = 50;
}
if (i <= 0) {
i = i - 1;
pc._alpha = 100;
}
if (bcharge > 0) {
charge._alpha = bcharge;
}
lbar._height = 2 * pl;
lbar._y = 120 - (2 * pl);
stage._x = (770 - px) / 2;
stage._y = (175 - py) / 2;
exit._x = ((ex + 275) - px) / 2;
exit._y = ((ey + 275) - py) / 2;
Frame 248
gotoAndPlay (18);
if ((((px + 10) > (ex - 20)) and ((px - 10) < (ex + 20))) and (((py + 30) > (ey - 20)) and (py < (ey + 50)))) {
gotoAndPlay (20);
}
Frame 249
lbar._height = 2 * pl;
lbar._y = 120 - (2 * pl);
stage._x = (275 - px) / 2;
stage._y = (-225 - py) / 2;
exit._x = ((ex + 275) - px) / 2;
exit._y = ((ey + 275) - py) / 2;
Frame 252
psn = 1;
bstep = 0;
pcd = 0;
bcharge = 0;
r = 1;
while (r <= 5) {
psx[r] = -200;
psy[r] = 0;
pst[r] = 0;
psd[r] = 0;
r++;
}
i = 0;
pl = pl + 5;
if (pl > 50) {
pl = 50;
}
px = 950;
py = -525;
r = 0;
while (r <= 26) {
bx[r] = -50;
by[r] = -50;
r++;
}
bx[1] = 1050;
by[1] = -650;
bx[2] = 150;
by[2] = -550;
bx[3] = 650;
by[3] = -550;
bx[4] = 1050;
by[4] = -550;
bx[5] = 150;
by[5] = -450;
bx[6] = 450;
by[6] = -450;
bx[7] = 550;
by[7] = -450;
bx[8] = 750;
by[8] = -450;
bx[9] = 850;
by[9] = -450;
bx[10] = 950;
by[10] = -450;
bx[11] = 150;
by[11] = -350;
bx[12] = 250;
by[12] = -350;
bx[13] = 550;
by[13] = -350;
bx[14] = 150;
by[14] = -250;
bx[15] = 450;
by[15] = -250;
bx[16] = 150;
by[16] = -150;
bx[17] = 550;
by[17] = -150;
bx[18] = 650;
by[18] = -150;
bx[19] = 750;
by[19] = -100;
bx[20] = 250;
by[20] = -50;
bx[21] = 350;
by[21] = 50;
bx[22] = 450;
by[22] = 50;
bx[23] = 550;
by[23] = 100;
bx[24] = 650;
by[24] = 150;
bx[25] = 750;
by[25] = 150;
bsn = 1;
r = 1;
while (r <= 8) {
bgx[r] = -200;
bgy[r] = -200;
bgt[r] = 0;
bgd[r] = -1;
bgs[r] = 0;
r++;
}
r = 1;
while (r <= 5) {
bgsx[r] = -200;
bgsy[r] = 0;
bgst[r] = 0;
bgsd[r] = 0;
r++;
}
r = 1;
while (r <= 8) {
f[r] = 20;
r++;
}
bgt[1] = 1;
bgd[1] = 0;
bgs[1] = 0;
bgl[1] = 3;
bgx[1] = 680;
bgy[1] = -650;
bgt[2] = 2;
bgd[2] = 0;
bgs[2] = 0;
bgl[2] = 3;
bgx[2] = 550;
bgy[2] = -550;
bgt[3] = 2;
bgd[3] = 0;
bgs[3] = 0;
bgl[3] = 3;
bgx[3] = 500;
bgy[3] = -550;
bgt[4] = 3;
bgd[4] = 0;
bgs[4] = 0;
bgl[4] = 5;
bgx[4] = 400;
bgy[4] = -650;
bgt[5] = 14;
bgd[5] = 0;
bgs[5] = 0;
bgl[5] = 3;
bgx[5] = 200;
bgy[5] = -450;
bgt[6] = 14;
bgd[6] = 3;
bgs[6] = 0;
bgl[6] = 3;
bgx[6] = 500;
bgy[6] = -350;
bgt[7] = 3;
bgd[7] = 0;
bgs[7] = 0;
bgl[7] = 5;
bgx[7] = 250;
bgy[7] = -250;
bgt[8] = 2;
bgd[8] = 0;
bgs[8] = 0;
bgl[8] = 3;
bgx[8] = 450;
bgy[8] = -50;
ex = 750;
ey = 50;
Frame 253
b1._x = bx[1] / 10;
b1._y = (by[1] / 10) + 120;
b2._x = bx[2] / 10;
b2._y = (by[2] / 10) + 120;
b3._x = bx[3] / 10;
b3._y = (by[3] / 10) + 120;
b4._x = bx[4] / 10;
b4._y = (by[4] / 10) + 120;
b5._x = bx[5] / 10;
b5._y = (by[5] / 10) + 120;
b6._x = bx[6] / 10;
b6._y = (by[6] / 10) + 120;
b7._x = bx[7] / 10;
b7._y = (by[7] / 10) + 120;
b8._x = bx[8] / 10;
b8._y = (by[8] / 10) + 120;
b9._x = bx[9] / 10;
b9._y = (by[9] / 10) + 120;
b10._x = bx[10] / 10;
b10._y = (by[10] / 10) + 120;
b11._x = bx[11] / 10;
b11._y = (by[11] / 10) + 120;
b12._x = bx[12] / 10;
b12._y = (by[12] / 10) + 120;
b13._x = bx[13] / 10;
b13._y = (by[13] / 10) + 120;
b14._x = bx[14] / 10;
b14._y = (by[14] / 10) + 120;
b15._x = bx[15] / 10;
b15._y = (by[15] / 10) + 120;
b16._x = bx[16] / 10;
b16._y = (by[16] / 10) + 120;
b17._x = bx[17] / 10;
b17._y = (by[17] / 10) + 120;
b18._x = bx[18] / 10;
b18._y = (by[18] / 10) + 120;
b19._x = bx[19] / 10;
b19._y = (by[19] / 10) + 120;
b20._x = bx[20] / 10;
b20._y = (by[20] / 10) + 120;
b21._x = bx[21] / 10;
b21._y = (by[21] / 10) + 120;
b22._x = bx[22] / 10;
b22._y = (by[22] / 10) + 120;
b23._x = bx[23] / 10;
b23._y = (by[23] / 10) + 120;
b24._x = bx[24] / 10;
b24._y = (by[24] / 10) + 120;
b25._x = bx[25] / 10;
b25._y = (by[25] / 10) + 120;
b26._x = bx[26] / 10;
b26._y = (by[26] / 10) + 120;
b27._x = bx[27] / 10;
b27._y = (by[27] / 10) + 120;
b28._x = bx[28] / 10;
b28._y = (by[28] / 10) + 120;
cir._x = px / 10;
cir._y = (py / 10) + 120;
shot1._x = psx[1] / 10;
shot1._y = (psy[1] / 10) + 120;
shot2._x = psx[2] / 10;
shot2._y = (psy[2] / 10) + 120;
shot3._x = psx[3] / 10;
shot3._y = (psy[3] / 10) + 120;
bshot1._x = bgsx[1] / 10;
bshot1._y = (bgsy[1] / 10) + 120;
bshot2._x = bgsx[2] / 10;
bshot2._y = (bgsy[2] / 10) + 120;
bshot3._x = bgsx[3] / 10;
bshot3._y = (bgsy[3] / 10) + 120;
bshot4._x = bgsx[4] / 10;
bshot4._y = (bgsy[4] / 10) + 120;
bshot5._x = bgsx[5] / 10;
bshot5._y = (bgsy[5] / 10) + 120;
bcir1._x = bgx[1] / 10;
bcir1._y = (bgy[1] / 10) + 120;
bcir2._x = bgx[2] / 10;
bcir2._y = (bgy[2] / 10) + 120;
bcir3._x = bgx[3] / 10;
bcir3._y = (bgy[3] / 10) + 120;
bcir4._x = bgx[4] / 10;
bcir4._y = (bgy[4] / 10) + 120;
bcir5._x = bgx[5] / 10;
bcir5._y = (bgy[5] / 10) + 120;
bcir6._x = bgx[6] / 10;
bcir6._y = (bgy[6] / 10) + 120;
bcir7._x = bgx[7] / 10;
bcir7._y = (bgy[7] / 10) + 120;
bcir8._x = bgx[8] / 10;
bcir8._y = (bgy[8] / 10) + 120;
bcir9._x = bgx[9] / 10;
bcir9._y = (bgy[9] / 10) + 120;
bcir10._x = bgx[10] / 10;
bcir10._y = (bgy[10] / 10) + 120;
bcir11._x = bgx[11] / 10;
bcir11._y = (bgy[11] / 10) + 120;
bcir12._x = bgx[12] / 10;
bcir12._y = (bgy[12] / 10) + 120;
bcir13._x = bgx[13] / 10;
bcir13._y = (bgy[13] / 10) + 120;
if (Key.isDown(39) and (pcd == 0)) {
pcd = 2;
}
if (Key.isDown(39) and ((pcd == 1) or (pcd == 3))) {
pcd = 0;
}
if (Key.isDown(37) and (pcd == 1)) {
pcd = 3;
}
if (Key.isDown(37) and ((pcd == 0) or (pcd == 2))) {
pcd = 1;
}
if (Key.isDown(38) and ((pcd == 0) or (pcd == 2))) {
pcd = 10;
pstep = 7;
}
if (Key.isDown(38) and ((pcd == 1) or (pcd == 3))) {
pcd = 11;
pstep = 7;
}
if (Key.isDown(40) and ((((pcd == 0) or (pcd == 1)) or (pcd == 2)) or (pcd == 3))) {
if (((pcd == 0) or (pcd == 2)) or (pcd == 8)) {
pcd = 6;
pstep = 3;
}
if (((pcd == 1) or (pcd == 3)) or (pcd == 9)) {
pcd = 7;
pstep = 3;
}
}
if (Key.isDown(16) and (bcharge < 100)) {
bcharge = bcharge + 5;
}
if (pcd == 0) {
pc.gotoAndStop(1);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(21);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 0;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
}
if (pcd == 1) {
pc.gotoAndStop(2);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(22);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 1;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
}
if (pcd == 2) {
px = px + 13;
if ((w == 0) or (w == 1)) {
pc.gotoAndStop(3);
}
if ((w == 2) or (w == 3)) {
pc.gotoAndStop(4);
}
if ((w == 4) or (w == 5)) {
pc.gotoAndStop(5);
}
if ((w == 6) or (w == 7)) {
pc.gotoAndStop(6);
}
if (Key.isDown(32)) {
if ((w == 0) or (w == 1)) {
pc.gotoAndStop(11);
}
if ((w == 2) or (w == 3)) {
pc.gotoAndStop(12);
}
if ((w == 4) or (w == 5)) {
pc.gotoAndStop(13);
}
if ((w == 6) or (w == 7)) {
pc.gotoAndStop(14);
}
if ((pst[psn] == 0) and (bstep == 0)) {
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 0;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
}
pcd = 0;
}
if (pcd == 3) {
px = px - 13;
if ((w == 0) or (w == 1)) {
pc.gotoAndStop(7);
}
if ((w == 2) or (w == 3)) {
pc.gotoAndStop(8);
}
if ((w == 4) or (w == 5)) {
pc.gotoAndStop(9);
}
if ((w == 6) or (w == 7)) {
pc.gotoAndStop(10);
}
if (Key.isDown(32)) {
if ((w == 0) or (w == 1)) {
pc.gotoAndStop(15);
}
if ((w == 2) or (w == 3)) {
pc.gotoAndStop(16);
}
if ((w == 4) or (w == 5)) {
pc.gotoAndStop(17);
}
if ((w == 6) or (w == 7)) {
pc.gotoAndStop(18);
}
if ((pst[psn] == 0) and (bstep == 0)) {
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 1;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
}
pcd = 1;
}
if (pcd == 9) {
pstep = pstep - 1;
if (pstep <= 0) {
pcd = 1;
}
}
if (pcd == 6) {
pc.gotoAndStop(19);
px = px + 20;
pstep = pstep - 1;
if (pstep <= 0) {
pcd = 0;
}
}
if (pcd == 7) {
pc.gotoAndStop(20);
px = px - 20;
pstep = pstep - 1;
if (pstep <= 0) {
pcd = 1;
}
}
if (pcd == 12) {
pc.gotoAndStop(23);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(25);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 0;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
py = py + (5 * (7 - pstep));
pstep = pstep - 1;
if (pstep <= 2) {
pstep = 2;
}
if (Key.isDown(39)) {
px = px + 13;
}
if (Key.isDown(37)) {
px = px - 13;
if (bstep == 0) {
pcd = 13;
}
}
}
if (pcd == 13) {
pc.gotoAndStop(24);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(26);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 1;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
py = py + (5 * (7 - pstep));
pstep = pstep - 1;
if (pstep <= 2) {
pstep = 2;
}
if (Key.isDown(39)) {
px = px + 13;
if (bstep == 0) {
pcd = 12;
}
}
if (Key.isDown(37)) {
px = px - 13;
}
}
if (pcd == 10) {
pc.gotoAndStop(23);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(25);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 0;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
py = py - (5 * pstep);
pstep = pstep - 1;
if (Key.isDown(39)) {
px = px + 13;
}
if (Key.isDown(37)) {
px = px - 13;
if (bstep == 0) {
pcd = 11;
}
}
if (Key.isDown(40)) {
pcd = 12;
pstep = pstep + 3;
}
if (pstep <= -1) {
pstep = 7;
pcd = 12;
}
}
if (pcd == 11) {
pc.gotoAndStop(24);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(26);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 1;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
py = py - (5 * pstep);
pstep = pstep - 1;
if (Key.isDown(39)) {
px = px + 13;
if (bstep == 0) {
pcd = 10;
}
}
if (Key.isDown(37)) {
px = px - 13;
}
if (Key.isDown(40)) {
pcd = 13;
pstep = pstep + 3;
}
if (pstep <= -1) {
pstep = 7;
pcd = 13;
}
}
if (pcd == 18) {
pc.gotoAndStop(27);
pstep = pstep - 1;
px = px - 5;
if (pstep <= -1) {
pstep = 2;
pcd = 0;
}
}
if (pcd == 19) {
pc.gotoAndStop(28);
pstep = pstep - 1;
px = px + 5;
if (pstep <= -1) {
pstep = 2;
pcd = 1;
}
}
if (pcd == 20) {
pc.gotoAndStop(69 - pstep);
bcharge = 0;
charge._alpha = 0;
bstep = 20;
pl = 1;
pstep = pstep - 1;
if (pstep < 0) {
lives = lives - 1;
if (lives >= 0) {
pl = 50;
gotoAndPlay (100);
}
if (lives < 0) {
lives = 2;
continues = continues - 1;
gotoAndPlay (5);
}
}
}
if (pl <= 0) {
c = 1;
while (c <= 8) {
bgx[c] = -600;
c++;
}
pc._alpha = 100;
pcd = 20;
pstep = 40;
megad.start();
}
if (bstep > 0) {
bcharge = 0;
charge._alpha = bcharge;
}
if (bstep > 0) {
bstep = bstep - 1;
}
if ((py > 500) and (pcd < 20)) {
megad.start();
pl = 0;
}
w = w - 1;
if (w < 0) {
w = 7;
}
e = pcd;
c = 0;
r = 1;
while (r <= 12) {
if (((((bx[r] - 150) < px) and ((bx[r] + 150) > px)) and ((by[r] - 150) < py)) and ((by[r] + 150) > py)) {
if (((((((px - 30) < (bx[r] + 50)) and ((px + 20) > (bx[r] - 50))) and (py < (by[r] - 50))) and ((py + 60) > (by[r] - 50))) and (pcd != 10)) and (pcd != 11)) {
if ((((pcd == 12) or (pcd == 13)) or (pcd == 16)) or (pcd == 17)) {
if ((pcd == 12) or (pcd == 16)) {
pcd = 0;
}
if ((pcd == 13) or (pcd == 17)) {
pcd = 1;
}
}
c = 1;
py = by[r] - 75;
}
if (((((px + 38) > (bx[r] - 50)) and ((px + 20) < bx[r])) and (py < (by[r] + 50))) and ((py + 20) > (by[r] - 50))) {
px = bx[r] - 85;
}
if (((((px - 35) < (bx[r] + 50)) and ((px - 20) > bx[r])) and (py < (by[r] + 50))) and ((py + 20) > (by[r] - 50))) {
px = bx[r] + 85;
}
if (((((px - 5) < (bx[r] + 50)) and ((px + 5) > (bx[r] - 50))) and ((py - 30) < (by[r] + 50))) and ((py + 10) > (by[r] + 50))) {
if ((((pcd == 10) or (pcd == 11)) or (pcd == 14)) or (pcd == 15)) {
if ((pcd == 10) or (pcd == 14)) {
pcd = 12;
pstep = 5;
}
if ((pcd == 11) or (pcd == 15)) {
pcd = 13;
pstep = 5;
}
}
py = by[r] + 90;
}
}
r++;
}
if (c == 0) {
if ((((pcd == 0) or (pcd == 2)) or (pcd == 6)) or (pcd == 18)) {
pcd = 12;
pstep = 6;
}
if ((((pcd == 1) or (pcd == 3)) or (pcd == 7)) or (pcd == 19)) {
pcd = 13;
pstep = 6;
}
}
r = 1;
while (r <= 3) {
if (pst[r] == 1) {
if (psd[r] == 0) {
psx[r] = psx[r] + 30;
if (r == 1) {
shot1p.gotoAndStop(1);
}
if (r == 2) {
shot2p.gotoAndStop(1);
}
if (r == 3) {
shot3p.gotoAndStop(1);
}
if (psx[r] > (px + 280)) {
pst[r] = 0;
psx[r] = -200;
}
}
if (psd[r] == 1) {
psx[r] = psx[r] - 30;
if (r == 1) {
shot1p.gotoAndStop(2);
}
if (r == 2) {
shot2p.gotoAndStop(2);
}
if (r == 3) {
shot3p.gotoAndStop(2);
}
if (psx[r] < (px - 280)) {
pst[r] = 0;
psx[r] = -200;
}
}
}
if (pst[r] == 2) {
if (psd[r] == 0) {
psx[r] = psx[r] + 35;
if (r == 1) {
shot1p.gotoAndStop(3);
}
if (r == 2) {
shot2p.gotoAndStop(3);
}
if (r == 3) {
shot3p.gotoAndStop(3);
}
if (psx[r] > (px + 280)) {
pst[r] = 0;
psx[r] = -200;
}
}
if (psd[r] == 1) {
psx[r] = psx[r] - 35;
if (r == 1) {
shot1p.gotoAndStop(4);
}
if (r == 2) {
shot2p.gotoAndStop(4);
}
if (r == 3) {
shot3p.gotoAndStop(4);
}
if (psx[r] < (px - 280)) {
pst[r] = 0;
psx[r] = -200;
}
}
}
if (pst[r] == 3) {
if (psd[r] == 0) {
psx[r] = psx[r] + 40;
if (r == 1) {
shot1p.gotoAndStop(5);
}
if (r == 2) {
shot2p.gotoAndStop(5);
}
if (r == 3) {
shot3p.gotoAndStop(5);
}
if (psx[r] > (px + 280)) {
pst[r] = 0;
psx[r] = -200;
}
}
if (psd[r] == 1) {
psx[r] = psx[r] - 40;
if (r == 1) {
shot1p.gotoAndStop(6);
}
if (r == 2) {
shot2p.gotoAndStop(6);
}
if (r == 3) {
shot3p.gotoAndStop(6);
}
if (psx[r] < (px - 280)) {
pst[r] = 0;
psx[r] = -200;
}
}
}
if (pst[r] == 4) {
if (r == 1) {
shot1p.gotoAndStop(10 - psd[r]);
}
if (r == 2) {
shot2p.gotoAndStop(10 - psd[r]);
}
if (r == 3) {
shot3p.gotoAndStop(10 - psd[r]);
}
psd[r] = psd[r] - 1;
if (psd[r] < 0) {
pst[r] = 0;
psx[r] = -200;
}
}
if (pst[r] == 5) {
if (r == 1) {
shot1p.gotoAndStop(14 - psd[r]);
}
if (r == 2) {
shot2p.gotoAndStop(14 - psd[r]);
}
if (r == 3) {
shot3p.gotoAndStop(14 - psd[r]);
}
psd[r] = psd[r] - 1;
if (psd[r] < 0) {
pst[r] = 0;
psx[r] = -200;
}
}
r++;
}
while (c <= 8) {
r = 1;
while (r <= 3) {
if ((pst[r] > 0) and (pst[r] < 4)) {
if (((((bgt[c] == 1) and ((bgx[c] - 35) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 35) > (psx[r] - ((pst[r] * 20) - 20)))) and ((bgy[c] - 5) < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 50) > (psy[r] - ((pst[r] * 20) - 20)))) {
if ((bgd[c] == 0) or (bgd[c] == 2)) {
deflect.start();
pst[r] = 5;
psd[r] = 2;
}
if ((bgd[c] == 1) or (bgd[c] == 3)) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd2.start();
bgd[c] = 4;
bgs[c] = 4;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
if (((((bgt[c] == 2) and ((bgx[c] - 35) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 35) > (psx[r] - ((pst[r] * 20) - 20)))) and (bgy[c] < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 50) > (psy[r] - ((pst[r] * 20) - 20)))) {
if ((((bgd[c] == 0) or (bgd[c] == 3)) or (bgd[c] == 1)) or (bgd[c] == 4)) {
deflect.start();
pst[r] = 5;
psd[r] = 2;
}
if ((bgd[c] == 2) or (bgd[c] == 5)) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd2.start();
bgd[c] = 6;
bgs[c] = 6;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
if (((((bgt[c] == 3) and ((bgx[c] - 35) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 35) > (psx[r] - ((pst[r] * 20) - 20)))) and ((bgy[c] - 20) < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 40) > (psy[r] - ((pst[r] * 20) - 20)))) {
if (bgd[c] == 0) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd2.start();
bgd[c] = 1;
bgs[c] = 4;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
if (((((bgt[c] == 4) and ((bgx[c] - 40) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 40) > (psx[r] - ((pst[r] * 20) - 20)))) and ((bgy[c] - 20) < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 50) > (psy[r] - ((pst[r] * 20) - 20)))) {
if ((bgd[c] == 0) or (bgd[c] == 2)) {
deflect.start();
pst[r] = 5;
psd[r] = 2;
}
if ((bgd[c] == 1) or (bgd[c] == 3)) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd1.start();
bgd[c] = 4;
bgs[c] = 4;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
if (((((bgt[c] == 5) and ((bgx[c] - 40) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 40) > (psx[r] - ((pst[r] * 20) - 20)))) and ((bgy[c] - 20) < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 50) > (psy[r] - ((pst[r] * 20) - 20)))) {
if ((((bgd[c] == 0) or (bgd[c] == 1)) or (bgd[c] == 2)) or (bgd[c] == 3)) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd1.start();
bgd[c] = 4;
bgs[c] = 5;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
if (((((bgt[c] == 6) and ((bgx[c] - 35) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 35) > (psx[r] - ((pst[r] * 20) - 20)))) and ((bgy[c] - 50) < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 20) > (psy[r] - ((pst[r] * 20) - 20)))) {
if ((bgd[c] == 0) or (bgd[c] == 1)) {
deflect.start();
pst[r] = 5;
psd[r] = 2;
}
if (bgd[c] == 2) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd2.start();
bgd[c] = 3;
bgs[c] = 4;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
if (((((bgt[c] == 7) and ((bgx[c] - 35) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 35) > (psx[r] - ((pst[r] * 20) - 20)))) and ((bgy[c] - 50) < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 20) > (psy[r] - ((pst[r] * 20) - 20)))) {
if (bgd[c] == 0) {
deflect.start();
pst[r] = 5;
psd[r] = 2;
}
if ((bgd[c] == 2) or (bgd[c] == 1)) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd2.start();
bgd[c] = 3;
bgs[c] = 3;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
if (((((bgt[c] == 8) and ((bgx[c] - 35) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 35) > (psx[r] - ((pst[r] * 20) - 20)))) and ((bgy[c] - 50) < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 20) > (psy[r] - ((pst[r] * 20) - 20)))) {
if ((bgd[c] == 0) or (bgd[c] == 1)) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd1.start();
bgd[c] = 2;
bgs[c] = 5;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
if (((((bgt[c] == 9) and ((bgx[c] - 40) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 40) > (psx[r] - ((pst[r] * 20) - 20)))) and ((bgy[c] - 20) < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 50) > (psy[r] - ((pst[r] * 20) - 20)))) {
if ((bgd[c] == 0) and (px > bgx[c])) {
deflect.start();
pst[r] = 5;
psd[r] = 2;
}
if ((bgd[c] == 1) and (px < bgx[c])) {
deflect.start();
pst[r] = 5;
psd[r] = 2;
}
if ((bgd[c] == 0) and (px < bgx[c])) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd1.start();
bgd[c] = 4;
bgs[c] = 4;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
if ((bgd[c] == 1) and (px > bgx[c])) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd1.start();
bgd[c] = 2;
bgs[c] = 4;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
if (((((bgt[c] == 10) and ((bgx[c] - 20) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 20) > (psx[r] - ((pst[r] * 20) - 20)))) and ((bgy[c] - 50) < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 20) > (psy[r] - ((pst[r] * 20) - 20)))) {
if ((bgd[c] == 0) or (bgd[c] == 1)) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd2.start();
bgd[c] = 2;
bgs[c] = 3;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
if (((((bgt[c] == 11) and ((bgx[c] - 25) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 25) > (psx[r] - ((pst[r] * 20) - 20)))) and (bgy[c] < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 50) > (psy[r] - ((pst[r] * 20) - 20)))) {
if ((((((bgd[c] == 0) or (bgd[c] == 1)) or (bgd[c] == 2)) or (bgd[c] == 3)) or (bgd[c] == 4)) or (bgd[c] == 5)) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd2.start();
bgd[c] = 6;
bgs[c] = 3;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
if (((((bgt[c] == 12) and ((bgx[c] - 25) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 25) > (psx[r] - ((pst[r] * 20) - 20)))) and (bgy[c] < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 50) > (psy[r] - ((pst[r] * 20) - 20)))) {
if ((bgd[c] == 0) or (bgd[c] == 1)) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd2.start();
bgd[c] = 2;
bgs[c] = 3;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
if (((((bgt[c] == 13) and ((bgx[c] - 35) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 35) > (psx[r] - ((pst[r] * 20) - 20)))) and (bgy[c] < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 60) > (psy[r] - ((pst[r] * 20) - 20)))) {
if ((((((bgd[c] == 0) or (bgd[c] == 1)) or (bgd[c] == 2)) or (bgd[c] == 3)) or (bgd[c] == 4)) or (bgd[c] == 5)) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd1.start();
bgd[c] = 6;
bgs[c] = 4;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
if (((((bgt[c] == 14) and ((bgx[c] - 20) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 20) > (psx[r] - ((pst[r] * 20) - 20)))) and ((bgy[c] - 20) < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 20) > (psy[r] - ((pst[r] * 20) - 20)))) {
if ((((bgd[c] == 0) or (bgd[c] == 1)) or (bgd[c] == 3)) or (bgd[c] == 4)) {
deflect.start();
pst[r] = 5;
psd[r] = 2;
}
if ((bgd[c] == 2) or (bgd[c] == 5)) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd2.start();
bgd[c] = 6;
bgs[c] = 3;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
}
r++;
}
c++;
}
r = 1;
while (r <= 8) {
if (((((bgt[r] > 0) and ((bgx[r] - 340) < px)) and ((bgx[r] + 340) > px)) and ((bgy[r] - 180) < py)) and ((bgy[r] + 350) > py)) {
c = 0;
e = 1;
while (e <= 26) {
if (((((bx[e] - 150) < bgx[r]) and ((bx[e] + 150) > bgx[r])) and ((by[e] - 150) < bgy[r])) and ((by[e] + 150) > bgy[r])) {
if (((((bgx[r] + 20) >= (bx[e] - 50)) and ((bgx[r] - 20) <= (bx[e] + 50))) and ((bgy[r] + 45) > (by[e] - 60))) and ((bgy[r] - 10) < (by[e] - 40))) {
c = 1;
}
if (((((bgx[r] + 20) > (bx[e] - 50)) and ((bgx[r] + 20) < bx[e])) and (bgy[r] < (by[e] + 50))) and ((bgy[r] + 20) > (by[e] - 50))) {
bgx[r] = bx[e] - 70;
}
if (((((bgx[r] - 20) < (bx[e] + 50)) and ((bgx[r] + 20) > bx[e])) and (bgy[r] < (by[e] + 50))) and ((bgy[r] + 20) > (by[e] - 50))) {
bgx[r] = bx[e] + 70;
}
if (((((bgx[r] - 5) < (bx[e] + 50)) and ((bgx[r] + 5) > (bx[e] - 50))) and ((bgy[r] - 30) < (by[e] + 50))) and (bgy[r] > (by[e] + 50))) {
bgy[r] = by[e] + 70;
}
if (((((bgx[r] - 2) < (bx[e] + 50)) and ((bgx[r] + 2) > (bx[e] - 50))) and ((bgy[r] + 20) < (by[e] - 50))) and ((bgy[r] + 60) > (by[e] - 50))) {
c = 1;
bgy[r] = by[e] - 105;
}
}
e++;
}
if (c == 0) {
bgy[r] = bgy[r] + 10;
}
if (bgt[r] == 1) {
if (((((((bgx[r] - 10) < (px + 10)) and ((bgx[r] + 10) > (px - 10))) and ((bgy[r] + 80) > (py + 10))) and ((bgy[r] + 50) < (py + 50))) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 4;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 4;
}
megah.start();
i = 10;
}
if (bgd[r] == 0) {
f[r] = 1;
if (px < bgx[r]) {
bgd[r] = 2;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
joes.start();
bgd[r] = 1;
bgs[r] = 7;
bgst[bsn] = 1;
bgsx[bsn] = bgx[r] - 10;
bgsy[bsn] = bgy[r] + 30;
bgsd[bsn] = 0;
bsn = bsn + 1;
if (bsn > 5) {
bsn = 1;
}
}
}
if (bgd[r] == 2) {
f[r] = 3;
if (px > bgx[r]) {
bgd[r] = 0;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
joes.start();
bgd[r] = 3;
bgs[r] = 7;
bgst[bsn] = 1;
bgsx[bsn] = bgx[r] + 10;
bgsy[bsn] = bgy[r] + 30;
bgsd[bsn] = 1;
bsn = bsn + 1;
if (bsn > 5) {
bsn = 1;
}
}
}
if (bgd[r] == 1) {
f[r] = 2;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 0;
bgs[r] = 20;
}
}
if (bgd[r] == 3) {
f[r] = 4;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 2;
bgs[r] = 20;
}
}
if (bgd[r] == 4) {
if (bgs[r] == 4) {
f[r] = 5;
}
if (bgs[r] == 3) {
f[r] = 6;
}
if (bgs[r] == 2) {
f[r] = 7;
}
if (bgs[r] == 1) {
f[r] = 8;
}
bgy[r] = bgy[r] - 10;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
f[r] = 9;
bgt[r] = 0;
bgx[r] = -500;
bgs[r] = 0;
}
}
}
if (bgt[r] == 2) {
if (((((((bgx[r] - 15) < (px + 10)) and ((bgx[r] + 15) > (px - 10))) and ((bgy[r] + 80) > (py - 10))) and ((bgy[r] + 50) < (py + 50))) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 3;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 3;
}
megah.start();
i = 10;
}
if (bgd[r] == 0) {
f[r] = 1;
if (px < bgx[r]) {
bgd[r] = 3;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 1;
bgs[r] = 10;
}
}
if (bgd[r] == 3) {
f[r] = 5;
if (px > bgx[r]) {
bgd[r] = 0;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 4;
bgs[r] = 10;
}
}
if (bgd[r] == 1) {
f[r] = 2;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 2;
bgs[r] = 12;
}
}
if (bgd[r] == 2) {
if (((bgs[r] == 12) or (bgs[r] == 11)) or (bgs[r] == 10)) {
f[r] = 3;
}
if (((bgs[r] == 9) or (bgs[r] == 8)) or (bgs[r] == 7)) {
f[r] = 4;
}
if (((bgs[r] == 6) or (bgs[r] == 5)) or (bgs[r] == 4)) {
f[r] = 3;
}
if (((bgs[r] == 3) or (bgs[r] == 2)) or (bgs[r] == 1)) {
f[r] = 4;
}
bgx[r] = bgx[r] + 8;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 0;
bgs[r] = 10 + random(20);
}
}
if (bgd[r] == 4) {
f[r] = 6;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 5;
bgs[r] = 12;
}
}
if (bgd[r] == 5) {
if (((bgs[r] == 12) or (bgs[r] == 11)) or (bgs[r] == 10)) {
f[r] = 7;
}
if (((bgs[r] == 9) or (bgs[r] == 8)) or (bgs[r] == 7)) {
f[r] = 8;
}
if (((bgs[r] == 6) or (bgs[r] == 5)) or (bgs[r] == 4)) {
f[r] = 7;
}
if (((bgs[r] == 3) or (bgs[r] == 2)) or (bgs[r] == 1)) {
f[r] = 8;
}
bgx[r] = bgx[r] - 8;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 3;
bgs[r] = 10 + random(20);
}
}
if (bgd[r] == 6) {
if (bgs[r] == 6) {
f[r] = 9;
}
if (bgs[r] == 5) {
f[r] = 10;
}
if (bgs[r] == 4) {
f[r] = 11;
}
if (bgs[r] == 3) {
f[r] = 12;
}
if (bgs[r] == 2) {
f[r] = 13;
}
if (bgs[r] == 1) {
f[r] = 14;
}
bgs[r] = bgs[r] - 1;
bgy[r] = bgy[r] - 10;
if (bgs[r] <= 0) {
f[r] = 15;
bgt[r] = 0;
bgx[r] = -500;
bgs[r] = 0;
}
}
}
if (bgt[r] == 3) {
if ((((((((bgx[r] - 20) < (px + 10)) and ((bgx[r] + 20) > (px - 10))) and ((bgy[r] + 60) > (py + 5))) and ((bgy[r] + 40) < (py + 45))) and (pcd < 18)) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 4;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 4;
}
megah.start();
i = 10;
}
if (bgd[r] == 0) {
if ((bgs[r] == 0) or (bgs[r] == 1)) {
f[r] = 1;
}
if ((bgs[r] == 2) or (bgs[r] == 3)) {
f[r] = 2;
}
if ((bgs[r] == 4) or (bgs[r] == 5)) {
f[r] = 3;
}
if ((bgs[r] == 6) or (bgs[r] == 7)) {
f[r] = 4;
}
if ((bgs[r] == 8) or (bgs[r] == 9)) {
f[r] = 5;
}
if ((bgs[r] == 10) or (bgs[r] == 11)) {
f[r] = 6;
}
if (px < bgx[r]) {
bgx[r] = bgx[r] - 5;
}
if (px > bgx[r]) {
bgx[r] = bgx[r] + 5;
}
if ((py - 20) > bgy[r]) {
bgy[r] = bgy[r] - 5;
}
if ((py - 20) < bgy[r]) {
bgy[r] = bgy[r] - 15;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgs[r] = 11;
}
}
if (bgd[r] == 1) {
if (bgs[r] == 4) {
f[r] = 7;
}
if (bgs[r] == 3) {
f[r] = 8;
}
if (bgs[r] == 2) {
f[r] = 9;
}
if (bgs[r] == 1) {
f[r] = 10;
}
bgs[r] = bgs[r] - 1;
bgy[r] = bgy[r] - 10;
if (bgs[r] <= 0) {
bgx[r] = -500;
f[r] = 11;
bgt[r] = 0;
bgs[r] = 0;
}
}
}
if (bgt[r] == 4) {
if (((((((bgx[r] - 20) < (px + 10)) and ((bgx[r] + 20) > (px - 10))) and ((bgy[r] + 80) > (py + 10))) and ((bgy[r] + 30) < (py + 50))) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 4;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 4;
}
megah.start();
i = 10;
}
if (bgd[r] == 0) {
f[r] = 1;
if ((px - 180) < bgx[r]) {
bgd[r] = 1;
bgs[r] = 4;
}
if (px < bgx[r]) {
bgd[r] = 2;
}
}
if (bgd[r] == 2) {
f[r] = 4;
if ((px + 180) > bgx[r]) {
bgd[r] = 3;
bgs[r] = 4;
}
if (px > bgx[r]) {
bgd[r] = 0;
}
}
if (bgd[r] == 1) {
if ((bgs[r] == 1) or (bgs[r] == 2)) {
f[r] = 2;
}
if ((bgs[r] == 3) or (bgs[r] == 4)) {
f[r] = 3;
}
bgx[r] = bgx[r] + 12;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgs[r] = 4;
}
}
if (bgd[r] == 3) {
if ((bgs[r] == 1) or (bgs[r] == 2)) {
f[r] = 5;
}
if ((bgs[r] == 3) or (bgs[r] == 4)) {
f[r] = 6;
}
bgx[r] = bgx[r] - 12;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgs[r] = 4;
}
}
if (bgd[r] == 4) {
if (bgs[r] == 4) {
f[r] = 7;
}
if (bgs[r] == 3) {
f[r] = 8;
}
if (bgs[r] == 2) {
f[r] = 9;
}
if (bgs[r] == 1) {
f[r] = 10;
}
bgs[r] = bgs[r] - 1;
bgy[r] = bgy[r] - 10;
if (bgs[r] <= 0) {
bgx[r] = -500;
f[r] = 11;
bgt[r] = 0;
bgs[r] = 0;
}
}
}
if (bgt[r] == 5) {
if (((((((bgx[r] - 20) < (px + 10)) and ((bgx[r] + 20) > (px - 10))) and ((bgy[r] + 80) > (py + 10))) and ((bgy[r] + 30) < (py + 50))) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 3;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 3;
}
megah.start();
i = 10;
}
if (bgd[r] == 0) {
f[r] = 1;
if (px < bgx[r]) {
bgd[r] = 2;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
cannons.start();
bgd[r] = 1;
bgs[r] = 8;
bgst[bsn] = 2;
bgsx[bsn] = bgx[r] - 20;
bgsy[bsn] = bgy[r] + 20;
bgsd[bsn] = 0;
bsn = bsn + 1;
if (bsn > 5) {
bsn = 1;
}
}
}
if (bgd[r] == 2) {
f[r] = 3;
if (px > bgx[r]) {
bgd[r] = 0;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
cannons.start();
bgd[r] = 3;
bgs[r] = 7;
bgst[bsn] = 2;
bgsx[bsn] = bgx[r] + 20;
bgsy[bsn] = bgy[r] + 20;
bgsd[bsn] = 1;
bsn = bsn + 1;
if (bsn > 5) {
bsn = 1;
}
}
}
if (bgd[r] == 1) {
f[r] = 2;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 0;
bgs[r] = 10 + random(15);
}
}
if (bgd[r] == 3) {
f[r] = 4;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 2;
bgs[r] = 10 + random(15);
}
}
if (bgd[r] == 4) {
if (bgs[r] == 5) {
f[r] = 5;
}
if (bgs[r] == 4) {
f[r] = 6;
}
if (bgs[r] == 3) {
f[r] = 7;
}
if (bgs[r] == 2) {
f[r] = 8;
}
if (bgs[r] == 1) {
f[r] = 9;
}
bgs[r] = bgs[r] - 1;
bgy[r] = bgy[r] - 10;
if (bgs[r] <= 0) {
f[r] = 10;
bgt[r] = 0;
bgx[r] = -500;
bgs[r] = 0;
}
}
}
if (bgt[r] == 6) {
if (((((((bgx[r] - 10) < (px + 10)) and ((bgx[r] + 10) > (px - 10))) and ((bgy[r] + 50) > (py + 10))) and ((bgy[r] + 10) < (py + 50))) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 4;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 4;
}
megah.start();
i = 10;
}
if (bgd[r] == 0) {
f[r] = 1;
bgy[r] = bgy[r] - 10;
if (((((px - 120) < bgx[r]) and ((px + 120) > bgx[r])) and ((bgy[r] - 80) < py)) and ((bgy[r] + 150) > py)) {
bgd[r] = 1;
bgs[r] = 6;
}
}
if (bgd[r] == 1) {
bgy[r] = bgy[r] - 10;
if (((bgs[r] == 6) or (bgs[r] == 5)) or (bgs[r] == 4)) {
f[r] = 2;
}
if (((bgs[r] == 3) or (bgs[r] == 2)) or (bgs[r] == 1)) {
f[r] = 3;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgs[r] = 4;
bgd[r] = 2;
}
}
if (bgd[r] == 2) {
if ((bgs[r] == 4) or (bgs[r] == 3)) {
f[r] = 4;
}
if ((bgs[r] == 2) or (bgs[r] == 1)) {
f[r] = 5;
}
if (px < bgx[r]) {
bgx[r] = (bgx[r] - 1) - random(10);
}
if (px > bgx[r]) {
bgx[r] = (bgx[r] + 1) + random(10);
}
if (py > bgy[r]) {
bgy[r] = bgy[r] + random(8);
}
if (py < bgy[r]) {
bgy[r] = (bgy[r] - 10) - random(10);
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgs[r] = 4;
}
}
if (bgd[r] == 3) {
if (bgs[r] == 4) {
f[r] = 6;
}
if (bgs[r] == 3) {
f[r] = 7;
}
if (bgs[r] == 2) {
f[r] = 8;
}
if (bgs[r] == 1) {
f[r] = 9;
}
bgs[r] = bgs[r] - 1;
bgy[r] = bgy[r] - 10;
if (bgs[r] <= 0) {
f[r] = 10;
bgt[r] = 0;
bgx[r] = -500;
bgs[r] = 0;
}
}
}
if (bgt[r] == 7) {
if (((((((bgx[r] - 20) < (px + 10)) and ((bgx[r] + 20) > (px - 10))) and ((bgy[r] + 20) > (py + 10))) and ((bgy[r] + 20) < (py + 50))) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 3;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 3;
}
megah.start();
i = 10;
}
if (bgd[r] == 0) {
f[r] = 1;
bgy[r] = bgy[r] - 10;
if ((px + 80) < bgx[r]) {
bgx[r] = bgx[r] - 5;
}
if ((px - 80) > bgx[r]) {
bgx[r] = bgx[r] + 5;
}
if ((py - 70) < bgy[r]) {
bgy[r] = bgy[r] - 5;
}
if ((py - 70) > bgy[r]) {
bgy[r] = bgy[r] + 5;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
joes.start();
if (px > bgx[r]) {
bgd[r] = 1;
}
if (px < bgx[r]) {
bgd[r] = 2;
}
if (px < bgx[r]) {
bgsd[bsn] = 3;
if ((py - 50) < bgy[r]) {
bgsd[bsn] = 1;
}
}
if (px > bgx[r]) {
bgsd[bsn] = 2;
if ((py - 50) < bgy[r]) {
bgsd[bsn] = 0;
}
}
bgs[r] = 12;
bgst[bsn] = 1;
bgsx[bsn] = bgx[r];
bgsy[bsn] = bgy[r];
bsn = bsn + 1;
if (bsn > 5) {
bsn = 1;
}
}
}
if (bgd[r] == 1) {
f[r] = 2;
bgy[r] = bgy[r] - 10;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 0;
bgs[r] = 10 + random(25);
}
}
if (bgd[r] == 2) {
f[r] = 3;
bgy[r] = bgy[r] - 10;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 0;
bgs[r] = 10 + random(25);
}
}
if (bgd[r] == 3) {
if (bgs[r] == 3) {
f[r] = 4;
}
if (bgs[r] == 2) {
f[r] = 5;
}
if (bgs[r] == 1) {
f[r] = 6;
}
bgs[r] = bgs[r] - 1;
bgy[r] = bgy[r] - 10;
if (bgs[r] <= 0) {
f[r] = 7;
bgt[r] = 0;
bgx[r] = -500;
bgs[r] = 0;
}
}
}
if (bgt[r] == 8) {
if (((((((bgx[r] - 20) < (px + 10)) and ((bgx[r] + 20) > (px - 10))) and ((bgy[r] + 35) > (py + 10))) and ((bgy[r] + 20) < (py + 50))) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 8;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 8;
}
bgd[r] = 2;
bgs[r] = 10;
baddyd1.start();
i = 10;
}
if (bgd[r] == 0) {
f[r] = 1;
bgx[r] = bgx[r] + 20;
if ((py + 30) > bgy[r]) {
bgy[r] = bgy[r] - 8;
}
if ((py + 30) < bgy[r]) {
bgy[r] = bgy[r] - 12;
}
if ((px + 100) < bgx[r]) {
bgd[r] = 1;
}
}
if (bgd[r] == 1) {
f[r] = 2;
bgx[r] = bgx[r] - 20;
if ((py + 30) > bgy[r]) {
bgy[r] = bgy[r] - 8;
}
if ((py + 30) < bgy[r]) {
bgy[r] = bgy[r] - 12;
}
if ((px - 100) > bgx[r]) {
bgd[r] = 0;
}
}
if (bgd[r] == 2) {
if (bgs[r] == 5) {
f[r] = 3;
}
if (bgs[r] == 4) {
f[r] = 4;
}
if (bgs[r] == 3) {
f[r] = 5;
}
if (bgs[r] == 2) {
f[r] = 6;
}
if (bgs[r] == 1) {
f[r] = 7;
}
bgs[r] = bgs[r] - 1;
bgy[r] = bgy[r] - 10;
if (bgs[r] <= 0) {
bgx[r] = -500;
f[r] = 8;
bgt[r] = 0;
bgs[r] = 0;
}
}
}
if (bgt[r] == 9) {
if (((((((bgx[r] - 30) < (px + 10)) and ((bgx[r] + 30) > (px - 10))) and ((bgy[r] + 55) > (py + 10))) and ((bgy[r] + 20) < (py + 50))) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 5;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 5;
}
megah.start();
i = 10;
}
if (bgd[r] == 0) {
if ((bgs[r] == 1) or (bgs[r] == 2)) {
f[r] = 1;
}
if ((bgs[r] == 3) or (bgs[r] == 4)) {
f[r] = 2;
}
bgx[r] = bgx[r] + 8;
if ((px + 80) < bgx[r]) {
bgd[r] = 1;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgs[r] = 4;
}
}
if (bgd[r] == 1) {
if ((bgs[r] == 1) or (bgs[r] == 2)) {
f[r] = 3;
}
if ((bgs[r] == 3) or (bgs[r] == 4)) {
f[r] = 4;
}
bgx[r] = bgx[r] - 8;
if ((px - 80) > bgx[r]) {
bgd[r] = 0;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgs[r] = 4;
}
}
if (bgd[r] == 2) {
if (bgs[r] == 4) {
f[r] = 5;
}
if (bgs[r] == 3) {
f[r] = 6;
}
if (bgs[r] == 2) {
f[r] = 7;
}
if (bgs[r] == 1) {
f[r] = 8;
}
bgs[r] = bgs[r] - 1;
bgy[r] = bgy[r] - 10;
if (bgs[r] <= 0) {
bgx[r] = -500;
f[r] = 9;
bgt[r] = 0;
bgs[r] = 0;
}
}
}
if (bgt[r] == 10) {
if (((((((bgx[r] - 20) < (px + 10)) and ((bgx[r] + 20) > (px - 10))) and ((bgy[r] + 20) > (py + 10))) and ((bgy[r] + 20) < (py + 50))) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 2;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 2;
}
megah.start();
i = 10;
}
if (bgd[r] == 0) {
f[r] = 1;
bgy[r] = bgy[r] - 10;
if (px < bgx[r]) {
bgx[r] = bgx[r] - 7;
}
if (px > bgx[r]) {
bgx[r] = bgx[r] + 7;
}
if ((py - 80) < bgy[r]) {
bgy[r] = bgy[r] - 8;
}
if ((py - 80) > bgy[r]) {
bgy[r] = bgy[r] + 8;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
joes.start();
bgd[r] = 1;
bgsd[bsn] = 4;
bgs[r] = 5;
bgst[bsn] = 1;
bgsx[bsn] = bgx[r];
bgsy[bsn] = bgy[r];
bsn = bsn + 1;
if (bsn > 5) {
bsn = 1;
}
}
}
if (bgd[r] == 1) {
f[r] = 2;
bgy[r] = bgy[r] - 10;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 0;
bgs[r] = 6 + random(16);
}
}
if (bgd[r] == 2) {
if (bgs[r] == 3) {
f[r] = 3;
}
if (bgs[r] == 2) {
f[r] = 4;
}
if (bgs[r] == 1) {
f[r] = 5;
}
bgs[r] = bgs[r] - 1;
bgy[r] = bgy[r] - 10;
if (bgs[r] <= 0) {
f[r] = 7;
bgt[r] = 0;
bgx[r] = -500;
bgs[r] = 0;
}
}
}
if (bgt[r] == 11) {
if (((((((bgx[r] - 20) < (px + 10)) and ((bgx[r] + 20) > (px - 10))) and ((bgy[r] + 50) > (py - 10))) and (bgy[r] < (py + 50))) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 3;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 3;
}
megah.start();
i = 10;
}
if (bgd[r] == 0) {
if (((bgs[r] == 12) or (bgs[r] == 11)) or (bgs[r] == 10)) {
f[r] = 1;
}
if (((bgs[r] == 9) or (bgs[r] == 8)) or (bgs[r] == 7)) {
f[r] = 2;
}
if (((bgs[r] == 6) or (bgs[r] == 5)) or (bgs[r] == 4)) {
f[r] = 1;
}
if (((bgs[r] == 3) or (bgs[r] == 2)) or (bgs[r] == 1)) {
f[r] = 2;
}
if (bgx[r] > px) {
bgd[r] = 3;
bgs[r] = 12;
}
bgx[r] = bgx[r] + 6;
if (((bgx[r] + 150) > (px - 20)) and (bgx[r] < px)) {
bgd[r] = 1;
bgs[r] = 9;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgs[r] = 12;
}
}
if (bgd[r] == 1) {
f[r] = 3;
bgx[r] = bgx[r] + 12;
bgy[r] = bgy[r] - 20;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 2;
bgs[r] = 10;
}
}
if (bgd[r] == 2) {
f[r] = 3;
bgx[r] = bgx[r] + 12;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 0;
bgs[r] = 12;
}
}
if (bgd[r] == 3) {
if (((bgs[r] == 12) or (bgs[r] == 11)) or (bgs[r] == 10)) {
f[r] = 4;
}
if (((bgs[r] == 9) or (bgs[r] == 8)) or (bgs[r] == 7)) {
f[r] = 5;
}
if (((bgs[r] == 6) or (bgs[r] == 5)) or (bgs[r] == 4)) {
f[r] = 4;
}
if (((bgs[r] == 3) or (bgs[r] == 2)) or (bgs[r] == 1)) {
f[r] = 5;
}
if (bgx[r] < px) {
bgd[r] = 0;
bgs[r] = 12;
}
bgx[r] = bgx[r] - 6;
if (((bgx[r] - 150) < (px - 20)) and (bgx[r] > px)) {
bgd[r] = 4;
bgs[r] = 9;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgs[r] = 12;
}
}
if (bgd[r] == 4) {
f[r] = 6;
bgx[r] = bgx[r] - 12;
bgy[r] = bgy[r] - 20;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 5;
bgs[r] = 10;
}
}
if (bgd[r] == 5) {
f[r] = 6;
bgx[r] = bgx[r] - 12;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 3;
bgs[r] = 12;
}
}
if (bgd[r] == 6) {
if (bgs[r] == 3) {
f[r] = 7;
}
if (bgs[r] == 2) {
f[r] = 8;
}
if (bgs[r] == 1) {
f[r] = 9;
}
bgs[r] = bgs[r] - 1;
bgy[r] = bgy[r] - 10;
if (bgs[r] <= 0) {
f[r] = 15;
bgt[r] = 0;
bgx[r] = -500;
bgs[r] = 0;
}
}
}
if (bgt[r] == 12) {
if (((((((bgx[r] - 20) < (px + 10)) and ((bgx[r] + 20) > (px - 10))) and ((bgy[r] + 40) > py)) and ((bgy[r] - 20) < (py + 50))) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 3;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 3;
}
megah.start();
i = 10;
}
if (bgd[r] == 0) {
if (bgs[r] == 1) {
f[r] = 1;
}
if (bgs[r] == 2) {
f[r] = 2;
}
bgy[r] = bgy[r] - 10;
bgx[r] = bgx[r] + 7;
if ((py - 60) < bgy[r]) {
bgy[r] = bgy[r] - 5;
}
if ((((px - 70) < bgx[r]) and ((px + 70) > bgx[r])) and (py > bgy[r])) {
bgy[r] = bgy[r] + 12;
}
if ((px + 100) < bgx[r]) {
bgd[r] = 1;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgs[r] = 2;
}
}
if (bgd[r] == 1) {
if (bgs[r] == 1) {
f[r] = 3;
}
if (bgs[r] == 2) {
f[r] = 4;
}
bgy[r] = bgy[r] - 10;
bgx[r] = bgx[r] - 7;
if ((py - 60) < bgy[r]) {
bgy[r] = bgy[r] - 5;
}
if ((((px - 70) < bgx[r]) and ((px + 70) > bgx[r])) and (py > bgy[r])) {
bgy[r] = bgy[r] + 12;
}
if ((px - 100) > bgx[r]) {
bgd[r] = 0;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgs[r] = 2;
}
}
if (bgd[r] == 2) {
if (bgs[r] == 4) {
f[r] = 5;
}
if (bgs[r] == 3) {
f[r] = 6;
}
if (bgs[r] == 2) {
f[r] = 7;
}
if (bgs[r] == 1) {
f[r] = 8;
}
bgs[r] = bgs[r] - 1;
bgy[r] = bgy[r] - 10;
if (bgs[r] <= 0) {
bgx[r] = -500;
f[r] = 9;
bgt[r] = 0;
bgs[r] = 0;
}
}
}
if (bgt[r] == 13) {
if (((((((bgx[r] - 50) < (px + 10)) and ((bgx[r] + 50) > (px - 10))) and ((bgy[r] + 70) > (py + 10))) and (bgy[r] < (py + 50))) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 4;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 4;
}
megah.start();
i = 10;
}
if (bgd[r] == 0) {
f[r] = 1;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
if ((px - 170) < bgx[r]) {
bgd[r] = 1;
bgs[r] = 7;
}
}
if (px < bgx[r]) {
bgd[r] = 3;
}
}
if (bgd[r] == 1) {
f[r] = 2;
bgx[r] = bgx[r] + 30;
bgy[r] = bgy[r] - 20;
if (bgy[r] < py) {
bgy[r] = bgy[r] + 10;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 2;
bgs[r] = 12;
}
}
if (bgd[r] == 2) {
f[r] = 3;
bgx[r] = bgx[r] + 5;
bgy[r] = bgy[r] + 2;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 0;
bgs[r] = random(12);
}
}
if (bgd[r] == 3) {
f[r] = 4;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
if ((px + 170) > bgx[r]) {
bgd[r] = 4;
bgs[r] = 7;
}
}
if (px > bgx[r]) {
bgd[r] = 0;
}
}
if (bgd[r] == 4) {
f[r] = 5;
bgx[r] = bgx[r] - 30;
bgy[r] = bgy[r] - 20;
bgs[r] = bgs[r] - 1;
if (bgy[r] < py) {
bgy[r] = bgy[r] + 10;
}
if (bgs[r] <= 0) {
bgd[r] = 5;
bgs[r] = 12;
}
}
if (bgd[r] == 5) {
f[r] = 6;
bgx[r] = bgx[r] - 5;
bgy[r] = bgy[r] + 2;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 3;
bgs[r] = random(12);
}
}
if (bgd[r] == 6) {
if (bgs[r] == 4) {
f[r] = 7;
}
if (bgs[r] == 3) {
f[r] = 8;
}
if (bgs[r] == 2) {
f[r] = 9;
}
if (bgs[r] == 1) {
f[r] = 10;
}
bgs[r] = bgs[r] - 1;
bgy[r] = bgy[r] - 10;
if (bgs[r] <= 0) {
bgx[r] = -500;
f[r] = 11;
bgt[r] = 0;
bgs[r] = 0;
}
}
}
if (bgt[r] == 14) {
if (((((((bgx[r] - 20) < (px + 10)) and ((bgx[r] + 20) > (px - 10))) and ((bgy[r] + 50) > (py + 10))) and ((bgy[r] + 20) < (py + 50))) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 2;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 2;
}
megah.start();
i = 10;
}
if (bgt[r] > 0) {
bgy[r] = bgy[r] - 10;
}
if (bgd[r] == 0) {
f[r] = 1;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 1;
bgs[r] = 6;
}
}
if (bgd[r] == 1) {
if (((bgs[r] == 6) or (bgs[r] == 5)) or (bgs[r] == 4)) {
f[r] = 2;
}
if (((bgs[r] == 3) or (bgs[r] == 2)) or (bgs[r] == 1)) {
f[r] = 3;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 2;
bgs[r] = 15;
}
}
if (bgd[r] == 2) {
f[r] = 4;
if (((bgs[r] == 15) or (bgs[r] == 10)) or (bgs[r] == 5)) {
cannons.start();
bgst[bsn] = 2;
bgsx[bsn] = bgx[r] + 20;
bgsy[bsn] = bgy[r];
bgsd[bsn] = 0;
bsn = bsn + 1;
if (bsn > 5) {
bsn = 1;
}
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 0;
bgs[r] = 20;
}
}
if (bgd[r] == 3) {
f[r] = 5;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 4;
bgs[r] = 6;
}
}
if (bgd[r] == 4) {
if (((bgs[r] == 6) or (bgs[r] == 5)) or (bgs[r] == 4)) {
f[r] = 6;
}
if (((bgs[r] == 3) or (bgs[r] == 2)) or (bgs[r] == 1)) {
f[r] = 7;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 5;
bgs[r] = 15;
}
}
if (bgd[r] == 5) {
f[r] = 8;
if (((bgs[r] == 15) or (bgs[r] == 10)) or (bgs[r] == 5)) {
cannons.start();
bgst[bsn] = 2;
bgsx[bsn] = bgx[r] - 20;
bgsy[bsn] = bgy[r];
bgsd[bsn] = 1;
bsn = bsn + 1;
if (bsn > 5) {
bsn = 1;
}
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 3;
bgs[r] = 20;
}
}
if (bgd[r] == 6) {
if (bgs[r] == 2) {
f[r] = 9;
}
if (bgs[r] == 1) {
f[r] = 10;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
f[r] = 11;
bgt[r] = 0;
bgx[r] = -500;
bgs[r] = 0;
}
}
}
}
r++;
}
r = 1;
while (r <= 5) {
if (bgst[r] > 0) {
if (bgst[r] == 1) {
if (r == 1) {
bgs1.gotoAndStop(1);
}
if (r == 2) {
bgs2.gotoAndStop(1);
}
if (r == 3) {
bgs3.gotoAndStop(1);
}
if (r == 4) {
bgs4.gotoAndStop(1);
}
if (r == 5) {
bgs5.gotoAndStop(1);
}
if (bgsd[r] == 0) {
bgsx[r] = bgsx[r] + 20;
if (bgsx[r] > (px + 300)) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgsd[r] == 1) {
bgsx[r] = bgsx[r] - 20;
if (bgsx[r] < (px - 300)) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgsd[r] == 2) {
bgsx[r] = bgsx[r] + 15;
bgsy[r] = bgsy[r] + 15;
if ((bgsx[r] > (px + 300)) or (bgsy[r] > (py + 300))) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgsd[r] == 3) {
bgsx[r] = bgsx[r] - 15;
bgsy[r] = bgsy[r] + 15;
if ((bgsx[r] > (px + 300)) or (bgsy[r] > (py + 300))) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgsd[r] == 4) {
bgsy[r] = bgsy[r] + 20;
if (bgsy[r] > (py + 300)) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (((((((bgsx[r] - 15) < (px + 10)) and ((bgsx[r] + 15) > (px - 10))) and ((bgsy[r] + 15) > (py + 5))) and ((bgsy[r] - 15) < (py + 20))) and (pcd < 18)) and (i < 1)) {
if ((bgsd[r] == 0) or (bgsd[r] == 2)) {
pcd = 19;
}
if ((bgsd[r] == 1) or (bgsd[r] == 3)) {
pcd = 18;
}
pstep = 2;
pl = pl - 3;
megah.start();
i = 10;
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgst[r] == 2) {
if (r == 1) {
bgs1.gotoAndStop(2);
}
if (r == 2) {
bgs2.gotoAndStop(2);
}
if (r == 3) {
bgs3.gotoAndStop(2);
}
if (r == 4) {
bgs4.gotoAndStop(2);
}
if (r == 5) {
bgs5.gotoAndStop(2);
}
if (bgsd[r] == 0) {
bgsx[r] = bgsx[r] + 30;
if (bgsx[r] > (px + 300)) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgsd[r] == 1) {
bgsx[r] = bgsx[r] - 30;
if (bgsx[r] < (px - 300)) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (((((((bgsx[r] - 25) < (px + 10)) and ((bgsx[r] + 25) > (px - 10))) and ((bgsy[r] + 80) > (py + 40))) and ((bgsy[r] + 35) < (py + 60))) and (pcd < 18)) and (i < 1)) {
if (bgsd[r] == 0) {
pcd = 19;
}
if (bgsd[r] == 1) {
pcd = 18;
}
pstep = 2;
pl = pl - 6;
megah.start();
i = 10;
bgst[r] = 0;
bgsx[r] = -200;
}
}
}
r++;
}
bg1.gotoAndStop(f[1]);
bg2.gotoAndStop(f[2]);
bg3.gotoAndStop(f[3]);
bg4.gotoAndStop(f[4]);
bg5.gotoAndStop(f[5]);
bg6.gotoAndStop(f[6]);
bg7.gotoAndStop(f[7]);
bg8.gotoAndStop(f[8]);
bgs1._x = ((bgsx[1] + 275) - px) / 2;
bgs1._y = ((bgsy[1] + 275) - py) / 2;
bgs2._x = ((bgsx[2] + 275) - px) / 2;
bgs2._y = ((bgsy[2] + 275) - py) / 2;
bgs3._x = ((bgsx[3] + 275) - px) / 2;
bgs3._y = ((bgsy[3] + 275) - py) / 2;
bgs4._x = ((bgsx[4] + 275) - px) / 2;
bgs4._y = ((bgsy[4] + 275) - py) / 2;
bgs5._x = ((bgsx[5] + 275) - px) / 2;
bgs5._y = ((bgsy[5] + 275) - py) / 2;
bg1._x = ((bgx[1] + 275) - px) / 2;
bg1._y = ((bgy[1] + 275) - py) / 2;
bg2._x = ((bgx[2] + 275) - px) / 2;
bg2._y = ((bgy[2] + 275) - py) / 2;
bg3._x = ((bgx[3] + 275) - px) / 2;
bg3._y = ((bgy[3] + 275) - py) / 2;
bg4._x = ((bgx[4] + 275) - px) / 2;
bg4._y = ((bgy[4] + 275) - py) / 2;
bg5._x = ((bgx[5] + 275) - px) / 2;
bg5._y = ((bgy[5] + 275) - py) / 2;
bg6._x = ((bgx[6] + 275) - px) / 2;
bg6._y = ((bgy[6] + 275) - py) / 2;
bg7._x = ((bgx[7] + 275) - px) / 2;
bg7._y = ((bgy[7] + 275) - py) / 2;
bg8._x = ((bgx[8] + 275) - px) / 2;
bg8._y = ((bgy[8] + 275) - py) / 2;
r = 1;
while (r <= 3) {
if (((pst[r] > 0) and (pst[r] < 4)) and (psd[r] == 0)) {
if (r == 1) {
shot1p._x = ((297 + psx[1]) - px) / 2;
shot1p._y = ((270 + psy[1]) - py) / 2;
}
if (r == 2) {
shot2p._x = ((297 + psx[2]) - px) / 2;
shot2p._y = ((270 + psy[2]) - py) / 2;
}
if (r == 3) {
shot3p._x = ((297 + psx[3]) - px) / 2;
shot3p._y = ((270 + psy[3]) - py) / 2;
}
}
if (((pst[r] > 0) and (pst[r] < 4)) and (psd[r] == 1)) {
if (r == 1) {
shot1p._x = ((247 + psx[1]) - px) / 2;
shot1p._y = ((270 + psy[1]) - py) / 2;
}
if (r == 2) {
shot2p._x = ((247 + psx[2]) - px) / 2;
shot2p._y = ((270 + psy[2]) - py) / 2;
}
if (r == 3) {
shot3p._x = ((247 + psx[3]) - px) / 2;
shot3p._y = ((270 + psy[3]) - py) / 2;
}
}
if ((pst[r] == 4) or (pst[r] == 5)) {
if (r == 1) {
shot1p._x = ((272 + psx[1]) - px) / 2;
shot1p._y = ((270 + psy[1]) - py) / 2;
}
if (r == 2) {
shot2p._x = ((272 + psx[2]) - px) / 2;
shot2p._y = ((270 + psy[2]) - py) / 2;
}
if (r == 3) {
shot3p._x = ((272 + psx[3]) - px) / 2;
shot3p._y = ((270 + psy[3]) - py) / 2;
}
}
if (pst[r] == 0) {
if (r == 1) {
shot1p._x = -200;
shot1p._y = (270 + psy[1]) - py;
}
if (r == 2) {
shot2p._x = -200;
shot2p._y = (270 + psy[2]) - py;
}
if (r == 3) {
shot3p._x = -200;
shot3p._y = (270 + psy[3]) - py;
}
}
r++;
}
if (i > 0) {
i = i - 1;
pc._alpha = 50;
}
if (i <= 0) {
i = i - 1;
pc._alpha = 100;
}
if (bcharge > 0) {
charge._alpha = bcharge;
}
lbar._height = 2 * pl;
lbar._y = 120 - (2 * pl);
stage._x = (770 - px) / 2;
stage._y = (175 - py) / 2;
exit._x = ((ex + 275) - px) / 2;
exit._y = ((ey + 275) - py) / 2;
Frame 254
gotoAndPlay (18);
if ((((px + 10) > (ex - 20)) and ((px - 10) < (ex + 20))) and (((py + 30) > (ey - 20)) and (py < (ey + 50)))) {
gotoAndPlay (20);
}
Frame 255
lbar._height = 2 * pl;
lbar._y = 120 - (2 * pl);
stage._x = (275 - px) / 2;
stage._y = (-225 - py) / 2;
exit._x = ((ex + 275) - px) / 2;
exit._y = ((ey + 275) - py) / 2;
Frame 258
psn = 1;
bstep = 0;
pcd = 0;
bcharge = 0;
r = 1;
while (r <= 5) {
psx[r] = -200;
psy[r] = 0;
pst[r] = 0;
psd[r] = 0;
r++;
}
i = 0;
pl = pl + 5;
if (pl > 50) {
pl = 50;
}
px = 950;
py = -525;
r = 0;
while (r <= 26) {
bx[r] = -50;
by[r] = -50;
r++;
}
bx[1] = 1050;
by[1] = -650;
bx[2] = 150;
by[2] = -550;
bx[3] = 650;
by[3] = -550;
bx[4] = 1050;
by[4] = -550;
bx[5] = 150;
by[5] = -450;
bx[6] = 450;
by[6] = -450;
bx[7] = 550;
by[7] = -450;
bx[8] = 750;
by[8] = -450;
bx[9] = 850;
by[9] = -450;
bx[10] = 950;
by[10] = -450;
bx[11] = 150;
by[11] = -350;
bx[12] = 250;
by[12] = -350;
bx[13] = 550;
by[13] = -350;
bx[14] = 150;
by[14] = -250;
bx[15] = 450;
by[15] = -250;
bx[16] = 150;
by[16] = -150;
bx[17] = 550;
by[17] = -150;
bx[18] = 650;
by[18] = -150;
bx[19] = 750;
by[19] = -100;
bx[20] = 250;
by[20] = -50;
bx[21] = 350;
by[21] = 50;
bx[22] = 450;
by[22] = 50;
bx[23] = 550;
by[23] = 100;
bx[24] = 650;
by[24] = 150;
bx[25] = 750;
by[25] = 150;
bsn = 1;
r = 1;
while (r <= 8) {
bgx[r] = -200;
bgy[r] = -200;
bgt[r] = 0;
bgd[r] = -1;
bgs[r] = 0;
r++;
}
r = 1;
while (r <= 5) {
bgsx[r] = -200;
bgsy[r] = 0;
bgst[r] = 0;
bgsd[r] = 0;
r++;
}
r = 1;
while (r <= 8) {
f[r] = 20;
r++;
}
bgt[1] = 1;
bgd[1] = 0;
bgs[1] = 0;
bgl[1] = 3;
bgx[1] = 680;
bgy[1] = -650;
bgt[2] = 2;
bgd[2] = 0;
bgs[2] = 0;
bgl[2] = 3;
bgx[2] = 550;
bgy[2] = -550;
bgt[3] = 2;
bgd[3] = 0;
bgs[3] = 0;
bgl[3] = 3;
bgx[3] = 500;
bgy[3] = -550;
bgt[4] = 3;
bgd[4] = 0;
bgs[4] = 0;
bgl[4] = 5;
bgx[4] = 400;
bgy[4] = -650;
bgt[5] = 14;
bgd[5] = 0;
bgs[5] = 0;
bgl[5] = 3;
bgx[5] = 200;
bgy[5] = -450;
bgt[6] = 14;
bgd[6] = 3;
bgs[6] = 0;
bgl[6] = 3;
bgx[6] = 500;
bgy[6] = -350;
bgt[7] = 3;
bgd[7] = 0;
bgs[7] = 0;
bgl[7] = 5;
bgx[7] = 250;
bgy[7] = -250;
bgt[8] = 2;
bgd[8] = 0;
bgs[8] = 0;
bgl[8] = 3;
bgx[8] = 450;
bgy[8] = -50;
ex = 750;
ey = 50;
Frame 259
b1._x = bx[1] / 10;
b1._y = (by[1] / 10) + 120;
b2._x = bx[2] / 10;
b2._y = (by[2] / 10) + 120;
b3._x = bx[3] / 10;
b3._y = (by[3] / 10) + 120;
b4._x = bx[4] / 10;
b4._y = (by[4] / 10) + 120;
b5._x = bx[5] / 10;
b5._y = (by[5] / 10) + 120;
b6._x = bx[6] / 10;
b6._y = (by[6] / 10) + 120;
b7._x = bx[7] / 10;
b7._y = (by[7] / 10) + 120;
b8._x = bx[8] / 10;
b8._y = (by[8] / 10) + 120;
b9._x = bx[9] / 10;
b9._y = (by[9] / 10) + 120;
b10._x = bx[10] / 10;
b10._y = (by[10] / 10) + 120;
b11._x = bx[11] / 10;
b11._y = (by[11] / 10) + 120;
b12._x = bx[12] / 10;
b12._y = (by[12] / 10) + 120;
b13._x = bx[13] / 10;
b13._y = (by[13] / 10) + 120;
b14._x = bx[14] / 10;
b14._y = (by[14] / 10) + 120;
b15._x = bx[15] / 10;
b15._y = (by[15] / 10) + 120;
b16._x = bx[16] / 10;
b16._y = (by[16] / 10) + 120;
b17._x = bx[17] / 10;
b17._y = (by[17] / 10) + 120;
b18._x = bx[18] / 10;
b18._y = (by[18] / 10) + 120;
b19._x = bx[19] / 10;
b19._y = (by[19] / 10) + 120;
b20._x = bx[20] / 10;
b20._y = (by[20] / 10) + 120;
b21._x = bx[21] / 10;
b21._y = (by[21] / 10) + 120;
b22._x = bx[22] / 10;
b22._y = (by[22] / 10) + 120;
b23._x = bx[23] / 10;
b23._y = (by[23] / 10) + 120;
b24._x = bx[24] / 10;
b24._y = (by[24] / 10) + 120;
b25._x = bx[25] / 10;
b25._y = (by[25] / 10) + 120;
b26._x = bx[26] / 10;
b26._y = (by[26] / 10) + 120;
b27._x = bx[27] / 10;
b27._y = (by[27] / 10) + 120;
b28._x = bx[28] / 10;
b28._y = (by[28] / 10) + 120;
cir._x = px / 10;
cir._y = (py / 10) + 120;
shot1._x = psx[1] / 10;
shot1._y = (psy[1] / 10) + 120;
shot2._x = psx[2] / 10;
shot2._y = (psy[2] / 10) + 120;
shot3._x = psx[3] / 10;
shot3._y = (psy[3] / 10) + 120;
bshot1._x = bgsx[1] / 10;
bshot1._y = (bgsy[1] / 10) + 120;
bshot2._x = bgsx[2] / 10;
bshot2._y = (bgsy[2] / 10) + 120;
bshot3._x = bgsx[3] / 10;
bshot3._y = (bgsy[3] / 10) + 120;
bshot4._x = bgsx[4] / 10;
bshot4._y = (bgsy[4] / 10) + 120;
bshot5._x = bgsx[5] / 10;
bshot5._y = (bgsy[5] / 10) + 120;
bcir1._x = bgx[1] / 10;
bcir1._y = (bgy[1] / 10) + 120;
bcir2._x = bgx[2] / 10;
bcir2._y = (bgy[2] / 10) + 120;
bcir3._x = bgx[3] / 10;
bcir3._y = (bgy[3] / 10) + 120;
bcir4._x = bgx[4] / 10;
bcir4._y = (bgy[4] / 10) + 120;
bcir5._x = bgx[5] / 10;
bcir5._y = (bgy[5] / 10) + 120;
bcir6._x = bgx[6] / 10;
bcir6._y = (bgy[6] / 10) + 120;
bcir7._x = bgx[7] / 10;
bcir7._y = (bgy[7] / 10) + 120;
bcir8._x = bgx[8] / 10;
bcir8._y = (bgy[8] / 10) + 120;
bcir9._x = bgx[9] / 10;
bcir9._y = (bgy[9] / 10) + 120;
bcir10._x = bgx[10] / 10;
bcir10._y = (bgy[10] / 10) + 120;
bcir11._x = bgx[11] / 10;
bcir11._y = (bgy[11] / 10) + 120;
bcir12._x = bgx[12] / 10;
bcir12._y = (bgy[12] / 10) + 120;
bcir13._x = bgx[13] / 10;
bcir13._y = (bgy[13] / 10) + 120;
if (Key.isDown(39) and (pcd == 0)) {
pcd = 2;
}
if (Key.isDown(39) and ((pcd == 1) or (pcd == 3))) {
pcd = 0;
}
if (Key.isDown(37) and (pcd == 1)) {
pcd = 3;
}
if (Key.isDown(37) and ((pcd == 0) or (pcd == 2))) {
pcd = 1;
}
if (Key.isDown(38) and ((pcd == 0) or (pcd == 2))) {
pcd = 10;
pstep = 7;
}
if (Key.isDown(38) and ((pcd == 1) or (pcd == 3))) {
pcd = 11;
pstep = 7;
}
if (Key.isDown(40) and ((((pcd == 0) or (pcd == 1)) or (pcd == 2)) or (pcd == 3))) {
if (((pcd == 0) or (pcd == 2)) or (pcd == 8)) {
pcd = 6;
pstep = 3;
}
if (((pcd == 1) or (pcd == 3)) or (pcd == 9)) {
pcd = 7;
pstep = 3;
}
}
if (Key.isDown(16) and (bcharge < 100)) {
bcharge = bcharge + 5;
}
if (pcd == 0) {
pc.gotoAndStop(1);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(21);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 0;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
}
if (pcd == 1) {
pc.gotoAndStop(2);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(22);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 1;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
}
if (pcd == 2) {
px = px + 13;
if ((w == 0) or (w == 1)) {
pc.gotoAndStop(3);
}
if ((w == 2) or (w == 3)) {
pc.gotoAndStop(4);
}
if ((w == 4) or (w == 5)) {
pc.gotoAndStop(5);
}
if ((w == 6) or (w == 7)) {
pc.gotoAndStop(6);
}
if (Key.isDown(32)) {
if ((w == 0) or (w == 1)) {
pc.gotoAndStop(11);
}
if ((w == 2) or (w == 3)) {
pc.gotoAndStop(12);
}
if ((w == 4) or (w == 5)) {
pc.gotoAndStop(13);
}
if ((w == 6) or (w == 7)) {
pc.gotoAndStop(14);
}
if ((pst[psn] == 0) and (bstep == 0)) {
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 0;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
}
pcd = 0;
}
if (pcd == 3) {
px = px - 13;
if ((w == 0) or (w == 1)) {
pc.gotoAndStop(7);
}
if ((w == 2) or (w == 3)) {
pc.gotoAndStop(8);
}
if ((w == 4) or (w == 5)) {
pc.gotoAndStop(9);
}
if ((w == 6) or (w == 7)) {
pc.gotoAndStop(10);
}
if (Key.isDown(32)) {
if ((w == 0) or (w == 1)) {
pc.gotoAndStop(15);
}
if ((w == 2) or (w == 3)) {
pc.gotoAndStop(16);
}
if ((w == 4) or (w == 5)) {
pc.gotoAndStop(17);
}
if ((w == 6) or (w == 7)) {
pc.gotoAndStop(18);
}
if ((pst[psn] == 0) and (bstep == 0)) {
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 1;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
}
pcd = 1;
}
if (pcd == 9) {
pstep = pstep - 1;
if (pstep <= 0) {
pcd = 1;
}
}
if (pcd == 6) {
pc.gotoAndStop(19);
px = px + 20;
pstep = pstep - 1;
if (pstep <= 0) {
pcd = 0;
}
}
if (pcd == 7) {
pc.gotoAndStop(20);
px = px - 20;
pstep = pstep - 1;
if (pstep <= 0) {
pcd = 1;
}
}
if (pcd == 12) {
pc.gotoAndStop(23);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(25);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 0;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
py = py + (5 * (7 - pstep));
pstep = pstep - 1;
if (pstep <= 2) {
pstep = 2;
}
if (Key.isDown(39)) {
px = px + 13;
}
if (Key.isDown(37)) {
px = px - 13;
if (bstep == 0) {
pcd = 13;
}
}
}
if (pcd == 13) {
pc.gotoAndStop(24);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(26);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 1;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
py = py + (5 * (7 - pstep));
pstep = pstep - 1;
if (pstep <= 2) {
pstep = 2;
}
if (Key.isDown(39)) {
px = px + 13;
if (bstep == 0) {
pcd = 12;
}
}
if (Key.isDown(37)) {
px = px - 13;
}
}
if (pcd == 10) {
pc.gotoAndStop(23);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(25);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 0;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
py = py - (5 * pstep);
pstep = pstep - 1;
if (Key.isDown(39)) {
px = px + 13;
}
if (Key.isDown(37)) {
px = px - 13;
if (bstep == 0) {
pcd = 11;
}
}
if (Key.isDown(40)) {
pcd = 12;
pstep = pstep + 3;
}
if (pstep <= -1) {
pstep = 7;
pcd = 12;
}
}
if (pcd == 11) {
pc.gotoAndStop(24);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(26);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 1;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
py = py - (5 * pstep);
pstep = pstep - 1;
if (Key.isDown(39)) {
px = px + 13;
if (bstep == 0) {
pcd = 10;
}
}
if (Key.isDown(37)) {
px = px - 13;
}
if (Key.isDown(40)) {
pcd = 13;
pstep = pstep + 3;
}
if (pstep <= -1) {
pstep = 7;
pcd = 13;
}
}
if (pcd == 18) {
pc.gotoAndStop(27);
pstep = pstep - 1;
px = px - 5;
if (pstep <= -1) {
pstep = 2;
pcd = 0;
}
}
if (pcd == 19) {
pc.gotoAndStop(28);
pstep = pstep - 1;
px = px + 5;
if (pstep <= -1) {
pstep = 2;
pcd = 1;
}
}
if (pcd == 20) {
pc.gotoAndStop(69 - pstep);
bcharge = 0;
charge._alpha = 0;
bstep = 20;
pl = 1;
pstep = pstep - 1;
if (pstep < 0) {
lives = lives - 1;
if (lives >= 0) {
pl = 50;
gotoAndPlay (100);
}
if (lives < 0) {
lives = 2;
continues = continues - 1;
gotoAndPlay (5);
}
}
}
if (pl <= 0) {
c = 1;
while (c <= 8) {
bgx[c] = -600;
c++;
}
pc._alpha = 100;
pcd = 20;
pstep = 40;
megad.start();
}
if (bstep > 0) {
bcharge = 0;
charge._alpha = bcharge;
}
if (bstep > 0) {
bstep = bstep - 1;
}
if ((py > 500) and (pcd < 20)) {
megad.start();
pl = 0;
}
w = w - 1;
if (w < 0) {
w = 7;
}
e = pcd;
c = 0;
r = 1;
while (r <= 12) {
if (((((bx[r] - 150) < px) and ((bx[r] + 150) > px)) and ((by[r] - 150) < py)) and ((by[r] + 150) > py)) {
if (((((((px - 30) < (bx[r] + 50)) and ((px + 20) > (bx[r] - 50))) and (py < (by[r] - 50))) and ((py + 60) > (by[r] - 50))) and (pcd != 10)) and (pcd != 11)) {
if ((((pcd == 12) or (pcd == 13)) or (pcd == 16)) or (pcd == 17)) {
if ((pcd == 12) or (pcd == 16)) {
pcd = 0;
}
if ((pcd == 13) or (pcd == 17)) {
pcd = 1;
}
}
c = 1;
py = by[r] - 75;
}
if (((((px + 38) > (bx[r] - 50)) and ((px + 20) < bx[r])) and (py < (by[r] + 50))) and ((py + 20) > (by[r] - 50))) {
px = bx[r] - 85;
}
if (((((px - 35) < (bx[r] + 50)) and ((px - 20) > bx[r])) and (py < (by[r] + 50))) and ((py + 20) > (by[r] - 50))) {
px = bx[r] + 85;
}
if (((((px - 5) < (bx[r] + 50)) and ((px + 5) > (bx[r] - 50))) and ((py - 30) < (by[r] + 50))) and ((py + 10) > (by[r] + 50))) {
if ((((pcd == 10) or (pcd == 11)) or (pcd == 14)) or (pcd == 15)) {
if ((pcd == 10) or (pcd == 14)) {
pcd = 12;
pstep = 5;
}
if ((pcd == 11) or (pcd == 15)) {
pcd = 13;
pstep = 5;
}
}
py = by[r] + 90;
}
}
r++;
}
if (c == 0) {
if ((((pcd == 0) or (pcd == 2)) or (pcd == 6)) or (pcd == 18)) {
pcd = 12;
pstep = 6;
}
if ((((pcd == 1) or (pcd == 3)) or (pcd == 7)) or (pcd == 19)) {
pcd = 13;
pstep = 6;
}
}
r = 1;
while (r <= 3) {
if (pst[r] == 1) {
if (psd[r] == 0) {
psx[r] = psx[r] + 30;
if (r == 1) {
shot1p.gotoAndStop(1);
}
if (r == 2) {
shot2p.gotoAndStop(1);
}
if (r == 3) {
shot3p.gotoAndStop(1);
}
if (psx[r] > (px + 280)) {
pst[r] = 0;
psx[r] = -200;
}
}
if (psd[r] == 1) {
psx[r] = psx[r] - 30;
if (r == 1) {
shot1p.gotoAndStop(2);
}
if (r == 2) {
shot2p.gotoAndStop(2);
}
if (r == 3) {
shot3p.gotoAndStop(2);
}
if (psx[r] < (px - 280)) {
pst[r] = 0;
psx[r] = -200;
}
}
}
if (pst[r] == 2) {
if (psd[r] == 0) {
psx[r] = psx[r] + 35;
if (r == 1) {
shot1p.gotoAndStop(3);
}
if (r == 2) {
shot2p.gotoAndStop(3);
}
if (r == 3) {
shot3p.gotoAndStop(3);
}
if (psx[r] > (px + 280)) {
pst[r] = 0;
psx[r] = -200;
}
}
if (psd[r] == 1) {
psx[r] = psx[r] - 35;
if (r == 1) {
shot1p.gotoAndStop(4);
}
if (r == 2) {
shot2p.gotoAndStop(4);
}
if (r == 3) {
shot3p.gotoAndStop(4);
}
if (psx[r] < (px - 280)) {
pst[r] = 0;
psx[r] = -200;
}
}
}
if (pst[r] == 3) {
if (psd[r] == 0) {
psx[r] = psx[r] + 40;
if (r == 1) {
shot1p.gotoAndStop(5);
}
if (r == 2) {
shot2p.gotoAndStop(5);
}
if (r == 3) {
shot3p.gotoAndStop(5);
}
if (psx[r] > (px + 280)) {
pst[r] = 0;
psx[r] = -200;
}
}
if (psd[r] == 1) {
psx[r] = psx[r] - 40;
if (r == 1) {
shot1p.gotoAndStop(6);
}
if (r == 2) {
shot2p.gotoAndStop(6);
}
if (r == 3) {
shot3p.gotoAndStop(6);
}
if (psx[r] < (px - 280)) {
pst[r] = 0;
psx[r] = -200;
}
}
}
if (pst[r] == 4) {
if (r == 1) {
shot1p.gotoAndStop(10 - psd[r]);
}
if (r == 2) {
shot2p.gotoAndStop(10 - psd[r]);
}
if (r == 3) {
shot3p.gotoAndStop(10 - psd[r]);
}
psd[r] = psd[r] - 1;
if (psd[r] < 0) {
pst[r] = 0;
psx[r] = -200;
}
}
if (pst[r] == 5) {
if (r == 1) {
shot1p.gotoAndStop(14 - psd[r]);
}
if (r == 2) {
shot2p.gotoAndStop(14 - psd[r]);
}
if (r == 3) {
shot3p.gotoAndStop(14 - psd[r]);
}
psd[r] = psd[r] - 1;
if (psd[r] < 0) {
pst[r] = 0;
psx[r] = -200;
}
}
r++;
}
while (c <= 8) {
r = 1;
while (r <= 3) {
if ((pst[r] > 0) and (pst[r] < 4)) {
if (((((bgt[c] == 1) and ((bgx[c] - 35) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 35) > (psx[r] - ((pst[r] * 20) - 20)))) and ((bgy[c] - 5) < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 50) > (psy[r] - ((pst[r] * 20) - 20)))) {
if ((bgd[c] == 0) or (bgd[c] == 2)) {
deflect.start();
pst[r] = 5;
psd[r] = 2;
}
if ((bgd[c] == 1) or (bgd[c] == 3)) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd2.start();
bgd[c] = 4;
bgs[c] = 4;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
if (((((bgt[c] == 2) and ((bgx[c] - 35) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 35) > (psx[r] - ((pst[r] * 20) - 20)))) and (bgy[c] < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 50) > (psy[r] - ((pst[r] * 20) - 20)))) {
if ((((bgd[c] == 0) or (bgd[c] == 3)) or (bgd[c] == 1)) or (bgd[c] == 4)) {
deflect.start();
pst[r] = 5;
psd[r] = 2;
}
if ((bgd[c] == 2) or (bgd[c] == 5)) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd2.start();
bgd[c] = 6;
bgs[c] = 6;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
if (((((bgt[c] == 3) and ((bgx[c] - 35) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 35) > (psx[r] - ((pst[r] * 20) - 20)))) and ((bgy[c] - 20) < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 40) > (psy[r] - ((pst[r] * 20) - 20)))) {
if (bgd[c] == 0) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd2.start();
bgd[c] = 1;
bgs[c] = 4;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
if (((((bgt[c] == 4) and ((bgx[c] - 40) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 40) > (psx[r] - ((pst[r] * 20) - 20)))) and ((bgy[c] - 20) < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 50) > (psy[r] - ((pst[r] * 20) - 20)))) {
if ((bgd[c] == 0) or (bgd[c] == 2)) {
deflect.start();
pst[r] = 5;
psd[r] = 2;
}
if ((bgd[c] == 1) or (bgd[c] == 3)) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd1.start();
bgd[c] = 4;
bgs[c] = 4;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
if (((((bgt[c] == 5) and ((bgx[c] - 40) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 40) > (psx[r] - ((pst[r] * 20) - 20)))) and ((bgy[c] - 20) < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 50) > (psy[r] - ((pst[r] * 20) - 20)))) {
if ((((bgd[c] == 0) or (bgd[c] == 1)) or (bgd[c] == 2)) or (bgd[c] == 3)) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd1.start();
bgd[c] = 4;
bgs[c] = 5;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
if (((((bgt[c] == 6) and ((bgx[c] - 35) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 35) > (psx[r] - ((pst[r] * 20) - 20)))) and ((bgy[c] - 50) < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 20) > (psy[r] - ((pst[r] * 20) - 20)))) {
if ((bgd[c] == 0) or (bgd[c] == 1)) {
deflect.start();
pst[r] = 5;
psd[r] = 2;
}
if (bgd[c] == 2) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd2.start();
bgd[c] = 3;
bgs[c] = 4;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
if (((((bgt[c] == 7) and ((bgx[c] - 35) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 35) > (psx[r] - ((pst[r] * 20) - 20)))) and ((bgy[c] - 50) < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 20) > (psy[r] - ((pst[r] * 20) - 20)))) {
if (bgd[c] == 0) {
deflect.start();
pst[r] = 5;
psd[r] = 2;
}
if ((bgd[c] == 2) or (bgd[c] == 1)) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd2.start();
bgd[c] = 3;
bgs[c] = 3;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
if (((((bgt[c] == 8) and ((bgx[c] - 35) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 35) > (psx[r] - ((pst[r] * 20) - 20)))) and ((bgy[c] - 50) < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 20) > (psy[r] - ((pst[r] * 20) - 20)))) {
if ((bgd[c] == 0) or (bgd[c] == 1)) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd1.start();
bgd[c] = 2;
bgs[c] = 5;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
if (((((bgt[c] == 9) and ((bgx[c] - 40) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 40) > (psx[r] - ((pst[r] * 20) - 20)))) and ((bgy[c] - 20) < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 50) > (psy[r] - ((pst[r] * 20) - 20)))) {
if ((bgd[c] == 0) and (px > bgx[c])) {
deflect.start();
pst[r] = 5;
psd[r] = 2;
}
if ((bgd[c] == 1) and (px < bgx[c])) {
deflect.start();
pst[r] = 5;
psd[r] = 2;
}
if ((bgd[c] == 0) and (px < bgx[c])) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd1.start();
bgd[c] = 4;
bgs[c] = 4;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
if ((bgd[c] == 1) and (px > bgx[c])) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd1.start();
bgd[c] = 2;
bgs[c] = 4;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
if (((((bgt[c] == 10) and ((bgx[c] - 20) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 20) > (psx[r] - ((pst[r] * 20) - 20)))) and ((bgy[c] - 50) < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 20) > (psy[r] - ((pst[r] * 20) - 20)))) {
if ((bgd[c] == 0) or (bgd[c] == 1)) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd2.start();
bgd[c] = 2;
bgs[c] = 3;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
if (((((bgt[c] == 11) and ((bgx[c] - 25) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 25) > (psx[r] - ((pst[r] * 20) - 20)))) and (bgy[c] < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 50) > (psy[r] - ((pst[r] * 20) - 20)))) {
if ((((((bgd[c] == 0) or (bgd[c] == 1)) or (bgd[c] == 2)) or (bgd[c] == 3)) or (bgd[c] == 4)) or (bgd[c] == 5)) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd2.start();
bgd[c] = 6;
bgs[c] = 3;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
if (((((bgt[c] == 12) and ((bgx[c] - 25) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 25) > (psx[r] - ((pst[r] * 20) - 20)))) and (bgy[c] < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 50) > (psy[r] - ((pst[r] * 20) - 20)))) {
if ((bgd[c] == 0) or (bgd[c] == 1)) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd2.start();
bgd[c] = 2;
bgs[c] = 3;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
if (((((bgt[c] == 13) and ((bgx[c] - 35) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 35) > (psx[r] - ((pst[r] * 20) - 20)))) and (bgy[c] < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 60) > (psy[r] - ((pst[r] * 20) - 20)))) {
if ((((((bgd[c] == 0) or (bgd[c] == 1)) or (bgd[c] == 2)) or (bgd[c] == 3)) or (bgd[c] == 4)) or (bgd[c] == 5)) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd1.start();
bgd[c] = 6;
bgs[c] = 4;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
if (((((bgt[c] == 14) and ((bgx[c] - 20) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 20) > (psx[r] - ((pst[r] * 20) - 20)))) and ((bgy[c] - 20) < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 20) > (psy[r] - ((pst[r] * 20) - 20)))) {
if ((((bgd[c] == 0) or (bgd[c] == 1)) or (bgd[c] == 3)) or (bgd[c] == 4)) {
deflect.start();
pst[r] = 5;
psd[r] = 2;
}
if ((bgd[c] == 2) or (bgd[c] == 5)) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd2.start();
bgd[c] = 6;
bgs[c] = 3;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
}
r++;
}
c++;
}
r = 1;
while (r <= 8) {
if (((((bgt[r] > 0) and ((bgx[r] - 340) < px)) and ((bgx[r] + 340) > px)) and ((bgy[r] - 180) < py)) and ((bgy[r] + 350) > py)) {
c = 0;
e = 1;
while (e <= 26) {
if (((((bx[e] - 150) < bgx[r]) and ((bx[e] + 150) > bgx[r])) and ((by[e] - 150) < bgy[r])) and ((by[e] + 150) > bgy[r])) {
if (((((bgx[r] + 20) >= (bx[e] - 50)) and ((bgx[r] - 20) <= (bx[e] + 50))) and ((bgy[r] + 45) > (by[e] - 60))) and ((bgy[r] - 10) < (by[e] - 40))) {
c = 1;
}
if (((((bgx[r] + 20) > (bx[e] - 50)) and ((bgx[r] + 20) < bx[e])) and (bgy[r] < (by[e] + 50))) and ((bgy[r] + 20) > (by[e] - 50))) {
bgx[r] = bx[e] - 70;
}
if (((((bgx[r] - 20) < (bx[e] + 50)) and ((bgx[r] + 20) > bx[e])) and (bgy[r] < (by[e] + 50))) and ((bgy[r] + 20) > (by[e] - 50))) {
bgx[r] = bx[e] + 70;
}
if (((((bgx[r] - 5) < (bx[e] + 50)) and ((bgx[r] + 5) > (bx[e] - 50))) and ((bgy[r] - 30) < (by[e] + 50))) and (bgy[r] > (by[e] + 50))) {
bgy[r] = by[e] + 70;
}
if (((((bgx[r] - 2) < (bx[e] + 50)) and ((bgx[r] + 2) > (bx[e] - 50))) and ((bgy[r] + 20) < (by[e] - 50))) and ((bgy[r] + 60) > (by[e] - 50))) {
c = 1;
bgy[r] = by[e] - 105;
}
}
e++;
}
if (c == 0) {
bgy[r] = bgy[r] + 10;
}
if (bgt[r] == 1) {
if (((((((bgx[r] - 10) < (px + 10)) and ((bgx[r] + 10) > (px - 10))) and ((bgy[r] + 80) > (py + 10))) and ((bgy[r] + 50) < (py + 50))) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 4;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 4;
}
megah.start();
i = 10;
}
if (bgd[r] == 0) {
f[r] = 1;
if (px < bgx[r]) {
bgd[r] = 2;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
joes.start();
bgd[r] = 1;
bgs[r] = 7;
bgst[bsn] = 1;
bgsx[bsn] = bgx[r] - 10;
bgsy[bsn] = bgy[r] + 30;
bgsd[bsn] = 0;
bsn = bsn + 1;
if (bsn > 5) {
bsn = 1;
}
}
}
if (bgd[r] == 2) {
f[r] = 3;
if (px > bgx[r]) {
bgd[r] = 0;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
joes.start();
bgd[r] = 3;
bgs[r] = 7;
bgst[bsn] = 1;
bgsx[bsn] = bgx[r] + 10;
bgsy[bsn] = bgy[r] + 30;
bgsd[bsn] = 1;
bsn = bsn + 1;
if (bsn > 5) {
bsn = 1;
}
}
}
if (bgd[r] == 1) {
f[r] = 2;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 0;
bgs[r] = 20;
}
}
if (bgd[r] == 3) {
f[r] = 4;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 2;
bgs[r] = 20;
}
}
if (bgd[r] == 4) {
if (bgs[r] == 4) {
f[r] = 5;
}
if (bgs[r] == 3) {
f[r] = 6;
}
if (bgs[r] == 2) {
f[r] = 7;
}
if (bgs[r] == 1) {
f[r] = 8;
}
bgy[r] = bgy[r] - 10;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
f[r] = 9;
bgt[r] = 0;
bgx[r] = -500;
bgs[r] = 0;
}
}
}
if (bgt[r] == 2) {
if (((((((bgx[r] - 15) < (px + 10)) and ((bgx[r] + 15) > (px - 10))) and ((bgy[r] + 80) > (py - 10))) and ((bgy[r] + 50) < (py + 50))) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 3;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 3;
}
megah.start();
i = 10;
}
if (bgd[r] == 0) {
f[r] = 1;
if (px < bgx[r]) {
bgd[r] = 3;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 1;
bgs[r] = 10;
}
}
if (bgd[r] == 3) {
f[r] = 5;
if (px > bgx[r]) {
bgd[r] = 0;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 4;
bgs[r] = 10;
}
}
if (bgd[r] == 1) {
f[r] = 2;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 2;
bgs[r] = 12;
}
}
if (bgd[r] == 2) {
if (((bgs[r] == 12) or (bgs[r] == 11)) or (bgs[r] == 10)) {
f[r] = 3;
}
if (((bgs[r] == 9) or (bgs[r] == 8)) or (bgs[r] == 7)) {
f[r] = 4;
}
if (((bgs[r] == 6) or (bgs[r] == 5)) or (bgs[r] == 4)) {
f[r] = 3;
}
if (((bgs[r] == 3) or (bgs[r] == 2)) or (bgs[r] == 1)) {
f[r] = 4;
}
bgx[r] = bgx[r] + 8;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 0;
bgs[r] = 10 + random(20);
}
}
if (bgd[r] == 4) {
f[r] = 6;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 5;
bgs[r] = 12;
}
}
if (bgd[r] == 5) {
if (((bgs[r] == 12) or (bgs[r] == 11)) or (bgs[r] == 10)) {
f[r] = 7;
}
if (((bgs[r] == 9) or (bgs[r] == 8)) or (bgs[r] == 7)) {
f[r] = 8;
}
if (((bgs[r] == 6) or (bgs[r] == 5)) or (bgs[r] == 4)) {
f[r] = 7;
}
if (((bgs[r] == 3) or (bgs[r] == 2)) or (bgs[r] == 1)) {
f[r] = 8;
}
bgx[r] = bgx[r] - 8;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 3;
bgs[r] = 10 + random(20);
}
}
if (bgd[r] == 6) {
if (bgs[r] == 6) {
f[r] = 9;
}
if (bgs[r] == 5) {
f[r] = 10;
}
if (bgs[r] == 4) {
f[r] = 11;
}
if (bgs[r] == 3) {
f[r] = 12;
}
if (bgs[r] == 2) {
f[r] = 13;
}
if (bgs[r] == 1) {
f[r] = 14;
}
bgs[r] = bgs[r] - 1;
bgy[r] = bgy[r] - 10;
if (bgs[r] <= 0) {
f[r] = 15;
bgt[r] = 0;
bgx[r] = -500;
bgs[r] = 0;
}
}
}
if (bgt[r] == 3) {
if ((((((((bgx[r] - 20) < (px + 10)) and ((bgx[r] + 20) > (px - 10))) and ((bgy[r] + 60) > (py + 5))) and ((bgy[r] + 40) < (py + 45))) and (pcd < 18)) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 4;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 4;
}
megah.start();
i = 10;
}
if (bgd[r] == 0) {
if ((bgs[r] == 0) or (bgs[r] == 1)) {
f[r] = 1;
}
if ((bgs[r] == 2) or (bgs[r] == 3)) {
f[r] = 2;
}
if ((bgs[r] == 4) or (bgs[r] == 5)) {
f[r] = 3;
}
if ((bgs[r] == 6) or (bgs[r] == 7)) {
f[r] = 4;
}
if ((bgs[r] == 8) or (bgs[r] == 9)) {
f[r] = 5;
}
if ((bgs[r] == 10) or (bgs[r] == 11)) {
f[r] = 6;
}
if (px < bgx[r]) {
bgx[r] = bgx[r] - 5;
}
if (px > bgx[r]) {
bgx[r] = bgx[r] + 5;
}
if ((py - 20) > bgy[r]) {
bgy[r] = bgy[r] - 5;
}
if ((py - 20) < bgy[r]) {
bgy[r] = bgy[r] - 15;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgs[r] = 11;
}
}
if (bgd[r] == 1) {
if (bgs[r] == 4) {
f[r] = 7;
}
if (bgs[r] == 3) {
f[r] = 8;
}
if (bgs[r] == 2) {
f[r] = 9;
}
if (bgs[r] == 1) {
f[r] = 10;
}
bgs[r] = bgs[r] - 1;
bgy[r] = bgy[r] - 10;
if (bgs[r] <= 0) {
bgx[r] = -500;
f[r] = 11;
bgt[r] = 0;
bgs[r] = 0;
}
}
}
if (bgt[r] == 4) {
if (((((((bgx[r] - 20) < (px + 10)) and ((bgx[r] + 20) > (px - 10))) and ((bgy[r] + 80) > (py + 10))) and ((bgy[r] + 30) < (py + 50))) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 4;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 4;
}
megah.start();
i = 10;
}
if (bgd[r] == 0) {
f[r] = 1;
if ((px - 180) < bgx[r]) {
bgd[r] = 1;
bgs[r] = 4;
}
if (px < bgx[r]) {
bgd[r] = 2;
}
}
if (bgd[r] == 2) {
f[r] = 4;
if ((px + 180) > bgx[r]) {
bgd[r] = 3;
bgs[r] = 4;
}
if (px > bgx[r]) {
bgd[r] = 0;
}
}
if (bgd[r] == 1) {
if ((bgs[r] == 1) or (bgs[r] == 2)) {
f[r] = 2;
}
if ((bgs[r] == 3) or (bgs[r] == 4)) {
f[r] = 3;
}
bgx[r] = bgx[r] + 12;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgs[r] = 4;
}
}
if (bgd[r] == 3) {
if ((bgs[r] == 1) or (bgs[r] == 2)) {
f[r] = 5;
}
if ((bgs[r] == 3) or (bgs[r] == 4)) {
f[r] = 6;
}
bgx[r] = bgx[r] - 12;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgs[r] = 4;
}
}
if (bgd[r] == 4) {
if (bgs[r] == 4) {
f[r] = 7;
}
if (bgs[r] == 3) {
f[r] = 8;
}
if (bgs[r] == 2) {
f[r] = 9;
}
if (bgs[r] == 1) {
f[r] = 10;
}
bgs[r] = bgs[r] - 1;
bgy[r] = bgy[r] - 10;
if (bgs[r] <= 0) {
bgx[r] = -500;
f[r] = 11;
bgt[r] = 0;
bgs[r] = 0;
}
}
}
if (bgt[r] == 5) {
if (((((((bgx[r] - 20) < (px + 10)) and ((bgx[r] + 20) > (px - 10))) and ((bgy[r] + 80) > (py + 10))) and ((bgy[r] + 30) < (py + 50))) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 3;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 3;
}
megah.start();
i = 10;
}
if (bgd[r] == 0) {
f[r] = 1;
if (px < bgx[r]) {
bgd[r] = 2;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
cannons.start();
bgd[r] = 1;
bgs[r] = 8;
bgst[bsn] = 2;
bgsx[bsn] = bgx[r] - 20;
bgsy[bsn] = bgy[r] + 20;
bgsd[bsn] = 0;
bsn = bsn + 1;
if (bsn > 5) {
bsn = 1;
}
}
}
if (bgd[r] == 2) {
f[r] = 3;
if (px > bgx[r]) {
bgd[r] = 0;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
cannons.start();
bgd[r] = 3;
bgs[r] = 7;
bgst[bsn] = 2;
bgsx[bsn] = bgx[r] + 20;
bgsy[bsn] = bgy[r] + 20;
bgsd[bsn] = 1;
bsn = bsn + 1;
if (bsn > 5) {
bsn = 1;
}
}
}
if (bgd[r] == 1) {
f[r] = 2;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 0;
bgs[r] = 10 + random(15);
}
}
if (bgd[r] == 3) {
f[r] = 4;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 2;
bgs[r] = 10 + random(15);
}
}
if (bgd[r] == 4) {
if (bgs[r] == 5) {
f[r] = 5;
}
if (bgs[r] == 4) {
f[r] = 6;
}
if (bgs[r] == 3) {
f[r] = 7;
}
if (bgs[r] == 2) {
f[r] = 8;
}
if (bgs[r] == 1) {
f[r] = 9;
}
bgs[r] = bgs[r] - 1;
bgy[r] = bgy[r] - 10;
if (bgs[r] <= 0) {
f[r] = 10;
bgt[r] = 0;
bgx[r] = -500;
bgs[r] = 0;
}
}
}
if (bgt[r] == 6) {
if (((((((bgx[r] - 10) < (px + 10)) and ((bgx[r] + 10) > (px - 10))) and ((bgy[r] + 50) > (py + 10))) and ((bgy[r] + 10) < (py + 50))) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 4;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 4;
}
megah.start();
i = 10;
}
if (bgd[r] == 0) {
f[r] = 1;
bgy[r] = bgy[r] - 10;
if (((((px - 120) < bgx[r]) and ((px + 120) > bgx[r])) and ((bgy[r] - 80) < py)) and ((bgy[r] + 150) > py)) {
bgd[r] = 1;
bgs[r] = 6;
}
}
if (bgd[r] == 1) {
bgy[r] = bgy[r] - 10;
if (((bgs[r] == 6) or (bgs[r] == 5)) or (bgs[r] == 4)) {
f[r] = 2;
}
if (((bgs[r] == 3) or (bgs[r] == 2)) or (bgs[r] == 1)) {
f[r] = 3;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgs[r] = 4;
bgd[r] = 2;
}
}
if (bgd[r] == 2) {
if ((bgs[r] == 4) or (bgs[r] == 3)) {
f[r] = 4;
}
if ((bgs[r] == 2) or (bgs[r] == 1)) {
f[r] = 5;
}
if (px < bgx[r]) {
bgx[r] = (bgx[r] - 1) - random(10);
}
if (px > bgx[r]) {
bgx[r] = (bgx[r] + 1) + random(10);
}
if (py > bgy[r]) {
bgy[r] = bgy[r] + random(8);
}
if (py < bgy[r]) {
bgy[r] = (bgy[r] - 10) - random(10);
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgs[r] = 4;
}
}
if (bgd[r] == 3) {
if (bgs[r] == 4) {
f[r] = 6;
}
if (bgs[r] == 3) {
f[r] = 7;
}
if (bgs[r] == 2) {
f[r] = 8;
}
if (bgs[r] == 1) {
f[r] = 9;
}
bgs[r] = bgs[r] - 1;
bgy[r] = bgy[r] - 10;
if (bgs[r] <= 0) {
f[r] = 10;
bgt[r] = 0;
bgx[r] = -500;
bgs[r] = 0;
}
}
}
if (bgt[r] == 7) {
if (((((((bgx[r] - 20) < (px + 10)) and ((bgx[r] + 20) > (px - 10))) and ((bgy[r] + 20) > (py + 10))) and ((bgy[r] + 20) < (py + 50))) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 3;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 3;
}
megah.start();
i = 10;
}
if (bgd[r] == 0) {
f[r] = 1;
bgy[r] = bgy[r] - 10;
if ((px + 80) < bgx[r]) {
bgx[r] = bgx[r] - 5;
}
if ((px - 80) > bgx[r]) {
bgx[r] = bgx[r] + 5;
}
if ((py - 70) < bgy[r]) {
bgy[r] = bgy[r] - 5;
}
if ((py - 70) > bgy[r]) {
bgy[r] = bgy[r] + 5;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
joes.start();
if (px > bgx[r]) {
bgd[r] = 1;
}
if (px < bgx[r]) {
bgd[r] = 2;
}
if (px < bgx[r]) {
bgsd[bsn] = 3;
if ((py - 50) < bgy[r]) {
bgsd[bsn] = 1;
}
}
if (px > bgx[r]) {
bgsd[bsn] = 2;
if ((py - 50) < bgy[r]) {
bgsd[bsn] = 0;
}
}
bgs[r] = 12;
bgst[bsn] = 1;
bgsx[bsn] = bgx[r];
bgsy[bsn] = bgy[r];
bsn = bsn + 1;
if (bsn > 5) {
bsn = 1;
}
}
}
if (bgd[r] == 1) {
f[r] = 2;
bgy[r] = bgy[r] - 10;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 0;
bgs[r] = 10 + random(25);
}
}
if (bgd[r] == 2) {
f[r] = 3;
bgy[r] = bgy[r] - 10;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 0;
bgs[r] = 10 + random(25);
}
}
if (bgd[r] == 3) {
if (bgs[r] == 3) {
f[r] = 4;
}
if (bgs[r] == 2) {
f[r] = 5;
}
if (bgs[r] == 1) {
f[r] = 6;
}
bgs[r] = bgs[r] - 1;
bgy[r] = bgy[r] - 10;
if (bgs[r] <= 0) {
f[r] = 7;
bgt[r] = 0;
bgx[r] = -500;
bgs[r] = 0;
}
}
}
if (bgt[r] == 8) {
if (((((((bgx[r] - 20) < (px + 10)) and ((bgx[r] + 20) > (px - 10))) and ((bgy[r] + 35) > (py + 10))) and ((bgy[r] + 20) < (py + 50))) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 8;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 8;
}
bgd[r] = 2;
bgs[r] = 10;
baddyd1.start();
i = 10;
}
if (bgd[r] == 0) {
f[r] = 1;
bgx[r] = bgx[r] + 20;
if ((py + 30) > bgy[r]) {
bgy[r] = bgy[r] - 8;
}
if ((py + 30) < bgy[r]) {
bgy[r] = bgy[r] - 12;
}
if ((px + 100) < bgx[r]) {
bgd[r] = 1;
}
}
if (bgd[r] == 1) {
f[r] = 2;
bgx[r] = bgx[r] - 20;
if ((py + 30) > bgy[r]) {
bgy[r] = bgy[r] - 8;
}
if ((py + 30) < bgy[r]) {
bgy[r] = bgy[r] - 12;
}
if ((px - 100) > bgx[r]) {
bgd[r] = 0;
}
}
if (bgd[r] == 2) {
if (bgs[r] == 5) {
f[r] = 3;
}
if (bgs[r] == 4) {
f[r] = 4;
}
if (bgs[r] == 3) {
f[r] = 5;
}
if (bgs[r] == 2) {
f[r] = 6;
}
if (bgs[r] == 1) {
f[r] = 7;
}
bgs[r] = bgs[r] - 1;
bgy[r] = bgy[r] - 10;
if (bgs[r] <= 0) {
bgx[r] = -500;
f[r] = 8;
bgt[r] = 0;
bgs[r] = 0;
}
}
}
if (bgt[r] == 9) {
if (((((((bgx[r] - 30) < (px + 10)) and ((bgx[r] + 30) > (px - 10))) and ((bgy[r] + 55) > (py + 10))) and ((bgy[r] + 20) < (py + 50))) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 5;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 5;
}
megah.start();
i = 10;
}
if (bgd[r] == 0) {
if ((bgs[r] == 1) or (bgs[r] == 2)) {
f[r] = 1;
}
if ((bgs[r] == 3) or (bgs[r] == 4)) {
f[r] = 2;
}
bgx[r] = bgx[r] + 8;
if ((px + 80) < bgx[r]) {
bgd[r] = 1;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgs[r] = 4;
}
}
if (bgd[r] == 1) {
if ((bgs[r] == 1) or (bgs[r] == 2)) {
f[r] = 3;
}
if ((bgs[r] == 3) or (bgs[r] == 4)) {
f[r] = 4;
}
bgx[r] = bgx[r] - 8;
if ((px - 80) > bgx[r]) {
bgd[r] = 0;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgs[r] = 4;
}
}
if (bgd[r] == 2) {
if (bgs[r] == 4) {
f[r] = 5;
}
if (bgs[r] == 3) {
f[r] = 6;
}
if (bgs[r] == 2) {
f[r] = 7;
}
if (bgs[r] == 1) {
f[r] = 8;
}
bgs[r] = bgs[r] - 1;
bgy[r] = bgy[r] - 10;
if (bgs[r] <= 0) {
bgx[r] = -500;
f[r] = 9;
bgt[r] = 0;
bgs[r] = 0;
}
}
}
if (bgt[r] == 10) {
if (((((((bgx[r] - 20) < (px + 10)) and ((bgx[r] + 20) > (px - 10))) and ((bgy[r] + 20) > (py + 10))) and ((bgy[r] + 20) < (py + 50))) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 2;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 2;
}
megah.start();
i = 10;
}
if (bgd[r] == 0) {
f[r] = 1;
bgy[r] = bgy[r] - 10;
if (px < bgx[r]) {
bgx[r] = bgx[r] - 7;
}
if (px > bgx[r]) {
bgx[r] = bgx[r] + 7;
}
if ((py - 80) < bgy[r]) {
bgy[r] = bgy[r] - 8;
}
if ((py - 80) > bgy[r]) {
bgy[r] = bgy[r] + 8;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
joes.start();
bgd[r] = 1;
bgsd[bsn] = 4;
bgs[r] = 5;
bgst[bsn] = 1;
bgsx[bsn] = bgx[r];
bgsy[bsn] = bgy[r];
bsn = bsn + 1;
if (bsn > 5) {
bsn = 1;
}
}
}
if (bgd[r] == 1) {
f[r] = 2;
bgy[r] = bgy[r] - 10;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 0;
bgs[r] = 6 + random(16);
}
}
if (bgd[r] == 2) {
if (bgs[r] == 3) {
f[r] = 3;
}
if (bgs[r] == 2) {
f[r] = 4;
}
if (bgs[r] == 1) {
f[r] = 5;
}
bgs[r] = bgs[r] - 1;
bgy[r] = bgy[r] - 10;
if (bgs[r] <= 0) {
f[r] = 7;
bgt[r] = 0;
bgx[r] = -500;
bgs[r] = 0;
}
}
}
if (bgt[r] == 11) {
if (((((((bgx[r] - 20) < (px + 10)) and ((bgx[r] + 20) > (px - 10))) and ((bgy[r] + 50) > (py - 10))) and (bgy[r] < (py + 50))) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 3;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 3;
}
megah.start();
i = 10;
}
if (bgd[r] == 0) {
if (((bgs[r] == 12) or (bgs[r] == 11)) or (bgs[r] == 10)) {
f[r] = 1;
}
if (((bgs[r] == 9) or (bgs[r] == 8)) or (bgs[r] == 7)) {
f[r] = 2;
}
if (((bgs[r] == 6) or (bgs[r] == 5)) or (bgs[r] == 4)) {
f[r] = 1;
}
if (((bgs[r] == 3) or (bgs[r] == 2)) or (bgs[r] == 1)) {
f[r] = 2;
}
if (bgx[r] > px) {
bgd[r] = 3;
bgs[r] = 12;
}
bgx[r] = bgx[r] + 6;
if (((bgx[r] + 150) > (px - 20)) and (bgx[r] < px)) {
bgd[r] = 1;
bgs[r] = 9;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgs[r] = 12;
}
}
if (bgd[r] == 1) {
f[r] = 3;
bgx[r] = bgx[r] + 12;
bgy[r] = bgy[r] - 20;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 2;
bgs[r] = 10;
}
}
if (bgd[r] == 2) {
f[r] = 3;
bgx[r] = bgx[r] + 12;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 0;
bgs[r] = 12;
}
}
if (bgd[r] == 3) {
if (((bgs[r] == 12) or (bgs[r] == 11)) or (bgs[r] == 10)) {
f[r] = 4;
}
if (((bgs[r] == 9) or (bgs[r] == 8)) or (bgs[r] == 7)) {
f[r] = 5;
}
if (((bgs[r] == 6) or (bgs[r] == 5)) or (bgs[r] == 4)) {
f[r] = 4;
}
if (((bgs[r] == 3) or (bgs[r] == 2)) or (bgs[r] == 1)) {
f[r] = 5;
}
if (bgx[r] < px) {
bgd[r] = 0;
bgs[r] = 12;
}
bgx[r] = bgx[r] - 6;
if (((bgx[r] - 150) < (px - 20)) and (bgx[r] > px)) {
bgd[r] = 4;
bgs[r] = 9;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgs[r] = 12;
}
}
if (bgd[r] == 4) {
f[r] = 6;
bgx[r] = bgx[r] - 12;
bgy[r] = bgy[r] - 20;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 5;
bgs[r] = 10;
}
}
if (bgd[r] == 5) {
f[r] = 6;
bgx[r] = bgx[r] - 12;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 3;
bgs[r] = 12;
}
}
if (bgd[r] == 6) {
if (bgs[r] == 3) {
f[r] = 7;
}
if (bgs[r] == 2) {
f[r] = 8;
}
if (bgs[r] == 1) {
f[r] = 9;
}
bgs[r] = bgs[r] - 1;
bgy[r] = bgy[r] - 10;
if (bgs[r] <= 0) {
f[r] = 15;
bgt[r] = 0;
bgx[r] = -500;
bgs[r] = 0;
}
}
}
if (bgt[r] == 12) {
if (((((((bgx[r] - 20) < (px + 10)) and ((bgx[r] + 20) > (px - 10))) and ((bgy[r] + 40) > py)) and ((bgy[r] - 20) < (py + 50))) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 3;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 3;
}
megah.start();
i = 10;
}
if (bgd[r] == 0) {
if (bgs[r] == 1) {
f[r] = 1;
}
if (bgs[r] == 2) {
f[r] = 2;
}
bgy[r] = bgy[r] - 10;
bgx[r] = bgx[r] + 7;
if ((py - 60) < bgy[r]) {
bgy[r] = bgy[r] - 5;
}
if ((((px - 70) < bgx[r]) and ((px + 70) > bgx[r])) and (py > bgy[r])) {
bgy[r] = bgy[r] + 12;
}
if ((px + 100) < bgx[r]) {
bgd[r] = 1;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgs[r] = 2;
}
}
if (bgd[r] == 1) {
if (bgs[r] == 1) {
f[r] = 3;
}
if (bgs[r] == 2) {
f[r] = 4;
}
bgy[r] = bgy[r] - 10;
bgx[r] = bgx[r] - 7;
if ((py - 60) < bgy[r]) {
bgy[r] = bgy[r] - 5;
}
if ((((px - 70) < bgx[r]) and ((px + 70) > bgx[r])) and (py > bgy[r])) {
bgy[r] = bgy[r] + 12;
}
if ((px - 100) > bgx[r]) {
bgd[r] = 0;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgs[r] = 2;
}
}
if (bgd[r] == 2) {
if (bgs[r] == 4) {
f[r] = 5;
}
if (bgs[r] == 3) {
f[r] = 6;
}
if (bgs[r] == 2) {
f[r] = 7;
}
if (bgs[r] == 1) {
f[r] = 8;
}
bgs[r] = bgs[r] - 1;
bgy[r] = bgy[r] - 10;
if (bgs[r] <= 0) {
bgx[r] = -500;
f[r] = 9;
bgt[r] = 0;
bgs[r] = 0;
}
}
}
if (bgt[r] == 13) {
if (((((((bgx[r] - 50) < (px + 10)) and ((bgx[r] + 50) > (px - 10))) and ((bgy[r] + 70) > (py + 10))) and (bgy[r] < (py + 50))) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 4;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 4;
}
megah.start();
i = 10;
}
if (bgd[r] == 0) {
f[r] = 1;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
if ((px - 170) < bgx[r]) {
bgd[r] = 1;
bgs[r] = 7;
}
}
if (px < bgx[r]) {
bgd[r] = 3;
}
}
if (bgd[r] == 1) {
f[r] = 2;
bgx[r] = bgx[r] + 30;
bgy[r] = bgy[r] - 20;
if (bgy[r] < py) {
bgy[r] = bgy[r] + 10;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 2;
bgs[r] = 12;
}
}
if (bgd[r] == 2) {
f[r] = 3;
bgx[r] = bgx[r] + 5;
bgy[r] = bgy[r] + 2;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 0;
bgs[r] = random(12);
}
}
if (bgd[r] == 3) {
f[r] = 4;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
if ((px + 170) > bgx[r]) {
bgd[r] = 4;
bgs[r] = 7;
}
}
if (px > bgx[r]) {
bgd[r] = 0;
}
}
if (bgd[r] == 4) {
f[r] = 5;
bgx[r] = bgx[r] - 30;
bgy[r] = bgy[r] - 20;
bgs[r] = bgs[r] - 1;
if (bgy[r] < py) {
bgy[r] = bgy[r] + 10;
}
if (bgs[r] <= 0) {
bgd[r] = 5;
bgs[r] = 12;
}
}
if (bgd[r] == 5) {
f[r] = 6;
bgx[r] = bgx[r] - 5;
bgy[r] = bgy[r] + 2;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 3;
bgs[r] = random(12);
}
}
if (bgd[r] == 6) {
if (bgs[r] == 4) {
f[r] = 7;
}
if (bgs[r] == 3) {
f[r] = 8;
}
if (bgs[r] == 2) {
f[r] = 9;
}
if (bgs[r] == 1) {
f[r] = 10;
}
bgs[r] = bgs[r] - 1;
bgy[r] = bgy[r] - 10;
if (bgs[r] <= 0) {
bgx[r] = -500;
f[r] = 11;
bgt[r] = 0;
bgs[r] = 0;
}
}
}
if (bgt[r] == 14) {
if (((((((bgx[r] - 20) < (px + 10)) and ((bgx[r] + 20) > (px - 10))) and ((bgy[r] + 50) > (py + 10))) and ((bgy[r] + 20) < (py + 50))) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 2;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 2;
}
megah.start();
i = 10;
}
if (bgt[r] > 0) {
bgy[r] = bgy[r] - 10;
}
if (bgd[r] == 0) {
f[r] = 1;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 1;
bgs[r] = 6;
}
}
if (bgd[r] == 1) {
if (((bgs[r] == 6) or (bgs[r] == 5)) or (bgs[r] == 4)) {
f[r] = 2;
}
if (((bgs[r] == 3) or (bgs[r] == 2)) or (bgs[r] == 1)) {
f[r] = 3;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 2;
bgs[r] = 15;
}
}
if (bgd[r] == 2) {
f[r] = 4;
if (((bgs[r] == 15) or (bgs[r] == 10)) or (bgs[r] == 5)) {
cannons.start();
bgst[bsn] = 2;
bgsx[bsn] = bgx[r] + 20;
bgsy[bsn] = bgy[r];
bgsd[bsn] = 0;
bsn = bsn + 1;
if (bsn > 5) {
bsn = 1;
}
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 0;
bgs[r] = 20;
}
}
if (bgd[r] == 3) {
f[r] = 5;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 4;
bgs[r] = 6;
}
}
if (bgd[r] == 4) {
if (((bgs[r] == 6) or (bgs[r] == 5)) or (bgs[r] == 4)) {
f[r] = 6;
}
if (((bgs[r] == 3) or (bgs[r] == 2)) or (bgs[r] == 1)) {
f[r] = 7;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 5;
bgs[r] = 15;
}
}
if (bgd[r] == 5) {
f[r] = 8;
if (((bgs[r] == 15) or (bgs[r] == 10)) or (bgs[r] == 5)) {
cannons.start();
bgst[bsn] = 2;
bgsx[bsn] = bgx[r] - 20;
bgsy[bsn] = bgy[r];
bgsd[bsn] = 1;
bsn = bsn + 1;
if (bsn > 5) {
bsn = 1;
}
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 3;
bgs[r] = 20;
}
}
if (bgd[r] == 6) {
if (bgs[r] == 2) {
f[r] = 9;
}
if (bgs[r] == 1) {
f[r] = 10;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
f[r] = 11;
bgt[r] = 0;
bgx[r] = -500;
bgs[r] = 0;
}
}
}
}
r++;
}
r = 1;
while (r <= 5) {
if (bgst[r] > 0) {
if (bgst[r] == 1) {
if (r == 1) {
bgs1.gotoAndStop(1);
}
if (r == 2) {
bgs2.gotoAndStop(1);
}
if (r == 3) {
bgs3.gotoAndStop(1);
}
if (r == 4) {
bgs4.gotoAndStop(1);
}
if (r == 5) {
bgs5.gotoAndStop(1);
}
if (bgsd[r] == 0) {
bgsx[r] = bgsx[r] + 20;
if (bgsx[r] > (px + 300)) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgsd[r] == 1) {
bgsx[r] = bgsx[r] - 20;
if (bgsx[r] < (px - 300)) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgsd[r] == 2) {
bgsx[r] = bgsx[r] + 15;
bgsy[r] = bgsy[r] + 15;
if ((bgsx[r] > (px + 300)) or (bgsy[r] > (py + 300))) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgsd[r] == 3) {
bgsx[r] = bgsx[r] - 15;
bgsy[r] = bgsy[r] + 15;
if ((bgsx[r] > (px + 300)) or (bgsy[r] > (py + 300))) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgsd[r] == 4) {
bgsy[r] = bgsy[r] + 20;
if (bgsy[r] > (py + 300)) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (((((((bgsx[r] - 15) < (px + 10)) and ((bgsx[r] + 15) > (px - 10))) and ((bgsy[r] + 15) > (py + 5))) and ((bgsy[r] - 15) < (py + 20))) and (pcd < 18)) and (i < 1)) {
if ((bgsd[r] == 0) or (bgsd[r] == 2)) {
pcd = 19;
}
if ((bgsd[r] == 1) or (bgsd[r] == 3)) {
pcd = 18;
}
pstep = 2;
pl = pl - 3;
megah.start();
i = 10;
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgst[r] == 2) {
if (r == 1) {
bgs1.gotoAndStop(2);
}
if (r == 2) {
bgs2.gotoAndStop(2);
}
if (r == 3) {
bgs3.gotoAndStop(2);
}
if (r == 4) {
bgs4.gotoAndStop(2);
}
if (r == 5) {
bgs5.gotoAndStop(2);
}
if (bgsd[r] == 0) {
bgsx[r] = bgsx[r] + 30;
if (bgsx[r] > (px + 300)) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgsd[r] == 1) {
bgsx[r] = bgsx[r] - 30;
if (bgsx[r] < (px - 300)) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (((((((bgsx[r] - 25) < (px + 10)) and ((bgsx[r] + 25) > (px - 10))) and ((bgsy[r] + 80) > (py + 40))) and ((bgsy[r] + 35) < (py + 60))) and (pcd < 18)) and (i < 1)) {
if (bgsd[r] == 0) {
pcd = 19;
}
if (bgsd[r] == 1) {
pcd = 18;
}
pstep = 2;
pl = pl - 6;
megah.start();
i = 10;
bgst[r] = 0;
bgsx[r] = -200;
}
}
}
r++;
}
bg1.gotoAndStop(f[1]);
bg2.gotoAndStop(f[2]);
bg3.gotoAndStop(f[3]);
bg4.gotoAndStop(f[4]);
bg5.gotoAndStop(f[5]);
bg6.gotoAndStop(f[6]);
bg7.gotoAndStop(f[7]);
bg8.gotoAndStop(f[8]);
bgs1._x = ((bgsx[1] + 275) - px) / 2;
bgs1._y = ((bgsy[1] + 275) - py) / 2;
bgs2._x = ((bgsx[2] + 275) - px) / 2;
bgs2._y = ((bgsy[2] + 275) - py) / 2;
bgs3._x = ((bgsx[3] + 275) - px) / 2;
bgs3._y = ((bgsy[3] + 275) - py) / 2;
bgs4._x = ((bgsx[4] + 275) - px) / 2;
bgs4._y = ((bgsy[4] + 275) - py) / 2;
bgs5._x = ((bgsx[5] + 275) - px) / 2;
bgs5._y = ((bgsy[5] + 275) - py) / 2;
bg1._x = ((bgx[1] + 275) - px) / 2;
bg1._y = ((bgy[1] + 275) - py) / 2;
bg2._x = ((bgx[2] + 275) - px) / 2;
bg2._y = ((bgy[2] + 275) - py) / 2;
bg3._x = ((bgx[3] + 275) - px) / 2;
bg3._y = ((bgy[3] + 275) - py) / 2;
bg4._x = ((bgx[4] + 275) - px) / 2;
bg4._y = ((bgy[4] + 275) - py) / 2;
bg5._x = ((bgx[5] + 275) - px) / 2;
bg5._y = ((bgy[5] + 275) - py) / 2;
bg6._x = ((bgx[6] + 275) - px) / 2;
bg6._y = ((bgy[6] + 275) - py) / 2;
bg7._x = ((bgx[7] + 275) - px) / 2;
bg7._y = ((bgy[7] + 275) - py) / 2;
bg8._x = ((bgx[8] + 275) - px) / 2;
bg8._y = ((bgy[8] + 275) - py) / 2;
r = 1;
while (r <= 3) {
if (((pst[r] > 0) and (pst[r] < 4)) and (psd[r] == 0)) {
if (r == 1) {
shot1p._x = ((297 + psx[1]) - px) / 2;
shot1p._y = ((270 + psy[1]) - py) / 2;
}
if (r == 2) {
shot2p._x = ((297 + psx[2]) - px) / 2;
shot2p._y = ((270 + psy[2]) - py) / 2;
}
if (r == 3) {
shot3p._x = ((297 + psx[3]) - px) / 2;
shot3p._y = ((270 + psy[3]) - py) / 2;
}
}
if (((pst[r] > 0) and (pst[r] < 4)) and (psd[r] == 1)) {
if (r == 1) {
shot1p._x = ((247 + psx[1]) - px) / 2;
shot1p._y = ((270 + psy[1]) - py) / 2;
}
if (r == 2) {
shot2p._x = ((247 + psx[2]) - px) / 2;
shot2p._y = ((270 + psy[2]) - py) / 2;
}
if (r == 3) {
shot3p._x = ((247 + psx[3]) - px) / 2;
shot3p._y = ((270 + psy[3]) - py) / 2;
}
}
if ((pst[r] == 4) or (pst[r] == 5)) {
if (r == 1) {
shot1p._x = ((272 + psx[1]) - px) / 2;
shot1p._y = ((270 + psy[1]) - py) / 2;
}
if (r == 2) {
shot2p._x = ((272 + psx[2]) - px) / 2;
shot2p._y = ((270 + psy[2]) - py) / 2;
}
if (r == 3) {
shot3p._x = ((272 + psx[3]) - px) / 2;
shot3p._y = ((270 + psy[3]) - py) / 2;
}
}
if (pst[r] == 0) {
if (r == 1) {
shot1p._x = -200;
shot1p._y = (270 + psy[1]) - py;
}
if (r == 2) {
shot2p._x = -200;
shot2p._y = (270 + psy[2]) - py;
}
if (r == 3) {
shot3p._x = -200;
shot3p._y = (270 + psy[3]) - py;
}
}
r++;
}
if (i > 0) {
i = i - 1;
pc._alpha = 50;
}
if (i <= 0) {
i = i - 1;
pc._alpha = 100;
}
if (bcharge > 0) {
charge._alpha = bcharge;
}
lbar._height = 2 * pl;
lbar._y = 120 - (2 * pl);
stage._x = (770 - px) / 2;
stage._y = (175 - py) / 2;
exit._x = ((ex + 275) - px) / 2;
exit._y = ((ey + 275) - py) / 2;
Frame 260
gotoAndPlay (18);
if ((((px + 10) > (ex - 20)) and ((px - 10) < (ex + 20))) and (((py + 30) > (ey - 20)) and (py < (ey + 50)))) {
gotoAndPlay (20);
}
Frame 261
lbar._height = 2 * pl;
lbar._y = 120 - (2 * pl);
stage._x = (275 - px) / 2;
stage._y = (-225 - py) / 2;
exit._x = ((ex + 275) - px) / 2;
exit._y = ((ey + 275) - py) / 2;
Frame 264
psn = 1;
bstep = 0;
pcd = 0;
bcharge = 0;
r = 1;
while (r <= 5) {
psx[r] = -200;
psy[r] = 0;
pst[r] = 0;
psd[r] = 0;
r++;
}
i = 0;
pl = pl + 5;
if (pl > 50) {
pl = 50;
}
px = 950;
py = -525;
r = 0;
while (r <= 26) {
bx[r] = -50;
by[r] = -50;
r++;
}
bx[1] = 1050;
by[1] = -650;
bx[2] = 150;
by[2] = -550;
bx[3] = 650;
by[3] = -550;
bx[4] = 1050;
by[4] = -550;
bx[5] = 150;
by[5] = -450;
bx[6] = 450;
by[6] = -450;
bx[7] = 550;
by[7] = -450;
bx[8] = 750;
by[8] = -450;
bx[9] = 850;
by[9] = -450;
bx[10] = 950;
by[10] = -450;
bx[11] = 150;
by[11] = -350;
bx[12] = 250;
by[12] = -350;
bx[13] = 550;
by[13] = -350;
bx[14] = 150;
by[14] = -250;
bx[15] = 450;
by[15] = -250;
bx[16] = 150;
by[16] = -150;
bx[17] = 550;
by[17] = -150;
bx[18] = 650;
by[18] = -150;
bx[19] = 750;
by[19] = -100;
bx[20] = 250;
by[20] = -50;
bx[21] = 350;
by[21] = 50;
bx[22] = 450;
by[22] = 50;
bx[23] = 550;
by[23] = 100;
bx[24] = 650;
by[24] = 150;
bx[25] = 750;
by[25] = 150;
bsn = 1;
r = 1;
while (r <= 8) {
bgx[r] = -200;
bgy[r] = -200;
bgt[r] = 0;
bgd[r] = -1;
bgs[r] = 0;
r++;
}
r = 1;
while (r <= 5) {
bgsx[r] = -200;
bgsy[r] = 0;
bgst[r] = 0;
bgsd[r] = 0;
r++;
}
r = 1;
while (r <= 8) {
f[r] = 20;
r++;
}
bgt[1] = 1;
bgd[1] = 0;
bgs[1] = 0;
bgl[1] = 3;
bgx[1] = 680;
bgy[1] = -650;
bgt[2] = 2;
bgd[2] = 0;
bgs[2] = 0;
bgl[2] = 3;
bgx[2] = 550;
bgy[2] = -550;
bgt[3] = 2;
bgd[3] = 0;
bgs[3] = 0;
bgl[3] = 3;
bgx[3] = 500;
bgy[3] = -550;
bgt[4] = 3;
bgd[4] = 0;
bgs[4] = 0;
bgl[4] = 5;
bgx[4] = 400;
bgy[4] = -650;
bgt[5] = 14;
bgd[5] = 0;
bgs[5] = 0;
bgl[5] = 3;
bgx[5] = 200;
bgy[5] = -450;
bgt[6] = 14;
bgd[6] = 3;
bgs[6] = 0;
bgl[6] = 3;
bgx[6] = 500;
bgy[6] = -350;
bgt[7] = 3;
bgd[7] = 0;
bgs[7] = 0;
bgl[7] = 5;
bgx[7] = 250;
bgy[7] = -250;
bgt[8] = 2;
bgd[8] = 0;
bgs[8] = 0;
bgl[8] = 3;
bgx[8] = 450;
bgy[8] = -50;
ex = 750;
ey = 50;
Frame 265
b1._x = bx[1] / 10;
b1._y = (by[1] / 10) + 120;
b2._x = bx[2] / 10;
b2._y = (by[2] / 10) + 120;
b3._x = bx[3] / 10;
b3._y = (by[3] / 10) + 120;
b4._x = bx[4] / 10;
b4._y = (by[4] / 10) + 120;
b5._x = bx[5] / 10;
b5._y = (by[5] / 10) + 120;
b6._x = bx[6] / 10;
b6._y = (by[6] / 10) + 120;
b7._x = bx[7] / 10;
b7._y = (by[7] / 10) + 120;
b8._x = bx[8] / 10;
b8._y = (by[8] / 10) + 120;
b9._x = bx[9] / 10;
b9._y = (by[9] / 10) + 120;
b10._x = bx[10] / 10;
b10._y = (by[10] / 10) + 120;
b11._x = bx[11] / 10;
b11._y = (by[11] / 10) + 120;
b12._x = bx[12] / 10;
b12._y = (by[12] / 10) + 120;
b13._x = bx[13] / 10;
b13._y = (by[13] / 10) + 120;
b14._x = bx[14] / 10;
b14._y = (by[14] / 10) + 120;
b15._x = bx[15] / 10;
b15._y = (by[15] / 10) + 120;
b16._x = bx[16] / 10;
b16._y = (by[16] / 10) + 120;
b17._x = bx[17] / 10;
b17._y = (by[17] / 10) + 120;
b18._x = bx[18] / 10;
b18._y = (by[18] / 10) + 120;
b19._x = bx[19] / 10;
b19._y = (by[19] / 10) + 120;
b20._x = bx[20] / 10;
b20._y = (by[20] / 10) + 120;
b21._x = bx[21] / 10;
b21._y = (by[21] / 10) + 120;
b22._x = bx[22] / 10;
b22._y = (by[22] / 10) + 120;
b23._x = bx[23] / 10;
b23._y = (by[23] / 10) + 120;
b24._x = bx[24] / 10;
b24._y = (by[24] / 10) + 120;
b25._x = bx[25] / 10;
b25._y = (by[25] / 10) + 120;
b26._x = bx[26] / 10;
b26._y = (by[26] / 10) + 120;
b27._x = bx[27] / 10;
b27._y = (by[27] / 10) + 120;
b28._x = bx[28] / 10;
b28._y = (by[28] / 10) + 120;
cir._x = px / 10;
cir._y = (py / 10) + 120;
shot1._x = psx[1] / 10;
shot1._y = (psy[1] / 10) + 120;
shot2._x = psx[2] / 10;
shot2._y = (psy[2] / 10) + 120;
shot3._x = psx[3] / 10;
shot3._y = (psy[3] / 10) + 120;
bshot1._x = bgsx[1] / 10;
bshot1._y = (bgsy[1] / 10) + 120;
bshot2._x = bgsx[2] / 10;
bshot2._y = (bgsy[2] / 10) + 120;
bshot3._x = bgsx[3] / 10;
bshot3._y = (bgsy[3] / 10) + 120;
bshot4._x = bgsx[4] / 10;
bshot4._y = (bgsy[4] / 10) + 120;
bshot5._x = bgsx[5] / 10;
bshot5._y = (bgsy[5] / 10) + 120;
bcir1._x = bgx[1] / 10;
bcir1._y = (bgy[1] / 10) + 120;
bcir2._x = bgx[2] / 10;
bcir2._y = (bgy[2] / 10) + 120;
bcir3._x = bgx[3] / 10;
bcir3._y = (bgy[3] / 10) + 120;
bcir4._x = bgx[4] / 10;
bcir4._y = (bgy[4] / 10) + 120;
bcir5._x = bgx[5] / 10;
bcir5._y = (bgy[5] / 10) + 120;
bcir6._x = bgx[6] / 10;
bcir6._y = (bgy[6] / 10) + 120;
bcir7._x = bgx[7] / 10;
bcir7._y = (bgy[7] / 10) + 120;
bcir8._x = bgx[8] / 10;
bcir8._y = (bgy[8] / 10) + 120;
bcir9._x = bgx[9] / 10;
bcir9._y = (bgy[9] / 10) + 120;
bcir10._x = bgx[10] / 10;
bcir10._y = (bgy[10] / 10) + 120;
bcir11._x = bgx[11] / 10;
bcir11._y = (bgy[11] / 10) + 120;
bcir12._x = bgx[12] / 10;
bcir12._y = (bgy[12] / 10) + 120;
bcir13._x = bgx[13] / 10;
bcir13._y = (bgy[13] / 10) + 120;
if (Key.isDown(39) and (pcd == 0)) {
pcd = 2;
}
if (Key.isDown(39) and ((pcd == 1) or (pcd == 3))) {
pcd = 0;
}
if (Key.isDown(37) and (pcd == 1)) {
pcd = 3;
}
if (Key.isDown(37) and ((pcd == 0) or (pcd == 2))) {
pcd = 1;
}
if (Key.isDown(38) and ((pcd == 0) or (pcd == 2))) {
pcd = 10;
pstep = 7;
}
if (Key.isDown(38) and ((pcd == 1) or (pcd == 3))) {
pcd = 11;
pstep = 7;
}
if (Key.isDown(40) and ((((pcd == 0) or (pcd == 1)) or (pcd == 2)) or (pcd == 3))) {
if (((pcd == 0) or (pcd == 2)) or (pcd == 8)) {
pcd = 6;
pstep = 3;
}
if (((pcd == 1) or (pcd == 3)) or (pcd == 9)) {
pcd = 7;
pstep = 3;
}
}
if (Key.isDown(16) and (bcharge < 100)) {
bcharge = bcharge + 5;
}
if (pcd == 0) {
pc.gotoAndStop(1);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(21);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 0;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
}
if (pcd == 1) {
pc.gotoAndStop(2);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(22);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 1;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
}
if (pcd == 2) {
px = px + 13;
if ((w == 0) or (w == 1)) {
pc.gotoAndStop(3);
}
if ((w == 2) or (w == 3)) {
pc.gotoAndStop(4);
}
if ((w == 4) or (w == 5)) {
pc.gotoAndStop(5);
}
if ((w == 6) or (w == 7)) {
pc.gotoAndStop(6);
}
if (Key.isDown(32)) {
if ((w == 0) or (w == 1)) {
pc.gotoAndStop(11);
}
if ((w == 2) or (w == 3)) {
pc.gotoAndStop(12);
}
if ((w == 4) or (w == 5)) {
pc.gotoAndStop(13);
}
if ((w == 6) or (w == 7)) {
pc.gotoAndStop(14);
}
if ((pst[psn] == 0) and (bstep == 0)) {
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 0;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
}
pcd = 0;
}
if (pcd == 3) {
px = px - 13;
if ((w == 0) or (w == 1)) {
pc.gotoAndStop(7);
}
if ((w == 2) or (w == 3)) {
pc.gotoAndStop(8);
}
if ((w == 4) or (w == 5)) {
pc.gotoAndStop(9);
}
if ((w == 6) or (w == 7)) {
pc.gotoAndStop(10);
}
if (Key.isDown(32)) {
if ((w == 0) or (w == 1)) {
pc.gotoAndStop(15);
}
if ((w == 2) or (w == 3)) {
pc.gotoAndStop(16);
}
if ((w == 4) or (w == 5)) {
pc.gotoAndStop(17);
}
if ((w == 6) or (w == 7)) {
pc.gotoAndStop(18);
}
if ((pst[psn] == 0) and (bstep == 0)) {
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 1;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
}
pcd = 1;
}
if (pcd == 9) {
pstep = pstep - 1;
if (pstep <= 0) {
pcd = 1;
}
}
if (pcd == 6) {
pc.gotoAndStop(19);
px = px + 20;
pstep = pstep - 1;
if (pstep <= 0) {
pcd = 0;
}
}
if (pcd == 7) {
pc.gotoAndStop(20);
px = px - 20;
pstep = pstep - 1;
if (pstep <= 0) {
pcd = 1;
}
}
if (pcd == 12) {
pc.gotoAndStop(23);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(25);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 0;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
py = py + (5 * (7 - pstep));
pstep = pstep - 1;
if (pstep <= 2) {
pstep = 2;
}
if (Key.isDown(39)) {
px = px + 13;
}
if (Key.isDown(37)) {
px = px - 13;
if (bstep == 0) {
pcd = 13;
}
}
}
if (pcd == 13) {
pc.gotoAndStop(24);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(26);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 1;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
py = py + (5 * (7 - pstep));
pstep = pstep - 1;
if (pstep <= 2) {
pstep = 2;
}
if (Key.isDown(39)) {
px = px + 13;
if (bstep == 0) {
pcd = 12;
}
}
if (Key.isDown(37)) {
px = px - 13;
}
}
if (pcd == 10) {
pc.gotoAndStop(23);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(25);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 0;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
py = py - (5 * pstep);
pstep = pstep - 1;
if (Key.isDown(39)) {
px = px + 13;
}
if (Key.isDown(37)) {
px = px - 13;
if (bstep == 0) {
pcd = 11;
}
}
if (Key.isDown(40)) {
pcd = 12;
pstep = pstep + 3;
}
if (pstep <= -1) {
pstep = 7;
pcd = 12;
}
}
if (pcd == 11) {
pc.gotoAndStop(24);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(26);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px;
psy[psn] = py;
psd[psn] = 1;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
py = py - (5 * pstep);
pstep = pstep - 1;
if (Key.isDown(39)) {
px = px + 13;
if (bstep == 0) {
pcd = 10;
}
}
if (Key.isDown(37)) {
px = px - 13;
}
if (Key.isDown(40)) {
pcd = 13;
pstep = pstep + 3;
}
if (pstep <= -1) {
pstep = 7;
pcd = 13;
}
}
if (pcd == 18) {
pc.gotoAndStop(27);
pstep = pstep - 1;
px = px - 5;
if (pstep <= -1) {
pstep = 2;
pcd = 0;
}
}
if (pcd == 19) {
pc.gotoAndStop(28);
pstep = pstep - 1;
px = px + 5;
if (pstep <= -1) {
pstep = 2;
pcd = 1;
}
}
if (pcd == 20) {
pc.gotoAndStop(69 - pstep);
bcharge = 0;
charge._alpha = 0;
bstep = 20;
pl = 1;
pstep = pstep - 1;
if (pstep < 0) {
lives = lives - 1;
if (lives >= 0) {
pl = 50;
gotoAndPlay (100);
}
if (lives < 0) {
lives = 2;
continues = continues - 1;
gotoAndPlay (5);
}
}
}
if (pl <= 0) {
c = 1;
while (c <= 8) {
bgx[c] = -600;
c++;
}
pc._alpha = 100;
pcd = 20;
pstep = 40;
megad.start();
}
if (bstep > 0) {
bcharge = 0;
charge._alpha = bcharge;
}
if (bstep > 0) {
bstep = bstep - 1;
}
if ((py > 500) and (pcd < 20)) {
megad.start();
pl = 0;
}
w = w - 1;
if (w < 0) {
w = 7;
}
e = pcd;
c = 0;
r = 1;
while (r <= 12) {
if (((((bx[r] - 150) < px) and ((bx[r] + 150) > px)) and ((by[r] - 150) < py)) and ((by[r] + 150) > py)) {
if (((((((px - 30) < (bx[r] + 50)) and ((px + 20) > (bx[r] - 50))) and (py < (by[r] - 50))) and ((py + 60) > (by[r] - 50))) and (pcd != 10)) and (pcd != 11)) {
if ((((pcd == 12) or (pcd == 13)) or (pcd == 16)) or (pcd == 17)) {
if ((pcd == 12) or (pcd == 16)) {
pcd = 0;
}
if ((pcd == 13) or (pcd == 17)) {
pcd = 1;
}
}
c = 1;
py = by[r] - 75;
}
if (((((px + 38) > (bx[r] - 50)) and ((px + 20) < bx[r])) and (py < (by[r] + 50))) and ((py + 20) > (by[r] - 50))) {
px = bx[r] - 85;
}
if (((((px - 35) < (bx[r] + 50)) and ((px - 20) > bx[r])) and (py < (by[r] + 50))) and ((py + 20) > (by[r] - 50))) {
px = bx[r] + 85;
}
if (((((px - 5) < (bx[r] + 50)) and ((px + 5) > (bx[r] - 50))) and ((py - 30) < (by[r] + 50))) and ((py + 10) > (by[r] + 50))) {
if ((((pcd == 10) or (pcd == 11)) or (pcd == 14)) or (pcd == 15)) {
if ((pcd == 10) or (pcd == 14)) {
pcd = 12;
pstep = 5;
}
if ((pcd == 11) or (pcd == 15)) {
pcd = 13;
pstep = 5;
}
}
py = by[r] + 90;
}
}
r++;
}
if (c == 0) {
if ((((pcd == 0) or (pcd == 2)) or (pcd == 6)) or (pcd == 18)) {
pcd = 12;
pstep = 6;
}
if ((((pcd == 1) or (pcd == 3)) or (pcd == 7)) or (pcd == 19)) {
pcd = 13;
pstep = 6;
}
}
r = 1;
while (r <= 3) {
if (pst[r] == 1) {
if (psd[r] == 0) {
psx[r] = psx[r] + 30;
if (r == 1) {
shot1p.gotoAndStop(1);
}
if (r == 2) {
shot2p.gotoAndStop(1);
}
if (r == 3) {
shot3p.gotoAndStop(1);
}
if (psx[r] > (px + 280)) {
pst[r] = 0;
psx[r] = -200;
}
}
if (psd[r] == 1) {
psx[r] = psx[r] - 30;
if (r == 1) {
shot1p.gotoAndStop(2);
}
if (r == 2) {
shot2p.gotoAndStop(2);
}
if (r == 3) {
shot3p.gotoAndStop(2);
}
if (psx[r] < (px - 280)) {
pst[r] = 0;
psx[r] = -200;
}
}
}
if (pst[r] == 2) {
if (psd[r] == 0) {
psx[r] = psx[r] + 35;
if (r == 1) {
shot1p.gotoAndStop(3);
}
if (r == 2) {
shot2p.gotoAndStop(3);
}
if (r == 3) {
shot3p.gotoAndStop(3);
}
if (psx[r] > (px + 280)) {
pst[r] = 0;
psx[r] = -200;
}
}
if (psd[r] == 1) {
psx[r] = psx[r] - 35;
if (r == 1) {
shot1p.gotoAndStop(4);
}
if (r == 2) {
shot2p.gotoAndStop(4);
}
if (r == 3) {
shot3p.gotoAndStop(4);
}
if (psx[r] < (px - 280)) {
pst[r] = 0;
psx[r] = -200;
}
}
}
if (pst[r] == 3) {
if (psd[r] == 0) {
psx[r] = psx[r] + 40;
if (r == 1) {
shot1p.gotoAndStop(5);
}
if (r == 2) {
shot2p.gotoAndStop(5);
}
if (r == 3) {
shot3p.gotoAndStop(5);
}
if (psx[r] > (px + 280)) {
pst[r] = 0;
psx[r] = -200;
}
}
if (psd[r] == 1) {
psx[r] = psx[r] - 40;
if (r == 1) {
shot1p.gotoAndStop(6);
}
if (r == 2) {
shot2p.gotoAndStop(6);
}
if (r == 3) {
shot3p.gotoAndStop(6);
}
if (psx[r] < (px - 280)) {
pst[r] = 0;
psx[r] = -200;
}
}
}
if (pst[r] == 4) {
if (r == 1) {
shot1p.gotoAndStop(10 - psd[r]);
}
if (r == 2) {
shot2p.gotoAndStop(10 - psd[r]);
}
if (r == 3) {
shot3p.gotoAndStop(10 - psd[r]);
}
psd[r] = psd[r] - 1;
if (psd[r] < 0) {
pst[r] = 0;
psx[r] = -200;
}
}
if (pst[r] == 5) {
if (r == 1) {
shot1p.gotoAndStop(14 - psd[r]);
}
if (r == 2) {
shot2p.gotoAndStop(14 - psd[r]);
}
if (r == 3) {
shot3p.gotoAndStop(14 - psd[r]);
}
psd[r] = psd[r] - 1;
if (psd[r] < 0) {
pst[r] = 0;
psx[r] = -200;
}
}
r++;
}
while (c <= 8) {
r = 1;
while (r <= 3) {
if ((pst[r] > 0) and (pst[r] < 4)) {
if (((((bgt[c] == 1) and ((bgx[c] - 35) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 35) > (psx[r] - ((pst[r] * 20) - 20)))) and ((bgy[c] - 5) < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 50) > (psy[r] - ((pst[r] * 20) - 20)))) {
if ((bgd[c] == 0) or (bgd[c] == 2)) {
deflect.start();
pst[r] = 5;
psd[r] = 2;
}
if ((bgd[c] == 1) or (bgd[c] == 3)) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd2.start();
bgd[c] = 4;
bgs[c] = 4;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
if (((((bgt[c] == 2) and ((bgx[c] - 35) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 35) > (psx[r] - ((pst[r] * 20) - 20)))) and (bgy[c] < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 50) > (psy[r] - ((pst[r] * 20) - 20)))) {
if ((((bgd[c] == 0) or (bgd[c] == 3)) or (bgd[c] == 1)) or (bgd[c] == 4)) {
deflect.start();
pst[r] = 5;
psd[r] = 2;
}
if ((bgd[c] == 2) or (bgd[c] == 5)) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd2.start();
bgd[c] = 6;
bgs[c] = 6;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
if (((((bgt[c] == 3) and ((bgx[c] - 35) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 35) > (psx[r] - ((pst[r] * 20) - 20)))) and ((bgy[c] - 20) < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 40) > (psy[r] - ((pst[r] * 20) - 20)))) {
if (bgd[c] == 0) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd2.start();
bgd[c] = 1;
bgs[c] = 4;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
if (((((bgt[c] == 4) and ((bgx[c] - 40) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 40) > (psx[r] - ((pst[r] * 20) - 20)))) and ((bgy[c] - 20) < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 50) > (psy[r] - ((pst[r] * 20) - 20)))) {
if ((bgd[c] == 0) or (bgd[c] == 2)) {
deflect.start();
pst[r] = 5;
psd[r] = 2;
}
if ((bgd[c] == 1) or (bgd[c] == 3)) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd1.start();
bgd[c] = 4;
bgs[c] = 4;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
if (((((bgt[c] == 5) and ((bgx[c] - 40) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 40) > (psx[r] - ((pst[r] * 20) - 20)))) and ((bgy[c] - 20) < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 50) > (psy[r] - ((pst[r] * 20) - 20)))) {
if ((((bgd[c] == 0) or (bgd[c] == 1)) or (bgd[c] == 2)) or (bgd[c] == 3)) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd1.start();
bgd[c] = 4;
bgs[c] = 5;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
if (((((bgt[c] == 6) and ((bgx[c] - 35) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 35) > (psx[r] - ((pst[r] * 20) - 20)))) and ((bgy[c] - 50) < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 20) > (psy[r] - ((pst[r] * 20) - 20)))) {
if ((bgd[c] == 0) or (bgd[c] == 1)) {
deflect.start();
pst[r] = 5;
psd[r] = 2;
}
if (bgd[c] == 2) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd2.start();
bgd[c] = 3;
bgs[c] = 4;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
if (((((bgt[c] == 7) and ((bgx[c] - 35) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 35) > (psx[r] - ((pst[r] * 20) - 20)))) and ((bgy[c] - 50) < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 20) > (psy[r] - ((pst[r] * 20) - 20)))) {
if (bgd[c] == 0) {
deflect.start();
pst[r] = 5;
psd[r] = 2;
}
if ((bgd[c] == 2) or (bgd[c] == 1)) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd2.start();
bgd[c] = 3;
bgs[c] = 3;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
if (((((bgt[c] == 8) and ((bgx[c] - 35) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 35) > (psx[r] - ((pst[r] * 20) - 20)))) and ((bgy[c] - 50) < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 20) > (psy[r] - ((pst[r] * 20) - 20)))) {
if ((bgd[c] == 0) or (bgd[c] == 1)) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd1.start();
bgd[c] = 2;
bgs[c] = 5;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
if (((((bgt[c] == 9) and ((bgx[c] - 40) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 40) > (psx[r] - ((pst[r] * 20) - 20)))) and ((bgy[c] - 20) < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 50) > (psy[r] - ((pst[r] * 20) - 20)))) {
if ((bgd[c] == 0) and (px > bgx[c])) {
deflect.start();
pst[r] = 5;
psd[r] = 2;
}
if ((bgd[c] == 1) and (px < bgx[c])) {
deflect.start();
pst[r] = 5;
psd[r] = 2;
}
if ((bgd[c] == 0) and (px < bgx[c])) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd1.start();
bgd[c] = 4;
bgs[c] = 4;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
if ((bgd[c] == 1) and (px > bgx[c])) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd1.start();
bgd[c] = 2;
bgs[c] = 4;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
if (((((bgt[c] == 10) and ((bgx[c] - 20) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 20) > (psx[r] - ((pst[r] * 20) - 20)))) and ((bgy[c] - 50) < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 20) > (psy[r] - ((pst[r] * 20) - 20)))) {
if ((bgd[c] == 0) or (bgd[c] == 1)) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd2.start();
bgd[c] = 2;
bgs[c] = 3;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
if (((((bgt[c] == 11) and ((bgx[c] - 25) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 25) > (psx[r] - ((pst[r] * 20) - 20)))) and (bgy[c] < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 50) > (psy[r] - ((pst[r] * 20) - 20)))) {
if ((((((bgd[c] == 0) or (bgd[c] == 1)) or (bgd[c] == 2)) or (bgd[c] == 3)) or (bgd[c] == 4)) or (bgd[c] == 5)) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd2.start();
bgd[c] = 6;
bgs[c] = 3;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
if (((((bgt[c] == 12) and ((bgx[c] - 25) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 25) > (psx[r] - ((pst[r] * 20) - 20)))) and (bgy[c] < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 50) > (psy[r] - ((pst[r] * 20) - 20)))) {
if ((bgd[c] == 0) or (bgd[c] == 1)) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd2.start();
bgd[c] = 2;
bgs[c] = 3;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
if (((((bgt[c] == 13) and ((bgx[c] - 35) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 35) > (psx[r] - ((pst[r] * 20) - 20)))) and (bgy[c] < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 60) > (psy[r] - ((pst[r] * 20) - 20)))) {
if ((((((bgd[c] == 0) or (bgd[c] == 1)) or (bgd[c] == 2)) or (bgd[c] == 3)) or (bgd[c] == 4)) or (bgd[c] == 5)) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd1.start();
bgd[c] = 6;
bgs[c] = 4;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
if (((((bgt[c] == 14) and ((bgx[c] - 20) < (psx[r] + ((pst[r] * 20) - 20)))) and ((bgx[c] + 20) > (psx[r] - ((pst[r] * 20) - 20)))) and ((bgy[c] - 20) < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[c] + 20) > (psy[r] - ((pst[r] * 20) - 20)))) {
if ((((bgd[c] == 0) or (bgd[c] == 1)) or (bgd[c] == 3)) or (bgd[c] == 4)) {
deflect.start();
pst[r] = 5;
psd[r] = 2;
}
if ((bgd[c] == 2) or (bgd[c] == 5)) {
megash.start();
bgl[c] = bgl[c] - pst[r];
if (bgl[c] < 1) {
baddyd2.start();
bgd[c] = 6;
bgs[c] = 3;
}
if ((bgl[c] > 0) or (pst[r] == 1)) {
pst[r] = 4;
psd[r] = 2;
}
}
}
}
r++;
}
c++;
}
r = 1;
while (r <= 8) {
if (((((bgt[r] > 0) and ((bgx[r] - 340) < px)) and ((bgx[r] + 340) > px)) and ((bgy[r] - 180) < py)) and ((bgy[r] + 350) > py)) {
c = 0;
e = 1;
while (e <= 26) {
if (((((bx[e] - 150) < bgx[r]) and ((bx[e] + 150) > bgx[r])) and ((by[e] - 150) < bgy[r])) and ((by[e] + 150) > bgy[r])) {
if (((((bgx[r] + 20) >= (bx[e] - 50)) and ((bgx[r] - 20) <= (bx[e] + 50))) and ((bgy[r] + 45) > (by[e] - 60))) and ((bgy[r] - 10) < (by[e] - 40))) {
c = 1;
}
if (((((bgx[r] + 20) > (bx[e] - 50)) and ((bgx[r] + 20) < bx[e])) and (bgy[r] < (by[e] + 50))) and ((bgy[r] + 20) > (by[e] - 50))) {
bgx[r] = bx[e] - 70;
}
if (((((bgx[r] - 20) < (bx[e] + 50)) and ((bgx[r] + 20) > bx[e])) and (bgy[r] < (by[e] + 50))) and ((bgy[r] + 20) > (by[e] - 50))) {
bgx[r] = bx[e] + 70;
}
if (((((bgx[r] - 5) < (bx[e] + 50)) and ((bgx[r] + 5) > (bx[e] - 50))) and ((bgy[r] - 30) < (by[e] + 50))) and (bgy[r] > (by[e] + 50))) {
bgy[r] = by[e] + 70;
}
if (((((bgx[r] - 2) < (bx[e] + 50)) and ((bgx[r] + 2) > (bx[e] - 50))) and ((bgy[r] + 20) < (by[e] - 50))) and ((bgy[r] + 60) > (by[e] - 50))) {
c = 1;
bgy[r] = by[e] - 105;
}
}
e++;
}
if (c == 0) {
bgy[r] = bgy[r] + 10;
}
if (bgt[r] == 1) {
if (((((((bgx[r] - 10) < (px + 10)) and ((bgx[r] + 10) > (px - 10))) and ((bgy[r] + 80) > (py + 10))) and ((bgy[r] + 50) < (py + 50))) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 4;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 4;
}
megah.start();
i = 10;
}
if (bgd[r] == 0) {
f[r] = 1;
if (px < bgx[r]) {
bgd[r] = 2;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
joes.start();
bgd[r] = 1;
bgs[r] = 7;
bgst[bsn] = 1;
bgsx[bsn] = bgx[r] - 10;
bgsy[bsn] = bgy[r] + 30;
bgsd[bsn] = 0;
bsn = bsn + 1;
if (bsn > 5) {
bsn = 1;
}
}
}
if (bgd[r] == 2) {
f[r] = 3;
if (px > bgx[r]) {
bgd[r] = 0;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
joes.start();
bgd[r] = 3;
bgs[r] = 7;
bgst[bsn] = 1;
bgsx[bsn] = bgx[r] + 10;
bgsy[bsn] = bgy[r] + 30;
bgsd[bsn] = 1;
bsn = bsn + 1;
if (bsn > 5) {
bsn = 1;
}
}
}
if (bgd[r] == 1) {
f[r] = 2;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 0;
bgs[r] = 20;
}
}
if (bgd[r] == 3) {
f[r] = 4;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 2;
bgs[r] = 20;
}
}
if (bgd[r] == 4) {
if (bgs[r] == 4) {
f[r] = 5;
}
if (bgs[r] == 3) {
f[r] = 6;
}
if (bgs[r] == 2) {
f[r] = 7;
}
if (bgs[r] == 1) {
f[r] = 8;
}
bgy[r] = bgy[r] - 10;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
f[r] = 9;
bgt[r] = 0;
bgx[r] = -500;
bgs[r] = 0;
}
}
}
if (bgt[r] == 2) {
if (((((((bgx[r] - 15) < (px + 10)) and ((bgx[r] + 15) > (px - 10))) and ((bgy[r] + 80) > (py - 10))) and ((bgy[r] + 50) < (py + 50))) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 3;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 3;
}
megah.start();
i = 10;
}
if (bgd[r] == 0) {
f[r] = 1;
if (px < bgx[r]) {
bgd[r] = 3;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 1;
bgs[r] = 10;
}
}
if (bgd[r] == 3) {
f[r] = 5;
if (px > bgx[r]) {
bgd[r] = 0;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 4;
bgs[r] = 10;
}
}
if (bgd[r] == 1) {
f[r] = 2;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 2;
bgs[r] = 12;
}
}
if (bgd[r] == 2) {
if (((bgs[r] == 12) or (bgs[r] == 11)) or (bgs[r] == 10)) {
f[r] = 3;
}
if (((bgs[r] == 9) or (bgs[r] == 8)) or (bgs[r] == 7)) {
f[r] = 4;
}
if (((bgs[r] == 6) or (bgs[r] == 5)) or (bgs[r] == 4)) {
f[r] = 3;
}
if (((bgs[r] == 3) or (bgs[r] == 2)) or (bgs[r] == 1)) {
f[r] = 4;
}
bgx[r] = bgx[r] + 8;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 0;
bgs[r] = 10 + random(20);
}
}
if (bgd[r] == 4) {
f[r] = 6;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 5;
bgs[r] = 12;
}
}
if (bgd[r] == 5) {
if (((bgs[r] == 12) or (bgs[r] == 11)) or (bgs[r] == 10)) {
f[r] = 7;
}
if (((bgs[r] == 9) or (bgs[r] == 8)) or (bgs[r] == 7)) {
f[r] = 8;
}
if (((bgs[r] == 6) or (bgs[r] == 5)) or (bgs[r] == 4)) {
f[r] = 7;
}
if (((bgs[r] == 3) or (bgs[r] == 2)) or (bgs[r] == 1)) {
f[r] = 8;
}
bgx[r] = bgx[r] - 8;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 3;
bgs[r] = 10 + random(20);
}
}
if (bgd[r] == 6) {
if (bgs[r] == 6) {
f[r] = 9;
}
if (bgs[r] == 5) {
f[r] = 10;
}
if (bgs[r] == 4) {
f[r] = 11;
}
if (bgs[r] == 3) {
f[r] = 12;
}
if (bgs[r] == 2) {
f[r] = 13;
}
if (bgs[r] == 1) {
f[r] = 14;
}
bgs[r] = bgs[r] - 1;
bgy[r] = bgy[r] - 10;
if (bgs[r] <= 0) {
f[r] = 15;
bgt[r] = 0;
bgx[r] = -500;
bgs[r] = 0;
}
}
}
if (bgt[r] == 3) {
if ((((((((bgx[r] - 20) < (px + 10)) and ((bgx[r] + 20) > (px - 10))) and ((bgy[r] + 60) > (py + 5))) and ((bgy[r] + 40) < (py + 45))) and (pcd < 18)) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 4;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 4;
}
megah.start();
i = 10;
}
if (bgd[r] == 0) {
if ((bgs[r] == 0) or (bgs[r] == 1)) {
f[r] = 1;
}
if ((bgs[r] == 2) or (bgs[r] == 3)) {
f[r] = 2;
}
if ((bgs[r] == 4) or (bgs[r] == 5)) {
f[r] = 3;
}
if ((bgs[r] == 6) or (bgs[r] == 7)) {
f[r] = 4;
}
if ((bgs[r] == 8) or (bgs[r] == 9)) {
f[r] = 5;
}
if ((bgs[r] == 10) or (bgs[r] == 11)) {
f[r] = 6;
}
if (px < bgx[r]) {
bgx[r] = bgx[r] - 5;
}
if (px > bgx[r]) {
bgx[r] = bgx[r] + 5;
}
if ((py - 20) > bgy[r]) {
bgy[r] = bgy[r] - 5;
}
if ((py - 20) < bgy[r]) {
bgy[r] = bgy[r] - 15;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgs[r] = 11;
}
}
if (bgd[r] == 1) {
if (bgs[r] == 4) {
f[r] = 7;
}
if (bgs[r] == 3) {
f[r] = 8;
}
if (bgs[r] == 2) {
f[r] = 9;
}
if (bgs[r] == 1) {
f[r] = 10;
}
bgs[r] = bgs[r] - 1;
bgy[r] = bgy[r] - 10;
if (bgs[r] <= 0) {
bgx[r] = -500;
f[r] = 11;
bgt[r] = 0;
bgs[r] = 0;
}
}
}
if (bgt[r] == 4) {
if (((((((bgx[r] - 20) < (px + 10)) and ((bgx[r] + 20) > (px - 10))) and ((bgy[r] + 80) > (py + 10))) and ((bgy[r] + 30) < (py + 50))) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 4;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 4;
}
megah.start();
i = 10;
}
if (bgd[r] == 0) {
f[r] = 1;
if ((px - 180) < bgx[r]) {
bgd[r] = 1;
bgs[r] = 4;
}
if (px < bgx[r]) {
bgd[r] = 2;
}
}
if (bgd[r] == 2) {
f[r] = 4;
if ((px + 180) > bgx[r]) {
bgd[r] = 3;
bgs[r] = 4;
}
if (px > bgx[r]) {
bgd[r] = 0;
}
}
if (bgd[r] == 1) {
if ((bgs[r] == 1) or (bgs[r] == 2)) {
f[r] = 2;
}
if ((bgs[r] == 3) or (bgs[r] == 4)) {
f[r] = 3;
}
bgx[r] = bgx[r] + 12;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgs[r] = 4;
}
}
if (bgd[r] == 3) {
if ((bgs[r] == 1) or (bgs[r] == 2)) {
f[r] = 5;
}
if ((bgs[r] == 3) or (bgs[r] == 4)) {
f[r] = 6;
}
bgx[r] = bgx[r] - 12;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgs[r] = 4;
}
}
if (bgd[r] == 4) {
if (bgs[r] == 4) {
f[r] = 7;
}
if (bgs[r] == 3) {
f[r] = 8;
}
if (bgs[r] == 2) {
f[r] = 9;
}
if (bgs[r] == 1) {
f[r] = 10;
}
bgs[r] = bgs[r] - 1;
bgy[r] = bgy[r] - 10;
if (bgs[r] <= 0) {
bgx[r] = -500;
f[r] = 11;
bgt[r] = 0;
bgs[r] = 0;
}
}
}
if (bgt[r] == 5) {
if (((((((bgx[r] - 20) < (px + 10)) and ((bgx[r] + 20) > (px - 10))) and ((bgy[r] + 80) > (py + 10))) and ((bgy[r] + 30) < (py + 50))) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 3;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 3;
}
megah.start();
i = 10;
}
if (bgd[r] == 0) {
f[r] = 1;
if (px < bgx[r]) {
bgd[r] = 2;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
cannons.start();
bgd[r] = 1;
bgs[r] = 8;
bgst[bsn] = 2;
bgsx[bsn] = bgx[r] - 20;
bgsy[bsn] = bgy[r] + 20;
bgsd[bsn] = 0;
bsn = bsn + 1;
if (bsn > 5) {
bsn = 1;
}
}
}
if (bgd[r] == 2) {
f[r] = 3;
if (px > bgx[r]) {
bgd[r] = 0;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
cannons.start();
bgd[r] = 3;
bgs[r] = 7;
bgst[bsn] = 2;
bgsx[bsn] = bgx[r] + 20;
bgsy[bsn] = bgy[r] + 20;
bgsd[bsn] = 1;
bsn = bsn + 1;
if (bsn > 5) {
bsn = 1;
}
}
}
if (bgd[r] == 1) {
f[r] = 2;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 0;
bgs[r] = 10 + random(15);
}
}
if (bgd[r] == 3) {
f[r] = 4;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 2;
bgs[r] = 10 + random(15);
}
}
if (bgd[r] == 4) {
if (bgs[r] == 5) {
f[r] = 5;
}
if (bgs[r] == 4) {
f[r] = 6;
}
if (bgs[r] == 3) {
f[r] = 7;
}
if (bgs[r] == 2) {
f[r] = 8;
}
if (bgs[r] == 1) {
f[r] = 9;
}
bgs[r] = bgs[r] - 1;
bgy[r] = bgy[r] - 10;
if (bgs[r] <= 0) {
f[r] = 10;
bgt[r] = 0;
bgx[r] = -500;
bgs[r] = 0;
}
}
}
if (bgt[r] == 6) {
if (((((((bgx[r] - 10) < (px + 10)) and ((bgx[r] + 10) > (px - 10))) and ((bgy[r] + 50) > (py + 10))) and ((bgy[r] + 10) < (py + 50))) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 4;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 4;
}
megah.start();
i = 10;
}
if (bgd[r] == 0) {
f[r] = 1;
bgy[r] = bgy[r] - 10;
if (((((px - 120) < bgx[r]) and ((px + 120) > bgx[r])) and ((bgy[r] - 80) < py)) and ((bgy[r] + 150) > py)) {
bgd[r] = 1;
bgs[r] = 6;
}
}
if (bgd[r] == 1) {
bgy[r] = bgy[r] - 10;
if (((bgs[r] == 6) or (bgs[r] == 5)) or (bgs[r] == 4)) {
f[r] = 2;
}
if (((bgs[r] == 3) or (bgs[r] == 2)) or (bgs[r] == 1)) {
f[r] = 3;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgs[r] = 4;
bgd[r] = 2;
}
}
if (bgd[r] == 2) {
if ((bgs[r] == 4) or (bgs[r] == 3)) {
f[r] = 4;
}
if ((bgs[r] == 2) or (bgs[r] == 1)) {
f[r] = 5;
}
if (px < bgx[r]) {
bgx[r] = (bgx[r] - 1) - random(10);
}
if (px > bgx[r]) {
bgx[r] = (bgx[r] + 1) + random(10);
}
if (py > bgy[r]) {
bgy[r] = bgy[r] + random(8);
}
if (py < bgy[r]) {
bgy[r] = (bgy[r] - 10) - random(10);
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgs[r] = 4;
}
}
if (bgd[r] == 3) {
if (bgs[r] == 4) {
f[r] = 6;
}
if (bgs[r] == 3) {
f[r] = 7;
}
if (bgs[r] == 2) {
f[r] = 8;
}
if (bgs[r] == 1) {
f[r] = 9;
}
bgs[r] = bgs[r] - 1;
bgy[r] = bgy[r] - 10;
if (bgs[r] <= 0) {
f[r] = 10;
bgt[r] = 0;
bgx[r] = -500;
bgs[r] = 0;
}
}
}
if (bgt[r] == 7) {
if (((((((bgx[r] - 20) < (px + 10)) and ((bgx[r] + 20) > (px - 10))) and ((bgy[r] + 20) > (py + 10))) and ((bgy[r] + 20) < (py + 50))) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 3;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 3;
}
megah.start();
i = 10;
}
if (bgd[r] == 0) {
f[r] = 1;
bgy[r] = bgy[r] - 10;
if ((px + 80) < bgx[r]) {
bgx[r] = bgx[r] - 5;
}
if ((px - 80) > bgx[r]) {
bgx[r] = bgx[r] + 5;
}
if ((py - 70) < bgy[r]) {
bgy[r] = bgy[r] - 5;
}
if ((py - 70) > bgy[r]) {
bgy[r] = bgy[r] + 5;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
joes.start();
if (px > bgx[r]) {
bgd[r] = 1;
}
if (px < bgx[r]) {
bgd[r] = 2;
}
if (px < bgx[r]) {
bgsd[bsn] = 3;
if ((py - 50) < bgy[r]) {
bgsd[bsn] = 1;
}
}
if (px > bgx[r]) {
bgsd[bsn] = 2;
if ((py - 50) < bgy[r]) {
bgsd[bsn] = 0;
}
}
bgs[r] = 12;
bgst[bsn] = 1;
bgsx[bsn] = bgx[r];
bgsy[bsn] = bgy[r];
bsn = bsn + 1;
if (bsn > 5) {
bsn = 1;
}
}
}
if (bgd[r] == 1) {
f[r] = 2;
bgy[r] = bgy[r] - 10;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 0;
bgs[r] = 10 + random(25);
}
}
if (bgd[r] == 2) {
f[r] = 3;
bgy[r] = bgy[r] - 10;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 0;
bgs[r] = 10 + random(25);
}
}
if (bgd[r] == 3) {
if (bgs[r] == 3) {
f[r] = 4;
}
if (bgs[r] == 2) {
f[r] = 5;
}
if (bgs[r] == 1) {
f[r] = 6;
}
bgs[r] = bgs[r] - 1;
bgy[r] = bgy[r] - 10;
if (bgs[r] <= 0) {
f[r] = 7;
bgt[r] = 0;
bgx[r] = -500;
bgs[r] = 0;
}
}
}
if (bgt[r] == 8) {
if (((((((bgx[r] - 20) < (px + 10)) and ((bgx[r] + 20) > (px - 10))) and ((bgy[r] + 35) > (py + 10))) and ((bgy[r] + 20) < (py + 50))) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 8;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 8;
}
bgd[r] = 2;
bgs[r] = 10;
baddyd1.start();
i = 10;
}
if (bgd[r] == 0) {
f[r] = 1;
bgx[r] = bgx[r] + 20;
if ((py + 30) > bgy[r]) {
bgy[r] = bgy[r] - 8;
}
if ((py + 30) < bgy[r]) {
bgy[r] = bgy[r] - 12;
}
if ((px + 100) < bgx[r]) {
bgd[r] = 1;
}
}
if (bgd[r] == 1) {
f[r] = 2;
bgx[r] = bgx[r] - 20;
if ((py + 30) > bgy[r]) {
bgy[r] = bgy[r] - 8;
}
if ((py + 30) < bgy[r]) {
bgy[r] = bgy[r] - 12;
}
if ((px - 100) > bgx[r]) {
bgd[r] = 0;
}
}
if (bgd[r] == 2) {
if (bgs[r] == 5) {
f[r] = 3;
}
if (bgs[r] == 4) {
f[r] = 4;
}
if (bgs[r] == 3) {
f[r] = 5;
}
if (bgs[r] == 2) {
f[r] = 6;
}
if (bgs[r] == 1) {
f[r] = 7;
}
bgs[r] = bgs[r] - 1;
bgy[r] = bgy[r] - 10;
if (bgs[r] <= 0) {
bgx[r] = -500;
f[r] = 8;
bgt[r] = 0;
bgs[r] = 0;
}
}
}
if (bgt[r] == 9) {
if (((((((bgx[r] - 30) < (px + 10)) and ((bgx[r] + 30) > (px - 10))) and ((bgy[r] + 55) > (py + 10))) and ((bgy[r] + 20) < (py + 50))) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 5;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 5;
}
megah.start();
i = 10;
}
if (bgd[r] == 0) {
if ((bgs[r] == 1) or (bgs[r] == 2)) {
f[r] = 1;
}
if ((bgs[r] == 3) or (bgs[r] == 4)) {
f[r] = 2;
}
bgx[r] = bgx[r] + 8;
if ((px + 80) < bgx[r]) {
bgd[r] = 1;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgs[r] = 4;
}
}
if (bgd[r] == 1) {
if ((bgs[r] == 1) or (bgs[r] == 2)) {
f[r] = 3;
}
if ((bgs[r] == 3) or (bgs[r] == 4)) {
f[r] = 4;
}
bgx[r] = bgx[r] - 8;
if ((px - 80) > bgx[r]) {
bgd[r] = 0;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgs[r] = 4;
}
}
if (bgd[r] == 2) {
if (bgs[r] == 4) {
f[r] = 5;
}
if (bgs[r] == 3) {
f[r] = 6;
}
if (bgs[r] == 2) {
f[r] = 7;
}
if (bgs[r] == 1) {
f[r] = 8;
}
bgs[r] = bgs[r] - 1;
bgy[r] = bgy[r] - 10;
if (bgs[r] <= 0) {
bgx[r] = -500;
f[r] = 9;
bgt[r] = 0;
bgs[r] = 0;
}
}
}
if (bgt[r] == 10) {
if (((((((bgx[r] - 20) < (px + 10)) and ((bgx[r] + 20) > (px - 10))) and ((bgy[r] + 20) > (py + 10))) and ((bgy[r] + 20) < (py + 50))) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 2;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 2;
}
megah.start();
i = 10;
}
if (bgd[r] == 0) {
f[r] = 1;
bgy[r] = bgy[r] - 10;
if (px < bgx[r]) {
bgx[r] = bgx[r] - 7;
}
if (px > bgx[r]) {
bgx[r] = bgx[r] + 7;
}
if ((py - 80) < bgy[r]) {
bgy[r] = bgy[r] - 8;
}
if ((py - 80) > bgy[r]) {
bgy[r] = bgy[r] + 8;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
joes.start();
bgd[r] = 1;
bgsd[bsn] = 4;
bgs[r] = 5;
bgst[bsn] = 1;
bgsx[bsn] = bgx[r];
bgsy[bsn] = bgy[r];
bsn = bsn + 1;
if (bsn > 5) {
bsn = 1;
}
}
}
if (bgd[r] == 1) {
f[r] = 2;
bgy[r] = bgy[r] - 10;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 0;
bgs[r] = 6 + random(16);
}
}
if (bgd[r] == 2) {
if (bgs[r] == 3) {
f[r] = 3;
}
if (bgs[r] == 2) {
f[r] = 4;
}
if (bgs[r] == 1) {
f[r] = 5;
}
bgs[r] = bgs[r] - 1;
bgy[r] = bgy[r] - 10;
if (bgs[r] <= 0) {
f[r] = 7;
bgt[r] = 0;
bgx[r] = -500;
bgs[r] = 0;
}
}
}
if (bgt[r] == 11) {
if (((((((bgx[r] - 20) < (px + 10)) and ((bgx[r] + 20) > (px - 10))) and ((bgy[r] + 50) > (py - 10))) and (bgy[r] < (py + 50))) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 3;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 3;
}
megah.start();
i = 10;
}
if (bgd[r] == 0) {
if (((bgs[r] == 12) or (bgs[r] == 11)) or (bgs[r] == 10)) {
f[r] = 1;
}
if (((bgs[r] == 9) or (bgs[r] == 8)) or (bgs[r] == 7)) {
f[r] = 2;
}
if (((bgs[r] == 6) or (bgs[r] == 5)) or (bgs[r] == 4)) {
f[r] = 1;
}
if (((bgs[r] == 3) or (bgs[r] == 2)) or (bgs[r] == 1)) {
f[r] = 2;
}
if (bgx[r] > px) {
bgd[r] = 3;
bgs[r] = 12;
}
bgx[r] = bgx[r] + 6;
if (((bgx[r] + 150) > (px - 20)) and (bgx[r] < px)) {
bgd[r] = 1;
bgs[r] = 9;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgs[r] = 12;
}
}
if (bgd[r] == 1) {
f[r] = 3;
bgx[r] = bgx[r] + 12;
bgy[r] = bgy[r] - 20;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 2;
bgs[r] = 10;
}
}
if (bgd[r] == 2) {
f[r] = 3;
bgx[r] = bgx[r] + 12;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 0;
bgs[r] = 12;
}
}
if (bgd[r] == 3) {
if (((bgs[r] == 12) or (bgs[r] == 11)) or (bgs[r] == 10)) {
f[r] = 4;
}
if (((bgs[r] == 9) or (bgs[r] == 8)) or (bgs[r] == 7)) {
f[r] = 5;
}
if (((bgs[r] == 6) or (bgs[r] == 5)) or (bgs[r] == 4)) {
f[r] = 4;
}
if (((bgs[r] == 3) or (bgs[r] == 2)) or (bgs[r] == 1)) {
f[r] = 5;
}
if (bgx[r] < px) {
bgd[r] = 0;
bgs[r] = 12;
}
bgx[r] = bgx[r] - 6;
if (((bgx[r] - 150) < (px - 20)) and (bgx[r] > px)) {
bgd[r] = 4;
bgs[r] = 9;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgs[r] = 12;
}
}
if (bgd[r] == 4) {
f[r] = 6;
bgx[r] = bgx[r] - 12;
bgy[r] = bgy[r] - 20;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 5;
bgs[r] = 10;
}
}
if (bgd[r] == 5) {
f[r] = 6;
bgx[r] = bgx[r] - 12;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 3;
bgs[r] = 12;
}
}
if (bgd[r] == 6) {
if (bgs[r] == 3) {
f[r] = 7;
}
if (bgs[r] == 2) {
f[r] = 8;
}
if (bgs[r] == 1) {
f[r] = 9;
}
bgs[r] = bgs[r] - 1;
bgy[r] = bgy[r] - 10;
if (bgs[r] <= 0) {
f[r] = 15;
bgt[r] = 0;
bgx[r] = -500;
bgs[r] = 0;
}
}
}
if (bgt[r] == 12) {
if (((((((bgx[r] - 20) < (px + 10)) and ((bgx[r] + 20) > (px - 10))) and ((bgy[r] + 40) > py)) and ((bgy[r] - 20) < (py + 50))) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 3;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 3;
}
megah.start();
i = 10;
}
if (bgd[r] == 0) {
if (bgs[r] == 1) {
f[r] = 1;
}
if (bgs[r] == 2) {
f[r] = 2;
}
bgy[r] = bgy[r] - 10;
bgx[r] = bgx[r] + 7;
if ((py - 60) < bgy[r]) {
bgy[r] = bgy[r] - 5;
}
if ((((px - 70) < bgx[r]) and ((px + 70) > bgx[r])) and (py > bgy[r])) {
bgy[r] = bgy[r] + 12;
}
if ((px + 100) < bgx[r]) {
bgd[r] = 1;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgs[r] = 2;
}
}
if (bgd[r] == 1) {
if (bgs[r] == 1) {
f[r] = 3;
}
if (bgs[r] == 2) {
f[r] = 4;
}
bgy[r] = bgy[r] - 10;
bgx[r] = bgx[r] - 7;
if ((py - 60) < bgy[r]) {
bgy[r] = bgy[r] - 5;
}
if ((((px - 70) < bgx[r]) and ((px + 70) > bgx[r])) and (py > bgy[r])) {
bgy[r] = bgy[r] + 12;
}
if ((px - 100) > bgx[r]) {
bgd[r] = 0;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgs[r] = 2;
}
}
if (bgd[r] == 2) {
if (bgs[r] == 4) {
f[r] = 5;
}
if (bgs[r] == 3) {
f[r] = 6;
}
if (bgs[r] == 2) {
f[r] = 7;
}
if (bgs[r] == 1) {
f[r] = 8;
}
bgs[r] = bgs[r] - 1;
bgy[r] = bgy[r] - 10;
if (bgs[r] <= 0) {
bgx[r] = -500;
f[r] = 9;
bgt[r] = 0;
bgs[r] = 0;
}
}
}
if (bgt[r] == 13) {
if (((((((bgx[r] - 50) < (px + 10)) and ((bgx[r] + 50) > (px - 10))) and ((bgy[r] + 70) > (py + 10))) and (bgy[r] < (py + 50))) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 4;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 4;
}
megah.start();
i = 10;
}
if (bgd[r] == 0) {
f[r] = 1;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
if ((px - 170) < bgx[r]) {
bgd[r] = 1;
bgs[r] = 7;
}
}
if (px < bgx[r]) {
bgd[r] = 3;
}
}
if (bgd[r] == 1) {
f[r] = 2;
bgx[r] = bgx[r] + 30;
bgy[r] = bgy[r] - 20;
if (bgy[r] < py) {
bgy[r] = bgy[r] + 10;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 2;
bgs[r] = 12;
}
}
if (bgd[r] == 2) {
f[r] = 3;
bgx[r] = bgx[r] + 5;
bgy[r] = bgy[r] + 2;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 0;
bgs[r] = random(12);
}
}
if (bgd[r] == 3) {
f[r] = 4;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
if ((px + 170) > bgx[r]) {
bgd[r] = 4;
bgs[r] = 7;
}
}
if (px > bgx[r]) {
bgd[r] = 0;
}
}
if (bgd[r] == 4) {
f[r] = 5;
bgx[r] = bgx[r] - 30;
bgy[r] = bgy[r] - 20;
bgs[r] = bgs[r] - 1;
if (bgy[r] < py) {
bgy[r] = bgy[r] + 10;
}
if (bgs[r] <= 0) {
bgd[r] = 5;
bgs[r] = 12;
}
}
if (bgd[r] == 5) {
f[r] = 6;
bgx[r] = bgx[r] - 5;
bgy[r] = bgy[r] + 2;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 3;
bgs[r] = random(12);
}
}
if (bgd[r] == 6) {
if (bgs[r] == 4) {
f[r] = 7;
}
if (bgs[r] == 3) {
f[r] = 8;
}
if (bgs[r] == 2) {
f[r] = 9;
}
if (bgs[r] == 1) {
f[r] = 10;
}
bgs[r] = bgs[r] - 1;
bgy[r] = bgy[r] - 10;
if (bgs[r] <= 0) {
bgx[r] = -500;
f[r] = 11;
bgt[r] = 0;
bgs[r] = 0;
}
}
}
if (bgt[r] == 14) {
if (((((((bgx[r] - 20) < (px + 10)) and ((bgx[r] + 20) > (px - 10))) and ((bgy[r] + 50) > (py + 10))) and ((bgy[r] + 20) < (py + 50))) and (pcd < 18)) and (i < 1)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 2;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 2;
}
megah.start();
i = 10;
}
if (bgt[r] > 0) {
bgy[r] = bgy[r] - 10;
}
if (bgd[r] == 0) {
f[r] = 1;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 1;
bgs[r] = 6;
}
}
if (bgd[r] == 1) {
if (((bgs[r] == 6) or (bgs[r] == 5)) or (bgs[r] == 4)) {
f[r] = 2;
}
if (((bgs[r] == 3) or (bgs[r] == 2)) or (bgs[r] == 1)) {
f[r] = 3;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 2;
bgs[r] = 15;
}
}
if (bgd[r] == 2) {
f[r] = 4;
if (((bgs[r] == 15) or (bgs[r] == 10)) or (bgs[r] == 5)) {
cannons.start();
bgst[bsn] = 2;
bgsx[bsn] = bgx[r] + 20;
bgsy[bsn] = bgy[r];
bgsd[bsn] = 0;
bsn = bsn + 1;
if (bsn > 5) {
bsn = 1;
}
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 0;
bgs[r] = 20;
}
}
if (bgd[r] == 3) {
f[r] = 5;
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 4;
bgs[r] = 6;
}
}
if (bgd[r] == 4) {
if (((bgs[r] == 6) or (bgs[r] == 5)) or (bgs[r] == 4)) {
f[r] = 6;
}
if (((bgs[r] == 3) or (bgs[r] == 2)) or (bgs[r] == 1)) {
f[r] = 7;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 5;
bgs[r] = 15;
}
}
if (bgd[r] == 5) {
f[r] = 8;
if (((bgs[r] == 15) or (bgs[r] == 10)) or (bgs[r] == 5)) {
cannons.start();
bgst[bsn] = 2;
bgsx[bsn] = bgx[r] - 20;
bgsy[bsn] = bgy[r];
bgsd[bsn] = 1;
bsn = bsn + 1;
if (bsn > 5) {
bsn = 1;
}
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
bgd[r] = 3;
bgs[r] = 20;
}
}
if (bgd[r] == 6) {
if (bgs[r] == 2) {
f[r] = 9;
}
if (bgs[r] == 1) {
f[r] = 10;
}
bgs[r] = bgs[r] - 1;
if (bgs[r] <= 0) {
f[r] = 11;
bgt[r] = 0;
bgx[r] = -500;
bgs[r] = 0;
}
}
}
}
r++;
}
r = 1;
while (r <= 5) {
if (bgst[r] > 0) {
if (bgst[r] == 1) {
if (r == 1) {
bgs1.gotoAndStop(1);
}
if (r == 2) {
bgs2.gotoAndStop(1);
}
if (r == 3) {
bgs3.gotoAndStop(1);
}
if (r == 4) {
bgs4.gotoAndStop(1);
}
if (r == 5) {
bgs5.gotoAndStop(1);
}
if (bgsd[r] == 0) {
bgsx[r] = bgsx[r] + 20;
if (bgsx[r] > (px + 300)) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgsd[r] == 1) {
bgsx[r] = bgsx[r] - 20;
if (bgsx[r] < (px - 300)) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgsd[r] == 2) {
bgsx[r] = bgsx[r] + 15;
bgsy[r] = bgsy[r] + 15;
if ((bgsx[r] > (px + 300)) or (bgsy[r] > (py + 300))) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgsd[r] == 3) {
bgsx[r] = bgsx[r] - 15;
bgsy[r] = bgsy[r] + 15;
if ((bgsx[r] > (px + 300)) or (bgsy[r] > (py + 300))) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgsd[r] == 4) {
bgsy[r] = bgsy[r] + 20;
if (bgsy[r] > (py + 300)) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (((((((bgsx[r] - 15) < (px + 10)) and ((bgsx[r] + 15) > (px - 10))) and ((bgsy[r] + 15) > (py + 5))) and ((bgsy[r] - 15) < (py + 20))) and (pcd < 18)) and (i < 1)) {
if ((bgsd[r] == 0) or (bgsd[r] == 2)) {
pcd = 19;
}
if ((bgsd[r] == 1) or (bgsd[r] == 3)) {
pcd = 18;
}
pstep = 2;
pl = pl - 3;
megah.start();
i = 10;
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgst[r] == 2) {
if (r == 1) {
bgs1.gotoAndStop(2);
}
if (r == 2) {
bgs2.gotoAndStop(2);
}
if (r == 3) {
bgs3.gotoAndStop(2);
}
if (r == 4) {
bgs4.gotoAndStop(2);
}
if (r == 5) {
bgs5.gotoAndStop(2);
}
if (bgsd[r] == 0) {
bgsx[r] = bgsx[r] + 30;
if (bgsx[r] > (px + 300)) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgsd[r] == 1) {
bgsx[r] = bgsx[r] - 30;
if (bgsx[r] < (px - 300)) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (((((((bgsx[r] - 25) < (px + 10)) and ((bgsx[r] + 25) > (px - 10))) and ((bgsy[r] + 80) > (py + 40))) and ((bgsy[r] + 35) < (py + 60))) and (pcd < 18)) and (i < 1)) {
if (bgsd[r] == 0) {
pcd = 19;
}
if (bgsd[r] == 1) {
pcd = 18;
}
pstep = 2;
pl = pl - 6;
megah.start();
i = 10;
bgst[r] = 0;
bgsx[r] = -200;
}
}
}
r++;
}
bg1.gotoAndStop(f[1]);
bg2.gotoAndStop(f[2]);
bg3.gotoAndStop(f[3]);
bg4.gotoAndStop(f[4]);
bg5.gotoAndStop(f[5]);
bg6.gotoAndStop(f[6]);
bg7.gotoAndStop(f[7]);
bg8.gotoAndStop(f[8]);
bgs1._x = ((bgsx[1] + 275) - px) / 2;
bgs1._y = ((bgsy[1] + 275) - py) / 2;
bgs2._x = ((bgsx[2] + 275) - px) / 2;
bgs2._y = ((bgsy[2] + 275) - py) / 2;
bgs3._x = ((bgsx[3] + 275) - px) / 2;
bgs3._y = ((bgsy[3] + 275) - py) / 2;
bgs4._x = ((bgsx[4] + 275) - px) / 2;
bgs4._y = ((bgsy[4] + 275) - py) / 2;
bgs5._x = ((bgsx[5] + 275) - px) / 2;
bgs5._y = ((bgsy[5] + 275) - py) / 2;
bg1._x = ((bgx[1] + 275) - px) / 2;
bg1._y = ((bgy[1] + 275) - py) / 2;
bg2._x = ((bgx[2] + 275) - px) / 2;
bg2._y = ((bgy[2] + 275) - py) / 2;
bg3._x = ((bgx[3] + 275) - px) / 2;
bg3._y = ((bgy[3] + 275) - py) / 2;
bg4._x = ((bgx[4] + 275) - px) / 2;
bg4._y = ((bgy[4] + 275) - py) / 2;
bg5._x = ((bgx[5] + 275) - px) / 2;
bg5._y = ((bgy[5] + 275) - py) / 2;
bg6._x = ((bgx[6] + 275) - px) / 2;
bg6._y = ((bgy[6] + 275) - py) / 2;
bg7._x = ((bgx[7] + 275) - px) / 2;
bg7._y = ((bgy[7] + 275) - py) / 2;
bg8._x = ((bgx[8] + 275) - px) / 2;
bg8._y = ((bgy[8] + 275) - py) / 2;
r = 1;
while (r <= 3) {
if (((pst[r] > 0) and (pst[r] < 4)) and (psd[r] == 0)) {
if (r == 1) {
shot1p._x = ((297 + psx[1]) - px) / 2;
shot1p._y = ((270 + psy[1]) - py) / 2;
}
if (r == 2) {
shot2p._x = ((297 + psx[2]) - px) / 2;
shot2p._y = ((270 + psy[2]) - py) / 2;
}
if (r == 3) {
shot3p._x = ((297 + psx[3]) - px) / 2;
shot3p._y = ((270 + psy[3]) - py) / 2;
}
}
if (((pst[r] > 0) and (pst[r] < 4)) and (psd[r] == 1)) {
if (r == 1) {
shot1p._x = ((247 + psx[1]) - px) / 2;
shot1p._y = ((270 + psy[1]) - py) / 2;
}
if (r == 2) {
shot2p._x = ((247 + psx[2]) - px) / 2;
shot2p._y = ((270 + psy[2]) - py) / 2;
}
if (r == 3) {
shot3p._x = ((247 + psx[3]) - px) / 2;
shot3p._y = ((270 + psy[3]) - py) / 2;
}
}
if ((pst[r] == 4) or (pst[r] == 5)) {
if (r == 1) {
shot1p._x = ((272 + psx[1]) - px) / 2;
shot1p._y = ((270 + psy[1]) - py) / 2;
}
if (r == 2) {
shot2p._x = ((272 + psx[2]) - px) / 2;
shot2p._y = ((270 + psy[2]) - py) / 2;
}
if (r == 3) {
shot3p._x = ((272 + psx[3]) - px) / 2;
shot3p._y = ((270 + psy[3]) - py) / 2;
}
}
if (pst[r] == 0) {
if (r == 1) {
shot1p._x = -200;
shot1p._y = (270 + psy[1]) - py;
}
if (r == 2) {
shot2p._x = -200;
shot2p._y = (270 + psy[2]) - py;
}
if (r == 3) {
shot3p._x = -200;
shot3p._y = (270 + psy[3]) - py;
}
}
r++;
}
if (i > 0) {
i = i - 1;
pc._alpha = 50;
}
if (i <= 0) {
i = i - 1;
pc._alpha = 100;
}
if (bcharge > 0) {
charge._alpha = bcharge;
}
lbar._height = 2 * pl;
lbar._y = 120 - (2 * pl);
stage._x = (770 - px) / 2;
stage._y = (175 - py) / 2;
exit._x = ((ex + 275) - px) / 2;
exit._y = ((ey + 275) - py) / 2;
Frame 266
gotoAndPlay (18);
if ((((px + 10) > (ex - 20)) and ((px - 10) < (ex + 20))) and (((py + 30) > (ey - 20)) and (py < (ey + 50)))) {
gotoAndPlay (20);
}
Frame 267
lbar._height = 2 * pl;
lbar._y = 120 - (2 * pl);
stage._x = (275 - px) / 2;
stage._y = (-225 - py) / 2;
exit._x = ((ex + 275) - px) / 2;
exit._y = ((ey + 275) - py) / 2;
Frame 270
psn = 1;
bstep = 0;
pcd = 0;
bcharge = 0;
r = 1;
while (r <= 5) {
psx[r] = -200;
psy[r] = 0;
pst[r] = 0;
psd[r] = 0;
r++;
}
i = 0;
pl = pl + 5;
if (pl > 50) {
pl = 50;
}
px = 150;
py = 350;
r = 0;
while (r <= 31) {
bx[r] = -50;
by[r] = -50;
r++;
}
bx[1] = 50;
by[1] = 150;
bx[2] = 50;
by[2] = 250;
bx[3] = 150;
by[3] = 350;
bx[4] = 250;
by[4] = 350;
bx[5] = 350;
by[5] = 350;
bx[6] = 450;
by[6] = 350;
bx[7] = 550;
by[7] = 350;
bx[8] = 650;
by[8] = 350;
bx[9] = 750;
by[9] = 350;
bx[10] = 850;
by[10] = 350;
bx[11] = 950;
by[11] = 350;
bx[12] = 1050;
by[12] = 350;
bx[13] = 1150;
by[13] = 350;
bx[14] = 1250;
by[14] = 250;
bx[15] = 1150;
by[15] = 150;
bsn = 1;
bi = 0;
r = 1;
while (r <= 8) {
bgx[r] = -200;
bgy[r] = -200;
bgt[r] = 0;
bgd[r] = -1;
bgs[r] = 0;
r++;
}
r = 1;
while (r <= 5) {
bgsx[r] = -200;
bgsy[r] = 0;
bgst[r] = 0;
bgsd[r] = 0;
r++;
}
r = 1;
while (r <= 8) {
f[r] = 20;
r++;
}
bgd[1] = 0;
bgs[1] = 0;
bgl[1] = 50;
bgx[1] = 350;
bgy[1] = 350;
ex = 1150;
ey = 250;
stopAllSounds();
Frame 275
b1._x = bx[1] / 10;
b1._y = (by[1] / 10) + 120;
b2._x = bx[2] / 10;
b2._y = (by[2] / 10) + 120;
b3._x = bx[3] / 10;
b3._y = (by[3] / 10) + 120;
b4._x = bx[4] / 10;
b4._y = (by[4] / 10) + 120;
b5._x = bx[5] / 10;
b5._y = (by[5] / 10) + 120;
b6._x = bx[6] / 10;
b6._y = (by[6] / 10) + 120;
b7._x = bx[7] / 10;
b7._y = (by[7] / 10) + 120;
b8._x = bx[8] / 10;
b8._y = (by[8] / 10) + 120;
b9._x = bx[9] / 10;
b9._y = (by[9] / 10) + 120;
b10._x = bx[10] / 10;
b10._y = (by[10] / 10) + 120;
b11._x = bx[11] / 10;
b11._y = (by[11] / 10) + 120;
b12._x = bx[12] / 10;
b12._y = (by[12] / 10) + 120;
b13._x = bx[13] / 10;
b13._y = (by[13] / 10) + 120;
b14._x = bx[14] / 10;
b14._y = (by[14] / 10) + 120;
b15._x = bx[15] / 10;
b15._y = (by[15] / 10) + 120;
b16._x = bx[16] / 10;
b16._y = (by[16] / 10) + 120;
b17._x = bx[17] / 10;
b17._y = (by[17] / 10) + 120;
b18._x = bx[18] / 10;
b18._y = (by[18] / 10) + 120;
b19._x = bx[19] / 10;
b19._y = (by[19] / 10) + 120;
b20._x = bx[20] / 10;
b20._y = (by[20] / 10) + 120;
b21._x = bx[21] / 10;
b21._y = (by[21] / 10) + 120;
b22._x = bx[22] / 10;
b22._y = (by[22] / 10) + 120;
b23._x = bx[23] / 10;
b23._y = (by[23] / 10) + 120;
b24._x = bx[24] / 10;
b24._y = (by[24] / 10) + 120;
b25._x = bx[25] / 10;
b25._y = (by[25] / 10) + 120;
b26._x = bx[26] / 10;
b26._y = (by[26] / 10) + 120;
b27._x = bx[27] / 10;
b27._y = (by[27] / 10) + 120;
b28._x = bx[28] / 10;
b28._y = (by[28] / 10) + 120;
b29._x = bx[29] / 10;
b29._y = (by[29] / 10) + 120;
b30._x = bx[30] / 10;
b30._y = (by[30] / 10) + 120;
b31._x = bx[31] / 10;
b31._y = (by[31] / 10) + 120;
cir._x = px / 10;
cir._y = (py / 10) + 120;
shot1._x = psx[1] / 10;
shot1._y = (psy[1] / 10) + 120;
shot2._x = psx[2] / 10;
shot2._y = (psy[2] / 10) + 120;
shot3._x = psx[3] / 10;
shot3._y = (psy[3] / 10) + 120;
bshot1._x = bgsx[1] / 10;
bshot1._y = (bgsy[1] / 10) + 120;
bshot2._x = bgsx[2] / 10;
bshot2._y = (bgsy[2] / 10) + 120;
bshot3._x = bgsx[3] / 10;
bshot3._y = (bgsy[3] / 10) + 120;
bshot4._x = bgsx[4] / 10;
bshot4._y = (bgsy[4] / 10) + 120;
bshot5._x = bgsx[5] / 10;
bshot5._y = (bgsy[5] / 10) + 120;
bcir1._x = bgx[1] / 10;
bcir1._y = (bgy[1] / 10) + 120;
bcir2._x = bgx[2] / 10;
bcir2._y = (bgy[2] / 10) + 120;
bcir3._x = bgx[3] / 10;
bcir3._y = (bgy[3] / 10) + 120;
bcir4._x = bgx[4] / 10;
bcir4._y = (bgy[4] / 10) + 120;
bcir5._x = bgx[5] / 10;
bcir5._y = (bgy[5] / 10) + 120;
bcir6._x = bgx[6] / 10;
bcir6._y = (bgy[6] / 10) + 120;
bcir7._x = bgx[7] / 10;
bcir7._y = (bgy[7] / 10) + 120;
bcir8._x = bgx[8] / 10;
bcir8._y = (bgy[8] / 10) + 120;
bcir9._x = bgx[9] / 10;
bcir9._y = (bgy[9] / 10) + 120;
bcir10._x = bgx[10] / 10;
bcir10._y = (bgy[10] / 10) + 120;
bcir11._x = bgx[11] / 10;
bcir11._y = (bgy[11] / 10) + 120;
bcir12._x = bgx[12] / 10;
bcir12._y = (bgy[12] / 10) + 120;
bcir13._x = bgx[13] / 10;
bcir13._y = (bgy[13] / 10) + 120;
if (Key.isDown(39) and (pcd == 0)) {
pcd = 2;
}
if (Key.isDown(39) and ((pcd == 1) or (pcd == 3))) {
pcd = 0;
}
if (Key.isDown(37) and (pcd == 1)) {
pcd = 3;
}
if (Key.isDown(37) and ((pcd == 0) or (pcd == 2))) {
pcd = 1;
}
if (Key.isDown(38) and ((pcd == 0) or (pcd == 2))) {
pcd = 10;
pstep = 7;
}
if (Key.isDown(38) and ((pcd == 1) or (pcd == 3))) {
pcd = 11;
pstep = 7;
}
if (Key.isDown(40) and ((((pcd == 0) or (pcd == 1)) or (pcd == 2)) or (pcd == 3))) {
if (((pcd == 0) or (pcd == 2)) or (pcd == 8)) {
pcd = 6;
pstep = 3;
}
if (((pcd == 1) or (pcd == 3)) or (pcd == 9)) {
pcd = 7;
pstep = 3;
}
}
if (Key.isDown(16) and (bcharge < 100)) {
bcharge = bcharge + 5;
}
if (pcd == 0) {
pc.gotoAndStop(1);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(21);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px + 10;
psy[psn] = py;
psd[psn] = 0;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
}
if (pcd == 1) {
pc.gotoAndStop(2);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(22);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px - 10;
psy[psn] = py;
psd[psn] = 1;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
}
if (pcd == 2) {
px = px + 13;
if ((w == 0) or (w == 1)) {
pc.gotoAndStop(3);
}
if ((w == 2) or (w == 3)) {
pc.gotoAndStop(4);
}
if ((w == 4) or (w == 5)) {
pc.gotoAndStop(5);
}
if ((w == 6) or (w == 7)) {
pc.gotoAndStop(6);
}
if (Key.isDown(32)) {
if ((w == 0) or (w == 1)) {
pc.gotoAndStop(11);
}
if ((w == 2) or (w == 3)) {
pc.gotoAndStop(12);
}
if ((w == 4) or (w == 5)) {
pc.gotoAndStop(13);
}
if ((w == 6) or (w == 7)) {
pc.gotoAndStop(14);
}
if ((pst[psn] == 0) and (bstep == 0)) {
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px + 10;
psy[psn] = py;
psd[psn] = 0;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
}
pcd = 0;
}
if (pcd == 3) {
px = px - 13;
if ((w == 0) or (w == 1)) {
pc.gotoAndStop(7);
}
if ((w == 2) or (w == 3)) {
pc.gotoAndStop(8);
}
if ((w == 4) or (w == 5)) {
pc.gotoAndStop(9);
}
if ((w == 6) or (w == 7)) {
pc.gotoAndStop(10);
}
if (Key.isDown(32)) {
if ((w == 0) or (w == 1)) {
pc.gotoAndStop(15);
}
if ((w == 2) or (w == 3)) {
pc.gotoAndStop(16);
}
if ((w == 4) or (w == 5)) {
pc.gotoAndStop(17);
}
if ((w == 6) or (w == 7)) {
pc.gotoAndStop(18);
}
if ((pst[psn] == 0) and (bstep == 0)) {
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px - 10;
psy[psn] = py;
psd[psn] = 1;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
}
pcd = 1;
}
if (pcd == 9) {
pstep = pstep - 1;
if (pstep <= 0) {
pcd = 1;
}
}
if (pcd == 6) {
pc.gotoAndStop(19);
px = px + 20;
pstep = pstep - 1;
if (pstep <= 0) {
pcd = 0;
}
}
if (pcd == 7) {
pc.gotoAndStop(20);
px = px - 20;
pstep = pstep - 1;
if (pstep <= 0) {
pcd = 1;
}
}
if (pcd == 12) {
pc.gotoAndStop(23);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(25);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px + 10;
psy[psn] = py;
psd[psn] = 0;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
py = py + (5 * (7 - pstep));
pstep = pstep - 1;
if (pstep <= 2) {
pstep = 2;
}
if (Key.isDown(39)) {
px = px + 13;
}
if (Key.isDown(37)) {
px = px - 13;
if (bstep == 0) {
pcd = 13;
}
}
}
if (pcd == 13) {
pc.gotoAndStop(24);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(26);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px - 10;
psy[psn] = py;
psd[psn] = 1;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
py = py + (5 * (7 - pstep));
pstep = pstep - 1;
if (pstep <= 2) {
pstep = 2;
}
if (Key.isDown(39)) {
px = px + 13;
if (bstep == 0) {
pcd = 12;
}
}
if (Key.isDown(37)) {
px = px - 13;
}
}
if (pcd == 10) {
pc.gotoAndStop(23);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(25);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px + 10;
psy[psn] = py;
psd[psn] = 0;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
py = py - (5 * pstep);
pstep = pstep - 1;
if (Key.isDown(39)) {
px = px + 13;
}
if (Key.isDown(37)) {
px = px - 13;
if (bstep == 0) {
pcd = 11;
}
}
if (Key.isDown(40)) {
pcd = 12;
pstep = pstep + 3;
}
if (pstep <= -1) {
pstep = 7;
pcd = 12;
}
}
if (pcd == 11) {
pc.gotoAndStop(24);
if (((pst[psn] == 0) and (bstep == 0)) and Key.isDown(32)) {
pc.gotoAndStop(26);
megas.start();
if (bcharge < 50) {
pst[psn] = 1;
}
if ((bcharge >= 50) and (bcharge < 100)) {
pst[psn] = 2;
}
if (bcharge == 100) {
pst[psn] = 3;
}
psx[psn] = px - 10;
psy[psn] = py;
psd[psn] = 1;
bstep = 2;
psn = psn + 1;
if (psn > 3) {
psn = 1;
}
}
py = py - (5 * pstep);
pstep = pstep - 1;
if (Key.isDown(39)) {
px = px + 13;
if (bstep == 0) {
pcd = 10;
}
}
if (Key.isDown(37)) {
px = px - 13;
}
if (Key.isDown(40)) {
pcd = 13;
pstep = pstep + 3;
}
if (pstep <= -1) {
pstep = 7;
pcd = 13;
}
}
if (pcd == 18) {
pc.gotoAndStop(27);
pstep = pstep - 1;
px = px - 5;
if (pstep <= -1) {
pstep = 2;
pcd = 0;
}
}
if (pcd == 19) {
pc.gotoAndStop(28);
pstep = pstep - 1;
px = px + 5;
if (pstep <= -1) {
pstep = 2;
pcd = 1;
}
}
if (pcd == 20) {
pc.gotoAndStop(69 - pstep);
bcharge = 0;
bstep = 20;
pl = 1;
pstep = pstep - 1;
if (pstep < 0) {
lives = lives - 1;
if (lives >= 0) {
pl = 50;
gotoAndPlay (135);
}
if (lives < 0) {
lives = 2;
continues = continues - 1;
gotoAndPlay (5);
}
}
}
if (pcd == 21) {
pc.gotoAndStop(77 - pstep);
charge._alpha = 0;
bcharge = 0;
bstep = 20;
pstep = pstep - 1;
if (pstep < 0) {
pstep = 0;
}
}
if (pl <= 0) {
pc._alpha = 100;
pcd = 20;
pstep = 40;
megad.start();
}
if (bstep > 0) {
bcharge = 0;
charge._alpha = bcharge;
}
if (bstep > 0) {
bstep = bstep - 1;
}
if (py > 350) {
py = 350;
if ((((pcd == 12) or (pcd == 13)) or (pcd == 16)) or (pcd == 17)) {
if ((pcd == 12) or (pcd == 16)) {
pcd = 0;
}
if ((pcd == 13) or (pcd == 17)) {
pcd = 1;
}
}
}
if ((pcd == 18) and (py < 350)) {
pcd = 12;
pstep = 5;
}
if ((pcd == 19) and (py < 350)) {
pcd = 13;
pstep = 5;
}
if (px < 25) {
px = 25;
}
if (px > 525) {
px = 525;
}
w = w - 1;
if (w < 0) {
w = 7;
}
e = pcd;
r = 1;
while (r <= 3) {
if (pst[r] == 1) {
if (psd[r] == 0) {
psx[r] = psx[r] + 30;
if (r == 1) {
shot1p.gotoAndStop(1);
}
if (r == 2) {
shot2p.gotoAndStop(1);
}
if (r == 3) {
shot3p.gotoAndStop(1);
}
if (psx[r] > 580) {
pst[r] = 0;
psx[r] = -200;
}
}
if (psd[r] == 1) {
psx[r] = psx[r] - 30;
if (r == 1) {
shot1p.gotoAndStop(2);
}
if (r == 2) {
shot2p.gotoAndStop(2);
}
if (r == 3) {
shot3p.gotoAndStop(2);
}
if (psx[r] < -30) {
pst[r] = 0;
psx[r] = -200;
}
}
}
if (pst[r] == 2) {
if (psd[r] == 0) {
psx[r] = psx[r] + 35;
if (r == 1) {
shot1p.gotoAndStop(3);
}
if (r == 2) {
shot2p.gotoAndStop(3);
}
if (r == 3) {
shot3p.gotoAndStop(3);
}
if (psx[r] > 600) {
pst[r] = 0;
psx[r] = -200;
}
}
if (psd[r] == 1) {
psx[r] = psx[r] - 35;
if (r == 1) {
shot1p.gotoAndStop(4);
}
if (r == 2) {
shot2p.gotoAndStop(4);
}
if (r == 3) {
shot3p.gotoAndStop(4);
}
if (psx[r] < -50) {
pst[r] = 0;
psx[r] = -200;
}
}
}
if (pst[r] == 3) {
if (psd[r] == 0) {
psx[r] = psx[r] + 40;
if (r == 1) {
shot1p.gotoAndStop(5);
}
if (r == 2) {
shot2p.gotoAndStop(5);
}
if (r == 3) {
shot3p.gotoAndStop(5);
}
if (psx[r] > 630) {
pst[r] = 0;
psx[r] = -200;
}
}
if (psd[r] == 1) {
psx[r] = psx[r] - 40;
if (r == 1) {
shot1p.gotoAndStop(6);
}
if (r == 2) {
shot2p.gotoAndStop(6);
}
if (r == 3) {
shot3p.gotoAndStop(6);
}
if (psx[r] < -80) {
pst[r] = 0;
psx[r] = -200;
}
}
}
if (pst[r] == 4) {
if (r == 1) {
shot1p.gotoAndStop(10 - psd[r]);
}
if (r == 2) {
shot2p.gotoAndStop(10 - psd[r]);
}
if (r == 3) {
shot3p.gotoAndStop(10 - psd[r]);
}
psd[r] = psd[r] - 1;
if (psd[r] < 0) {
pst[r] = 0;
psx[r] = -200;
}
}
if (pst[r] == 5) {
if (r == 1) {
shot1p.gotoAndStop(14 - psd[r]);
}
if (r == 2) {
shot2p.gotoAndStop(14 - psd[r]);
}
if (r == 3) {
shot3p.gotoAndStop(14 - psd[r]);
}
psd[r] = psd[r] - 1;
if (psd[r] < 0) {
pst[r] = 0;
psx[r] = -200;
}
}
r++;
}
r = 1;
while (r <= 3) {
if ((pst[r] > 0) and (pst[r] < 4)) {
if (((((((bgx[1] - 22) < (psx[r] + ((pst[r] * 20) - 20))) and ((bgx[1] + 22) > (psx[r] - ((pst[r] * 20) - 20)))) and ((bgy[1] - 35) < (psy[r] + ((pst[r] * 20) - 20)))) and ((bgy[1] + 35) > (psy[r] - ((pst[r] * 20) - 20)))) and (bi < 1)) and (bgl[1] > 0)) {
if (bgd[1] > 5) {
deflect.start();
}
if (bgd[1] < 6) {
megash.start();
bgl[1] = bgl[1] - pst[r];
bi = 12;
if (bgl[1] < 1) {
bi = 0;
baddyd2.start();
bgd[1] = 14;
bgs[1] = 10;
pcd = 21;
pstep = 7;
}
}
if (bgl[1] > 0) {
pst[r] = 0;
psx[r] = -200;
}
}
}
r++;
}
if (bgd[1] == 0) {
boss.gotoAndStop(1);
if (px < bgx[1]) {
bgd[1] = 1;
}
c = random(140 - (3 * dif));
if (c < 6) {
machineg.start();
bgd[1] = 2;
bgs[1] = 8;
}
if ((c > 10) and (c < 16)) {
cannons.start();
bgd[1] = 4;
bgs[1] = 8;
}
if ((c > 20) and (c < 25)) {
jetpass.start();
bgd[1] = 6;
bgs[1] = 12;
}
}
if (bgd[1] == 1) {
boss.gotoAndStop(6);
if (px > bgx[1]) {
bgd[1] = 0;
}
c = random(140 - (3 * dif));
if (c < 6) {
machineg.start();
bgd[1] = 3;
bgs[1] = 8;
}
if ((c > 10) and (c < 16)) {
cannons.start();
bgd[1] = 5;
bgs[1] = 8;
}
if ((c > 20) and (c < 25)) {
jetpass.start();
bgd[1] = 7;
bgs[1] = 12;
}
}
if (bgd[1] == 2) {
boss.gotoAndStop(3);
bgs[1] = bgs[1] - 1;
if (bgs[1] <= 0) {
bgd[1] = 0;
bgst[bsn] = 1;
bgsx[bsn] = bgx[1] + 20;
bgsy[bsn] = bgy[1] + 20;
bgsd[bsn] = 0;
bsn = bsn + 1;
if (bsn > 5) {
bsn = 1;
}
}
}
if (bgd[1] == 3) {
boss.gotoAndStop(8);
bgs[1] = bgs[1] - 1;
if (bgs[1] <= 0) {
bgd[1] = 1;
bgst[bsn] = 1;
bgsx[bsn] = bgx[1] - 20;
bgsy[bsn] = bgy[1] + 20;
bgsd[bsn] = 1;
bsn = bsn + 1;
if (bsn > 5) {
bsn = 1;
}
}
}
if (bgd[1] == 4) {
boss.gotoAndStop(3);
bgs[1] = bgs[1] - 1;
if (bgs[1] <= 0) {
bgd[1] = 0;
bgst[bsn] = 2;
bgsx[bsn] = bgx[1] + 40;
bgsy[bsn] = bgy[1] + 20;
bgsd[bsn] = 0;
bsn = bsn + 1;
if (bsn > 5) {
bsn = 1;
}
}
}
if (bgd[1] == 5) {
boss.gotoAndStop(8);
bgs[1] = bgs[1] - 1;
if (bgs[1] <= 0) {
bgd[1] = 1;
bgst[bsn] = 2;
bgsx[bsn] = bgx[1] - 40;
bgsy[bsn] = bgy[1] + 20;
bgsd[bsn] = 1;
bsn = bsn + 1;
if (bsn > 5) {
bsn = 1;
}
}
}
if (bgd[1] == 6) {
boss.gotoAndStop(2);
bgy[1] = bgy[1] - 30;
if (bgy[1] < -50) {
c = random(40);
if ((c >= 0) and (c < 10)) {
jetpass.start();
bgd[1] = 8;
bgs[1] = 25;
bgx[1] = -50;
bgy[1] = 330 - random(100);
}
if ((c >= 10) and (c < 20)) {
jetpass.start();
bgd[1] = 9;
bgs[1] = 25;
bgx[1] = 600;
bgy[1] = 330 - random(100);
}
if (c >= 20) {
bgd[1] = 10;
bgs[1] = 20 + random(20 + Dif);
bgx[1] = 275;
bgy[1] = -200;
}
}
}
if (bgd[1] == 7) {
boss.gotoAndStop(7);
bgy[1] = bgy[1] - 30;
bgs[1] = bgs[1] - 1;
if (bgy[1] < -50) {
c = random(40);
if ((c >= 0) and (c < 10)) {
jetpass.start();
bgd[1] = 8;
bgs[1] = 25;
bgx[1] = -50;
bgy[1] = 330 - random(100);
}
if ((c >= 10) and (c < 20)) {
jetpass.start();
bgd[1] = 9;
bgs[1] = 25;
bgx[1] = 600;
bgy[1] = 330 - random(100);
}
if (c >= 20) {
bgd[1] = 10;
bgs[1] = 10 + random(10 + Dif);
bgx[1] = 275;
bgy[1] = -200;
}
}
}
if (bgd[1] == 8) {
boss.gotoAndStop(4 + random(2));
bgx[1] = bgx[1] + 15;
bgs[1] = bgs[1] - 1;
if (bgx[1] > 600) {
bgd[1] = 11;
bgx[1] = random(450) + 50;
bgy[1] = -100;
}
if (((bgs[1] == 22) or (bgs[1] == 15)) or (bgs[1] == 8)) {
c = 1 + random(2);
if (c == 1) {
machineg.start();
}
if (c == 2) {
cannons.start();
}
bgst[bsn] = c;
bgsx[bsn] = bgx[1] + 20;
bgsy[bsn] = bgy[1] + 40;
bgsd[bsn] = 0;
bsn = bsn + 1;
if (bsn > 5) {
bsn = 1;
}
}
}
if (bgd[1] == 9) {
boss.gotoAndStop(9 + random(2));
bgx[1] = bgx[1] - 15;
bgs[1] = bgs[1] - 1;
if (bgx[1] < -50) {
bgd[1] = 11;
bgx[1] = random(450) + 50;
bgy[1] = -100;
}
if (((bgs[1] == 22) or (bgs[1] == 15)) or (bgs[1] == 8)) {
c = 1 + random(2);
if (c == 1) {
machineg.start();
}
if (c == 2) {
cannons.start();
}
bgst[bsn] = c;
bgsx[bsn] = bgx[1] + 20;
bgsy[bsn] = bgy[1] + 40;
bgsd[bsn] = 1;
bsn = bsn + 1;
if (bsn > 5) {
bsn = 1;
}
}
}
if (bgd[1] == 10) {
boss.gotoAndStop(1);
bgs[1] = bgs[1] - 1;
if (bgs[1] < 0) {
bgd[1] = 11;
bgx[1] = random(450) + 50;
bgy[1] = -100;
}
if ((((((bgs[1] == 0) or (bgs[1] == 7)) or (bgs[1] == 15)) or (bgs[1] == 23)) or (bgs[1] == 31)) or (bgs[1] == 37)) {
cannons.start();
bgst[bsn] = 3;
bgsx[bsn] = (px - 60) + random(120);
bgsy[bsn] = -50;
bgsd[bsn] = 0;
bsn = bsn + 1;
if (bsn > 5) {
bsn = 1;
}
}
}
if (bgd[1] == 11) {
boss.gotoAndStop(2);
bgy[1] = bgy[1] + 30;
if (bgy[1] > 350) {
bgd[1] = random(2);
bgy[1] = 350;
}
}
if (bgd[1] == 14) {
boss.gotoAndStop(10);
if ((bgs[1] == 0) or (bgs[1] == 1)) {
boss.gotoAndStop(16);
}
if ((bgs[1] == 2) or (bgs[1] == 3)) {
boss.gotoAndStop(15);
}
if ((bgs[1] == 4) or (bgs[1] == 5)) {
boss.gotoAndStop(14);
}
if ((bgs[1] == 6) or (bgs[1] == 7)) {
boss.gotoAndStop(13);
}
if ((bgs[1] == 8) or (bgs[1] == 9)) {
boss.gotoAndStop(12);
}
if (bgs[1] == 10) {
boss.gotoAndStop(11);
}
bgs[1] = bgs[1] - 1;
if (bgs[1] < 0) {
gotoAndPlay (142);
}
}
r = 1;
while (r <= 5) {
if (bgst[r] > 0) {
if (bgst[r] == 1) {
if (bgsd[r] == 0) {
if (r == 1) {
bgs1.gotoAndStop(1);
}
if (r == 2) {
bgs2.gotoAndStop(1);
}
if (r == 3) {
bgs3.gotoAndStop(1);
}
if (r == 4) {
bgs4.gotoAndStop(1);
}
if (r == 5) {
bgs5.gotoAndStop(1);
}
bgsx[r] = bgsx[r] + 25;
if (bgsx[r] > 580) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgsd[r] == 1) {
if (r == 1) {
bgs1.gotoAndStop(2);
}
if (r == 2) {
bgs2.gotoAndStop(2);
}
if (r == 3) {
bgs3.gotoAndStop(2);
}
if (r == 4) {
bgs4.gotoAndStop(2);
}
if (r == 5) {
bgs5.gotoAndStop(2);
}
bgsx[r] = bgsx[r] - 25;
if (bgsx[r] < -30) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if ((((((((bgsx[r] - 30) < (px + 10)) and ((bgsx[r] + 30) > (px - 10))) and ((bgsy[r] + 25) > (py + 5))) and ((bgsy[r] - 25) < (py + 20))) and (pcd < 18)) and (i < 1)) and (pl > 0)) {
if ((bgsd[r] == 0) or (bgsd[r] == 2)) {
pcd = 19;
}
if ((bgsd[r] == 1) or (bgsd[r] == 3)) {
pcd = 18;
}
pstep = 2;
pl = pl - 2;
megah.start();
i = 10;
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgst[r] == 2) {
if (bgsd[r] == 0) {
if (r == 1) {
bgs1.gotoAndStop(3 + random(2));
}
if (r == 2) {
bgs2.gotoAndStop(3 + random(2));
}
if (r == 3) {
bgs3.gotoAndStop(3 + random(2));
}
if (r == 4) {
bgs4.gotoAndStop(3 + random(2));
}
if (r == 5) {
bgs5.gotoAndStop(3 + random(2));
}
bgsx[r] = bgsx[r] + 20;
if ((py + 20) < bgsy[r]) {
bgsy[r] = bgsy[r] - 3;
}
if ((py + 20) > bgsy[r]) {
bgsy[r] = bgsy[r] + 3;
}
if (bgsx[r] > 580) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgsd[r] == 1) {
if (r == 1) {
bgs1.gotoAndStop(5 + random(2));
}
if (r == 2) {
bgs2.gotoAndStop(5 + random(2));
}
if (r == 3) {
bgs3.gotoAndStop(5 + random(2));
}
if (r == 4) {
bgs4.gotoAndStop(5 + random(2));
}
if (r == 5) {
bgs5.gotoAndStop(5 + random(2));
}
bgsx[r] = bgsx[r] - 20;
if ((py + 20) < bgsy[r]) {
bgsy[r] = bgsy[r] - 3;
}
if ((py + 20) > bgsy[r]) {
bgsy[r] = bgsy[r] + 3;
}
if (bgsx[r] < -30) {
bgst[r] = 0;
bgsx[r] = -200;
}
}
if ((((((((bgsx[r] - 30) < (px + 10)) and ((bgsx[r] + 30) > (px - 10))) and ((bgsy[r] + 25) > (py + 5))) and ((bgsy[r] - 25) < (py + 20))) and (pcd < 18)) and (i < 1)) and (pl > 0)) {
if ((bgsd[r] == 0) or (bgsd[r] == 2)) {
pcd = 19;
}
if ((bgsd[r] == 1) or (bgsd[r] == 3)) {
pcd = 18;
}
pstep = 2;
pl = pl - 3;
megah.start();
i = 10;
bgst[r] = 0;
bgsx[r] = -200;
}
}
if (bgst[r] == 3) {
if (bgsd[r] == 0) {
if (r == 1) {
bgs1.gotoAndStop(11 + random(2));
}
if (r == 2) {
bgs2.gotoAndStop(11 + random(2));
}
if (r == 3) {
bgs3.gotoAndStop(11 + random(2));
}
if (r == 4) {
bgs4.gotoAndStop(11 + random(2));
}
if (r == 5) {
bgs5.gotoAndStop(11 + random(2));
}
bgsy[r] = bgsy[r] + 30;
if (bgsy[r] > 340) {
baddyd2.start();
bgst[r] = 4;
bgsd[r] = 0;
}
}
if ((((((((bgsx[r] - 12) < (px + 10)) and ((bgsx[r] + 12) > (px - 10))) and ((bgsy[r] + 35) > (py + 5))) and ((bgsy[r] - 35) < (py + 20))) and (pcd < 18)) and (i < 1)) and (pl > 0)) {
if ((bgsd[r] == 0) or (bgsd[r] == 2)) {
pcd = 19;
}
if ((bgsd[r] == 1) or (bgsd[r] == 3)) {
pcd = 18;
}
pstep = 2;
pl = pl - 3;
megah.start();
i = 10;
bgst[r] = 4;
bgsd[r] = 0;
}
}
if (bgst[r] == 4) {
if (bgsd[r] >= 0) {
if (r == 1) {
bgs1.gotoAndStop(7 + bgsd[r]);
}
if (r == 2) {
bgs2.gotoAndStop(7 + bgsd[r]);
}
if (r == 3) {
bgs3.gotoAndStop(7 + bgsd[r]);
}
if (r == 4) {
bgs4.gotoAndStop(7 + bgsd[r]);
}
if (r == 5) {
bgs5.gotoAndStop(7 + bgsd[r]);
}
bgsd[r] = bgsd[r] + 1;
if (bgsd[r] > 3) {
bgst[r] = 0;
bgsd[r] = 0;
bgsx[r] = -500;
bgsy[r] = 0;
}
}
if (((((((((bgsx[r] - 20) - (3 * bgsd[r])) < (px + 10)) and (((bgsx[r] + 20) + (3 * bgsd[r])) > (px - 10))) and ((bgsy[r] + 50) > (py + 5))) and (((bgsy[r] - 10) - (5 * bgsd[r])) < (py + 20))) and (pcd < 18)) and (i < 1)) and (pl > 0)) {
pcd = 18 + random(2);
pstep = 2;
pl = pl - 4;
megah.start();
i = 10;
}
}
}
r++;
}
if ((((((((bgx[1] - 20) < (px + 10)) and ((bgx[1] + 20) > (px - 10))) and ((bgy[1] + 60) > (py + 10))) and ((bgy[1] + 20) < (py + 50))) and (pcd < 18)) and (i < 1)) and (pl > 0)) {
if (bgx[r] < px) {
pcd = 19;
pstep = 2;
pl = pl - 2;
}
if (bgx[r] > px) {
pcd = 18;
pstep = 2;
pl = pl - 2;
}
megah.start();
i = 10;
}
if (bgy[1] > 350) {
bgy[1] = 350;
}
bgs1._x = bgsx[1] / 2;
bgs1._y = (bgsy[1] / 2) - 20;
bgs2._x = bgsx[2] / 2;
bgs2._y = (bgsy[2] / 2) - 20;
bgs3._x = bgsx[3] / 2;
bgs3._y = (bgsy[3] / 2) - 20;
bgs4._x = bgsx[4] / 2;
bgs4._y = (bgsy[4] / 2) - 20;
bgs5._x = bgsx[5] / 2;
bgs5._y = (bgsy[5] / 2) - 20;
r = 1;
while (r <= 3) {
if (((pst[r] > 0) and (pst[r] < 4)) and (psd[r] == 0)) {
if (r == 1) {
shot1p._x = psx[1] / 2;
shot1p._y = psy[1] / 2;
}
if (r == 2) {
shot2p._x = psx[2] / 2;
shot2p._y = psy[2] / 2;
}
if (r == 3) {
shot3p._x = psx[3] / 2;
shot3p._y = psy[3] / 2;
}
}
if (((pst[r] > 0) and (pst[r] < 4)) and (psd[r] == 1)) {
if (r == 1) {
shot1p._x = psx[1] / 2;
shot1p._y = psy[1] / 2;
}
if (r == 2) {
shot2p._x = psx[2] / 2;
shot2p._y = psy[2] / 2;
}
if (r == 3) {
shot3p._x = psx[3] / 2;
shot3p._y = psy[3] / 2;
}
}
if ((pst[r] == 4) or (pst[r] == 5)) {
if (r == 1) {
shot1p._x = psx[1] / 2;
shot1p._y = psy[1] / 2;
}
if (r == 2) {
shot2p._x = psx[2] / 2;
shot2p._y = psy[2] / 2;
}
if (r == 3) {
shot3p._x = psx[3] / 2;
shot3p._y = psy[3] / 2;
}
}
if (pst[r] == 0) {
if (r == 1) {
shot1p._x = -200;
shot1p._y = (270 + psy[1]) - py;
}
if (r == 2) {
shot2p._x = -200;
shot2p._y = (270 + psy[2]) - py;
}
if (r == 3) {
shot3p._x = -200;
shot3p._y = (270 + psy[3]) - py;
}
}
r++;
}
if (i > 0) {
i = i - 1;
pc._alpha = 50;
}
if (i <= 0) {
i = i - 1;
pc._alpha = 100;
}
if (bi > 0) {
bi = bi - 1;
boss._alpha = 50;
}
if (bi <= 0) {
boss._alpha = 100;
}
if (bcharge > 0) {
charge._alpha = bcharge;
}
charge._x = px / 2;
charge._y = py / 2;
boss._x = bgx[1] / 2;
boss._y = (bgy[1] / 2) - 11;
pc._x = px / 2;
pc._y = py / 2;
lbar._height = 2 * pl;
lbar._y = 120 - (2 * pl);
bbar._height = 2 * bgl[1];
bbar._y = 120 - (2 * bgl[1]);
Frame 276
gotoAndPlay (140);
Frame 277
lbar._height = 2 * pl;
lbar._y = 120 - (2 * pl);
stage._x = (270 - px) / 2;
stage._y = (-725 - py) / 2;
exit._x = ((ex + 275) - px) / 2;
exit._y = ((ey + 275) - py) / 2;
Frame 279
gotoAndPlay (5);
Symbol 32 Button
on (release) {
gotoAndPlay (4);
}
Symbol 37 Button
on (release) {
dif = 0;
lives = 2;
continues = 9999;
play();
}
Symbol 41 Button
on (release) {
dif = 20;
lives = 2;
continues = 2;
play();
}
Symbol 42 Button
on (release) {
dif = 8;
lives = 2;
continues = 10;
play();
}