Instance of Symbol 5 MovieClip in Frame 2
on (press) {
this._parent.more_pressed();
}
Instance of Symbol 12 MovieClip in Frame 2
on (press) {
this._parent.more_pressed();
}
Frame 3
stot = this.getBytesTotal();
sloa = this.getBytesLoaded();
if (stot != 0) {
per = Math.floor((sloa / stot) * 100);
} else {
per = 0;
}
mc_bar.mc._x = mc_bar.mc._width * (-1 + (sloa / stot));
txtPer = String(per) + "%";
if (((sloa >= 1) && (stot >= 1)) && (sloa == stot)) {
gotoAndStop ("main");
inMenuFirst();
} else {
gotoAndPlay (2);
}
Instance of Symbol 135 MovieClip in Frame 5
onClipEvent (load) {
this._parent.zastInitFon();
}
onClipEvent (enterFrame) {
this._parent.zastProcessFon();
}
Instance of Symbol 157 MovieClip "mc_sloop" in Frame 5
onClipEvent (load) {
var soundControl = new Sound(this);
}
Instance of Symbol 162 MovieClip "btn_sound" in Frame 5
onClipEvent (load) {
if (this._parent.stopSoundFlag) {
this.gotoAndStop(2);
}
}
Frame 7
this.stop();
Instance of Symbol 135 MovieClip "mc_control" in Frame 7
onClipEvent (load) {
this._parent.initLevel();
}
onClipEvent (enterFrame) {
this._parent.processGame();
}
onClipEvent (mouseMove) {
this._parent.myMouseMove();
}
onClipEvent (keyDown) {
this._parent.myKeyDown();
}
onClipEvent (mouseUp) {
this._parent.myMouseUp();
}
Symbol 1 MovieClip Frame 1
#initclip 11
function soundOff() {
mc_sloop.gotoAndStop(3);
stopSoundFlag = true;
}
function soundOn() {
mc_sloop.gotoAndStop(2);
stopSoundFlag = false;
}
function new_game_pressed() {
gameStart();
}
function how_to_play_pressed() {
this.gotoAndStop("rules");
}
function more_pressed() {
getURL ("http://www.justfreegames.com?WT.mc_id=FlashNavalStrike", "_blank");
}
function back_pressed() {
this.gotoAndStop("main");
}
function inMenuFirst() {
mc_sloop.gotoAndStop(2);
objBack = new CBack();
objTransform = new CTransform(WORLD_CENTER_X, WORLD_CENTER_Y);
objTimeCounter = new CTimeCounter();
}
function gameStart() {
level = 0;
scores = 0;
lifeScores = 0;
lifeCount = startLifeCount;
nextLevel();
}
function nextLevel() {
level++;
armorCount = startArmorCount;
initLevelDifficult();
this.gotoAndStop("reset");
this.gotoAndStop("game");
}
function newGame() {
this.gotoAndStop("reset");
this.gotoAndStop("main");
}
function playSnd(lib_snd) {
if (stopSoundFlag) {
return(undefined);
}
s = new Sound(this);
s.attachSound(lib_snd);
s.start();
}
function zastInitFon() {
objBack.init(mc_fon.mc_water.mc, 100);
lastTimer = getTimer();
}
function zastProcessFon() {
var _local1;
var _local2;
_local1 = getTimer();
_local2 = _local1 - lastTimer;
txtFps = 1 / (_local2 / 1000);
lastTimer = _local1;
objBack.process(_local2, 0, 1);
}
function initLevel() {
lastTimer = getTimer();
objBack.init(mc_fon.mc_water.mc, 100);
objTransform.init(WORLD_WIDTH, WORLD_HEIGHT, WORLD_DEPTH, 0.4);
mc_player.init(1152, 48, 512);
mc_player.toFly();
CEnemyPlane.PLAYER = mc_player;
CShip.PLAYER = mc_player;
shotCounter = 0;
planesCounter = 10000;
torpedsCounter = 0;
txtScores = scores;
txtLifes = lifeCount;
txtTransports = curNumTransports;
txtAllTransports = levelNumForVictory;
objTimeCounter.setTime(3000);
mc_message.gotoAndStop("stLevel");
mc_message.mc_lev.txtLev = level;
gameState = 0;
winFlag = false;
extraLife = false;
resetSounds();
}
function processGame() {
var _local3;
var _local2;
_local3 = getTimer();
_local2 = _local3 - lastTimer;
txtFps = 1 / (_local2 / 1000);
lastTimer = _local3;
playSounds();
if (gameState == 5) {
return(undefined);
}
if (gameState == 0) {
if (!objTimeCounter.process(_local2)) {
mc_message.gotoAndStop("stEmpty");
gameState = 1;
}
} else if ((gameState == 2) || (gameState == 4)) {
if (!objTimeCounter.process(_local2)) {
newGame();
return(undefined);
}
} else if (gameState == 3) {
if (!objTimeCounter.process(_local2)) {
nextLevel();
return(undefined);
}
}
if (extraLife) {
if (!objTimeCounter.process(_local2)) {
extraLife = false;
mc_message.gotoAndStop("stEmpty");
}
}
if (winFlag && (gameState != 3)) {
if (noEnemies()) {
toWinLevel();
}
}
if (gameState != 0) {
mc_player.process(_local2);
}
doPlayerConstraints();
objTransform.nearDX = -mc_player.x;
objTransform.nearDY = -mc_player.y;
doWorldCoordsConstraints();
mc_player.screenSynchronize(objTransform);
synchronizeWater();
synchronizeWater2(_local2);
if (gameState == 1) {
if (!mc_player.isFall()) {
if (Key.isDown(1) || (Key.isDown(17))) {
mc_player.tryShot();
if (mc_player.isShot()) {
doPlayerShot();
}
}
if (mc_player.canTorpedo() && (Key.isDown(32))) {
mc_player.doTorpedo();
addTorpedo1();
}
}
if (!winFlag) {
if (curNumShips < levelMaxNumShips) {
generateShips(_local2);
}
if (curNumPlanes < levelMaxNumPlanes) {
generatePlanes(_local2);
}
}
}
if (gameState > 0) {
processShots(_local2);
processEnemyShots(_local2);
processPlanes(_local2);
processShips(_local2);
processTorpeds(_local2);
}
if ((gameState == 1) && (mc_player.isOver())) {
if (lifeCount <= 0) {
toGameOver();
} else {
if (curNumTransports <= 0) {
nextLevel();
} else {
armorCount = startArmorCount;
curNumPlanes = (curNumShips = 0);
this.gotoAndStop("reset");
this.gotoAndStop("game");
}
return(undefined);
}
}
}
function myKeyDown() {
if (gameState == 1) {
if (Key.isDown(80)) {
mc_message.gotoAndStop("stPause");
gameState = 5;
extraLife = false;
}
} else if (gameState == 5) {
if (Key.isDown(80)) {
mc_message.gotoAndStop("stEmpty");
gameState = 1;
}
}
}
function myMouseUp() {
if ((gameState == 2) || (gameState == 4)) {
newGame();
} else if (gameState == 3) {
nextLevel();
}
}
function myMouseMove() {
mc_player.myMouseMove();
}
function initLevelDifficult() {
var _local1;
var _local2;
_local2 = levels.length;
_local1 = 0;
while (_local1 < _local2) {
if (level <= levels[_local1]) {
break;
}
_local1++;
}
levelNumForVictory = m_iNumForVictory[_local1];
levelMaxNumShips = m_iMaxNumShips[_local1];
levelMaxNumPlanes = m_iMaxNumPlanes[_local1];
curNumShips = 0;
curNumPlanes = 0;
curNumTransports = levelNumForVictory;
levelShipCoeff = m_fShipCoeff[_local1];
levelBigShipCoeff = m_fBigShipCoeff[_local1];
levelBigPlaneCoeff = m_fBigPlaneCoeff[_local1];
curShipCoeff = 0;
curBigShipCoeff = 0;
curBigPlaneCoeff = 0;
m_fTimeToAddShip = TIME_TO_SHIP / 2;
m_fTimeToAddPlane = TIME_TO_PLANE / 2;
transportSpeed = 35 + (level * 0.3);
shipSpeed = 38 + (level * 0.3);
bigShipSpeed = 32 + (level * 0.3);
planeSpeed = 30 + (level * 0.15);
bigPlaneSpeed = 25 + (level * 0.3);
}
function removePlaneEvent(mc) {
curNumPlanes--;
}
function removeShipEvent(mc) {
curNumShips--;
}
function generateShips(dTime) {
m_fTimeToAddShip = m_fTimeToAddShip + dTime;
if (m_fTimeToAddShip >= TIME_TO_SHIP) {
m_fTimeToAddShip = 0;
if (curBigShipCoeff >= 1) {
curBigShipCoeff = curBigShipCoeff - 1;
addShip(2);
} else if (curShipCoeff >= 1) {
curShipCoeff = curShipCoeff - 1;
addShip(1);
} else {
curShipCoeff = curShipCoeff + levelShipCoeff;
curBigShipCoeff = curBigShipCoeff + levelBigShipCoeff;
addShip(0);
}
}
}
function generatePlanes(dTime) {
m_fTimeToAddPlane = m_fTimeToAddPlane + dTime;
if (m_fTimeToAddPlane >= TIME_TO_PLANE) {
m_fTimeToAddPlane = 0;
if (curBigPlaneCoeff >= 1) {
curBigPlaneCoeff = curBigPlaneCoeff - 1;
addEnemyBigPlane();
} else {
curBigPlaneCoeff = curBigPlaneCoeff + levelBigPlaneCoeff;
addEnemyPlane();
}
}
}
function addTorpedo1() {
var _local2 = new CVector3D(mc_player.x, mc_player.y + (mc_player._height / 2), 0);
var _local3 = new CVector3D(0, 1, 0);
var _local1 = mc_torpeds1.attachMovie("lib_torpedo", "" + torpedsCounter, torpedsCounter);
torpedsCounter++;
if (torpedsCounter > 10000) {
torpedsCounter = 0;
}
_local1.init(_local2, _local3, TORPEDO_DOWN_SPEED, 2);
_local1.screenSynchronize(objTransform);
sndTorpout2 = true;
}
function addTorpedo2(pos) {
pos.y = WORLD_HEIGHT;
var _local2 = new CVector3D(0, 0, 1);
var _local1 = mc_torpeds2.attachMovie("lib_torpedo", "" + torpedsCounter, torpedsCounter);
torpedsCounter++;
if (torpedsCounter > 10000) {
torpedsCounter = 0;
}
_local1.init(pos, _local2, TORPEDO_SWIM_SPEED, 2);
_local1.screenSynchronize(objTransform);
_local1._alpha = 50;
}
function processTorpeds(dTime) {
var _local4;
var _local2;
var _local6;
var _local1;
var _local9;
var _local8;
var _local3;
var _local7;
var _local5;
for (_local4 in mc_torpeds1) {
_local2 = mc_torpeds1[_local4];
_local2.process(dTime);
_local2.screenSynchronize(objTransform);
_local2._yscale = _local2._yscale * -1;
if (_local2.pos.y >= WORLD_HEIGHT) {
addTorpedo2(_local2.pos);
_local2.disable();
}
}
for (_local4 in mc_torpeds2) {
_local2 = mc_torpeds2[_local4];
_local2.process(dTime);
_local2.screenSynchronize(objTransform);
if (_local2.pos.z > objTransform.depth) {
_local2.disable();
_local2 = null;
continue;
}
for (_local6 in mc_ships) {
_local1 = mc_ships[_local6];
if (_local1.depthInMovie == undefined) {
continue;
}
if ((((_local2.pos.z >= _local1.pos.z) && (_local2.oldPos.z < _local1.pos.z)) && (_local2.pos.x > (_local1.pos.x - _local1.myWidth2))) && (_local2.pos.x < (_local1.pos.x + _local1.myWidth2))) {
if (_local1.doDmage()) {
if (_local1.myType == 0) {
curNumTransports--;
if (curNumTransports < 0) {
curNumTransports = 0;
}
txtTransports = curNumTransports;
sndTransportdown2 = true;
checkForWin();
} else {
sndWarshipdown = true;
}
_local9 = _local1._x;
_local8 = _local1._y + (_local1._height * 0.1);
_local3 = _local1.pos;
_local7 = _local1.depthInMovie;
_local5 = _local1._xscale * _local1.myScale;
curNumShips--;
_local1.disable();
_local1 = null;
addWaterBoom(mc_ships, _local7, _local9, _local8, _local3, _local5);
addScores(scrShip);
} else {
_local3 = new CVector3D(_local2._x, _local2._y, 0);
_local2._parent.localToGlobal(_local3);
_local1.globalToLocal(_local3);
_local1 = _local1.attachMovie("lib_boom", "0", 0);
_local1._x = _local3.x;
_local1._y = _local3.y;
sndWarshiphit = true;
}
_local2.disable();
_local2 = null;
break;
}
}
}
}
function getFreeShipDepth() {
var _local1 = random(shipDepthCount);
var _local2;
_local2 = 0;
while (_local2 < shipDepthCount) {
if (mc_ships["" + _local1] == undefined) {
break;
}
_local1 = _local1 + 1;
if (_local1 >= shipDepthCount) {
_local1 = 0;
}
_local2++;
}
return(_local1);
}
function addShip(shipType) {
var _local1 = getFreeShipDepth();
var _local2;
var _local6;
var _local8;
var _local5;
var _local7;
var _local3;
if (_local1 < 0) {
return(false);
}
if (shipType == 0) {
_local3 = transportSpeed + (transportSpeed * (-0.1 + (0.2 * Math.random())));
} else if (shipType == 1) {
_local3 = shipSpeed + (shipSpeed * (-0.1 + (0.2 * Math.random())));
} else {
_local3 = bigShipSpeed + (bigShipSpeed * (-0.1 + (0.2 * Math.random())));
}
_local2 = mc_ships.attachMovie("lib_ship" + shipType, "" + _local1, _local1);
_local6 = WORLD_DEPTH * (shipFarDepthPerc - (((shipFarDepthPerc - shipNearDepthPerc) * _local1) / shipDepthCount));
_local5 = objTransform.getKForZ(_local6);
_local8 = objTransform.getWorldXFromScreen(((-_local2._width) / 2) * _local5, _local5);
_local7 = new CVector3D(_local8, WORLD_HEIGHT, _local6);
_local2.init(shipType, _local3, _local7, _local1);
_local2.screenSynchronize(objTransform);
curNumShips++;
return(true);
}
function processShips(dTime) {
var _local2;
var _local1;
for (_local2 in mc_ships) {
_local1 = mc_ships[_local2];
_local1.process(dTime);
_local1.screenSynchronize(objTransform);
if (_local1.removeFlag) {
removeShipEvent(_local1);
_local1.disable();
} else if (_local1.canShot() && (gameState == 1)) {
if (_local1.shotCounter == 0) {
sndShipshot = true;
}
_local1.doShot();
doEnemyShipShot(_local1);
}
}
}
function addEnemyPlane() {
var _local2;
var _local3 = new CVector3D(((-WORLD_WIDTH) * 0.9) + ((WORLD_WIDTH * 1.8) * Math.random()), ((-WORLD_HEIGHT) * 0.8) + ((WORLD_HEIGHT * 1.2) * Math.random()), objTransform.depth);
var _local1 = new CVector3D(((-WORLD_WIDTH) * 0.9) + ((WORLD_WIDTH * 1.8) * Math.random()), ((-WORLD_HEIGHT) * 0.8) + ((WORLD_HEIGHT * 1.2) * Math.random()), 0);
_local1.minus(_local3);
_local1.normalize();
_local2 = mc_planes.attachMovie("lib_enemy_plane", "" + planesCounter, planesCounter);
planesCounter--;
if (planesCounter < 0) {
planesCounter = 10000;
}
_local2.init(_local3, _local1, planeSpeed, objTransform, false, planesCounter + 1);
_local2.screenSynchronize(objTransform);
curNumPlanes++;
}
function addEnemyBigPlane() {
var _local2;
var _local3 = new CVector3D(((-WORLD_WIDTH) * 0.9) + ((WORLD_WIDTH * 1.8) * Math.random()), ((-WORLD_HEIGHT) * 0.8) + ((WORLD_HEIGHT * 1.2) * Math.random()), objTransform.depth);
var _local1 = new CVector3D(((-WORLD_WIDTH) * 0.9) + ((WORLD_WIDTH * 1.8) * Math.random()), ((-WORLD_HEIGHT) * 0.8) + ((WORLD_HEIGHT * 1) * Math.random()), 0);
_local1.minus(_local3);
_local1.normalize();
_local2 = mc_planes.attachMovie("lib_enemy_plane_big", "" + planesCounter, planesCounter);
planesCounter--;
if (planesCounter < 0) {
planesCounter = 10000;
}
_local2.init(_local3, _local1, bigPlaneSpeed, objTransform, true, planesCounter + 1);
_local2.screenSynchronize(objTransform);
curNumPlanes++;
}
function processPlanes(dTime) {
var _local2;
var _local1;
for (_local2 in mc_planes) {
_local1 = mc_planes[_local2];
_local1.process(dTime);
_local1.screenSynchronize(objTransform);
if (_local1.toAway) {
_local1.toAway = false;
if ((((_local1._x > _local1.myWidth2) && (_local1._x < (LEVEL_WIDTH - _local1.myWidth2))) && (_local1._y > _local1.myHeight2)) && (_local1._y < (LEVEL_HEIGHT - _local1.myHeight2))) {
sndPlaneryadom = true;
}
}
if (_local1.removeFlag) {
removePlaneEvent(_local1);
_local1.disable();
} else if (_local1.canShot() && (gameState == 1)) {
if (_local1.shotCounter == 0) {
sndEnemyshots = true;
}
_local1.doShot();
if (_local1.bigPlane) {
doEnemyBigPlaneShot(_local1);
} else {
doEnemyPlaneShot(_local1);
}
}
}
}
function doEnemyPlaneShot(mc_plane) {
var _local2 = new CVector3D(mc_plane.pos.x, mc_plane.pos.y, mc_plane.pos.z);
var _local1 = new CVector3D((mc_player.x - 70) + (140 * Math.random()), (mc_player.y - 100) + (200 * Math.random()), 0);
var _local3 = mc_e_shots.attachMovie("lib_shot", "" + shotCounter, shotCounter);
shotCounter++;
if (shotCounter > 10000) {
shotCounter = 0;
}
_local1.minus(_local2);
_local1.normalize();
_local2.plus(_local1.multNew(CShot.LENGTH));
_local3.init(_local2, _local1, ENEMY_PLANE_SHOT_SPEED, 3);
_local3.screenSynchronize(objTransform);
}
function doEnemyBigPlaneShot(mc_plane) {
var _local2 = new CVector3D(mc_plane.pos.x, mc_plane.pos.y, mc_plane.pos.z);
var _local1 = new CVector3D((mc_player.x - 50) + (100 * Math.random()), (mc_player.y - 70) + (150 * Math.random()), 0);
var _local3 = mc_e_shots.attachMovie("lib_shot2", "" + shotCounter, shotCounter);
shotCounter++;
if (shotCounter > 10000) {
shotCounter = 0;
}
_local1.minus(_local2);
_local1.normalize();
_local2.plus(_local1.multNew(CShot.LENGTH));
_local3.init(_local2, _local1, ENEMY_PLANE_SHOT_SPEED, 4);
_local3.screenSynchronize(objTransform);
}
function doEnemyShipShot(mc_ship) {
var _local4 = new CVector3D(mc_ship.pos.x, objTransform.getWorldYFromScreen(mc_ship._y - (mc_ship._height / 2), objTransform.getKForZ(mc_ship.pos.z)), mc_ship.pos.z);
var _local2 = new CVector3D((mc_player.x - 150) + (300 * Math.random()), (mc_player.y - 150) + (450 * Math.random()), 0);
var _local3 = mc_e_shots.attachMovie("lib_shot2", "" + shotCounter, shotCounter);
shotCounter++;
if (shotCounter > 10000) {
shotCounter = 0;
}
_local2.minus(_local4);
_local2.normalize();
_local3.init(_local4, _local2, ENEMY_SHIP_SHOT_SPEED, 4);
_local3.screenSynchronize(objTransform);
}
function processEnemyShots(dTime) {
var _local2;
var _local1;
var _local4 = {x:0, y:0};
for (_local2 in mc_e_shots) {
_local1 = mc_e_shots[_local2];
_local1.process(dTime);
_local1.screenSynchronize(objTransform);
if (_local1.pos.z < (CShot.LENGTH / 2)) {
if ((((((gameState == 1) && (!mc_player.migFlag)) && (_local1._x > (mc_player._x - (mc_player._width / 2)))) && (_local1._x < (mc_player._x + (mc_player._width / 2)))) && (_local1._y > (mc_player._y - (mc_player._height * 0.4)))) && (_local1._y < (mc_player._y + (mc_player._height * 0.4)))) {
mc_player.toMig();
decrementArmor();
_local1.disable();
_local1 = null;
} else if (_local1.pos.z < 0) {
_local1.disable();
_local1 = null;
}
}
}
}
function doPlayerShot() {
var _local1 = {x:0, y:0};
_local1.x = mc_player.mc.p1._x;
_local1.y = mc_player.mc.p1._y;
mc_player.mc.localToGlobal(_local1);
mc_player._parent.globalToLocal(_local1);
_local1.x = (mc_player.x + _local1.x) - mc_player._x;
_local1.y = (mc_player.y + _local1.y) - mc_player._y;
generatePlayerShot(_local1.x, _local1.y);
_local1.x = mc_player.mc.p2._x;
_local1.y = mc_player.mc.p2._y;
mc_player.mc.localToGlobal(_local1);
mc_player._parent.globalToLocal(_local1);
_local1.x = (mc_player.x + _local1.x) - mc_player._x;
_local1.y = (mc_player.y + _local1.y) - mc_player._y;
generatePlayerShot(_local1.x, _local1.y);
sndCannon = true;
}
function generatePlayerShot(x, y) {
var _local2 = new CVector3D(x, y, CShot.LENGTH);
var _local3 = new CVector3D(0, 0, 1);
var _local1 = mc_shots.attachMovie("lib_shot", "" + shotCounter, shotCounter);
shotCounter++;
if (shotCounter > 10000) {
shotCounter = 0;
}
_local1.init(_local2, _local3, PLAYER_SHOT_SPEED, 1);
_local1.screenSynchronize(objTransform);
}
function processShots(dTime) {
var _local9;
var _local2;
var _local5;
var _local1;
var _local8;
var _local7;
var _local4;
var _local6;
var _local3;
for (_local9 in mc_shots) {
_local2 = mc_shots[_local9];
_local2.process(dTime);
_local2.screenSynchronize(objTransform);
if (_local2.pos.z > (objTransform.depth * 1.2)) {
_local2.disable();
_local2 = null;
continue;
}
for (_local5 in mc_planes) {
_local1 = mc_planes[_local5];
if (_local1.depthInMovie == undefined) {
continue;
}
if ((((((_local2.pos.x > (_local1.pos.x - _local1.myWidth2)) && (_local2.pos.x < (_local1.pos.x + _local1.myWidth2))) && (_local2.pos.y > (_local1.pos.y - _local1.myHeight2))) && (_local2.pos.y < (_local1.pos.y + _local1.myHeight2))) && (_local2.pos.z > (_local1.pos.z - _local1.myDepth2))) && (_local2.pos.z < (_local1.pos.z + _local1.myDepth2))) {
if (_local1.doDmage()) {
_local8 = _local1._x;
_local7 = _local1._y;
_local4 = _local1.pos;
_local6 = _local1.depthInMovie;
_local3 = _local1._xscale;
curNumPlanes--;
_local1.disable();
_local2.disable();
_local2 = null;
_local1 = null;
addBoom(mc_planes, _local6, _local8, _local7, _local4, _local3 * 2);
addScores(scrPlane);
sndEnemy_exp = true;
} else {
_local1.attachMovie("lib_boom", "0", 0);
}
break;
}
}
}
}
function addBoom(parentMovie, depth, x, y, pos, scale) {
var _local1 = parentMovie.attachMovie("lib_boom", "" + depth, depth);
_local1._xscale = (_local1._yscale = scale);
_local1._x = x;
_local1._y = y;
_local1.init(pos);
}
function addWaterBoom(parentMovie, depth, x, y, pos, scale) {
var _local1 = parentMovie.attachMovie("lib_water_boom", "" + depth, depth);
_local1._xscale = (_local1._yscale = scale);
_local1._x = x;
_local1._y = y;
_local1.init(pos);
}
function doPlayerConstraints() {
if (mc_player.isFall()) {
return(undefined);
}
if (mc_player.x > (WORLD_WIDTH - (mc_player.xRad * 0.7))) {
mc_player.x = WORLD_WIDTH - (mc_player.xRad * 0.7);
} else if (mc_player.x < ((-WORLD_WIDTH) + (mc_player.xRad * 0.7))) {
mc_player.x = (-WORLD_WIDTH) + (mc_player.xRad * 0.7);
}
if (mc_player.y > ((WORLD_HEIGHT - mc_player.yRad) - 40)) {
mc_player.y = (WORLD_HEIGHT - mc_player.yRad) - 40;
} else if (mc_player.y < ((-WORLD_HEIGHT) + mc_player.yRad)) {
mc_player.y = (-WORLD_HEIGHT) + mc_player.yRad;
}
}
function doWorldCoordsConstraints() {
if (((objTransform.nearCX + objTransform.nearDX) + WORLD_WIDTH) < LEVEL_WIDTH) {
objTransform.nearDX = (LEVEL_WIDTH - WORLD_WIDTH) - objTransform.nearCX;
} else if (((objTransform.nearCX + objTransform.nearDX) - WORLD_WIDTH) > 0) {
objTransform.nearDX = WORLD_WIDTH - objTransform.nearCX;
}
if ((((objTransform.nearCY + objTransform.nearDY) + WORLD_HEIGHT) - 25) < LEVEL_HEIGHT) {
objTransform.nearDY = ((LEVEL_HEIGHT - WORLD_HEIGHT) - objTransform.nearCY) + 25;
} else if (((objTransform.nearCY + objTransform.nearDY) - WORLD_HEIGHT) > 0) {
objTransform.nearDY = WORLD_HEIGHT - objTransform.nearCY;
}
}
function synchronizeWater() {
var _local1 = {x:0, y:mc_fon.mc_h._y};
var _local3;
var _local2 = {x:0, y:0, k:0};
mc_fon.localToGlobal(_local1);
mc_fon._parent.globalToLocal(_local1);
objTransform.getScreenXY(0, WORLD_HEIGHT, objTransform.depth, _local2);
_local3 = _local2.y - _local1.y;
mc_fon._y = mc_fon._y + _local3;
}
function synchronizeWater2(dTime) {
var _local1 = 0;
var _local2;
_local1 = (-mc_player.dir.x) * mc_player.curSpeed;
_local2 = 1 - (objTransform.nearDY / 700);
objBack.process(dTime, _local1, _local2 * 0.7);
}
function addScores(num) {
scores = scores + num;
lifeScores = lifeScores + num;
if (lifeScores >= SCORES_FOR_LIFE) {
lifeScores = lifeScores - SCORES_FOR_LIFE;
incrementLife();
}
txtScores = scores;
}
function decrementArmor() {
_root["mc_armor" + armorCount]._visible = false;
armorCount--;
if (armorCount <= 0) {
decrementLife();
}
}
function decrementLife() {
lifeCount--;
mc_player.toFall();
txtLifes = lifeCount;
sndDeath = true;
}
function incrementLife() {
lifeCount++;
if (lifeCount > maxLifeCount) {
lifeCount = maxLifeCount;
}
txtLifes = lifeCount;
if (gameState == 1) {
extraLife = true;
mc_message.gotoAndStop("stExtra");
objTimeCounter.setTime(3000);
}
sndExtralife = true;
}
function toGameOver() {
gameState = 2;
mc_message.gotoAndStop("stOver");
objTimeCounter.setTime(4000);
extraLife = false;
}
function toWinLevel() {
if (level == MAX_LEVEL) {
gameState = 4;
mc_message.gotoAndStop("stComplete");
objTimeCounter.setTime(40000);
} else {
gameState = 3;
mc_message.gotoAndStop("stWin");
objTimeCounter.setTime(4000);
}
extraLife = false;
}
function checkForWin() {
if (curNumTransports <= 0) {
winFlag = true;
}
}
function noEnemies() {
var _local1;
for (_local1 in mc_planes) {
return(false);
}
for (_local1 in mc_ships) {
return(false);
}
return(true);
}
function resetSounds() {
sndCannon = (sndDeath = (sndEnemy_exp = (sndEnemyshots = (sndExtralife = (sndPlaneryadom = (sndShipshot = (sndTorpout2 = (sndTransportdown2 = (sndWarshipdown = (sndWarshiphit = false))))))))));
}
function playSounds() {
if (sndDeath) {
playSnd("lib_snd_death");
} else if (sndExtralife) {
playSnd("lib_snd_extralife");
} else if (sndTransportdown2) {
playSnd("lib_snd_transportdown2");
} else if (sndTorpout2) {
playSnd("lib_snd_torpout2");
} else if (sndPlaneryadom) {
playSnd("lib_snd_planeryadom");
} else if (sndEnemy_exp) {
playSnd("lib_snd_enemy_exp");
} else if (sndWarshipdown) {
playSnd("lib_snd_warshipdown");
} else if (sndWarshiphit) {
playSnd("lib_snd_warshiphit");
} else if (sndEnemyshots) {
playSnd("lib_snd_enemyshots");
} else if (sndShipshot) {
playSnd("lib_snd_shipshot");
} else if (sndCannon) {
playSnd("lib_snd_cannon");
}
resetSounds();
}
var author = "Galimov Ruslan rigal@mail.ru";
var copyright = "www.sunnygames.com";
fscommand ("showmenu", "false");
fscommand ("trapallkeys", "true");
var lastTimer;
var level;
var MAX_LEVEL = 30;
var stopSoundFlag = false;
var scores;
var lifeScores;
var SCORES_FOR_LIFE = 7000;
var scrPlane = 50;
var scrShip = 100;
var lifeCount;
var armorCount;
var startArmorCount = 5;
var startLifeCount = 3;
var maxLifeCount = 9;
var gameState;
var winFlag;
var extraLife;
var sndCannon;
var sndDeath;
var sndEnemy_exp;
var sndEnemyshots;
var sndExtralife;
var sndPlaneryadom;
var sndShipshot;
var sndTorpout2;
var sndTransportdown2;
var sndWarshipdown;
var sndWarshiphit;
var LEVEL_WIDTH = 550;
var LEVEL_HEIGHT = 400;
var WORLD_WIDTH = (LEVEL_WIDTH * 1.1);
var WORLD_HEIGHT = (LEVEL_HEIGHT * 0.8);
var WORLD_CENTER_X = 275;
var WORLD_CENTER_Y = 176.211453744493;
var WORLD_DEPTH = 500;
var PLAYER_SHOT_SPEED = 600;
var ENEMY_PLANE_SHOT_SPEED = 200;
var ENEMY_SHIP_SHOT_SPEED = 400;
var TORPEDO_DOWN_SPEED = 400;
var TORPEDO_SWIM_SPEED = 110;
var shotCounter;
var planesCounter;
var torpedsCounter;
var shipFarDepthPerc = 0.8;
var shipNearDepthPerc = 0.45;
var shipDepthCount = 15;
var objBack = null;
var objTransform = null;
var objTimeCounter = null;
var levelNumForVictory;
var levelMaxNumShips;
var levelMaxNumPlanes;
var curNumShips;
var curNumPlanes;
var curNumTransports;
var levelShipCoeff;
var levelBigShipCoeff;
var levelBigPlaneCoeff;
var curShipCoeff;
var curBigShipCoeff;
var curBigPlaneCoeff;
var levels = [1, 3, 5, 10, 15, 20, 25, 30];
var transportSpeed;
var shipSpeed;
var bigShipSpeed;
var planeSpeed;
var bigPlaneSpeed;
var m_iNumForVictory = [3, 3, 5, 5, 5, 5, 7, 7];
var m_iMaxNumShips = [1, 3, 4, 5, 6, 7, 10, 10];
var m_iMaxNumPlanes = [3, 4, 5, 6, 6, 6, 7, 10];
var m_fShipCoeff = [0, 2, 3, 3.5, 2.5, 1.5, 0.5, 0.5];
var m_fBigShipCoeff = [0, 0, 0, 1.8, 2.8, 3, 3, 3];
var m_fBigPlaneCoeff = [0, 0, 0, 0, 0.3, 0.5, 0.7, 0.7];
var m_fTimeToAddShip;
var m_fTimeToAddPlane;
var TIME_TO_SHIP = 5000;
var TIME_TO_PLANE = 3000;
#endinitclip
Symbol 236 MovieClip [__Packages.CEnemyPlane] Frame 0
class CEnemyPlane extends MovieClip
{
static var PLAYER;
var pos, dir, speed, bigPlane, depthInMovie, state, lastDepth, xDir, lifeCount, removeFlag, shotCounter, curShotTime, timeCounter, myWidth2, _width, myHeight2, _height, myDepth2, toAway, _x, _y, gotoAndStop, _xscale, _yscale, removeMovieClip;
function CEnemyPlane () {
super();
}
function init(pos_, dir_, speed_, objTransform, bigPlane_, depthInMovie_) {
pos = pos_;
dir = dir_;
speed = speed_;
bigPlane = bigPlane_;
depthInMovie = depthInMovie_;
state = 0;
lastDepth = objTransform.depth / 5.5;
if (dir.x > 0) {
xDir = -1;
} else {
xDir = 1;
}
if (bigPlane) {
lifeCount = 2;
} else {
lifeCount = 1;
}
removeFlag = false;
shotCounter = 0;
curShotTime = (SHOT_TIME * 0.3) + ((3 * SHOT_TIME) * Math.random());
timeCounter = 0;
myWidth2 = _width * 0.5;
myHeight2 = _height * 0.4;
myDepth2 = CShot.LENGTH * 0.5;
toAway = false;
}
function process(dTime) {
if (state == 0) {
timeCounter = timeCounter + dTime;
}
if ((state == 0) && (pos.z <= lastDepth)) {
if (!bigPlane) {
if ((PLAYER._x > _x) && (dir.x > 0)) {
dir.x = -Math.abs(dir.x);
}
if ((PLAYER._x < _x) && (dir.x < 0)) {
dir.x = Math.abs(dir.x);
}
if ((PLAYER._y > _y) && (dir.y > 0)) {
dir.y = -Math.abs(dir.y);
}
if ((PLAYER._y < _y) && (dir.y < 0)) {
dir.y = Math.abs(dir.y);
}
if (dir.x > 0) {
xDir = -1;
} else {
xDir = 1;
}
}
if ((dir.y > 0) && (!bigPlane)) {
gotoAndStop("st_d1");
} else {
gotoAndStop("st_u1");
}
if (bigPlane) {
dir.y = -Math.abs(dir.y);
}
state = 1;
toAway = true;
} else if ((state == 1) && (pos.z <= (lastDepth / 2))) {
if (!bigPlane) {
if (dir.y > 0) {
gotoAndStop("st_d2");
} else {
gotoAndStop("st_u2");
}
}
state = 2;
}
var _local2 = (speed * dTime) / 1000;
if (state == 0) {
pos.x = pos.x + (dir.x * _local2);
pos.y = pos.y + (dir.y * _local2);
pos.z = pos.z + (dir.z * _local2);
} else {
if (bigPlane) {
pos.x = pos.x + (dir.x * _local2);
} else {
pos.x = pos.x + ((((dir.x * _local2) * 140) * (lastDepth - pos.z)) / lastDepth);
}
pos.y = pos.y + ((((dir.y * _local2) * 180) * (lastDepth - pos.z)) / lastDepth);
pos.z = pos.z + ((dir.z * _local2) * (((lastDepth - pos.z) / lastDepth) + 1));
}
}
function screenSynchronize(objTransform) {
var _local2 = {x:0, y:0, k:0};
objTransform.getScreenXY(pos.x, pos.y, pos.z, _local2);
_x = _local2.x;
_y = _local2.y;
_xscale = ((_yscale = _local2.k * 100)) * xDir;
if (pos.z < 0) {
removeFlag = true;
}
}
function canShot() {
return(timeCounter >= curShotTime);
}
function doShot() {
timeCounter = 0;
shotCounter++;
if (((!bigPlane) && (shotCounter < NUM_SHOTS)) || (bigPlane && (shotCounter < (NUM_SHOTS * 1.2)))) {
curShotTime = SHOT_SMALL_TIME;
} else {
curShotTime = (SHOT_TIME - (SHOT_TIME * 0.3)) + ((SHOT_TIME * 0.6) * Math.random());
shotCounter = 0;
}
}
function doDmage() {
lifeCount--;
return(lifeCount <= 0);
}
function disable() {
removeMovieClip();
}
static var SHOT_TIME = 4500;
static var SHOT_SMALL_TIME = 250;
static var NUM_SHOTS = 3;
}
Symbol 237 MovieClip [__Packages.CVector3D] Frame 0
class CVector3D
{
var x, y, z;
function CVector3D (x_, y_, z_) {
x = x_;
y = y_;
z = z_;
}
function reinit(x_, y_, z_) {
x = x_;
y = y_;
z = z_;
}
function duplicate() {
return(new CVector3D(x, y, z));
}
function copyTo(v) {
v.x = x;
v.y = y;
v.z = z;
}
function minus(v) {
x = x - v.x;
y = y - v.y;
z = z - v.z;
}
function plus(v) {
x = x + v.x;
y = y + v.y;
z = z + v.z;
}
function multNew(num) {
return(new CVector3D(x * num, y * num, z * num));
}
function normalize() {
var _local2 = Math.sqrt(((x * x) + (y * y)) + (z * z));
if (_local2 > 0.001) {
x = x / _local2;
y = y / _local2;
z = z / _local2;
}
}
}
Symbol 238 MovieClip [__Packages.CTransform] Frame 0
class CTransform
{
var nearWidth, nearHeight, depth, k, nearDX, nearDY;
function CTransform (nearCX_, nearCY_) {
nearCX = nearCX_;
nearCY = nearCY_;
}
function init(nearWidth_, nearHeight_, depth_, k_) {
nearWidth = nearWidth_;
nearHeight = nearHeight_;
depth = depth_;
k = k_;
nearDX = (nearDY = 0);
}
function getScreenXY(x, y, z, point) {
var _local2 = getKForZ(z);
x = ((x + nearDX) * _local2) + nearCX;
y = ((y + nearDY) * _local2) + nearCY;
point.k = _local2 / (1 + ((3 * z) / depth));
point.x = x;
point.y = y;
}
function getKForZ(z) {
return(1 - (((1 - k) * z) / depth));
}
function getWorldXFromScreen(x, k) {
return(((x - nearCX) / k) - nearDX);
}
function getWorldYFromScreen(y, k) {
return(((y - nearCY) / k) - nearDY);
}
var nearCX = 275;
var nearCY = 200;
}
Symbol 239 MovieClip [__Packages.CShot] Frame 0
class CShot extends MovieClip
{
var pos, oldPos, dir, speed, myType, _x, _y, _xscale, _yscale, _rotation, removeMovieClip;
function CShot () {
super();
}
function init(pos_, dir_, speed_, myType_) {
pos = pos_;
oldPos = pos.duplicate();
dir = dir_;
speed = speed_;
myType = myType_;
}
function process(dTime) {
var _local2 = (speed * dTime) / 1000;
if (myType == 2) {
oldPos.reinit(pos.x, pos.y, pos.z);
}
pos.x = pos.x + (dir.x * _local2);
pos.y = pos.y + (dir.y * _local2);
pos.z = pos.z + (dir.z * _local2);
}
function screenSynchronize(objTransform) {
var _local2 = {x:0, y:0, k:0};
var _local5 = {x:0, y:0, k:0};
var _local6;
var _local4;
var _local3;
objTransform.getScreenXY(pos.x, pos.y, pos.z, _local2);
objTransform.getScreenXY(pos.x - (dir.x * LENGTH), pos.y - (dir.y * LENGTH), pos.z - (dir.z * LENGTH), _local5);
_local4 = _local2.x - _local5.x;
_local3 = _local2.y - _local5.y;
_local6 = Math.sqrt((_local4 * _local4) + (_local3 * _local3));
_x = _local2.x;
_y = _local2.y;
if (myType == 1) {
_xscale = ((_local6 * 10) * 0.55) + 67.5;
_yscale = ((_local2.k * 100) * 0.6) + 40;
_rotation = (Math.atan2(_local3, _local4) * 180) / Math.PI;
} else if (myType == 2) {
_xscale = (_yscale = _local2.k * 100);
_rotation = ((Math.atan2(_local3, _local4) * 180) / Math.PI) + 90;
} else if (myType == 3) {
_xscale = ((_local6 * 10) * 0.55) + 67.5;
_yscale = _local2.k * 110;
_rotation = (Math.atan2(_local3, _local4) * 180) / Math.PI;
} else if (myType == 4) {
_xscale = (_yscale = _local2.k * 100);
}
}
function disable() {
removeMovieClip();
}
static var LENGTH = 50;
}
Symbol 240 MovieClip [__Packages.CTimeCounter] Frame 0
class CTimeCounter
{
var curTime;
function CTimeCounter () {
}
function setTime(time) {
curTime = time;
}
function process(dTime) {
curTime = curTime - dTime;
return(curTime > 0);
}
function endTime() {
curTime = 0;
}
}
Symbol 241 MovieClip [__Packages.CBack] Frame 0
class CBack
{
var mc1, speed, mc2, hx, hy;
function CBack () {
}
function init(mc1_, speed_) {
mc1 = mc1_;
speed = speed_;
mc2 = mc1.duplicateMovieClip("mc2", 0);
mc2._x = (mc1._x + mc1._width) - 1;
hx = 0;
hy = 0;
}
function process(dTime, dr, k) {
var _local2 = (speed * dTime) / 1000;
hy = hy + (_local2 * k);
while (hy > 0) {
hy = hy - mc1.mc1._height;
}
mc1.mc1._y = Math.round(hy);
mc1.mc2._y = (mc1.mc1._y + mc1.mc1._height) - 1;
mc2.mc1._y = mc1.mc1._y;
mc2.mc2._y = mc1.mc2._y;
hx = hx + ((dr * k) * 0.8);
while (hx > 0) {
hx = hx - mc1._width;
}
while (hx <= (-mc1._width)) {
hx = hx + mc1._width;
}
mc1._x = Math.round(hx);
mc2._x = (mc1._x + mc1._width) - 1;
}
}
Symbol 242 MovieClip [__Packages.CShip] Frame 0
class CShip extends MovieClip
{
static var PLAYER;
var myType, speed, pos, depthInMovie, lifeCount, shotCounter, curShotTime, timeCounter, removeFlag, myWidth2, _width, myScale, _x, _y, _xscale, _yscale, gotoAndStop, removeMovieClip;
function CShip () {
super();
}
function init(myType_, speed_, pos_, depthInMovie_) {
myType = myType_;
speed = speed_;
pos = pos_;
depthInMovie = depthInMovie_;
if (myType == 2) {
lifeCount = 2;
} else {
lifeCount = 1;
}
shotCounter = 0;
curShotTime = (SHOT_TIME - (SHOT_TIME * 0.3)) + ((SHOT_TIME * 0.6) * Math.random());
timeCounter = 0;
removeFlag = false;
myWidth2 = _width * 0.29;
if (myType == 1) {
myScale = 0.75;
} else {
myScale = 1.3;
}
}
function process(dTime) {
var _local2 = (speed * dTime) / 1000;
timeCounter = timeCounter + dTime;
pos.x = pos.x + _local2;
}
function screenSynchronize(objTransform) {
var _local2 = {x:0, y:0, k:0};
objTransform.getScreenXY(pos.x, pos.y, pos.z, _local2);
_x = _local2.x;
_y = _local2.y;
_xscale = (_yscale = _local2.k * 150);
if ((pos.x >= objTransform.nearWidth) && ((_x - (_width / 2)) >= SCREEN_WIDTH)) {
removeFlag = true;
}
var _local6 = objTransform.nearHeight - PLAYER.y;
var _local5 = Math.sqrt(((pos.x - PLAYER.x) * (pos.x - PLAYER.x)) + (pos.z * pos.z));
var _local3 = _local6 / _local5;
if (_local3 < 0.66) {
gotoAndStop(1);
} else if (_local3 < 1.2) {
gotoAndStop(2);
} else {
gotoAndStop(3);
}
}
function canShot() {
return((myType > 0) && (timeCounter >= curShotTime));
}
function doShot() {
timeCounter = 0;
shotCounter++;
if (shotCounter < NUM_SHOTS) {
curShotTime = SHOT_SMALL_TIME;
} else {
curShotTime = (SHOT_TIME - (SHOT_TIME * 0.3)) + ((SHOT_TIME * 0.6) * Math.random());
shotCounter = 0;
}
}
function doDmage() {
lifeCount--;
return(lifeCount <= 0);
}
function disable() {
removeMovieClip();
}
static var SHOT_TIME = 8000;
static var SHOT_SMALL_TIME = 400;
static var NUM_SHOTS = 3;
static var SCREEN_WIDTH = 550;
}
Symbol 243 MovieClip [__Packages.CBoom] Frame 0
class CBoom extends MovieClip
{
var pos, _x, _y;
function CBoom () {
super();
}
function init(pos_) {
pos = pos_;
}
function process(dTime) {
}
function screenSynchronize(objTransform) {
var _local2 = {x:0, y:0, k:0};
objTransform.getScreenXY(pos.x, pos.y, pos.z, _local2);
_x = _local2.x;
_y = _local2.y;
}
function canShot() {
return(false);
}
}
Symbol 244 MovieClip [__Packages.CPlayer] Frame 0
class CPlayer extends MovieClip
{
var x, y, state, shotTimeCounter, torpedoTimeCounter, stop, acc, maxSpeed, downAcc, curSpeed, dir, mouseControl, xRad, _width, yRad, _height, migFlag, _x, _parent, _y, mc, _rotation, shotFlag, gotoAndPlay, gotoAndStop, _visible;
function CPlayer () {
super();
x = (y = 0);
state = 0;
shotTimeCounter = SHOT_DELAY;
torpedoTimeCounter = TORPEDO_DELAY;
stop();
}
function init(acc_, maxSpeed_, downAcc_) {
acc = acc_;
maxSpeed = maxSpeed_;
downAcc = downAcc_;
curSpeed = 0;
dir = new CVector2D(1, 0);
mouseControl = false;
xRad = _width / 2;
yRad = _height / 2;
migFlag = false;
}
function toFly() {
state = 1;
}
function process(dTime) {
var _local7;
var _local6;
var _local4;
var _local5;
shotTimeCounter = shotTimeCounter + dTime;
torpedoTimeCounter = torpedoTimeCounter + dTime;
dTime = dTime / 1000;
if (state == 1) {
_local7 = Key.isDown(37);
_local5 = Key.isDown(39);
_local6 = Key.isDown(38);
_local4 = Key.isDown(40);
if (((_local7 || (_local5)) || (_local6)) || (_local4)) {
mouseControl = false;
}
var _local2 = new CVector2D(0, 0);
var _local8;
if (mouseControl) {
_local2.reinit(_parent._xmouse - _x, _parent._ymouse - _y);
_local8 = _local2.modul();
if (_local8 > mouseInactiveRadius) {
_local2.normalize();
updateView(_local2);
_local2.mult(acc);
} else {
_local2.reinit(0, 0);
mc.gotoAndStop("st_");
}
} else {
if (_local7) {
_local2.x = _local2.x - 1;
}
if (_local5) {
_local2.x = _local2.x + 1;
}
if (_local6) {
_local2.y = _local2.y - 1;
}
if (_local4) {
_local2.y = _local2.y + 1;
}
_local2.normalize();
if (_local2.modul() > 0.001) {
updateView(_local2);
} else {
mc.gotoAndStop("st_");
}
_local2.mult(acc);
}
curSpeed = curSpeed - ((downAcc * dTime) * dTime);
if (curSpeed < 0) {
curSpeed = 0;
}
dir.mult(curSpeed);
_local2.mult(dTime * dTime);
dir.plus(_local2);
curSpeed = dir.modul();
if (curSpeed > maxSpeed) {
curSpeed = maxSpeed;
}
dir.normalize();
x = x + (dir.x * curSpeed);
y = y + (dir.y * curSpeed);
} else if (state == 3) {
y = y + ((maxSpeed * 7) * dTime);
_rotation = _rotation + (500 * dTime);
}
}
function updateView(addSpeed) {
var _local2 = "st_";
if (addSpeed.y > 0.3) {
_local2 = _local2 + "d";
} else if (addSpeed.y < -0.3) {
_local2 = _local2 + "u";
}
if (addSpeed.x > 0.3) {
_local2 = _local2 + "r";
} else if (addSpeed.x < -0.3) {
_local2 = _local2 + "l";
}
mc.gotoAndStop(_local2);
}
function screenSynchronize(objTransform) {
var _local2 = {x:x, y:y, k:0};
objTransform.getScreenXY(x, y, 0, _local2);
_x = _local2.x;
_y = _local2.y;
if ((state == 3) && (y > (objTransform.nearHeight * 2))) {
toOver();
}
}
function myMouseMove() {
mouseControl = true;
}
function tryShot() {
if (shotTimeCounter >= SHOT_DELAY) {
shotFlag = true;
shotTimeCounter = 0;
}
}
function isShot() {
if (shotFlag) {
shotFlag = false;
return(true);
}
return(false);
}
function canTorpedo() {
return(torpedoTimeCounter >= TORPEDO_DELAY);
}
function doTorpedo() {
torpedoTimeCounter = 0;
}
function toMig() {
migFlag = true;
gotoAndPlay(2);
}
function toFall() {
gotoAndStop(1);
mc.gotoAndStop("st_");
migFlag = true;
state = 3;
}
function isFall() {
return(state == 3);
}
function toOver() {
state = 4;
_visible = false;
}
function isOver() {
return(state == 4);
}
function endMig() {
migFlag = false;
gotoAndStop(1);
}
function disable() {
_visible = false;
state = 5;
}
var mouseInactiveRadius = 35;
static var SHOT_DELAY = 350;
static var TORPEDO_DELAY = 1200;
}
Symbol 245 MovieClip [__Packages.CVector2D] Frame 0
class CVector2D
{
var x, y;
function CVector2D (x_, y_) {
x = x_;
y = y_;
}
function reinit(x_, y_) {
x = x_;
y = y_;
}
function getUgol() {
return(Math.atan2(y, x));
}
function duplicate() {
return(new CVector2D(x, y));
}
function copyTo(v) {
v.x = x;
v.y = y;
}
function minus(v) {
x = x - v.x;
y = y - v.y;
}
function minusNew(v) {
return(new CVector2D(x - v.x, y - v.y));
}
function normalize() {
var _local2 = Math.sqrt((x * x) + (y * y));
if (_local2 > 0.001) {
x = x / _local2;
y = y / _local2;
}
}
function reverseNew() {
return(new CVector2D(-x, -y));
}
function scalar(v) {
return((x * v.x) + (y * v.y));
}
function modul() {
return(Math.sqrt((x * x) + (y * y)));
}
function reflectFromNormal(n) {
var _local2 = Math.atan2(n.y, n.x);
rotate(-_local2);
x = -x;
rotate(_local2);
}
function rotate(u) {
var _local4 = x;
var _local3 = y;
x = (_local4 * Math.cos(u)) - (_local3 * Math.sin(u));
y = (_local4 * Math.sin(u)) + (_local3 * Math.cos(u));
}
function rotateNew(u) {
return(new CVector2D((x * Math.cos(u)) - (y * Math.sin(u)), (x * Math.sin(u)) + (y * Math.cos(u))));
}
function mult(k) {
x = x * k;
y = y * k;
}
function multNew(k) {
return(new CVector2D(x * k, y * k));
}
function plus(v) {
x = x + v.x;
y = y + v.y;
}
function plusNew(v) {
return(new CVector2D(x + v.x, y + v.y));
}
function getDistanceTo(p1, p2) {
var _local3 = p1.y - p2.y;
var _local2 = p2.x - p1.x;
var _local6 = (p1.x * (p2.y - p1.y)) - (p1.y * (p2.x - p1.x));
var _local5 = Math.sqrt((_local3 * _local3) + (_local2 * _local2));
_local3 = _local3 / _local5;
_local2 = _local2 / _local5;
_local6 = _local6 / _local5;
return(((_local3 * x) + (_local2 * y)) + _local6);
}
}
Symbol 18 MovieClip [lib_shot] Frame 1
#initclip 21
Object.registerClass("lib_shot", CShot);
#endinitclip
Symbol 29 MovieClip [lib_enemy_plane] Frame 1
#initclip 12
Object.registerClass("lib_enemy_plane", CEnemyPlane);
#endinitclip
this.stop();
Symbol 34 MovieClip [lib_enemy_plane_big] Frame 1
#initclip 13
Object.registerClass("lib_enemy_plane_big", CEnemyPlane);
#endinitclip
this.stop();
Symbol 41 MovieClip [lib_ship0] Frame 1
#initclip 14
Object.registerClass("lib_ship0", CShip);
#endinitclip
this.stop();
Symbol 48 MovieClip [lib_ship1] Frame 1
#initclip 15
Object.registerClass("lib_ship1", CShip);
#endinitclip
this.stop();
Symbol 55 MovieClip [lib_ship2] Frame 1
#initclip 16
Object.registerClass("lib_ship2", CShip);
#endinitclip
this.stop();
Symbol 58 MovieClip [lib_torpedo] Frame 1
#initclip 17
Object.registerClass("lib_torpedo", CShot);
#endinitclip
Symbol 61 MovieClip [lib_shot2] Frame 1
#initclip 18
Object.registerClass("lib_shot2", CShot);
#endinitclip
Symbol 103 MovieClip [lib_boom] Frame 1
#initclip 19
Object.registerClass("lib_boom", CBoom);
#endinitclip
Symbol 103 MovieClip [lib_boom] Frame 23
this.removeMovieClip();
Symbol 124 MovieClip [lib_water_boom] Frame 1
#initclip 20
Object.registerClass("lib_water_boom", CBoom);
#endinitclip
Symbol 124 MovieClip [lib_water_boom] Frame 25
this.removeMovieClip();
Instance of Symbol 132 MovieClip in Symbol 136 MovieClip Frame 1
onClipEvent (load) {
this.gotoAndPlay(25);
}
Symbol 145 Button
on (release) {
new_game_pressed();
}
Symbol 150 Button
on (release) {
more_pressed();
}
Symbol 155 Button
on (release) {
how_to_play_pressed();
}
Symbol 157 MovieClip Frame 1
stop();
Symbol 159 Button
on (press) {
this._parent.soundOff();
this.gotoAndStop(2);
}
Symbol 161 Button
on (press) {
this._parent.soundOn();
this.gotoAndStop(1);
}
Symbol 162 MovieClip Frame 1
this.stop();
Symbol 167 Button
on (release) {
back_pressed();
}
Symbol 188 MovieClip Frame 1
this.stop();
Symbol 189 MovieClip [lib_player] Frame 1
#initclip 22
Object.registerClass("lib_player", CPlayer);
#endinitclip
Symbol 189 MovieClip [lib_player] Frame 25
this.endMig();
Symbol 213 MovieClip Frame 12
this.swapDepths(10000);
this.removeMovieClip();
Symbol 235 MovieClip Frame 1
this.stop();