Frame 1
makefresh = 1;
timesplayed = 0;
music_intro = new Sound();
music_intro.attachSound("intro");
music_startlevel = new Sound();
music_startlevel.attachSound("startlevel");
music_ingame1 = new Sound();
music_ingame1.attachSound("ingame1");
music_gameover = new Sound();
music_gameover.attachSound("gameover");
sound_mothershipdown = new Sound();
sound_mothershipdown.attachSound("mothershipdown");
sound_shoot = new Sound();
sound_shoot.attachSound("soundshoot");
sound_killufo = new Sound();
sound_killufo.attachSound("killufo");
sound_die = new Sound();
sound_die.attachSound("die");
this.onEnterFrame = function () {
if (makefresh == 1) {
makefresh = 0;
gameover = 0;
wave = 1;
score = 0;
highestkill = 0;
lives = 3;
enemy_numb = 3;
enemy_shot = 0;
enemy_speed = 1;
bulletspeed = 8;
goplay = 0;
createufos = 0;
dogetready = 0;
ufohit = 0;
dispatchufos = 0;
dispatchcreate = 0;
doshoot = 1;
startmenu = 1;
startintro = 0;
introdone = 0;
shootbusy = 0;
playsound = 1;
setpauze = 0;
firstnumbx = 713;
_root.music_gameover.stop();
music_intro_start = 1;
music_startlevel_start = 0;
music_ingame1_start = 0;
_root.highscore._y = 152;
_root.highscore.highscoretext.hsfieldname.text = "";
_root.highscore.highscoretext.hsfieldscore.text = "";
dragy = 336;
Mouse.hide();
startDrag (player, true, 49, dragy, 691, dragy);
gethighscore = new LoadVars();
gethighscore.load("http://www.coin-op.nl/panic/getscore.php");
gethighscore.onLoad = function (success) {
if (success) {
counthighscore = gethighscore.count;
i = 1;
while (i <= counthighscore) {
_root.highscore.highscoretext.hsfieldname.text = _root.highscore.highscoretext.hsfieldname.text + gethighscore["player" + i];
_root.highscore.highscoretext.hsfieldscore.text = _root.highscore.highscoretext.hsfieldscore.text + gethighscore["score" + i];
i++;
}
} else {
trace("Error");
}
};
}
greydot._x = _xmouse;
greydot._y = _ymouse;
if (startmenu == 1) {
if (playsound == 1) {
if (music_intro_start == 1) {
_root.music_intro.start(0, 100);
_root.music_intro.setVolume(50);
music_intro_start = 0;
}
}
if (_root.logo.buttonplay.hitTest(_root.bullet)) {
_root.bullet._y = -18;
ep = 0;
while (ep <= 100) {
timesplayed++;
duplicateMovieClip (_root.explodeblock, "eb" + ep, 200 + ep);
setProperty("eb" + ep, _x , 368);
setProperty("eb" + ep, _y , 274);
explodesize = random(18);
setProperty("eb" + ep, _width , explodesize);
setProperty("eb" + ep, _height , explodesize);
setProperty("eb" + ep, _rotation , random(360));
_root.highscore._y = -100;
ep++;
}
startmenu = 0;
startintro = 1;
}
}
if (startintro == 1) {
if (playsound == 1) {
_root.music_intro.stop();
_root.music_startlevel.start(0, 1);
music_ingame1_start = 1;
}
_root.cautionleft._y = 140;
_root.cautionleft.gotoAndPlay(2);
_root.cautionright._y = 140;
_root.cautionright.gotoAndPlay(2);
introcaution = 1;
_root.intro.gotoAndPlay(2);
_root.logo.gotoAndPlay(2);
startintro = 0;
}
if (doshoot == 1) {
if (_root.bullet._y > 24) {
_root.bullet._y = _root.bullet._y - bulletspeed;
shootbusy = 1;
} else {
_root.bullet._y = -20;
shootbusy = 0;
}
}
if (introdone == 1) {
_root.intro._y = -460;
_root.mothership._y = 36;
_root.mothership._x = 163;
introdone = 2;
openhatch = 1;
}
if (openhatch == 1) {
if (playsound == 1) {
if (music_startlevel_start == 1) {
_root.music_ingame1.stop();
music_ingame1_start = 1;
_root.music_startlevel.start(0, 1);
music_startlevel_start = 0;
}
}
_root.mothership.gotoAndPlay(2);
openhatch = 0;
}
if (createufos == 1) {
i = 1;
while (i <= enemy_numb) {
sc = 0;
while (sc < 4) {
removeMovieClip((["ufo" + i] + "smallnumber") + sc);
sc++;
}
i++;
}
i = 1;
while (i <= enemy_numb) {
duplicateMovieClip ("ufo", "ufo" + i, 100 + i);
leftright = random(2);
if (leftright == 1) {
_root["ufo" + i]._x = -100;
} else {
_root["ufo" + i]._x = 860;
}
_root["ufo" + i]._y = random(140);
_root["speed" + i] = i * enemy_speed;
_root["angle" + i] = random(360);
if ((_root["angle" + i] > 170) or (_root["angle" + i] < 190)) {
_root["angle" + i] = _root["angle" + i] + (random(70) + 20);
}
if ((_root["angle" + i] > 350) or (_root["angle" + i] < 10)) {
_root["angle" + i] = _root["angle" + i] + (random(70) + 20);
}
duplicateMovieClip ("ufoicon", "ufoicon" + i, i);
_root["ufoicon" + i]._x = 27 * i;
_root["ufoicon" + i]._y = 26;
i++;
}
dispatchufos = 1;
dogetready = 1;
createufos = 0;
}
if (dogetready == 1) {
if (introcaution == 1) {
introcaution = 0;
} else {
_root.cautionleft._y = 140;
_root.cautionleft.gotoAndPlay(2);
_root.cautionright._y = 140;
_root.cautionright.gotoAndPlay(2);
}
wavelength = length(wave);
_root.wavesign._x = 713 - (68 + (14 * wavelength));
_root.wavesign._y = 42;
wn = 0;
while (wn < wavelength) {
cutwavenumb = String(wave).substr(wn, 1);
if (cutwavenumb == 0) {
cutwavenumb = 10;
}
duplicateMovieClip (_root.number, "wavenumb" + wn, 180 + wn);
_root["wavenumb" + wn]._x = (_root.wavesign._x + 68) + (14 * wn);
_root["wavenumb" + wn]._y = 42;
_root["wavenumb" + wn]._width = 12;
_root["wavenumb" + wn]._height = 10;
_root["wavenumb" + wn].gotoAndStop(cutwavenumb);
wn++;
}
_root.mothership.gotoAndPlay(56);
goplay = 1;
dogetready = 0;
}
if (gameover == 1) {
if (endall == 1) {
Mouse.show();
stopDrag();
goplay = 0;
doshoot = 0;
_root.bullet._y = -20;
_root.entername._y = 134;
_root.mothership.gotoAndPlay(111);
lscount = 1;
i = 0;
while (i <= enemy_numb) {
sc = 0;
while (sc <= 3) {
removeMovieClip((["ufo" + i] + "smallnumber") + sc);
sc++;
}
removeMovieClip(_root["ufo" + i]);
i++;
}
endall = 0;
}
duplicateMovieClip ("explodeblock", "eb" + lscount, lscount);
_root["eb" + lscount]._x = _root.mothership.motherlaser._x + 160;
_root["eb" + lscount]._y = 356;
explodesize = random(12);
setProperty("eb" + lscount, _width , explodesize);
setProperty("eb" + lscount, _height , explodesize);
setProperty("eb" + lscount, _rotation , 180 + random(180));
lscount++;
if (lscount > 100) {
lscount = 1;
}
}
if (goplay == 1) {
if (setpauze > 0) {
shootbusy = 1;
setpauze--;
} else {
if (playsound == 1) {
if (music_ingame1_start == 1) {
_root.music_startlevel.stop();
_root.music_ingame1.start(0, 999);
music_ingame1_start = 0;
}
}
if (showscore == 1) {
shootbusy = 0;
sc = 0;
while (sc < newscorelength) {
removeMovieClip("actualnumber" + sc);
sc++;
}
sc = 0;
while (sc < calcscorelength) {
removeMovieClip("calcnumber" + sc);
sc++;
}
sc = 0;
while (sc < ufonumblength) {
removeMovieClip("ufonumber" + sc);
sc++;
}
_root.xalpha._y = -20;
showscore = 0;
}
ufohit = 0;
}
if (ufohit == 0) {
if (enemy_shot == enemy_numb) {
openhatch = 1;
enemy_numb++;
wave++;
enemy_shot = 0;
setpauze = 200;
ufohit = 1;
goplay = 0;
music_startlevel_start = 1;
}
i = 1;
while (i <= enemy_numb) {
_root["dx" + i] = _root["speed" + i] * Math.cos((_root["angle" + i] * Math.PI) / 180);
_root["dy" + i] = -(_root["speed" + i] * Math.sin((_root["angle" + i] * Math.PI) / 180));
_root["ufo" + i]._x = _root["ufo" + i]._x + _root["dx" + i];
_root["ufo" + i]._y = _root["ufo" + i]._y + _root["dy" + i];
if (_root["ufo" + i]._x > 665) {
_root["ufo" + i]._x = 665;
_root["angle" + i] = 180 - _root["angle" + i];
}
if (_root["ufo" + i]._x < 23) {
_root["ufo" + i]._x = 23;
_root["angle" + i] = 180 - _root["angle" + i];
}
if (_root["ufo" + i]._y < 23) {
_root["ufo" + i]._y = 23;
_root["angle" + i] = -_root["angle" + i];
}
if (_root["ufo" + i]._y > 330) {
_root["ufo" + i]._y = 330;
_root["angle" + i] = -_root["angle" + i];
}
if (_root["angle" + i] >= 360) {
_root["angle" + i] = _root["angle" + i] - 360;
}
if (_root["angle" + i] < 0) {
_root["angle" + i] = _root["angle" + i] + 360;
}
if (_root["ufo" + i].hitTest(_root.bullet)) {
if (playsound == 1) {
_root.sound_killufo.start(0, 1);
}
actualscore = Math.round((323 - _root["ufo" + i]._y) / 3);
newscore = Math.round((323 - _root["ufo" + i]._y) / 3) * i;
score = score + newscore;
scorelength = length(score);
sc = 0;
while (sc < scorelength) {
cutscore = String(score).substr(sc, 1);
if (cutscore == 0) {
cutscore = 10;
}
duplicateMovieClip (_root.number, "number" + sc, 400 + sc);
setProperty("number" + sc, _x , firstnumbx - ((scorelength - sc) * 14));
setProperty("number" + sc, _y , 29);
setProperty("number" + sc, _width , 12);
setProperty("number" + sc, _height , 10);
_root["number" + sc].gotoAndStop(cutscore);
sc++;
}
newscorelength = length(newscore);
sc = 0;
while (sc < newscorelength) {
cutscore = String(newscore).substr(sc, 1);
if (cutscore == 0) {
cutscore = 10;
}
firstsmallnumbx = i * 27;
duplicateMovieClip (_root.number, (["ufo" + i] + "smallnumber") + sc, 420 + ((i * 3) + sc));
setProperty((["ufo" + i] + "smallnumber") + sc, _x , firstsmallnumbx + (sc * 7));
setProperty((["ufo" + i] + "smallnumber") + sc, _y , 40);
_root[(["ufo" + i] + "smallnumber") + sc].gotoAndStop(cutscore);
sc++;
}
duplicateMovieClip (_root.whiteline, whitelineani, 380);
setProperty(whitelineani, _x , Math.floor(_root["ufo" + i]._x - 24));
setProperty(whitelineani, _y , Math.floor(_root["ufo" + i]._y + 14));
newscorelength = length(newscore);
sc = 0;
while (sc < newscorelength) {
duplicateMovieClip (_root.number, "actualnumber" + sc, 520 + sc);
setProperty("actualnumber" + sc, _x , Math.floor(_root["ufo" + i]._x + ((26 / newscorelength) + (14 * sc))));
setProperty("actualnumber" + sc, _y , Math.floor(_root["ufo" + i]._y + 10));
setProperty("actualnumber" + sc, _width , 12);
setProperty("actualnumber" + sc, _height , 10);
cutscore = String(newscore).substr(sc, 1);
if (cutscore == 0) {
cutscore = 10;
}
cutscore = Number(cutscore) + 10;
_root["actualnumber" + sc].gotoAndStop(cutscore);
showscore = 1;
sc++;
}
if (newscore > highestkill) {
highestkill = newscore;
}
calcscorelength = length(actualscore);
sc = 0;
while (sc < calcscorelength) {
duplicateMovieClip (_root.number, "calcnumber" + sc, 540 + sc);
setProperty("calcnumber" + sc, _x , Math.floor(_root["ufo" + i]._x + ((26 / calcscorelength) + (7 * sc))));
setProperty("calcnumber" + sc, _y , Math.floor(_root["ufo" + i]._y + 3));
cutscore = String(actualscore).substr(sc, 1);
if (cutscore == 0) {
cutscore = 10;
}
cutscore = Number(cutscore) + 10;
_root["calcnumber" + sc].gotoAndStop(cutscore);
sc++;
}
_root.xalpha._x = Math.floor(((_root["ufo" + i]._x + (26 / calcscorelength)) + (sc * 7)) + 3);
_root.xalpha._y = Math.floor(_root["ufo" + i]._y + 3);
ufonumblength = length(i);
sc = 0;
while (sc < ufonumblength) {
duplicateMovieClip (_root.number, "ufonumber" + sc, 580 + sc);
setProperty("ufonumber" + sc, _x , _root.xalpha._x + (11 + (sc * 7)));
setProperty("ufonumber" + sc, _y , Math.floor(_root["ufo" + i]._y + 3));
cutscore = String(i).substr(sc, 1);
if (cutscore == 0) {
cutscore = 10;
}
cutscore = Number(cutscore) + 10;
_root["ufonumber" + sc].gotoAndStop(cutscore);
sc++;
}
ufohit = 1;
setpauze = 55;
_root["ufoicon" + i].gotoAndStop(2);
_root.bullet._y = -18;
_root.ufoexplode._x = _root["ufo" + i]._x;
_root.ufoexplode._y = _root["ufo" + i]._y;
_root.ufoexplode.gotoAndPlay(2);
ep = 0;
while (ep <= 14) {
duplicateMovieClip (_root.explodeblock, "eb" + ep, 200 + ep);
setProperty("eb" + ep, _x , _root.ufoexplode._x + 26);
setProperty("eb" + ep, _y , _root.ufoexplode._y + 14);
explodesize = random(18);
setProperty("eb" + ep, _width , explodesize);
setProperty("eb" + ep, _height , explodesize);
setProperty("eb" + ep, _rotation , random(360));
ep++;
}
removeMovieClip(["ufo" + i]);
enemy_shot++;
}
if (_root["ufo" + i].hitTest(_root.player)) {
if (playsound == 1) {
_root.music_ingame1.stop();
_root.sound_die.start(0, 1);
music_ingame1_start = 1;
}
ufohit = 1;
lives--;
if (lives == 0) {
if (playsound == 1) {
music_ingame1_start = 0;
_root.music_gameover.start(0, 100);
}
wn = 0;
while (wn < wavelength) {
removeMovieClip("wavenumb" + wn);
wn++;
}
_root.wavesign._y = -42;
dragy = -100;
startDrag (player, true, 49, dragy, 691, dragy);
goplay = 0;
gameover = 1;
endall = 1;
dogetready = 0;
} else {
_root.livesnumb._y = 160;
if (lives == 2) {
_root.livesnumb.gotoAndPlay(361);
} else if (lives == 1) {
_root.livesnumb.gotoAndPlay(181);
} else {
_root.livesnumb.gotoAndPlay(2);
}
dogetready = 1;
}
setpauze = 200;
ep = 0;
while (ep <= 30) {
duplicateMovieClip (_root.explodeblockplayer, "eb" + ep, 300 + ep);
setProperty("eb" + ep, _x , (_root.player._x + 13) + random(13));
setProperty("eb" + ep, _y , (_root.player._y + 7) + random(7));
explodesize = random(30) + 8;
setProperty("eb" + ep, _width , explodesize);
setProperty("eb" + ep, _height , explodesize);
setProperty("eb" + ep, _rotation , random(180) + 180);
ep++;
}
i = 1;
while (i <= enemy_numb) {
duplicateMovieClip (_root.ufotrail, "ufoexplode" + i, 140 + i);
_root["ufoexplode" + i]._x = _root["ufo" + i]._x;
_root["ufoexplode" + i]._y = _root["ufo" + i]._y;
leftright = random(2);
if (leftright == 1) {
_root["ufo" + i]._x = -50;
} else {
_root["ufo" + i]._x = 800;
}
_root["ufo" + i]._y = random(140);
_root["angle" + i] = random(360);
if ((_root["angle" + i] > 170) or (_root["angle" + i] < 190)) {
_root["angle" + i] = _root["angle" + i] + (random(70) + 20);
}
if ((_root["angle" + i] > 350) or (_root["angle" + i] < 10)) {
_root["angle" + i] = _root["angle" + i] + (random(70) + 20);
}
i++;
}
}
i++;
}
}
}
};
Instance of Symbol 19 MovieClip "bullet" in Frame 1
onClipEvent (mouseDown) {
if ((_root.doshoot == 1) and (_root.shootbusy == 0)) {
this._x = _root.player._x - 3;
this._y = 330;
if (_root.playsound == 1) {
_root.sound_shoot.start(0, 1);
}
_root.shootbusy = 1;
}
}
Symbol 17 MovieClip Frame 1
stop();
Symbol 17 MovieClip Frame 55
_root.createufos = 1;
stop();
Symbol 17 MovieClip Frame 110
stop();
Symbol 17 MovieClip Frame 510
gotoAndPlay (111);
Symbol 24 MovieClip Frame 1
stop();
Symbol 24 MovieClip Frame 2
stop();
Symbol 25 MovieClip Frame 100
stop();
Symbol 26 MovieClip Frame 1
stop();
Symbol 27 MovieClip Frame 40
removeMovieClip(this);
Symbol 28 MovieClip Frame 1
stop();
Symbol 28 MovieClip Frame 2
if (_root.playsound == 1) {
_root.sound_mothershipdown.start(0, 1);
}
Symbol 28 MovieClip Frame 185
_root.introdone = 1;
stop();
Symbol 82 Button
on (press) {
_root.bullet._y = -10;
getURL ("http://www.coin-op.nl", "_blank");
}
Symbol 85 Button
on (release) {
getURL ("http://www.coin-op.nl", "_blank");
}
Symbol 86 MovieClip Frame 1
stop();
Symbol 86 MovieClip Frame 2
stop();
Symbol 87 Button
on (press) {
_root.bullet._y = -10;
if (_root.playsound == 0) {
_root.playsound = 1;
_root.music_intro.start(0, 100);
_root.logo.soundonoffbt.soundonoff.gotoAndStop(1);
} else {
_root.playsound = 0;
_root.music_intro.stop();
_root.logo.soundonoffbt.soundonoff.gotoAndStop(2);
}
}
Symbol 89 MovieClip Frame 1
stop();
Symbol 89 MovieClip Frame 40
this._y = -500;
Symbol 90 MovieClip Frame 1
stop();
Symbol 93 MovieClip Frame 55
removeMovieClip(this);
Symbol 96 MovieClip Frame 85
removeMovieClip(this);
Symbol 141 MovieClip Frame 1
stop();
Symbol 141 MovieClip Frame 200
this._y = -100;
Symbol 142 MovieClip Frame 1
stop();
Symbol 142 MovieClip Frame 200
this._y = -100;
Symbol 143 MovieClip Frame 1
stop();
Symbol 143 MovieClip Frame 180
this._y = -50;
Symbol 143 MovieClip Frame 360
this._y = -50;
Symbol 143 MovieClip Frame 540
this._y = -50;
Symbol 146 MovieClip Frame 30
removeMovieClip(this);
Symbol 154 Button
on (release) {
myVars = new LoadVars();
myVars.player = _root.entername.enternamebox.playername.text;
myVars.score = _root.score;
myVars.highest = _root.highestkill;
myVars.wave = _root.wave;
myVars.sendAndLoad("http://www.coin-op.nl/panic/addscore.php", myVars, "POST");
this._y = -150;
_root.logo._y = -227;
_root.makefresh = 1;
_root.mothership.gotoAndPlay(1);
scorelength = length(_root.score);
sc = 0;
while (sc <= scorelength) {
removeMovieClip(_root["number" + sc]);
sc++;
}
}
Symbol 155 Button
on (release) {
this._y = -150;
_root.logo._y = -227;
_root.makefresh = 1;
_root.mothership.gotoAndPlay(1);
scorelength = length(_root.score);
sc = 0;
while (sc <= scorelength) {
removeMovieClip(_root["number" + sc]);
sc++;
}
}