Frame 1
function checkAutoUpdaterLoad() {
if (autoUpdater_mc.startUpdate.toString() == "[type Function]") {
clearInterval(checkLoadedInterval);
autoUpdaterLoadComplete();
}
}
function autoUpdaterLoadComplete() {
_root.autoUpdater_mc._visible = true;
autoUpdater_mc.redirectURL = _root.MMredirectURL;
autoUpdater_mc.MMplayerType = _root.MMplayerType;
autoUpdater_mc.MMdoctitle = _root.MMdoctitle;
autoUpdater_mc.startUpdate();
}
function installStatus(statusValue) {
_root.out_txt.text = _root.out_txt.text + "installStatus(statusValue), ";
if (statusValue == "Download.Complete") {
_root.autoUpdater_mc._visible = false;
clearInterval(autoPlacementInterval);
} else if (statusValue == "Download.Cancelled") {
_root.autoUpdater_mc._visible = false;
clearInterval(autoPlacementInterval);
} else if (statusValue == "Download.Failed") {
_root.autoUpdater_mc._visible = false;
clearInterval(autoPlacementInterval);
}
}
function centreAutoUpdater() {
autoUpdater_mc._x = 0.5 * (Stage.width - autoUpdater_mc._width);
autoUpdater_mc._y = 0.5 * (Stage.height - autoUpdater_mc._height);
}
if (_root.basepath == undefined) {
_root.basepath = "";
}
if (_root.skipintro == undefined) {
_root.skipintro = false;
}
uk.kerb.tracking.DoubleQuick.init(_root, 6);
stop();
if (_root.playerOK || (_root.playerOK == undefined)) {
_root.autoUpdater_mc._visible = false;
_root.onEnterFrame = function () {
if (_root._framesloaded >= 2) {
_root.gotoAndStop(2);
delete _root.onEnterFrame;
}
};
} else {
System.security.allowDomain("fpdownload.macromedia.com");
var cacheBuster = new Date().getTime();
var updateSWF = ("http://fpdownload.macromedia.com/pub/flashplayer/update/current/swf/autoUpdater.swf?" + cacheBuster);
var checkLoadedInterval = setInterval(this, "checkAutoUpdaterLoad", 10);
var autoPlacementInterval = setInterval(this, "centreAutoUpdater", 10);
_root.autoUpdater_mc._visible = false;
_root.autoUpdater_mc.loadMovie(updateSWF);
}
Frame 2
stop();
var introAnimationDone = false;
this.introAnimationComplete = function () {
introAnimationDone = true;
};
this.outroAnimationComplete = function () {
nextFrame();
};
this.preloader_mc.introAnimationComplete = uk.kerb.utils.EventDelegate.create(this, introAnimationComplete);
this.preloader_mc.outroAnimationComplete = uk.kerb.utils.EventDelegate.create(this, outroAnimationComplete);
this.onEnterFrame = function () {
var _local3 = this.getBytesLoaded();
var _local4 = this.getBytesTotal();
var _local2 = Math.round((100 * _local3) / _local4);
if ((_local2 > 0) && (_local2 <= 100)) {
if (introAnimationDone) {
_local2 = ((_local2 - 20) * 100) / 80;
var _local5 = this.preloader_mc._currentframe;
var _local6 = _local2 + 20;
if ((_local5 < _local6) || (_local2 >= 100)) {
this.preloader_mc.play();
} else {
this.preloader_mc.stop();
}
if (_local2 >= 100) {
delete this.onEnterFrame;
}
}
}
};
Frame 3
stop();
animation_mc.animationComplete = uk.kerb.utils.EventDelegate.create(this, gotoAndStop, "main");
animation_mc.gotoAndPlay(1);
Frame 4
Frame 5
uk.kerb.tracking.DoubleQuick.event(29);
Symbol 20 MovieClip [tripod] Frame 1
stop();
Symbol 635 MovieClip [__Packages.uk.kerb.tracking.DoubleQuick] Frame 0
class uk.kerb.tracking.DoubleQuick
{
static var projectId, baseurl, dq;
function DoubleQuick () {
}
static function init(_mcRef, _projectId) {
projectId = _projectId;
baseurl = _mcRef._url;
trace((("Tracking initialised with project " + projectId) + " and baseurl ") + baseurl);
var _local4 = SharedObject.getLocal(SO_NAME);
var _local2 = true;
var _local7 = new Date();
if (_local7 < _local4.data[SO_EXPIRY_PROPERTY_NAME]) {
_local2 = false;
}
if ((_local4.data[SO_SESSION_PROPERTY_NAME] == undefined) || (_local2)) {
trace("requesting new session key");
var _local3 = new LoadVars();
var resultLv = new LoadVars();
_local3.project = projectId;
resultLv.onLoad = function (success) {
if (success) {
var _local2 = SharedObject.getLocal(uk.kerb.tracking.DoubleQuick.SO_NAME);
var _local1 = resultLv.sessionkey;
if ((_local1 != "") && (_local1 != null)) {
trace("acquired session key " + _local1);
_local2.data[uk.kerb.tracking.DoubleQuick.SO_SESSION_PROPERTY_NAME] = _local1;
var _local4 = new Date().getTime();
var _local3 = new Date(_local4 + ((resultLv.timeout * 60) * 1000));
_local2.data[uk.kerb.tracking.DoubleQuick.SO_EXPIRY_PROPERTY_NAME] = _local3;
}
uk.kerb.tracking.DoubleQuick.initialisationFinished();
} else {
trace("Error connecting to server.");
}
};
_local3.sendAndLoad(TRACKER_SESSION_URL, resultLv, "GET");
} else {
initialisationFinished();
}
}
static function initialisationFinished() {
trace("Tracking initialised");
initialised = true;
var _local1 = 0;
while (_local1 < queue.length) {
event(queue[_local1]);
_local1++;
}
queue = new Array();
var _local2 = SharedObject.getLocal(SO_NAME);
tickerURL = (((TICKER_URL + "?project=") + projectId) + "&session=") + _local2.data[SO_SESSION_PROPERTY_NAME];
dq = new uk.kerb.tracking.DoubleQuick();
dq.startTimer();
}
static function event(watchId) {
if (!initialised) {
trace("Queueing event " + watchId);
queue.push(watchId);
} else {
var _local2 = new LoadVars();
trace("Tracking event " + watchId);
_local2.load(generateURL(watchId));
}
}
static function ping() {
if (tickerURL != null) {
var _local1 = new LoadVars();
trace("Tracking ticker");
_local1.load(tickerURL);
}
}
static function click(watchId) {
trace("Tracking clickThrough " + watchId);
getURL (generateURL(watchId), "_blank");
}
static function generateURL(watchId) {
var _local1 = SharedObject.getLocal(SO_NAME);
return((((((((TRACKER_URL + "?watch=") + watchId) + "&project=") + projectId) + "&session=") + _local1.data[SO_SESSION_PROPERTY_NAME]) + "&baseurl=") + escape(baseurl));
}
function startTimer() {
setInterval(this, "pingProxy", TICKER_PERIOD);
}
function pingProxy() {
ping();
}
static var TRACKER_URL = "http://doublequick.kerb.co.uk/tracking/trackflash.htm";
static var TRACKER_SESSION_URL = "http://doublequick.kerb.co.uk/tracking/session.htm";
static var TICKER_URL = "http://doublequick.kerb.co.uk/tracking/ticker.htm";
static var TICKER_PERIOD = 30000;
static var SO_NAME = "doublequick";
static var SO_SESSION_PROPERTY_NAME = "sessionkey";
static var SO_EXPIRY_PROPERTY_NAME = "expo";
static var initialised = false;
static var queue = new Array();
static var tickerURL = null;
}
Symbol 636 MovieClip [__Packages.uk.kerb.utils.EventDelegate] Frame 0
class uk.kerb.utils.EventDelegate
{
function EventDelegate () {
}
static function create(scope, method) {
var params = arguments.splice(2, arguments.length - 2);
var _local2 = function () {
return(method.apply(scope, arguments.concat(params)));
};
return(_local2);
}
}
Symbol 637 MovieClip [__Packages.main.Main] Frame 0
class main.Main
{
var mc, sm, sections, sectionsHistory, keyBindings, currSection, inTransition, hideCurrSection, playNextIntro, nextSection, lastKeyDown;
function Main () {
}
static function getInstance() {
if (instance == null) {
instance = new main.Main();
}
return(instance);
}
function init(mc) {
var _local4;
var _local3;
var _local6;
this.mc = mc;
sm = new uk.kerb.utils.sound.SoundManager(mc);
_root.sm = sm;
sm.loadSoundList(["*intro_music", "*game1_music", "*game2_music", "*game3_music", "*game4_music", "*game5_music", "dadadaaaa_snd", "heatray_snd", "ufo_snd", "killtripod_snd", "killufo_snd", "humandie_1_snd", "humandie_2_snd", "apetureopen_snd", "apetureclose_snd", "thud_snd", "ulla_snd", "button_snd", "firebullet_snd", "firemissile_snd", "missileexplode_snd", "whirr_snd"]);
sections = new Array();
sectionsHistory = new Array();
sections[SECTION_INTRO] = new main.Intro(mc.intro_mc, sm);
sections[SECTION_INSTRUCTIONS] = new main.Instructions(mc.instructions_mc, sm);
sections[SECTION_GAME] = new game.Game(mc.game_mc, sm);
sections[SECTION_NEXTLEVEL] = new main.NextLevel(mc.nextlevel_mc, sm);
sections[SECTION_GAMEOVER] = new main.GameOver(mc.gameover_mc, sm);
sections[SECTION_GAMEFINISHED] = new main.GameFinished(mc.gamefinished_mc, sm);
_local4 = 0;
while (_local4 < sections.length) {
_local3 = sections[_local4];
_local3.addEventListener("onChangeSection", this);
_local3.addEventListener("onSectionIntroComplete", this);
_local3.addEventListener("onSectionOutroComplete", this);
_local3.addEventListener("onSetKeyBinding", this);
_local4++;
}
Key.addListener(this);
keyBindings = new Array();
_local6 = new ContextMenu();
_local6.hideBuiltInItems();
_local6.customItems.push(new ContextMenuItem("Built by Kerb", uk.kerb.utils.EventDelegate.create(this, onContextMenuSelect, 0)));
_root.menu = _local6;
if (_root.skipintro) {
currSection = sections[SECTION_GAME];
currSection.show();
currSection.playIntro();
onSectionIntroComplete();
} else {
currSection = sections[SECTION_INTRO];
currSection.show();
currSection.playIntro();
inTransition = true;
}
}
function getSoundManager() {
return(sm);
}
function dispose() {
var _local3;
var _local2;
Key.removeListener(this);
_local3 = 0;
while (_local3 < sections.length) {
_local2 = sections[_local3];
_local2.removeEventListener("onChangeSection", this);
_local2.removeEventListener("onSectionIntroComplete", this);
_local2.removeEventListener("onSectionOutroComplete", this);
_local2.removeEventListener("onSetKeyBinding", this);
_local3++;
}
game.Game(sections[SECTION_GAME]).dispose();
}
function onChangeSection(se) {
var _local2;
if (!inTransition) {
_local2 = se.nextSectionID;
hideCurrSection = se.hideCurrSection;
playNextIntro = se.playIntro;
keyBindings = new Array();
if (_local2 == SECTION_PREVIOUS) {
nextSection = main.ISection(sectionsHistory.pop());
} else {
nextSection = sections[_local2];
sectionsHistory.push(currSection);
}
if (nextSection != undefined) {
inTransition = true;
if (se.playOutro) {
currSection.playOutro();
} else {
onSectionOutroComplete();
}
}
}
}
function onSectionIntroComplete() {
currSection.init();
inTransition = false;
}
function onSectionOutroComplete() {
if (hideCurrSection) {
currSection.hide();
}
currSection = nextSection;
nextSection = null;
currSection.show();
if (playNextIntro) {
currSection.playIntro();
} else {
onSectionIntroComplete();
}
}
function onSetKeyBinding(keyBindingObject) {
keyBindings.push(keyBindingObject);
}
function onKeyDown() {
var _local2;
var _local3;
var _local4;
if (!inTransition) {
_local2 = 0;
while (_local2 < keyBindings.length) {
_local3 = keyBindings[_local2].key;
_local4 = keyBindings[_local2].action;
if (Key.isDown(_local3) && (_local3 != lastKeyDown)) {
_local4();
break;
}
_local2++;
}
}
lastKeyDown = Key.getCode();
}
function onKeyUp() {
lastKeyDown = null;
}
function onContextMenuSelect(context, menuItem, itemPosition) {
if (!(itemPosition === 0)) {
} else {
getURL (URL_KERB, "_blank");
}
}
static var URL_KERB = "http://www.kerb.co.uk/";
static var SECTION_PREVIOUS = 0;
static var SECTION_INTRO = 1;
static var SECTION_INSTRUCTIONS = 2;
static var SECTION_GAME = 3;
static var SECTION_NEXTLEVEL = 4;
static var SECTION_GAMEOVER = 5;
static var SECTION_GAMEFINISHED = 6;
static var GAME_LEVEL = 1;
static var instance = null;
}
Symbol 638 MovieClip [__Packages.uk.kerb.utils.sound.SoundManager] Frame 0
class uk.kerb.utils.sound.SoundManager
{
var mcRef, soundList, preloaderList, soundOnFlag, musicOnFlag, allSoundsLoaded, soundLoadStarted;
function SoundManager (_mcRef) {
mcRef = _mcRef;
soundList = new Array();
preloaderList = new Array();
soundOnFlag = true;
musicOnFlag = true;
}
function loadSoundList(_soundlist) {
var _local8 = false;
var _local7;
var _local4;
var _local6;
var _local3;
_local3 = 0;
while (_local3 < _soundlist.length) {
var _local2 = _soundlist[_local3];
if (_soundlist[_local3].toLowerCase().indexOf(".mp3") > -1) {
preloaderList.push(_soundlist[_local3]);
_local8 = true;
} else {
_local6 = mcRef.getNextHighestDepth();
_local7 = mcRef.createEmptyMovieClip("sounddummy" + _local6, _local6);
_local4 = new uk.kerb.utils.sound.ExtendedSound(_local7);
if (_local2.charAt(0) == "*") {
_local4.attachSound(_local2.substr(1));
soundList[_local2] = _local4;
} else {
_local4.attachSound(_local2);
soundList[_local2] = _local4;
}
}
_local3++;
}
if (_local8) {
preloadNextMP3();
} else {
allSoundsLoaded(true);
}
}
function playSound(_id, _volume, _loops, _fadeSpeedSeconds, _panPosition) {
soundList[_id].start(0, _loops);
if ((_fadeSpeedSeconds != undefined) && (_fadeSpeedSeconds != 0)) {
soundList[_id].setVolume(0);
soundList[_id].startFade(_volume, _fadeSpeedSeconds);
} else {
soundList[_id].setVolume(_volume);
}
soundList[_id].setPan(_panPosition);
}
function setSoundComplete(_id, foo) {
soundList[_id].onSoundComplete = foo;
}
function stopSound(_id, _fadeSpeedSeconds) {
if ((_fadeSpeedSeconds != undefined) && (_fadeSpeedSeconds != 0)) {
soundList[_id].startFade(0, _fadeSpeedSeconds);
} else {
soundList[_id].stop();
}
}
function stopEverySound(_fadeSpeedSeconds, _excludeIdList) {
var _local3;
var _local2;
for (_local2 in soundList) {
if (!checkIfExcluded(_local2, _excludeIdList)) {
_local3 = soundList[_local2];
if ((_fadeSpeedSeconds != undefined) && (_fadeSpeedSeconds != 0)) {
_local3.startFade(0, _fadeSpeedSeconds);
} else {
_local3.stop();
}
}
}
}
function soundOff() {
var _local2;
for (_local2 in soundList) {
if (_local2.charAt(0) != "*") {
soundList[_local2].setMute(true);
}
}
soundOnFlag = false;
}
function soundOn() {
var _local2;
for (_local2 in soundList) {
if (_local2.charAt(0) != "*") {
soundList[_local2].setMute(false);
}
}
soundOnFlag = true;
}
function musicOff() {
var _local2;
for (_local2 in soundList) {
if (_local2.charAt(0) == "*") {
soundList[_local2].setMute(true);
}
}
musicOnFlag = false;
}
function musicOn() {
var _local2;
for (_local2 in soundList) {
if (_local2.charAt(0) == "*") {
soundList[_local2].setMute(false);
}
}
musicOnFlag = true;
}
function isSoundOn() {
return(soundOnFlag);
}
function isMusicOn() {
return(musicOnFlag);
}
function fadeSound(_id, _targetVolume, _fadeSpeedSeconds, _easing) {
soundList[_id].startFade(_targetVolume, _fadeSpeedSeconds, _easing);
}
function panSound(_id, _targetPosition, _panSpeedSeconds, _easing) {
soundList[_id].startPan(_targetPosition, _panSpeedSeconds, _easing);
}
function fadeInRandomSound(_sounds, _fadeSpeedSeconds) {
var _local6 = 0;
var _local2;
_local2 = 0;
while (_local2 < _sounds.length) {
_local6 = _local6 + _sounds[_local2].freqency;
_local2++;
}
var _local5 = 0;
_local2 = 0;
while (_local2 < _sounds.length) {
_local5 = _local5 + (_sounds[_local2].freqency / _local6);
_sounds[_local2].chance = _local5;
_local2++;
}
var _local4 = Math.random();
var _local7 = 0;
_local2 = 1;
while (_local2 < _sounds.length) {
if ((_local4 > _sounds[_local2 - 1].chance) && (_local4 <= _sounds[_local2].chance)) {
_local7 = _local2;
}
_local2++;
}
var _local8 = _sounds[_local7].level.split("-");
var _local9 = (Math.random() * (Number(_local8[1]) - Number(_local8[0]))) + Number(_local8[0]);
playSound(_sounds[_local7].id, _local9, 1, _fadeSpeedSeconds);
}
function checkIfExcluded(_excludeId, _excludeIdList) {
var _local1;
_local1 = 0;
while (_local1 < _excludeIdList.length) {
if (_excludeIdList[_local1] == _excludeId) {
return(true);
}
_local1++;
}
return(false);
}
function preloadNextMP3() {
var _local8 = this;
var _local5 = mcRef.getNextHighestDepth();
if (preloaderList.length > 0) {
var _local2 = preloaderList.shift();
if (soundLoadStarted != undefined) {
soundLoadStarted(_local2);
}
var _local7 = mcRef.createEmptyMovieClip("sounddummy" + _local5, _local5);
var _local3 = new uk.kerb.utils.sound.ExtendedSound(_local7);
if (_local2.charAt(0) == "*") {
_local3.loadSound(_local2.substr(1));
var _local6 = _local2.split("/");
var _local4 = "*" + _local6[_local6.length - 1].slice(0, -4);
soundList[_local4] = _local3;
soundList[_local4].onLoad = uk.kerb.utils.EventDelegate.create(this, preloadNextMP3);
} else {
_local3.loadSound(_local2);
var _local6 = _local2.split("/");
var _local4 = _local6[_local6.length - 1].slice(0, -4);
soundList[_local4] = _local3;
soundList[_local4].onLoad = uk.kerb.utils.EventDelegate.create(this, preloadNextMP3);
}
} else {
allSoundsLoaded(true);
}
}
}
Symbol 639 MovieClip [__Packages.uk.kerb.utils.sound.ExtendedSound] Frame 0
class uk.kerb.utils.sound.ExtendedSound extends Sound
{
var mcRef, mute, fade, onFadeComplete, volume, sweep, onSweepComplete, pan;
function ExtendedSound (_mcRef) {
super((mcRef = _mcRef));
mute = 1;
setVolume(masterVolume);
setPan(0);
}
function startFade(_targetVolume, _duration, _easing) {
_targetVolume = inBounds(_targetVolume, 0, 100, masterVolume);
_duration = inBounds(_duration, 0, Number.MAX_VALUE, 0.5);
if (_easing == undefined) {
_easing = mx.transitions.easing.None.easeNone;
}
fade = new mx.transitions.Tween(this, "volume", _easing, getVolume(), _targetVolume, _duration, true);
fade.onMotionChanged = uk.kerb.utils.EventDelegate.create(this, setFadeVolume);
fade.onMotionFinished = uk.kerb.utils.EventDelegate.create(this, onFadeComplete);
return(this);
}
function setFadeVolume(_tw) {
setVolume(volume);
}
function startPan(_targetPosition, _duration, _easing) {
_targetPosition = inBounds(_targetPosition, -100, 100, 0);
_duration = inBounds(_duration, 0, Number.MAX_VALUE, 0.5);
if (_easing == undefined) {
_easing = mx.transitions.easing.None.easeNone;
}
sweep = new mx.transitions.Tween(this, "pan", _easing, getPan(), _targetPosition, _duration, true);
sweep.onMotionChanged = uk.kerb.utils.EventDelegate.create(this, setPanPosition);
sweep.onMotionFinished = uk.kerb.utils.EventDelegate.create(this, onSweepComplete);
return(this);
}
function setPanPosition(_tw) {
setPan(pan);
}
function attachSound(_libraryID) {
stop();
super.attachSound(_libraryID);
return(this);
}
function loadSound(_mp3URL) {
stop();
super.loadSound(_mp3URL, false);
return(this);
}
function start(_offset, _loops) {
_offset = inBounds(_offset, 0, super.duration, 0);
_loops = inBounds(_loops, 1, Number.MAX_VALUE, 1);
stop();
super.start(_offset, _loops);
return(this);
}
function stop() {
super.stop();
return(this);
}
function setVolume(_volume) {
volume = inBounds(_volume, 0, 100, masterVolume);
super.setVolume(((volume / 100) * masterVolume) * mute);
return(this);
}
function getVolume() {
return(volume);
}
function setPan(_pan) {
pan = inBounds(_pan, -100, 100, 0);
super.setPan(pan);
return(this);
}
function getPan() {
return(pan);
}
function setMute(_bool) {
mute = (_bool ? 0 : 1);
setVolume(getVolume());
return(this);
}
function inBounds(_value, _min, _max, _default) {
if (_value == undefined) {
_value = _default;
}
if (_value < _min) {
_value = _min;
}
if (_value > _max) {
_value = _max;
}
return(_value);
}
static var masterVolume = 100;
}
Symbol 640 MovieClip [__Packages.mx.transitions.OnEnterFrameBeacon] Frame 0
class mx.transitions.OnEnterFrameBeacon
{
function OnEnterFrameBeacon () {
}
static function init() {
var _local4 = _global.MovieClip;
if (!_root.__OnEnterFrameBeacon) {
mx.transitions.BroadcasterMX.initialize(_local4);
var _local3 = _root.createEmptyMovieClip("__OnEnterFrameBeacon", 9876);
_local3.onEnterFrame = function () {
_global.MovieClip.broadcastMessage("onEnterFrame");
};
}
}
static var version = "1.1.0.52";
}
Symbol 641 MovieClip [__Packages.mx.transitions.BroadcasterMX] Frame 0
class mx.transitions.BroadcasterMX
{
var _listeners;
function BroadcasterMX () {
}
static function initialize(o, dontCreateArray) {
if (o.broadcastMessage != undefined) {
delete o.broadcastMessage;
}
o.addListener = mx.transitions.BroadcasterMX.prototype.addListener;
o.removeListener = mx.transitions.BroadcasterMX.prototype.removeListener;
if (!dontCreateArray) {
o._listeners = new Array();
}
}
function addListener(o) {
removeListener(o);
if (broadcastMessage == undefined) {
broadcastMessage = mx.transitions.BroadcasterMX.prototype.broadcastMessage;
}
return(_listeners.push(o));
}
function removeListener(o) {
var _local2 = _listeners;
var _local3 = _local2.length;
while (_local3--) {
if (_local2[_local3] == o) {
_local2.splice(_local3, 1);
if (!_local2.length) {
broadcastMessage = undefined;
}
return(true);
}
}
return(false);
}
function broadcastMessage() {
var _local5 = String(arguments.shift());
var _local4 = _listeners.concat();
var _local6 = _local4.length;
var _local3 = 0;
while (_local3 < _local6) {
_local4[_local3][_local5].apply(_local4[_local3], arguments);
_local3++;
}
}
static var version = "1.1.0.52";
}
Symbol 642 MovieClip [__Packages.mx.transitions.Tween] Frame 0
class mx.transitions.Tween
{
var obj, prop, begin, useSeconds, _listeners, addListener, prevTime, _time, looping, _duration, broadcastMessage, isPlaying, _fps, prevPos, _pos, change, _intervalID, _startTime;
function Tween (obj, prop, func, begin, finish, duration, useSeconds) {
mx.transitions.OnEnterFrameBeacon.init();
if (!arguments.length) {
return;
}
this.obj = obj;
this.prop = prop;
this.begin = begin;
position = (begin);
this.duration = (duration);
this.useSeconds = useSeconds;
if (func) {
this.func = func;
}
this.finish = (finish);
_listeners = [];
addListener(this);
start();
}
function set time(t) {
prevTime = _time;
if (t > duration) {
if (looping) {
rewind(t - _duration);
update();
broadcastMessage("onMotionLooped", this);
} else {
if (useSeconds) {
_time = _duration;
update();
}
stop();
broadcastMessage("onMotionFinished", this);
}
} else if (t < 0) {
rewind();
update();
} else {
_time = t;
update();
}
//return(time);
}
function get time() {
return(_time);
}
function set duration(d) {
_duration = (((d == null) || (d <= 0)) ? (_global.Infinity) : (d));
//return(duration);
}
function get duration() {
return(_duration);
}
function set FPS(fps) {
var _local2 = isPlaying;
stopEnterFrame();
_fps = fps;
if (_local2) {
startEnterFrame();
}
//return(FPS);
}
function get FPS() {
return(_fps);
}
function set position(p) {
setPosition(p);
//return(position);
}
function setPosition(p) {
prevPos = _pos;
obj[prop] = (_pos = p);
broadcastMessage("onMotionChanged", this, _pos);
updateAfterEvent();
}
function get position() {
return(getPosition());
}
function getPosition(t) {
if (t == undefined) {
t = _time;
}
return(func(t, begin, change, _duration));
}
function set finish(f) {
change = f - begin;
//return(finish);
}
function get finish() {
return(begin + change);
}
function continueTo(finish, duration) {
begin = position;
this.finish = (finish);
if (duration != undefined) {
this.duration = (duration);
}
start();
}
function yoyo() {
continueTo(begin, time);
}
function startEnterFrame() {
if (_fps == undefined) {
_global.MovieClip.addListener(this);
} else {
_intervalID = setInterval(this, "onEnterFrame", 1000 / _fps);
}
isPlaying = true;
}
function stopEnterFrame() {
if (_fps == undefined) {
_global.MovieClip.removeListener(this);
} else {
clearInterval(_intervalID);
}
isPlaying = false;
}
function start() {
rewind();
startEnterFrame();
broadcastMessage("onMotionStarted", this);
}
function stop() {
stopEnterFrame();
broadcastMessage("onMotionStopped", this);
}
function resume() {
fixTime();
startEnterFrame();
broadcastMessage("onMotionResumed", this);
}
function rewind(t) {
_time = ((t == undefined) ? 0 : (t));
fixTime();
update();
}
function fforward() {
time = (_duration);
fixTime();
}
function nextFrame() {
if (useSeconds) {
time = ((getTimer() - _startTime) / 1000);
} else {
time = (_time + 1);
}
}
function onEnterFrame() {
nextFrame();
}
function prevFrame() {
if (!useSeconds) {
time = (_time - 1);
}
}
function toString() {
return("[Tween]");
}
function fixTime() {
if (useSeconds) {
_startTime = getTimer() - (_time * 1000);
}
}
function update() {
position = (getPosition(_time));
}
static var version = "1.1.0.52";
static var __initBeacon = mx.transitions.OnEnterFrameBeacon.init();
static var __initBroadcaster = mx.transitions.BroadcasterMX.initialize(mx.transitions.Tween.prototype, true);
function func(t, b, c, d) {
return(((c * t) / d) + b);
}
}
Symbol 643 MovieClip [__Packages.mx.transitions.easing.None] Frame 0
class mx.transitions.easing.None
{
function None () {
}
static function easeNone(t, b, c, d) {
return(((c * t) / d) + b);
}
static function easeIn(t, b, c, d) {
return(((c * t) / d) + b);
}
static function easeOut(t, b, c, d) {
return(((c * t) / d) + b);
}
static function easeInOut(t, b, c, d) {
return(((c * t) / d) + b);
}
static var version = "1.1.0.52";
}
Symbol 644 MovieClip [__Packages.main.ISection] Frame 0
interface main.ISection
{
}
Symbol 645 MovieClip [__Packages.utils.IListenable] Frame 0
interface utils.IListenable
{
}
Symbol 646 MovieClip [__Packages.main.AbstractSection] Frame 0
class main.AbstractSection implements utils.IListenable
{
var mc, introCompleteHandler, outroCompleteHandler, active;
function AbstractSection (mc) {
this.mc = mc;
introCompleteHandler = uk.kerb.utils.EventDelegate.create(this, onIntroComplete);
outroCompleteHandler = uk.kerb.utils.EventDelegate.create(this, onOutroComplete);
mx.events.EventDispatcher.initialize(this);
active = false;
mc.gotoAndStop("hidden");
}
function onIntroComplete() {
dispatchEvent({type:"onSectionIntroComplete", target:this});
}
function onOutroComplete() {
dispatchEvent({type:"onSectionOutroComplete", target:this});
}
function show() {
if (!active) {
mc.gotoAndStop("visible");
}
}
function hide() {
if (active) {
mc.gotoAndStop("hidden");
active = false;
}
}
function dispatchEvent(eventObject) {
}
function addEventListener(event, listener) {
}
function removeEventListener(event, listener) {
}
}
Symbol 647 MovieClip [__Packages.mx.events.EventDispatcher] Frame 0
class mx.events.EventDispatcher
{
function EventDispatcher () {
}
static function _removeEventListener(queue, event, handler) {
if (queue != undefined) {
var _local4 = queue.length;
var _local1;
_local1 = 0;
while (_local1 < _local4) {
var _local2 = queue[_local1];
if (_local2 == handler) {
queue.splice(_local1, 1);
return(undefined);
}
_local1++;
}
}
}
static function initialize(object) {
if (_fEventDispatcher == undefined) {
_fEventDispatcher = new mx.events.EventDispatcher();
}
object.addEventListener = _fEventDispatcher.addEventListener;
object.removeEventListener = _fEventDispatcher.removeEventListener;
object.dispatchEvent = _fEventDispatcher.dispatchEvent;
object.dispatchQueue = _fEventDispatcher.dispatchQueue;
}
function dispatchQueue(queueObj, eventObj) {
var _local7 = "__q_" + eventObj.type;
var _local4 = queueObj[_local7];
if (_local4 != undefined) {
var _local5;
for (_local5 in _local4) {
var _local1 = _local4[_local5];
var _local3 = typeof(_local1);
if ((_local3 == "object") || (_local3 == "movieclip")) {
if (_local1.handleEvent != undefined) {
_local1.handleEvent(eventObj);
}
if (_local1[eventObj.type] != undefined) {
if (exceptions[eventObj.type] == undefined) {
_local1[eventObj.type](eventObj);
}
}
} else {
_local1.apply(queueObj, [eventObj]);
}
}
}
}
function dispatchEvent(eventObj) {
if (eventObj.target == undefined) {
eventObj.target = this;
}
this[eventObj.type + "Handler"](eventObj);
dispatchQueue(this, eventObj);
}
function addEventListener(event, handler) {
var _local3 = "__q_" + event;
if (this[_local3] == undefined) {
this[_local3] = new Array();
}
_global.ASSetPropFlags(this, _local3, 1);
_removeEventListener(this[_local3], event, handler);
this[_local3].push(handler);
}
function removeEventListener(event, handler) {
var _local2 = "__q_" + event;
_removeEventListener(this[_local2], event, handler);
}
static var _fEventDispatcher = undefined;
static var exceptions = {move:1, draw:1, load:1};
}
Symbol 648 MovieClip [__Packages.main.Intro] Frame 0
class main.Intro extends main.AbstractSection implements main.ISection
{
var sm, instructions_func, play_func, dispatchEvent, active, mc, introCompleteHandler, outroCompleteHandler;
function Intro (mc, sm) {
super(mc);
this.sm = sm;
var _local3 = new utils.SectionEvent(main.Main.SECTION_INSTRUCTIONS);
var _local4 = new utils.SectionEvent(main.Main.SECTION_GAME);
instructions_func = uk.kerb.utils.EventDelegate.create(this, buttonPressed, _local3);
play_func = uk.kerb.utils.EventDelegate.create(this, buttonPressed, _local4);
}
function buttonPressed(evt) {
sm.playSound("button_snd");
dispatchEvent(evt);
}
function init() {
if (!active) {
mc.instructions_btn.onRelease = instructions_func;
mc.play_btn.onRelease = play_func;
active = true;
}
dispatchEvent({type:"onSetKeyBinding", target:this, key:32, action:instructions_func});
}
function playIntro() {
mc.introAnimation_mc.animationComplete = introCompleteHandler;
uk.kerb.utils.SetOneInterval.create(10, uk.kerb.utils.EventDelegate.create(mc.introAnimation_mc, mc.introAnimation_mc.gotoAndPlay, 2));
mc.instructions_btn._visible = false;
mc.play_btn._visible = false;
mc.introAnimation_mc._visible = true;
mc.outroAnimation_mc._visible = false;
sm.playSound("dadadaaaa_snd");
}
function onIntroComplete() {
mc.instructions_btn._visible = true;
mc.play_btn._visible = true;
super.onIntroComplete();
}
function playOutro() {
mc.instructions_btn._visible = false;
mc.play_btn._visible = false;
mc.introAnimation_mc._visible = false;
mc.outroAnimation_mc._visible = true;
mc.outroAnimation_mc.animationComplete = outroCompleteHandler;
mc.outroAnimation_mc.gotoAndPlay(2);
sm.stopSound("dadadaaaa_snd", 2);
}
}
Symbol 649 MovieClip [__Packages.utils.SectionEvent] Frame 0
class utils.SectionEvent
{
var nextSectionID, hideCurrSection, playOutro, playIntro, type, target;
function SectionEvent (nextSectionID, hideCurrSection, playOutro, playIntro) {
this.nextSectionID = nextSectionID;
this.hideCurrSection = ((hideCurrSection == undefined) ? true : (hideCurrSection));
this.playOutro = ((playOutro == undefined) ? true : (playOutro));
this.playIntro = ((playIntro == undefined) ? true : (playIntro));
type = "onChangeSection";
target = null;
}
}
Symbol 650 MovieClip [__Packages.uk.kerb.utils.SetOneInterval] Frame 0
class uk.kerb.utils.SetOneInterval
{
var func, interval;
function SetOneInterval (duration, func) {
this.func = func;
interval = setInterval(this, "intervalCalled", duration);
intervalList.push(this);
}
static function create(duration, func) {
return((new uk.kerb.utils.SetOneInterval(duration, func)).interval);
}
static function clearAll() {
var _local1;
_local1 = 0;
while (_local1 < intervalList.length) {
intervalList[_local1].stop();
_local1++;
}
}
function stop() {
intervalCalled();
}
function intervalCalled() {
var _local2;
clearInterval(interval);
_local2 = 0;
while (_local2 < intervalList.length) {
if (intervalList[_local2] == this) {
intervalList.splice(_local2, 1);
break;
}
_local2++;
}
func();
}
static var intervalList = [];
}
Symbol 651 MovieClip [__Packages.main.Instructions] Frame 0
class main.Instructions extends main.AbstractSection implements main.ISection
{
var sm, play_func, dispatchEvent, active, mc, introCompleteHandler, outroCompleteHandler;
function Instructions (mc, sm) {
super(mc);
this.sm = sm;
var _local3 = new utils.SectionEvent(main.Main.SECTION_GAME);
play_func = uk.kerb.utils.EventDelegate.create(this, buttonPressed, _local3);
}
function buttonPressed(evt) {
sm.playSound("button_snd");
dispatchEvent(evt);
}
function init() {
if (!active) {
mc.play_btn.onRelease = play_func;
active = true;
}
dispatchEvent({type:"onSetKeyBinding", target:this, key:32, action:play_func});
}
function playIntro() {
mc.introAnimation_mc.animationComplete = introCompleteHandler;
uk.kerb.utils.SetOneInterval.create(10, uk.kerb.utils.EventDelegate.create(mc.introAnimation_mc, mc.introAnimation_mc.gotoAndPlay, 2));
mc.play_btn._visible = false;
mc.introAnimation_mc._visible = true;
mc.outroAnimation_mc._visible = false;
sm.playSound("whirr_snd", 100, 10000, 2);
sm.playSound("*intro_music", 100, 10000, 2);
}
function onIntroComplete() {
mc.play_btn._visible = true;
super.onIntroComplete();
}
function playOutro() {
mc.play_btn._visible = false;
mc.introAnimation_mc._visible = false;
mc.outroAnimation_mc._visible = true;
mc.outroAnimation_mc.animationComplete = outroCompleteHandler;
mc.outroAnimation_mc.gotoAndPlay(2);
sm.stopSound("whirr_snd", 2);
sm.stopSound("*intro_music", 2);
}
}
Symbol 652 MovieClip [__Packages.game.Game] Frame 0
class game.Game extends main.AbstractSection implements main.ISection
{
static var UFO_CHANCE, MAX_UFOS, MAX_HUMANS, UFO_MAX_DELAY, UFO_SPEED, MISSILE_SPEED, GUN_FIRING_DELAY, HUMAN_FIRING_DELAY, TRIPOD_FIRING_DELAY, GROUND_LEVEL, GAME_WIDTH;
var sm, gameOver_func, dispatchEvent, nextLevel_func, gameFinished_func, totalTime, elapsedTime, timeSinceLastUFO, ufosArrived, aliensLeft, mc, active, introCompleteHandler, outroCompleteHandler, startTime;
function Game (mc, sm) {
super(mc);
this.sm = sm;
var _local3 = new utils.SectionEvent(main.Main.SECTION_GAMEOVER);
gameOver_func = uk.kerb.utils.EventDelegate.create(this, dispatchEvent, _local3);
var _local4 = new utils.SectionEvent(main.Main.SECTION_NEXTLEVEL);
nextLevel_func = uk.kerb.utils.EventDelegate.create(this, dispatchEvent, _local4);
var _local5 = new utils.SectionEvent(main.Main.SECTION_GAMEFINISHED);
gameFinished_func = uk.kerb.utils.EventDelegate.create(this, dispatchEvent, _local5);
}
function setup() {
trace("entering level " + main.Main.GAME_LEVEL);
uk.kerb.tracking.DoubleQuick.event(LEVEL_EVENTS[main.Main.GAME_LEVEL - 1]);
totalTime = 0;
elapsedTime = 0;
timeSinceLastUFO = 0;
ufosArrived = 0;
aliensLeft = 0;
switch (main.Main.GAME_LEVEL) {
case 1 :
UFO_CHANCE = 0.01;
MAX_UFOS = 20;
MAX_HUMANS = 20;
UFO_MAX_DELAY = 200;
UFO_SPEED = 4;
MISSILE_SPEED = 5;
GUN_FIRING_DELAY = 10;
HUMAN_FIRING_DELAY = 50;
TRIPOD_FIRING_DELAY = 100;
break;
case 2 :
UFO_CHANCE = 0.02;
MAX_UFOS = 30;
MAX_HUMANS = 20;
UFO_MAX_DELAY = 150;
UFO_SPEED = 4;
MISSILE_SPEED = 5;
GUN_FIRING_DELAY = 10;
HUMAN_FIRING_DELAY = 50;
TRIPOD_FIRING_DELAY = 100;
break;
case 3 :
UFO_CHANCE = 0.04;
MAX_UFOS = 40;
MAX_HUMANS = 20;
UFO_MAX_DELAY = 100;
UFO_SPEED = 4;
MISSILE_SPEED = 5;
GUN_FIRING_DELAY = 12;
HUMAN_FIRING_DELAY = 50;
TRIPOD_FIRING_DELAY = 100;
break;
case 4 :
UFO_CHANCE = 0.06;
MAX_UFOS = 50;
MAX_HUMANS = 20;
UFO_MAX_DELAY = 100;
UFO_SPEED = 4;
MISSILE_SPEED = 5;
GUN_FIRING_DELAY = 12;
HUMAN_FIRING_DELAY = 50;
TRIPOD_FIRING_DELAY = 100;
break;
case 5 :
UFO_CHANCE = 0.08;
MAX_UFOS = 50;
MAX_HUMANS = 15;
UFO_MAX_DELAY = 80;
UFO_SPEED = 5;
MISSILE_SPEED = 5;
GUN_FIRING_DELAY = 15;
HUMAN_FIRING_DELAY = 50;
TRIPOD_FIRING_DELAY = 100;
}
aliensLeft = MAX_UFOS;
var _local2 = 0;
while (_local2 < MAX_HUMANS) {
addHuman();
_local2++;
}
mc.counter_mc.tens_mc.gotoAndStop("digit_" + Math.floor(humans.length / 10));
mc.counter_mc.ones_mc.gotoAndStop("digit_" + (humans.length % 10));
mc.martians_mc.tens_mc.gotoAndStop("digit_" + Math.floor(aliensLeft / 10));
mc.martians_mc.ones_mc.gotoAndStop("digit_" + (aliensLeft % 10));
mc.counter_mc.tens_mc.arrivedAt = uk.kerb.utils.EventDelegate.create(this, counterTensArrived);
mc.counter_mc.ones_mc.arrivedAt = uk.kerb.utils.EventDelegate.create(this, counterOnesArrived);
mc.martians_mc.tens_mc.arrivedAt = uk.kerb.utils.EventDelegate.create(this, mcounterTensArrived);
mc.martians_mc.ones_mc.arrivedAt = uk.kerb.utils.EventDelegate.create(this, mcounterOnesArrived);
mc.sound_mc.music_mc.onRelease = uk.kerb.utils.EventDelegate.create(this, musicButtonPressed);
mc.sound_mc.sfx_mc.onRelease = uk.kerb.utils.EventDelegate.create(this, soundButtonPressed);
mc.back_mc.gotoAndStop(1);
sm.playSound("ulla_snd", SFX_VOLUME);
run();
}
function soundButtonPressed() {
if (sm.isSoundOn()) {
sm.soundOff();
} else {
sm.soundOn();
}
showSoundState();
}
function musicButtonPressed() {
if (sm.isMusicOn()) {
sm.musicOff();
} else {
sm.musicOn();
}
showSoundState();
}
function showSoundState() {
mc.sound_mc.music_mc.gotoAndStop((sm.isMusicOn() ? "soundOn" : "soundOff"));
mc.sound_mc.sfx_mc.gotoAndStop((sm.isSoundOn() ? "soundOn" : "soundOff"));
}
function humanCounters() {
var _local6 = Math.floor(humans.length / 10);
var _local8 = humans.length % 10;
var _local2 = mc.counter_mc.tens_mc._currentframe - 1;
var _local3 = mc.counter_mc.ones_mc._currentframe - 1;
if ((_local2 % 10) == 0) {
var _local7 = 9 - (_local2 / 10);
if (_local7 != _local6) {
mc.counter_mc.tens_mc.play();
}
}
if ((_local3 % 10) == 0) {
var _local4 = 9 - (_local3 / 10);
if (_local4 != _local8) {
mc.counter_mc.ones_mc.play();
}
}
var _local5 = ((MAX_HUMANS - humans.length) * mc.back_mc._totalframes) / MAX_HUMANS;
if (mc.back_mc._currentframe < _local5) {
mc.back_mc.play();
} else {
mc.back_mc.stop();
}
}
function martianCounters() {
var _local5 = Math.floor(aliensLeft / 10);
var _local7 = aliensLeft % 10;
var _local2 = mc.martians_mc.tens_mc._currentframe - 1;
var _local3 = mc.martians_mc.ones_mc._currentframe - 1;
if ((_local2 % 10) == 0) {
var _local6 = 9 - (_local2 / 10);
if (_local6 != _local5) {
mc.martians_mc.tens_mc.play();
}
}
if ((_local3 % 10) == 0) {
var _local4 = 9 - (_local3 / 10);
if (_local4 != _local7) {
mc.martians_mc.ones_mc.play();
}
}
}
function counterTensArrived(num) {
var _local2 = Math.floor(humans.length / 10);
if (num == _local2) {
mc.counter_mc.tens_mc.stop();
}
}
function counterOnesArrived(num) {
var _local2 = humans.length % 10;
if (num == _local2) {
mc.counter_mc.ones_mc.stop();
}
}
function mcounterTensArrived(num) {
var _local2 = Math.floor(aliensLeft / 10);
if (num == _local2) {
mc.martians_mc.tens_mc.stop();
}
}
function mcounterOnesArrived(num) {
var _local2 = aliensLeft % 10;
if (num == _local2) {
mc.martians_mc.ones_mc.stop();
}
}
function init() {
if (!active) {
GROUND_LEVEL = mc.ground_mc._y;
GAME_WIDTH = Stage.width - (GAME_BORDER * 2);
guns = new Array(new game.GunPlacement(mc.gun1_mc), new game.ReversedGunPlacement(mc.gun2_mc));
active = true;
mc.counter_mc.tens_mc.gotoAndStop("digit_0");
mc.counter_mc.ones_mc.gotoAndStop("digit_0");
mc.martians_mc.tens_mc.gotoAndStop("digit_0");
mc.martians_mc.ones_mc.gotoAndStop("digit_0");
}
}
function playIntro() {
mc.introAnimation_mc.animationComplete = introCompleteHandler;
uk.kerb.utils.SetOneInterval.create(10, uk.kerb.utils.EventDelegate.create(this, showIntroAnimationAndRemoveCover));
mc.introAnimation_mc._visible = true;
mc.outroAnimation_mc._visible = false;
mc.counter_mc._visible = false;
mc.sound_mc._visible = false;
mc.martians_mc._visible = false;
mc.xhair_mc._visible = false;
mc.cover_mc._visible = true;
sm.playSound(("*game" + main.Main.GAME_LEVEL) + "_music", 100, 10000, 2);
}
function showIntroAnimationAndRemoveCover() {
mc.cover_mc._visible = false;
mc.introAnimation_mc.gotoAndPlay(2);
}
function onIntroComplete() {
super.onIntroComplete();
mc.counter_mc._visible = true;
mc.sound_mc._visible = true;
mc.martians_mc._visible = true;
mc.introAnimation_mc._visible = false;
mc.outroAnimation_mc._visible = false;
setup();
}
function playOutro() {
mc.introAnimation_mc._visible = false;
mc.outroAnimation_mc._visible = true;
mc.counter_mc._visible = false;
mc.sound_mc._visible = false;
mc.martians_mc._visible = false;
mc.outroAnimation_mc.animationComplete = outroCompleteHandler;
mc.outroAnimation_mc.gotoAndPlay(2);
}
function onOutroComplete() {
super.onOutroComplete();
dispose();
}
function run() {
startTime = getTimer();
mc.onEnterFrame = uk.kerb.utils.EventDelegate.create(this, update);
Mouse.hide();
mc.xhair_mc._visible = true;
Mouse.addListener(this);
onMouseMove();
}
function stopGame() {
elapsedTime = elapsedTime + (getTimer() - startTime);
delete mc.onEnterFrame;
Mouse.show();
mc.xhair_mc._visible = false;
Mouse.removeListener(this);
}
function update() {
totalTime = (getTimer() - startTime) + elapsedTime;
var _local2;
var _local3;
var _local9;
var _local11;
var _local7;
var _local6;
var _local12;
var _local5;
var _local4;
var _local10;
var _local8;
if (mc._ymouse > GROUND_LEVEL) {
Mouse.show();
mc.xhair_mc._visible = false;
} else {
Mouse.hide();
mc.xhair_mc._visible = true;
}
timeSinceLastUFO++;
if (((Math.random() < UFO_CHANCE) || (timeSinceLastUFO > UFO_MAX_DELAY)) && (ufosArrived < MAX_UFOS)) {
addUFO();
}
_local2 = missiles.length - 1;
while (_local2 >= 0) {
_local11 = missiles[_local2];
_local11.update();
if (_local11.hasArrived()) {
explodeMissile(_local11);
missiles.splice(_local2, 1);
}
_local2--;
}
_local2 = bullets.length - 1;
while (_local2 >= 0) {
_local9 = bullets[_local2];
_local9.update();
if (_local9.hasArrived()) {
explodeBullet(_local9);
bullets.splice(_local2, 1);
}
_local2--;
}
_local2 = explosions.length - 1;
while (_local2 >= 0) {
_local7 = explosions[_local2];
_local7.update();
if (_local7.hasFinished()) {
_local7.dispose();
explosions.splice(_local2, 1);
} else {
_local3 = ufos.length - 1;
while (_local3 >= 0) {
_local6 = ufos[_local3];
if (_local7.inExplosion(_local6)) {
killUFO(_local6);
ufos.splice(_local3, 1);
}
_local3--;
}
}
_local2--;
}
_local2 = guns.length - 1;
while (_local2 >= 0) {
_local12 = guns[_local2];
_local12.update();
_local2--;
}
tripodsToFire = new Array();
_local2 = tripods.length - 1;
while (_local2 >= 0) {
_local4 = tripods[_local2];
if (_local4.dead) {
tripodIsDead(_local4);
tripods.splice(_local2, 1);
} else {
_local4.update();
if (_local4.canFire()) {
tripodsToFire.push(_local4);
}
if (_local4.canBeKilled()) {
_local3 = humansToFire.length - 1;
while ((_local3 >= 0) && (_local4.canBeKilled())) {
_local5 = humansToFire[_local3];
if (_local5.canShootAt(_local4)) {
killTripod(_local5, _local4);
humansToFire.splice(_local3, 1);
}
_local3--;
}
}
}
_local2--;
}
humansToFire = new Array();
_local2 = humans.length - 1;
while (_local2 >= 0) {
_local5 = humans[_local2];
if (_local5.dead) {
humanIsDead(_local5);
humans.splice(_local2, 1);
} else {
_local5.update();
if (_local5.canFire()) {
humansToFire.push(_local5);
}
if (_local5.canBeKilled()) {
_local3 = tripodsToFire.length - 1;
while ((_local3 >= 0) && (_local5.canBeKilled())) {
_local4 = tripodsToFire[_local3];
if (_local4.canShootAt(_local5)) {
killHuman(_local4, _local5);
tripodsToFire.splice(_local3, 1);
}
_local3--;
}
}
}
_local2--;
}
humanCounters();
martianCounters();
_local2 = ufos.length - 1;
while (_local2 >= 0) {
_local6 = ufos[_local2];
_local6.update();
if (_local6.hasArrived()) {
ufoArrive(_local6);
ufos.splice(_local2, 1);
}
_local2--;
}
_local2 = tripodLasers.length - 1;
while (_local2 >= 0) {
_local10 = tripodLasers[_local2];
_local10.update();
if (_local10.hasFinished()) {
finishedKillingHuman(_local10);
tripodLasers.splice(_local2, 1);
}
_local2--;
}
_local2 = animations.length - 1;
while (_local2 >= 0) {
_local8 = animations[_local2];
_local8.update();
if (_local8.hasFinished()) {
_local8.dispose();
animations.splice(_local2, 1);
}
_local2--;
}
if (humans.length == 0) {
lose();
}
if ((((ufos.length == 0) && (tripods.length == 0)) && (animations.length == 0)) && (ufosArrived >= MAX_UFOS)) {
win();
}
}
function onMouseMove() {
var _local2 = guns.length - 1;
while (_local2 >= 0) {
guns[_local2].updateMousePosition();
_local2--;
}
mc.xhair_mc._x = mc._xmouse;
mc.xhair_mc._y = mc._ymouse;
}
function onMouseDown() {
var _local4 = mc._xmouse;
var _local2 = mc._ymouse;
if (_local2 > GROUND_LEVEL) {
return(undefined);
}
var _local3 = getNearestGunPlacement(guns, _local4, _local2);
if (_local3 == null) {
return(undefined);
}
fireGun(_local3, _local4, _local2);
}
function fireGun(gun, destX, destY) {
gun.fire();
sm.playSound("firemissile_snd", SFX_VOLUME);
var _local2 = addMovieClip("missile", gun.getGunX(), gun.getGunY());
missiles.push(new game.Missile(_local2, destX, destY));
}
function explodeMissile(missile) {
missile.dispose();
sm.playSound("missileexplode_snd", SFX_VOLUME);
var _local2 = addMovieClip("explosion", missile.x, missile.y);
explosions.push(new game.Explosion(_local2));
}
function addHuman() {
var _local2 = ((Math.random() < 0.5) ? 1 : 2);
var _local3 = addMovieClip("human_" + _local2, GAME_BORDER + Math.floor(Math.random() * GAME_WIDTH), GROUND_LEVEL);
humans.push(new game.Human(_local3, _local2));
}
function killHuman(tripod, human) {
tripod.fire();
tripod.shootingAt = human;
human.beingShotAt = tripod;
var _local4 = addEmptyMovieClip("laser", 0, 0);
tripodLasers.push(new game.TripodLaser(_local4, tripod, human));
sm.playSound("heatray_snd", SFX_VOLUME + 20);
}
function finishedKillingHuman(tripodLaser) {
tripodLaser.dispose();
tripodLaser.tripod.shootingAt = null;
tripodLaser.tripod.kills++;
tripodLaser.human.beingShotAt = null;
tripodLaser.human.dead = true;
}
function killTripod(human, tripod) {
human.fire(uk.kerb.utils.EventDelegate.create(this, fireBullet, human, tripod));
human.shootingAt = tripod;
tripod.beingShotAt = human;
}
function fireBullet(human, tripod) {
var _local3 = addMovieClip("bullet", human.getGunX(), human.getGunY());
bullets.push(new game.Bullet(_local3, human, tripod));
sm.playSound("firebullet_snd", SFX_VOLUME);
}
function explodeBullet(bullet) {
bullet.dispose();
bullet.human.shootingAt = null;
bullet.human.kills++;
bullet.tripod.beingShotAt = null;
bullet.tripod.dead = true;
}
function killUFO(ufo) {
ufo.dispose();
aliensLeft--;
sm.playSound("killufo_snd", SFX_VOLUME);
var _local2 = addMovieClip("ufo_explode", ufo.x, ufo.y);
animations.push(new game.Animation(_local2));
}
function tripodIsDead(tripod) {
tripod.dispose();
aliensLeft--;
sm.playSound("killtripod_snd", SFX_VOLUME);
var _local2 = addMovieClip("tripod_explode", tripod.x, tripod.y);
animations.push(new game.Animation(_local2));
}
function humanIsDead(human) {
human.dispose();
var _local3 = addMovieClip(("human_" + human.humanType) + "_explode", human.x, human.y);
if (human.dx < 0) {
_local3._xscale = -100;
}
sm.playSound(("humandie_" + human.humanType) + "_snd", SFX_VOLUME);
var _local4 = new game.Animation(_local3);
_local4.dx = human.dx;
animations.push(_local4);
}
function ufoArrive(ufo) {
ufo.dispose();
var _local4 = addMovieClip("ufo_arrive", ufo.x, ufo.y);
var _local3 = new game.Animation(_local4);
sm.playSound("thud_snd", SFX_VOLUME);
_local3.onFinished = uk.kerb.utils.EventDelegate.create(this, addTripod, ufo.x, ufo.y);
animations.push(_local3);
}
function addTripod(x, y) {
var _local2 = addMovieClip("tripod", x, y);
tripods.push(new game.Tripod(_local2));
}
function addUFO() {
ufosArrived++;
timeSinceLastUFO = 0;
sm.playSound("ufo_snd", SFX_VOLUME);
var _local2 = addMovieClip("ufo", GAME_BORDER + Math.floor(Math.random() * GAME_WIDTH), 0);
ufos.push(new game.UFO(_local2, GAME_BORDER + Math.floor(Math.random() * GAME_WIDTH), GROUND_LEVEL - 10));
}
function addMovieClip(linkage, x, y) {
var _local3 = mc.gameassets_mc.getNextHighestDepth();
var _local2 = mc.gameassets_mc.attachMovie(linkage, (linkage + "_") + _local3, _local3);
_local2._x = x;
_local2._y = y;
return(_local2);
}
function addEmptyMovieClip(linkage, x, y) {
var _local3 = mc.getNextHighestDepth();
var _local2 = mc.createEmptyMovieClip((linkage + "_") + _local3, _local3);
_local2._x = x;
_local2._y = y;
return(_local2);
}
function getNearestGunPlacement(array, x, y) {
var _local7 = null;
var _local5 = -1;
var _local2;
var _local4;
var _local3;
_local3 = 0;
while (_local3 < array.length) {
_local2 = game.GunPlacement(array[_local3]);
if (_local2.canFire()) {
_local4 = getDistanceSquared(x, y, _local2.x, _local2.y);
if (((_local5 < 0) || (_local4 < _local5)) && (_local4 > (_local2.FIRING_DISTANCE * _local2.FIRING_DISTANCE))) {
_local5 = _local4;
_local7 = _local2;
}
}
_local3++;
}
return(_local7);
}
function getDistanceSquared(x1, y1, x2, y2) {
return(((x1 - x2) * (x1 - x2)) + ((y1 - y2) * (y1 - y2)));
}
function dispose() {
var _local2;
_local2 = bullets.length - 1;
while (_local2 >= 0) {
bullets[_local2].dispose();
_local2--;
}
_local2 = explosions.length - 1;
while (_local2 >= 0) {
explosions[_local2].dispose();
_local2--;
}
_local2 = guns.length - 1;
while (_local2 >= 0) {
guns[_local2].dispose();
_local2--;
}
_local2 = tripods.length - 1;
while (_local2 >= 0) {
tripods[_local2].dispose();
_local2--;
}
_local2 = humans.length - 1;
while (_local2 >= 0) {
humans[_local2].dispose();
_local2--;
}
_local2 = ufos.length - 1;
while (_local2 >= 0) {
ufos[_local2].dispose();
_local2--;
}
_local2 = tripodLasers.length - 1;
while (_local2 >= 0) {
tripodLasers[_local2].dispose();
_local2--;
}
_local2 = missiles.length - 1;
while (_local2 >= 0) {
missiles[_local2].dispose();
_local2--;
}
_local2 = animations.length - 1;
while (_local2 >= 0) {
animations[_local2].dispose();
_local2--;
}
guns = new Array();
ufos = new Array();
tripods = new Array();
humans = new Array();
bullets = new Array();
tripodLasers = new Array();
missiles = new Array();
explosions = new Array();
animations = new Array();
}
function lose() {
trace("lose");
stopGame();
sm.stopSound(("*game" + main.Main.GAME_LEVEL) + "_music", 2);
mc.back_mc.gotoAndStop(mc.back_mc._totalframes);
main.Main.GAME_LEVEL = 1;
gameOver_func();
}
function win() {
trace("win");
stopGame();
sm.stopSound(("*game" + main.Main.GAME_LEVEL) + "_music", 2);
if (main.Main.GAME_LEVEL < 5) {
main.Main.GAME_LEVEL++;
nextLevel_func();
} else {
main.Main.GAME_LEVEL = 1;
gameFinished_func();
}
}
static var GAME_BORDER = 25;
static var SFX_VOLUME = 70;
var guns = new Array();
var ufos = new Array();
var tripods = new Array();
var humans = new Array();
var missiles = new Array();
var bullets = new Array();
var tripodLasers = new Array();
var explosions = new Array();
var animations = new Array();
var tripodsToFire = new Array();
var humansToFire = new Array();
var LEVEL_EVENTS = new Array(30, 31, 32, 45, 46);
}
Symbol 653 MovieClip [__Packages.game.GameObject] Frame 0
class game.GameObject
{
var mc, x, y;
function GameObject (_mc) {
mc = _mc;
x = mc._x;
y = mc._y;
}
function update() {
}
function dispose() {
mc.removeMovieClip();
}
}
Symbol 654 MovieClip [__Packages.game.FiringObject] Frame 0
class game.FiringObject extends game.GameObject
{
var firingTimer;
function FiringObject (_mc) {
super(_mc);
firingTimer = 0;
}
function canFire() {
return(firingTimer == 0);
}
function fire() {
firingTimer = 0;
}
function update() {
if (firingTimer > 0) {
firingTimer--;
}
}
}
Symbol 655 MovieClip [__Packages.game.GunPlacement] Frame 0
class game.GunPlacement extends game.FiringObject
{
var firingTimer, mouseAngle, mc, canFire, x, y;
function GunPlacement (_mc) {
super(_mc);
}
function fire() {
firingTimer = game.Game.GUN_FIRING_DELAY;
}
function updateMousePosition() {
mouseAngle = Math.atan2(mc._ymouse, mc._xmouse) / Math.PI;
if (mouseAngle > 0) {
if (mouseAngle > 0.5) {
mouseAngle = -1;
} else {
mouseAngle = 0;
}
}
mc.barrel_mc._rotation = (mouseAngle + 0.5) * 180;
}
function update() {
super.update();
if (canFire()) {
mc.barrel_mc.gotoAndStop("ready");
} else {
mc.barrel_mc.gotoAndStop("firing");
}
}
function getGunX() {
return(x - (FIRING_DISTANCE * Math.sin((mouseAngle + 0.5) * Math.PI)));
}
function getGunY() {
return(y - (FIRING_DISTANCE * Math.cos((mouseAngle + 0.5) * Math.PI)));
}
var FIRING_DISTANCE = 50;
}
Symbol 656 MovieClip [__Packages.game.ReversedGunPlacement] Frame 0
class game.ReversedGunPlacement extends game.GunPlacement
{
var mouseAngle, FIRING_DISTANCE, x, y;
function ReversedGunPlacement (_mc) {
super(_mc);
}
function getGunX() {
return(x + (FIRING_DISTANCE * Math.sin((mouseAngle + 0.5) * Math.PI)));
}
function getGunY() {
return(y - (FIRING_DISTANCE * Math.cos((mouseAngle + 0.5) * Math.PI)));
}
}
Symbol 657 MovieClip [__Packages.game.Bullet] Frame 0
class game.Bullet extends game.GameObject
{
var destX, destY, human, tripod, y, x, dx, dy, mc;
function Bullet (_mc, human, tripod) {
super(_mc);
destX = tripod.getHeadX();
destY = tripod.getHeadY();
this.human = human;
this.tripod = tripod;
var _local3 = Math.atan2(destY - y, destX - x);
dx = SPEED * Math.cos(_local3);
dy = SPEED * Math.sin(_local3);
mc._rotation = 90 + ((_local3 * 180) / Math.PI);
}
function update() {
if ((((destX - x) * (destX - (x + dx))) <= 0) && (((destY - y) * (destY - (y + dy))) <= 0)) {
x = destX;
y = destY;
} else {
x = x + dx;
y = y + dy;
}
mc._x = x;
mc._y = y;
}
function hasArrived() {
return((x == destX) && (y == destY));
}
var SPEED = 5;
}
Symbol 658 MovieClip [__Packages.game.Human] Frame 0
class game.Human extends game.FiringObject
{
var humanType, dx, kills, dead, beingShotAt, shootingAt, mc, x, y, firingTimer;
function Human (_mc, humanType) {
super(_mc);
this.humanType = humanType;
dx = 0;
kills = 0;
dead = false;
beingShotAt = null;
shootingAt = null;
}
function getHeadX() {
return(x + mc.head_mc._x);
}
function getHeadY() {
return(y + mc.head_mc._y);
}
function getGunX() {
return(x + mc.gun_mc._x);
}
function getGunY() {
return(y + mc.gun_mc._y);
}
function update() {
super.update();
var _local3 = 0;
if (shootingAt != null) {
dx = 0;
if (shootingAt.x < x) {
_local3 = -1;
} else {
_local3 = 1;
}
} else {
dx = dx + (((Math.random() * 2) * SPEED_CHANGE) - SPEED_CHANGE);
if (dx < (-MAX_SPEED)) {
dx = -MAX_SPEED;
}
if (dx > MAX_SPEED) {
dx = MAX_SPEED;
}
if (beingShotAt != null) {
dx = dx * 2;
}
if (Math.abs(dx) > 0.2) {
_local3 = dx;
}
x = x + _local3;
if ((x < game.Game.GAME_BORDER) || (x > (game.Game.GAME_WIDTH + game.Game.GAME_BORDER))) {
x = x - _local3;
dx = -dx;
}
}
if (_local3 > 0) {
mc._xscale = 100;
} else if (_local3 < 0) {
mc._xscale = -100;
}
if (shootingAt != null) {
mc.gotoAndStop("shoot");
} else if (Math.abs(_local3) > 0) {
if (beingShotAt != null) {
mc.gotoAndStop("run");
} else {
mc.gotoAndStop("walk");
}
} else {
mc.gotoAndStop("stand");
}
mc._x = x;
}
function fire(fireBullet_func) {
mc.gotoAndStop("shoot");
mc.human_mc.fireBullet = fireBullet_func;
mc.human_mc.finishedFiring = uk.kerb.utils.EventDelegate.create(this, finishedFiring);
firingTimer = game.Game.HUMAN_FIRING_DELAY;
}
function finishedFiring() {
shootingAt = null;
}
function canFire() {
return((((!dead) && (shootingAt == null)) && (beingShotAt == null)) && (super.canFire()));
}
function canBeKilled() {
return(((!dead) && (shootingAt == null)) && (beingShotAt == null));
}
function canShootAt(go) {
return(Math.abs(x - go.x) < FIRING_DISTANCE);
}
var FIRING_DISTANCE = 50;
var SPEED_CHANGE = 0.25;
var MAX_SPEED = 2;
}
Symbol 659 MovieClip [__Packages.game.Tripod] Frame 0
class game.Tripod extends game.FiringObject
{
var dx, kills, dead, beingShotAt, shootingAt, firingTimer, mc, x, y;
function Tripod (_mc) {
super(_mc);
dx = ((Math.random() < 0.5) ? (SPEED) : (-SPEED));
kills = 0;
dead = false;
beingShotAt = null;
shootingAt = null;
}
function fire() {
firingTimer = game.Game.TRIPOD_FIRING_DELAY;
}
function getHeadX() {
return(x + mc.head_mc._x);
}
function getHeadY() {
return(y + mc.head_mc._y);
}
function getGunX() {
return(x + mc.gun_mc._x);
}
function getGunY() {
return(y + mc.gun_mc._y);
}
function update() {
super.update();
if (beingShotAt != null) {
dx = 0;
} else {
x = x + dx;
if ((x < game.Game.GAME_BORDER) || (x > (game.Game.GAME_WIDTH + game.Game.GAME_BORDER))) {
x = x - dx;
dx = -dx;
}
}
if (dx < 0) {
mc.gotoAndStop("left");
} else if (dx == 0) {
mc.gotoAndStop("stand");
} else {
mc.gotoAndStop("right");
}
mc._x = x;
}
function canFire() {
return(((((kills < MAX_KILLS) && (!dead)) && (shootingAt == null)) && (beingShotAt == null)) && (super.canFire()));
}
function canBeKilled() {
return((((kills >= MAX_KILLS) && (!dead)) && (shootingAt == null)) && (beingShotAt == null));
}
function canShootAt(go) {
return(Math.abs(x - go.x) < FIRING_DISTANCE);
}
var FIRING_DISTANCE = 50;
var MAX_KILLS = 2;
var SPEED = 1.5;
}
Symbol 660 MovieClip [__Packages.game.Missile] Frame 0
class game.Missile extends game.GameObject
{
var destX, destY, y, x, dx, dy, mc;
function Missile (_mc, destX, destY) {
super(_mc);
this.destX = destX;
this.destY = destY;
var _local3 = Math.atan2(destY - y, destX - x);
dx = game.Game.MISSILE_SPEED * Math.cos(_local3);
dy = game.Game.MISSILE_SPEED * Math.sin(_local3);
mc._rotation = 90 + ((_local3 * 180) / Math.PI);
}
function update() {
if ((((destX - x) * (destX - (x + dx))) <= 0) && (((destY - y) * (destY - (y + dy))) <= 0)) {
x = destX;
y = destY;
} else {
x = x + dx;
y = y + dy;
}
mc._x = x;
mc._y = y;
}
function hasArrived() {
return((x == destX) && (y == destY));
}
}
Symbol 661 MovieClip [__Packages.game.Explosion] Frame 0
class game.Explosion extends game.GameObject
{
var lifeTime, y, x;
function Explosion (_mc) {
super(_mc);
lifeTime = LIFETIME;
}
function update() {
if (lifeTime > 0) {
lifeTime--;
}
}
function inExplosion(go) {
return((((x - go.x) * (x - go.x)) + ((y - go.y) * (y - go.y))) < (RADIUS * RADIUS));
}
function hasFinished() {
return(lifeTime == 0);
}
var LIFETIME = 30;
var RADIUS = 40;
}
Symbol 662 MovieClip [__Packages.game.UFO] Frame 0
class game.UFO extends game.GameObject
{
var destX, destY, y, x, dx, dy, mc;
function UFO (_mc, destX, destY) {
super(_mc);
this.destX = destX;
this.destY = destY;
var _local3 = Math.atan2(destY - y, destX - x);
dx = game.Game.UFO_SPEED * Math.cos(_local3);
dy = game.Game.UFO_SPEED * Math.sin(_local3);
}
function update() {
if ((((destX - x) * (destX - (x + dx))) <= 0) && (((destY - y) * (destY - (y + dy))) <= 0)) {
x = destX;
y = destY;
} else {
x = x + dx;
y = y + dy;
}
mc._x = x;
mc._y = y;
}
function hasArrived() {
return((x == destX) && (y == destY));
}
}
Symbol 663 MovieClip [__Packages.game.TripodLaser] Frame 0
class game.TripodLaser extends game.GameObject
{
var tripod, human, lifeTime, mc;
function TripodLaser (_mc, tripod, human) {
super(_mc);
this.tripod = tripod;
this.human = human;
lifeTime = LIFETIME;
}
function update() {
if (lifeTime > 0) {
lifeTime--;
}
mc.clear();
mc.lineStyle(4, 16744448, Math.floor(((LIFETIME - lifeTime) * 100) / LIFETIME));
mc.moveTo(tripod.getGunX(), tripod.getGunY());
mc.lineTo(human.getHeadX(), human.getHeadY());
mc.lineStyle(2, 16777215, Math.floor(((LIFETIME - lifeTime) * 100) / LIFETIME));
mc.moveTo(tripod.getGunX(), tripod.getGunY());
mc.lineTo(human.getHeadX(), human.getHeadY());
}
function hasFinished() {
return(((lifeTime == 0) || (human.dead)) || (tripod.dead));
}
var LIFETIME = 15;
}
Symbol 664 MovieClip [__Packages.game.Animation] Frame 0
class game.Animation extends game.GameObject
{
var mc, x, finished;
function Animation (_mc) {
super(_mc);
mc.animationComplete = uk.kerb.utils.EventDelegate.create(this, onAnimationComplete);
}
function update() {
super.update();
x = x + dx;
mc._x = x;
}
function onAnimationComplete() {
finished = true;
if (onFinished != null) {
onFinished();
}
}
function hasFinished() {
return(finished);
}
var onFinished = null;
var dx = 0;
}
Symbol 665 MovieClip [__Packages.main.NextLevel] Frame 0
class main.NextLevel extends main.AbstractSection implements main.ISection
{
var sm, play_func, active, mc, dispatchEvent, introCompleteHandler, outroCompleteHandler;
function NextLevel (mc, sm) {
super(mc);
this.sm = sm;
var _local3 = new utils.SectionEvent(main.Main.SECTION_GAME);
play_func = uk.kerb.utils.EventDelegate.create(this, buttonPressed, _local3);
}
function init() {
if (!active) {
mc.play_btn.onRelease = play_func;
active = true;
}
dispatchEvent({type:"onSetKeyBinding", target:this, key:32, action:play_func});
}
function buttonPressed(evt) {
sm.playSound("button_snd");
dispatchEvent(evt);
}
function playIntro() {
mc.introAnimation_mc.animationComplete = introCompleteHandler;
uk.kerb.utils.SetOneInterval.create(10, uk.kerb.utils.EventDelegate.create(mc.introAnimation_mc, mc.introAnimation_mc.gotoAndPlay, 2));
mc.play_btn._visible = false;
mc.introAnimation_mc._visible = true;
mc.outroAnimation_mc._visible = false;
sm.playSound("whirr_snd", 100, 10000, 2);
sm.playSound("*intro_music", 100, 10000, 2);
}
function onIntroComplete() {
mc.play_btn._visible = true;
mc.introAnimation_mc.frame_mc.visitwebsite_btn.onRelease = uk.kerb.utils.EventDelegate.create(this, clickThrough);
super.onIntroComplete();
}
function playOutro() {
mc.play_btn._visible = false;
mc.introAnimation_mc._visible = false;
mc.outroAnimation_mc._visible = true;
mc.outroAnimation_mc.animationComplete = outroCompleteHandler;
mc.outroAnimation_mc.gotoAndPlay(2);
sm.stopSound("whirr_snd", 2);
sm.stopSound("*intro_music", 2);
}
function clickThrough() {
uk.kerb.tracking.DoubleQuick.click(34);
}
}
Symbol 666 MovieClip [__Packages.main.GameOver] Frame 0
class main.GameOver extends main.AbstractSection implements main.ISection
{
var sm, play_func, dispatchEvent, active, mc, introCompleteHandler, outroCompleteHandler;
function GameOver (mc, sm) {
super(mc);
this.sm = sm;
var _local3 = new utils.SectionEvent(main.Main.SECTION_GAME);
play_func = uk.kerb.utils.EventDelegate.create(this, buttonPressed, _local3);
}
function buttonPressed(evt) {
sm.playSound("button_snd");
dispatchEvent(evt);
}
function init() {
if (!active) {
mc.play_btn.onRelease = play_func;
active = true;
}
dispatchEvent({type:"onSetKeyBinding", target:this, key:32, action:play_func});
}
function playIntro() {
mc.introAnimation_mc.animationComplete = introCompleteHandler;
uk.kerb.utils.SetOneInterval.create(10, uk.kerb.utils.EventDelegate.create(mc.introAnimation_mc, mc.introAnimation_mc.gotoAndPlay, 2));
mc.play_btn._visible = false;
mc.introAnimation_mc._visible = true;
mc.outroAnimation_mc._visible = false;
sm.playSound("whirr_snd", 100, 10000, 2);
sm.playSound("*intro_music", 100, 10000, 2);
}
function onIntroComplete() {
mc.play_btn._visible = true;
mc.introAnimation_mc.frame_mc.visitwebsite_btn.onRelease = uk.kerb.utils.EventDelegate.create(this, clickThrough);
super.onIntroComplete();
}
function playOutro() {
mc.play_btn._visible = false;
mc.introAnimation_mc._visible = false;
mc.outroAnimation_mc._visible = true;
mc.outroAnimation_mc.animationComplete = outroCompleteHandler;
mc.outroAnimation_mc.gotoAndPlay(2);
sm.stopSound("whirr_snd", 2);
sm.stopSound("*intro_music", 2);
}
function clickThrough() {
uk.kerb.tracking.DoubleQuick.click(36);
}
}
Symbol 667 MovieClip [__Packages.main.GameFinished] Frame 0
class main.GameFinished extends main.AbstractSection implements main.ISection
{
var sm, play_func, dispatchEvent, active, mc, introCompleteHandler, outroCompleteHandler;
function GameFinished (mc, sm) {
super(mc);
this.sm = sm;
var _local3 = new utils.SectionEvent(main.Main.SECTION_GAME);
play_func = uk.kerb.utils.EventDelegate.create(this, buttonPressed, _local3);
}
function buttonPressed(evt) {
sm.playSound("button_snd");
dispatchEvent(evt);
}
function init() {
if (!active) {
mc.play_btn.onRelease = play_func;
active = true;
}
dispatchEvent({type:"onSetKeyBinding", target:this, key:32, action:play_func});
}
function playIntro() {
mc.introAnimation_mc.animationComplete = introCompleteHandler;
uk.kerb.utils.SetOneInterval.create(10, uk.kerb.utils.EventDelegate.create(mc.introAnimation_mc, mc.introAnimation_mc.gotoAndPlay, 2));
mc.play_btn._visible = false;
mc.introAnimation_mc._visible = true;
mc.outroAnimation_mc._visible = false;
sm.playSound("whirr_snd", 100, 10000, 2);
sm.playSound("*intro_music", 100, 10000, 2);
}
function onIntroComplete() {
mc.play_btn._visible = true;
mc.introAnimation_mc.frame_mc.visitwebsite_btn.onRelease = uk.kerb.utils.EventDelegate.create(this, clickThrough);
super.onIntroComplete();
}
function playOutro() {
mc.play_btn._visible = false;
mc.introAnimation_mc._visible = false;
mc.outroAnimation_mc._visible = true;
mc.outroAnimation_mc.animationComplete = outroCompleteHandler;
mc.outroAnimation_mc.gotoAndPlay(2);
sm.stopSound("whirr_snd", 2);
sm.stopSound("*intro_music", 2);
}
function clickThrough() {
uk.kerb.tracking.DoubleQuick.click(35);
}
}
Symbol 139 MovieClip Frame 19
introAnimationComplete();
Symbol 139 MovieClip Frame 136
stop();
outroAnimationComplete();
Symbol 222 MovieClip Frame 150
stop();
animationComplete();
Symbol 223 Button
on (release) {
uk.kerb.tracking.DoubleQuick.click(33);
}
Symbol 239 MovieClip [explosion] Frame 35
stop();
Symbol 263 MovieClip [ufo_explode] Frame 26
stop();
animationComplete();
Symbol 280 MovieClip [ufo_arrive] Frame 30
stop();
animationComplete();
Symbol 281 MovieClip [tripod_explode] Frame 24
stop();
animationComplete();
Symbol 297 MovieClip Frame 22
fireBullet();
Symbol 297 MovieClip Frame 60
finishedFiring();
Symbol 300 MovieClip [human_1] Frame 1
stop();
Symbol 337 MovieClip [human_1_explode] Frame 35
stop();
animationComplete();
Symbol 372 MovieClip [human_2_explode] Frame 35
stop();
animationComplete();
Symbol 383 MovieClip Frame 22
fireBullet();
Symbol 383 MovieClip Frame 60
finishedFiring();
Symbol 392 MovieClip [human_2] Frame 1
stop();
Symbol 417 MovieClip Frame 1
stop();
Symbol 427 MovieClip Frame 1
stop();
Symbol 441 MovieClip Frame 10
stop();
Symbol 442 MovieClip Frame 1
stop();
Symbol 476 MovieClip Frame 20
stop();
Symbol 486 MovieClip Frame 20
stop();
Symbol 487 MovieClip Frame 1
stop();
Symbol 494 MovieClip Frame 1
arrivedAt(9);
Symbol 494 MovieClip Frame 11
arrivedAt(8);
Symbol 494 MovieClip Frame 21
arrivedAt(7);
Symbol 494 MovieClip Frame 31
arrivedAt(6);
Symbol 494 MovieClip Frame 41
arrivedAt(5);
Symbol 494 MovieClip Frame 51
arrivedAt(4);
Symbol 494 MovieClip Frame 61
arrivedAt(3);
Symbol 494 MovieClip Frame 71
arrivedAt(2);
Symbol 494 MovieClip Frame 81
arrivedAt(1);
Symbol 494 MovieClip Frame 91
arrivedAt(0);
Symbol 494 MovieClip Frame 101
gotoAndPlay (1);
Symbol 514 MovieClip Frame 1
stop();
Symbol 514 MovieClip Frame 2
_root.sm.playSound("apetureclose_snd");
Symbol 514 MovieClip Frame 26
stop();
animationComplete();
Symbol 516 MovieClip Frame 1
stop();
Symbol 516 MovieClip Frame 2
_root.sm.playSound("apetureopen_snd");
Symbol 516 MovieClip Frame 60
stop();
animationComplete();
Symbol 517 MovieClip Frame 2
stop();
Symbol 574 MovieClip Frame 1
stop();
Symbol 575 MovieClip Frame 1
stop();
Symbol 575 MovieClip Frame 39
_root.sm.playSound("apetureclose_snd");
Symbol 575 MovieClip Frame 64
stop();
animationComplete();
Symbol 583 MovieClip Frame 1
stop();
Symbol 583 MovieClip Frame 2
_root.sm.playSound("apetureopen_snd");
Symbol 583 MovieClip Frame 103
stop();
animationComplete();
Symbol 584 MovieClip Frame 2
stop();
Symbol 592 MovieClip Frame 1
stop();
Symbol 597 MovieClip Frame 1
stop();
Symbol 598 MovieClip Frame 1
stop();
Symbol 598 MovieClip Frame 39
_root.sm.playSound("apetureclose_snd");
Symbol 598 MovieClip Frame 64
stop();
animationComplete();
Symbol 599 MovieClip Frame 1
stop();
Symbol 599 MovieClip Frame 2
_root.sm.playSound("apetureopen_snd");
Symbol 599 MovieClip Frame 107
stop();
animationComplete();
Symbol 600 MovieClip Frame 2
stop();
Symbol 605 MovieClip Frame 1
stop();
Symbol 605 MovieClip Frame 39
_root.sm.playSound("apetureclose_snd");
Symbol 605 MovieClip Frame 64
stop();
animationComplete();
Symbol 606 MovieClip Frame 1
stop();
Symbol 606 MovieClip Frame 2
_root.sm.playSound("apetureopen_snd");
Symbol 606 MovieClip Frame 108
stop();
animationComplete();
Symbol 607 MovieClip Frame 2
stop();
Symbol 618 MovieClip Frame 1
stop();
Symbol 619 MovieClip Frame 1
stop();
Symbol 619 MovieClip Frame 39
_root.sm.playSound("apetureclose_snd");
Symbol 619 MovieClip Frame 64
stop();
animationComplete();
Symbol 620 MovieClip Frame 1
stop();
Symbol 620 MovieClip Frame 2
_root.sm.playSound("apetureopen_snd");
Symbol 620 MovieClip Frame 109
stop();
animationComplete();
Symbol 621 MovieClip Frame 2
stop();
Symbol 630 MovieClip Frame 1
stop();
Symbol 631 MovieClip Frame 1
stop();
Symbol 631 MovieClip Frame 13
_root.sm.playSound("apetureclose_snd");
Symbol 631 MovieClip Frame 37
stop();
animationComplete();
Symbol 632 MovieClip Frame 1
stop();
Symbol 632 MovieClip Frame 12
stop();
animationComplete();
Symbol 633 MovieClip Frame 2
stop();
Symbol 634 MovieClip Frame 1
main.Main.getInstance().init(this);