Frame 1
stop();
Frame 2
score = 0;
lives = 3;
level = 1;
Instance of Symbol 25 MovieClip "defender" in Frame 2
onClipEvent (keyDown) {
if ((Key.getCode() == Key.RIGHT) && (_parent.dx < 290)) {
_parent.dx = _parent.dx + 10;
_x = _parent.dx;
}
if ((Key.getCode() == Key.LEFT) && (32 < _parent.dx)) {
_parent.dx = _parent.dx - 10;
_x = _parent.dx;
}
if ((Key.getCode() == Key.SPACE) && (_parent.missile == 0)) {
_parent.missile = 1;
_parent.my = 323;
_parent.mx = _parent.dx;
_parent.fire._x = _parent.mx;
_parent.fire._y = _parent.my;
_parent.fire._visible = 1;
}
}
Frame 3
y = 0;
base = level * 12;
if (96 < Number(base)) {
base = 96;
}
while (Number(y) < 5) {
if (Number(y) == 0) {
tg = "s1";
}
if (Number(y) == 1) {
tg = "s2";
}
if (Number(y) == 3) {
tg = "s3";
}
x = 0;
while (Number(x) < 12) {
n = Number(x) + Number(y * 11);
duplicateMovieClip (tg, "a" add n, Number(n) + 5);
x = Number(x) + 1;
Set("x" add n, x * 24);
Set("y" add n, Number(Number(y * 24) + 90) + Number(base));
Set("f" add n, 1);
}
y = Number(y) + 1;
}
dir = 1;
dx = 32;
setProperty("/defender", _x , dx);
missile = 0;
aa = 0;
speed = 1;
vaisseau = 0;
gameover = 0;
Frame 4
call("show");
if (Number(presents) == 30) {
speed = 2;
} else if (Number(presents) == 20) {
speed = 3;
} else if (Number(presents) == 10) {
speed = 4;
} else if (Number(presents) == 5) {
speed = 5;
} else if (Number(presents) == 3) {
speed = 6;
} else if (Number(presents) == 2) {
speed = 7;
} else if (Number(presents) == 1) {
speed = 8;
} else if (Number(presents) == 0) {
gameover = 2;
}
nn = 0;
while (Number(nn) < Number(speed)) {
call("avance");
nn = Number(nn) + 1;
}
if (Number(missile) == 1) {
call("tir");
}
if (Number(missile) == 1) {
call("tir");
}
if (Number(missile) == 1) {
call("tir");
}
call("attack");
Frame 5
call("attack");
if (Number(missile) == 1) {
call("tir");
}
if (Number(missile) == 1) {
call("tir");
}
if (Number(missile) == 1) {
call("tir");
}
Frame 6
call("attack");
if (Number(missile) == 1) {
call("tir");
}
if (Number(missile) == 1) {
call("tir");
}
if (Number(missile) == 1) {
call("tir");
}
if (Number(gameover) == 1) {
gotoAndPlay (13);
}
if (Number(gameover) == 3) {
call("show");
lives = 0;
gotoAndStop (26);
}
if (Number(gameover) < 1) {
gotoAndPlay (4);
}
Frame 7
level = Number(level) + 1;
gotoAndPlay (3);
Frame 8
call("vaisseau");
if (Number(aa) == 0) {
found = 0;
aa = 1;
col = random(11);
tentatives = 0;
while ((Number(found) < 1) and (Number(tentatives) < 12)) {
tentatives = Number(tentatives) + 1;
row = 4;
while (Number(found) == 0) {
if (eval ("f" add ((row * 11) + col)) == 1) {
found = 1;
ax = eval ("x" add ((row * 11) + col));
ay = eval ("y" add ((row * 11) + col));
setProperty("/alienfire", _x , ax);
} else {
row = row - 1;
if (Number(row) == Number(-1)) {
found = -1;
}
}
}
if (Number(found) < 1) {
found = 0;
col = Number(col) + 1;
if (Number(col) == 11) {
col = 0;
}
}
}
} else {
ay = Number(ay) + 3;
setProperty("/alienfire", _y , ay);
if (336 < Number(ay)) {
setProperty("/alienfire", _y , 400);
aa = 0;
}
if (((325 < Number(ay)) and (Number(ay) < 331)) and (Number((ax - dx) * (ax - dx)) < 101)) {
gameover = 1;
}
tx = ax;
ty = ay;
}
Frame 9
my = my - 3;
setProperty("/fire", _y , my);
if (Number(my) < 48) {
missile = 0;
setProperty("/fire", _visible , 0);
setProperty("/fire", _y , 323);
}
n = 0;
while (Number(n) < 55) {
if (eval ("f" add n) == 1) {
deltax = eval ("x" add n) - mx;
deltay = eval ("y" add n) - my;
if ((Number(deltax * deltax) < 50) and (Number(deltay * deltay) < 50)) {
missile = 0;
setProperty("/fire", _visible , 0);
setProperty("/fire", _y , 323);
tellTarget ("a" add n) {
gotoAndPlay (9);
};
Set("f" add n, 0);
score = (Number(score) + 90) - (int(n / 11) * 10);
n = 99;
}
}
n = Number(n) + 1;
}
tx = mx;
ty = my;
deltax = mx - vaisseaux;
if ((((Number(my) < 75) and (58 < Number(my))) and (Number(vaisseau) == 1)) and (Number(deltax * deltax) < 196)) {
missile = 0;
setProperty("/fire", _visible , 0);
setProperty("/fire", _y , 323);
vaisseau = 2;
vaisseaucon = 40;
tellTarget ("/vaisseau") {
gotoAndStop(2 + Number(random(3)));
};
}
Frame 10
n = 0;
limit = 0;
while (Number(n) < 55) {
if (eval ("f" add n) == 1) {
Set("x" add n, eval ("x" add n) + dir);
if ((eval ("x" add n) == 316) or (eval ("x" add n) == 24)) {
limit = 1;
}
}
n = Number(n) + 1;
}
if (Number(limit) == 1) {
n = 0;
dir = -dir;
while (Number(n) < 55) {
if (eval ("f" add n) == 1) {
Set("y" add n, eval ("y" add n) + 12);
if (eval ("y" add n) == 330) {
gameover = 3;
}
}
n = Number(n) + 1;
}
}
Frame 11
n = 0;
presents = 0;
while (Number(n) < 55) {
if (eval ("f" add n) == 1) {
setProperty("a" add n, _x , eval ("x" add n));
setProperty("a" add n, _y , eval ("y" add n));
presents = Number(presents) + 1;
}
n = Number(n) + 1;
}
Frame 12
if ((Number(vaisseau) == 0) and (Number(random(100)) == 2)) {
vaisseau = 1;
vaisseaux = 352;
}
if (Number(vaisseau) == 1) {
setProperty("/vaisseau", _x , vaisseaux);
vaisseaux = vaisseaux - 4;
if (Number(vaisseaux) < Number(-40)) {
vaisseau = 0;
}
}
if (Number(vaisseau) == 2) {
vaisseaucon = vaisseaucon - 1;
if (Number(vaisseaucon) < 0) {
vaisseau = 0;
setProperty("/vaisseau", _x , 356);
tellTarget ("/vaisseau") {
gotoAndStop (1);
};
}
}
Frame 13
tellTarget ("/defender") {
gotoAndStop (2);
};
setProperty("/alienfire", _y , 400);
aa = 0;
missile = 0;
setProperty("/fire", _visible , 0);
setProperty("/fire", _y , 323);
gameover = 0;
Frame 25
tellTarget ("/defender") {
gotoAndStop (1);
};
dx = 32;
setProperty("/defender", _x , dx);
lives = lives - 1;
if (0 < Number(lives)) {
gotoAndPlay (4);
}
Frame 26
stop();
Frame 27
n = 0;
while (Number(n) < 55) {
removeMovieClip("a" add n);
n = Number(n) + 1;
}
gotoAndPlay (1);
Symbol 2 Button
on (keyPress "<Enter>") {
play();
}
on (release) {
play();
}
Symbol 15 MovieClip Frame 8
gotoAndPlay (1);
Symbol 15 MovieClip Frame 13
stop();
Symbol 18 MovieClip Frame 8
gotoAndPlay (1);
Symbol 18 MovieClip Frame 13
stop();
Symbol 21 MovieClip Frame 8
gotoAndPlay (1);
Symbol 21 MovieClip Frame 13
stop();
Symbol 25 MovieClip Frame 1
stop();
Symbol 35 MovieClip Frame 1
stop();
Symbol 35 MovieClip Frame 2
Set("/:score", Number(/:score) + 200);
Symbol 35 MovieClip Frame 3
Set("/:score", Number(/:score) + 500);
Symbol 35 MovieClip Frame 4
Set("/:score", Number(/:score) + 1000);
Symbol 45 Button
on (keyPress "<Enter>") {
call("clear");
loadMovieNum ("invaders.swf", 0);
}
on (release) {
play();
}