Frame 1
System.security.allowDomain("gamezhero.com", "www.gamezhero.com");
_root.createEmptyMovieClip("gamezhero", 100000);
_root.gamezhero.loadMovie("http://www.gamezhero.com/flash/gamezhero2.swf?x=25&y=25&from=attackOfTheFeverHeads&scale=80&t=1128758746531");
Stage.showMenu = false;
function init() {
Button.prototype.tabEnabled = false;
MovieClip.prototype.tabEnabled = false;
_global.g_kApplication._lockroot = true;
_global.g_kApplication.m_kSettings = new Settings();
_global.g_kApplication.m_kApplicationState = new ApplicationState();
_global.g_kApplication.m_kPlayerState = new PlayerState();
_global.g_kApplication.m_kSoundPlayer = _global.g_kApplication.createEmptyMovieClip("m_kSoundPlayer", _global.g_kApplication.getNextHighestDepth());
_global.g_kApplication.m_kGameTimer = new LRG.Utils.LRGGameTimer();
LRG.Utils.LRGGameTimer(_global.getGameTimer()).startClock(true);
_global.g_kApplication.stop();
}
function start() {
_global.g_kApplication.m_kGui.m_kPlayGui.gotoAndStop("Hide");
_global.g_kApplication.m_kGui.m_kPlayGui._visible = false;
_global.g_kApplication.m_kGui.m_kGameSummaryPanel.gotoAndStop("Hide");
_global.g_kApplication.m_kGui.m_kGameSummaryPanel._visible = false;
_global.g_kApplication.m_kGui.m_kHelpPanel.gotoAndStop("Hide");
_global.g_kApplication.m_kGui.m_kHelpPanel._visible = false;
_global.g_kApplication.m_kGui.m_kRoundSummaryPanel.gotoAndStop("Hide");
_global.g_kApplication.m_kGui.m_kRoundSummaryPanel._visible = false;
_global.getApplicationState().setState(_global.getApplicationState().AS_PRE_GAME);
_global.getApplicationState().setPaused(true);
this.onEnterFrame = function () {
_global.g_kApplication.m_kGui.m_kSplashScreen.gotoAndStop("Show");
_global.g_kApplication.m_kGui.m_kSplashScreen._visible = true;
_global.g_kApplication.m_kGui.m_kSplashScreen.onShow();
this.onEnterFrame = undefined;
};
}
if (_global.LRG == undefined) {
_global.LRG = new Object();
}
if (_global.LRG.Utils == undefined) {
_global.LRG.Utils = new Object();
}
Array.prototype.getIndex = function (item) {
var _local2 = 0;
while (_local2 < this.length) {
if (this[_local2] == item) {
return(_local2);
}
_local2++;
}
return(-1);
};
Array.prototype.removeIndex = function (fIndex) {
var _local2 = this.slice(0, fIndex);
_local2 = _local2.concat(this.slice(fIndex + 1, this.length));
return(_local2);
};
Array.prototype.removeData = function (item) {
var _local2 = this.getIndex(item);
if (_local2 > -1) {
return(this.removeIndex(_local2));
}
return(this.slice(0));
};
Array.prototype.getRandom = function () {
var _local2 = Math.floor(Math.floor(Math.random() * 1000) % this.length);
return(this[_local2]);
};
if (_global.LRG.Utils.Vector2D == undefined) {
_global.LRG.Utils.Vector2D = new Object();
}
_global.LRG.Utils.Vector2D.magnitude = function (fX, fY) {
return(Math.sqrt((fX * fX) + (fY * fY)));
};
_global.LRG.Utils.Vector2D.normalize = function (fX, fY) {
var _local2 = new Object();
var _local3 = _global.LRG.Utils.Vector2D.magnitude(fX, fY);
_local2.x = fX / _local3;
_local2.y = fY / _local3;
return(_local2);
};
_global.LRG.Utils.Vector2D.dot = function (fX1, fY1, fX2, fY2) {
return((fX1 * fX2) + (fY1 * fY2));
};
_global.playSound = function (soundID, loops, targetClip, pan, volume) {
if (ApplicationState(_global.getApplicationState()).isMuted()) {
return(undefined);
}
_global.debug("play sound" + soundID);
if (typeof(targetClip) == "undefined") {
targetClip = _global.g_kApplication.m_kSoundPlayer;
}
if (typeof(loops) == "undefined") {
loops = 1;
}
if (typeof(pan) == "undefined") {
pan = 0;
}
if (pan < -100) {
pan = -100;
} else if (pan > 100) {
pan = 100;
}
if (volume == undefined) {
volume = 100;
}
var _local3 = new Sound(targetClip);
_local3.setPan(pan);
_local3.setVolume(volume);
_local3.attachSound(soundID);
_local3.start(0, loops);
mLastSoundID = soundID;
};
_global.stopSound = function (soundID, targetClip) {
if (typeof(targetClip) == "undefined") {
targetClip = this;
}
var _local3 = this.getSoundObject(targetClip[soundID]);
_local3.stop([soundID]);
};
_global.getSoundObject = function (targetClip) {
if (typeof(this.mSoundObjectArray) == "undefined") {
this.mSoundObjectArray = new Array();
}
if (typeof(this.mSoundObjectArray[targetClip]) == "undefined") {
this.mSoundObjectArray[targetClip] = new Sound(targetClip);
}
return(this.mSoundObjectArray[targetClip]);
};
if (_global.LRG == undefined) {
_global.LRG = new Object();
}
if (_global.LRG.LRGMusic == undefined) {
_global.LRG.LRGMusic = new Object();
}
_global.LRG.LRGMusic.m_bGameHasMusic = true;
_global.LRG.LRGMusic.m_bMuted = false;
_global.LRG.LRGMusic.startMusic = function (kPlayList) {
if (!_global.LRG.LRGMusic.m_bGameHasMusic) {
return(undefined);
}
trace("startMusic() called");
if (_global.LRG.LRGMusic.m_kMusic == undefined) {
kEmptyClip = _global.g_kApplication.createEmptyMovieClip("m_kMusicClip", _global.g_kApplication.getNextHighestDepth());
_global.LRG.LRGMusic.m_kMusic = new Sound(kEmptyClip);
}
if (kPlayList != undefined) {
_global.LRG.LRGMusic.m_pLoopList = kPlayList;
} else {
_global.LRG.LRGMusic.m_pLoopList = new Array();
}
_global.LRG.LRGMusic.m_kMusic.m_sLastLoop = undefined;
_global.LRG.LRGMusic.m_kFadeTimerClip.onEnterFrame = undefined;
_global.LRG.LRGMusic.stop();
if (_global.LRG.LRGMusic.m_bMuted) {
_global.LRG.LRGMusic.m_kMusic.setVolume(0);
} else {
_global.LRG.LRGMusic.m_kMusic.setVolume(100);
}
_global.LRG.LRGMusic.m_kMusic.onSoundComplete = _global.LRG.LRGMusic.playMusicLoop;
_global.LRG.LRGMusic.playMusicLoop();
};
_global.LRG.LRGMusic.setPlaylist = function (kPlayList) {
_global.LRG.LRGMusic.m_pLoopList = kPlayList;
_global.LRG.LRGMusic.m_kMusic.m_sLastLoop = undefined;
};
_global.LRG.LRGMusic.stopMusic = function () {
if (!_global.LRG.LRGMusic.m_bGameHasMusic) {
return(undefined);
}
_global.LRG.LRGMusic.m_kMusic.stop();
_global.LRG.LRGMusic.m_kFadeTimerClip.onEnterFrame = undefined;
};
_global.LRG.LRGMusic.endMusic = function (fFadePeriod, kOptCallBack) {
if (!_global.LRG.LRGMusic.m_bGameHasMusic) {
return(undefined);
}
_global.LRG.LRGMusic.m_kMusic.onSoundComplete = undefined;
if (_global.LRG.LRGMusic.m_kFadeTimerClip == undefined) {
_global.LRG.LRGMusic.m_kFadeTimerClip = _root.createEmptyMovieClip(m_kMusicFadeTimer, _root.getNextHighestDepth());
}
_global.LRG.LRGMusic.m_kFadeTimerClip.m_fStartTime = getTimer();
if (fFadePeriod == undefined) {
fFadePeriod = 5000;
}
_global.LRG.LRGMusic.m_kFadeTimerClip.m_fFadePeriod = fFadePeriod;
if (kOptCallBack != undefined) {
_global.LRG.LRGMusic.m_kEndFadeListener = kOptCallBack;
}
_global.LRG.LRGMusic.m_kFadeTimerClip.onEnterFrame = function () {
var _local5 = getTimer();
var _local3 = (_local5 - this.m_fStartTime) / this.m_fFadePeriod;
if (_local3 >= 1) {
trace("stop the fade out please");
_global.LRG.LRGMusic.m_kMusic.stop();
this.onEnterFrame = undefined;
if (_global.LRG.LRGMusic.m_kEndFadeListener != undefined) {
_global.LRG.LRGMusic.m_kEndFadeListener.musicEnded();
_global.LRG.LRGMusic.m_kEndFadeListener = undefined;
}
} else {
var _local4;
if (_global.LRG.LRGMusic.m_bMuted) {
_local4 = 0;
} else {
_local4 = Math.min(100, 100 * (1 - _local3));
}
_global.LRG.LRGMusic.m_kMusic.setVolume(_local4);
}
};
};
_global.LRG.LRGMusic.playMusicLoop = function () {
if (!_global.LRG.LRGMusic.m_bGameHasMusic) {
return(undefined);
}
var _local3 = "";
var _local5 = 1;
if ((_global.LRG.LRGMusic.m_sPlayListStyle == undefined) || (_global.LRG.LRGMusic.m_sPlayListStyle == "RANDOM")) {
if (_global.LRG.LRGMusic.m_kMusic.m_sLastLoop != undefined) {
var _local6 = _global.LRG.LRGMusic.m_pLoopList.removeData(_global.LRG.LRGMusic.m_kMusic.m_sLastLoop);
_local3 = _local6.getRandom();
} else {
_local3 = _global.LRG.LRGMusic.m_pLoopList.getRandom();
}
var _local4 = Math.round(Math.random() * 1000) % 2;
_local5 = 1 + _local4;
trace("MUSIC CHOICE: " + _local3);
} else if (_global.LRG.LRGMusic.m_sPlayListStyle == "LINEAR") {
var _local2 = _global.LRG.LRGMusic.m_pLoopList.getIndex(_global.LRG.LRGMusic.m_kMusic.m_sLastLoop);
if (_local2 >= 0) {
_local2++;
if (_local2 >= _global.LRG.LRGMusic.m_pLoopList.length) {
_local2 = _global.LRG.LRGMusic.m_pLoopList.length - 1;
_global.LRG.LRGMusic.m_sPlayListStyle = "RANDOM";
}
} else {
_local2 = 0;
}
_local2 = Math.min(_local2, _global.LRG.LRGMusic.m_pLoopList.length - 1);
_local3 = _global.LRG.LRGMusic.m_pLoopList[_local2];
trace("MUSIC CHOICE: " + _local3);
}
_global.LRG.LRGMusic.m_kMusic.attachSound(_local3);
_global.LRG.LRGMusic.m_kMusic.start(0, _local5);
_global.LRG.LRGMusic.m_kMusic.m_sLastLoop = _local3;
};
_global.LRG.LRGMusic.setPlaylistStyle = function (sStyle) {
_global.LRG.LRGMusic.m_sPlayListStyle = sStyle;
_global.LRG.LRGMusic.m_kMusic.m_sLastLoop = undefined;
};
_global.LRG.LRGMusic.muteMusic = function (bMuteMusic) {
_global.LRG.LRGMusic.m_bMuted = bMuteMusic;
if (_global.LRG.LRGMusic.m_bMuted) {
_global.LRG.LRGMusic.m_kMusic.setVolume(0);
} else {
_global.LRG.LRGMusic.m_kMusic.setVolume(100);
}
};
_global.g_kApplication = this;
_global.g_kApplication.m_kSettings = null;
_global.g_kApplication.m_kApplicationState = null;
_global.g_kApplication.m_kPlayerState = null;
_global.g_kApplication.m_kGameTimer = null;
_global.dbg = function (str) {
return(undefined);
};
_global.debug = function (str) {
if (_global.g_kApplication.m_kDebug != undefined) {
_global.g_kApplication.m_kDebug.text = (_global.g_kApplication.m_kDebug.text + str) + newline;
}
};
_global.getSettings = function () {
return(_global.g_kApplication.m_kSettings);
};
_global.getApplicationState = function () {
return(_global.g_kApplication.m_kApplicationState);
};
_global.getPlayerState = function () {
return(_global.g_kApplication.m_kPlayerState);
};
_global.getGameTimer = function () {
return(_global.g_kApplication.m_kGameTimer);
};
this._lockroot = false;
if (_root == this) {
this.init();
this.start();
}
_global.setBreakPoint = function () {
trace("Break point reached.");
};
Symbol 27 MovieClip [s_ZombieHead1] Frame 1
#initclip 62
Object.registerClass("s_ZombieHead1", Enemy);
#endinitclip
Symbol 37 MovieClip [s_Hesh] Frame 1
#initclip 28
Object.registerClass("s_Hesh", Enemy);
#endinitclip
Symbol 44 MovieClip [s_DolphinBoy] Frame 1
#initclip 29
Object.registerClass("s_DolphinBoy", Enemy);
#endinitclip
Symbol 64 MovieClip [s_Zombie1] Frame 1
#initclip 30
Object.registerClass("s_Zombie1", Enemy);
#endinitclip
Symbol 85 MovieClip [s_Zombie3] Frame 1
#initclip 31
Object.registerClass("s_Zombie3", Enemy);
#endinitclip
Symbol 103 MovieClip [s_Zombie2] Frame 1
#initclip 32
Object.registerClass("s_Zombie2", Enemy);
#endinitclip
Symbol 276 MovieClip [s_Player] Frame 1
#initclip 33
Object.registerClass("s_Player", Player);
#endinitclip
Symbol 279 MovieClip [s_ZombieHead3] Frame 1
#initclip 34
Object.registerClass("s_ZombieHead3", Enemy);
#endinitclip
Symbol 282 MovieClip [s_ZombieHead2] Frame 1
#initclip 35
Object.registerClass("s_ZombieHead2", Enemy);
#endinitclip
Symbol 285 MovieClip [s_PowerUp] Frame 1
#initclip 36
Object.registerClass("s_PowerUp", PowerUp);
#endinitclip
Symbol 294 MovieClip [s_PretzelBonus] Frame 1
#initclip 37
Object.registerClass("s_PretzelBonus", LRG.LRGMovieClip);
#endinitclip
Symbol 301 MovieClip [s_BashBonus] Frame 1
#initclip 38
Object.registerClass("s_BashBonus", LRG.LRGMovieClip);
#endinitclip
Symbol 303 MovieClip [s_StartBtn] Frame 1
#initclip 39
Object.registerClass("s_StartBtn", LRG.LRGMovieClip);
#endinitclip
Symbol 308 MovieClip [s_BonusPretzel] Frame 1
#initclip 40
Object.registerClass("s_BonusPretzel", Enemy);
#endinitclip
Symbol 310 MovieClip [s_CoconutPile] Frame 1
#initclip 41
Object.registerClass("s_CoconutPile", Enemy);
#endinitclip
Symbol 312 MovieClip [s_Coconut] Frame 1
#initclip 42
Object.registerClass("s_Coconut", Enemy);
#endinitclip
Symbol 319 MovieClip [s_FPSDisplay] Frame 1
#initclip 43
Object.registerClass("s_FPSDisplay", LRG.Utils.FPSDisplay);
#endinitclip
Symbol 343 MovieClip [s_StartButton] Frame 1
#initclip 44
Object.registerClass("s_StartButton", LRG.LRGMovieClip);
#endinitclip
Symbol 350 MovieClip [s_soundHolder] Frame 1
#initclip 45
Object.registerClass("s_soundHolder", LRG.LRGMovieClip);
#endinitclip
Symbol 351 MovieClip [s_EnemyHolder] Frame 1
#initclip 46
Object.registerClass("s_EnemyHolder", EnemyManager);
#endinitclip
Symbol 354 MovieClip [s_BackgroundElement6] Frame 1
#initclip 47
Object.registerClass("s_BackgroundElement6", Object2D);
#endinitclip
Symbol 357 MovieClip [s_BackgroundElement7] Frame 1
#initclip 48
Object.registerClass("s_BackgroundElement7", Object2D);
#endinitclip
Symbol 359 MovieClip [s_BackgroundElement1] Frame 1
#initclip 49
Object.registerClass("s_BackgroundElement1", Object2D);
#endinitclip
Symbol 362 MovieClip [s_BackgroundElement2] Frame 1
#initclip 50
Object.registerClass("s_BackgroundElement2", Object2D);
#endinitclip
Symbol 365 MovieClip [s_BackgroundElement3] Frame 1
#initclip 51
Object.registerClass("s_BackgroundElement3", Object2D);
#endinitclip
Symbol 367 MovieClip [s_BackgroundElement4] Frame 1
#initclip 52
Object.registerClass("s_BackgroundElement4", Object2D);
#endinitclip
Symbol 370 MovieClip [s_BackgroundElement5] Frame 1
#initclip 53
Object.registerClass("s_BackgroundElement5", Object2D);
#endinitclip
Symbol 382 MovieClip [s_BackgroundElementHolder] Frame 1
#initclip 54
Object.registerClass("s_BackgroundElementHolder", BackgroundElementManager);
#endinitclip
Symbol 385 MovieClip [s_Scrim] Frame 1
#initclip 55
Object.registerClass("s_Scrim", LRG.LRGMovieClip);
#endinitclip
Symbol 386 MovieClip [s_GameScreen] Frame 1
#initclip 56
Object.registerClass("s_GameScreen", SealabGame);
#endinitclip
Symbol 391 MovieClip [s_PlayGui] Frame 1
#initclip 57
Object.registerClass("s_PlayGui", PlayGui);
#endinitclip
Symbol 409 MovieClip [s_HelpPanel] Frame 1
#initclip 58
Object.registerClass("s_HelpPanel", HelpPanel);
#endinitclip
Symbol 420 MovieClip [s_GameSummaryPanel] Frame 1
#initclip 59
Object.registerClass("s_GameSummaryPanel", GameSummaryPanel);
#endinitclip
Symbol 424 MovieClip [s_SplashScreen] Frame 1
#initclip 60
Object.registerClass("s_SplashScreen", SplashScreen);
#endinitclip
Symbol 425 MovieClip [s_Gui] Frame 1
#initclip 61
Object.registerClass("s_Gui", Gui);
#endinitclip
Symbol 426 MovieClip [__Packages.ApplicationState] Frame 0
class ApplicationState
{
var m_bMuted, m_eState;
function ApplicationState () {
init();
}
function init() {
m_bMuted = false;
m_eState = AS_APP_STARTED;
}
function getState() {
return(m_eState);
}
function setState(eState) {
m_eState = eState;
}
function isCurrentState(eState) {
return(m_eState == eState);
}
function setPaused(bPaused) {
if (bPaused && (!isPaused())) {
trace("PAUSE");
LRG.Utils.LRGGameTimer(_global.getGameTimer()).stopClock();
} else if ((!bPaused) && (isPaused())) {
trace("RESUME");
LRG.Utils.LRGGameTimer(_global.getGameTimer()).startClock(false);
}
}
function isPaused() {
return(!LRG.Utils.LRGGameTimer(_global.getGameTimer()).isRunning());
}
function setMuted(bMuted) {
if (isMuted() && (!bMuted)) {
m_bMuted = false;
_global.LRG.LRGMusic.startMusic();
} else if ((!isMuted()) && (bMuted)) {
_global.LRG.LRGMusic.stopMusic();
m_bMuted = true;
}
}
function isMuted() {
return(m_bMuted);
}
var AS_APP_STARTED = 0;
var AS_PRE_GAME = 1;
var AS_GAME_RUNNING = 2;
var AS_BETWEEN_ROUNDS = 3;
var AS_GAME_OVER = 4;
}
Symbol 427 MovieClip [__Packages.LRG.Utils.LRGGameTimer] Frame 0
class LRG.Utils.LRGGameTimer extends MovieClip
{
var m_fOffsetTime, m_fStartedTime, m_fStoppedTime, m_fCurrentTime, m_pClockListeners, m_fIntervalId, m_fTimeToRun;
function LRGGameTimer () {
super();
init();
}
function init() {
m_fOffsetTime = 0;
m_fStartedTime = undefined;
m_fStoppedTime = undefined;
m_fCurrentTime = undefined;
m_pClockListeners = new Array();
m_fIntervalId = undefined;
m_fTimeToRun = Infinity;
}
function getTime() {
return(m_fCurrentTime);
}
function isRunning() {
return(m_fIntervalId != undefined);
}
function stopClock() {
if (isRunning()) {
clearInterval(m_fIntervalId);
m_fIntervalId = undefined;
m_fStoppedTime = getTimer() / 1000;
var _local2 = 0;
while (_local2 < m_pClockListeners.length) {
m_pClockListeners[_local2].doOnClockStopped(this);
_local2++;
}
}
}
function startClock(bReset) {
if (bReset || (m_fCurrentTime == undefined)) {
resetClock();
} else {
m_fOffsetTime = m_fOffsetTime + ((getTimer() / 1000) - m_fStoppedTime);
m_fCurrentTime = (getTimer() / 1000) - m_fOffsetTime;
}
var _local2 = 0;
while (_local2 < m_pClockListeners.length) {
m_pClockListeners[_local2].doOnClockStarted(this);
_local2++;
}
m_fIntervalId = setInterval(this, "updateClock", 8.33333333333333);
}
function resetClock() {
m_fCurrentTime = 0;
m_fOffsetTime = getTimer() / 1000;
}
function setTimeToRun(fTime) {
m_fTimeToRun = fTime;
}
function addListener(kListener) {
m_pClockListeners.push(kListener);
}
function removeListener(kListener) {
var _local2 = m_pClockListeners;
m_pClockListeners = _local2.removeData(kListener);
}
function updateClock() {
m_fCurrentTime = (getTimer() / 1000) - m_fOffsetTime;
if (m_fCurrentTime >= m_fTimeToRun) {
stopClock();
}
}
}
Symbol 428 MovieClip [__Packages.Settings] Frame 0
class Settings
{
var PLAYER_START_FORWARD_SPEED, PLAYER_ACCELERATION, PLAYER_MIN_FORWARD_SPEED, PLAYER_MAX_FORWARD_SPEED, PLAYER_LANE_CHANGE_SPEED, PLAYER_SWING_RATE, PLAYER_IMPACT_SLOW, PLAYER_ACCEL_WAIT, PLAYER_OFFSET_SPEED, PLAYER_MIN_OFFSET, PLAYER_MAX_OFFSET, PLAYER_IMPACT_DAMAGE, BATTERY_VALUE, ENEMY_SPEED, ENEMY_SPEED_INCREASE, ENEMY_ACC, ENEMY_ACC_INCREASE, ENEMY_FLY_SPEED, ENEMY_FLY_SPEED_X, ENEMY_FLY_SPEED_Y, MAX_ENEMIES_ON_SCREEN, ENEMY_RADIUS_COEFF, MIN_SECS_BETWEEN_SPECIALS, MAX_SECS_BETWEEN_SPECIALS, HESH_RIDE_SECS, PRETZEL_POINT_VALUE, HIDE_BOUNDARIES;
function Settings () {
init();
}
function init() {
PLAYER_START_FORWARD_SPEED = 50;
PLAYER_ACCELERATION = 120;
PLAYER_MIN_FORWARD_SPEED = 20;
PLAYER_MAX_FORWARD_SPEED = 475;
PLAYER_LANE_CHANGE_SPEED = 350;
PLAYER_SWING_RATE = 3;
PLAYER_IMPACT_SLOW = 120;
PLAYER_ACCEL_WAIT = 0.75;
PLAYER_OFFSET_SPEED = 250;
PLAYER_MIN_OFFSET = -150;
PLAYER_MAX_OFFSET = 250;
PLAYER_IMPACT_DAMAGE = 10;
BATTERY_VALUE = 25;
ENEMY_SPEED = 100;
ENEMY_SPEED_INCREASE = 12;
ENEMY_ACC = 250;
ENEMY_ACC_INCREASE = 20;
ENEMY_FLY_SPEED = 300;
ENEMY_FLY_SPEED_X = 200;
ENEMY_FLY_SPEED_Y = 400;
MAX_ENEMIES_ON_SCREEN = 5;
ENEMY_RADIUS_COEFF = 0.85;
MIN_SECS_BETWEEN_SPECIALS = 1;
MAX_SECS_BETWEEN_SPECIALS = 15;
HESH_RIDE_SECS = 12;
PRETZEL_POINT_VALUE = 5000;
HIDE_BOUNDARIES = true;
}
function getSetting(sSettingName) {
return(this[sSettingName]);
}
}
Symbol 429 MovieClip [__Packages.PlayerState] Frame 0
class PlayerState
{
var m_fHealth, m_fScore;
function PlayerState () {
init();
}
function init() {
setHealth(100);
setScore(0);
}
function setHealth(fHealth) {
m_fHealth = fHealth;
PlayGui(_global.g_kApplication.m_kGui.m_kPlayGui).setHealth(m_fHealth);
}
function getHealth() {
return(m_fHealth);
}
function setScore(fScore) {
m_fScore = fScore;
PlayGui(_global.g_kApplication.m_kGui.m_kPlayGui).setScore(m_fScore);
}
function getScore() {
return(m_fScore);
}
}
Symbol 430 MovieClip [__Packages.LRG.LRGMovieClip] Frame 0
class LRG.LRGMovieClip extends MovieClip
{
var stop, m_kActionsList, m_pActiveActions, m_kClipClock, onEnterFrame, m_fSpecialness, _totalframes, _parent;
function LRGMovieClip () {
super();
stop();
init();
}
function init() {
m_kActionsList = new Object();
m_pActiveActions = new Array();
m_kClipClock = undefined;
}
function setClock(kClockObject) {
m_kClipClock = kClockObject;
}
function getClock() {
return(m_kClipClock);
}
function addAction(kActionObject) {
if (m_kActionsList[kActionObject.getName()] != undefined) {
removeAction(kActionObject.getName());
}
m_kActionsList[kActionObject.getName()] = kActionObject;
}
function removeAction(sActionKey) {
if (m_kActionsList[sActionKey] != undefined) {
if (m_pActiveActions.getIndex(sActionKey) != -1) {
stopAction(sActionKey, false);
}
delete m_kActionsList[sActionKey];
if (m_pActiveActions.length <= 0) {
onEnterFrame = undefined;
}
}
}
function removeAllActions() {
var _local3 = new Array();
for (var _local4 in m_kActionsList) {
_local3.push(_local4);
}
var _local2 = 0;
while (_local2 < _local3.length) {
removeAction(_local3[_local2]);
_local2++;
}
}
function startAction(sActionKey, kActionParams, bExclusiveType) {
var _local3;
_local3 = m_kActionsList[sActionKey];
if (_local3 == undefined) {
trace((this + ": An attempt was made to start the undefined action ") + sActionKey);
return(undefined);
}
if (m_pActiveActions.getIndex(sActionKey) != -1) {
return(undefined);
}
if (bExclusiveType) {
stopActionsOfType(_local3.getType());
}
_local3.reset(getClipTime(), kActionParams);
m_pActiveActions.push(sActionKey);
if (sActionKey == "THROB_IN") {
trace("pushed " + m_pActiveActions);
}
onEnterFrame = LRGOnEnterFrame;
}
function stopActionsOfType(sActionType) {
var _local5 = m_pActiveActions.slice(0);
var _local2 = 0;
while (_local2 < _local5.length) {
var _local3 = _local5[_local2];
var _local4 = m_kActionsList[_local3];
if ((_local4.getType() == sActionType) || (m_fSpecialness == Enemy.HESH)) {
stopAction(_local3, false);
}
_local2++;
}
}
function stopAction(sActionKey, bCompleted) {
var _local2 = m_pActiveActions.removeData(sActionKey);
delete m_pActiveActions;
m_pActiveActions = _local2;
if (!isActionActive()) {
onEnterFrame = undefined;
}
if (bCompleted) {
onActionCompleted(sActionKey);
}
}
function stopAllActions() {
var _local3 = m_pActiveActions.slice(0);
var _local2 = 0;
while (_local2 < _local3.length) {
stopAction(_local3[_local2], false);
_local2++;
}
}
function getActionsList() {
return(m_kActionsList);
}
function getActiveActions() {
return(m_pActiveActions);
}
function getAction(sActionKey) {
return(m_kActionsList[sActionKey]);
}
function isActionActive() {
return(m_pActiveActions.length >= 1);
}
function isThisActionActive(sActionKey) {
return(m_pActiveActions.getIndex(sActionKey) != -1);
}
function playAnimation(sName, fFps, fStartFrame, fEndFrame, bLoop, fDirection) {
var _local2 = new Object();
_local2.m_sName = sName;
_local2.m_fFPS = fFps;
_local2.m_fStartFrame = fStartFrame;
_local2.m_fEndFrame = fEndFrame;
_local2.m_bLoop = bLoop;
_local2.m_fDirection = fDirection;
var _local3 = new LRG.LRGAnimationAction(_local2);
addAction(_local3);
startAction(sName, null, true);
}
function play(fFps, bLoop) {
if (fFps == undefined) {
fFps = 30;
}
if (bLoop == undefined) {
bLoop = false;
}
playAnimation("DEFAULT_FULL_FRAME_ANIMATION", fFps, 1, _totalframes, bLoop, 1);
}
function LRGOnEnterFrame() {
if (isClockRunning()) {
LRGUpdateActions();
doEnterFrame();
}
}
function LRGUpdateActions() {
var _local8 = getClipTime();
var _local5 = new Array();
var _local6 = new Array();
var _local4;
var _local3 = 0;
while (_local3 < m_pActiveActions.length) {
_local4 = m_pActiveActions[_local3];
var _local7 = m_kActionsList[_local4].update(_local8, this);
if (_local7) {
_local5.push(_local4);
var _local2 = m_kActionsList[_local4].getNext();
if ((_local2 != undefined) && (m_kActionsList[_local2] != undefined)) {
_local6.push(_local2);
}
}
_local3++;
}
_local3 = 0;
while (_local3 < _local5.length) {
stopAction(_local5[_local3], true);
_local3++;
}
_local3 = 0;
while (_local3 < _local6.length) {
startAction(_local6[_local3]);
_local3++;
}
}
function onActionCompleted(sActionKey) {
_parent.onActionCompleted(sActionKey);
}
function doEnterFrame() {
}
function getClipTime() {
if (m_kClipClock) {
return(m_kClipClock.getTime());
}
return(getTimer() / 1000);
}
function isClockRunning() {
if (!m_kClipClock) {
return(true);
}
return(m_kClipClock.isRunning());
}
}
Symbol 431 MovieClip [__Packages.LRG.LRGAction] Frame 0
class LRG.LRGAction
{
var m_sName, m_fLastUpdateTime, m_fSPF, m_fFPS, m_fTotalActionTime, m_sNextAction, m_sActionType;
function LRGAction (kActionParams) {
}
function init(kActionParams) {
if (kActionParams.m_sName != undefined) {
m_sName = kActionParams.m_sName;
}
m_fLastUpdateTime = 0;
if (kActionParams.m_fSPF != undefined) {
m_fSPF = kActionParams.m_fSPF;
m_fFPS = 1 / m_fSPF;
} else if (kActionParams.m_fFPS != undefined) {
m_fFPS = kActionParams.m_fFPS;
m_fSPF = 1 / m_fFPS;
}
if (kActionParams.m_fTotalActionTime != undefined) {
m_fTotalActionTime = kActionParams.m_fTotalActionTime;
}
if (kActionParams.m_sNext != undefined) {
m_sNextAction = kActionParams.m_sNext;
}
if (m_sActionType == undefined) {
if (kActionParams.m_sType == undefined) {
m_sActionType = "DEFAULT";
} else {
m_sActionType = kActionParams.m_sType;
}
} else if (kActionParams.m_sType != undefined) {
m_sActionType = kActionParams.m_sType;
}
}
function getName() {
return(m_sName);
}
function getType() {
return(m_sActionType);
}
function getNext() {
return(m_sNextAction);
}
function setNext(sNextAction) {
m_sNextAction = sNextAction;
}
function reset(fCurrTime, kActionParams) {
if (kActionParams) {
init(kActionParams);
}
m_fLastUpdateTime = fCurrTime;
}
function update(fCurrTime, kClip) {
if (m_fLastUpdateTime == 0) {
m_fLastUpdateTime = fCurrTime;
return(false);
}
var _local2 = fCurrTime - m_fLastUpdateTime;
if (_local2 >= m_fSPF) {
m_fLastUpdateTime = fCurrTime;
return(doUpdate(fCurrTime, _local2, kClip));
}
return(false);
}
function doUpdate(fCurrTime, fDeltaTimeSecs, kClip) {
return(true);
}
}
Symbol 432 MovieClip [__Packages.Object2D] Frame 0
class Object2D extends LRG.LRGMovieClip
{
var m_fPositionX, m_fPositionY, m_kCamera, m_kSoundClip, createEmptyMovieClip, getNextHighestDepth, m_kSoundObject, _y, _x, _parent;
function Object2D () {
super();
}
function init() {
super.init();
m_fPositionX = 0;
m_fPositionY = 0;
m_kCamera = null;
}
function onAdd() {
SealabGame(_global.g_kApplication.m_kGameScreen).getCamera().registerObject(this);
m_kSoundClip = createEmptyMovieClip("m_kSoundClip", getNextHighestDepth());
m_kSoundObject = new Sound(m_kSoundClip);
}
function onRemove() {
SealabGame(_global.g_kApplication.m_kGameScreen).getCamera().unregisterObject(this);
}
function playSound(sSymbolName, bLoop) {
if (bLoop == undefined) {
bLoop = false;
}
var _local3 = {x:_x, y:_y};
_parent.localToGlobal(_local3);
var _local2 = (_local3.x / 3) - 100;
if (_local2 < -100) {
_local2 = -100;
} else if (_local2 > 100) {
_local2 = 100;
}
m_kSoundObject.setPan(_local2);
m_kSoundObject.attachSound(sSymbolName);
m_kSoundObject.start(0, (bLoop ? 999999 : 0));
}
function setCamera(kCamera) {
m_kCamera = kCamera;
}
}
Symbol 433 MovieClip [__Packages.SealabGame] Frame 0
class SealabGame extends LRG.LRGMovieClip
{
var m_kCamera, m_pBonusClips, m_fBashBonuses, m_kScrim, m_kPlayer, m_kEnemyHolder, m_kLane1Guide, m_kLane2Guide, m_kLane3Guide, m_kLane4Guide, m_kGroundGuide, m_kBackgroundElementHolder, attachMovie, getNextHighestDepth, _parent;
function SealabGame () {
super();
}
function init() {
super.init();
m_kCamera = null;
m_pBonusClips = new Array();
}
function startGame() {
_global.LRG.LRGMusic.stopMusic();
_global.LRG.LRGMusic.setPlaylistStyle("LINEAR");
_global.LRG.LRGMusic.startMusic(["sealab_game_music3.wav", "sealab_game_music1.wav", "sealab_game_music2.wav"]);
var _local3 = new Date().getTime();
loadMovieNum ("tracker.swf?" + _local3, 10000);
m_fBashBonuses = 0;
m_kScrim.gotoAndStop("Hide");
_global.getApplicationState().setState(_global.getApplicationState().AS_GAME_RUNNING);
_global.getApplicationState().setPaused(false);
Gui(_global.g_kApplication.m_kGui).onStartGame();
m_kPlayer = m_kEnemyHolder.m_kPlayer;
if (Settings(_global.getSettings()).getSetting("HIDE_BOUNDARIES")) {
m_kLane1Guide._visible = false;
m_kLane2Guide._visible = false;
m_kLane3Guide._visible = false;
m_kLane4Guide._visible = false;
m_kGroundGuide._visible = false;
}
PlayerState(_global.getPlayerState()).setScore(0);
PlayerState(_global.getPlayerState()).setHealth(100);
m_kPlayer.setController(new HumanPlayerController());
m_kCamera = new Camera2D();
m_kCamera.init();
m_kCamera.onStartGame();
m_kPlayer.onStartGame();
m_kEnemyHolder.onStartGame();
m_kBackgroundElementHolder.onStartGame();
}
function endGame() {
_global.getApplicationState().setPaused(true);
m_kPlayer.onEndGame();
m_kEnemyHolder.onEndGame();
m_kBackgroundElementHolder.onEndGame();
m_kCamera.onEndGame();
delete m_kCamera;
m_kCamera = null;
var _local3 = 0;
while (_local3 < m_pBonusClips.length) {
m_pBonusClips[_local3].removeMovieClip();
_local3++;
}
m_pBonusClips.splice(0);
_global.getApplicationState().setPaused(true);
_global.getApplicationState().setState(_global.getApplicationState().AS_GAME_OVER);
Gui(_global.g_kApplication.m_kGui).onEndGame();
}
function onPlayerDied() {
m_kScrim.playAnimation("DEATH_FADE", 21.8, 11, 120, false, 1);
_global.LRG.LRGMusic.endMusic();
}
function onEnemyDied() {
}
function getPlayer() {
return(m_kPlayer);
}
function getEnemyManager() {
return(m_kEnemyHolder);
}
function getBackgroundElementManager() {
return(m_kBackgroundElementHolder);
}
function getCamera() {
return(m_kCamera);
}
function addBonusAnimation(fX, fY, sText, sSymbol, bHideString) {
m_fBashBonuses++;
var _local2 = LRG.LRGMovieClip(attachMovie(sSymbol, "m_kBashBonus" + m_fBashBonuses, getNextHighestDepth()));
_local2._x = fX;
_local2._y = fY;
_local2.m_kSizeInidicator._visible = false;
var _local3 = _local2.m_kSizeInidicator.getBounds(_parent);
if (_local3.xMax > 600) {
_local2._x = _local2._x - (_local3.xMax - 600);
}
if (_local3.yMax > 400) {
_local2._y = _local2._y - (_local3.yMax - 400);
}
_local2.m_kTextHolder.m_kNumber.text = sText;
_local2.m_kTextHolder.m_kNumberShadow.text = sText;
if (bHideString) {
_local2.m_kTextHolder.m_kBash._visible = false;
}
_local2.playAnimation("BONUS_ANIMATION", 60, 1, 37, false, 1);
m_pBonusClips.push(_local2);
}
function playHeshSong() {
_global.LRG.LRGMusic.stopMusic();
_global.LRG.LRGMusic.setPlaylistStyle("LINEAR");
_global.LRG.LRGMusic.startMusic(["sealab_game_music_invincible.wav"]);
}
function stopHeshSong() {
_global.LRG.LRGMusic.endMusic(2300, this);
}
function musicEnded() {
if (!_global.getApplicationState().getPaused()) {
_global.LRG.LRGMusic.stopMusic();
_global.LRG.LRGMusic.setPlaylistStyle("LINEAR");
_global.LRG.LRGMusic.startMusic(["sealab_game_music3.wav", "sealab_game_music1.wav", "sealab_game_music2.wav"]);
}
}
function onActionCompleted(sActionKey) {
if (sActionKey == "BONUS_ANIMATION") {
while (LRG.LRGMovieClip(m_pBonusClips[0]).getActiveActions().getIndex("BONUS_ANIMATION") == -1) {
m_pBonusClips.shift().removeMovieClip();
}
} else if (sActionKey == "DEATH_FADE") {
endGame();
}
}
}
Symbol 434 MovieClip [__Packages.Gui] Frame 0
class Gui extends LRG.LRGMovieClip
{
var m_kPlayGui, m_kGameSummaryPanel;
function Gui () {
super();
}
function onStartGame() {
showPlayGui();
}
function onEndGame() {
hidePlayGui();
showGameSummaryPanel();
}
function showPlayGui() {
m_kPlayGui.gotoAndStop("Show");
m_kPlayGui._visible = true;
m_kPlayGui.onShow();
}
function hidePlayGui() {
m_kPlayGui.gotoAndStop("Hide");
m_kPlayGui._visible = false;
}
function showGameSummaryPanel() {
m_kGameSummaryPanel.gotoAndStop("Show");
m_kGameSummaryPanel._visible = true;
m_kGameSummaryPanel.onShow();
}
function hideGameSummaryPanel() {
m_kGameSummaryPanel.gotoAndStop("Hide");
m_kGameSummaryPanel._visible = false;
}
}
Symbol 435 MovieClip [__Packages.GameSummaryPanel] Frame 0
class GameSummaryPanel extends LRG.LRGMovieClip
{
var m_kScoreText, m_kBackground, m_kOkButton, m_kHelpButton;
function GameSummaryPanel () {
super();
}
function init() {
super.init();
}
function onShow() {
_global.playSound("sealab_game_end.wav", 1, _global.g_kApplication);
m_kScoreText.text = PlayerState(_global.getPlayerState()).getScore();
m_kBackground.onPress = function () {
};
m_kBackground.onRelease = function () {
};
m_kBackground.useHandCursor = false;
m_kOkButton.onRelease = function () {
_global.playSound("sealab_button.wav", 1, _global.g_kApplication);
this.onKeyUp = undefined;
Key.removeListener(this);
_global.g_kApplication.m_kGui.m_kGameSummaryPanel.gotoAndStop("Hide");
_global.g_kApplication.m_kGui.m_kGameSummaryPanel._visible = false;
_global.g_kApplication.m_kGameScreen.startGame();
};
Key.addListener(m_kOkButton);
m_kOkButton.onKeyUp = function () {
if (Key.getCode() == 13) {
this.onRelease();
}
};
m_kHelpButton.onRelease = function () {
_global.playSound("sealab_button.wav", 1, _global.g_kApplication);
_global.g_kApplication.m_kGui.m_kGameSummaryPanel.gotoAndStop("Hide");
_global.g_kApplication.m_kGui.m_kGameSummaryPanel._visible = false;
_global.g_kApplication.m_kGui.m_kHelpPanel.gotoAndStop("Hide");
_global.g_kApplication.m_kGui.m_kHelpPanel._visible = false;
_global.g_kApplication.m_kGui.m_kHelpPanel.onShow();
};
}
}
Symbol 436 MovieClip [__Packages.PlayerController] Frame 0
class PlayerController
{
var m_kPlayer;
function PlayerController () {
init();
}
function init() {
m_kPlayer = undefined;
}
function setPlayer(kPlayer) {
m_kPlayer = kPlayer;
}
function onStartGame() {
}
function onEndGame() {
}
function update(fDeltaSecs) {
}
}
Symbol 437 MovieClip [__Packages.Player] Frame 0
class Player extends Object2D
{
var setClock, addAction, m_kController, m_fSpeed, m_fAcceleration, m_fLastUpdateTime, getClipTime, m_fLastSwingTime, m_fOffsetX, m_fOffsetXDelta, m_fPositionXNoOffset, m_kLeftRange, m_kRightRange, onAdd, m_fMaxSpeed, m_fMinOffset, m_fMaxOffset, m_bSwinging, m_bTakingDamage, m_bAccelerate, m_bInvincible, m_fPositionX, m_fCurrentLane, startAction, stopAction, playAnimation, m_kSoundObject, playSound, m_fLaneChangeSpeed, m_fSwingRate, m_fTargetLane, m_fGoalY, m_fPositionY, _parent, isThisActionActive;
function Player () {
super();
}
function init() {
trace("Player::init()");
super.init();
setClock(_global.getGameTimer());
var _local4 = new Object();
_local4.m_sName = "GENERIC";
_local4.m_fFPS = 120;
var _local5 = new LRG.LRGGenericAction(_local4);
addAction(_local5);
m_kController = undefined;
m_fSpeed = 0;
m_fAcceleration = 0;
m_fLastUpdateTime = getClipTime();
m_fLastSwingTime = getClipTime();
m_fOffsetX = 0;
m_fOffsetXDelta = 0;
m_fPositionXNoOffset = 0;
}
function onStartGame() {
if (Settings(_global.getSettings()).getSetting("HIDE_BOUNDARIES")) {
m_kLeftRange._visible = false;
m_kRightRange._visible = false;
}
onAdd();
m_fMaxSpeed = Settings(_global.getSettings()).getSetting("PLAYER_MAX_FORWARD_SPEED");
setSpeed(Settings(_global.getSettings()).getSetting("PLAYER_START_FORWARD_SPEED"));
setAcceleration(Settings(_global.getSettings()).getSetting("PLAYER_ACCELERATION"));
setLaneChangeSpeed(Settings(_global.getSettings()).getSetting("PLAYER_LANE_CHANGE_SPEED"));
setSwingRate(Settings(_global.getSettings()).getSetting("PLAYER_SWING_RATE"));
m_fMinOffset = Settings(_global.getSettings()).getSetting("PLAYER_MIN_OFFSET");
m_fMaxOffset = Settings(_global.getSettings()).getSetting("PLAYER_MAX_OFFSET");
m_fLastUpdateTime = getClipTime();
m_fLastSwingTime = 0;
m_bSwinging = false;
m_bTakingDamage = false;
m_bAccelerate = true;
m_bInvincible = false;
m_fPositionX = 0;
m_fCurrentLane = undefined;
moveToLane(2, true);
startAction("GENERIC", null, true);
stopAction("TO_RIGHT_LANE", false);
stopAction("TO_LEFT_LANE", false);
playAnimation("FORWARD", 15, 1, 9, true, 1);
m_kSoundObject.stop();
playSound("sealab_car_accel.wav");
var _local3 = new Object();
_local3.m_sName = "WAIT_CAR_STEADY";
_local3.m_fTotalActionTime = 2.86666667;
var _local4 = new LRG.LRGWaitAction(_local3);
addAction(_local4);
startAction("WAIT_CAR_STEADY", null, false);
m_kController.onStartGame();
}
function onEndGame() {
SealabGame(_global.g_kApplication.m_kGameScreen).getCamera().unregisterObject(this);
m_kController.onEndGame();
m_kSoundObject.stop();
stopAction("GENERIC", false);
}
function setController(kController) {
m_kController = kController;
m_kController.setPlayer(this);
}
function setSpeed(fSpeed) {
m_fSpeed = fSpeed;
}
function getSpeed() {
return(m_fSpeed);
}
function setAcceleration(fAcceleration) {
m_fAcceleration = fAcceleration;
}
function getAcceleration() {
return(m_fAcceleration);
}
function setLaneChangeSpeed(fLaneChangeSpeed) {
m_fLaneChangeSpeed = fLaneChangeSpeed;
}
function getLaneChangeSpeed() {
return(m_fLaneChangeSpeed);
}
function setSwingRate(fSwingRate) {
m_fSwingRate = fSwingRate;
}
function getSwingRate() {
return(m_fSwingRate);
}
function setOffsetXDelta(fOffsetXDelta) {
m_fOffsetXDelta = fOffsetXDelta;
}
function getOffsetXDelta() {
return(m_fOffsetXDelta);
}
function moveToLane(fNumber, bInstant) {
m_fTargetLane = fNumber;
var _local3 = SealabGame(_global.g_kApplication.m_kGameScreen);
switch (m_fTargetLane) {
case 1 :
m_fGoalY = _local3.m_kLane1Guide._y;
break;
case 2 :
m_fGoalY = _local3.m_kLane2Guide._y;
break;
case 3 :
m_fGoalY = _local3.m_kLane3Guide._y;
break;
case 4 :
m_fGoalY = _local3.m_kLane4Guide._y;
}
if (bInstant) {
m_fPositionY = m_fGoalY;
m_fCurrentLane = m_fTargetLane;
}
}
function changeLaneLeft() {
if (m_bTakingDamage) {
return(undefined);
}
if ((m_fCurrentLane > 1) || ((m_fCurrentLane == 1) && (m_fTargetLane == 2))) {
if (m_fTargetLane > m_fCurrentLane) {
moveToLane(m_fCurrentLane, false);
m_fCurrentLane++;
} else {
moveToLane(m_fCurrentLane - 1, false);
}
}
}
function changeLaneRight() {
if (m_bTakingDamage) {
return(undefined);
}
if ((m_fCurrentLane < 4) || ((m_fCurrentLane == 4) && (m_fTargetLane == 3))) {
if (m_fTargetLane < m_fCurrentLane) {
moveToLane(m_fCurrentLane, false);
m_fCurrentLane--;
} else {
moveToLane(m_fCurrentLane + 1, false);
}
}
}
function swingPipe() {
if (((!m_bSwinging) && (!m_bTakingDamage)) && (!m_bInvincible)) {
m_bSwinging = true;
var _local7 = SealabGame(_global.g_kApplication.m_kGameScreen);
var _local5 = _local7.getPlayer().m_kLeftRange.getBounds(_parent);
var _local6 = _local7.getPlayer().m_kRightRange.getBounds(_parent);
var _local8 = false;
var _local9 = false;
var _local4 = 0;
while (_local4 < _local7.getEnemyManager().getNumberEnemies()) {
var _local3 = _local7.getEnemyManager().getEnemyAtIndex(_local4);
if (_local3.isEnemyHead()) {
} else if ((((_local3._x >= _local5.xMin) && (_local3._x <= _local5.xMax)) && (_local3._y >= _local5.yMin)) && (_local3._y <= _local5.yMax)) {
_local8 = true;
_local3.onHitWithPipe(true);
} else if ((((_local3._x >= _local6.xMin) && (_local3._x <= _local6.xMax)) && (_local3._y >= _local6.yMin)) && (_local3._y <= _local6.yMax)) {
_local9 = true;
_local3.onHitWithPipe(false);
}
_local4++;
}
if ((_local9 && (_local8)) || ((!_local9) && (!_local8))) {
playAnimation("SWING_PIPE", 40, 51, 60, false, 1);
playSound("sealab_swing_two_pipes.wav");
} else if (_local9) {
playAnimation("SWING_PIPE", 40, 41, 50, false, 1);
playSound("sealab_swing_one_pipe.wav");
} else if (_local8) {
playAnimation("SWING_PIPE", 40, 31, 40, false, 1);
playSound("sealab_swing_one_pipe.wav");
}
}
}
function takeDamage() {
if (!m_bInvincible) {
m_kSoundObject.stop();
}
playSound("sealab_car_hits_zombie.wav");
if (m_bInvincible) {
return(undefined);
}
playSound("sealab_electric_car_stall.wav", true);
m_fSpeed = m_fSpeed - Settings(_global.getSettings()).getSetting("PLAYER_IMPACT_SLOW");
if (m_bSwinging) {
stopAction("SWING_PIPE", false);
m_bSwinging = false;
}
playAnimation("TAKE_DAMAGE", 30, 61, 69, false, 1);
var _local3 = new Object();
_local3.m_sName = "ACCEL_WAIT";
_local3.m_fTotalActionTime = Settings(_global.getSettings()).getSetting("PLAYER_ACCEL_WAIT");
var _local4 = new LRG.LRGWaitAction(_local3);
addAction(_local4);
startAction("ACCEL_WAIT", null, false);
m_bAccelerate = false;
m_bTakingDamage = true;
if (m_fSpeed < Settings(_global.getSettings()).getSetting("PLAYER_MIN_FORWARD_SPEED")) {
m_fSpeed = 0;
m_fLaneChangeSpeed = 0;
}
}
function isFacingCamera() {
return(m_fGoalY > m_fPositionY);
}
function isFacingAwayFromCamera() {
return(m_fGoalY < m_fPositionY);
}
function isSwingingPipe() {
return(m_bSwinging);
}
function isMoving() {
return(m_fSpeed != 0);
}
function isInvincible() {
return(m_bInvincible);
}
function onHitHesh() {
trace("Player::onHitHesh()");
m_bInvincible = true;
playAnimation("HESH_DROP_IN", 50, 79, 110, false, 1);
m_kSoundObject.stop();
_global.playSound("sealab_hesh_down.wav");
var _local3 = new Object();
_local3.m_sName = "KNOCK_OFF_HESH";
_local3.m_fTotalActionTime = Settings(_global.getSettings()).getSetting("HESH_RIDE_SECS");
var _local4 = new LRG.LRGWaitAction(_local3);
addAction(_local4);
startAction("KNOCK_OFF_HESH", null, false);
}
function doEnterFrame() {
if (ApplicationState(_global.getApplicationState()).isPaused()) {
return(undefined);
}
var _local3 = getClipTime() - m_fLastUpdateTime;
m_kController.update(_local3);
if (m_fPositionY != m_fGoalY) {
var _local5 = m_fGoalY - m_fPositionY;
var _local4 = _local3 * m_fLaneChangeSpeed;
if (_local4 >= Math.abs(_local5)) {
m_fPositionY = m_fGoalY;
m_fCurrentLane = m_fTargetLane;
if ((((!isSwingingPipe()) && (isMoving())) && (!m_bTakingDamage)) && (!m_bInvincible)) {
stopAction("TO_RIGHT_LANE", false);
stopAction("TO_LEFT_LANE", false);
playAnimation("FORWARD", 15, 1, 9, true, 1);
}
} else {
if (_local5 < 0) {
_local4 = _local4 * -1;
}
m_fPositionY = m_fPositionY + _local4;
}
}
m_fPositionXNoOffset = m_fPositionXNoOffset + (_local3 * m_fSpeed);
if ((!m_bTakingDamage) && (m_bAccelerate)) {
m_fOffsetX = m_fOffsetX + (_local3 * m_fOffsetXDelta);
}
if (m_fOffsetX < m_fMinOffset) {
m_fOffsetX = m_fMinOffset;
} else if (m_fOffsetX > m_fMaxOffset) {
m_fOffsetX = m_fMaxOffset;
}
m_fPositionX = m_fPositionXNoOffset + m_fOffsetX;
if ((m_fSpeed > 0) && (m_bAccelerate)) {
m_fSpeed = m_fSpeed + (m_fAcceleration * _local3);
if (m_fSpeed > m_fMaxSpeed) {
m_fSpeed = m_fMaxSpeed;
}
}
SealabGame(_global.g_kApplication.m_kGameScreen).getCamera().setPosition((m_fPositionXNoOffset + 115) - ((m_fSpeed / m_fMaxSpeed) * 35), 200);
m_fLastUpdateTime = getClipTime();
}
function onActionCompleted(sActionKey) {
if (sActionKey == "SWING_PIPE") {
m_bSwinging = false;
if (m_bTakingDamage) {
playAnimation("TAKE_DAMAGE", 40, 61, 69, false, 1);
} else {
playAnimation("FORWARD", 15, 1, 9, true, 1);
}
} else if (sActionKey == "TAKE_DAMAGE") {
if (m_fSpeed > 0) {
if (m_bAccelerate) {
m_kSoundObject.stop();
playSound("sealab_car_accel.wav");
m_bTakingDamage = false;
playAnimation("FORWARD", 15, 1, 9, true, 1);
var _local9 = new Object();
_local9.m_sName = "WAIT_CAR_STEADY";
_local9.m_fTotalActionTime = 2.86666667;
var _local10 = new LRG.LRGWaitAction(_local9);
addAction(_local10);
startAction("WAIT_CAR_STEADY", null, false);
} else {
playAnimation("TAKE_DAMAGE", 30, 61, 69, false, 1);
}
} else {
m_kSoundObject.stop();
playAnimation("DOOMED", 999, 70, 78, false, 1);
SealabGame(_global.g_kApplication.m_kGameScreen).getEnemyManager().onPlayerDoomed();
}
} else if (sActionKey == "DOOMED") {
playSound("sealab_player_dies.wav");
SealabGame(_global.g_kApplication.m_kGameScreen).onPlayerDied();
} else if (sActionKey == "ACCEL_WAIT") {
m_bAccelerate = true;
} else if (sActionKey == "WAIT_CAR_STEADY") {
if (m_bAccelerate && (m_fSpeed > 0)) {
playSound("sealab_car_steady.wav", true);
}
} else if ((sActionKey == "HESH_DROP_IN") || (sActionKey == "HESH_SWING")) {
var _local7 = _global.g_kApplication.m_kGameScreen;
if (sActionKey == "HESH_DROP_IN") {
_local7.playHeshSong();
playSound("sealab_car_steady.wav", true);
m_fSpeed = Math.max(m_fSpeed, Settings(_global.getSettings()).getSetting("PLAYER_MIN_FORWARD_SPEED"));
m_fLaneChangeSpeed = Math.max(m_fLaneChangeSpeed, Settings(_global.getSettings()).getSetting("PLAYER_LANE_CHANGE_SPEED"));
}
if (isThisActionActive("HESH_FALL_OUT")) {
return(undefined);
}
playAnimation("HESH_SWING", 60, 111, 140, false, 1);
playSound("sealab_swing_two_pipes.wav");
m_bSwinging = true;
m_bTakingDamage = false;
var _local5 = _local7.getPlayer().m_kLeftRange.getBounds(_parent);
var _local6 = _local7.getPlayer().m_kRightRange.getBounds(_parent);
var _local4 = 0;
while (_local4 < _local7.getEnemyManager().getNumberEnemies()) {
var _local3 = _local7.getEnemyManager().getEnemyAtIndex(_local4);
if (_local3.isEnemyHead()) {
} else if ((((_local3._x >= _local5.xMin) && (_local3._x <= _local5.xMax)) && (_local3._y >= _local5.yMin)) && (_local3._y <= _local5.yMax)) {
_local3.onHitWithPipe(true);
} else if ((((_local3._x >= _local6.xMin) && (_local3._x <= _local6.xMax)) && (_local3._y >= _local6.yMin)) && (_local3._y <= _local6.yMax)) {
_local3.onHitWithPipe(false);
}
_local4++;
}
} else if (sActionKey == "KNOCK_OFF_HESH") {
playAnimation("HESH_FALL_OUT", 27, 141, 203, false, 1);
m_bSwinging = false;
playSound("sealab_car_steady.wav", true);
_global.g_kApplication.m_kGameScreen.stopHeshSong();
} else if (sActionKey == "HESH_FALL_OUT") {
m_bInvincible = false;
SealabGame(_global.g_kApplication.m_kGameScreen).getEnemyManager().startAddSpecialAction();
}
}
}
Symbol 438 MovieClip [__Packages.LRG.LRGGenericAction] Frame 0
class LRG.LRGGenericAction extends LRG.LRGAction
{
var init;
function LRGGenericAction (kActionParams) {
super();
init(kActionParams);
}
function doUpdate(fCurrTime, fDeltaTimeSecs, kClip) {
return(false);
}
}
Symbol 439 MovieClip [__Packages.LRG.LRGWaitAction] Frame 0
class LRG.LRGWaitAction extends LRG.LRGAction
{
var m_fTotalActionTime, m_sActionType;
function LRGWaitAction (kAnimationParams) {
super();
init(kAnimationParams);
}
function init(kActionParams) {
if ((kActionParams.m_fTotalActionTime == undefined) && (m_fTotalActionTime == undefined)) {
kActionParams.m_fTotalActionTime = 0;
trace(("Wait action " + kActionParams.m_sName) + " created with no wait time specified.");
}
kActionParams.m_fSPF = kActionParams.m_fTotalActionTime;
if ((kActionParams.m_sType == undefined) && ((m_sActionType == undefined) || (m_sActionType == "DEFAULT"))) {
kActionParams.m_sType = "WAIT";
}
super.init(kActionParams);
}
function reset(fCurrTime, kActionParams) {
super.reset(fCurrTime, kActionParams);
}
function doUpdate(fCurrTime, fDeltaTimeSecs, kClip) {
if (fDeltaTimeSecs >= m_fTotalActionTime) {
return(true);
}
return(false);
}
}
Symbol 440 MovieClip [__Packages.HumanPlayerController] Frame 0
class HumanPlayerController extends PlayerController
{
var m_bFireKeyDown, m_kPlayer;
function HumanPlayerController () {
super();
}
function init() {
super.init();
m_bFireKeyDown = false;
Key.addListener(this);
Mouse.addListener(this);
}
function onStartGame() {
m_bFireKeyDown = false;
}
function onEndGame() {
}
function onKeyUp() {
if (!Key.isDown(32)) {
m_bFireKeyDown = false;
}
}
function update(fDeltaSecs) {
if (ApplicationState(_global.getApplicationState()).isPaused()) {
return(undefined);
}
if (Key.isDown(38)) {
m_kPlayer.changeLaneLeft();
} else if (Key.isDown(40)) {
m_kPlayer.changeLaneRight();
}
if ((!m_bFireKeyDown) && (Key.isDown(32))) {
m_bFireKeyDown = true;
m_kPlayer.swingPipe();
}
}
}
Symbol 441 MovieClip [__Packages.Camera2D] Frame 0
class Camera2D
{
var m_fPositionX, m_fPositionY, m_pRegisteredObjects;
function Camera2D () {
init();
}
function init() {
m_fPositionX = 0;
m_fPositionY = 0;
m_pRegisteredObjects = new Array();
}
function onStartGame() {
}
function onEndGame() {
}
function registerObject(kObject) {
m_pRegisteredObjects.push(kObject);
kObject.setCamera(this);
}
function unregisterObject(kObject) {
kObject.setCamera(null);
var _local2 = m_pRegisteredObjects.removeData(kObject);
delete m_pRegisteredObjects;
m_pRegisteredObjects = _local2;
}
function setPosition(fPositionX, fPositionY) {
m_fPositionX = fPositionX;
m_fPositionY = fPositionY;
var _local2 = 0;
while (_local2 < m_pRegisteredObjects.length) {
Object2D(m_pRegisteredObjects[_local2])._x = (Object2D(m_pRegisteredObjects[_local2]).m_fPositionX - m_fPositionX) + 300;
Object2D(m_pRegisteredObjects[_local2])._y = (Object2D(m_pRegisteredObjects[_local2]).m_fPositionY - m_fPositionY) + 200;
_local2++;
}
}
function getVirtualLeftBound() {
return(m_fPositionX - 300);
}
function getVirtualRightBound() {
return(m_fPositionX + 300);
}
function getVirtualTopBound() {
return(m_fPositionY - 200);
}
function getVirtualBottomBound() {
return(m_fPositionY + 200);
}
}
Symbol 442 MovieClip [__Packages.EnemyManager] Frame 0
class EnemyManager extends LRG.LRGMovieClip
{
var setClock, m_pEnemyArray, m_pSortedSpriteArray, m_pSpecial, addAction, attachMovie, getNextHighestDepth, m_fTotalAdded, startAction, m_kPlayer, stopAction;
function EnemyManager () {
super();
}
function init() {
super.init();
setClock(_global.getGameTimer());
m_pEnemyArray = new Array();
m_pSortedSpriteArray = new Array();
m_pSpecial = null;
var _local5 = new Object();
_local5.m_sName = "ADD_ENEMIES";
_local5.m_fSPF = 0.5;
_local5.m_kCallback = addCallback;
var _local6 = new LRG.LRGRepeatedCallbackAction(_local5);
addAction(_local6);
var _local4 = new Object();
_local4.m_sName = "ADD_SPECIAL_ENEMIES";
_local4.m_fTotalActionTime = 0;
_local4.m_kCallback = addSpecialCallback;
var _local7 = new LRG.LRGDelayedCallbackAction(_local4);
addAction(_local7);
attachMovie("s_Player", "m_kPlayer", getNextHighestDepth());
}
function onStartGame() {
trace("EnemyManager::onStartGame()");
m_fTotalAdded = 0;
startAction("ADD_ENEMIES", null, true);
startAddSpecialAction();
m_pSortedSpriteArray.push(m_kPlayer);
}
function onEndGame() {
stopAction("ADD_ENEMIES", false);
m_pSortedSpriteArray.splice(0);
var _local2 = 0;
while (_local2 < m_pEnemyArray.length) {
m_pEnemyArray[_local2].onRemove();
m_pEnemyArray[_local2].removeMovieClip();
_local2++;
}
m_pEnemyArray.splice(0);
if (m_pSpecial) {
m_pSpecial.onRemove();
m_pSpecial.removeMovieClip();
}
m_pSpecial = null;
}
function getEnemyAtIndex(fIndex) {
return(m_pEnemyArray[fIndex]);
}
function getNumberEnemies() {
return(m_pEnemyArray.length);
}
function addCallback() {
if (m_pEnemyArray.length >= Settings(_global.getSettings()).getSetting("MAX_ENEMIES_ON_SCREEN")) {
return(undefined);
}
addEnemy(1000);
}
function startAddSpecialAction() {
var _local4 = Settings(_global.getSettings()).getSetting("MIN_SECS_BETWEEN_SPECIALS");
var _local6 = Settings(_global.getSettings()).getSetting("MAX_SECS_BETWEEN_SPECIALS");
var _local5 = (Math.random() * (_local6 - _local4)) + _local4;
var _local3 = new Object();
_local3.m_fTotalActionTime = _local5;
startAction("ADD_SPECIAL_ENEMIES", _local3, false);
}
function addSpecialCallback() {
if (m_pSpecial) {
trace("Attempt to add special enemy with one already in place.");
return(undefined);
}
m_fTotalAdded++;
var _local4 = _global.g_kApplication.m_kGameScreen;
var _local5 = Math.floor(Math.random() * 1000) % 4;
var _local3 = new Object();
_local3._x = -1000;
_local3._y = -1000;
trace("making choice: " + _local5);
switch (_local5) {
case 0 :
trace("Adding dolphin boy.");
m_pSpecial = Enemy(attachMovie("s_DolphinBoy", "m_kDolphinBoy" + m_fTotalAdded, getNextHighestDepth(), _local3));
m_pSpecial.setSpecialness(Enemy.DOLPHIN_BOY);
break;
case 1 :
trace("Adding bonus pretzel.");
m_pSpecial = Enemy(attachMovie("s_BonusPretzel", "m_kBonusPretzel" + m_fTotalAdded, getNextHighestDepth(), _local3));
m_pSpecial.setSpecialness(Enemy.BONUS_PRETZEL);
m_pSpecial.play(12, true);
break;
case 2 :
trace("Adding Hesh.");
m_pSpecial = Enemy(attachMovie("s_Hesh", "m_kHesh" + m_fTotalAdded, getNextHighestDepth(), _local3));
m_pSpecial.setSpecialness(Enemy.HESH);
break;
case 3 :
default :
trace("Adding bonus s_CoconutPile.");
m_pSpecial = Enemy(attachMovie("s_CoconutPile", "m_kCoconutPile" + m_fTotalAdded, getNextHighestDepth(), _local3));
m_pSpecial.setSpecialness(Enemy.COCONUT_PILE);
}
var _local6 = _local4.m_kGroundGuide.getBounds(this);
m_pSpecial.m_fPositionX = _local4.getCamera().getVirtualRightBound() + m_pSpecial._width;
switch (Math.floor(Math.random() * 4)) {
case 0 :
m_pSpecial.m_fPositionY = _local4.m_kLane1Guide._y - 15;
break;
case 1 :
m_pSpecial.m_fPositionY = _local4.m_kLane2Guide._y - 15;
break;
case 2 :
m_pSpecial.m_fPositionY = _local4.m_kLane3Guide._y - 15;
break;
case 3 :
m_pSpecial.m_fPositionY = _local4.m_kLane4Guide._y - 15;
}
m_pSortedSpriteArray.push(m_pSpecial);
m_pSpecial.onAdd();
}
function addEnemy(fPointValue) {
m_fTotalAdded++;
var _local5 = new Object();
_local5._x = -1000;
_local5._y = -1000;
var _local9 = Math.floor(Math.random() * 3) + 1;
var _local4 = _global.g_kApplication.m_kGameScreen;
var _local3 = Enemy(attachMovie("s_Zombie" + _local9, "m_kEnemy" + m_fTotalAdded, getNextHighestDepth(), _local5));
_local3.setType(_local9);
var _local7 = _local4.m_kGroundGuide.getBounds(this);
var _local6;
var _local8 = false;
if (SealabGame(_global.g_kApplication.m_kGameScreen).getPlayer().isMoving()) {
_local6 = Math.floor(Math.random() * 1000) % 10;
} else {
_local6 = Math.floor(Math.random() * 1000) % 3;
_local8 = true;
}
if ((_local6 == 0) && (_local8)) {
_local3.m_fPositionX = (Math.random() * _local4.m_kGroundGuide._width) + _local4.getCamera().getVirtualLeftBound();
_local3.m_fPositionY = (_local7.yMin + _local4.m_kGroundGuide._height) + _local3._height;
_local3.setVelocityX(_local4.getPlayer().getSpeed());
} else if (_local6 == 1) {
_local3.m_fPositionX = _local4.getCamera().getVirtualLeftBound() - (_local3._width / 2);
_local3.m_fPositionY = (Math.random() * _local4.m_kGroundGuide._height) + _local7.yMin;
_local3.setVelocityX(_local4.getPlayer().getSpeed());
} else {
_local3.m_fPositionX = _local4.getCamera().getVirtualRightBound() + _local3._width;
_local3.m_fPositionY = (Math.random() * _local4.m_kGroundGuide._height) + _local7.yMin;
}
_local3.setPointValue(fPointValue);
m_pEnemyArray.push(_local3);
m_pSortedSpriteArray.push(_local3);
_local3.onAdd();
}
function addEnemyHead(fPositionX, fPositionY, fVelocityX, fVelocityY, sSymbol, kSentFlyingBy) {
m_fTotalAdded++;
var _local4 = _global.g_kApplication.m_kGameScreen;
var _local3 = Enemy(attachMovie(sSymbol, "m_kHead" + m_fTotalAdded, getNextHighestDepth()));
_local3.m_fPositionX = fPositionX;
_local3.m_fPositionY = fPositionY;
_local3.setVelocityX(fVelocityX);
_local3.setVelocityY(fVelocityY);
m_pEnemyArray.push(_local3);
m_pSortedSpriteArray.push(_local3);
_local3.setEnemyHead(true);
_local3.setSentFlyingBy(kSentFlyingBy);
_local3.onAdd();
return(_local3);
}
function onRequestRemoveEnemy(kEnemy) {
m_pEnemyArray = m_pEnemyArray.removeData(kEnemy);
m_pSortedSpriteArray = m_pSortedSpriteArray.removeData(kEnemy);
if (kEnemy == m_pSpecial) {
m_pSpecial = null;
if (!Player(m_kPlayer).isInvincible()) {
startAddSpecialAction();
}
}
kEnemy.onRemove();
kEnemy.removeMovieClip();
}
function onPlayerDoomed() {
var _local2 = 0;
while (_local2 < 10) {
addEnemy(0);
_local2++;
}
_local2 = 0;
while (_local2 < m_pEnemyArray.length) {
var _local3 = m_pEnemyArray[_local2];
if (!_local3.isGoneFlying()) {
if (_local3.getState() == Enemy.SQUISHED) {
addEnemy(0);
} else {
trace("fast speed for all of the zombies");
_local3.setSpeed(100 + (Math.random() * 40));
}
}
_local2++;
}
}
function compareZ(a, b) {
return(a._y - b._y);
}
function doEnterFrame() {
m_pSortedSpriteArray.sort(compareZ);
var _local2 = 0;
while (_local2 < m_pSortedSpriteArray.length) {
if (m_pSortedSpriteArray[_local2].getDepth() != (_local2 + 1)) {
m_pSortedSpriteArray[_local2].swapDepths(_local2 + 1);
}
_local2++;
}
}
}
Symbol 443 MovieClip [__Packages.LRG.LRGRepeatedCallbackAction] Frame 0
class LRG.LRGRepeatedCallbackAction extends LRG.LRGAction
{
var m_fSPF, m_sActionType, m_kCallback, m_sName;
function LRGRepeatedCallbackAction (kAnimationParams) {
super();
init(kAnimationParams);
}
function init(kActionParams) {
if (((kActionParams.m_fSPF == undefined) && (kActionParams.m_fFPS == undefined)) && (m_fSPF == undefined)) {
kActionParams.m_fSPF = 0;
trace(("Repeated callback action " + kActionParams.m_sName) + " created with no SPF specified.");
}
if ((kActionParams.m_sType == undefined) && ((m_sActionType == undefined) || (m_sActionType == "DEFAULT"))) {
kActionParams.m_sType = "REPEATED_CALLBACK";
}
super.init(kActionParams);
if (kActionParams.m_kCallback != undefined) {
m_kCallback = kActionParams.m_kCallback;
} else if (m_kCallback == undefined) {
trace(("LRGRepeatedCallbackAction " + m_sName) + " initialized without callback.");
}
}
function reset(fCurrTime, kActionParams) {
super.reset(fCurrTime, kActionParams);
}
function doUpdate(fCurrTime, fDeltaTimeSecs, kClip) {
if (fDeltaTimeSecs >= m_fSPF) {
m_kCallback.apply(kClip);
}
return(false);
}
}
Symbol 444 MovieClip [__Packages.LRG.LRGDelayedCallbackAction] Frame 0
class LRG.LRGDelayedCallbackAction extends LRG.LRGAction
{
var m_fTotalActionTime, m_sActionType, m_kCallback, m_sName;
function LRGDelayedCallbackAction (kAnimationParams) {
super();
init(kAnimationParams);
}
function init(kActionParams) {
if ((kActionParams.m_fTotalActionTime == undefined) && (m_fTotalActionTime == undefined)) {
kActionParams.m_fTotalActionTime = 0;
trace(("Delayed callback action " + kActionParams.m_sName) + " created with no wait time specified.");
}
kActionParams.m_fSPF = kActionParams.m_fTotalActionTime;
if ((kActionParams.m_sType == undefined) && ((m_sActionType == undefined) || (m_sActionType == "DEFAULT"))) {
kActionParams.m_sType = "DELAYED_CALLBACK";
}
if (kActionParams.m_kCallback != undefined) {
m_kCallback = kActionParams.m_kCallback;
} else if (m_kCallback == undefined) {
trace(("LRGDelayedCallbackAction " + m_sName) + " initialized without callback.");
}
super.init(kActionParams);
}
function reset(fCurrTime, kActionParams) {
super.reset(fCurrTime, kActionParams);
}
function doUpdate(fCurrTime, fDeltaTimeSecs, kClip) {
if (fDeltaTimeSecs >= m_fTotalActionTime) {
m_kCallback.apply(kClip);
return(true);
}
return(false);
}
}
Symbol 445 MovieClip [__Packages.BackgroundElementManager] Frame 0
class BackgroundElementManager extends LRG.LRGMovieClip
{
var setClock, m_pElementArray, addAction, startAction, m_fLastRightBound, m_kGuide1, m_kGuide2, m_kGuide3, m_kGuide4, m_kGuide5, m_kGuide6, m_kGuide7, stopAction, m_kElementsHolder, m_kPowerUpHolder;
function BackgroundElementManager () {
super();
}
function init() {
super.init();
setClock(_global.getGameTimer());
m_pElementArray = new Array();
var _local5 = new Object();
_local5.m_sName = "ADD_OBJECTS";
_local5.m_fSPF = 0.5;
_local5.m_kCallback = addCallback;
var _local6 = new LRG.LRGRepeatedCallbackAction(_local5);
addAction(_local6);
var _local4 = new Object();
_local4.m_sName = "ADD_POWERUPS";
_local4.m_fSPF = 30;
_local4.m_kCallback = addPowerUpsCallback;
var _local7 = new LRG.LRGRepeatedCallbackAction(_local4);
addAction(_local7);
}
function onStartGame() {
startAction("ADD_OBJECTS", null, false);
m_fLastRightBound = 0;
if (Settings(_global.getSettings()).getSetting("HIDE_BOUNDARIES")) {
m_kGuide1._visible = false;
m_kGuide2._visible = false;
m_kGuide3._visible = false;
m_kGuide4._visible = false;
m_kGuide5._visible = false;
m_kGuide6._visible = false;
m_kGuide7._visible = false;
}
}
function onEndGame() {
stopAction("ADD_OBJECTS", false);
stopAction("ADD_POWERUPS", false);
var _local2 = 0;
while (_local2 < m_pElementArray.length) {
Object2D(m_pElementArray[_local2]).onRemove();
Object2D(m_pElementArray[_local2]).removeMovieClip();
_local2++;
}
m_pElementArray.splice(0);
}
function addCallback() {
var _local4 = _global.g_kApplication.m_kGameScreen;
if ((_local4.getCamera().getVirtualRightBound() - m_fLastRightBound) < 250) {
return(undefined);
}
m_fLastRightBound = _local4.getCamera().getVirtualRightBound();
addBackgroundElement("s_BackgroundElement1", m_kGuide1._y, m_kElementsHolder);
var _local3 = Math.floor(Math.random() * 6) + 2;
var _local5 = this["m_kGuide" + _local3]._y;
addBackgroundElement("s_BackgroundElement" + _local3, _local5, m_kElementsHolder);
}
function addPowerUpsCallback() {
var _local5 = _global.g_kApplication.m_kGameScreen;
var _local4 = Math.floor(Math.random() * 4) + 1;
var _local3 = _local5[("m_kLane" + _local4) + "Guide"]._y;
addBackgroundElement("s_PowerUp", _local3, m_kPowerUpHolder);
}
function addBackgroundElement(sSymbol, fPosY, kParent) {
var _local6 = _global.g_kApplication.m_kGameScreen;
_global.dbg("Add BKG: " + sSymbol);
var _local3 = Object2D(kParent.attachMovie(sSymbol, sSymbol + kParent.getNextHighestDepth(), kParent.getNextHighestDepth()));
_local3.m_fPositionX = _local6.getCamera().getVirtualRightBound() + (_local3._width / 2);
_local3.m_fPositionY = fPosY;
_local3._x = 9999;
_local3._y = 9999;
m_pElementArray.push(_local3);
_local3.onAdd();
}
function onRequestRemoveBackgroundElement(kObject2D) {
var _local4 = m_pElementArray.getIndex(kObject2D);
if (_local4 != -1) {
m_pElementArray.splice(_local4, 1);
_global.dbg("onReqRemove: " + kObject2D._name);
kObject2D.onRemove();
kObject2D.removeMovieClip();
}
}
function doEnterFrame() {
var _local4 = new Array();
var _local5 = SealabGame(_global.g_kApplication.m_kGameScreen).getCamera().getVirtualLeftBound();
var _local3 = 0;
while (_local3 < m_pElementArray.length) {
if ((Object2D(m_pElementArray[_local3]).m_fPositionX + Object2D(m_pElementArray[_local3])._width) < _local5) {
_local4.push(m_pElementArray[_local3]);
}
_local3++;
}
_local3 = 0;
while (_local3 < _local4.length) {
onRequestRemoveBackgroundElement(_local4[_local3]);
_local3++;
}
}
}
Symbol 446 MovieClip [__Packages.Enemy] Frame 0
class Enemy extends Object2D
{
var setClock, m_fPointValue, m_fVelocityX, m_fVelocityY, m_fNumZombiesHit, m_bGoneFlying, m_kEnemyThatSentUsFlying, m_pEnemiesWeSentFlying, m_bMobile, m_fSpecialness, addAction, m_fSpeed, m_fAcceleration, _parent, m_fWallPosition, m_fRadius, _width, m_fState, m_fLastUpdateTime, getClipTime, startAction, m_bEnemyHead, m_fLastStateChangeTime, m_fType, playAnimation, _xscale, stopAction, gotoAndStop, playSound, m_fPositionY, m_fPositionX, m_fGoalOffsetX, m_fGoalOffsetY, getAction, getBounds, _x, _y;
function Enemy () {
super();
}
function init() {
super.init();
setClock(_global.getGameTimer());
m_fPointValue = 0;
m_fVelocityX = 0;
m_fVelocityY = 0;
m_fNumZombiesHit = 0;
m_bGoneFlying = false;
m_kEnemyThatSentUsFlying = null;
m_pEnemiesWeSentFlying = new Array();
m_bMobile = true;
m_fSpecialness = NOT_SPECIAL;
var _local4 = new Object();
_local4.m_sName = "GENERIC";
_local4.m_fFPS = 120;
var _local6 = new LRG.LRGGenericAction(_local4);
addAction(_local6);
var _local5 = new LRG.LRGRepeatedCallbackAction({m_sName:"UPDATE_OFFSET", m_fSPF:0, m_kCallback:updateOffset});
addAction(_local5);
}
function onAdd() {
super.onAdd();
m_fSpeed = Settings(_global.getSettings()).getSetting("ENEMY_SPEED") + ((PlayerState(_global.getPlayerState()).getScore() / 10000) * Settings(_global.getSettings()).getSetting("ENEMY_SPEED_INCREASE"));
m_fAcceleration = Settings(_global.getSettings()).getSetting("ENEMY_ACC") + ((PlayerState(_global.getPlayerState()).getScore() / 10000) * Settings(_global.getSettings()).getSetting("ENEMY_ACC_INCREASE"));
var _local4 = SealabGame(_global.g_kApplication.m_kGameScreen).m_kGroundGuide.getBounds(_parent);
m_fWallPosition = _local4.yMin;
m_fRadius = (_width / 2) * Settings(_global.getSettings()).getSetting("ENEMY_RADIUS_COEFF");
m_fState = undefined;
m_fLastUpdateTime = getClipTime();
startAction("GENERIC", null, true);
if (m_bEnemyHead) {
setState(FLY_RIGHT);
m_bGoneFlying = true;
} else if (m_fSpecialness == NOT_SPECIAL) {
startAction("UPDATE_OFFSET", null, false);
} else {
setState(STANDING);
}
m_fLastStateChangeTime = getClipTime() - 9999;
}
function onRemove() {
super.onRemove();
}
function setSentFlyingBy(kEnemy) {
m_kEnemyThatSentUsFlying = kEnemy;
}
function setType(fType) {
m_fType = fType;
}
function getType() {
return(m_fType);
}
function setSpecialness(fSpecialness) {
m_fSpecialness = fSpecialness;
}
function getSpecialness() {
return(m_fSpecialness);
}
function setSpeed(fSpeed) {
m_fSpeed = fSpeed;
}
function getSpeed() {
return(m_fSpeed);
}
function setVelocityX(fVelocityX) {
m_fVelocityX = fVelocityX;
}
function getVelocityX() {
return(m_fVelocityX);
}
function setVelocityY(fVelocityY) {
m_fVelocityY = fVelocityY;
}
function getVelocityY() {
return(m_fVelocityY);
}
function getRadius() {
return(m_fRadius);
}
function setPointValue(fPointValue) {
m_fPointValue = fPointValue;
}
function getPointValue() {
return(m_fPointValue);
}
function setNumZombiesHit(fNumZombiesHit) {
m_fNumZombiesHit = fNumZombiesHit;
}
function getNumZombiesHit() {
return(m_fNumZombiesHit);
}
function setState(fState) {
if (m_fState === fState) {
return(undefined);
}
var _local2 = m_fState;
var _local3 = getClipTime() - m_fLastStateChangeTime;
switch ((m_fState = fState)) {
case WALK_FRONT_LEFT :
if (_local3 < 0.65) {
m_fState = _local2;
return(undefined);
}
playAnimation("STATE_ANIMATION", (40 * m_fSpeed) / 100, 1, 10, true, 1);
_xscale = Math.abs(_xscale);
break;
case WALK_FRONT_RIGHT :
if (_local3 < 0.65) {
m_fState = _local2;
return(undefined);
}
playAnimation("STATE_ANIMATION", (40 * m_fSpeed) / 100, 1, 10, true, 1);
_xscale = -Math.abs(_xscale);
break;
case WALK_REAR_LEFT :
if (_local3 < 0.65) {
m_fState = _local2;
return(undefined);
}
playAnimation("STATE_ANIMATION", (40 * m_fSpeed) / 100, 11, 20, true, 1);
_xscale = Math.abs(_xscale);
break;
case WALK_REAR_RIGHT :
if (_local3 < 0.65) {
m_fState = _local2;
return(undefined);
}
playAnimation("STATE_ANIMATION", (40 * m_fSpeed) / 100, 11, 20, true, 1);
_xscale = -Math.abs(_xscale);
break;
case FLY_LEFT :
playAnimation("STATE_ANIMATION", 40, 31, 40, true, 1);
_xscale = Math.abs(_xscale);
break;
case FLY_RIGHT :
playAnimation("STATE_ANIMATION", 40, 31, 40, true, 1);
_xscale = -Math.abs(_xscale);
break;
case SQUISHED :
stopAction("STATE_ANIMATION", false);
if (m_fSpecialness == NOT_SPECIAL) {
gotoAndStop("HeadlessSquished");
}
m_bMobile = false;
break;
case STANDING :
stopAction("STATE_ANIMATION", false);
if (m_fSpecialness != NOT_SPECIAL) {
gotoAndStop("Initial");
}
m_bMobile = false;
}
m_fLastStateChangeTime = getClipTime();
}
function getState() {
return(m_fState);
}
function isGoneFlying() {
return(m_bGoneFlying);
}
function setEnemyHead(bEnemyHead) {
m_bEnemyHead = bEnemyHead;
}
function isEnemyHead() {
return(m_bEnemyHead);
}
function onCollidedWith(kEnemy) {
playSound("sealab_flying_zombie_hit.wav");
m_bGoneFlying = true;
m_kEnemyThatSentUsFlying = kEnemy;
m_fVelocityX = kEnemy.getVelocityX();
m_fVelocityY = kEnemy.getVelocityY();
setState(FLY_RIGHT);
playAnimation("FLY_THWACK", 50, 41, 49, false, 1);
}
function onHitWithPipe(bLeft) {
if ((getState() == SQUISHED) || (m_bGoneFlying)) {
return(undefined);
}
playSound("sealab_pipe_hits_zombie.wav");
m_fPositionY = m_fPositionY - 20;
PlayerState(_global.getPlayerState()).setScore(PlayerState(_global.getPlayerState()).getScore() + m_fPointValue);
setState(SQUISHED);
playAnimation("THWACK", 20, 21, 30, false, 1);
var _local4 = _global.g_kApplication.m_kGameScreen;
var _local5 = Settings(_global.getSettings()).getSetting("ENEMY_FLY_SPEED_X");
var _local3 = Settings(_global.getSettings()).getSetting("ENEMY_FLY_SPEED_Y");
_local4.getEnemyManager().addEnemyHead(m_fPositionX, m_fPositionY, _local4.getPlayer().getSpeed() + _local5, (bLeft ? (-_local3) : (_local3)), "s_ZombieHead" + m_fType);
}
function updateOffset() {
m_fGoalOffsetX = (Math.random() * 300) - 200;
m_fGoalOffsetY = (Math.random() * 150) - 75;
getAction("UPDATE_OFFSET").reset(getClipTime(), {m_fSPF:1 + (Math.random() * 1.5)}, false);
}
function goneFlyingUpdate() {
var _local5 = _global.g_kApplication.m_kGameScreen;
if (((m_fPositionX + _width) < _local5.getCamera().getVirtualLeftBound()) || ((m_fPositionX - _width) > _local5.getCamera().getVirtualRightBound())) {
_local5.getEnemyManager().onRequestRemoveEnemy(this);
return(undefined);
}
if (m_fPositionY < m_fWallPosition) {
m_fVelocityY = m_fVelocityY * -1;
m_fPositionY = m_fWallPosition;
}
if (_local5.getPlayer().isMoving()) {
var _local7 = getBounds(_parent);
if ((((_local7.xMin <= 600) && (_local7.xMin >= 0)) && (_local7.yMin <= 400)) && (_local7.yMin >= 0)) {
var _local4 = 0;
while (_local4 < _local5.getEnemyManager().getNumberEnemies()) {
var _local3 = _local5.getEnemyManager().getEnemyAtIndex(_local4);
if (((_local3 == this) || (_local3.isGoneFlying())) || (_local3.getState() == SQUISHED)) {
} else {
var _local6 = _global.LRG.Utils.Vector2D.magnitude(m_fPositionX - _local3.m_fPositionX, m_fPositionY - _local3.m_fPositionY);
if (_local6 <= (m_fRadius + _local3.getRadius())) {
_local3.onCollidedWith(this);
m_fVelocityY = m_fVelocityY * -1;
m_fNumZombiesHit++;
if (m_kEnemyThatSentUsFlying) {
m_kEnemyThatSentUsFlying.setNumZombiesHit(m_fNumZombiesHit);
}
m_pEnemiesWeSentFlying.push(_local3);
_local4 = 0;
while (_local4 < m_pEnemiesWeSentFlying.length) {
Enemy(m_pEnemiesWeSentFlying[_local4]).setNumZombiesHit(m_fNumZombiesHit);
_local4++;
}
switch (m_fNumZombiesHit) {
case 1 :
playSound("sealab_double_bash.wav");
_local5.addBonusAnimation(_x, _y, "Double", "s_BashBonus", false);
break;
case 2 :
playSound("sealab_triple_bash.wav");
_local5.addBonusAnimation(_x, _y, "Triple", "s_BashBonus", false);
break;
case 3 :
playSound("sealab_quadruple_bash.wav");
_local5.addBonusAnimation(_x, _y, "Quadruple", "s_BashBonus", false);
break;
case 4 :
playSound("sealab_quinntastic_bash.wav");
_local5.addBonusAnimation(_x, _y, "QUINTASTIC", "s_BashBonus", false);
break;
case 5 :
playSound("sealab_quinntastic_bash.wav");
_local5.addBonusAnimation(_x, _y, "OWNAGE!!", "s_BashBonus", true);
break;
default :
playSound("sealab_quinntastic_bash.wav");
_local5.addBonusAnimation(_x, _y, "FIGNUTS!!!", "s_BashBonus", true);
}
PlayerState(_global.getPlayerState()).setScore(PlayerState(_global.getPlayerState()).getScore() + (_local3.getPointValue() * (m_fNumZombiesHit + 1)));
}
}
_local4++;
}
}
}
}
function mobileUpdate(fDeltaSecs) {
var _local6 = _global.g_kApplication.m_kGameScreen;
var _local7 = m_fGoalOffsetX + _local6.getPlayer().m_fPositionX;
var _local3 = m_fGoalOffsetY + _local6.getPlayer().m_fPositionY;
if (_local3 < m_fWallPosition) {
_local3 = m_fWallPosition;
}
var _local4 = _global.LRG.Utils.Vector2D.normalize(_local7 - m_fPositionX, _local3 - m_fPositionY);
var _local8 = _local4.x * m_fSpeed;
var _local9 = _local4.y * m_fSpeed;
var _local5 = _global.LRG.Utils.Vector2D.normalize(_local8 - m_fVelocityX, _local9 - m_fVelocityY);
m_fVelocityX = m_fVelocityX + ((_local5.x * m_fAcceleration) * fDeltaSecs);
m_fVelocityY = m_fVelocityY + ((_local5.y * m_fAcceleration) * fDeltaSecs);
if (m_fVelocityX > 0) {
if (m_fVelocityY >= -4) {
setState(WALK_FRONT_RIGHT);
} else {
setState(WALK_REAR_RIGHT);
}
} else if (m_fVelocityY >= -4) {
setState(WALK_FRONT_LEFT);
} else {
setState(WALK_REAR_LEFT);
}
}
function onCollideWithPlayer(kBounds) {
var _local3 = _global.g_kApplication.m_kGameScreen;
if (m_fSpecialness != NOT_SPECIAL) {
trace("HIT PLAYER");
}
if (m_fSpecialness == NOT_SPECIAL) {
_local3.getPlayer().takeDamage();
PlayerState(_global.getPlayerState()).setScore(PlayerState(_global.getPlayerState()).getScore() + m_fPointValue);
stopAction("UPDATE_OFFSET", false);
var _local4 = Settings(_global.getSettings()).getSetting("ENEMY_FLY_SPEED");
var _local9 = (kBounds.xMin + kBounds.xMax) / 2;
var _local8 = (kBounds.yMin + kBounds.yMax) / 2;
var _local10 = kBounds.xMax - kBounds.xMin;
var _local11 = kBounds.yMax - kBounds.yMin;
if (_local3.getPlayer().isFacingCamera() && ((_x > _local9) || (_y > _local8))) {
m_bGoneFlying = true;
m_fVelocityX = _local3.getPlayer().getSpeed() + _local4;
m_fVelocityY = _local4;
setState(FLY_RIGHT);
} else if (_local3.getPlayer().isFacingAwayFromCamera() && ((_x > _local9) || (_y < _local8))) {
m_bGoneFlying = true;
m_fVelocityX = _local3.getPlayer().getSpeed() + _local4;
m_fVelocityY = -_local4;
setState(FLY_RIGHT);
} else if (_x > (kBounds.xMax - (_local10 * 0.125))) {
m_bGoneFlying = true;
m_fVelocityX = _local3.getPlayer().getSpeed() + _local4;
m_fVelocityY = 0;
setState(FLY_RIGHT);
} else if (_y < _local8) {
m_bGoneFlying = true;
m_fVelocityX = -_local3.getPlayer().getSpeed();
m_fVelocityY = -_local4;
setState(FLY_LEFT);
} else if (_y >= _local8) {
m_bGoneFlying = true;
m_fVelocityX = -_local3.getPlayer().getSpeed();
m_fVelocityY = _local4;
setState(FLY_LEFT);
} else {
trace("I BET I AM JUST GONNA DISAPPEAR!!!!");
setState(SQUISHED);
}
} else if (m_fSpecialness == HESH) {
trace("Hit Hesh! Play the animation and the sound");
setState(SQUISHED);
playAnimation("SPECIAL_THWACK", 40, 11, 43, false, 1);
_global.playSound("sealab_hesh_up.wav");
} else if (m_fSpecialness == DOLPHIN_BOY) {
setState(SQUISHED);
playAnimation("SPECIAL_THWACK", 20, 11, 30, false, 1);
_global.playSound("sealab_dolphin.wav");
} else {
if (m_fSpecialness == BONUS_PRETZEL) {
PlayerState(_global.getPlayerState()).setScore(PlayerState(_global.getPlayerState()).getScore() + Settings(_global.getSettings()).getSetting("PRETZEL_POINT_VALUE"));
_local3.addBonusAnimation(_x, _y, "", "s_PretzelBonus");
_global.playSound("sealab_bonus_pretzel.wav");
_local3.getEnemyManager().onRequestRemoveEnemy(this);
return(undefined);
}
if (m_fSpecialness == COCONUT_PILE) {
setState(SQUISHED);
playAnimation("SPECIAL_THWACK", 60, 11, 20, false, 1);
_global.playSound("sealab_coconut_hit.wav");
_local3 = _global.g_kApplication.m_kGameScreen;
var _local7 = Settings(_global.getSettings()).getSetting("ENEMY_FLY_SPEED_X");
var _local6 = Settings(_global.getSettings()).getSetting("ENEMY_FLY_SPEED_Y");
m_pEnemiesWeSentFlying.push(_local3.getEnemyManager().addEnemyHead(m_fPositionX, m_fPositionY - 15, _local3.getPlayer().getSpeed() + _local7, -_local6, "s_Coconut", this));
m_pEnemiesWeSentFlying.push(_local3.getEnemyManager().addEnemyHead(m_fPositionX, m_fPositionY - 8, (_local3.getPlayer().getSpeed() + _local7) + (_local6 * 2), (-_local6) / 2, "s_Coconut", this));
m_pEnemiesWeSentFlying.push(_local3.getEnemyManager().addEnemyHead(m_fPositionX, m_fPositionY + 8, (_local3.getPlayer().getSpeed() + _local7) + (_local6 * 2), _local6 / 2, "s_Coconut", this));
m_pEnemiesWeSentFlying.push(_local3.getEnemyManager().addEnemyHead(m_fPositionX, m_fPositionY + 10, _local3.getPlayer().getSpeed() + _local7, _local6, "s_Coconut", this));
}
}
}
function doEnterFrame() {
if (ApplicationState(_global.getApplicationState()).isPaused()) {
return(undefined);
}
var _local3 = _global.g_kApplication.m_kGameScreen;
if ((getState() == SQUISHED) && (m_fSpecialness != HESH)) {
if ((m_fPositionX + _width) < _local3.getCamera().getVirtualLeftBound()) {
_local3.getEnemyManager().onRequestRemoveEnemy(this);
}
return(undefined);
}
if ((m_fPositionX + _width) < (_local3.getCamera().getVirtualLeftBound() + 50)) {
if ((m_fSpecialness == HESH) && (getState() == SQUISHED)) {
return(undefined);
}
_local3.getEnemyManager().onRequestRemoveEnemy(this);
return(undefined);
}
var _local5 = getClipTime() - m_fLastUpdateTime;
if (m_bGoneFlying) {
goneFlyingUpdate();
} else if (m_bMobile) {
mobileUpdate(_local5);
}
if (m_bMobile) {
m_fPositionX = m_fPositionX + (m_fVelocityX * _local5);
m_fPositionY = m_fPositionY + (m_fVelocityY * _local5);
if (!m_bGoneFlying) {
if (m_fPositionY < m_fWallPosition) {
m_fPositionY = m_fWallPosition;
}
}
}
if (!m_bGoneFlying) {
if (_local3.getPlayer().getSpeed() > 0) {
if (m_fState != SQUISHED) {
var _local4 = _local3.getPlayer().m_kCollision.getBounds(_parent);
if ((((_x >= _local4.xMin) && (_x <= _local4.xMax)) && (_y >= _local4.yMin)) && (_y <= _local4.yMax)) {
onCollideWithPlayer(_local4);
}
}
}
}
m_fLastUpdateTime = getClipTime();
}
function onActionCompleted(sActionKey) {
if (sActionKey == "FLY_THWACK") {
setState(FLY_RIGHT);
} else if (sActionKey == "SPECIAL_THWACK") {
trace("SPECIAL ACTION COMPLETE");
_global.debug("SPECIAL COMPLETE");
var _local3 = _global.g_kApplication.m_kGameScreen;
if (m_fSpecialness == COCONUT_PILE) {
_local3.getEnemyManager().onRequestRemoveEnemy(this);
return(undefined);
}
if (m_fSpecialness == HESH) {
_local3.getPlayer().onHitHesh();
trace("Hit hesh. Player: kGameScreen.getPlayer()");
_local3.getEnemyManager().onRequestRemoveEnemy(this);
return(undefined);
}
}
}
static var WALK_FRONT_LEFT = 0;
static var WALK_FRONT_RIGHT = 1;
static var WALK_REAR_LEFT = 2;
static var WALK_REAR_RIGHT = 3;
static var FLY_LEFT = 4;
static var FLY_RIGHT = 5;
static var SQUISHED = 6;
static var STANDING = 7;
static var NOT_SPECIAL = 0;
static var HESH = 1;
static var DOLPHIN_BOY = 2;
static var BONUS_PRETZEL = 3;
static var COCONUT_PILE = 4;
}
Symbol 447 MovieClip [__Packages.LRG.LRGAnimationAction] Frame 0
class LRG.LRGAnimationAction extends LRG.LRGAction
{
var m_sActionType, m_pFrameList, m_sName, m_fDirection, m_fCurrentFrameIndex, m_bIsLooping, m_fFPS;
function LRGAnimationAction (kAnimationParams) {
super();
init(kAnimationParams);
}
function init(kAnimationParams) {
if ((kAnimationParams.m_sType == undefined) && ((m_sActionType == undefined) || (m_sActionType == "DEFAULT"))) {
kAnimationParams.m_sType = "FRAME_ANIMATION";
}
super.init(kAnimationParams);
if ((kAnimationParams.m_fStartFrame != undefined) && (kAnimationParams.m_fEndFrame != undefined)) {
if (m_pFrameList == undefined) {
m_pFrameList = new Array();
}
m_pFrameList.splice(0);
var _local3 = kAnimationParams.m_fStartFrame;
while (_local3 <= kAnimationParams.m_fEndFrame) {
m_pFrameList.push(_local3);
_local3++;
}
} else if (kAnimationParams.m_pFrameList != undefined) {
delete m_pFrameList;
m_pFrameList = kAnimationParams.m_pFrameList.slice(0);
} else if (m_pFrameList == undefined) {
trace(("Animation action " + m_sName) + " specified with no frame list.");
}
if (kAnimationParams.m_fDirection != undefined) {
m_fDirection = kAnimationParams.m_fDirection;
} else if (m_fDirection == undefined) {
m_fDirection = 1;
}
m_fCurrentFrameIndex = 0;
if (kAnimationParams.m_bLoop != undefined) {
m_bIsLooping = kAnimationParams.m_bLoop;
} else if (m_bIsLooping == undefined) {
m_bIsLooping = false;
}
}
function reset(fCurrTime, kAnimationParams) {
super.reset(fCurrTime, kAnimationParams);
if (m_fDirection > 0) {
m_fCurrentFrameIndex = 0;
} else {
m_fCurrentFrameIndex = m_pFrameList.length - 1;
}
}
function doUpdate(fCurrTime, fDeltaTimeSecs, kClip) {
var _local3 = fDeltaTimeSecs * m_fFPS;
m_fCurrentFrameIndex = m_fCurrentFrameIndex + (m_fDirection * _local3);
var _local4 = Math.round(m_fCurrentFrameIndex);
if (_local4 < m_pFrameList.length) {
var _local2 = m_pFrameList[Math.round(m_fCurrentFrameIndex)];
} else {
var _local2 = m_pFrameList[m_pFrameList.length - 1];
}
kClip.gotoAndStop(_local2);
if (!m_bIsLooping) {
if ((m_fCurrentFrameIndex < 0) || (m_fCurrentFrameIndex >= m_pFrameList.length)) {
return(true);
}
} else if (m_fCurrentFrameIndex < 0) {
m_fCurrentFrameIndex = m_pFrameList.length - 1;
} else if (m_fCurrentFrameIndex >= m_pFrameList.length) {
m_fCurrentFrameIndex = 0;
}
return(false);
}
}
Symbol 448 MovieClip [__Packages.PlayGui] Frame 0
class PlayGui extends LRG.LRGMovieClip
{
var m_kMuteButtonHolder, m_kScoreIndicator, m_kHealthIndicator;
function PlayGui () {
super();
}
function init() {
super.init();
}
function onShow() {
updateMuteButton();
}
function updateMuteButton() {
if (_global.LRG.LRGMusic.m_bMuted) {
m_kMuteButtonHolder.gotoAndStop("SoundOff");
} else {
m_kMuteButtonHolder.gotoAndStop("SoundOn");
}
m_kMuteButtonHolder.m_kMusicIsOn.onRelease = function () {
_global.LRG.LRGMusic.muteMusic(true);
this._parent._parent.updateMuteButton();
};
m_kMuteButtonHolder.m_kMusicIsOff.onRelease = function () {
_global.LRG.LRGMusic.muteMusic(false);
this._parent._parent.updateMuteButton();
};
}
function setScore(fScore) {
m_kScoreIndicator.m_kText.text = "" + fScore;
}
function setHealth(fHealth) {
m_kHealthIndicator.m_kText.text = "" + fHealth;
}
}
Symbol 449 MovieClip [__Packages.PowerUp] Frame 0
class PowerUp extends Object2D
{
var setClock, addAction, m_kCollision, startAction, _parent;
function PowerUp () {
super();
}
function init() {
super.init();
setClock(_global.getGameTimer());
var _local4 = new Object();
_local4.m_sName = "GENERIC";
_local4.m_fFPS = 120;
var _local5 = new LRG.LRGGenericAction(_local4);
addAction(_local5);
}
function onAdd() {
super.onAdd();
if (Settings(_global.getSettings()).getSetting("HIDE_BOUNDARIES")) {
m_kCollision._visible = false;
}
startAction("GENERIC", null, true);
}
function doEnterFrame() {
if (ApplicationState(_global.getApplicationState()).isPaused()) {
return(undefined);
}
var _local5 = _global.g_kApplication.m_kGameScreen;
var _local3 = _local5.getPlayer().m_kCollision.getBounds(_parent);
var _local4 = m_kCollision.getBounds(_parent);
if (!((((_local3.yMax < _local4.yMin) || (_local3.yMin > _local4.yMax)) || (_local3.xMax < _local4.xMin)) || (_local3.xMin > _local3.mMax))) {
PlayerState(_global.getPlayerState()).setHealth(PlayerState(_global.getPlayerState()).getHealth() + Settings(_global.getSettings()).getSetting("BATTERY_VALUE"));
if (PlayerState(_global.getPlayerState()).getHealth() > 100) {
PlayerState(_global.getPlayerState()).setHealth(100);
}
_local5.getBackgroundElementManager().onRequestRemoveBackgroundElement(this);
}
}
}
Symbol 450 MovieClip [__Packages.LRG.Utils.FPSDisplay] Frame 0
class LRG.Utils.FPSDisplay extends MovieClip
{
var m_fUpdatePeriod, m_fNumUpdates, m_fTotalFramesTime, m_fLastTime, m_fLastUpdateTime, onEnterFrame, m_kTimeDisplay;
function FPSDisplay () {
super();
init();
}
function init() {
m_fUpdatePeriod = 250;
m_fNumUpdates = 0;
m_fTotalFramesTime = 0;
m_fLastTime = getTimer();
m_fLastUpdateTime = getTimer();
onEnterFrame = updateFPS;
}
function updateFPS() {
m_fNumUpdates++;
var _local2 = getTimer();
m_fTotalFramesTime = m_fTotalFramesTime + (_local2 - m_fLastTime);
m_fLastTime = _local2;
if ((_local2 - m_fLastUpdateTime) > m_fUpdatePeriod) {
m_fLastUpdateTime = _local2;
var _local3 = m_fTotalFramesTime / m_fNumUpdates;
var _local4 = 1000 / _local3;
m_fNumUpdates = 0;
m_fTotalFramesTime = 0;
m_kTimeDisplay.text = "fps: " + Math.floor(_local4);
}
}
}
Symbol 451 MovieClip [__Packages.HelpPanel] Frame 0
class HelpPanel extends LRG.LRGMovieClip
{
var m_kBackground, m_kOkButton;
function HelpPanel () {
super();
}
function init() {
super.init();
}
function onShow() {
_global.getApplicationState().setPaused(true);
m_kBackground.onPress = function () {
};
m_kBackground.onRelease = function () {
};
m_kBackground.useHandCursor = false;
m_kOkButton.onRelease = function () {
_global.playSound("sealab_button.wav", 1, _global.g_kApplication);
this.onKeyUp = undefined;
Key.removeListener(this);
_global.g_kApplication.m_kGui.m_kHelpPanel.gotoAndStop("Hide");
_global.g_kApplication.m_kGui.m_kHelpPanel._visible = false;
if (_global.getApplicationState().isCurrentState(_global.getApplicationState().AS_PRE_GAME)) {
_global.g_kApplication.m_kGameScreen.startGame();
} else {
_global.g_kApplication.m_kGameScreen.startGame();
}
};
Key.addListener(m_kOkButton);
m_kOkButton.onKeyUp = function () {
if (Key.getCode() == 13) {
this.onRelease();
}
};
}
}
Symbol 452 MovieClip [__Packages.SplashScreen] Frame 0
class SplashScreen extends LRG.LRGMovieClip
{
var m_kBackground, m_kStartButton;
function SplashScreen () {
super();
}
function init() {
super.init();
}
function onShow() {
_global.LRG.LRGMusic.startMusic(["sealab_game_music1.wav"]);
m_kBackground.onPress = function () {
};
m_kBackground.onRelease = function () {
};
m_kBackground.useHandCursor = false;
m_kStartButton.onEnterFrame = function () {
this.onEnterFrame = undefined;
this.playAnimation("ANIMATE", 30, 1, 45, true, 1);
};
m_kStartButton._xscale = 126.4;
m_kStartButton._yscale = 126.4;
m_kStartButton.onDragOut = function () {
this._xscale = (this._yscale = 126.4);
};
m_kStartButton.onDragOver = function () {
this._xscale = (this._yscale = 115.3);
};
m_kStartButton.onPress = function () {
this._xscale = (this._yscale = 115.5);
};
m_kStartButton.onReleaseOutside = function () {
this._xscale = (this._yscale = 126.4);
};
m_kStartButton.onRollOut = function () {
this._xscale = (this._yscale = 126.4);
};
m_kStartButton.onRollOver = function () {
this._xscale = (this._yscale = 132.3);
};
m_kStartButton.onRelease = function () {
_global.playSound("sealab_button.wav", 1, _global.g_kApplication);
this.onKeyUp = undefined;
Key.removeListener(this);
_global.g_kApplication.m_kGui.m_kSplashScreen.gotoAndStop("Hide");
_global.g_kApplication.m_kGui.m_kSplashScreen._visible = false;
_global.g_kApplication.m_kGui.m_kHelpPanel.gotoAndStop("Show");
_global.g_kApplication.m_kGui.m_kHelpPanel._visible = true;
_global.g_kApplication.m_kGui.m_kHelpPanel.onShow();
};
Key.addListener(m_kStartButton);
m_kStartButton.onKeyUp = function () {
if (Key.getCode() == 13) {
this.onRelease();
}
};
}
}