Frame 2
iBytesTotal = _root.getBytesTotal();
iBytesLoaded = _root.getBytesLoaded();
iBytes = Math.ceil((iBytesLoaded / iBytesTotal) * 100);
_root.txtLoading.text = iBytes + "%";
Frame 3
if (iBytes < 100) {
gotoAndPlay (2);
} else {
gotoAndPlay (4);
}
Frame 5
function NewGame() {
_root.Score = 0;
_root.Lives = 3;
_root.InitialHeight = 0;
_root.InitialSpeed = 21;
_root.RestoreBricks();
z = 1;
while (z <= 4) {
_root["mcHouse" + z]._visible = true;
z++;
}
_root.mcCannon._visible = true;
_root.mcCannon._x = 36;
_root.mcStatusBar.mcLife1._visible = true;
_root.mcStatusBar.mcLife2._visible = true;
_root.mcStatusBar.mcLife3._visible = true;
_root.mcStatusBar._visible = true;
_root.mcStatusBar.txtScore.text = "0";
_root.CreateAliens(_root.InitialHeight);
}
function SaveBricks() {
z = 1;
while (z <= 4) {
zz = 0;
while (zz <= 35) {
_root["aHouse" + z][zz] = _root["mcHouse" + z]["mcBrick" + zz]._x;
zz++;
}
z++;
}
}
function RestoreBricks() {
z = 1;
while (z <= 4) {
zz = 0;
while (zz <= 35) {
_root["mcHouse" + z]["mcBrick" + zz]._x = _root["aHouse" + z][zz];
zz++;
}
z++;
}
}
function CreateAliens(initialheight) {
_root.createEmptyMovieClip("mcInvasion", 1000);
_root.mcInvasion._x = 100;
_root.mcInvasion._y = 50;
_root.InvasionCounter = 0;
_root.MaxInvasionCounter = _root.InitialSpeed;
_root.MonsterMovement = true;
_root.FlagDown = false;
_root.StillFlagDown = false;
_root.Factor = 1;
_root.aCompleteColumns = new Array();
_root.CompleteColumns = 0;
z = 1;
while (z <= 11) {
_root.aCompleteColumns[z] = true;
z++;
}
_root.LeftColumn = 1;
_root.RightColumn = 11;
_root.MinX = 10;
_root.MaxX = 180;
_root.LaserCounter = 1;
_root.AlienShotCounter = 1;
_root.FlagShot = false;
_root.FlagShot2 = false;
_root.FlagAlienShot = false;
_root.FlagGo = true;
_root.SaucerCounter = 0;
_root.FlagSaucer = false;
_root.TotalMonsters = 55;
_root.PomPointer = 1;
z = 1;
while (z <= 11) {
_root.mcInvasion.attachMovie("mcMonster3", "mcMonster" + z, 1000 + z);
_root.mcInvasion["mcMonster" + z]._y = initialheight + 60;
_root.mcInvasion["mcMonster" + z]._x = z * 30;
_root.mcInvasion["mcMonster" + z]._xscale = 80;
_root.mcInvasion["mcMonster" + z]._yscale = 80;
_root.mcInvasion["mcMonster" + z].myscore = 40;
_root.mcInvasion["mcMonster" + z].mycolumn = z;
z++;
}
z = 12;
while (z <= 22) {
_root.mcInvasion.attachMovie("mcMonster1", "mcMonster" + z, 1000 + z);
_root.mcInvasion["mcMonster" + z]._y = initialheight + 90;
_root.mcInvasion["mcMonster" + z]._x = ((z - 10) * 30) - 30;
_root.mcInvasion["mcMonster" + z]._xscale = 80;
_root.mcInvasion["mcMonster" + z]._yscale = 80;
_root.mcInvasion["mcMonster" + z].myscore = 20;
_root.mcInvasion["mcMonster" + z].mycolumn = z - 11;
_root.mcInvasion.attachMovie("mcMonster1", "mcMonster" + (z + 11), 1000 + (z + 11));
_root.mcInvasion["mcMonster" + (z + 11)]._y = initialheight + 120;
_root.mcInvasion["mcMonster" + (z + 11)]._x = ((z - 10) * 30) - 30;
_root.mcInvasion["mcMonster" + (z + 11)]._xscale = 80;
_root.mcInvasion["mcMonster" + (z + 11)]._yscale = 80;
_root.mcInvasion["mcMonster" + (z + 11)].myscore = 20;
_root.mcInvasion["mcMonster" + (z + 11)].mycolumn = z - 11;
z++;
}
z = 34;
while (z <= 44) {
_root.mcInvasion.attachMovie("mcMonster2", "mcMonster" + z, 1000 + z);
_root.mcInvasion["mcMonster" + z]._y = initialheight + 150;
_root.mcInvasion["mcMonster" + z]._x = ((z - 30) * 30) - 90;
_root.mcInvasion["mcMonster" + z]._xscale = 80;
_root.mcInvasion["mcMonster" + z]._yscale = 80;
_root.mcInvasion["mcMonster" + z].myscore = 10;
_root.mcInvasion["mcMonster" + z].mycolumn = z - 33;
_root.mcInvasion.attachMovie("mcMonster2", "mcMonster" + (z + 11), 1000 + (z + 11));
_root.mcInvasion["mcMonster" + (z + 11)]._y = initialheight + 180;
_root.mcInvasion["mcMonster" + (z + 11)]._x = ((z - 30) * 30) - 90;
_root.mcInvasion["mcMonster" + (z + 11)]._xscale = 80;
_root.mcInvasion["mcMonster" + (z + 11)]._yscale = 80;
_root.mcInvasion["mcMonster" + (z + 11)].myscore = 10;
_root.mcInvasion["mcMonster" + (z + 11)].mycolumn = z - 33;
z++;
}
}
function Shot() {
_root.LaserCounter++;
_root.attachMovie("mcShot", "mcShot" + _root.LaserCounter, 50000 + _root.LaserCounter);
_root["mcShot" + _root.LaserCounter]._x = _root.mcCannon._x + 18;
_root["mcShot" + _root.LaserCounter]._y = _root.mcCannon._y - 10;
_root["mcShot" + _root.LaserCounter].onEnterFrame = function () {
if (this._y <= 0) {
_root.FlagShot2 = false;
this.removeMovieClip();
} else {
this._y = this._y - 10;
z = 1;
while (z <= 4) {
if (this.hitTest(_root["mcHouse" + z])) {
zz = 35;
while (zz >= 0) {
if (this.hitTest(_root["mcHouse" + z]["mcBrick" + zz])) {
_root["mcHouse" + z]["mcBrick" + zz]._x = 10000;
_root.FlagShot2 = false;
this.removeMovieClip();
}
zz--;
}
}
z++;
}
z = 1;
while (z <= 55) {
if (this.hitTest(_root.mcInvasion["mcMonster" + z])) {
_root.Score = _root.Score + _root.mcInvasion["mcMonster" + z].myscore;
_root.mcStatusBar.txtScore.text = _root.Score;
_root.DestroySound();
_root.mcAlienExplosion._x = _root.mcInvasion._x + _root.mcInvasion["mcMonster" + z]._x;
_root.mcAlienExplosion._y = _root.mcInvasion._y + _root.mcInvasion["mcMonster" + z]._y;
flagcolumn = false;
column = _root.mcInvasion["mcMonster" + z].mycolumn;
_root.mcInvasion["mcMonster" + z].removeMovieClip();
zz = 1;
while (zz <= 5) {
if (_root.mcInvasion["mcMonster" + (((zz - 1) * 11) + column)] != undefined) {
flagcolumn = true;
}
zz++;
}
if (FlagColumnControl == true) {
if (flagcolumn == false) {
_root.aCompleteColumns[column] = false;
_root.CompleteColumns++;
if (_root.CompleteColumns <= 11) {
zz = 1;
while (zz <= 11) {
if (_root.aCompleteColumns[zz] == true) {
_root.LeftColumn = zz;
_root.MinX = 10 - ((zz - 1) * 30);
zz = 11;
}
zz++;
}
zz = 11;
while (zz >= 1) {
if (_root.aCompleteColumns[zz] == true) {
_root.RightColumn = zz;
_root.MaxX = 180 + ((11 - zz) * 30);
zz = 0;
}
zz--;
}
}
}
}
_root.FlagShot2 = false;
this.removeMovieClip();
_root.mcAlienExplosion.gotoAndPlay("in");
_root.TotalMonsters--;
if (_root.TotalMonsters == 0) {
_root.NextPhase();
}
}
z++;
}
if (_root.FlagSaucer == true) {
if (this.hitTest(_root.mcSaucer)) {
_root.Score = _root.Score + parseInt(_root.mcSaucerExplosion.txtMyScore.text);
_root.mcStatusBar.txtScore.text = _root.Score;
_root.sndSaucer.stop();
_root.SaucerDestroySound();
_root.mcSaucerExplosion._x = _root.mcSaucer._x;
_root.mcSaucerExplosion._y = _root.mcSaucer._y;
_root.mcSaucer.removeMovieClip();
_root.FlagShot2 = false;
this.removeMovieClip();
_root.mcSaucerExplosion.gotoAndPlay("in");
}
}
}
};
_root.ShotSound();
}
function AlienShot() {
_root.AlienShotCounter++;
RandomShot = Math.floor(Math.random() * 2);
if (RandomShot == 0) {
_root.attachMovie("mcAlienShot", "mcAlienShot" + _root.AlienShotCounter, 100000 + _root.AlienShotCounter);
} else {
_root.attachMovie("mcAlienShot2", "mcAlienShot" + _root.AlienShotCounter, 100000 + _root.AlienShotCounter);
}
RandomAlien = Math.floor(Math.random() * 55);
if (_root.mcInvasion["mcMonster" + RandomAlien] != undefined) {
_root["mcAlienShot" + _root.AlienShotCounter]._y = _root.mcInvasion._y + _root.mcInvasion["mcMonster" + RandomAlien]._y;
_root["mcAlienShot" + _root.AlienShotCounter]._x = _root.mcInvasion._x + _root.mcInvasion["mcMonster" + RandomAlien]._x;
z = -1;
_root.FlagAlienShot = true;
} else {
z = 55;
while (z >= 0) {
if (_root.mcInvasion["mcMonster" + z] != undefined) {
_root["mcAlienShot" + _root.AlienShotCounter]._y = _root.mcInvasion._y + _root.mcInvasion["mcMonster" + z]._y;
_root["mcAlienShot" + _root.AlienShotCounter]._x = _root.mcInvasion._x + _root.mcInvasion["mcMonster" + z]._x;
z = -1;
_root.FlagAlienShot = true;
}
z--;
}
}
_root["mcAlienShot" + _root.AlienShotCounter].onEnterFrame = function () {
if (this._y < 435) {
this._y = this._y + 5;
z = 1;
while (z <= 4) {
if (this.hitTest(_root["mcHouse" + z])) {
zz = 35;
while (zz >= 0) {
if (this.hitTest(_root["mcHouse" + z]["mcBrick" + zz])) {
_root["mcHouse" + z]["mcBrick" + zz]._x = 10000;
_root.FlagAlienShot = false;
this.removeMovieClip();
}
zz--;
}
}
z++;
}
if (this.hitTest(_root.mcCannon)) {
this.removeMovieClip();
_root.FlagAlienShot = false;
_root.mcExplosion._x = _root.mcCannon._x;
_root.mcExplosion._y = _root.mcCannon._y - 8;
_root.mcCannon._x = 10000;
_root.mcExplosion.gotoAndPlay("in");
_root.mcStatusBar["mcLife" + _root.Lives]._visible = false;
_root.Lives--;
_root.FlagGo = false;
}
} else {
this.removeMovieClip();
_root.FlagAlienShot = false;
}
};
}
function NextPhase() {
_root.FlagGo = false;
if (_root.InitialHeight < 50) {
_root.InitialSpeed = _root.InitialSpeed - 2;
_root.InitialHeight = _root.InitialHeight + 10;
} else {
_root.InitialSpeed = _root.InitialSpeed - 2;
}
_root.CreateAliens(_root.InitialHeight);
}
function NewCannon() {
if (_root.Lives > 0) {
_root.mcCannon._x = 36;
} else {
_root.GameOver();
}
}
function GameOver(reason) {
_root.FlagGo = false;
_root.mcInvasion.removeMovieClip();
_root.mcCannon._visible = false;
_root.RestoreBricks();
z = 1;
while (z <= 4) {
_root["mcHouse" + z]._visible = false;
z++;
}
_root.mcStatusBar._visible = false;
_root.mcGameOver._visible = true;
_root.mcGameOver.gotoAndPlay("in");
if (_root.Score > _root.HiScore) {
_root.HiScore = _root.Score;
_root.mcStatusBar.txtHiScore.text = _root.HiScore;
}
}
function ShotSound() {
sndShot = new Sound(mcShotSound);
sndShot.attachSound("shot");
_root.sndShot.setVolume(100);
sndShot.start();
}
function DestroySound() {
sndDestroy = new Sound(mcDestroySound);
sndDestroy.attachSound("destroy");
_root.sndDestroy.setVolume(100);
sndDestroy.start();
}
function SaucerDestroySound() {
sndSaucerDestroy = new Sound(mcSaucerDestroySound);
sndSaucerDestroy.attachSound("saucerdestroy");
_root.sndSaucerDestroy.setVolume(100);
sndSaucerDestroy.start();
}
function SaucerSound() {
sndSaucer = new Sound(mcSaucerSound);
sndSaucer.attachSound("saucer");
_root.sndDestroy.setVolume(100);
sndSaucer.start();
sndSaucer.onSoundComplete = function () {
sndSaucer.start(0.2, 999);
};
}
function Pom1Sound() {
sndPom1 = new Sound(mcPom1);
sndPom1.attachSound("pom1");
_root.sndPom1.setVolume(100);
sndPom1.start();
}
function Pom2Sound() {
sndPom2 = new Sound(mcPom2);
sndPom2.attachSound("pom2");
_root.sndPom2.setVolume(100);
sndPom2.start();
}
function Pom3Sound() {
sndPom3 = new Sound(mcPom3);
sndPom3.attachSound("pom3");
_root.sndPom3.setVolume(100);
sndPom3.start();
}
function Pom4Sound() {
sndPom4 = new Sound(mcPom4);
sndPom4.attachSound("pom4");
_root.sndPom4.setVolume(100);
sndPom4.start();
}
FlagColumnControl = true;
_root.aHouse1 = new Array();
_root.aHouse2 = new Array();
_root.aHouse3 = new Array();
_root.aHouse4 = new Array();
_root.MainTitle._visible = true;
_root.attachMovie("mcBottomBar", "mcBottomBar", 500000);
_root.mcBottomBar._x = 275;
_root.mcBottomBar._y = 405;
_root.SaveBricks();
_root.HiScore = 0;
stop();
_root.createEmptyMovieClip("mcControl", 50000);
_root.mcControl.onEnterFrame = function () {
if (_root.FlagGo == true) {
_root.InvasionCounter++;
if (_root.FlagSaucer == false) {
_root.SaucerCounter++;
}
if ((_root.SaucerCounter == 300) and (_root.FlagSaucer == false)) {
gosaucer = Math.floor(Math.random() * 5);
if (gosaucer == 3) {
_root.FlagSaucer = true;
saucerdirection = Math.floor(Math.random() * 2);
saucerscore = (Math.floor(Math.random() * 4) + 1) * 100;
_root.mcSaucerExplosion.txtMyScore.text = saucerscore;
_root.attachMovie("mcSaucer", "mcSaucer", 300000);
_root.SaucerSound();
_root.mcSaucer._y = 70;
if (saucerdirection == 1) {
_root.mcSaucer._x = -10;
_root.mcSaucer.onEnterFrame = function () {
this._x = this._x + 4;
if (this._x >= 560) {
_root.SaucerCounter = 0;
_root.FlagSaucer = false;
_root.sndSaucer.stop();
this.removeMovieClip();
}
};
} else {
_root.mcSaucer._x = 560;
_root.mcSaucer.onEnterFrame = function () {
this._x = this._x - 4;
if (this._x <= -10) {
_root.SaucerCounter = 0;
_root.FlagSaucer = false;
_root.sndSaucer.stop();
this.removeMovieClip();
}
};
}
} else {
_root.SaucerCounter = 0;
_root.FlagSaucer = false;
}
}
if (_root.FlagAlienShot == false) {
ShotAlien = Math.floor(Math.random() * 50);
if (ShotAlien == 35) {
_root.AlienShot();
}
}
if (_root.InvasionCounter == _root.MaxInvasionCounter) {
if (_root.PomPointer < 4) {
_root.PomPointer++;
} else {
_root.PomPointer = 1;
}
_root[("Pom" + _root.PomPointer) + "Sound"]();
if (_root.FlagStillDown == false) {
if (_root.mcInvasion._x >= _root.MaxX) {
_root.mcInvasion._y = _root.mcInvasion._y + 5;
_root.Factor = -1;
_root.FlagDown = true;
if (_root.MaxInvasionCounter > 5) {
_root.MaxInvasionCounter = _root.MaxInvasionCounter - 2;
}
}
if (_root.mcInvasion._x <= _root.MinX) {
_root.mcInvasion._y = _root.mcInvasion._y + 5;
_root.Factor = 1;
_root.FlagDown = true;
if (_root.MaxInvasionCounter > 1) {
_root.MaxInvasionCounter = _root.MaxInvasionCounter - 2;
}
}
} else {
_root.FlagStillDown = false;
}
if (_root.FlagDown == false) {
if (_root.MonsterMovement == true) {
z = 1;
while (z <= 55) {
_root.mcInvasion["mcMonster" + z].gotoAndStop(2);
z++;
}
_root.MonsterMovement = false;
} else {
z = 1;
while (z <= 55) {
_root.mcInvasion["mcMonster" + z].gotoAndStop(1);
z++;
}
_root.MonsterMovement = true;
}
_root.mcInvasion._x = _root.mcInvasion._x + (5 * _root.Factor);
} else {
_root.FlagDown = false;
_root.FlagStillDown = true;
}
_root.InvasionCounter = 0;
}
}
};
Instance of Symbol 45 MovieClip "mcEarth" in Frame 5
onClipEvent (enterFrame) {
z = 55;
while (z >= 0) {
if (this.hitTest(_root.mcInvasion["mcMonster" + z])) {
_root.GameOver("invasion");
}
z--;
}
}
Instance of Symbol 65 MovieClip "mcCannon" in Frame 5
onClipEvent (enterFrame) {
if (_root.FlagGo == true) {
if (Key.isDown(37)) {
if (this._x > 22) {
this._x = this._x - 5;
}
}
if (Key.isDown(39)) {
if (this._x < 492) {
this._x = this._x + 5;
}
}
if (Key.isDown(32)) {
if ((((_root["mcShot" + (_root.LaserCounter - 1)]._y <= (_root.mcCannon._y - 100)) or (_root["mcShot" + (_root.LaserCounter - 1)] == undefined)) and (_root.FlagShot == false)) and (_root.FlagShot2 == false)) {
_root.FlagShot = true;
_root.FlagShot2 = true;
_root.mcDelayer.gotoAndPlay("in");
_root.Shot();
}
}
}
}
Symbol 11 MovieClip [mcMonster1] Frame 1
stop();
Symbol 11 MovieClip [mcMonster1] Frame 2
stop();
Symbol 14 MovieClip [mcMonster3] Frame 1
stop();
Symbol 14 MovieClip [mcMonster3] Frame 2
stop();
Symbol 17 MovieClip [mcMonster2] Frame 1
stop();
Symbol 17 MovieClip [mcMonster2] Frame 2
stop();
Symbol 31 Button
on (release) {
getURL ("http://www.lostjungle.com");
}
Symbol 32 Button
on (release) {
getURL ("http://www.lostjungle.com/add.php?game=asciiinvaders");
}
Symbol 57 Button
on (release) {
this.gotoAndStop("stopped");
_root.NewGame();
}
Symbol 58 Button
on (release) {
_root.mcGameOver._visible = false;
_root.mcMainTitle._visible = true;
}
Symbol 59 MovieClip Frame 1
stop();
Symbol 59 MovieClip Frame 2
play();
Symbol 59 MovieClip Frame 121
stop();
Symbol 74 Button
on (release) {
_root.mcMainTitle._visible = false;
_root.NewGame();
}
Symbol 75 Button
on (release) {
getURL ("http://www.lostjungle.com/yankleber/");
}
Symbol 78 MovieClip Frame 1
play();
Symbol 78 MovieClip Frame 8
_root.FlagShot = false;
stop();
Symbol 80 MovieClip Frame 1
stop();
Symbol 80 MovieClip Frame 2
play();
Symbol 85 MovieClip Frame 1
stop();
Symbol 85 MovieClip Frame 2
play();
Symbol 85 MovieClip Frame 25
_root.FlagGo = true;
_root.NewCannon();
stop();
Symbol 87 MovieClip Frame 1
play();
Symbol 87 MovieClip Frame 15
_root.FlagSaucer = false;
_root.SaucerCounter = 0;
stop();