Frame 1
function levelUp() {
level++;
pointsNeeded = pointsNeeded + 100;
scrollSpeed++;
if (tokenFrequency > 15) {
tokenFrequency--;
}
if (!gullFest) {
if (seagullFrequency > 50) {
seagullFrequency = seagullFrequency - 10;
}
}
if ((level % 2) == 0) {
if (tokenMoveX < 12) {
tokenMoveX++;
}
}
if ((level % 2) == 0) {
if (numberThreshold < 9) {
numberThreshold++;
}
}
if ((level % 4) == 0) {
if (tokensPerSpawn < 3) {
tokensPerSpawn++;
}
}
}
function clearScreen() {
removeMovieClip("Background");
removeMovieClip("Interface");
}
function spawnSeagull() {
var _local3 = randInt(1, 4);
attachMovie(seagullClip, "Seagull" + seagullIndex, seagullDepth[_local3 - 1] + seagullIndex);
theSeagull = _root["Seagull" + seagullIndex];
if (!gullFest) {
if (seagullClip == "seagull") {
SFX.gotoAndPlay("Seagull");
} else {
SFX.gotoAndPlay("UFOFire");
}
}
seagullsActive.push(theSeagull);
theSeagull.active = true;
theSeagull._x = tokenSpawnX;
theSeagull.myRow = _local3;
theSeagull._y = tokenSpawnY[theSeagull.myRow];
if (seagullIndex >= seagullIndexMax) {
seagullIndex = 1;
} else {
seagullIndex++;
}
theSeagull.onEnterFrame = function () {
if (this.active) {
this._x = this._x - seagullMoveX;
if (gameInPlay) {
if (this.Anim.Collider.hitTest(Player.Surfboard) && (playerOnWave == this.myRow)) {
hitSeagull(this);
}
}
if (this._x < tokenCutoffX) {
removeSeagull(this);
removeMovieClip(this);
}
}
};
}
function spawnTokens() {
var _local6 = [1, 2, 3, 4];
shuffle(_local6);
var _local3 = 1;
while (_local3 <= tokensPerSpawn) {
attachMovie("token", "Token" + tokenIndex, tokenDepth[_local6[_local3 - 1] - 1] + tokenIndex);
theToken = _root["Token" + tokenIndex];
var _local5 = 1;
var _local4 = 9;
if (tokensHeld.length != 0) {
if ((lastNumberGrabbed - numberThreshold) >= 1) {
_local5 = lastNumberGrabbed - numberThreshold;
} else {
_local5 = 1;
}
if ((lastNumberGrabbed + numberThreshold) <= 9) {
_local4 = lastNumberGrabbed + numberThreshold;
} else {
_local4 = 9;
}
}
theToken.myNumber = randInt(_local5, _local4);
theToken.gotoAndStop(theToken.myNumber);
tokensActive.push(theToken);
theToken.active = true;
theToken.myRow = _local6[_local3 - 1];
theToken._x = tokenSpawnX;
theToken._y = tokenSpawnY[theToken.myRow];
if (tokenIndex >= tokenIndexMax) {
tokenIndex = 1;
} else {
tokenIndex++;
}
theToken.onEnterFrame = function () {
if (this.active) {
this._x = this._x - tokenMoveX;
if (gameInPlay) {
if (Player.Surfboard.hitTest(this._x, this._y, true) && (playerOnWave == this.myRow)) {
grabToken(this);
}
}
if (this._x < tokenCutoffX) {
removeToken(this);
removeMovieClip(this);
}
}
};
_local3++;
}
}
function hitSeagull(theSeagull) {
if (!noPickingUp) {
theSeagull.swapDepths(9999);
theSeagull.active = false;
theSeagull.gotoAndPlay("Hit");
if (seagullClip == "seagull") {
SFX.gotoAndPlay("SeagullHit");
} else {
SFX.gotoAndPlay("UFOCrash");
}
clearHand();
removeSeagull(theSeagull);
}
}
function removeSeagull(theSeagull) {
var _local1 = 0;
while (_local1 < seagullsActive.length) {
if (seagullsActive[_local1] == theSeagull) {
seagullsActive.splice(_local1, 1);
}
_local1++;
}
}
function grabToken(theToken) {
if (!noPickingUp) {
if (tokensHeld.length < 5) {
Player.Anim.gotoAndPlay("Twirl");
tokensHeld.push(theToken.myNumber);
lastNumberGrabbed = theToken.myNumber;
theSlot = Interface["Slot" + tokensHeld.length];
theSlot.gotoAndStop(theToken.myNumber + 1);
theToken.active = false;
theToken.gotoAndPlay("Grabbed");
removeToken(theToken);
if (tokensHeld.length > 1) {
evaluateHand();
} else {
SFX.gotoAndPlay("TokenGood1");
}
}
}
}
function evaluateHand() {
playerHand = 0;
if (checkStraightDown()) {
playerHand = 1;
} else if (checkStraightUp()) {
playerHand = 2;
} else if (check5InARow()) {
playerHand = 3;
} else {
playerHand = 0;
}
if (playerHand != 0) {
if (tokensHeld.length < 5) {
lastHandOnCheck = playerHand;
SFX.gotoAndPlay("TokenGood" + tokensHeld.length);
} else {
noPickingUp = true;
handLength = tokensHeld.length;
SFX.gotoAndPlay("TokenGood" + tokensHeld.length);
Interface.gotoAndPlay("RewardHand");
}
} else {
playerHand = lastHandOnCheck;
if (lastHandOnCheck != 0) {
Interface["Slot" + tokensHeld.length]._visible = false;
}
noPickingUp = true;
handLength = tokensHeld.length - 1;
SFX.gotoAndPlay("TokenBad");
Interface.gotoAndPlay("RewardHand");
}
}
function clearHand() {
var _local1 = 1;
while (_local1 <= 5) {
Interface["Slot" + _local1].gotoAndStop(1);
Interface["Slot" + _local1]._visible = true;
_local1++;
}
tokensHeld = [];
lastHandOnCheck = 0;
}
function removeToken(theToken) {
var _local1 = 0;
while (_local1 < tokensActive.length) {
if (tokensActive[_local1] == theToken) {
tokensActive.splice(_local1, 1);
}
_local1++;
}
}
function check5InARow() {
var _local2 = true;
var _local1 = 1;
while (_local1 < tokensHeld.length) {
if (tokensHeld[_local1] != tokensHeld[_local1 - 1]) {
_local2 = false;
break;
}
_local1++;
}
return(_local2);
}
function checkStraightUp() {
var _local2 = true;
var _local1 = 1;
while (_local1 < tokensHeld.length) {
if (tokensHeld[_local1] != (tokensHeld[_local1 - 1] + 1)) {
_local2 = false;
break;
}
_local1++;
}
return(_local2);
}
function checkStraightDown() {
var _local2 = true;
var _local1 = 1;
while (_local1 < tokensHeld.length) {
if (tokensHeld[_local1] != (tokensHeld[_local1 - 1] - 1)) {
_local2 = false;
break;
}
_local1++;
}
return(_local2);
}
function randInt(num0, num1) {
if (arguments.length == 1) {
return(Math.round(Math.random() * num0));
}
return(Math.round(Math.random() * Math.abs(num0 - num1)) + num0);
}
function shuffle(theArray) {
i = 0;
while (i <= (theArray.length - 1)) {
var _local2 = Math.round(Math.random() * i);
var _local3 = theArray[i];
theArray[i] = theArray[_local2];
theArray[_local2] = _local3;
i++;
}
return(theArray);
}
stop();
fscommand ("allowscale", false);
funcHITBOX = function (arEvent, arAction) {
lString = ((("javascript: _hbLink ('/flash/" + arEvent.toLowerCase()) + "/") + arAction.toLowerCase()) + "','left','0,0,0,0')";
getURL (lString);
};
Frame 10
stop();
var cheatCodes = ["EPICWAVE", "GULLFEST", "AREA51"];
var defaultText = "";
var codeInput = defaultText;
var activeCode = null;
CodeEntry.codeField.restrict = "A-Z 0-9";
Frame 20
stop();
Instance of Symbol 179 MovieClip in Frame 20
onClipEvent (load) {
gotoAndStop (9);
}
Instance of Symbol 179 MovieClip in Frame 20
onClipEvent (load) {
gotoAndStop (8);
}
Instance of Symbol 179 MovieClip in Frame 20
onClipEvent (load) {
gotoAndStop (7);
}
Instance of Symbol 179 MovieClip in Frame 20
onClipEvent (load) {
gotoAndStop (6);
}
Instance of Symbol 179 MovieClip in Frame 20
onClipEvent (load) {
gotoAndStop (5);
}
Instance of Symbol 179 MovieClip in Frame 20
onClipEvent (load) {
gotoAndStop (1);
}
Instance of Symbol 179 MovieClip in Frame 20
onClipEvent (load) {
gotoAndStop (2);
}
Instance of Symbol 179 MovieClip in Frame 20
onClipEvent (load) {
gotoAndStop (3);
}
Instance of Symbol 179 MovieClip in Frame 20
onClipEvent (load) {
gotoAndStop (4);
}
Instance of Symbol 179 MovieClip in Frame 20
onClipEvent (load) {
gotoAndStop (5);
}
Instance of Symbol 179 MovieClip in Frame 20
onClipEvent (load) {
gotoAndStop (5);
}
Instance of Symbol 179 MovieClip in Frame 20
onClipEvent (load) {
gotoAndStop (5);
}
Instance of Symbol 179 MovieClip in Frame 20
onClipEvent (load) {
gotoAndStop (5);
}
Instance of Symbol 179 MovieClip in Frame 20
onClipEvent (load) {
gotoAndStop (5);
}
Instance of Symbol 179 MovieClip in Frame 20
onClipEvent (load) {
gotoAndStop (5);
}
Frame 30
var score = 0;
var totalScore = 0;
var level = 1;
var pointsNeeded = 100;
var scrollSpeed = 5;
var counter = 0;
var counterMax = 1500;
var gameInPlay = false;
var noPickingUp = false;
var roundOver = false;
var handNames = ["Add 'em up!", "straight down!", "straight up!", "in a row!"];
var handValues = [0, 35, 30, 25];
var handLength = 0;
var lastNumberGrabbed = 0;
var lastHandOnCheck = 0;
var numberThreshold = 1;
var playerDepth = [500, 2500, 4500, 6500];
var seagullCounter = 0;
var seagullFrequency = 300;
var seagullInterval = 0;
var seagullIndex = 1;
var seagullIndexMax = 100;
var seagullMoveX = 8;
var seagullsActive = [];
var seagullDepth = [2300, 4300, 6300, 8300];
var tokensActive = [];
var tokensHeld = [];
var tokenIndex = 1;
var tokenIndexMax = 1000;
var tokenDepth = [1000, 3000, 5000, 7000];
var tokenFrequency = 40;
var tokensPerSpawn = 1;
var tokenMoveX = 7;
var tokenSpawnX = 700;
var tokenSpawnY = [0, 100, 150, 200, 250];
var tokenCutoffX = -50;
var playerBusy = false;
var playerOnWave = 1;
var playerStartX = 115;
var playerStartY = 100;
var playerSpeed = 1.5;
var playerHand = 0;
attachMovie("interface", "Interface", 10000);
attachMovie("background", "Background", 1);
var seagullClip = "seagull";
var gullFest = false;
if (activeCode != null) {
if (activeCode == "EPICWAVE") {
scrollSpeed = 20;
tokenMoveX = 15;
counterMax = 750;
} else if (activeCode == "GULLFEST") {
gullFest = true;
seagullFrequency = 25;
} else if (activeCode == "AREA51") {
seagullClip = "ufo";
}
}
SFX.gotoAndPlay("Waves");
gotoAndPlay ("Play");
Frame 40
attachMovie("player", "Player", playerDepth[0]);
Player._x = playerStartX;
Player._y = playerStartY;
playerOnWave = 1;
playerBusy = false;
playerHand = 0;
var i = 1;
while (i <= 4) {
attachMovie("wave", "Wave" + i, playerDepth[i - 1] - 1);
theWave = _root["Wave" + i];
theWave._x = 115;
theWave._y = tokenSpawnY[i];
theWave.gotoAndPlay(randInt(1, theWave._totalFrames));
i++;
}
removeAllObstacles();
seagullIndex = 1;
seagullInterval = seagullFrequency + Math.ceil(randInt(1, seagullFrequency / 2));
clearHand();
tokensActive = [];
tokenIndex = 1;
lastNumberGrabbed = 0;
lastHandOnCheck = 0;
counter = 0;
score = 0;
gameInPlay = false;
roundOver = false;
noPickingUp = false;
var x = (((counter / counterMax) * 100) * 5);
Interface.ProgressMeter.Marker._x = x;
Interface.gotoAndPlay("BeginLevel");
stop();
Interface.onEnterFrame = function () {
if (gameInPlay) {
counter++;
if ((counter % tokenFrequency) == 0) {
spawnTokens();
}
if (seagullCounter < seagullInterval) {
seagullCounter++;
} else {
spawnSeagull();
seagullCounter = 0;
seagullInterval = seagullFrequency + Math.ceil(randInt(1, seagullFrequency / 2));
}
var _local2 = ((counter / counterMax) * 100) * 5;
this.ProgressMeter.Marker._x = _local2;
if ((counter >= counterMax) && (!noPickups)) {
gotoAndPlay ("EndLevel");
}
}
};
Player.onEnterFrame = function () {
this.play();
if (gameInPlay) {
this.swapDepths(playerDepth[playerOnWave - 1]);
if (!playerBusy) {
if (Key.isDown(38)) {
playerBusy = true;
if (playerOnWave > 1) {
SFX.gotoAndPlay("Move");
playerOnWave--;
}
} else if (Key.isDown(40)) {
playerBusy = true;
if (playerOnWave < 4) {
SFX.gotoAndPlay("Move");
playerOnWave++;
}
}
} else {
var _local4 = _root["Wave" + playerOnWave]._y - this._y;
if (Math.abs(_local4) < 1) {
this._y = _root["Wave" + playerOnWave]._y;
playerBusy = false;
} else {
var _local5 = _local4 / playerSpeed;
var _local6 = this._y + _local5;
this._y = _local6;
}
}
} else if (roundOver) {
if (this._x < tokenSpawnX) {
this._x = this._x + scrollSpeed;
var _local3 = 1;
while (_local3 <= 4) {
_root["Wave" + _local3]._x = _root["Wave" + _local3]._x + scrollSpeed;
_local3++;
}
} else {
removeMovieClip(this);
var _local3 = 1;
while (_local3 <= 4) {
removeMovieClip("Wave" + _local3);
_local3++;
}
}
}
};
Background.onEnterFrame = function () {
if (!roundOver) {
this._x = this._x - scrollSpeed;
if ((this._x + (this._width / 2)) <= 0) {
this._x = 0;
}
}
};
Frame 50
SFX.gotoAndPlay("Go");
gameInPlay = false;
roundOver = true;
var i = 1;
while (i <= 5) {
Interface["Slot" + i].gotoAndStop(1);
Interface["Slot" + i]._visible = true;
i++;
}
Player.Anim.gotoAndStop(1);
removeMovieClip(Tracers);
Interface.gotoAndPlay("EndLevel");
stop();
Symbol 8 MovieClip [ufo] Frame 1
stop();
Symbol 8 MovieClip [ufo] Frame 40
removeMovieClip(this);
Symbol 32 MovieClip Frame 1
stop();
Symbol 37 MovieClip Frame 1
stop();
Symbol 60 Button
on (keyPress "<Space>") {
gotoAndPlay ("NextLevel");
}
Symbol 67 Button
on (press) {
_root.SFX.gotoAndPlay("Click");
_root.gotoAndPlay("Title");
_root.clearScreen();
}
Symbol 71 MovieClip [interface] Frame 1
stop();
Symbol 71 MovieClip [interface] Frame 10
_root.Player.gotoAndStop(1);
levelText = "Level " + _root.level;
quotaText = ((("Earn at least " + _root.pointsNeeded) + " points\rto move onto level ") + (_root.level + 1)) + "!";
Symbol 71 MovieClip [interface] Frame 94
_root.SFX.gotoAndPlay("Go");
Symbol 71 MovieClip [interface] Frame 95
_root.SFX.gotoAndPlay("StartMusic");
Symbol 71 MovieClip [interface] Frame 125
_root.gameInPlay = true;
gotoAndStop (1);
Symbol 71 MovieClip [interface] Frame 130
if (_root.playerHand != 0) {
_root.SFX.gotoAndPlay("HandText");
rewardText = (_root.handLength + " ") + _root.handNames[_root.playerHand];
rewardPoints = _root.handValues[_root.playerHand] * _root.handLength;
} else {
rewardPoints = 0;
rewardText = _root.handNames[_root.playerHand];
var i = 0;
while (i < _root.tokensHeld.length) {
rewardPoints = rewardPoints + _root.tokensHeld[i];
i++;
}
}
Symbol 71 MovieClip [interface] Frame 145
rewardPointsText = "+ " + rewardPoints;
_root.score = _root.score + rewardPoints;
_root.SFX.gotoAndPlay("AwardPoints");
Symbol 71 MovieClip [interface] Frame 165
_root.clearHand();
_root.noPickingUp = false;
_root.gameInPlay = true;
gotoAndStop (1);
Symbol 71 MovieClip [interface] Frame 170
var needed = _root.pointsNeeded;
var earned = _root.score;
var bonus = 0;
Symbol 71 MovieClip [interface] Frame 171
_root.SFX.gotoAndPlay("StopMusic");
Symbol 71 MovieClip [interface] Frame 250
_root.SFX.gotoAndPlay("Tally");
Symbol 71 MovieClip [interface] Frame 280
_root.SFX.gotoAndPlay("Tally");
Symbol 71 MovieClip [interface] Frame 310
if (needed > earned) {
_root.totalScore = _root.totalScore + _root.score;
gotoAndPlay ("GameOver");
} else {
gotoAndPlay ("Bonus");
}
Symbol 71 MovieClip [interface] Frame 340
_root.SFX.gotoAndPlay("Twirl");
bonus = (earned - needed) * 2;
Symbol 71 MovieClip [interface] Frame 370
_root.SFX.gotoAndPlay("AwardPoints");
_root.totalScore = _root.totalScore + (_root.score + bonus);
stop();
Symbol 71 MovieClip [interface] Frame 380
_root.levelUp();
_root.gotoAndPlay("Play");
Symbol 71 MovieClip [interface] Frame 395
stopAllSounds();
_root.SFX.gotoAndPlay("GameOver");
Symbol 71 MovieClip [interface] Frame 420
stop();
Symbol 85 MovieClip Frame 1
stop();
Symbol 85 MovieClip Frame 20
gotoAndStop(_root.lastNumberGrabbed);
Symbol 100 MovieClip [token] Frame 1
stop();
Symbol 100 MovieClip [token] Frame 24
removeMovieClip(this);
Symbol 110 MovieClip [seagull] Frame 1
stop();
Symbol 110 MovieClip [seagull] Frame 35
removeMovieClip(this);
Symbol 118 Button
on (press) {
_root.SFX.gotoAndPlay("Click");
_root.funcHITBOX("instructions", "view_instructions");
gotoAndPlay ("HowTo");
}
Symbol 123 Button
on (press) {
_root.SFX.gotoAndPlay("Click");
gotoAndPlay ("EnterCode");
}
Symbol 154 MovieClip Frame 1
stop();
Symbol 154 MovieClip Frame 6
gotoAndStop (1);
Symbol 154 MovieClip Frame 16
gotoAndStop (1);
Symbol 154 MovieClip Frame 26
gotoAndStop (1);
Symbol 154 MovieClip Frame 36
gotoAndStop (1);
Symbol 154 MovieClip Frame 46
gotoAndStop (1);
Symbol 154 MovieClip Frame 56
gotoAndStop (1);
Symbol 154 MovieClip Frame 66
gotoAndStop (1);
Symbol 154 MovieClip Frame 76
gotoAndStop (1);
Symbol 154 MovieClip Frame 86
gotoAndStop (1);
Symbol 154 MovieClip Frame 96
gotoAndStop (1);
Symbol 154 MovieClip Frame 106
gotoAndStop (1);
Symbol 154 MovieClip Frame 116
gotoAndStop (1);
Symbol 154 MovieClip Frame 126
gotoAndStop (1);
Symbol 154 MovieClip Frame 136
gotoAndStop (1);
Symbol 154 MovieClip Frame 146
gotoAndStop (1);
Symbol 154 MovieClip Frame 156
gotoAndStop (1);
Symbol 154 MovieClip Frame 166
gotoAndStop (1);
Symbol 154 MovieClip Frame 176
gotoAndStop (1);
Symbol 154 MovieClip Frame 186
gotoAndStop (1);
Symbol 154 MovieClip Frame 196
gotoAndStop (1);
Symbol 154 MovieClip Frame 206
gotoAndStop (1);
Symbol 156 Button
on (press) {
_root.SFX.gotoAndPlay("Click");
_root.funcHITBOX("play_activity", "play_from_code");
gotoAndPlay ("Start");
}
Symbol 161 Button
on (press) {
_root.SFX.gotoAndPlay("Click");
var match = false;
var i = 0;
while (i < _root.cheatCodes.length) {
var theCode = _root.cheatCodes[i];
if (_root.codeInput == theCode) {
match = true;
break;
}
i++;
}
if (match == true) {
_root.funcHITBOX("misc", "valid_code_" + _root.codeInput);
gotoAndPlay ("Valid");
} else {
gotoAndPlay ("Invalid");
}
}
Symbol 164 MovieClip Frame 1
play();
Symbol 164 MovieClip Frame 2
Selection.setFocus("codeField");
stop();
Symbol 164 MovieClip Frame 10
_root.activeCode = _root.codeInput;
stop();
Symbol 164 MovieClip Frame 20
_root.activeCode = null;
Symbol 166 Button
on (press) {
_root.SFX.gotoAndPlay("Click");
_root.funcHITBOX("play_activity", "play_from_instructions");
gotoAndPlay ("Start");
}
Symbol 179 MovieClip Frame 1
stop();