Frame 1
function menuHandler() {
if ((curStage >= 3) && (curStage <= 8)) {
youLoseGoodDaySir();
}
}
function frameHandler() {
if (expert) {
modeStr = "Expert Mode!!!!";
} else {
modeStr = " ";
}
if (cStatus == 1) {
moveGiraffe(false);
clearDrawingAreas();
createNeckPoint();
drawNeckPoint();
handleStars();
healthHandler();
if (curStage == 3) {
addBombs();
handleBombs();
}
if (curStage == 4) {
addBombs();
handleBombs();
handleBullets();
}
if (curStage == 5) {
addBombs();
handleBombs();
spawnRockets();
handleRockets();
handleBullets();
}
if (curStage == 6) {
handleBombs();
handleRockets();
handleBullets();
}
if (curStage == 7) {
handleBullets();
handleWalrus();
handleRockets();
}
if (curStage == 8) {
addBombs();
handleBombs();
handleBullets();
handleWalrus();
handleRockets();
}
}
}
function handleWalrus() {
w.turret._rotation = rotateTo(w._x + w.turret._x, w._y + w.turret._y, gHead._x, gHead._y);
wCounter++;
if (expert) {
if (((wCounter >= 4) && (curStage == 7)) || ((wCounter >= 8) && (curStage == 8))) {
addThat();
}
} else if (((wCounter >= 10) && (curStage == 7)) || ((wCounter >= 10) && (curStage == 8))) {
addThat();
}
}
function addThat() {
var _local1 = new Object();
_local1.x = w.turret.tip._x;
_local1.y = w.turret.tip._y;
w.turret.localToGlobal(_local1);
w.turret.fT.play();
addRocket(_local1.x, _local1.y, 15, w.turret._rotation);
wCounter = 0;
}
function spawnRockets() {
wCounter++;
if (expert) {
if (wCounter >= 7) {
addRocket(random(200), 710, 20, 180);
wCounter = 0;
}
} else if (wCounter >= 13) {
addRocket(random(200), 710, 20, 180);
wCounter = 0;
}
}
function addRocket(xPos, yPos, vel, rot) {
shel = lineArea.attachMovie("rocket", "rocket" + k, k++);
shel.v = vel;
shel._x = xPos;
shel._y = yPos;
shel._rotation = rot + 90;
shel.yV = vel * Math.cos(rot * 0.01745329);
shel.xV = (-vel) * Math.sin(rot * 0.01745329);
rockets.push(shel);
}
function handleRockets() {
i = 0;
while (i < rockets.length) {
var _local1 = rockets[i];
_local1._x = _local1._x + _local1.xV;
_local1._y = _local1._y + _local1.yV;
if ((((_local1._y < -20) || (_local1._y > 720)) || (_local1._x < -20)) || (_local1._x > 220)) {
_local1.removeMovieClip();
rockets.splice(i, 1);
} else if (gHead.hitA.hitTest(_local1._x, _local1._y)) {
killPlayer();
_local1.removeMovieClip();
rockets.splice(i, 1);
}
i++;
}
}
function addBombs() {
if (active) {
bombCounter++;
}
if (expert) {
if ((curStage == 3) && (bombCounter >= 3)) {
addB();
return(undefined);
}
if ((curStage == 4) && (bombCounter >= 2)) {
addB();
return(undefined);
}
if ((curStage == 5) && (bombCounter >= 7)) {
addB();
return(undefined);
}
if ((curStage == 8) && (bombCounter >= 4)) {
addB();
return(undefined);
}
} else {
if ((curStage == 3) && (bombCounter >= 7)) {
addB();
return(undefined);
}
if ((curStage == 4) && (bombCounter >= 4)) {
addB();
return(undefined);
}
if ((curStage == 5) && (bombCounter >= 15)) {
addB();
return(undefined);
}
if ((curStage == 8) && (bombCounter >= 7)) {
addB();
return(undefined);
}
}
}
function addB() {
bombCounter = 0;
shel = itemArea.attachMovie("bombFall", "bombFall" + k, k++);
shel._x = random(sW);
shel._y = -50;
shel.life = 1;
bombs.push(shel);
}
function handleBombs() {
i = 0;
while (i < bombs.length) {
curBomb = bombs[i];
curBomb._y = curBomb._y + 20;
if (curBomb.hitTest(gHead.hitA)) {
killPlayer();
curBomb.removeMovieClip();
bombs.splice(i, 1);
}
if (curBomb._y > 720) {
curBomb.removeMovieClip();
bombs.splice(i, 1);
}
i++;
}
}
function handleBullets() {
bulletsCounter++;
if (bulletsCounter == 4) {
bulletsCounter = 0;
bu = itemArea.attachMovie("bullet", "bullet" + k, k++);
bu2 = itemArea.attachMovie("bullet", "bullet" + k, k++);
var _local2 = new Object();
_local2.x = gHead.leftLaser._x;
_local2.y = gHead.leftLaser._y;
var _local3 = new Object();
_local3.x = gHead.rightLaser._x;
_local3.y = gHead.rightLaser._y;
gHead.localToGlobal(_local2);
gHead.localToGlobal(_local3);
bu._x = (_local2.x + random(6)) - 3;
bu._y = _local2.y;
bu2._x = (_local3.x + random(6)) - 3;
bu2._y = _local3.y;
bu.v = (bu2.v = (-neckSpeed) * 1.2);
bu.yV = (bu2.yV = bu.v * Math.cos(gHead._rotation * 0.01745329));
bu.xV = (bu2.xV = (-bu.v) * Math.sin(gHead._rotation * 0.01745329));
bullets.push(bu);
bullets.push(bu2);
}
i = 0;
while (i < bullets.length) {
var _local1 = bullets[i];
_local1._x = _local1._x + _local1.xV;
_local1._y = _local1._y + _local1.yV;
if (_local1._y < -20) {
_local1.removeMovieClip();
bullets.splice(i, 1);
} else if (_local1.hitTest(w.box)) {
w.flashWalrus.play();
_local1.removeMovieClip();
bullets.splice(i, 1);
i--;
}
j = 0;
while (j < bombs.length) {
curBomb = bombs[j];
if (curBomb.hitTest(_local1)) {
curBomb.life--;
curBomb.play();
if (curBomb.life == 0) {
callExplosionAt(curBomb);
bombs.splice(j, 1);
curBomb.removeMovieClip();
_local1.removeMovieClip();
bullets.splice(i, 1);
i--;
}
}
j++;
}
i++;
}
}
function callExplosionAt(mov) {
l = 0;
while (l < 20) {
shel = itemArea.attachMovie("explode", "explode" + k, k++);
shel._x = mov._x;
shel._y = mov._y;
shel._rotation = random(360);
shel._xscale = (shel._yscale = random(300) + 50);
var _local1 = new Color(shel);
l++;
}
}
function handleStars() {
gHead.lTrail._yscale = random(20) + 100;
gHead.rTrail._yscale = random(20) + 100;
if (curStage != 6) {
st = attachMovie("star", "star" + k, k++);
st2 = attachMovie("star", "star" + k, k++);
var _local2 = new Object();
_local2.x = gHead.leftRocket._x;
_local2.y = gHead.leftRocket._y;
var _local3 = new Object();
_local3.x = gHead.rightRocket._x;
_local3.y = gHead.rightRocket._y;
gHead.localToGlobal(_local2);
gHead.localToGlobal(_local3);
st._x = (_local2.x + random(6)) - 3;
st._y = _local2.y;
st2._x = (_local3.x + random(6)) - 3;
st2._y = _local3.y;
applyStarStyle(st);
applyStarStyle(st2);
stars.push(st);
stars.push(st2);
}
i = 0;
while (i < stars.length) {
var _local1 = stars[i];
_local1._x = _local1._x + _local1.xV;
_local1._y = _local1._y + _local1.yV;
_local1.life++;
_local1._alpha = _local1._alpha - 2;
if (_local1.life > 40) {
_local1.removeMovieClip();
stars.splice(i, 1);
}
i++;
}
}
function applyStarStyle(mov) {
mov._xscale = (mov._yscale = random(200) + 50);
mov.v = neckSpeed * (mov._xscale / 100);
mov.yV = mov.v * Math.cos(gHead._rotation * 0.01745329);
mov.xV = (-mov.v) * Math.sin(gHead._rotation * 0.01745329);
mov.life = 0;
var _local2 = new Color(mov);
_local2.setRGB(16777215);
}
function nuke() {
f = 0;
while (f < rockets.length) {
rockets[f].removeMovieClip();
f++;
}
f = 0;
while (f < bombs.length) {
bombs[f].removeMovieClip();
f++;
}
f = 0;
while (f < stars.length) {
stars[f].removeMovieClip();
f++;
}
f = 0;
while (f < bullets.length) {
bullets[f].removeMovieClip();
f++;
}
rockets.splice(0, rockets.length);
bombs.splice(0, bombs.length);
stars.splice(0, stars.length);
bullets.splice(0, bullets.length);
lineArea.removeMovieClip();
attachMovie("drawArea", "lineArea", k++);
neckPoints.splice(0, neckPoints.length);
clearDrawingAreas();
}
function init() {
trace("INIT LAUNCH");
nuke();
gHead._x = 100;
gHead._y = 600;
i = 0;
while (i < (neckSegment * 2)) {
createNeckPoint();
drawNeckPoint();
i++;
}
onEnterFrame = frameHandler;
df = 0;
while (df < 40) {
moveGiraffe(true);
clearDrawingAreas();
createNeckPoint();
drawNeckPoint();
handleStars();
df++;
}
}
function moveGiraffe(fromInit) {
if (controls == "keyboard") {
if (Key.isDown(37)) {
xV = xV - s;
} else if (Key.isDown(39)) {
xV = xV + s;
}
if (Key.isDown(38)) {
yV = yV - s;
} else if (Key.isDown(40)) {
yV = yV + s;
}
}
if (controls == "mouse") {
if (_xmouse > gHead._x) {
xV = xV + s;
if (_xmouse <= (xV + gHead._x)) {
xV = 0;
gHead._x = _xmouse;
}
} else if (_xmouse < gHead._x) {
xV = xV - s;
if (_xmouse >= (xV + gHead._x)) {
xV = 0;
gHead._x = _xmouse;
}
}
if (_ymouse > gHead._y) {
yV = yV + s;
if (_xmouse <= (yV + gHead._y)) {
yV = 0;
gHead._y = _ymouse;
}
} else if (_ymouse < gHead._y) {
yV = yV - s;
if (_ymouse >= (yV + gHead._y)) {
yV = 0;
gHead._y = _ymouse;
}
}
}
if (controls == "mouse") {
if (((Key.isDown(37) || (Key.isDown(39))) || (Key.isDown(40))) || (Key.isDown(38))) {
controls = "keyboard";
}
}
if (controls == "keyboard") {
if ((oldX != _xmouse) || (oldY != _ymouse)) {
controls = "mouse";
}
}
oldX = _xmouse;
oldY = _ymouse;
gHead._x = gHead._x + xV;
if (!fromInit) {
gHead._y = gHead._y + yV;
}
gHead._rotation = xV + yV;
if (gHead._x > (sW - 10)) {
gHead._x = sW - 10;
xV = xV * -1;
}
if (gHead._x < 10) {
gHead._x = 10;
xV = xV * -1;
}
if (gHead._y > 640) {
gHead._y = 640;
yV = yV * -1;
}
if (gHead._y < 10) {
gHead._y = 10;
yV = yV * -1;
}
xV = xV * 0.8;
yV = yV * 0.8;
spots._x = gHead._x;
spots._y = gHead._y;
}
function clearDrawingAreas() {
drawArea.clear();
lineArea.clear();
}
function createNeckPoint() {
neckPoints.push(new flash.geom.Point(gHead._x, gHead._y));
if (neckPoints.length > neckSegments) {
neckPoints.shift();
}
}
function drawNeckPoint() {
drawArea.lineStyle(3, 16777215, 100);
drawArea.beginFill(16777215, 100);
drawArea.moveTo(neckPoints[0].x, neckPoints[0].y);
lineArea.lineStyle(1, 0, 100);
lineArea.moveTo(neckPoints[0].x, neckPoints[0].y);
i = 0;
while (i < neckPoints.length) {
var _local1 = neckPoints[i];
if (i != 0) {
drawArea.lineTo(_local1.x, _local1.y);
lineArea.lineTo(_local1.x, _local1.y);
}
i++;
}
drawArea.lineTo(neckPoints[neckPoints.length - 1].x + nW, neckPoints[neckPoints.length - 1].y);
lineArea.moveTo(neckPoints[neckPoints.length - 1].x + nW, neckPoints[neckPoints.length - 1].y);
i = neckPoints.length - 1;
while (i > -1) {
var _local1 = neckPoints[i];
if (i != (neckPoints.length - 1)) {
drawArea.lineTo(_local1.x + nW, _local1.y);
lineArea.lineTo(_local1.x + nW, _local1.y);
}
i--;
}
drawArea.lineTo(neckPoints[0].x, neckPoints[0].y);
drawArea.endFill();
i = 0;
while (i < neckPoints.length) {
var _local1 = neckPoints[i];
_local1.y = _local1.y + neckSpeed;
i++;
}
}
function healthHandler() {
health++;
if (health > 100) {
health = 100;
}
if (health < 0) {
youLoseGoodDaySir();
}
giraffeBar._xscale = health;
}
function youLoseGoodDaySir() {
health = 0;
giraffeBar._xscale = health;
cStatus = 2;
stop();
deaths++;
_root.blackAndWhite(false);
attachMovie("lose", "lose", k++);
}
function killPlayer() {
health = health - 50;
de = 0;
while (de < 5) {
shel = attachMovie("explosionOut2", "e" + k, k++);
shel._x = gHead._x;
shel._y = gHead._y;
var _local1 = new Color(shel);
_local1.setRGB(16711680);
de++;
}
}
function callStage(num) {
trace("BOOTING STAGE " + num);
curStage = num;
if (curStage == 2) {
init();
}
if (curStage == 7) {
nuke();
}
if (curStage == 9) {
nuke();
cStatus = 2;
}
active = true;
}
function ceaseFire() {
active = false;
}
function rotateTo(x1, y1, x2, y2) {
return(((-Math.atan2(x2 - x1, y2 - y1)) * 180) / 3.141593);
}
function cleanStart() {
trace("==cleanStart==");
health = 100;
deaths = 0;
lose.removeMovieClip();
_root.blackAndWhite(true);
cStatus = 1;
curStage = 0;
gotoAndStop (2);
}
function startGame() {
health = 100;
deaths = 0;
lose.removeMovieClip();
_root.blackAndWhite(true);
cStatus = 1;
curStage = 0;
gotoAndPlay (3);
}
function restartSection() {
trace("==restart==");
health = 100;
lose.removeMovieClip();
_root.blackAndWhite(true);
var _local2 = "s" + curStage;
cStatus = 1;
gotoAndPlay(_local2);
init();
}
Stage.showMenu = false;
var my_cm = new ContextMenu();
var expert = false;
var modeStr = "";
my_cm.onSelect = menuHandler;
this.menu = my_cm;
var active = false;
var sW = 200;
var SH = 700;
var nW = 10;
var neckSegments = 20;
var neckSpeed = (700 / neckSegments);
var xV = 0;
var yV = 0;
var s = 2;
var k = 0;
var curStage = 0;
var cStatus = 1;
var deaths = 0;
var controls = "keyboard";
var oldX = _xmouse;
var oldY = _ymouse;
var stars = new Array();
var bombs = new Array();
var bombCounter = 0;
var rockets = new Array();
var wCounter = 0;
var rocketCounter = 0;
var bullets = new Array();
var bulletsCounter = 0;
var neckPoints = new Array();
var health = 100;
MovieClip.prototype.blackAndWhite = function (clear) {
};
stop();
Frame 5
callStage(1);
Frame 594
tg.play();
Frame 610
callStage(2);
Frame 1216
callStage(3);
Frame 1681
ceaseFire();
Frame 1820
callStage(4);
Frame 2350
ceaseFire();
Frame 2420
callStage(5);
Frame 3000
callStage(6);
Frame 3700
callStage(7);
Frame 4250
callStage(8);
Frame 4810
callStage(9);
Frame 4876
de = 0;
while (de < 30) {
shel = attachMovie("explosionOut", "e" + k, k++);
shel._x = jW._x;
shel._y = jW._y;
de++;
}
Frame 5083
stop();
Symbol 8 MovieClip [explode] Frame 11
this.removeMovieClip();
Symbol 14 MovieClip [bombFall] Frame 1
stop();
Symbol 20 MovieClip [explosionOut2] Frame 1
this._xscale = (this._yscale = random(100) + 50);
this._rotation = random(360);
Symbol 20 MovieClip [explosionOut2] Frame 15
this.removeMovieClip();
Symbol 21 MovieClip [explosionOut] Frame 1
this._xscale = (this._yscale = random(400) + 100);
this._rotation = random(360);
Symbol 21 MovieClip [explosionOut] Frame 51
this.removeMovieClip();
Symbol 30 Button
on (release) {
getURL ("http://www.armorgames.com/", "_blank");
}
Symbol 36 Button
on (release, keyPress "<Space>") {
_root.restartSection();
}
Symbol 40 Button
on (release) {
_root.cleanStart();
}
Symbol 43 Button
on (release) {
getURL ("http://www.armorgames.com/", "_blank");
}
Symbol 53 MovieClip [lose] Frame 80
stop();
Symbol 57 Button
on (release) {
getURL ("http://www.armorgames.com/", "_blank");
}
Symbol 64 Button
on (release) {
_root.startGame();
_root.expert = false;
_parent.play();
}
Symbol 67 Button
on (release) {
_root.startGame();
_root.expert = true;
_parent.play();
}
Symbol 74 MovieClip Frame 1
stop();
Instance of Symbol 68 MovieClip in Symbol 74 MovieClip Frame 1
onClipEvent (enterFrame) {
loaded = _root.getBytesLoaded();
total = _root.getBytesTotal();
framesLoaded = Math.ceil((loaded / total) * 100);
gotoAndStop(framesLoaded);
if (framesLoaded >= 99) {
_parent.pb._visible = true;
} else {
_parent.pb._visible = false;
}
}
Symbol 74 MovieClip Frame 51
stop();
Symbol 88 Button
on (press) {
getURL ("http://www.armorgames.com", "_blank");
}
Symbol 89 MovieClip Frame 1
gotoAndPlay (2);
Symbol 89 MovieClip Frame 161
stop();
Symbol 107 MovieClip Frame 1
stop();
Symbol 107 MovieClip Frame 50
stop();
Symbol 114 Button
on (release) {
gotoAndStop ("s3");
}
Symbol 115 Button
on (release) {
gotoAndPlay (609);
}
Symbol 126 MovieClip Frame 1
onEnterFrame = function () {
if (_root.cStatus == 1) {
play();
} else {
stop();
}
};
Symbol 132 MovieClip Frame 1
this._visible = false;
Symbol 134 Button
on (release) {
gotoAndPlay (1214);
}
Symbol 163 MovieClip Frame 1
onEnterFrame = function () {
if (_root.cStatus == 1) {
play();
} else {
stop();
}
};
Symbol 187 MovieClip Frame 1
stop();
Symbol 194 MovieClip Frame 1
stop();
Symbol 203 MovieClip Frame 1
onEnterFrame = function () {
if (_root.cStatus == 1) {
play();
} else {
stop();
}
};
Symbol 219 Button
on (release) {
_root.cleanStart();
}
Symbol 223 Button
on (release) {
getURL ("http://www.armorgames.com/", "_blank");
}