Frame 1
var percent = 0;
var destPercent = 0;
var dt;
var Time = 0;
var InitFilter = true;
var dFilter;
var rad = 0;
var Continue = false;
var Score = 0;
var Time = 0;
var dt = 0;
var TurnSpeed = 0;
var ShipSpeed = 0;
var Health = 100;
var bullets;
var bomb;
var bombspeed;
var mediKit;
var tank = null;
var PlayerShip;
var EnemyShip;
var FireDelay = 0;
var BombDelay = 0;
var EmitSmoke;
var EmitCount = 0;
var smoke;
var explosion;
var gunShot;
var planeDive;
var explode;
var plane;
var addplane;
var levelSfx;
var bombfallSfx;
var hitSfx;
var medi_appear;
var medi_collect;
var planeClip;
var sfxClip;
var EnemyCount = 0;
var EnemyDelay = 2;
var EnemyAdDelay = 3;
var ShipsAtATime = 2;
var ObjIntId = -1;
var Level = 1;
var Loaded = false;
var SoundToggle = true;
onEnterFrame = function () {
if (_root._currentframe != 1) {
return(undefined);
}
if (InitFilter) {
Stage.scaleMode = "exactFit";
InitFilter = false;
FinishedLoading._visible = false;
FinishedLoading.onRollOver = function () {
};
FinishedLoading.onPress = function () {
if (FinishedLoading._visible) {
Continue = true;
}
};
FinishedLoading.useHandCursor = true;
var _local5 = flash.display.BitmapData.loadBitmap("Filter_Logo");
var _local2 = new flash.geom.Point();
_local2.x = 0;
_local2.y = 0;
_local2.length = 0;
dFilter = new flash.filters.DisplacementMapFilter(_local5, _local2, 1, 1, 4, 4);
dFilter.alpha = 0;
dfilter.mode = "ignore";
var _local4 = OBG_Logo.filters;
_local4.push(dFilter);
OBG_Logo.filters = _local4;
}
var _local3 = getTimer();
dt = (_local3 - Time) / 1000;
if (_local3 == 0) {
dt = 0.01;
}
Time = _local3;
dFilter.scaleX = Math.cos(rad) * 3;
dFilter.scaleY = Math.sin(rad) * 3;
rad = rad + (dt * 2.5);
var _local4 = OBG_Logo.filters;
_local4[0] = dFilter;
OBG_Logo.filters = _local4;
FinishedLoading._alpha = Math.abs(Math.cos(rad) * 100);
loading = getBytesLoaded();
total = getBytesTotal();
destPercent = (loading / total) * 100;
percent = percent + (dt * 25);
if (percent > destPercent) {
percent = destPercent;
}
Bar._width = (percent / 100) * 302;
if (percent > 99) {
FinishedLoading._visible = true;
}
if (Continue) {
gotoAndStop (2);
}
};
stop();
Instance of Symbol 72 MovieClip "OBG_Logo" in Frame 1
on (release) {
getURL ("http://www.oceanbreezegames.com/Online-Games/", "_blank");
}
Instance of Symbol 74 MovieClip in Frame 1
on (release) {
getURL ("http://www.oceanbreezegames.com/Online-Games/", "_blank");
}
Frame 2
stop();
Frame 3
function updateObj(dt) {
fC = fC + (dt / 0.01);
if (fC >= 1) {
var _local2 = int(fC);
fC = fC - int(fC);
var _local3 = -1;
while (_local3++ , _local3 < _local2) {
if (Health <= 0) {
if ((PlayerShip._currentframe == PlayerShip._totalframes) && (PlayerShip._visible)) {
PlayerShip._visible = false;
initExplosion(PlayerShip, false);
} else {
PlayerShip.nextFrame();
}
}
for (s in smoke) {
smoke[s].nextFrame();
if (smoke[s]._currentframe == smoke[s]._totalframes) {
smoke[s].removeMovieClip();
smoke.splice(s, 1);
} else {
smoke[s].swapDepths(_root.getNextHighestDepth());
}
}
for (e in explosion) {
explosion[e].nextFrame();
if (explosion[e]._currentframe == explosion[e]._totalframes) {
explosion[e].removeMovieClip();
explosion.splice(e, 1);
}
}
for (i in bomb) {
bomb[i].nextFrame();
if (bomb[i]._currentframe == bomb[i]._totalframes) {
initExplosion(bomb[i], false);
bomb[i].removeMovieClip();
bomb.splice(i, 1);
bombspeed.splice(i, 1);
}
}
}
}
}
function FireBullet(o, id) {
var _local2 = bullets.length;
bullets[_local2] = new Bullet();
bullets[_local2].id = id;
bullets[_local2].Image = _root.attachMovie("Bullet", "Bullet_" + UniqueID, getNextHighestDepth());
UniqueID++;
var _local3 = (o._rotation * 3.14) / 180;
bullets[_local2].Image._x = o._x + (Math.cos(_local3) * 18);
bullets[_local2].Image._y = o._y + (Math.sin(_local3) * 18);
bullets[_local2].Image._rotation = o._rotation;
bullets[_local2].Image.cacheAsBitmap = true;
}
function EmitSmokeFunc(count, obj) {
var _local4 = -1;
while (_local4++ , _local4 < int(count)) {
var _local2 = smoke.length;
smoke[_local2] = _root.attachMovie("Smoke", "Smoke_" + UniqueID, _root.getNextHighestDepth());
UniqueID++;
smoke[_local2]._x = obj._x + ((Math.random() * 12) - 6);
smoke[_local2]._y = obj._y + ((Math.random() * 12) - 6);
smoke[_local2].cacheAsBitmap = true;
}
}
function initExplosion(obj, ignoreTank) {
if ((tank != null) && (!ignoreTank)) {
var _local4 = tank.Image._x - obj._x;
var _local3 = tank.Image._y - obj._y;
var _local6 = (_local4 * _local4) + (_local3 * _local3);
if (_local6 < 600) {
initExplosion(tank.Image, true);
tank.Image.removeMovieClip();
tank = null;
AddScore(1000 + (255 * Level));
}
}
var _local2 = explosion.length;
explosion[_local2] = _root.attachMovie("Explosion", "Explosion_" + UniqueID, _root.getNextHighestDepth());
UniqueID++;
explosion[_local2]._x = obj._x;
explosion[_local2]._y = obj._y;
explode.start(0, 1);
}
function UpdateFrame() {
if (TempScore == -1) {
AddScore(0);
}
updateEnemyAd(dt);
tank.Update(dt);
PlayerShip._alpha = PlayerShip._alpha + (dt * 75);
if (PlayerShip._alpha > 100) {
PlayerShip._alpha = 100;
}
if (PlayerShip._currentframe < 2) {
if (Key.isDown(37)) {
TurnSpeed = -175;
} else if (Key.isDown(39)) {
TurnSpeed = 175;
} else {
TurnSpeed = 0;
}
if (Key.isDown(38)) {
var _local5 = (PlayerShip._rotation * 3.14) / 180;
ShipSpeed = ShipSpeed + (100 * dt);
if (ShipSpeed > 200) {
ShipSpeed = 200;
}
} else {
ShipSpeed = ShipSpeed * (1 - (dt * 0.6));
if (ShipSpeed < 100) {
ShipSpeed = 100;
}
}
var _local6 = (((ShipSpeed - 100) / 100) * 50) + 15;
plane.setVolume(_local6);
if (Key.isDown(32) && (FireDelay <= 0)) {
gunShot.start(0, 1);
FireBullet(PlayerShip, 0);
FireDelay = 0.2;
}
if (Key.isDown(17) && (BombDelay <= 0)) {
var _local3 = bomb.length;
bomb[_local3] = _root.attachMovie("Bomb", "Bomb_" + UniqueID, getNextHighestDepth());
UniqueID++;
var _local5 = (PlayerShip._rotation * 3.14) / 180;
bombspeed[_local3] = ShipSpeed * 0.8;
bomb[_local3]._x = PlayerShip._x;
bomb[_local3]._y = PlayerShip._y;
bomb[_local3]._rotation = PlayerShip._rotation;
bomb[_local3].cacheAsBitmap = true;
BombDelay = 1;
bombfallSfx.start(0, 1);
}
} else {
ShipSpeed = ShipSpeed * (1 - (dt * 1.8));
}
var _local2;
for (_local2 in bomb) {
var _local5 = (bomb[_local2]._rotation * 3.14) / 180;
bomb[_local2]._x = bomb[_local2]._x + ((Math.cos(_local5) * bombspeed[_local2]) * dt);
bomb[_local2]._y = bomb[_local2]._y + ((Math.sin(_local5) * bombspeed[_local2]) * dt);
bombspeed[_local2] = bombspeed[_local2] * (1 - (dt * 0.8));
}
for (_local2 in bullets) {
var _local5 = (bullets[_local2].Image._rotation * 3.14) / 180;
bullets[_local2].Image._x = bullets[_local2].Image._x + ((Math.cos(_local5) * 600) * dt);
bullets[_local2].Image._y = bullets[_local2].Image._y + ((Math.sin(_local5) * 600) * dt);
if (!InStage(bullets[_local2].Image)) {
bullets[_local2].Image.removeMovieClip();
bullets.splice(_local2, 1);
} else if (((bullets[_local2].id == 1) && (PlayerShip._visible)) && (Health > 0)) {
if (PlayerShip.hitTest(bullets[_local2].Image._x, bullets[_local2].Image._y)) {
Health = Health - 7;
var _local4 = 103 * (Health / 100);
setClipRect(BottomTray.HealthBar, 103 - _local4, 0, _local4, BottomTray.HealthBar._height);
BottomTray.HealthBar._x = 6.5 + (103 - _local4);
hitSfx.start(0, 1);
bullets[_local2].Image.removeMovieClip();
bullets.splice(_local2, 1);
if (Health <= 0) {
PlayerShip.gotoAndPlay(3);
planeDive.start(0, 1);
}
}
} else if (bullets[_local2].id == 0) {
for (e in EnemyShip) {
if (EnemyShip[e].Image.hitTest(bullets[_local2].Image)) {
hitSfx.start(0, 1);
EnemyShip[e].Hit(7);
bullets[_local2].Image.removeMovieClip();
bullets.splice(_local2, 1);
e = EnemyShip.length;
}
}
}
}
if (PlayerShip._visible) {
if (Health > 60) {
EmitSmoke = 0;
} else if (Health > 50) {
EmitSmoke = 4;
} else if (Health > 40) {
EmitSmoke = 8;
} else if (Health > 30) {
EmitSmoke = 12;
} else if (Health > 20) {
EmitSmoke = 16;
} else if (Health > 0) {
EmitSmoke = 20;
}
EmitCount = EmitCount + (EmitSmoke * dt);
EmitSmokeFunc(EmitCount, PlayerShip);
EmitCount = EmitCount - int(EmitCount);
}
for (e in EnemyShip) {
KeepInStage(EnemyShip[e].Image, 60);
EnemyShip[e].Update(dt, PlayerShip._x, PlayerShip._y, PlayerShip._rotation);
if (EnemyShip[e].Fire()) {
FireBullet(EnemyShip[e].Image, 1);
gunShot.start(0, 1);
}
if (EnemyShip[e].State == EnemyShip[e].REMOVE_ME) {
if ((Math.random() < (0.35 + (Level * 0.075))) && (EnemyCount > 0)) {
var _local3 = mediKit.length;
mediKit[_local3] = _root.attachMovie("MediKit", "MediKit_" + UniqueID, _root.getNextHighestDepth());
UniqueID++;
mediKit[_local3]._x = EnemyShip[e].Image._x;
mediKit[_local3]._y = EnemyShip[e].Image._y;
mediKit[_local3].cacheAsBitmap = true;
mediKit[_local3]._xscale = 0;
mediKit[_local3]._yscale = 0;
medi_appear.start(0, 1);
}
initExplosion(EnemyShip[e].Image, false);
EnemyShip[e].Image.removeMovieClip();
EnemyShip.splice(e, 1);
if ((EnemyCount == 0) && (EnemyShip.length == 0)) {
Level = Level + 1;
ClearObjs();
PlayerShip._alpha = 0;
levelSfx.start(0, 1);
_root.gotoAndPlay(4);
}
} else if (EnemyShip[e].Health < 60) {
if (EnemyShip[e].Health > 50) {
EmitSmoke = 4;
} else if (EnemyShip[e].Health > 40) {
EmitSmoke = 6;
} else if (EnemyShip[e].Health > 30) {
EmitSmoke = 12;
} else if (EnemyShip[e].Health > 20) {
EmitSmoke = 16;
} else if (EnemyShip[e].Health > 0) {
EmitSmoke = 20;
}
EnemyShip[e].EmitCount = EnemyShip[e].EmitCount + (EmitSmoke * dt);
EmitSmokeFunc(EnemyShip[e].EmitCount, EnemyShip[e].Image);
EnemyShip[e].EmitCount = EnemyShip[e].EmitCount - int(EnemyShip[e].EmitCount);
}
}
PlayerShip.swapDepths(_root.getNextHighestDepth());
PlayerShip._rotation = PlayerShip._rotation + (TurnSpeed * dt);
var _local5 = (PlayerShip._rotation * 3.14) / 180;
PlayerShip._x = PlayerShip._x + ((Math.cos(_local5) * ShipSpeed) * dt);
PlayerShip._y = PlayerShip._y + ((Math.sin(_local5) * ShipSpeed) * dt);
KeepInStage(PlayerShip, 20);
BottomTray.swapDepths(_root.getNextHighestDepth());
Speaker.swapDepths(_root.getNextHighestDepth());
SpeakerSound.swapDepths(_root.getNextHighestDepth());
ReturnToMenu.swapDepths(_root.getNextHighestDepth());
FireDelay = FireDelay - dt;
BombDelay = BombDelay - dt;
for (_local2 in mediKit) {
mediKit[_local2]._rotation = mediKit[_local2]._rotation + (25 * dt);
mediKit[_local2]._xscale = mediKit[_local2]._xscale + (dt * 400);
mediKit[_local2]._yscale = mediKit[_local2]._yscale + (dt * 400);
if (mediKit[_local2]._xscale > 100) {
mediKit[_local2]._xscale = 100;
}
if (mediKit[_local2]._yscale > 100) {
mediKit[_local2]._yscale = 100;
}
if (PlayerShip.hitTest(mediKit[_local2])) {
Health = Health + 15;
medi_collect.start(0, 1);
if (Health > 100) {
Health = 100;
}
var _local4 = 103 * (Health / 100);
setClipRect(BottomTray.HealthBar, 103 - _local4, 0, _local4, BottomTray.HealthBar._height);
BottomTray.HealthBar._x = 6.5 + (103 - _local4);
mediKit[_local2].removeMovieClip();
mediKit.splice(_local2, 1);
}
}
if (!SoundToggle) {
SpeakerSound._visible = false;
gunShot.setVolume(0);
plane.setVolume(0);
} else {
SpeakerSound._visible = true;
gunShot.setVolume(100);
}
if (((PlayerShip._visible == false) && (explosion.length == 0)) && (Health <= 0)) {
UnloadAll(5);
}
}
function InStage(obj) {
return((((obj._x >= 0) && (obj._y >= 0)) && (obj._x < Stage.width)) && (obj._y < Stage.height));
}
function KeepInStage(obj, extra) {
if (obj._x < (-extra)) {
obj._x = Stage.width + extra;
} else if (obj._x > (Stage.width + extra)) {
obj._x = -extra;
}
if (obj._y < (-extra)) {
obj._y = Stage.height + extra;
} else if (obj._y > (Stage.height + extra)) {
obj._y = -extra;
}
}
function ClearObjs() {
BottomTray.removeMovieClip();
tank.Image.removeMovieClip();
tank = null;
var _local3 = 0;
while (_local3 < bullets.length) {
bullets[_local3].Image.removeMovieClip();
_local3++;
}
bullets = null;
bullets = new Array();
var _local1 = 0;
while (_local1 < explosion.length) {
explosion[_local1].removeMovieClip();
_local1++;
}
explosion = null;
explosion = new Array();
_local1 = 0;
while (_local1 < EnemyShip.length) {
EnemyShip[_local1].Image.removeMovieClip();
_local1++;
}
EnemyShip = null;
EnemyShip = new Array();
var _local2 = 0;
while (_local2 < smoke.length) {
smoke[_local2].removeMovieClip();
_local2++;
}
smoke = null;
smoke = new Array();
_local3 = 0;
while (_local3 < bomb.length) {
bomb[_local3].removeMovieClip();
_local3++;
}
bomb = null;
bomb = new Array();
bombspeed = null;
bombspeed = new Array();
_local3 = 0;
while (_local3 < mediKit.length) {
mediKit[_local3].removeMovieClip();
_local3++;
}
mediKit = null;
mediKit = new Array();
Speaker.removeMovieClip();
SpeakerSound.removeMovieClip();
ReturnToMenu.removeMovieClip();
PlayerShip._visible = false;
}
function UnloadAll(frame) {
ClearObjs();
Level = 1;
plane.stop();
_root.stop();
_root.gotoAndStop(frame);
}
function LoadGame() {
BottomTray.cacheAsBitmap = true;
mediKit = new Array();
bomb = new Array();
bombspeed = new Array();
explosion = new Array();
smoke = new Array();
bullets = new Array();
EnemyShip = new Array();
PlayerShip = _root.attachMovie("Ship2", "PlayerShip", getNextHighestDepth());
PlayerShip.cacheAsBitmap = true;
Loaded = true;
sfxClip = _root.createEmptyMovieClip("SfxClip", getNextHighestDepth());
medi_appear = new Sound(sfxClip);
medi_appear.attachSound("medi_appear");
medi_collect = new Sound(sfxClip);
medi_collect.attachSound("medi_collect");
hitSfx = new Sound(sfxClip);
hitSfx.attachSound("hit");
gunShot = new Sound(sfxClip);
gunShot.attachSound("gunshot1");
planeDive = new Sound(sfxClip);
planeDive.attachSound("plane_dive");
explode = new Sound(sfxClip);
explode.attachSound("explode");
morsecode = new Sound(sfxClip);
morsecode.attachSound("morsecode");
levelSfx = new Sound(sfxClip);
levelSfx.attachSound("levelup");
bombfallSfx = new Sound(sfxClip);
bombfallSfx.attachSound("bombfall");
planeClip = sfxClip.createEmptyMovieClip("PlaneClip", getNextHighestDepth());
plane = new Sound(planeClip);
plane.attachSound("prop1");
plane.setVolume(15);
Level = 1;
LoadLevel();
}
function setClipRect(obj, xpos, ypos, w, h) {
var _local4 = int(xpos);
var _local3 = int(ypos);
var _local1 = int(w);
var _local5 = int(h);
var _local2 = new flash.geom.Rectangle(_local4, _local3, _local1, _local5);
obj.scrollRect = _local2;
}
function AddScore(amount) {
Score = Score + amount;
BottomTray.ScoreText.text = FormatScoreText(Score);
}
function FormatScoreText(amount) {
var _local1 = "" + amount;
var _local4 = "";
var _local6 = int(_local1.length / 3);
var _local5 = 0;
var _local3 = _local1.length - 1;
var _local2 = 0;
while (_local2 < _local1.length) {
_local4 = _local4 + _local1.charAt(_local2);
if ((((_local3 == 3) && (_local1.length > 3)) || ((_local3 == 6) && (_local1.length > 6))) || ((_local3 == 9) && (_local1.length > 9))) {
_local4 = _local4 + ",";
}
_local3--;
_local2++;
}
return(_local4);
}
function LoadLevel() {
tankCount = Level * 2;
if (Level == 1) {
Score = 0;
BottomTray.ScoreText.text = "0";
}
setClipRect(BottomTray.HealthBar, 0, 0, 103, BottomTray.HealthBar._height);
BottomTray.HealthBar._x = 6.5;
PlayerShip._x = Stage.width / 2;
PlayerShip._y = Stage.height / 2;
PlayerShip._alpha = 0;
PlayerShip._visible = true;
plane.stop();
plane.setVolume(15);
plane.start(0, 99999999);
PlayerShip.gotoAndStop(1);
i = 0;
while (i < EnemyShip.length) {
EnemyShip[i].Image.removeMovieClip();
i++;
}
EnemyShip = null;
EnemyShip = new Array();
TurnSpeed = 0;
ShipSpeed = 0;
Health = 100;
FireDelay = 0;
EmitCount = 0;
switch (Level) {
case 1 :
ShipsAtATime = 1;
EnemyCount = 2;
EnemyDelay = 2;
EnemyAdDelay = 7;
break;
case 2 :
ShipsAtATime = 2;
EnemyCount = 3;
EnemyDelay = 3;
EnemyAdDelay = 7;
break;
case 3 :
ShipsAtATime = 3;
EnemyCount = 5;
EnemyDelay = 2;
EnemyAdDelay = 12;
break;
case 4 :
ShipsAtATime = 2;
EnemyCount = 6;
EnemyDelay = 2;
EnemyAdDelay = 7;
break;
case 5 :
ShipsAtATime = 2;
EnemyCount = 6;
EnemyDelay = 2;
EnemyAdDelay = 4;
break;
default :
ShipsAtATime = 3;
EnemyCount = 9;
EnemyDelay = 2;
EnemyAdDelay = 7;
}
Time = getTimer();
}
function updateEnemyAd(dt) {
if (((Level > 1) && (tank == null)) && (tankCount > 0)) {
tank = new Vehicle(Level);
tankCount--;
}
EnemyDelay = EnemyDelay - dt;
if (((EnemyDelay < 1.75) && ((EnemyDelay + dt) >= 1.75)) && (EnemyCount > 0)) {
if (ShipsAtATime > EnemyShip.length) {
morsecode.start(0, 1);
} else {
EnemyDelay = EnemyDelay + dt;
}
}
if (((EnemyDelay <= 0) && (EnemyCount > 0)) && (ShipsAtATime > EnemyShip.length)) {
i = 0;
while (i < 1) {
var _local2 = EnemyShip.length;
EnemyShip[_local2] = new AirPlane(Level);
EnemyShip[_local2].Image = _root.attachMovie("Ship3", "EnemyShip_" + UniqueID, getNextHighestDepth());
UniqueID++;
EnemyShip[_local2].Image.cacheAsBitmap = true;
var _local3 = Math.random() * 100;
if (_local3 < 25) {
EnemyShip[_local2].SetPos(Math.random() * Stage.width, -30);
} else if (_local3 < 50) {
EnemyShip[_local2].SetPos(Math.random() * Stage.width, Stage.height + 30);
} else if (_local3 < 75) {
EnemyShip[_local2].SetPos(-30, Math.random() * Stage.height);
} else if (_local3 < 100) {
EnemyShip[_local2].SetPos(Stage.width + 30, Math.random() * Stage.height);
}
EnemyCount--;
i++;
}
EnemyDelay = EnemyAdDelay;
}
}
stop();
var TempScore = -1;
var UniqueID = 0;
var fC = 0;
_root.onEnterFrame = function () {
if (_root._currentframe == 3) {
if (!Loaded) {
LoadGame();
}
var _local2 = getTimer();
dt = (_local2 - Time) / 1000;
UpdateFrame();
updateObj(dt);
Time = _local2;
}
};
Instance of Symbol 54 MovieClip [SpeakerIconOn] "SpeakerSound" in Frame 3
on (release) {
_root.SoundToggle = !_root.SoundToggle;
}
Instance of Symbol 51 MovieClip [Speaker] "Speaker" in Frame 3
on (release) {
_root.SoundToggle = !_root.SoundToggle;
}
Instance of Symbol 87 MovieClip "ReturnToMenu" in Frame 3
on (release) {
_root.UnloadAll(2);
}
Instance of Symbol 90 MovieClip in Frame 3
on (release) {
getURL ("http://www.oceanbreezegames.com/Online-Games/", "_blank");
}
Frame 4
function updateWT(dt) {
fC = fC + (dt / 0.01);
if (fC >= 1) {
var _local1 = 0;
while (_local1 < int(fC)) {
if (WaveText._currentframe == WaveText._totalframes) {
} else {
WaveText.nextFrame();
}
_local1++;
}
fC = fC - int(fC);
}
}
var wtId = -1;
var fC = 0;
var TTime = getTimer();
onEnterFrame = function () {
if (_root._currentframe == 4) {
var _local2 = getTimer();
dt = (_local2 - TTime) / 1000;
updateWT(dt);
TTime = _local2;
WaveText.Wave.text = "WAVE " + _root.Level;
}
};
stop();
Frame 5
var goId = -1;
var atHome = false;
var ibProArcade = false;
SubmitScoreMC._visible = false;
OBHSMC._visible = false;
onEnterFrame = function () {
if (goId == -1) {
atHome = GOTextMC._url.substr(0, 34) == "http://media.oceanbreezegames.com/";
FinalScoreMC.FinalScoreText.text = "Final Score: " + _root.FormatScoreText(_root.Score);
if ((!ibProArcade) && (!atHome)) {
SubmitScoreMC._visible = false;
OBHSMC._visible = true;
} else if (ibProArcade) {
SubmitScoreMC._visible = true;
SubmitScoreMC.onRelease = function () {
var _local2;
_local2 = new LoadVars();
_local2.gname = "dogfight";
_local2.gscore = _root.Score;
_local2.send("index.php?act=Arcade&do=newscore", "_self", "POST");
SubmitScoreMC._visible = false;
goId = 1;
};
} else if (atHome) {
SubmitScoreMC._visible = true;
SubmitScoreMC.onRelease = function () {
if (SubmitScoreMC._visible) {
var _local2;
_local2 = new LoadVars();
_local2.var1 = "dogfight";
_local2.var2 = "Guest";
_local2.var3 = "" + _root.Score;
_local2.sendAndLoad("http://www.oceanbreezegames.com/newhs.php", _local2, "POST");
flash.external.ExternalInterface.call("rewritepersonal");
_root.gotoAndStop(2);
SubmitScoreMC._visible = false;
goId = 1;
}
};
}
}
};
stop();
Instance of Symbol 98 MovieClip in Frame 5
on (release) {
_root.gotoAndStop("2");
}
Instance of Symbol 100 MovieClip "OBHSMC" in Frame 5
on (release) {
getURL ("http://www.oceanbreezegames.com/Online-Games/", "_blank");
}
Symbol 17 MovieClip [Ship2] Frame 1
stop();
Symbol 17 MovieClip [Ship2] Frame 126
stop();
Symbol 22 MovieClip [Smoke] Frame 1
stop();
Symbol 22 MovieClip [Smoke] Frame 60
stop();
Symbol 25 MovieClip [Ship3] Frame 1
stop();
Symbol 25 MovieClip [Ship3] Frame 2
stop();
Symbol 25 MovieClip [Ship3] Frame 120
stop();
Symbol 29 MovieClip [Explosion] Frame 1
stop();
Symbol 29 MovieClip [Explosion] Frame 32
stop();
Symbol 35 MovieClip [Bomb] Frame 1
stop();
Symbol 35 MovieClip [Bomb] Frame 120
stop();
Symbol 41 MovieClip [FinalScoreMC] Frame 1
stop();
Symbol 43 MovieClip [GOTextMC] Frame 1
stop();
Symbol 48 MovieClip [WaveText] Frame 1
stop();
Symbol 48 MovieClip [WaveText] Frame 240
_root.LoadLevel();
_root.gotoAndPlay("3");
gotoAndStop (1);
Instance of Symbol 71 MovieClip in Symbol 72 MovieClip Frame 1
on (release) {
getURL ("http://www.oceanbreezegames.com/Online-Games/", "_self");
}
Symbol 101 MovieClip [__Packages.Vehicle] Frame 0
class Vehicle
{
var Image, Speed, destX, destY;
function Vehicle (Level) {
Image = _root.attachMovie("Tank", "Tank_1", _root.getNextHighestDepth());
Image.cacheAsBitmap = true;
var _local3 = Math.random() * 100;
if (_local3 < 25) {
SetPos(Math.random() * Stage.width, -30);
} else if (_local3 < 50) {
SetPos(Math.random() * Stage.width, Stage.height + 30);
} else if (_local3 < 75) {
SetPos(-30, Math.random() * Stage.height);
} else if (_local3 < 100) {
SetPos(Stage.width + 30, Math.random() * Stage.height);
}
Speed = (Level * 10) + 15;
destX = Math.random() * Stage.width;
destY = Math.random() * Stage.height;
}
function SetPos(xIn, yIn) {
Image._x = xIn;
Image._y = yIn;
}
function Update(dt) {
var _local5 = (Image._rotation * 3.14) / 180;
var _local2 = Math.atan2(destY - Image._y, destX - Image._x);
_local2 = _local2 * 57.29;
if (_local2 < 0) {
_local2 = -_local2;
} else if (_local2 > 0) {
_local2 = 180 + (180 - _local2);
}
var _local3 = Image._rotation;
if (_local3 < 0) {
_local3 = -_local3;
} else if (_local3 > 0) {
_local3 = 180 + (180 - _local3);
}
if ((_local2 > 180) && (_local3 < 180)) {
_local3 = _local3 + 360;
}
if ((_local2 < 180) && (_local3 > 180)) {
_local3 = _local3 - 360;
}
var _local6 = _local3 - _local2;
if (Math.abs(_local6) > 1) {
if (Math.abs(_local6) > 180) {
if (_local3 < _local2) {
Image._rotation = Image._rotation + (dt * 80);
} else {
Image._rotation = Image._rotation - (dt * 80);
}
} else if (_local3 > _local2) {
Image._rotation = Image._rotation + (dt * 80);
} else {
Image._rotation = Image._rotation - (dt * 80);
}
}
if ((Math.abs(destY - Image._y) < 5) && (Math.abs(destX - Image._x) < 5)) {
destX = Math.random() * Stage.width;
destY = Math.random() * Stage.height;
}
Image._x = Image._x + ((Math.cos(_local5) * Speed) * dt);
Image._y = Image._y + ((Math.sin(_local5) * Speed) * dt);
}
}
Symbol 102 MovieClip [__Packages.Bullet] Frame 0
class Bullet
{
var id;
function Bullet () {
id = 0;
}
}
Symbol 103 MovieClip [__Packages.AirPlane] Frame 0
class AirPlane
{
var avoidDir, fC, FireTime, State, EmitCount, ShipSpeed, AvoidTime, FollowTime, Health, TurnSpeed, MaxSpeed, FireTimeDelay, Turning, Image;
function AirPlane (Level) {
avoidDir = 0;
fC = 0;
FireTime = 0;
State = SCOUT;
EmitCount = 0;
ShipSpeed = 120;
AvoidTime = 0;
FollowTime = 5;
switch (Level) {
case 1 :
Health = 70;
TurnSpeed = (Math.random() * 10) + 80;
MaxSpeed = (Math.random() * 10) + 130;
FireTimeDelay = 0.5;
break;
case 2 :
Health = 77;
TurnSpeed = (Math.random() * 15) + 85;
MaxSpeed = (Math.random() * 20) + 130;
FireTimeDelay = 0.5;
break;
case 3 :
Health = 85;
TurnSpeed = (Math.random() * 20) + 95;
MaxSpeed = (Math.random() * 15) + 140;
FireTimeDelay = 0.5;
break;
case 4 :
Health = 85;
TurnSpeed = (Math.random() * 10) + 105;
MaxSpeed = (Math.random() * 25) + 150;
FireTimeDelay = 0.4;
break;
case 5 :
Health = 80;
TurnSpeed = (Math.random() * 5) + 125;
MaxSpeed = (Math.random() * 30) + 160;
FireTimeDelay = 0.35;
break;
default :
Health = 70;
TurnSpeed = (Math.random() * 5) + 135;
MaxSpeed = (Math.random() * 20) + 210;
FireTimeDelay = 0.25;
}
Turning = false;
}
function Fire() {
if (((((FireTime <= 0) && (State != DEATH)) && (State != REMOVE_ME)) && (!Turning)) && (State != AVOID_PLAYER)) {
FireTime = FireTimeDelay;
return(true);
}
return(false);
}
function SetPos(xIn, yIn) {
Image._x = xIn;
Image._y = yIn;
}
function DeathFrameUpdate(dt) {
if (State != DEATH) {
return(undefined);
}
fC = fC + (dt / 0.01);
var _local3 = Math.floor(fC);
fC = fC - Math.floor(fC);
if (_local3 >= 1) {
var _local2 = 0;
while (_local2 < _local3) {
if (Image._currentframe == Image._totalframes) {
Image._visible = false;
} else {
Image.nextFrame();
}
_local2++;
}
}
}
function Hit(damage) {
if (Health <= 0) {
return(undefined);
}
Health = Health - damage;
if (Health <= 0) {
State = DEATH;
Image.gotoAndPlay(2);
_root.planeDive.start(0, 1);
_root.AddScore(2200 + (325 * _root.Level));
}
}
function Update(dt) {
DeathFrameUpdate(dt);
FireTime = FireTime - dt;
switch (State) {
case SCOUT :
FollowPlayer(dt);
break;
case AVOID_PLAYER :
AvoidPlayer(dt);
}
if (State != DEATH) {
if (ShipSpeed > MaxSpeed) {
ShipSpeed = MaxSpeed;
}
} else {
ShipSpeed = ShipSpeed * (1 - (dt * 1.8));
if (Image._currentframe == Image._totalframes) {
State = REMOVE_ME;
_root.explode.start(0, 1);
}
}
Image.swapDepths(_root.getNextHighestDepth());
var _local4 = (Image._rotation * 3.14) / 180;
Image._x = Image._x + ((Math.cos(_local4) * ShipSpeed) * dt);
Image._y = Image._y + ((Math.sin(_local4) * ShipSpeed) * dt);
}
function AvoidPlayer(dt) {
var _local10 = ((Math.cos((_root.PlayerShip._rotation * Math.PI) / 180) * 200) * dt) + _root.PlayerShip._x;
var _local8 = ((Math.sin((_root.PlayerShip._rotation * Math.PI) / 180) * 200) * dt) + _root.PlayerShip._y;
var _local12 = Image._x;
var _local11 = Image._y;
var _local9 = _local10 - _local12;
var _local7 = _local8 - _local11;
var _local3 = Math.atan2(_local7, _local9);
if (avoidDir > 0.5) {
_local3 = _local3 - (Math.PI/2);
} else {
_local3 = _local3 + (Math.PI/2);
}
_local3 = _local3 * 57.29;
if (_local3 < 0) {
_local3 = -_local3;
} else if (_local3 > 0) {
_local3 = 180 + (180 - _local3);
}
var _local4 = Image._rotation;
if (_local4 < 0) {
_local4 = -_local4;
} else if (_local4 > 0) {
_local4 = 180 + (180 - _local4);
}
if ((_local3 > 180) && (_local4 < 180)) {
_local4 = _local4 + 360;
}
if ((_local3 < 180) && (_local4 > 180)) {
_local4 = _local4 - 360;
}
var _local6 = _local4 - _local3;
if (Math.abs(_local6) > 10) {
ShipSpeed = ShipSpeed - (dt * 10);
if (ShipSpeed < 120) {
ShipSpeed = 120;
}
if (Math.abs(_local6) > 180) {
if (_local4 < _local3) {
TurnLeft(dt);
} else {
TurnRight(dt);
}
} else if (_local4 > _local3) {
TurnLeft(dt);
} else {
TurnRight(dt);
}
Turning = true;
} else {
Turning = false;
ShipSpeed = ShipSpeed + (dt * ((Math.random() * 50) + 40));
}
AvoidTime = AvoidTime - dt;
if (AvoidTime < 0) {
State = SCOUT;
FollowTime = (Math.random() * 5) + 8;
}
}
function FollowPlayer(dt) {
var _local10 = ((Math.cos((_root.PlayerShip._rotation * Math.PI) / 180) * 200) * dt) + _root.PlayerShip._x;
var _local8 = ((Math.sin((_root.PlayerShip._rotation * Math.PI) / 180) * 200) * dt) + _root.PlayerShip._y;
var _local12 = Image._x;
var _local11 = Image._y;
var _local9 = _local10 - _local12;
var _local7 = _local8 - _local11;
var _local3 = Math.atan2(_local7, _local9);
_local3 = _local3 * 57.29;
if (_local3 < 0) {
_local3 = -_local3;
} else if (_local3 > 0) {
_local3 = 180 + (180 - _local3);
}
var _local4 = Image._rotation;
if (_local4 < 0) {
_local4 = -_local4;
} else if (_local4 > 0) {
_local4 = 180 + (180 - _local4);
}
if ((_local3 > 180) && (_local4 < 180)) {
_local4 = _local4 + 360;
}
if ((_local3 < 180) && (_local4 > 180)) {
_local4 = _local4 - 360;
}
var _local6 = _local4 - _local3;
if (Math.abs(_local6) > 10) {
ShipSpeed = ShipSpeed - (dt * 10);
if (ShipSpeed < 120) {
ShipSpeed = 120;
}
if (Math.abs(_local6) > 180) {
if (_local4 < _local3) {
TurnLeft(dt);
} else {
TurnRight(dt);
}
} else if (_local4 > _local3) {
TurnLeft(dt);
} else {
TurnRight(dt);
}
Turning = true;
} else {
Turning = false;
ShipSpeed = ShipSpeed + (dt * ((Math.random() * 50) + 40));
}
FollowTime = FollowTime - dt;
if (FollowTime < 0) {
avoidDir = Math.random();
State = AVOID_PLAYER;
AvoidTime = (Math.random() * 3) + 4;
}
}
function TurnLeft(dt) {
Image._rotation = Image._rotation + (TurnSpeed * dt);
if (Image._rotation < 360) {
Image._rotation = Image._rotation - 360;
}
}
function TurnRight(dt) {
Image._rotation = Image._rotation - (TurnSpeed * dt);
if (Image._rotation < 0) {
Image._rotation = Image._rotation + 360;
}
}
var SCOUT = 0;
var FLEE = 1;
var ATTACK = 2;
var DEATH = 3;
var REMOVE_ME = 4;
var AVOID_PLAYER = 5;
}
Symbol 79 Button
on (release) {
if (Loaded) {
LoadLevel(Level);
}
this.gotoAndPlay(4);
}
Symbol 82 Button
on (release) {
getURL ("http://www.oceanbreezegames.com/Online-Games/", "_blank");
}
Symbol 93 MovieClip Frame 30
stop();