Frame 1
stop();
introFrames = 0;
waitTime = 96;
btnUsuallyGames._alpha = 0;
_root.onEnterFrame = function () {
if (introFrames < waitTime) {
btnUsuallyGames._alpha = btnUsuallyGames._alpha + 3;
introFrames++;
} else {
gotoAndStop ("title");
}
};
btnUsuallyGames.onRelease = function () {
getURL ("http://www.usuallygames.com/", "_blank");
};
Frame 10
function setMouseIcon(mouseIcon) {
if (mouseIcon == "crosshair") {
attachMovie("Crosshair", "crosshair", 100000, {_width:28, _height:28, _x:_root._xmouse, _y:_root._ymouse});
removeMovieClip("hand");
} else if (mouseIcon == "hand") {
attachMovie("Hand", "hand", 100000, {_width:19.6, _height:30, _x:_root._xmouse, _y:_root._ymouse});
removeMovieClip("crosshair");
} else if (mouseIcon == "default") {
Mouse.show();
removeMovieClip("crosshair");
removeMovieClip("hand");
}
}
function checkGameOver(gameTime) {
if (gameTime == 0) {
_root.gameOver = 1;
_root.mouseIcon = "default";
setMouseIcon("default");
i = totalFish;
while (i > (totalFish - 30)) {
removeMovieClip(eval ("MainFish" + i));
i--;
}
gotoAndStop ("end");
}
}
function spawnFish() {
if ((framesElapsed % Math.round(framesPerSecond / spawnRate)) == 0) {
attachMovie("MainFish", "MainFish" + totalFish, 10 + totalFish, {fishID:totalFish, fishType:1});
}
if (fishKilled == bonusFishAppearance) {
attachMovie("BonusFish", "BonusFish" + totalFish, 10 + totalFish, {fishID:totalFish, fishType:2});
bonusFishAppearance = Math.ceil((Math.random() * 20) + 10) + fishKilled;
}
if (((framesElapsed / framesPerSecond) % 5) == 0) {
if (spawnRate < 2) {
spawnRate = spawnRate + 0.1;
}
}
}
function fireWeapon() {
if (bulletsRemaining > 0) {
fireShot.start();
eval ("bullet_" + bulletsRemaining)._x = -100;
bulletsRemaining--;
} else {
emptyChamber.start();
bulletsRemaining = -1;
}
}
function reloadBullets() {
bulletsRemaining = 8;
i = 1;
while (i <= bulletsRemaining) {
eval ("bullet_" + i)._x = bulletsStart + (10.4 * (i - 1));
i++;
}
reloadClip.start();
}
instructions._alpha = 0;
instructions.exit.onRelease = function () {
instructions._alpha = 0;
};
buttonOver = new Sound();
buttonOver.attachSound("buttonOver.mp3");
btnHighScores.onRollOver = function () {
if (instructions._alpha == 0) {
buttonOver.start();
}
};
btnStart.onRollOver = function () {
if (instructions._alpha == 0) {
buttonOver.start();
}
};
btnInstructions.onRollOver = function () {
if (instructions._alpha == 0) {
buttonOver.start();
}
};
btnUsuallyGames.onRollOver = function () {
if (instructions._alpha == 0) {
buttonOver.start();
}
};
btnStart.onRelease = function () {
gotoAndStop ("game");
};
btnInstructions.onRelease = function () {
instructions._alpha = 100;
};
btnUsuallyGames.onRelease = function () {
getURL ("http://www.usuallygames.com/", "_blank");
};
btnHighScores.onRelease = function () {
getURL ("http://www.usuallygames.com/scores/?id=100001", "_blank");
};
Frame 19
var framesPerSecond = 36;
var spawnRate = 0.5;
var gameTime = (30 * framesPerSecond);
var airMeterMultiplier = (airMeter._height / gameTime);
var bonusFishAppearance = Math.ceil((Math.random() * 20) + 10);
var bulletsStart = 41;
var framesElapsed = 0;
var playerScore = 0;
var bulletsRemaining = 0;
var totalFish = 0;
var fishKilled = 0;
var gameOver = 0;
var overReload = 0;
var mouseIcon = "crosshair";
textScore.label = playerScore;
fireShot = new Sound();
fireShot.attachSound("fireShot.wav");
emptyChamber = new Sound();
emptyChamber.attachSound("emptyChamber.wav");
reloadClip = new Sound();
reloadClip.attachSound("reloadClip.wav");
Mouse.hide();
attachMovie("Crosshair", "crosshair", 100000, {_width:28, _height:28});
reloadBullets();
_root.onEnterFrame = function () {
setMouseIcon(mouseIcon);
checkGameOver(gameTime);
if (gameOver == 0) {
spawnFish();
}
framesElapsed++;
gameTime--;
airMeter._height = gameTime * airMeterMultiplier;
};
_root.onMouseDown = function () {
if ((overReload == 0) && (gameOver == 0)) {
fireWeapon();
}
};
btnReload.onPress = function () {
reloadBullets();
overReload = 0;
mouseIcon = "crosshair";
};
btnReload.onRollOver = function () {
overReload = 1;
mouseIcon = "hand";
};
btnReload.onRollOut = function () {
overReload = 0;
mouseIcon = "crosshair";
};
Frame 29
txtPlayerName.text = "Enter Your Name";
txtPlayerName.onSetFocus = function () {
txtPlayerName.text = "";
};
btnPlayAgain.onRollOver = function () {
buttonOver.start();
};
btnPlayAgain.onRelease = function () {
gotoAndStop ("game");
};
btnSubmitScore.onRollOver = function () {
buttonOver.start();
};
btnSubmitScore.onRelease = function () {
var _local1 = new LoadVars();
if (playerScore > 0) {
_local1.tooLow = 0;
} else {
_local1.tooLow = 1;
}
_local1.gameID = "100001";
_local1.scorePass = "x92Ksld93kfXksj492oKSos029sk20gi";
_local1.playerName = txtPlayerName.text;
_local1.playerScore = playerScore;
_local1.send("http://www.usuallygames.com/scores/", "_blank", "POST");
};
Symbol 11 MovieClip [FishPoints] Frame 1
#initclip 7
Object.registerClass("FishPoints", FishPoints);
#endinitclip
Symbol 13 MovieClip [BonusFish] Frame 1
#initclip 4
Object.registerClass("BonusFish", Fish);
#endinitclip
Symbol 20 MovieClip [DeadFish] Frame 1
#initclip 5
Object.registerClass("DeadFish", DeadFish);
#endinitclip
Symbol 24 MovieClip [MainFish] Frame 1
#initclip 6
Object.registerClass("MainFish", Fish);
#endinitclip
Symbol 80 MovieClip [__Packages.Fish] Frame 0
class Fish extends MovieClip
{
var fishType, stdWidth, stdHeight, scalePercent, dx, pointsMultiplier, timeMultiplier, _width, _height, startDirection, _x, _y, _xscale, insertionPointX, insertionPointY, pointsEarned, fishID, removeMovieClip;
function Fish () {
super();
if (fishType == 1) {
stdWidth = 200;
stdHeight = 137;
scalePercent = Math.ceil((Math.random() * 40) + 30) / 100;
dx = (Math.random() * 10) + 5;
pointsMultiplier = 1;
timeMultiplier = 1;
} else if (fishType == 2) {
stdWidth = 150;
stdHeight = 103;
scalePercent = Math.ceil((Math.random() * 20) + 20) / 100;
dx = (Math.random() * 15) + 10;
pointsMultiplier = 4;
timeMultiplier = 4;
}
_width = stdWidth * scalePercent;
_height = stdHeight * scalePercent;
startDirection = Math.round(Math.random());
if (startDirection == 0) {
_x = 0;
_y = (Math.random() * (Stage.height - (_height * 2))) + _height;
}
if (startDirection == 1) {
_x = Stage.width;
_y = (Math.random() * (Stage.height - (_height * 2))) + _height;
_xscale = _xscale * -1;
dx = -dx;
}
_root.totalFish++;
}
function onEnterFrame() {
_x = _x + dx;
}
function onPress() {
if ((_root.bulletsRemaining >= 0) && (_root.gameOver == 0)) {
if (dx > 0) {
insertionPointX = _x - (_width / 2);
} else if (dx < 0) {
insertionPointX = _x + (_width / 2);
}
insertionPointY = _y;
pointsEarned = (Math.round(Math.abs(dx * 3)) + Math.round(Math.abs((scalePercent * 100) - 100))) * pointsMultiplier;
_root.playerScore = _root.playerScore + pointsEarned;
_root.textScore.label = _root.playerScore;
_root.gameTime = _root.gameTime + ((_root.framesPerSecond / 2) * timeMultiplier);
_root.attachMovie("DeadFish", "DeadFish" + fishID, 998 + fishID, {_x:insertionPointX, _y:insertionPointY, fishWidth:_width, fishHeight:_height});
_root.attachMovie("FishPoints", "FishPoints" + fishID, 999 + fishID, {_x:insertionPointX, _y:insertionPointY, pointsEarned:pointsEarned, pointsID:fishID});
(removeMovieClip());// not popped
_root.fishKilled++;
}
}
}
Symbol 81 MovieClip [__Packages.DeadFish] Frame 0
class DeadFish extends MovieClip
{
var stdWidth, stdHeight, scalePercent, _width, fishWidth, _height, _alpha, removeMovieClip;
function DeadFish () {
super();
stdWidth = 92.5;
stdHeight = 30;
scalePercent = 0.5;
_width = fishWidth * scalePercent;
_height = ((fishWidth * scalePercent) * stdHeight) / stdWidth;
}
function onEnterFrame() {
if (_alpha > 0) {
_alpha = _alpha - 3;
} else {
(removeMovieClip());// not popped
}
}
}
Symbol 82 MovieClip [__Packages.FishPoints] Frame 0
class FishPoints extends MovieClip
{
var points, pointsEarned, _y, _alpha, removeMovieClip;
function FishPoints () {
super();
points = pointsEarned + " Points";
}
function onEnterFrame() {
_y = _y - 3;
if (_alpha > 0) {
_alpha = _alpha - 3;
} else {
(removeMovieClip());// not popped
}
}
}