Frame 2
if (getBytesLoaded() >= getBytesTotal()) {
gotoAndStop (4);
stop();
}
Frame 3
gotoAndPlay (2);
Symbol 54 MovieClip [Expl] Frame 21
this.removeMovieClip();
this.unloadMovie();
Symbol 70 MovieClip [expl3] Frame 7
this.removeMovieClip();
this.unloadMovie();
Symbol 164 MovieClip [expl2] Frame 46
this.removeMovieClip();
this.unloadMovie();
Symbol 205 MovieClip [expl4] Frame 20
this.removeMovieClip();
this.unloadMovie();
Symbol 206 MovieClip [bigBoom] Frame 71
this._parent.removeMovieClip();
this._parent.unloadMovie();
Symbol 335 MovieClip [myWpn2] Frame 2
stop();
Symbol 358 MovieClip [myWpn3] Frame 2
stop();
Symbol 361 MovieClip [myWpn1] Frame 2
stop();
Symbol 399 MovieClip [myWpn5] Frame 2
stop();
Symbol 404 MovieClip Frame 1
gotoAndPlay (1);
Symbol 870 MovieClip [__Packages.Me] Frame 0
class Me extends MovieClip
{
var arrWeapons, gotoAndStop, minX, minY, maxX, _width, maxY, _height, _parent, hp, mc_HitRect, xSpeed, ySpeed, curWeapon, _x, expl, _y, onEnterFrame, _visible, mc_AddEngine, idsi_Speed;
function Me () {
super();
arrWeapons = new Array();
gotoAndStop(3);
minX = 0;
minY = 0;
maxX = 500 - _width;
maxY = 480 - (_height / 2);
_parent.setHP(hp);
}
function setInvulnerable(val) {
invulnerable = val;
}
function resetWeapons() {
var _local2 = 0;
while (_local2 < arrWeapons.length) {
arrWeapons[_local2].delete_();
delete arrWeapons[_local2];
_local2++;
}
delete arrWeapons;
arrWeapons = new Array();
addWeapon();
addWeapon();
addWeapon();
addWeapon();
setCurWeapon(0);
}
function getWeapons() {
return(arrWeapons);
}
function getHitRect() {
return(mc_HitRect);
}
function onLoad() {
}
function getUpgradeBonuses() {
var _local2 = upgradeBonuses;
upgradeBonuses = 0;
return(_local2);
}
function addWeapon() {
var _local2 = new MyWeapon(arrWeapons.length + 1, this, _parent);
if (_local2 != undefined) {
arrWeapons.push(_local2);
}
}
function getHp() {
return(hp);
}
function changeXSpeed(a) {
if ((xSpeed + a) < (-maxSpeed)) {
xSpeed = -maxSpeed;
} else if ((xSpeed + a) > maxSpeed) {
xSpeed = maxSpeed;
} else if (((xSpeed / (xSpeed + a)) < 0) and (xSpeed != 0)) {
xSpeed = 0;
} else {
xSpeed = xSpeed + a;
}
}
function changeYSpeed(a) {
if ((ySpeed + a) < (-maxSpeed)) {
ySpeed = -maxSpeed;
} else if ((ySpeed + a) > maxSpeed) {
ySpeed = maxSpeed;
} else if (((ySpeed / (ySpeed + a)) < 0) and (ySpeed != 0)) {
ySpeed = 0;
} else {
ySpeed = ySpeed + a;
}
}
function setCurWeapon(val) {
if (val <= (arrWeapons.length - 1)) {
curWeapon = val;
}
_parent.setCurWeapon(val + 1);
}
function checkMove() {
if ((Key.isDown(32) || (Key.isDown(16))) || (Key.isDown(17))) {
arrWeapons[curWeapon].shot();
}
if (Key.isDown(39)) {
changeXSpeed(a_);
if (((_x + xSpeed) > minX) and ((_x + xSpeed) < maxX)) {
_x = _x + xSpeed;
expl._x = expl._x + xSpeed;
} else {
if ((_x + xSpeed) < minX) {
var _local3 = _x - minX;
_x = _x - _local3;
expl._x = expl._x - xSpeed;
} else if ((_x + xSpeed) > maxX) {
var _local3 = maxX - _x;
_x = _x + _local3;
expl._x = expl._x + xSpeed;
}
xSpeed = 0;
}
} else if (Key.isDown(37)) {
changeXSpeed(-a_);
if (((_x + xSpeed) > minX) and ((_x + xSpeed) < maxX)) {
_x = _x + xSpeed;
expl._x = expl._x + xSpeed;
} else {
if ((_x + xSpeed) < minX) {
var _local3 = _x - minX;
_x = _x - _local3;
expl._x = expl._x - xSpeed;
} else if ((_x + xSpeed) > maxX) {
var _local3 = maxX - _x;
_x = _x + _local3;
expl._x = expl._x + xSpeed;
}
xSpeed = 0;
}
} else if (Math.abs(xSpeed) > 0) {
if (((_x + xSpeed) > minX) and ((_x + xSpeed) < maxX)) {
changeXSpeed(a_ * ((-xSpeed) / Math.abs(xSpeed)));
_x = _x + xSpeed;
expl._x = expl._x + xSpeed;
} else {
if ((_x + xSpeed) < minX) {
var _local3 = _x - minX;
_x = _x - _local3;
expl._x = expl._x - xSpeed;
} else if ((_x + xSpeed) > maxX) {
var _local3 = maxX - _x;
_x = _x + _local3;
expl._x = expl._x + xSpeed;
}
xSpeed = 0;
}
}
if (Key.isDown(40)) {
changeYSpeed(a_);
if (((_y + ySpeed) > minY) and ((_y + ySpeed) < maxY)) {
_y = _y + ySpeed;
expl._y = expl._y + ySpeed;
} else {
if ((_y + ySpeed) < minY) {
var _local2 = _y - minY;
_y = _y - _local2;
expl._y = expl._y - ySpeed;
} else if ((_y + ySpeed) > maxY) {
var _local2 = maxY - _y;
_y = _y + _local2;
expl._y = expl._y + ySpeed;
}
ySpeed = 0;
}
} else if (Key.isDown(38)) {
changeYSpeed(-a_);
if (((_y + ySpeed) > minY) and ((_y + ySpeed) < maxY)) {
_y = _y + ySpeed;
expl._y = expl._y + ySpeed;
} else {
if ((_y + ySpeed) < minY) {
var _local2 = _y - minY;
_y = _y - _local2;
expl._y = expl._y - ySpeed;
} else if ((_y + ySpeed) > maxY) {
var _local2 = maxY - _y;
_y = _y + _local2;
expl._y = expl._y + ySpeed;
}
ySpeed = 0;
}
} else if (Math.abs(ySpeed) > 0) {
if (((_y + ySpeed) > minY) and ((_y + ySpeed) < maxY)) {
changeYSpeed(a_ * ((-ySpeed) / Math.abs(ySpeed)));
_y = _y + ySpeed;
expl._y = expl._y + ySpeed;
} else {
if ((_y + ySpeed) < minY) {
var _local2 = _y - minY;
_y = _y - _local2;
expl._y = expl._y - ySpeed;
} else if ((_y + ySpeed) > maxY) {
var _local2 = maxY - _y;
_y = _y + _local2;
expl._y = expl._y + ySpeed;
}
ySpeed = 0;
}
}
checkPosition();
}
function checkPosition(str) {
currentPos = Math.round((10 * xSpeed) / maxSpeed);
if (currentPos == 0) {
gotoAndStop(4);
} else if ((currentPos > 0) and (currentPos <= 3)) {
gotoAndStop(5);
} else if ((currentPos > 3) and (currentPos <= 7)) {
gotoAndStop(6);
} else if ((currentPos > 7) and (currentPos <= 10)) {
gotoAndStop(7);
} else if ((currentPos < 0) and (currentPos >= -3)) {
gotoAndStop(3);
} else if ((currentPos < -3) and (currentPos >= -7)) {
gotoAndStop(2);
} else if ((currentPos < -7) and (currentPos >= -10)) {
gotoAndStop(1);
}
}
function strike() {
if (!invulnerable) {
setWeaponBack();
hp--;
_parent.redBlink();
_parent.setHP(hp);
if (hp == 0) {
explode();
}
}
}
function explode() {
delete onEnterFrame;
_parent.endGame();
expl._visible = true;
expl.play();
_visible = false;
}
function getBonus(bonusType) {
if (bonusType == 1) {
upgradeBonuses = upgradeBonuses + 1;
} else if (bonusType == 2) {
mc_AddEngine._visible = true;
maxSpeed = 15;
a_ = startA * 3;
clearInterval(idsi_Speed);
idsi_Speed = setInterval(this, "resetSpeed", 10000);
} else if (bonusType == 3) {
if ((hp + 1) <= 10) {
hp++;
_parent.setHP(hp);
}
} else if (bonusType == 4) {
setWeaponForward();
}
}
function addScore(val) {
score = score + val;
if ((score % 1000) == 0) {
upgradeBonuses++;
}
}
function resetSpeed() {
mc_AddEngine._visible = false;
maxSpeed = startMaxSpeed;
a_ = startA;
}
function resetParam() {
resetWeapons();
mc_AddEngine._visible = false;
onEnterFrame = function () {
this.checkMove();
this._parent.showScore(this.score);
};
if (expl != undefined) {
expl.removeMovieClip();
}
expl = _parent.attachMovie("Expl", "ship_expl", _parent.getNextDeepestDepth());
expl._width = _width * 2;
expl._yscale = expl._xscale;
expl._x = (_x + (_width / 2)) - (expl._width / 2);
expl._y = (_y + (_height / 2)) - (expl._height / 2);
expl._visible = false;
expl.stop();
xSpeed = 0;
ySpeed = 0;
a_ = startA;
maxSpeed = startMaxSpeed;
hp = startHp;
_parent.setHP(hp);
score = 0;
_parent.setScore(score);
}
function setWeaponBack() {
if (curWeapon > 0) {
setCurWeapon(curWeapon - 1);
}
}
function setWeaponForward() {
if (curWeapon < 3) {
setCurWeapon(curWeapon + 1);
}
}
var currentPos = 0;
var maxCurPos = 6;
var startMaxSpeed = 10;
var maxSpeed = Me.prototype.startMaxSpeed;
var startA = 1;
var a_ = Me.prototype.startA;
var score = 0;
var startHp = 10;
var upgradeBonuses = 0;
var invulnerable = false;
}
Symbol 871 MovieClip [__Packages.MyWeapon] Frame 0
class MyWeapon
{
var container, owner, wpnObject, reloadTime, damage;
function MyWeapon (wpnType, owner, container) {
this.container = container;
this.owner = owner;
wpnObject = new Object();
if (wpnType == 1) {
wpnObject = wpn1;
} else if (wpnType == 2) {
wpnObject = wpn2;
} else if (wpnType == 3) {
wpnObject = wpn3;
} else if (wpnType == 4) {
wpnObject = wpn4;
}
if (wpnObject.mc == undefined) {
this=undefined;//parameter overwritten
} else {
reloadTime = wpnObject.baseReloadTime;
damage = wpnObject.damage;
}
}
function improveDamage() {
damage = damage + (wpnObject.damage / 4);
}
function improveReloadTime() {
reloadTime = reloadTime - (reloadTime * 0.05);
}
function shot() {
if ((getTimer() - lastShot) > reloadTime) {
if (wpnObject.targetingType == 0) {
shot0();
} else if (wpnObject.targetingType == 1) {
shot1();
} else if (wpnObject.targetingType == 2) {
shot2();
} else if (wpnObject.targetingType == 3) {
shot3();
} else if (wpnObject.targetingType == 4) {
shot4();
}
}
}
function shot3() {
lastShot = getTimer();
var _local8 = owner._x + (owner._width / 2);
var _local7 = owner._y + (owner._height / 8);
var _local5 = new MyMissile(owner, container, damage, wpnObject.mc, wpnObject.deathMc, _local8, _local7);
var ths = this;
_local5.deathAction = function () {
var _local5 = new MyMissile(ths.owner, ths.container, ths.damage, ths.wpnObject.mc, ths.wpnObject.deathMc, this.mc._x, this.mc._y);
_local5.setSpeedX(0);
_local5.setSpeedY(-this.wpnObject.moveSpeed);
var _local3 = new MyMissile(ths.owner, ths.container, ths.damage, ths.wpnObject.mc, ths.wpnObject.deathMc, this.mc._x, this.mc._y);
_local3.setSpeedX(this.wpnObject.moveSpeed);
_local3.setSpeedY(0);
var _local2 = new MyMissile(ths.owner, ths.container, ths.damage, ths.wpnObject.mc, ths.wpnObject.deathMc, this.mc._x, this.mc._y);
_local2.setSpeedX(-this.wpnObject.moveSpeed);
_local2.setSpeedY(0);
var _local4 = new MyMissile(ths.owner, ths.container, ths.damage, ths.wpnObject.mc, ths.wpnObject.deathMc, this.mc._x, this.mc._y);
_local4.setSpeedX(0);
_local4.setSpeedY(this.wpnObject.moveSpeed);
};
_local5.setSpeedY(-10);
}
function shot2() {
lastShot = getTimer();
var _local4 = owner._x + (owner._width / 2);
var _local3 = owner._y + (owner._height / 8);
var _local2 = new MyMissile(owner, container, damage, wpnObject.mc, wpnObject.deathMc, _local4, _local3);
_local2.setSpeedY(-wpnObject.moveSpeed);
_local2.setTargetingType(1, container.getNearestEnemy());
}
function shot0() {
lastShot = getTimer();
var _local3 = owner._x + (owner._width / 2);
var _local2 = owner._y + (owner._height / 8);
var _local4 = new MyMissile(owner, container, damage, wpnObject.mc, wpnObject.deathMc, _local3, _local2);
_local4.setSpeedY(-wpnObject.moveSpeed);
}
function shot4() {
lastShot = getTimer();
var _local4 = owner._x + (owner._width / 2);
var _local3 = owner._y + (owner._height / 8);
var _local2 = new MyMissile(owner, container, damage, wpnObject.mc, wpnObject.deathMc, _local4, _local3);
_local2.setPlatform(owner);
_local2.setUnbreakable();
}
function shot1() {
lastShot = getTimer();
var _local3 = owner._x + (owner._width / 2);
var _local2 = owner._y + (owner._height / 8);
var _local4 = new MyMissile(owner, container, damage, wpnObject.mc, wpnObject.deathMc, _local3, _local2);
_local4.setSpeedX(wpnObject.moveSpeed / 3);
_local4.setSpeedY(-wpnObject.moveSpeed);
_local4 = new MyMissile(owner, container, damage, wpnObject.mc, wpnObject.deathMc, _local3, _local2);
_local4.setSpeedX(0);
_local4.setSpeedY(-wpnObject.moveSpeed);
_local4 = new MyMissile(owner, container, damage, wpnObject.mc, wpnObject.deathMc, _local3, _local2);
_local4.setSpeedX((-wpnObject.moveSpeed) / 3);
_local4.setSpeedY(-wpnObject.moveSpeed);
}
function delete_() {
}
var wpn1 = {mc:"myWpn1", deathMc:"expl3", damage:0.3, baseReloadTime:300, targetingType:0, moveSpeed:25};
var wpn2 = {mc:"myWpn5", deathMc:"expl2", damage:2, baseReloadTime:1000, targetingType:0, moveSpeed:10};
var wpn3 = {mc:"myWpn3", deathMc:"expl4", damage:1, baseReloadTime:1000, targetingType:2, moveSpeed:20};
var wpn4 = {mc:"myWpn2", deathMc:"expl3", damage:0.5, baseReloadTime:400, targetingType:1, moveSpeed:20};
var lastShot = 0;
}
Symbol 872 MovieClip [__Packages.MyMissile] Frame 0
class MyMissile extends MovieClip
{
var owner, container, damage, mcString, mcDestrString, mc, target_, speed, mc_platform, deathAction, mcDestr;
function MyMissile (owner, container, damage, mc, mcDestrString, x_, y_) {
super();
this.owner = owner;
this.container = container;
this.damage = damage;
mcString = mc;
this.mcDestrString = mcDestrString;
var _local3 = this.container.getNextDeepestDepth();
this.mc = this.container.attachMovie(mcString, "myMissile" + String(_local3), _local3);
if (this.mcDestrString != "") {
this.mc._x = x_ - (this.mc._width / 2);
this.mc._y = y_ - (this.mc._height / 2);
} else {
this.mc._x = x_;
this.mc._y = y_;
}
move1();
}
function setUnbreakable() {
unbreakable = true;
}
function setSpeedX(val) {
speedX = val;
}
function setSpeedY(val) {
speedY = val;
}
function setTargetingType(targetingType, target) {
if (((target != undefined) && (target != null)) && (target != NaN)) {
target_ = target;
this.targetingType = targetingType;
speed = Math.sqrt((speedX * speedX) + (speedY * speedY));
}
}
function move1() {
var ths = this;
mc.onEnterFrame = function () {
ths.doMove();
if (ths.mc.mc_Lightning == undefined) {
return(undefined);
}
if (ths.mc.mc_Lightning._currentframe == ths.mc.mc_Lightning._totalframes) {
ths.deleteThis();
}
};
}
function doMove() {
if (targetingType > 0) {
if (((target_._x != undefined) && (target_._x != null)) && (target_._x != NaN)) {
targeting();
}
}
if ((speedY != 0) || (speedX != 0)) {
mc._y = mc._y + speedY;
mc._x = mc._x + speedX;
var _local3 = mc._x;
var _local2 = mc._y;
var _local5 = conWidth;
var _local4 = conHeight;
if ((((_local2 > (_local4 + 100)) || (_local2 < ((-mc._height) - 100))) || (_local3 > (_local5 + 100))) || (_local3 < ((-mc._width) - 100))) {
deleteThis();
}
}
if (hasPlatform) {
mc._x = mc_platform._x + (mc_platform._width / 2);
mc._y = mc_platform._y + (mc_platform._height / 4);
}
checkCounter++;
if ((checkCounter % 4) == 0) {
if (container.checkHit(mc, damage)) {
if (!unbreakable) {
delete mc.onEnterFrame;
explode();
}
}
}
}
function setPlatform(mc_platform) {
hasPlatform = true;
this.mc_platform = mc_platform;
}
function targeting() {
var _local2 = Math.atan(Math.abs(speedX / speedY));
var _local7 = mc._x;
var _local5 = mc._y;
var _local6 = target_._x + (target_._width / 2);
var _local4 = target_._y + (target_._height / 2);
var _local3 = Math.atan(Math.abs((_local6 - _local7) / (_local4 - _local5)));
if (_local5 < _local4) {
_local3 = _local3 + (3.14 - (2 * _local3));
}
if (_local7 > _local6) {
_local3 = -_local3;
}
if (speedY > 0) {
_local2 = _local2 + (3.14 - (2 * _local2));
}
if (speedX < 0) {
_local2 = -_local2;
}
_local2 = changeAngle(_local2, _local3, 0.1);
speedX = speed * Math.sin(_local2);
speedY = (-speed) * Math.cos(_local2);
mc._rotation = (_local2 * 180) / 3.14;
}
function changeAngle(a1, a2, delta_) {
var _local3 = 1;
if (Math.abs(a2 - a1) < delta_) {
a1 = a2;
} else {
if (Math.abs(a1 - a2) > 3.14) {
_local3 = -1;
}
if (a2 > a1) {
a1 = a1 + (delta_ * _local3);
} else if (a2 < a1) {
a1 = a1 - (delta_ * _local3);
}
}
return(a1);
}
function deleteThis() {
delete mc.onEnterFrame;
mc.removeMovieClip();
}
function explode() {
deathAction();
var _local2 = container.getNextDeepestDepth();
mcDestr = container.attachMovie(mcDestrString, "expl" + String(_local2), _local2);
mcDestr._height = 100;
mcDestr._xscale = mcDestr._yscale;
mcDestr._x = mc._x + ((mc._width - mcDestr._width) / 2);
mcDestr._y = mc._y + ((mc._height - mcDestr._height) / 2);
mcDestr._rotation = mc._rotation;
mc.removeMovieClip();
trace("trace removed mc = " + mc.name);
}
var speedX = 0;
var speedY = 0;
var targetingType = 0;
var unbreakable = false;
var conWidth = 500;
var conHeight = 550;
var hasPlatform = false;
var checkCounter = 0;
}
Symbol 873 MovieClip [__Packages.WarField] Frame 0
class WarField extends MovieClip
{
var mc_Interface, mc_EndLevel, arr_Enemys, lastGroupAppearsIn, createEmptyMovieClip, mc_Health, mc_Transition, curBoss, mc_Me, lvl, _parent, maxGroups, speed, arr_PosibleEnemys, startTime, onEnterFrame, tf_Score, mc_redBlink;
function WarField () {
super();
mc_Interface.btnMoreGames.onRelease = function () {
_root.getURL("http://www.game-zoid.com/?from=Starship2swf", "_blank");
};
mc_EndLevel._visible = false;
var ths = this;
mc_EndLevel.onMouseDown = function () {
if (this._visible) {
ths.showTransition();
}
this._visible = false;
};
arr_Enemys = new Array();
lastGroupAppearsIn = getTimer();
mc_Interface.btnMenu.onRelease = function () {
this._parent._parent.menu_();
};
var _local4 = createEmptyMovieClip("forInterface", 10000);
var _local6 = createEmptyMovieClip("forHelth", 10001);
var _local5 = createEmptyMovieClip("forTransition", 10002);
mc_Interface.swapDepths(_local4);
mc_Health.swapDepths(_local6);
mc_Transition.swapDepths(_local5);
_local4.removeMovieClip();
_local6.removeMovieClip();
_local5.removeMovieClip();
mc_Interface.mc_hider1._visible = false;
mc_Interface.mc_hider2._visible = false;
mc_Interface.mc_hider3._visible = false;
mc_Interface.mc_hider4._visible = true;
}
function setCurWeapon(num) {
mc_Interface.mc_hider1._visible = false;
mc_Interface.mc_hider2._visible = false;
mc_Interface.mc_hider3._visible = false;
mc_Interface.mc_hider4._visible = false;
var _local2 = "mc_hider" + num;
mc_Interface[_local2]._visible = true;
}
function clear_() {
trace("delete ALL");
stop_();
deleteAll();
curBoss = undefined;
}
function getNextDeepestDepth() {
nextDeepestDepth++;
if (nextDeepestDepth == 9999) {
nextDeepestDepth = 100;
}
return(nextDeepestDepth);
}
function getNearestEnemy() {
var _local3 = getAllEnemys();
var _local5 = 0;
var _local4 = 0;
var _local6 = 2000;
var _local7 = 2000;
var _local8;
var _local2 = 0;
while (_local2 < _local3.length) {
_local5 = _local3[_local2].getMc()._x - mc_Me._x;
_local4 = _local3[_local2].getMc()._y - mc_Me._y;
_local6 = Math.sqrt((_local5 * _local5) + (_local4 * _local4));
if (_local7 > _local6) {
_local7 = _local6;
_local8 = _local3[_local2].getMc();
}
_local2++;
}
return(_local8);
}
function getAllEnemys() {
var _local2 = new Array();
for (var _local3 in arr_Enemys) {
_local2 = _local2.concat(arr_Enemys[_local3].getEnemys());
}
_local2 = _local2.concat(curBoss.getEnemys());
return(_local2);
}
function bossHasDestroyed() {
mc_Me.setInvulnerable(true);
delete curBoss;
if (lvl == 6) {
endGame(true);
} else {
mc_EndLevel._visible = true;
}
}
function showTransition() {
deleteAll();
mc_Transition.play();
}
function deleteAll() {
deleteEnemies();
deleteBonuses();
}
function deleteBonuses() {
trace("delete Bonuses");
bonusStatus = "Disabled";
}
function getBonusStatus() {
return(bonusStatus);
}
function deleteEnemies() {
var _local3 = getAllEnemys();
var _local2 = 0;
while (_local2 < _local3.length) {
_local3[_local2].deleteThis();
_local2++;
}
}
function finishTransition() {
trace("finishTransition");
showWeaponMenu();
}
function showWeaponMenu() {
trace("this.mc_WeaponMenu.show_");
_parent.showWeaponMenu(mc_Me, lvl);
}
function checkHit(mc, dmg) {
var _local4 = false;
var _local3 = getAllEnemys();
var _local2 = 0;
while (_local2 < _local3.length) {
if (_local3[_local2].checkHit(mc, dmg)) {
_local4 = true;
}
_local2++;
}
return(_local4);
}
function getTargetForEnemy() {
return(mc_Me.getHitRect());
}
function putBoss() {
enemyProbability = 0;
curBoss = new Boss(this, lvl);
}
function putEnemy(probability) {
if ((enemysCounter < maxGroups) and (minDeltaT < (getTimer() - lastGroupAppearsIn))) {
var _local5 = Math.random();
if (_local5 < probability) {
lastGroupAppearsIn = getTimer();
var _local4 = getRandomEnemyInfo();
var _local2 = String(getNextDeepestDepth());
var _local3 = new EnemyGroup(this, _local4, lvl, _local2);
arr_Enemys[_local2] = _local3;
enemysCounter++;
}
}
}
function putRandomBonus(probability, x_, y_) {
var _local2 = Math.random();
if (_local2 < probability) {
var _local4 = String(getNextDeepestDepth());
var _local3 = new Bonus(this, mc_Me, x_, y_);
}
}
function setLvl(lvl) {
mc_Me.setInvulnerable(false);
bonusStatus = "Enabled";
startEnemyProbability = lvlInfo[lvl - 1].enemyProbability;
levelLength = lvlInfo[lvl - 1].lvlLength;
minDeltaT = lvlInfo[lvl - 1].minDeltaT;
maxGroups = lvlInfo[lvl - 1].maxGroups;
this.lvl = lvl;
speed = 3 + (lvl * 2);
arr_PosibleEnemys = new Array();
arr_PosibleEnemys = getEnemysForLvl(lvl);
if (lvl == 1) {
mc_Me.resetParam();
}
start_();
}
function deleteEnemy(id) {
delete arr_Enemys[id];
count();
enemysCounter--;
}
function count() {
var _local2 = 0;
for (var _local3 in arr_Enemys) {
_local2++;
}
}
function start_() {
mc_Me._visible = true;
enemyProbability = startEnemyProbability;
startTime = getTimer();
var ths = this;
onEnterFrame = function () {
ths.putEnemy(this.enemyProbability);
if (((getTimer() - this.startTime) >= this.levelLength) && (this.curBoss == undefined)) {
this.enemyProbability = 0;
this.putBoss();
this.levelLength = 600000 /* 0x0927C0 */;
}
};
}
function getRandomEnemyInfo() {
var _local2 = Math.round(Math.random() * (arr_PosibleEnemys.length - 1));
return(arr_PosibleEnemys[_local2]);
}
function stop_() {
delete onEnterFrame;
}
function checkStrikes() {
for (var _local2 in arr_Enemys) {
if (arr_Enemys[_local2].hitTest_(mc_Me)) {
mc_Me.strike();
}
}
}
function getBonus(bonusType) {
mc_Me.getBonus(bonusType);
}
function showScore(val) {
score = val;
val = Math.round(val);
tf_Score.text = String(val);
}
function setHP(val) {
mc_Health.gotoAndStop(val + 1);
}
function getSpeed() {
return(speed);
}
function menu_() {
stop_();
clear_();
enemyProbability = 0;
_parent.menu_();
}
function endGame() {
stop_();
enemyProbability = 0;
var _local2;
if (mc_Me.getHp() == 0) {
_local2 = false;
} else {
_local2 = true;
}
_parent.endGame(_local2);
}
function getScore() {
return(Number(tf_Score.text));
}
function redBlink() {
mc_redBlink.gotoAndPlay(2);
}
function getEnemysForLvl(lvl) {
var _local2 = new Array();
if (lvl == 1) {
_local2.push(enemy1);
_local2.push(enemy10);
_local2.push(enemy10);
} else if (lvl == 2) {
_local2.push(enemy1);
_local2.push(enemy2);
_local2.push(enemy10);
_local2.push(enemy11);
_local2.push(enemy10);
_local2.push(enemy11);
} else if (lvl == 3) {
_local2.push(enemy1);
_local2.push(enemy2);
_local2.push(enemy3);
_local2.push(enemy10);
_local2.push(enemy11);
_local2.push(enemy12);
_local2.push(enemy10);
_local2.push(enemy11);
_local2.push(enemy12);
} else if (lvl == 4) {
_local2.push(enemy3);
_local2.push(enemy4);
_local2.push(enemy5);
_local2.push(enemy10);
_local2.push(enemy11);
_local2.push(enemy12);
_local2.push(enemy13);
_local2.push(enemy12);
_local2.push(enemy13);
_local2.push(enemy13);
} else if (lvl == 5) {
_local2.push(enemy4);
_local2.push(enemy5);
_local2.push(enemy6);
_local2.push(enemy10);
_local2.push(enemy11);
_local2.push(enemy12);
_local2.push(enemy13);
_local2.push(enemy14);
_local2.push(enemy14);
} else if (lvl == 6) {
_local2.push(enemy7);
_local2.push(enemy8);
_local2.push(enemy9);
_local2.push(enemy12);
_local2.push(enemy13);
_local2.push(enemy13);
_local2.push(enemy14);
_local2.push(enemy14);
_local2.push(enemy14);
}
return(_local2);
}
function addScore(val) {
mc_Me.addScore(val);
}
var enemy1 = {mc:"Enemy1", deathMc:"Expl", hp:1, weapon:1};
var enemy2 = {mc:"Enemy2", deathMc:"expl4", hp:2, weapon:1};
var enemy3 = {mc:"Enemy3", deathMc:"expl2", hp:3, weapon:1};
var enemy4 = {mc:"Enemy4", deathMc:"expl3", hp:4, weapon:1};
var enemy5 = {mc:"Enemy5", deathMc:"Expl", hp:5, weapon:4};
var enemy6 = {mc:"Enemy6", deathMc:"expl2", hp:6, weapon:4};
var enemy7 = {mc:"Enemy7", deathMc:"expl3", hp:7, weapon:4};
var enemy8 = {mc:"Enemy8", deathMc:"expl4", hp:8, weapon:3};
var enemy9 = {mc:"Enemy9", deathMc:"Expl", hp:9, weapon:3};
var enemy10 = {mc:"Enemy10", deathMc:"expl3", hp:0.3, weapon:1, small:true};
var enemy11 = {mc:"Enemy11", deathMc:"expl3", hp:0.3, weapon:1, small:true};
var enemy12 = {mc:"Enemy12", deathMc:"expl3", hp:1, weapon:1, small:true};
var enemy13 = {mc:"Enemy13", deathMc:"expl3", hp:1, weapon:1, small:true};
var enemy14 = {mc:"Enemy14", deathMc:"expl3", hp:2, weapon:1, small:true};
var lvlInfo = [{minDeltaT:1000, enemyProbability:0.1, maxGroups:7, lvlLength:60000}, {minDeltaT:1500, enemyProbability:0.1, maxGroups:7, lvlLength:60000}, {minDeltaT:1500, enemyProbability:0.1, maxGroups:7, lvlLength:60000}, {minDeltaT:2000, enemyProbability:0.1, maxGroups:7, lvlLength:60000}, {minDeltaT:2000, enemyProbability:0.1, maxGroups:7, lvlLength:60000}, {minDeltaT:2000, enemyProbability:0.1, maxGroups:7, lvlLength:60000}];
var score = 0;
var enemyProbability = WarField.prototype.startEnemyProbability;
var enemysCounter = 0;
var startEnemyProbability = 0.1;
var levelLength = 20000;
var minDeltaT = 1000;
var bonusStatus = "Enabled";
var nextDeepestDepth = 1000;
}
Symbol 874 MovieClip [__Packages.Boss] Frame 0
class Boss
{
var curBoss, container, curBossCounter, mc_Enemy;
function Boss (container, lvl) {
curBoss = new Array();
this.container = container;
if (lvl == 1) {
curBoss = boss1;
} else if (lvl == 2) {
curBoss = boss4;
} else if (lvl == 3) {
curBoss = boss7;
} else if (lvl == 4) {
curBoss = boss8;
} else if (lvl == 5) {
curBoss = boss9;
} else if (lvl == 6) {
curBoss = boss10;
}
curBossCounter = 0;
var _local3 = this.container.getNextDeepestDepth();
mc_Enemy = new Enemy(this, container, _local3, curBoss[curBossCounter], 101, 200, -200);
}
function getRandomMoveType() {
return(Math.round((Math.random() * 2) + 101));
}
function getEnemys() {
var _local2 = new Array();
_local2.push(mc_Enemy);
return(_local2);
}
function checkHit(mc, dmg) {
return(mc_Enemy.checkHit(mc, dmg));
}
function deleteEnemy(id, x_, y_) {
if (container.mc_Me._visible == false) {
return(undefined);
}
trace("deleteEnemy");
trace("x=+" + x_);
trace("y=" + y_);
curBossCounter++;
if (curBossCounter < curBoss.length) {
var _local2 = container.getNextDeepestDepth();
mc_Enemy = new Enemy(this, container, _local2, curBoss[curBossCounter], 101, x_, y_);
} else {
container.bossHasDestroyed();
}
}
var boss1 = [{mc:"boss11", deathMc:"Expl", hp:15, weapon:2, weapon2:4}, {mc:"boss12", deathMc:"bigBoom11", hp:10, weapon:2}];
var boss4 = [{mc:"boss41", deathMc:"Expl", hp:25, weapon:2, weapon2:4}, {mc:"boss42", deathMc:"bigBoom41", hp:15, weapon:2}];
var boss7 = [{mc:"boss71", deathMc:"Expl", hp:40, weapon:3, weapon2:4}, {mc:"boss72", deathMc:"Expl", hp:35, weapon:3, weapon2:4}, {mc:"boss73", deathMc:"Expl", hp:30, weapon:2, weapon2:4}, {mc:"boss74", deathMc:"bigBoom71", hp:25, weapon:2, weapon2:4}];
var boss8 = [{mc:"boss81", deathMc:"Expl", hp:60, weapon:2, weapon2:3, weapon3:1}, {mc:"boss82", deathMc:"bigBoom81", hp:40, weapon:2, weapon2:3}];
var boss9 = [{mc:"boss91", deathMc:"Expl", hp:80, weapon:2, weapon2:3, weapon3:4}, {mc:"boss92", deathMc:"bigBoom91", hp:60, weapon:2, weapon2:3}];
var boss10 = [{mc:"boss101", deathMc:"Expl", hp:150, weapon:2, weapon2:3, weapon3:4}, {mc:"boss102", deathMc:"bigBoom101", hp:100, weapon:2, weapon2:3, weapon3:4}];
}
Symbol 875 MovieClip [__Packages.Enemy] Frame 0
class Enemy extends MovieClip
{
var owner, container, id, hp, mc, mc_Destr, moveMc, weapon, weapon2, weapon3;
function Enemy (owner, container, id, params_, moveType, x_, y_) {
super();
trace("New Enemy");
this.owner = owner;
this.container = container;
this.id = id;
hp = params_.hp;
var _local5 = params_.mc;
mc = container.attachMovie(_local5, (_local5 + "-") + String(container.getNextDeepestDepth()), container.getNextDeepestDepth());
_local5 = params_.deathMc;
mc_Destr = this.container.attachMovie(_local5, (_local5 + "-") + String(container.getNextDeepestDepth()), container.getNextDeepestDepth());
mc_Destr._visible = false;
mc_Destr.stop();
mc_Destr.mc_Boom.stop();
var ths = this;
mc.onEnterFrame = function () {
if (this._y >= 600) {
ths.deleteThis();
}
};
mc._x = x_;
mc._y = y_;
trace("MoveEnemy");
moveMc = new MoveEnemy(mc, moveType, container.getTargetForEnemy());
weapon = new EnemyWeapon(params_.weapon, container, mc);
if (params_.weapon2 != undefined) {
weapon2 = new EnemyWeapon(params_.weapon2, container, mc);
}
if (params_.weapon3 != undefined) {
weapon3 = new EnemyWeapon(params_.weapon3, container, mc);
}
}
function checkHit(mc, dmg) {
if (this.mc.hitTest(mc)) {
hp = hp - dmg;
if (hp <= 0) {
explode();
}
return(true);
}
return(false);
}
function getMc() {
return(mc);
}
function deleteThis() {
weapon.delete_();
weapon2.delete_();
weapon3.delete_();
removeMc();
moveMc.deleteTween();
owner.deleteEnemy(id);
}
function removeMc() {
mc.removeMovieClip();
mc_Destr.removeMovieClip();
}
function explode() {
container.addScore(50);
weapon.delete_();
weapon2.delete_();
weapon3.delete_();
if ((owner.curBoss.length - 1) == owner.curBossCounter) {
mc_Destr._x = mc._x;
mc_Destr._y = mc._y;
} else {
if (mc._width > mc._height) {
mc_Destr._width = mc._width * 2.2;
mc_Destr._yscale = mc_Destr._xscale;
} else {
mc_Destr._height = mc._height * 2.2;
mc_Destr._xscale = mc_Destr._yscale;
}
mc_Destr._x = (mc._x + (0.5 * mc._width)) - (0.5 * mc_Destr._width);
mc_Destr._y = (mc._y + (0.5 * mc._height)) - (0.5 * mc_Destr._height);
}
mc_Destr._visible = true;
mc_Destr.play();
mc_Destr.mc_Boom.play();
container.putRandomBonus(0.5, mc._x, mc._y);
var _local3 = mc._x;
var _local2 = mc._y;
trace("before = " + mc);
mc.removeMovieClip();
trace("after = " + mc);
owner.deleteEnemy(id, _local3, _local2);
trace("after2 = " + mc);
}
var alive = true;
}
Symbol 876 MovieClip [__Packages.EnemyWeapon] Frame 0
class EnemyWeapon
{
var container, ownerMc, target_, mc, idsi_Shot;
function EnemyWeapon (wpnType, container, ownerMc) {
this.container = container;
this.ownerMc = ownerMc;
target_ = container.getTargetForEnemy();
if (wpnType == 1) {
mc = "wpn2";
idsi_Shot = setInterval(this, "shot3", 2700);
} else if (wpnType == 2) {
mc = "wpn1";
idsi_Shot = setInterval(this, "shot1", 1100);
} else if (wpnType == 3) {
mc = "myWpn2";
idsi_Shot = setInterval(this, "shot2", 2000);
} else if (wpnType == 4) {
mc = "Wpn2";
idsi_Shot = setInterval(this, "shot3", 1100);
}
}
function delete_() {
clearInterval(idsi_Shot);
}
function shot3() {
if (ownerMc._width == undefined) {
delete_();
return(undefined);
}
var _local10 = container.getNextDeepestDepth();
var _local2 = container.attachMovie(mc, mc + String(_local10), _local10);
_local2.expl = "Expl";
_local2.damage = 1;
_local2._x = ownerMc._x + ((ownerMc._width - _local2._width) / 2);
_local2._y = ownerMc._y + ((ownerMc._height - _local2._height) / 2);
var _local7 = ((0.01 * target_._parent._xscale) * (target_._x + (target_._width / 2))) + target_._parent._x;
var _local5 = ((0.01 * target_._parent._yscale) * (target_._y + (target_._height / 2))) + target_._parent._y;
var _local6 = _local2._x;
var _local4 = _local2._y;
var _local9 = Math.sqrt(((_local6 - _local7) * (_local6 - _local7)) + ((_local4 - _local5) * (_local4 - _local5)));
var _local8 = (_local7 - _local6) / _local9;
var _local11 = (_local5 - _local4) / _local9;
if (_local4 > _local5) {
_local2._rotation = 180 + ((Math.asin(_local8) * 180) / 3.14);
} else {
_local2._rotation = ((-Math.asin(_local8)) * 180) / 3.14;
}
_local2.speedX = 6 * _local8;
_local2.speedY = 6 * _local11;
_local2.target_ = target_;
_local2.count = 0;
_local2.onEnterFrame = function () {
this._y = this._y + this.speedY;
this._x = this._x + this.speedX;
this.count++;
if (this.count == 5) {
this.count = 0;
if (this.hitTest(this.target_)) {
this.target_._parent.strike();
var _local3 = this._parent.getNextDeepestDepth();
var _local2 = this._parent.attachMovie(this.expl, "expl" + String(_local3), _local3);
trace(this.expl);
_local2._height = this._height * 3;
_local2._xscale = _local2._yscale;
_local2._x = this._x + ((this._width - _local2._width) / 2);
_local2._y = this._y + ((this._height - _local2._height) / 2);
_local2.play();
this.removeMovieClip();
}
}
if (this._y > 550) {
this.removeMovieClip();
}
};
}
function shot1() {
if (ownerMc._width == undefined) {
delete_();
return(undefined);
}
var _local4 = container.getNextDeepestDepth();
var _local2 = container.attachMovie(mc, mc + String(_local4), _local4);
_local2.expl = "Expl";
_local2.damage = 1;
_local2._x = ownerMc._x + ((ownerMc._width - _local2._width) / 2);
_local2._y = ownerMc._y + ((ownerMc._height - _local2._height) / 2);
_local2.speedY = 4;
_local2.speedX = 0;
_local2.target_ = target_;
_local2.count = 0;
_local2.onEnterFrame = function () {
this._y = this._y + this.speedY;
this._x = this._x + this.speedX;
this.speedY = this.speedY + 0.5;
this.count++;
if (this.count == 5) {
this.count = 0;
if (this.hitTest(this.target_)) {
this.target_._parent.strike();
var _local3 = this._parent.getNextDeepestDepth();
var _local2 = this._parent.attachMovie(this.expl, "expl" + String(_local3), _local3);
trace(this.expl);
_local2._height = this._height * 3;
_local2._xscale = _local2._yscale;
_local2._x = this._x + ((this._width - _local2._width) / 2);
_local2._y = this._y + ((this._height - _local2._height) / 2);
_local2.play();
this.removeMovieClip();
}
}
if (this._y > 550) {
this.removeMovieClip();
}
};
}
function shot2() {
if (ownerMc._width == undefined) {
delete_();
return(undefined);
}
var _local6 = container.getNextDeepestDepth();
var _local2 = container.attachMovie(mc, mc + String(_local6), _local6);
_local6 = container.getNextDeepestDepth();
var _local4 = container.attachMovie(mc, mc + String(_local6), _local6);
_local6 = container.getNextDeepestDepth();
var _local3 = container.attachMovie(mc, mc + String(_local6), _local6);
_local2.expl = "Expl";
_local2.damage = 1;
_local2._x = ownerMc._x + ((ownerMc._width - _local2._width) / 2);
_local2._y = ownerMc._y + ((ownerMc._height - _local2._height) / 2);
_local2.speedY = 4;
_local2.speedX = 0;
_local2.target_ = target_;
_local2.count = 0;
_local4.expl = "Expl";
_local4.damage = 1;
_local4._x = ownerMc._x + ((ownerMc._width - _local2._width) / 2);
_local4._y = ownerMc._y + ((ownerMc._height - _local2._height) / 2);
_local4.speedY = 4;
_local4.speedX = -2;
_local4.target_ = target_;
_local4.count = 0;
_local3.expl = "Expl";
_local3.damage = 1;
_local3._x = ownerMc._x + ((ownerMc._width - _local2._width) / 2);
_local3._y = ownerMc._y + ((ownerMc._height - _local2._height) / 2);
_local3.speedY = 4;
_local3.speedX = 2;
_local3.target_ = target_;
_local3.count = 0;
_local2.onEnterFrame = function () {
this._y = this._y + this.speedY;
this._x = this._x + this.speedX;
this.count++;
if (this.count == 5) {
this.count = 0;
if (this.hitTest(this.target_)) {
this.target_._parent.strike();
var _local3 = this._parent.getNextDeepestDepth();
var _local2 = this._parent.attachMovie(this.expl, "expl" + String(_local3), _local3);
trace(this.expl);
_local2._height = this._height * 3;
_local2._xscale = _local2._yscale;
_local2._x = this._x + ((this._width - _local2._width) / 2);
_local2._y = this._y + ((this._height - _local2._height) / 2);
_local2.play();
this.removeMovieClip();
}
}
if (this._y > 550) {
this.removeMovieClip();
}
};
_local4.onEnterFrame = _local2.onEnterFrame;
_local3.onEnterFrame = _local2.onEnterFrame;
}
}
Symbol 877 MovieClip [__Packages.MoveEnemy] Frame 0
class MoveEnemy
{
var target_, mc, idsi, tweenY, tweenX;
function MoveEnemy (mc, movingType, target) {
target_ = target._parent;
this.mc = mc;
if (movingType == 0) {
startTween0();
} else if (movingType == 1) {
startTween1();
} else if (movingType == 2) {
startTween2();
} else if (movingType == 3) {
startTween3();
} else if (movingType == 4) {
startTween4();
} else if (movingType == 5) {
startTween5();
} else if (movingType == 8) {
startTween8();
} else if (movingType == 101) {
startTweenBoss11();
}
idsi = setInterval(this, "check_", 500);
}
function check_() {
if (((mc._x == undefined) or (mc._x == null)) or (mc._x == NaN)) {
clearInterval(idsi);
deleteTween();
}
}
function deleteTween() {
tweenY.stop();
tweenX.stop();
delete tweenY;
delete tweenX;
}
function startTween0() {
tweenY = new mx.transitions.Tween(mc, "_y", mx.transitions.easing.None.easeNone, mc._y, 600, 20, true);
}
function startTween1() {
tweenY = new mx.transitions.Tween(mc, "_y", mx.transitions.easing.None.easeNone, mc._y, 600, 20, true);
animation1_1();
}
function animation1_1() {
tweenX = new mx.transitions.Tween(mc, "_x", mx.transitions.easing.None.easeNone, mc._x, mc._x - 100, 2, true);
var ths = this;
tweenX.onMotionFinished = function () {
ths.animation1_2();
};
}
function animation1_2() {
tweenX = new mx.transitions.Tween(mc, "_x", mx.transitions.easing.None.easeNone, mc._x, mc._x + 100, 2, true);
var ths = this;
tweenX.onMotionFinished = function () {
ths.animation1_1();
};
}
function startTween2() {
tweenY = new mx.transitions.Tween(mc, "_y", mx.transitions.easing.None.easeNone, mc._y, 600, 20, true);
animation2_1();
}
function animation2_1() {
tweenX = new mx.transitions.Tween(mc, "_x", mx.transitions.easing.None.easeNone, mc._x, mc._x + 100, 2, true);
var ths = this;
tweenX.onMotionFinished = function () {
ths.animation2_2();
};
}
function animation2_2() {
tweenX = new mx.transitions.Tween(mc, "_x", mx.transitions.easing.None.easeNone, mc._x, mc._x - 100, 2, true);
var ths = this;
tweenX.onMotionFinished = function () {
ths.animation2_1();
};
}
function startTween3() {
tweenY = new mx.transitions.Tween(mc, "_y", mx.transitions.easing.None.easeNone, mc._y, 400, 12, true);
var ths = this;
tweenY.onMotionFinished = function () {
ths.animation3_1();
};
}
function animation3_1() {
tweenX = new mx.transitions.Tween(mc, "_x", mx.transitions.easing.None.easeNone, mc._x, mc._x + 300, 12, true);
tweenY = new mx.transitions.Tween(mc, "_y", mx.transitions.easing.None.easeNone, mc._y, 100, 12, true);
var ths = this;
tweenY.onMotionFinished = function () {
ths.animation3_2();
};
}
function animation3_2() {
tweenY = new mx.transitions.Tween(mc, "_y", mx.transitions.easing.None.easeNone, mc._y, 600, 12, true);
}
function startTween4() {
tweenY = new mx.transitions.Tween(mc, "_y", mx.transitions.easing.None.easeNone, mc._y, 400, 12, true);
var ths = this;
tweenY.onMotionFinished = function () {
ths.animation4_1();
};
}
function animation4_1() {
tweenX = new mx.transitions.Tween(mc, "_x", mx.transitions.easing.None.easeNone, mc._x, mc._x - 300, 12, true);
tweenY = new mx.transitions.Tween(mc, "_y", mx.transitions.easing.None.easeNone, mc._y, 100, 12, true);
var ths = this;
tweenY.onMotionFinished = function () {
ths.animation4_2();
};
}
function animation4_2() {
tweenY = new mx.transitions.Tween(mc, "_y", mx.transitions.easing.None.easeNone, mc._y, 600, 12, true);
}
function startTween5() {
tweenY = new mx.transitions.Tween(mc, "_alpha", mx.transitions.easing.None.easeNone, 100, 0, 2, true);
var ths = this;
tweenY.onMotionFinished = function () {
ths.mc._x = Math.random() * 450;
ths.mc._y = Math.random() * 200;
ths.animation5_1();
};
}
function animation5_1() {
tweenY = new mx.transitions.Tween(mc, "_alpha", mx.transitions.easing.None.easeNone, 0, 100, 2, true);
var ths = this;
tweenY.onMotionFinished = function () {
ths.startTween5();
};
}
function startTween8() {
var _local2 = (Math.random() * 2) - 1;
tweenY = new mx.transitions.Tween(mc, "_y", mx.transitions.easing.None.easeNone, mc._y, 200, 1, true);
tweenX = new mx.transitions.Tween(mc, "_x", mx.transitions.easing.None.easeNone, mc._x, target_._x - (100 * _local2), 1, true);
var ths = this;
tweenY.onMotionFinished = function () {
ths.animation8_1();
};
}
function animation8_1() {
var _local2 = (Math.random() * 2) - 1;
tweenX = new mx.transitions.Tween(mc, "_x", mx.transitions.easing.None.easeNone, mc._x, target_._x + (_local2 * 100), 5, true);
tweenY = new mx.transitions.Tween(mc, "_y", mx.transitions.easing.None.easeNone, mc._y, target_._y - 100, 5, true);
var ths = this;
tweenY.onMotionFinished = function () {
ths.animation8_2();
};
}
function animation8_2() {
tweenY = new mx.transitions.Tween(mc, "_y", mx.transitions.easing.None.easeNone, mc._y, 600, 1, true);
}
function startTweenBoss11() {
tweenY.stop();
tweenX.stop();
trace("Start Animation");
trace("x=" + mc._x);
trace("y=" + mc._y);
trace("mc=" + mc);
tweenY = new mx.transitions.Tween(mc, "_y", mx.transitions.easing.Regular.easeInOut, mc._y, 10, 2, true);
tweenX = new mx.transitions.Tween(mc, "_x", mx.transitions.easing.Regular.easeInOut, mc._x, 200, 2, true);
var ths = this;
tweenX.onMotionFinished = function () {
ths.animationBoss11_1();
};
tweenY.start();
tweenX.start();
}
function animationBoss11_1() {
tweenY.stop();
tweenX.stop();
tweenY = new mx.transitions.Tween(mc, "_y", mx.transitions.easing.Regular.easeInOut, mc._y, mc._y + 200, 2, true);
tweenX = new mx.transitions.Tween(mc, "_x", mx.transitions.easing.Regular.easeInOut, mc._x, mc._x + 200, 2, true);
var ths = this;
tweenX.onMotionFinished = function () {
ths.animationBoss11_2();
};
tweenY.start();
tweenX.start();
}
function animationBoss11_2() {
tweenY.stop();
tweenX.stop();
tweenX = new mx.transitions.Tween(mc, "_x", mx.transitions.easing.Regular.easeInOut, mc._x, mc._x - 400, 2, true);
var ths = this;
tweenX.onMotionFinished = function () {
ths.startTweenBoss11();
};
tweenX.start();
}
function startTweenBoss12() {
tweenY = new mx.transitions.Tween(mc, "_y", mx.transitions.easing.Regular.easeInOut, mc._y, 200, 2, true);
tweenX = new mx.transitions.Tween(mc, "_x", mx.transitions.easing.Regular.easeInOut, mc._x, mc._x + 200, 2, true);
var ths = this;
tweenX.onMotionFinished = function () {
ths.animationBoss12_1();
};
}
function animationBoss12_1() {
tweenX = new mx.transitions.Tween(mc, "_x", mx.transitions.easing.Regular.easeInOut, mc._x, mc._x - 320, 2, true);
var ths = this;
tweenX.onMotionFinished = function () {
ths.animationBoss12_2();
};
}
function animationBoss12_2() {
tweenY = new mx.transitions.Tween(mc, "_y", mx.transitions.easing.Regular.easeInOut, 200, 10, 2, true);
tweenX = new mx.transitions.Tween(mc, "_x", mx.transitions.easing.Regular.easeInOut, mc._x, mc._x + 120, 2, true);
var ths = this;
tweenX.onMotionFinished = function () {
ths.startTweenBoss12();
};
}
function startTweenBoss13() {
tweenY = new mx.transitions.Tween(mc, "_y", mx.transitions.easing.Regular.easeInOut, mc._y, 200, 2, true);
tweenX = new mx.transitions.Tween(mc, "_x", mx.transitions.easing.Regular.easeInOut, mc._x, mc._x + 200, 2, true);
var ths = this;
tweenX.onMotionFinished = function () {
ths.animationBoss13_1();
};
}
function animationBoss13_1() {
tweenX = new mx.transitions.Tween(mc, "_x", mx.transitions.easing.Regular.easeInOut, mc._x, mc._x - 240, 2, true);
var ths = this;
tweenX.onMotionFinished = function () {
ths.animationBoss13_2();
};
}
function animationBoss13_2() {
tweenY = new mx.transitions.Tween(mc, "_y", mx.transitions.easing.Regular.easeInOut, 200, 10, 2, true);
tweenX = new mx.transitions.Tween(mc, "_x", mx.transitions.easing.Regular.easeInOut, mc._x, mc._x + 40, 2, true);
var ths = this;
tweenX.onMotionFinished = function () {
ths.startTweenBoss13();
};
}
function startTweenBoss14() {
tweenY = new mx.transitions.Tween(mc, "_y", mx.transitions.easing.Regular.easeInOut, mc._y, 200, 2, true);
tweenX = new mx.transitions.Tween(mc, "_x", mx.transitions.easing.Regular.easeInOut, mc._x, mc._x + 200, 2, true);
var ths = this;
tweenX.onMotionFinished = function () {
ths.animationBoss14_1();
};
}
function animationBoss14_1() {
tweenX = new mx.transitions.Tween(mc, "_x", mx.transitions.easing.Regular.easeInOut, mc._x, mc._x - 160, 2, true);
var ths = this;
tweenX.onMotionFinished = function () {
ths.animationBoss14_2();
};
}
function animationBoss14_2() {
tweenY = new mx.transitions.Tween(mc, "_y", mx.transitions.easing.Regular.easeInOut, 200, 10, 2, true);
tweenX = new mx.transitions.Tween(mc, "_x", mx.transitions.easing.Regular.easeInOut, mc._x, mc._x - 40, 2, true);
var ths = this;
tweenX.onMotionFinished = function () {
ths.startTweenBoss14();
};
}
function startTweenBoss15() {
tweenY = new mx.transitions.Tween(mc, "_y", mx.transitions.easing.Regular.easeInOut, mc._y, 200, 2, true);
tweenX = new mx.transitions.Tween(mc, "_x", mx.transitions.easing.Regular.easeInOut, mc._x, mc._x + 200, 2, true);
var ths = this;
tweenX.onMotionFinished = function () {
ths.animationBoss15_1();
};
}
function animationBoss15_1() {
tweenX = new mx.transitions.Tween(mc, "_x", mx.transitions.easing.Regular.easeInOut, mc._x, mc._x - 80, 2, true);
var ths = this;
tweenX.onMotionFinished = function () {
ths.animationBoss15_2();
};
}
function animationBoss15_2() {
tweenY = new mx.transitions.Tween(mc, "_y", mx.transitions.easing.Regular.easeInOut, 200, 10, 2, true);
tweenX = new mx.transitions.Tween(mc, "_x", mx.transitions.easing.Regular.easeInOut, mc._x, mc._x - 120, 2, true);
var ths = this;
tweenX.onMotionFinished = function () {
ths.startTweenBoss15();
};
}
}
Symbol 878 MovieClip [__Packages.mx.transitions.OnEnterFrameBeacon] Frame 0
class mx.transitions.OnEnterFrameBeacon
{
function OnEnterFrameBeacon () {
}
static function init() {
var _local4 = _global.MovieClip;
if (!_root.__OnEnterFrameBeacon) {
mx.transitions.BroadcasterMX.initialize(_local4);
var _local3 = _root.createEmptyMovieClip("__OnEnterFrameBeacon", 9876);
_local3.onEnterFrame = function () {
_global.MovieClip.broadcastMessage("onEnterFrame");
};
}
}
static var version = "1.1.0.52";
}
Symbol 879 MovieClip [__Packages.mx.transitions.BroadcasterMX] Frame 0
class mx.transitions.BroadcasterMX
{
var _listeners;
function BroadcasterMX () {
}
static function initialize(o, dontCreateArray) {
if (o.broadcastMessage != undefined) {
delete o.broadcastMessage;
}
o.addListener = mx.transitions.BroadcasterMX.prototype.addListener;
o.removeListener = mx.transitions.BroadcasterMX.prototype.removeListener;
if (!dontCreateArray) {
o._listeners = new Array();
}
}
function addListener(o) {
removeListener(o);
if (broadcastMessage == undefined) {
broadcastMessage = mx.transitions.BroadcasterMX.prototype.broadcastMessage;
}
return(_listeners.push(o));
}
function removeListener(o) {
var _local2 = _listeners;
var _local3 = _local2.length;
while (_local3--) {
if (_local2[_local3] == o) {
_local2.splice(_local3, 1);
if (!_local2.length) {
broadcastMessage = undefined;
}
return(true);
}
}
return(false);
}
function broadcastMessage() {
var _local5 = String(arguments.shift());
var _local4 = _listeners.concat();
var _local6 = _local4.length;
var _local3 = 0;
while (_local3 < _local6) {
_local4[_local3][_local5].apply(_local4[_local3], arguments);
_local3++;
}
}
static var version = "1.1.0.52";
}
Symbol 880 MovieClip [__Packages.mx.transitions.Tween] Frame 0
class mx.transitions.Tween
{
var obj, prop, begin, useSeconds, _listeners, addListener, prevTime, _time, looping, _duration, broadcastMessage, isPlaying, _fps, prevPos, _pos, change, _intervalID, _startTime;
function Tween (obj, prop, func, begin, finish, duration, useSeconds) {
mx.transitions.OnEnterFrameBeacon.init();
if (!arguments.length) {
return;
}
this.obj = obj;
this.prop = prop;
this.begin = begin;
position = (begin);
this.duration = (duration);
this.useSeconds = useSeconds;
if (func) {
this.func = func;
}
this.finish = (finish);
_listeners = [];
addListener(this);
start();
}
function set time(t) {
prevTime = _time;
if (t > duration) {
if (looping) {
rewind(t - _duration);
update();
broadcastMessage("onMotionLooped", this);
} else {
if (useSeconds) {
_time = _duration;
update();
}
stop();
broadcastMessage("onMotionFinished", this);
}
} else if (t < 0) {
rewind();
update();
} else {
_time = t;
update();
}
//return(time);
}
function get time() {
return(_time);
}
function set duration(d) {
_duration = (((d == null) || (d <= 0)) ? (_global.Infinity) : (d));
//return(duration);
}
function get duration() {
return(_duration);
}
function set FPS(fps) {
var _local2 = isPlaying;
stopEnterFrame();
_fps = fps;
if (_local2) {
startEnterFrame();
}
//return(FPS);
}
function get FPS() {
return(_fps);
}
function set position(p) {
setPosition(p);
//return(position);
}
function setPosition(p) {
prevPos = _pos;
obj[prop] = (_pos = p);
broadcastMessage("onMotionChanged", this, _pos);
updateAfterEvent();
}
function get position() {
return(getPosition());
}
function getPosition(t) {
if (t == undefined) {
t = _time;
}
return(func(t, begin, change, _duration));
}
function set finish(f) {
change = f - begin;
//return(finish);
}
function get finish() {
return(begin + change);
}
function continueTo(finish, duration) {
begin = position;
this.finish = (finish);
if (duration != undefined) {
this.duration = (duration);
}
start();
}
function yoyo() {
continueTo(begin, time);
}
function startEnterFrame() {
if (_fps == undefined) {
_global.MovieClip.addListener(this);
} else {
_intervalID = setInterval(this, "onEnterFrame", 1000 / _fps);
}
isPlaying = true;
}
function stopEnterFrame() {
if (_fps == undefined) {
_global.MovieClip.removeListener(this);
} else {
clearInterval(_intervalID);
}
isPlaying = false;
}
function start() {
rewind();
startEnterFrame();
broadcastMessage("onMotionStarted", this);
}
function stop() {
stopEnterFrame();
broadcastMessage("onMotionStopped", this);
}
function resume() {
fixTime();
startEnterFrame();
broadcastMessage("onMotionResumed", this);
}
function rewind(t) {
_time = ((t == undefined) ? 0 : (t));
fixTime();
update();
}
function fforward() {
time = (_duration);
fixTime();
}
function nextFrame() {
if (useSeconds) {
time = ((getTimer() - _startTime) / 1000);
} else {
time = (_time + 1);
}
}
function onEnterFrame() {
nextFrame();
}
function prevFrame() {
if (!useSeconds) {
time = (_time - 1);
}
}
function toString() {
return("[Tween]");
}
function fixTime() {
if (useSeconds) {
_startTime = getTimer() - (_time * 1000);
}
}
function update() {
position = (getPosition(_time));
}
static var version = "1.1.0.52";
static var __initBeacon = mx.transitions.OnEnterFrameBeacon.init();
static var __initBroadcaster = mx.transitions.BroadcasterMX.initialize(mx.transitions.Tween.prototype, true);
function func(t, b, c, d) {
return(((c * t) / d) + b);
}
}
Symbol 881 MovieClip [__Packages.mx.transitions.easing.None] Frame 0
class mx.transitions.easing.None
{
function None () {
}
static function easeNone(t, b, c, d) {
return(((c * t) / d) + b);
}
static function easeIn(t, b, c, d) {
return(((c * t) / d) + b);
}
static function easeOut(t, b, c, d) {
return(((c * t) / d) + b);
}
static function easeInOut(t, b, c, d) {
return(((c * t) / d) + b);
}
static var version = "1.1.0.52";
}
Symbol 882 MovieClip [__Packages.mx.transitions.easing.Regular] Frame 0
class mx.transitions.easing.Regular
{
function Regular () {
}
static function easeIn(t, b, c, d) {
t = t / d;
return(((c * t) * t) + b);
}
static function easeOut(t, b, c, d) {
t = t / d;
return((((-c) * t) * (t - 2)) + b);
}
static function easeInOut(t, b, c, d) {
t = t / (d / 2);
if (t < 1) {
return((((c / 2) * t) * t) + b);
}
t--;
return((((-c) / 2) * ((t * (t - 2)) - 1)) + b);
}
static var version = "1.1.0.52";
}
Symbol 883 MovieClip [__Packages.EnemyGroup] Frame 0
class EnemyGroup
{
var groupId, container, arrEnemys, curGroupWidth, idsi_CheckEnemys;
function EnemyGroup (container, enemyInfo, lvl, groupId) {
this.groupId = groupId;
this.container = container;
arrEnemys = new Array();
var _local3 = new Array();
_local3 = getRandomGroup(lvl);
var _local9 = Math.random() * (500 - curGroupWidth);
var _local2 = 0;
while (_local2 < _local3.length) {
var _local4 = container.getNextDeepestDepth();
if (enemyInfo.small == true) {
var _local6 = 8;
} else {
var _local6 = _local3[_local2].moveType;
}
var _local5 = new Enemy(this, container, _local4, enemyInfo, _local6, _local9 + _local3[_local2].x_, _local3[_local2].y_);
arrEnemys[_local4] = _local5;
_local2++;
}
idsi_CheckEnemys = setInterval(this, "checkEnemys", 1000);
}
function getEnemys() {
var _local2 = new Array();
for (var _local3 in arrEnemys) {
if (((arrEnemys[_local3].getMc() != null) && (arrEnemys[_local3].getMc() != undefined)) && (arrEnemys[_local3].getMc() != NaN)) {
_local2.push(arrEnemys[_local3]);
}
}
return(_local2);
}
function checkHit(mc, dmg) {
for (var _local4 in arrEnemys) {
if (arrEnemys[_local4].checkHit(mc, dmg)) {
return(true);
}
}
return(false);
}
function deleteEnemy(id, x_, y_) {
trace("delete Enemy");
delete arrEnemys[id];
}
function checkEnemys() {
for (var _local2 in arrEnemys) {
if (((arrEnemys[_local2].getMc() != null) && (arrEnemys[_local2].getMc() != undefined)) && (arrEnemys[_local2].getMc() != NaN)) {
return(undefined);
}
}
clearInterval(idsi_CheckEnemys);
container.deleteEnemy(groupId);
}
function getRandomGroup(lvl) {
var _local2 = new Array();
_local2 = getPosibleGroups(lvl);
var _local3 = Math.round(Math.random() * (_local2.length - 1));
if (_local2[_local3] == group1) {
curGroupWidth = gr1Width;
} else if (_local2[_local3] == group2) {
curGroupWidth = gr2Width;
} else if (_local2[_local3] == group3) {
curGroupWidth = gr3Width;
} else if (_local2[_local3] == group4) {
curGroupWidth = gr4Width;
} else if (_local2[_local3] == group5) {
curGroupWidth = gr5Width;
} else if (_local2[_local3] == group6) {
curGroupWidth = gr6Width;
} else if (_local2[_local3] == group7) {
curGroupWidth = gr7Width;
}
return(_local2[_local3]);
}
function getPosibleGroups(lvl) {
if (lvl == 1) {
var _local3 = new Array();
_local3.push(group1);
} else if (lvl == 2) {
var _local3 = new Array();
_local3.push(group1);
_local3.push(group2);
} else if (lvl == 3) {
var _local3 = new Array();
_local3.push(group1);
_local3.push(group2);
_local3.push(group3);
} else if (lvl == 4) {
var _local3 = new Array();
_local3.push(group2);
_local3.push(group3);
} else if (lvl == 5) {
var _local3 = new Array();
_local3.push(group2);
_local3.push(group3);
_local3.push(group4);
} else if (lvl == 6) {
var _local3 = new Array();
_local3.push(group3);
_local3.push(group4);
} else if (lvl == 7) {
var _local3 = new Array();
_local3.push(group4);
_local3.push(group5);
_local3.push(group6);
} else if (lvl == 8) {
var _local3 = new Array();
_local3.push(group5);
_local3.push(group6);
} else if (lvl == 9) {
var _local3 = new Array();
_local3.push(group5);
_local3.push(group6);
_local3.push(group7);
} else if (lvl == 10) {
var _local3 = new Array();
_local3.push(group6);
_local3.push(group7);
}
return(_local3);
}
var group1 = [{x_:0, y_:-100, moveType:0}];
var group2 = [{x_:0, y_:-100, moveType:0}, {x_:100, y_:-100, moveType:0}];
var group3 = [{x_:0, y_:-100, moveType:1}];
var group4 = [{x_:0, y_:-100, moveType:1}, {x_:200, y_:-100, moveType:2}];
var group5 = [{x_:0, y_:-100, moveType:3}];
var group6 = [{x_:350, y_:-100, moveType:4}];
var group7 = [{x_:0, y_:-100, moveType:5}];
var gr1Width = 50;
var gr2Width = 150;
var gr3Width = 100;
var gr4Width = 400;
var gr5Width = 400;
var gr6Width = 400;
var gr7Width = 500;
var count = 0;
}
Symbol 884 MovieClip [__Packages.Bonus] Frame 0
class Bonus extends MovieClip
{
var ship, container, bonusType, mc, mc_Destr, onEnterFrame;
function Bonus (container, ship, x_, y_) {
super();
this.ship = ship;
this.container = container;
if (number > 1) {
var _local4 = Math.floor(Math.random() * number) + 1;
} else {
var _local4 = 1;
}
bonusType = _local4;
var _local5 = "Bonus" + String(_local4);
mc = container.attachMovie(_local5, (_local5 + "-") + String(container.getNextDeepestDepth()), container.getNextDeepestDepth());
mc.cacheAsBitmap = true;
mc._x = x_;
mc._y = y_;
_local5 = "bonusExpl" + String(_local4);
mc_Destr = container.attachMovie(_local5, (_local5 + "-") + String(container.getNextDeepestDepth()), container.getNextDeepestDepth());
mc_Destr._visible = false;
mc_Destr._height = mc._height * 1.5;
mc_Destr._xscale = mc_Destr._yscale;
mc_Destr.stop();
var ths = this;
mc.onEnterFrame = function () {
ths.doMove();
ths.hitTest_(ths.ship);
};
}
function checkContainerStatus() {
if (container.getBonusStatus() == "Disabled") {
deleteThis();
}
}
function doMove() {
checkContainerStatus();
xSpeed = xSpeed + (1 - random(3));
if (Math.abs(xSpeed) > XSPEED) {
xSpeed = 0;
}
if (mc._y > 550) {
deleteThis();
}
}
function deleteThis() {
removeMc();
}
function removeMc() {
mc.removeMovieClip();
mc_Destr.removeMovieClip();
}
function hitTest_(mc_) {
if (alive) {
if (mc.hitTest(mc_.getHitRect()) and (mc_.getHp() > 0)) {
explode();
alive = false;
container.getBonus(bonusType);
return(true);
}
}
return(false);
}
function explode() {
var _local3 = (mc_Destr._width - mc._width) / 2;
var _local2 = (mc_Destr._height - mc._height) / 2;
mc_Destr._x = mc._x - _local3;
mc_Destr._y = mc._y - _local2;
mc.removeMovieClip();
mc_Destr._visible = true;
mc_Destr.play();
delete onEnterFrame;
}
static var XSPEED = 0;
static var YSPEED = -4;
var xSpeed = 0;
var number = 4;
var alive = true;
}
Symbol 885 MovieClip [__Packages.FinishDialog] Frame 0
class FinishDialog extends MovieClip
{
var mc_GameOverText, mc_YouWinText, onMouseDown, _parent;
function FinishDialog () {
super();
}
function init(win) {
if (win) {
mc_GameOverText._visible = false;
mc_YouWinText._visible = true;
} else {
mc_GameOverText._visible = true;
mc_YouWinText._visible = false;
}
onMouseDown = mouseDown_;
}
function mouseDown_() {
_parent.clearWarField();
_parent.addScore();
delete onMouseDown;
}
}
Symbol 886 MovieClip [__Packages.Help] Frame 0
class Help
{
var btnLock, btn_Back, btnRules, btnEnemys, btnBonuses, mc_Bonuses, mc_Enemys, mc_Rules;
function Help () {
btnLock.useHandCursor = false;
showRules();
var ths = this;
btn_Back.onRelease = function () {
trace("ths=" + ths);
ths._visible = false;
};
btnRules.onRelease = function () {
ths.showRules();
};
btnEnemys.onRelease = function () {
ths.showEnemys();
};
btnBonuses.onRelease = function () {
ths.showBonuses();
};
}
function showBonuses() {
mc_Bonuses._visible = true;
mc_Enemys._visible = false;
mc_Rules._visible = false;
}
function showEnemys() {
mc_Bonuses._visible = false;
mc_Enemys._visible = true;
mc_Rules._visible = false;
}
function showRules() {
mc_Bonuses._visible = false;
mc_Enemys._visible = false;
mc_Rules._visible = true;
}
}
Symbol 887 MovieClip [__Packages.HightScore] Frame 0
class HightScore extends MovieClip
{
var btnLock, arrRows, btn_Close, attachMovie, getNextHighestDepth, getURL;
function HightScore () {
super();
btnLock.useHandCursor = false;
arrRows = new Array();
btn_Close.onRelease = function () {
this._parent._visible = false;
this._parent.removeAllRows();
};
}
function sortScore(arrScore) {
var _local3 = 0;
while (_local3 < (arrScore.length - 1)) {
var _local2 = _local3 + 1;
while (_local2 < arrScore.length) {
if (arrScore[_local3].score_ < arrScore[_local2].score_) {
var _local4 = arrScore[_local3].score_;
var _local5 = arrScore[_local3].name_;
arrScore[_local3].score_ = arrScore[_local2].score_;
arrScore[_local3].name_ = arrScore[_local2].name_;
arrScore[_local2].score_ = _local4;
arrScore[_local2].name_ = _local5;
}
_local2++;
}
_local3++;
}
}
function addScore(score_) {
trace("HighScores=" + score_);
var _local3 = getScoreArray();
var _local2 = 0;
_local2 = 0;
while (_local2 < _local3.length) {
if (_local3[_local2].score_ < score_) {
showScoreWithInputDialog(_local2, score_, _local3);
return(undefined);
}
_local2++;
}
showScoreWithInputDialog(_local2, score_, _local3);
return(undefined);
}
function showScoreWithInputDialog(place, score, arrScore) {
trace("place=" + place);
var _local2 = 0;
while (_local2 < (arrScore.length + 1)) {
trace("this.arrRows.length=" + arrRows.length);
trace("i=" + _local2);
trace("place=" + place);
if (arrRows.length < 10) {
if (_local2 == place) {
trace("i=0");
var _local3 = new MovieClip();
_local3 = attachMovie("inputDialog", "inputDialog" + String(getNextHighestDepth()), getNextHighestDepth());
_local3._x = 112;
_local3._y = 61 + (arrRows.length * 42.5);
_local3.tf_Score.text = score;
_local3.tf_Name.onSetFocus = function () {
this.text = "";
};
var ths = this;
_local3.btnSubmit.onRelease = function () {
ths.submitScore(place, score, this._parent.tf_Name.text, arrScore);
};
arrRows.push(_local3);
}
trace("arrScore[i].score_=" + arrScore[_local2].score_);
trace("arrScore[i].name_=" + arrScore[_local2].name_);
if ((arrRows.length < 10) and (arrScore[_local2] != undefined)) {
var _local3 = new MovieClip();
_local3 = attachMovie("ScoreRow", "ScoreRow" + String(getNextHighestDepth()), getNextHighestDepth());
_local3._x = 112;
_local3._y = 61 + (arrRows.length * 42.5);
_local3.tf_Name.text = arrScore[_local2].name_;
_local3.tf_Score.text = arrScore[_local2].score_;
arrRows.push(_local3);
}
}
_local2++;
}
}
function removeAllRows() {
var _local2 = 0;
while (_local2 < arrRows.length) {
arrRows[_local2].removeMovieClip();
_local2++;
}
arrRows.length = 0;
}
function submitScore(place, score, name_, arrScore) {
trace("submit");
getURL((((("http://game-zoid.com/index2.php?option=com_topscore&gameid=1&scrore=" + String(score)) + "&name=") + name_) + "&key=") + String(((score * score) + (5 * score)) + 34), "_blank");
var _local3 = new Array();
var _local2 = 0;
while (_local2 < (arrScore.length + 1)) {
if (_local2 == place) {
if (_local3.length < 10) {
var _local5 = new Object();
_local5.score_ = score;
_local5.name_ = name_;
_local3.push(_local5);
}
if ((_local3.length < 10) and (arrScore[_local2] != undefined)) {
_local3.push(arrScore[_local2]);
}
} else if ((_local3.length < 10) and (arrScore[_local2] != undefined)) {
_local3.push(arrScore[_local2]);
}
_local2++;
}
var _local9 = SharedObject.getLocal("micro");
traceArr(_local3);
_local9.data.arrScore = _local3;
_local9.flush();
removeAllRows();
showScore();
}
function traceArr(arr) {
var _local1 = 0;
while (_local1 < arr.length) {
trace((("name=" + arr[_local1].name_) + " score=") + arr[_local1].score_);
_local1++;
}
}
function getScoreArray() {
var _local1 = SharedObject.getLocal("micro");
if (_local1.data.arrScore == undefined) {
_local1.data.arrScore = new Array();
}
return(_local1.data.arrScore);
}
function showScore() {
var _local4 = getScoreArray();
sortScore(_local4);
var _local2 = 0;
while (_local2 < _local4.length) {
var _local3 = attachMovie("ScoreRow", "ScoreRow" + String(_local2), getNextHighestDepth());
_local3._x = 112;
_local3._y = 61 + (arrRows.length * 42.5);
_local3.tf_Name.text = _local4[_local2].name_;
_local3.tf_Score.text = _local4[_local2].score_;
arrRows.push(_local3);
_local2++;
}
}
}
Symbol 888 MovieClip [__Packages.StartDialog] Frame 0
class StartDialog extends MovieClip
{
var mcScore, mcHelp, btnStart, btnHelp, btnScore, btn_Controls, _parent;
function StartDialog () {
super();
mcScore._visible = false;
mcHelp._visible = false;
var ths = this;
btnStart.onRelease = function () {
ths._parent.startGame(1);
};
btnHelp.onRelease = function () {
if (Math.random() < 0.1) {
trace("need gotoGameFalls");
_root.getURL("http://www.game-zoid.com/?from=Starship2swf", "_blank");
}
ths.showHelp();
};
btnScore.onRelease = function () {
if (Math.random() < 0.1) {
trace("need gotoGameFalls");
_root.getURL("http://www.game-zoid.com/?from=Starship2swf", "_blank");
}
ths.showHighScores();
};
btn_Controls.onRelease = function () {
trace("go to gamefalls.com");
_root.getURL("http://www.game-zoid.com/?from=Starship2swf", "_blank");
};
}
function gotoGameFalls() {
trace("gotoGameFalls");
_root.getURL("http://www.game-zoid.com/?from=Starship2swf", "_blank");
}
function showHighScores() {
mcScore._visible = true;
mcScore.showScore();
}
function showHelp() {
mcHelp._visible = true;
}
function addScore(score) {
mcScore._visible = true;
mcScore.addScore(score);
}
function soundOff() {
_parent.soundOff();
}
function soundOn() {
_parent.soundOn();
}
}
Symbol 889 MovieClip [__Packages.WeaponMenu] Frame 0
class WeaponMenu extends MovieClip
{
var arrWeapons, mc_Me, btn_Ok, mc_UpgSpeed1, mc_UpgSpeed2, mc_UpgSpeed3, mc_UpgSpeed4, mc_UpgDmg1, mc_UpgDmg2, mc_UpgDmg3, mc_UpgDmg4, mc_Shadow1, mc_Shadow2, mc_Shadow3, tf_Points, tf_speed1, tf_dmg1, tf_speed2, tf_dmg2, tf_speed3, tf_dmg3, tf_speed4, tf_dmg4;
function WeaponMenu () {
super();
arrWeapons = new Array();
}
function show_(mc_Me, lvl) {
this.mc_Me = mc_Me;
if (lvl == 1) {
resetWeapons();
}
openPulverizer();
openRocket();
openPlasma();
this.lvl = lvl;
trace("Show Weapon Menu");
totalUpgBonuses = totalUpgBonuses + mc_Me.getUpgradeBonuses();
arrWeapons = mc_Me.getWeapons();
fillTextFields();
var ths = this;
btn_Ok.onRelease = function () {
ths._parent.startGame(ths.lvl + 1);
ths._visible = false;
};
mc_UpgSpeed1.onRelease = function () {
ths.improveSpeed(1);
};
mc_UpgSpeed2.onRelease = function () {
ths.improveSpeed(2);
};
mc_UpgSpeed3.onRelease = function () {
ths.improveSpeed(3);
};
mc_UpgSpeed4.onRelease = function () {
ths.improveSpeed(4);
};
mc_UpgDmg1.onRelease = function () {
ths.improveDmg(1);
};
mc_UpgDmg2.onRelease = function () {
ths.improveDmg(2);
};
mc_UpgDmg3.onRelease = function () {
ths.improveDmg(3);
};
mc_UpgDmg4.onRelease = function () {
ths.improveDmg(4);
};
}
function resetWeapons() {
mc_UpgSpeed2._visible = false;
mc_UpgDmg2._visible = false;
mc_Shadow1._visible = true;
mc_UpgSpeed3._visible = false;
mc_UpgDmg3._visible = false;
mc_Shadow2._visible = true;
mc_UpgSpeed4._visible = false;
mc_UpgDmg4._visible = false;
mc_Shadow3._visible = true;
}
function openPulverizer() {
mc_UpgSpeed2._visible = true;
mc_UpgDmg2._visible = true;
mc_Shadow1._visible = false;
}
function openRocket() {
mc_UpgSpeed3._visible = true;
mc_UpgDmg3._visible = true;
mc_Shadow2._visible = false;
}
function openPlasma() {
mc_UpgSpeed4._visible = true;
mc_UpgDmg4._visible = true;
mc_Shadow3._visible = false;
}
function improveDmg(wpnNum) {
if (totalUpgBonuses > 0) {
arrWeapons[wpnNum - 1].improveDamage();
totalUpgBonuses--;
}
fillTextFields();
}
function improveSpeed(wpnNum) {
if (totalUpgBonuses > 0) {
arrWeapons[wpnNum - 1].improveReloadTime();
totalUpgBonuses--;
}
fillTextFields();
}
function fillTextFields() {
tf_Points.text = String(totalUpgBonuses);
tf_speed1.text = String(0.01 * Math.round(100000 / arrWeapons[0].reloadTime));
tf_dmg1.text = String(arrWeapons[0].damage);
if (arrWeapons[1].reloadTime != undefined) {
tf_speed2.text = String(0.01 * Math.round(100000 / arrWeapons[1].reloadTime));
tf_dmg2.text = String(arrWeapons[1].damage);
} else {
tf_speed2.text = "";
tf_dmg2.text = "";
}
if (arrWeapons[2].reloadTime != undefined) {
tf_speed3.text = String(0.01 * Math.round(100000 / arrWeapons[2].reloadTime));
tf_dmg3.text = String(arrWeapons[2].damage);
} else {
tf_speed3.text = "";
tf_dmg3.text = "";
}
if (arrWeapons[3].reloadTime != undefined) {
tf_speed4.text = String(0.01 * Math.round(100000 / arrWeapons[3].reloadTime));
tf_dmg4.text = String(arrWeapons[3].damage);
} else {
tf_speed4.text = "";
tf_dmg4.text = "";
}
}
var totalUpgBonuses = 0;
var lvl = 0;
}
Symbol 890 MovieClip [__Packages.Controller] Frame 0
class Controller extends MovieClip
{
var mc_WeaponMenu, mc_WarField, mc_FinishDialog, mc_StartDialog, mc_BG, playSound;
function Controller () {
super();
mc_WeaponMenu._visible = false;
mc_WarField._visible = false;
mc_FinishDialog._visible = false;
mc_StartDialog._visible = false;
mc_BG._visible = false;
}
function onLoad() {
playSound = new Sound();
playSound.attachSound("menuSound");
playSound.setVolume(20);
playSound.start();
var ths = this;
playSound.onSoundComplete = function () {
ths.playSound.start();
};
showStartDialog();
}
function clearWarField() {
mc_WarField.clear_();
}
function showStartDialog() {
mc_WeaponMenu._visible = false;
mc_WarField._visible = false;
mc_FinishDialog._visible = false;
mc_BG._visible = false;
mc_StartDialog._visible = true;
}
function startGame(lvl) {
mc_WeaponMenu._visible = false;
mc_BG._visible = true;
mc_BG.setLvl_(1);
mc_FinishDialog._visible = false;
mc_StartDialog._visible = false;
mc_WarField._visible = true;
mc_WarField.setLvl(lvl);
}
function menu_() {
showStartDialog();
}
function endGame(win) {
showFinishDialog(win);
}
function showFinishDialog(win) {
mc_WeaponMenu._visible = false;
mc_FinishDialog._visible = true;
mc_FinishDialog.init(win);
}
function showWeaponMenu(mc_Me, lvl) {
mc_WeaponMenu._visible = true;
mc_WarField._visible = false;
mc_FinishDialog._visible = false;
mc_BG._visible = false;
mc_StartDialog._visible = false;
mc_WeaponMenu.show_(mc_Me, lvl);
}
function addScore() {
showStartDialog();
mc_StartDialog.addScore(mc_WarField.getScore());
}
function soundOff() {
playSound.setVolume(0);
}
function soundOn() {
playSound.setVolume(20);
}
}
Symbol 891 MovieClip [__Packages.BgItem] Frame 0
class BgItem
{
var owner, container, mc;
function BgItem (owner, container, attachName, onTop) {
this.owner = owner;
this.container = container;
var _local2 = container.getNextHighestDepth();
mc = container.attachMovie(attachName, attachName + String(_local2), _local2);
mc.cacheAsBitmap = true;
mc._x = (Math.random() * 1600) - 500;
if (onTop) {
mc._y = -600;
} else {
mc._y = (Math.random() * 2000) - 700;
}
mc._xscale = (Math.random() * 70) + 30;
mc._yscale = mc._xscale;
var ths = this;
mc.onEnterFrame = function () {
ths.doMove();
};
}
function doMove() {
mc._y = mc._y + speed;
if (mc._y >= 1500) {
deleteThis();
}
}
function setSpeed(val) {
speed = val;
}
function deleteThis() {
delete mc.onEnterFrame;
mc.removeMovieClip();
}
var speed = 0;
}
Symbol 892 MovieClip [__Packages.BG] Frame 0
class BG extends MovieClip
{
var mc_ItemContainer, xSpeed, ySpeed, mc_BG1, mc_BG2, arr_PosibleItems, onEnterFrame;
function BG () {
super();
mc_ItemContainer._alpha = 30;
}
function changeXSpeed(a) {
if ((xSpeed + a) < (-maxSpeed)) {
xSpeed = -maxSpeed;
} else if ((xSpeed + a) > maxSpeed) {
xSpeed = maxSpeed;
} else if (((xSpeed / (xSpeed + a)) < 0) and (xSpeed != 0)) {
xSpeed = 0;
} else {
xSpeed = xSpeed + a;
}
}
function changeYSpeed(a) {
if ((ySpeed + a) < (-maxSpeed)) {
ySpeed = -maxSpeed;
} else if ((ySpeed + a) > maxSpeed) {
ySpeed = maxSpeed;
} else if (((ySpeed / (ySpeed + a)) < 0) and (ySpeed != 0)) {
ySpeed = 0;
} else {
ySpeed = ySpeed + a;
}
}
function checkMove() {
if (Key.isDown(39)) {
changeXSpeed(a_);
if (((mc_ItemContainer._x + xSpeed) > minX) and ((mc_ItemContainer._x + xSpeed) < maxX)) {
mc_ItemContainer._x = mc_ItemContainer._x + xSpeed;
} else {
if ((mc_ItemContainer._x + xSpeed) < minX) {
var _local3 = mc_ItemContainer._x - minX;
mc_ItemContainer._x = mc_ItemContainer._x - _local3;
} else if ((mc_ItemContainer._x + xSpeed) > maxX) {
var _local3 = maxX - mc_ItemContainer._x;
mc_ItemContainer._x = mc_ItemContainer._x + _local3;
}
xSpeed = 0;
}
} else if (Key.isDown(37)) {
changeXSpeed(-a_);
if (((mc_ItemContainer._x + xSpeed) > minX) and ((mc_ItemContainer._x + xSpeed) < maxX)) {
mc_ItemContainer._x = mc_ItemContainer._x + xSpeed;
} else {
if ((mc_ItemContainer._x + xSpeed) < minX) {
var _local3 = mc_ItemContainer._x - minX;
mc_ItemContainer._x = mc_ItemContainer._x - _local3;
} else if ((mc_ItemContainer._x + xSpeed) > maxX) {
var _local3 = maxX - mc_ItemContainer._x;
mc_ItemContainer._x = mc_ItemContainer._x + _local3;
}
xSpeed = 0;
}
} else if (Math.abs(xSpeed) > 0) {
if (((mc_ItemContainer._x + xSpeed) > minX) and ((mc_ItemContainer._x + xSpeed) < maxX)) {
changeXSpeed(a_ * (xSpeed / Math.abs(xSpeed)));
mc_ItemContainer._x = mc_ItemContainer._x + xSpeed;
} else {
if ((mc_ItemContainer._x + xSpeed) < minX) {
var _local3 = mc_ItemContainer._x - minX;
mc_ItemContainer._x = mc_ItemContainer._x - _local3;
} else if ((mc_ItemContainer._x + xSpeed) > maxX) {
var _local3 = maxX - mc_ItemContainer._x;
mc_ItemContainer._x = mc_ItemContainer._x + _local3;
}
xSpeed = 0;
}
}
if (Key.isDown(40)) {
changeYSpeed(a_);
if (((mc_ItemContainer._y + ySpeed) > minY) and ((mc_ItemContainer._y + ySpeed) < maxY)) {
mc_ItemContainer._y = mc_ItemContainer._y + ySpeed;
} else {
if ((mc_ItemContainer._y + ySpeed) < minY) {
var _local2 = mc_ItemContainer._y - minY;
mc_ItemContainer._y = mc_ItemContainer._y - _local2;
} else if ((mc_ItemContainer._y + ySpeed) > maxY) {
var _local2 = maxY - mc_ItemContainer._y;
mc_ItemContainer._y = mc_ItemContainer._y + _local2;
}
ySpeed = 0;
}
} else if (Key.isDown(38)) {
changeYSpeed(-a_);
if (((mc_ItemContainer._y + ySpeed) > minY) and ((mc_ItemContainer._y + ySpeed) < maxY)) {
mc_ItemContainer._y = mc_ItemContainer._y + ySpeed;
} else {
if ((mc_ItemContainer._y + ySpeed) < minY) {
var _local2 = mc_ItemContainer._y - minY;
mc_ItemContainer._y = mc_ItemContainer._y - _local2;
} else if ((mc_ItemContainer._y + ySpeed) > maxY) {
var _local2 = maxY - mc_ItemContainer._y;
mc_ItemContainer._y = mc_ItemContainer._y + _local2;
}
ySpeed = 0;
}
} else if (Math.abs(ySpeed) > 0) {
if (((mc_ItemContainer._y + ySpeed) > minY) and ((mc_ItemContainer._y + ySpeed) < maxY)) {
changeYSpeed(a_ * (ySpeed / Math.abs(ySpeed)));
mc_ItemContainer._y = mc_ItemContainer._y + ySpeed;
} else {
if ((mc_ItemContainer._y + ySpeed) < minY) {
var _local2 = mc_ItemContainer._y - minY;
mc_ItemContainer._y = mc_ItemContainer._y - _local2;
} else if ((mc_ItemContainer._y + ySpeed) > maxY) {
var _local2 = maxY - mc_ItemContainer._y;
mc_ItemContainer._y = mc_ItemContainer._y + _local2;
}
ySpeed = 0;
}
}
}
function setLvl_(lvl) {
stop_();
if (mc_BG1 != null) {
mc_BG1._x = -1000;
mc_BG2._x = -1000;
}
mc_BG1 = getBGForLvl(lvl, "a");
mc_BG2 = getBGForLvl(lvl, "b");
mc_BG1._x = 0;
mc_BG2._x = 0;
mc_BG1._y = 0;
mc_BG2._y = (-mc_BG2._height) + 2;
arr_PosibleItems = new Array();
arr_PosibleItems = getItemsForLvl(lvl);
var _local2 = 0;
while (_local2 < 20) {
putItem(1, false);
_local2++;
}
move_();
}
function move_() {
onEnterFrame = function () {
this.doMove();
this.checkMove();
};
}
function doMove() {
mc_BG1._y = mc_BG1._y + speed;
mc_BG2._y = mc_BG2._y + speed;
if (mc_BG2._y >= 550) {
mc_BG2._y = (mc_BG1._y - mc_BG2._height) + 2;
}
if (mc_BG1._y >= 550) {
mc_BG1._y = (mc_BG2._y - mc_BG1._height) + 2;
}
putItem(0.05, true);
}
function stop_() {
delete onEnterFrame;
}
function getBGForLvl(lvl, str) {
return(this[("mc_BGLvl" + String(lvl)) + str]);
}
function putItem(probability, onTop) {
var _local3 = Math.random();
if (_local3 < probability) {
var _local2 = new BgItem(this, mc_ItemContainer, getRandomItemAttachName(), onTop);
_local2.setSpeed(speed);
}
}
function getRandomItemAttachName() {
var _local2 = Math.round(Math.random() * arr_PosibleItems.length) - 1;
return(arr_PosibleItems[_local2].mc);
}
function getItemsForLvl(lvl) {
var _local2 = new Array();
_local2.push(items1);
_local2.push(items2);
_local2.push(items3);
_local2.push(items4);
_local2.push(items5);
_local2.push(items6);
_local2.push(items7);
_local2.push(items8);
_local2.push(items9);
_local2.push(items10);
_local2.push(items11);
_local2.push(items13);
_local2.push(items14);
return(_local2);
}
var items1 = {mc:"bgItem1"};
var items2 = {mc:"bgItem2"};
var items3 = {mc:"bgItem3"};
var items4 = {mc:"bgItem4"};
var items5 = {mc:"bgItem5"};
var items6 = {mc:"bgItem6"};
var items7 = {mc:"bgItem7"};
var items8 = {mc:"bgItem8"};
var items9 = {mc:"bgItem9"};
var items10 = {mc:"bgItem10"};
var items11 = {mc:"bgItem11"};
var items13 = {mc:"bgItem13"};
var items14 = {mc:"bgItem14"};
var speed = 4;
var maxX = 500;
var minX = -500;
var maxY = 500;
var minY = -500;
var startMaxSpeed = 2;
var maxSpeed = BG.prototype.startMaxSpeed;
var startA = -0.3;
var a_ = BG.prototype.startA;
}
Symbol 414 MovieClip [BG] Frame 1
#initclip 33
Object.registerClass("BG", BG);
#endinitclip
Symbol 434 MovieClip [me] Frame 1
#initclip 24
Object.registerClass("me", Me);
#endinitclip
stop();
Symbol 437 MovieClip Frame 1
stop();
Symbol 437 MovieClip Frame 12
gotoAndStop (1);
Symbol 443 MovieClip Frame 1
stop();
Symbol 443 MovieClip Frame 111
this._parent.finishTransition();
Symbol 519 MovieClip Frame 1
stop();
Symbol 520 MovieClip [WarField] Frame 1
#initclip 25
Object.registerClass("WarField", WarField);
#endinitclip
Symbol 528 MovieClip [FinishDialog] Frame 1
#initclip 26
Object.registerClass("FinishDialog", FinishDialog);
#endinitclip
Symbol 577 MovieClip [help] Frame 1
#initclip 27
Object.registerClass("help", Help);
#endinitclip
Symbol 580 MovieClip [HightScore] Frame 1
#initclip 28
Object.registerClass("HightScore", HightScore);
#endinitclip
Symbol 581 MovieClip [StartDialog] Frame 1
#initclip 29
Object.registerClass("StartDialog", StartDialog);
#endinitclip
Symbol 602 MovieClip [weaponsMenu_] Frame 1
#initclip 30
Object.registerClass("weaponsMenu_", WeaponMenu);
#endinitclip
Symbol 603 MovieClip [Controller] Frame 1
#initclip 31
Object.registerClass("Controller", Controller);
#endinitclip
Symbol 604 MovieClip [bgItem] Frame 1
#initclip 32
Object.registerClass("bgItem", BgItem);
#endinitclip
Symbol 785 MovieClip [bonusExpl3] Frame 1
stop();
Symbol 785 MovieClip [bonusExpl3] Frame 15
this.removeMovieClip();
this.unloadMovie();
Symbol 819 MovieClip [BonusExpl2] Frame 1
stop();
Symbol 819 MovieClip [BonusExpl2] Frame 16
this.removeMovieClip();
this.unloadMovie();
Symbol 847 MovieClip [BonusExpl1] Frame 1
stop();
Symbol 847 MovieClip [BonusExpl1] Frame 13
this.removeMovieClip();
this.unloadMovie();
Symbol 869 MovieClip Frame 1
stop();